@w6w/ui 0.2.11 → 0.2.54
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +139 -2
- package/README.md +28 -10
- package/dist/AppPicker.d.ts +12 -1
- package/dist/CanvasContextMenu.d.ts +19 -0
- package/dist/{CodeBlock-BqXDA35P.js → CodeBlock-C-oIIYfC.js} +1436 -555
- package/dist/CodeBlock-C-oIIYfC.js.map +1 -0
- package/dist/CodeBlock-CymlfyeA.cjs +15 -0
- package/dist/CodeBlock-CymlfyeA.cjs.map +1 -0
- package/dist/CodeEditor.d.ts +4 -1
- package/dist/ConditionEditor.d.ts +11 -0
- package/dist/JsonEditor.d.ts +12 -0
- package/dist/ParamCustomization.d.ts +5 -0
- package/dist/ParamsForm.d.ts +11 -3
- package/dist/RouterEditor.d.ts +5 -0
- package/dist/StepBuilderModal.d.ts +83 -13
- package/dist/StepNameEditor.d.ts +11 -0
- package/dist/StopEditor.d.ts +5 -0
- package/dist/TriggerFillForm.d.ts +14 -1
- package/dist/WebhookListenPanel.d.ts +28 -0
- package/dist/WorkflowConnections.d.ts +29 -0
- package/dist/WorkflowFlowEditor.d.ts +64 -8
- package/dist/assets/script-completion.worker-DDJKkj5M.js +8290 -0
- package/dist/assets/script-completion.worker-DDJKkj5M.js.map +1 -0
- package/dist/canvas-context-menu.d.ts +27 -0
- package/dist/code.cjs +1 -1
- package/dist/code.mjs +3 -4
- package/dist/code.mjs.map +1 -1
- package/dist/components/AnchoredFlyout.d.ts +7 -0
- package/dist/components/ColumnsEditor.d.ts +27 -0
- package/dist/components/Combobox.d.ts +12 -1
- package/dist/components/CsvPanel.d.ts +21 -0
- package/dist/components/DataEntryEditor.d.ts +38 -0
- package/dist/components/DataEntryList.d.ts +33 -0
- package/dist/components/DataStoreList.d.ts +33 -0
- package/dist/components/DataTableGrid.d.ts +46 -0
- package/dist/components/EventbriteTriggerPicker.d.ts +7 -0
- package/dist/components/ExecutionDetail.d.ts +17 -1
- package/dist/components/ExecutionList.d.ts +19 -1
- package/dist/components/ExecutionLogPanel.d.ts +61 -3
- package/dist/components/ExpressionEditorModal.d.ts +33 -10
- package/dist/components/ExpressionOptions.d.ts +101 -15
- package/dist/components/HtmlPreview.d.ts +7 -0
- package/dist/components/JsonTree.d.ts +32 -0
- package/dist/components/ResolvedParams.d.ts +6 -1
- package/dist/components/ResultViewer.d.ts +46 -0
- package/dist/components/ScriptBindingsNotice.d.ts +31 -0
- package/dist/components/ScriptCodeField.d.ts +13 -0
- package/dist/components/StepStatusPill.d.ts +7 -0
- package/dist/components/expression-authoring.d.ts +13 -0
- package/dist/components/expression-dom.d.ts +17 -2
- package/dist/components/expression-template.d.ts +25 -3
- package/dist/components/icons.d.ts +1 -1
- package/dist/components/json-compose.d.ts +53 -0
- package/dist/components/result-format.d.ts +13 -0
- package/dist/condition-editor.d.ts +44 -0
- package/dist/data-stores/data-store-view.d.ts +371 -0
- package/dist/eventbrite-trigger-selection.d.ts +13 -0
- package/dist/flow-connect.d.ts +22 -16
- package/dist/flow-delete.d.ts +16 -0
- package/dist/flow-history.d.ts +75 -0
- package/dist/flow-layout.d.ts +13 -0
- package/dist/flow-loop-colors.d.ts +39 -0
- package/dist/flow-loop.d.ts +98 -0
- package/dist/flow-node-flags.d.ts +14 -0
- package/dist/flow-problems.d.ts +69 -0
- package/dist/flow-state.d.ts +20 -0
- package/dist/flow-types.d.ts +137 -9
- package/dist/flow-utils.d.ts +27 -13
- package/dist/flow.cjs +4 -2
- package/dist/flow.cjs.map +1 -1
- package/dist/flow.d.ts +7 -3
- package/dist/flow.mjs +3563 -1557
- package/dist/flow.mjs.map +1 -1
- package/dist/index.cjs +2 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +30 -4
- package/dist/index.mjs +2555 -1272
- package/dist/index.mjs.map +1 -1
- package/dist/node-samples-ChdyMBnJ.cjs +22 -0
- package/dist/node-samples-ChdyMBnJ.cjs.map +1 -0
- package/dist/node-samples-DkJL07EX.js +12302 -0
- package/dist/node-samples-DkJL07EX.js.map +1 -0
- package/dist/node-samples.d.ts +80 -0
- package/dist/output-shape.d.ts +30 -14
- package/dist/param-customization.d.ts +7 -0
- package/dist/provider.d.ts +119 -7
- package/dist/resolve-params.d.ts +45 -11
- package/dist/run-visuals.d.ts +14 -21
- package/dist/script-bindings.d.ts +63 -0
- package/dist/script-completion-service.d.ts +9 -0
- package/dist/script-completion.worker.d.ts +1 -0
- package/dist/script-completions.d.ts +2 -0
- package/dist/state-shape.d.ts +38 -0
- package/dist/step-preview-state.d.ts +155 -6
- package/dist/step-problems.d.ts +42 -12
- package/dist/test-inputs.d.ts +25 -0
- package/dist/trigger-registration.d.ts +28 -0
- package/dist/types.d.ts +70 -8
- package/dist/use-app-action-defs.d.ts +9 -1
- package/dist/use-test-input.d.ts +18 -0
- package/dist/workflow-connections.d.ts +30 -0
- package/package.json +16 -7
- package/src/code.css +60 -6
- package/src/styles/_canvas.scss +35 -0
- package/src/styles/_code-editor.scss +35 -0
- package/src/styles/_code.scss +6 -5
- package/src/styles/_copyable.scss +24 -0
- package/src/styles/_data-stores.scss +138 -0
- package/src/styles/_data-vars.scss +17 -6
- package/src/styles/_execution-history.scss +73 -0
- package/src/styles/_execution-log.scss +145 -1
- package/src/styles/_expression-modal.scss +106 -16
- package/src/styles/_fields.scss +11 -0
- package/src/styles/_flow.scss +160 -0
- package/src/styles/_fx.scss +3 -1
- package/src/styles/_incoming-state.scss +33 -0
- package/src/styles/_modal.scss +12 -0
- package/src/styles/_multiselect.scss +35 -0
- package/src/styles/_sections.scss +36 -0
- package/src/styles/_step-builder.scss +145 -0
- package/src/styles/_tester.scss +56 -0
- package/src/styles/_tokens.scss +27 -1
- package/src/styles.css +1290 -77
- package/src/styles.scss +2 -0
- package/dist/CodeBlock-BqXDA35P.js.map +0 -1
- package/dist/CodeBlock-CulfbnZD.cjs +0 -15
- package/dist/CodeBlock-CulfbnZD.cjs.map +0 -1
- package/dist/ConfirmModal-Ln99S9NT.js +0 -7919
- package/dist/ConfirmModal-Ln99S9NT.js.map +0 -1
- package/dist/ConfirmModal-fjHW5rN-.cjs +0 -14
- package/dist/ConfirmModal-fjHW5rN-.cjs.map +0 -1
- package/dist/Copyable-DA6eiU7w.cjs +0 -2
- package/dist/Copyable-DA6eiU7w.cjs.map +0 -1
- package/dist/Copyable-F4NTaG77.js +0 -847
- package/dist/Copyable-F4NTaG77.js.map +0 -1
package/dist/CodeEditor.d.ts
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
|
+
import { EditorView } from '@codemirror/view';
|
|
1
2
|
import { ThemeMode } from './types.ts';
|
|
2
3
|
/**
|
|
3
4
|
* A CodeMirror *editing* mode for `<CodeEditor>` — a distinct concept from the
|
|
4
5
|
* Prism *display-highlighting* grammar name a sibling module exports for
|
|
5
6
|
* rendered snippets. Deliberately its own type, not shared with that one.
|
|
6
7
|
*/
|
|
7
|
-
export type ScriptLanguage = "javascript" | "python";
|
|
8
|
+
export type ScriptLanguage = "javascript" | "typescript" | "python";
|
|
8
9
|
export interface CodeEditorProps {
|
|
9
10
|
value: string;
|
|
10
11
|
onChange: (value: string) => void;
|
|
@@ -30,6 +31,8 @@ export interface CodeEditorProps {
|
|
|
30
31
|
language?: ScriptLanguage;
|
|
31
32
|
/** Accessible label for the editor. */
|
|
32
33
|
"aria-label"?: string;
|
|
34
|
+
/** Called with the CodeMirror view once it exists — for inserting at the caret. */
|
|
35
|
+
onCreateEditor?: (view: EditorView) => void;
|
|
33
36
|
}
|
|
34
37
|
/**
|
|
35
38
|
* Plain-text-by-default code editor built on CodeMirror 6 — the same surface as
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The standard expression textbox on either side of each comparison row, the rows joined by
|
|
3
|
+
* one combinator (all of / any of / exactly one of). A condition the rows cannot express
|
|
4
|
+
* (a nested group, another operator) opens in the code view.
|
|
5
|
+
*/
|
|
6
|
+
export declare function ConditionEditor({ values, onChange, readOnly, purpose, }: {
|
|
7
|
+
values: Record<string, unknown>;
|
|
8
|
+
onChange: (values: Record<string, unknown>) => void;
|
|
9
|
+
readOnly?: boolean;
|
|
10
|
+
purpose?: "if" | "stop" | "router";
|
|
11
|
+
}): import("react").JSX.Element;
|
package/dist/JsonEditor.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { EditorView } from '@codemirror/view';
|
|
1
2
|
import { ReactNode } from 'react';
|
|
2
3
|
import { ThemeMode } from './types.ts';
|
|
3
4
|
export interface JsonEditorProps {
|
|
@@ -26,6 +27,17 @@ export interface JsonEditorProps {
|
|
|
26
27
|
* `minHeight` and `maxHeight` — an inline JSON/group field wants this.
|
|
27
28
|
*/
|
|
28
29
|
height?: string;
|
|
30
|
+
/**
|
|
31
|
+
* Receives the CodeMirror view once it exists — for a host that inserts text at the caret
|
|
32
|
+
* (the JSON compose pane of `ExpressionEditorModal`).
|
|
33
|
+
*/
|
|
34
|
+
onCreateEditor?: (view: EditorView) => void;
|
|
35
|
+
/** Fired when the editor loses focus. */
|
|
36
|
+
onBlur?: () => void;
|
|
37
|
+
/** Fired when the editor gains focus. */
|
|
38
|
+
onFocus?: () => void;
|
|
39
|
+
/** Show JSON syntax diagnostics. Defaults to true; forms can defer them until blur. */
|
|
40
|
+
showDiagnostics?: boolean;
|
|
29
41
|
/** Read-only mode — useful for previewing a stored definition. */
|
|
30
42
|
readOnly?: boolean;
|
|
31
43
|
/**
|
package/dist/ParamsForm.d.ts
CHANGED
|
@@ -42,11 +42,17 @@ export interface ParamsFormProps {
|
|
|
42
42
|
* tidy. Widget is chosen by `param.type` — same field-driven approach as
|
|
43
43
|
* `AuthFieldsForm`, extended with `text` (textarea) and `json` (JsonEditor).
|
|
44
44
|
*
|
|
45
|
-
* Values are collected into a plain object suitable for a step's `with`.
|
|
46
|
-
*
|
|
47
|
-
* view; this form deals in literals.
|
|
45
|
+
* Values are collected into a plain object suitable for a step's `with`. A field
|
|
46
|
+
* bound to a reference holds a `{{ }}` template string (`"{{ nodes.x.output.y }}"`).
|
|
48
47
|
*/
|
|
49
48
|
export declare function ParamsForm({ params, values, onChange, readOnly, dynamic }: ParamsFormProps): import("react").JSX.Element;
|
|
49
|
+
/** Entries one picker request asks for: a page, never the whole store. */
|
|
50
|
+
export declare const STORE_KEY_PAGE = 25;
|
|
51
|
+
/** One muted line under an entry's key: its value, shortened, and when it last changed. */
|
|
52
|
+
export declare function storeEntryDetail(entry: {
|
|
53
|
+
value?: unknown;
|
|
54
|
+
updatedAt?: string;
|
|
55
|
+
}): string;
|
|
50
56
|
/**
|
|
51
57
|
* One typed key/value entry in a `vars` param. `type` is a real value type only:
|
|
52
58
|
* `expression` is a binding *mode* (see {@link FxField}/`ExprValue`), not a value
|
|
@@ -60,3 +66,5 @@ export interface DataVar {
|
|
|
60
66
|
type: "string" | "number" | "boolean" | "json";
|
|
61
67
|
value: unknown;
|
|
62
68
|
}
|
|
69
|
+
/** Rows for a literal object or the existing typed-row format; bindings stay in JSON mode. */
|
|
70
|
+
export declare function dataVarRows(value: unknown, previous?: DataVar[]): DataVar[] | null;
|
|
@@ -1,15 +1,21 @@
|
|
|
1
1
|
import { NodeConfig } from './NodeConfigForm.tsx';
|
|
2
|
-
import { ExpressionStepSource } from './components/ExpressionOptions.tsx';
|
|
2
|
+
import { ExpressionLoopSource, ExpressionStepSource } from './components/ExpressionOptions.tsx';
|
|
3
3
|
import { InternalNodeDef } from './flow-types.ts';
|
|
4
|
-
import { StepStartState } from './provider.tsx';
|
|
5
|
-
import { ActionParam, AppSummary, FunctionSummary, ThemeMode, WorkflowDetail, WorkflowSummary } from './types.ts';
|
|
6
|
-
/** The step the builder emits — the editor assigns the final `id
|
|
7
|
-
*
|
|
4
|
+
import { StepStartState, W6WApi } from './provider.tsx';
|
|
5
|
+
import { ActionDef, ActionParam, AppSummary, FunctionSummary, ThemeMode, WorkflowDetail, WorkflowSummary } from './types.ts';
|
|
6
|
+
/** The step the builder emits — the editor assigns the final `id` unless `id` carries a
|
|
7
|
+
* name the user chose in the add flow. `NodeConfig` carries the base settings (retry /
|
|
8
|
+
* onError / notes) set on the Config view. */
|
|
8
9
|
export interface BuiltStep extends NodeConfig {
|
|
10
|
+
/** The node name chosen in the add flow; on `onDraftChange` it renames the minted node. */
|
|
11
|
+
id?: string;
|
|
9
12
|
uses: {
|
|
10
13
|
app: string;
|
|
11
14
|
action: string;
|
|
12
15
|
connection?: string | null;
|
|
16
|
+
connectionRef?: string;
|
|
17
|
+
/** Marks an app TRIGGER node (`action` is the trigger key); the engine/server read it. */
|
|
18
|
+
trigger?: true;
|
|
13
19
|
};
|
|
14
20
|
with?: Record<string, unknown>;
|
|
15
21
|
}
|
|
@@ -30,6 +36,12 @@ export interface StepBuilderModalProps {
|
|
|
30
36
|
* Endpoints pickers) keep the original one-shot "Add node" behavior.
|
|
31
37
|
*/
|
|
32
38
|
onDraftChange?: (id: string, step: BuiltStep) => void;
|
|
39
|
+
/**
|
|
40
|
+
* The graph's current node ids. With `onDraftChange`, the add flow shows the minted node's
|
|
41
|
+
* name with the same rename control the step editor has, validated against these (unique,
|
|
42
|
+
* no dot), and applies it on Done — so the node is created with that name.
|
|
43
|
+
*/
|
|
44
|
+
stepIds?: string[];
|
|
33
45
|
theme?: ThemeMode;
|
|
34
46
|
/**
|
|
35
47
|
* Hide the GRAPH-ONLY tabs — Triggers / Controls / Utilities / Data, the
|
|
@@ -56,9 +68,10 @@ export interface StepBuilderModalProps {
|
|
|
56
68
|
* Which homepage tab opens first. Defaults to `"connected"` — F-2.0's
|
|
57
69
|
* homepage. A caller re-opening the picker for an already-bound target
|
|
58
70
|
* passes that target's own family, so "Change" lands where the current
|
|
59
|
-
* value lives instead of making the author re-find the tab.
|
|
71
|
+
* value lives instead of making the author re-find the tab. The canvas's
|
|
72
|
+
* right-click "Add trigger" opens on `"triggers"`.
|
|
60
73
|
*/
|
|
61
|
-
initialTab?: "connected" | "functions" | "workflows";
|
|
74
|
+
initialTab?: "connected" | "functions" | "workflows" | "triggers";
|
|
62
75
|
/** Modal heading. Defaults to "Add a node". */
|
|
63
76
|
title?: string;
|
|
64
77
|
/**
|
|
@@ -81,6 +94,11 @@ export interface StepBuilderModalProps {
|
|
|
81
94
|
* which have no graph to draw ancestors from.
|
|
82
95
|
*/
|
|
83
96
|
upstreamSteps?: ExpressionStepSource[];
|
|
97
|
+
/**
|
|
98
|
+
* The For each whose body the new step lands in (`stepBuilderLoop`, same decision as its
|
|
99
|
+
* rail). Seeds the Test tab's `state.foreach` with the sample item and index 0; not editable here.
|
|
100
|
+
*/
|
|
101
|
+
loop?: ExpressionLoopSource;
|
|
84
102
|
/**
|
|
85
103
|
* Pre-select an app when the modal opens. When provided along with
|
|
86
104
|
* initialAction/initialConnection/initialWith, the modal opens directly
|
|
@@ -138,6 +156,12 @@ export interface StepBuilderModalProps {
|
|
|
138
156
|
* so the only outcome is an infinite loop. Absent ⇒ nothing is excluded.
|
|
139
157
|
*/
|
|
140
158
|
excludeCallableIds?: readonly string[];
|
|
159
|
+
/**
|
|
160
|
+
* Fired once an app trigger or webhook picked on the Triggers tab is committed (needs
|
|
161
|
+
* `onDraftChange`), with the new node's id: the host closes this modal and
|
|
162
|
+
* opens that node in its own step editor, as it does for any node.
|
|
163
|
+
*/
|
|
164
|
+
onOpenStep?: (id: string) => void;
|
|
141
165
|
}
|
|
142
166
|
/** The four representations of the Configure tab: form, full-step JSON,
|
|
143
167
|
* params-only JSON, node settings. */
|
|
@@ -152,12 +176,13 @@ export type ConfigView = "props" | "code" | "params-code" | "config";
|
|
|
152
176
|
* deliberately no second toggle component: one glyph set, one styling, one
|
|
153
177
|
* pressed-state behaviour, however many views a host offers.
|
|
154
178
|
*/
|
|
155
|
-
export declare function ConfigViewToggle({ view, onChange, disabled, views, }: {
|
|
179
|
+
export declare function ConfigViewToggle({ view, onChange, disabled, views, customized, }: {
|
|
156
180
|
view: ConfigView;
|
|
157
181
|
onChange: (v: ConfigView) => void;
|
|
158
182
|
disabled?: boolean;
|
|
159
183
|
/** Which views to offer, in order. Defaults to all four. */
|
|
160
184
|
views?: ConfigView[];
|
|
185
|
+
customized?: boolean;
|
|
161
186
|
}): import("react").JSX.Element;
|
|
162
187
|
/**
|
|
163
188
|
* Guided "add a step" flow. A sidebar toggles between **Apps** (pick app →
|
|
@@ -167,21 +192,27 @@ export declare function ConfigViewToggle({ view, onChange, disabled, views, }: {
|
|
|
167
192
|
*
|
|
168
193
|
* Data + IO come from `useW6WApi()`, so mount it under `<W6WUIProvider>`.
|
|
169
194
|
*/
|
|
170
|
-
export declare function StepBuilderModal({ onClose, onAdd, onDraftChange, theme, appsOnly, callables, initialTab, title, workflowId, stepId, upstreamSteps, initialApp, initialAction, initialConnection, initialWith, appsFilter, appsIds, connectionOnly, onConnected, excludeCallableIds, }: StepBuilderModalProps): import("react").JSX.Element;
|
|
195
|
+
export declare function StepBuilderModal({ onClose, onAdd, onDraftChange, theme, appsOnly, callables, initialTab, title, workflowId, stepId, upstreamSteps, loop, initialApp, initialAction, initialConnection, initialWith, appsFilter, appsIds, connectionOnly, onConnected, excludeCallableIds, onOpenStep, stepIds, }: StepBuilderModalProps): import("react").JSX.Element;
|
|
171
196
|
/**
|
|
172
197
|
* Config form for a chosen internal node — its schema rendered through the same
|
|
173
198
|
* `ParamsForm` as app actions, seeded with the node's defaults. Emits the built
|
|
174
199
|
* step on Add.
|
|
175
200
|
*/
|
|
176
|
-
export declare function ControlStepConfig({ node, onAdd, onClose, onDraftChange, workflowId, upstreamSteps, }: {
|
|
201
|
+
export declare function ControlStepConfig({ node: initialNode, onAdd, onClose, onDone, onDraftChange, onOpenStep, workflowId, upstreamSteps, loop, }: {
|
|
177
202
|
node: InternalNodeDef;
|
|
178
203
|
onAdd: (s: BuiltStep) => string | undefined | void;
|
|
179
204
|
onClose: () => void;
|
|
205
|
+
/** Done, once the node is added — applies the add flow's name, then closes. Else `onClose`. */
|
|
206
|
+
onDone?: () => void;
|
|
180
207
|
/** See {@link StepBuilderModalProps.onDraftChange}. */
|
|
181
208
|
onDraftChange?: (id: string, step: BuiltStep) => void;
|
|
209
|
+
/** Open the full webhook editor, including its URL and listener, as soon as it is added. */
|
|
210
|
+
onOpenStep?: (id: string) => void;
|
|
182
211
|
workflowId?: string;
|
|
183
212
|
/** The new step's known graph ancestors — see {@link StepBuilderModalProps.upstreamSteps}. */
|
|
184
213
|
upstreamSteps?: ExpressionStepSource[];
|
|
214
|
+
/** See {@link StepBuilderModalProps.loop}. */
|
|
215
|
+
loop?: ExpressionLoopSource;
|
|
185
216
|
}): import("react").JSX.Element;
|
|
186
217
|
export declare function triggerFieldsOf(wf: WorkflowDetail): ActionParam[];
|
|
187
218
|
/**
|
|
@@ -196,15 +227,25 @@ export declare function triggerFieldsOf(wf: WorkflowDetail): ActionParam[];
|
|
|
196
227
|
* `NodeConfigForm` is reached once the `@w6w/call` step already lives on a
|
|
197
228
|
* canvas, not at add-time.
|
|
198
229
|
*/
|
|
199
|
-
export declare function CallableStepConfig({ family, targetId, targetLabel, onAdd, onClose, onDraftChange, }: {
|
|
230
|
+
export declare function CallableStepConfig({ family, targetId, targetLabel, onAdd, onClose, onDone, onDraftChange, }: {
|
|
200
231
|
family: "function" | "workflow";
|
|
201
232
|
targetId: string;
|
|
202
233
|
targetLabel: string;
|
|
203
234
|
onAdd: (s: BuiltStep) => string | undefined | void;
|
|
204
235
|
onClose: () => void;
|
|
236
|
+
/** Done, once the node is added — applies the add flow's name, then closes. Else `onClose`. */
|
|
237
|
+
onDone?: () => void;
|
|
205
238
|
/** See {@link StepBuilderModalProps.onDraftChange}. */
|
|
206
239
|
onDraftChange?: (id: string, step: BuiltStep) => void;
|
|
207
240
|
}): import("react").JSX.Element;
|
|
241
|
+
/**
|
|
242
|
+
* The starting `with` for a freshly picked action: every param whose `default` is
|
|
243
|
+
* an expression (e.g. `"{{ const.account_id }}"`). A plain default is only shown
|
|
244
|
+
* as a placeholder value and never stored, so an expression default would render
|
|
245
|
+
* as literal text and never reach the engine — seeding it makes it a live,
|
|
246
|
+
* saved binding the user can still clear or replace.
|
|
247
|
+
*/
|
|
248
|
+
export declare function expressionDefaults(params: ActionParam[]): Record<string, unknown>;
|
|
208
249
|
/**
|
|
209
250
|
* Whether every required param has a usable value — gates the inline "Test run".
|
|
210
251
|
* A required array (e.g. a `vars` table) may be empty (see the Data node); other
|
|
@@ -297,6 +338,8 @@ interface ReadyToUse {
|
|
|
297
338
|
state: "loading" | "error" | "empty" | "ready";
|
|
298
339
|
error?: string;
|
|
299
340
|
apps: AppSummary[];
|
|
341
|
+
/** Full connected-id scope for server search, including apps not loaded yet. */
|
|
342
|
+
appIds?: string[];
|
|
300
343
|
fns: FunctionSummary[];
|
|
301
344
|
wfs: WorkflowSummary[];
|
|
302
345
|
/** More connected-app ids remain unresolved — draw an explicit "load more" affordance. */
|
|
@@ -344,17 +387,42 @@ export declare function clampMinutes(raw: string, min: number): number;
|
|
|
344
387
|
*
|
|
345
388
|
* Exported for tests only (not re-exported from the package index).
|
|
346
389
|
*/
|
|
347
|
-
export declare function useReadyToUse(callables: readonly ("function" | "workflow")[], appsFilter?: (app: AppSummary) => boolean, excludeIds?: readonly string[], appsIds?: readonly string[]
|
|
390
|
+
export declare function useReadyToUse(callables: readonly ("function" | "workflow")[], appsFilter?: (app: AppSummary) => boolean, excludeIds?: readonly string[], appsIds?: readonly string[],
|
|
391
|
+
/** `resolveInline`: ignore a connection row's inline `app` meta and resolve every id through
|
|
392
|
+
* `listAppsByIds` — for a caller that needs fields the inline meta lacks (`triggerCount`). */
|
|
393
|
+
opts?: {
|
|
394
|
+
resolveInline?: boolean;
|
|
395
|
+
}): ReadyToUse;
|
|
348
396
|
/** A copy of `items` without any entry whose `id` equals one of `ids` (id
|
|
349
397
|
* equality only — never name or position). No `ids` ⇒ an unchanged copy. */
|
|
350
398
|
export declare function withoutIds<T extends {
|
|
351
399
|
id: string;
|
|
352
400
|
}>(items: readonly T[], ids?: readonly string[]): T[];
|
|
353
|
-
|
|
401
|
+
/** An app's triggers as action-shaped defs ({ key, title, description, params }), so
|
|
402
|
+
* the action pickers and param forms take them as they are. No API member => none. */
|
|
403
|
+
export declare function getTriggerDefs(api: W6WApi, appId: string): Promise<ActionDef[]>;
|
|
404
|
+
/** An app trigger's Test tab: it runs when the app reports the event, not by hand. */
|
|
405
|
+
export declare function AppTriggerTestNote({ title, app }: {
|
|
406
|
+
title: string;
|
|
407
|
+
app: string;
|
|
408
|
+
}): import("react").JSX.Element;
|
|
409
|
+
export declare function AppStepConfig({ kind, onOpenStep, appId, app, onAdd, onClose, onDone, onDraftChange, onChangeApp, theme, workflowId, stepId, upstreamSteps, loop, initialAction, initialConnection, initialWith, }: {
|
|
410
|
+
/**
|
|
411
|
+
* What the Setup tab picks: one of the app's actions, or (`"trigger"`, the
|
|
412
|
+
* Triggers tab) one of its triggers. Same account step, same picker, same
|
|
413
|
+
* add-on-pick; a trigger node carries `uses.trigger: true` and lists
|
|
414
|
+
* `api.getAppTriggers`. Its Test tab only says when it runs: there is no
|
|
415
|
+
* action to invoke by hand.
|
|
416
|
+
*/
|
|
417
|
+
kind?: "action" | "trigger";
|
|
418
|
+
/** See {@link StepBuilderModalProps.onOpenStep}. */
|
|
419
|
+
onOpenStep?: (id: string) => void;
|
|
354
420
|
appId: string;
|
|
355
421
|
app?: AppSummary;
|
|
356
422
|
onAdd: (s: BuiltStep) => string | undefined | void;
|
|
357
423
|
onClose: () => void;
|
|
424
|
+
/** Done, once the node is added — applies the add flow's name, then closes. Else `onClose`. */
|
|
425
|
+
onDone?: () => void;
|
|
358
426
|
/** See {@link StepBuilderModalProps.onDraftChange}. */
|
|
359
427
|
onDraftChange?: (id: string, step: BuiltStep) => void;
|
|
360
428
|
onChangeApp?: () => void;
|
|
@@ -363,6 +431,8 @@ export declare function AppStepConfig({ appId, app, onAdd, onClose, onDraftChang
|
|
|
363
431
|
stepId?: string;
|
|
364
432
|
/** The new step's known graph ancestors — see {@link StepBuilderModalProps.upstreamSteps}. */
|
|
365
433
|
upstreamSteps?: ExpressionStepSource[];
|
|
434
|
+
/** See {@link StepBuilderModalProps.loop}. */
|
|
435
|
+
loop?: ExpressionLoopSource;
|
|
366
436
|
/** Pre-selected action key, opens directly to Configure tab when provided with initialWith */
|
|
367
437
|
initialAction?: string;
|
|
368
438
|
/** Pre-selected connection id */
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A node's name (its step id) with a pencil to rename it — the one control both the step
|
|
3
|
+
* editor and the add flow show. `onCommit` validates and applies a changed name, returning
|
|
4
|
+
* why it was refused (shown inline, the input stays open) or `null`. Enter / blur commit,
|
|
5
|
+
* Escape reverts.
|
|
6
|
+
*/
|
|
7
|
+
export declare function StepNameEditor({ value, onCommit, readOnly, }: {
|
|
8
|
+
value: string;
|
|
9
|
+
onCommit: (id: string) => string | null;
|
|
10
|
+
readOnly?: boolean;
|
|
11
|
+
}): import("react").JSX.Element;
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import { StepTestPersist } from './StepBuilderModal.tsx';
|
|
2
|
+
/** How long an edited sample payload sits before it is remembered (it is flushed on close too). */
|
|
3
|
+
export declare const EDIT_SAVE_DEBOUNCE_MS = 600;
|
|
2
4
|
/**
|
|
3
5
|
* The Test-tab widget for a manual/webhook trigger. A trigger's configured
|
|
4
6
|
* `fields` ARE the run's starting state, so testing it means **filling those
|
|
@@ -37,8 +39,14 @@ import { StepTestPersist } from './StepBuilderModal.tsx';
|
|
|
37
39
|
* `packages/studio/src/lib/workflow-live-run.ts`): it fetches the manual
|
|
38
40
|
* trigger's latest `step_tests` row and sends its `with` verbatim as `input`.
|
|
39
41
|
* This form is not in that path; it only writes the fixture that call reads.
|
|
42
|
+
*
|
|
43
|
+
* **Listen for test event.** With `listen` supplied (a `@w6w/webhook` trigger inside a workflow),
|
|
44
|
+
* the primary action is {@link WebhookListenPanel}: the real request a caller sends becomes the
|
|
45
|
+
* payload. **Use as test data** runs exactly this form's Test path with the captured request as
|
|
46
|
+
* the values, so it lands as the trigger's output and saved test like a typed payload would. The
|
|
47
|
+
* manual payload box stays, folded below as the secondary option.
|
|
40
48
|
*/
|
|
41
|
-
export declare function TriggerFillForm({ app, action, fields, persist, }: {
|
|
49
|
+
export declare function TriggerFillForm({ app, action, fields, persist, listen, }: {
|
|
42
50
|
app: string;
|
|
43
51
|
action: string;
|
|
44
52
|
/** The trigger's `fields` param value (an array of field definitions). */
|
|
@@ -49,4 +57,9 @@ export declare function TriggerFillForm({ app, action, fields, persist, }: {
|
|
|
49
57
|
* a fixture by and this form neither reads nor writes one.
|
|
50
58
|
*/
|
|
51
59
|
persist?: StepTestPersist;
|
|
60
|
+
/** Offer "Listen for test event" (webhook triggers in a saved workflow). */
|
|
61
|
+
listen?: {
|
|
62
|
+
stepWith: Record<string, unknown> | undefined;
|
|
63
|
+
readOnly?: boolean;
|
|
64
|
+
};
|
|
52
65
|
}): import("react").JSX.Element;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { SubscriptionSummary, WebhookListenSession } from './types.ts';
|
|
2
|
+
/** The captured call a webhook trigger emits as its output. */
|
|
3
|
+
export type CapturedWebhookRequest = NonNullable<WebhookListenSession["request"]>;
|
|
4
|
+
/**
|
|
5
|
+
* The `@w6w/webhook` subscription that feeds `stepId`: the one bound to that node, else the
|
|
6
|
+
* workflow's first webhook subscription (one not bound to any node — the URL panel's own pick).
|
|
7
|
+
*/
|
|
8
|
+
export declare function pickWebhookSubscription(subs: SubscriptionSummary[], stepId: string): SubscriptionSummary | null;
|
|
9
|
+
/** Headers for display: secret-looking values masked. */
|
|
10
|
+
export declare function displayHeaders(headers: Record<string, string>): Record<string, string>;
|
|
11
|
+
/**
|
|
12
|
+
* "Listen for test event" — the webhook trigger's primary Test action. Opens a short-lived listen
|
|
13
|
+
* session on the node's webhook subscription, so the receive URL captures the next request even
|
|
14
|
+
* while the workflow is unpublished (the caller gets a test acknowledgement and no run starts),
|
|
15
|
+
* and long-polls it. A captured request is shown — method, time, query, headers (secret-looking
|
|
16
|
+
* ones masked), pretty body — and **Use as test data** hands it to `onUse`, which makes it this
|
|
17
|
+
* trigger's output and saved test.
|
|
18
|
+
*/
|
|
19
|
+
export declare function WebhookListenPanel({ workflowId, stepId, stepWith, readOnly, onUse, using, }: {
|
|
20
|
+
workflowId: string;
|
|
21
|
+
stepId: string;
|
|
22
|
+
/** The node's current config — the params a newly created subscription starts from. */
|
|
23
|
+
stepWith: Record<string, unknown> | undefined;
|
|
24
|
+
readOnly?: boolean;
|
|
25
|
+
onUse: (request: CapturedWebhookRequest) => void;
|
|
26
|
+
/** `onUse`'s save is in flight. */
|
|
27
|
+
using?: boolean;
|
|
28
|
+
}): import("react").JSX.Element | null;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { RefObject } from 'react';
|
|
2
|
+
import { FlowStep } from './flow-types.ts';
|
|
3
|
+
import { ConnectionSummary } from './types.ts';
|
|
4
|
+
import { FlowConnections } from './workflow-connections.ts';
|
|
5
|
+
export declare const WorkflowConnectionsContext: import('react').Context<{
|
|
6
|
+
nodes: FlowStep[];
|
|
7
|
+
readOnly?: boolean;
|
|
8
|
+
connections: FlowConnections;
|
|
9
|
+
setConnections: (connections: FlowConnections) => void;
|
|
10
|
+
} | null>;
|
|
11
|
+
export declare function useWorkflowConnections(): {
|
|
12
|
+
nodes: FlowStep[];
|
|
13
|
+
readOnly?: boolean;
|
|
14
|
+
connections: FlowConnections;
|
|
15
|
+
setConnections: (connections: FlowConnections) => void;
|
|
16
|
+
} | null;
|
|
17
|
+
/** One account menu for both adding and editing workflow nodes. */
|
|
18
|
+
export declare function WorkflowConnectionPicker({ step, conns, failed, readOnly, open, onOpenChange, anchorRef, onChangeConnection, onChangeConnectionRef, onConnectionCreated, }: {
|
|
19
|
+
step: FlowStep;
|
|
20
|
+
conns: ConnectionSummary[] | null;
|
|
21
|
+
failed?: boolean;
|
|
22
|
+
readOnly?: boolean;
|
|
23
|
+
open: boolean;
|
|
24
|
+
onOpenChange: (open: boolean) => void;
|
|
25
|
+
anchorRef: RefObject<HTMLElement | null>;
|
|
26
|
+
onChangeConnection: (id: string) => void;
|
|
27
|
+
onChangeConnectionRef: (ref: string) => void;
|
|
28
|
+
onConnectionCreated: () => void;
|
|
29
|
+
}): import("react").JSX.Element;
|
|
@@ -1,13 +1,25 @@
|
|
|
1
|
-
import { ExpressionOptions, ExpressionStepSource } from './components/ExpressionOptions.tsx';
|
|
1
|
+
import { ExpressionLoopSource, ExpressionOptions, ExpressionStepSource } from './components/ExpressionOptions.tsx';
|
|
2
2
|
import { FlowStep, FlowWorkflow } from './flow-types.ts';
|
|
3
|
+
import { StepStartState } from './provider.tsx';
|
|
3
4
|
import { RunState } from './run-visuals.ts';
|
|
4
5
|
import { StepProblem, StepProblems } from './step-problems.ts';
|
|
5
6
|
import { AppSummary } from './types.ts';
|
|
7
|
+
/** What kind of change an `onChange` reports — see `WorkflowFlowEditorProps.onChange`. */
|
|
8
|
+
export interface FlowChangeMeta {
|
|
9
|
+
viewportOnly?: true;
|
|
10
|
+
}
|
|
6
11
|
export interface WorkflowFlowEditorProps {
|
|
7
12
|
/** The workflow being edited. The editor re-derives layout when this changes identity. */
|
|
8
13
|
value: FlowWorkflow;
|
|
9
|
-
/**
|
|
10
|
-
|
|
14
|
+
/**
|
|
15
|
+
* Fired whenever the user changes the graph — new nodes, edges, or step edits.
|
|
16
|
+
*
|
|
17
|
+
* `meta.viewportOnly` is `true` when the change is the author's pan/zoom being
|
|
18
|
+
* written to `settings.viewport` and nothing else. A host that drops the shown
|
|
19
|
+
* run on an edit (so the run paint stops describing a workflow that changed)
|
|
20
|
+
* keeps it for these: moving the camera changes nothing that ran.
|
|
21
|
+
*/
|
|
22
|
+
onChange: (next: FlowWorkflow, meta?: FlowChangeMeta) => void;
|
|
11
23
|
/** Disable all interactions — pans/zooms are still enabled. */
|
|
12
24
|
readOnly?: boolean;
|
|
13
25
|
/** Height of the editor viewport. Defaults to 480px. */
|
|
@@ -65,7 +77,7 @@ export interface WorkflowFlowEditorProps {
|
|
|
65
77
|
* connection no longer exists gets an error ring + tooltip. Omitted ⇒ the
|
|
66
78
|
* canvas renders exactly as today. The host owns detection; this editor never
|
|
67
79
|
* infers a problem itself. Repaints live (same `value.id`) and is never
|
|
68
|
-
* persisted: `flowToWorkflow` never reads `data.
|
|
80
|
+
* persisted: `flowToWorkflow` never reads `data.stepProblems`.
|
|
69
81
|
*/
|
|
70
82
|
stepProblems?: StepProblems;
|
|
71
83
|
/**
|
|
@@ -95,6 +107,31 @@ export interface WorkflowFlowEditorProps {
|
|
|
95
107
|
* `onChange` and never overwrites the stored viewport.
|
|
96
108
|
*/
|
|
97
109
|
fitViewKey?: string | number | boolean;
|
|
110
|
+
/**
|
|
111
|
+
* Run from a node: ▶ runs THAT node and then continues through every node downstream of it,
|
|
112
|
+
* following the edges the way a real run does, and stops BEFORE each paused node
|
|
113
|
+
* (`ui.paused`). The host enqueues it as a real run (`POST /workflows/:id/nodes/:nodeId/run`
|
|
114
|
+
* with `continue: true`) and shows it like any run — `runState` + its run log.
|
|
115
|
+
*
|
|
116
|
+
* Called from the ▶ collect form's Run button with:
|
|
117
|
+
* - `stopAt` — every paused node except the start node itself;
|
|
118
|
+
* - `state` — the upstream outputs the form seeded (saved step tests / the last run), the same
|
|
119
|
+
* start state a single-node run is given;
|
|
120
|
+
* - `input` — the filled values, only when the start node is a trigger.
|
|
121
|
+
*
|
|
122
|
+
* Omitted ⇒ ▶ test-runs the single node exactly as before (and flow-control nodes have no ▶).
|
|
123
|
+
* A rejected promise is shown in the run modal.
|
|
124
|
+
*/
|
|
125
|
+
onRunFromNode?: (nodeId: string, req: RunFromNodeRequest) => Promise<void> | void;
|
|
126
|
+
}
|
|
127
|
+
/** What {@link WorkflowFlowEditorProps.onRunFromNode} is called with. */
|
|
128
|
+
export interface RunFromNodeRequest {
|
|
129
|
+
/** Paused node ids the run must stop before (never the start node). */
|
|
130
|
+
stopAt: string[];
|
|
131
|
+
/** Upstream outputs seeded from saved step tests / the last run; absent when none. */
|
|
132
|
+
state?: StepStartState;
|
|
133
|
+
/** The trigger's filled values — present only when the start node is a trigger. */
|
|
134
|
+
input?: Record<string, unknown>;
|
|
98
135
|
}
|
|
99
136
|
/** Which view the step edit modal opens in: the tabbed form, raw JSON, or node settings. */
|
|
100
137
|
type EditView = "props" | "json" | "settings";
|
|
@@ -109,22 +146,41 @@ type EditView = "props" | "json" | "settings";
|
|
|
109
146
|
* - Selecting a node reveals a toolbar above it: Edit / Duplicate / Delete.
|
|
110
147
|
* - Edit opens a modal with a Form ⇄ JSON toggle for that step.
|
|
111
148
|
* - Every meaningful change fires `onChange` with an updated Workflow.
|
|
149
|
+
* - Ctrl/Cmd+Z undoes graph edits; Ctrl/Cmd+Shift+Z (or Ctrl+Y) redoes them.
|
|
150
|
+
* History is local to the open workflow and excludes tests, samples and viewport changes.
|
|
112
151
|
*/
|
|
113
152
|
export declare function WorkflowFlowEditor(props: WorkflowFlowEditorProps): import("react").JSX.Element;
|
|
114
|
-
|
|
153
|
+
/**
|
|
154
|
+
* The state the Test tab PREVIEWS its resolved params against: the seeded `testStartState`
|
|
155
|
+
* (what the test will actually send) with, for each upstream `nodes.<id>.output` and the
|
|
156
|
+
* `trigger.event` that the seeds do not carry, the value the editor already previews in the ƒx
|
|
157
|
+
* Result (`sampleValues`: a persisted test's kept value or the app's declared `sample`). A seeded
|
|
158
|
+
* output always wins. Only the PREVIEW reads this; the invoke is still sent `testStartState`.
|
|
159
|
+
*/
|
|
160
|
+
export declare function previewStartState(state: StepStartState | undefined, sampleValues: Record<string, unknown> | undefined): StepStartState | undefined;
|
|
161
|
+
export declare function StepEditModal(props: StepEditModalProps): import("react").JSX.Element;
|
|
162
|
+
interface StepEditModalProps {
|
|
115
163
|
workflowId: string;
|
|
116
164
|
step: FlowStep;
|
|
165
|
+
/** Refresh authored fields after undo/redo without remounting the Test tab. */
|
|
166
|
+
restoreVersion?: number;
|
|
117
167
|
/** Graph ancestors of this step (from `upstreamStateSources`); the incoming-state picker seeds from their saved tests. */
|
|
118
168
|
upstreamSteps: ExpressionStepSource[];
|
|
169
|
+
/** The enclosing For each when this step is in its body: seeds `state.foreach` on Test. */
|
|
170
|
+
loop?: ExpressionLoopSource;
|
|
119
171
|
onChange: (next: FlowStep) => void;
|
|
120
172
|
onClose: () => void;
|
|
121
173
|
readOnly?: boolean;
|
|
122
174
|
initialView?: EditView;
|
|
123
175
|
/** Most outgoing edges this node has in one lane; "Run next nodes" needs >= 2. */
|
|
124
176
|
fanOutCount?: number;
|
|
177
|
+
/** This step's own output field keys, offered by "Write to state" › Pick fields (free text still accepted). */
|
|
178
|
+
stateOutputFields?: string[];
|
|
125
179
|
/** Fired the instant the footer Test button is clicked, before the test runs (T1.1.1). */
|
|
126
180
|
onTestRun?: () => void;
|
|
127
|
-
/** Host-supplied
|
|
128
|
-
|
|
129
|
-
|
|
181
|
+
/** Host-supplied problems for this step; a dangling connection locks Configure/Test, a fixable one gets a button. */
|
|
182
|
+
stepProblems?: StepProblem[];
|
|
183
|
+
/** The graph's other node ids — a rename onto one of them is refused with a message. */
|
|
184
|
+
otherStepIds?: string[];
|
|
185
|
+
}
|
|
130
186
|
export {};
|