@w6w/ui 0.2.66 → 0.2.67
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 +11 -1
- package/README.md +5 -3
- package/dist/FormBuilder.d.ts +19 -0
- package/dist/ManualWebhookPanel.d.ts +34 -0
- package/dist/TriggerFillForm.d.ts +3 -0
- package/dist/WebhookListenPanel.d.ts +8 -1
- package/dist/components/AuthFieldsForm.d.ts +10 -0
- package/dist/components/AuthGuide.d.ts +19 -1
- package/dist/components/CallableList.d.ts +30 -4
- package/dist/components/Combobox.d.ts +5 -0
- package/dist/components/ExpressionOptions.d.ts +22 -0
- package/dist/{connection-app-meta-CKBbgN7e.js → connection-app-meta-DEC0n4PA.js} +4894 -4211
- package/dist/connection-app-meta-DEC0n4PA.js.map +1 -0
- package/dist/connection-app-meta-Dk6F3KEH.cjs +29 -0
- package/dist/connection-app-meta-Dk6F3KEH.cjs.map +1 -0
- package/dist/dynamic-fields.d.ts +3 -0
- package/dist/flow-types.d.ts +2 -0
- package/dist/flow.cjs +6 -5
- package/dist/flow.cjs.map +1 -1
- package/dist/flow.mjs +3515 -2436
- package/dist/flow.mjs.map +1 -1
- package/dist/form-schema.d.ts +236 -0
- package/dist/form-trigger.d.ts +8 -0
- package/dist/index.cjs +2 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +4 -4
- package/dist/index.mjs +1325 -1272
- package/dist/index.mjs.map +1 -1
- package/dist/provider.d.ts +12 -0
- package/dist/resolve-params.d.ts +2 -0
- package/dist/types.d.ts +17 -1
- package/dist/workflow-connections.d.ts +11 -0
- package/package.json +2 -2
- package/src/styles/_callable-list.scss +37 -3
- package/src/styles/_connections.scss +29 -0
- package/src/styles/_expression-modal.scss +7 -0
- package/src/styles/_form-builder.scss +232 -0
- package/src/styles/_sections.scss +29 -0
- package/src/styles.css +386 -3
- package/src/styles.scss +1 -0
- package/dist/connection-app-meta-CKBbgN7e.js.map +0 -1
- package/dist/connection-app-meta-DfA6Yqhh.cjs +0 -28
- package/dist/connection-app-meta-DfA6Yqhh.cjs.map +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,6 +1,16 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
-
##
|
|
3
|
+
## 0.2.67
|
|
4
|
+
|
|
5
|
+
- **Connections in the expression editor:** the ƒx picker lists each workflow connection binding with its app and account, and inserts `connections.<name>.<field>` (id, app, name, state, profile fields). Needs `@w6w/expr` 0.1.6.
|
|
6
|
+
- **Form trigger** with a drag-and-drop form builder; fields are added from a sectioned combobox.
|
|
7
|
+
- A manual webhook trigger shows its URL and setup steps.
|
|
8
|
+
- Trigger settings forms load dynamic options.
|
|
9
|
+
- Workflows, Endpoints and Functions lists have status tabs and search; the rows' three-dots menu offers Duplicate (via `@w6w/embed`).
|
|
10
|
+
- Custom CSS starts from a commented template of the page's vars.
|
|
11
|
+
- Service-account key files are never masked, and domain-wide delegation is spelled out; a secret can be replaced on demand.
|
|
12
|
+
|
|
13
|
+
## 0.2.62 – 0.2.66
|
|
4
14
|
|
|
5
15
|
- Connect dialog: with no shared credential the app can use, the Credential step's **Use existing / Enter new** choice is gone and the app's own fields show directly. The empty "No shared credentials of this type yet." state and its **Create a shared credential** button are removed; `onCreateSharedCredential`, `CreateSharedCredentialContext` and `CredentialPicker`'s `emptyHint` / `onCreateShared` are deprecated and ignored.
|
|
6
16
|
- `AppConnectionForm`: one app's connect form without the dialog, for a host that already has one.
|
package/README.md
CHANGED
|
@@ -284,9 +284,11 @@ Install from the Studio repository root with `pnpm install`; all three packages
|
|
|
284
284
|
lockfile. From that root, use `pnpm -C packages/ui build`, `test`, or `storybook`.
|
|
285
285
|
The published npm package remains `@w6w/ui` with the same exports and MIT license.
|
|
286
286
|
|
|
287
|
-
|
|
288
|
-
`packages/ui
|
|
289
|
-
|
|
287
|
+
Publishing is continuous: `.github/workflows/release-ui.yml` in **w6w-io/w6w-studio** runs on
|
|
288
|
+
every push to `main` that touches `packages/ui`, and publishes `packages/ui/package.json`'s
|
|
289
|
+
version if npm does not have it yet. Bumping the version and merging is the release; there is no
|
|
290
|
+
tag. Before uploading it waits (up to 30 minutes) for each `@w6w/*` dependency version it names
|
|
291
|
+
to reach npm, so a provider merged first (core's `@w6w/expr`) may still be publishing.
|
|
290
292
|
The workflow publishes the exact tested pnpm tarball using npm trusted publishing.
|
|
291
293
|
Before the first release from Studio, update @w6w/ui's npm trusted publisher to
|
|
292
294
|
repository `w6w-studio`, workflow `release-ui.yml` (the former `w6w-ui/release.yml`
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { FormDefinition } from './form-schema.ts';
|
|
2
|
+
/**
|
|
3
|
+
* The `@w6w/form` trigger's form builder — the custom editor for its `form` param (a
|
|
4
|
+
* {@link FormDefinition}, `form-schema.ts`). The form's title and description, then its fields as
|
|
5
|
+
* a list you **drag to reorder** (grip; ArrowUp/ArrowDown on a focused grip moves one place), each
|
|
6
|
+
* opening into its own settings; a searchable "Add a field" combobox that appends a new field
|
|
7
|
+
* of the picked type and opens it; then the completion screen and the page settings. Every edit writes the
|
|
8
|
+
* whole definition back through `onChange`; the authored value is edited in place (never
|
|
9
|
+
* round-tripped through the parser, which would drop a half-typed name), and the parser's problems
|
|
10
|
+
* are listed on top. The JSON itself stays editable in the step's Parameters code view.
|
|
11
|
+
*/
|
|
12
|
+
export declare function FormBuilder({ value, onChange, readOnly, stepId, }: {
|
|
13
|
+
/** The step's `with.form` — a form definition, or absent for a new trigger. */
|
|
14
|
+
value: unknown;
|
|
15
|
+
onChange: (form: FormDefinition) => void;
|
|
16
|
+
readOnly?: boolean;
|
|
17
|
+
/** The trigger's node id, for the "use this answer as" hint. */
|
|
18
|
+
stepId?: string;
|
|
19
|
+
}): import("react").JSX.Element;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { SubscriptionSummary, WebhookSetup } from './types.ts';
|
|
2
|
+
/**
|
|
3
|
+
* The trigger node's own subscription, if any: node-bound, same app and trigger. The server keeps
|
|
4
|
+
* one row per node, so this is the row whose URL the user pastes into the vendor.
|
|
5
|
+
*/
|
|
6
|
+
export declare function pickNodeSubscription(subs: readonly SubscriptionSummary[], nodeId: string, appId: string, triggerKey: string): SubscriptionSummary | null;
|
|
7
|
+
/** `instructions` → its steps: one per non-empty line, a leading "1." / "-" / "•" dropped. */
|
|
8
|
+
export declare function instructionSteps(instructions: string | undefined): string[];
|
|
9
|
+
/**
|
|
10
|
+
* The receive URL of an app trigger whose webhook the USER adds in the vendor
|
|
11
|
+
* (`Trigger.webhook.registration === "manual"`, rfcs/trigger.md Amendment 2026-11-22), with the
|
|
12
|
+
* app's own steps for adding it and a plain warning that nothing arrives until it is added.
|
|
13
|
+
*
|
|
14
|
+
* The URL exists before publish: when the node has no subscription yet the panel asks the server
|
|
15
|
+
* for one (`createSubscription` with `nodeId`). That create is idempotent per node on the server,
|
|
16
|
+
* and the row stays dormant until the node is published, so opening the panel twice, or on a
|
|
17
|
+
* second tab, never mints a second URL. The id, and so the URL, survives edits to the trigger's
|
|
18
|
+
* params and connection, so a URL already pasted keeps working.
|
|
19
|
+
*
|
|
20
|
+
* While the row is still `pending` (not yet adopted by a publish), edits to the node's fields are
|
|
21
|
+
* sent to it, debounced, by the same idempotent create: a vendor that checks the URL when it is
|
|
22
|
+
* saved (a verify token, a signing secret) checks it against what the user just typed.
|
|
23
|
+
*/
|
|
24
|
+
export declare function ManualWebhookPanel({ workflowId, nodeId, appId, triggerKey, appName, setup, connectionId, params, readOnly, }: {
|
|
25
|
+
workflowId: string;
|
|
26
|
+
nodeId: string;
|
|
27
|
+
appId: string;
|
|
28
|
+
triggerKey: string;
|
|
29
|
+
appName: string;
|
|
30
|
+
setup: WebhookSetup;
|
|
31
|
+
connectionId: string | null;
|
|
32
|
+
params: Record<string, unknown>;
|
|
33
|
+
readOnly?: boolean;
|
|
34
|
+
}): import("react").JSX.Element;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { StepTestPersist } from './StepBuilderModal.tsx';
|
|
2
|
+
import { FORM_APP, WEBHOOK_APP } from './flow-types.ts';
|
|
2
3
|
/** How long an edited sample payload sits before it is remembered (it is flushed on close too). */
|
|
3
4
|
export declare const EDIT_SAVE_DEBOUNCE_MS = 600;
|
|
4
5
|
/**
|
|
@@ -69,6 +70,8 @@ export declare function TriggerFillForm({ app, action, fields, persist, listen,
|
|
|
69
70
|
listen?: {
|
|
70
71
|
stepWith: Record<string, unknown> | undefined;
|
|
71
72
|
readOnly?: boolean;
|
|
73
|
+
/** The trigger app; a `@w6w/form` listens for a form submission. Default `@w6w/webhook`. */
|
|
74
|
+
appId?: typeof WEBHOOK_APP | typeof FORM_APP;
|
|
72
75
|
};
|
|
73
76
|
/** An app trigger node (`uses.trigger: true`): the payload is the output, nothing is invoked. */
|
|
74
77
|
appTrigger?: boolean;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { FORM_APP, WEBHOOK_APP } from './flow-types.ts';
|
|
1
2
|
import { SubscriptionSummary, WebhookListenSession } from './types.ts';
|
|
2
3
|
/** The captured call a webhook trigger emits as its output. */
|
|
3
4
|
export type CapturedWebhookRequest = NonNullable<WebhookListenSession["request"]>;
|
|
@@ -16,7 +17,13 @@ export declare function displayHeaders(headers: Record<string, string>): Record<
|
|
|
16
17
|
* ones masked), pretty body — and **Use as test data** hands it to `onUse`, which makes it this
|
|
17
18
|
* trigger's output and saved test.
|
|
18
19
|
*/
|
|
19
|
-
export declare function WebhookListenPanel({ workflowId, stepId, stepWith, readOnly, onUse, using, }: {
|
|
20
|
+
export declare function WebhookListenPanel({ workflowId, stepId, stepWith, readOnly, onUse, using, appId, }: {
|
|
21
|
+
/**
|
|
22
|
+
* The trigger: a `@w6w/webhook` URL captures the next request; a `@w6w/form` page captures the
|
|
23
|
+
* next submission — which, unlike a webhook's, also runs the workflow (the editor's saved draft),
|
|
24
|
+
* so a test submission shows the whole flow continuing.
|
|
25
|
+
*/
|
|
26
|
+
appId?: typeof WEBHOOK_APP | typeof FORM_APP;
|
|
20
27
|
workflowId: string;
|
|
21
28
|
stepId: string;
|
|
22
29
|
/** The node's current config — the params a newly created subscription starts from. */
|
|
@@ -43,4 +43,14 @@ export declare function keyFilePreview(raw: string): {
|
|
|
43
43
|
value: string;
|
|
44
44
|
secret: boolean;
|
|
45
45
|
}[] | null;
|
|
46
|
+
/**
|
|
47
|
+
* A secret JSON field (a service-account key file): paste it or pick the file, then see what was
|
|
48
|
+
* read — the account email, project, client id, key id — with the secret parts masked. The raw
|
|
49
|
+
* text is never shown back; it is parsed and encrypted on save, and a saved key is never re-shown.
|
|
50
|
+
*/
|
|
51
|
+
export declare function SecretJsonField({ field, value, onChange, }: {
|
|
52
|
+
field: AuthField;
|
|
53
|
+
value: string;
|
|
54
|
+
onChange: (raw: string) => void;
|
|
55
|
+
}): import("react").JSX.Element;
|
|
46
56
|
export {};
|
|
@@ -5,9 +5,10 @@ import { AuthDef } from '../types.ts';
|
|
|
5
5
|
* or a delegation is re-granted. The auth's description, its "Where do I get this?" steps, and
|
|
6
6
|
* for a service account the scopes to grant, each only when declared.
|
|
7
7
|
*/
|
|
8
|
-
export declare function AuthGuide({ auth, scopes }: {
|
|
8
|
+
export declare function AuthGuide({ auth, scopes, clientId, }: {
|
|
9
9
|
auth: AuthDef;
|
|
10
10
|
scopes?: boolean;
|
|
11
|
+
clientId?: string;
|
|
11
12
|
}): import("react").JSX.Element;
|
|
12
13
|
/**
|
|
13
14
|
* "Where do I get this?" — the auth's own setup steps, each linking to the vendor page where the
|
|
@@ -19,6 +20,23 @@ export declare function AuthSetupSteps({ steps }: {
|
|
|
19
20
|
url?: string;
|
|
20
21
|
}[];
|
|
21
22
|
}): import("react").JSX.Element;
|
|
23
|
+
/**
|
|
24
|
+
* The Client ID a Google service-account key carries, from a pasted key file's text (or an
|
|
25
|
+
* already-parsed object). Empty when it is not a key file yet.
|
|
26
|
+
*/
|
|
27
|
+
export declare function keyClientId(raw: unknown): string;
|
|
28
|
+
/**
|
|
29
|
+
* Domain-wide delegation, spelled out where a service-account connection is made: a Workspace
|
|
30
|
+
* service account can act as a user only after a Workspace admin allows its Client ID for the
|
|
31
|
+
* exact scopes. Always open (it is the step people miss), with the Client ID and the scopes each
|
|
32
|
+
* copyable, so nothing has to be hunted for in the key file. `clientId` is empty until a key is
|
|
33
|
+
* chosen or pasted.
|
|
34
|
+
*/
|
|
35
|
+
export declare function DelegationSteps({ scopes, clientId, required, }: {
|
|
36
|
+
scopes: readonly string[];
|
|
37
|
+
clientId: string;
|
|
38
|
+
required: boolean;
|
|
39
|
+
}): import("react").JSX.Element;
|
|
22
40
|
/**
|
|
23
41
|
* The scopes a service account must be granted, comma-separated exactly as Google's
|
|
24
42
|
* Domain-wide delegation form asks for them, with a Copy button.
|
|
@@ -6,6 +6,10 @@ export interface CallableListRow {
|
|
|
6
6
|
title: ReactNode;
|
|
7
7
|
description?: ReactNode;
|
|
8
8
|
archived: boolean;
|
|
9
|
+
/** The row's status bucket (e.g. `"active"`, `"draft"`): which of the list's `groups` tabs it sits in. */
|
|
10
|
+
group?: string;
|
|
11
|
+
/** What the search box matches, besides the id. Defaults to `title` and `description` when strings. */
|
|
12
|
+
searchText?: string;
|
|
9
13
|
/** Extra badges, rendered before the archived badge in the trailing slot. */
|
|
10
14
|
badges?: ReactNode;
|
|
11
15
|
/** Trailing content; sits inside the row's anchor when `getHref` is set, so keep it non-interactive. */
|
|
@@ -41,10 +45,16 @@ export interface CallableListProps {
|
|
|
41
45
|
newLabel?: string;
|
|
42
46
|
/** Tooltip (`title` attribute) on each openable row. */
|
|
43
47
|
openRowTitle?: string;
|
|
48
|
+
/**
|
|
49
|
+
* `showArchived` lands on the Archived tab; `filterTab` is a prefix, each tab gets
|
|
50
|
+
* `<prefix>-<key>` (`all`, a group key, `archived`).
|
|
51
|
+
*/
|
|
44
52
|
testIds?: {
|
|
45
53
|
showArchived?: string;
|
|
46
54
|
importOpen?: string;
|
|
47
55
|
archivedBadge?: string;
|
|
56
|
+
filterTab?: string;
|
|
57
|
+
search?: string;
|
|
48
58
|
};
|
|
49
59
|
loading?: boolean;
|
|
50
60
|
error?: string | null;
|
|
@@ -58,11 +68,21 @@ export interface CallableListProps {
|
|
|
58
68
|
onOpen?: (id: string, event: MouseEvent<Element>) => void;
|
|
59
69
|
/** When set, each row is a real `<a href>`. */
|
|
60
70
|
getHref?: (id: string) => string;
|
|
61
|
-
/**
|
|
71
|
+
/**
|
|
72
|
+
* Status tabs between All and Archived, in order (e.g. Active, Draft). A row joins one through
|
|
73
|
+
* its `group`. All lists every row that is not archived; Archived lists only archived rows.
|
|
74
|
+
*/
|
|
75
|
+
groups?: readonly CallableListGroup[];
|
|
76
|
+
/** Controlled tab: `"all"`, a group key, or `"archived"`. Omit for an uncontrolled tab on All. */
|
|
77
|
+
filter?: string;
|
|
78
|
+
onFilterChange?: (next: string) => void;
|
|
79
|
+
/** Old name for the Archived tab: `true` is `filter: "archived"`, `false` is All. */
|
|
62
80
|
showArchived?: boolean;
|
|
63
81
|
onShowArchivedChange?: (next: boolean) => void;
|
|
82
|
+
/** Placeholder of the search box. Defaults to "Search by name". */
|
|
83
|
+
searchPlaceholder?: string;
|
|
64
84
|
slots?: {
|
|
65
|
-
/** Replaces the default title/description block (the
|
|
85
|
+
/** Replaces the default title/description block (the filter bar stays). */
|
|
66
86
|
header?: ReactNode;
|
|
67
87
|
/** Rendered before Import/New. */
|
|
68
88
|
actions?: ReactNode;
|
|
@@ -70,10 +90,16 @@ export interface CallableListProps {
|
|
|
70
90
|
empty?: ReactNode;
|
|
71
91
|
};
|
|
72
92
|
}
|
|
93
|
+
/** One status tab of a {@link CallableList}: rows whose `group` equals `key`. */
|
|
94
|
+
export interface CallableListGroup {
|
|
95
|
+
key: string;
|
|
96
|
+
label: string;
|
|
97
|
+
}
|
|
73
98
|
/**
|
|
74
99
|
* A presentational list of callables (Functions, Endpoints, Workflows): rows in, callbacks out.
|
|
75
|
-
* Owns only
|
|
100
|
+
* Owns only its filters — status tabs (All, each of `groups`, Archived, with counts) and a search
|
|
101
|
+
* box; it knows no router, query, modal or kind.
|
|
76
102
|
* Rows render through {@link DataTable}: a click handler with `onOpen`, anchors with `getHref`.
|
|
77
103
|
* No visible rows renders an {@link EmptyState}; when only archived rows exist it offers "Show archived".
|
|
78
104
|
*/
|
|
79
|
-
export declare function CallableList({ rows, title, icon, description, emptyCopy, newLabel, openRowTitle, testIds, loading, error, onCreate, creating, onImport, onOpen, getHref, showArchived: showArchivedProp, onShowArchivedChange, slots, }: CallableListProps): import("react").JSX.Element;
|
|
105
|
+
export declare function CallableList({ rows, title, icon, description, emptyCopy, newLabel, openRowTitle, testIds, loading, error, onCreate, creating, onImport, onOpen, getHref, groups, filter: filterProp, onFilterChange, showArchived: showArchivedProp, onShowArchivedChange, searchPlaceholder, slots, }: CallableListProps): import("react").JSX.Element;
|
|
@@ -11,6 +11,11 @@ export interface ComboboxOption {
|
|
|
11
11
|
icon?: ReactNode;
|
|
12
12
|
/** Extra text the filter also matches (e.g. a provider name that is not in the label). */
|
|
13
13
|
keywords?: string;
|
|
14
|
+
/**
|
|
15
|
+
* A section heading: a run of consecutive options sharing a `group` is listed under it (an
|
|
16
|
+
* `<optgroup>` in select mode). Filtering keeps the heading over the options still shown.
|
|
17
|
+
*/
|
|
18
|
+
group?: string;
|
|
14
19
|
}
|
|
15
20
|
export interface ComboboxProps {
|
|
16
21
|
options: ComboboxOption[];
|
|
@@ -139,6 +139,23 @@ export interface ExpressionDocumentSource {
|
|
|
139
139
|
key: string;
|
|
140
140
|
}[];
|
|
141
141
|
}
|
|
142
|
+
/**
|
|
143
|
+
* A workflow connection binding (`connections.<name>`): who it is and the non-secret `profile`
|
|
144
|
+
* its app recorded at connect time. Offered as the rail's "Connections" section.
|
|
145
|
+
*/
|
|
146
|
+
export interface ExpressionConnectionSource {
|
|
147
|
+
/** The binding name (`Workflow.connections` key), e.g. `gitlab_1`. */
|
|
148
|
+
name: string;
|
|
149
|
+
/** The app's display name, else its id. */
|
|
150
|
+
appName: string;
|
|
151
|
+
/** The bound connection's display name; absent while unbound or not loaded. */
|
|
152
|
+
label?: string;
|
|
153
|
+
/**
|
|
154
|
+
* The readable fields under `connections.<name>`: `id`, `app`, `name`, `state`, `profile`, and
|
|
155
|
+
* one `profile.<path>` per profile leaf (`path: true`, so the rail nests them).
|
|
156
|
+
*/
|
|
157
|
+
fields: ExpressionFieldSource[];
|
|
158
|
+
}
|
|
142
159
|
/** Known variable/secret names offered in an ExpressionInput's insert menu. */
|
|
143
160
|
export interface ExpressionOptions {
|
|
144
161
|
vars?: string[];
|
|
@@ -148,6 +165,11 @@ export interface ExpressionOptions {
|
|
|
148
165
|
* only — there is deliberately no create callback.
|
|
149
166
|
*/
|
|
150
167
|
constants?: string[];
|
|
168
|
+
/**
|
|
169
|
+
* The workflow's connection bindings (`connections.<name>.profile.<field>`). Workflow context
|
|
170
|
+
* only; values for the preview ride {@link sampleValues} as whole `connections.<name>` objects.
|
|
171
|
+
*/
|
|
172
|
+
connections?: ExpressionConnectionSource[];
|
|
151
173
|
secrets?: string[];
|
|
152
174
|
/**
|
|
153
175
|
* Function/run input keys in scope (`inputs.<name>`). Present when the field
|