@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.
Files changed (43) hide show
  1. package/CHANGELOG.md +11 -1
  2. package/README.md +5 -3
  3. package/dist/FormBuilder.d.ts +19 -0
  4. package/dist/ManualWebhookPanel.d.ts +34 -0
  5. package/dist/TriggerFillForm.d.ts +3 -0
  6. package/dist/WebhookListenPanel.d.ts +8 -1
  7. package/dist/components/AuthFieldsForm.d.ts +10 -0
  8. package/dist/components/AuthGuide.d.ts +19 -1
  9. package/dist/components/CallableList.d.ts +30 -4
  10. package/dist/components/Combobox.d.ts +5 -0
  11. package/dist/components/ExpressionOptions.d.ts +22 -0
  12. package/dist/{connection-app-meta-CKBbgN7e.js → connection-app-meta-DEC0n4PA.js} +4894 -4211
  13. package/dist/connection-app-meta-DEC0n4PA.js.map +1 -0
  14. package/dist/connection-app-meta-Dk6F3KEH.cjs +29 -0
  15. package/dist/connection-app-meta-Dk6F3KEH.cjs.map +1 -0
  16. package/dist/dynamic-fields.d.ts +3 -0
  17. package/dist/flow-types.d.ts +2 -0
  18. package/dist/flow.cjs +6 -5
  19. package/dist/flow.cjs.map +1 -1
  20. package/dist/flow.mjs +3515 -2436
  21. package/dist/flow.mjs.map +1 -1
  22. package/dist/form-schema.d.ts +236 -0
  23. package/dist/form-trigger.d.ts +8 -0
  24. package/dist/index.cjs +2 -2
  25. package/dist/index.cjs.map +1 -1
  26. package/dist/index.d.ts +4 -4
  27. package/dist/index.mjs +1325 -1272
  28. package/dist/index.mjs.map +1 -1
  29. package/dist/provider.d.ts +12 -0
  30. package/dist/resolve-params.d.ts +2 -0
  31. package/dist/types.d.ts +17 -1
  32. package/dist/workflow-connections.d.ts +11 -0
  33. package/package.json +2 -2
  34. package/src/styles/_callable-list.scss +37 -3
  35. package/src/styles/_connections.scss +29 -0
  36. package/src/styles/_expression-modal.scss +7 -0
  37. package/src/styles/_form-builder.scss +232 -0
  38. package/src/styles/_sections.scss +29 -0
  39. package/src/styles.css +386 -3
  40. package/src/styles.scss +1 -0
  41. package/dist/connection-app-meta-CKBbgN7e.js.map +0 -1
  42. package/dist/connection-app-meta-DfA6Yqhh.cjs +0 -28
  43. package/dist/connection-app-meta-DfA6Yqhh.cjs.map +0 -1
@@ -298,6 +298,13 @@ export interface W6WApi {
298
298
  resolveActionFields?(appId: string, actionKey: string, body: ResolveFieldsBody, opts?: {
299
299
  signal?: AbortSignal;
300
300
  }): Promise<ResolveFieldsResult>;
301
+ /**
302
+ * OPTIONAL: the same for a TRIGGER's subscription form (`POST /apps/:id/triggers/:key/fields`).
303
+ * Absent, a trigger's `source: "resolveFields"` params render as plain inputs.
304
+ */
305
+ resolveTriggerFields?(appId: string, triggerKey: string, body: ResolveFieldsBody, opts?: {
306
+ signal?: AbortSignal;
307
+ }): Promise<ResolveFieldsResult>;
301
308
  /** Load auth methods declared by an app's manifest, with availability flags. */
302
309
  getAppAuth(appId: string): Promise<AuthDef[]>;
303
310
  /** Create a non-OAuth connection with a user-supplied credential. */
@@ -608,6 +615,11 @@ export interface W6WApi {
608
615
  params?: Record<string, unknown>;
609
616
  /** Poll triggers only, in milliseconds. */
610
617
  intervalMs?: number;
618
+ /**
619
+ * The trigger node this row feeds. The server keeps ONE row per node (a repeat create
620
+ * answers the existing row) and leaves it pending until the node is published.
621
+ */
622
+ nodeId?: string;
611
623
  }): Promise<SubscriptionSummary>;
612
624
  }
613
625
  export interface W6WUIProviderProps {
@@ -50,6 +50,8 @@ export interface ResolveScope {
50
50
  /** The SAME object as {@link vars}: `state`, `var` and `vars` are one tree (optional: hand-built scopes omit it). */
51
51
  state?: Record<string, unknown>;
52
52
  documents: Record<string, unknown>;
53
+ /** The workflow's bound connections, read as `connections.<name>.<field>`. */
54
+ connections?: Record<string, unknown>;
53
55
  /** Account constants, read as `const.<name>`. */
54
56
  constants?: Record<string, unknown>;
55
57
  steps: Record<string, {
package/dist/types.d.ts CHANGED
@@ -52,6 +52,16 @@ export interface TriggerSummary {
52
52
  output?: unknown;
53
53
  /** A representative event payload the app declares (never fabricated). */
54
54
  sample?: unknown;
55
+ /** A manual webhook: the user adds its URL in the vendor by hand (rfcs/trigger.md 2026-11-22). */
56
+ webhook?: WebhookSetup;
57
+ }
58
+ /**
59
+ * How a webhook trigger's URL reaches the vendor. `"manual"`: the user pastes it into the vendor's
60
+ * own settings, following `instructions` (plain text, one step per line).
61
+ */
62
+ export interface WebhookSetup {
63
+ registration: "manual";
64
+ instructions?: string;
55
65
  }
56
66
  /** A Subscription (rfcs/trigger.md) as returned by the console subscription routes. */
57
67
  export interface SubscriptionSummary {
@@ -60,8 +70,12 @@ export interface SubscriptionSummary {
60
70
  triggerKey: string;
61
71
  workflowId: string;
62
72
  connectionId: string | null;
63
- /** Present only for `appId === "@w6w/webhook"` — the server's own computed receive URL. */
73
+ /** The server's own computed receive URL — on every webhook-type subscription, any app. */
64
74
  webhookUrl?: string;
75
+ /** Present only for `appId === "@w6w/form"` — the public form page's URL. */
76
+ formUrl?: string;
77
+ /** The subscription's params (sealed secrets masked). A form one names its node as `node`. */
78
+ params?: Record<string, unknown>;
65
79
  type?: "webhook" | "poll" | "protocol";
66
80
  status?: SubscriptionStatus;
67
81
  /** Poll interval in milliseconds; null for webhook subscriptions. */
@@ -314,6 +328,8 @@ export interface ActionDef {
314
328
  in?: number | "many";
315
329
  out?: number | "many";
316
330
  };
331
+ /** App triggers only: a manual webhook, whose URL the user adds in the vendor. */
332
+ webhook?: WebhookSetup;
317
333
  }
318
334
  /**
319
335
  * Summary of a registered Function, as returned by GET /functions (core
@@ -1,3 +1,4 @@
1
+ import { ExpressionConnectionSource } from './components/ExpressionOptions.tsx';
1
2
  import { FlowStep, FlowWorkflow } from './flow-types.ts';
2
3
  import { AppSummary, AuthDef, ConnectionSummary } from './types.ts';
3
4
  export type FlowConnections = Record<string, {
@@ -76,3 +77,13 @@ export declare function defaultConnectionFor(step: FlowStep, choices: Connection
76
77
  export declare function withDefaultConnection(appId: string, auths: AuthDef[], choices: ConnectionSummary[]): ConnectionSummary[];
77
78
  /** Change every binding used by the displayed account's consumers, retaining reference keys. */
78
79
  export declare function replaceWorkflowConnection(app: string, before: string, after: string, nodes: FlowStep[], connections: FlowConnections): FlowConnections;
80
+ /**
81
+ * The expression picker's "Connections" section and its preview values: one source per binding,
82
+ * with the fields a run reads at `connections.<name>` (`id`, `app`, `name`, `state`, `profile.*`).
83
+ * A binding whose connection is unbound or not (yet) loaded still lists its fixed fields, so the
84
+ * author can write the ref before the account is picked; the run fills it.
85
+ */
86
+ export declare function connectionExpressionSources(connections: FlowConnections, summaries: ReadonlyMap<string, ConnectionSummary>, apps: ReadonlyMap<string, Pick<AppSummary, "displayName">>): {
87
+ sources: ExpressionConnectionSource[];
88
+ sampleValues: Record<string, unknown>;
89
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@w6w/ui",
3
- "version": "0.2.66",
3
+ "version": "0.2.67",
4
4
  "description": "React components for w6w — central API management. Build plugins, apps and integrations on them.",
5
5
  "license": "MIT",
6
6
  "homepage": "https://w6w.io",
@@ -72,7 +72,7 @@
72
72
  "@codemirror/state": "^6.5.0",
73
73
  "@codemirror/view": "^6.35.0",
74
74
  "@uiw/react-codemirror": "^4.23.7",
75
- "@w6w/expr": "^0.1.5",
75
+ "@w6w/expr": "^0.1.6",
76
76
  "@xyflow/react": "^12.3.6",
77
77
  "prism-react-renderer": "^2.4.1",
78
78
  "react-markdown": "^10.1.0",
@@ -21,11 +21,45 @@
21
21
  .w6w-callable-list-description {
22
22
  margin: 0;
23
23
  }
24
- .w6w-callable-list-toggle {
24
+ /* Status tabs (All · Active · Draft · Archived) on the left, the search box on the right;
25
+ they wrap onto two lines on a narrow panel. */
26
+ .w6w-callable-list-filters {
25
27
  display: flex;
28
+ flex-wrap: wrap;
26
29
  align-items: center;
27
- gap: var(--w6w-sp-2);
28
- cursor: pointer;
30
+ justify-content: space-between;
31
+ gap: var(--w6w-sp-2) var(--w6w-sp-3);
32
+ }
33
+ /* A fieldset (the tab group), reset to the segmented box `.w6w-subtabs` draws. */
34
+ .w6w-callable-list-tabs {
35
+ margin: 0;
36
+ min-width: 0;
37
+ }
38
+ .w6w-callable-list-filters .w6w-subtab {
39
+ display: inline-flex;
40
+ align-items: center;
41
+ gap: var(--w6w-sp-1-5);
42
+ }
43
+ .w6w-callable-list-count {
44
+ font-size: 11px;
45
+ font-variant-numeric: tabular-nums;
46
+ color: var(--w6w-muted);
47
+ }
48
+ /* Same box as `.w6w-field` inputs: no host page styles a bare search input. */
49
+ .w6w-callable-list-search {
50
+ flex: 0 1 240px;
51
+ min-width: 160px;
52
+ background: var(--w6w-panel-2);
53
+ border: 1px solid var(--w6w-border);
54
+ border-radius: 8px;
55
+ padding: var(--w6w-sp-1-5) var(--w6w-sp-2-5);
56
+ color: var(--w6w-text);
57
+ font-size: var(--w6w-fs-sm);
58
+ font-family: inherit;
59
+ }
60
+ .w6w-callable-list-search:focus {
61
+ outline: none;
62
+ border-color: var(--w6w-accent);
29
63
  }
30
64
  .w6w-callable-list-actions {
31
65
  display: flex;
@@ -363,3 +363,32 @@
363
363
  .w6w-keyfile code {
364
364
  user-select: all;
365
365
  }
366
+
367
+ /* AddConnectionModal / EditConnectionModal: domain-wide delegation, spelled out. */
368
+ .w6w-delegation {
369
+ display: flex;
370
+ flex-direction: column;
371
+ gap: var(--w6w-sp-2);
372
+ padding: var(--w6w-sp-3);
373
+ border: 1px solid var(--w6w-border);
374
+ border-radius: var(--w6w-radius);
375
+ background: var(--w6w-panel-2);
376
+ font-size: var(--w6w-fs-sm);
377
+ }
378
+ .w6w-delegation h4 {
379
+ margin: 0;
380
+ font-size: var(--w6w-fs-sm);
381
+ }
382
+ .w6w-delegation ol {
383
+ margin: 0;
384
+ padding-left: var(--w6w-sp-4);
385
+ display: flex;
386
+ flex-direction: column;
387
+ gap: var(--w6w-sp-2);
388
+ }
389
+ .w6w-delegation .w6w-scopes {
390
+ margin-top: var(--w6w-sp-1);
391
+ }
392
+ .w6w-delegation .w6w-scopes code {
393
+ background: var(--w6w-panel);
394
+ }
@@ -143,6 +143,13 @@
143
143
  }
144
144
  /* A step's per-field sources, nested under its whole-output source, so three
145
145
  upstream steps x four fields reads as a tree rather than a flat wall. */
146
+ /* A Connections binding's app · account caption, under its row (`ExpressionEditorModal`). */
147
+ .w6w-exprmodal-connection-note {
148
+ margin: -2px 0 2px 22px;
149
+ overflow: hidden;
150
+ text-overflow: ellipsis;
151
+ white-space: nowrap;
152
+ }
146
153
  .w6w-exprmodal-subsources {
147
154
  display: flex;
148
155
  flex-direction: column;
@@ -0,0 +1,232 @@
1
+ // The `@w6w/form` trigger's form builder (`FormBuilder.tsx`): the field list you drag to reorder,
2
+ // the field-type palette you click or drag from, and the completion / page settings disclosures.
3
+ .w6w-form-builder {
4
+ display: flex;
5
+ flex-direction: column;
6
+ gap: var(--w6w-sp-3);
7
+ min-width: 0;
8
+ }
9
+ .w6w-form-problems {
10
+ margin: 0;
11
+ padding: var(--w6w-sp-2) var(--w6w-sp-2-5);
12
+ list-style: none;
13
+ border: 1px solid var(--w6w-health-degraded);
14
+ border-radius: 8px;
15
+ color: var(--w6w-text);
16
+ font-size: var(--w6w-fs-xs);
17
+ display: flex;
18
+ flex-direction: column;
19
+ gap: var(--w6w-sp-1);
20
+ }
21
+ .w6w-form-problem-link {
22
+ border: 0;
23
+ padding: 0;
24
+ background: transparent;
25
+ font: inherit;
26
+ color: inherit;
27
+ text-align: left;
28
+ text-decoration: underline;
29
+ cursor: pointer;
30
+ }
31
+ .w6w-form-section-label {
32
+ color: var(--w6w-text);
33
+ font-weight: var(--w6w-fw-semibold);
34
+ font-size: var(--w6w-fs-sm);
35
+ }
36
+ .w6w-form-section-label .w6w-muted {
37
+ font-weight: normal;
38
+ }
39
+ .w6w-form-fields {
40
+ display: flex;
41
+ flex-direction: column;
42
+ gap: var(--w6w-sp-1-5);
43
+ }
44
+ .w6w-form-empty {
45
+ padding: var(--w6w-sp-4) var(--w6w-sp-3);
46
+ border: 1px dashed var(--w6w-border);
47
+ border-radius: 8px;
48
+ text-align: center;
49
+ color: var(--w6w-muted);
50
+ font-size: var(--w6w-fs-sm);
51
+ }
52
+ .w6w-form-empty.is-drop-target {
53
+ border-color: var(--w6w-accent);
54
+ color: var(--w6w-accent);
55
+ }
56
+ .w6w-form-field {
57
+ border: 1px solid var(--w6w-border);
58
+ border-radius: 8px;
59
+ background: var(--w6w-panel);
60
+ min-width: 0;
61
+ }
62
+ .w6w-form-field.is-open {
63
+ border-color: var(--w6w-accent);
64
+ }
65
+ .w6w-form-field.is-dragging {
66
+ opacity: 0.45;
67
+ }
68
+ .w6w-form-field.is-drop-before {
69
+ box-shadow: 0 -3px 0 var(--w6w-accent);
70
+ }
71
+ .w6w-form-field.is-drop-after {
72
+ box-shadow: 0 3px 0 var(--w6w-accent);
73
+ }
74
+ .w6w-form-field.is-page-break {
75
+ border-style: dashed;
76
+ background: transparent;
77
+ }
78
+ .w6w-form-field-head {
79
+ display: flex;
80
+ align-items: center;
81
+ gap: var(--w6w-sp-1);
82
+ padding: var(--w6w-sp-1);
83
+ }
84
+ .w6w-form-field-summary {
85
+ flex: 1 1 auto;
86
+ min-width: 0;
87
+ display: flex;
88
+ align-items: center;
89
+ gap: var(--w6w-sp-2);
90
+ border: 0;
91
+ background: transparent;
92
+ padding: var(--w6w-sp-1);
93
+ font: inherit;
94
+ color: var(--w6w-text);
95
+ text-align: left;
96
+ cursor: pointer;
97
+ }
98
+ .w6w-form-field-summary > svg {
99
+ margin-left: auto;
100
+ flex-shrink: 0;
101
+ color: var(--w6w-muted);
102
+ transition: transform 0.15s;
103
+ }
104
+ .w6w-form-field.is-open .w6w-form-field-summary > svg {
105
+ transform: rotate(180deg);
106
+ }
107
+ .w6w-form-field-type {
108
+ flex-shrink: 0;
109
+ min-width: 88px;
110
+ font-size: var(--w6w-fs-xs);
111
+ color: var(--w6w-muted);
112
+ }
113
+ .w6w-form-field-label {
114
+ min-width: 0;
115
+ overflow: hidden;
116
+ text-overflow: ellipsis;
117
+ white-space: nowrap;
118
+ font-size: var(--w6w-fs-sm);
119
+ }
120
+ .w6w-form-req {
121
+ color: var(--w6w-danger);
122
+ }
123
+ .w6w-form-field-name {
124
+ flex-shrink: 1;
125
+ min-width: 0;
126
+ overflow: hidden;
127
+ text-overflow: ellipsis;
128
+ white-space: nowrap;
129
+ font-size: var(--w6w-fs-xs);
130
+ color: var(--w6w-muted);
131
+ }
132
+ .w6w-form-field-badge {
133
+ flex-shrink: 0;
134
+ font-size: var(--w6w-fs-xs);
135
+ padding: 0 var(--w6w-sp-1);
136
+ border-radius: 4px;
137
+ border: 1px solid var(--w6w-border);
138
+ color: var(--w6w-muted);
139
+ }
140
+ .w6w-form-field-body {
141
+ display: flex;
142
+ flex-direction: column;
143
+ gap: var(--w6w-sp-2-5);
144
+ padding: var(--w6w-sp-2) var(--w6w-sp-2-5) var(--w6w-sp-3);
145
+ border-top: 1px solid var(--w6w-border);
146
+ }
147
+ .w6w-form-checks {
148
+ display: flex;
149
+ flex-wrap: wrap;
150
+ gap: var(--w6w-sp-2) var(--w6w-sp-4);
151
+ }
152
+ .w6w-form-check {
153
+ display: inline-flex;
154
+ align-items: center;
155
+ gap: var(--w6w-sp-1-5);
156
+ font-size: var(--w6w-fs-sm);
157
+ color: var(--w6w-text);
158
+ }
159
+ .w6w-form-options {
160
+ display: flex;
161
+ flex-direction: column;
162
+ gap: var(--w6w-sp-1);
163
+ }
164
+ .w6w-form-option {
165
+ display: grid;
166
+ grid-template-columns: auto minmax(0, 2fr) minmax(0, 1fr) auto;
167
+ gap: var(--w6w-sp-1);
168
+ align-items: center;
169
+ }
170
+ .w6w-form-option.is-dragging {
171
+ opacity: 0.45;
172
+ }
173
+ .w6w-form-option.is-drop-before {
174
+ box-shadow: 0 -2px 0 var(--w6w-accent);
175
+ }
176
+ .w6w-form-option input,
177
+ .w6w-form-cond select,
178
+ .w6w-form-cond input,
179
+ .w6w-form-color input[type="text"] {
180
+ min-width: 0;
181
+ background: var(--w6w-panel-2);
182
+ border: 1px solid var(--w6w-border);
183
+ border-radius: 8px;
184
+ padding: var(--w6w-sp-1-5) var(--w6w-sp-2);
185
+ color: var(--w6w-text);
186
+ font: inherit;
187
+ font-size: var(--w6w-fs-sm);
188
+ }
189
+ .w6w-form-cond {
190
+ display: flex;
191
+ flex-wrap: wrap;
192
+ align-items: center;
193
+ gap: var(--w6w-sp-1-5);
194
+ padding: var(--w6w-sp-2);
195
+ border-radius: 8px;
196
+ background: var(--w6w-panel-2);
197
+ }
198
+ .w6w-form-cond select,
199
+ .w6w-form-cond input {
200
+ background: var(--w6w-panel);
201
+ flex: 1 1 110px;
202
+ }
203
+ .w6w-form-cond-add {
204
+ align-self: flex-start;
205
+ }
206
+ .w6w-form-group-body {
207
+ display: flex;
208
+ flex-direction: column;
209
+ gap: var(--w6w-sp-2-5);
210
+ margin-top: var(--w6w-sp-2-5);
211
+ }
212
+ .w6w-form-color {
213
+ display: flex;
214
+ gap: var(--w6w-sp-1);
215
+ align-items: center;
216
+ }
217
+ .w6w-form-color input[type="color"] {
218
+ width: 34px;
219
+ height: 32px;
220
+ padding: 0;
221
+ border: 1px solid var(--w6w-border);
222
+ border-radius: 6px;
223
+ background: transparent;
224
+ }
225
+ .w6w-form-color input[type="text"] {
226
+ flex: 1;
227
+ }
228
+ /* Beats `.w6w-field textarea`'s inherited font: the template's comment columns need monospace. */
229
+ .w6w-field textarea.w6w-form-css {
230
+ font-family: var(--w6w-font-mono);
231
+ font-size: var(--w6w-fs-xs);
232
+ }
@@ -34,6 +34,35 @@
34
34
  gap: var(--w6w-sp-2-5);
35
35
  }
36
36
  /* Webhook "Listen for test event": the waiting row, its pulse, and the folded manual payload. */
37
+ /* The webhook / form URL panel sits above the step's own form in Configure. */
38
+ .w6w-url-panel {
39
+ margin-bottom: var(--w6w-sp-4);
40
+ }
41
+ .w6w-listen-url {
42
+ display: flex;
43
+ align-items: center;
44
+ gap: var(--w6w-sp-2);
45
+ }
46
+ .w6w-listen-url > :first-child {
47
+ flex: 1;
48
+ min-width: 0;
49
+ }
50
+ /* A manual webhook (the user adds the URL in the vendor): the warning and the app's own steps. */
51
+ .w6w-manual-webhook-note {
52
+ padding: var(--w6w-sp-2) var(--w6w-sp-2-5);
53
+ border-left: 3px solid var(--w6w-health-degraded);
54
+ border-radius: 4px;
55
+ background: var(--w6w-panel-2);
56
+ color: var(--w6w-text);
57
+ font-size: var(--w6w-fs-sm);
58
+ }
59
+ .w6w-manual-webhook-steps ol {
60
+ margin: var(--w6w-sp-1) 0 0;
61
+ padding-left: var(--w6w-sp-5);
62
+ display: flex;
63
+ flex-direction: column;
64
+ gap: var(--w6w-sp-1);
65
+ }
37
66
  .w6w-listen-waiting {
38
67
  display: flex;
39
68
  align-items: center;