@widgetic/workflows 0.1.1 → 0.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +118 -46
- package/dist/api/apiContext.d.ts +4 -0
- package/dist/api/apiContext.js +17 -0
- package/dist/api/types.d.ts +201 -0
- package/dist/api/types.js +3 -0
- package/dist/api/workflowsApi.d.ts +133 -0
- package/dist/api/workflowsApi.js +763 -0
- package/dist/components/Workflows.svelte +43 -17
- package/dist/components/WorkflowsEmptyState.svelte +16 -5
- package/dist/components/WorkflowsEmptyState.svelte.d.ts +5 -16
- package/dist/components/WorkflowsHeader.svelte +2 -2
- package/dist/components/WorkflowsWorkspace.svelte +90 -0
- package/dist/components/WorkflowsWorkspace.svelte.d.ts +15 -0
- package/dist/components/canvas/AddBlockMenu.svelte +101 -0
- package/dist/components/canvas/AddBlockMenu.svelte.d.ts +5 -0
- package/dist/components/canvas/CanvasToolbar.svelte +95 -0
- package/dist/components/canvas/CanvasToolbar.svelte.d.ts +9 -0
- package/dist/components/canvas/CompositionNodeView.svelte +125 -0
- package/dist/components/canvas/CompositionNodeView.svelte.d.ts +5 -0
- package/dist/components/canvas/ConditionNodeView.svelte +95 -0
- package/dist/components/canvas/ConditionNodeView.svelte.d.ts +5 -0
- package/dist/components/canvas/HandlePoint.svelte +32 -0
- package/dist/components/canvas/HandlePoint.svelte.d.ts +14 -0
- package/dist/components/canvas/TriggerNodeView.svelte +75 -0
- package/dist/components/canvas/TriggerNodeView.svelte.d.ts +5 -0
- package/dist/components/canvas/WorkflowCanvas.svelte +380 -0
- package/dist/components/canvas/WorkflowCanvas.svelte.d.ts +25 -0
- package/dist/components/canvas/WorkflowEdgeView.svelte +58 -0
- package/dist/components/canvas/WorkflowEdgeView.svelte.d.ts +4 -0
- package/dist/components/editor/ConflictBanner.svelte +78 -0
- package/dist/components/editor/ConflictBanner.svelte.d.ts +3 -0
- package/dist/components/editor/EditorBanners.svelte +141 -0
- package/dist/components/editor/EditorBanners.svelte.d.ts +7 -0
- package/dist/components/editor/EditorCanvasArea.svelte +85 -0
- package/dist/components/editor/EditorCanvasArea.svelte.d.ts +3 -0
- package/dist/components/editor/EditorTabs.svelte +81 -0
- package/dist/components/editor/EditorTabs.svelte.d.ts +7 -0
- package/dist/components/editor/EditorTopBar.svelte +132 -0
- package/dist/components/editor/EditorTopBar.svelte.d.ts +9 -0
- package/dist/components/editor/PresenceBanner.svelte +126 -0
- package/dist/components/editor/PresenceBanner.svelte.d.ts +3 -0
- package/dist/components/editor/RunsTab.svelte +256 -0
- package/dist/components/editor/RunsTab.svelte.d.ts +3 -0
- package/dist/components/editor/SettingsTab.svelte +180 -0
- package/dist/components/editor/SettingsTab.svelte.d.ts +7 -0
- package/dist/components/editor/WorkflowEditor.svelte +198 -0
- package/dist/components/editor/WorkflowEditor.svelte.d.ts +17 -0
- package/dist/components/index.d.ts +0 -2
- package/dist/components/index.js +0 -2
- package/dist/components/list/CreateWorkflowDialog.svelte +89 -0
- package/dist/components/list/CreateWorkflowDialog.svelte.d.ts +9 -0
- package/dist/components/list/WorkflowList.svelte +204 -0
- package/dist/components/list/WorkflowList.svelte.d.ts +12 -0
- package/dist/components/list/WorkflowRow.svelte +191 -0
- package/dist/components/list/WorkflowRow.svelte.d.ts +10 -0
- package/dist/components/panel/BlockProblems.svelte +47 -0
- package/dist/components/panel/BlockProblems.svelte.d.ts +6 -0
- package/dist/components/panel/CompositionForm.svelte +127 -0
- package/dist/components/panel/CompositionForm.svelte.d.ts +7 -0
- package/dist/components/panel/CompositionPicker.svelte +179 -0
- package/dist/components/panel/CompositionPicker.svelte.d.ts +14 -0
- package/dist/components/panel/ConditionForm.svelte +105 -0
- package/dist/components/panel/ConditionForm.svelte.d.ts +7 -0
- package/dist/components/panel/EventValueRow.svelte +85 -0
- package/dist/components/panel/EventValueRow.svelte.d.ts +12 -0
- package/dist/components/panel/NextStepSelect.svelte +70 -0
- package/dist/components/panel/NextStepSelect.svelte.d.ts +12 -0
- package/dist/components/panel/ProblemsList.svelte +101 -0
- package/dist/components/panel/ProblemsList.svelte.d.ts +3 -0
- package/dist/components/panel/RuleCard.svelte +191 -0
- package/dist/components/panel/RuleCard.svelte.d.ts +13 -0
- package/dist/components/panel/SidePanel.svelte +82 -0
- package/dist/components/panel/SidePanel.svelte.d.ts +3 -0
- package/dist/components/panel/TestRow.svelte +150 -0
- package/dist/components/panel/TestRow.svelte.d.ts +15 -0
- package/dist/components/panel/TestRunPanel.svelte +85 -0
- package/dist/components/panel/TestRunPanel.svelte.d.ts +3 -0
- package/dist/components/panel/TestTriggerCard.svelte +121 -0
- package/dist/components/panel/TestTriggerCard.svelte.d.ts +7 -0
- package/dist/components/panel/TriggerForm.svelte +385 -0
- package/dist/components/panel/TriggerForm.svelte.d.ts +7 -0
- package/dist/components/panel/VersionHistory.svelte +123 -0
- package/dist/components/panel/VersionHistory.svelte.d.ts +3 -0
- package/dist/components/ui/ActionButton.svelte +85 -0
- package/dist/components/ui/ActionButton.svelte.d.ts +27 -0
- package/dist/components/ui/ConfirmDialog.svelte +52 -0
- package/dist/components/ui/ConfirmDialog.svelte.d.ts +16 -0
- package/dist/components/ui/Icon.svelte +32 -0
- package/dist/components/ui/Icon.svelte.d.ts +9 -0
- package/dist/components/ui/Menu.svelte +211 -0
- package/dist/components/ui/Menu.svelte.d.ts +21 -0
- package/dist/components/ui/Modal.svelte +129 -0
- package/dist/components/ui/Modal.svelte.d.ts +13 -0
- package/dist/components/ui/Notice.svelte +36 -0
- package/dist/components/ui/Notice.svelte.d.ts +11 -0
- package/dist/components/ui/SelectField.svelte +74 -0
- package/dist/components/ui/SelectField.svelte.d.ts +16 -0
- package/dist/components/ui/StatusBadge.svelte +41 -0
- package/dist/components/ui/StatusBadge.svelte.d.ts +9 -0
- package/dist/components/ui/TextField.svelte +97 -0
- package/dist/components/ui/TextField.svelte.d.ts +29 -0
- package/dist/components/ui/icons.d.ts +34 -0
- package/dist/components/ui/icons.js +54 -0
- package/dist/components/ui/types.d.ts +26 -0
- package/dist/components/ui/types.js +1 -0
- package/dist/editor/apiErrorText.d.ts +10 -0
- package/dist/editor/apiErrorText.js +53 -0
- package/dist/editor/autosave.d.ts +47 -0
- package/dist/editor/autosave.js +119 -0
- package/dist/editor/blockLabels.d.ts +91 -0
- package/dist/editor/blockLabels.js +196 -0
- package/dist/editor/canvasContext.d.ts +52 -0
- package/dist/editor/canvasContext.js +37 -0
- package/dist/editor/canvasWords.d.ts +24 -0
- package/dist/editor/canvasWords.js +40 -0
- package/dist/editor/capabilityModel.d.ts +46 -0
- package/dist/editor/capabilityModel.js +113 -0
- package/dist/editor/editLeaseController.d.ts +162 -0
- package/dist/editor/editLeaseController.js +459 -0
- package/dist/editor/editorState.svelte.d.ts +277 -0
- package/dist/editor/editorState.svelte.js +862 -0
- package/dist/editor/flowAdapter.d.ts +59 -0
- package/dist/editor/flowAdapter.js +166 -0
- package/dist/editor/formatCount.d.ts +5 -0
- package/dist/editor/formatCount.js +15 -0
- package/dist/editor/graphDiff.d.ts +27 -0
- package/dist/editor/graphDiff.js +64 -0
- package/dist/editor/graphModel.d.ts +154 -0
- package/dist/editor/graphModel.js +457 -0
- package/dist/editor/issueText.d.ts +64 -0
- package/dist/editor/issueText.js +101 -0
- package/dist/editor/keepCopy.d.ts +41 -0
- package/dist/editor/keepCopy.js +52 -0
- package/dist/editor/listState.svelte.d.ts +82 -0
- package/dist/editor/listState.svelte.js +250 -0
- package/dist/editor/statsRange.d.ts +26 -0
- package/dist/editor/statsRange.js +41 -0
- package/dist/editor/testRun.d.ts +36 -0
- package/dist/editor/testRun.js +74 -0
- package/dist/editor/zonedTime.d.ts +20 -0
- package/dist/editor/zonedTime.js +134 -0
- package/dist/i18n/language.d.ts +3 -3
- package/dist/i18n/messages.d.ts +429 -4
- package/dist/i18n/messages.js +456 -8
- package/dist/index.d.ts +2 -1
- package/dist/index.js +1 -1
- package/dist/types/index.d.ts +41 -3
- package/package.json +5 -1
|
@@ -0,0 +1,277 @@
|
|
|
1
|
+
import type { FieldValue, ValidationIssue, WorkflowGraph, WorkflowNode } from '@widgetic/workflows-engine';
|
|
2
|
+
import { type WorkflowsApi } from '../api/workflowsApi.js';
|
|
3
|
+
import type { CompositionOption, WorkflowDetail, WorkflowStateAction, WorkflowVersion, WorkflowVersionDetail } from '../api/types.js';
|
|
4
|
+
import type { WorkflowsMessageKey } from '../i18n/messages.js';
|
|
5
|
+
import type { WorkflowsError } from '../types/index.js';
|
|
6
|
+
import { type SaveState } from './autosave.js';
|
|
7
|
+
import { type EditLeaseControllerOptions, type PresenceState } from './editLeaseController.js';
|
|
8
|
+
import { type BlockRequest } from './graphModel.js';
|
|
9
|
+
import { type KeptCopy } from './keepCopy.js';
|
|
10
|
+
import { type TestRunState } from './testRun.js';
|
|
11
|
+
/** The tabs of an open workflow. */
|
|
12
|
+
export type EditorTab = 'editor' | 'runs' | 'settings';
|
|
13
|
+
/** What the side panel shows next to the canvas. */
|
|
14
|
+
export type PanelMode = 'selection' | 'history' | 'test';
|
|
15
|
+
/** Something the person is waiting for. */
|
|
16
|
+
export type BusyKind = 'publishing' | 'discarding' | 'restoring' | 'changingState' | 'duplicating' | 'deleting' | 'keepingCopy';
|
|
17
|
+
/** A line the editor says about what just happened: a message of the catalog, so the screen says it in the page's language. */
|
|
18
|
+
export interface EditorNotice {
|
|
19
|
+
tone: 'info' | 'problem';
|
|
20
|
+
messageKey: WorkflowsMessageKey;
|
|
21
|
+
values?: Record<string, string | number>;
|
|
22
|
+
}
|
|
23
|
+
/** What the editor needs from the screen that owns the canvas. The canvas fills it in when it is on the screen. */
|
|
24
|
+
export interface CanvasHandle {
|
|
25
|
+
/** Makes the canvas show this workflow, as one step that one undo takes back. */
|
|
26
|
+
applyGraph(next: WorkflowGraph): void;
|
|
27
|
+
/** Replaces everything on the canvas (a reload, a restore); nothing to undo afterwards. */
|
|
28
|
+
loadGraph(graph: WorkflowGraph): void;
|
|
29
|
+
selectNodes(nodeIds: readonly string[]): void;
|
|
30
|
+
fitView(): void;
|
|
31
|
+
zoomIn(): void;
|
|
32
|
+
zoomOut(): void;
|
|
33
|
+
undo(): void;
|
|
34
|
+
redo(): void;
|
|
35
|
+
readonly canUndo: boolean;
|
|
36
|
+
readonly canRedo: boolean;
|
|
37
|
+
}
|
|
38
|
+
/** What the editor is given when it is made. */
|
|
39
|
+
export interface WorkflowEditorOptions {
|
|
40
|
+
api: WorkflowsApi;
|
|
41
|
+
workflowId: string;
|
|
42
|
+
/** Tells the page about a failure (`onError` of the screen). */
|
|
43
|
+
reportError: (error: WorkflowsError) => void;
|
|
44
|
+
/** The person asked to leave this workflow (it was deleted, or they pressed Back). */
|
|
45
|
+
leave: () => void;
|
|
46
|
+
/** Another workflow was made (a duplicate) and the person should see it. */
|
|
47
|
+
openWorkflow: (workflowId: string) => void;
|
|
48
|
+
/** For tests. */
|
|
49
|
+
random?: () => number;
|
|
50
|
+
/** For tests: how long a success notice stays. */
|
|
51
|
+
noticeMilliseconds?: number;
|
|
52
|
+
/** For tests: the delay before a change is saved. */
|
|
53
|
+
saveDelayMilliseconds?: number;
|
|
54
|
+
/**
|
|
55
|
+
* Tell who else is editing this workflow and keep this tab's claim on it (a team's workspace). Off unless the page asks:
|
|
56
|
+
* where it is off, nothing is asked of the API and nothing is ever blocked. See `startPresence`.
|
|
57
|
+
*/
|
|
58
|
+
presence?: boolean;
|
|
59
|
+
/** For tests: the clock, the timers, the page and the tab id of the presence. */
|
|
60
|
+
presenceOptions?: Omit<EditLeaseControllerOptions, 'port' | 'logger'>;
|
|
61
|
+
}
|
|
62
|
+
/**
|
|
63
|
+
* Everything the open workflow is: what the server says about it, the draft the person is changing, the compositions that
|
|
64
|
+
* can be used, what the draft is missing, where saving stands, and the small things the person is in the middle of
|
|
65
|
+
* (what is selected, which panel is open, a test visitor).
|
|
66
|
+
*
|
|
67
|
+
* The draft lives in two places on purpose. The canvas holds the blocks while they are dragged and drawn; this holds the
|
|
68
|
+
* same workflow as the engine's plain graph, which is what is validated, saved and published. They are kept the same in one
|
|
69
|
+
* direction each way: a change on the canvas arrives here through `acceptCanvasGraph`, and a change made in the side panel
|
|
70
|
+
* or the Add block menu goes through `commit`, which tells the canvas, whose own change then arrives here. Nothing else
|
|
71
|
+
* writes `graph`.
|
|
72
|
+
*
|
|
73
|
+
* What it never does: decide a rule of the workflow (the engine does), word a sentence (the catalog does), or draw.
|
|
74
|
+
*/
|
|
75
|
+
export declare class WorkflowEditorState {
|
|
76
|
+
readonly workflowId: string;
|
|
77
|
+
workflow: WorkflowDetail | null;
|
|
78
|
+
loadState: "loading" | "ready" | "failed";
|
|
79
|
+
loadFailure: "workflows.region.label" | "workflows.header.title" | "workflows.header.subtitle" | "workflows.common.cancel" | "workflows.common.close" | "workflows.common.dismiss" | "workflows.common.loading" | "workflows.empty.title" | "workflows.empty.hint" | "workflows.error.title" | "workflows.error.hint" | "workflows.error.retry" | "workflows.error.generic" | "workflows.error.network" | "workflows.error.timeout" | "workflows.error.server" | "workflows.error.sessionEnded" | "workflows.error.planRestricted" | "workflows.error.notFound" | "workflows.error.revisionChanged" | "workflows.error.archived" | "workflows.error.nothingToPublish" | "workflows.error.nothingToDiscard" | "workflows.error.everPublished" | "workflows.error.wrongState" | "workflows.error.tooManyWorkflows" | "workflows.error.publishBlocked" | "workflows.error.invalidGraph" | "workflows.error.tooManyRequests" | "workflows.list.label" | "workflows.list.newWorkflow" | "workflows.list.searchLabel" | "workflows.list.searchPlaceholder" | "workflows.list.filterLabel" | "workflows.list.filterActive" | "workflows.list.filterAll" | "workflows.list.sortLabel" | "workflows.list.sortCreated" | "workflows.list.sortPublished" | "workflows.list.sortRuns" | "workflows.list.sortName" | "workflows.list.sortAscending" | "workflows.list.sortDescending" | "workflows.list.columnName" | "workflows.list.columnStatus" | "workflows.list.columnRuns" | "workflows.list.columnPublished" | "workflows.list.columnCreated" | "workflows.list.compositionsCount" | "workflows.list.runsCount" | "workflows.list.publishedOn" | "workflows.list.neverPublished" | "workflows.list.never" | "workflows.list.open" | "workflows.list.rowMenu" | "workflows.list.showMore" | "workflows.list.noMatches" | "workflows.list.duplicated" | "workflows.list.deleted" | "workflows.create.title" | "workflows.create.nameLabel" | "workflows.create.namePlaceholder" | "workflows.create.compositionLabel" | "workflows.create.compositionHelp" | "workflows.create.create" | "workflows.create.creating" | "workflows.status.draft" | "workflows.status.live" | "workflows.status.paused" | "workflows.status.archived" | "workflows.status.unpublishedChanges" | "workflows.top.back" | "workflows.top.nameLabel" | "workflows.top.testRun" | "workflows.top.history" | "workflows.top.embedCode" | "workflows.top.publish" | "workflows.top.publishChanges" | "workflows.top.publishing" | "workflows.save.saved" | "workflows.save.saving" | "workflows.save.pending" | "workflows.save.failed" | "workflows.save.conflict" | "workflows.tabs.label" | "workflows.tabs.editor" | "workflows.tabs.runs" | "workflows.tabs.settings" | "workflows.banner.unpublishedChanges" | "workflows.banner.publishChanges" | "workflows.banner.discard" | "workflows.banner.discardTitle" | "workflows.banner.discardMessage" | "workflows.banner.neverPublished" | "workflows.banner.paused" | "workflows.banner.archived" | "workflows.banner.conflict" | "workflows.banner.reload" | "workflows.banner.touchOnly" | "workflows.conflict.keepCopy" | "workflows.conflict.keepingCopy" | "workflows.conflict.copyName" | "workflows.conflict.copyKept" | "workflows.conflict.openCopy" | "workflows.conflict.loadTitle" | "workflows.conflict.loadMessage" | "workflows.presence.blockedTitleNamed" | "workflows.presence.blockedTitleYou" | "workflows.presence.blockedTitle" | "workflows.presence.blockedBody" | "workflows.presence.lostTitleNamed" | "workflows.presence.lostTitleYou" | "workflows.presence.lostTitle" | "workflows.presence.lostBody" | "workflows.presence.takeOver" | "workflows.presence.takeOverHint" | "workflows.presence.lookOnly" | "workflows.presence.lookOnlyHint" | "workflows.presence.working" | "workflows.presence.actionFailed" | "workflows.presence.readOnlyNamed" | "workflows.presence.readOnlyYou" | "workflows.presence.readOnly" | "workflows.presence.readOnlyFree" | "workflows.presence.startEditing" | "workflows.editor.published" | "workflows.editor.discarded" | "workflows.editor.restored" | "workflows.editor.reloaded" | "workflows.editor.paused" | "workflows.editor.resumed" | "workflows.editor.archived" | "workflows.editor.unarchived" | "workflows.editor.saveFirst" | "workflows.editor.fixProblems" | "workflows.editor.blockLimit" | "workflows.publish.firstTitle" | "workflows.publish.firstMessage" | "workflows.publish.changesTitle" | "workflows.publish.changesMessage" | "workflows.leave.title" | "workflows.leave.message" | "workflows.leave.confirm" | "workflows.canvas.label" | "workflows.canvas.pointIn" | "workflows.canvas.pointOut" | "workflows.toolbar.label" | "workflows.toolbar.addBlock" | "workflows.toolbar.undo" | "workflows.toolbar.redo" | "workflows.toolbar.zoomIn" | "workflows.toolbar.zoomOut" | "workflows.toolbar.fit" | "workflows.addBlock.composition" | "workflows.addBlock.helpComposition" | "workflows.addBlock.condition" | "workflows.addBlock.helpCondition" | "workflows.addBlock.triggerHeading" | "workflows.addBlock.helpInput" | "workflows.addBlock.helpAction" | "workflows.addBlock.helpPageEvent" | "workflows.addBlock.helpScheduled" | "workflows.block.startsHere" | "workflows.block.trigger" | "workflows.block.condition" | "workflows.block.unknown" | "workflows.block.compositionNotChosen" | "workflows.block.compositionLoading" | "workflows.block.compositionUnavailable" | "workflows.block.notPublished" | "workflows.block.numbered" | "workflows.block.problems" | "workflows.panel.label" | "workflows.panel.overviewHeading" | "workflows.panel.overviewHelp" | "workflows.panel.problemsHeading" | "workflows.panel.problemsLabel" | "workflows.panel.noProblems" | "workflows.panel.manyBlocksSelected" | "workflows.panel.connectionSelected" | "workflows.panel.removeBlock" | "workflows.panel.removeBlocks" | "workflows.panel.removeConnection" | "workflows.composition.heading" | "workflows.composition.help" | "workflows.composition.searchLabel" | "workflows.composition.searchPlaceholder" | "workflows.composition.none" | "workflows.composition.alreadyUsed" | "workflows.composition.isStart" | "workflows.composition.makeStart" | "workflows.composition.capabilitiesHeading" | "workflows.composition.capabilityInput" | "workflows.composition.capabilityAction" | "workflows.composition.capabilityWebsites" | "workflows.composition.inputTables" | "workflows.composition.actionCount" | "workflows.trigger.heading" | "workflows.trigger.help" | "workflows.trigger.kindLabel" | "workflows.trigger.kindInput" | "workflows.trigger.kindAction" | "workflows.trigger.kindPageEvent" | "workflows.trigger.kindScheduled" | "workflows.trigger.unavailable" | "workflows.trigger.tableLabel" | "workflows.trigger.tableHelp" | "workflows.trigger.actionLabel" | "workflows.trigger.actionHelp" | "workflows.trigger.chooseOne" | "workflows.trigger.notFound" | "workflows.trigger.readableValues" | "workflows.trigger.noReadableValues" | "workflows.trigger.nextLabel" | "workflows.trigger.nextHelp" | "workflows.trigger.nextNone" | "workflows.trigger.summaryInput" | "workflows.trigger.summaryAction" | "workflows.trigger.summaryPageEvent" | "workflows.trigger.summaryAt" | "workflows.trigger.summaryUnfinished" | "workflows.reason.widgetKeepsNoData" | "workflows.reason.widgetReportsNoActions" | "workflows.reason.widgetNotPublished" | "workflows.schedule.modeLabel" | "workflows.schedule.modeAfter" | "workflows.schedule.modeAt" | "workflows.schedule.afterHelp" | "workflows.schedule.amountLabel" | "workflows.schedule.unitLabel" | "workflows.schedule.unitSeconds" | "workflows.schedule.unitMinutes" | "workflows.schedule.unitHours" | "workflows.schedule.unitDays" | "workflows.schedule.unitWeeks" | "workflows.schedule.waitSeconds" | "workflows.schedule.waitMinutes" | "workflows.schedule.waitHours" | "workflows.schedule.waitDays" | "workflows.schedule.waitWeeks" | "workflows.schedule.momentLabel" | "workflows.schedule.momentHelp" | "workflows.schedule.invalidMoment" | "workflows.event.nameLabel" | "workflows.event.namePlaceholder" | "workflows.event.nameHelp" | "workflows.event.nameInvalid" | "workflows.event.howToSend" | "workflows.event.valuesHeading" | "workflows.event.valuesHelp" | "workflows.event.addValue" | "workflows.event.valueName" | "workflows.event.valueNamePlaceholder" | "workflows.event.valueNameInvalid" | "workflows.event.valueType" | "workflows.event.removeValue" | "workflows.fieldType.text" | "workflows.fieldType.number" | "workflows.fieldType.boolean" | "workflows.value.yes" | "workflows.value.no" | "workflows.condition.heading" | "workflows.condition.help" | "workflows.condition.noTrigger" | "workflows.condition.noValues" | "workflows.condition.addRule" | "workflows.condition.ruleLimit" | "workflows.condition.defaultName" | "workflows.condition.defaultLabel" | "workflows.condition.defaultStay" | "workflows.condition.defaultHelp" | "workflows.condition.defaultHint" | "workflows.condition.defaultStays" | "workflows.rule.defaultName" | "workflows.rule.nameLabel" | "workflows.rule.moveUp" | "workflows.rule.moveDown" | "workflows.rule.remove" | "workflows.rule.matchLabel" | "workflows.rule.matchAll" | "workflows.rule.matchAny" | "workflows.rule.noTests" | "workflows.rule.addTest" | "workflows.rule.testLimit" | "workflows.rule.thenGoTo" | "workflows.rule.testWithValue" | "workflows.rule.testWithoutValue" | "workflows.rule.testAndMore" | "workflows.test.field" | "workflows.test.operator" | "workflows.test.value" | "workflows.test.valuePlaceholder" | "workflows.test.remove" | "workflows.operator.is" | "workflows.operator.isNot" | "workflows.operator.contains" | "workflows.operator.doesNotContain" | "workflows.operator.startsWith" | "workflows.operator.endsWith" | "workflows.operator.greaterThan" | "workflows.operator.atLeast" | "workflows.operator.lessThan" | "workflows.operator.atMost" | "workflows.operator.isEmpty" | "workflows.operator.isNotEmpty" | "workflows.test.heading" | "workflows.test.help" | "workflows.test.close" | "workflows.test.start" | "workflows.test.restart" | "workflows.test.ended" | "workflows.test.noStart" | "workflows.test.noTriggers" | "workflows.test.visitorIsOn" | "workflows.test.fire" | "workflows.test.resultMoved" | "workflows.test.resultStayed" | "workflows.test.resultIgnored" | "workflows.history.heading" | "workflows.history.help" | "workflows.history.close" | "workflows.history.none" | "workflows.history.failed" | "workflows.history.version" | "workflows.history.live" | "workflows.history.by" | "workflows.history.view" | "workflows.history.viewing" | "workflows.history.backToDraft" | "workflows.history.restore" | "workflows.history.restoreTitle" | "workflows.history.restoreMessage" | "workflows.runs.help" | "workflows.runs.rangeLabel" | "workflows.runs.lastDays" | "workflows.runs.versionLabel" | "workflows.runs.allVersions" | "workflows.runs.versionLive" | "workflows.runs.started" | "workflows.runs.entered" | "workflows.runs.fired" | "workflows.runs.failed" | "workflows.runs.none" | "workflows.runs.neverPublished" | "workflows.settings.zoneHeading" | "workflows.settings.zoneLabel" | "workflows.settings.zoneHelp" | "workflows.settings.embedHeading" | "workflows.settings.embedHelp" | "workflows.settings.stateHeading" | "workflows.settings.pause" | "workflows.settings.pauseHelp" | "workflows.settings.resume" | "workflows.settings.resumeHelp" | "workflows.settings.archive" | "workflows.settings.archiveHelp" | "workflows.settings.archiveTitle" | "workflows.settings.archiveMessage" | "workflows.settings.unarchive" | "workflows.settings.unarchiveHelp" | "workflows.settings.duplicate" | "workflows.settings.duplicateHelp" | "workflows.settings.delete" | "workflows.settings.deleteHelp" | "workflows.settings.deleteBlocked" | "workflows.settings.deleteTitle" | "workflows.settings.deleteMessage" | "workflows.issue.unknown" | "workflows.issue.malformed" | "workflows.issue.schemaVersion" | "workflows.issue.graphTooLarge" | "workflows.issue.unknownNodeType" | "workflows.issue.unknownTriggerKind" | "workflows.issue.badId" | "workflows.issue.duplicateId" | "workflows.issue.tooManyBlocks" | "workflows.issue.tooManyEdges" | "workflows.issue.noComposition" | "workflows.issue.noStart" | "workflows.issue.manyStarts" | "workflows.issue.compositionMissingId" | "workflows.issue.duplicateComposition" | "workflows.issue.compositionNotAvailable" | "workflows.issue.compositionWebsiteMismatch" | "workflows.issue.unreachableBlock" | "workflows.issue.edgeUnknownNode" | "workflows.issue.edgeBadPort" | "workflows.issue.edgeInvalidConnection" | "workflows.issue.portManyTargets" | "workflows.issue.cycle" | "workflows.issue.triggerNoSource" | "workflows.issue.triggerManySources" | "workflows.issue.triggerNoTarget" | "workflows.issue.triggerConfigIncomplete" | "workflows.issue.triggerNeedsTable" | "workflows.issue.triggerNeedsAction" | "workflows.issue.triggerNeedsName" | "workflows.issue.scheduleInvalid" | "workflows.issue.eventValueInvalid" | "workflows.issue.eventTooManyValues" | "workflows.issue.triggerCapabilityMissing" | "workflows.issue.triggerInputMissing" | "workflows.issue.triggerActionMissing" | "workflows.issue.conditionNoSource" | "workflows.issue.conditionManySources" | "workflows.issue.conditionNoCases" | "workflows.issue.conditionTooManyCases" | "workflows.issue.caseBadId" | "workflows.issue.caseDuplicateId" | "workflows.issue.caseNoTests" | "workflows.issue.caseTooManyTests" | "workflows.issue.caseNoTarget" | "workflows.issue.testBadField" | "workflows.issue.testBadOperator" | "workflows.issue.testMissingValue" | "workflows.issue.fieldUnknown" | null;
|
|
80
|
+
/** The compositions the workflow uses, as the API describes them. `null`: not there for this person. */
|
|
81
|
+
options: Readonly<Record<string, CompositionOption | null | undefined>>;
|
|
82
|
+
optionsReady: boolean;
|
|
83
|
+
graph: WorkflowGraph;
|
|
84
|
+
name: string;
|
|
85
|
+
timezone: string;
|
|
86
|
+
/** Bumped when the whole draft is replaced from outside (a reload, a restore), so the canvas starts again from it. */
|
|
87
|
+
draftEpoch: number;
|
|
88
|
+
saveState: SaveState;
|
|
89
|
+
saveFailure: "workflows.region.label" | "workflows.header.title" | "workflows.header.subtitle" | "workflows.common.cancel" | "workflows.common.close" | "workflows.common.dismiss" | "workflows.common.loading" | "workflows.empty.title" | "workflows.empty.hint" | "workflows.error.title" | "workflows.error.hint" | "workflows.error.retry" | "workflows.error.generic" | "workflows.error.network" | "workflows.error.timeout" | "workflows.error.server" | "workflows.error.sessionEnded" | "workflows.error.planRestricted" | "workflows.error.notFound" | "workflows.error.revisionChanged" | "workflows.error.archived" | "workflows.error.nothingToPublish" | "workflows.error.nothingToDiscard" | "workflows.error.everPublished" | "workflows.error.wrongState" | "workflows.error.tooManyWorkflows" | "workflows.error.publishBlocked" | "workflows.error.invalidGraph" | "workflows.error.tooManyRequests" | "workflows.list.label" | "workflows.list.newWorkflow" | "workflows.list.searchLabel" | "workflows.list.searchPlaceholder" | "workflows.list.filterLabel" | "workflows.list.filterActive" | "workflows.list.filterAll" | "workflows.list.sortLabel" | "workflows.list.sortCreated" | "workflows.list.sortPublished" | "workflows.list.sortRuns" | "workflows.list.sortName" | "workflows.list.sortAscending" | "workflows.list.sortDescending" | "workflows.list.columnName" | "workflows.list.columnStatus" | "workflows.list.columnRuns" | "workflows.list.columnPublished" | "workflows.list.columnCreated" | "workflows.list.compositionsCount" | "workflows.list.runsCount" | "workflows.list.publishedOn" | "workflows.list.neverPublished" | "workflows.list.never" | "workflows.list.open" | "workflows.list.rowMenu" | "workflows.list.showMore" | "workflows.list.noMatches" | "workflows.list.duplicated" | "workflows.list.deleted" | "workflows.create.title" | "workflows.create.nameLabel" | "workflows.create.namePlaceholder" | "workflows.create.compositionLabel" | "workflows.create.compositionHelp" | "workflows.create.create" | "workflows.create.creating" | "workflows.status.draft" | "workflows.status.live" | "workflows.status.paused" | "workflows.status.archived" | "workflows.status.unpublishedChanges" | "workflows.top.back" | "workflows.top.nameLabel" | "workflows.top.testRun" | "workflows.top.history" | "workflows.top.embedCode" | "workflows.top.publish" | "workflows.top.publishChanges" | "workflows.top.publishing" | "workflows.save.saved" | "workflows.save.saving" | "workflows.save.pending" | "workflows.save.failed" | "workflows.save.conflict" | "workflows.tabs.label" | "workflows.tabs.editor" | "workflows.tabs.runs" | "workflows.tabs.settings" | "workflows.banner.unpublishedChanges" | "workflows.banner.publishChanges" | "workflows.banner.discard" | "workflows.banner.discardTitle" | "workflows.banner.discardMessage" | "workflows.banner.neverPublished" | "workflows.banner.paused" | "workflows.banner.archived" | "workflows.banner.conflict" | "workflows.banner.reload" | "workflows.banner.touchOnly" | "workflows.conflict.keepCopy" | "workflows.conflict.keepingCopy" | "workflows.conflict.copyName" | "workflows.conflict.copyKept" | "workflows.conflict.openCopy" | "workflows.conflict.loadTitle" | "workflows.conflict.loadMessage" | "workflows.presence.blockedTitleNamed" | "workflows.presence.blockedTitleYou" | "workflows.presence.blockedTitle" | "workflows.presence.blockedBody" | "workflows.presence.lostTitleNamed" | "workflows.presence.lostTitleYou" | "workflows.presence.lostTitle" | "workflows.presence.lostBody" | "workflows.presence.takeOver" | "workflows.presence.takeOverHint" | "workflows.presence.lookOnly" | "workflows.presence.lookOnlyHint" | "workflows.presence.working" | "workflows.presence.actionFailed" | "workflows.presence.readOnlyNamed" | "workflows.presence.readOnlyYou" | "workflows.presence.readOnly" | "workflows.presence.readOnlyFree" | "workflows.presence.startEditing" | "workflows.editor.published" | "workflows.editor.discarded" | "workflows.editor.restored" | "workflows.editor.reloaded" | "workflows.editor.paused" | "workflows.editor.resumed" | "workflows.editor.archived" | "workflows.editor.unarchived" | "workflows.editor.saveFirst" | "workflows.editor.fixProblems" | "workflows.editor.blockLimit" | "workflows.publish.firstTitle" | "workflows.publish.firstMessage" | "workflows.publish.changesTitle" | "workflows.publish.changesMessage" | "workflows.leave.title" | "workflows.leave.message" | "workflows.leave.confirm" | "workflows.canvas.label" | "workflows.canvas.pointIn" | "workflows.canvas.pointOut" | "workflows.toolbar.label" | "workflows.toolbar.addBlock" | "workflows.toolbar.undo" | "workflows.toolbar.redo" | "workflows.toolbar.zoomIn" | "workflows.toolbar.zoomOut" | "workflows.toolbar.fit" | "workflows.addBlock.composition" | "workflows.addBlock.helpComposition" | "workflows.addBlock.condition" | "workflows.addBlock.helpCondition" | "workflows.addBlock.triggerHeading" | "workflows.addBlock.helpInput" | "workflows.addBlock.helpAction" | "workflows.addBlock.helpPageEvent" | "workflows.addBlock.helpScheduled" | "workflows.block.startsHere" | "workflows.block.trigger" | "workflows.block.condition" | "workflows.block.unknown" | "workflows.block.compositionNotChosen" | "workflows.block.compositionLoading" | "workflows.block.compositionUnavailable" | "workflows.block.notPublished" | "workflows.block.numbered" | "workflows.block.problems" | "workflows.panel.label" | "workflows.panel.overviewHeading" | "workflows.panel.overviewHelp" | "workflows.panel.problemsHeading" | "workflows.panel.problemsLabel" | "workflows.panel.noProblems" | "workflows.panel.manyBlocksSelected" | "workflows.panel.connectionSelected" | "workflows.panel.removeBlock" | "workflows.panel.removeBlocks" | "workflows.panel.removeConnection" | "workflows.composition.heading" | "workflows.composition.help" | "workflows.composition.searchLabel" | "workflows.composition.searchPlaceholder" | "workflows.composition.none" | "workflows.composition.alreadyUsed" | "workflows.composition.isStart" | "workflows.composition.makeStart" | "workflows.composition.capabilitiesHeading" | "workflows.composition.capabilityInput" | "workflows.composition.capabilityAction" | "workflows.composition.capabilityWebsites" | "workflows.composition.inputTables" | "workflows.composition.actionCount" | "workflows.trigger.heading" | "workflows.trigger.help" | "workflows.trigger.kindLabel" | "workflows.trigger.kindInput" | "workflows.trigger.kindAction" | "workflows.trigger.kindPageEvent" | "workflows.trigger.kindScheduled" | "workflows.trigger.unavailable" | "workflows.trigger.tableLabel" | "workflows.trigger.tableHelp" | "workflows.trigger.actionLabel" | "workflows.trigger.actionHelp" | "workflows.trigger.chooseOne" | "workflows.trigger.notFound" | "workflows.trigger.readableValues" | "workflows.trigger.noReadableValues" | "workflows.trigger.nextLabel" | "workflows.trigger.nextHelp" | "workflows.trigger.nextNone" | "workflows.trigger.summaryInput" | "workflows.trigger.summaryAction" | "workflows.trigger.summaryPageEvent" | "workflows.trigger.summaryAt" | "workflows.trigger.summaryUnfinished" | "workflows.reason.widgetKeepsNoData" | "workflows.reason.widgetReportsNoActions" | "workflows.reason.widgetNotPublished" | "workflows.schedule.modeLabel" | "workflows.schedule.modeAfter" | "workflows.schedule.modeAt" | "workflows.schedule.afterHelp" | "workflows.schedule.amountLabel" | "workflows.schedule.unitLabel" | "workflows.schedule.unitSeconds" | "workflows.schedule.unitMinutes" | "workflows.schedule.unitHours" | "workflows.schedule.unitDays" | "workflows.schedule.unitWeeks" | "workflows.schedule.waitSeconds" | "workflows.schedule.waitMinutes" | "workflows.schedule.waitHours" | "workflows.schedule.waitDays" | "workflows.schedule.waitWeeks" | "workflows.schedule.momentLabel" | "workflows.schedule.momentHelp" | "workflows.schedule.invalidMoment" | "workflows.event.nameLabel" | "workflows.event.namePlaceholder" | "workflows.event.nameHelp" | "workflows.event.nameInvalid" | "workflows.event.howToSend" | "workflows.event.valuesHeading" | "workflows.event.valuesHelp" | "workflows.event.addValue" | "workflows.event.valueName" | "workflows.event.valueNamePlaceholder" | "workflows.event.valueNameInvalid" | "workflows.event.valueType" | "workflows.event.removeValue" | "workflows.fieldType.text" | "workflows.fieldType.number" | "workflows.fieldType.boolean" | "workflows.value.yes" | "workflows.value.no" | "workflows.condition.heading" | "workflows.condition.help" | "workflows.condition.noTrigger" | "workflows.condition.noValues" | "workflows.condition.addRule" | "workflows.condition.ruleLimit" | "workflows.condition.defaultName" | "workflows.condition.defaultLabel" | "workflows.condition.defaultStay" | "workflows.condition.defaultHelp" | "workflows.condition.defaultHint" | "workflows.condition.defaultStays" | "workflows.rule.defaultName" | "workflows.rule.nameLabel" | "workflows.rule.moveUp" | "workflows.rule.moveDown" | "workflows.rule.remove" | "workflows.rule.matchLabel" | "workflows.rule.matchAll" | "workflows.rule.matchAny" | "workflows.rule.noTests" | "workflows.rule.addTest" | "workflows.rule.testLimit" | "workflows.rule.thenGoTo" | "workflows.rule.testWithValue" | "workflows.rule.testWithoutValue" | "workflows.rule.testAndMore" | "workflows.test.field" | "workflows.test.operator" | "workflows.test.value" | "workflows.test.valuePlaceholder" | "workflows.test.remove" | "workflows.operator.is" | "workflows.operator.isNot" | "workflows.operator.contains" | "workflows.operator.doesNotContain" | "workflows.operator.startsWith" | "workflows.operator.endsWith" | "workflows.operator.greaterThan" | "workflows.operator.atLeast" | "workflows.operator.lessThan" | "workflows.operator.atMost" | "workflows.operator.isEmpty" | "workflows.operator.isNotEmpty" | "workflows.test.heading" | "workflows.test.help" | "workflows.test.close" | "workflows.test.start" | "workflows.test.restart" | "workflows.test.ended" | "workflows.test.noStart" | "workflows.test.noTriggers" | "workflows.test.visitorIsOn" | "workflows.test.fire" | "workflows.test.resultMoved" | "workflows.test.resultStayed" | "workflows.test.resultIgnored" | "workflows.history.heading" | "workflows.history.help" | "workflows.history.close" | "workflows.history.none" | "workflows.history.failed" | "workflows.history.version" | "workflows.history.live" | "workflows.history.by" | "workflows.history.view" | "workflows.history.viewing" | "workflows.history.backToDraft" | "workflows.history.restore" | "workflows.history.restoreTitle" | "workflows.history.restoreMessage" | "workflows.runs.help" | "workflows.runs.rangeLabel" | "workflows.runs.lastDays" | "workflows.runs.versionLabel" | "workflows.runs.allVersions" | "workflows.runs.versionLive" | "workflows.runs.started" | "workflows.runs.entered" | "workflows.runs.fired" | "workflows.runs.failed" | "workflows.runs.none" | "workflows.runs.neverPublished" | "workflows.settings.zoneHeading" | "workflows.settings.zoneLabel" | "workflows.settings.zoneHelp" | "workflows.settings.embedHeading" | "workflows.settings.embedHelp" | "workflows.settings.stateHeading" | "workflows.settings.pause" | "workflows.settings.pauseHelp" | "workflows.settings.resume" | "workflows.settings.resumeHelp" | "workflows.settings.archive" | "workflows.settings.archiveHelp" | "workflows.settings.archiveTitle" | "workflows.settings.archiveMessage" | "workflows.settings.unarchive" | "workflows.settings.unarchiveHelp" | "workflows.settings.duplicate" | "workflows.settings.duplicateHelp" | "workflows.settings.delete" | "workflows.settings.deleteHelp" | "workflows.settings.deleteBlocked" | "workflows.settings.deleteTitle" | "workflows.settings.deleteMessage" | "workflows.issue.unknown" | "workflows.issue.malformed" | "workflows.issue.schemaVersion" | "workflows.issue.graphTooLarge" | "workflows.issue.unknownNodeType" | "workflows.issue.unknownTriggerKind" | "workflows.issue.badId" | "workflows.issue.duplicateId" | "workflows.issue.tooManyBlocks" | "workflows.issue.tooManyEdges" | "workflows.issue.noComposition" | "workflows.issue.noStart" | "workflows.issue.manyStarts" | "workflows.issue.compositionMissingId" | "workflows.issue.duplicateComposition" | "workflows.issue.compositionNotAvailable" | "workflows.issue.compositionWebsiteMismatch" | "workflows.issue.unreachableBlock" | "workflows.issue.edgeUnknownNode" | "workflows.issue.edgeBadPort" | "workflows.issue.edgeInvalidConnection" | "workflows.issue.portManyTargets" | "workflows.issue.cycle" | "workflows.issue.triggerNoSource" | "workflows.issue.triggerManySources" | "workflows.issue.triggerNoTarget" | "workflows.issue.triggerConfigIncomplete" | "workflows.issue.triggerNeedsTable" | "workflows.issue.triggerNeedsAction" | "workflows.issue.triggerNeedsName" | "workflows.issue.scheduleInvalid" | "workflows.issue.eventValueInvalid" | "workflows.issue.eventTooManyValues" | "workflows.issue.triggerCapabilityMissing" | "workflows.issue.triggerInputMissing" | "workflows.issue.triggerActionMissing" | "workflows.issue.conditionNoSource" | "workflows.issue.conditionManySources" | "workflows.issue.conditionNoCases" | "workflows.issue.conditionTooManyCases" | "workflows.issue.caseBadId" | "workflows.issue.caseDuplicateId" | "workflows.issue.caseNoTests" | "workflows.issue.caseTooManyTests" | "workflows.issue.caseNoTarget" | "workflows.issue.testBadField" | "workflows.issue.testBadOperator" | "workflows.issue.testMissingValue" | "workflows.issue.fieldUnknown" | null;
|
|
90
|
+
tab: EditorTab;
|
|
91
|
+
panel: PanelMode;
|
|
92
|
+
selectedNodeIds: readonly string[];
|
|
93
|
+
selectedEdgeIds: readonly string[];
|
|
94
|
+
busy: BusyKind | null;
|
|
95
|
+
notice: EditorNotice | null;
|
|
96
|
+
/** What a refused publish said was wrong (the server checks again with what it knows), until the next change. */
|
|
97
|
+
refusedIssues: readonly ValidationIssue[];
|
|
98
|
+
/** What the touch of a screen allows: with no pointer to draw lines with, the canvas only shows. */
|
|
99
|
+
canvasTouchOnly: boolean;
|
|
100
|
+
/** Set when a publish was tried while the draft has problems: the blocks with problems are outlined until it is published. */
|
|
101
|
+
problemsRevealed: boolean;
|
|
102
|
+
versions: readonly WorkflowVersion[] | null;
|
|
103
|
+
versionsState: "loading" | "failed" | "idle";
|
|
104
|
+
/** A published version being looked at, read-only. */
|
|
105
|
+
viewing: WorkflowVersionDetail | null;
|
|
106
|
+
testRun: TestRunState | null;
|
|
107
|
+
/** Where the claim on editing stands (see `EditLeaseController`). Nothing is blocked while it is `off` or `editing`. */
|
|
108
|
+
presence: PresenceState;
|
|
109
|
+
/** The workflow that holds the changes the person made while somebody else saved the draft first, once it was made. */
|
|
110
|
+
keptCopy: KeptCopy | null;
|
|
111
|
+
/** The canvas, while one is on the screen (a pointer that changes when the canvas comes and goes). */
|
|
112
|
+
canvas: CanvasHandle | null;
|
|
113
|
+
private revision;
|
|
114
|
+
private lastSaved;
|
|
115
|
+
private readonly saver;
|
|
116
|
+
private readonly api;
|
|
117
|
+
private readonly reportError;
|
|
118
|
+
private readonly leave;
|
|
119
|
+
private readonly openWorkflow;
|
|
120
|
+
private readonly random;
|
|
121
|
+
private readonly noticeMilliseconds;
|
|
122
|
+
private noticeTimer;
|
|
123
|
+
private loadController;
|
|
124
|
+
private disposed;
|
|
125
|
+
private readonly presenceWanted;
|
|
126
|
+
private readonly presenceOptions;
|
|
127
|
+
private leaseController;
|
|
128
|
+
/** The latest look at the server's draft, after editing came back (see `catchUpAfterPause`): a newer look and leaving the screen cancel it. */
|
|
129
|
+
private catchUpController;
|
|
130
|
+
constructor(options: WorkflowEditorOptions);
|
|
131
|
+
/** What the engine finds missing in the draft, with what it knows about the compositions once that has arrived. */
|
|
132
|
+
issues: ValidationIssue[];
|
|
133
|
+
/** The problems drawn on the canvas: those of the draft, so none while a published version is being looked at. */
|
|
134
|
+
issuesOnCanvas: import("./flowAdapter.js").IssuesOnCanvas;
|
|
135
|
+
/** Errors stop a publish; warnings are advice. */
|
|
136
|
+
hasPublishBlockers: boolean;
|
|
137
|
+
status: import("../api/types.js").WorkflowStatus;
|
|
138
|
+
/**
|
|
139
|
+
* Archived workflows are only looked at; so is a version, and so is a workflow somebody else is editing (the person
|
|
140
|
+
* chose to look only, or has not yet chosen to take over). The canvas on a touch screen only shows, see `canEditCanvas`.
|
|
141
|
+
*/
|
|
142
|
+
isReadOnly: boolean;
|
|
143
|
+
/**
|
|
144
|
+
* The workflow as a whole can be changed now (paused, archived, put back to a version, deleted): nothing else is
|
|
145
|
+
* running, and nobody else is editing it. Those are the changes that take what somebody is working on from under them.
|
|
146
|
+
*/
|
|
147
|
+
canChangeWorkflow: boolean;
|
|
148
|
+
canEditCanvas: boolean;
|
|
149
|
+
hasChangesToPublish: boolean;
|
|
150
|
+
/** Publish can be tried: there is something to publish and nothing else in the way. The problems found are told on the try. */
|
|
151
|
+
canTryPublish: boolean;
|
|
152
|
+
/** Publish will go through, as far as this screen can tell (the server checks again). */
|
|
153
|
+
canPublish: boolean;
|
|
154
|
+
selectedNode: WorkflowNode | null;
|
|
155
|
+
startNodeId: string | null;
|
|
156
|
+
compositionIds: string[];
|
|
157
|
+
/** The ids of the blocks a test visitor has passed, and where they are now, for the marks on the canvas. */
|
|
158
|
+
testPassedIds: Set<string>;
|
|
159
|
+
testTakenEdgeIds: Set<string>;
|
|
160
|
+
/** Reads the workflow and the compositions it uses. Safe to call again: it starts over from the server. */
|
|
161
|
+
load(): Promise<void>;
|
|
162
|
+
/** Stops everything that is waiting: timers, saves, requests. Called when the editor is taken off the screen. */
|
|
163
|
+
dispose(): void;
|
|
164
|
+
/** Sends what is waiting before the screen is left. Resolves to where saving stands. */
|
|
165
|
+
flushSaves(): Promise<SaveState>;
|
|
166
|
+
/** Leaves the workflow: what is waiting is sent first, then everything that was running is stopped. */
|
|
167
|
+
finish(): Promise<SaveState>;
|
|
168
|
+
/**
|
|
169
|
+
* Takes what the server holds as the draft, replacing what is on the screen. A published version that was being looked
|
|
170
|
+
* at is let go of: the canvas shows the draft now, and a banner that says otherwise would be wrong.
|
|
171
|
+
*/
|
|
172
|
+
private adoptServerDraft;
|
|
173
|
+
/** Throws away what is unsaved on this screen and reads the draft again (after somebody else changed it). */
|
|
174
|
+
reloadDraft(): Promise<void>;
|
|
175
|
+
/**
|
|
176
|
+
* Begins asking to edit, and keeps this tab's claim while the screen is open. When a teammate holds it, editing is paused
|
|
177
|
+
* here (`presence.editsBlocked`) until the person takes over or the teammate leaves. Nothing happens unless the page
|
|
178
|
+
* asked for presence: a personal workspace has no teammate, and there nothing is asked of the API and nothing is blocked.
|
|
179
|
+
*/
|
|
180
|
+
startPresence(): void;
|
|
181
|
+
/** The person chose to take over from the teammate who is editing: their editing pauses, and what they saved stays. */
|
|
182
|
+
takeOverEditing(): void;
|
|
183
|
+
/** The person chose to only look, for now. */
|
|
184
|
+
lookOnly(): void;
|
|
185
|
+
/** The person chose to begin editing, after looking (the teammate is gone). */
|
|
186
|
+
startEditing(): void;
|
|
187
|
+
private followPresence;
|
|
188
|
+
/**
|
|
189
|
+
* Editing came back after a pause, and what the screen shows may be older than what the other editor saved meanwhile.
|
|
190
|
+
* When everything on the screen is saved, the screen takes the server's draft if that is newer, so that the first thing
|
|
191
|
+
* the person does is not refused as a conflict. What is not saved is never replaced: the conflict banner decides that.
|
|
192
|
+
*/
|
|
193
|
+
private catchUpAfterPause;
|
|
194
|
+
/** Reads what the API says about these compositions; the ones it does not know come back as `null`. */
|
|
195
|
+
private readCompositionOptions;
|
|
196
|
+
/** Remembers compositions the person picked from the list, so the blocks that show them have their names at once. */
|
|
197
|
+
rememberCompositions(items: readonly CompositionOption[]): void;
|
|
198
|
+
/** Asks the API for compositions that the draft uses and this screen has not read yet (after a restore, say). */
|
|
199
|
+
private refreshMissingCompositions;
|
|
200
|
+
/**
|
|
201
|
+
* A change that happened on the canvas (a block dragged, a line drawn, a block deleted): the draft follows it. Answers
|
|
202
|
+
* the draft as it is kept, which can differ from what the canvas held (the first composition left became the start), so
|
|
203
|
+
* that the canvas can take it over.
|
|
204
|
+
*/
|
|
205
|
+
acceptCanvasGraph(fromCanvas: WorkflowGraph): WorkflowGraph;
|
|
206
|
+
/**
|
|
207
|
+
* A change made from the side panel or a menu. The canvas applies it (so it can be undone) and tells this state back,
|
|
208
|
+
* the same way a drag does. Without a canvas on the screen the draft changes directly.
|
|
209
|
+
*/
|
|
210
|
+
commit(next: WorkflowGraph): void;
|
|
211
|
+
/** What follows any change of the draft: a published check is stale, a test visitor may be somewhere that is gone, saving is due. */
|
|
212
|
+
private afterDraftChanged;
|
|
213
|
+
/** Replaces one block (the side panel changed it). */
|
|
214
|
+
replaceBlock(node: WorkflowNode): void;
|
|
215
|
+
/** Draws a connection from a place of a block to another block, or takes it away (`targetNodeId` null). One line per place. */
|
|
216
|
+
connect(sourceNodeId: string, sourcePort: string, targetNodeId: string | null): void;
|
|
217
|
+
/** Adds a block after the selected one (or where there is room) and selects it. Resolves to why nothing was added, if so. */
|
|
218
|
+
addBlock(request: BlockRequest): 'too_many_blocks' | null;
|
|
219
|
+
/** Takes the selected blocks and lines off the draft. */
|
|
220
|
+
removeSelected(): void;
|
|
221
|
+
removeBlock(nodeId: string): void;
|
|
222
|
+
/** Makes a composition the first one visitors see. */
|
|
223
|
+
makeStart(nodeId: string): void;
|
|
224
|
+
/** The selection of the canvas, as the canvas reports it. */
|
|
225
|
+
followSelection(nodeIds: readonly string[], edgeIds: readonly string[]): void;
|
|
226
|
+
setName(name: string): void;
|
|
227
|
+
setTimezone(timezone: string): void;
|
|
228
|
+
/** What would go to the server now, or `null` when the server already has it. */
|
|
229
|
+
private readSaveSnapshot;
|
|
230
|
+
private toSaveInput;
|
|
231
|
+
private applySaved;
|
|
232
|
+
private followSaveState;
|
|
233
|
+
/** Tries a failed save again (the person pressed "Try again"). */
|
|
234
|
+
retrySave(): void;
|
|
235
|
+
/**
|
|
236
|
+
* Somebody else saved the draft first, so what this person changed was not saved (`saveState` is `conflict`). Keeps what
|
|
237
|
+
* is on this screen as a new workflow, so that loading the latest version does not cost the person their work. The words
|
|
238
|
+
* of the copy's name are the screen's (`wording` puts them around the workflow's name, in the person's language).
|
|
239
|
+
* Nothing is done to the workflow being edited. Resolves to whether the copy was made; `keptCopy` says which.
|
|
240
|
+
*/
|
|
241
|
+
keepCopyOfChanges(wording: (name: string) => string): Promise<boolean>;
|
|
242
|
+
/** The person chose to open the copy they kept: the page follows, as it does for a duplicate. Nothing without a copy. */
|
|
243
|
+
openKeptCopy(): void;
|
|
244
|
+
/** Runs one thing the person waits for. Nothing else that changes the workflow runs meanwhile. */
|
|
245
|
+
private runBusy;
|
|
246
|
+
/** Makes the draft the next version visitors get. */
|
|
247
|
+
publish(): Promise<boolean>;
|
|
248
|
+
/** Puts the draft back to what is live. */
|
|
249
|
+
discardChanges(): Promise<boolean>;
|
|
250
|
+
loadVersions(): Promise<void>;
|
|
251
|
+
openHistory(): void;
|
|
252
|
+
closeHistory(): void;
|
|
253
|
+
/** Shows a published version read-only on the canvas. */
|
|
254
|
+
viewVersion(versionId: string): Promise<void>;
|
|
255
|
+
/** Goes back from a version to the draft. */
|
|
256
|
+
leaveVersion(): void;
|
|
257
|
+
/** Copies the version into the draft (the draft it replaces stays recoverable only through undo, so the screen asks first). */
|
|
258
|
+
restoreViewedVersion(): Promise<boolean>;
|
|
259
|
+
/** Reads what the API says about the compositions of a graph (a version, say) that this screen has not read yet. */
|
|
260
|
+
ensureOptionsFor(graph: WorkflowGraph): Promise<void>;
|
|
261
|
+
changeState(action: WorkflowStateAction): Promise<boolean>;
|
|
262
|
+
duplicate(): Promise<void>;
|
|
263
|
+
deleteWorkflow(): Promise<void>;
|
|
264
|
+
openTestRun(): void;
|
|
265
|
+
closeTestRun(): void;
|
|
266
|
+
restartTestRun(): void;
|
|
267
|
+
/** The test visitor does one thing: a trigger of the composition they are on fires, carrying these values. */
|
|
268
|
+
fireTrigger(triggerId: string, values: Record<string, FieldValue>): void;
|
|
269
|
+
showNotice(tone: EditorNotice['tone'], messageKey: WorkflowsMessageKey, values?: Record<string, string | number>): void;
|
|
270
|
+
dismissNotice(): void;
|
|
271
|
+
private showFailureNotice;
|
|
272
|
+
/** Says a failure once in the console and tells the page. */
|
|
273
|
+
private noteFailure;
|
|
274
|
+
}
|
|
275
|
+
export declare function provideEditorState(state: WorkflowEditorState): WorkflowEditorState;
|
|
276
|
+
/** Called by a part of the editor while it is created. The editor is always there for those parts: this throws if it is not. */
|
|
277
|
+
export declare function useEditorState(): WorkflowEditorState;
|