@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.
Files changed (138) hide show
  1. package/CHANGELOG.md +140 -0
  2. package/README.md +10 -1
  3. package/dist/components/App.svelte +219 -6
  4. package/dist/components/App.svelte.d.ts +8 -0
  5. package/dist/components/CanvasToolbar.svelte +40 -3
  6. package/dist/components/CanvasToolbar.svelte.d.ts +5 -1
  7. package/dist/components/ConnectPortPicker.svelte +8 -4
  8. package/dist/components/DoctorMenu.svelte +208 -126
  9. package/dist/components/ImpactConfirm.svelte +341 -0
  10. package/dist/components/ImpactConfirm.svelte.d.ts +12 -0
  11. package/dist/components/Input.svelte +2 -2
  12. package/dist/components/Navbar.svelte +48 -3
  13. package/dist/components/Navbar.svelte.d.ts +4 -0
  14. package/dist/components/NodeSidebar.svelte +36 -15
  15. package/dist/components/NodeSidebar.svelte.d.ts +2 -0
  16. package/dist/components/NodeSwapPicker.svelte +4 -14
  17. package/dist/components/RunBar.svelte +36 -1
  18. package/dist/components/RunBar.svelte.d.ts +5 -0
  19. package/dist/components/RunInputsDialog.svelte +198 -0
  20. package/dist/components/RunInputsDialog.svelte.d.ts +34 -0
  21. package/dist/components/SchemaForm.svelte +2 -1
  22. package/dist/components/SchemaForm.svelte.d.ts +2 -1
  23. package/dist/components/WorkflowCompareDialog.svelte +177 -0
  24. package/dist/components/WorkflowCompareDialog.svelte.d.ts +10 -0
  25. package/dist/components/WorkflowEditor.svelte +88 -6
  26. package/dist/components/WorkflowEditor.svelte.d.ts +6 -0
  27. package/dist/components/WorkflowInterfaceEditor.svelte +14 -4
  28. package/dist/components/WorkflowInterfaceEntryCard.svelte +19 -3
  29. package/dist/components/WorkflowInterfaceEntryCard.svelte.d.ts +2 -0
  30. package/dist/components/form/FormAutocomplete.svelte +76 -12
  31. package/dist/components/nodes/NodeCard.svelte +2 -2
  32. package/dist/components/primitives/Button.svelte +1 -1
  33. package/dist/components/primitives/Button.svelte.d.ts +1 -1
  34. package/dist/components/primitives/Card.svelte +1 -1
  35. package/dist/components/primitives/Card.svelte.d.ts +1 -1
  36. package/dist/components/primitives/Checkbox.svelte +1 -1
  37. package/dist/components/primitives/Checkbox.svelte.d.ts +1 -1
  38. package/dist/components/primitives/Chip.svelte +1 -1
  39. package/dist/components/primitives/Chip.svelte.d.ts +1 -1
  40. package/dist/components/primitives/Combobox.svelte +1 -1
  41. package/dist/components/primitives/Combobox.svelte.d.ts +1 -1
  42. package/dist/components/primitives/Composer.svelte +1 -1
  43. package/dist/components/primitives/Composer.svelte.d.ts +1 -1
  44. package/dist/components/primitives/EmptyState.svelte +1 -1
  45. package/dist/components/primitives/EmptyState.svelte.d.ts +1 -1
  46. package/dist/components/primitives/Field.svelte +1 -1
  47. package/dist/components/primitives/Field.svelte.d.ts +1 -1
  48. package/dist/components/primitives/IconButton.svelte +1 -1
  49. package/dist/components/primitives/IconButton.svelte.d.ts +1 -1
  50. package/dist/components/primitives/Menu.svelte +1 -1
  51. package/dist/components/primitives/Menu.svelte.d.ts +1 -1
  52. package/dist/components/primitives/Notice.svelte +1 -1
  53. package/dist/components/primitives/Notice.svelte.d.ts +1 -1
  54. package/dist/components/primitives/PanelHeader.svelte +1 -1
  55. package/dist/components/primitives/PanelHeader.svelte.d.ts +1 -1
  56. package/dist/components/primitives/Segmented.svelte +2 -2
  57. package/dist/components/primitives/Segmented.svelte.d.ts +2 -2
  58. package/dist/components/primitives/Select.svelte +1 -1
  59. package/dist/components/primitives/Select.svelte.d.ts +1 -1
  60. package/dist/components/primitives/StatusPill.svelte +1 -1
  61. package/dist/components/primitives/StatusPill.svelte.d.ts +1 -1
  62. package/dist/components/primitives/Switch.svelte +1 -1
  63. package/dist/components/primitives/Switch.svelte.d.ts +1 -1
  64. package/dist/components/primitives/Tabs.svelte +2 -2
  65. package/dist/components/primitives/Tabs.svelte.d.ts +2 -2
  66. package/dist/components/primitives/Toolbar.svelte +1 -1
  67. package/dist/components/primitives/Toolbar.svelte.d.ts +1 -1
  68. package/dist/components/primitives/ToolbarSeparator.svelte +1 -1
  69. package/dist/components/primitives/ToolbarSeparator.svelte.d.ts +1 -1
  70. package/dist/components/toast/DismissibleToast.svelte +25 -6
  71. package/dist/components/toast/DismissibleToast.svelte.d.ts +3 -0
  72. package/dist/config/endpoints.d.ts +7 -0
  73. package/dist/config/endpoints.js +2 -1
  74. package/dist/editor/connectCandidates.d.ts +3 -0
  75. package/dist/editor/connectCandidates.js +14 -5
  76. package/dist/editor/index.d.ts +1 -1
  77. package/dist/editor/index.js +1 -1
  78. package/dist/helpers/workflowEditorHelper.d.ts +15 -0
  79. package/dist/helpers/workflowEditorHelper.js +9 -0
  80. package/dist/index.d.ts +1 -0
  81. package/dist/messages/defaults.d.ts +101 -0
  82. package/dist/messages/defaults.js +92 -1
  83. package/dist/openapi/v1/openapi.yaml +10 -2
  84. package/dist/schemas/v1/workflow.schema.json +1 -1
  85. package/dist/services/draftStorage.d.ts +24 -10
  86. package/dist/services/draftStorage.js +60 -35
  87. package/dist/services/globalSave.d.ts +28 -10
  88. package/dist/services/globalSave.js +135 -31
  89. package/dist/services/impactGate.d.ts +34 -0
  90. package/dist/services/impactGate.js +70 -0
  91. package/dist/services/impactService.d.ts +28 -0
  92. package/dist/services/impactService.js +71 -0
  93. package/dist/services/toastQueue.d.ts +9 -0
  94. package/dist/services/toastService.d.ts +4 -0
  95. package/dist/services/toastService.js +9 -3
  96. package/dist/services/workflowLaunchService.js +3 -1
  97. package/dist/settings/index.d.ts +2 -2
  98. package/dist/settings/index.js +1 -1
  99. package/dist/stores/doctorStore.svelte.d.ts +24 -1
  100. package/dist/stores/doctorStore.svelte.js +105 -2
  101. package/dist/stores/instanceContainer.svelte.d.ts +16 -0
  102. package/dist/stores/instanceContainer.svelte.js +22 -2
  103. package/dist/stores/saveConflictStore.svelte.d.ts +62 -0
  104. package/dist/stores/saveConflictStore.svelte.js +169 -0
  105. package/dist/stores/workflowStore.svelte.d.ts +7 -3
  106. package/dist/stores/workflowStore.svelte.js +14 -5
  107. package/dist/styles/toast.css +10 -1
  108. package/dist/svelte-app.d.ts +23 -0
  109. package/dist/svelte-app.js +114 -3
  110. package/dist/themes/scopedSkinCss.d.ts +22 -0
  111. package/dist/themes/scopedSkinCss.js +27 -1
  112. package/dist/types/doctor.d.ts +3 -1
  113. package/dist/types/events.d.ts +20 -0
  114. package/dist/types/events.js +2 -0
  115. package/dist/types/impact.d.ts +25 -0
  116. package/dist/types/impact.js +7 -0
  117. package/dist/types/index.d.ts +11 -1
  118. package/dist/types/settings.d.ts +31 -0
  119. package/dist/types/settings.js +132 -0
  120. package/dist/ui/index.d.ts +76 -0
  121. package/dist/ui/index.js +81 -0
  122. package/dist/utils/apiUrl.d.ts +55 -0
  123. package/dist/utils/apiUrl.js +117 -0
  124. package/dist/utils/draftRestore.d.ts +27 -0
  125. package/dist/utils/draftRestore.js +36 -0
  126. package/dist/utils/interfaceTags.js +4 -1
  127. package/dist/utils/nodeSearch.d.ts +10 -0
  128. package/dist/utils/nodeSearch.js +37 -0
  129. package/dist/utils/portal.js +45 -3
  130. package/dist/utils/runOffer.d.ts +21 -0
  131. package/dist/utils/runOffer.js +13 -0
  132. package/dist/utils/workflowCompare.d.ts +35 -0
  133. package/dist/utils/workflowCompare.js +84 -0
  134. package/dist/utils/workflowInterface.d.ts +26 -1
  135. package/dist/utils/workflowInterface.js +91 -11
  136. package/dist/webmcp/index.d.ts +5 -0
  137. package/dist/webmcp/index.js +5 -0
  138. package/package.json +8 -2
@@ -32,7 +32,7 @@ interface Props {
32
32
  * **Use it for** the run status of a node or a run on the canvas.
33
33
  * **Not for** a free-form tag; use `Chip`.
34
34
  *
35
- * Not exported from the package; the API may still change.
35
+ * Exported from `@flowdrop/flowdrop/ui`.
36
36
  */
37
37
  declare const StatusPill: import("svelte").Component<Props, {}, "">;
38
38
  type StatusPill = ReturnType<typeof StatusPill>;
@@ -9,7 +9,7 @@
9
9
  **Use it for** a setting that takes effect right away.
10
10
  **Not for** an option that is saved later with a form; use `Checkbox`.
11
11
 
12
- Not exported from the package; the API may still change.
12
+ Exported from `@flowdrop/flowdrop/ui`.
13
13
  -->
14
14
 
15
15
  <script lang="ts">
@@ -19,7 +19,7 @@ interface Props extends Omit<HTMLInputAttributes, 'type' | 'checked' | 'onchange
19
19
  * **Use it for** a setting that takes effect right away.
20
20
  * **Not for** an option that is saved later with a form; use `Checkbox`.
21
21
  *
22
- * Not exported from the package; the API may still change.
22
+ * Exported from `@flowdrop/flowdrop/ui`.
23
23
  */
24
24
  declare const Switch: import("svelte").Component<Props, {}, "">;
25
25
  type Switch = ReturnType<typeof Switch>;
@@ -18,7 +18,7 @@
18
18
  Each tab has `id={tabId(idBase, value)}` and `aria-controls={tabPanelId(idBase, value)}`.
19
19
  Without `idBase` an id is generated that you cannot know, so pass `idBase` whenever panels exist.
20
20
 
21
- Not exported from the package; the API may still change.
21
+ Exported from `@flowdrop/flowdrop/ui`.
22
22
  -->
23
23
 
24
24
  <script lang="ts" module>
@@ -35,7 +35,7 @@
35
35
  <script lang="ts">
36
36
  import Icon from '@iconify/svelte';
37
37
 
38
- interface TabItem {
38
+ export interface TabItem {
39
39
  /** Value written to `value` when chosen */
40
40
  value: string;
41
41
  /** Visible label */
@@ -2,7 +2,7 @@
2
2
  export declare function tabId(idBase: string, value: string): string;
3
3
  /** DOM id of the panel the tab for `value` controls. */
4
4
  export declare function tabPanelId(idBase: string, value: string): string;
5
- interface TabItem {
5
+ export interface TabItem {
6
6
  /** Value written to `value` when chosen */
7
7
  value: string;
8
8
  /** Visible label */
@@ -47,7 +47,7 @@ interface Props {
47
47
  * Each tab has `id={tabId(idBase, value)}` and `aria-controls={tabPanelId(idBase, value)}`.
48
48
  * Without `idBase` an id is generated that you cannot know, so pass `idBase` whenever panels exist.
49
49
  *
50
- * Not exported from the package; the API may still change.
50
+ * Exported from `@flowdrop/flowdrop/ui`.
51
51
  */
52
52
  declare const Tabs: import("svelte").Component<Props, {}, "value">;
53
53
  type Tabs = ReturnType<typeof Tabs>;
@@ -15,7 +15,7 @@
15
15
  (Editor/Canvas).
16
16
  **Not for** drawing a bar; it has no surface of its own.
17
17
 
18
- Not exported from the package; not public API yet.
18
+ Exported from `@flowdrop/flowdrop/ui`.
19
19
  -->
20
20
 
21
21
  <script lang="ts">
@@ -25,7 +25,7 @@ interface Props {
25
25
  * (Editor/Canvas).
26
26
  * **Not for** drawing a bar; it has no surface of its own.
27
27
  *
28
- * Not exported from the package; not public API yet.
28
+ * Exported from `@flowdrop/flowdrop/ui`.
29
29
  */
30
30
  declare const Toolbar: import("svelte").Component<Props, {}, "">;
31
31
  type Toolbar = ReturnType<typeof Toolbar>;
@@ -4,7 +4,7 @@
4
4
 
5
5
  Pass the same `orientation` as the toolbar. The line is drawn across that axis.
6
6
 
7
- Not exported from the package; not public API yet.
7
+ Exported from `@flowdrop/flowdrop/ui`.
8
8
  -->
9
9
 
10
10
  <script lang="ts">
@@ -7,7 +7,7 @@ interface Props {
7
7
  *
8
8
  * Pass the same `orientation` as the toolbar. The line is drawn across that axis.
9
9
  *
10
- * Not exported from the package; not public API yet.
10
+ * Exported from `@flowdrop/flowdrop/ui`.
11
11
  */
12
12
  declare const ToolbarSeparator: import("svelte").Component<Props, {}, "">;
13
13
  type ToolbarSeparator = ReturnType<typeof ToolbarSeparator>;
@@ -29,7 +29,10 @@
29
29
  /** Why it happened, one short paragraph. */
30
30
  body?: string;
31
31
  details?: readonly string[];
32
+ /** Single action; kept for callers outside the library. */
32
33
  action?: ToastAction;
34
+ /** Follow-up steps, shown after `action`. */
35
+ actions?: readonly ToastAction[];
33
36
  kind?: ToastKind;
34
37
  dismissible?: boolean;
35
38
  }
@@ -40,13 +43,23 @@
40
43
  body,
41
44
  details = [],
42
45
  action,
46
+ actions = [],
43
47
  kind = 'info',
44
48
  dismissible = true
45
49
  }: Props = $props();
46
50
 
47
- function runAction(): void {
48
- action?.onClick();
49
- toastApi.dismiss(toast.id);
51
+ const all = $derived([...(action ? [action] : []), ...actions]);
52
+ // The main action is the one marked `primary`, else the first.
53
+ const mainIndex = $derived(
54
+ Math.max(
55
+ 0,
56
+ all.findIndex((a) => a.primary)
57
+ )
58
+ );
59
+
60
+ function run(item: ToastAction): void {
61
+ item.onClick();
62
+ if (!item.keepOpen) toastApi.dismiss(toast.id);
50
63
  }
51
64
  </script>
52
65
 
@@ -88,9 +101,15 @@
88
101
  {/each}
89
102
  </ul>
90
103
  {/if}
91
- {#if action}
92
- <div class="flowdrop-toast-actions">
93
- <Button variant="ghost" size="sm" onclick={runAction}>{action.label}</Button>
104
+ {#if all.length}
105
+ <div class="flowdrop-toast-actions" class:flowdrop-toast-actions--multi={all.length > 1}>
106
+ {#each all as item, i (i)}
107
+ <Button
108
+ variant={all.length === 1 ? 'ghost' : i === mainIndex ? 'primary' : 'secondary'}
109
+ size="sm"
110
+ onclick={() => run(item)}>{item.label}</Button
111
+ >
112
+ {/each}
94
113
  </div>
95
114
  {/if}
96
115
  </div>
@@ -25,7 +25,10 @@ interface Props {
25
25
  /** Why it happened, one short paragraph. */
26
26
  body?: string;
27
27
  details?: readonly string[];
28
+ /** Single action; kept for callers outside the library. */
28
29
  action?: ToastAction;
30
+ /** Follow-up steps, shown after `action`. */
31
+ actions?: readonly ToastAction[];
29
32
  kind?: ToastKind;
30
33
  dismissible?: boolean;
31
34
  }
@@ -51,6 +51,13 @@ export interface EndpointConfig {
51
51
  * the editor applies as one undoable edit. Needs `diagnose`.
52
52
  */
53
53
  remedy?: string;
54
+ /**
55
+ * Impact check before save (`POST`, body = the workflow as the editor
56
+ * would save it, `{id}` = the saved workflow id). Answers `{ success,
57
+ * data: { confirm, interface, renames, items } }`. A backend without it
58
+ * omits the key and the editor saves without asking.
59
+ */
60
+ impact?: string;
54
61
  };
55
62
  executions: {
56
63
  execute: string;
@@ -28,7 +28,8 @@ export const defaultEndpointConfig = {
28
28
  // Singular `workflow` here is the reference backend's spelling, not a typo.
29
29
  run: '/workflow/{workflowId}/run',
30
30
  diagnose: '/workflow/{id}/diagnose',
31
- remedy: '/workflow/{id}/remedy'
31
+ remedy: '/workflow/{id}/remedy',
32
+ impact: '/workflow/{id}/impact'
32
33
  },
33
34
  executions: {
34
35
  execute: '/workflows/{id}/execute',
@@ -7,6 +7,9 @@
7
7
  * wire is a valid target (the pick adds another); a pair that is already wired
8
8
  * is marked and picking it does nothing.
9
9
  *
10
+ * Trigger pins and data ports never count as compatible with each other: they
11
+ * are listed, but under "Other types".
12
+ *
10
13
  * @module editor/connectCandidates
11
14
  */
12
15
  import type { NodePort, Workflow, WorkflowEdge } from '../types/index.js';
@@ -7,6 +7,9 @@
7
7
  * wire is a valid target (the pick adds another); a pair that is already wired
8
8
  * is marked and picking it does nothing.
9
9
  *
10
+ * Trigger pins and data ports never count as compatible with each other: they
11
+ * are listed, but under "Other types".
12
+ *
10
13
  * @module editor/connectCandidates
11
14
  */
12
15
  import { v4 as uuidv4 } from 'uuid';
@@ -14,7 +17,7 @@ import { ProximityConnectHelper } from '../helpers/proximityConnect.js';
14
17
  import { buildHandleId } from '../utils/handleIds.js';
15
18
  import { isPortVisible } from '../utils/portUtils.js';
16
19
  import { isTriggerEventInput } from '../utils/reservedPorts.js';
17
- import { nodeCanvasLabel } from '../utils/workflowInterface.js';
20
+ import { disambiguateLabels, nodeCanvasLabel } from '../utils/workflowInterface.js';
18
21
  import { defaultMessages } from '../messages/defaults.js';
19
22
  /** A stable key for a candidate, `nodeId::portId`. */
20
23
  export function connectCandidateKey(candidate) {
@@ -49,6 +52,7 @@ export function canConnectFrom(workflow, target) {
49
52
  */
50
53
  export function listConnectCandidates(workflow, checker, target) {
51
54
  const groups = { compatible: [], other: [] };
55
+ const found = [];
52
56
  const origin = resolveOrigin(workflow, target);
53
57
  if (!origin)
54
58
  return groups;
@@ -75,9 +79,11 @@ export function listConnectCandidates(workflow, checker, target) {
75
79
  edge.sourceHandle === handle &&
76
80
  edge.target === target.nodeId &&
77
81
  edge.targetHandle === originHandle);
78
- const compatible = fromOutput
79
- ? checker.areDataTypesCompatible(origin.port.dataType, port.dataType)
80
- : checker.areDataTypesCompatible(port.dataType, origin.port.dataType);
82
+ const sameKind = (origin.port.dataType === 'trigger') === (port.dataType === 'trigger');
83
+ const compatible = sameKind &&
84
+ (fromOutput
85
+ ? checker.areDataTypesCompatible(origin.port.dataType, port.dataType)
86
+ : checker.areDataTypesCompatible(port.dataType, origin.port.dataType));
81
87
  const candidate = {
82
88
  nodeId: node.id,
83
89
  nodeLabel: nodeCanvasLabel(node),
@@ -86,9 +92,12 @@ export function listConnectCandidates(workflow, checker, target) {
86
92
  wired,
87
93
  connected
88
94
  };
89
- (compatible ? groups.compatible : groups.other).push(candidate);
95
+ found.push(candidate);
90
96
  }
91
97
  }
98
+ for (const candidate of disambiguateLabels(found)) {
99
+ (candidate.compatible ? groups.compatible : groups.other).push(candidate);
100
+ }
92
101
  return groups;
93
102
  }
94
103
  /** The edge a pick makes. The source is always the output side. Styling is left to the editor. */
@@ -81,7 +81,7 @@ export { globalSaveWorkflow, globalExportWorkflow } from '../services/globalSave
81
81
  export { fetchPortConfig, validatePortConfig } from '../services/portConfigApi.js';
82
82
  export { fetchCategories, validateCategories } from '../services/categoriesApi.js';
83
83
  export { fetchDynamicSchema, resolveExternalEditUrl, getEffectiveConfigEditOptions, clearSchemaCache, invalidateSchemaCache, hasConfigEditOptions, shouldShowExternalEdit, shouldUseDynamicSchema } from '../services/dynamicSchemaService.js';
84
- export { getDraftStorageKey, saveDraft, loadDraft, deleteDraft, hasDraft, getDraftMetadata, clearAllDrafts, setDraftStorage, getDraftStorage, resolveDraftStorage, DraftAutoSaveManager } from '../services/draftStorage.js';
84
+ export { getDraftStorageKey, saveDraft, loadDraft, draftFingerprint, deleteDraft, hasDraft, getDraftMetadata, clearAllDrafts, setDraftStorage, getDraftStorage, resolveDraftStorage, DraftAutoSaveManager } from '../services/draftStorage.js';
85
85
  export type { DraftStorageAdapter, DraftStorageType, DraftStorageOption } from '../services/draftStorage.js';
86
86
  export { EnhancedFlowDropApiClient, ApiError, parseApiErrorBody, errorDetails } from '../api/enhanced-client.js';
87
87
  export { isLoopbackEdge, isValidLoopbackCycle, PortCompatibilityChecker, getPossibleConnections, validateConnection, getConnectionSuggestions, hasCycles, hasInvalidCycles, getExecutionOrder } from '../utils/connections.js';
@@ -116,7 +116,7 @@ export { globalSaveWorkflow, globalExportWorkflow } from '../services/globalSave
116
116
  export { fetchPortConfig, validatePortConfig } from '../services/portConfigApi.js';
117
117
  export { fetchCategories, validateCategories } from '../services/categoriesApi.js';
118
118
  export { fetchDynamicSchema, resolveExternalEditUrl, getEffectiveConfigEditOptions, clearSchemaCache, invalidateSchemaCache, hasConfigEditOptions, shouldShowExternalEdit, shouldUseDynamicSchema } from '../services/dynamicSchemaService.js';
119
- export { getDraftStorageKey, saveDraft, loadDraft, deleteDraft, hasDraft, getDraftMetadata, clearAllDrafts, setDraftStorage, getDraftStorage, resolveDraftStorage, DraftAutoSaveManager } from '../services/draftStorage.js';
119
+ export { getDraftStorageKey, saveDraft, loadDraft, draftFingerprint, deleteDraft, hasDraft, getDraftMetadata, clearAllDrafts, setDraftStorage, getDraftStorage, resolveDraftStorage, DraftAutoSaveManager } from '../services/draftStorage.js';
120
120
  // ============================================================================
121
121
  // API Clients
122
122
  // ============================================================================
@@ -145,6 +145,21 @@ export declare class WorkflowOperationsHelper {
145
145
  */
146
146
  static checkWorkflowHasAnyCycles(nodes: WorkflowNodeType[], edges: WorkflowEdge[]): boolean;
147
147
  }
148
+ /**
149
+ * Where a node added from the palette lands: to the right of the selected
150
+ * node, else the middle of the visible canvas.
151
+ */
152
+ export declare function placementForNewNode(selected: {
153
+ x: number;
154
+ y: number;
155
+ width: number;
156
+ } | null, viewportCentre: {
157
+ x: number;
158
+ y: number;
159
+ }, gap: number): {
160
+ x: number;
161
+ y: number;
162
+ };
148
163
  /**
149
164
  * Configuration helper
150
165
  */
@@ -412,6 +412,15 @@ export class WorkflowOperationsHelper {
412
412
  return hasCycles(nodes, edges);
413
413
  }
414
414
  }
415
+ /**
416
+ * Where a node added from the palette lands: to the right of the selected
417
+ * node, else the middle of the visible canvas.
418
+ */
419
+ export function placementForNewNode(selected, viewportCentre, gap) {
420
+ if (!selected)
421
+ return { x: viewportCentre.x, y: viewportCentre.y };
422
+ return { x: selected.x + selected.width + gap, y: selected.y };
423
+ }
415
424
  /**
416
425
  * Configuration helper
417
426
  */
package/dist/index.d.ts CHANGED
@@ -39,4 +39,5 @@ export type { AuthProvider } from './types/auth.js';
39
39
  export type { FlowDropInstance } from './stores/instanceContainer.svelte.js';
40
40
  export type { FlowDropMountOptions, MountedFlowDropApp, RunCommandOptions } from './svelte-app.js';
41
41
  export type { FlowDropEventHandlers } from './types/events.js';
42
+ export type { ImpactSeverity, ImpactItem, ImpactReport } from './types/impact.js';
42
43
  export type { Messages, MessagesOverride } from './messages/index.js';
@@ -132,6 +132,7 @@ export declare const defaultMessages: {
132
132
  readonly suggestions: "Suggestions";
133
133
  readonly retry: "Retry";
134
134
  readonly timedOut: "The request timed out";
135
+ readonly invalidUrl: "Suggestions are not available: the field has an invalid URL";
135
136
  readonly noResults: "No results found";
136
137
  };
137
138
  readonly field: {
@@ -271,6 +272,7 @@ export declare const defaultMessages: {
271
272
  readonly tagline: "Visual Workflow Manager";
272
273
  readonly breadcrumbAriaLabel: "Breadcrumb";
273
274
  readonly connected: "Connected";
275
+ readonly unsavedChanges: "Unsaved changes";
274
276
  readonly settingsTitle: "Settings";
275
277
  readonly settingsAriaLabel: "Open settings";
276
278
  readonly appearance: {
@@ -435,6 +437,24 @@ export declare const defaultMessages: {
435
437
  readonly optionCurrent: "current";
436
438
  readonly optionTaken: "already taken";
437
439
  };
440
+ readonly runButton: {
441
+ readonly label: "Run";
442
+ readonly title: "Run this workflow";
443
+ readonly failed: "The run could not be started.";
444
+ readonly queued: "The run is queued. It starts when the site's queue runs (cron).";
445
+ };
446
+ readonly runInputsDialog: {
447
+ readonly title: ({ name }: {
448
+ name: string;
449
+ }) => string;
450
+ readonly close: "Close the run form";
451
+ readonly missing: ({ names }: {
452
+ names: string;
453
+ }) => string;
454
+ readonly invalid: ({ names }: {
455
+ names: string;
456
+ }) => string;
457
+ };
438
458
  readonly runBar: {
439
459
  readonly label: "Run";
440
460
  readonly running: "Running";
@@ -446,6 +466,8 @@ export declare const defaultMessages: {
446
466
  readonly stopLabel: "Stop the run";
447
467
  readonly open: "Open";
448
468
  readonly openLabel: "Open the run in Test mode";
469
+ readonly openRun: "Open run";
470
+ readonly openRunTitle: "Open the run page";
449
471
  readonly askAssistant: "Ask the Assistant";
450
472
  readonly askAssistantLabel: "Ask the Assistant about this run";
451
473
  readonly announce: {
@@ -461,6 +483,10 @@ export declare const defaultMessages: {
461
483
  count: number;
462
484
  }) => string;
463
485
  readonly triggerTitle: "Problems found in this workflow";
486
+ readonly checking: "Checking...";
487
+ readonly unavailable: "Check unavailable";
488
+ readonly unavailableTitle: "The problem check could not run. It tries again after your next change.";
489
+ readonly retry: "Retry";
464
490
  readonly title: "Problems";
465
491
  readonly listLabel: "Problems in this workflow";
466
492
  readonly severity: {
@@ -498,6 +524,10 @@ export declare const defaultMessages: {
498
524
  }) => string;
499
525
  };
500
526
  readonly dismissNotice: "Dismiss";
527
+ readonly autoDone: ({ label }: {
528
+ label: string;
529
+ }) => string;
530
+ readonly undo: "Undo";
501
531
  };
502
532
  readonly runsList: {
503
533
  readonly trigger: "Runs";
@@ -586,8 +616,12 @@ export declare const defaultMessages: {
586
616
  };
587
617
  readonly layout: {
588
618
  readonly componentsSidebar: "Components sidebar";
619
+ readonly addNode: ({ name }: {
620
+ name: string;
621
+ }) => string;
589
622
  readonly nodesTab: "Nodes";
590
623
  readonly workflowCanvas: "Workflow canvas";
624
+ readonly skipToCanvas: "Skip to the canvas";
591
625
  readonly executionLogs: "Execution logs sidebar";
592
626
  readonly settingsCategories: "Settings categories";
593
627
  readonly zoomLevelsTitle: "Zoom levels";
@@ -1187,6 +1221,8 @@ export declare const defaultMessages: {
1187
1221
  readonly descriptionLabel: "Description";
1188
1222
  readonly dataTypeLabel: "Data type";
1189
1223
  readonly dataTypePlaceholder: "Select a data type…";
1224
+ readonly mixedInputHint: "Callers can send anything. Pick a type so forms can ask for it properly.";
1225
+ readonly noTitle: "No title";
1190
1226
  readonly namePlaceholder: "Defaults to ID";
1191
1227
  readonly typeMismatchInline: ({ portType }: {
1192
1228
  portType: string;
@@ -1333,6 +1369,22 @@ export declare const defaultMessages: {
1333
1369
  }) => string;
1334
1370
  };
1335
1371
  };
1372
+ readonly impact: {
1373
+ readonly title: "Before you save";
1374
+ readonly breaks: "This change breaks";
1375
+ readonly changes: "This change also does";
1376
+ readonly info: "Also good to know";
1377
+ readonly severity: {
1378
+ readonly breaks: "Breaks";
1379
+ readonly changes: "Changes";
1380
+ readonly info: "Info";
1381
+ };
1382
+ readonly failed: ({ message }: {
1383
+ message: string;
1384
+ }) => string;
1385
+ readonly cancel: "Cancel";
1386
+ readonly save: "Save anyway";
1387
+ };
1336
1388
  readonly webmcp: {
1337
1389
  readonly bridge: {
1338
1390
  readonly trigger: "Desktop bridge";
@@ -1405,6 +1457,14 @@ export declare const defaultMessages: {
1405
1457
  readonly failed: "Failed";
1406
1458
  readonly skipped: "Skipped";
1407
1459
  };
1460
+ readonly drafts: {
1461
+ readonly found: ({ time }: {
1462
+ time: string;
1463
+ }) => string;
1464
+ readonly savedSince: "The workflow was saved after this draft. Restoring puts your draft over that version.";
1465
+ readonly restore: "Restore";
1466
+ readonly discard: "Discard";
1467
+ };
1408
1468
  readonly composer: {
1409
1469
  readonly placeholder: "Type a message";
1410
1470
  readonly send: "Send";
@@ -1432,4 +1492,45 @@ export declare const defaultMessages: {
1432
1492
  readonly hintChoose: "choose";
1433
1493
  readonly hintClose: "close";
1434
1494
  };
1495
+ readonly autoSave: {
1496
+ readonly waiting: "Autosave is waiting: this change affects what uses the workflow. Press Save to review it.";
1497
+ };
1498
+ readonly compare: {
1499
+ readonly title: "Your version and the saved version";
1500
+ readonly onlyMine: "Only in yours";
1501
+ readonly onlyTheirs: "Only in the saved version";
1502
+ readonly changedInBoth: "Different in the two versions";
1503
+ readonly none: "No differences in the workflow itself";
1504
+ readonly keepMine: "Keep mine";
1505
+ readonly loadTheirs: "Load saved version";
1506
+ readonly cancel: "Cancel";
1507
+ readonly stepOnly: ({ label }: {
1508
+ label: string;
1509
+ }) => string;
1510
+ readonly stepSettings: ({ label }: {
1511
+ label: string;
1512
+ }) => string;
1513
+ readonly stepLabel: ({ label }: {
1514
+ label: string;
1515
+ }) => string;
1516
+ readonly stepPosition: ({ label }: {
1517
+ label: string;
1518
+ }) => string;
1519
+ readonly wiresOnly: ({ n }: {
1520
+ n: number;
1521
+ }) => string;
1522
+ readonly name: ({ mine, theirs }: {
1523
+ mine: string;
1524
+ theirs: string;
1525
+ }) => string;
1526
+ readonly description: "Workflow description changed";
1527
+ readonly interface: "Workflow interface changed";
1528
+ readonly chat: "Chat settings changed";
1529
+ };
1530
+ readonly saveConflict: {
1531
+ readonly title: "Someone saved this workflow after you opened it.";
1532
+ readonly body: "Your changes are not saved yet.";
1533
+ readonly compare: "Compare";
1534
+ readonly noRevision: "Could not read the saved version, so your changes were not sent.";
1535
+ };
1435
1536
  };