@conduction/nextcloud-vue 2.139.0 → 2.141.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/esm/components/CnAppRoot/CnAppRoot.vue2.js +9 -2
- package/dist/esm/components/CnAppRoot/CnAppRoot.vue2.js.map +1 -1
- package/dist/esm/components/CnAppRoot/CnAppRoot.vue3.js.map +1 -1
- package/dist/esm/components/CnAssignDialog/CnAssignDialog.vue.js +1 -1
- package/dist/esm/components/CnAssignDialog/CnAssignDialog.vue2.js +10 -2
- package/dist/esm/components/CnAssignDialog/CnAssignDialog.vue2.js.map +1 -1
- package/dist/esm/components/CnAssignDialog/CnAssignDialog.vue3.js.map +1 -1
- package/dist/esm/components/CnCellRenderer/CnCellRenderer.vue.js +1 -1
- package/dist/esm/components/CnCellRenderer/CnCellRenderer.vue2.js +28 -4
- package/dist/esm/components/CnCellRenderer/CnCellRenderer.vue2.js.map +1 -1
- package/dist/esm/components/CnCellRenderer/CnCellRenderer.vue3.js +2 -2
- package/dist/esm/components/CnCellRenderer/CnCellRenderer.vue3.js.map +1 -1
- package/dist/esm/components/CnChartWidget/CnChartWidget.vue.js +1 -1
- package/dist/esm/components/CnChartWidget/CnChartWidget.vue2.js +64 -1
- package/dist/esm/components/CnChartWidget/CnChartWidget.vue2.js.map +1 -1
- package/dist/esm/components/CnChartWidget/CnChartWidget.vue3.js +76 -37
- package/dist/esm/components/CnChartWidget/CnChartWidget.vue3.js.map +1 -1
- package/dist/esm/components/CnConversationThread/CnConversationWidget.vue.js +1 -1
- package/dist/esm/components/CnConversationThread/CnConversationWidget.vue2.js +106 -0
- package/dist/esm/components/CnConversationThread/CnConversationWidget.vue2.js.map +1 -1
- package/dist/esm/components/CnConversationThread/CnConversationWidget.vue3.js +30 -7
- package/dist/esm/components/CnConversationThread/CnConversationWidget.vue3.js.map +1 -1
- package/dist/esm/components/CnDashboardPage/CnDashboardPage.vue.js +1 -1
- package/dist/esm/components/CnDashboardPage/CnDashboardPage.vue2.js +1 -0
- package/dist/esm/components/CnDashboardPage/CnDashboardPage.vue2.js.map +1 -1
- package/dist/esm/components/CnDashboardPage/CnDashboardPage.vue3.js.map +1 -1
- package/dist/esm/components/CnDataTable/CnDataTable.vue2.js +5 -3
- package/dist/esm/components/CnDataTable/CnDataTable.vue2.js.map +1 -1
- package/dist/esm/components/CnDataTable/CnDataTable.vue3.js +1 -0
- package/dist/esm/components/CnDataTable/CnDataTable.vue3.js.map +1 -1
- package/dist/esm/components/CnFactsWidget/CnFactsWidget.vue.js +1 -1
- package/dist/esm/components/CnFactsWidget/CnFactsWidget.vue2.js +59 -3
- package/dist/esm/components/CnFactsWidget/CnFactsWidget.vue2.js.map +1 -1
- package/dist/esm/components/CnFactsWidget/CnFactsWidget.vue3.js +44 -34
- package/dist/esm/components/CnFactsWidget/CnFactsWidget.vue3.js.map +1 -1
- package/dist/esm/components/CnFilesBrowser/CnFilesBrowser.vue.js +1 -1
- package/dist/esm/components/CnFilesBrowser/CnFilesBrowser.vue2.js +28 -1
- package/dist/esm/components/CnFilesBrowser/CnFilesBrowser.vue2.js.map +1 -1
- package/dist/esm/components/CnFilesBrowser/CnFilesBrowser.vue3.js.map +1 -1
- package/dist/esm/components/CnFilesBrowser/filesBrowser.js +7 -1
- package/dist/esm/components/CnFilesBrowser/filesBrowser.js.map +1 -1
- package/dist/esm/components/CnFilesBrowser/filesBrowserColumns.js +5 -0
- package/dist/esm/components/CnFilesBrowser/filesBrowserColumns.js.map +1 -1
- package/dist/esm/components/CnIndexPage/CnIndexPage.vue2.js +30 -2
- package/dist/esm/components/CnIndexPage/CnIndexPage.vue2.js.map +1 -1
- package/dist/esm/components/CnIndexPage/CnIndexPage.vue3.js.map +1 -1
- package/dist/esm/components/CnIndexSidebar/CnIndexSidebar.vue2.js +65 -1
- package/dist/esm/components/CnIndexSidebar/CnIndexSidebar.vue2.js.map +1 -1
- package/dist/esm/components/CnIndexSidebar/CnIndexSidebar.vue3.js +120 -69
- package/dist/esm/components/CnIndexSidebar/CnIndexSidebar.vue3.js.map +1 -1
- package/dist/esm/components/CnMapWidget/CnMapWidget.vue.js +1 -1
- package/dist/esm/components/CnMapWidget/CnMapWidget.vue2.js +47 -9
- package/dist/esm/components/CnMapWidget/CnMapWidget.vue2.js.map +1 -1
- package/dist/esm/components/CnMapWidget/CnMapWidget.vue3.js.map +1 -1
- package/dist/esm/components/CnObjectDataWidget/CnObjectDataWidget.vue.js +1 -1
- package/dist/esm/components/CnObjectDataWidget/CnObjectDataWidget.vue2.js +28 -3
- package/dist/esm/components/CnObjectDataWidget/CnObjectDataWidget.vue2.js.map +1 -1
- package/dist/esm/components/CnObjectDataWidget/CnObjectDataWidget.vue3.js.map +1 -1
- package/dist/esm/components/CnObjectListWidget/CnObjectListWidget.vue.js +1 -1
- package/dist/esm/components/CnObjectListWidget/CnObjectListWidget.vue2.js +3 -3
- package/dist/esm/components/CnObjectListWidget/CnObjectListWidget.vue2.js.map +1 -1
- package/dist/esm/components/CnObjectListWidget/CnObjectListWidget.vue3.js.map +1 -1
- package/dist/esm/components/CnRecordListWidget/CnRecordListWidget.vue.js +1 -1
- package/dist/esm/components/CnRecordListWidget/CnRecordListWidget.vue2.js +2 -0
- package/dist/esm/components/CnRecordListWidget/CnRecordListWidget.vue2.js.map +1 -1
- package/dist/esm/components/CnRecordListWidget/CnRecordListWidget.vue3.js +1 -1
- package/dist/esm/components/CnRecordListWidget/CnRecordListWidget.vue3.js.map +1 -1
- package/dist/esm/components/CnRecordListWidget/CnRecordNoteRows.vue.js +1 -1
- package/dist/esm/components/CnRecordListWidget/CnRecordNoteRows.vue2.js +20 -0
- package/dist/esm/components/CnRecordListWidget/CnRecordNoteRows.vue2.js.map +1 -1
- package/dist/esm/components/CnRecordListWidget/CnRecordNoteRows.vue3.js +34 -26
- package/dist/esm/components/CnRecordListWidget/CnRecordNoteRows.vue3.js.map +1 -1
- package/dist/esm/components/CnStackedBarWidget/CnStackedBarWidget.vue.js +1 -1
- package/dist/esm/components/CnStackedBarWidget/CnStackedBarWidget.vue2.js +12 -1
- package/dist/esm/components/CnStackedBarWidget/CnStackedBarWidget.vue2.js.map +1 -1
- package/dist/esm/components/CnStackedBarWidget/CnStackedBarWidget.vue3.js +1 -1
- package/dist/esm/components/CnStackedBarWidget/CnStackedBarWidget.vue3.js.map +1 -1
- package/dist/esm/components/CnTransitionInputFields/CnTransitionInputFields.vue.js +1 -1
- package/dist/esm/components/CnTransitionInputFields/CnTransitionInputFields.vue2.js +23 -1
- package/dist/esm/components/CnTransitionInputFields/CnTransitionInputFields.vue2.js.map +1 -1
- package/dist/esm/components/CnTransitionInputFields/CnTransitionInputFields.vue3.js +43 -13
- package/dist/esm/components/CnTransitionInputFields/CnTransitionInputFields.vue3.js.map +1 -1
- package/dist/esm/composables/indexSources.js +5 -2
- package/dist/esm/composables/indexSources.js.map +1 -1
- package/dist/esm/composables/useTaskInboxStore.js +4 -3
- package/dist/esm/composables/useTaskInboxStore.js.map +1 -1
- package/dist/esm/l10n/en.json.js +3 -1
- package/dist/esm/l10n/en.json.js.map +1 -1
- package/dist/esm/l10n/nl.json.js +6 -1
- package/dist/esm/l10n/nl.json.js.map +1 -1
- package/dist/esm/library-style.js +1 -1
- package/dist/esm/nextcloud-vue.css +961 -605
- package/dist/esm/utils/builtInFormatters.js +23 -1
- package/dist/esm/utils/builtInFormatters.js.map +1 -1
- package/dist/esm/utils/fillTemplate.js +7 -1
- package/dist/esm/utils/fillTemplate.js.map +1 -1
- package/dist/esm/utils/groupSublines.js +120 -0
- package/dist/esm/utils/groupSublines.js.map +1 -0
- package/dist/esm/utils/myTeam.js +24 -4
- package/dist/esm/utils/myTeam.js.map +1 -1
- package/dist/esm/utils/resolveFilterTokens.js +5 -4
- package/dist/esm/utils/resolveFilterTokens.js.map +1 -1
- package/dist/esm/utils/transitionInputs.js +43 -2
- package/dist/esm/utils/transitionInputs.js.map +1 -1
- package/dist/nextcloud-vue.cjs.js +1731 -846
- package/dist/nextcloud-vue.cjs.js.map +2 -2
- package/dist/nextcloud-vue.css +961 -605
- package/l10n/en.json +3 -1
- package/l10n/nl.json +6 -1
- package/package.json +1 -1
- package/src/components/CnAppRoot/CnAppRoot.vue +9 -2
- package/src/components/CnAssignDialog/CnAssignDialog.vue +10 -2
- package/src/components/CnCellRenderer/CnCellRenderer.vue +30 -6
- package/src/components/CnChartWidget/CnChartWidget.md +2 -0
- package/src/components/CnChartWidget/CnChartWidget.vue +121 -5
- package/src/components/CnConversationThread/CnConversationWidget.vue +126 -1
- package/src/components/CnDashboardPage/CnDashboardPage.vue +1 -0
- package/src/components/CnDataTable/CnDataTable.vue +6 -3
- package/src/components/CnFactsWidget/CnFactsWidget.vue +72 -5
- package/src/components/CnFilesBrowser/CnFilesBrowser.vue +28 -1
- package/src/components/CnFilesBrowser/filesBrowser.js +7 -1
- package/src/components/CnFilesBrowser/filesBrowserColumns.js +5 -0
- package/src/components/CnIndexPage/CnIndexPage.vue +30 -2
- package/src/components/CnIndexSidebar/CnIndexSidebar.vue +101 -3
- package/src/components/CnMapWidget/CnMapWidget.vue +47 -9
- package/src/components/CnObjectDataWidget/CnObjectDataWidget.vue +28 -3
- package/src/components/CnObjectListWidget/CnObjectListWidget.vue +3 -3
- package/src/components/CnRecordListWidget/CnRecordListWidget.vue +20 -1
- package/src/components/CnRecordListWidget/CnRecordNoteRows.vue +43 -9
- package/src/components/CnStackedBarWidget/CnStackedBarWidget.vue +68 -2
- package/src/components/CnTransitionInputFields/CnTransitionInputFields.vue +43 -1
- package/src/composables/indexSources.js +5 -2
- package/src/composables/useTaskInboxStore.js +4 -3
- package/src/css/dialog.css +13 -1
- package/src/css/look-board-detail.css +12 -9
- package/src/css/look-board-index.css +90 -7
- package/src/css/look-board.css +102 -2
- package/src/css/table.css +25 -0
- package/src/utils/builtInFormatters.js +22 -0
- package/src/utils/fillTemplate.js +7 -1
- package/src/utils/groupSublines.js +125 -0
- package/src/utils/myTeam.js +24 -4
- package/src/utils/resolveFilterTokens.js +5 -4
- package/src/utils/transitionInputs.js +42 -1
|
@@ -2,7 +2,7 @@ import script from './CnConversationWidget.vue2.js';
|
|
|
2
2
|
import { render } from './CnConversationWidget.vue3.js';
|
|
3
3
|
|
|
4
4
|
script.render = render;
|
|
5
|
-
script.__scopeId = "data-v-
|
|
5
|
+
script.__scopeId = "data-v-63984d97";
|
|
6
6
|
const __sfc_main = script;
|
|
7
7
|
|
|
8
8
|
export { __sfc_main as default };
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import { subscribe, unsubscribe } from '@nextcloud/event-bus';
|
|
2
|
+
import { translate } from '@nextcloud/l10n';
|
|
2
3
|
import { NcButton, NcCheckboxRadioSwitch } from '@nextcloud/vue';
|
|
3
4
|
import __sfc_main$1 from '../CnIcon/CnIcon.vue.js';
|
|
4
5
|
import __sfc_main$2 from '../CnTemplateSelect/CnTemplateSelect.vue.js';
|
|
5
6
|
import __sfc_main from './CnConversationThread.vue.js';
|
|
6
7
|
import { dispatchAction } from '../../utils/actionsDispatcher.js';
|
|
8
|
+
import { formatTimeOfDay } from '../../utils/boardDate.js';
|
|
7
9
|
import { fetchReferenceObjects } from '../../utils/boardReferenceColumns.js';
|
|
8
10
|
import { readPath } from '../../utils/readPath.js';
|
|
9
11
|
import { resolveDeepTokens, hasUnresolvedDeepTokens } from '../../utils/resolveFilterTokens.js';
|
|
@@ -106,6 +108,10 @@ var script = {
|
|
|
106
108
|
acting: '',
|
|
107
109
|
/** The threads `statusBadge` reads. */
|
|
108
110
|
badgeRows: [],
|
|
111
|
+
/** What the last draft save said: when it was saved, or that it failed. */
|
|
112
|
+
draftStatus: '',
|
|
113
|
+
/** Whether a draft is being saved. */
|
|
114
|
+
savingDraft: false,
|
|
109
115
|
}
|
|
110
116
|
},
|
|
111
117
|
|
|
@@ -243,6 +249,21 @@ var script = {
|
|
|
243
249
|
* @return {string} The URL, or '' when the content names none.
|
|
244
250
|
* @spec openspec/changes/detail-action-model-and-case-surfaces/specs/detail-action-model/spec.md#requirement-conversation-thread
|
|
245
251
|
*/
|
|
252
|
+
/**
|
|
253
|
+
* The reply draft's url (`content.draft.url`, `@objectId` filled in),
|
|
254
|
+
* or '' without one.
|
|
255
|
+
*
|
|
256
|
+
* @return {string}
|
|
257
|
+
* @spec openspec/changes/conversation-reply-draft/specs/conversation-reply-draft/spec.md#requirement-a-reply-can-be-saved-as-a-draft-and-comes-back
|
|
258
|
+
*/
|
|
259
|
+
draftUrl() {
|
|
260
|
+
const url = this.content.draft && this.content.draft.url;
|
|
261
|
+
if (typeof url !== 'string' || url === '') {
|
|
262
|
+
return ''
|
|
263
|
+
}
|
|
264
|
+
return url.replace(/@objectId/g, encodeURIComponent(String(this.objectId ?? '')))
|
|
265
|
+
},
|
|
266
|
+
|
|
246
267
|
endpoint() {
|
|
247
268
|
const url = this.content.endpoint;
|
|
248
269
|
if (typeof url !== 'string' || url === '') {
|
|
@@ -268,19 +289,101 @@ var script = {
|
|
|
268
289
|
handler() {
|
|
269
290
|
this.loadSource();
|
|
270
291
|
this.loadBadge();
|
|
292
|
+
this.loadDraft();
|
|
271
293
|
},
|
|
272
294
|
},
|
|
273
295
|
},
|
|
274
296
|
|
|
275
297
|
mounted() {
|
|
276
298
|
subscribe('cn:page:refresh', this.onPageRefresh);
|
|
299
|
+
subscribe('cn:conversation:reply-sent', this.onReplySentElsewhere);
|
|
277
300
|
},
|
|
278
301
|
|
|
279
302
|
beforeUnmount() {
|
|
280
303
|
unsubscribe('cn:page:refresh', this.onPageRefresh);
|
|
304
|
+
unsubscribe('cn:conversation:reply-sent', this.onReplySentElsewhere);
|
|
281
305
|
},
|
|
282
306
|
|
|
283
307
|
methods: {
|
|
308
|
+
t: translate,
|
|
309
|
+
|
|
310
|
+
/**
|
|
311
|
+
* Read the saved reply draft into the reply box.
|
|
312
|
+
*
|
|
313
|
+
* @return {Promise<void>}
|
|
314
|
+
* @spec openspec/changes/conversation-reply-draft/specs/conversation-reply-draft/spec.md#requirement-a-reply-can-be-saved-as-a-draft-and-comes-back
|
|
315
|
+
*/
|
|
316
|
+
async loadDraft() {
|
|
317
|
+
if (!this.draftUrl) {
|
|
318
|
+
return
|
|
319
|
+
}
|
|
320
|
+
try {
|
|
321
|
+
const { default: axios } = await import('@nextcloud/axios');
|
|
322
|
+
const { generateUrl } = await import('@nextcloud/router');
|
|
323
|
+
const { data } = await axios.get(generateUrl(this.draftUrl));
|
|
324
|
+
const text = data && typeof data.text === 'string' ? data.text : '';
|
|
325
|
+
if (text !== '' && this.$refs.thread) {
|
|
326
|
+
this.$refs.thread.setDraft(text);
|
|
327
|
+
}
|
|
328
|
+
} catch {
|
|
329
|
+
// No saved draft to read leaves the box empty.
|
|
330
|
+
}
|
|
331
|
+
},
|
|
332
|
+
|
|
333
|
+
/**
|
|
334
|
+
* Store the reply box as the draft and say when it was saved.
|
|
335
|
+
*
|
|
336
|
+
* @param {string} text The reply box's text.
|
|
337
|
+
* @return {Promise<void>}
|
|
338
|
+
*/
|
|
339
|
+
async saveDraft(text) {
|
|
340
|
+
this.savingDraft = true;
|
|
341
|
+
try {
|
|
342
|
+
await this.storeDraft(String(text ?? ''));
|
|
343
|
+
this.draftStatus = translate('nextcloud-vue', 'Draft saved at {time}', { time: formatTimeOfDay(new Date()) });
|
|
344
|
+
} catch {
|
|
345
|
+
this.draftStatus = translate('nextcloud-vue', 'The draft could not be saved');
|
|
346
|
+
} finally {
|
|
347
|
+
this.savingDraft = false;
|
|
348
|
+
}
|
|
349
|
+
},
|
|
350
|
+
|
|
351
|
+
/**
|
|
352
|
+
* A reply on this record went out through a dialog or another surface
|
|
353
|
+
* (`cn:conversation:reply-sent` with `{ objectId }`): the saved draft
|
|
354
|
+
* and the reply box are cleared.
|
|
355
|
+
*
|
|
356
|
+
* @param {{objectId?: string}} payload The record the reply was on.
|
|
357
|
+
* @return {Promise<void>}
|
|
358
|
+
* @spec openspec/changes/conversation-reply-draft/specs/conversation-reply-draft/spec.md#requirement-a-reply-can-be-saved-as-a-draft-and-comes-back
|
|
359
|
+
*/
|
|
360
|
+
async onReplySentElsewhere(payload) {
|
|
361
|
+
if (!this.draftUrl || String(payload?.objectId ?? '') !== String(this.objectId ?? '')) {
|
|
362
|
+
return
|
|
363
|
+
}
|
|
364
|
+
if (this.$refs.thread) {
|
|
365
|
+
this.$refs.thread.setDraft('');
|
|
366
|
+
}
|
|
367
|
+
this.draftStatus = '';
|
|
368
|
+
try {
|
|
369
|
+
await this.storeDraft('');
|
|
370
|
+
} catch {
|
|
371
|
+
// The next save overwrites a draft that could not be cleared.
|
|
372
|
+
}
|
|
373
|
+
},
|
|
374
|
+
|
|
375
|
+
/**
|
|
376
|
+
* PUT the draft text.
|
|
377
|
+
*
|
|
378
|
+
* @param {string} text The text; '' clears the draft.
|
|
379
|
+
* @return {Promise<void>}
|
|
380
|
+
*/
|
|
381
|
+
async storeDraft(text) {
|
|
382
|
+
const { default: axios } = await import('@nextcloud/axios');
|
|
383
|
+
const { generateUrl } = await import('@nextcloud/router');
|
|
384
|
+
await axios.put(generateUrl(this.draftUrl), { text });
|
|
385
|
+
},
|
|
386
|
+
|
|
284
387
|
/**
|
|
285
388
|
* Read the messages again when the page refreshes (a dialog sent one).
|
|
286
389
|
*
|
|
@@ -619,6 +722,9 @@ var script = {
|
|
|
619
722
|
if (typeof text !== 'string' || text === '') {
|
|
620
723
|
return
|
|
621
724
|
}
|
|
725
|
+
if (this.draftUrl) {
|
|
726
|
+
this.storeDraft('');
|
|
727
|
+
}
|
|
622
728
|
this.sentHere.push({
|
|
623
729
|
id: `sent-${this.sentHere.length}`,
|
|
624
730
|
time: new Date().toISOString(),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CnConversationWidget.vue2.js","sources":["../../../../src/components/CnConversationThread/CnConversationWidget.vue"],"sourcesContent":["<!--\n - SPDX-FileCopyrightText: 2026 Conduction B.V.\n - SPDX-License-Identifier: EUPL-1.2\n-->\n\n<template>\n\t<div class=\"cn-case-widget-card\">\n\t\t<CnConversationThread\n\t\t\t:messages=\"messages\"\n\t\t\t:title=\"tr(content.title || '')\"\n\t\t\t:subtitle=\"tr(content.subtitle || '')\"\n\t\t\t:showDirection=\"content.showDirection === true\"\n\t\t\t:allowReply=\"content.allowReply !== false\"\n\t\t\t:replyLabel=\"content.replyLabel ? tr(content.replyLabel) : undefined\"\n\t\t\t:placeholder=\"tr(content.placeholder || '')\"\n\t\t\t:sendLabel=\"content.sendLabel ? tr(content.sendLabel) : undefined\"\n\t\t\t:replyHint=\"tr(content.replyHint || '')\"\n\t\t\t:replyOption=\"replyOption\"\n\t\t\t:usLabel=\"content.usLabel ? tr(content.usLabel) : undefined\"\n\t\t\t:endpoint=\"replyAction ? '' : endpoint\"\n\t\t\t:loading=\"loading\"\n\t\t\t:emptyText=\"content.emptyText ? tr(content.emptyText) : undefined\"\n\t\t\t:channelFilter=\"content.channelChips === true\"\n\t\t\t:channels=\"channelLabels\"\n\t\t\t:payload=\"replyValues\"\n\t\t\t@send=\"onSend\"\n\t\t\t@sent=\"onSent\"\n\t\t\t@messageAction=\"onMessageAction\">\n\t\t\t<template v-if=\"templates\" #reply-tools=\"{ setDraft }\">\n\t\t\t\t<CnTemplateSelect\n\t\t\t\t\t:url=\"templates.url\"\n\t\t\t\t\t:params=\"templateParams\"\n\t\t\t\t\t:inputLabel=\"tr(templates.inputLabel || 'Template')\"\n\t\t\t\t\tdata-testid=\"cn-conversation-templates\"\n\t\t\t\t\t@apply=\"applyTemplate($event, setDraft)\" />\n\t\t\t</template>\n\t\t\t<template v-if=\"replyOptions.length > 0\" #reply-actions>\n\t\t\t\t<NcCheckboxRadioSwitch\n\t\t\t\t\tv-for=\"option in replyOptions\"\n\t\t\t\t\t:key=\"option.key\"\n\t\t\t\t\tv-model=\"replyValues[option.key]\"\n\t\t\t\t\t:data-testid=\"`cn-conversation-option-${option.key}`\">\n\t\t\t\t\t{{ tr(option.label) }}\n\t\t\t\t</NcCheckboxRadioSwitch>\n\t\t\t</template>\n\t\t\t<template v-if=\"headerAction || statusBadgeText\" #header-actions>\n\t\t\t\t<span v-if=\"statusBadgeText\"\n\t\t\t\t\tclass=\"cn-conversation-widget__badge\"\n\t\t\t\t\tdata-testid=\"cn-conversation-status-badge\">\n\t\t\t\t\t{{ statusBadgeText }}\n\t\t\t\t</span>\n\t\t\t\t<NcButton\n\t\t\t\t\tv-if=\"headerAction\"\n\t\t\t\t\tdata-testid=\"cn-conversation-header-action\"\n\t\t\t\t\t@click=\"onHeaderAction\">\n\t\t\t\t\t<template v-if=\"headerAction.icon\" #icon>\n\t\t\t\t\t\t<CnIcon :name=\"headerAction.icon\" :size=\"20\" />\n\t\t\t\t\t</template>\n\t\t\t\t\t{{ tr(headerAction.label) }}\n\t\t\t\t</NcButton>\n\t\t\t</template>\n\t\t</CnConversationThread>\n\t\t<p v-if=\"actionError\"\n\t\t\tclass=\"cn-conversation-widget__error\"\n\t\t\trole=\"alert\"\n\t\t\tdata-testid=\"cn-conversation-action-error\">\n\t\t\t{{ actionError }}\n\t\t</p>\n\t</div>\n</template>\n\n<script>\nimport { subscribe, unsubscribe } from '@nextcloud/event-bus'\nimport { NcButton, NcCheckboxRadioSwitch } from '@nextcloud/vue'\nimport CnIcon from '../CnIcon/CnIcon.vue'\nimport CnTemplateSelect from '../CnTemplateSelect/CnTemplateSelect.vue'\nimport CnConversationThread from './CnConversationThread.vue'\nimport { dispatchAction } from '../../utils/actionsDispatcher.js'\nimport { fetchReferenceObjects } from '../../utils/boardReferenceColumns.js'\nimport { readPath } from '../../utils/readPath.js'\nimport { hasUnresolvedDeepTokens, resolveDeepTokens } from '../../utils/resolveFilterTokens.js'\nimport { userDisplayName } from '../../utils/userDisplayName.js'\n\n/**\n * CnConversationWidget: the `conversation` detail widget type.\n *\n * Renders CnConversationThread from the messages of a record, oldest first.\n * The messages are a list on the bound record (`field`), or the objects of a\n * register list (`source: { register, schema, filter?, limit? }`, the filter\n * token-resolved like a record-list's: `{ \"case\": \"@objectId\" }`).\n *\n * Mapping keys name where each message keeps its parts: `textField` (alias\n * `bodyField`), `timeField` (alias `timestampField`), `authorField` (alias\n * `senderField`), `sideField` (alias `directionField`) with `usValue` (alias\n * `outValue`) for the messages the organisation sent, and `channelField` with\n * an optional `channelMap` from stored value to label (\"email\" to \"E-mail\").\n *\n * The reply box posts to `endpoint` (`@objectId` filled in), or runs\n * `replyAction`, an action descriptor the app decides the meaning of: it is\n * dispatched with `args: [{ text, objectId }]` and `props.text`. After a send\n * the source is read again.\n *\n * `fields: [{ field, side }]` merges several lists of the record by time,\n * each on its side (a ticket's `portalReplies` and `portalAnswers`).\n * `templates` (`{ url, params?, inputLabel, textField? }`) puts a\n * CnTemplateSelect above the reply box; picking one fills the box with the\n * option's `values[textField]` (default `text`). `replyOptions`\n * (`[{ key, label, default? }]`) are checkboxes sent with the reply: in the\n * endpoint's body and as `options` in a `replyAction`'s argument.\n * `statusField` with `statusMap` shows each message's status, and\n * `messageActions` (`[{ id, label, endpoint, method?, when?, errorText? }]`)\n * are buttons on the messages that match `when` (`{ field, in }`,\n * `{ field, equals }`, `{ field, empty: true }`, or a list of them that must\n * all hold); `{field}` in the endpoint is read from the message. `errors`\n * (`{ path, map, default, ok? }`) names an answer's refusal by its status.\n *\n * `channelChips: true` draws a chip per channel above the thread (every\n * `channelMap` label, in map order, then any other channel a message uses).\n * `headerAction` is a button beside the title (`{ label, icon?, ...action }`,\n * DqZaakContact's \"Contact vastleggen\"), dispatched like `replyAction` with\n * `args: [{ objectId }]`; after it the source is read again.\n */\nexport default {\n\tname: 'CnConversationWidget',\n\n\tcomponents: {\n\t\tCnConversationThread,\n\t\tCnIcon,\n\t\tCnTemplateSelect,\n\t\tNcButton,\n\t\tNcCheckboxRadioSwitch,\n\t},\n\n\tinject: {\n\t\tcnTranslate: { default: () => (key) => key },\n\t\t/** Pre-bound action dispatcher of the page, for `replyAction`. */\n\t\tcnDispatchAction: { default: null },\n\t},\n\n\tprops: {\n\t\t/**\n\t\t * The widget's content: `field` (the dot-path to the messages on the\n\t\t * record) or `source`, the mapping keys, `endpoint` or `replyAction`,\n\t\t * and the texts (`title`, `replyLabel`, `placeholder`, `sendLabel`,\n\t\t * `usLabel`, `emptyText`, translated).\n\t\t */\n\t\tcontent: {\n\t\t\ttype: Object,\n\t\t\tdefault: () => ({}),\n\t\t},\n\n\t\t/** The bound record. */\n\t\tobjectData: {\n\t\t\ttype: Object,\n\t\t\tdefault: null,\n\t\t},\n\n\t\t/** The bound record's id. */\n\t\tobjectId: {\n\t\t\ttype: [String, Number],\n\t\t\tdefault: '',\n\t\t},\n\t},\n\n\tdata() {\n\t\treturn {\n\t\t\t/** Replies sent from this widget that the record does not hold yet. */\n\t\t\tsentHere: [],\n\t\t\t/** The messages read from `source`. */\n\t\t\tlisted: [],\n\t\t\t/** Whether `source` is being read. */\n\t\t\tloading: false,\n\t\t\t/** The reply options' values, by key. */\n\t\t\treplyValues: this.initialReplyValues(),\n\t\t\t/** Why the last message action failed. */\n\t\t\tactionError: '',\n\t\t\t/** The action running, as `<action>|<message>`. */\n\t\t\tacting: '',\n\t\t\t/** The threads `statusBadge` reads. */\n\t\t\tbadgeRows: [],\n\t\t}\n\t},\n\n\tcomputed: {\n\t\t/** @return {object|null} The register list the messages come from, or null. */\n\t\tsource() {\n\t\t\tconst source = this.content?.source\n\t\t\treturn source && typeof source === 'object' && source.register && source.schema ? source : null\n\t\t},\n\n\t\t/** @return {object|null} The header action, or null without a label. */\n\t\t/** @return {string} The latest thread's status (`statusBadge`), mapped and translated; '' for none. */\n\t\tstatusBadgeText() {\n\t\t\tconst badge = this.content?.statusBadge\n\t\t\tif (!badge || this.badgeRows.length === 0) {\n\t\t\t\treturn ''\n\t\t\t}\n\t\t\tconst sortField = badge.sortField || ''\n\t\t\tconst time = (row) => {\n\t\t\t\tconst value = sortField ? Date.parse(readPath(row, sortField)) : NaN\n\t\t\t\treturn Number.isNaN(value) ? 0 : value\n\t\t\t}\n\t\t\tconst latest = [...this.badgeRows].sort((a, b) => time(b) - time(a))[0]\n\t\t\tconst raw = readPath(latest, badge.path || 'status')\n\t\t\tif (raw === undefined || raw === null || raw === '') {\n\t\t\t\treturn ''\n\t\t\t}\n\t\t\tconst map = badge.map && typeof badge.map === 'object' ? badge.map : {}\n\t\t\treturn this.tr(Object.hasOwn(map, String(raw)) ? map[String(raw)] : String(raw))\n\t\t},\n\n\t\theaderAction() {\n\t\t\tconst action = this.content?.headerAction\n\t\t\treturn action && typeof action === 'object' && typeof action.label === 'string' && action.label !== '' ? action : null\n\t\t},\n\n\t\t/** @return {Array<string>} The `channelMap` labels, translated, each once. */\n\t\tchannelLabels() {\n\t\t\tconst map = this.content?.channelMap && typeof this.content.channelMap === 'object' ? this.content.channelMap : {}\n\t\t\treturn [...new Set(Object.values(map).filter((label) => typeof label === 'string' && label !== '').map((label) => this.tr(label)))]\n\t\t},\n\n\t\t/**\n\t\t * `content.replyOption` with its label translated, or null.\n\t\t *\n\t\t * @return {{label: string, key: string, value?: boolean}|null}\n\t\t * @spec openspec/changes/conversation-reply-option/specs/conversation-source/spec.md#requirement-a-reply-can-carry-a-hint-and-an-option\n\t\t */\n\t\treplyOption() {\n\t\t\tconst option = this.content?.replyOption\n\t\t\treturn option && typeof option === 'object' && option.label && option.key\n\t\t\t\t? { ...option, label: this.tr(option.label) }\n\t\t\t\t: null\n\t\t},\n\n\t\t/** @return {object|null} The template picker config, or null. */\n\t\ttemplates() {\n\t\t\tconst templates = this.content?.templates\n\t\t\treturn templates && typeof templates === 'object' && typeof templates.url === 'string' && templates.url !== '' ? templates : null\n\t\t},\n\n\t\t/** @return {object} The template list's params with tokens resolved. */\n\t\ttemplateParams() {\n\t\t\treturn resolveDeepTokens(this.templates?.params || {}, this.tokenCtx)\n\t\t},\n\n\t\t/** @return {Array<object>} The reply options with a key and a label. */\n\t\treplyOptions() {\n\t\t\tconst list = Array.isArray(this.content?.replyOptions) ? this.content.replyOptions : []\n\t\t\treturn list.filter((option) => option && typeof option.key === 'string' && option.key !== '' && typeof option.label === 'string')\n\t\t},\n\n\t\t/** @return {Array<object>} The message actions with an id, a label and an endpoint. */\n\t\tmessageActions() {\n\t\t\tconst list = Array.isArray(this.content?.messageActions) ? this.content.messageActions : []\n\t\t\treturn list.filter((action) => action && action.id && action.label && typeof action.endpoint === 'string')\n\t\t},\n\n\t\t/** @return {object|null} The reply action, or null. */\n\t\treplyAction() {\n\t\t\tconst action = this.content?.replyAction\n\t\t\treturn action && typeof action === 'object' ? action : null\n\t\t},\n\n\t\t/**\n\t\t * The messages in the thread's shape, oldest first, plus the replies\n\t\t * sent here.\n\t\t *\n\t\t * @return {Array<object>} The messages.\n\t\t * @spec openspec/changes/detail-action-model-and-case-surfaces/specs/detail-action-model/spec.md#requirement-conversation-thread\n\t\t * @spec openspec/changes/conversation-source/specs/conversation-source/spec.md#requirement-a-conversation-reads-its-messages-from-a-list-and-maps-their-parts\n\t\t */\n\t\tmessages() {\n\t\t\tconst c = this.content || {}\n\t\t\tconst usValue = String(c.outValue ?? c.usValue ?? 'us')\n\t\t\tconst channelMap = c.channelMap && typeof c.channelMap === 'object' ? c.channelMap : {}\n\t\t\tconst statusMap = c.statusMap && typeof c.statusMap === 'object' ? c.statusMap : {}\n\t\t\tconst stored = this.rawMessages()\n\t\t\t\t.map(({ message, side, key }, index) => {\n\t\t\t\t\tconst channel = c.channelField ? readPath(message, c.channelField) : undefined\n\t\t\t\t\tconst channelKey = channel === undefined || channel === null ? '' : String(channel)\n\t\t\t\t\tconst status = c.statusField ? readPath(message, c.statusField) : undefined\n\t\t\t\t\tconst statusKey = status === undefined || status === null ? '' : String(status)\n\t\t\t\t\tconst sideOf = side || (String(readPath(message, c.directionField || c.sideField || 'side')) === usValue ? 'us' : 'them')\n\t\t\t\t\treturn {\n\t\t\t\t\t\tid: key,\n\t\t\t\t\t\tauthor: this.authorOf(message, sideOf),\n\t\t\t\t\t\tnote: c.noteField ? this.textOf(readPath(message, c.noteField)) : '',\n\t\t\t\t\t\ttime: readPath(message, c.timestampField || c.timeField || 'time'),\n\t\t\t\t\t\ttext: readPath(message, c.bodyField || c.textField || 'text'),\n\t\t\t\t\t\tside: sideOf,\n\t\t\t\t\t\tchannel: channelKey === '' ? '' : this.tr(Object.hasOwn(channelMap, channelKey) ? channelMap[channelKey] : channelKey),\n\t\t\t\t\t\tstatus: statusKey === '' ? '' : this.tr(Object.hasOwn(statusMap, statusKey) ? statusMap[statusKey] : statusKey),\n\t\t\t\t\t\tactions: this.messageActions\n\t\t\t\t\t\t\t.filter((action) => this.actionApplies(action, message))\n\t\t\t\t\t\t\t.map((action) => ({ id: action.id, label: this.tr(action.label), disabled: this.acting === `${action.id}|${key}` })),\n\t\t\t\t\t\torder: index,\n\t\t\t\t\t}\n\t\t\t\t})\n\t\t\tconst at = (message) => {\n\t\t\t\tconst ms = Date.parse(message.time)\n\t\t\t\treturn Number.isNaN(ms) ? null : ms\n\t\t\t}\n\t\t\tstored.sort((a, b) => {\n\t\t\t\tconst ta = at(a)\n\t\t\t\tconst tb = at(b)\n\t\t\t\treturn (ta === null || tb === null || ta === tb) ? a.order - b.order : ta - tb\n\t\t\t})\n\t\t\treturn [...stored, ...this.sentHere]\n\t\t},\n\n\t\t/**\n\t\t * The endpoint with the record's id filled in.\n\t\t *\n\t\t * @return {string} The URL, or '' when the content names none.\n\t\t * @spec openspec/changes/detail-action-model-and-case-surfaces/specs/detail-action-model/spec.md#requirement-conversation-thread\n\t\t */\n\t\tendpoint() {\n\t\t\tconst url = this.content.endpoint\n\t\t\tif (typeof url !== 'string' || url === '') {\n\t\t\t\treturn ''\n\t\t\t}\n\t\t\treturn url.replace(/@objectId/g, encodeURIComponent(String(this.objectId ?? '')))\n\t\t},\n\n\t\t/** @return {object} The token context for `source.filter` and `replyAction`. */\n\t\ttokenCtx() {\n\t\t\treturn { objectId: this.objectId, object: this.objectData || {} }\n\t\t},\n\t},\n\n\twatch: {\n\t\t// The record was read again, so it now holds what was sent from here.\n\t\tobjectData() {\n\t\t\tthis.sentHere = []\n\t\t},\n\n\t\tobjectId: {\n\t\t\timmediate: true,\n\t\t\thandler() {\n\t\t\t\tthis.loadSource()\n\t\t\t\tthis.loadBadge()\n\t\t\t},\n\t\t},\n\t},\n\n\tmounted() {\n\t\tsubscribe('cn:page:refresh', this.onPageRefresh)\n\t},\n\n\tbeforeUnmount() {\n\t\tunsubscribe('cn:page:refresh', this.onPageRefresh)\n\t},\n\n\tmethods: {\n\t\t/**\n\t\t * Read the messages again when the page refreshes (a dialog sent one).\n\t\t *\n\t\t * @return {Promise<void>}\n\t\t */\n\t\tasync onPageRefresh() {\n\t\t\tawait Promise.all([this.loadSource(), this.loadBadge()])\n\t\t},\n\n\t\t/**\n\t\t * Read the threads whose latest status `statusBadge` shows\n\t\t * (`{ source: { register, schema, filter?, limit? }, sortField?, path?, map? }`).\n\t\t * A filter whose token does not resolve, or a failed read, shows no badge.\n\t\t *\n\t\t * @return {Promise<void>}\n\t\t * @spec openspec/changes/conversation-reply-tools/specs/conversation/spec.md#requirement-a-conversation-shows-the-latest-thread-status-and-a-status-can-open-a-follow-up\n\t\t */\n\t\tasync loadBadge() {\n\t\t\tconst source = this.content?.statusBadge?.source\n\t\t\tif (!source || !source.register || !source.schema) {\n\t\t\t\tthis.badgeRows = []\n\t\t\t\treturn\n\t\t\t}\n\t\t\tconst filter = resolveDeepTokens(source.filter || {}, this.tokenCtx)\n\t\t\tif (hasUnresolvedDeepTokens(filter) || Object.values(filter).some((value) => value === '' || value === null || value === undefined)) {\n\t\t\t\tthis.badgeRows = []\n\t\t\t\treturn\n\t\t\t}\n\t\t\ttry {\n\t\t\t\tconst rows = await fetchReferenceObjects({ register: source.register, schema: source.schema, filter, limit: source.limit || 50 })\n\t\t\t\tthis.badgeRows = Array.isArray(rows) ? rows : []\n\t\t\t} catch {\n\t\t\t\tthis.badgeRows = []\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * The stored messages with the side their list gives them: one list\n\t\t * (`field` or `source`), or several merged (`fields`).\n\t\t *\n\t\t * @return {Array<{message: object, side: string, key: string}>} The messages.\n\t\t * @spec openspec/changes/conversation-reply-tools/specs/conversation/spec.md#requirement-a-conversation-merges-several-lists-of-the-record\n\t\t */\n\t\trawMessages() {\n\t\t\tconst c = this.content || {}\n\t\t\tconst lists = !this.source && Array.isArray(c.fields) && c.fields.length > 0\n\t\t\t\t? c.fields.filter((entry) => entry && typeof entry.field === 'string').map((entry) => ({ list: readPath(this.objectData || {}, entry.field), side: entry.side === 'us' ? 'us' : 'them', prefix: entry.field }))\n\t\t\t\t: [{ list: this.source ? this.listed : readPath(this.objectData || {}, c.field || 'messages'), side: '', prefix: 'message' }]\n\t\t\treturn lists.flatMap(({ list, side, prefix }) => (Array.isArray(list) ? list : [])\n\t\t\t\t.filter((message) => message && typeof message === 'object')\n\t\t\t\t.map((message, index) => ({ message, side, key: String(message.id ?? `${prefix}-${index}`) })))\n\t\t},\n\n\t\t/**\n\t\t * Whether a message action applies to a message (`when`).\n\t\t *\n\t\t * @param {object} action The action.\n\t\t * @param {object} message The stored message.\n\t\t * @return {boolean}\n\t\t */\n\t\tactionApplies(action, message) {\n\t\t\tconst conditions = [].concat(action.when || [])\n\t\t\treturn conditions.every((when) => {\n\t\t\t\tif (!when || typeof when !== 'object' || typeof when.field !== 'string') {\n\t\t\t\t\treturn true\n\t\t\t\t}\n\t\t\t\tconst value = readPath(message, when.field)\n\t\t\t\tif (when.empty === true) {\n\t\t\t\t\treturn value === undefined || value === null || value === ''\n\t\t\t\t}\n\t\t\t\tif (Array.isArray(when.in)) {\n\t\t\t\t\treturn when.in.map(String).includes(String(value))\n\t\t\t\t}\n\t\t\t\treturn String(value) === String(when.equals)\n\t\t\t})\n\t\t},\n\n\t\t/**\n\t\t * The reply options at their defaults.\n\t\t *\n\t\t * @return {object} Values by key.\n\t\t */\n\t\tinitialReplyValues() {\n\t\t\tconst list = Array.isArray(this.content?.replyOptions) ? this.content.replyOptions : []\n\t\t\treturn Object.fromEntries(list.filter((option) => option && option.key).map((option) => [option.key, option.default === true]))\n\t\t},\n\n\t\t/**\n\t\t * Put a picked template's text in the reply box.\n\t\t *\n\t\t * @param {object|null} option The template option.\n\t\t * @param {(text: string) => void} setDraft The thread's draft setter.\n\t\t * @return {void}\n\t\t */\n\t\tapplyTemplate(option, setDraft) {\n\t\t\tif (!option || !option.values) {\n\t\t\t\treturn\n\t\t\t}\n\t\t\tconst text = option.values[this.templates.textField || 'text']\n\t\t\tif (typeof text === 'string') {\n\t\t\t\tsetDraft(text)\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * Run a message action: call its endpoint with the message's fields,\n\t\t * then read the messages again.\n\t\t *\n\t\t * @param {{action: string, message: string}} event Which action on which message.\n\t\t * @return {Promise<void>}\n\t\t * @spec openspec/changes/conversation-reply-tools/specs/conversation/spec.md#requirement-a-message-carries-its-status-and-actions\n\t\t */\n\t\tasync onMessageAction({ action: actionId, message: key }) {\n\t\t\tconst action = this.messageActions.find((entry) => entry.id === actionId)\n\t\t\tconst stored = this.rawMessages().find((entry) => entry.key === key)\n\t\t\tif (!action || !stored || this.acting) {\n\t\t\t\treturn\n\t\t\t}\n\t\t\tthis.actionError = ''\n\t\t\tthis.acting = `${actionId}|${key}`\n\t\t\ttry {\n\t\t\t\tconst [{ default: axios }, { generateUrl }] = await Promise.all([import('@nextcloud/axios'), import('@nextcloud/router')])\n\t\t\t\tconst path = action.endpoint\n\t\t\t\t\t.replace(/@objectId/g, encodeURIComponent(String(this.objectId ?? '')))\n\t\t\t\t\t.replace(/\\{([\\w.]+)\\}/g, (_m, field) => encodeURIComponent(String(readPath(stored.message, field) ?? '')))\n\t\t\t\tconst response = await axios.request({ method: String(action.method || 'POST').toLowerCase(), url: generateUrl(path) })\n\t\t\t\tif (await this.followUp(action, response?.data)) {\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t\tconst refusal = this.actionRefusal(action, response?.data)\n\t\t\t\tif (refusal) {\n\t\t\t\t\tthis.actionError = refusal\n\t\t\t\t}\n\t\t\t\tawait this.loadSource()\n\t\t\t} catch (error) {\n\t\t\t\tif (await this.followUp(action, error?.response?.data)) {\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t\tthis.actionError = this.actionRefusal(action, error?.response?.data) || this.tr(action.errorText || 'The action failed.')\n\t\t\t} finally {\n\t\t\t\tthis.acting = ''\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * Run the follow-up action a message action's answer asks for: the\n\t\t * status at `errors.path` (default `status`) looked up in `onStatus`,\n\t\t * dispatched like `headerAction`, tokens resolved against the record.\n\t\t *\n\t\t * @param {object} action The message action.\n\t\t * @param {object|undefined} answer The response body.\n\t\t * @return {Promise<boolean>} True when a follow-up ran.\n\t\t * @spec openspec/changes/conversation-reply-tools/specs/conversation/spec.md#requirement-a-conversation-shows-the-latest-thread-status-and-a-status-can-open-a-follow-up\n\t\t */\n\t\tasync followUp(action, answer) {\n\t\t\tconst map = action.onStatus\n\t\t\tif (!map || typeof map !== 'object' || !answer || typeof answer !== 'object') {\n\t\t\t\treturn false\n\t\t\t}\n\t\t\tconst status = readPath(answer, action.errors?.path || 'status')\n\t\t\tconst next = status === undefined || status === null ? null : map[String(status)]\n\t\t\tif (!next || typeof next !== 'object') {\n\t\t\t\treturn false\n\t\t\t}\n\t\t\tconst resolved = resolveDeepTokens(next, this.tokenCtx)\n\t\t\ttry {\n\t\t\t\tawait (typeof this.cnDispatchAction === 'function'\n\t\t\t\t\t? this.cnDispatchAction(resolved)\n\t\t\t\t\t: dispatchAction(resolved, { router: this.$router || null }))\n\t\t\t} catch {\n\t\t\t\treturn false\n\t\t\t}\n\t\t\treturn true\n\t\t},\n\n\t\t/**\n\t\t * The text a message action's answer names, by `errors` (`{ path, map,\n\t\t * ok? }`): the status at `path` mapped to a text. A status listed in `ok`\n\t\t * (default `[\"sent\", \"ok\"]`) is no refusal.\n\t\t *\n\t\t * @param {object} action The action.\n\t\t * @param {object|undefined} answer The response body.\n\t\t * @return {string} The text, '' for none.\n\t\t */\n\t\tactionRefusal(action, answer) {\n\t\t\tconst errors = action.errors\n\t\t\tif (!errors || typeof errors !== 'object' || !answer || typeof answer !== 'object') {\n\t\t\t\treturn ''\n\t\t\t}\n\t\t\tconst status = readPath(answer, errors.path || 'status')\n\t\t\tif (status === undefined || status === null || (errors.ok || ['sent', 'ok']).map(String).includes(String(status))) {\n\t\t\t\treturn ''\n\t\t\t}\n\t\t\tconst text = (errors.map || {})[String(status)] || errors.default\n\t\t\treturn text ? this.tr(text) : ''\n\t\t},\n\n\t\t/**\n\t\t * Who wrote a message: `usAuthorField` / `themAuthorField` for its\n\t\t * side, else `senderField` (`authorField`). A field written\n\t\t * `@object.<path>` reads the bound record (the case's requester on an\n\t\t * incoming message). With `usAuthorFormat` / `themAuthorFormat` set to\n\t\t * `user` the value is a user id, shown by its display name.\n\t\t *\n\t\t * @param {object} message The message.\n\t\t * @param {string} side `us` or `them`.\n\t\t * @return {string} The author, or '' when the message names none.\n\t\t * @spec openspec/changes/conversation-board-bubble/specs/conversation-source/spec.md#requirement-a-message-names-its-author-per-side-its-direction-and-a-note\n\t\t */\n\t\tauthorOf(message, side) {\n\t\t\tconst c = this.content || {}\n\t\t\tconst field = (side === 'us' ? c.usAuthorField : c.themAuthorField) || c.senderField || c.authorField || 'author'\n\t\t\tconst value = typeof field === 'string' && field.startsWith('@object.')\n\t\t\t\t? readPath(this.objectData || {}, field.slice('@object.'.length))\n\t\t\t\t: readPath(message, field)\n\t\t\tconst text = this.textOf(value)\n\t\t\tconst format = side === 'us' ? c.usAuthorFormat : c.themAuthorFormat\n\t\t\treturn format === 'user' && text !== '' ? (userDisplayName(text) || text) : text\n\t\t},\n\n\t\t/**\n\t\t * @param {unknown} value A stored value.\n\t\t * @return {string} It as text, or '' for none.\n\t\t */\n\t\ttextOf(value) {\n\t\t\treturn value === undefined || value === null || typeof value === 'object' ? '' : String(value)\n\t\t},\n\n\t\t/**\n\t\t * Translate through the app's translate.\n\t\t *\n\t\t * @param {string} key The source string.\n\t\t * @return {string}\n\t\t */\n\t\ttr(key) {\n\t\t\treturn key && typeof this.cnTranslate === 'function' ? this.cnTranslate(key) : (key || '')\n\t\t},\n\n\t\t/**\n\t\t * Read the messages from `source`. A filter whose token does not\n\t\t * resolve sends no request; a failed read leaves the thread empty.\n\t\t *\n\t\t * @return {Promise<void>}\n\t\t * @spec openspec/changes/conversation-source/specs/conversation-source/spec.md#requirement-a-conversation-reads-its-messages-from-a-list-and-maps-their-parts\n\t\t */\n\t\tasync loadSource() {\n\t\t\tif (!this.source) {\n\t\t\t\treturn\n\t\t\t}\n\t\t\tconst raw = this.source.filter || {}\n\t\t\tconst filter = resolveDeepTokens(raw, this.tokenCtx)\n\t\t\tconst emptied = Object.keys(raw).some((key) => typeof raw[key] === 'string' && raw[key].startsWith('@') && (filter[key] === '' || filter[key] === null || filter[key] === undefined))\n\t\t\tif (emptied || hasUnresolvedDeepTokens(filter)) {\n\t\t\t\tthis.listed = []\n\t\t\t\treturn\n\t\t\t}\n\t\t\tthis.loading = true\n\t\t\ttry {\n\t\t\t\tthis.listed = await fetchReferenceObjects({ register: this.source.register, schema: this.source.schema, filter, limit: this.source.limit || 200 })\n\t\t\t\tthis.sentHere = []\n\t\t\t} catch {\n\t\t\t\tthis.listed = []\n\t\t\t} finally {\n\t\t\t\tthis.loading = false\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * Run `replyAction` with the reply, when there is one; the endpoint\n\t\t * path is the thread's own.\n\t\t *\n\t\t * @param {string} text The reply.\n\t\t * @param {object} [extras] The reply option's state, `{ [key]: boolean }`.\n\t\t * @return {Promise<void>}\n\t\t * @spec openspec/changes/conversation-source/specs/conversation-source/spec.md#requirement-a-reply-can-run-an-app-action\n\t\t * @spec openspec/changes/conversation-reply-option/specs/conversation-source/spec.md#requirement-a-reply-can-carry-a-hint-and-an-option\n\t\t */\n\t\tasync onSend(text, extras = {}) {\n\t\t\tif (!this.replyAction) {\n\t\t\t\treturn\n\t\t\t}\n\t\t\tconst resolved = resolveDeepTokens(this.replyAction, this.tokenCtx)\n\t\t\tconst options = this.replyOptions.length > 0 ? { options: { ...this.replyValues } } : {}\n\t\t\tconst action = { ...resolved, args: [{ text, objectId: this.objectId, ...extras, ...options }], props: { ...(resolved.props || {}), text, ...extras, ...options } }\n\t\t\tconst result = typeof this.cnDispatchAction === 'function'\n\t\t\t\t? this.cnDispatchAction(action)\n\t\t\t\t: dispatchAction(action, { router: this.$router || null })\n\t\t\ttry {\n\t\t\t\tconst outcome = await result\n\t\t\t\tif (outcome === false) {\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t} catch {\n\t\t\t\treturn\n\t\t\t}\n\t\t\tif (this.source) {\n\t\t\t\tawait this.loadSource()\n\t\t\t\treturn\n\t\t\t}\n\t\t\tthis.onSent({ text })\n\t\t},\n\n\t\t/**\n\t\t * Run `headerAction` with the record id, then read the source again.\n\t\t *\n\t\t * @return {Promise<void>}\n\t\t */\n\t\tasync onHeaderAction() {\n\t\t\tif (!this.headerAction) {\n\t\t\t\treturn\n\t\t\t}\n\t\t\tconst { label, icon, ...rest } = resolveDeepTokens(this.headerAction, this.tokenCtx)\n\t\t\tconst action = { ...rest, args: [{ objectId: this.objectId }] }\n\t\t\ttry {\n\t\t\t\tconst outcome = await (typeof this.cnDispatchAction === 'function'\n\t\t\t\t\t? this.cnDispatchAction(action)\n\t\t\t\t\t: dispatchAction(action, { router: this.$router || null }))\n\t\t\t\tif (outcome === false) {\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t} catch {\n\t\t\t\treturn\n\t\t\t}\n\t\t\tawait this.loadSource()\n\t\t},\n\n\t\t/**\n\t\t * Show an accepted reply at once, without waiting for the record.\n\t\t *\n\t\t * @param {object} data The endpoint's response.\n\t\t * @return {void}\n\t\t * @spec openspec/changes/detail-action-model-and-case-surfaces/specs/detail-action-model/spec.md#requirement-conversation-thread\n\t\t */\n\t\tonSent(data) {\n\t\t\tconst text = data?.message ?? data?.text\n\t\t\tif (typeof text !== 'string' || text === '') {\n\t\t\t\treturn\n\t\t\t}\n\t\t\tthis.sentHere.push({\n\t\t\t\tid: `sent-${this.sentHere.length}`,\n\t\t\t\ttime: new Date().toISOString(),\n\t\t\t\ttext,\n\t\t\t\tside: 'us',\n\t\t\t})\n\t\t},\n\t},\n}\n</script>\n\n<style scoped>\n.cn-conversation-widget__badge {\n\tpadding: 2px 10px;\n\tborder-radius: var(--border-radius-pill);\n\tbackground: var(--color-background-dark);\n\tcolor: var(--color-main-text);\n\tfont-size: var(--font-size-small, 13px);\n}\n\n.cn-conversation-widget__error {\n\tcolor: var(--color-error-text, var(--color-error));\n\tmargin: calc(2 * var(--default-grid-baseline)) 0 0;\n}\n\n.cn-case-widget-card {\n\tbackground: var(--color-main-background);\n\tborder: 1px solid var(--color-border);\n\tborder-radius: var(--border-radius-large);\n\tpadding: calc(5 * var(--default-grid-baseline));\n}\n</style>\n"],"names":["CnConversationThread","CnIcon","CnTemplateSelect"],"mappings":";;;;;;;;;;;AAmFA;;AAEC;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;;;;;;;;AASA;;;;;AAKA;;AAEA;AACA;AACA;;;AAGD,aAAe;CACd,IAAI,EAAE,sBAAsB;;CAE5B,UAAU,EAAE;AACX,wBAAAA,UAAoB;AACpB,UAAAC,YAAM;AACN,oBAAAC,YAAgB;AAChB,EAAA,QAAQ;AACR,EAAA,qBAAqB;EACrB;;AAED,CAAA,MAAM,EAAE;AACP,EAAA,WAAW,EAAE,EAAE,OAAO,EAAE,MAAM,CAAC,GAAG,KAAK,KAAK;;AAE5C,EAAA,gBAAgB,EAAE,EAAE,OAAO,EAAE,MAAM;EACnC;;AAED,CAAA,KAAK,EAAE;AACN;;;;AAIC;;AAED,EAAA,OAAO,EAAE;GACR,IAAI,EAAE,MAAM;AACZ,GAAA,OAAO,EAAE,OAAO,EAAE,CAAC;GACnB;;AAED;EACA,UAAU,EAAE;GACX,IAAI,EAAE,MAAM;GACZ,OAAO,EAAE,IAAI;G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AAE,IAAI,CAAC,QAAS,EAAC,CAAE,GAAA;AAC9D,GAAA,IAAI;IACH,MAAM,OAAM,GAAI,OAAO,OAAO,IAAI,CAAC,gBAAiB,KAAI,UAAS;OAC9D,IAAI,CAAC,gBAAgB,CAAC,MAAM,CAAA;OAC5B,cAAc,CAAC,MAAM,EAAE,EAAE,MAAM,EAAE,IAAI,CAAC,OAAM,IAAK,IAAK,EAAC,CAAC,EAAA;AAC3D,IAAA,IAAI,OAAQ,KAAI,KAAK,EAAE;KACtB,MAAK;AACN,KAAA;AACD,IAAA,CAAE,MAAM;IACP,MAAK;AACN,IAAA;AACA,GAAA,MAAM,IAAI,CAAC,UAAU,GAAC;GACtB;;AAED;;AAEC;AACA;;;;EAID,MAAM,CAAC,IAAI,EAAE;AACZ,GAAA,MAAM,IAAK,GAAE,IAAI,EAAE,OAAM,IAAK,IAAI,EAAE,KAAG;AACvC,GAAA,IAAI,OAAO,IAAG,KAAM,QAAO,IAAK,SAAS,EAAE,EAAE;IAC5C,MAAK;AACN,IAAA;AACA,GAAA,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC;AAClB,IAAA,EAAE,EAAE,CAAC,KAAK,EAAE,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC;IAClC,IAAI,EAAE,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE;IAC9B,IAAI;AACJ,IAAA,IAAI,EAAE,IAAI;IACV,EAAA;GACD;EACD;AACF;;;;"}
|
|
1
|
+
{"version":3,"file":"CnConversationWidget.vue2.js","sources":["../../../../src/components/CnConversationThread/CnConversationWidget.vue"],"sourcesContent":["<!--\n - SPDX-FileCopyrightText: 2026 Conduction B.V.\n - SPDX-License-Identifier: EUPL-1.2\n-->\n\n<template>\n\t<div class=\"cn-case-widget-card\">\n\t\t<CnConversationThread\n\t\t\tref=\"thread\"\n\t\t\t:messages=\"messages\"\n\t\t\t:title=\"tr(content.title || '')\"\n\t\t\t:subtitle=\"tr(content.subtitle || '')\"\n\t\t\t:showDirection=\"content.showDirection === true\"\n\t\t\t:allowReply=\"content.allowReply !== false\"\n\t\t\t:replyLabel=\"content.replyLabel ? tr(content.replyLabel) : undefined\"\n\t\t\t:placeholder=\"tr(content.placeholder || '')\"\n\t\t\t:sendLabel=\"content.sendLabel ? tr(content.sendLabel) : undefined\"\n\t\t\t:replyHint=\"tr(content.replyHint || '')\"\n\t\t\t:replyOption=\"replyOption\"\n\t\t\t:usLabel=\"content.usLabel ? tr(content.usLabel) : undefined\"\n\t\t\t:endpoint=\"replyAction ? '' : endpoint\"\n\t\t\t:loading=\"loading\"\n\t\t\t:emptyText=\"content.emptyText ? tr(content.emptyText) : undefined\"\n\t\t\t:channelFilter=\"content.channelChips === true\"\n\t\t\t:channels=\"channelLabels\"\n\t\t\t:payload=\"replyValues\"\n\t\t\t@send=\"onSend\"\n\t\t\t@sent=\"onSent\"\n\t\t\t@messageAction=\"onMessageAction\">\n\t\t\t<template v-if=\"templates\" #reply-tools=\"{ setDraft }\">\n\t\t\t\t<CnTemplateSelect\n\t\t\t\t\t:url=\"templates.url\"\n\t\t\t\t\t:params=\"templateParams\"\n\t\t\t\t\t:inputLabel=\"tr(templates.inputLabel || 'Template')\"\n\t\t\t\t\tdata-testid=\"cn-conversation-templates\"\n\t\t\t\t\t@apply=\"applyTemplate($event, setDraft)\" />\n\t\t\t</template>\n\t\t\t<template v-if=\"replyOptions.length > 0 || draftUrl\" #reply-actions=\"{ draft }\">\n\t\t\t\t<NcCheckboxRadioSwitch\n\t\t\t\t\tv-for=\"option in replyOptions\"\n\t\t\t\t\t:key=\"option.key\"\n\t\t\t\t\tv-model=\"replyValues[option.key]\"\n\t\t\t\t\t:data-testid=\"`cn-conversation-option-${option.key}`\">\n\t\t\t\t\t{{ tr(option.label) }}\n\t\t\t\t</NcCheckboxRadioSwitch>\n\t\t\t\t<span v-if=\"draftUrl && draftStatus\"\n\t\t\t\t\tclass=\"cn-conversation-widget__draft-status\"\n\t\t\t\t\trole=\"status\"\n\t\t\t\t\tdata-testid=\"cn-conversation-draft-status\">\n\t\t\t\t\t{{ draftStatus }}\n\t\t\t\t</span>\n\t\t\t\t<NcButton\n\t\t\t\t\tv-if=\"draftUrl\"\n\t\t\t\t\tdata-testid=\"cn-conversation-save-draft\"\n\t\t\t\t\t:disabled=\"savingDraft\"\n\t\t\t\t\t@click=\"saveDraft(draft)\">\n\t\t\t\t\t{{ t('nextcloud-vue', 'Save as draft') }}\n\t\t\t\t</NcButton>\n\t\t\t</template>\n\t\t\t<template v-if=\"headerAction || statusBadgeText\" #header-actions>\n\t\t\t\t<span v-if=\"statusBadgeText\"\n\t\t\t\t\tclass=\"cn-conversation-widget__badge\"\n\t\t\t\t\tdata-testid=\"cn-conversation-status-badge\">\n\t\t\t\t\t{{ statusBadgeText }}\n\t\t\t\t</span>\n\t\t\t\t<NcButton\n\t\t\t\t\tv-if=\"headerAction\"\n\t\t\t\t\tdata-testid=\"cn-conversation-header-action\"\n\t\t\t\t\t@click=\"onHeaderAction\">\n\t\t\t\t\t<template v-if=\"headerAction.icon\" #icon>\n\t\t\t\t\t\t<CnIcon :name=\"headerAction.icon\" :size=\"20\" />\n\t\t\t\t\t</template>\n\t\t\t\t\t{{ tr(headerAction.label) }}\n\t\t\t\t</NcButton>\n\t\t\t</template>\n\t\t</CnConversationThread>\n\t\t<p v-if=\"actionError\"\n\t\t\tclass=\"cn-conversation-widget__error\"\n\t\t\trole=\"alert\"\n\t\t\tdata-testid=\"cn-conversation-action-error\">\n\t\t\t{{ actionError }}\n\t\t</p>\n\t</div>\n</template>\n\n<script>\nimport { subscribe, unsubscribe } from '@nextcloud/event-bus'\nimport { translate as t } from '@nextcloud/l10n'\nimport { NcButton, NcCheckboxRadioSwitch } from '@nextcloud/vue'\nimport CnIcon from '../CnIcon/CnIcon.vue'\nimport CnTemplateSelect from '../CnTemplateSelect/CnTemplateSelect.vue'\nimport CnConversationThread from './CnConversationThread.vue'\nimport { dispatchAction } from '../../utils/actionsDispatcher.js'\nimport { formatTimeOfDay } from '../../utils/boardDate.js'\nimport { fetchReferenceObjects } from '../../utils/boardReferenceColumns.js'\nimport { readPath } from '../../utils/readPath.js'\nimport { hasUnresolvedDeepTokens, resolveDeepTokens } from '../../utils/resolveFilterTokens.js'\nimport { userDisplayName } from '../../utils/userDisplayName.js'\n\n/**\n * CnConversationWidget: the `conversation` detail widget type.\n *\n * Renders CnConversationThread from the messages of a record, oldest first.\n * The messages are a list on the bound record (`field`), or the objects of a\n * register list (`source: { register, schema, filter?, limit? }`, the filter\n * token-resolved like a record-list's: `{ \"case\": \"@objectId\" }`).\n *\n * Mapping keys name where each message keeps its parts: `textField` (alias\n * `bodyField`), `timeField` (alias `timestampField`), `authorField` (alias\n * `senderField`), `sideField` (alias `directionField`) with `usValue` (alias\n * `outValue`) for the messages the organisation sent, and `channelField` with\n * an optional `channelMap` from stored value to label (\"email\" to \"E-mail\").\n *\n * The reply box posts to `endpoint` (`@objectId` filled in), or runs\n * `replyAction`, an action descriptor the app decides the meaning of: it is\n * dispatched with `args: [{ text, objectId }]` and `props.text`. After a send\n * the source is read again.\n *\n * `fields: [{ field, side }]` merges several lists of the record by time,\n * each on its side (a ticket's `portalReplies` and `portalAnswers`).\n * `templates` (`{ url, params?, inputLabel, textField? }`) puts a\n * CnTemplateSelect above the reply box; picking one fills the box with the\n * option's `values[textField]` (default `text`). `replyOptions`\n * (`[{ key, label, default? }]`) are checkboxes sent with the reply: in the\n * endpoint's body and as `options` in a `replyAction`'s argument.\n * `statusField` with `statusMap` shows each message's status, and\n * `messageActions` (`[{ id, label, endpoint, method?, when?, errorText? }]`)\n * are buttons on the messages that match `when` (`{ field, in }`,\n * `{ field, equals }`, `{ field, empty: true }`, or a list of them that must\n * all hold); `{field}` in the endpoint is read from the message. `errors`\n * (`{ path, map, default, ok? }`) names an answer's refusal by its status.\n *\n * `channelChips: true` draws a chip per channel above the thread (every\n * `channelMap` label, in map order, then any other channel a message uses).\n * `headerAction` is a button beside the title (`{ label, icon?, ...action }`,\n * DqZaakContact's \"Contact vastleggen\"), dispatched like `replyAction` with\n * `args: [{ objectId }]`; after it the source is read again.\n */\nexport default {\n\tname: 'CnConversationWidget',\n\n\tcomponents: {\n\t\tCnConversationThread,\n\t\tCnIcon,\n\t\tCnTemplateSelect,\n\t\tNcButton,\n\t\tNcCheckboxRadioSwitch,\n\t},\n\n\tinject: {\n\t\tcnTranslate: { default: () => (key) => key },\n\t\t/** Pre-bound action dispatcher of the page, for `replyAction`. */\n\t\tcnDispatchAction: { default: null },\n\t},\n\n\tprops: {\n\t\t/**\n\t\t * The widget's content: `field` (the dot-path to the messages on the\n\t\t * record) or `source`, the mapping keys, `endpoint` or `replyAction`,\n\t\t * and the texts (`title`, `replyLabel`, `placeholder`, `sendLabel`,\n\t\t * `usLabel`, `emptyText`, translated).\n\t\t */\n\t\tcontent: {\n\t\t\ttype: Object,\n\t\t\tdefault: () => ({}),\n\t\t},\n\n\t\t/** The bound record. */\n\t\tobjectData: {\n\t\t\ttype: Object,\n\t\t\tdefault: null,\n\t\t},\n\n\t\t/** The bound record's id. */\n\t\tobjectId: {\n\t\t\ttype: [String, Number],\n\t\t\tdefault: '',\n\t\t},\n\t},\n\n\tdata() {\n\t\treturn {\n\t\t\t/** Replies sent from this widget that the record does not hold yet. */\n\t\t\tsentHere: [],\n\t\t\t/** The messages read from `source`. */\n\t\t\tlisted: [],\n\t\t\t/** Whether `source` is being read. */\n\t\t\tloading: false,\n\t\t\t/** The reply options' values, by key. */\n\t\t\treplyValues: this.initialReplyValues(),\n\t\t\t/** Why the last message action failed. */\n\t\t\tactionError: '',\n\t\t\t/** The action running, as `<action>|<message>`. */\n\t\t\tacting: '',\n\t\t\t/** The threads `statusBadge` reads. */\n\t\t\tbadgeRows: [],\n\t\t\t/** What the last draft save said: when it was saved, or that it failed. */\n\t\t\tdraftStatus: '',\n\t\t\t/** Whether a draft is being saved. */\n\t\t\tsavingDraft: false,\n\t\t}\n\t},\n\n\tcomputed: {\n\t\t/** @return {object|null} The register list the messages come from, or null. */\n\t\tsource() {\n\t\t\tconst source = this.content?.source\n\t\t\treturn source && typeof source === 'object' && source.register && source.schema ? source : null\n\t\t},\n\n\t\t/** @return {object|null} The header action, or null without a label. */\n\t\t/** @return {string} The latest thread's status (`statusBadge`), mapped and translated; '' for none. */\n\t\tstatusBadgeText() {\n\t\t\tconst badge = this.content?.statusBadge\n\t\t\tif (!badge || this.badgeRows.length === 0) {\n\t\t\t\treturn ''\n\t\t\t}\n\t\t\tconst sortField = badge.sortField || ''\n\t\t\tconst time = (row) => {\n\t\t\t\tconst value = sortField ? Date.parse(readPath(row, sortField)) : NaN\n\t\t\t\treturn Number.isNaN(value) ? 0 : value\n\t\t\t}\n\t\t\tconst latest = [...this.badgeRows].sort((a, b) => time(b) - time(a))[0]\n\t\t\tconst raw = readPath(latest, badge.path || 'status')\n\t\t\tif (raw === undefined || raw === null || raw === '') {\n\t\t\t\treturn ''\n\t\t\t}\n\t\t\tconst map = badge.map && typeof badge.map === 'object' ? badge.map : {}\n\t\t\treturn this.tr(Object.hasOwn(map, String(raw)) ? map[String(raw)] : String(raw))\n\t\t},\n\n\t\theaderAction() {\n\t\t\tconst action = this.content?.headerAction\n\t\t\treturn action && typeof action === 'object' && typeof action.label === 'string' && action.label !== '' ? action : null\n\t\t},\n\n\t\t/** @return {Array<string>} The `channelMap` labels, translated, each once. */\n\t\tchannelLabels() {\n\t\t\tconst map = this.content?.channelMap && typeof this.content.channelMap === 'object' ? this.content.channelMap : {}\n\t\t\treturn [...new Set(Object.values(map).filter((label) => typeof label === 'string' && label !== '').map((label) => this.tr(label)))]\n\t\t},\n\n\t\t/**\n\t\t * `content.replyOption` with its label translated, or null.\n\t\t *\n\t\t * @return {{label: string, key: string, value?: boolean}|null}\n\t\t * @spec openspec/changes/conversation-reply-option/specs/conversation-source/spec.md#requirement-a-reply-can-carry-a-hint-and-an-option\n\t\t */\n\t\treplyOption() {\n\t\t\tconst option = this.content?.replyOption\n\t\t\treturn option && typeof option === 'object' && option.label && option.key\n\t\t\t\t? { ...option, label: this.tr(option.label) }\n\t\t\t\t: null\n\t\t},\n\n\t\t/** @return {object|null} The template picker config, or null. */\n\t\ttemplates() {\n\t\t\tconst templates = this.content?.templates\n\t\t\treturn templates && typeof templates === 'object' && typeof templates.url === 'string' && templates.url !== '' ? templates : null\n\t\t},\n\n\t\t/** @return {object} The template list's params with tokens resolved. */\n\t\ttemplateParams() {\n\t\t\treturn resolveDeepTokens(this.templates?.params || {}, this.tokenCtx)\n\t\t},\n\n\t\t/** @return {Array<object>} The reply options with a key and a label. */\n\t\treplyOptions() {\n\t\t\tconst list = Array.isArray(this.content?.replyOptions) ? this.content.replyOptions : []\n\t\t\treturn list.filter((option) => option && typeof option.key === 'string' && option.key !== '' && typeof option.label === 'string')\n\t\t},\n\n\t\t/** @return {Array<object>} The message actions with an id, a label and an endpoint. */\n\t\tmessageActions() {\n\t\t\tconst list = Array.isArray(this.content?.messageActions) ? this.content.messageActions : []\n\t\t\treturn list.filter((action) => action && action.id && action.label && typeof action.endpoint === 'string')\n\t\t},\n\n\t\t/** @return {object|null} The reply action, or null. */\n\t\treplyAction() {\n\t\t\tconst action = this.content?.replyAction\n\t\t\treturn action && typeof action === 'object' ? action : null\n\t\t},\n\n\t\t/**\n\t\t * The messages in the thread's shape, oldest first, plus the replies\n\t\t * sent here.\n\t\t *\n\t\t * @return {Array<object>} The messages.\n\t\t * @spec openspec/changes/detail-action-model-and-case-surfaces/specs/detail-action-model/spec.md#requirement-conversation-thread\n\t\t * @spec openspec/changes/conversation-source/specs/conversation-source/spec.md#requirement-a-conversation-reads-its-messages-from-a-list-and-maps-their-parts\n\t\t */\n\t\tmessages() {\n\t\t\tconst c = this.content || {}\n\t\t\tconst usValue = String(c.outValue ?? c.usValue ?? 'us')\n\t\t\tconst channelMap = c.channelMap && typeof c.channelMap === 'object' ? c.channelMap : {}\n\t\t\tconst statusMap = c.statusMap && typeof c.statusMap === 'object' ? c.statusMap : {}\n\t\t\tconst stored = this.rawMessages()\n\t\t\t\t.map(({ message, side, key }, index) => {\n\t\t\t\t\tconst channel = c.channelField ? readPath(message, c.channelField) : undefined\n\t\t\t\t\tconst channelKey = channel === undefined || channel === null ? '' : String(channel)\n\t\t\t\t\tconst status = c.statusField ? readPath(message, c.statusField) : undefined\n\t\t\t\t\tconst statusKey = status === undefined || status === null ? '' : String(status)\n\t\t\t\t\tconst sideOf = side || (String(readPath(message, c.directionField || c.sideField || 'side')) === usValue ? 'us' : 'them')\n\t\t\t\t\treturn {\n\t\t\t\t\t\tid: key,\n\t\t\t\t\t\tauthor: this.authorOf(message, sideOf),\n\t\t\t\t\t\tnote: c.noteField ? this.textOf(readPath(message, c.noteField)) : '',\n\t\t\t\t\t\ttime: readPath(message, c.timestampField || c.timeField || 'time'),\n\t\t\t\t\t\ttext: readPath(message, c.bodyField || c.textField || 'text'),\n\t\t\t\t\t\tside: sideOf,\n\t\t\t\t\t\tchannel: channelKey === '' ? '' : this.tr(Object.hasOwn(channelMap, channelKey) ? channelMap[channelKey] : channelKey),\n\t\t\t\t\t\tstatus: statusKey === '' ? '' : this.tr(Object.hasOwn(statusMap, statusKey) ? statusMap[statusKey] : statusKey),\n\t\t\t\t\t\tactions: this.messageActions\n\t\t\t\t\t\t\t.filter((action) => this.actionApplies(action, message))\n\t\t\t\t\t\t\t.map((action) => ({ id: action.id, label: this.tr(action.label), disabled: this.acting === `${action.id}|${key}` })),\n\t\t\t\t\t\torder: index,\n\t\t\t\t\t}\n\t\t\t\t})\n\t\t\tconst at = (message) => {\n\t\t\t\tconst ms = Date.parse(message.time)\n\t\t\t\treturn Number.isNaN(ms) ? null : ms\n\t\t\t}\n\t\t\tstored.sort((a, b) => {\n\t\t\t\tconst ta = at(a)\n\t\t\t\tconst tb = at(b)\n\t\t\t\treturn (ta === null || tb === null || ta === tb) ? a.order - b.order : ta - tb\n\t\t\t})\n\t\t\treturn [...stored, ...this.sentHere]\n\t\t},\n\n\t\t/**\n\t\t * The endpoint with the record's id filled in.\n\t\t *\n\t\t * @return {string} The URL, or '' when the content names none.\n\t\t * @spec openspec/changes/detail-action-model-and-case-surfaces/specs/detail-action-model/spec.md#requirement-conversation-thread\n\t\t */\n\t\t/**\n\t\t * The reply draft's url (`content.draft.url`, `@objectId` filled in),\n\t\t * or '' without one.\n\t\t *\n\t\t * @return {string}\n\t\t * @spec openspec/changes/conversation-reply-draft/specs/conversation-reply-draft/spec.md#requirement-a-reply-can-be-saved-as-a-draft-and-comes-back\n\t\t */\n\t\tdraftUrl() {\n\t\t\tconst url = this.content.draft && this.content.draft.url\n\t\t\tif (typeof url !== 'string' || url === '') {\n\t\t\t\treturn ''\n\t\t\t}\n\t\t\treturn url.replace(/@objectId/g, encodeURIComponent(String(this.objectId ?? '')))\n\t\t},\n\n\t\tendpoint() {\n\t\t\tconst url = this.content.endpoint\n\t\t\tif (typeof url !== 'string' || url === '') {\n\t\t\t\treturn ''\n\t\t\t}\n\t\t\treturn url.replace(/@objectId/g, encodeURIComponent(String(this.objectId ?? '')))\n\t\t},\n\n\t\t/** @return {object} The token context for `source.filter` and `replyAction`. */\n\t\ttokenCtx() {\n\t\t\treturn { objectId: this.objectId, object: this.objectData || {} }\n\t\t},\n\t},\n\n\twatch: {\n\t\t// The record was read again, so it now holds what was sent from here.\n\t\tobjectData() {\n\t\t\tthis.sentHere = []\n\t\t},\n\n\t\tobjectId: {\n\t\t\timmediate: true,\n\t\t\thandler() {\n\t\t\t\tthis.loadSource()\n\t\t\t\tthis.loadBadge()\n\t\t\t\tthis.loadDraft()\n\t\t\t},\n\t\t},\n\t},\n\n\tmounted() {\n\t\tsubscribe('cn:page:refresh', this.onPageRefresh)\n\t\tsubscribe('cn:conversation:reply-sent', this.onReplySentElsewhere)\n\t},\n\n\tbeforeUnmount() {\n\t\tunsubscribe('cn:page:refresh', this.onPageRefresh)\n\t\tunsubscribe('cn:conversation:reply-sent', this.onReplySentElsewhere)\n\t},\n\n\tmethods: {\n\t\tt,\n\n\t\t/**\n\t\t * Read the saved reply draft into the reply box.\n\t\t *\n\t\t * @return {Promise<void>}\n\t\t * @spec openspec/changes/conversation-reply-draft/specs/conversation-reply-draft/spec.md#requirement-a-reply-can-be-saved-as-a-draft-and-comes-back\n\t\t */\n\t\tasync loadDraft() {\n\t\t\tif (!this.draftUrl) {\n\t\t\t\treturn\n\t\t\t}\n\t\t\ttry {\n\t\t\t\tconst { default: axios } = await import('@nextcloud/axios')\n\t\t\t\tconst { generateUrl } = await import('@nextcloud/router')\n\t\t\t\tconst { data } = await axios.get(generateUrl(this.draftUrl))\n\t\t\t\tconst text = data && typeof data.text === 'string' ? data.text : ''\n\t\t\t\tif (text !== '' && this.$refs.thread) {\n\t\t\t\t\tthis.$refs.thread.setDraft(text)\n\t\t\t\t}\n\t\t\t} catch {\n\t\t\t\t// No saved draft to read leaves the box empty.\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * Store the reply box as the draft and say when it was saved.\n\t\t *\n\t\t * @param {string} text The reply box's text.\n\t\t * @return {Promise<void>}\n\t\t */\n\t\tasync saveDraft(text) {\n\t\t\tthis.savingDraft = true\n\t\t\ttry {\n\t\t\t\tawait this.storeDraft(String(text ?? ''))\n\t\t\t\tthis.draftStatus = t('nextcloud-vue', 'Draft saved at {time}', { time: formatTimeOfDay(new Date()) })\n\t\t\t} catch {\n\t\t\t\tthis.draftStatus = t('nextcloud-vue', 'The draft could not be saved')\n\t\t\t} finally {\n\t\t\t\tthis.savingDraft = false\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * A reply on this record went out through a dialog or another surface\n\t\t * (`cn:conversation:reply-sent` with `{ objectId }`): the saved draft\n\t\t * and the reply box are cleared.\n\t\t *\n\t\t * @param {{objectId?: string}} payload The record the reply was on.\n\t\t * @return {Promise<void>}\n\t\t * @spec openspec/changes/conversation-reply-draft/specs/conversation-reply-draft/spec.md#requirement-a-reply-can-be-saved-as-a-draft-and-comes-back\n\t\t */\n\t\tasync onReplySentElsewhere(payload) {\n\t\t\tif (!this.draftUrl || String(payload?.objectId ?? '') !== String(this.objectId ?? '')) {\n\t\t\t\treturn\n\t\t\t}\n\t\t\tif (this.$refs.thread) {\n\t\t\t\tthis.$refs.thread.setDraft('')\n\t\t\t}\n\t\t\tthis.draftStatus = ''\n\t\t\ttry {\n\t\t\t\tawait this.storeDraft('')\n\t\t\t} catch {\n\t\t\t\t// The next save overwrites a draft that could not be cleared.\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * PUT the draft text.\n\t\t *\n\t\t * @param {string} text The text; '' clears the draft.\n\t\t * @return {Promise<void>}\n\t\t */\n\t\tasync storeDraft(text) {\n\t\t\tconst { default: axios } = await import('@nextcloud/axios')\n\t\t\tconst { generateUrl } = await import('@nextcloud/router')\n\t\t\tawait axios.put(generateUrl(this.draftUrl), { text })\n\t\t},\n\n\t\t/**\n\t\t * Read the messages again when the page refreshes (a dialog sent one).\n\t\t *\n\t\t * @return {Promise<void>}\n\t\t */\n\t\tasync onPageRefresh() {\n\t\t\tawait Promise.all([this.loadSource(), this.loadBadge()])\n\t\t},\n\n\t\t/**\n\t\t * Read the threads whose latest status `statusBadge` shows\n\t\t * (`{ source: { register, schema, filter?, limit? }, sortField?, path?, map? }`).\n\t\t * A filter whose token does not resolve, or a failed read, shows no badge.\n\t\t *\n\t\t * @return {Promise<void>}\n\t\t * @spec openspec/changes/conversation-reply-tools/specs/conversation/spec.md#requirement-a-conversation-shows-the-latest-thread-status-and-a-status-can-open-a-follow-up\n\t\t */\n\t\tasync loadBadge() {\n\t\t\tconst source = this.content?.statusBadge?.source\n\t\t\tif (!source || !source.register || !source.schema) {\n\t\t\t\tthis.badgeRows = []\n\t\t\t\treturn\n\t\t\t}\n\t\t\tconst filter = resolveDeepTokens(source.filter || {}, this.tokenCtx)\n\t\t\tif (hasUnresolvedDeepTokens(filter) || Object.values(filter).some((value) => value === '' || value === null || value === undefined)) {\n\t\t\t\tthis.badgeRows = []\n\t\t\t\treturn\n\t\t\t}\n\t\t\ttry {\n\t\t\t\tconst rows = await fetchReferenceObjects({ register: source.register, schema: source.schema, filter, limit: source.limit || 50 })\n\t\t\t\tthis.badgeRows = Array.isArray(rows) ? rows : []\n\t\t\t} catch {\n\t\t\t\tthis.badgeRows = []\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * The stored messages with the side their list gives them: one list\n\t\t * (`field` or `source`), or several merged (`fields`).\n\t\t *\n\t\t * @return {Array<{message: object, side: string, key: string}>} The messages.\n\t\t * @spec openspec/changes/conversation-reply-tools/specs/conversation/spec.md#requirement-a-conversation-merges-several-lists-of-the-record\n\t\t */\n\t\trawMessages() {\n\t\t\tconst c = this.content || {}\n\t\t\tconst lists = !this.source && Array.isArray(c.fields) && c.fields.length > 0\n\t\t\t\t? c.fields.filter((entry) => entry && typeof entry.field === 'string').map((entry) => ({ list: readPath(this.objectData || {}, entry.field), side: entry.side === 'us' ? 'us' : 'them', prefix: entry.field }))\n\t\t\t\t: [{ list: this.source ? this.listed : readPath(this.objectData || {}, c.field || 'messages'), side: '', prefix: 'message' }]\n\t\t\treturn lists.flatMap(({ list, side, prefix }) => (Array.isArray(list) ? list : [])\n\t\t\t\t.filter((message) => message && typeof message === 'object')\n\t\t\t\t.map((message, index) => ({ message, side, key: String(message.id ?? `${prefix}-${index}`) })))\n\t\t},\n\n\t\t/**\n\t\t * Whether a message action applies to a message (`when`).\n\t\t *\n\t\t * @param {object} action The action.\n\t\t * @param {object} message The stored message.\n\t\t * @return {boolean}\n\t\t */\n\t\tactionApplies(action, message) {\n\t\t\tconst conditions = [].concat(action.when || [])\n\t\t\treturn conditions.every((when) => {\n\t\t\t\tif (!when || typeof when !== 'object' || typeof when.field !== 'string') {\n\t\t\t\t\treturn true\n\t\t\t\t}\n\t\t\t\tconst value = readPath(message, when.field)\n\t\t\t\tif (when.empty === true) {\n\t\t\t\t\treturn value === undefined || value === null || value === ''\n\t\t\t\t}\n\t\t\t\tif (Array.isArray(when.in)) {\n\t\t\t\t\treturn when.in.map(String).includes(String(value))\n\t\t\t\t}\n\t\t\t\treturn String(value) === String(when.equals)\n\t\t\t})\n\t\t},\n\n\t\t/**\n\t\t * The reply options at their defaults.\n\t\t *\n\t\t * @return {object} Values by key.\n\t\t */\n\t\tinitialReplyValues() {\n\t\t\tconst list = Array.isArray(this.content?.replyOptions) ? this.content.replyOptions : []\n\t\t\treturn Object.fromEntries(list.filter((option) => option && option.key).map((option) => [option.key, option.default === true]))\n\t\t},\n\n\t\t/**\n\t\t * Put a picked template's text in the reply box.\n\t\t *\n\t\t * @param {object|null} option The template option.\n\t\t * @param {(text: string) => void} setDraft The thread's draft setter.\n\t\t * @return {void}\n\t\t */\n\t\tapplyTemplate(option, setDraft) {\n\t\t\tif (!option || !option.values) {\n\t\t\t\treturn\n\t\t\t}\n\t\t\tconst text = option.values[this.templates.textField || 'text']\n\t\t\tif (typeof text === 'string') {\n\t\t\t\tsetDraft(text)\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * Run a message action: call its endpoint with the message's fields,\n\t\t * then read the messages again.\n\t\t *\n\t\t * @param {{action: string, message: string}} event Which action on which message.\n\t\t * @return {Promise<void>}\n\t\t * @spec openspec/changes/conversation-reply-tools/specs/conversation/spec.md#requirement-a-message-carries-its-status-and-actions\n\t\t */\n\t\tasync onMessageAction({ action: actionId, message: key }) {\n\t\t\tconst action = this.messageActions.find((entry) => entry.id === actionId)\n\t\t\tconst stored = this.rawMessages().find((entry) => entry.key === key)\n\t\t\tif (!action || !stored || this.acting) {\n\t\t\t\treturn\n\t\t\t}\n\t\t\tthis.actionError = ''\n\t\t\tthis.acting = `${actionId}|${key}`\n\t\t\ttry {\n\t\t\t\tconst [{ default: axios }, { generateUrl }] = await Promise.all([import('@nextcloud/axios'), import('@nextcloud/router')])\n\t\t\t\tconst path = action.endpoint\n\t\t\t\t\t.replace(/@objectId/g, encodeURIComponent(String(this.objectId ?? '')))\n\t\t\t\t\t.replace(/\\{([\\w.]+)\\}/g, (_m, field) => encodeURIComponent(String(readPath(stored.message, field) ?? '')))\n\t\t\t\tconst response = await axios.request({ method: String(action.method || 'POST').toLowerCase(), url: generateUrl(path) })\n\t\t\t\tif (await this.followUp(action, response?.data)) {\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t\tconst refusal = this.actionRefusal(action, response?.data)\n\t\t\t\tif (refusal) {\n\t\t\t\t\tthis.actionError = refusal\n\t\t\t\t}\n\t\t\t\tawait this.loadSource()\n\t\t\t} catch (error) {\n\t\t\t\tif (await this.followUp(action, error?.response?.data)) {\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t\tthis.actionError = this.actionRefusal(action, error?.response?.data) || this.tr(action.errorText || 'The action failed.')\n\t\t\t} finally {\n\t\t\t\tthis.acting = ''\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * Run the follow-up action a message action's answer asks for: the\n\t\t * status at `errors.path` (default `status`) looked up in `onStatus`,\n\t\t * dispatched like `headerAction`, tokens resolved against the record.\n\t\t *\n\t\t * @param {object} action The message action.\n\t\t * @param {object|undefined} answer The response body.\n\t\t * @return {Promise<boolean>} True when a follow-up ran.\n\t\t * @spec openspec/changes/conversation-reply-tools/specs/conversation/spec.md#requirement-a-conversation-shows-the-latest-thread-status-and-a-status-can-open-a-follow-up\n\t\t */\n\t\tasync followUp(action, answer) {\n\t\t\tconst map = action.onStatus\n\t\t\tif (!map || typeof map !== 'object' || !answer || typeof answer !== 'object') {\n\t\t\t\treturn false\n\t\t\t}\n\t\t\tconst status = readPath(answer, action.errors?.path || 'status')\n\t\t\tconst next = status === undefined || status === null ? null : map[String(status)]\n\t\t\tif (!next || typeof next !== 'object') {\n\t\t\t\treturn false\n\t\t\t}\n\t\t\tconst resolved = resolveDeepTokens(next, this.tokenCtx)\n\t\t\ttry {\n\t\t\t\tawait (typeof this.cnDispatchAction === 'function'\n\t\t\t\t\t? this.cnDispatchAction(resolved)\n\t\t\t\t\t: dispatchAction(resolved, { router: this.$router || null }))\n\t\t\t} catch {\n\t\t\t\treturn false\n\t\t\t}\n\t\t\treturn true\n\t\t},\n\n\t\t/**\n\t\t * The text a message action's answer names, by `errors` (`{ path, map,\n\t\t * ok? }`): the status at `path` mapped to a text. A status listed in `ok`\n\t\t * (default `[\"sent\", \"ok\"]`) is no refusal.\n\t\t *\n\t\t * @param {object} action The action.\n\t\t * @param {object|undefined} answer The response body.\n\t\t * @return {string} The text, '' for none.\n\t\t */\n\t\tactionRefusal(action, answer) {\n\t\t\tconst errors = action.errors\n\t\t\tif (!errors || typeof errors !== 'object' || !answer || typeof answer !== 'object') {\n\t\t\t\treturn ''\n\t\t\t}\n\t\t\tconst status = readPath(answer, errors.path || 'status')\n\t\t\tif (status === undefined || status === null || (errors.ok || ['sent', 'ok']).map(String).includes(String(status))) {\n\t\t\t\treturn ''\n\t\t\t}\n\t\t\tconst text = (errors.map || {})[String(status)] || errors.default\n\t\t\treturn text ? this.tr(text) : ''\n\t\t},\n\n\t\t/**\n\t\t * Who wrote a message: `usAuthorField` / `themAuthorField` for its\n\t\t * side, else `senderField` (`authorField`). A field written\n\t\t * `@object.<path>` reads the bound record (the case's requester on an\n\t\t * incoming message). With `usAuthorFormat` / `themAuthorFormat` set to\n\t\t * `user` the value is a user id, shown by its display name.\n\t\t *\n\t\t * @param {object} message The message.\n\t\t * @param {string} side `us` or `them`.\n\t\t * @return {string} The author, or '' when the message names none.\n\t\t * @spec openspec/changes/conversation-board-bubble/specs/conversation-source/spec.md#requirement-a-message-names-its-author-per-side-its-direction-and-a-note\n\t\t */\n\t\tauthorOf(message, side) {\n\t\t\tconst c = this.content || {}\n\t\t\tconst field = (side === 'us' ? c.usAuthorField : c.themAuthorField) || c.senderField || c.authorField || 'author'\n\t\t\tconst value = typeof field === 'string' && field.startsWith('@object.')\n\t\t\t\t? readPath(this.objectData || {}, field.slice('@object.'.length))\n\t\t\t\t: readPath(message, field)\n\t\t\tconst text = this.textOf(value)\n\t\t\tconst format = side === 'us' ? c.usAuthorFormat : c.themAuthorFormat\n\t\t\treturn format === 'user' && text !== '' ? (userDisplayName(text) || text) : text\n\t\t},\n\n\t\t/**\n\t\t * @param {unknown} value A stored value.\n\t\t * @return {string} It as text, or '' for none.\n\t\t */\n\t\ttextOf(value) {\n\t\t\treturn value === undefined || value === null || typeof value === 'object' ? '' : String(value)\n\t\t},\n\n\t\t/**\n\t\t * Translate through the app's translate.\n\t\t *\n\t\t * @param {string} key The source string.\n\t\t * @return {string}\n\t\t */\n\t\ttr(key) {\n\t\t\treturn key && typeof this.cnTranslate === 'function' ? this.cnTranslate(key) : (key || '')\n\t\t},\n\n\t\t/**\n\t\t * Read the messages from `source`. A filter whose token does not\n\t\t * resolve sends no request; a failed read leaves the thread empty.\n\t\t *\n\t\t * @return {Promise<void>}\n\t\t * @spec openspec/changes/conversation-source/specs/conversation-source/spec.md#requirement-a-conversation-reads-its-messages-from-a-list-and-maps-their-parts\n\t\t */\n\t\tasync loadSource() {\n\t\t\tif (!this.source) {\n\t\t\t\treturn\n\t\t\t}\n\t\t\tconst raw = this.source.filter || {}\n\t\t\tconst filter = resolveDeepTokens(raw, this.tokenCtx)\n\t\t\tconst emptied = Object.keys(raw).some((key) => typeof raw[key] === 'string' && raw[key].startsWith('@') && (filter[key] === '' || filter[key] === null || filter[key] === undefined))\n\t\t\tif (emptied || hasUnresolvedDeepTokens(filter)) {\n\t\t\t\tthis.listed = []\n\t\t\t\treturn\n\t\t\t}\n\t\t\tthis.loading = true\n\t\t\ttry {\n\t\t\t\tthis.listed = await fetchReferenceObjects({ register: this.source.register, schema: this.source.schema, filter, limit: this.source.limit || 200 })\n\t\t\t\tthis.sentHere = []\n\t\t\t} catch {\n\t\t\t\tthis.listed = []\n\t\t\t} finally {\n\t\t\t\tthis.loading = false\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * Run `replyAction` with the reply, when there is one; the endpoint\n\t\t * path is the thread's own.\n\t\t *\n\t\t * @param {string} text The reply.\n\t\t * @param {object} [extras] The reply option's state, `{ [key]: boolean }`.\n\t\t * @return {Promise<void>}\n\t\t * @spec openspec/changes/conversation-source/specs/conversation-source/spec.md#requirement-a-reply-can-run-an-app-action\n\t\t * @spec openspec/changes/conversation-reply-option/specs/conversation-source/spec.md#requirement-a-reply-can-carry-a-hint-and-an-option\n\t\t */\n\t\tasync onSend(text, extras = {}) {\n\t\t\tif (!this.replyAction) {\n\t\t\t\treturn\n\t\t\t}\n\t\t\tconst resolved = resolveDeepTokens(this.replyAction, this.tokenCtx)\n\t\t\tconst options = this.replyOptions.length > 0 ? { options: { ...this.replyValues } } : {}\n\t\t\tconst action = { ...resolved, args: [{ text, objectId: this.objectId, ...extras, ...options }], props: { ...(resolved.props || {}), text, ...extras, ...options } }\n\t\t\tconst result = typeof this.cnDispatchAction === 'function'\n\t\t\t\t? this.cnDispatchAction(action)\n\t\t\t\t: dispatchAction(action, { router: this.$router || null })\n\t\t\ttry {\n\t\t\t\tconst outcome = await result\n\t\t\t\tif (outcome === false) {\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t} catch {\n\t\t\t\treturn\n\t\t\t}\n\t\t\tif (this.source) {\n\t\t\t\tawait this.loadSource()\n\t\t\t\treturn\n\t\t\t}\n\t\t\tthis.onSent({ text })\n\t\t},\n\n\t\t/**\n\t\t * Run `headerAction` with the record id, then read the source again.\n\t\t *\n\t\t * @return {Promise<void>}\n\t\t */\n\t\tasync onHeaderAction() {\n\t\t\tif (!this.headerAction) {\n\t\t\t\treturn\n\t\t\t}\n\t\t\tconst { label, icon, ...rest } = resolveDeepTokens(this.headerAction, this.tokenCtx)\n\t\t\tconst action = { ...rest, args: [{ objectId: this.objectId }] }\n\t\t\ttry {\n\t\t\t\tconst outcome = await (typeof this.cnDispatchAction === 'function'\n\t\t\t\t\t? this.cnDispatchAction(action)\n\t\t\t\t\t: dispatchAction(action, { router: this.$router || null }))\n\t\t\t\tif (outcome === false) {\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t} catch {\n\t\t\t\treturn\n\t\t\t}\n\t\t\tawait this.loadSource()\n\t\t},\n\n\t\t/**\n\t\t * Show an accepted reply at once, without waiting for the record.\n\t\t *\n\t\t * @param {object} data The endpoint's response.\n\t\t * @return {void}\n\t\t * @spec openspec/changes/detail-action-model-and-case-surfaces/specs/detail-action-model/spec.md#requirement-conversation-thread\n\t\t */\n\t\tonSent(data) {\n\t\t\tconst text = data?.message ?? data?.text\n\t\t\tif (typeof text !== 'string' || text === '') {\n\t\t\t\treturn\n\t\t\t}\n\t\t\tif (this.draftUrl) {\n\t\t\t\tthis.storeDraft('')\n\t\t\t}\n\t\t\tthis.sentHere.push({\n\t\t\t\tid: `sent-${this.sentHere.length}`,\n\t\t\t\ttime: new Date().toISOString(),\n\t\t\t\ttext,\n\t\t\t\tside: 'us',\n\t\t\t})\n\t\t},\n\t},\n}\n</script>\n\n<style scoped>\n.cn-conversation-widget__badge {\n\tpadding: 2px 10px;\n\tborder-radius: var(--border-radius-pill);\n\tbackground: var(--color-background-dark);\n\tcolor: var(--color-main-text);\n\tfont-size: var(--font-size-small, 13px);\n}\n\n.cn-conversation-widget__error {\n\tcolor: var(--color-error-text, var(--color-error));\n\tmargin: calc(2 * var(--default-grid-baseline)) 0 0;\n}\n\n.cn-case-widget-card {\n\tbackground: var(--color-main-background);\n\tborder: 1px solid var(--color-border);\n\tborder-radius: var(--border-radius-large);\n\tpadding: calc(5 * var(--default-grid-baseline));\n}\n\n.cn-conversation-widget__draft-status {\n\tcolor: var(--color-text-maxcontrast);\n\tfont-size: 13px;\n}\n</style>\n"],"names":["CnConversationThread","CnIcon","CnTemplateSelect","t"],"mappings":";;;;;;;;;;;;;AAmGA;;AAEC;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;;;;;;;;AASA;;;;;AAKA;;AAEA;AACA;AACA;;;AAGD,aAAe;CACd,IAAI,EAAE,sBAAsB;;CAE5B,UAAU,EAAE;AACX,wBAAAA,UAAoB;AACpB,UAAAC,YAAM;AACN,oBAAAC,YAAgB;AACh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A,IAAI,IAAI,CAAC,QAAQ,EAAE;AAClB,IAAA,IAAI,CAAC,UAAU,CAAC,EAAE,EAAA;AACnB,IAAA;AACA,GAAA,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC;AAClB,IAAA,EAAE,EAAE,CAAC,KAAK,EAAE,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC;IAClC,IAAI,EAAE,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE;IAC9B,IAAI;AACJ,IAAA,IAAI,EAAE,IAAI;IACV,EAAA;GACD;EACD;AACF;;;;"}
|
|
@@ -2,11 +2,17 @@ import { resolveComponent, openBlock, createElementBlock, createVNode, createSlo
|
|
|
2
2
|
|
|
3
3
|
const _hoisted_1 = { class: "cn-case-widget-card" };
|
|
4
4
|
const _hoisted_2 = {
|
|
5
|
+
key: 0,
|
|
6
|
+
class: "cn-conversation-widget__draft-status",
|
|
7
|
+
role: "status",
|
|
8
|
+
"data-testid": "cn-conversation-draft-status"
|
|
9
|
+
};
|
|
10
|
+
const _hoisted_3 = {
|
|
5
11
|
key: 0,
|
|
6
12
|
class: "cn-conversation-widget__badge",
|
|
7
13
|
"data-testid": "cn-conversation-status-badge"
|
|
8
14
|
};
|
|
9
|
-
const
|
|
15
|
+
const _hoisted_4 = {
|
|
10
16
|
key: 0,
|
|
11
17
|
class: "cn-conversation-widget__error",
|
|
12
18
|
role: "alert",
|
|
@@ -16,12 +22,13 @@ const _hoisted_3 = {
|
|
|
16
22
|
function render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
17
23
|
const _component_CnTemplateSelect = resolveComponent("CnTemplateSelect");
|
|
18
24
|
const _component_NcCheckboxRadioSwitch = resolveComponent("NcCheckboxRadioSwitch");
|
|
19
|
-
const _component_CnIcon = resolveComponent("CnIcon");
|
|
20
25
|
const _component_NcButton = resolveComponent("NcButton");
|
|
26
|
+
const _component_CnIcon = resolveComponent("CnIcon");
|
|
21
27
|
const _component_CnConversationThread = resolveComponent("CnConversationThread");
|
|
22
28
|
|
|
23
29
|
return (openBlock(), createElementBlock("div", _hoisted_1, [
|
|
24
30
|
createVNode(_component_CnConversationThread, {
|
|
31
|
+
ref: "thread",
|
|
25
32
|
messages: $options.messages,
|
|
26
33
|
title: $options.tr($props.content.title || ''),
|
|
27
34
|
subtitle: $options.tr($props.content.subtitle || ''),
|
|
@@ -58,10 +65,10 @@ function render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
58
65
|
key: "0"
|
|
59
66
|
}
|
|
60
67
|
: undefined,
|
|
61
|
-
($options.replyOptions.length > 0)
|
|
68
|
+
($options.replyOptions.length > 0 || $options.draftUrl)
|
|
62
69
|
? {
|
|
63
70
|
name: "reply-actions",
|
|
64
|
-
fn: withCtx(() => [
|
|
71
|
+
fn: withCtx(({ draft }) => [
|
|
65
72
|
(openBlock(true), createElementBlock(Fragment, null, renderList($options.replyOptions, (option) => {
|
|
66
73
|
return (openBlock(), createBlock(_component_NcCheckboxRadioSwitch, {
|
|
67
74
|
key: option.key,
|
|
@@ -74,7 +81,23 @@ function render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
74
81
|
]),
|
|
75
82
|
_: 2 /* DYNAMIC */
|
|
76
83
|
}, 1032 /* PROPS, DYNAMIC_SLOTS */, ["modelValue", "onUpdate:modelValue", "data-testid"]))
|
|
77
|
-
}), 128 /* KEYED_FRAGMENT */))
|
|
84
|
+
}), 128 /* KEYED_FRAGMENT */)),
|
|
85
|
+
($options.draftUrl && $data.draftStatus)
|
|
86
|
+
? (openBlock(), createElementBlock("span", _hoisted_2, toDisplayString($data.draftStatus), 1 /* TEXT */))
|
|
87
|
+
: createCommentVNode("v-if", true),
|
|
88
|
+
($options.draftUrl)
|
|
89
|
+
? (openBlock(), createBlock(_component_NcButton, {
|
|
90
|
+
key: 1,
|
|
91
|
+
"data-testid": "cn-conversation-save-draft",
|
|
92
|
+
disabled: $data.savingDraft,
|
|
93
|
+
onClick: $event => ($options.saveDraft(draft))
|
|
94
|
+
}, {
|
|
95
|
+
default: withCtx(() => [
|
|
96
|
+
createTextVNode(toDisplayString($options.t('nextcloud-vue', 'Save as draft')), 1 /* TEXT */)
|
|
97
|
+
]),
|
|
98
|
+
_: 1 /* STABLE */
|
|
99
|
+
}, 8 /* PROPS */, ["disabled", "onClick"]))
|
|
100
|
+
: createCommentVNode("v-if", true)
|
|
78
101
|
]),
|
|
79
102
|
key: "1"
|
|
80
103
|
}
|
|
@@ -84,7 +107,7 @@ function render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
84
107
|
name: "header-actions",
|
|
85
108
|
fn: withCtx(() => [
|
|
86
109
|
($options.statusBadgeText)
|
|
87
|
-
? (openBlock(), createElementBlock("span",
|
|
110
|
+
? (openBlock(), createElementBlock("span", _hoisted_3, toDisplayString($options.statusBadgeText), 1 /* TEXT */))
|
|
88
111
|
: createCommentVNode("v-if", true),
|
|
89
112
|
($options.headerAction)
|
|
90
113
|
? (openBlock(), createBlock(_component_NcButton, {
|
|
@@ -117,7 +140,7 @@ function render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
117
140
|
: undefined
|
|
118
141
|
]), 1032 /* PROPS, DYNAMIC_SLOTS */, ["messages", "title", "subtitle", "showDirection", "allowReply", "replyLabel", "placeholder", "sendLabel", "replyHint", "replyOption", "usLabel", "endpoint", "loading", "emptyText", "channelFilter", "channels", "payload", "onSend", "onSent", "onMessageAction"]),
|
|
119
142
|
($data.actionError)
|
|
120
|
-
? (openBlock(), createElementBlock("p",
|
|
143
|
+
? (openBlock(), createElementBlock("p", _hoisted_4, toDisplayString($data.actionError), 1 /* TEXT */))
|
|
121
144
|
: createCommentVNode("v-if", true)
|
|
122
145
|
]))
|
|
123
146
|
}
|