@widgetic/workflows 0.1.1 → 0.2.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/README.md +107 -46
- package/dist/api/apiContext.d.ts +4 -0
- package/dist/api/apiContext.js +17 -0
- package/dist/api/types.d.ts +168 -0
- package/dist/api/types.js +3 -0
- package/dist/api/workflowsApi.d.ts +109 -0
- package/dist/api/workflowsApi.js +657 -0
- package/dist/components/Workflows.svelte +41 -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 +87 -0
- package/dist/components/WorkflowsWorkspace.svelte.d.ts +14 -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/EditorBanners.svelte +143 -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/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 +185 -0
- package/dist/components/editor/WorkflowEditor.svelte.d.ts +15 -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/editorState.svelte.d.ts +220 -0
- package/dist/editor/editorState.svelte.js +713 -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/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 +396 -4
- package/dist/i18n/messages.js +421 -8
- package/dist/index.d.ts +2 -1
- package/dist/index.js +1 -1
- package/dist/types/index.d.ts +31 -3
- package/package.json +5 -1
package/dist/i18n/messages.js
CHANGED
|
@@ -10,24 +10,437 @@
|
|
|
10
10
|
* keeps the English text below, so a language can be added a screen at a time.
|
|
11
11
|
*
|
|
12
12
|
* Words that are NOT here, on purpose:
|
|
13
|
-
* - what a person wrote: the name of a workflow, of a
|
|
14
|
-
* language they were written in.
|
|
15
|
-
* - the lines the server
|
|
13
|
+
* - what a person wrote: the name of a workflow, of a composition, of a rule and of a page's event are shown as they were
|
|
14
|
+
* written, in the language they were written in. So are the labels a widget gives to its own columns and actions.
|
|
15
|
+
* - the lines of the server: it never sends a sentence to show. The screen reads what kind of failure it was (`error.*`)
|
|
16
|
+
* and what the engine found wrong with a workflow (`issue.*`), and says it here, in the page's language.
|
|
16
17
|
*/
|
|
17
18
|
export const WORKFLOWS_MESSAGES = {
|
|
18
19
|
// ===== The screen as a whole =====
|
|
19
20
|
/** The name of the region a workflows screen is, for a person who uses a screen reader. */
|
|
20
21
|
'workflows.region.label': 'Workflows',
|
|
21
|
-
// ===== The header =====
|
|
22
|
+
// ===== The header of the list =====
|
|
22
23
|
'workflows.header.title': 'Workflows',
|
|
23
24
|
/** One line under the title: what a workflow does. */
|
|
24
25
|
'workflows.header.subtitle': 'Decide which composition your embed shows, step by step.',
|
|
26
|
+
// ===== Words several parts share =====
|
|
27
|
+
'workflows.common.cancel': 'Cancel',
|
|
28
|
+
'workflows.common.close': 'Close',
|
|
29
|
+
'workflows.common.dismiss': 'Dismiss',
|
|
30
|
+
'workflows.common.loading': 'Loading…',
|
|
25
31
|
// ===== Nothing made yet =====
|
|
26
32
|
'workflows.empty.title': 'No workflows yet',
|
|
27
|
-
'workflows.empty.hint': 'A workflow chains compositions together.
|
|
28
|
-
|
|
29
|
-
// ===== When a part of the screen fails to draw =====
|
|
33
|
+
'workflows.empty.hint': 'A workflow chains compositions together. Triggers and conditions between them decide which one a visitor sees next.',
|
|
34
|
+
// ===== When a part of the screen fails to draw, and when a request fails =====
|
|
30
35
|
'workflows.error.title': 'Workflows could not be shown',
|
|
31
36
|
'workflows.error.hint': 'Something went wrong while this screen was being drawn.',
|
|
32
|
-
'workflows.error.retry': 'Try again'
|
|
37
|
+
'workflows.error.retry': 'Try again',
|
|
38
|
+
'workflows.error.generic': 'Something went wrong. Try again.',
|
|
39
|
+
'workflows.error.network': 'You seem to be offline. Check your connection and try again.',
|
|
40
|
+
'workflows.error.timeout': 'The request took too long. Try again.',
|
|
41
|
+
'workflows.error.server': 'The server had a problem. Try again in a moment.',
|
|
42
|
+
'workflows.error.sessionEnded': 'Your session has ended. Sign in again to continue.',
|
|
43
|
+
'workflows.error.planRestricted': 'Workflows are not part of your plan.',
|
|
44
|
+
'workflows.error.notFound': 'This workflow could not be found. It may have been deleted.',
|
|
45
|
+
'workflows.error.revisionChanged': 'This workflow was changed somewhere else. Load the latest version to keep editing.',
|
|
46
|
+
'workflows.error.archived': 'This workflow is archived. Restore it first.',
|
|
47
|
+
'workflows.error.nothingToPublish': 'There are no changes to publish.',
|
|
48
|
+
'workflows.error.nothingToDiscard': 'There are no unpublished changes to discard.',
|
|
49
|
+
'workflows.error.everPublished': 'A workflow that was published cannot be deleted. Archive it instead.',
|
|
50
|
+
'workflows.error.wrongState': 'This cannot be done in the current state of the workflow.',
|
|
51
|
+
'workflows.error.tooManyWorkflows': 'You have reached the limit of workflows for this workspace.',
|
|
52
|
+
'workflows.error.publishBlocked': 'The workflow cannot be published yet. Fix the problems that are marked.',
|
|
53
|
+
'workflows.error.invalidGraph': 'The workflow could not be saved because something in it is not valid.',
|
|
54
|
+
'workflows.error.tooManyRequests': 'Too many requests. Wait a moment and try again.',
|
|
55
|
+
// ===== The list =====
|
|
56
|
+
'workflows.list.label': 'Workflows',
|
|
57
|
+
'workflows.list.newWorkflow': 'New workflow',
|
|
58
|
+
'workflows.list.searchLabel': 'Search workflows',
|
|
59
|
+
'workflows.list.searchPlaceholder': 'Search by name',
|
|
60
|
+
'workflows.list.filterLabel': 'Show',
|
|
61
|
+
'workflows.list.filterActive': 'Not archived',
|
|
62
|
+
'workflows.list.filterAll': 'All workflows',
|
|
63
|
+
'workflows.list.sortLabel': 'Sort by',
|
|
64
|
+
'workflows.list.sortCreated': 'Date created',
|
|
65
|
+
'workflows.list.sortPublished': 'Last published',
|
|
66
|
+
'workflows.list.sortRuns': 'Visitors',
|
|
67
|
+
'workflows.list.sortName': 'Name',
|
|
68
|
+
'workflows.list.sortAscending': 'Ascending. Press to reverse the order.',
|
|
69
|
+
'workflows.list.sortDescending': 'Descending. Press to reverse the order.',
|
|
70
|
+
'workflows.list.columnName': 'Name',
|
|
71
|
+
'workflows.list.columnStatus': 'Status',
|
|
72
|
+
'workflows.list.columnRuns': 'Visitors',
|
|
73
|
+
'workflows.list.columnPublished': 'Last published',
|
|
74
|
+
'workflows.list.columnCreated': 'Created',
|
|
75
|
+
'workflows.list.compositionsCount': '{count, plural, one {# composition} other {# compositions}}',
|
|
76
|
+
'workflows.list.runsCount': '{count, plural, one {# visitor} other {# visitors}}',
|
|
77
|
+
'workflows.list.publishedOn': 'Published {date}',
|
|
78
|
+
'workflows.list.neverPublished': 'Not published yet',
|
|
79
|
+
'workflows.list.never': 'Never',
|
|
80
|
+
'workflows.list.open': 'Open',
|
|
81
|
+
/** The name of the menu of one row; `name` is the workflow. */
|
|
82
|
+
'workflows.list.rowMenu': 'Actions for {name}',
|
|
83
|
+
'workflows.list.showMore': 'Show more',
|
|
84
|
+
'workflows.list.noMatches': 'No workflow matches your search.',
|
|
85
|
+
'workflows.list.duplicated': 'The workflow was copied as a new draft.',
|
|
86
|
+
'workflows.list.deleted': 'The workflow was deleted.',
|
|
87
|
+
// ===== Making a workflow =====
|
|
88
|
+
'workflows.create.title': 'New workflow',
|
|
89
|
+
'workflows.create.nameLabel': 'Name',
|
|
90
|
+
'workflows.create.namePlaceholder': 'For example, Welcome offer',
|
|
91
|
+
'workflows.create.compositionLabel': 'First composition',
|
|
92
|
+
'workflows.create.compositionHelp': 'The composition visitors see first. You can also choose or change it in the editor.',
|
|
93
|
+
'workflows.create.create': 'Create workflow',
|
|
94
|
+
'workflows.create.creating': 'Creating…',
|
|
95
|
+
// ===== Where a workflow stands =====
|
|
96
|
+
'workflows.status.draft': 'Draft',
|
|
97
|
+
'workflows.status.live': 'Live',
|
|
98
|
+
'workflows.status.paused': 'Paused',
|
|
99
|
+
'workflows.status.archived': 'Archived',
|
|
100
|
+
'workflows.status.unpublishedChanges': 'Unpublished changes',
|
|
101
|
+
// ===== The top of the editor =====
|
|
102
|
+
'workflows.top.back': 'Back to workflows',
|
|
103
|
+
'workflows.top.nameLabel': 'Workflow name',
|
|
104
|
+
'workflows.top.testRun': 'Test run',
|
|
105
|
+
'workflows.top.history': 'Version history',
|
|
106
|
+
'workflows.top.embedCode': 'Embed code',
|
|
107
|
+
'workflows.top.publish': 'Publish',
|
|
108
|
+
'workflows.top.publishChanges': 'Publish changes',
|
|
109
|
+
'workflows.top.publishing': 'Publishing…',
|
|
110
|
+
/** Whether the latest changes are safe. */
|
|
111
|
+
'workflows.save.saved': 'All changes saved',
|
|
112
|
+
'workflows.save.saving': 'Saving…',
|
|
113
|
+
'workflows.save.pending': 'Unsaved changes',
|
|
114
|
+
'workflows.save.failed': 'Could not save your changes',
|
|
115
|
+
'workflows.save.conflict': 'Not saved: changed somewhere else',
|
|
116
|
+
'workflows.tabs.label': 'Parts of the workflow',
|
|
117
|
+
'workflows.tabs.editor': 'Editor',
|
|
118
|
+
'workflows.tabs.runs': 'Runs',
|
|
119
|
+
'workflows.tabs.settings': 'Settings',
|
|
120
|
+
// ===== Banners =====
|
|
121
|
+
'workflows.banner.unpublishedChanges': 'You have changes that are not published.',
|
|
122
|
+
'workflows.banner.publishChanges': 'Publish changes',
|
|
123
|
+
'workflows.banner.discard': 'Discard changes',
|
|
124
|
+
'workflows.banner.discardTitle': 'Discard your changes?',
|
|
125
|
+
'workflows.banner.discardMessage': 'The draft goes back to the version that is live. Your unpublished changes are lost.',
|
|
126
|
+
'workflows.banner.neverPublished': 'This workflow is not published yet, so embeds show only their first composition. Publish it to start moving visitors.',
|
|
127
|
+
'workflows.banner.paused': 'This workflow is paused. Embeds show only their first composition until you resume it.',
|
|
128
|
+
'workflows.banner.archived': 'This workflow is archived. Restore it in the Settings tab to change or publish it.',
|
|
129
|
+
'workflows.banner.conflict': 'This workflow was changed somewhere else, so your latest changes were not saved.',
|
|
130
|
+
'workflows.banner.reload': 'Load the latest version',
|
|
131
|
+
'workflows.banner.touchOnly': 'The canvas is read-only on a touch screen. Use the panel to change the selected block, or open this workflow on a computer to rearrange blocks.',
|
|
132
|
+
// ===== Things the editor tells the person after they did something =====
|
|
133
|
+
'workflows.editor.published': 'Version {number} is live.',
|
|
134
|
+
'workflows.editor.discarded': 'Changes discarded. The draft matches the live version again.',
|
|
135
|
+
'workflows.editor.restored': 'Version {number} was copied into the draft. Publish to make it live.',
|
|
136
|
+
'workflows.editor.reloaded': 'Loaded the latest version.',
|
|
137
|
+
'workflows.editor.paused': 'The workflow is paused.',
|
|
138
|
+
'workflows.editor.resumed': 'The workflow is live again.',
|
|
139
|
+
'workflows.editor.archived': 'The workflow is archived.',
|
|
140
|
+
'workflows.editor.unarchived': 'The workflow was restored.',
|
|
141
|
+
'workflows.editor.saveFirst': 'Wait until your changes are saved, then try again.',
|
|
142
|
+
'workflows.editor.fixProblems': '{count, plural, one {Fix # problem before publishing.} other {Fix # problems before publishing.}}',
|
|
143
|
+
'workflows.editor.blockLimit': 'A workflow can have at most {max} blocks.',
|
|
144
|
+
'workflows.publish.firstTitle': 'Publish this workflow?',
|
|
145
|
+
'workflows.publish.firstMessage': 'Embeds that use it start moving visitors between your compositions.',
|
|
146
|
+
'workflows.publish.changesTitle': 'Publish your changes?',
|
|
147
|
+
'workflows.publish.changesMessage': 'Visitors who start from now on follow the new version. Visitors who are already partway through finish the version they started.',
|
|
148
|
+
'workflows.leave.title': 'Leave without saving?',
|
|
149
|
+
'workflows.leave.message': 'Your latest changes were not saved. If you leave now they are lost.',
|
|
150
|
+
'workflows.leave.confirm': 'Leave anyway',
|
|
151
|
+
// ===== The canvas =====
|
|
152
|
+
'workflows.canvas.label': 'Workflow canvas',
|
|
153
|
+
'workflows.canvas.pointIn': 'Incoming connection point',
|
|
154
|
+
'workflows.canvas.pointOut': 'Outgoing connection point',
|
|
155
|
+
'workflows.toolbar.label': 'Canvas tools',
|
|
156
|
+
'workflows.toolbar.addBlock': 'Add block',
|
|
157
|
+
'workflows.toolbar.undo': 'Undo',
|
|
158
|
+
'workflows.toolbar.redo': 'Redo',
|
|
159
|
+
'workflows.toolbar.zoomIn': 'Zoom in',
|
|
160
|
+
'workflows.toolbar.zoomOut': 'Zoom out',
|
|
161
|
+
'workflows.toolbar.fit': 'Fit to screen',
|
|
162
|
+
'workflows.addBlock.composition': 'Composition',
|
|
163
|
+
'workflows.addBlock.helpComposition': 'A composition visitors see.',
|
|
164
|
+
'workflows.addBlock.condition': 'Condition',
|
|
165
|
+
'workflows.addBlock.helpCondition': 'Choose the next step by the values the trigger carried.',
|
|
166
|
+
'workflows.addBlock.triggerHeading': 'Triggers',
|
|
167
|
+
'workflows.addBlock.helpInput': 'A visitor adds something to the widget.',
|
|
168
|
+
'workflows.addBlock.helpAction': 'A visitor does something in the widget.',
|
|
169
|
+
'workflows.addBlock.helpPageEvent': 'Your page tells the workflow that something happened.',
|
|
170
|
+
'workflows.addBlock.helpScheduled': 'After a wait, or at a date and time.',
|
|
171
|
+
// ===== The blocks =====
|
|
172
|
+
'workflows.block.startsHere': 'Starts here',
|
|
173
|
+
'workflows.block.trigger': 'Trigger',
|
|
174
|
+
'workflows.block.condition': 'Condition',
|
|
175
|
+
'workflows.block.unknown': 'Unknown block',
|
|
176
|
+
'workflows.block.compositionNotChosen': 'Choose a composition',
|
|
177
|
+
'workflows.block.compositionLoading': 'Loading composition…',
|
|
178
|
+
'workflows.block.compositionUnavailable': 'Composition unavailable',
|
|
179
|
+
'workflows.block.notPublished': 'Not published',
|
|
180
|
+
/** A composition that is on the canvas more than once is told apart by a number. */
|
|
181
|
+
'workflows.block.numbered': '{name} ({number})',
|
|
182
|
+
'workflows.block.problems': '{count, plural, one {# problem} other {# problems}}',
|
|
183
|
+
// ===== The panel =====
|
|
184
|
+
'workflows.panel.label': 'Block settings',
|
|
185
|
+
'workflows.panel.overviewHeading': 'Workflow',
|
|
186
|
+
'workflows.panel.overviewHelp': 'Select a block to change it, or add one from the toolbar. Connect blocks by dragging from the point on the side of one to the point on the side of another.',
|
|
187
|
+
'workflows.panel.problemsHeading': 'Problems',
|
|
188
|
+
'workflows.panel.problemsLabel': 'Problems in this workflow',
|
|
189
|
+
'workflows.panel.noProblems': 'No problems found.',
|
|
190
|
+
'workflows.panel.manyBlocksSelected': '{count} blocks selected',
|
|
191
|
+
'workflows.panel.connectionSelected': 'A connection is selected.',
|
|
192
|
+
'workflows.panel.removeBlock': 'Remove block',
|
|
193
|
+
'workflows.panel.removeBlocks': 'Remove blocks',
|
|
194
|
+
'workflows.panel.removeConnection': 'Remove connection',
|
|
195
|
+
// ===== A composition block =====
|
|
196
|
+
'workflows.composition.heading': 'Composition',
|
|
197
|
+
'workflows.composition.help': 'The composition visitors see at this step.',
|
|
198
|
+
'workflows.composition.searchLabel': 'Search compositions',
|
|
199
|
+
'workflows.composition.searchPlaceholder': 'Search by name',
|
|
200
|
+
'workflows.composition.none': 'No compositions found.',
|
|
201
|
+
'workflows.composition.alreadyUsed': 'Already in this workflow',
|
|
202
|
+
'workflows.composition.isStart': 'Visitors start here.',
|
|
203
|
+
'workflows.composition.makeStart': 'Make this the start',
|
|
204
|
+
'workflows.composition.capabilitiesHeading': 'What this composition offers',
|
|
205
|
+
'workflows.composition.capabilityInput': 'Input',
|
|
206
|
+
'workflows.composition.capabilityAction': 'Actions',
|
|
207
|
+
'workflows.composition.capabilityWebsites': 'Allowed websites',
|
|
208
|
+
/** `tables` is the names of the widget's tables, separated by commas. */
|
|
209
|
+
'workflows.composition.inputTables': 'Collects input in: {tables}',
|
|
210
|
+
'workflows.composition.actionCount': '{count, plural, one {# action reported} other {# actions reported}}',
|
|
211
|
+
// ===== A trigger block =====
|
|
212
|
+
'workflows.trigger.heading': 'Trigger',
|
|
213
|
+
'workflows.trigger.help': 'What has to happen for a visitor to move on from the composition before it.',
|
|
214
|
+
'workflows.trigger.kindLabel': 'Trigger type',
|
|
215
|
+
'workflows.trigger.kindInput': 'Input added',
|
|
216
|
+
'workflows.trigger.kindAction': 'Action in the widget',
|
|
217
|
+
'workflows.trigger.kindPageEvent': 'Event from your page',
|
|
218
|
+
'workflows.trigger.kindScheduled': 'Scheduled',
|
|
219
|
+
/** Why a kind of trigger cannot be chosen; `kind` is its name and `reason` one of the `reason.*` messages. */
|
|
220
|
+
'workflows.trigger.unavailable': '{kind} is not available here. {reason}',
|
|
221
|
+
'workflows.trigger.tableLabel': 'Table',
|
|
222
|
+
'workflows.trigger.tableHelp': 'The table of the widget that collects what visitors add.',
|
|
223
|
+
'workflows.trigger.actionLabel': 'Action',
|
|
224
|
+
'workflows.trigger.actionHelp': 'One of the actions the widget reports.',
|
|
225
|
+
'workflows.trigger.chooseOne': 'Choose one',
|
|
226
|
+
/** A table, column or action that was chosen and is not there any more. */
|
|
227
|
+
'workflows.trigger.notFound': '{name} (no longer available)',
|
|
228
|
+
'workflows.trigger.readableValues': 'A condition after this trigger can read: {values}.',
|
|
229
|
+
'workflows.trigger.noReadableValues': 'This trigger carries no values a condition could read.',
|
|
230
|
+
'workflows.trigger.nextLabel': 'Next step',
|
|
231
|
+
'workflows.trigger.nextHelp': 'The block that comes next once this trigger fires.',
|
|
232
|
+
'workflows.trigger.nextNone': 'Not connected yet',
|
|
233
|
+
'workflows.trigger.summaryInput': 'Input added in {table}',
|
|
234
|
+
'workflows.trigger.summaryAction': 'Action: {action}',
|
|
235
|
+
'workflows.trigger.summaryPageEvent': 'Page event: {name}',
|
|
236
|
+
'workflows.trigger.summaryAt': 'On {moment}',
|
|
237
|
+
'workflows.trigger.summaryUnfinished': 'Not finished',
|
|
238
|
+
'workflows.reason.widgetKeepsNoData': 'This widget does not keep visitor data.',
|
|
239
|
+
'workflows.reason.widgetReportsNoActions': 'This widget does not report any actions.',
|
|
240
|
+
'workflows.reason.widgetNotPublished': 'This composition is not published yet.',
|
|
241
|
+
// ===== Scheduled =====
|
|
242
|
+
'workflows.schedule.modeLabel': 'When',
|
|
243
|
+
'workflows.schedule.modeAfter': 'After a wait',
|
|
244
|
+
'workflows.schedule.modeAt': 'At a date and time',
|
|
245
|
+
'workflows.schedule.afterHelp': 'The wait starts when the visitor reaches this step.',
|
|
246
|
+
'workflows.schedule.amountLabel': 'Wait for',
|
|
247
|
+
'workflows.schedule.unitLabel': 'Unit',
|
|
248
|
+
'workflows.schedule.unitSeconds': 'Seconds',
|
|
249
|
+
'workflows.schedule.unitMinutes': 'Minutes',
|
|
250
|
+
'workflows.schedule.unitHours': 'Hours',
|
|
251
|
+
'workflows.schedule.unitDays': 'Days',
|
|
252
|
+
'workflows.schedule.unitWeeks': 'Weeks',
|
|
253
|
+
'workflows.schedule.waitSeconds': '{count, plural, one {Wait # second} other {Wait # seconds}}',
|
|
254
|
+
'workflows.schedule.waitMinutes': '{count, plural, one {Wait # minute} other {Wait # minutes}}',
|
|
255
|
+
'workflows.schedule.waitHours': '{count, plural, one {Wait # hour} other {Wait # hours}}',
|
|
256
|
+
'workflows.schedule.waitDays': '{count, plural, one {Wait # day} other {Wait # days}}',
|
|
257
|
+
'workflows.schedule.waitWeeks': '{count, plural, one {Wait # week} other {Wait # weeks}}',
|
|
258
|
+
'workflows.schedule.momentLabel': 'Date and time',
|
|
259
|
+
/** `zone` is the time zone of the workflow (`Europe/Bucharest`). */
|
|
260
|
+
'workflows.schedule.momentHelp': 'In the time zone of the workflow: {zone}.',
|
|
261
|
+
'workflows.schedule.invalidMoment': 'Enter a valid date and time.',
|
|
262
|
+
// ===== Event from the page =====
|
|
263
|
+
'workflows.event.nameLabel': 'Event name',
|
|
264
|
+
'workflows.event.namePlaceholder': 'For example, checkout-started',
|
|
265
|
+
'workflows.event.nameHelp': 'The name your page uses when it sends the event.',
|
|
266
|
+
'workflows.event.nameInvalid': 'Use only letters, numbers and . _ : - (up to 64 characters).',
|
|
267
|
+
'workflows.event.howToSend': 'Send it from your page with sendWorkflowEvent(host, name, values), or dispatch a widgetic:workflow-event event on the embed.',
|
|
268
|
+
'workflows.event.valuesHeading': 'Values the event carries',
|
|
269
|
+
'workflows.event.valuesHelp': 'A condition after this trigger can read these values to choose the next step. They are never stored.',
|
|
270
|
+
'workflows.event.addValue': 'Add a value',
|
|
271
|
+
'workflows.event.valueName': 'Name of value {number}',
|
|
272
|
+
'workflows.event.valueNamePlaceholder': 'For example, plan',
|
|
273
|
+
'workflows.event.valueNameInvalid': 'Use only letters, numbers and . _ : - (up to 64 characters).',
|
|
274
|
+
'workflows.event.valueType': 'Type of value {number}',
|
|
275
|
+
'workflows.event.removeValue': 'Remove value {number}',
|
|
276
|
+
'workflows.fieldType.text': 'Text',
|
|
277
|
+
'workflows.fieldType.number': 'Number',
|
|
278
|
+
'workflows.fieldType.boolean': 'Yes or no',
|
|
279
|
+
'workflows.value.yes': 'Yes',
|
|
280
|
+
'workflows.value.no': 'No',
|
|
281
|
+
// ===== A condition block =====
|
|
282
|
+
'workflows.condition.heading': 'Condition',
|
|
283
|
+
'workflows.condition.help': 'Rules are checked in order. The first rule that matches decides the next step.',
|
|
284
|
+
'workflows.condition.noTrigger': 'Connect this condition to a trigger first: it reads the values that trigger carries.',
|
|
285
|
+
'workflows.condition.noValues': 'The trigger before this condition carries no values to compare.',
|
|
286
|
+
'workflows.condition.addRule': 'Add rule',
|
|
287
|
+
'workflows.condition.ruleLimit': 'A condition can have at most {max} rules.',
|
|
288
|
+
'workflows.condition.defaultName': 'Default',
|
|
289
|
+
'workflows.condition.defaultLabel': 'When no rule matches',
|
|
290
|
+
'workflows.condition.defaultStay': 'Stay on the current composition',
|
|
291
|
+
'workflows.condition.defaultHelp': 'Where the visitor goes when no rule matches. Leave it unconnected to keep the visitor where they are.',
|
|
292
|
+
'workflows.condition.defaultHint': 'When no rule matches',
|
|
293
|
+
'workflows.condition.defaultStays': 'When no rule matches: stay here',
|
|
294
|
+
'workflows.rule.defaultName': 'Rule {number}',
|
|
295
|
+
/** `name` is the name of the rule. */
|
|
296
|
+
'workflows.rule.nameLabel': 'Name of {name}',
|
|
297
|
+
'workflows.rule.moveUp': 'Move {name} up',
|
|
298
|
+
'workflows.rule.moveDown': 'Move {name} down',
|
|
299
|
+
'workflows.rule.remove': 'Remove {name}',
|
|
300
|
+
'workflows.rule.matchLabel': 'Match',
|
|
301
|
+
'workflows.rule.matchAll': 'All of these',
|
|
302
|
+
'workflows.rule.matchAny': 'Any of these',
|
|
303
|
+
'workflows.rule.noTests': 'No tests yet. Add one.',
|
|
304
|
+
'workflows.rule.addTest': 'Add test',
|
|
305
|
+
'workflows.rule.testLimit': 'A rule can have at most {max} tests.',
|
|
306
|
+
'workflows.rule.thenGoTo': 'If {name} matches, go to',
|
|
307
|
+
/** One test as a phrase: `Plan is Pro`. A language can put the three parts in the order it says them in. */
|
|
308
|
+
'workflows.rule.testWithValue': '{field} {operator} {value}',
|
|
309
|
+
'workflows.rule.testWithoutValue': '{field} {operator}',
|
|
310
|
+
'workflows.rule.testAndMore': '{summary} and {count, plural, one {# more test} other {# more tests}}',
|
|
311
|
+
'workflows.test.field': 'Value of test {number}',
|
|
312
|
+
'workflows.test.operator': 'Comparison of test {number}',
|
|
313
|
+
'workflows.test.value': 'Compare with, test {number}',
|
|
314
|
+
'workflows.test.valuePlaceholder': 'Value to compare with',
|
|
315
|
+
'workflows.test.remove': 'Remove test {number}',
|
|
316
|
+
'workflows.operator.is': 'is',
|
|
317
|
+
'workflows.operator.isNot': 'is not',
|
|
318
|
+
'workflows.operator.contains': 'contains',
|
|
319
|
+
'workflows.operator.doesNotContain': 'does not contain',
|
|
320
|
+
'workflows.operator.startsWith': 'starts with',
|
|
321
|
+
'workflows.operator.endsWith': 'ends with',
|
|
322
|
+
'workflows.operator.greaterThan': 'is greater than',
|
|
323
|
+
'workflows.operator.atLeast': 'is at least',
|
|
324
|
+
'workflows.operator.lessThan': 'is less than',
|
|
325
|
+
'workflows.operator.atMost': 'is at most',
|
|
326
|
+
'workflows.operator.isEmpty': 'is empty',
|
|
327
|
+
'workflows.operator.isNotEmpty': 'is not empty',
|
|
328
|
+
// ===== Test run =====
|
|
329
|
+
'workflows.test.heading': 'Test run',
|
|
330
|
+
'workflows.test.help': 'Play a visitor on the draft. Nothing is sent and no visit is counted.',
|
|
331
|
+
'workflows.test.close': 'Close test run',
|
|
332
|
+
'workflows.test.start': 'Start a test run',
|
|
333
|
+
'workflows.test.restart': 'Start over',
|
|
334
|
+
'workflows.test.ended': 'The test run ended because the draft changed. Start a new one to try the latest draft.',
|
|
335
|
+
'workflows.test.noStart': 'Choose a starting composition to run a test.',
|
|
336
|
+
'workflows.test.noTriggers': 'This composition has no triggers to fire. The visitor stays here.',
|
|
337
|
+
/** `name` is the block the test visitor is on. */
|
|
338
|
+
'workflows.test.visitorIsOn': 'The test visitor is on {name}.',
|
|
339
|
+
'workflows.test.fire': 'Fire this trigger',
|
|
340
|
+
'workflows.test.resultMoved': 'The visitor moved to {name}.',
|
|
341
|
+
'workflows.test.resultStayed': 'The visitor stayed on this composition.',
|
|
342
|
+
'workflows.test.resultIgnored': 'Nothing happened: this trigger does not apply here.',
|
|
343
|
+
// ===== Versions =====
|
|
344
|
+
'workflows.history.heading': 'Version history',
|
|
345
|
+
'workflows.history.help': 'Every publish is saved as a version. Visitors who started on a version finish on it.',
|
|
346
|
+
'workflows.history.close': 'Close version history',
|
|
347
|
+
'workflows.history.none': 'No versions yet. Publish the workflow to make the first.',
|
|
348
|
+
'workflows.history.failed': 'The versions could not be loaded.',
|
|
349
|
+
'workflows.history.version': 'Version {number}',
|
|
350
|
+
'workflows.history.live': 'Live',
|
|
351
|
+
'workflows.history.by': 'Published by {name}',
|
|
352
|
+
'workflows.history.view': 'View',
|
|
353
|
+
'workflows.history.viewing': 'Viewing version {number} (read-only)',
|
|
354
|
+
'workflows.history.backToDraft': 'Back to the draft',
|
|
355
|
+
'workflows.history.restore': 'Restore this version',
|
|
356
|
+
'workflows.history.restoreTitle': 'Restore version {number}?',
|
|
357
|
+
'workflows.history.restoreMessage': 'Version {number} is copied into the draft and replaces its unpublished changes. It goes live only when you publish.',
|
|
358
|
+
// ===== The runs tab =====
|
|
359
|
+
'workflows.runs.help': 'Counts only: how many visitors reached each composition and followed each path. What visitors typed is never stored.',
|
|
360
|
+
'workflows.runs.rangeLabel': 'Period',
|
|
361
|
+
'workflows.runs.lastDays': 'Last {count, plural, one {# day} other {# days}}',
|
|
362
|
+
'workflows.runs.versionLabel': 'Version',
|
|
363
|
+
'workflows.runs.allVersions': 'All versions',
|
|
364
|
+
'workflows.runs.versionLive': 'Version {number} (live)',
|
|
365
|
+
'workflows.runs.started': '{count, plural, one {# visitor started} other {# visitors started}}',
|
|
366
|
+
'workflows.runs.entered': '{count} entered',
|
|
367
|
+
'workflows.runs.fired': '{count} fired',
|
|
368
|
+
'workflows.runs.failed': '{count} could not be shown',
|
|
369
|
+
'workflows.runs.none': 'No visitors in this period.',
|
|
370
|
+
'workflows.runs.neverPublished': 'Publish this workflow to start counting visitors.',
|
|
371
|
+
// ===== The settings tab, and what can be done to a workflow =====
|
|
372
|
+
'workflows.settings.zoneHeading': 'Time zone',
|
|
373
|
+
'workflows.settings.zoneLabel': 'Time zone of the workflow',
|
|
374
|
+
'workflows.settings.zoneHelp': 'Scheduled dates and times use this time zone.',
|
|
375
|
+
'workflows.settings.embedHeading': 'Embed',
|
|
376
|
+
'workflows.settings.embedHelp': 'Show this workflow on a page with its embed code.',
|
|
377
|
+
'workflows.settings.stateHeading': 'State',
|
|
378
|
+
'workflows.settings.pause': 'Pause',
|
|
379
|
+
'workflows.settings.pauseHelp': 'While the workflow is paused, embeds show only their first composition. Visitors keep their place.',
|
|
380
|
+
'workflows.settings.resume': 'Resume',
|
|
381
|
+
'workflows.settings.resumeHelp': 'The workflow is paused. Resume it to move visitors again.',
|
|
382
|
+
'workflows.settings.archive': 'Archive',
|
|
383
|
+
'workflows.settings.archiveHelp': 'Take a published workflow out of the list. Embeds that use it show only their first composition.',
|
|
384
|
+
'workflows.settings.archiveTitle': 'Archive this workflow?',
|
|
385
|
+
'workflows.settings.archiveMessage': 'Embeds that use this workflow show only their first composition. You can restore it later.',
|
|
386
|
+
'workflows.settings.unarchive': 'Restore',
|
|
387
|
+
'workflows.settings.unarchiveHelp': 'Bring this workflow back to the list.',
|
|
388
|
+
'workflows.settings.duplicate': 'Duplicate',
|
|
389
|
+
'workflows.settings.duplicateHelp': 'Make a copy of this workflow as a new draft.',
|
|
390
|
+
'workflows.settings.delete': 'Delete',
|
|
391
|
+
'workflows.settings.deleteHelp': 'Delete this draft for good.',
|
|
392
|
+
'workflows.settings.deleteBlocked': 'A workflow that was published can only be archived, because pages may still use it.',
|
|
393
|
+
'workflows.settings.deleteTitle': 'Delete this workflow?',
|
|
394
|
+
'workflows.settings.deleteMessage': '“{name}” is deleted for good.',
|
|
395
|
+
// ===== What the engine found wrong with a workflow =====
|
|
396
|
+
// `block` is what the block is called on the canvas; `name` and `field` are what the problem is about.
|
|
397
|
+
'workflows.issue.unknown': 'Something is wrong with this workflow.',
|
|
398
|
+
'workflows.issue.malformed': 'This workflow could not be read.',
|
|
399
|
+
'workflows.issue.schemaVersion': 'This workflow was saved by a newer version and cannot be opened here.',
|
|
400
|
+
'workflows.issue.graphTooLarge': 'This workflow is too large.',
|
|
401
|
+
'workflows.issue.unknownNodeType': 'A block of an unknown kind was found.',
|
|
402
|
+
'workflows.issue.unknownTriggerKind': '{block} is a kind of trigger that is not known.',
|
|
403
|
+
'workflows.issue.badId': 'A block has an id that is not valid.',
|
|
404
|
+
'workflows.issue.duplicateId': 'Two blocks have the same id.',
|
|
405
|
+
'workflows.issue.tooManyBlocks': 'A workflow can have at most {maxBlocks} blocks.',
|
|
406
|
+
'workflows.issue.tooManyEdges': 'This workflow has too many connections.',
|
|
407
|
+
'workflows.issue.noComposition': 'Add at least one composition.',
|
|
408
|
+
'workflows.issue.noStart': 'Choose the composition that starts the workflow.',
|
|
409
|
+
'workflows.issue.manyStarts': 'Only one composition can start the workflow.',
|
|
410
|
+
'workflows.issue.compositionMissingId': '{block} has no composition chosen.',
|
|
411
|
+
'workflows.issue.duplicateComposition': '{block} is used more than once. Each composition has one block.',
|
|
412
|
+
'workflows.issue.compositionNotAvailable': '{block} is not available. It may have been deleted or is not published.',
|
|
413
|
+
'workflows.issue.compositionWebsiteMismatch': '{block} is not allowed on the website where the embed is shown. Check its allowed websites.',
|
|
414
|
+
'workflows.issue.unreachableBlock': '{block} cannot be reached from the start.',
|
|
415
|
+
'workflows.issue.edgeUnknownNode': 'A connection points to a block that is not there.',
|
|
416
|
+
'workflows.issue.edgeBadPort': 'A connection leaves a block from a point it does not have.',
|
|
417
|
+
'workflows.issue.edgeInvalidConnection': 'A connection joins two blocks that cannot be joined.',
|
|
418
|
+
'workflows.issue.portManyTargets': '{block} leads to more than one next step. Keep one.',
|
|
419
|
+
'workflows.issue.cycle': 'The workflow goes back to a step it already passed. Workflows only move forward.',
|
|
420
|
+
'workflows.issue.triggerNoSource': '{block} has no composition before it.',
|
|
421
|
+
'workflows.issue.triggerManySources': '{block} follows more than one composition.',
|
|
422
|
+
'workflows.issue.triggerNoTarget': '{block} has no next step. Connect it.',
|
|
423
|
+
'workflows.issue.triggerConfigIncomplete': '{block} is not finished.',
|
|
424
|
+
'workflows.issue.triggerNeedsTable': '{block} needs a table.',
|
|
425
|
+
'workflows.issue.triggerNeedsAction': '{block} needs an action.',
|
|
426
|
+
'workflows.issue.triggerNeedsName': '{block} needs an event name.',
|
|
427
|
+
'workflows.issue.scheduleInvalid': '{block} has a wait or a date that is not valid.',
|
|
428
|
+
'workflows.issue.eventValueInvalid': '{block} has a value that is not valid: {name}.',
|
|
429
|
+
'workflows.issue.eventTooManyValues': '{block} carries too many values.',
|
|
430
|
+
'workflows.issue.triggerCapabilityMissing': '{block} uses something its composition does not offer.',
|
|
431
|
+
'workflows.issue.triggerInputMissing': 'The composition of {block} no longer collects input in {name}.',
|
|
432
|
+
'workflows.issue.triggerActionMissing': 'The composition of {block} no longer reports the action {name}.',
|
|
433
|
+
'workflows.issue.conditionNoSource': '{block} has no trigger before it.',
|
|
434
|
+
'workflows.issue.conditionManySources': '{block} follows more than one trigger.',
|
|
435
|
+
'workflows.issue.conditionNoCases': '{block} has no rules. Add at least one.',
|
|
436
|
+
'workflows.issue.conditionTooManyCases': '{block} can have at most {maxRules} rules.',
|
|
437
|
+
'workflows.issue.caseBadId': 'A rule of {block} has an id that is not valid.',
|
|
438
|
+
'workflows.issue.caseDuplicateId': 'Two rules of {block} have the same id.',
|
|
439
|
+
'workflows.issue.caseNoTests': 'A rule of {block} has no tests. Add one.',
|
|
440
|
+
'workflows.issue.caseTooManyTests': 'A rule of {block} can have at most {maxTests} tests.',
|
|
441
|
+
'workflows.issue.caseNoTarget': 'A rule of {block} does not lead anywhere. Connect it to a next step.',
|
|
442
|
+
'workflows.issue.testBadField': 'A test of {block} reads a value its trigger does not carry.',
|
|
443
|
+
'workflows.issue.testBadOperator': 'A test of {block} uses a comparison that does not fit its value.',
|
|
444
|
+
'workflows.issue.testMissingValue': 'A test of {block} needs a value to compare with.',
|
|
445
|
+
'workflows.issue.fieldUnknown': 'A test of {block} reads {field}, which the composition no longer has.'
|
|
33
446
|
};
|
package/dist/index.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
-
export { Workflows
|
|
1
|
+
export { Workflows } from './components/index.js';
|
|
2
2
|
export { WORKFLOWS_MESSAGES, checkWorkflowsMessages, provideWorkflowsLanguage, useWorkflowsLanguage, type WorkflowsMessageKey } from './i18n/index.js';
|
|
3
3
|
export type { WorkflowsError, WorkflowsErrorCode, WorkflowsProps } from './types/index.js';
|
|
4
|
+
export type { AccessTokenFunction } from './api/types.js';
|
package/dist/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// Reexport your entry components here
|
|
2
2
|
// The screen. Everything a page needs to show workflows is this one component.
|
|
3
|
-
export { Workflows
|
|
3
|
+
export { Workflows } from './components/index.js';
|
|
4
4
|
// The words of the screen, and the check a page runs on its own translations.
|
|
5
5
|
export { WORKFLOWS_MESSAGES, checkWorkflowsMessages, provideWorkflowsLanguage, useWorkflowsLanguage } from './i18n/index.js';
|
package/dist/types/index.d.ts
CHANGED
|
@@ -1,8 +1,13 @@
|
|
|
1
1
|
import type { TextDirection } from '@widgetic/design-system/i18n';
|
|
2
|
+
import type { AccessTokenFunction } from '../api/types.js';
|
|
2
3
|
/** Why `onError` was called. */
|
|
3
4
|
export type WorkflowsErrorCode =
|
|
4
5
|
/** A part of the screen threw while it was being drawn. The screen shows "Try again" in its place. */
|
|
5
|
-
'RENDER_FAILED'
|
|
6
|
+
'RENDER_FAILED'
|
|
7
|
+
/** A request to the Widgetic API failed (offline, refused, a server error). The screen tells the person; this is for the page. */
|
|
8
|
+
| 'REQUEST_FAILED'
|
|
9
|
+
/** The person's session is over: the page's `getAccessToken` could not give a token the API accepts. */
|
|
10
|
+
| 'SESSION_ENDED';
|
|
6
11
|
/**
|
|
7
12
|
* What `onError` is told when something goes wrong. The screen shows the problem to the person using it by itself; this is
|
|
8
13
|
* for the page around it. The `message` is English, for the page's developer: it is not a sentence to show a visitor.
|
|
@@ -10,11 +15,32 @@ export type WorkflowsErrorCode =
|
|
|
10
15
|
export interface WorkflowsError {
|
|
11
16
|
message: string;
|
|
12
17
|
code: WorkflowsErrorCode;
|
|
13
|
-
/** `true` when the screen cannot go on. A part that failed to draw is not fatal: the person can try again. */
|
|
18
|
+
/** `true` when the screen cannot go on. A part that failed to draw, or a request that failed, is not fatal: the person can try again. */
|
|
14
19
|
fatal: boolean;
|
|
15
20
|
}
|
|
16
|
-
/** What the `Workflows` component takes.
|
|
21
|
+
/** What the `Workflows` component takes. */
|
|
17
22
|
export interface WorkflowsProps {
|
|
23
|
+
/** The Widgetic API origin, without `/v1` (`https://api.widgetic.com`). */
|
|
24
|
+
apiUrl: string;
|
|
25
|
+
/**
|
|
26
|
+
* Gives the screen a token for the API. It is called with `'initial'` for the first request and `'expired'` (with the token
|
|
27
|
+
* the API refused) after a refusal; whatever it answers is used, and the screen never stores a token anywhere.
|
|
28
|
+
*/
|
|
29
|
+
getAccessToken: AccessTokenFunction;
|
|
30
|
+
/** `personal`, or the id of the organization whose workflows are shown. A change of it starts the screen again. */
|
|
31
|
+
workspaceId: string;
|
|
32
|
+
/**
|
|
33
|
+
* The workflow that is open, or nothing for the list. The page owns it (it is part of the page's address) and is told
|
|
34
|
+
* about every change through `onOpenWorkflow`; left out, the screen keeps track by itself.
|
|
35
|
+
*/
|
|
36
|
+
workflowId?: string | null;
|
|
37
|
+
/** The person opened a workflow (its id), or went back to the list (`null`). */
|
|
38
|
+
onOpenWorkflow?: (workflowId: string | null) => void;
|
|
39
|
+
/**
|
|
40
|
+
* Shows the embed code of a workflow (the tag to put on a page). The dialog belongs to the page, which knows how the tag
|
|
41
|
+
* is built for its embed SDK; without this the screen shows no embed-code button.
|
|
42
|
+
*/
|
|
43
|
+
onShowEmbedCode?: (workflowId: string) => void;
|
|
18
44
|
/**
|
|
19
45
|
* A BCP 47 language tag (`de`, `pt-BR`, `ar-EG`): the plural rules and how numbers and dates are written. It translates
|
|
20
46
|
* nothing by itself (see `messages`). Blank or left out is English.
|
|
@@ -35,4 +61,6 @@ export interface WorkflowsProps {
|
|
|
35
61
|
class?: string;
|
|
36
62
|
/** Called when something goes wrong, once for each failure. See {@link WorkflowsError}. */
|
|
37
63
|
onError?: (error: WorkflowsError) => void;
|
|
64
|
+
/** For tests and previews: the `fetch` the screen asks the API with. The page's own `fetch` when left out. */
|
|
65
|
+
fetchImplementation?: typeof fetch;
|
|
38
66
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@widgetic/workflows",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.2.0",
|
|
4
4
|
"description": "Workflows for Widgetic: chain compositions together with filters that decide which composition an embed shows. One Svelte package that the Widgetic site, partners and Shopify all load.",
|
|
5
5
|
"license": "SEE LICENSE IN LICENSE",
|
|
6
6
|
"type": "module",
|
|
@@ -50,6 +50,10 @@
|
|
|
50
50
|
"lint": "prettier --check . && eslint .",
|
|
51
51
|
"format": "prettier --write ."
|
|
52
52
|
},
|
|
53
|
+
"dependencies": {
|
|
54
|
+
"@widgetic/workflows-engine": "^0.1.1",
|
|
55
|
+
"kaykay": "0.3.0"
|
|
56
|
+
},
|
|
53
57
|
"peerDependencies": {
|
|
54
58
|
"@widgetic/design-system": ">=0.5.21",
|
|
55
59
|
"svelte": "^5.25.6"
|