@widgetic/workflows 0.2.7 → 0.2.8
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 +49 -43
- package/dist/components/Workflows.svelte +13 -15
- package/dist/components/WorkflowsEmptyState.svelte +14 -12
- package/dist/components/WorkflowsHeader.svelte +9 -5
- package/dist/components/WorkflowsHeader.svelte.d.ts +4 -16
- package/dist/components/WorkflowsWorkspace.svelte +3 -2
- package/dist/components/canvas/AddBlockMenu.svelte +11 -2
- package/dist/components/canvas/CanvasToolbar.svelte +42 -31
- package/dist/components/canvas/CanvasToolbar.svelte.d.ts +2 -0
- package/dist/components/canvas/CompositionNodeView.svelte +58 -36
- package/dist/components/canvas/ConditionNodeView.svelte +31 -18
- package/dist/components/canvas/HandlePoint.svelte +10 -3
- package/dist/components/canvas/HandlePoint.svelte.d.ts +1 -1
- package/dist/components/canvas/TriggerNodeView.svelte +39 -13
- package/dist/components/canvas/WorkflowCanvas.svelte +22 -7
- package/dist/components/canvas/WorkflowCanvas.svelte.d.ts +2 -0
- package/dist/components/canvas/WorkflowEdgeView.svelte +5 -6
- package/dist/components/editor/ConflictBanner.svelte +1 -1
- package/dist/components/editor/EditorBanners.svelte +11 -4
- package/dist/components/editor/EditorCanvasArea.svelte +17 -10
- package/dist/components/editor/EditorTabs.svelte +10 -44
- package/dist/components/editor/EditorTopBar.svelte +166 -54
- package/dist/components/editor/PresenceBanner.svelte +106 -85
- package/dist/components/editor/RunsFlow.svelte +100 -17
- package/dist/components/editor/RunsTab.svelte +52 -46
- package/dist/components/editor/SettingsRow.svelte +35 -0
- package/dist/components/editor/SettingsRow.svelte.d.ts +14 -0
- package/dist/components/editor/SettingsTab.svelte +66 -50
- package/dist/components/editor/WorkflowEditor.svelte +4 -5
- package/dist/components/list/CreateWorkflowDialog.svelte +123 -73
- package/dist/components/list/WorkflowList.svelte +227 -100
- package/dist/components/list/WorkflowRow.svelte +84 -42
- package/dist/components/panel/BlockProblems.svelte +9 -8
- package/dist/components/panel/CompositionForm.svelte +52 -34
- package/dist/components/panel/CompositionPicker.svelte +43 -21
- package/dist/components/panel/CompositionPicker.svelte.d.ts +5 -0
- package/dist/components/panel/CompositionSelect.svelte +105 -0
- package/dist/components/panel/CompositionSelect.svelte.d.ts +23 -0
- package/dist/components/panel/ConditionForm.svelte +50 -17
- package/dist/components/panel/EventValueRow.svelte +5 -4
- package/dist/components/panel/ProblemsList.svelte +17 -19
- package/dist/components/panel/RuleCard.svelte +127 -89
- package/dist/components/panel/RuleCard.svelte.d.ts +2 -0
- package/dist/components/panel/SidePanel.svelte +101 -50
- package/dist/components/panel/TestResultLine.svelte +35 -0
- package/dist/components/panel/TestResultLine.svelte.d.ts +9 -0
- package/dist/components/panel/TestRow.svelte +21 -18
- package/dist/components/panel/TestRunPanel.svelte +61 -39
- package/dist/components/panel/TestTriggerCard.svelte +66 -6
- package/dist/components/panel/TestTriggerCard.svelte.d.ts +10 -0
- package/dist/components/panel/TriggerForm.svelte +24 -25
- package/dist/components/panel/VersionHistory.svelte +31 -43
- package/dist/components/ui/ActionButton.svelte +44 -12
- package/dist/components/ui/ActionButton.svelte.d.ts +2 -1
- package/dist/components/ui/Badge.svelte +39 -0
- package/dist/components/ui/Badge.svelte.d.ts +12 -0
- package/dist/components/ui/ConfirmDialog.svelte +4 -3
- package/dist/components/ui/Menu.svelte +28 -14
- package/dist/components/ui/Menu.svelte.d.ts +3 -1
- package/dist/components/ui/Modal.svelte +15 -8
- package/dist/components/ui/Notice.svelte +35 -11
- package/dist/components/ui/Notice.svelte.d.ts +4 -1
- package/dist/components/ui/SelectField.svelte +48 -20
- package/dist/components/ui/SelectField.svelte.d.ts +2 -0
- package/dist/components/ui/StatusBadge.svelte +13 -24
- package/dist/components/ui/StatusBadge.svelte.d.ts +0 -2
- package/dist/components/ui/Tabs.svelte +79 -0
- package/dist/components/ui/Tabs.svelte.d.ts +21 -0
- package/dist/components/ui/TextField.svelte +47 -27
- package/dist/components/ui/TextField.svelte.d.ts +5 -0
- package/dist/components/ui/icons.d.ts +43 -29
- package/dist/components/ui/icons.js +101 -40
- package/dist/editor/editorState.svelte.d.ts +23 -2
- package/dist/editor/editorState.svelte.js +36 -0
- package/dist/editor/listState.svelte.d.ts +32 -2
- package/dist/editor/listState.svelte.js +41 -0
- package/dist/i18n/language.d.ts +3 -3
- package/dist/i18n/messages.d.ts +22 -13
- package/dist/i18n/messages.js +23 -14
- package/dist/i18n/statusWords.d.ts +12 -0
- package/dist/i18n/statusWords.js +12 -0
- package/package.json +3 -3
|
@@ -8,9 +8,10 @@
|
|
|
8
8
|
the widgets it chains and a draft workflow wired like it, so the composition is not chosen here and the name may be left
|
|
9
9
|
empty (the workflow is named after the preset).
|
|
10
10
|
|
|
11
|
-
The presets are asked for when the dialog opens.
|
|
12
|
-
|
|
13
|
-
|
|
11
|
+
The presets are asked for when the dialog opens. While they are on the way the blank start is shown with a line that says so;
|
|
12
|
+
a workspace that is offered none (most are) then sees the dialog as it always was: the choices stay only when there is a
|
|
13
|
+
preset to choose, and when the presets cannot be read the dialog says so and the blank start keeps working. The name is the
|
|
14
|
+
only thing a blank start requires, so the dialog never asks for what it could do without.
|
|
14
15
|
-->
|
|
15
16
|
<script lang="ts">
|
|
16
17
|
import { onMount } from 'svelte';
|
|
@@ -19,7 +20,7 @@
|
|
|
19
20
|
import { useListState } from '../../editor/listState.svelte.js';
|
|
20
21
|
import { canStartNow, chosenPresetOf, picturesOf } from '../../editor/presetChoice.js';
|
|
21
22
|
import { useWorkflowsLanguage } from '../../i18n/language.js';
|
|
22
|
-
import
|
|
23
|
+
import CompositionSelect from '../panel/CompositionSelect.svelte';
|
|
23
24
|
import ActionButton from '../ui/ActionButton.svelte';
|
|
24
25
|
import Icon from '../ui/Icon.svelte';
|
|
25
26
|
import Modal from '../ui/Modal.svelte';
|
|
@@ -78,14 +79,16 @@
|
|
|
78
79
|
});
|
|
79
80
|
</script>
|
|
80
81
|
|
|
81
|
-
<Modal title={$t('workflows.create.title')} size="
|
|
82
|
+
<Modal title={$t('workflows.create.title')} size="large" busy={isCreating} onclose={oncancel}>
|
|
82
83
|
<!-- svelte-ignore a11y_no_static_element_interactions -->
|
|
83
84
|
<div class="flex flex-col gap-4" onkeydown={handleKeydown}>
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
<
|
|
88
|
-
|
|
85
|
+
<!-- While the presets are being asked for, the blank start is already there (it works without them) and the line below says what is going on. -->
|
|
86
|
+
{#if list.presets.length > 0 || list.presetsState === 'loading'}
|
|
87
|
+
<fieldset class="flex min-w-0 flex-col gap-3" disabled={isCreating}>
|
|
88
|
+
<legend class="text-body-medium text-foreground">{$t('workflows.create.startLabel')}</legend
|
|
89
|
+
>
|
|
90
|
+
<div class="flex max-h-72 flex-col gap-2 overflow-auto">
|
|
91
|
+
<label class="flex cursor-pointer">
|
|
89
92
|
<input
|
|
90
93
|
type="radio"
|
|
91
94
|
name="{groupId}-start"
|
|
@@ -94,121 +97,168 @@
|
|
|
94
97
|
onchange={() => (list.chosenPresetKey = null)}
|
|
95
98
|
/>
|
|
96
99
|
<span
|
|
97
|
-
class="flex w-full items-
|
|
100
|
+
class="flex w-full items-start gap-3 rounded-lg border bg-background px-3 py-3 text-start transition-colors duration-fast peer-focus-visible:ring-2 peer-focus-visible:ring-ring peer-focus-visible:ring-offset-2 peer-focus-visible:ring-offset-background {chosenPreset ===
|
|
101
|
+
null
|
|
102
|
+
? 'border-primary ring-1 ring-inset ring-primary'
|
|
103
|
+
: 'border-border hover:bg-accent'}"
|
|
98
104
|
>
|
|
99
105
|
<span
|
|
100
|
-
class="flex
|
|
106
|
+
class="mt-0.5 flex size-4 shrink-0 items-center justify-center rounded-full border-2 {chosenPreset ===
|
|
107
|
+
null
|
|
108
|
+
? 'border-primary bg-primary'
|
|
109
|
+
: 'border-muted-foreground'}"
|
|
110
|
+
aria-hidden="true"
|
|
101
111
|
>
|
|
102
|
-
<
|
|
112
|
+
{#if chosenPreset === null}<span class="size-1.5 rounded-full bg-primary-foreground"
|
|
113
|
+
></span>{/if}
|
|
103
114
|
</span>
|
|
104
|
-
<span class="flex min-w-0 flex-1 flex-col">
|
|
105
|
-
<span class="
|
|
106
|
-
|
|
115
|
+
<span class="flex min-w-0 flex-1 flex-col gap-0.5">
|
|
116
|
+
<span class="text-body-medium text-foreground"
|
|
117
|
+
>{$t('workflows.create.blankTitle')}</span
|
|
118
|
+
>
|
|
119
|
+
<span class="text-caption text-muted-foreground"
|
|
120
|
+
>{$t('workflows.create.blankHint')}</span
|
|
121
|
+
>
|
|
107
122
|
</span>
|
|
108
123
|
</span>
|
|
109
124
|
</label>
|
|
110
125
|
{#each list.presets as preset (preset.key)}
|
|
111
126
|
{@const pictures = picturesOf(preset)}
|
|
112
|
-
|
|
127
|
+
{@const isChosen = chosenPreset?.key === preset.key}
|
|
128
|
+
<label class="flex cursor-pointer">
|
|
113
129
|
<input
|
|
114
130
|
type="radio"
|
|
115
131
|
name="{groupId}-start"
|
|
116
132
|
class="peer sr-only"
|
|
117
|
-
checked={
|
|
133
|
+
checked={isChosen}
|
|
118
134
|
onchange={() => (list.chosenPresetKey = preset.key)}
|
|
119
135
|
/>
|
|
120
136
|
<span
|
|
121
|
-
class="flex w-full items-start gap-3 rounded-
|
|
137
|
+
class="flex w-full items-start gap-3 rounded-lg border bg-background px-3 py-3 text-start transition-colors duration-fast peer-focus-visible:ring-2 peer-focus-visible:ring-ring peer-focus-visible:ring-offset-2 peer-focus-visible:ring-offset-background {isChosen
|
|
138
|
+
? 'border-primary ring-1 ring-inset ring-primary'
|
|
139
|
+
: 'border-border hover:bg-accent'}"
|
|
122
140
|
>
|
|
123
|
-
<span
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
141
|
+
<span
|
|
142
|
+
class="mt-0.5 flex size-4 shrink-0 items-center justify-center rounded-full border-2 {isChosen
|
|
143
|
+
? 'border-primary bg-primary'
|
|
144
|
+
: 'border-muted-foreground'}"
|
|
145
|
+
aria-hidden="true"
|
|
146
|
+
>
|
|
147
|
+
{#if isChosen}<span class="size-1.5 rounded-full bg-primary-foreground"
|
|
148
|
+
></span>{/if}
|
|
149
|
+
</span>
|
|
150
|
+
<span class="flex min-w-0 flex-1 flex-col gap-2">
|
|
151
|
+
{#if pictures.shown.some((widget) => widget.thumbnailUrl)}
|
|
152
|
+
<div class="flex shrink-0 flex-wrap items-center gap-1 pt-0.5">
|
|
153
|
+
{#each pictures.shown as widget, index (index)}
|
|
154
|
+
{#if widget.thumbnailUrl}
|
|
155
|
+
<img
|
|
156
|
+
src={widget.thumbnailUrl}
|
|
157
|
+
alt=""
|
|
158
|
+
loading="lazy"
|
|
159
|
+
draggable="false"
|
|
160
|
+
class="h-8 w-11 rounded-lg border border-border object-cover"
|
|
161
|
+
/>
|
|
162
|
+
{:else}
|
|
163
|
+
<span
|
|
164
|
+
class="flex h-8 w-11 items-center justify-center rounded-lg border border-border text-muted-foreground"
|
|
165
|
+
>
|
|
166
|
+
<Icon name="composition" class="size-4" />
|
|
167
|
+
</span>
|
|
168
|
+
{/if}
|
|
169
|
+
{/each}
|
|
170
|
+
{#if pictures.hiddenCount > 0}
|
|
171
|
+
<span class="text-caption text-muted-foreground"
|
|
172
|
+
>{$t('workflows.create.presetMorePictures', {
|
|
173
|
+
count: pictures.hiddenCount
|
|
174
|
+
})}</span
|
|
175
|
+
>
|
|
176
|
+
{/if}
|
|
177
|
+
</div>
|
|
178
|
+
{/if}
|
|
179
|
+
<span class="flex min-w-0 flex-col gap-0.5">
|
|
180
|
+
<span class="text-body-medium text-foreground" dir="auto">{preset.title}</span>
|
|
181
|
+
{#if preset.description}
|
|
182
|
+
<span class="line-clamp-2 text-caption text-muted-foreground" dir="auto"
|
|
183
|
+
>{preset.description}</span
|
|
136
184
|
>
|
|
137
|
-
<Icon name="composition" />
|
|
138
|
-
</span>
|
|
139
185
|
{/if}
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
count: pictures.hiddenCount
|
|
186
|
+
<span class="text-caption text-muted-foreground"
|
|
187
|
+
>{$t('workflows.create.presetSummary', {
|
|
188
|
+
blocks: preset.blockCount,
|
|
189
|
+
widgets: preset.widgets.length
|
|
145
190
|
})}</span
|
|
146
191
|
>
|
|
147
|
-
|
|
148
|
-
</span>
|
|
149
|
-
<span class="flex min-w-0 flex-1 flex-col">
|
|
150
|
-
<span class="truncate font-medium" dir="auto">{preset.title}</span>
|
|
151
|
-
{#if preset.description}
|
|
152
|
-
<span class="line-clamp-2 text-xs text-ink-muted" dir="auto"
|
|
153
|
-
>{preset.description}</span
|
|
154
|
-
>
|
|
155
|
-
{/if}
|
|
156
|
-
<span class="text-xs text-ink-muted"
|
|
157
|
-
>{$t('workflows.create.presetSummary', {
|
|
158
|
-
blocks: preset.blockCount,
|
|
159
|
-
widgets: preset.widgets.length
|
|
160
|
-
})}</span
|
|
161
|
-
>
|
|
192
|
+
</span>
|
|
162
193
|
</span>
|
|
163
194
|
</span>
|
|
164
195
|
</label>
|
|
165
196
|
{/each}
|
|
166
197
|
</div>
|
|
198
|
+
{#if list.presetsState === 'loading'}
|
|
199
|
+
<p class="flex items-center gap-2 px-2 text-body text-muted-foreground" role="status">
|
|
200
|
+
<Icon name="loader" class="size-4 shrink-0 motion-safe:animate-spin" />
|
|
201
|
+
{$t('workflows.create.presetsLoading')}
|
|
202
|
+
</p>
|
|
203
|
+
{/if}
|
|
167
204
|
</fieldset>
|
|
168
|
-
{:else if list.presetsState === 'loading'}
|
|
169
|
-
<p class="text-xs text-ink-muted" role="status">{$t('workflows.create.presetsLoading')}</p>
|
|
170
205
|
{:else if list.presetsState === 'failed'}
|
|
171
206
|
<div class="flex flex-wrap items-center gap-2">
|
|
172
|
-
<p class="text-
|
|
207
|
+
<p class="text-body text-muted-foreground" role="status">
|
|
208
|
+
{$t('workflows.create.presetsFailed')}
|
|
209
|
+
</p>
|
|
173
210
|
<ActionButton size="small" onclick={() => void list.loadPresets()}
|
|
174
211
|
>{$t('workflows.error.retry')}</ActionButton
|
|
175
212
|
>
|
|
176
213
|
</div>
|
|
177
214
|
{/if}
|
|
178
215
|
|
|
216
|
+
<!-- With a preset chosen the note about the copy comes first (or, while it is being made, what is happening), then the name. -->
|
|
217
|
+
{#if chosenPreset}
|
|
218
|
+
{#if isCreating}
|
|
219
|
+
<p class="flex items-center gap-2 text-caption text-muted-foreground" role="status">
|
|
220
|
+
<Icon name="loader" class="size-3.5 shrink-0 motion-safe:animate-spin" />
|
|
221
|
+
{$t('workflows.create.settingUp')}
|
|
222
|
+
</p>
|
|
223
|
+
{:else}
|
|
224
|
+
<p class="text-caption text-muted-foreground">{$t('workflows.create.presetHelp')}</p>
|
|
225
|
+
{/if}
|
|
226
|
+
{/if}
|
|
227
|
+
|
|
179
228
|
<TextField
|
|
180
229
|
label={$t('workflows.create.nameLabel')}
|
|
181
230
|
placeholder={chosenPreset ? chosenPreset.title : $t('workflows.create.namePlaceholder')}
|
|
182
231
|
help={chosenPreset ? $t('workflows.create.presetNameHelp') : undefined}
|
|
183
232
|
maxlength={MAX_WORKFLOW_NAME_LENGTH}
|
|
184
233
|
autofocus
|
|
234
|
+
disabled={isCreating}
|
|
185
235
|
bind:value={name}
|
|
186
236
|
/>
|
|
187
237
|
|
|
188
|
-
{#if chosenPreset}
|
|
189
|
-
<
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
selectedId={chosen?.id ?? null}
|
|
199
|
-
onpick={(option) => (chosen = chosen?.id === option.id ? null : option)}
|
|
200
|
-
/>
|
|
201
|
-
</div>
|
|
238
|
+
{#if !chosenPreset}
|
|
239
|
+
<CompositionSelect
|
|
240
|
+
label={$t('workflows.create.compositionLabel')}
|
|
241
|
+
valueLabel={chosen?.name ?? null}
|
|
242
|
+
placeholder={$t('workflows.create.compositionPlaceholder')}
|
|
243
|
+
help={$t('workflows.create.compositionHelp')}
|
|
244
|
+
selectedId={chosen?.id ?? null}
|
|
245
|
+
disabled={isCreating}
|
|
246
|
+
onpick={(option) => (chosen = chosen?.id === option.id ? null : option)}
|
|
247
|
+
/>
|
|
202
248
|
{/if}
|
|
203
249
|
{#if list.createFailure}
|
|
204
250
|
<Notice tone="problem">{$t(list.createFailure)}</Notice>
|
|
205
251
|
{/if}
|
|
206
252
|
</div>
|
|
207
253
|
{#snippet footer()}
|
|
208
|
-
<ActionButton disabled={isCreating} onclick={oncancel}
|
|
254
|
+
<ActionButton variant="outline" disabled={isCreating} onclick={oncancel}
|
|
209
255
|
>{$t('workflows.common.cancel')}</ActionButton
|
|
210
256
|
>
|
|
211
|
-
<ActionButton
|
|
257
|
+
<ActionButton
|
|
258
|
+
variant="primary"
|
|
259
|
+
disabled={!canCreate || isCreating}
|
|
260
|
+
onclick={() => void create()}
|
|
261
|
+
>
|
|
212
262
|
{isCreating ? $t('workflows.create.creating') : $t('workflows.create.create')}
|
|
213
263
|
</ActionButton>
|
|
214
264
|
{/snippet}
|