@design.estate/dees-catalog 21.32.3 → 21.33.0
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.
- package/dist_bundle/bundle.js +1545 -332
- package/dist_bundle/bundle.js.map +1 -1
- package/dist_bundle/chunks/U6Ua8p1giFoD1s7vrUZUdpbg/{chunk-ZRD47DC6.js → chunk-B3NM6BL3.js} +3 -3
- package/dist_bundle/chunks/U6Ua8p1giFoD1s7vrUZUdpbg/{chunk-EL3KNDIB.js → chunk-BDUZ7I23.js} +2 -2
- package/dist_bundle/chunks/U6Ua8p1giFoD1s7vrUZUdpbg/{chunk-LDC2GECY.js → chunk-IK5OF7M4.js} +33 -2
- package/dist_bundle/chunks/U6Ua8p1giFoD1s7vrUZUdpbg/{chunk-LDC2GECY.js.map → chunk-IK5OF7M4.js.map} +1 -1
- package/dist_bundle/chunks/U6Ua8p1giFoD1s7vrUZUdpbg/{de-YOX3NS2W.js → de-PTMMQ5DA.js} +33 -2
- package/dist_bundle/chunks/U6Ua8p1giFoD1s7vrUZUdpbg/de-PTMMQ5DA.js.map +1 -0
- package/dist_bundle/chunks/U6Ua8p1giFoD1s7vrUZUdpbg/{dees-modal-7LJGK5SK.js → dees-modal-BZIJFVRI.js} +3 -3
- package/dist_bundle/chunks/U6Ua8p1giFoD1s7vrUZUdpbg/{dees-workspace-terminal-O3NEQ4DO.js → dees-workspace-terminal-EU377EZY.js} +4 -4
- package/dist_ts_web/00_commitinfo_data.js +1 -1
- package/dist_ts_web/elements/00group-chart/dees-chart-area/component.d.ts +18 -0
- package/dist_ts_web/elements/00group-chart/dees-chart-area/component.js +60 -2
- package/dist_ts_web/elements/00group-chart/dees-chart-area/priceaxislabels.d.ts +24 -0
- package/dist_ts_web/elements/00group-chart/dees-chart-area/priceaxislabels.js +80 -0
- package/dist_ts_web/elements/00group-feedback/dees-hint/dees-hint.d.ts +1 -0
- package/dist_ts_web/elements/00group-feedback/dees-hint/dees-hint.js +13 -3
- package/dist_ts_web/elements/00group-harness/dees-harness-message-list/dees-harness-message-list.js +7 -5
- package/dist_ts_web/elements/00group-harness/dees-harness-permission-card/dees-harness-permission-card.d.ts +0 -3
- package/dist_ts_web/elements/00group-harness/dees-harness-permission-card/dees-harness-permission-card.js +10 -182
- package/dist_ts_web/elements/00group-harness/dees-harness-question-card/dees-harness-question-card.d.ts +64 -1
- package/dist_ts_web/elements/00group-harness/dees-harness-question-card/dees-harness-question-card.demo.js +221 -22
- package/dist_ts_web/elements/00group-harness/dees-harness-question-card/dees-harness-question-card.js +544 -66
- package/dist_ts_web/elements/00group-harness/harness.helpers.d.ts +16 -1
- package/dist_ts_web/elements/00group-harness/harness.helpers.js +25 -1
- package/dist_ts_web/elements/00group-harness/harness.records.d.ts +27 -0
- package/dist_ts_web/elements/00group-harness/harness.records.js +193 -0
- package/dist_ts_web/elements/00group-harness/interfaces.d.ts +93 -4
- package/dist_ts_web/elements/00group-kanban/dees-kanban/dees-kanban.d.ts +39 -0
- package/dist_ts_web/elements/00group-kanban/dees-kanban/dees-kanban.demo.js +22 -8
- package/dist_ts_web/elements/00group-kanban/dees-kanban/dees-kanban.js +265 -25
- package/dist_ts_web/elements/00group-kanban/dees-kanban-column/dees-kanban-column.d.ts +5 -0
- package/dist_ts_web/elements/00group-kanban/dees-kanban-column/dees-kanban-column.js +70 -11
- package/dist_ts_web/elements/00group-kanban/dees-kanban-ticket-detail/dees-kanban-ticket-detail.d.ts +16 -1
- package/dist_ts_web/elements/00group-kanban/dees-kanban-ticket-detail/dees-kanban-ticket-detail.js +188 -5
- package/dist_ts_web/elements/00group-kanban/interfaces.d.ts +47 -2
- package/dist_ts_web/elements/00group-kanban/kanban.demodata.d.ts +7 -1
- package/dist_ts_web/elements/00group-kanban/kanban.demodata.js +49 -7
- package/dist_ts_web/elements/00group-kanban/kanban.dragcontroller.js +6 -1
- package/dist_ts_web/elements/00group-kanban/kanban.helpers.d.ts +15 -1
- package/dist_ts_web/elements/00group-kanban/kanban.helpers.js +31 -1
- package/dist_ts_web/i18n/de.d.ts +124 -0
- package/dist_ts_web/i18n/de.js +32 -1
- package/dist_ts_web/i18n/messages.d.ts +124 -0
- package/dist_ts_web/i18n/messages.js +32 -1
- package/package.json +1 -1
- package/readme.md +76 -13
- package/ts_web/00_commitinfo_data.ts +1 -1
- package/ts_web/elements/00group-chart/dees-chart-area/component.ts +59 -1
- package/ts_web/elements/00group-chart/dees-chart-area/priceaxislabels.ts +97 -0
- package/ts_web/elements/00group-feedback/dees-hint/dees-hint.ts +16 -3
- package/ts_web/elements/00group-harness/dees-harness-message-list/dees-harness-message-list.ts +6 -4
- package/ts_web/elements/00group-harness/dees-harness-permission-card/dees-harness-permission-card.ts +16 -186
- package/ts_web/elements/00group-harness/dees-harness-question-card/dees-harness-question-card.demo.ts +261 -55
- package/ts_web/elements/00group-harness/dees-harness-question-card/dees-harness-question-card.ts +575 -88
- package/ts_web/elements/00group-harness/harness.helpers.ts +39 -0
- package/ts_web/elements/00group-harness/harness.records.ts +210 -0
- package/ts_web/elements/00group-harness/interfaces.ts +99 -4
- package/ts_web/elements/00group-kanban/dees-kanban/dees-kanban.demo.ts +21 -5
- package/ts_web/elements/00group-kanban/dees-kanban/dees-kanban.ts +256 -24
- package/ts_web/elements/00group-kanban/dees-kanban-column/dees-kanban-column.ts +67 -6
- package/ts_web/elements/00group-kanban/dees-kanban-ticket-detail/dees-kanban-ticket-detail.ts +202 -1
- package/ts_web/elements/00group-kanban/interfaces.ts +55 -3
- package/ts_web/elements/00group-kanban/kanban.demodata.ts +62 -6
- package/ts_web/elements/00group-kanban/kanban.dragcontroller.ts +5 -0
- package/ts_web/elements/00group-kanban/kanban.helpers.ts +53 -0
- package/ts_web/i18n/de.ts +31 -0
- package/ts_web/i18n/messages.ts +31 -0
- package/dist_bundle/chunks/U6Ua8p1giFoD1s7vrUZUdpbg/de-YOX3NS2W.js.map +0 -1
- /package/dist_bundle/chunks/U6Ua8p1giFoD1s7vrUZUdpbg/{chunk-ZRD47DC6.js.map → chunk-B3NM6BL3.js.map} +0 -0
- /package/dist_bundle/chunks/U6Ua8p1giFoD1s7vrUZUdpbg/{chunk-EL3KNDIB.js.map → chunk-BDUZ7I23.js.map} +0 -0
- /package/dist_bundle/chunks/U6Ua8p1giFoD1s7vrUZUdpbg/{dees-modal-7LJGK5SK.js.map → dees-modal-BZIJFVRI.js.map} +0 -0
- /package/dist_bundle/chunks/U6Ua8p1giFoD1s7vrUZUdpbg/{dees-workspace-terminal-O3NEQ4DO.js.map → dees-workspace-terminal-EU377EZY.js.map} +0 -0
package/ts_web/elements/00group-harness/dees-harness-permission-card/dees-harness-permission-card.ts
CHANGED
|
@@ -11,17 +11,21 @@ import {
|
|
|
11
11
|
} from '@design.estate/dees-element';
|
|
12
12
|
import { dcLocalize } from '../../../i18n/localize.js';
|
|
13
13
|
import { themeDefaultStyles } from '../../00theme.js';
|
|
14
|
-
import { visuallyHidden } from '../../00visuallyhidden.js';
|
|
15
14
|
import { harnessActivityStyles, harnessControlStyles } from '../harness.styles.js';
|
|
15
|
+
import {
|
|
16
|
+
harnessRecordStyles,
|
|
17
|
+
harnessShownRecords,
|
|
18
|
+
renderHarnessChanges,
|
|
19
|
+
renderHarnessMoreRecords,
|
|
20
|
+
renderHarnessOutcome,
|
|
21
|
+
routeHarnessRecordLink,
|
|
22
|
+
} from '../harness.records.js';
|
|
16
23
|
import type {
|
|
17
24
|
IHarnessPermissionAction,
|
|
18
|
-
IHarnessPermissionChange,
|
|
19
25
|
IHarnessPermissionItem,
|
|
20
26
|
IHarnessPermissionLinkDetail,
|
|
21
|
-
IHarnessPermissionOutcome,
|
|
22
27
|
IHarnessPermissionRequest,
|
|
23
28
|
IHarnessPermissionViewState,
|
|
24
|
-
THarnessPermissionOutcomeTone,
|
|
25
29
|
THarnessPermissionResponse,
|
|
26
30
|
} from '../interfaces.js';
|
|
27
31
|
import { harnessStringifyValue } from '../harness.helpers.js';
|
|
@@ -56,17 +60,6 @@ const DEFAULT_EMPHASIS: Record<THarnessPermissionResponse, NonNullable<IHarnessP
|
|
|
56
60
|
|
|
57
61
|
const BUTTON_TYPE = { accent: 'accent', plain: 'default', destructive: 'destructive' } as const;
|
|
58
62
|
|
|
59
|
-
const OUTCOME_ICON: Record<THarnessPermissionOutcomeTone, string> = {
|
|
60
|
-
running: 'lucide:LoaderCircle',
|
|
61
|
-
success: 'lucide:CircleCheck',
|
|
62
|
-
warning: 'lucide:TriangleAlert',
|
|
63
|
-
error: 'lucide:CircleX',
|
|
64
|
-
neutral: 'lucide:Info',
|
|
65
|
-
};
|
|
66
|
-
|
|
67
|
-
/** How many records a request lists before the rest wait behind "Show more". */
|
|
68
|
-
const ITEMS_SHOWN = 5;
|
|
69
|
-
|
|
70
63
|
/**
|
|
71
64
|
* Permission prompt card: title, type badge, the agent's summary, the
|
|
72
65
|
* records it acts on (each a link where it opens, with what changes in it),
|
|
@@ -130,6 +123,7 @@ export class DeesHarnessPermissionCard extends DeesElement {
|
|
|
130
123
|
cssManager.defaultStyles,
|
|
131
124
|
harnessControlStyles,
|
|
132
125
|
harnessActivityStyles,
|
|
126
|
+
harnessRecordStyles,
|
|
133
127
|
css`
|
|
134
128
|
:host {
|
|
135
129
|
display: block;
|
|
@@ -222,127 +216,6 @@ export class DeesHarnessPermissionCard extends DeesElement {
|
|
|
222
216
|
line-height: 1.5;
|
|
223
217
|
overflow-wrap: anywhere;
|
|
224
218
|
}
|
|
225
|
-
|
|
226
|
-
.items {
|
|
227
|
-
list-style: none;
|
|
228
|
-
margin: 12px 0;
|
|
229
|
-
padding: 0;
|
|
230
|
-
border: var(--dees-line-width-hairline) solid var(--dees-color-control-border);
|
|
231
|
-
border-radius: var(--dees-radius-lg);
|
|
232
|
-
background: var(--dees-color-control-bg);
|
|
233
|
-
font-size: 12px;
|
|
234
|
-
}
|
|
235
|
-
|
|
236
|
-
.item {
|
|
237
|
-
display: grid;
|
|
238
|
-
gap: 4px;
|
|
239
|
-
padding: 8px 12px;
|
|
240
|
-
min-width: 0;
|
|
241
|
-
}
|
|
242
|
-
|
|
243
|
-
.item + .item {
|
|
244
|
-
border-top: var(--dees-line-width-hairline) solid var(--dees-color-border-subtle);
|
|
245
|
-
}
|
|
246
|
-
|
|
247
|
-
.itemHead {
|
|
248
|
-
display: flex;
|
|
249
|
-
align-items: center;
|
|
250
|
-
gap: var(--dees-spacing-sm);
|
|
251
|
-
min-width: 0;
|
|
252
|
-
}
|
|
253
|
-
|
|
254
|
-
.itemLabel {
|
|
255
|
-
flex: 1;
|
|
256
|
-
min-width: 0;
|
|
257
|
-
color: var(--dees-color-text-primary);
|
|
258
|
-
font-weight: 500;
|
|
259
|
-
overflow-wrap: anywhere;
|
|
260
|
-
}
|
|
261
|
-
|
|
262
|
-
a.itemLabel {
|
|
263
|
-
color: var(--dees-color-accent-primary);
|
|
264
|
-
text-decoration: none;
|
|
265
|
-
border-radius: var(--dees-radius-xs);
|
|
266
|
-
}
|
|
267
|
-
|
|
268
|
-
a.itemLabel:hover {
|
|
269
|
-
text-decoration: underline;
|
|
270
|
-
}
|
|
271
|
-
|
|
272
|
-
a.itemLabel:focus-visible {
|
|
273
|
-
outline: var(--dees-line-width-focus-ring) solid var(--dees-color-focus-ring);
|
|
274
|
-
outline-offset: 2px;
|
|
275
|
-
}
|
|
276
|
-
|
|
277
|
-
.changes {
|
|
278
|
-
display: grid;
|
|
279
|
-
grid-template-columns: auto minmax(0, 1fr);
|
|
280
|
-
gap: var(--dees-spacing-2xs) var(--dees-spacing-md);
|
|
281
|
-
margin: 0;
|
|
282
|
-
}
|
|
283
|
-
|
|
284
|
-
.changes dt {
|
|
285
|
-
color: var(--dees-color-text-secondary);
|
|
286
|
-
white-space: nowrap;
|
|
287
|
-
}
|
|
288
|
-
|
|
289
|
-
.changes dd {
|
|
290
|
-
margin: 0;
|
|
291
|
-
color: var(--dees-color-text-primary);
|
|
292
|
-
overflow-wrap: anywhere;
|
|
293
|
-
}
|
|
294
|
-
|
|
295
|
-
.before {
|
|
296
|
-
color: var(--dees-color-text-secondary);
|
|
297
|
-
text-decoration: line-through;
|
|
298
|
-
}
|
|
299
|
-
|
|
300
|
-
.arrow {
|
|
301
|
-
margin: 0 4px;
|
|
302
|
-
color: var(--dees-color-text-secondary);
|
|
303
|
-
}
|
|
304
|
-
|
|
305
|
-
.moreItems {
|
|
306
|
-
margin: -4px 0 12px;
|
|
307
|
-
padding: 0;
|
|
308
|
-
border: none;
|
|
309
|
-
background: none;
|
|
310
|
-
color: var(--dees-color-accent-primary);
|
|
311
|
-
font: inherit;
|
|
312
|
-
font-size: var(--dees-font-caption1-size, 11px);
|
|
313
|
-
cursor: pointer;
|
|
314
|
-
border-radius: var(--dees-radius-xs);
|
|
315
|
-
}
|
|
316
|
-
|
|
317
|
-
.moreItems:hover {
|
|
318
|
-
text-decoration: underline;
|
|
319
|
-
}
|
|
320
|
-
|
|
321
|
-
.outcome {
|
|
322
|
-
display: inline-flex;
|
|
323
|
-
align-items: center;
|
|
324
|
-
gap: 6px;
|
|
325
|
-
min-width: 0;
|
|
326
|
-
color: var(--dees-color-text-secondary);
|
|
327
|
-
font-size: var(--dees-font-caption1-size, 11px);
|
|
328
|
-
overflow-wrap: anywhere;
|
|
329
|
-
}
|
|
330
|
-
|
|
331
|
-
.item .outcome {
|
|
332
|
-
flex: 0 1 auto;
|
|
333
|
-
}
|
|
334
|
-
|
|
335
|
-
.outcome dees-icon {
|
|
336
|
-
flex: 0 0 auto;
|
|
337
|
-
}
|
|
338
|
-
|
|
339
|
-
.outcome.tone-running dees-icon { color: var(--dees-color-accent-primary); }
|
|
340
|
-
.outcome.tone-success dees-icon { color: var(--dees-color-accent-success); }
|
|
341
|
-
.outcome.tone-warning dees-icon { color: var(--dees-color-accent-warning); }
|
|
342
|
-
.outcome.tone-error dees-icon { color: var(--dees-color-accent-error); }
|
|
343
|
-
.outcome.tone-error { color: var(--dees-color-text-primary); }
|
|
344
|
-
|
|
345
|
-
.srOnly { ${visuallyHidden} }
|
|
346
219
|
`,
|
|
347
220
|
];
|
|
348
221
|
|
|
@@ -373,7 +246,7 @@ export class DeesHarnessPermissionCard extends DeesElement {
|
|
|
373
246
|
<div class="actions">
|
|
374
247
|
${this.effectiveResponse
|
|
375
248
|
? request.outcome
|
|
376
|
-
?
|
|
249
|
+
? renderHarnessOutcome(request.outcome)
|
|
377
250
|
: html`<span class="answeredNote">${this.t(this.rememberable && this.effectiveRemember ? 'permission.answeredRemembered' : 'permission.answered', {
|
|
378
251
|
response: this.responseWords(this.effectiveResponse),
|
|
379
252
|
})}</span>`
|
|
@@ -414,62 +287,21 @@ export class DeesHarnessPermissionCard extends DeesElement {
|
|
|
414
287
|
private renderItems(itemsArg: readonly IHarnessPermissionItem[]): TemplateResult | string {
|
|
415
288
|
if (itemsArg.length === 0) return '';
|
|
416
289
|
const expanded = this.effectiveItemsExpanded;
|
|
417
|
-
const shown = expanded || itemsArg.length <= ITEMS_SHOWN ? itemsArg : itemsArg.slice(0, ITEMS_SHOWN);
|
|
418
|
-
const hidden = itemsArg.length - ITEMS_SHOWN;
|
|
419
290
|
return html`
|
|
420
291
|
<ul class="items" aria-label=${this.t('permission.items')}>
|
|
421
|
-
${
|
|
292
|
+
${harnessShownRecords(itemsArg, expanded).map((item) => html`
|
|
422
293
|
<li class="item">
|
|
423
294
|
<div class="itemHead">
|
|
424
295
|
${item.href
|
|
425
296
|
? html`<a class="itemLabel" href=${item.href} @click=${(event: MouseEvent) => this.openItem(event, item)}>${item.label}</a>`
|
|
426
297
|
: html`<span class="itemLabel">${item.label}</span>`}
|
|
427
|
-
${item.outcome ?
|
|
298
|
+
${item.outcome ? renderHarnessOutcome(item.outcome) : ''}
|
|
428
299
|
</div>
|
|
429
|
-
${item.changes?.length ? this.
|
|
300
|
+
${item.changes?.length ? renderHarnessChanges(this.t, item.changes) : ''}
|
|
430
301
|
</li>
|
|
431
302
|
`)}
|
|
432
303
|
</ul>
|
|
433
|
-
${
|
|
434
|
-
? html`
|
|
435
|
-
<button class="moreItems" type="button" aria-expanded=${expanded ? 'true' : 'false'} @click=${this.toggleItems}>
|
|
436
|
-
${expanded ? this.t('permission.fewerItems') : this.t('permission.moreItems', { count: hidden })}
|
|
437
|
-
</button>
|
|
438
|
-
`
|
|
439
|
-
: ''}
|
|
440
|
-
`;
|
|
441
|
-
}
|
|
442
|
-
|
|
443
|
-
/** What changes in a record: each field, its value before struck through, and after. */
|
|
444
|
-
private renderChanges(changesArg: readonly IHarnessPermissionChange[]): TemplateResult {
|
|
445
|
-
return html`
|
|
446
|
-
<dl class="changes">
|
|
447
|
-
${changesArg.map((change) => html`
|
|
448
|
-
<dt>${change.label}</dt>
|
|
449
|
-
<dd>
|
|
450
|
-
<span aria-hidden="true">${change.before !== undefined
|
|
451
|
-
? html`<span class="before">${change.before}</span><span class="arrow">→</span>`
|
|
452
|
-
: ''}<span class="after">${change.after}</span></span>
|
|
453
|
-
<span class="srOnly">${change.before !== undefined
|
|
454
|
-
? this.t('permission.change', { label: change.label, before: change.before, after: change.after })
|
|
455
|
-
: this.t('permission.changeNew', { label: change.label, after: change.after })}</span>
|
|
456
|
-
</dd>
|
|
457
|
-
`)}
|
|
458
|
-
</dl>
|
|
459
|
-
`;
|
|
460
|
-
}
|
|
461
|
-
|
|
462
|
-
private renderOutcome(outcomeArg: IHarnessPermissionOutcome): TemplateResult {
|
|
463
|
-
return html`
|
|
464
|
-
<span class="outcome tone-${outcomeArg.tone}" role="status">
|
|
465
|
-
<dees-icon
|
|
466
|
-
class=${outcomeArg.tone === 'running' ? 'harnessActivity' : ''}
|
|
467
|
-
icon=${OUTCOME_ICON[outcomeArg.tone]}
|
|
468
|
-
iconSize="13"
|
|
469
|
-
aria-hidden="true"
|
|
470
|
-
></dees-icon>
|
|
471
|
-
<span>${outcomeArg.text}</span>
|
|
472
|
-
</span>
|
|
304
|
+
${renderHarnessMoreRecords(this.t, itemsArg.length, expanded, this.toggleItems)}
|
|
473
305
|
`;
|
|
474
306
|
}
|
|
475
307
|
|
|
@@ -486,14 +318,12 @@ export class DeesHarnessPermissionCard extends DeesElement {
|
|
|
486
318
|
|
|
487
319
|
/** A record's link: the host may route it itself (it cancels the event); a plain or modified click otherwise follows it. */
|
|
488
320
|
private openItem(eventArg: MouseEvent, itemArg: IHarnessPermissionItem): void {
|
|
489
|
-
|
|
490
|
-
const proceed = this.dispatchEvent(new CustomEvent<IHarnessPermissionLinkDetail>('harness-permission-link', {
|
|
321
|
+
routeHarnessRecordLink(eventArg, () => this.dispatchEvent(new CustomEvent<IHarnessPermissionLinkDetail>('harness-permission-link', {
|
|
491
322
|
detail: { requestId: this.request.id, item: itemArg, request: this.request },
|
|
492
323
|
bubbles: true,
|
|
493
324
|
composed: true,
|
|
494
325
|
cancelable: true,
|
|
495
|
-
}));
|
|
496
|
-
if (!proceed) eventArg.preventDefault();
|
|
326
|
+
})));
|
|
497
327
|
}
|
|
498
328
|
|
|
499
329
|
private respond(response: THarnessPermissionResponse): void {
|
|
@@ -1,63 +1,269 @@
|
|
|
1
1
|
import { html } from '@design.estate/dees-element';
|
|
2
|
-
import { demoPage, demoOutput, showDemoResult } from '../../../demos/templates.js';
|
|
2
|
+
import { demoPage, demoSection, demoOutput, showDemoResult } from '../../../demos/templates.js';
|
|
3
|
+
import type { IHarnessQuestionRequest } from '../interfaces.js';
|
|
4
|
+
|
|
5
|
+
type TQuestionCard = HTMLElementTagNameMap['dees-harness-question-card'];
|
|
3
6
|
|
|
4
7
|
const logResponse = (event: CustomEvent) => {
|
|
5
|
-
const card = event.target as
|
|
6
|
-
card.request = {
|
|
8
|
+
const card = event.target as TQuestionCard;
|
|
9
|
+
card.request = {
|
|
10
|
+
...card.request,
|
|
11
|
+
response: event.detail.answers,
|
|
12
|
+
respondedAt: Date.now(),
|
|
13
|
+
declinedItemIds: event.detail.declinedItemIds,
|
|
14
|
+
};
|
|
7
15
|
showDemoResult(event.currentTarget as Element, event.detail);
|
|
8
16
|
};
|
|
9
17
|
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
18
|
+
/** A confirmed proposal is carried out as a host would: under way first, then done. */
|
|
19
|
+
const runProposal = (event: CustomEvent) => {
|
|
20
|
+
logResponse(event);
|
|
21
|
+
const card = event.target as TQuestionCard;
|
|
22
|
+
if (event.detail.answers[0] !== 'confirm') return;
|
|
23
|
+
card.request = { ...card.request, outcome: { tone: 'running', text: 'Making the changes…' } };
|
|
24
|
+
setTimeout(() => {
|
|
25
|
+
card.request = { ...card.request, outcome: { tone: 'success', text: 'Changes made' } };
|
|
26
|
+
}, 1500);
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
/** The host routes a proposed change's link itself, so the page stays. */
|
|
30
|
+
const routeLink = (event: CustomEvent) => {
|
|
31
|
+
event.preventDefault();
|
|
32
|
+
showDemoResult(event.currentTarget as Element, { link: event.detail.item.label, requestId: event.detail.requestId });
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
const invoices = (countArg: number) => Array.from({ length: countArg }, (_, index) => {
|
|
36
|
+
const number = `R-2026-01${String(40 + index).padStart(2, '0')}`;
|
|
37
|
+
return {
|
|
38
|
+
id: `invoice-${number}`,
|
|
39
|
+
summary: 'Books it to 8400 Revenue',
|
|
40
|
+
label: `Invoice ${number}`,
|
|
41
|
+
href: '#',
|
|
42
|
+
changes: [{ label: 'Status', before: 'Draft', after: 'Booked' }],
|
|
43
|
+
};
|
|
44
|
+
});
|
|
45
|
+
|
|
46
|
+
const proposals: IHarnessQuestionRequest[] = [
|
|
47
|
+
{
|
|
48
|
+
id: 'p-single',
|
|
49
|
+
kind: 'proposal',
|
|
50
|
+
question: 'Create this customer?',
|
|
51
|
+
items: [{
|
|
52
|
+
id: 'customer',
|
|
53
|
+
summary: 'Creates the customer, ready for invoices',
|
|
54
|
+
changes: [{ label: 'Name', after: 'Lindqvist Design AB' }, { label: 'Country', after: 'Sweden' }],
|
|
55
|
+
}],
|
|
56
|
+
},
|
|
57
|
+
{
|
|
58
|
+
id: 'p-warning',
|
|
59
|
+
kind: 'proposal',
|
|
60
|
+
severity: 'warning',
|
|
61
|
+
question: 'Archive the project Q3 Campaign?',
|
|
62
|
+
items: [{ id: 'project', summary: 'Archives the project and its 14 tasks; it can be restored for 30 days', label: 'Q3 Campaign', href: '#' }],
|
|
63
|
+
},
|
|
64
|
+
{
|
|
65
|
+
id: 'p-danger',
|
|
66
|
+
kind: 'proposal',
|
|
67
|
+
severity: 'danger',
|
|
68
|
+
question: 'Change the account every future payout goes to?',
|
|
69
|
+
confirmLabel: 'Change account',
|
|
70
|
+
items: [{
|
|
71
|
+
id: 'payout-account',
|
|
72
|
+
summary: 'Sends every future payout to the new account',
|
|
73
|
+
label: 'Payout settings',
|
|
74
|
+
href: '#',
|
|
75
|
+
changes: [
|
|
76
|
+
{ label: 'IBAN', before: 'DE89 3704 0044 0532 0130 00', after: 'DE02 1203 0000 0000 2020 51' },
|
|
77
|
+
{ label: 'Account holder', before: 'Acme GmbH', after: 'Acme Holding GmbH' },
|
|
78
|
+
],
|
|
79
|
+
}],
|
|
80
|
+
},
|
|
81
|
+
{
|
|
82
|
+
id: 'p-mixed',
|
|
83
|
+
kind: 'proposal',
|
|
84
|
+
question: 'Tidy up the customer Nordwind GmbH?',
|
|
85
|
+
items: [
|
|
86
|
+
{
|
|
87
|
+
id: 'contact',
|
|
88
|
+
summary: 'Merges the duplicate contact into the customer',
|
|
89
|
+
label: 'Contact Nordwind GmbH (2)',
|
|
90
|
+
href: '#',
|
|
91
|
+
},
|
|
92
|
+
{
|
|
93
|
+
id: 'terms',
|
|
94
|
+
severity: 'warning',
|
|
95
|
+
summary: 'Shortens the payment terms; open invoices keep theirs',
|
|
96
|
+
label: 'Customer Nordwind GmbH',
|
|
97
|
+
href: '#',
|
|
98
|
+
changes: [{ label: 'Payment terms', before: '30 days', after: '14 days' }],
|
|
99
|
+
},
|
|
100
|
+
{
|
|
101
|
+
id: 'draft',
|
|
102
|
+
severity: 'danger',
|
|
103
|
+
summary: 'Deletes the unsent draft invoice',
|
|
104
|
+
label: 'Invoice R-2026-0098',
|
|
105
|
+
href: '#',
|
|
106
|
+
},
|
|
107
|
+
],
|
|
108
|
+
},
|
|
109
|
+
{
|
|
110
|
+
id: 'p-several',
|
|
111
|
+
kind: 'proposal',
|
|
112
|
+
question: 'Book these six invoices?',
|
|
113
|
+
itemsDeclinable: true,
|
|
114
|
+
items: invoices(6),
|
|
115
|
+
},
|
|
116
|
+
];
|
|
117
|
+
|
|
118
|
+
const decided: IHarnessQuestionRequest[] = [
|
|
119
|
+
{
|
|
120
|
+
id: 'p-running',
|
|
121
|
+
kind: 'proposal',
|
|
122
|
+
question: 'Send a payment reminder to three customers?',
|
|
123
|
+
items: [{ id: 'reminders', summary: 'Sends the reminder by e-mail to Lindqvist Design AB, Nordwind GmbH and Kaya Studio' }],
|
|
124
|
+
response: ['confirm'],
|
|
125
|
+
outcome: { tone: 'running', text: 'Sending 3 reminders…' },
|
|
126
|
+
},
|
|
127
|
+
{
|
|
128
|
+
id: 'p-confirmed',
|
|
129
|
+
kind: 'proposal',
|
|
130
|
+
question: 'Book these three invoices?',
|
|
131
|
+
itemsDeclinable: true,
|
|
132
|
+
items: invoices(3).map((item) => item.id === 'invoice-R-2026-0141'
|
|
133
|
+
? item
|
|
134
|
+
: { ...item, outcome: { tone: 'success' as const, text: 'Booked' } }),
|
|
135
|
+
response: ['confirm'],
|
|
136
|
+
declinedItemIds: ['invoice-R-2026-0141'],
|
|
137
|
+
outcome: { tone: 'success', text: '2 invoices booked, 1 left out' },
|
|
138
|
+
},
|
|
139
|
+
{
|
|
140
|
+
id: 'p-credential',
|
|
141
|
+
kind: 'proposal',
|
|
142
|
+
severity: 'warning',
|
|
143
|
+
question: 'Issue an API key for the accounting export?',
|
|
144
|
+
items: [{
|
|
145
|
+
id: 'api-key',
|
|
146
|
+
summary: 'Issues a key that reads invoices and bookings, valid for a year',
|
|
147
|
+
label: 'Accounting export',
|
|
148
|
+
href: '#',
|
|
149
|
+
outcome: { tone: 'success', text: 'Issued' },
|
|
150
|
+
credential: { label: 'API key', value: 'demo_key_7Hq2-x9Lw-4Rt8-Kd3m-Vb6n', note: 'Shown once: store it now. Only you can see it; the agent is not shown it.' },
|
|
151
|
+
}],
|
|
152
|
+
response: ['confirm'],
|
|
153
|
+
outcome: { tone: 'success', text: 'API key issued' },
|
|
154
|
+
},
|
|
155
|
+
{
|
|
156
|
+
id: 'p-declined',
|
|
157
|
+
kind: 'proposal',
|
|
158
|
+
severity: 'danger',
|
|
159
|
+
question: 'Delete the draft offer A-2026-0031?',
|
|
160
|
+
items: [{ id: 'offer', summary: 'Deletes the draft and its 3 attachments', label: 'Offer A-2026-0031', href: '#' }],
|
|
161
|
+
response: ['decline'],
|
|
162
|
+
},
|
|
163
|
+
{
|
|
164
|
+
id: 'p-expired',
|
|
165
|
+
kind: 'proposal',
|
|
166
|
+
severity: 'warning',
|
|
167
|
+
question: 'Pay the supplier invoice E-4471 today?',
|
|
168
|
+
items: [{ id: 'payment', summary: 'Transfers 2,480.00 € to Nordwind GmbH', label: 'Invoice E-4471', href: '#' }],
|
|
169
|
+
state: 'expired',
|
|
170
|
+
outcome: { tone: 'neutral', text: 'The conversation ended before an answer.' },
|
|
171
|
+
},
|
|
172
|
+
{
|
|
173
|
+
id: 'p-failed',
|
|
174
|
+
kind: 'proposal',
|
|
175
|
+
question: 'Rename the account 1200?',
|
|
176
|
+
items: [{
|
|
177
|
+
id: 'account',
|
|
178
|
+
summary: 'Renames the account in the chart of accounts',
|
|
179
|
+
label: 'Account 1200',
|
|
180
|
+
href: '#',
|
|
181
|
+
changes: [{ label: 'Name', before: 'Bank', after: 'Bank — Sparkasse' }],
|
|
182
|
+
outcome: { tone: 'error', text: 'Not changed' },
|
|
183
|
+
}],
|
|
184
|
+
response: ['confirm'],
|
|
185
|
+
state: 'failed',
|
|
186
|
+
outcome: { tone: 'error', text: 'The ledger refused the change: account 1200 is locked for the closed year 2025.' },
|
|
187
|
+
},
|
|
188
|
+
];
|
|
189
|
+
|
|
190
|
+
export const demoFunc = () => demoPage('Questions', 'Questions the agent asks, and changes it proposes that wait for a confirmation.', html`
|
|
191
|
+
${demoSection('Questions', 'Single choices, multiple choices and written answers.', html`
|
|
192
|
+
<div class="questionDemo dees-demo-stack" @harness-question-response=${logResponse}>
|
|
193
|
+
<dees-harness-question-card
|
|
194
|
+
.request=${{
|
|
195
|
+
id: 'q1',
|
|
196
|
+
question: 'Which database should the new service use?',
|
|
197
|
+
createdAt: Date.now(),
|
|
198
|
+
options: [
|
|
199
|
+
{ label: 'PostgreSQL', description: 'Relational, already in the stack' },
|
|
200
|
+
{ label: 'MongoDB', description: 'Document store, flexible schema' },
|
|
201
|
+
{ label: 'SQLite', description: 'Embedded, zero ops' },
|
|
202
|
+
],
|
|
203
|
+
}}
|
|
204
|
+
></dees-harness-question-card>
|
|
205
|
+
<dees-harness-question-card
|
|
206
|
+
.request=${{
|
|
207
|
+
id: 'q2',
|
|
208
|
+
question: 'Which environments should the rollout include?',
|
|
209
|
+
multiSelect: true,
|
|
210
|
+
allowCustom: false,
|
|
211
|
+
options: [
|
|
212
|
+
{ label: 'staging' },
|
|
213
|
+
{ label: 'production-eu' },
|
|
214
|
+
{ label: 'production-us' },
|
|
215
|
+
],
|
|
216
|
+
}}
|
|
217
|
+
></dees-harness-question-card>
|
|
218
|
+
<dees-harness-question-card
|
|
219
|
+
.request=${{
|
|
220
|
+
id: 'q-warning',
|
|
221
|
+
severity: 'warning',
|
|
222
|
+
question: 'The import brings its own tax settings. Replace the current ones?',
|
|
223
|
+
allowCustom: false,
|
|
224
|
+
options: [
|
|
225
|
+
{ label: 'Replace them', description: 'The imported rates apply from the next booking on' },
|
|
226
|
+
{ label: 'Keep the current ones' },
|
|
227
|
+
],
|
|
228
|
+
}}
|
|
229
|
+
></dees-harness-question-card>
|
|
230
|
+
<dees-harness-question-card
|
|
231
|
+
.request=${{
|
|
232
|
+
id: 'q3',
|
|
233
|
+
question: 'Anything else I should know before migrating?',
|
|
234
|
+
options: [],
|
|
235
|
+
}}
|
|
236
|
+
></dees-harness-question-card>
|
|
237
|
+
<dees-harness-question-card
|
|
238
|
+
busy
|
|
239
|
+
.request=${{
|
|
240
|
+
id: 'q-busy',
|
|
241
|
+
question: 'Waiting for the runtime — which region?',
|
|
242
|
+
options: [{ label: 'eu-central' }, { label: 'us-east' }],
|
|
243
|
+
}}
|
|
244
|
+
></dees-harness-question-card>
|
|
245
|
+
<dees-harness-question-card
|
|
246
|
+
.request=${{
|
|
247
|
+
id: 'q4',
|
|
248
|
+
question: 'Which framework for the admin UI?',
|
|
249
|
+
options: [{ label: 'Lit' }, { label: 'React' }],
|
|
250
|
+
response: ['Lit'],
|
|
251
|
+
respondedAt: Date.now() - 60_000,
|
|
252
|
+
}}
|
|
253
|
+
></dees-harness-question-card>
|
|
254
|
+
</div>
|
|
255
|
+
${demoOutput()}
|
|
256
|
+
`)}
|
|
257
|
+
${demoSection('Proposals', 'A change the agent makes once confirmed: a single one, one that asks for care, one that cannot be taken back, several collected into one decision (the most serious change sets the card\'s colour), and several the reader may leave single ones out of.', html`
|
|
258
|
+
<div class="dees-demo-stack" @harness-question-response=${runProposal} @harness-question-link=${routeLink}>
|
|
259
|
+
${proposals.map((request) => html`<dees-harness-question-card .request=${request}></dees-harness-question-card>`)}
|
|
260
|
+
</div>
|
|
261
|
+
${demoOutput()}
|
|
262
|
+
`)}
|
|
263
|
+
${demoSection('Decided proposals', 'Read-only once decided: confirmed and under way, confirmed with a change left out, confirmed with a secret only the reader sees, declined, expired, failed.', html`
|
|
264
|
+
<div class="dees-demo-stack" @harness-question-link=${routeLink}>
|
|
265
|
+
${decided.map((request) => html`<dees-harness-question-card .request=${request}></dees-harness-question-card>`)}
|
|
266
|
+
</div>
|
|
61
267
|
${demoOutput()}
|
|
62
|
-
|
|
268
|
+
`)}
|
|
63
269
|
`);
|