@aquera/mcp-ui-render 0.0.1

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 (42) hide show
  1. package/CHANGELOG.md +437 -0
  2. package/CONFIGURATION.md +178 -0
  3. package/LICENSE +21 -0
  4. package/README.md +237 -0
  5. package/RELEASE-NOTES.md +77 -0
  6. package/TEST-PLAN.md +72 -0
  7. package/USAGE.md +100 -0
  8. package/package.json +52 -0
  9. package/src/controls.d.ts +1 -0
  10. package/src/controls.js +572 -0
  11. package/src/controls.js.map +1 -0
  12. package/src/elements/aq-mcp-config.d.ts +289 -0
  13. package/src/elements/aq-mcp-config.js +673 -0
  14. package/src/elements/aq-mcp-config.js.map +1 -0
  15. package/src/elements/aq-mcp-field.d.ts +92 -0
  16. package/src/elements/aq-mcp-field.js +275 -0
  17. package/src/elements/aq-mcp-field.js.map +1 -0
  18. package/src/elements/aq-mcp-section.d.ts +101 -0
  19. package/src/elements/aq-mcp-section.js +261 -0
  20. package/src/elements/aq-mcp-section.js.map +1 -0
  21. package/src/engine/status.d.ts +31 -0
  22. package/src/engine/status.js +44 -0
  23. package/src/engine/status.js.map +1 -0
  24. package/src/engine/submit.d.ts +26 -0
  25. package/src/engine/submit.js +37 -0
  26. package/src/engine/submit.js.map +1 -0
  27. package/src/engine/validate.d.ts +24 -0
  28. package/src/engine/validate.js +144 -0
  29. package/src/engine/validate.js.map +1 -0
  30. package/src/engine/values.d.ts +20 -0
  31. package/src/engine/values.js +42 -0
  32. package/src/engine/values.js.map +1 -0
  33. package/src/index.d.ts +18 -0
  34. package/src/index.js +20 -0
  35. package/src/index.js.map +1 -0
  36. package/src/mcp-ui-render.css +811 -0
  37. package/src/registry.d.ts +63 -0
  38. package/src/registry.js +39 -0
  39. package/src/registry.js.map +1 -0
  40. package/src/types.d.ts +239 -0
  41. package/src/types.js +8 -0
  42. package/src/types.js.map +1 -0
@@ -0,0 +1 @@
1
+ {"version":3,"file":"aq-mcp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IAA/B,QAAQ,CAAC,EAAE,SAAS,EAAE,KAAK,EAAE,CAAC;;+CAAsC;AAGrC;IAA/B,QAAQ,CAAC,EAAE,SAAS,EAAE,KAAK,EAAE,CAAC;;2CAAqB;AAqBpB;IAA/B,QAAQ,CAAC,EAAE,SAAS,EAAE,KAAK,EAAE,CAAC;;mDAAgD;AAMlD;IAA5B,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;;uDAA2B;AAS3B;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;;mDAA8D;AAK7D;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;;kDAA2D;AASzD;IAA5B,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;;2DAA+B;AAU/B;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;;yDAA4C;AAQ1C;IAA5B,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;;yDAA8B;AAY9B;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;;qDAA6B;AAOxB;IAA/B,QAAQ,CAAC,EAAE,SAAS,EAAE,KAAK,EAAE,CAAC;;iDAA2C;AAEzD;IAAhB,KAAK,EAAE;;2CAAoD;AAK3C;IAAhB,KAAK,EAAE;;4CAAuC;AAC9B;IAAhB,KAAK,EAAE;;kDAA6E;AApG1E,WAAW;IADvB,aAAa,CAAC,eAAe,CAAC;GAClB,WAAW,CA4jBvB"}
@@ -0,0 +1,92 @@
1
+ /**
2
+ * `<aq-mcp-field>` — one two-column row (design Option A): label + required mark
3
+ * + help on the left, the control on the right. Re-emits user intent upward:
4
+ * `field-input` (edits) and `field-action` (buttons/actions), bubbling/composed so
5
+ * `<aq-mcp-config>` owns state. A `writeOnce` field that already has a stored
6
+ * value renders masked + "Replace" instead of an input (§7) until Replace is
7
+ * clicked. A `FULL_WIDTH_CONTROLS` control (currently `properties-table` only)
8
+ * skips the two-column split entirely and renders its own full-width card
9
+ * instead — see that constant's doc comment.
10
+ *
11
+ * Light DOM by design (see `<aq-mcp-config>`'s own doc comment) — requires
12
+ * the host to load `mcp-ui-render.css` globally.
13
+ */
14
+ import { LitElement, type TemplateResult } from 'lit';
15
+ import type { Field } from '../types.js';
16
+ import '../controls.js';
17
+ export declare class AqMcpField extends LitElement {
18
+ field: Field;
19
+ value: unknown;
20
+ error: string | null;
21
+ /** Host-fed options for `select`/`radio` fields resolved dynamically via `field.tool`
22
+ * (§9.6) — see `<aq-mcp-config>`'s own `dynamicOptions` property for the full contract. */
23
+ dynamicOptions: Record<string, unknown[]>;
24
+ /** Set by `<aq-mcp-section>` in `sectionsLayout: 'accordion'`. Swaps the
25
+ * label-left/control-right row for a label-ABOVE-control cell that sits in
26
+ * the section's grid, with `help` as hint text UNDER the control rather
27
+ * than beside the label. It is the same `renderHelp()` every other layout
28
+ * uses — one help implementation, one truncation rule — only repositioned,
29
+ * so a long description reads identically wherever it appears. Reflected
30
+ * so CSS can target
31
+ * `[dense]` without depending on the class the parent template happens to
32
+ * bind (a `class` binding upstream would clobber anything this element
33
+ * added to `classList` on its own re-render). */
34
+ dense: boolean;
35
+ private replacing;
36
+ private helpExpanded;
37
+ protected createRenderRoot(): HTMLElement;
38
+ private emitInput;
39
+ private emitAction;
40
+ /** A write-once secret with a stored value shows masked + Replace, not an input
41
+ * (§7) — "stored" means the host seeded the WRITE_ONCE_UNCHANGED sentinel,
42
+ * NOT merely any non-empty string. Checking for any truthy string instead
43
+ * broke live typing: the moment a user typed even one character into a
44
+ * fresh field, that keystroke itself became a "non-empty string" and this
45
+ * flipped to the masked view mid-type, discarding everything after it. */
46
+ private isSetWriteOnce;
47
+ private renderControl;
48
+ /** Help text past this length collapses behind a "View more"/"View less" toggle
49
+ * — matches the live reference's behavior for its longer field descriptions;
50
+ * anything shorter always renders in full, no toggle shown. */
51
+ private static readonly HELP_TRUNCATE_AT;
52
+ private renderHelp;
53
+ /** Which control will actually render — the registered one for this
54
+ * `ui-component`, else the datatype's default (§9.1). Needed to spot a
55
+ * boolean/toggle field, which gets a pill ROW in dense mode rather than a
56
+ * label-above-control cell; asking `field['ui-component'] === 'checkbox'`
57
+ * alone would miss a `datatype: "boolean"` field whose `ui-component` is
58
+ * unknown and therefore falls back to `checkbox`. */
59
+ private effectiveControl;
60
+ /**
61
+ * The required marker: the same `*` the stacked and tabs layouts use, shown
62
+ * only while the requirement is still OUTSTANDING.
63
+ *
64
+ * A symbol, not a sentence. An earlier version read "Needs a value", which
65
+ * is the renderer describing a field's state in words the descriptor never
66
+ * supplied — `isRequired: true` is all it says. The asterisk carries the
67
+ * same fact using the convention the rest of this library already uses.
68
+ *
69
+ * Still conditional: a permanent mark on every required field, including
70
+ * the finished ones, makes the marks that still mean something the hardest
71
+ * to find.
72
+ */
73
+ private renderRequiredMark;
74
+ /** A value the user has actually supplied. The write-once sentinel counts
75
+ * as supplied (§7) — same rule `engine/status.ts` applies to the section
76
+ * counts, so a stored secret never reads as an empty field. */
77
+ private hasValue;
78
+ /** Dense (accordion) layout — see the `dense` property's doc comment. */
79
+ private renderDense;
80
+ render(): TemplateResult;
81
+ /** `data-empty` / `data-toggle` drive dense-mode styling (the dashed "Not
82
+ * set" box, the toggle pill's checked tint) from the element itself. Set
83
+ * as ATTRIBUTES, not classes: `<aq-mcp-section>`'s template binds this
84
+ * element's `class`, and Lit re-applies that binding on every update,
85
+ * which would wipe anything added to `classList` here. */
86
+ protected updated(): void;
87
+ }
88
+ declare global {
89
+ interface HTMLElementTagNameMap {
90
+ 'aq-mcp-field': AqMcpField;
91
+ }
92
+ }
@@ -0,0 +1,275 @@
1
+ var AqMcpField_1;
2
+ import { __decorate, __metadata } from "tslib";
3
+ /**
4
+ * `<aq-mcp-field>` — one two-column row (design Option A): label + required mark
5
+ * + help on the left, the control on the right. Re-emits user intent upward:
6
+ * `field-input` (edits) and `field-action` (buttons/actions), bubbling/composed so
7
+ * `<aq-mcp-config>` owns state. A `writeOnce` field that already has a stored
8
+ * value renders masked + "Replace" instead of an input (§7) until Replace is
9
+ * clicked. A `FULL_WIDTH_CONTROLS` control (currently `properties-table` only)
10
+ * skips the two-column split entirely and renders its own full-width card
11
+ * instead — see that constant's doc comment.
12
+ *
13
+ * Light DOM by design (see `<aq-mcp-config>`'s own doc comment) — requires
14
+ * the host to load `mcp-ui-render.css` globally.
15
+ */
16
+ import { LitElement, html } from 'lit';
17
+ import { customElement, property, state } from 'lit/decorators.js';
18
+ import { defaultControlFor, resolveControl } from '../registry.js';
19
+ import { WRITE_ONCE_UNCHANGED } from '../engine/submit.js';
20
+ import { isEmpty } from '../engine/validate.js';
21
+ import '../controls.js'; // register the default controls
22
+ /** `ui-component`s that render their own full-width card (title/subtitle/toolbar
23
+ * included) rather than fitting the standard label-left/control-right two-column
24
+ * row — currently `properties-table` only, matching the live reference's
25
+ * "Generated Configuration" card layout. Kept as a short allowlist here (same
26
+ * precedent as the existing `isSetWriteOnce()`/`file` ui-component checks below)
27
+ * rather than a new generic `Field` flag, since no other control needs it yet. */
28
+ const FULL_WIDTH_CONTROLS = new Set(['properties-table']);
29
+ let AqMcpField = AqMcpField_1 = class AqMcpField extends LitElement {
30
+ constructor() {
31
+ super(...arguments);
32
+ this.value = undefined;
33
+ this.error = null;
34
+ /** Host-fed options for `select`/`radio` fields resolved dynamically via `field.tool`
35
+ * (§9.6) — see `<aq-mcp-config>`'s own `dynamicOptions` property for the full contract. */
36
+ this.dynamicOptions = {};
37
+ /** Set by `<aq-mcp-section>` in `sectionsLayout: 'accordion'`. Swaps the
38
+ * label-left/control-right row for a label-ABOVE-control cell that sits in
39
+ * the section's grid, with `help` as hint text UNDER the control rather
40
+ * than beside the label. It is the same `renderHelp()` every other layout
41
+ * uses — one help implementation, one truncation rule — only repositioned,
42
+ * so a long description reads identically wherever it appears. Reflected
43
+ * so CSS can target
44
+ * `[dense]` without depending on the class the parent template happens to
45
+ * bind (a `class` binding upstream would clobber anything this element
46
+ * added to `classList` on its own re-render). */
47
+ this.dense = false;
48
+ this.replacing = false;
49
+ this.helpExpanded = false;
50
+ }
51
+ createRenderRoot() {
52
+ return this;
53
+ }
54
+ emitInput(value) {
55
+ this.dispatchEvent(new CustomEvent('field-input', {
56
+ detail: { attribute: this.field.attribute, value },
57
+ bubbles: true,
58
+ composed: true,
59
+ }));
60
+ }
61
+ emitAction(action) {
62
+ this.dispatchEvent(new CustomEvent('field-action', { detail: { field: this.field, action }, bubbles: true, composed: true }));
63
+ }
64
+ /** A write-once secret with a stored value shows masked + Replace, not an input
65
+ * (§7) — "stored" means the host seeded the WRITE_ONCE_UNCHANGED sentinel,
66
+ * NOT merely any non-empty string. Checking for any truthy string instead
67
+ * broke live typing: the moment a user typed even one character into a
68
+ * fresh field, that keystroke itself became a "non-empty string" and this
69
+ * flipped to the masked view mid-type, discarding everything after it. */
70
+ isSetWriteOnce() {
71
+ return !!this.field.writeOnce && !this.replacing && this.value === WRITE_ONCE_UNCHANGED;
72
+ }
73
+ renderControl() {
74
+ const f = this.field;
75
+ if (this.isSetWriteOnce()) {
76
+ const isFile = this.field.datatype === 'file' || this.field['ui-component'] === 'file';
77
+ // Masked, as it always was (§7) — the host holds the real value and this
78
+ // element never sees it. An interim version replaced the mask with
79
+ // "Saved and encrypted", which is the renderer asserting in prose
80
+ // something the descriptor only implies via `writeOnce`.
81
+ return html `<div class="aq-mcp-writeonce">
82
+ <span class="aq-mcp-writeonce__lock" aria-hidden="true">
83
+ <nile-glyph name="ng-lock-03" method="stroke" size="16" color="currentColor"></nile-glyph>
84
+ </span>
85
+ <span class="aq-mcp-writeonce__state">${isFile ? 'A file is on record' : '••••••••••'}</span>
86
+ <button
87
+ type="button"
88
+ class="aq-mcp-writeonce__replace"
89
+ @click=${() => {
90
+ this.replacing = true;
91
+ this.emitInput('');
92
+ }}
93
+ >
94
+ Replace
95
+ </button>
96
+ </div>`;
97
+ }
98
+ const renderer = resolveControl(f['ui-component']) ?? resolveControl(defaultControlFor(f.datatype));
99
+ if (!renderer)
100
+ return html ``;
101
+ return renderer({
102
+ field: f,
103
+ value: this.value,
104
+ error: this.error,
105
+ onInput: (v) => this.emitInput(v),
106
+ onAction: (action) => this.emitAction(action),
107
+ dynamicOptions: this.dynamicOptions,
108
+ dense: this.dense,
109
+ });
110
+ }
111
+ renderHelp() {
112
+ const help = this.field.help;
113
+ if (!help)
114
+ return '';
115
+ // Dense mode never truncates. The threshold below is tuned for the
116
+ // stacked/tabs layouts, where help shares a ~280px label column with the
117
+ // label itself and a long paragraph would tower over its own control. In
118
+ // the accordion the same text is a full-width hint line under the field
119
+ // with room for two or three lines, so collapsing it behind "View more"
120
+ // hides information that already fits — and, on a form where nearly every
121
+ // field carries a long description, turns most of the card into toggles.
122
+ if (this.dense || help.length <= AqMcpField_1.HELP_TRUNCATE_AT) {
123
+ return html `<div class="aq-mcp-field__help">${help}</div>`;
124
+ }
125
+ if (this.helpExpanded) {
126
+ return html `<div class="aq-mcp-field__help">
127
+ ${help}
128
+ <button type="button" class="aq-mcp-field__help-toggle" @click=${() => (this.helpExpanded = false)}>
129
+ View less
130
+ </button>
131
+ </div>`;
132
+ }
133
+ return html `<div class="aq-mcp-field__help">
134
+ ${help.slice(0, AqMcpField_1.HELP_TRUNCATE_AT)}…
135
+ <button type="button" class="aq-mcp-field__help-toggle" @click=${() => (this.helpExpanded = true)}>
136
+ View more
137
+ </button>
138
+ </div>`;
139
+ }
140
+ /** Which control will actually render — the registered one for this
141
+ * `ui-component`, else the datatype's default (§9.1). Needed to spot a
142
+ * boolean/toggle field, which gets a pill ROW in dense mode rather than a
143
+ * label-above-control cell; asking `field['ui-component'] === 'checkbox'`
144
+ * alone would miss a `datatype: "boolean"` field whose `ui-component` is
145
+ * unknown and therefore falls back to `checkbox`. */
146
+ effectiveControl() {
147
+ const declared = this.field['ui-component'];
148
+ return resolveControl(declared) ? declared : defaultControlFor(this.field.datatype);
149
+ }
150
+ /**
151
+ * The required marker: the same `*` the stacked and tabs layouts use, shown
152
+ * only while the requirement is still OUTSTANDING.
153
+ *
154
+ * A symbol, not a sentence. An earlier version read "Needs a value", which
155
+ * is the renderer describing a field's state in words the descriptor never
156
+ * supplied — `isRequired: true` is all it says. The asterisk carries the
157
+ * same fact using the convention the rest of this library already uses.
158
+ *
159
+ * Still conditional: a permanent mark on every required field, including
160
+ * the finished ones, makes the marks that still mean something the hardest
161
+ * to find.
162
+ */
163
+ renderRequiredMark() {
164
+ if (!this.field.isRequired || this.hasValue())
165
+ return '';
166
+ return html `<span class="aq-mcp-field__req">*</span>`;
167
+ }
168
+ /** A value the user has actually supplied. The write-once sentinel counts
169
+ * as supplied (§7) — same rule `engine/status.ts` applies to the section
170
+ * counts, so a stored secret never reads as an empty field. */
171
+ hasValue() {
172
+ return this.value === WRITE_ONCE_UNCHANGED || !isEmpty(this.value);
173
+ }
174
+ /** Dense (accordion) layout — see the `dense` property's doc comment. */
175
+ renderDense() {
176
+ const f = this.field;
177
+ const label = f.label ?? f.attribute;
178
+ // `datatype: "none"` holds no value the user supplies — a button, or a
179
+ // report/table that renders its own heading. It gets neither a label row
180
+ // (the control already carries its own text, so one would read twice) nor
181
+ // the empty-field treatment (it is not an unfilled field, it is not a
182
+ // field at all in that sense — the same exclusion `engine/status.ts`
183
+ // makes when counting). Spans both columns: the reports are wide, and a
184
+ // lone button is still left-aligned inside the span.
185
+ if (f.datatype === 'none') {
186
+ return html `<div class="aq-mcp-field__control aq-mcp-field__control--full">${this.renderControl()}</div>`;
187
+ }
188
+ // A toggle carries its own label on the pill row, so it never gets the
189
+ // label-above-control treatment — the control IS the row.
190
+ if (this.effectiveControl() === 'checkbox' && !this.isSetWriteOnce()) {
191
+ // The toggle's description lives INSIDE its row, not below it: the row
192
+ // is already a self-contained block, and a hint line hanging under it
193
+ // reads as belonging to whatever comes next.
194
+ return html `<div class="aq-mcp-field__toggle">
195
+ <span class="aq-mcp-field__toggle-text">
196
+ <span class="aq-mcp-field__label-text">${label}</span>
197
+ ${f.help ? html `<span class="aq-mcp-field__toggle-help">${f.help}</span>` : ''}
198
+ </span>
199
+ <div class="aq-mcp-field__control">${this.renderControl()}</div>
200
+ </div>`;
201
+ }
202
+ return html `
203
+ <div class="aq-mcp-field__label">
204
+ <span class="aq-mcp-field__label-text">${label}</span>
205
+ ${this.renderRequiredMark()}
206
+ </div>
207
+ <div class="aq-mcp-field__control">${this.renderControl()}</div>
208
+ ${this.renderHelp()}
209
+ `;
210
+ }
211
+ render() {
212
+ const f = this.field;
213
+ if (!f)
214
+ return html ``;
215
+ if (FULL_WIDTH_CONTROLS.has(f['ui-component'])) {
216
+ return html `<div class="aq-mcp-field__control aq-mcp-field__control--full">${this.renderControl()}</div>`;
217
+ }
218
+ if (this.dense)
219
+ return this.renderDense();
220
+ return html `
221
+ <div class="aq-mcp-field__label">
222
+ ${f.label ?? f.attribute}${f.isRequired ? html `<span class="aq-mcp-field__req">*</span>` : ''}
223
+ ${this.renderHelp()}
224
+ </div>
225
+ <div class="aq-mcp-field__control">${this.renderControl()}</div>
226
+ `;
227
+ }
228
+ /** `data-empty` / `data-toggle` drive dense-mode styling (the dashed "Not
229
+ * set" box, the toggle pill's checked tint) from the element itself. Set
230
+ * as ATTRIBUTES, not classes: `<aq-mcp-section>`'s template binds this
231
+ * element's `class`, and Lit re-applies that binding on every update,
232
+ * which would wipe anything added to `classList` here. */
233
+ updated() {
234
+ this.toggleAttribute('data-empty', this.dense && this.field?.datatype !== 'none' && !this.hasValue());
235
+ this.toggleAttribute('data-toggle', this.dense && this.effectiveControl() === 'checkbox');
236
+ this.toggleAttribute('data-on', this.value === true || this.value === 'true');
237
+ }
238
+ };
239
+ /** Help text past this length collapses behind a "View more"/"View less" toggle
240
+ * — matches the live reference's behavior for its longer field descriptions;
241
+ * anything shorter always renders in full, no toggle shown. */
242
+ AqMcpField.HELP_TRUNCATE_AT = 100;
243
+ __decorate([
244
+ property({ attribute: false }),
245
+ __metadata("design:type", Object)
246
+ ], AqMcpField.prototype, "field", void 0);
247
+ __decorate([
248
+ property({ attribute: false }),
249
+ __metadata("design:type", Object)
250
+ ], AqMcpField.prototype, "value", void 0);
251
+ __decorate([
252
+ property({ attribute: false }),
253
+ __metadata("design:type", Object)
254
+ ], AqMcpField.prototype, "error", void 0);
255
+ __decorate([
256
+ property({ attribute: false }),
257
+ __metadata("design:type", Object)
258
+ ], AqMcpField.prototype, "dynamicOptions", void 0);
259
+ __decorate([
260
+ property({ type: Boolean, reflect: true }),
261
+ __metadata("design:type", Object)
262
+ ], AqMcpField.prototype, "dense", void 0);
263
+ __decorate([
264
+ state(),
265
+ __metadata("design:type", Object)
266
+ ], AqMcpField.prototype, "replacing", void 0);
267
+ __decorate([
268
+ state(),
269
+ __metadata("design:type", Object)
270
+ ], AqMcpField.prototype, "helpExpanded", void 0);
271
+ AqMcpField = AqMcpField_1 = __decorate([
272
+ customElement('aq-mcp-field')
273
+ ], AqMcpField);
274
+ export { AqMcpField };
275
+ //# sourceMappingURL=aq-mcp-field.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"aq-mcp-field.js","sourceRoot":"","sources":["../../../../../apps/mcp-ui-render/src/elements/aq-mcp-field.ts"],"names":[],"mappings":";;AAAA;;;;;;;;;;;;GAYG;AACH,OAAO,EAAE,UAAU,EAAE,IAAI,EAAuB,MAAM,KAAK,CAAC;AAC5D,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAEnE,OAAO,EAAE,iBAAiB,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AACnE,OAAO,EAAE,oBAAoB,EAAE,MAAM,qBAAqB,CAAC;AAC3D,OAAO,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAC;AAEhD,OAAO,gBAAgB,CAAC,CAAC,gCAAgC;AAEzD;;;;;mFAKmF;AACnF,MAAM,mBAAmB,GAAG,IAAI,GAAG,CAAC,CAAC,kBAAkB,CAAC,CAAC,CAAC;AAGnD,IAAM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AU,EAAE;;2CAEgB,IAAI,CAAC,aAAa,EAAE;KAC1D,CAAC;IACJ,CAAC;IAED;;;;+DAI2D;IACjD,OAAO;QACf,IAAI,CAAC,eAAe,CAAC,YAAY,EAAE,IAAI,CAAC,KAAK,IAAI,IAAI,CAAC,KAAK,EAAE,QAAQ,KAAK,MAAM,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE,CAAC,CAAC;QACtG,IAAI,CAAC,eAAe,CAAC,aAAa,EAAE,IAAI,CAAC,KAAK,IAAI,IAAI,CAAC,gBAAgB,EAAE,KAAK,UAAU,CAAC,CAAC;QAC1F,IAAI,CAAC,eAAe,CAAC,SAAS,EAAE,IAAI,CAAC,KAAK,KAAK,IAAI,IAAI,IAAI,CAAC,KAAK,KAAK,MAAM,CAAC,CAAC;IAChF,CAAC;;AArID;;gEAEgE;AACxC,2BAAgB,GAAG,GAAG,AAAN,CAAO;AA7Ff;IAA/B,QAAQ,CAAC,EAAE,SAAS,EAAE,KAAK,EAAE,CAAC;;yCAAe;AACd;IAA/B,QAAQ,CAAC,EAAE,SAAS,EAAE,KAAK,EAAE,CAAC;;yCAA4B;AAC3B;IAA/B,QAAQ,CAAC,EAAE,SAAS,EAAE,KAAK,EAAE,CAAC;;yCAA6B;AAG5B;IAA/B,QAAQ,CAAC,EAAE,SAAS,EAAE,KAAK,EAAE,CAAC;;kDAAgD;AAYnC;IAA3C,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;;yCAAe;AAEzC;IAAhB,KAAK,EAAE;;6CAA2B;AAClB;IAAhB,KAAK,EAAE;;gDAA8B;AArB3B,UAAU;IADtB,aAAa,CAAC,cAAc,CAAC;GACjB,UAAU,CAiOtB"}
@@ -0,0 +1,101 @@
1
+ /**
2
+ * `<aq-mcp-section>` — one section rendered as a card (design Option A): header
3
+ * with the section label, an `authType` badge, and a save-target caption
4
+ * ("connector saves · <submitTool>" or "platform saves · applications_update",
5
+ * §13); a body of two-column fields (applicable, non-hidden, in order, §12,
6
+ * and — for `test-connection-report`/`permissions-report` specifically — only
7
+ * once there's actually a value to show, see `hasNothingToShow`); and a save
8
+ * footer whose button emits `section-submit`. A host may register
9
+ * a custom footer for `section.key` via `registerSectionFooter` to replace the
10
+ * default button entirely; absent that, the default "Save <label>" renders.
11
+ * `showFooter` (default true) is a master switch that hides EITHER — custom
12
+ * or default — when false, e.g. when the host drives submission itself.
13
+ * `compact` (set by `<aq-mcp-config>` in `sectionsLayout: 'tabs'` mode) drops
14
+ * the card's own border + title, since the tab nav already shows the label.
15
+ *
16
+ * Light DOM by design (see `<aq-mcp-config>`'s own doc comment) — requires
17
+ * the host to load `mcp-ui-render.css` globally.
18
+ */
19
+ import { LitElement, type TemplateResult } from 'lit';
20
+ import type { Section, Values } from '../types.js';
21
+ import './aq-mcp-field.js';
22
+ export declare class AqMcpSection extends LitElement {
23
+ section: Section;
24
+ values: Values;
25
+ errors: Record<string, string | null>;
26
+ /** Host-fed options for `select`/`radio` fields resolved dynamically via `field.tool`
27
+ * (§9.6) — see `<aq-mcp-config>`'s own `dynamicOptions` property for the full contract. */
28
+ dynamicOptions: Record<string, unknown[]>;
29
+ /** Master switch for this section's footer (§13/§14) — the default "Save
30
+ * <label>" button, AND any `registerSectionFooter` override. Default true;
31
+ * set false to hide the footer entirely regardless of what's registered,
32
+ * e.g. when the host drives submission itself via its own button(s). */
33
+ showFooter: boolean;
34
+ /** Set by `<aq-mcp-config>` when this section is rendered as a tab panel
35
+ * (`sectionsLayout: 'tabs'`) — drops the card's own border and title
36
+ * (the tab nav already shows the label) to avoid double-boxing/duplicate
37
+ * labeling. The authType badge and save-target caption still render. */
38
+ compact: boolean;
39
+ /** Set by `<aq-mcp-config>` when this section is the body of a
40
+ * `nile-accordion` (`sectionsLayout: 'accordion'`). Drops the card AND the
41
+ * whole header — the accordion's own summary already carries the label,
42
+ * authType badge and completion chips — and lays the body out as a
43
+ * two-column grid of label-above-control fields (`dense` is passed down to
44
+ * every `<aq-mcp-field>`). The save-target caption moves into the footer,
45
+ * the only place it still has anything to explain, and only when a footer
46
+ * actually renders. */
47
+ dense: boolean;
48
+ /** Column ceiling for the dense field grid — see `<aq-mcp-config>`'s
49
+ * `accordionColumns`. Only meaningful when `dense` is set. */
50
+ columns: 1 | 2;
51
+ protected createRenderRoot(): HTMLElement;
52
+ private caption;
53
+ private saveLabel;
54
+ private emitSubmit;
55
+ private renderFooter;
56
+ private renderHeader;
57
+ /**
58
+ * Split the dense (accordion) body into the three zones the design calls for.
59
+ *
60
+ * The `bootstrap` descriptor has NO layout vocabulary — no group, column,
61
+ * width or span key — and its shape is fixed, so this cannot be declared and
62
+ * has to be derived. It is derived only from data the descriptor already
63
+ * carries, never from the attribute name or anything else guessed:
64
+ *
65
+ * - **toggles** — `datatype: "boolean"`. Last, full width. A switch with a
66
+ * one-line description is a different row shape from a labelled control,
67
+ * which is why these group even though it reorders them.
68
+ * - **defaults** — has a `defaultValue`, is NOT required, and is not a
69
+ * credential. Two-up, below a plain rule. The rule carries NO caption: a
70
+ * heading there ("Defaults you can tune") would be the renderer
71
+ * describing the connector's own fields in words the descriptor never
72
+ * supplied. The separation is conveyed by position and density instead,
73
+ * which needs no invented copy.
74
+ * - **primary** — everything else, full width, first: required fields,
75
+ * credentials, and optional fields the connector gave no default for.
76
+ * These are the ones where the user has to supply something.
77
+ *
78
+ * The `isRequired`/`secret` exclusions matter: a required field that happens
79
+ * to carry a default is still something the user must confirm, and a stored
80
+ * credential is never "a default you can tune" — filing either under that
81
+ * heading would tell the reader they can skip it.
82
+ *
83
+ * This DOES reorder relative to the descriptor's `fields` order, and it is
84
+ * the only layout that does. Order is preserved WITHIN each zone, so a
85
+ * connector's intended sequence still shows through.
86
+ */
87
+ private zones;
88
+ /** See `zones()` — "the connector already chose an answer, and you may
89
+ * leave it alone". `datatype: "none"` (buttons, reports) has no value to
90
+ * default; a required field must still be confirmed; a secret is never a
91
+ * tunable default however it was seeded. */
92
+ private static isTunableDefault;
93
+ private renderFields;
94
+ private renderDenseBody;
95
+ render(): TemplateResult;
96
+ }
97
+ declare global {
98
+ interface HTMLElementTagNameMap {
99
+ 'aq-mcp-section': AqMcpSection;
100
+ }
101
+ }