@w6w/ui 0.2.56 → 0.2.57

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 (41) hide show
  1. package/CHANGELOG.md +8 -0
  2. package/dist/CallTargetForm.d.ts +10 -0
  3. package/dist/{CodeBlock-CymlfyeA.cjs → CodeBlock-BSX1pi6W.cjs} +2 -2
  4. package/dist/{CodeBlock-CymlfyeA.cjs.map → CodeBlock-BSX1pi6W.cjs.map} +1 -1
  5. package/dist/{CodeBlock-C-oIIYfC.js → CodeBlock-CPKXSNEs.js} +7 -3
  6. package/dist/{CodeBlock-C-oIIYfC.js.map → CodeBlock-CPKXSNEs.js.map} +1 -1
  7. package/dist/CodeEditor.d.ts +2 -0
  8. package/dist/JsonEditor.d.ts +1 -3
  9. package/dist/Markdown.d.ts +3 -1
  10. package/dist/StepBuilderModal.d.ts +2 -3
  11. package/dist/TriggerSampleButton.d.ts +11 -0
  12. package/dist/WorkflowFlowEditor.d.ts +48 -0
  13. package/dist/YamlEditor.d.ts +1 -2
  14. package/dist/callable-fields.d.ts +4 -0
  15. package/dist/code.cjs +1 -1
  16. package/dist/code.mjs +1 -1
  17. package/dist/components/ConfirmModal.d.ts +7 -1
  18. package/dist/components/DataEntryList.d.ts +2 -0
  19. package/dist/components/ResultViewer.d.ts +1 -2
  20. package/dist/connection-app-meta-BeYDm-cs.cjs +24 -0
  21. package/dist/connection-app-meta-BeYDm-cs.cjs.map +1 -0
  22. package/dist/{connection-app-meta-ZCPakGjD.js → connection-app-meta-aURFNTx_.js} +6115 -5806
  23. package/dist/connection-app-meta-aURFNTx_.js.map +1 -0
  24. package/dist/flow.cjs +4 -3
  25. package/dist/flow.cjs.map +1 -1
  26. package/dist/flow.mjs +1820 -1753
  27. package/dist/flow.mjs.map +1 -1
  28. package/dist/index.cjs +2 -2
  29. package/dist/index.cjs.map +1 -1
  30. package/dist/index.mjs +306 -305
  31. package/dist/index.mjs.map +1 -1
  32. package/dist/provider.d.ts +3 -0
  33. package/package.json +2 -1
  34. package/src/code.css +24 -0
  35. package/src/styles/_code-editor.scss +16 -0
  36. package/src/styles/_copyable.scss +22 -0
  37. package/src/styles/_data-vars.scss +11 -0
  38. package/src/styles.css +54 -0
  39. package/dist/connection-app-meta-BEXlKBgV.cjs +0 -22
  40. package/dist/connection-app-meta-BEXlKBgV.cjs.map +0 -1
  41. package/dist/connection-app-meta-ZCPakGjD.js.map +0 -1
@@ -7,6 +7,8 @@ import { ThemeMode } from './types.ts';
7
7
  */
8
8
  export type ScriptLanguage = "javascript" | "typescript" | "python";
9
9
  export interface CodeEditorProps {
10
+ /** Copy the current source. Enabled by default. */
11
+ copyable?: boolean;
10
12
  value: string;
11
13
  onChange: (value: string) => void;
12
14
  /** Placeholder text shown when value is empty. */
@@ -53,9 +53,7 @@ export interface JsonEditorProps {
53
53
  * component's own `.w6w-json-editor` wrapper (sibling to the CodeMirror
54
54
  * mount — no extra DOM node). Copies the current `value` verbatim.
55
55
  *
56
- * Off by default: the other five `<JsonEditor>` mounts in this tree are
57
- * not step-JSON config views and must render byte-identically to before
58
- * this prop existed.
56
+ * On by default; disable only when the containing view supplies its own copy button.
59
57
  */
60
58
  copyable?: boolean;
61
59
  /**
@@ -1,5 +1,7 @@
1
1
  export interface MarkdownProps {
2
2
  content: string;
3
+ /** Copy the full Markdown source, including frontmatter. Enabled by default. */
4
+ copyable?: boolean;
3
5
  className?: string;
4
6
  }
5
7
  /**
@@ -22,4 +24,4 @@ export declare function splitFrontmatter(text: string): {
22
24
  * is dropped (`skipHtml`), images are not rendered, and links are protocol-allowlisted.
23
25
  * A leading YAML frontmatter block becomes a collapsed section above the body.
24
26
  */
25
- export declare function Markdown({ content, className }: MarkdownProps): import("react").JSX.Element;
27
+ export declare function Markdown({ content, className, copyable }: MarkdownProps): import("react").JSX.Element;
@@ -2,7 +2,7 @@ import { NodeConfig } from './NodeConfigForm.tsx';
2
2
  import { ExpressionLoopSource, ExpressionStepSource } from './components/ExpressionOptions.tsx';
3
3
  import { InternalNodeDef } from './flow-types.ts';
4
4
  import { StepStartState, W6WApi } from './provider.tsx';
5
- import { ActionDef, ActionParam, AppSummary, FunctionSummary, ThemeMode, WorkflowDetail, WorkflowSummary } from './types.ts';
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. */
@@ -214,7 +214,7 @@ export declare function ControlStepConfig({ node: initialNode, onAdd, onClose, o
214
214
  /** See {@link StepBuilderModalProps.loop}. */
215
215
  loop?: ExpressionLoopSource;
216
216
  }): import("react").JSX.Element;
217
- export declare function triggerFieldsOf(wf: WorkflowDetail): ActionParam[];
217
+ export { triggerFieldsOf } from './callable-fields.ts';
218
218
  /**
219
219
  * Config → test → add flow for a picked Function/Workflow target (D-12,
220
220
  * D-15). Mints a single `@w6w/call` step — `family` only decides which
@@ -460,4 +460,3 @@ export declare function AppConnectionOnlyConfig({ appId, app, onClose, onChangeA
460
460
  /** Fired once, on the footer button — never on a state change (D-sbm-2). */
461
461
  onConnected: (connectionId: string, app: AppSummary) => void;
462
462
  }): import("react").JSX.Element;
463
- export {};
@@ -0,0 +1,11 @@
1
+ /**
2
+ * Fills the Run node payload with the sample event the app declares for this trigger, so the
3
+ * operator does not have to work out what the app will send. Renders nothing while the
4
+ * definition loads, when the fetch fails, and when the trigger declares no usable sample.
5
+ */
6
+ export declare function TriggerSampleButton({ app, trigger, onUse, }: {
7
+ app: string;
8
+ /** The trigger's key (`uses.action`). */
9
+ trigger: string;
10
+ onUse: (sample: Record<string, unknown>) => void;
11
+ }): import("react").JSX.Element | null;
@@ -153,6 +153,54 @@ type EditView = "props" | "json" | "settings";
153
153
  * History is local to the open workflow and excludes tests, samples and viewport changes.
154
154
  */
155
155
  export declare function WorkflowFlowEditor(props: WorkflowFlowEditorProps): import("react").JSX.Element;
156
+ /**
157
+ * Phase 1 of the canvas ▶ run: **collect the run's incoming state**, then hand
158
+ * it to the host to invoke. Rendered inside the run modal, which is the chrome.
159
+ *
160
+ * Two shapes, because the two kinds of step start from different things:
161
+ * - a **trigger** has no incoming state — it *is* the start — so it projects
162
+ * its configured `fields` *definitions* into params (`fieldsToParams`), seeds
163
+ * from their declared defaults (`seedValues`) and renders them through
164
+ * {@link PropertyEntryForm} (chrome-less by contract, so it is mounted bare
165
+ * here). The filled values become the run's starting state (`{ input }`), and
166
+ * the step's **last saved values** come back pre-filled on top (T4.1.3).
167
+ * - **everything else** is already configured, and what changes between two
168
+ * runs is the data arriving at it. So it collects exactly what the Test tab
169
+ * collects — {@link IncomingStateField}, the same component — and runs the
170
+ * step with its **stored** `with` underneath. The configuration is not
171
+ * re-collected here and is never rewritten by a run (R-I-1: the ▶ modal used
172
+ * to render the Configure form).
173
+ *
174
+ * The trigger check comes first on purpose: a trigger *is* an internal node, and
175
+ * its internal schema is the `fields` **editor**, not the fields themselves.
176
+ *
177
+ * `params` is fetched on **both** paths — a trigger renders them, and a
178
+ * non-trigger needs them for the same required-params gate the Test tab applies
179
+ * to `{...step.with, ...state}`. An app action fetches its action definition
180
+ * exactly as `StepEditModal` does, showing "Loading parameters…" until it lands.
181
+ */
182
+ export declare function StepRunCollect({ workflowId, step, upstreamSteps, loop, onRun, onCancel, continues, }: {
183
+ /** Fixture key, with `step.id` — where the remembered values are read from. */
184
+ workflowId: string;
185
+ step: FlowStep;
186
+ /** Graph ancestors of this step; their saved tests are offered as seeds. */
187
+ upstreamSteps: ExpressionStepSource[];
188
+ /** The enclosing For each when this step is in its body (from the same projection call). */
189
+ loop?: ExpressionLoopSource;
190
+ /**
191
+ * Fired when the user presses Run — with the trigger's filled values, or (for
192
+ * every other step) the incoming-state override alone, plus the start state
193
+ * seeded from the upstream steps' saved outputs (so the step's own
194
+ * `{{ steps.<id>.output.<field> }}` references resolve). The two are
195
+ * different things and stay separate: `values` are params, `state` is scope.
196
+ */
197
+ onRun: (values: Record<string, unknown>, state?: StepStartState) => void;
198
+ onCancel: () => void;
199
+ /** Present when Run continues downstream (`onRunFromNode`): the paused ids it stops before. */
200
+ continues?: {
201
+ stopAt: string[];
202
+ };
203
+ }): import("react").JSX.Element;
156
204
  /**
157
205
  * The state the Test tab PREVIEWS its resolved params against: the seeded `testStartState`
158
206
  * (what the test will actually send) with, for each upstream `nodes.<id>.output` and the
@@ -29,8 +29,7 @@ export interface YamlEditorProps {
29
29
  * component's own `.w6w-yaml-editor` wrapper (sibling to the CodeMirror
30
30
  * mount — no extra DOM node). Copies the current `value` verbatim.
31
31
  *
32
- * Off by default: the other mounts of this component must render byte-
33
- * identically to before this prop existed.
32
+ * On by default; disable only when the containing view supplies its own copy button.
34
33
  */
35
34
  copyable?: boolean;
36
35
  }
@@ -0,0 +1,4 @@
1
+ import { ActionParam, WorkflowDetail } from './types.ts';
2
+ /** Manual entry points can be called with an explicit input payload. */
3
+ export declare function callableTriggers(wf: WorkflowDetail): import('./types.ts').WorkflowStepSummary[];
4
+ export declare function triggerFieldsOf(wf: WorkflowDetail, entry?: string): ActionParam[];
package/dist/code.cjs CHANGED
@@ -1,2 +1,2 @@
1
- "use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./CodeBlock-CymlfyeA.cjs");exports.CodeBlock=e.CodeBlock;exports.Copyable=e.Copyable;
1
+ "use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./CodeBlock-BSX1pi6W.cjs");exports.CodeBlock=e.CodeBlock;exports.Copyable=e.Copyable;
2
2
  //# sourceMappingURL=code.cjs.map
package/dist/code.mjs CHANGED
@@ -1,5 +1,5 @@
1
1
  "use client";
2
- import { C as a, a as l } from "./CodeBlock-C-oIIYfC.js";
2
+ import { C as a, a as l } from "./CodeBlock-CPKXSNEs.js";
3
3
  export {
4
4
  a as CodeBlock,
5
5
  l as Copyable
@@ -12,6 +12,12 @@ export interface ConfirmModalProps {
12
12
  pending?: boolean;
13
13
  /** Style the confirm button as destructive (default true — this dialog gates dangerous actions). */
14
14
  destructive?: boolean;
15
+ /**
16
+ * Open with focus on the confirm button, so Enter approves. Without it `showModal()` focuses
17
+ * the first button, Cancel, and Enter dismisses — the safe default. Only for an action the
18
+ * user can undo.
19
+ */
20
+ autoFocusConfirm?: boolean;
15
21
  /** Extra consequence copy under the message (e.g. a warning line) that a string cannot carry. */
16
22
  children?: ReactNode;
17
23
  }
@@ -32,4 +38,4 @@ export interface ConfirmModalProps {
32
38
  * Confirmations are `{pending}` state + a rendered sibling modal, never a blocking
33
39
  * call: a caller reachable from a keydown handler cannot swap in a boolean.
34
40
  */
35
- export declare function ConfirmModal({ title, message, onConfirm, onClose, confirmLabel, cancelLabel, destructive, pending, children, }: ConfirmModalProps): import("react").JSX.Element;
41
+ export declare function ConfirmModal({ title, message, onConfirm, onClose, confirmLabel, cancelLabel, destructive, pending, autoFocusConfirm, children, }: ConfirmModalProps): import("react").JSX.Element;
@@ -5,6 +5,8 @@ export interface DataEntryListRow {
5
5
  version: number;
6
6
  /** The short text shown in the Value column. */
7
7
  preview: string;
8
+ /** Full value to copy; never use a truncated preview as the clipboard payload. */
9
+ copyText?: string;
8
10
  }
9
11
  export interface DataEntryListProps {
10
12
  rows: readonly DataEntryListRow[];
@@ -23,8 +23,7 @@ export interface ResultViewerProps {
23
23
  *
24
24
  * Read-only means read-only: nothing here takes an `onChange`, and the one
25
25
  * interactive affordance besides the collapsers and the Rendered/Source
26
- * toggle is `Copyable`'s button, overlaying the top-right corner and revealed
27
- * on hover (`w6w-copyable--hover`).
26
+ * toggle is `Copyable`'s button, always visible at the top-right corner.
28
27
  *
29
28
  * **Vendor HTML never touches this document.** The `html` format renders only
30
29
  * through `HtmlPreview` — an `<iframe sandbox="">` whose `srcdoc` opens with a