@w6w/ui 0.2.57 → 0.2.59

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.
Files changed (55) hide show
  1. package/CHANGELOG.md +19 -0
  2. package/dist/AddConnectionModal.d.ts +6 -0
  3. package/dist/StepBuilderModal.d.ts +17 -4
  4. package/dist/TriggerFillForm.d.ts +4 -3
  5. package/dist/WorkflowConnections.d.ts +7 -1
  6. package/dist/WorkflowFlowEditor.d.ts +6 -0
  7. package/dist/canvas-context-menu.d.ts +8 -3
  8. package/dist/components/AuthFieldsForm.d.ts +6 -0
  9. package/dist/components/Combobox.d.ts +9 -1
  10. package/dist/components/CredentialPicker.d.ts +1 -1
  11. package/dist/components/ExpressionOptions.d.ts +2 -0
  12. package/dist/condition-editor.d.ts +3 -1
  13. package/dist/connection-app-meta-CNEwLsL3.cjs +24 -0
  14. package/dist/connection-app-meta-CNEwLsL3.cjs.map +1 -0
  15. package/dist/connection-app-meta-Cl6mUAMF.js +13537 -0
  16. package/dist/connection-app-meta-Cl6mUAMF.js.map +1 -0
  17. package/dist/flow-history.d.ts +8 -0
  18. package/dist/flow.cjs +5 -5
  19. package/dist/flow.cjs.map +1 -1
  20. package/dist/flow.mjs +2425 -2618
  21. package/dist/flow.mjs.map +1 -1
  22. package/dist/index.cjs +2 -2
  23. package/dist/index.cjs.map +1 -1
  24. package/dist/index.mjs +99 -102
  25. package/dist/index.mjs.map +1 -1
  26. package/dist/provider.d.ts +6 -0
  27. package/dist/state-shape.d.ts +13 -0
  28. package/dist/step-preview-state.d.ts +10 -1
  29. package/dist/step-settings-controls.d.ts +20 -0
  30. package/dist/types.d.ts +13 -0
  31. package/package.json +4 -2
  32. package/src/code.css +2 -1
  33. package/src/styles/_box-reset.scss +22 -0
  34. package/src/styles/_callable-list.scss +5 -4
  35. package/src/styles/_canvas.scss +1 -4
  36. package/src/styles/_chips.scss +0 -1
  37. package/src/styles/_connections.scss +101 -0
  38. package/src/styles/_copyable.scss +3 -1
  39. package/src/styles/_data-stores.scss +15 -5
  40. package/src/styles/_data-table.scss +6 -0
  41. package/src/styles/_data-vars.scss +10 -0
  42. package/src/styles/_empty-state.scss +16 -0
  43. package/src/styles/_execution-log.scss +3 -4
  44. package/src/styles/_fields.scss +57 -25
  45. package/src/styles/_flow.scss +11 -0
  46. package/src/styles/_fx.scss +14 -47
  47. package/src/styles/_host-guard.scss +100 -0
  48. package/src/styles/_step-builder.scss +26 -2
  49. package/src/styles/_step-config.scss +4 -5
  50. package/src/styles.css +335 -99
  51. package/src/styles.scss +2 -0
  52. package/dist/connection-app-meta-BeYDm-cs.cjs +0 -24
  53. package/dist/connection-app-meta-BeYDm-cs.cjs.map +0 -1
  54. package/dist/connection-app-meta-aURFNTx_.js +0 -12731
  55. package/dist/connection-app-meta-aURFNTx_.js.map +0 -1
package/CHANGELOG.md CHANGED
@@ -1,5 +1,24 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.2.59
4
+
5
+ - The add-node dialog's Settings tab offers **Write to state** and **Run next nodes**, and a choice lands on the node as soon as it is added.
6
+ - A step whose app needs a connection shows "Connect <App> to choose an action" with a **Connect <App>** button that opens the app's connection form, instead of an action list it can't run.
7
+ - The add-node search covers every tab (built-in nodes, apps, workflows, functions), grouped under headings; clicking a tab narrows it.
8
+ - Connect dialog: an auth's `setup` steps show as a collapsed "Where do I get this?" with a link per step. The credential is named for you (a service-account key by its client email), so there is no Credential name field. A pasted service-account key shows its client email, client ID, project and key ID with only the private key masked, and the scopes come comma-separated with a **Copy** button.
9
+ - Callable lists (workflows, functions, endpoints) draw one frame, and the badge column fits its badges.
10
+ - `Combobox` options can carry a leading icon and extra search keywords.
11
+ - References accept brackets — `messages[0].id`, `user["name"]` — and save in dot form (`@w6w/expr` 0.1.3).
12
+
13
+ ## 0.2.58
14
+
15
+ - A trigger tested in the add-step dialog saves its test, so the next step can read its fields (`{{ nodes.<trigger>.output.* }}`) without re-running it from the step editor.
16
+ - Conditions: **has a value** and **is empty** check whether a field holds anything (saved as JSONLogic `!!` / `!`); **Not** reverses either.
17
+ - An If node's **True** label sits outside the card, above its port, like **False**.
18
+ - A step's Test and the canvas Run node form send what upstream "Write to state" nodes put in state, so `{{ state.* }}` resolves the way the run will (needs a server with the matching invoke change). A whole-value JSON field offers a **state** chip that binds it to `{{ state }}`, and the picker's State section shows for a step not yet wired in.
19
+ - `DataTable` takes `className="w6w-data-table-rows"` for row separators only, no column rule.
20
+ - Form fields keep the library's own spacing and widths on pages with global `label`, `input`, `textarea` or checkbox rules, and every component is `border-box` whatever the page's `box-sizing`. A page override of a form element's margin, width or min-height inside a component now needs at least two classes plus the element (see Theming → Restyle a single component).
21
+
3
22
  ## 0.2.57
4
23
 
5
24
  - Use the app's sample event from the Run node modal.
@@ -22,3 +22,9 @@ export interface AddConnectionModalProps {
22
22
  * in. Data + IO come from `useW6WApi()`.
23
23
  */
24
24
  export declare function AddConnectionModal(props: AddConnectionModalProps): import("react").JSX.Element;
25
+ /**
26
+ * The saved key's label, so nobody has to invent one: the service account's own email when the
27
+ * pasted key carries one (what Google Cloud calls it too), else "<App> key". Connections point at
28
+ * the key by id; the label only tells saved keys apart in the "Use existing" list.
29
+ */
30
+ export declare function credentialName(source: Record<string, unknown>, appName: string): string;
@@ -1,12 +1,18 @@
1
1
  import { NodeConfig } from './NodeConfigForm.tsx';
2
2
  import { ExpressionLoopSource, ExpressionStepSource } from './components/ExpressionOptions.tsx';
3
- import { InternalNodeDef } from './flow-types.ts';
3
+ import { InternalNodeDef, FlowStep } from './flow-types.ts';
4
4
  import { StepStartState, W6WApi } from './provider.tsx';
5
5
  import { ActionDef, ActionParam, AppSummary, FunctionSummary, ThemeMode, WorkflowSummary } from './types.ts';
6
6
  /** The step the builder emits — the editor assigns the final `id` unless `id` carries a
7
7
  * name the user chose in the add flow. `NodeConfig` carries the base settings (retry /
8
8
  * onError / notes) set on the Config view. */
9
- export interface BuiltStep extends NodeConfig {
9
+ /**
10
+ * What the add dialog's Settings collect: the node editor's settings (retry, on error, notes) plus
11
+ * "Run next nodes" and "Write to state", so the node is created with them instead of gaining them
12
+ * only once it is reopened.
13
+ */
14
+ export type DraftConfig = NodeConfig & Pick<FlowStep, "state" | "fanOut">;
15
+ export interface BuiltStep extends DraftConfig {
10
16
  /** The node name chosen in the add flow; on `onDraftChange` it renames the minted node. */
11
17
  id?: string;
12
18
  uses: {
@@ -20,7 +26,13 @@ export interface BuiltStep extends NodeConfig {
20
26
  with?: Record<string, unknown>;
21
27
  }
22
28
  export interface StepBuilderModalProps {
29
+ /** Cancel, × and Esc — and Done when `onDone` is not supplied. */
23
30
  onClose: () => void;
31
+ /**
32
+ * Done: the user finished configuring the added step. Lets a host tell Done from
33
+ * Cancel, so a cancelled add can be rolled back. Defaults to `onClose`.
34
+ */
35
+ onDone?: () => void;
24
36
  /**
25
37
  * Fired once per session, the moment the step first has identity — for an
26
38
  * app step, when Setup completes (action + connection, if needed); for a
@@ -192,7 +204,7 @@ export declare function ConfigViewToggle({ view, onChange, disabled, views, cust
192
204
  *
193
205
  * Data + IO come from `useW6WApi()`, so mount it under `<W6WUIProvider>`.
194
206
  */
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;
207
+ export declare function StepBuilderModal({ onClose, onDone, 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;
196
208
  /**
197
209
  * Config form for a chosen internal node — its schema rendered through the same
198
210
  * `ParamsForm` as app actions, seeded with the node's defaults. Emits the built
@@ -277,7 +289,8 @@ export declare function isTestRequired(surface: unknown): boolean;
277
289
  * fixture (`saveStepTest`) and records the run's outcome (`recordStepTestRun`)
278
290
  * against the given workflow step after each invoke. `input` is the resolved
279
291
  * incoming state captured alongside the params (`values` → `with`). Absent in
280
- * the add-step builder (the step isn't in a workflow yet).
292
+ * the add-step builder until the step is on the canvas: an app step lands on
293
+ * "Add", but a built-in node is committed the moment it is picked, so its Test saves.
281
294
  */
282
295
  export interface StepTestPersist {
283
296
  workflowId: string;
@@ -52,9 +52,10 @@ export declare function TriggerFillForm({ app, action, fields, persist, listen,
52
52
  /** The trigger's `fields` param value (an array of field definitions). */
53
53
  fields: unknown;
54
54
  /**
55
- * Where to remember the entered values. Absent in the add-step builder — that
56
- * step is not in a workflow yet, so there is no `(workflowId, stepId)` to key
57
- * a fixture by and this form neither reads nor writes one.
55
+ * Where to remember the entered values. Absent only where the trigger has no
56
+ * `(workflowId, stepId)` to key a fixture by (a builder with no canvas behind
57
+ * it); there this form neither reads nor writes one. The add-step builder
58
+ * passes it once the picked trigger is committed to the canvas.
58
59
  */
59
60
  persist?: StepTestPersist;
60
61
  /** Offer "Listen for test event" (webhook triggers in a saved workflow). */
@@ -15,7 +15,7 @@ export declare function useWorkflowConnections(): {
15
15
  setConnections: (connections: FlowConnections) => void;
16
16
  } | null;
17
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, }: {
18
+ export declare function WorkflowConnectionPicker({ step, conns, failed, readOnly, open, onOpenChange, anchorRef, onChangeConnection, onChangeConnectionRef, onConnectionCreated, createSignal, }: {
19
19
  step: FlowStep;
20
20
  conns: ConnectionSummary[] | null;
21
21
  failed?: boolean;
@@ -26,4 +26,10 @@ export declare function WorkflowConnectionPicker({ step, conns, failed, readOnly
26
26
  onChangeConnection: (id: string) => void;
27
27
  onChangeConnectionRef: (ref: string) => void;
28
28
  onConnectionCreated: () => void;
29
+ /**
30
+ * Open the new-connection dialog straight away, skipping the menu: each INCREASE of this
31
+ * number opens it once (a host's "Connect <app>" button bumps it). The value on mount never
32
+ * opens it.
33
+ */
34
+ createSignal?: number;
29
35
  }): import("react").JSX.Element;
@@ -220,7 +220,13 @@ interface StepEditModalProps {
220
220
  /** The enclosing For each when this step is in its body: seeds `state.foreach` on Test. */
221
221
  loop?: ExpressionLoopSource;
222
222
  onChange: (next: FlowStep) => void;
223
+ /** Done: close, keeping the edits (they apply live). Also ×/Esc when `onCancel` is absent. */
223
224
  onClose: () => void;
225
+ /**
226
+ * Cancel, × and Esc: close and discard this dialog's edits. Without it, no Cancel button
227
+ * shows and × / Esc keep the edits.
228
+ */
229
+ onCancel?: () => void;
224
230
  readOnly?: boolean;
225
231
  initialView?: EditView;
226
232
  /** Most outgoing edges this node has in one lane; "Run next nodes" needs >= 2. */
@@ -8,7 +8,7 @@ export interface CanvasMenuTarget {
8
8
  /** Node ids Duplicate / Delete act on. Empty on a bare-canvas right-click. */
9
9
  nodeIds: string[];
10
10
  }
11
- export type CanvasMenuAction = "duplicate" | "delete" | "add-node" | "add-trigger";
11
+ export type CanvasMenuAction = "duplicate" | "delete" | "replace-trigger" | "add-node" | "add-trigger";
12
12
  export interface CanvasMenuItem {
13
13
  action: CanvasMenuAction;
14
14
  label: string;
@@ -23,5 +23,10 @@ export interface CanvasMenuItem {
23
23
  * The bare canvas acts on whatever is selected.
24
24
  */
25
25
  export declare function contextMenuTargets(selectedIds: readonly string[], nodeId?: string): string[];
26
- /** Duplicate + Delete when nodes are targeted, then Add node + Add trigger. All greyed when read-only. */
27
- export declare function canvasMenuItems(nodeIds: readonly string[], readOnly: boolean): CanvasMenuItem[];
26
+ /**
27
+ * Duplicate + Delete when nodes are targeted (plus Replace trigger when the one target is a
28
+ * trigger), then Add node + Add trigger. All greyed when read-only.
29
+ */
30
+ export declare function canvasMenuItems(nodeIds: readonly string[], readOnly: boolean, opts?: {
31
+ replaceableTrigger?: boolean;
32
+ }): CanvasMenuItem[];
@@ -37,4 +37,10 @@ export declare function parseJsonFields(fields: AuthField[], values: Record<stri
37
37
  * comes from the app's manifest so no app-specific knowledge is needed here.
38
38
  */
39
39
  export declare function AuthFieldsForm({ fields, values, onChange, enterSubmitProps, mode, }: Props): import("react").JSX.Element;
40
+ export declare function keyFilePreview(raw: string): {
41
+ key: string;
42
+ label: string;
43
+ value: string;
44
+ secret: boolean;
45
+ }[] | null;
40
46
  export {};
@@ -1,8 +1,16 @@
1
+ import { ReactNode } from 'react';
1
2
  export interface ComboboxOption {
2
3
  value: string;
3
4
  label: string;
4
5
  /** A muted second line under the label (e.g. a value preview); never matched by the filter. */
5
6
  detail?: string;
7
+ /**
8
+ * A small leading glyph (e.g. a provider's logo), drawn before the label in the list and
9
+ * inside the input while this option is the selected one. Combobox mode only.
10
+ */
11
+ icon?: ReactNode;
12
+ /** Extra text the filter also matches (e.g. a provider name that is not in the label). */
13
+ keywords?: string;
6
14
  }
7
15
  export interface ComboboxProps {
8
16
  options: ComboboxOption[];
@@ -36,7 +44,7 @@ export interface ComboboxProps {
36
44
  }
37
45
  /** Combobox is chosen when the list would take more than 60% of the viewport. */
38
46
  export declare function shouldUseCombobox(count: number, optionHeight: number, viewportHeight: number): boolean;
39
- /** Case-insensitive substring match on label and value. */
47
+ /** Case-insensitive substring match on label, value and keywords. */
40
48
  export declare function filterOptions(options: ComboboxOption[], query: string): ComboboxOption[];
41
49
  export declare const DEFAULT_LIST_MAX_HEIGHT = 240;
42
50
  export declare function Combobox({ options, value, onChange, placeholder, disabled, "aria-label": ariaLabel, mode, forceSelection, optionHeight, listMaxHeight, className, onInputChange, emptyText, footer, }: ComboboxProps): import("react").JSX.Element;
@@ -22,7 +22,7 @@ export interface CredentialPickerProps {
22
22
  export declare function CredentialPicker({ credentials, mode, onModeChange, selectedId, onSelect, canUseExisting, contract, }: CredentialPickerProps): import("react").JSX.Element;
23
23
  /**
24
24
  * The binding fields a `serviceAccount` auth asks for on a connection. `delegatedUser` is always
25
- * labelled "Impersonated user" (the person the credential acts as, never the connection's owner),
25
+ * labelled "Workspace user to act as" (the person the credential acts as, never the connection's owner),
26
26
  * is absent when impersonation is `"none"` even if declared, and is synthesised when impersonation
27
27
  * is allowed but the auth declares no such field.
28
28
  */
@@ -161,6 +161,8 @@ export interface ExpressionOptions {
161
161
  */
162
162
  stateShape?: {
163
163
  fields: ExpressionStateField[];
164
+ /** Upstream state writes from real outputs — what a step Test sends as `state` (`state-shape.ts`). */
165
+ written?: Record<string, unknown>;
164
166
  };
165
167
  /** Whether a trigger event is in scope (`trigger.event`). */
166
168
  hasTrigger?: boolean;
@@ -1,8 +1,10 @@
1
1
  import { ExprValue, SecretValue } from './types.ts';
2
2
  /** The comparisons the condition builder offers, in menu order, with their labels. */
3
- export declare const CONDITION_OPERATORS: readonly [readonly ["is-true", "is true"], readonly ["is-false", "is false"], readonly ["===", "equals"], readonly ["!==", "does not equal"], readonly [">", "greater than"], readonly [">=", "at least"], readonly ["<", "less than"], readonly ["<=", "at most"], readonly ["in", "in"], readonly ["includes", "includes value"], readonly ["include-any", "includes any of (list)"], readonly ["include-all", "includes all of (list)"]];
3
+ export declare const CONDITION_OPERATORS: readonly [readonly ["is-true", "is true"], readonly ["is-false", "is false"], readonly ["has-value", "has a value"], readonly ["is-empty", "is empty"], readonly ["===", "equals"], readonly ["!==", "does not equal"], readonly [">", "greater than"], readonly [">=", "at least"], readonly ["<", "less than"], readonly ["<=", "at most"], readonly ["in", "in"], readonly ["includes", "includes value"], readonly ["include-any", "includes any of (list)"], readonly ["include-all", "includes all of (list)"]];
4
4
  /** Operand order for membership comparisons; shown on the selected operator and its options. */
5
5
  export declare const CONDITION_OPERATOR_HINTS: Record<string, string>;
6
+ /** True when `operator` takes no right-hand value (is true / is false / has a value / is empty). */
7
+ export declare function isUnaryConditionOperator(operator: string): boolean;
6
8
  /** A comparison operator as the builder names it (`===` → "equals"); unknown ones as written. */
7
9
  export declare function conditionOperatorLabel(op: string): string;
8
10
  /** One comparison row of the builder: `left <operator> right`. */