@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.
Files changed (160) hide show
  1. package/CHANGELOG.md +146 -2
  2. package/README.md +28 -10
  3. package/dist/AppPicker.d.ts +58 -2
  4. package/dist/CanvasContextMenu.d.ts +19 -0
  5. package/dist/CanvasLayer.d.ts +38 -0
  6. package/dist/{CodeBlock-Dot3Pd7P.js → CodeBlock-C-oIIYfC.js} +1436 -555
  7. package/dist/CodeBlock-C-oIIYfC.js.map +1 -0
  8. package/dist/CodeBlock-CymlfyeA.cjs +15 -0
  9. package/dist/CodeBlock-CymlfyeA.cjs.map +1 -0
  10. package/dist/CodeEditor.d.ts +4 -1
  11. package/dist/ConditionEditor.d.ts +11 -0
  12. package/dist/EditConnectionModal.d.ts +6 -1
  13. package/dist/JsonEditor.d.ts +20 -0
  14. package/dist/Markdown.d.ts +25 -0
  15. package/dist/ParamCustomization.d.ts +5 -0
  16. package/dist/ParamsForm.d.ts +18 -4
  17. package/dist/RouterEditor.d.ts +5 -0
  18. package/dist/StepBuilderModal.d.ts +103 -15
  19. package/dist/StepNameEditor.d.ts +11 -0
  20. package/dist/StopEditor.d.ts +5 -0
  21. package/dist/TriggerFillForm.d.ts +14 -1
  22. package/dist/WebhookListenPanel.d.ts +28 -0
  23. package/dist/WorkflowConnections.d.ts +29 -0
  24. package/dist/WorkflowFlowEditor.d.ts +74 -7
  25. package/dist/app-pages.d.ts +2 -0
  26. package/dist/assets/script-completion.worker-DDJKkj5M.js +8290 -0
  27. package/dist/assets/script-completion.worker-DDJKkj5M.js.map +1 -0
  28. package/dist/canvas-context-menu.d.ts +27 -0
  29. package/dist/canvas-types.d.ts +36 -0
  30. package/dist/canvas-utils.d.ts +44 -0
  31. package/dist/code.cjs +1 -1
  32. package/dist/code.mjs +3 -4
  33. package/dist/code.mjs.map +1 -1
  34. package/dist/components/AnchoredFlyout.d.ts +7 -0
  35. package/dist/components/AuthFieldsForm.d.ts +11 -0
  36. package/dist/components/BudgetMeter.d.ts +15 -0
  37. package/dist/components/CallableList.d.ts +3 -2
  38. package/dist/components/ColumnsEditor.d.ts +27 -0
  39. package/dist/components/Combobox.d.ts +19 -1
  40. package/dist/components/ConnectionList.d.ts +2 -3
  41. package/dist/components/CredentialPicker.d.ts +35 -0
  42. package/dist/components/CsvPanel.d.ts +21 -0
  43. package/dist/components/DataEntryEditor.d.ts +38 -0
  44. package/dist/components/DataEntryList.d.ts +33 -0
  45. package/dist/components/DataStoreList.d.ts +33 -0
  46. package/dist/components/DataTable.d.ts +27 -0
  47. package/dist/components/DataTableGrid.d.ts +46 -0
  48. package/dist/components/EmptyState.d.ts +9 -0
  49. package/dist/components/EventbriteTriggerPicker.d.ts +7 -0
  50. package/dist/components/ExecutionDetail.d.ts +17 -1
  51. package/dist/components/ExecutionList.d.ts +19 -1
  52. package/dist/components/ExecutionLogPanel.d.ts +61 -3
  53. package/dist/components/ExpressionEditorModal.d.ts +33 -10
  54. package/dist/components/ExpressionOptions.d.ts +101 -15
  55. package/dist/components/HtmlPreview.d.ts +7 -0
  56. package/dist/components/JsonTree.d.ts +32 -0
  57. package/dist/components/ResolvedParams.d.ts +6 -1
  58. package/dist/components/ResultViewer.d.ts +46 -0
  59. package/dist/components/ScriptBindingsNotice.d.ts +31 -0
  60. package/dist/components/ScriptCodeField.d.ts +13 -0
  61. package/dist/components/StepStatusPill.d.ts +7 -0
  62. package/dist/components/expression-authoring.d.ts +13 -0
  63. package/dist/components/expression-dom.d.ts +17 -2
  64. package/dist/components/expression-template.d.ts +25 -3
  65. package/dist/components/icons.d.ts +1 -1
  66. package/dist/components/json-compose.d.ts +53 -0
  67. package/dist/components/result-format.d.ts +13 -0
  68. package/dist/condition-editor.d.ts +44 -0
  69. package/dist/data-stores/data-store-view.d.ts +371 -0
  70. package/dist/dynamic-fields.d.ts +60 -0
  71. package/dist/editor-theme.d.ts +24 -0
  72. package/dist/eventbrite-trigger-selection.d.ts +13 -0
  73. package/dist/flow-connect.d.ts +22 -16
  74. package/dist/flow-delete.d.ts +16 -0
  75. package/dist/flow-fanout.d.ts +2 -2
  76. package/dist/flow-history.d.ts +75 -0
  77. package/dist/flow-layout.d.ts +13 -0
  78. package/dist/flow-loop-colors.d.ts +39 -0
  79. package/dist/flow-loop.d.ts +98 -0
  80. package/dist/flow-node-flags.d.ts +14 -0
  81. package/dist/flow-problems.d.ts +69 -0
  82. package/dist/flow-state.d.ts +20 -0
  83. package/dist/flow-types.d.ts +155 -10
  84. package/dist/flow-utils.d.ts +33 -12
  85. package/dist/flow.cjs +4 -2
  86. package/dist/flow.cjs.map +1 -1
  87. package/dist/flow.d.ts +15 -2
  88. package/dist/flow.mjs +3737 -1350
  89. package/dist/flow.mjs.map +1 -1
  90. package/dist/index.cjs +2 -1
  91. package/dist/index.cjs.map +1 -1
  92. package/dist/index.d.ts +43 -5
  93. package/dist/index.mjs +2855 -1333
  94. package/dist/index.mjs.map +1 -1
  95. package/dist/node-samples-ChdyMBnJ.cjs +22 -0
  96. package/dist/node-samples-ChdyMBnJ.cjs.map +1 -0
  97. package/dist/node-samples-DkJL07EX.js +12302 -0
  98. package/dist/node-samples-DkJL07EX.js.map +1 -0
  99. package/dist/node-samples.d.ts +80 -0
  100. package/dist/note-markdown.d.ts +22 -0
  101. package/dist/output-shape.d.ts +30 -14
  102. package/dist/param-customization.d.ts +7 -0
  103. package/dist/provider.d.ts +174 -13
  104. package/dist/resolve-params.d.ts +50 -11
  105. package/dist/run-visuals.d.ts +18 -22
  106. package/dist/script-bindings.d.ts +63 -0
  107. package/dist/script-completion-service.d.ts +9 -0
  108. package/dist/script-completion.worker.d.ts +1 -0
  109. package/dist/script-completions.d.ts +2 -0
  110. package/dist/state-shape.d.ts +38 -0
  111. package/dist/step-preview-state.d.ts +155 -6
  112. package/dist/step-problems.d.ts +64 -0
  113. package/dist/test-inputs.d.ts +25 -0
  114. package/dist/trigger-registration.d.ts +28 -0
  115. package/dist/types.d.ts +179 -11
  116. package/dist/use-app-action-defs.d.ts +9 -1
  117. package/dist/use-dynamic-fields.d.ts +23 -0
  118. package/dist/use-test-input.d.ts +18 -0
  119. package/dist/workflow-connections.d.ts +30 -0
  120. package/package.json +18 -7
  121. package/src/code.css +60 -6
  122. package/src/styles/_budget-meter.scss +46 -0
  123. package/src/styles/_callable-list.scss +15 -6
  124. package/src/styles/_canvas.scss +353 -0
  125. package/src/styles/_code-editor.scss +35 -0
  126. package/src/styles/_code.scss +6 -5
  127. package/src/styles/_connections.scss +2 -14
  128. package/src/styles/_copyable.scss +24 -0
  129. package/src/styles/_data-stores.scss +138 -0
  130. package/src/styles/_data-table.scss +55 -0
  131. package/src/styles/_data-vars.scss +17 -6
  132. package/src/styles/_empty-state.scss +21 -0
  133. package/src/styles/_execution-history.scss +73 -0
  134. package/src/styles/_execution-log.scss +145 -1
  135. package/src/styles/_expression-modal.scss +106 -16
  136. package/src/styles/_fields.scss +11 -0
  137. package/src/styles/_flow.scss +171 -0
  138. package/src/styles/_fx.scss +26 -1
  139. package/src/styles/_incoming-state.scss +33 -0
  140. package/src/styles/_layout.scss +10 -0
  141. package/src/styles/_markdown.scss +20 -0
  142. package/src/styles/_modal.scss +12 -0
  143. package/src/styles/_multiselect.scss +35 -0
  144. package/src/styles/_sections.scss +36 -0
  145. package/src/styles/_step-builder.scss +145 -0
  146. package/src/styles/_tester.scss +57 -14
  147. package/src/styles/_tokens.scss +27 -1
  148. package/src/styles.css +1861 -115
  149. package/src/styles.scss +7 -0
  150. package/dist/CodeBlock-CZu4TFSi.cjs +0 -15
  151. package/dist/CodeBlock-CZu4TFSi.cjs.map +0 -1
  152. package/dist/CodeBlock-Dot3Pd7P.js.map +0 -1
  153. package/dist/ConfirmModal-ChoiGy2K.cjs +0 -11
  154. package/dist/ConfirmModal-ChoiGy2K.cjs.map +0 -1
  155. package/dist/ConfirmModal-Wx3i8F1n.js +0 -6359
  156. package/dist/ConfirmModal-Wx3i8F1n.js.map +0 -1
  157. package/dist/Copyable-1niV9gUa.js +0 -771
  158. package/dist/Copyable-1niV9gUa.js.map +0 -1
  159. package/dist/Copyable-CYZU1o4X.cjs +0 -2
  160. package/dist/Copyable-CYZU1o4X.cjs.map +0 -1
@@ -1,12 +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';
5
+ import { StepProblem, StepProblems } from './step-problems.ts';
4
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
+ }
5
11
  export interface WorkflowFlowEditorProps {
6
12
  /** The workflow being edited. The editor re-derives layout when this changes identity. */
7
13
  value: FlowWorkflow;
8
- /** Fired whenever the user changes the graph — new nodes, edges, or step edits. */
9
- onChange: (next: FlowWorkflow) => void;
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;
10
23
  /** Disable all interactions — pans/zooms are still enabled. */
11
24
  readOnly?: boolean;
12
25
  /** Height of the editor viewport. Defaults to 480px. */
@@ -59,6 +72,14 @@ export interface WorkflowFlowEditorProps {
59
72
  * back off a node.
60
73
  */
61
74
  runState?: RunState;
75
+ /**
76
+ * Host-detected per-step problems, keyed by step id — an app step whose bound
77
+ * connection no longer exists gets an error ring + tooltip. Omitted ⇒ the
78
+ * canvas renders exactly as today. The host owns detection; this editor never
79
+ * infers a problem itself. Repaints live (same `value.id`) and is never
80
+ * persisted: `flowToWorkflow` never reads `data.stepProblems`.
81
+ */
82
+ stepProblems?: StepProblems;
62
83
  /**
63
84
  * Fired the instant a step test starts — the ▶ collect form's Run button, or
64
85
  * `StepEditModal`'s footer Test button — before the invoke goes out, so a host
@@ -86,6 +107,31 @@ export interface WorkflowFlowEditorProps {
86
107
  * `onChange` and never overwrites the stored viewport.
87
108
  */
88
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>;
89
135
  }
90
136
  /** Which view the step edit modal opens in: the tabbed form, raw JSON, or node settings. */
91
137
  type EditView = "props" | "json" | "settings";
@@ -95,25 +141,46 @@ type EditView = "props" | "json" | "settings";
95
141
  * - Auto-layouted on load (topological columns + sibling rows).
96
142
  * - Nodes render differently for action steps vs. control steps
97
143
  * (`uses.app === "@w6w/control"`).
98
- * - `+ Step` opens a guided builder (pick app → connection → action → params,
144
+ * - `+ Node` opens a guided builder (pick app → connection → action → params,
99
145
  * or a flow control). Drag nodes to reposition; connect handles to add edges.
100
146
  * - Selecting a node reveals a toolbar above it: Edit / Duplicate / Delete.
101
147
  * - Edit opens a modal with a Form ⇄ JSON toggle for that step.
102
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.
103
151
  */
104
152
  export declare function WorkflowFlowEditor(props: WorkflowFlowEditorProps): import("react").JSX.Element;
105
- export declare function StepEditModal({ workflowId, step: initialStep, upstreamSteps, onChange, onClose, readOnly, initialView, fanOutCount, onTestRun, }: {
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 {
106
163
  workflowId: string;
107
164
  step: FlowStep;
165
+ /** Refresh authored fields after undo/redo without remounting the Test tab. */
166
+ restoreVersion?: number;
108
167
  /** Graph ancestors of this step (from `upstreamStateSources`); the incoming-state picker seeds from their saved tests. */
109
168
  upstreamSteps: ExpressionStepSource[];
169
+ /** The enclosing For each when this step is in its body: seeds `state.foreach` on Test. */
170
+ loop?: ExpressionLoopSource;
110
171
  onChange: (next: FlowStep) => void;
111
172
  onClose: () => void;
112
173
  readOnly?: boolean;
113
174
  initialView?: EditView;
114
- /** Most outgoing edges this step has in one lane; "Run next steps" needs >= 2. */
175
+ /** Most outgoing edges this node has in one lane; "Run next nodes" needs >= 2. */
115
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[];
116
179
  /** Fired the instant the footer Test button is clicked, before the test runs (T1.1.1). */
117
180
  onTestRun?: () => void;
118
- }): import("react").JSX.Element;
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
+ }
119
186
  export {};
@@ -5,6 +5,8 @@ export interface AppsPageQuery {
5
5
  q: string;
6
6
  /** Server-side category filter (e.g. `"ai"` for the AI tab), or absent. */
7
7
  category?: string;
8
+ /** Server-side id allow-list, or absent. */
9
+ ids?: string[];
8
10
  }
9
11
  /**
10
12
  * Two queries are the same fetch target when both fields match exactly