@w6w/ui 0.2.0 → 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 +146 -2
- package/README.md +28 -10
- package/dist/AppPicker.d.ts +58 -2
- package/dist/CanvasContextMenu.d.ts +19 -0
- package/dist/CanvasLayer.d.ts +38 -0
- package/dist/{CodeBlock-Dot3Pd7P.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/EditConnectionModal.d.ts +6 -1
- package/dist/JsonEditor.d.ts +20 -0
- package/dist/Markdown.d.ts +25 -0
- package/dist/ParamCustomization.d.ts +5 -0
- package/dist/ParamsForm.d.ts +18 -4
- package/dist/RouterEditor.d.ts +5 -0
- package/dist/StepBuilderModal.d.ts +103 -15
- 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 +74 -7
- package/dist/app-pages.d.ts +2 -0
- 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/canvas-types.d.ts +36 -0
- package/dist/canvas-utils.d.ts +44 -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/AuthFieldsForm.d.ts +11 -0
- package/dist/components/BudgetMeter.d.ts +15 -0
- package/dist/components/CallableList.d.ts +3 -2
- package/dist/components/ColumnsEditor.d.ts +27 -0
- package/dist/components/Combobox.d.ts +19 -1
- package/dist/components/ConnectionList.d.ts +2 -3
- package/dist/components/CredentialPicker.d.ts +35 -0
- 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/DataTable.d.ts +27 -0
- package/dist/components/DataTableGrid.d.ts +46 -0
- package/dist/components/EmptyState.d.ts +9 -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/dynamic-fields.d.ts +60 -0
- package/dist/editor-theme.d.ts +24 -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-fanout.d.ts +2 -2
- 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 +155 -10
- package/dist/flow-utils.d.ts +33 -12
- package/dist/flow.cjs +4 -2
- package/dist/flow.cjs.map +1 -1
- package/dist/flow.d.ts +15 -2
- package/dist/flow.mjs +3737 -1350
- 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 +43 -5
- package/dist/index.mjs +2855 -1333
- 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/note-markdown.d.ts +22 -0
- package/dist/output-shape.d.ts +30 -14
- package/dist/param-customization.d.ts +7 -0
- package/dist/provider.d.ts +174 -13
- package/dist/resolve-params.d.ts +50 -11
- package/dist/run-visuals.d.ts +18 -22
- 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 +64 -0
- package/dist/test-inputs.d.ts +25 -0
- package/dist/trigger-registration.d.ts +28 -0
- package/dist/types.d.ts +179 -11
- package/dist/use-app-action-defs.d.ts +9 -1
- package/dist/use-dynamic-fields.d.ts +23 -0
- package/dist/use-test-input.d.ts +18 -0
- package/dist/workflow-connections.d.ts +30 -0
- package/package.json +18 -7
- package/src/code.css +60 -6
- package/src/styles/_budget-meter.scss +46 -0
- package/src/styles/_callable-list.scss +15 -6
- package/src/styles/_canvas.scss +353 -0
- package/src/styles/_code-editor.scss +35 -0
- package/src/styles/_code.scss +6 -5
- package/src/styles/_connections.scss +2 -14
- package/src/styles/_copyable.scss +24 -0
- package/src/styles/_data-stores.scss +138 -0
- package/src/styles/_data-table.scss +55 -0
- package/src/styles/_data-vars.scss +17 -6
- package/src/styles/_empty-state.scss +21 -0
- 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 +171 -0
- package/src/styles/_fx.scss +26 -1
- package/src/styles/_incoming-state.scss +33 -0
- package/src/styles/_layout.scss +10 -0
- package/src/styles/_markdown.scss +20 -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 +57 -14
- package/src/styles/_tokens.scss +27 -1
- package/src/styles.css +1861 -115
- package/src/styles.scss +7 -0
- package/dist/CodeBlock-CZu4TFSi.cjs +0 -15
- package/dist/CodeBlock-CZu4TFSi.cjs.map +0 -1
- package/dist/CodeBlock-Dot3Pd7P.js.map +0 -1
- package/dist/ConfirmModal-ChoiGy2K.cjs +0 -11
- package/dist/ConfirmModal-ChoiGy2K.cjs.map +0 -1
- package/dist/ConfirmModal-Wx3i8F1n.js +0 -6359
- package/dist/ConfirmModal-Wx3i8F1n.js.map +0 -1
- package/dist/Copyable-1niV9gUa.js +0 -771
- package/dist/Copyable-1niV9gUa.js.map +0 -1
- package/dist/Copyable-CYZU1o4X.cjs +0 -2
- package/dist/Copyable-CYZU1o4X.cjs.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;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ConnectionSummary, ThemeMode } from './types.ts';
|
|
2
2
|
export interface EditConnectionModalProps {
|
|
3
3
|
/** The row being edited. `builtIn` rows have nothing to edit: the modal shows a notice only. */
|
|
4
|
-
connection: Pick<ConnectionSummary, "id" | "appId" | "authKey" | "displayName" | "builtIn">;
|
|
4
|
+
connection: Pick<ConnectionSummary, "id" | "appId" | "authKey" | "displayName" | "builtIn" | "credentialId" | "lastTestOk">;
|
|
5
5
|
onClose: () => void;
|
|
6
6
|
/** Fired with the server's updated row. The typed credential is cleared before this runs. */
|
|
7
7
|
onSaved: (updated: ConnectionSummary) => void;
|
|
@@ -15,6 +15,11 @@ export interface EditConnectionModalProps {
|
|
|
15
15
|
* sent, and the server merges them over the stored credential. OAuth connections can be renamed
|
|
16
16
|
* here; re-authorizing is not part of this modal.
|
|
17
17
|
*
|
|
18
|
+
* A connection that uses a stored credential (`connection.credentialId`), when the host supplies
|
|
19
|
+
* `api.rotateCredential`, is split in two: Save only renames it and changes its binding (never the
|
|
20
|
+
* credential, which other connections may share), and "Rotate credential" is a separate explicit
|
|
21
|
+
* action that replaces the stored secret for every connection using it.
|
|
22
|
+
*
|
|
18
23
|
* Needs `api.updateConnection`. Without it (or for a `builtIn` row) there is no Save button, a
|
|
19
24
|
* one-line notice shows instead, and nothing is called. Hosts should not offer Edit in that case.
|
|
20
25
|
*/
|
package/dist/JsonEditor.d.ts
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { EditorView } from '@codemirror/view';
|
|
2
|
+
import { ReactNode } from 'react';
|
|
1
3
|
import { ThemeMode } from './types.ts';
|
|
2
4
|
export interface JsonEditorProps {
|
|
3
5
|
value: string;
|
|
@@ -25,6 +27,17 @@ export interface JsonEditorProps {
|
|
|
25
27
|
* `minHeight` and `maxHeight` — an inline JSON/group field wants this.
|
|
26
28
|
*/
|
|
27
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;
|
|
28
41
|
/** Read-only mode — useful for previewing a stored definition. */
|
|
29
42
|
readOnly?: boolean;
|
|
30
43
|
/**
|
|
@@ -45,6 +58,13 @@ export interface JsonEditorProps {
|
|
|
45
58
|
* this prop existed.
|
|
46
59
|
*/
|
|
47
60
|
copyable?: boolean;
|
|
61
|
+
/**
|
|
62
|
+
* Content overlaid inside the editor box at its top-right corner, a direct
|
|
63
|
+
* child of `.w6w-json-editor` (same overlay mechanism as `copyable`). The
|
|
64
|
+
* `ParamsForm` json field puts its `ƒx` here. Text keeps right padding so
|
|
65
|
+
* line 1 is not covered.
|
|
66
|
+
*/
|
|
67
|
+
overlay?: ReactNode;
|
|
48
68
|
}
|
|
49
69
|
/**
|
|
50
70
|
* JSON editor built on CodeMirror 6. Syntax highlighting, folding, gutter with
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
export interface MarkdownProps {
|
|
2
|
+
content: string;
|
|
3
|
+
className?: string;
|
|
4
|
+
}
|
|
5
|
+
/**
|
|
6
|
+
* Pass a URL through only when its *parsed* protocol is allowlisted; relative,
|
|
7
|
+
* unparseable and every other scheme (javascript:, data:, vbscript:, any casing
|
|
8
|
+
* or whitespace trick the URL parser normalises) collapse to "".
|
|
9
|
+
*/
|
|
10
|
+
export declare function safeUrl(url: string): string;
|
|
11
|
+
/**
|
|
12
|
+
* A leading `---` YAML block and the Markdown after it. Rendered as Markdown the block would
|
|
13
|
+
* come out as a rule plus a heading; it is metadata, so `Markdown` shows it in a collapsed
|
|
14
|
+
* section instead. Kept as text, not parsed — this package carries no YAML parser.
|
|
15
|
+
*/
|
|
16
|
+
export declare function splitFrontmatter(text: string): {
|
|
17
|
+
frontmatter: string | null;
|
|
18
|
+
body: string;
|
|
19
|
+
};
|
|
20
|
+
/**
|
|
21
|
+
* Renders imported, attacker-controllable note content. No `rehype-raw`: raw HTML
|
|
22
|
+
* is dropped (`skipHtml`), images are not rendered, and links are protocol-allowlisted.
|
|
23
|
+
* A leading YAML frontmatter block becomes a collapsed section above the body.
|
|
24
|
+
*/
|
|
25
|
+
export declare function Markdown({ content, className }: MarkdownProps): import("react").JSX.Element;
|
package/dist/ParamsForm.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { DynamicContext } from './dynamic-fields.ts';
|
|
1
2
|
import { ActionParam } from './types.ts';
|
|
2
3
|
/**
|
|
3
4
|
* Evaluate a param's `showIf` predicate. `getValue` resolves a sibling field's
|
|
@@ -29,6 +30,11 @@ export interface ParamsFormProps {
|
|
|
29
30
|
/** Fired with the next values object on every edit. */
|
|
30
31
|
onChange: (values: Record<string, unknown>) => void;
|
|
31
32
|
readOnly?: boolean;
|
|
33
|
+
/**
|
|
34
|
+
* Opt-in context for `options: { source: "resolveFields" }` params. Absent (or
|
|
35
|
+
* the host has no `resolveActionFields`) = those params render as plain inputs.
|
|
36
|
+
*/
|
|
37
|
+
dynamic?: DynamicContext;
|
|
32
38
|
}
|
|
33
39
|
/**
|
|
34
40
|
* Renders an action's declared params as a form. Required params are always
|
|
@@ -36,11 +42,17 @@ export interface ParamsFormProps {
|
|
|
36
42
|
* tidy. Widget is chosen by `param.type` — same field-driven approach as
|
|
37
43
|
* `AuthFieldsForm`, extended with `text` (textarea) and `json` (JsonEditor).
|
|
38
44
|
*
|
|
39
|
-
* Values are collected into a plain object suitable for a step's `with`.
|
|
40
|
-
*
|
|
41
|
-
* 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 }}"`).
|
|
42
47
|
*/
|
|
43
|
-
export declare function ParamsForm({ params, values, onChange, readOnly }: ParamsFormProps): import("react").JSX.Element;
|
|
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;
|
|
44
56
|
/**
|
|
45
57
|
* One typed key/value entry in a `vars` param. `type` is a real value type only:
|
|
46
58
|
* `expression` is a binding *mode* (see {@link FxField}/`ExprValue`), not a value
|
|
@@ -54,3 +66,5 @@ export interface DataVar {
|
|
|
54
66
|
type: "string" | "number" | "boolean" | "json";
|
|
55
67
|
value: unknown;
|
|
56
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, 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
|
}
|
|
@@ -27,9 +33,15 @@ export interface StepBuilderModalProps {
|
|
|
27
33
|
* `onAdd` — keeps the already-added node current without minting a second
|
|
28
34
|
* one. `id` is the id `onAdd` returned. Progressive commit (mint-then-update)
|
|
29
35
|
* only engages when this is supplied; omitted callers (the Functions/
|
|
30
|
-
* Endpoints pickers) keep the original one-shot "Add
|
|
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,10 +68,11 @@ 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";
|
|
62
|
-
/** Modal heading. Defaults to "Add a
|
|
74
|
+
initialTab?: "connected" | "functions" | "workflows" | "triggers";
|
|
75
|
+
/** Modal heading. Defaults to "Add a node". */
|
|
63
76
|
title?: string;
|
|
64
77
|
/**
|
|
65
78
|
* Workflow-step context, when the builder is opened for a step that already
|
|
@@ -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
|
|
@@ -114,6 +132,11 @@ export interface StepBuilderModalProps {
|
|
|
114
132
|
* and the selected-app header omits the ` · v<version>` suffix for it.
|
|
115
133
|
*/
|
|
116
134
|
appsFilter?: (app: AppSummary) => boolean;
|
|
135
|
+
/**
|
|
136
|
+
* Server-side id allow-list for the Apps-tab picker (forwarded as `ids` to the
|
|
137
|
+
* paged fetch), so the footer total equals the cards shown.
|
|
138
|
+
*/
|
|
139
|
+
appsIds?: string[];
|
|
117
140
|
/**
|
|
118
141
|
* Stop at "a connection is chosen" — no Action, no Configure/Test. Renders
|
|
119
142
|
* {@link AppConnectionOnlyConfig} in place of the usual `AppStepConfig`
|
|
@@ -126,6 +149,19 @@ export interface StepBuilderModalProps {
|
|
|
126
149
|
* selection alone. Only meaningful with {@link StepBuilderModalProps.connectionOnly}.
|
|
127
150
|
*/
|
|
128
151
|
onConnected?: (connectionId: string, app: AppSummary) => void;
|
|
152
|
+
/**
|
|
153
|
+
* Callable ids (`fn_…` / `wf_…`) the Functions and Workflows tabs, and the
|
|
154
|
+
* "Ready to use" tab, never offer — matched by id equality only. A Function
|
|
155
|
+
* editor passes its own id: a Function bound to itself has no state change,
|
|
156
|
+
* so the only outcome is an infinite loop. Absent ⇒ nothing is excluded.
|
|
157
|
+
*/
|
|
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;
|
|
129
165
|
}
|
|
130
166
|
/** The four representations of the Configure tab: form, full-step JSON,
|
|
131
167
|
* params-only JSON, node settings. */
|
|
@@ -140,12 +176,13 @@ export type ConfigView = "props" | "code" | "params-code" | "config";
|
|
|
140
176
|
* deliberately no second toggle component: one glyph set, one styling, one
|
|
141
177
|
* pressed-state behaviour, however many views a host offers.
|
|
142
178
|
*/
|
|
143
|
-
export declare function ConfigViewToggle({ view, onChange, disabled, views, }: {
|
|
179
|
+
export declare function ConfigViewToggle({ view, onChange, disabled, views, customized, }: {
|
|
144
180
|
view: ConfigView;
|
|
145
181
|
onChange: (v: ConfigView) => void;
|
|
146
182
|
disabled?: boolean;
|
|
147
183
|
/** Which views to offer, in order. Defaults to all four. */
|
|
148
184
|
views?: ConfigView[];
|
|
185
|
+
customized?: boolean;
|
|
149
186
|
}): import("react").JSX.Element;
|
|
150
187
|
/**
|
|
151
188
|
* Guided "add a step" flow. A sidebar toggles between **Apps** (pick app →
|
|
@@ -155,22 +192,29 @@ export declare function ConfigViewToggle({ view, onChange, disabled, views, }: {
|
|
|
155
192
|
*
|
|
156
193
|
* Data + IO come from `useW6WApi()`, so mount it under `<W6WUIProvider>`.
|
|
157
194
|
*/
|
|
158
|
-
export declare function StepBuilderModal({ onClose, onAdd, onDraftChange, theme, appsOnly, callables, initialTab, title, workflowId, stepId, upstreamSteps, initialApp, initialAction, initialConnection, initialWith, appsFilter, connectionOnly, onConnected, }: 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;
|
|
159
196
|
/**
|
|
160
197
|
* Config form for a chosen internal node — its schema rendered through the same
|
|
161
198
|
* `ParamsForm` as app actions, seeded with the node's defaults. Emits the built
|
|
162
199
|
* step on Add.
|
|
163
200
|
*/
|
|
164
|
-
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, }: {
|
|
165
202
|
node: InternalNodeDef;
|
|
166
203
|
onAdd: (s: BuiltStep) => string | undefined | void;
|
|
167
204
|
onClose: () => void;
|
|
205
|
+
/** Done, once the node is added — applies the add flow's name, then closes. Else `onClose`. */
|
|
206
|
+
onDone?: () => void;
|
|
168
207
|
/** See {@link StepBuilderModalProps.onDraftChange}. */
|
|
169
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;
|
|
170
211
|
workflowId?: string;
|
|
171
212
|
/** The new step's known graph ancestors — see {@link StepBuilderModalProps.upstreamSteps}. */
|
|
172
213
|
upstreamSteps?: ExpressionStepSource[];
|
|
214
|
+
/** See {@link StepBuilderModalProps.loop}. */
|
|
215
|
+
loop?: ExpressionLoopSource;
|
|
173
216
|
}): import("react").JSX.Element;
|
|
217
|
+
export declare function triggerFieldsOf(wf: WorkflowDetail): ActionParam[];
|
|
174
218
|
/**
|
|
175
219
|
* Config → test → add flow for a picked Function/Workflow target (D-12,
|
|
176
220
|
* D-15). Mints a single `@w6w/call` step — `family` only decides which
|
|
@@ -183,15 +227,25 @@ export declare function ControlStepConfig({ node, onAdd, onClose, onDraftChange,
|
|
|
183
227
|
* `NodeConfigForm` is reached once the `@w6w/call` step already lives on a
|
|
184
228
|
* canvas, not at add-time.
|
|
185
229
|
*/
|
|
186
|
-
export declare function CallableStepConfig({ family, targetId, targetLabel, onAdd, onClose, onDraftChange, }: {
|
|
230
|
+
export declare function CallableStepConfig({ family, targetId, targetLabel, onAdd, onClose, onDone, onDraftChange, }: {
|
|
187
231
|
family: "function" | "workflow";
|
|
188
232
|
targetId: string;
|
|
189
233
|
targetLabel: string;
|
|
190
234
|
onAdd: (s: BuiltStep) => string | undefined | void;
|
|
191
235
|
onClose: () => void;
|
|
236
|
+
/** Done, once the node is added — applies the add flow's name, then closes. Else `onClose`. */
|
|
237
|
+
onDone?: () => void;
|
|
192
238
|
/** See {@link StepBuilderModalProps.onDraftChange}. */
|
|
193
239
|
onDraftChange?: (id: string, step: BuiltStep) => void;
|
|
194
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>;
|
|
195
249
|
/**
|
|
196
250
|
* Whether every required param has a usable value — gates the inline "Test run".
|
|
197
251
|
* A required array (e.g. a `vars` table) may be empty (see the Data node); other
|
|
@@ -284,6 +338,8 @@ interface ReadyToUse {
|
|
|
284
338
|
state: "loading" | "error" | "empty" | "ready";
|
|
285
339
|
error?: string;
|
|
286
340
|
apps: AppSummary[];
|
|
341
|
+
/** Full connected-id scope for server search, including apps not loaded yet. */
|
|
342
|
+
appIds?: string[];
|
|
287
343
|
fns: FunctionSummary[];
|
|
288
344
|
wfs: WorkflowSummary[];
|
|
289
345
|
/** More connected-app ids remain unresolved — draw an explicit "load more" affordance. */
|
|
@@ -331,12 +387,42 @@ export declare function clampMinutes(raw: string, min: number): number;
|
|
|
331
387
|
*
|
|
332
388
|
* Exported for tests only (not re-exported from the package index).
|
|
333
389
|
*/
|
|
334
|
-
export declare function useReadyToUse(callables: readonly ("function" | "workflow")[], appsFilter?: (app: AppSummary) => boolean
|
|
335
|
-
|
|
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;
|
|
396
|
+
/** A copy of `items` without any entry whose `id` equals one of `ids` (id
|
|
397
|
+
* equality only — never name or position). No `ids` ⇒ an unchanged copy. */
|
|
398
|
+
export declare function withoutIds<T extends {
|
|
399
|
+
id: string;
|
|
400
|
+
}>(items: readonly T[], ids?: readonly string[]): T[];
|
|
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;
|
|
336
420
|
appId: string;
|
|
337
421
|
app?: AppSummary;
|
|
338
422
|
onAdd: (s: BuiltStep) => string | undefined | void;
|
|
339
423
|
onClose: () => void;
|
|
424
|
+
/** Done, once the node is added — applies the add flow's name, then closes. Else `onClose`. */
|
|
425
|
+
onDone?: () => void;
|
|
340
426
|
/** See {@link StepBuilderModalProps.onDraftChange}. */
|
|
341
427
|
onDraftChange?: (id: string, step: BuiltStep) => void;
|
|
342
428
|
onChangeApp?: () => void;
|
|
@@ -345,6 +431,8 @@ export declare function AppStepConfig({ appId, app, onAdd, onClose, onDraftChang
|
|
|
345
431
|
stepId?: string;
|
|
346
432
|
/** The new step's known graph ancestors — see {@link StepBuilderModalProps.upstreamSteps}. */
|
|
347
433
|
upstreamSteps?: ExpressionStepSource[];
|
|
434
|
+
/** See {@link StepBuilderModalProps.loop}. */
|
|
435
|
+
loop?: ExpressionLoopSource;
|
|
348
436
|
/** Pre-selected action key, opens directly to Configure tab when provided with initialWith */
|
|
349
437
|
initialAction?: string;
|
|
350
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;
|