@conduction/nextcloud-vue 2.155.0 → 2.157.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.
Files changed (133) hide show
  1. package/dist/esm/components/CnAiCompanion/CnAiInput.vue2.js +3 -1
  2. package/dist/esm/components/CnAiCompanion/CnAiInput.vue2.js.map +1 -1
  3. package/dist/esm/components/CnAiCompanion/CnAiInput.vue3.js.map +1 -1
  4. package/dist/esm/components/CnBannerWidget/CnBannerWidget.vue.js +1 -1
  5. package/dist/esm/components/CnBannerWidget/CnBannerWidget.vue2.js.map +1 -1
  6. package/dist/esm/components/CnBannerWidget/CnBannerWidget.vue3.js.map +1 -1
  7. package/dist/esm/components/CnChecklistRunWidget/CnChecklistRunWidget.vue.js +1 -1
  8. package/dist/esm/components/CnChecklistRunWidget/CnChecklistRunWidget.vue2.js.map +1 -1
  9. package/dist/esm/components/CnChecklistRunWidget/CnChecklistRunWidget.vue3.js.map +1 -1
  10. package/dist/esm/components/CnCountdownWidget/CnCountdownWidget.vue.js +1 -1
  11. package/dist/esm/components/CnCountdownWidget/CnCountdownWidget.vue2.js.map +1 -1
  12. package/dist/esm/components/CnCountdownWidget/CnCountdownWidget.vue3.js.map +1 -1
  13. package/dist/esm/components/CnDashboardPage/CnDashboardPage.vue.js +1 -1
  14. package/dist/esm/components/CnDashboardPage/CnDashboardPage.vue2.js.map +1 -1
  15. package/dist/esm/components/CnDashboardPage/CnDashboardPage.vue3.js.map +1 -1
  16. package/dist/esm/components/CnDeviceFramesWidget/CnDeviceFramesWidget.vue.js +1 -1
  17. package/dist/esm/components/CnDeviceFramesWidget/CnDeviceFramesWidget.vue2.js.map +1 -1
  18. package/dist/esm/components/CnDeviceFramesWidget/CnDeviceFramesWidget.vue3.js.map +1 -1
  19. package/dist/esm/components/CnDuplicateWarning/CnDuplicateWarning.vue.js +1 -1
  20. package/dist/esm/components/CnDuplicateWarning/CnDuplicateWarning.vue2.js +2 -1
  21. package/dist/esm/components/CnDuplicateWarning/CnDuplicateWarning.vue2.js.map +1 -1
  22. package/dist/esm/components/CnDuplicateWarning/CnDuplicateWarning.vue3.js +10 -3
  23. package/dist/esm/components/CnDuplicateWarning/CnDuplicateWarning.vue3.js.map +1 -1
  24. package/dist/esm/components/CnFactsWidget/CnFactsWidget.vue.js +1 -1
  25. package/dist/esm/components/CnFactsWidget/CnFactsWidget.vue2.js +14 -4
  26. package/dist/esm/components/CnFactsWidget/CnFactsWidget.vue2.js.map +1 -1
  27. package/dist/esm/components/CnFactsWidget/CnFactsWidget.vue3.js +3 -3
  28. package/dist/esm/components/CnFactsWidget/CnFactsWidget.vue3.js.map +1 -1
  29. package/dist/esm/components/CnFeaturesBoard/CnFeaturesBoard.vue.js +1 -1
  30. package/dist/esm/components/CnFeaturesBoard/CnFeaturesBoard.vue2.js.map +1 -1
  31. package/dist/esm/components/CnFeaturesBoard/CnFeaturesBoard.vue3.js.map +1 -1
  32. package/dist/esm/components/CnFormDialog/CnFormDialog.vue.js +1 -1
  33. package/dist/esm/components/CnFormDialog/CnFormDialog.vue2.js.map +1 -1
  34. package/dist/esm/components/CnFormDialog/CnFormDialog.vue3.js +2 -1
  35. package/dist/esm/components/CnFormDialog/CnFormDialog.vue3.js.map +1 -1
  36. package/dist/esm/components/CnIndexSidebar/CnIndexSidebar.vue2.js +13 -4
  37. package/dist/esm/components/CnIndexSidebar/CnIndexSidebar.vue2.js.map +1 -1
  38. package/dist/esm/components/CnIndexSidebar/CnIndexSidebar.vue3.js.map +1 -1
  39. package/dist/esm/components/CnLinkedWidget/CnLinkedWidget.vue.js +1 -1
  40. package/dist/esm/components/CnLinkedWidget/CnLinkedWidget.vue2.js +91 -7
  41. package/dist/esm/components/CnLinkedWidget/CnLinkedWidget.vue2.js.map +1 -1
  42. package/dist/esm/components/CnLinkedWidget/CnLinkedWidget.vue3.js.map +1 -1
  43. package/dist/esm/components/CnMailTab/CnMailTab.vue.js +1 -1
  44. package/dist/esm/components/CnMailTab/CnMailTab.vue2.js +4 -4
  45. package/dist/esm/components/CnMailTab/CnMailTab.vue2.js.map +1 -1
  46. package/dist/esm/components/CnMailTab/CnMailTab.vue3.js.map +1 -1
  47. package/dist/esm/components/CnNotificationMatrix/CnNotificationMatrix.vue.js +1 -1
  48. package/dist/esm/components/CnNotificationMatrix/CnNotificationMatrix.vue2.js +3 -0
  49. package/dist/esm/components/CnNotificationMatrix/CnNotificationMatrix.vue2.js.map +1 -1
  50. package/dist/esm/components/CnNotificationMatrix/CnNotificationMatrix.vue3.js +10 -2
  51. package/dist/esm/components/CnNotificationMatrix/CnNotificationMatrix.vue3.js.map +1 -1
  52. package/dist/esm/components/CnPartyPicker/CnPartyPicker.vue.js +1 -1
  53. package/dist/esm/components/CnPartyPicker/CnPartyPicker.vue2.js +6 -0
  54. package/dist/esm/components/CnPartyPicker/CnPartyPicker.vue2.js.map +1 -1
  55. package/dist/esm/components/CnPartyPicker/CnPartyPicker.vue3.js +2 -1
  56. package/dist/esm/components/CnPartyPicker/CnPartyPicker.vue3.js.map +1 -1
  57. package/dist/esm/components/CnSavedViewLookFields/CnSavedViewLookFields.vue.js +1 -1
  58. package/dist/esm/components/CnSavedViewLookFields/CnSavedViewLookFields.vue2.js.map +1 -1
  59. package/dist/esm/components/CnSavedViewLookFields/CnSavedViewLookFields.vue3.js +27 -24
  60. package/dist/esm/components/CnSavedViewLookFields/CnSavedViewLookFields.vue3.js.map +1 -1
  61. package/dist/esm/components/CnSchemaFormDialog/CnSchemaConfigurationTab.vue2.js +25 -0
  62. package/dist/esm/components/CnSchemaFormDialog/CnSchemaConfigurationTab.vue2.js.map +1 -1
  63. package/dist/esm/components/CnSchemaFormDialog/CnSchemaConfigurationTab.vue3.js +40 -8
  64. package/dist/esm/components/CnSchemaFormDialog/CnSchemaConfigurationTab.vue3.js.map +1 -1
  65. package/dist/esm/components/CnSchemaFormDialog/CnSchemaFormDialog.vue2.js +10 -0
  66. package/dist/esm/components/CnSchemaFormDialog/CnSchemaFormDialog.vue2.js.map +1 -1
  67. package/dist/esm/components/CnSchemaFormDialog/CnSchemaFormDialog.vue3.js.map +1 -1
  68. package/dist/esm/components/CnSearchSelect/CnSearchSelect.vue.js +1 -1
  69. package/dist/esm/components/CnSearchSelect/CnSearchSelect.vue2.js.map +1 -1
  70. package/dist/esm/components/CnSearchSelect/CnSearchSelect.vue3.js.map +1 -1
  71. package/dist/esm/components/CnSettingsFieldsSection/CnSettingsFieldsSection.vue.js +1 -1
  72. package/dist/esm/components/CnSettingsFieldsSection/CnSettingsFieldsSection.vue2.js +24 -1
  73. package/dist/esm/components/CnSettingsFieldsSection/CnSettingsFieldsSection.vue2.js.map +1 -1
  74. package/dist/esm/components/CnSettingsFieldsSection/CnSettingsFieldsSection.vue3.js +9 -0
  75. package/dist/esm/components/CnSettingsFieldsSection/CnSettingsFieldsSection.vue3.js.map +1 -1
  76. package/dist/esm/components/CnStagesWidget/CnStagesWidget.vue.js +1 -1
  77. package/dist/esm/components/CnStagesWidget/CnStagesWidget.vue2.js +4 -1
  78. package/dist/esm/components/CnStagesWidget/CnStagesWidget.vue2.js.map +1 -1
  79. package/dist/esm/components/CnStagesWidget/CnStagesWidget.vue3.js.map +1 -1
  80. package/dist/esm/components/CnStagesWidget/stagesModel.js +10 -2
  81. package/dist/esm/components/CnStagesWidget/stagesModel.js.map +1 -1
  82. package/dist/esm/components/CnTimelineWidget/CnTimelineManage.vue.js +1 -1
  83. package/dist/esm/components/CnTimelineWidget/CnTimelineManage.vue2.js +61 -2
  84. package/dist/esm/components/CnTimelineWidget/CnTimelineManage.vue2.js.map +1 -1
  85. package/dist/esm/components/CnTimelineWidget/CnTimelineManage.vue3.js +68 -44
  86. package/dist/esm/components/CnTimelineWidget/CnTimelineManage.vue3.js.map +1 -1
  87. package/dist/esm/integrations/builtin/email/CnEmailTab.vue.js +1 -1
  88. package/dist/esm/integrations/builtin/email/CnEmailTab.vue2.js +13 -3
  89. package/dist/esm/integrations/builtin/email/CnEmailTab.vue2.js.map +1 -1
  90. package/dist/esm/integrations/builtin/email/CnEmailTab.vue3.js.map +1 -1
  91. package/dist/esm/l10n/en.json.js +12 -7
  92. package/dist/esm/l10n/en.json.js.map +1 -1
  93. package/dist/esm/l10n/nl.json.js +14 -9
  94. package/dist/esm/l10n/nl.json.js.map +1 -1
  95. package/dist/esm/library-style.js +1 -1
  96. package/dist/esm/nextcloud-vue.css +777 -469
  97. package/dist/esm/utils/dynamicProperties.js +14 -2
  98. package/dist/esm/utils/dynamicProperties.js.map +1 -1
  99. package/dist/nextcloud-vue.cjs.js +2472 -2120
  100. package/dist/nextcloud-vue.cjs.js.map +2 -2
  101. package/dist/nextcloud-vue.css +777 -469
  102. package/l10n/en.json +12 -7
  103. package/l10n/nl.json +14 -9
  104. package/package.json +1 -1
  105. package/src/components/CnAiCompanion/CnAiInput.vue +3 -1
  106. package/src/components/CnBannerWidget/CnBannerWidget.vue +5 -1
  107. package/src/components/CnChecklistRunWidget/CnChecklistRunWidget.vue +12 -5
  108. package/src/components/CnCountdownWidget/CnCountdownWidget.vue +12 -0
  109. package/src/components/CnDashboardPage/CnDashboardPage.vue +3 -1
  110. package/src/components/CnDeviceFramesWidget/CnDeviceFramesWidget.vue +1 -0
  111. package/src/components/CnDuplicateWarning/CnDuplicateWarning.vue +8 -4
  112. package/src/components/CnFactsWidget/CnFactsWidget.vue +31 -6
  113. package/src/components/CnFeaturesBoard/CnFeaturesBoard.vue +4 -2
  114. package/src/components/CnFormDialog/CnFormDialog.vue +1 -0
  115. package/src/components/CnIndexSidebar/CnIndexSidebar.vue +13 -4
  116. package/src/components/CnLinkedWidget/CnLinkedWidget.vue +91 -7
  117. package/src/components/CnMailTab/CnMailTab.vue +4 -4
  118. package/src/components/CnNotificationMatrix/CnNotificationMatrix.vue +20 -0
  119. package/src/components/CnPartyPicker/CnPartyPicker.vue +7 -0
  120. package/src/components/CnSavedViewLookFields/CnSavedViewLookFields.vue +27 -20
  121. package/src/components/CnSchemaFormDialog/CnSchemaConfigurationTab.vue +42 -0
  122. package/src/components/CnSchemaFormDialog/CnSchemaFormDialog.vue +10 -0
  123. package/src/components/CnSearchSelect/CnSearchSelect.vue +3 -1
  124. package/src/components/CnSettingsFieldsSection/CnSettingsFieldsSection.vue +37 -1
  125. package/src/components/CnStagesWidget/CnStagesWidget.vue +4 -1
  126. package/src/components/CnStagesWidget/stagesModel.js +10 -2
  127. package/src/components/CnTimelineWidget/CnTimelineManage.vue +69 -4
  128. package/src/css/dialog.css +33 -0
  129. package/src/css/look-board-detail.css +4 -3
  130. package/src/css/look-board-index.css +34 -3
  131. package/src/css/look-board.css +181 -4
  132. package/src/integrations/builtin/email/CnEmailTab.vue +13 -3
  133. package/src/utils/dynamicProperties.js +13 -1
@@ -1 +1 @@
1
- {"version":3,"file":"CnLinkedWidget.vue2.js","sources":["../../../../src/components/CnLinkedWidget/CnLinkedWidget.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-linked-widget\" data-testid=\"cn-linked-widget\">\n\t\t<ul v-if=\"linkedRows.length > 0\" class=\"cn-linked-widget__rows\">\n\t\t\t<li\n\t\t\t\tv-for=\"row in linkedRows\"\n\t\t\t\t:key=\"row.key\"\n\t\t\t\tclass=\"cn-linked-widget__row\"\n\t\t\t\tdata-testid=\"cn-linked-row\">\n\t\t\t\t<a v-if=\"row.href\" :href=\"row.href\" class=\"cn-linked-widget__link\">\n\t\t\t\t\t<CnIcon\n\t\t\t\t\t\tv-if=\"row.icon\"\n\t\t\t\t\t\t:name=\"row.icon\"\n\t\t\t\t\t\t:size=\"18\"\n\t\t\t\t\t\taria-hidden=\"true\" />\n\t\t\t\t\t{{ row.label }}\n\t\t\t\t</a>\n\t\t\t\t<button\n\t\t\t\t\tv-else-if=\"row.run\"\n\t\t\t\t\ttype=\"button\"\n\t\t\t\t\tclass=\"cn-linked-widget__link\"\n\t\t\t\t\t@click=\"row.run()\">\n\t\t\t\t\t<CnIcon\n\t\t\t\t\t\tv-if=\"row.icon\"\n\t\t\t\t\t\t:name=\"row.icon\"\n\t\t\t\t\t\t:size=\"18\"\n\t\t\t\t\t\taria-hidden=\"true\" />\n\t\t\t\t\t{{ row.label }}\n\t\t\t\t</button>\n\t\t\t\t<span v-else class=\"cn-linked-widget__link\">\n\t\t\t\t\t<CnIcon\n\t\t\t\t\t\tv-if=\"row.icon\"\n\t\t\t\t\t\t:name=\"row.icon\"\n\t\t\t\t\t\t:size=\"18\"\n\t\t\t\t\t\taria-hidden=\"true\" />\n\t\t\t\t\t{{ row.label }}\n\t\t\t\t</span>\n\t\t\t</li>\n\t\t</ul>\n\t\t<!-- A div, not a p: a theme's paragraph rule would draw the muted\n\t\t 13px line at body size. -->\n\t\t<div v-if=\"emptyLine\" class=\"cn-linked-widget__empty\" data-testid=\"cn-linked-empty\">\n\t\t\t{{ emptyLine }}\n\t\t</div>\n\t\t<span v-if=\"emptyActions.length > 0\" class=\"cn-linked-widget__actions\">\n\t\t\t<button\n\t\t\t\tv-for=\"action in emptyActions\"\n\t\t\t\t:key=\"action.key\"\n\t\t\t\ttype=\"button\"\n\t\t\t\tclass=\"cn-linked-widget__action\"\n\t\t\t\tdata-testid=\"cn-linked-action\"\n\t\t\t\t@click=\"action.run()\">\n\t\t\t\t{{ action.label }}\n\t\t\t</button>\n\t\t</span>\n\t\t<!-- The leaves run here, unseen: each reads its own data and reports\n\t\t a summary through `onSummary`; this card draws the rows. -->\n\t\t<div hidden class=\"cn-linked-widget__leaves\">\n\t\t\t<CnLeafMountHost\n\t\t\t\tv-for=\"provider in providers\"\n\t\t\t\t:key=\"provider.id\"\n\t\t\t\t:provider=\"provider\"\n\t\t\t\t:mountProps=\"mountPropsById[provider.id]\" />\n\t\t</div>\n\t</div>\n</template>\n\n<script>\nimport { getLanguage, translate as t } from '@nextcloud/l10n'\nimport CnIcon from '../CnIcon/CnIcon.vue'\nimport CnLeafMountHost from '../CnLeafMountHost/CnLeafMountHost.vue'\nimport { useIntegrationRegistry } from '../../composables/useIntegrationRegistry.js'\n\n/**\n * Join nouns as a sentence list in the user's language (\"a, b en c\").\n *\n * @param {string[]} items The nouns.\n * @return {string} The list.\n */\nfunction joinList(items) {\n\ttry {\n\t\treturn new Intl.ListFormat((getLanguage() || 'en').replace('_', '-'), { style: 'long', type: 'conjunction' }).format(items)\n\t} catch {\n\t\treturn items.join(', ')\n\t}\n}\n\n/**\n * CnLinkedWidget — the `linked` widget: one card that lists what other apps\n * hold for this record (DqZaak \"Gekoppeld\").\n *\n * `content.leaves` names the mount-mode integration leaves, in order. Each is\n * mounted out of sight with an `onSummary(summary)` prop and reports\n * `{ count, noun, rows?, actions? }`: a leaf with something linked draws its\n * rows (`{ label, href?, run?, icon? }`); the leaves with nothing linked share\n * one line (\"Leges, contract en projecten: niets gekoppeld\") followed by their\n * actions. A leaf whose app is absent is not registered and is left out.\n *\n * @spec openspec/changes/linked-integrations-card/specs/linked-integrations-card/spec.md#requirement-one-card-lists-the-linked-integrations-of-a-record\n */\nexport default {\n\tname: 'CnLinkedWidget',\n\n\tcomponents: { CnIcon, CnLeafMountHost },\n\n\tprops: {\n\t\t/** `{ leaves: string[] }`: the integration ids, in the order to list them. */\n\t\tcontent: {\n\t\t\ttype: Object,\n\t\t\tdefault: () => ({}),\n\t\t},\n\n\t\t/** The record's id. */\n\t\tobjectId: {\n\t\t\ttype: [String, Number],\n\t\t\tdefault: '',\n\t\t},\n\n\t\t/** The record's register. */\n\t\tregister: {\n\t\t\ttype: String,\n\t\t\tdefault: '',\n\t\t},\n\n\t\t/** The record's schema. */\n\t\tschema: {\n\t\t\ttype: String,\n\t\t\tdefault: '',\n\t\t},\n\t},\n\n\tsetup() {\n\t\tconst { integrations, getById } = useIntegrationRegistry()\n\t\treturn { integrations, getById }\n\t},\n\n\tdata() {\n\t\treturn {\n\t\t\t/** The latest summary each leaf reported, by integration id. */\n\t\t\tsummaries: {},\n\t\t}\n\t},\n\n\tcomputed: {\n\t\t/** @return {string[]} The configured leaf ids. */\n\t\tleafIds() {\n\t\t\tconst leaves = this.content && this.content.leaves\n\t\t\treturn Array.isArray(leaves) ? leaves.filter((id) => typeof id === 'string' && id !== '') : []\n\t\t},\n\n\t\t/** @return {object[]} The registered mount-mode providers, in the configured order. */\n\t\tproviders() {\n\t\t\t// Read so a leaf that registers after this card renders still joins it.\n\t\t\tvoid this.integrations\n\t\t\treturn this.leafIds\n\t\t\t\t.map((id) => this.getById(id))\n\t\t\t\t.filter((p) => p && p.renderMode === 'mount' && typeof p.mount === 'function' && typeof p.unmount === 'function')\n\t\t},\n\n\t\t/** @return {object} The mount props per leaf. */\n\t\tmountPropsById() {\n\t\t\tconst context = { register: this.register, schema: this.schema, objectId: String(this.objectId || '') }\n\t\t\tconst out = {}\n\t\t\tfor (const provider of this.providers) {\n\t\t\t\tout[provider.id] = {\n\t\t\t\t\tsurface: 'detail-page',\n\t\t\t\t\t...context,\n\t\t\t\t\tintegrationContext: { ...context },\n\t\t\t\t\tonSummary: (summary) => this.onSummary(provider.id, summary),\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn out\n\t\t},\n\n\t\t/** @return {Array<{id: string, summary: object}>} The reported summaries, in order. */\n\t\treported() {\n\t\t\treturn this.providers\n\t\t\t\t.filter((p) => this.summaries[p.id])\n\t\t\t\t.map((p) => ({ id: p.id, summary: this.summaries[p.id] }))\n\t\t},\n\n\t\t/** @return {object[]} The rows of the leaves that have something linked. */\n\t\tlinkedRows() {\n\t\t\tconst rows = []\n\t\t\tfor (const { id, summary } of this.reported) {\n\t\t\t\tif (summary.count <= 0) {\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\t\t\t\tconst own = summary.rows.length > 0\n\t\t\t\t\t? summary.rows\n\t\t\t\t\t: [{ label: `${summary.noun} (${summary.count})` }]\n\t\t\t\town.forEach((row, index) => rows.push({ ...row, key: `${id}-${index}` }))\n\t\t\t}\n\t\t\treturn rows\n\t\t},\n\n\t\t/** @return {object[]} The leaves with nothing linked. */\n\t\temptyLeaves() {\n\t\t\treturn this.reported.filter(({ summary }) => summary.count <= 0)\n\t\t},\n\n\t\t/** @return {string} \"Leges, contract en projecten: niets gekoppeld\", or ''. */\n\t\temptyLine() {\n\t\t\tconst nouns = this.emptyLeaves.map(({ summary }) => summary.noun).filter((noun) => noun !== '')\n\t\t\tif (nouns.length === 0) {\n\t\t\t\treturn ''\n\t\t\t}\n\t\t\tconst list = joinList(nouns)\n\t\t\treturn t('nextcloud-vue', '{things}: nothing linked', { things: list.charAt(0).toUpperCase() + list.slice(1) })\n\t\t},\n\n\t\t/** @return {object[]} The actions of the leaves with nothing linked. */\n\t\temptyActions() {\n\t\t\tconst actions = []\n\t\t\tfor (const { id, summary } of this.emptyLeaves) {\n\t\t\t\tsummary.actions.forEach((action, index) => actions.push({ ...action, key: `${id}-${index}` }))\n\t\t\t}\n\t\t\treturn actions\n\t\t},\n\t},\n\n\tmethods: {\n\t\t/**\n\t\t * Keep a leaf's summary, normalised.\n\t\t *\n\t\t * @param {string} id The integration id.\n\t\t * @param {{count?: number, noun?: string, rows?: Array, actions?: Array}} summary What the leaf reported.\n\t\t */\n\t\tonSummary(id, summary) {\n\t\t\tconst s = summary && typeof summary === 'object' ? summary : {}\n\t\t\tconst usableRow = (row) => row && typeof row.label === 'string' && row.label !== ''\n\t\t\tconst usableAction = (action) => action && typeof action.run === 'function' && typeof action.label === 'string' && action.label !== ''\n\t\t\tthis.summaries = {\n\t\t\t\t...this.summaries,\n\t\t\t\t[id]: {\n\t\t\t\t\tcount: Number.isFinite(s.count) ? s.count : 0,\n\t\t\t\t\tnoun: typeof s.noun === 'string' ? s.noun : '',\n\t\t\t\t\trows: Array.isArray(s.rows) ? s.rows.filter(usableRow) : [],\n\t\t\t\t\tactions: Array.isArray(s.actions) ? s.actions.filter(usableAction) : [],\n\t\t\t\t},\n\t\t\t}\n\t\t},\n\t},\n}\n</script>\n\n<style scoped>\n.cn-linked-widget {\n\tdisplay: flex;\n\tflex-direction: column;\n\tgap: 10px;\n}\n\n.cn-linked-widget__rows {\n\tdisplay: flex;\n\tflex-direction: column;\n\tgap: 10px;\n\tlist-style: none;\n\tmargin: 0;\n\tpadding: 0;\n}\n\n.cn-linked-widget__link {\n\talign-items: center;\n\tbackground: none;\n\tborder: 0;\n\tcolor: var(--color-main-text);\n\tdisplay: flex;\n\tfont: inherit;\n\tfont-size: 14px;\n\tfont-weight: 600;\n\tgap: 10px;\n\tmargin: 0;\n\tmin-height: 0;\n\tpadding: 0;\n\ttext-align: start;\n}\n\na.cn-linked-widget__link,\nbutton.cn-linked-widget__link {\n\tcolor: var(--color-primary-element);\n\tcursor: pointer;\n\ttext-decoration: underline;\n}\n\n.cn-linked-widget__empty {\n\tcolor: var(--color-text-maxcontrast);\n\tfont-size: 13px;\n\tmargin: 0;\n}\n\n.cn-linked-widget__actions {\n\tdisplay: flex;\n\tflex-wrap: wrap;\n\tgap: 12px;\n}\n\n.cn-linked-widget__action {\n\tbackground: none;\n\tborder: 0;\n\tcolor: var(--color-primary-element);\n\tcursor: pointer;\n\tfont: inherit;\n\tfont-size: 14px;\n\tfont-weight: 600;\n\tmargin: 0;\n\tmin-height: 0;\n\tpadding: 0;\n\ttext-decoration: underline;\n}\n</style>\n"],"names":["CnIcon","CnLeafMountHost","t"],"mappings":";;;;;AA6EA;;AAEC;AACA;;;AAGD,SAAS,QAAQ,CAAC,KAAK,EAAE;AACxB,CAAA,IAAI;EACH,OAAO,IAAI,IAAI,CAAC,UAAU,CAAC,CAAC,WAAW,EAAC,IAAK,IAAI,EAAE,OAAO,CAAC,GAAG,EAAE,GAAG,CAAC,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,aAAc,EAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAA;AAC3H,EAAA,CAAE,MAAM;AACP,EAAA,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,CAAA;AACvB,EAAA;AACD,CAAA;;AAEA;AACC;AACA;AACA;AACA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AK,CAAC,OAAO,CAAC,CAAC,CAAC,OAAO,CAAE,GAAE,CAAC,CAAC,OAAO,CAAC,MAAM,CAAC,YAAY,CAAE,GAAE,EAAE;KACvE;AACF,KAAA;GACA;EACD;AACF;;;;"}
1
+ {"version":3,"file":"CnLinkedWidget.vue2.js","sources":["../../../../src/components/CnLinkedWidget/CnLinkedWidget.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-linked-widget\" data-testid=\"cn-linked-widget\">\n\t\t<ul v-if=\"linkedRows.length > 0\" class=\"cn-linked-widget__rows\">\n\t\t\t<li\n\t\t\t\tv-for=\"row in linkedRows\"\n\t\t\t\t:key=\"row.key\"\n\t\t\t\tclass=\"cn-linked-widget__row\"\n\t\t\t\tdata-testid=\"cn-linked-row\">\n\t\t\t\t<a v-if=\"row.href\" :href=\"row.href\" class=\"cn-linked-widget__link\">\n\t\t\t\t\t<CnIcon\n\t\t\t\t\t\tv-if=\"row.icon\"\n\t\t\t\t\t\t:name=\"row.icon\"\n\t\t\t\t\t\t:size=\"18\"\n\t\t\t\t\t\taria-hidden=\"true\" />\n\t\t\t\t\t{{ row.label }}\n\t\t\t\t</a>\n\t\t\t\t<button\n\t\t\t\t\tv-else-if=\"row.run\"\n\t\t\t\t\ttype=\"button\"\n\t\t\t\t\tclass=\"cn-linked-widget__link\"\n\t\t\t\t\t@click=\"row.run()\">\n\t\t\t\t\t<CnIcon\n\t\t\t\t\t\tv-if=\"row.icon\"\n\t\t\t\t\t\t:name=\"row.icon\"\n\t\t\t\t\t\t:size=\"18\"\n\t\t\t\t\t\taria-hidden=\"true\" />\n\t\t\t\t\t{{ row.label }}\n\t\t\t\t</button>\n\t\t\t\t<span v-else class=\"cn-linked-widget__link\">\n\t\t\t\t\t<CnIcon\n\t\t\t\t\t\tv-if=\"row.icon\"\n\t\t\t\t\t\t:name=\"row.icon\"\n\t\t\t\t\t\t:size=\"18\"\n\t\t\t\t\t\taria-hidden=\"true\" />\n\t\t\t\t\t{{ row.label }}\n\t\t\t\t</span>\n\t\t\t</li>\n\t\t</ul>\n\t\t<!-- A div, not a p: a theme's paragraph rule would draw the muted\n\t\t 13px line at body size. -->\n\t\t<div v-if=\"emptyLine\" class=\"cn-linked-widget__empty\" data-testid=\"cn-linked-empty\">\n\t\t\t{{ emptyLine }}\n\t\t</div>\n\t\t<span v-if=\"emptyActions.length > 0\" class=\"cn-linked-widget__actions\">\n\t\t\t<button\n\t\t\t\tv-for=\"action in emptyActions\"\n\t\t\t\t:key=\"action.key\"\n\t\t\t\ttype=\"button\"\n\t\t\t\tclass=\"cn-linked-widget__action\"\n\t\t\t\tdata-testid=\"cn-linked-action\"\n\t\t\t\t@click=\"action.run()\">\n\t\t\t\t{{ action.label }}\n\t\t\t</button>\n\t\t</span>\n\t\t<!-- The leaves run here, unseen: each reads its own data and reports\n\t\t a summary through `onSummary`; this card draws the rows. -->\n\t\t<div hidden class=\"cn-linked-widget__leaves\">\n\t\t\t<CnLeafMountHost\n\t\t\t\tv-for=\"provider in providers\"\n\t\t\t\t:key=\"provider.id\"\n\t\t\t\t:provider=\"provider\"\n\t\t\t\t:mountProps=\"mountPropsById[provider.id]\" />\n\t\t</div>\n\t</div>\n</template>\n\n<script>\nimport { getLanguage, translate as t } from '@nextcloud/l10n'\nimport CnIcon from '../CnIcon/CnIcon.vue'\nimport CnLeafMountHost from '../CnLeafMountHost/CnLeafMountHost.vue'\nimport { useIntegrationRegistry } from '../../composables/useIntegrationRegistry.js'\nimport { isAppInstalled } from '../../utils/appInstalled.js'\nimport { fetchReferenceObjects } from '../../utils/boardReferenceColumns.js'\nimport { fillTemplate } from '../../utils/fillTemplate.js'\nimport { prefixUrl } from '../../utils/headers.js'\n\n/**\n * Join nouns as a sentence list in the user's language (\"a, b en c\").\n *\n * @param {string[]} items The nouns.\n * @return {string} The list.\n */\nfunction joinList(items) {\n\ttry {\n\t\treturn new Intl.ListFormat((getLanguage() || 'en').replace('_', '-'), { style: 'long', type: 'conjunction' }).format(items)\n\t} catch {\n\t\treturn items.join(', ')\n\t}\n}\n\n/**\n * CnLinkedWidget — the `linked` widget: one card that lists what other apps\n * hold for this record (DqZaak \"Gekoppeld\").\n *\n * `content.leaves` names the mount-mode integration leaves, in order. Each is\n * mounted out of sight with an `onSummary(summary)` prop and reports\n * `{ count, noun, rows?, actions? }`: a leaf with something linked draws its\n * rows (`{ label, href?, run?, icon? }`); the leaves with nothing linked share\n * one line (\"Leges, contract en projecten: niets gekoppeld\") followed by their\n * actions. A leaf whose app is absent is not registered and is left out.\n *\n * A leaf may also be a record leaf, written in the manifest instead of\n * registered by an app: `{ id, register, schema, filter?, requiredApp?, noun,\n * label, href?, icon? }`. The card reads that register's records matching\n * `filter` (`@objectId` is this record's id) and lists one row per record,\n * `label` and `href` filled from it (DqZaak \"Vraag in pipelinq\": the\n * requests whose case reference is this case). It is left out when\n * `requiredApp` is not installed. Texts go through the host translate.\n *\n * @spec openspec/changes/linked-integrations-card/specs/linked-integrations-card/spec.md#requirement-one-card-lists-the-linked-integrations-of-a-record\n */\nexport default {\n\tname: 'CnLinkedWidget',\n\n\tcomponents: { CnIcon, CnLeafMountHost },\n\n\tinject: {\n\t\t/** The host app's translate (CnAppRoot `cnTranslate`). */\n\t\tcnTranslate: { default: () => (key) => key },\n\t},\n\n\tprops: {\n\t\t/** `{ leaves: Array<string|object> }`: integration ids or record leaves, in the order to list them. */\n\t\tcontent: {\n\t\t\ttype: Object,\n\t\t\tdefault: () => ({}),\n\t\t},\n\n\t\t/** The record's id. */\n\t\tobjectId: {\n\t\t\ttype: [String, Number],\n\t\t\tdefault: '',\n\t\t},\n\n\t\t/** The record's register. */\n\t\tregister: {\n\t\t\ttype: String,\n\t\t\tdefault: '',\n\t\t},\n\n\t\t/** The record's schema. */\n\t\tschema: {\n\t\t\ttype: String,\n\t\t\tdefault: '',\n\t\t},\n\t},\n\n\tsetup() {\n\t\tconst { integrations, getById } = useIntegrationRegistry()\n\t\treturn { integrations, getById }\n\t},\n\n\tdata() {\n\t\treturn {\n\t\t\t/** The latest summary each leaf reported, by integration id. */\n\t\t\tsummaries: {},\n\t\t}\n\t},\n\n\tcomputed: {\n\t\t/** @return {Array<string|object>} The configured leaves. */\n\t\tleaves() {\n\t\t\tconst leaves = this.content && this.content.leaves\n\t\t\treturn Array.isArray(leaves) ? leaves : []\n\t\t},\n\n\t\t/** @return {string[]} The configured integration ids. */\n\t\tleafIds() {\n\t\t\treturn this.leaves.filter((id) => typeof id === 'string' && id !== '')\n\t\t},\n\n\t\t/** @return {object[]} The record leaves whose app is here. */\n\t\trecordLeaves() {\n\t\t\treturn this.leaves.filter((leaf) => leaf && typeof leaf === 'object' && typeof leaf.id === 'string' && leaf.id !== ''\n\t\t\t\t&& leaf.register && leaf.schema && (!leaf.requiredApp || isAppInstalled(leaf.requiredApp)))\n\t\t},\n\n\t\t/** @return {string[]} Every listed leaf's id, in the configured order. */\n\t\torderedIds() {\n\t\t\tconst providers = new Set(this.providers.map((p) => p.id))\n\t\t\tconst records = new Set(this.recordLeaves.map((leaf) => leaf.id))\n\t\t\treturn this.leaves\n\t\t\t\t.map((leaf) => (typeof leaf === 'string' ? leaf : (leaf && leaf.id)))\n\t\t\t\t.filter((id) => providers.has(id) || records.has(id))\n\t\t},\n\n\t\t/** @return {object[]} The registered mount-mode providers, in the configured order. */\n\t\tproviders() {\n\t\t\t// Read so a leaf that registers after this card renders still joins it.\n\t\t\tvoid this.integrations\n\t\t\treturn this.leafIds\n\t\t\t\t.map((id) => this.getById(id))\n\t\t\t\t.filter((p) => p && p.renderMode === 'mount' && typeof p.mount === 'function' && typeof p.unmount === 'function')\n\t\t},\n\n\t\t/** @return {object} The mount props per leaf. */\n\t\tmountPropsById() {\n\t\t\tconst context = { register: this.register, schema: this.schema, objectId: String(this.objectId || '') }\n\t\t\tconst out = {}\n\t\t\tfor (const provider of this.providers) {\n\t\t\t\tout[provider.id] = {\n\t\t\t\t\tsurface: 'detail-page',\n\t\t\t\t\t...context,\n\t\t\t\t\tintegrationContext: { ...context },\n\t\t\t\t\tonSummary: (summary) => this.onSummary(provider.id, summary),\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn out\n\t\t},\n\n\t\t/** @return {Array<{id: string, summary: object}>} The reported summaries, in order. */\n\t\treported() {\n\t\t\treturn this.orderedIds\n\t\t\t\t.filter((id) => this.summaries[id])\n\t\t\t\t.map((id) => ({ id, summary: this.summaries[id] }))\n\t\t},\n\n\t\t/** @return {object[]} The rows of the leaves that have something linked. */\n\t\tlinkedRows() {\n\t\t\tconst rows = []\n\t\t\tfor (const { id, summary } of this.reported) {\n\t\t\t\tif (summary.count <= 0) {\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\t\t\t\tconst own = summary.rows.length > 0\n\t\t\t\t\t? summary.rows\n\t\t\t\t\t: [{ label: `${summary.noun} (${summary.count})` }]\n\t\t\t\town.forEach((row, index) => rows.push({ ...row, key: `${id}-${index}` }))\n\t\t\t}\n\t\t\treturn rows\n\t\t},\n\n\t\t/** @return {object[]} The leaves with nothing linked. */\n\t\temptyLeaves() {\n\t\t\treturn this.reported.filter(({ summary }) => summary.count <= 0)\n\t\t},\n\n\t\t/** @return {string} \"Leges, contract en projecten: niets gekoppeld\", or ''. */\n\t\temptyLine() {\n\t\t\tconst nouns = this.emptyLeaves.map(({ summary }) => summary.noun).filter((noun) => noun !== '')\n\t\t\tif (nouns.length === 0) {\n\t\t\t\treturn ''\n\t\t\t}\n\t\t\tconst list = joinList(nouns)\n\t\t\treturn t('nextcloud-vue', '{things}: nothing linked', { things: list.charAt(0).toUpperCase() + list.slice(1) })\n\t\t},\n\n\t\t/** @return {object[]} The actions of the leaves with nothing linked. */\n\t\temptyActions() {\n\t\t\tconst actions = []\n\t\t\tfor (const { id, summary } of this.emptyLeaves) {\n\t\t\t\tsummary.actions.forEach((action, index) => actions.push({ ...action, key: `${id}-${index}` }))\n\t\t\t}\n\t\t\treturn actions\n\t\t},\n\t},\n\n\twatch: {\n\t\trecordLeaves: {\n\t\t\thandler() {\n\t\t\t\tthis.recordLeaves.forEach((leaf) => this.readRecordLeaf(leaf))\n\t\t\t},\n\n\t\t\timmediate: true,\n\t\t},\n\n\t\tobjectId() {\n\t\t\tthis.recordLeaves.forEach((leaf) => this.readRecordLeaf(leaf))\n\t\t},\n\t},\n\n\tmethods: {\n\t\t/**\n\t\t * Read a record leaf's records and report them as its summary. A\n\t\t * failed read reports nothing, so the leaf is not listed as empty.\n\t\t *\n\t\t * @param {object} leaf The record leaf.\n\t\t * @return {Promise<void>}\n\t\t */\n\t\tasync readRecordLeaf(leaf) {\n\t\t\tconst objectId = String(this.objectId || '')\n\t\t\tif (objectId === '') {\n\t\t\t\treturn\n\t\t\t}\n\t\t\tconst filter = {}\n\t\t\tfor (const [key, value] of Object.entries(leaf.filter || {})) {\n\t\t\t\tfilter[key] = value === '@objectId' ? objectId : value\n\t\t\t}\n\t\t\tlet rows\n\t\t\ttry {\n\t\t\t\trows = await fetchReferenceObjects({ register: leaf.register, schema: leaf.schema, filter, limit: leaf.limit || 20 })\n\t\t\t} catch {\n\t\t\t\treturn\n\t\t\t}\n\t\t\tconst label = leaf.label ? this.cnTranslate(leaf.label) : ''\n\t\t\tthis.onSummary(leaf.id, {\n\t\t\t\tcount: rows.length,\n\t\t\t\tnoun: leaf.noun ? this.cnTranslate(leaf.noun) : '',\n\t\t\t\trows: rows.map((row) => {\n\t\t\t\t\tconst href = leaf.href ? fillTemplate(leaf.href, row) : ''\n\t\t\t\t\treturn { label: fillTemplate(label, row), href: href ? prefixUrl(href) : undefined, icon: leaf.icon || undefined }\n\t\t\t\t}),\n\t\t\t})\n\t\t},\n\n\t\t/**\n\t\t * Keep a leaf's summary, normalised.\n\t\t *\n\t\t * @param {string} id The integration id.\n\t\t * @param {{count?: number, noun?: string, rows?: Array, actions?: Array}} summary What the leaf reported.\n\t\t */\n\t\tonSummary(id, summary) {\n\t\t\tconst s = summary && typeof summary === 'object' ? summary : {}\n\t\t\tconst usableRow = (row) => row && typeof row.label === 'string' && row.label !== ''\n\t\t\tconst usableAction = (action) => action && typeof action.run === 'function' && typeof action.label === 'string' && action.label !== ''\n\t\t\tthis.summaries = {\n\t\t\t\t...this.summaries,\n\t\t\t\t[id]: {\n\t\t\t\t\tcount: Number.isFinite(s.count) ? s.count : 0,\n\t\t\t\t\tnoun: typeof s.noun === 'string' ? s.noun : '',\n\t\t\t\t\trows: Array.isArray(s.rows) ? s.rows.filter(usableRow) : [],\n\t\t\t\t\tactions: Array.isArray(s.actions) ? s.actions.filter(usableAction) : [],\n\t\t\t\t},\n\t\t\t}\n\t\t},\n\t},\n}\n</script>\n\n<style scoped>\n.cn-linked-widget {\n\tdisplay: flex;\n\tflex-direction: column;\n\tgap: 10px;\n}\n\n.cn-linked-widget__rows {\n\tdisplay: flex;\n\tflex-direction: column;\n\tgap: 10px;\n\tlist-style: none;\n\tmargin: 0;\n\tpadding: 0;\n}\n\n.cn-linked-widget__link {\n\talign-items: center;\n\tbackground: none;\n\tborder: 0;\n\tcolor: var(--color-main-text);\n\tdisplay: flex;\n\tfont: inherit;\n\tfont-size: 14px;\n\tfont-weight: 600;\n\tgap: 10px;\n\tmargin: 0;\n\tmin-height: 0;\n\tpadding: 0;\n\ttext-align: start;\n}\n\na.cn-linked-widget__link,\nbutton.cn-linked-widget__link {\n\tcolor: var(--color-primary-element);\n\tcursor: pointer;\n\ttext-decoration: underline;\n}\n\n.cn-linked-widget__empty {\n\tcolor: var(--color-text-maxcontrast);\n\tfont-size: 13px;\n\tmargin: 0;\n}\n\n.cn-linked-widget__actions {\n\tdisplay: flex;\n\tflex-wrap: wrap;\n\tgap: 12px;\n}\n\n.cn-linked-widget__action {\n\tbackground: none;\n\tborder: 0;\n\tcolor: var(--color-primary-element);\n\tcursor: pointer;\n\tfont: inherit;\n\tfont-size: 14px;\n\tfont-weight: 600;\n\tmargin: 0;\n\tmin-height: 0;\n\tpadding: 0;\n\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,QAAS,GAAE,OAAQ,GAAE,GAAC;AAC9D,GAAA,MAAM,YAAY,CAAC,GAAG,KAAK,GAAE,IAAK,OAAO,GAAG,CAAC,KAAI,KAAM,QAAO,IAAK,GAAG,CAAC,KAAI,KAAM,GAAC;GAClF,MAAM,YAAa,GAAE,CAAC,MAAM,KAAK,MAAO,IAAG,OAAO,MAAM,CAAC,GAAI,KAAI,cAAc,OAAO,MAAM,CAAC,KAAM,KAAI,QAAO,IAAK,MAAM,CAAC,KAAM,KAAI,GAAC;AACrI,GAAA,IAAI,CAAC,YAAY;AAChB,IAAA,GAAG,IAAI,CAAC,SAAS;IACjB,CAAC,EAAE,GAAG;AACL,KAAA,KAAK,EAAE,MAAM,CAAC,QAAQ,CAAC,CAAC,CAAC,KAAK,CAAA,GAAI,CAAC,CAAC,KAAI,GAAI,CAAC;AAC7C,KAAA,IAAI,EAAE,OAAO,CAAC,CAAC,SAAS,QAAS,GAAE,CAAC,CAAC,IAAK,GAAE,EAAE;KAC9C,IAAI,EAAE,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,IAAI,CAAE,GAAE,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,SAAS,CAAA,GAAI,EAAE;AAC3D,KAAA,OAAO,EAAE,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,OAAO,CAAE,GAAE,CAAC,CAAC,OAAO,CAAC,MAAM,CAAC,YAAY,CAAE,GAAE,EAAE;KACvE;AACF,KAAA;GACA;EACD;AACF;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"CnLinkedWidget.vue3.js","sources":["../../../../src/components/CnLinkedWidget/CnLinkedWidget.vue?vue&type=template&id=0fc31606&lang.js"],"sourcesContent":["<!--\n - SPDX-FileCopyrightText: 2026 Conduction B.V.\n - SPDX-License-Identifier: EUPL-1.2\n-->\n\n<template>\n\t<div class=\"cn-linked-widget\" data-testid=\"cn-linked-widget\">\n\t\t<ul v-if=\"linkedRows.length > 0\" class=\"cn-linked-widget__rows\">\n\t\t\t<li\n\t\t\t\tv-for=\"row in linkedRows\"\n\t\t\t\t:key=\"row.key\"\n\t\t\t\tclass=\"cn-linked-widget__row\"\n\t\t\t\tdata-testid=\"cn-linked-row\">\n\t\t\t\t<a v-if=\"row.href\" :href=\"row.href\" class=\"cn-linked-widget__link\">\n\t\t\t\t\t<CnIcon\n\t\t\t\t\t\tv-if=\"row.icon\"\n\t\t\t\t\t\t:name=\"row.icon\"\n\t\t\t\t\t\t:size=\"18\"\n\t\t\t\t\t\taria-hidden=\"true\" />\n\t\t\t\t\t{{ row.label }}\n\t\t\t\t</a>\n\t\t\t\t<button\n\t\t\t\t\tv-else-if=\"row.run\"\n\t\t\t\t\ttype=\"button\"\n\t\t\t\t\tclass=\"cn-linked-widget__link\"\n\t\t\t\t\t@click=\"row.run()\">\n\t\t\t\t\t<CnIcon\n\t\t\t\t\t\tv-if=\"row.icon\"\n\t\t\t\t\t\t:name=\"row.icon\"\n\t\t\t\t\t\t:size=\"18\"\n\t\t\t\t\t\taria-hidden=\"true\" />\n\t\t\t\t\t{{ row.label }}\n\t\t\t\t</button>\n\t\t\t\t<span v-else class=\"cn-linked-widget__link\">\n\t\t\t\t\t<CnIcon\n\t\t\t\t\t\tv-if=\"row.icon\"\n\t\t\t\t\t\t:name=\"row.icon\"\n\t\t\t\t\t\t:size=\"18\"\n\t\t\t\t\t\taria-hidden=\"true\" />\n\t\t\t\t\t{{ row.label }}\n\t\t\t\t</span>\n\t\t\t</li>\n\t\t</ul>\n\t\t<!-- A div, not a p: a theme's paragraph rule would draw the muted\n\t\t 13px line at body size. -->\n\t\t<div v-if=\"emptyLine\" class=\"cn-linked-widget__empty\" data-testid=\"cn-linked-empty\">\n\t\t\t{{ emptyLine }}\n\t\t</div>\n\t\t<span v-if=\"emptyActions.length > 0\" class=\"cn-linked-widget__actions\">\n\t\t\t<button\n\t\t\t\tv-for=\"action in emptyActions\"\n\t\t\t\t:key=\"action.key\"\n\t\t\t\ttype=\"button\"\n\t\t\t\tclass=\"cn-linked-widget__action\"\n\t\t\t\tdata-testid=\"cn-linked-action\"\n\t\t\t\t@click=\"action.run()\">\n\t\t\t\t{{ action.label }}\n\t\t\t</button>\n\t\t</span>\n\t\t<!-- The leaves run here, unseen: each reads its own data and reports\n\t\t a summary through `onSummary`; this card draws the rows. -->\n\t\t<div hidden class=\"cn-linked-widget__leaves\">\n\t\t\t<CnLeafMountHost\n\t\t\t\tv-for=\"provider in providers\"\n\t\t\t\t:key=\"provider.id\"\n\t\t\t\t:provider=\"provider\"\n\t\t\t\t:mountProps=\"mountPropsById[provider.id]\" />\n\t\t</div>\n\t</div>\n</template>\n\n<script>\nimport { getLanguage, translate as t } from '@nextcloud/l10n'\nimport CnIcon from '../CnIcon/CnIcon.vue'\nimport CnLeafMountHost from '../CnLeafMountHost/CnLeafMountHost.vue'\nimport { useIntegrationRegistry } from '../../composables/useIntegrationRegistry.js'\n\n/**\n * Join nouns as a sentence list in the user's language (\"a, b en c\").\n *\n * @param {string[]} items The nouns.\n * @return {string} The list.\n */\nfunction joinList(items) {\n\ttry {\n\t\treturn new Intl.ListFormat((getLanguage() || 'en').replace('_', '-'), { style: 'long', type: 'conjunction' }).format(items)\n\t} catch {\n\t\treturn items.join(', ')\n\t}\n}\n\n/**\n * CnLinkedWidget — the `linked` widget: one card that lists what other apps\n * hold for this record (DqZaak \"Gekoppeld\").\n *\n * `content.leaves` names the mount-mode integration leaves, in order. Each is\n * mounted out of sight with an `onSummary(summary)` prop and reports\n * `{ count, noun, rows?, actions? }`: a leaf with something linked draws its\n * rows (`{ label, href?, run?, icon? }`); the leaves with nothing linked share\n * one line (\"Leges, contract en projecten: niets gekoppeld\") followed by their\n * actions. A leaf whose app is absent is not registered and is left out.\n *\n * @spec openspec/changes/linked-integrations-card/specs/linked-integrations-card/spec.md#requirement-one-card-lists-the-linked-integrations-of-a-record\n */\nexport default {\n\tname: 'CnLinkedWidget',\n\n\tcomponents: { CnIcon, CnLeafMountHost },\n\n\tprops: {\n\t\t/** `{ leaves: string[] }`: the integration ids, in the order to list them. */\n\t\tcontent: {\n\t\t\ttype: Object,\n\t\t\tdefault: () => ({}),\n\t\t},\n\n\t\t/** The record's id. */\n\t\tobjectId: {\n\t\t\ttype: [String, Number],\n\t\t\tdefault: '',\n\t\t},\n\n\t\t/** The record's register. */\n\t\tregister: {\n\t\t\ttype: String,\n\t\t\tdefault: '',\n\t\t},\n\n\t\t/** The record's schema. */\n\t\tschema: {\n\t\t\ttype: String,\n\t\t\tdefault: '',\n\t\t},\n\t},\n\n\tsetup() {\n\t\tconst { integrations, getById } = useIntegrationRegistry()\n\t\treturn { integrations, getById }\n\t},\n\n\tdata() {\n\t\treturn {\n\t\t\t/** The latest summary each leaf reported, by integration id. */\n\t\t\tsummaries: {},\n\t\t}\n\t},\n\n\tcomputed: {\n\t\t/** @return {string[]} The configured leaf ids. */\n\t\tleafIds() {\n\t\t\tconst leaves = this.content && this.content.leaves\n\t\t\treturn Array.isArray(leaves) ? leaves.filter((id) => typeof id === 'string' && id !== '') : []\n\t\t},\n\n\t\t/** @return {object[]} The registered mount-mode providers, in the configured order. */\n\t\tproviders() {\n\t\t\t// Read so a leaf that registers after this card renders still joins it.\n\t\t\tvoid this.integrations\n\t\t\treturn this.leafIds\n\t\t\t\t.map((id) => this.getById(id))\n\t\t\t\t.filter((p) => p && p.renderMode === 'mount' && typeof p.mount === 'function' && typeof p.unmount === 'function')\n\t\t},\n\n\t\t/** @return {object} The mount props per leaf. */\n\t\tmountPropsById() {\n\t\t\tconst context = { register: this.register, schema: this.schema, objectId: String(this.objectId || '') }\n\t\t\tconst out = {}\n\t\t\tfor (const provider of this.providers) {\n\t\t\t\tout[provider.id] = {\n\t\t\t\t\tsurface: 'detail-page',\n\t\t\t\t\t...context,\n\t\t\t\t\tintegrationContext: { ...context },\n\t\t\t\t\tonSummary: (summary) => this.onSummary(provider.id, summary),\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn out\n\t\t},\n\n\t\t/** @return {Array<{id: string, summary: object}>} The reported summaries, in order. */\n\t\treported() {\n\t\t\treturn this.providers\n\t\t\t\t.filter((p) => this.summaries[p.id])\n\t\t\t\t.map((p) => ({ id: p.id, summary: this.summaries[p.id] }))\n\t\t},\n\n\t\t/** @return {object[]} The rows of the leaves that have something linked. */\n\t\tlinkedRows() {\n\t\t\tconst rows = []\n\t\t\tfor (const { id, summary } of this.reported) {\n\t\t\t\tif (summary.count <= 0) {\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\t\t\t\tconst own = summary.rows.length > 0\n\t\t\t\t\t? summary.rows\n\t\t\t\t\t: [{ label: `${summary.noun} (${summary.count})` }]\n\t\t\t\town.forEach((row, index) => rows.push({ ...row, key: `${id}-${index}` }))\n\t\t\t}\n\t\t\treturn rows\n\t\t},\n\n\t\t/** @return {object[]} The leaves with nothing linked. */\n\t\temptyLeaves() {\n\t\t\treturn this.reported.filter(({ summary }) => summary.count <= 0)\n\t\t},\n\n\t\t/** @return {string} \"Leges, contract en projecten: niets gekoppeld\", or ''. */\n\t\temptyLine() {\n\t\t\tconst nouns = this.emptyLeaves.map(({ summary }) => summary.noun).filter((noun) => noun !== '')\n\t\t\tif (nouns.length === 0) {\n\t\t\t\treturn ''\n\t\t\t}\n\t\t\tconst list = joinList(nouns)\n\t\t\treturn t('nextcloud-vue', '{things}: nothing linked', { things: list.charAt(0).toUpperCase() + list.slice(1) })\n\t\t},\n\n\t\t/** @return {object[]} The actions of the leaves with nothing linked. */\n\t\temptyActions() {\n\t\t\tconst actions = []\n\t\t\tfor (const { id, summary } of this.emptyLeaves) {\n\t\t\t\tsummary.actions.forEach((action, index) => actions.push({ ...action, key: `${id}-${index}` }))\n\t\t\t}\n\t\t\treturn actions\n\t\t},\n\t},\n\n\tmethods: {\n\t\t/**\n\t\t * Keep a leaf's summary, normalised.\n\t\t *\n\t\t * @param {string} id The integration id.\n\t\t * @param {{count?: number, noun?: string, rows?: Array, actions?: Array}} summary What the leaf reported.\n\t\t */\n\t\tonSummary(id, summary) {\n\t\t\tconst s = summary && typeof summary === 'object' ? summary : {}\n\t\t\tconst usableRow = (row) => row && typeof row.label === 'string' && row.label !== ''\n\t\t\tconst usableAction = (action) => action && typeof action.run === 'function' && typeof action.label === 'string' && action.label !== ''\n\t\t\tthis.summaries = {\n\t\t\t\t...this.summaries,\n\t\t\t\t[id]: {\n\t\t\t\t\tcount: Number.isFinite(s.count) ? s.count : 0,\n\t\t\t\t\tnoun: typeof s.noun === 'string' ? s.noun : '',\n\t\t\t\t\trows: Array.isArray(s.rows) ? s.rows.filter(usableRow) : [],\n\t\t\t\t\tactions: Array.isArray(s.actions) ? s.actions.filter(usableAction) : [],\n\t\t\t\t},\n\t\t\t}\n\t\t},\n\t},\n}\n</script>\n\n<style scoped>\n.cn-linked-widget {\n\tdisplay: flex;\n\tflex-direction: column;\n\tgap: 10px;\n}\n\n.cn-linked-widget__rows {\n\tdisplay: flex;\n\tflex-direction: column;\n\tgap: 10px;\n\tlist-style: none;\n\tmargin: 0;\n\tpadding: 0;\n}\n\n.cn-linked-widget__link {\n\talign-items: center;\n\tbackground: none;\n\tborder: 0;\n\tcolor: var(--color-main-text);\n\tdisplay: flex;\n\tfont: inherit;\n\tfont-size: 14px;\n\tfont-weight: 600;\n\tgap: 10px;\n\tmargin: 0;\n\tmin-height: 0;\n\tpadding: 0;\n\ttext-align: start;\n}\n\na.cn-linked-widget__link,\nbutton.cn-linked-widget__link {\n\tcolor: var(--color-primary-element);\n\tcursor: pointer;\n\ttext-decoration: underline;\n}\n\n.cn-linked-widget__empty {\n\tcolor: var(--color-text-maxcontrast);\n\tfont-size: 13px;\n\tmargin: 0;\n}\n\n.cn-linked-widget__actions {\n\tdisplay: flex;\n\tflex-wrap: wrap;\n\tgap: 12px;\n}\n\n.cn-linked-widget__action {\n\tbackground: none;\n\tborder: 0;\n\tcolor: var(--color-primary-element);\n\tcursor: pointer;\n\tfont: inherit;\n\tfont-size: 14px;\n\tfont-weight: 600;\n\tmargin: 0;\n\tmin-height: 0;\n\tpadding: 0;\n\ttext-decoration: underline;\n}\n</style>\n"],"names":["_createElementBlock","_Fragment","_renderList","_createBlock","_toDisplayString","_openBlock","_createElementVNode"],"mappings":";;;AAWM,EAAA,KAAK,EAAC,kBAAkB;AAAC,EAAA,aAAC,EAAA,kBAAA;;;;AACD,EAAA,KAAA,EAAA,wBAAA;;;;;;AA0Bd,EAAA,KAAK,EAAC,wBAAG;;;;AAYF,EAAA,KAAK,EAAC,yBAAG;AAAA,EAAA,aAAA,EAAA,iBAAA;;;;AAGE,EAAA,KAAA,EAAA,2BAAA;;;;AAa5B,EAAA,MAAM,EAAN,EAAM;AAAC,EAAA,KAAK,EAAC,0BAA0B;;;;;;;;AAtDlC,IAAA,CAAA,QAAA,CAAA,UAAU,CAAC,MAAM,GAAA,CAAA;yCAmCtB,gBAAA,EAAA;4BAlCHA,kBAiCI,CAAAC,QAAA,EAAA,IAAA,EAAAC,UAAA,CAhCG,QAAA,CAAA,UAAA,EAAA,CAAA,GAAA,KAAA;iCADPF,kBAiCI,CAAA,IAAA,EAAA;cA/BF,GAAE,EAAE,GAAG,CAAC,GAAG;AACX,cAAA,KAAG,EAAC,uBAAW;AACf,cAAA,aAAS,EAAA,eAAA;;AACF,cAAA,CAAA,GAAG,CAAC,IAAI;gCAAfA,kBAOE,CAAA,GAAA,EAAA;;wBAPkB,EAAA,GAAA,CAAA,IAAA;AAAA,oBAAA,KAAA,EAAA,wBAAA;;AAEnB,oBAAA,CAAA,GAAA,CAAA,IAAA;sCADFG,WAIY,CAAA,iBAAA,EAAA;;0BAFV,IAAG,EAAA,GAAA,CAAA,IAAA;AACH,0BAAA,IAAI,EAAE,EAAE;AACT,0BAAA,aAAW,EAAA,MAAA;;;oCAAA,GACZ,GAAAC,eAAA,CAAG,GAAG,CAAC,KAAK,CAAA,EAAA,CAAA,YAAA;;AAGD,kBAAA,CAAA,GAAG,CAAC,GAAA;kCADfJ,kBAWQ,CAAA,QAAA,EAAA;;AATP,sBAAA,IAAG,EAA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MAAK,CAAE,KAAK,CAAA,EAAA,CAAA,oBAAA,UAAA,CAAA,CAAA;;;;AAKf,IAAAE,kBAAA,QAAA;wBACDN,8CACG,QAAA,CAAA,SAAA,EAAA,CAAA,QAAA,KAAA;6BADHG;;;;;;;;;;;;"}
1
+ {"version":3,"file":"CnLinkedWidget.vue3.js","sources":["../../../../src/components/CnLinkedWidget/CnLinkedWidget.vue?vue&type=template&id=744b4be8&lang.js"],"sourcesContent":["<!--\n - SPDX-FileCopyrightText: 2026 Conduction B.V.\n - SPDX-License-Identifier: EUPL-1.2\n-->\n\n<template>\n\t<div class=\"cn-linked-widget\" data-testid=\"cn-linked-widget\">\n\t\t<ul v-if=\"linkedRows.length > 0\" class=\"cn-linked-widget__rows\">\n\t\t\t<li\n\t\t\t\tv-for=\"row in linkedRows\"\n\t\t\t\t:key=\"row.key\"\n\t\t\t\tclass=\"cn-linked-widget__row\"\n\t\t\t\tdata-testid=\"cn-linked-row\">\n\t\t\t\t<a v-if=\"row.href\" :href=\"row.href\" class=\"cn-linked-widget__link\">\n\t\t\t\t\t<CnIcon\n\t\t\t\t\t\tv-if=\"row.icon\"\n\t\t\t\t\t\t:name=\"row.icon\"\n\t\t\t\t\t\t:size=\"18\"\n\t\t\t\t\t\taria-hidden=\"true\" />\n\t\t\t\t\t{{ row.label }}\n\t\t\t\t</a>\n\t\t\t\t<button\n\t\t\t\t\tv-else-if=\"row.run\"\n\t\t\t\t\ttype=\"button\"\n\t\t\t\t\tclass=\"cn-linked-widget__link\"\n\t\t\t\t\t@click=\"row.run()\">\n\t\t\t\t\t<CnIcon\n\t\t\t\t\t\tv-if=\"row.icon\"\n\t\t\t\t\t\t:name=\"row.icon\"\n\t\t\t\t\t\t:size=\"18\"\n\t\t\t\t\t\taria-hidden=\"true\" />\n\t\t\t\t\t{{ row.label }}\n\t\t\t\t</button>\n\t\t\t\t<span v-else class=\"cn-linked-widget__link\">\n\t\t\t\t\t<CnIcon\n\t\t\t\t\t\tv-if=\"row.icon\"\n\t\t\t\t\t\t:name=\"row.icon\"\n\t\t\t\t\t\t:size=\"18\"\n\t\t\t\t\t\taria-hidden=\"true\" />\n\t\t\t\t\t{{ row.label }}\n\t\t\t\t</span>\n\t\t\t</li>\n\t\t</ul>\n\t\t<!-- A div, not a p: a theme's paragraph rule would draw the muted\n\t\t 13px line at body size. -->\n\t\t<div v-if=\"emptyLine\" class=\"cn-linked-widget__empty\" data-testid=\"cn-linked-empty\">\n\t\t\t{{ emptyLine }}\n\t\t</div>\n\t\t<span v-if=\"emptyActions.length > 0\" class=\"cn-linked-widget__actions\">\n\t\t\t<button\n\t\t\t\tv-for=\"action in emptyActions\"\n\t\t\t\t:key=\"action.key\"\n\t\t\t\ttype=\"button\"\n\t\t\t\tclass=\"cn-linked-widget__action\"\n\t\t\t\tdata-testid=\"cn-linked-action\"\n\t\t\t\t@click=\"action.run()\">\n\t\t\t\t{{ action.label }}\n\t\t\t</button>\n\t\t</span>\n\t\t<!-- The leaves run here, unseen: each reads its own data and reports\n\t\t a summary through `onSummary`; this card draws the rows. -->\n\t\t<div hidden class=\"cn-linked-widget__leaves\">\n\t\t\t<CnLeafMountHost\n\t\t\t\tv-for=\"provider in providers\"\n\t\t\t\t:key=\"provider.id\"\n\t\t\t\t:provider=\"provider\"\n\t\t\t\t:mountProps=\"mountPropsById[provider.id]\" />\n\t\t</div>\n\t</div>\n</template>\n\n<script>\nimport { getLanguage, translate as t } from '@nextcloud/l10n'\nimport CnIcon from '../CnIcon/CnIcon.vue'\nimport CnLeafMountHost from '../CnLeafMountHost/CnLeafMountHost.vue'\nimport { useIntegrationRegistry } from '../../composables/useIntegrationRegistry.js'\nimport { isAppInstalled } from '../../utils/appInstalled.js'\nimport { fetchReferenceObjects } from '../../utils/boardReferenceColumns.js'\nimport { fillTemplate } from '../../utils/fillTemplate.js'\nimport { prefixUrl } from '../../utils/headers.js'\n\n/**\n * Join nouns as a sentence list in the user's language (\"a, b en c\").\n *\n * @param {string[]} items The nouns.\n * @return {string} The list.\n */\nfunction joinList(items) {\n\ttry {\n\t\treturn new Intl.ListFormat((getLanguage() || 'en').replace('_', '-'), { style: 'long', type: 'conjunction' }).format(items)\n\t} catch {\n\t\treturn items.join(', ')\n\t}\n}\n\n/**\n * CnLinkedWidget — the `linked` widget: one card that lists what other apps\n * hold for this record (DqZaak \"Gekoppeld\").\n *\n * `content.leaves` names the mount-mode integration leaves, in order. Each is\n * mounted out of sight with an `onSummary(summary)` prop and reports\n * `{ count, noun, rows?, actions? }`: a leaf with something linked draws its\n * rows (`{ label, href?, run?, icon? }`); the leaves with nothing linked share\n * one line (\"Leges, contract en projecten: niets gekoppeld\") followed by their\n * actions. A leaf whose app is absent is not registered and is left out.\n *\n * A leaf may also be a record leaf, written in the manifest instead of\n * registered by an app: `{ id, register, schema, filter?, requiredApp?, noun,\n * label, href?, icon? }`. The card reads that register's records matching\n * `filter` (`@objectId` is this record's id) and lists one row per record,\n * `label` and `href` filled from it (DqZaak \"Vraag in pipelinq\": the\n * requests whose case reference is this case). It is left out when\n * `requiredApp` is not installed. Texts go through the host translate.\n *\n * @spec openspec/changes/linked-integrations-card/specs/linked-integrations-card/spec.md#requirement-one-card-lists-the-linked-integrations-of-a-record\n */\nexport default {\n\tname: 'CnLinkedWidget',\n\n\tcomponents: { CnIcon, CnLeafMountHost },\n\n\tinject: {\n\t\t/** The host app's translate (CnAppRoot `cnTranslate`). */\n\t\tcnTranslate: { default: () => (key) => key },\n\t},\n\n\tprops: {\n\t\t/** `{ leaves: Array<string|object> }`: integration ids or record leaves, in the order to list them. */\n\t\tcontent: {\n\t\t\ttype: Object,\n\t\t\tdefault: () => ({}),\n\t\t},\n\n\t\t/** The record's id. */\n\t\tobjectId: {\n\t\t\ttype: [String, Number],\n\t\t\tdefault: '',\n\t\t},\n\n\t\t/** The record's register. */\n\t\tregister: {\n\t\t\ttype: String,\n\t\t\tdefault: '',\n\t\t},\n\n\t\t/** The record's schema. */\n\t\tschema: {\n\t\t\ttype: String,\n\t\t\tdefault: '',\n\t\t},\n\t},\n\n\tsetup() {\n\t\tconst { integrations, getById } = useIntegrationRegistry()\n\t\treturn { integrations, getById }\n\t},\n\n\tdata() {\n\t\treturn {\n\t\t\t/** The latest summary each leaf reported, by integration id. */\n\t\t\tsummaries: {},\n\t\t}\n\t},\n\n\tcomputed: {\n\t\t/** @return {Array<string|object>} The configured leaves. */\n\t\tleaves() {\n\t\t\tconst leaves = this.content && this.content.leaves\n\t\t\treturn Array.isArray(leaves) ? leaves : []\n\t\t},\n\n\t\t/** @return {string[]} The configured integration ids. */\n\t\tleafIds() {\n\t\t\treturn this.leaves.filter((id) => typeof id === 'string' && id !== '')\n\t\t},\n\n\t\t/** @return {object[]} The record leaves whose app is here. */\n\t\trecordLeaves() {\n\t\t\treturn this.leaves.filter((leaf) => leaf && typeof leaf === 'object' && typeof leaf.id === 'string' && leaf.id !== ''\n\t\t\t\t&& leaf.register && leaf.schema && (!leaf.requiredApp || isAppInstalled(leaf.requiredApp)))\n\t\t},\n\n\t\t/** @return {string[]} Every listed leaf's id, in the configured order. */\n\t\torderedIds() {\n\t\t\tconst providers = new Set(this.providers.map((p) => p.id))\n\t\t\tconst records = new Set(this.recordLeaves.map((leaf) => leaf.id))\n\t\t\treturn this.leaves\n\t\t\t\t.map((leaf) => (typeof leaf === 'string' ? leaf : (leaf && leaf.id)))\n\t\t\t\t.filter((id) => providers.has(id) || records.has(id))\n\t\t},\n\n\t\t/** @return {object[]} The registered mount-mode providers, in the configured order. */\n\t\tproviders() {\n\t\t\t// Read so a leaf that registers after this card renders still joins it.\n\t\t\tvoid this.integrations\n\t\t\treturn this.leafIds\n\t\t\t\t.map((id) => this.getById(id))\n\t\t\t\t.filter((p) => p && p.renderMode === 'mount' && typeof p.mount === 'function' && typeof p.unmount === 'function')\n\t\t},\n\n\t\t/** @return {object} The mount props per leaf. */\n\t\tmountPropsById() {\n\t\t\tconst context = { register: this.register, schema: this.schema, objectId: String(this.objectId || '') }\n\t\t\tconst out = {}\n\t\t\tfor (const provider of this.providers) {\n\t\t\t\tout[provider.id] = {\n\t\t\t\t\tsurface: 'detail-page',\n\t\t\t\t\t...context,\n\t\t\t\t\tintegrationContext: { ...context },\n\t\t\t\t\tonSummary: (summary) => this.onSummary(provider.id, summary),\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn out\n\t\t},\n\n\t\t/** @return {Array<{id: string, summary: object}>} The reported summaries, in order. */\n\t\treported() {\n\t\t\treturn this.orderedIds\n\t\t\t\t.filter((id) => this.summaries[id])\n\t\t\t\t.map((id) => ({ id, summary: this.summaries[id] }))\n\t\t},\n\n\t\t/** @return {object[]} The rows of the leaves that have something linked. */\n\t\tlinkedRows() {\n\t\t\tconst rows = []\n\t\t\tfor (const { id, summary } of this.reported) {\n\t\t\t\tif (summary.count <= 0) {\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\t\t\t\tconst own = summary.rows.length > 0\n\t\t\t\t\t? summary.rows\n\t\t\t\t\t: [{ label: `${summary.noun} (${summary.count})` }]\n\t\t\t\town.forEach((row, index) => rows.push({ ...row, key: `${id}-${index}` }))\n\t\t\t}\n\t\t\treturn rows\n\t\t},\n\n\t\t/** @return {object[]} The leaves with nothing linked. */\n\t\temptyLeaves() {\n\t\t\treturn this.reported.filter(({ summary }) => summary.count <= 0)\n\t\t},\n\n\t\t/** @return {string} \"Leges, contract en projecten: niets gekoppeld\", or ''. */\n\t\temptyLine() {\n\t\t\tconst nouns = this.emptyLeaves.map(({ summary }) => summary.noun).filter((noun) => noun !== '')\n\t\t\tif (nouns.length === 0) {\n\t\t\t\treturn ''\n\t\t\t}\n\t\t\tconst list = joinList(nouns)\n\t\t\treturn t('nextcloud-vue', '{things}: nothing linked', { things: list.charAt(0).toUpperCase() + list.slice(1) })\n\t\t},\n\n\t\t/** @return {object[]} The actions of the leaves with nothing linked. */\n\t\temptyActions() {\n\t\t\tconst actions = []\n\t\t\tfor (const { id, summary } of this.emptyLeaves) {\n\t\t\t\tsummary.actions.forEach((action, index) => actions.push({ ...action, key: `${id}-${index}` }))\n\t\t\t}\n\t\t\treturn actions\n\t\t},\n\t},\n\n\twatch: {\n\t\trecordLeaves: {\n\t\t\thandler() {\n\t\t\t\tthis.recordLeaves.forEach((leaf) => this.readRecordLeaf(leaf))\n\t\t\t},\n\n\t\t\timmediate: true,\n\t\t},\n\n\t\tobjectId() {\n\t\t\tthis.recordLeaves.forEach((leaf) => this.readRecordLeaf(leaf))\n\t\t},\n\t},\n\n\tmethods: {\n\t\t/**\n\t\t * Read a record leaf's records and report them as its summary. A\n\t\t * failed read reports nothing, so the leaf is not listed as empty.\n\t\t *\n\t\t * @param {object} leaf The record leaf.\n\t\t * @return {Promise<void>}\n\t\t */\n\t\tasync readRecordLeaf(leaf) {\n\t\t\tconst objectId = String(this.objectId || '')\n\t\t\tif (objectId === '') {\n\t\t\t\treturn\n\t\t\t}\n\t\t\tconst filter = {}\n\t\t\tfor (const [key, value] of Object.entries(leaf.filter || {})) {\n\t\t\t\tfilter[key] = value === '@objectId' ? objectId : value\n\t\t\t}\n\t\t\tlet rows\n\t\t\ttry {\n\t\t\t\trows = await fetchReferenceObjects({ register: leaf.register, schema: leaf.schema, filter, limit: leaf.limit || 20 })\n\t\t\t} catch {\n\t\t\t\treturn\n\t\t\t}\n\t\t\tconst label = leaf.label ? this.cnTranslate(leaf.label) : ''\n\t\t\tthis.onSummary(leaf.id, {\n\t\t\t\tcount: rows.length,\n\t\t\t\tnoun: leaf.noun ? this.cnTranslate(leaf.noun) : '',\n\t\t\t\trows: rows.map((row) => {\n\t\t\t\t\tconst href = leaf.href ? fillTemplate(leaf.href, row) : ''\n\t\t\t\t\treturn { label: fillTemplate(label, row), href: href ? prefixUrl(href) : undefined, icon: leaf.icon || undefined }\n\t\t\t\t}),\n\t\t\t})\n\t\t},\n\n\t\t/**\n\t\t * Keep a leaf's summary, normalised.\n\t\t *\n\t\t * @param {string} id The integration id.\n\t\t * @param {{count?: number, noun?: string, rows?: Array, actions?: Array}} summary What the leaf reported.\n\t\t */\n\t\tonSummary(id, summary) {\n\t\t\tconst s = summary && typeof summary === 'object' ? summary : {}\n\t\t\tconst usableRow = (row) => row && typeof row.label === 'string' && row.label !== ''\n\t\t\tconst usableAction = (action) => action && typeof action.run === 'function' && typeof action.label === 'string' && action.label !== ''\n\t\t\tthis.summaries = {\n\t\t\t\t...this.summaries,\n\t\t\t\t[id]: {\n\t\t\t\t\tcount: Number.isFinite(s.count) ? s.count : 0,\n\t\t\t\t\tnoun: typeof s.noun === 'string' ? s.noun : '',\n\t\t\t\t\trows: Array.isArray(s.rows) ? s.rows.filter(usableRow) : [],\n\t\t\t\t\tactions: Array.isArray(s.actions) ? s.actions.filter(usableAction) : [],\n\t\t\t\t},\n\t\t\t}\n\t\t},\n\t},\n}\n</script>\n\n<style scoped>\n.cn-linked-widget {\n\tdisplay: flex;\n\tflex-direction: column;\n\tgap: 10px;\n}\n\n.cn-linked-widget__rows {\n\tdisplay: flex;\n\tflex-direction: column;\n\tgap: 10px;\n\tlist-style: none;\n\tmargin: 0;\n\tpadding: 0;\n}\n\n.cn-linked-widget__link {\n\talign-items: center;\n\tbackground: none;\n\tborder: 0;\n\tcolor: var(--color-main-text);\n\tdisplay: flex;\n\tfont: inherit;\n\tfont-size: 14px;\n\tfont-weight: 600;\n\tgap: 10px;\n\tmargin: 0;\n\tmin-height: 0;\n\tpadding: 0;\n\ttext-align: start;\n}\n\na.cn-linked-widget__link,\nbutton.cn-linked-widget__link {\n\tcolor: var(--color-primary-element);\n\tcursor: pointer;\n\ttext-decoration: underline;\n}\n\n.cn-linked-widget__empty {\n\tcolor: var(--color-text-maxcontrast);\n\tfont-size: 13px;\n\tmargin: 0;\n}\n\n.cn-linked-widget__actions {\n\tdisplay: flex;\n\tflex-wrap: wrap;\n\tgap: 12px;\n}\n\n.cn-linked-widget__action {\n\tbackground: none;\n\tborder: 0;\n\tcolor: var(--color-primary-element);\n\tcursor: pointer;\n\tfont: inherit;\n\tfont-size: 14px;\n\tfont-weight: 600;\n\tmargin: 0;\n\tmin-height: 0;\n\tpadding: 0;\n\ttext-decoration: underline;\n}\n</style>\n"],"names":["_createElementBlock","_Fragment","_renderList","_createBlock","_toDisplayString","_openBlock","_createElementVNode"],"mappings":";;;AAWM,EAAA,KAAK,EAAC,kBAAkB;AAAC,EAAA,aAAC,EAAA,kBAAA;;;;AACD,EAAA,KAAA,EAAA,wBAAA;;;;;;AA0Bd,EAAA,KAAK,EAAC,wBAAG;;;;AAYF,EAAA,KAAK,EAAC,yBAAG;AAAA,EAAA,aAAA,EAAA,iBAAA;;;;AAGE,EAAA,KAAA,EAAA,2BAAA;;;;AAa5B,EAAA,MAAM,EAAN,EAAM;AAAC,EAAA,KAAK,EAAC,0BAA0B;;;;;;;;AAtDlC,IAAA,CAAA,QAAA,CAAA,UAAU,CAAC,MAAM,GAAA,CAAA;yCAmCtB,gBAAA,EAAA;4BAlCHA,kBAiCI,CAAAC,QAAA,EAAA,IAAA,EAAAC,UAAA,CAhCG,QAAA,CAAA,UAAA,EAAA,CAAA,GAAA,KAAA;iCADPF,kBAiCI,CAAA,IAAA,EAAA;cA/BF,GAAE,EAAE,GAAG,CAAC,GAAG;AACX,cAAA,KAAG,EAAC,uBAAW;AACf,cAAA,aAAS,EAAA,eAAA;;AACF,cAAA,CAAA,GAAG,CAAC,IAAI;gCAAfA,kBAOE,CAAA,GAAA,EAAA;;wBAPkB,EAAA,GAAA,CAAA,IAAA;AAAA,oBAAA,KAAA,EAAA,wBAAA;;AAEnB,oBAAA,CAAA,GAAA,CAAA,IAAA;sCADFG,WAIY,CAAA,iBAAA,EAAA;;0BAFV,IAAG,EAAA,GAAA,CAAA,IAAA;AACH,0BAAA,IAAI,EAAE,EAAE;AACT,0BAAA,aAAW,EAAA,MAAA;;;oCAAA,GACZ,GAAAC,eAAA,CAAG,GAAG,CAAC,KAAK,CAAA,EAAA,CAAA,YAAA;;AAGD,kBAAA,CAAA,GAAG,CAAC,GAAA;kCADfJ,kBAWQ,CAAA,QAAA,E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f,aAAA,EAAAE,eAAA,CAAA,MAAK,CAAE,KAAK,CAAA,EAAA,CAAA,oBAAA,UAAA,CAAA,CAAA;;;;AAKf,IAAAE,kBAAA,QAAA;wBACDN,8CACG,QAAA,CAAA,SAAA,EAAA,CAAA,QAAA,KAAA;6BADHG;;;;;;;;;;;;"}
@@ -2,7 +2,7 @@ import script from './CnMailTab.vue2.js';
2
2
  import { render } from './CnMailTab.vue3.js';
3
3
 
4
4
  script.render = render;
5
- script.__scopeId = "data-v-7a3a1cfc";
5
+ script.__scopeId = "data-v-474b24a4";
6
6
  const __sfc_main = script;
7
7
 
8
8
  export { __sfc_main as default };
@@ -158,14 +158,14 @@ var script = {
158
158
  return keyOf(this.objectId) || keyOf(this.record.id) || keyOf(this.record['@self'] && this.record['@self'].id)
159
159
  },
160
160
 
161
- /** @return {string} The register slug or id. */
161
+ /** @return {string} The register slug or id, from the prop or else the record's own `@self`. */
162
162
  registerKey() {
163
- return keyOf(this.register)
163
+ return keyOf(this.register) || keyOf(this.record['@self'] && this.record['@self'].register)
164
164
  },
165
165
 
166
- /** @return {string} The schema slug or id. */
166
+ /** @return {string} The schema slug or id, from the prop or else the record's own `@self`. */
167
167
  schemaKey() {
168
- return keyOf(this.schema)
168
+ return keyOf(this.schema) || keyOf(this.record['@self'] && this.record['@self'].schema)
169
169
  },
170
170
 
171
171
  /** @return {object} The token context for the URLs. */
@@ -1 +1 @@
1
- {"version":3,"file":"CnMailTab.vue2.js","sources":["../../../../src/components/CnMailTab/CnMailTab.vue"],"sourcesContent":["<!--\n - SPDX-FileCopyrightText: 2026 Conduction B.V.\n - SPDX-License-Identifier: EUPL-1.2\n-->\n<template>\n\t<div class=\"cn-mail-tab\" data-testid=\"cn-mail-tab\">\n\t\t<CnEmptyContent\n\t\t\tv-if=\"unavailable\"\n\t\t\t:name=\"t('nextcloud-vue', 'Mail is not available')\"\n\t\t\t:description=\"t('nextcloud-vue', 'Install Nextcloud Mail to draft and link mail here.')\">\n\t\t\t<template #icon>\n\t\t\t\t<EmailOffOutline :size=\"48\" />\n\t\t\t</template>\n\t\t</CnEmptyContent>\n\n\t\t<template v-else>\n\t\t\t<div v-if=\"heading || description || hasHeaderActions\" class=\"cn-mail-tab__header\" data-testid=\"cn-mail-tab-header\">\n\t\t\t\t<div class=\"cn-mail-tab__heading\">\n\t\t\t\t\t<h3 v-if=\"heading\" class=\"cn-mail-tab__title\">\n\t\t\t\t\t\t{{ heading }}\n\t\t\t\t\t</h3>\n\t\t\t\t\t<!-- Divs, not <p>: a theme that sizes every paragraph with !important\n\t\t\t\t\t would override the card's 14px description. -->\n\t\t\t\t\t<div v-if=\"description\" class=\"cn-mail-tab__subtitle\">\n\t\t\t\t\t\t{{ description }}\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t\t<div v-if=\"hasHeaderActions\" class=\"cn-mail-tab__header-actions\">\n\t\t\t\t\t<NcButton\n\t\t\t\t\t\tv-if=\"showLinkAction\"\n\t\t\t\t\t\tvariant=\"secondary\"\n\t\t\t\t\t\tdata-testid=\"cn-mail-tab-header-link\"\n\t\t\t\t\t\t@click=\"openLinkPicker\">\n\t\t\t\t\t\t<template #icon>\n\t\t\t\t\t\t\t<LinkVariant :size=\"18\" />\n\t\t\t\t\t\t</template>\n\t\t\t\t\t\t{{ t('nextcloud-vue', 'Link mail') }}\n\t\t\t\t\t</NcButton>\n\t\t\t\t\t<NcButton\n\t\t\t\t\t\tv-if=\"showComposeAction\"\n\t\t\t\t\t\tvariant=\"primary\"\n\t\t\t\t\t\t:disabled=\"draftEnabled && (closed || drafting)\"\n\t\t\t\t\t\t:href=\"draftEnabled ? undefined : composeUrl\"\n\t\t\t\t\t\t:target=\"draftEnabled ? undefined : '_blank'\"\n\t\t\t\t\t\tdata-testid=\"cn-mail-tab-header-compose\"\n\t\t\t\t\t\t@click=\"onCompose\">\n\t\t\t\t\t\t<template #icon>\n\t\t\t\t\t\t\t<EmailEditOutline :size=\"18\" />\n\t\t\t\t\t\t</template>\n\t\t\t\t\t\t{{ t('nextcloud-vue', 'Compose mail') }}\n\t\t\t\t\t</NcButton>\n\t\t\t\t</div>\n\t\t\t</div>\n\n\t\t\t<div v-if=\"draftEnabled\" class=\"cn-mail-tab__template-row\" data-testid=\"cn-mail-tab-template-row\">\n\t\t\t\t<NcSelect\n\t\t\t\t\tv-if=\"templatesEnabled\"\n\t\t\t\t\tv-model=\"selectedTemplate\"\n\t\t\t\t\tclass=\"cn-mail-tab__template-select\"\n\t\t\t\t\t:options=\"templates\"\n\t\t\t\t\t:disabled=\"templates.length === 0\"\n\t\t\t\t\t:inputLabel=\"t('nextcloud-vue', 'Email template')\"\n\t\t\t\t\t:label=\"templateLabelField\"\n\t\t\t\t\t:trackBy=\"templateIdField\"\n\t\t\t\t\t:placeholder=\"templatePlaceholder\"\n\t\t\t\t\t:clearable=\"true\" />\n\t\t\t\t<!-- The draft buttons stand together, 8px apart, beside the field. -->\n\t\t\t\t<div class=\"cn-mail-tab__template-actions\">\n\t\t\t\t\t<NcButton\n\t\t\t\t\t\tv-if=\"templatesEnabled\"\n\t\t\t\t\t\t:disabled=\"closed || drafting || !selectedTemplate\"\n\t\t\t\t\t\tdata-testid=\"cn-mail-tab-draft-template\"\n\t\t\t\t\t\t@click=\"draftFromTemplate\">\n\t\t\t\t\t\t<template #icon>\n\t\t\t\t\t\t\t<OpenInNew :size=\"16\" />\n\t\t\t\t\t\t</template>\n\t\t\t\t\t\t{{ t('nextcloud-vue', 'Open draft from template') }}\n\t\t\t\t\t</NcButton>\n\t\t\t\t\t<NcButton\n\t\t\t\t\t\tv-if=\"!showComposeAction || draftSource.blankButton === true\"\n\t\t\t\t\t\t:disabled=\"closed || drafting\"\n\t\t\t\t\t\tdata-testid=\"cn-mail-tab-draft-blank\"\n\t\t\t\t\t\t@click=\"draftBlank\">\n\t\t\t\t\t\t{{ t('nextcloud-vue', 'Empty draft') }}\n\t\t\t\t\t</NcButton>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t\t<div v-if=\"hint\" class=\"cn-mail-tab__hint\">\n\t\t\t\t{{ hint }}\n\t\t\t</div>\n\n\t\t\t<NcNoteCard\n\t\t\t\tv-if=\"error\"\n\t\t\t\ttype=\"error\"\n\t\t\t\t:heading=\"t('nextcloud-vue', 'Could not open draft')\"\n\t\t\t\trole=\"alert\">\n\t\t\t\t{{ error }}\n\t\t\t</NcNoteCard>\n\t\t\t<NcNoteCard\n\t\t\t\tv-if=\"unresolved.length > 0\"\n\t\t\t\ttype=\"warning\"\n\t\t\t\trole=\"status\"\n\t\t\t\tdata-testid=\"cn-mail-tab-unresolved\">\n\t\t\t\t<p>{{ t('nextcloud-vue', 'Some template fields could not be filled. Fill these in the draft yourself:') }}</p>\n\t\t\t\t<ul class=\"cn-mail-tab__unresolved\">\n\t\t\t\t\t<li v-for=\"name in unresolved\" :key=\"name\">\n\t\t\t\t\t\t<code>{{ placeholderOf(name) }}</code>\n\t\t\t\t\t</li>\n\t\t\t\t</ul>\n\t\t\t</NcNoteCard>\n\n\t\t\t<CnEmailTab\n\t\t\t\tv-if=\"linkedMail && objectKey\"\n\t\t\t\tref=\"linkedMail\"\n\t\t\t\tclass=\"cn-mail-tab__linked\"\n\t\t\t\t:showActions=\"!hasHeaderActions\"\n\t\t\t\t:objectId=\"objectKey\"\n\t\t\t\t:register=\"registerKey\"\n\t\t\t\t:schema=\"schemaKey\" />\n\t\t</template>\n\t</div>\n</template>\n\n<script>\nimport { translate as t } from '@nextcloud/l10n'\nimport { NcButton, NcNoteCard, NcSelect } from '@nextcloud/vue'\nimport EmailEditOutline from 'vue-material-design-icons/EmailEditOutline.vue'\nimport EmailOffOutline from 'vue-material-design-icons/EmailOffOutline.vue'\nimport LinkVariant from 'vue-material-design-icons/LinkVariant.vue'\nimport OpenInNew from 'vue-material-design-icons/OpenInNew.vue'\nimport CnEmailTab from '../../integrations/builtin/email/CnEmailTab.vue'\nimport CnEmptyContent from '../CnEmptyContent/CnEmptyContent.vue'\nimport { fetchEndpointSource, interpolateUrlTokens } from '../../composables/useEndpointSource.js'\nimport { evaluateVisibleWhenLocal } from '../../utils/visibleWhen.js'\n\n/** The actions `content.headerActions` can put in the tab's header. */\nconst HEADER_ACTIONS = ['compose', 'link']\n\n/**\n * Read a reference that may be a slug, an id or an object carrying either.\n *\n * @param {string|number|object} value The reference.\n * @return {string} The slug or id, or ''.\n */\nfunction keyOf(value) {\n\tif (value === null || value === undefined) {\n\t\treturn ''\n\t}\n\tif (typeof value === 'object') {\n\t\treturn String(value.slug || value.id || value.uuid || '')\n\t}\n\treturn String(value)\n}\n\n/**\n * CnMailTab — the mail of one record: drafts in Nextcloud Mail, from a\n * template or empty, above the mail linked to the record.\n *\n * Registered as the `mail` widget type. The app owns the endpoints and the\n * texts; the tab never sends mail. A draft is a POST to `draft.url`, whose\n * response may carry `draftUrl` (opened in a new tab) and `unresolved` (the\n * template fields the server could not fill). A 404 there means the app has\n * no Mail to draft into, and the tab says so instead of the controls.\n *\n * ```json\n * {\n * \"type\": \"mail\",\n * \"content\": {\n * \"heading\": \"Email\",\n * \"description\": \"Mail linked to this case\",\n * \"hint\": \"The draft opens in Nextcloud Mail.\",\n * \"templates\": { \"url\": \"/apps/app/api/types/@object.type/templates\", \"responsePath\": \"results\", \"labelField\": \"name\", \"idField\": \"id\" },\n * \"noTemplatesText\": \"No templates for this type yet\",\n * \"draft\": { \"url\": \"/apps/app/api/records/@objectId/templates/{templateId}/draft\", \"blankTemplateId\": \"blank\" },\n * \"closedWhen\": { \"field\": \"endDate\", \"op\": \"notEmpty\" },\n * \"linkedMail\": true,\n * \"headerActions\": [\"link\", \"compose\"]\n * }\n * }\n * ```\n *\n * URLs take the `@objectId` / `@object.<field>` tokens of `endpointSource`;\n * `{templateId}` in the draft URL is the chosen template's id, or\n * `blankTemplateId` for an empty draft. Without `templates` the row offers\n * the empty draft only; without `draft` there is no row. `closedWhen` is a\n * local visibleWhen condition on the record that disables drafting.\n * `linkedMail: false` leaves the linked mail to a separate `email`\n * integration card. `headerActions` puts buttons beside the heading:\n * `compose` opens the empty draft (or Nextcloud Mail's composer when there\n * is no `draft`) and replaces the row's empty-draft button, unless\n * `draft.blankButton` is true (DqZaakEmail draws both); `link` opens the\n * linked mail's picker and needs the linked mail. The linked mail then drops\n * its own buttons. Texts go through the host's translate.\n */\nexport default {\n\tname: 'CnMailTab',\n\n\tcomponents: {\n\t\tCnEmailTab,\n\t\tCnEmptyContent,\n\t\tEmailEditOutline,\n\t\tEmailOffOutline,\n\t\tLinkVariant,\n\t\tNcButton,\n\t\tNcNoteCard,\n\t\tNcSelect,\n\t\tOpenInNew,\n\t},\n\n\tinject: {\n\t\t/** The detail page's object context (`{ objectId, object }`), for tokens. */\n\t\tcnObjectContext: { default: null },\n\t\t/** The host's translate, for the manifest texts. */\n\t\tcnTranslate: { default: () => (key) => key },\n\t},\n\n\tprops: {\n\t\t/**\n\t\t * The widget config: `{ heading?, description?, hint?, templates?,\n\t\t * noTemplatesText?, draft?, closedWhen?, linkedMail?, headerActions? }`, as in the\n\t\t * component description and docs/components/cn-mail-tab.md.\n\t\t *\n\t\t * @type {object}\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's id, for `@objectId` and the linked mail. */\n\t\tobjectId: {\n\t\t\ttype: [String, Number],\n\t\t\tdefault: '',\n\t\t},\n\n\t\t/** The bound record, for `@object.<field>` and `closedWhen`. */\n\t\tobjectData: {\n\t\t\ttype: Object,\n\t\t\tdefault: null,\n\t\t},\n\n\t\t/** The bound record's register, for the linked mail. */\n\t\tregister: {\n\t\t\ttype: [String, Object],\n\t\t\tdefault: '',\n\t\t},\n\n\t\t/** The bound record's schema, for the linked mail. */\n\t\tschema: {\n\t\t\ttype: [String, Object],\n\t\t\tdefault: '',\n\t\t},\n\t},\n\n\temits: ['drafted'],\n\n\tdata() {\n\t\treturn {\n\t\t\ttemplates: [],\n\t\t\tselectedTemplate: null,\n\t\t\tdrafting: false,\n\t\t\terror: '',\n\t\t\tunresolved: [],\n\t\t\tunavailable: false,\n\t\t}\n\t},\n\n\tcomputed: {\n\t\t/** @return {object} The record, from the prop or the page context. */\n\t\trecord() {\n\t\t\tif (this.objectData) {\n\t\t\t\treturn this.objectData\n\t\t\t}\n\t\t\tconst ctx = this.cnObjectContext\n\t\t\tconst value = ctx && typeof ctx === 'object' && 'value' in ctx ? ctx.value : ctx\n\t\t\treturn (value && value.object) || {}\n\t\t},\n\n\t\t/** @return {string} The record id. */\n\t\tobjectKey() {\n\t\t\treturn keyOf(this.objectId) || keyOf(this.record.id) || keyOf(this.record['@self'] && this.record['@self'].id)\n\t\t},\n\n\t\t/** @return {string} The register slug or id. */\n\t\tregisterKey() {\n\t\t\treturn keyOf(this.register)\n\t\t},\n\n\t\t/** @return {string} The schema slug or id. */\n\t\tschemaKey() {\n\t\t\treturn keyOf(this.schema)\n\t\t},\n\n\t\t/** @return {object} The token context for the URLs. */\n\t\ttokenContext() {\n\t\t\treturn { objectId: this.objectKey, object: this.record }\n\t\t},\n\n\t\t/** @return {string} The heading, translated, or ''. */\n\t\theading() {\n\t\t\treturn this.tr(this.content.heading)\n\t\t},\n\n\t\t/** @return {string} The line under the heading, translated, or ''. */\n\t\tdescription() {\n\t\t\treturn this.tr(this.content.description)\n\t\t},\n\n\t\t/** @return {string} The line under the template row, translated, or ''. */\n\t\thint() {\n\t\t\treturn this.tr(this.content.hint)\n\t\t},\n\n\t\t/** @return {object|null} The templates endpoint, or null. */\n\t\ttemplatesSource() {\n\t\t\tconst source = this.content.templates\n\t\t\treturn source && typeof source === 'object' && source.url ? source : null\n\t\t},\n\n\t\t/** @return {object|null} The draft endpoint, or null. */\n\t\tdraftSource() {\n\t\t\tconst source = this.content.draft\n\t\t\treturn source && typeof source === 'object' && source.url ? source : null\n\t\t},\n\n\t\t/** @return {boolean} Whether the template select and its button show. */\n\t\ttemplatesEnabled() {\n\t\t\treturn this.templatesSource !== null\n\t\t},\n\n\t\t/** @return {boolean} Whether the template row shows. */\n\t\tdraftEnabled() {\n\t\t\treturn this.draftSource !== null\n\t\t},\n\n\t\t/** @return {string} The template field shown in the select. */\n\t\ttemplateLabelField() {\n\t\t\treturn (this.templatesSource && this.templatesSource.labelField) || 'name'\n\t\t},\n\n\t\t/** @return {string} The template field that identifies it. */\n\t\ttemplateIdField() {\n\t\t\treturn (this.templatesSource && this.templatesSource.idField) || 'id'\n\t\t},\n\n\t\t/** @return {string} The select's placeholder. */\n\t\ttemplatePlaceholder() {\n\t\t\tif (this.templates.length === 0) {\n\t\t\t\treturn this.tr(this.content.noTemplatesText) || t('nextcloud-vue', 'No templates yet')\n\t\t\t}\n\t\t\treturn t('nextcloud-vue', 'Select a template (optional)…')\n\t\t},\n\n\t\t/** @return {boolean} Whether `closedWhen` holds for the record. */\n\t\tclosed() {\n\t\t\tconst cond = this.content.closedWhen\n\t\t\tif (!cond) {\n\t\t\t\treturn false\n\t\t\t}\n\t\t\treturn evaluateVisibleWhenLocal(cond, this.record)\n\t\t},\n\n\t\t/** @return {string} The templates URL after tokens, to refetch on change. */\n\t\ttemplatesUrl() {\n\t\t\treturn this.templatesSource ? interpolateUrlTokens(this.templatesSource.url, this.tokenContext) : ''\n\t\t},\n\n\t\t/** @return {boolean} Whether the linked mail list shows. */\n\t\tlinkedMail() {\n\t\t\treturn this.content.linkedMail !== false\n\t\t},\n\n\t\t/**\n\t\t * The known header actions the config asks for.\n\t\t *\n\t\t * @return {string[]} `compose` and or `link`.\n\t\t * @spec openspec/changes/mail-tab-compose-and-link/specs/mail-tab-compose-and-link/spec.md#requirement-the-mail-tab-can-carry-compose-mail-and-link-mail-in-its-header\n\t\t */\n\t\theaderActions() {\n\t\t\tconst list = Array.isArray(this.content.headerActions) ? this.content.headerActions : []\n\t\t\treturn list.filter((key) => HEADER_ACTIONS.includes(key))\n\t\t},\n\n\t\t/** @return {boolean} Whether the header shows \"Compose mail\". */\n\t\tshowComposeAction() {\n\t\t\treturn this.headerActions.includes('compose')\n\t\t},\n\n\t\t/** @return {boolean} Whether the header shows \"Link mail\": it opens the linked mail's picker. */\n\t\tshowLinkAction() {\n\t\t\treturn this.headerActions.includes('link') && this.linkedMail && this.objectKey !== ''\n\t\t},\n\n\t\t/** @return {boolean} Whether the header holds any button. */\n\t\thasHeaderActions() {\n\t\t\treturn this.showComposeAction || this.showLinkAction\n\t\t},\n\n\t\t/** @return {string} Nextcloud Mail's composer, for an app without a draft endpoint. */\n\t\tcomposeUrl() {\n\t\t\treturn (typeof OC !== 'undefined' && typeof OC.generateUrl === 'function')\n\t\t\t\t? OC.generateUrl('/apps/mail/box/draft')\n\t\t\t\t: '/index.php/apps/mail/box/draft'\n\t\t},\n\t},\n\n\twatch: {\n\t\ttemplatesUrl: {\n\t\t\timmediate: true,\n\t\t\thandler() {\n\t\t\t\tthis.loadTemplates()\n\t\t\t},\n\t\t},\n\t},\n\n\tmethods: {\n\t\tt,\n\n\t\t/**\n\t\t * Translate a manifest text through the host.\n\t\t *\n\t\t * @param {string} text The text.\n\t\t * @return {string} The translation, or '' for no text.\n\t\t */\n\t\ttr(text) {\n\t\t\tif (typeof text !== 'string' || text === '') {\n\t\t\t\treturn ''\n\t\t\t}\n\t\t\treturn this.cnTranslate(text)\n\t\t},\n\n\t\t/**\n\t\t * Read the templates. A failed read leaves the empty draft usable.\n\t\t *\n\t\t * @return {Promise<void>}\n\t\t */\n\t\tasync loadTemplates() {\n\t\t\tif (!this.templatesSource) {\n\t\t\t\tthis.templates = []\n\t\t\t\treturn\n\t\t\t}\n\t\t\ttry {\n\t\t\t\tconst payload = await fetchEndpointSource(this.templatesSource, this.tokenContext)\n\t\t\t\tconst list = Array.isArray(payload) ? payload : (payload && Array.isArray(payload.results) ? payload.results : [])\n\t\t\t\tthis.templates = list\n\t\t\t} catch (err) {\n\t\t\t\t// eslint-disable-next-line no-console\n\t\t\t\tconsole.warn('[CnMailTab] could not read the templates', err)\n\t\t\t\tthis.templates = []\n\t\t\t}\n\t\t},\n\n\t\t/** @return {Promise<void>} */\n\t\tdraftFromTemplate() {\n\t\t\treturn this.openDraft(this.selectedTemplate)\n\t\t},\n\n\t\t/**\n\t\t * \"Compose mail\": the empty draft through the app's endpoint. Without\n\t\t * one the button is a link to Mail's composer and needs no handler.\n\t\t *\n\t\t * @return {Promise<void>|undefined}\n\t\t */\n\t\tonCompose() {\n\t\t\treturn this.draftEnabled ? this.draftBlank() : undefined\n\t\t},\n\n\t\t/**\n\t\t * \"Link mail\": the linked mail's picker, which links the chosen\n\t\t * message to the record through its own endpoint.\n\t\t *\n\t\t * @return {void}\n\t\t */\n\t\topenLinkPicker() {\n\t\t\tconst linked = this.$refs.linkedMail\n\t\t\tif (linked && typeof linked.openPicker === 'function') {\n\t\t\t\tlinked.openPicker()\n\t\t\t}\n\t\t},\n\n\t\t/** @return {Promise<void>} */\n\t\tdraftBlank() {\n\t\t\tthis.selectedTemplate = null\n\t\t\treturn this.openDraft(null)\n\t\t},\n\n\t\t/**\n\t\t * Ask the app to create a Nextcloud Mail draft and open it.\n\t\t *\n\t\t * @param {object|null} template The chosen template, or null for an empty draft.\n\t\t * @return {Promise<void>}\n\t\t */\n\t\tasync openDraft(template) {\n\t\t\tif (this.closed || !this.draftSource) {\n\t\t\t\treturn\n\t\t\t}\n\t\t\tthis.drafting = true\n\t\t\tthis.error = ''\n\t\t\tthis.unresolved = []\n\t\t\ttry {\n\t\t\t\tconst id = template ? template[this.templateIdField] : (this.draftSource.blankTemplateId || 'blank')\n\t\t\t\tconst path = interpolateUrlTokens(this.draftSource.url, this.tokenContext)\n\t\t\t\t\t.replace('{templateId}', encodeURIComponent(String(id)))\n\t\t\t\tconst [{ default: axios }, { generateUrl }] = await Promise.all([\n\t\t\t\t\timport('@nextcloud/axios'),\n\t\t\t\t\timport('@nextcloud/router'),\n\t\t\t\t])\n\t\t\t\tconst { data } = await axios.post(generateUrl(path), {})\n\t\t\t\tthis.unresolved = Array.isArray(data && data.unresolved) ? data.unresolved : []\n\t\t\t\tif (data && data.draftUrl) {\n\t\t\t\t\twindow.open(data.draftUrl, '_blank', 'noopener')\n\t\t\t\t}\n\t\t\t\t/**\n\t\t\t\t * @event drafted A draft was made from a template. Carries the\n\t\t\t\t * draft endpoint's response, including `draftUrl` and\n\t\t\t\t * `unresolved` when the endpoint returns them.\n\t\t\t\t * @type {object}\n\t\t\t\t */\n\t\t\t\tthis.$emit('drafted', data)\n\t\t\t} catch (err) {\n\t\t\t\tconst response = err && err.response\n\t\t\t\tif (response && response.status === 404) {\n\t\t\t\t\tthis.unavailable = true\n\t\t\t\t}\n\t\t\t\tthis.error = (response && response.data && response.data.message)\n\t\t\t\t\t|| (err && err.message)\n\t\t\t\t\t|| t('nextcloud-vue', 'The draft could not be opened.')\n\t\t\t} finally {\n\t\t\t\tthis.drafting = false\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * Write a template field the way the template spells it.\n\t\t *\n\t\t * @param {string} name The field name.\n\t\t * @return {string} `{{name}}`.\n\t\t */\n\t\tplaceholderOf(name) {\n\t\t\treturn `{{${name}}}`\n\t\t},\n\t},\n}\n</script>\n\n<style scoped>\n.cn-mail-tab {\n\tdisplay: flex;\n\tflex-direction: column;\n\tgap: 16px;\n\tpadding: 12px;\n}\n\n.cn-mail-tab__header {\n\tdisplay: flex;\n\tflex-wrap: wrap;\n\talign-items: flex-start;\n\tjustify-content: space-between;\n\tgap: 10px 16px;\n}\n\n.cn-mail-tab__heading {\n\tdisplay: flex;\n\tflex: 1 1 260px;\n\tflex-direction: column;\n\tgap: 3px;\n\tmin-width: 0;\n}\n\n.cn-mail-tab__header-actions {\n\tdisplay: flex;\n\tflex: none;\n\tflex-wrap: wrap;\n\tgap: 8px;\n}\n\n.cn-mail-tab__title {\n\tmargin: 0;\n\tfont-size: 16px;\n\tfont-weight: bold;\n}\n\n.cn-mail-tab__subtitle,\n.cn-mail-tab__hint {\n\tmargin: 0;\n\tcolor: var(--color-text-maxcontrast);\n}\n\n.cn-mail-tab__template-row {\n\tdisplay: flex;\n\tflex-wrap: wrap;\n\talign-items: flex-end;\n\tgap: 8px;\n}\n\n.cn-mail-tab__template-actions {\n\tdisplay: flex;\n\tflex-wrap: wrap;\n\tgap: 8px;\n}\n\n.cn-mail-tab__template-select {\n\tflex: 1 1 260px;\n}\n\n.cn-mail-tab__unresolved {\n\tmargin: 4px 0 0;\n\tpadding-inline-start: 20px;\n}\n\n.cn-mail-tab__unresolved code {\n\tbackground: var(--color-background-dark);\n\tpadding: 2px 6px;\n\tborder-radius: var(--border-radius);\n\tfont-family: var(--font-face-mono, monospace);\n}\n</style>\n"],"names":["CnEmailTab","CnEmptyContent","t"],"mappings":";;;;;;;;;;;;AAuIA;AACA,MAAM,cAAe,GAAE,CAAC,SAAS,EAAE,MAAM,EAAA;;AAEzC;;AAEC;;AAEA;;AAED,SAAS,KAAK,CAAC,KAAK,EAAE;AACrB,CAAA,IAAI,KAAI,KAAM,QAAQ,KAAM,KAAI,SAAS,EAAE;AAC1C,EAAA,OAAO,EAAC;AACT,EAAA;CACA,IAAI,OAAO,UAAU,QAAQ,EAAE;EAC9B,OAAO,MAAM,CAAC,KAAK,CAAC,IAAK,IAAG,KAAK,CAAC,EAAC,IAAK,KAAK,CAAC,IAAK,IAAG,EAAE,CAAA;AACzD,EAAA;AACA,CAAA,OAAO,MAAM,CAAC,KAAK,CAAA;AACpB,CAAA;;AAEA;;;AAGC;;;AAGA;;;AAGA;AACA;;AAEA;;AAEA;AACA;AACA;;;;;AAKA;AACA;;;AAGA;AACA;AACA;;AAEA;;;;;AAKA;;AAEA;AACA;;;AAGD,aAAe;AACd,CAAA,IAAI,EAAE,WAAW;;CAEjB,UAAU,EAAE;cACXA,UAAU;AACV,kBAAAC,YAAc;AACd,EAAA,gBAAgB;AAChB,EAAA,eAAe;EACf,WAAW;AACX,EAAA,QAAQ;EACR,UAAU;AACV,EAAA,QAAQ;AACR,EAAA,SAAS;EACT;;AAED,CAAA,MAAM,EAAE;AACP;AACA,EAAA,eAAe,EAAE,EAAE,OAAO,EAAE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AAG,CAAC,SAAO;AACnC,IAAA,IAAI,QAAS,IAAG,QAAQ,CAAC,MAAK,KAAM,GAAG,EAAE;AACxC,KAAA,IAAI,CAAC,cAAc,KAAG;AACvB,KAAA;IACA,IAAI,CAAC,KAAI,GAAI,CAAC,QAAS,IAAG,QAAQ,CAAC,IAAK,IAAG,QAAQ,CAAC,IAAI,CAAC,OAAO;AAC/D,SAAI,GAAE,IAAK,GAAG,CAAC,OAAO,CAAA;QACnBA,SAAC,CAAC,eAAe,EAAE,gCAAgC,EAAA;AACxD,IAAA,SAAU;AACT,IAAA,IAAI,CAAC,QAAS,GAAE,MAAI;AACrB,IAAA;GACA;;AAED;AACC;AACA;AACA;;;AAGD,EAAA,aAAa,CAAC,IAAI,EAAE;AACnB,GAAA,OAAO,CAAC,EAAE,EAAE,IAAI,CAAC,EAAE,CAAA;GACnB;EACD;AACF;;;;"}
1
+ {"version":3,"file":"CnMailTab.vue2.js","sources":["../../../../src/components/CnMailTab/CnMailTab.vue"],"sourcesContent":["<!--\n - SPDX-FileCopyrightText: 2026 Conduction B.V.\n - SPDX-License-Identifier: EUPL-1.2\n-->\n<template>\n\t<div class=\"cn-mail-tab\" data-testid=\"cn-mail-tab\">\n\t\t<CnEmptyContent\n\t\t\tv-if=\"unavailable\"\n\t\t\t:name=\"t('nextcloud-vue', 'Mail is not available')\"\n\t\t\t:description=\"t('nextcloud-vue', 'Install Nextcloud Mail to draft and link mail here.')\">\n\t\t\t<template #icon>\n\t\t\t\t<EmailOffOutline :size=\"48\" />\n\t\t\t</template>\n\t\t</CnEmptyContent>\n\n\t\t<template v-else>\n\t\t\t<div v-if=\"heading || description || hasHeaderActions\" class=\"cn-mail-tab__header\" data-testid=\"cn-mail-tab-header\">\n\t\t\t\t<div class=\"cn-mail-tab__heading\">\n\t\t\t\t\t<h3 v-if=\"heading\" class=\"cn-mail-tab__title\">\n\t\t\t\t\t\t{{ heading }}\n\t\t\t\t\t</h3>\n\t\t\t\t\t<!-- Divs, not <p>: a theme that sizes every paragraph with !important\n\t\t\t\t\t would override the card's 14px description. -->\n\t\t\t\t\t<div v-if=\"description\" class=\"cn-mail-tab__subtitle\">\n\t\t\t\t\t\t{{ description }}\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t\t<div v-if=\"hasHeaderActions\" class=\"cn-mail-tab__header-actions\">\n\t\t\t\t\t<NcButton\n\t\t\t\t\t\tv-if=\"showLinkAction\"\n\t\t\t\t\t\tvariant=\"secondary\"\n\t\t\t\t\t\tdata-testid=\"cn-mail-tab-header-link\"\n\t\t\t\t\t\t@click=\"openLinkPicker\">\n\t\t\t\t\t\t<template #icon>\n\t\t\t\t\t\t\t<LinkVariant :size=\"18\" />\n\t\t\t\t\t\t</template>\n\t\t\t\t\t\t{{ t('nextcloud-vue', 'Link mail') }}\n\t\t\t\t\t</NcButton>\n\t\t\t\t\t<NcButton\n\t\t\t\t\t\tv-if=\"showComposeAction\"\n\t\t\t\t\t\tvariant=\"primary\"\n\t\t\t\t\t\t:disabled=\"draftEnabled && (closed || drafting)\"\n\t\t\t\t\t\t:href=\"draftEnabled ? undefined : composeUrl\"\n\t\t\t\t\t\t:target=\"draftEnabled ? undefined : '_blank'\"\n\t\t\t\t\t\tdata-testid=\"cn-mail-tab-header-compose\"\n\t\t\t\t\t\t@click=\"onCompose\">\n\t\t\t\t\t\t<template #icon>\n\t\t\t\t\t\t\t<EmailEditOutline :size=\"18\" />\n\t\t\t\t\t\t</template>\n\t\t\t\t\t\t{{ t('nextcloud-vue', 'Compose mail') }}\n\t\t\t\t\t</NcButton>\n\t\t\t\t</div>\n\t\t\t</div>\n\n\t\t\t<div v-if=\"draftEnabled\" class=\"cn-mail-tab__template-row\" data-testid=\"cn-mail-tab-template-row\">\n\t\t\t\t<NcSelect\n\t\t\t\t\tv-if=\"templatesEnabled\"\n\t\t\t\t\tv-model=\"selectedTemplate\"\n\t\t\t\t\tclass=\"cn-mail-tab__template-select\"\n\t\t\t\t\t:options=\"templates\"\n\t\t\t\t\t:disabled=\"templates.length === 0\"\n\t\t\t\t\t:inputLabel=\"t('nextcloud-vue', 'Email template')\"\n\t\t\t\t\t:label=\"templateLabelField\"\n\t\t\t\t\t:trackBy=\"templateIdField\"\n\t\t\t\t\t:placeholder=\"templatePlaceholder\"\n\t\t\t\t\t:clearable=\"true\" />\n\t\t\t\t<!-- The draft buttons stand together, 8px apart, beside the field. -->\n\t\t\t\t<div class=\"cn-mail-tab__template-actions\">\n\t\t\t\t\t<NcButton\n\t\t\t\t\t\tv-if=\"templatesEnabled\"\n\t\t\t\t\t\t:disabled=\"closed || drafting || !selectedTemplate\"\n\t\t\t\t\t\tdata-testid=\"cn-mail-tab-draft-template\"\n\t\t\t\t\t\t@click=\"draftFromTemplate\">\n\t\t\t\t\t\t<template #icon>\n\t\t\t\t\t\t\t<OpenInNew :size=\"16\" />\n\t\t\t\t\t\t</template>\n\t\t\t\t\t\t{{ t('nextcloud-vue', 'Open draft from template') }}\n\t\t\t\t\t</NcButton>\n\t\t\t\t\t<NcButton\n\t\t\t\t\t\tv-if=\"!showComposeAction || draftSource.blankButton === true\"\n\t\t\t\t\t\t:disabled=\"closed || drafting\"\n\t\t\t\t\t\tdata-testid=\"cn-mail-tab-draft-blank\"\n\t\t\t\t\t\t@click=\"draftBlank\">\n\t\t\t\t\t\t{{ t('nextcloud-vue', 'Empty draft') }}\n\t\t\t\t\t</NcButton>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t\t<div v-if=\"hint\" class=\"cn-mail-tab__hint\">\n\t\t\t\t{{ hint }}\n\t\t\t</div>\n\n\t\t\t<NcNoteCard\n\t\t\t\tv-if=\"error\"\n\t\t\t\ttype=\"error\"\n\t\t\t\t:heading=\"t('nextcloud-vue', 'Could not open draft')\"\n\t\t\t\trole=\"alert\">\n\t\t\t\t{{ error }}\n\t\t\t</NcNoteCard>\n\t\t\t<NcNoteCard\n\t\t\t\tv-if=\"unresolved.length > 0\"\n\t\t\t\ttype=\"warning\"\n\t\t\t\trole=\"status\"\n\t\t\t\tdata-testid=\"cn-mail-tab-unresolved\">\n\t\t\t\t<p>{{ t('nextcloud-vue', 'Some template fields could not be filled. Fill these in the draft yourself:') }}</p>\n\t\t\t\t<ul class=\"cn-mail-tab__unresolved\">\n\t\t\t\t\t<li v-for=\"name in unresolved\" :key=\"name\">\n\t\t\t\t\t\t<code>{{ placeholderOf(name) }}</code>\n\t\t\t\t\t</li>\n\t\t\t\t</ul>\n\t\t\t</NcNoteCard>\n\n\t\t\t<CnEmailTab\n\t\t\t\tv-if=\"linkedMail && objectKey\"\n\t\t\t\tref=\"linkedMail\"\n\t\t\t\tclass=\"cn-mail-tab__linked\"\n\t\t\t\t:showActions=\"!hasHeaderActions\"\n\t\t\t\t:objectId=\"objectKey\"\n\t\t\t\t:register=\"registerKey\"\n\t\t\t\t:schema=\"schemaKey\" />\n\t\t</template>\n\t</div>\n</template>\n\n<script>\nimport { translate as t } from '@nextcloud/l10n'\nimport { NcButton, NcNoteCard, NcSelect } from '@nextcloud/vue'\nimport EmailEditOutline from 'vue-material-design-icons/EmailEditOutline.vue'\nimport EmailOffOutline from 'vue-material-design-icons/EmailOffOutline.vue'\nimport LinkVariant from 'vue-material-design-icons/LinkVariant.vue'\nimport OpenInNew from 'vue-material-design-icons/OpenInNew.vue'\nimport CnEmailTab from '../../integrations/builtin/email/CnEmailTab.vue'\nimport CnEmptyContent from '../CnEmptyContent/CnEmptyContent.vue'\nimport { fetchEndpointSource, interpolateUrlTokens } from '../../composables/useEndpointSource.js'\nimport { evaluateVisibleWhenLocal } from '../../utils/visibleWhen.js'\n\n/** The actions `content.headerActions` can put in the tab's header. */\nconst HEADER_ACTIONS = ['compose', 'link']\n\n/**\n * Read a reference that may be a slug, an id or an object carrying either.\n *\n * @param {string|number|object} value The reference.\n * @return {string} The slug or id, or ''.\n */\nfunction keyOf(value) {\n\tif (value === null || value === undefined) {\n\t\treturn ''\n\t}\n\tif (typeof value === 'object') {\n\t\treturn String(value.slug || value.id || value.uuid || '')\n\t}\n\treturn String(value)\n}\n\n/**\n * CnMailTab — the mail of one record: drafts in Nextcloud Mail, from a\n * template or empty, above the mail linked to the record.\n *\n * Registered as the `mail` widget type. The app owns the endpoints and the\n * texts; the tab never sends mail. A draft is a POST to `draft.url`, whose\n * response may carry `draftUrl` (opened in a new tab) and `unresolved` (the\n * template fields the server could not fill). A 404 there means the app has\n * no Mail to draft into, and the tab says so instead of the controls.\n *\n * ```json\n * {\n * \"type\": \"mail\",\n * \"content\": {\n * \"heading\": \"Email\",\n * \"description\": \"Mail linked to this case\",\n * \"hint\": \"The draft opens in Nextcloud Mail.\",\n * \"templates\": { \"url\": \"/apps/app/api/types/@object.type/templates\", \"responsePath\": \"results\", \"labelField\": \"name\", \"idField\": \"id\" },\n * \"noTemplatesText\": \"No templates for this type yet\",\n * \"draft\": { \"url\": \"/apps/app/api/records/@objectId/templates/{templateId}/draft\", \"blankTemplateId\": \"blank\" },\n * \"closedWhen\": { \"field\": \"endDate\", \"op\": \"notEmpty\" },\n * \"linkedMail\": true,\n * \"headerActions\": [\"link\", \"compose\"]\n * }\n * }\n * ```\n *\n * URLs take the `@objectId` / `@object.<field>` tokens of `endpointSource`;\n * `{templateId}` in the draft URL is the chosen template's id, or\n * `blankTemplateId` for an empty draft. Without `templates` the row offers\n * the empty draft only; without `draft` there is no row. `closedWhen` is a\n * local visibleWhen condition on the record that disables drafting.\n * `linkedMail: false` leaves the linked mail to a separate `email`\n * integration card. `headerActions` puts buttons beside the heading:\n * `compose` opens the empty draft (or Nextcloud Mail's composer when there\n * is no `draft`) and replaces the row's empty-draft button, unless\n * `draft.blankButton` is true (DqZaakEmail draws both); `link` opens the\n * linked mail's picker and needs the linked mail. The linked mail then drops\n * its own buttons. Texts go through the host's translate.\n */\nexport default {\n\tname: 'CnMailTab',\n\n\tcomponents: {\n\t\tCnEmailTab,\n\t\tCnEmptyContent,\n\t\tEmailEditOutline,\n\t\tEmailOffOutline,\n\t\tLinkVariant,\n\t\tNcButton,\n\t\tNcNoteCard,\n\t\tNcSelect,\n\t\tOpenInNew,\n\t},\n\n\tinject: {\n\t\t/** The detail page's object context (`{ objectId, object }`), for tokens. */\n\t\tcnObjectContext: { default: null },\n\t\t/** The host's translate, for the manifest texts. */\n\t\tcnTranslate: { default: () => (key) => key },\n\t},\n\n\tprops: {\n\t\t/**\n\t\t * The widget config: `{ heading?, description?, hint?, templates?,\n\t\t * noTemplatesText?, draft?, closedWhen?, linkedMail?, headerActions? }`, as in the\n\t\t * component description and docs/components/cn-mail-tab.md.\n\t\t *\n\t\t * @type {object}\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's id, for `@objectId` and the linked mail. */\n\t\tobjectId: {\n\t\t\ttype: [String, Number],\n\t\t\tdefault: '',\n\t\t},\n\n\t\t/** The bound record, for `@object.<field>` and `closedWhen`. */\n\t\tobjectData: {\n\t\t\ttype: Object,\n\t\t\tdefault: null,\n\t\t},\n\n\t\t/** The bound record's register, for the linked mail. */\n\t\tregister: {\n\t\t\ttype: [String, Object],\n\t\t\tdefault: '',\n\t\t},\n\n\t\t/** The bound record's schema, for the linked mail. */\n\t\tschema: {\n\t\t\ttype: [String, Object],\n\t\t\tdefault: '',\n\t\t},\n\t},\n\n\temits: ['drafted'],\n\n\tdata() {\n\t\treturn {\n\t\t\ttemplates: [],\n\t\t\tselectedTemplate: null,\n\t\t\tdrafting: false,\n\t\t\terror: '',\n\t\t\tunresolved: [],\n\t\t\tunavailable: false,\n\t\t}\n\t},\n\n\tcomputed: {\n\t\t/** @return {object} The record, from the prop or the page context. */\n\t\trecord() {\n\t\t\tif (this.objectData) {\n\t\t\t\treturn this.objectData\n\t\t\t}\n\t\t\tconst ctx = this.cnObjectContext\n\t\t\tconst value = ctx && typeof ctx === 'object' && 'value' in ctx ? ctx.value : ctx\n\t\t\treturn (value && value.object) || {}\n\t\t},\n\n\t\t/** @return {string} The record id. */\n\t\tobjectKey() {\n\t\t\treturn keyOf(this.objectId) || keyOf(this.record.id) || keyOf(this.record['@self'] && this.record['@self'].id)\n\t\t},\n\n\t\t/** @return {string} The register slug or id, from the prop or else the record's own `@self`. */\n\t\tregisterKey() {\n\t\t\treturn keyOf(this.register) || keyOf(this.record['@self'] && this.record['@self'].register)\n\t\t},\n\n\t\t/** @return {string} The schema slug or id, from the prop or else the record's own `@self`. */\n\t\tschemaKey() {\n\t\t\treturn keyOf(this.schema) || keyOf(this.record['@self'] && this.record['@self'].schema)\n\t\t},\n\n\t\t/** @return {object} The token context for the URLs. */\n\t\ttokenContext() {\n\t\t\treturn { objectId: this.objectKey, object: this.record }\n\t\t},\n\n\t\t/** @return {string} The heading, translated, or ''. */\n\t\theading() {\n\t\t\treturn this.tr(this.content.heading)\n\t\t},\n\n\t\t/** @return {string} The line under the heading, translated, or ''. */\n\t\tdescription() {\n\t\t\treturn this.tr(this.content.description)\n\t\t},\n\n\t\t/** @return {string} The line under the template row, translated, or ''. */\n\t\thint() {\n\t\t\treturn this.tr(this.content.hint)\n\t\t},\n\n\t\t/** @return {object|null} The templates endpoint, or null. */\n\t\ttemplatesSource() {\n\t\t\tconst source = this.content.templates\n\t\t\treturn source && typeof source === 'object' && source.url ? source : null\n\t\t},\n\n\t\t/** @return {object|null} The draft endpoint, or null. */\n\t\tdraftSource() {\n\t\t\tconst source = this.content.draft\n\t\t\treturn source && typeof source === 'object' && source.url ? source : null\n\t\t},\n\n\t\t/** @return {boolean} Whether the template select and its button show. */\n\t\ttemplatesEnabled() {\n\t\t\treturn this.templatesSource !== null\n\t\t},\n\n\t\t/** @return {boolean} Whether the template row shows. */\n\t\tdraftEnabled() {\n\t\t\treturn this.draftSource !== null\n\t\t},\n\n\t\t/** @return {string} The template field shown in the select. */\n\t\ttemplateLabelField() {\n\t\t\treturn (this.templatesSource && this.templatesSource.labelField) || 'name'\n\t\t},\n\n\t\t/** @return {string} The template field that identifies it. */\n\t\ttemplateIdField() {\n\t\t\treturn (this.templatesSource && this.templatesSource.idField) || 'id'\n\t\t},\n\n\t\t/** @return {string} The select's placeholder. */\n\t\ttemplatePlaceholder() {\n\t\t\tif (this.templates.length === 0) {\n\t\t\t\treturn this.tr(this.content.noTemplatesText) || t('nextcloud-vue', 'No templates yet')\n\t\t\t}\n\t\t\treturn t('nextcloud-vue', 'Select a template (optional)…')\n\t\t},\n\n\t\t/** @return {boolean} Whether `closedWhen` holds for the record. */\n\t\tclosed() {\n\t\t\tconst cond = this.content.closedWhen\n\t\t\tif (!cond) {\n\t\t\t\treturn false\n\t\t\t}\n\t\t\treturn evaluateVisibleWhenLocal(cond, this.record)\n\t\t},\n\n\t\t/** @return {string} The templates URL after tokens, to refetch on change. */\n\t\ttemplatesUrl() {\n\t\t\treturn this.templatesSource ? interpolateUrlTokens(this.templatesSource.url, this.tokenContext) : ''\n\t\t},\n\n\t\t/** @return {boolean} Whether the linked mail list shows. */\n\t\tlinkedMail() {\n\t\t\treturn this.content.linkedMail !== false\n\t\t},\n\n\t\t/**\n\t\t * The known header actions the config asks for.\n\t\t *\n\t\t * @return {string[]} `compose` and or `link`.\n\t\t * @spec openspec/changes/mail-tab-compose-and-link/specs/mail-tab-compose-and-link/spec.md#requirement-the-mail-tab-can-carry-compose-mail-and-link-mail-in-its-header\n\t\t */\n\t\theaderActions() {\n\t\t\tconst list = Array.isArray(this.content.headerActions) ? this.content.headerActions : []\n\t\t\treturn list.filter((key) => HEADER_ACTIONS.includes(key))\n\t\t},\n\n\t\t/** @return {boolean} Whether the header shows \"Compose mail\". */\n\t\tshowComposeAction() {\n\t\t\treturn this.headerActions.includes('compose')\n\t\t},\n\n\t\t/** @return {boolean} Whether the header shows \"Link mail\": it opens the linked mail's picker. */\n\t\tshowLinkAction() {\n\t\t\treturn this.headerActions.includes('link') && this.linkedMail && this.objectKey !== ''\n\t\t},\n\n\t\t/** @return {boolean} Whether the header holds any button. */\n\t\thasHeaderActions() {\n\t\t\treturn this.showComposeAction || this.showLinkAction\n\t\t},\n\n\t\t/** @return {string} Nextcloud Mail's composer, for an app without a draft endpoint. */\n\t\tcomposeUrl() {\n\t\t\treturn (typeof OC !== 'undefined' && typeof OC.generateUrl === 'function')\n\t\t\t\t? OC.generateUrl('/apps/mail/box/draft')\n\t\t\t\t: '/index.php/apps/mail/box/draft'\n\t\t},\n\t},\n\n\twatch: {\n\t\ttemplatesUrl: {\n\t\t\timmediate: true,\n\t\t\thandler() {\n\t\t\t\tthis.loadTemplates()\n\t\t\t},\n\t\t},\n\t},\n\n\tmethods: {\n\t\tt,\n\n\t\t/**\n\t\t * Translate a manifest text through the host.\n\t\t *\n\t\t * @param {string} text The text.\n\t\t * @return {string} The translation, or '' for no text.\n\t\t */\n\t\ttr(text) {\n\t\t\tif (typeof text !== 'string' || text === '') {\n\t\t\t\treturn ''\n\t\t\t}\n\t\t\treturn this.cnTranslate(text)\n\t\t},\n\n\t\t/**\n\t\t * Read the templates. A failed read leaves the empty draft usable.\n\t\t *\n\t\t * @return {Promise<void>}\n\t\t */\n\t\tasync loadTemplates() {\n\t\t\tif (!this.templatesSource) {\n\t\t\t\tthis.templates = []\n\t\t\t\treturn\n\t\t\t}\n\t\t\ttry {\n\t\t\t\tconst payload = await fetchEndpointSource(this.templatesSource, this.tokenContext)\n\t\t\t\tconst list = Array.isArray(payload) ? payload : (payload && Array.isArray(payload.results) ? payload.results : [])\n\t\t\t\tthis.templates = list\n\t\t\t} catch (err) {\n\t\t\t\t// eslint-disable-next-line no-console\n\t\t\t\tconsole.warn('[CnMailTab] could not read the templates', err)\n\t\t\t\tthis.templates = []\n\t\t\t}\n\t\t},\n\n\t\t/** @return {Promise<void>} */\n\t\tdraftFromTemplate() {\n\t\t\treturn this.openDraft(this.selectedTemplate)\n\t\t},\n\n\t\t/**\n\t\t * \"Compose mail\": the empty draft through the app's endpoint. Without\n\t\t * one the button is a link to Mail's composer and needs no handler.\n\t\t *\n\t\t * @return {Promise<void>|undefined}\n\t\t */\n\t\tonCompose() {\n\t\t\treturn this.draftEnabled ? this.draftBlank() : undefined\n\t\t},\n\n\t\t/**\n\t\t * \"Link mail\": the linked mail's picker, which links the chosen\n\t\t * message to the record through its own endpoint.\n\t\t *\n\t\t * @return {void}\n\t\t */\n\t\topenLinkPicker() {\n\t\t\tconst linked = this.$refs.linkedMail\n\t\t\tif (linked && typeof linked.openPicker === 'function') {\n\t\t\t\tlinked.openPicker()\n\t\t\t}\n\t\t},\n\n\t\t/** @return {Promise<void>} */\n\t\tdraftBlank() {\n\t\t\tthis.selectedTemplate = null\n\t\t\treturn this.openDraft(null)\n\t\t},\n\n\t\t/**\n\t\t * Ask the app to create a Nextcloud Mail draft and open it.\n\t\t *\n\t\t * @param {object|null} template The chosen template, or null for an empty draft.\n\t\t * @return {Promise<void>}\n\t\t */\n\t\tasync openDraft(template) {\n\t\t\tif (this.closed || !this.draftSource) {\n\t\t\t\treturn\n\t\t\t}\n\t\t\tthis.drafting = true\n\t\t\tthis.error = ''\n\t\t\tthis.unresolved = []\n\t\t\ttry {\n\t\t\t\tconst id = template ? template[this.templateIdField] : (this.draftSource.blankTemplateId || 'blank')\n\t\t\t\tconst path = interpolateUrlTokens(this.draftSource.url, this.tokenContext)\n\t\t\t\t\t.replace('{templateId}', encodeURIComponent(String(id)))\n\t\t\t\tconst [{ default: axios }, { generateUrl }] = await Promise.all([\n\t\t\t\t\timport('@nextcloud/axios'),\n\t\t\t\t\timport('@nextcloud/router'),\n\t\t\t\t])\n\t\t\t\tconst { data } = await axios.post(generateUrl(path), {})\n\t\t\t\tthis.unresolved = Array.isArray(data && data.unresolved) ? data.unresolved : []\n\t\t\t\tif (data && data.draftUrl) {\n\t\t\t\t\twindow.open(data.draftUrl, '_blank', 'noopener')\n\t\t\t\t}\n\t\t\t\t/**\n\t\t\t\t * @event drafted A draft was made from a template. Carries the\n\t\t\t\t * draft endpoint's response, including `draftUrl` and\n\t\t\t\t * `unresolved` when the endpoint returns them.\n\t\t\t\t * @type {object}\n\t\t\t\t */\n\t\t\t\tthis.$emit('drafted', data)\n\t\t\t} catch (err) {\n\t\t\t\tconst response = err && err.response\n\t\t\t\tif (response && response.status === 404) {\n\t\t\t\t\tthis.unavailable = true\n\t\t\t\t}\n\t\t\t\tthis.error = (response && response.data && response.data.message)\n\t\t\t\t\t|| (err && err.message)\n\t\t\t\t\t|| t('nextcloud-vue', 'The draft could not be opened.')\n\t\t\t} finally {\n\t\t\t\tthis.drafting = false\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * Write a template field the way the template spells it.\n\t\t *\n\t\t * @param {string} name The field name.\n\t\t * @return {string} `{{name}}`.\n\t\t */\n\t\tplaceholderOf(name) {\n\t\t\treturn `{{${name}}}`\n\t\t},\n\t},\n}\n</script>\n\n<style scoped>\n.cn-mail-tab {\n\tdisplay: flex;\n\tflex-direction: column;\n\tgap: 16px;\n\tpadding: 12px;\n}\n\n.cn-mail-tab__header {\n\tdisplay: flex;\n\tflex-wrap: wrap;\n\talign-items: flex-start;\n\tjustify-content: space-between;\n\tgap: 10px 16px;\n}\n\n.cn-mail-tab__heading {\n\tdisplay: flex;\n\tflex: 1 1 260px;\n\tflex-direction: column;\n\tgap: 3px;\n\tmin-width: 0;\n}\n\n.cn-mail-tab__header-actions {\n\tdisplay: flex;\n\tflex: none;\n\tflex-wrap: wrap;\n\tgap: 8px;\n}\n\n.cn-mail-tab__title {\n\tmargin: 0;\n\tfont-size: 16px;\n\tfont-weight: bold;\n}\n\n.cn-mail-tab__subtitle,\n.cn-mail-tab__hint {\n\tmargin: 0;\n\tcolor: var(--color-text-maxcontrast);\n}\n\n.cn-mail-tab__template-row {\n\tdisplay: flex;\n\tflex-wrap: wrap;\n\talign-items: flex-end;\n\tgap: 8px;\n}\n\n.cn-mail-tab__template-actions {\n\tdisplay: flex;\n\tflex-wrap: wrap;\n\tgap: 8px;\n}\n\n.cn-mail-tab__template-select {\n\tflex: 1 1 260px;\n}\n\n.cn-mail-tab__unresolved {\n\tmargin: 4px 0 0;\n\tpadding-inline-start: 20px;\n}\n\n.cn-mail-tab__unresolved code {\n\tbackground: var(--color-background-dark);\n\tpadding: 2px 6px;\n\tborder-radius: var(--border-radius);\n\tfont-family: var(--font-face-mono, monospace);\n}\n</style>\n"],"names":["CnEmailTab","CnEmptyContent","t"],"mappings":";;;;;;;;;;;;AAuIA;AACA,MAAM,cAAe,GAAE,CAAC,SAAS,EAAE,MAAM,EAAA;;AAEzC;;AAEC;;AAEA;;AAED,SAAS,KAAK,CAAC,KAAK,EAAE;AACrB,CAAA,IAAI,KAAI,KAAM,QAAQ,KAAM,KAAI,SAAS,EAAE;AAC1C,EAAA,OAAO,EAAC;AACT,EAAA;CACA,IAAI,OAAO,UAAU,QAAQ,EAAE;EAC9B,OAAO,MAAM,CAAC,KAAK,CAAC,IAAK,IAAG,KAAK,CAAC,EAAC,IAAK,KAAK,CAAC,IAAK,IAAG,EAAE,CAAA;AACzD,EAAA;AACA,CAAA,OAAO,MAAM,CAAC,KAAK,CAAA;AACpB,CAAA;;AAEA;;;AAGC;;;AAGA;;;AAGA;AACA;;AAEA;;AAEA;AACA;AACA;;;;;AAKA;AACA;;;AAGA;AACA;AACA;;AAEA;;;;;AAKA;;AAEA;AACA;;;AAGD,aAAe;AACd,CAAA,IAAI,EAAE,WAAW;;CAEjB,UAAU,EAAE;cACXA,UAAU;AACV,kBAAAC,YAAc;AACd,EAAA,gBAAgB;AAChB,EAAA,eAAe;EACf,WAAW;AACX,EAAA,QAAQ;EACR,UAAU;AACV,EAAA,QAAQ;AACR,EAAA,SAAS;EACT;;AAED,CAAA,MAAM,EAAE;AACP;AACA,EAAA,eAAe,EAAE,EAAE,OAAO,EAAE,IAAG,EAAG;AAClC;AACA,EAAA,WAAW,EAAE,EAAE,OAAO,EAAE,MAAM,CAAC,GAAG,KAAK,KAAK;EAC5C;;AAED,CAAA,KAAK,EAAE;AACN;;AAEC;;AAEA;;;AAGD,EAAA,OAAO,EAAE;GACR,IAAI,EAAE,MAAM;AACZ,GAAA,OAAO,EAAE,OAAO,EAAE,C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,IAAK,GAAG,CAAC,SAAO;AACnC,IAAA,IAAI,QAAS,IAAG,QAAQ,CAAC,MAAK,KAAM,GAAG,EAAE;AACxC,KAAA,IAAI,CAAC,cAAc,KAAG;AACvB,KAAA;IACA,IAAI,CAAC,KAAI,GAAI,CAAC,QAAS,IAAG,QAAQ,CAAC,IAAK,IAAG,QAAQ,CAAC,IAAI,CAAC,OAAO;AAC/D,SAAI,GAAE,IAAK,GAAG,CAAC,OAAO,CAAA;QACnBA,SAAC,CAAC,eAAe,EAAE,gCAAgC,EAAA;AACxD,IAAA,SAAU;AACT,IAAA,IAAI,CAAC,QAAS,GAAE,MAAI;AACrB,IAAA;GACA;;AAED;AACC;AACA;AACA;;;AAGD,EAAA,aAAa,CAAC,IAAI,EAAE;AACnB,GAAA,OAAO,CAAC,EAAE,EAAE,IAAI,CAAC,EAAE,CAAA;GACnB;EACD;AACF;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"CnMailTab.vue3.js","sources":["../../../../src/components/CnMailTab/CnMailTab.vue?vue&type=template&id=7a3a1cfc&lang.js"],"sourcesContent":["<!--\n - SPDX-FileCopyrightText: 2026 Conduction B.V.\n - SPDX-License-Identifier: EUPL-1.2\n-->\n<template>\n\t<div class=\"cn-mail-tab\" data-testid=\"cn-mail-tab\">\n\t\t<CnEmptyContent\n\t\t\tv-if=\"unavailable\"\n\t\t\t:name=\"t('nextcloud-vue', 'Mail is not available')\"\n\t\t\t:description=\"t('nextcloud-vue', 'Install Nextcloud Mail to draft and link mail here.')\">\n\t\t\t<template #icon>\n\t\t\t\t<EmailOffOutline :size=\"48\" />\n\t\t\t</template>\n\t\t</CnEmptyContent>\n\n\t\t<template v-else>\n\t\t\t<div v-if=\"heading || description || hasHeaderActions\" class=\"cn-mail-tab__header\" data-testid=\"cn-mail-tab-header\">\n\t\t\t\t<div class=\"cn-mail-tab__heading\">\n\t\t\t\t\t<h3 v-if=\"heading\" class=\"cn-mail-tab__title\">\n\t\t\t\t\t\t{{ heading }}\n\t\t\t\t\t</h3>\n\t\t\t\t\t<!-- Divs, not <p>: a theme that sizes every paragraph with !important\n\t\t\t\t\t would override the card's 14px description. -->\n\t\t\t\t\t<div v-if=\"description\" class=\"cn-mail-tab__subtitle\">\n\t\t\t\t\t\t{{ description }}\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t\t<div v-if=\"hasHeaderActions\" class=\"cn-mail-tab__header-actions\">\n\t\t\t\t\t<NcButton\n\t\t\t\t\t\tv-if=\"showLinkAction\"\n\t\t\t\t\t\tvariant=\"secondary\"\n\t\t\t\t\t\tdata-testid=\"cn-mail-tab-header-link\"\n\t\t\t\t\t\t@click=\"openLinkPicker\">\n\t\t\t\t\t\t<template #icon>\n\t\t\t\t\t\t\t<LinkVariant :size=\"18\" />\n\t\t\t\t\t\t</template>\n\t\t\t\t\t\t{{ t('nextcloud-vue', 'Link mail') }}\n\t\t\t\t\t</NcButton>\n\t\t\t\t\t<NcButton\n\t\t\t\t\t\tv-if=\"showComposeAction\"\n\t\t\t\t\t\tvariant=\"primary\"\n\t\t\t\t\t\t:disabled=\"draftEnabled && (closed || drafting)\"\n\t\t\t\t\t\t:href=\"draftEnabled ? undefined : composeUrl\"\n\t\t\t\t\t\t:target=\"draftEnabled ? undefined : '_blank'\"\n\t\t\t\t\t\tdata-testid=\"cn-mail-tab-header-compose\"\n\t\t\t\t\t\t@click=\"onCompose\">\n\t\t\t\t\t\t<template #icon>\n\t\t\t\t\t\t\t<EmailEditOutline :size=\"18\" />\n\t\t\t\t\t\t</template>\n\t\t\t\t\t\t{{ t('nextcloud-vue', 'Compose mail') }}\n\t\t\t\t\t</NcButton>\n\t\t\t\t</div>\n\t\t\t</div>\n\n\t\t\t<div v-if=\"draftEnabled\" class=\"cn-mail-tab__template-row\" data-testid=\"cn-mail-tab-template-row\">\n\t\t\t\t<NcSelect\n\t\t\t\t\tv-if=\"templatesEnabled\"\n\t\t\t\t\tv-model=\"selectedTemplate\"\n\t\t\t\t\tclass=\"cn-mail-tab__template-select\"\n\t\t\t\t\t:options=\"templates\"\n\t\t\t\t\t:disabled=\"templates.length === 0\"\n\t\t\t\t\t:inputLabel=\"t('nextcloud-vue', 'Email template')\"\n\t\t\t\t\t:label=\"templateLabelField\"\n\t\t\t\t\t:trackBy=\"templateIdField\"\n\t\t\t\t\t:placeholder=\"templatePlaceholder\"\n\t\t\t\t\t:clearable=\"true\" />\n\t\t\t\t<!-- The draft buttons stand together, 8px apart, beside the field. -->\n\t\t\t\t<div class=\"cn-mail-tab__template-actions\">\n\t\t\t\t\t<NcButton\n\t\t\t\t\t\tv-if=\"templatesEnabled\"\n\t\t\t\t\t\t:disabled=\"closed || drafting || !selectedTemplate\"\n\t\t\t\t\t\tdata-testid=\"cn-mail-tab-draft-template\"\n\t\t\t\t\t\t@click=\"draftFromTemplate\">\n\t\t\t\t\t\t<template #icon>\n\t\t\t\t\t\t\t<OpenInNew :size=\"16\" />\n\t\t\t\t\t\t</template>\n\t\t\t\t\t\t{{ t('nextcloud-vue', 'Open draft from template') }}\n\t\t\t\t\t</NcButton>\n\t\t\t\t\t<NcButton\n\t\t\t\t\t\tv-if=\"!showComposeAction || draftSource.blankButton === true\"\n\t\t\t\t\t\t:disabled=\"closed || drafting\"\n\t\t\t\t\t\tdata-testid=\"cn-mail-tab-draft-blank\"\n\t\t\t\t\t\t@click=\"draftBlank\">\n\t\t\t\t\t\t{{ t('nextcloud-vue', 'Empty draft') }}\n\t\t\t\t\t</NcButton>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t\t<div v-if=\"hint\" class=\"cn-mail-tab__hint\">\n\t\t\t\t{{ hint }}\n\t\t\t</div>\n\n\t\t\t<NcNoteCard\n\t\t\t\tv-if=\"error\"\n\t\t\t\ttype=\"error\"\n\t\t\t\t:heading=\"t('nextcloud-vue', 'Could not open draft')\"\n\t\t\t\trole=\"alert\">\n\t\t\t\t{{ error }}\n\t\t\t</NcNoteCard>\n\t\t\t<NcNoteCard\n\t\t\t\tv-if=\"unresolved.length > 0\"\n\t\t\t\ttype=\"warning\"\n\t\t\t\trole=\"status\"\n\t\t\t\tdata-testid=\"cn-mail-tab-unresolved\">\n\t\t\t\t<p>{{ t('nextcloud-vue', 'Some template fields could not be filled. Fill these in the draft yourself:') }}</p>\n\t\t\t\t<ul class=\"cn-mail-tab__unresolved\">\n\t\t\t\t\t<li v-for=\"name in unresolved\" :key=\"name\">\n\t\t\t\t\t\t<code>{{ placeholderOf(name) }}</code>\n\t\t\t\t\t</li>\n\t\t\t\t</ul>\n\t\t\t</NcNoteCard>\n\n\t\t\t<CnEmailTab\n\t\t\t\tv-if=\"linkedMail && objectKey\"\n\t\t\t\tref=\"linkedMail\"\n\t\t\t\tclass=\"cn-mail-tab__linked\"\n\t\t\t\t:showActions=\"!hasHeaderActions\"\n\t\t\t\t:objectId=\"objectKey\"\n\t\t\t\t:register=\"registerKey\"\n\t\t\t\t:schema=\"schemaKey\" />\n\t\t</template>\n\t</div>\n</template>\n\n<script>\nimport { translate as t } from '@nextcloud/l10n'\nimport { NcButton, NcNoteCard, NcSelect } from '@nextcloud/vue'\nimport EmailEditOutline from 'vue-material-design-icons/EmailEditOutline.vue'\nimport EmailOffOutline from 'vue-material-design-icons/EmailOffOutline.vue'\nimport LinkVariant from 'vue-material-design-icons/LinkVariant.vue'\nimport OpenInNew from 'vue-material-design-icons/OpenInNew.vue'\nimport CnEmailTab from '../../integrations/builtin/email/CnEmailTab.vue'\nimport CnEmptyContent from '../CnEmptyContent/CnEmptyContent.vue'\nimport { fetchEndpointSource, interpolateUrlTokens } from '../../composables/useEndpointSource.js'\nimport { evaluateVisibleWhenLocal } from '../../utils/visibleWhen.js'\n\n/** The actions `content.headerActions` can put in the tab's header. */\nconst HEADER_ACTIONS = ['compose', 'link']\n\n/**\n * Read a reference that may be a slug, an id or an object carrying either.\n *\n * @param {string|number|object} value The reference.\n * @return {string} The slug or id, or ''.\n */\nfunction keyOf(value) {\n\tif (value === null || value === undefined) {\n\t\treturn ''\n\t}\n\tif (typeof value === 'object') {\n\t\treturn String(value.slug || value.id || value.uuid || '')\n\t}\n\treturn String(value)\n}\n\n/**\n * CnMailTab — the mail of one record: drafts in Nextcloud Mail, from a\n * template or empty, above the mail linked to the record.\n *\n * Registered as the `mail` widget type. The app owns the endpoints and the\n * texts; the tab never sends mail. A draft is a POST to `draft.url`, whose\n * response may carry `draftUrl` (opened in a new tab) and `unresolved` (the\n * template fields the server could not fill). A 404 there means the app has\n * no Mail to draft into, and the tab says so instead of the controls.\n *\n * ```json\n * {\n * \"type\": \"mail\",\n * \"content\": {\n * \"heading\": \"Email\",\n * \"description\": \"Mail linked to this case\",\n * \"hint\": \"The draft opens in Nextcloud Mail.\",\n * \"templates\": { \"url\": \"/apps/app/api/types/@object.type/templates\", \"responsePath\": \"results\", \"labelField\": \"name\", \"idField\": \"id\" },\n * \"noTemplatesText\": \"No templates for this type yet\",\n * \"draft\": { \"url\": \"/apps/app/api/records/@objectId/templates/{templateId}/draft\", \"blankTemplateId\": \"blank\" },\n * \"closedWhen\": { \"field\": \"endDate\", \"op\": \"notEmpty\" },\n * \"linkedMail\": true,\n * \"headerActions\": [\"link\", \"compose\"]\n * }\n * }\n * ```\n *\n * URLs take the `@objectId` / `@object.<field>` tokens of `endpointSource`;\n * `{templateId}` in the draft URL is the chosen template's id, or\n * `blankTemplateId` for an empty draft. Without `templates` the row offers\n * the empty draft only; without `draft` there is no row. `closedWhen` is a\n * local visibleWhen condition on the record that disables drafting.\n * `linkedMail: false` leaves the linked mail to a separate `email`\n * integration card. `headerActions` puts buttons beside the heading:\n * `compose` opens the empty draft (or Nextcloud Mail's composer when there\n * is no `draft`) and replaces the row's empty-draft button, unless\n * `draft.blankButton` is true (DqZaakEmail draws both); `link` opens the\n * linked mail's picker and needs the linked mail. The linked mail then drops\n * its own buttons. Texts go through the host's translate.\n */\nexport default {\n\tname: 'CnMailTab',\n\n\tcomponents: {\n\t\tCnEmailTab,\n\t\tCnEmptyContent,\n\t\tEmailEditOutline,\n\t\tEmailOffOutline,\n\t\tLinkVariant,\n\t\tNcButton,\n\t\tNcNoteCard,\n\t\tNcSelect,\n\t\tOpenInNew,\n\t},\n\n\tinject: {\n\t\t/** The detail page's object context (`{ objectId, object }`), for tokens. */\n\t\tcnObjectContext: { default: null },\n\t\t/** The host's translate, for the manifest texts. */\n\t\tcnTranslate: { default: () => (key) => key },\n\t},\n\n\tprops: {\n\t\t/**\n\t\t * The widget config: `{ heading?, description?, hint?, templates?,\n\t\t * noTemplatesText?, draft?, closedWhen?, linkedMail?, headerActions? }`, as in the\n\t\t * component description and docs/components/cn-mail-tab.md.\n\t\t *\n\t\t * @type {object}\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's id, for `@objectId` and the linked mail. */\n\t\tobjectId: {\n\t\t\ttype: [String, Number],\n\t\t\tdefault: '',\n\t\t},\n\n\t\t/** The bound record, for `@object.<field>` and `closedWhen`. */\n\t\tobjectData: {\n\t\t\ttype: Object,\n\t\t\tdefault: null,\n\t\t},\n\n\t\t/** The bound record's register, for the linked mail. */\n\t\tregister: {\n\t\t\ttype: [String, Object],\n\t\t\tdefault: '',\n\t\t},\n\n\t\t/** The bound record's schema, for the linked mail. */\n\t\tschema: {\n\t\t\ttype: [String, Object],\n\t\t\tdefault: '',\n\t\t},\n\t},\n\n\temits: ['drafted'],\n\n\tdata() {\n\t\treturn {\n\t\t\ttemplates: [],\n\t\t\tselectedTemplate: null,\n\t\t\tdrafting: false,\n\t\t\terror: '',\n\t\t\tunresolved: [],\n\t\t\tunavailable: false,\n\t\t}\n\t},\n\n\tcomputed: {\n\t\t/** @return {object} The record, from the prop or the page context. */\n\t\trecord() {\n\t\t\tif (this.objectData) {\n\t\t\t\treturn this.objectData\n\t\t\t}\n\t\t\tconst ctx = this.cnObjectContext\n\t\t\tconst value = ctx && typeof ctx === 'object' && 'value' in ctx ? ctx.value : ctx\n\t\t\treturn (value && value.object) || {}\n\t\t},\n\n\t\t/** @return {string} The record id. */\n\t\tobjectKey() {\n\t\t\treturn keyOf(this.objectId) || keyOf(this.record.id) || keyOf(this.record['@self'] && this.record['@self'].id)\n\t\t},\n\n\t\t/** @return {string} The register slug or id. */\n\t\tregisterKey() {\n\t\t\treturn keyOf(this.register)\n\t\t},\n\n\t\t/** @return {string} The schema slug or id. */\n\t\tschemaKey() {\n\t\t\treturn keyOf(this.schema)\n\t\t},\n\n\t\t/** @return {object} The token context for the URLs. */\n\t\ttokenContext() {\n\t\t\treturn { objectId: this.objectKey, object: this.record }\n\t\t},\n\n\t\t/** @return {string} The heading, translated, or ''. */\n\t\theading() {\n\t\t\treturn this.tr(this.content.heading)\n\t\t},\n\n\t\t/** @return {string} The line under the heading, translated, or ''. */\n\t\tdescription() {\n\t\t\treturn this.tr(this.content.description)\n\t\t},\n\n\t\t/** @return {string} The line under the template row, translated, or ''. */\n\t\thint() {\n\t\t\treturn this.tr(this.content.hint)\n\t\t},\n\n\t\t/** @return {object|null} The templates endpoint, or null. */\n\t\ttemplatesSource() {\n\t\t\tconst source = this.content.templates\n\t\t\treturn source && typeof source === 'object' && source.url ? source : null\n\t\t},\n\n\t\t/** @return {object|null} The draft endpoint, or null. */\n\t\tdraftSource() {\n\t\t\tconst source = this.content.draft\n\t\t\treturn source && typeof source === 'object' && source.url ? source : null\n\t\t},\n\n\t\t/** @return {boolean} Whether the template select and its button show. */\n\t\ttemplatesEnabled() {\n\t\t\treturn this.templatesSource !== null\n\t\t},\n\n\t\t/** @return {boolean} Whether the template row shows. */\n\t\tdraftEnabled() {\n\t\t\treturn this.draftSource !== null\n\t\t},\n\n\t\t/** @return {string} The template field shown in the select. */\n\t\ttemplateLabelField() {\n\t\t\treturn (this.templatesSource && this.templatesSource.labelField) || 'name'\n\t\t},\n\n\t\t/** @return {string} The template field that identifies it. */\n\t\ttemplateIdField() {\n\t\t\treturn (this.templatesSource && this.templatesSource.idField) || 'id'\n\t\t},\n\n\t\t/** @return {string} The select's placeholder. */\n\t\ttemplatePlaceholder() {\n\t\t\tif (this.templates.length === 0) {\n\t\t\t\treturn this.tr(this.content.noTemplatesText) || t('nextcloud-vue', 'No templates yet')\n\t\t\t}\n\t\t\treturn t('nextcloud-vue', 'Select a template (optional)…')\n\t\t},\n\n\t\t/** @return {boolean} Whether `closedWhen` holds for the record. */\n\t\tclosed() {\n\t\t\tconst cond = this.content.closedWhen\n\t\t\tif (!cond) {\n\t\t\t\treturn false\n\t\t\t}\n\t\t\treturn evaluateVisibleWhenLocal(cond, this.record)\n\t\t},\n\n\t\t/** @return {string} The templates URL after tokens, to refetch on change. */\n\t\ttemplatesUrl() {\n\t\t\treturn this.templatesSource ? interpolateUrlTokens(this.templatesSource.url, this.tokenContext) : ''\n\t\t},\n\n\t\t/** @return {boolean} Whether the linked mail list shows. */\n\t\tlinkedMail() {\n\t\t\treturn this.content.linkedMail !== false\n\t\t},\n\n\t\t/**\n\t\t * The known header actions the config asks for.\n\t\t *\n\t\t * @return {string[]} `compose` and or `link`.\n\t\t * @spec openspec/changes/mail-tab-compose-and-link/specs/mail-tab-compose-and-link/spec.md#requirement-the-mail-tab-can-carry-compose-mail-and-link-mail-in-its-header\n\t\t */\n\t\theaderActions() {\n\t\t\tconst list = Array.isArray(this.content.headerActions) ? this.content.headerActions : []\n\t\t\treturn list.filter((key) => HEADER_ACTIONS.includes(key))\n\t\t},\n\n\t\t/** @return {boolean} Whether the header shows \"Compose mail\". */\n\t\tshowComposeAction() {\n\t\t\treturn this.headerActions.includes('compose')\n\t\t},\n\n\t\t/** @return {boolean} Whether the header shows \"Link mail\": it opens the linked mail's picker. */\n\t\tshowLinkAction() {\n\t\t\treturn this.headerActions.includes('link') && this.linkedMail && this.objectKey !== ''\n\t\t},\n\n\t\t/** @return {boolean} Whether the header holds any button. */\n\t\thasHeaderActions() {\n\t\t\treturn this.showComposeAction || this.showLinkAction\n\t\t},\n\n\t\t/** @return {string} Nextcloud Mail's composer, for an app without a draft endpoint. */\n\t\tcomposeUrl() {\n\t\t\treturn (typeof OC !== 'undefined' && typeof OC.generateUrl === 'function')\n\t\t\t\t? OC.generateUrl('/apps/mail/box/draft')\n\t\t\t\t: '/index.php/apps/mail/box/draft'\n\t\t},\n\t},\n\n\twatch: {\n\t\ttemplatesUrl: {\n\t\t\timmediate: true,\n\t\t\thandler() {\n\t\t\t\tthis.loadTemplates()\n\t\t\t},\n\t\t},\n\t},\n\n\tmethods: {\n\t\tt,\n\n\t\t/**\n\t\t * Translate a manifest text through the host.\n\t\t *\n\t\t * @param {string} text The text.\n\t\t * @return {string} The translation, or '' for no text.\n\t\t */\n\t\ttr(text) {\n\t\t\tif (typeof text !== 'string' || text === '') {\n\t\t\t\treturn ''\n\t\t\t}\n\t\t\treturn this.cnTranslate(text)\n\t\t},\n\n\t\t/**\n\t\t * Read the templates. A failed read leaves the empty draft usable.\n\t\t *\n\t\t * @return {Promise<void>}\n\t\t */\n\t\tasync loadTemplates() {\n\t\t\tif (!this.templatesSource) {\n\t\t\t\tthis.templates = []\n\t\t\t\treturn\n\t\t\t}\n\t\t\ttry {\n\t\t\t\tconst payload = await fetchEndpointSource(this.templatesSource, this.tokenContext)\n\t\t\t\tconst list = Array.isArray(payload) ? payload : (payload && Array.isArray(payload.results) ? payload.results : [])\n\t\t\t\tthis.templates = list\n\t\t\t} catch (err) {\n\t\t\t\t// eslint-disable-next-line no-console\n\t\t\t\tconsole.warn('[CnMailTab] could not read the templates', err)\n\t\t\t\tthis.templates = []\n\t\t\t}\n\t\t},\n\n\t\t/** @return {Promise<void>} */\n\t\tdraftFromTemplate() {\n\t\t\treturn this.openDraft(this.selectedTemplate)\n\t\t},\n\n\t\t/**\n\t\t * \"Compose mail\": the empty draft through the app's endpoint. Without\n\t\t * one the button is a link to Mail's composer and needs no handler.\n\t\t *\n\t\t * @return {Promise<void>|undefined}\n\t\t */\n\t\tonCompose() {\n\t\t\treturn this.draftEnabled ? this.draftBlank() : undefined\n\t\t},\n\n\t\t/**\n\t\t * \"Link mail\": the linked mail's picker, which links the chosen\n\t\t * message to the record through its own endpoint.\n\t\t *\n\t\t * @return {void}\n\t\t */\n\t\topenLinkPicker() {\n\t\t\tconst linked = this.$refs.linkedMail\n\t\t\tif (linked && typeof linked.openPicker === 'function') {\n\t\t\t\tlinked.openPicker()\n\t\t\t}\n\t\t},\n\n\t\t/** @return {Promise<void>} */\n\t\tdraftBlank() {\n\t\t\tthis.selectedTemplate = null\n\t\t\treturn this.openDraft(null)\n\t\t},\n\n\t\t/**\n\t\t * Ask the app to create a Nextcloud Mail draft and open it.\n\t\t *\n\t\t * @param {object|null} template The chosen template, or null for an empty draft.\n\t\t * @return {Promise<void>}\n\t\t */\n\t\tasync openDraft(template) {\n\t\t\tif (this.closed || !this.draftSource) {\n\t\t\t\treturn\n\t\t\t}\n\t\t\tthis.drafting = true\n\t\t\tthis.error = ''\n\t\t\tthis.unresolved = []\n\t\t\ttry {\n\t\t\t\tconst id = template ? template[this.templateIdField] : (this.draftSource.blankTemplateId || 'blank')\n\t\t\t\tconst path = interpolateUrlTokens(this.draftSource.url, this.tokenContext)\n\t\t\t\t\t.replace('{templateId}', encodeURIComponent(String(id)))\n\t\t\t\tconst [{ default: axios }, { generateUrl }] = await Promise.all([\n\t\t\t\t\timport('@nextcloud/axios'),\n\t\t\t\t\timport('@nextcloud/router'),\n\t\t\t\t])\n\t\t\t\tconst { data } = await axios.post(generateUrl(path), {})\n\t\t\t\tthis.unresolved = Array.isArray(data && data.unresolved) ? data.unresolved : []\n\t\t\t\tif (data && data.draftUrl) {\n\t\t\t\t\twindow.open(data.draftUrl, '_blank', 'noopener')\n\t\t\t\t}\n\t\t\t\t/**\n\t\t\t\t * @event drafted A draft was made from a template. Carries the\n\t\t\t\t * draft endpoint's response, including `draftUrl` and\n\t\t\t\t * `unresolved` when the endpoint returns them.\n\t\t\t\t * @type {object}\n\t\t\t\t */\n\t\t\t\tthis.$emit('drafted', data)\n\t\t\t} catch (err) {\n\t\t\t\tconst response = err && err.response\n\t\t\t\tif (response && response.status === 404) {\n\t\t\t\t\tthis.unavailable = true\n\t\t\t\t}\n\t\t\t\tthis.error = (response && response.data && response.data.message)\n\t\t\t\t\t|| (err && err.message)\n\t\t\t\t\t|| t('nextcloud-vue', 'The draft could not be opened.')\n\t\t\t} finally {\n\t\t\t\tthis.drafting = false\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * Write a template field the way the template spells it.\n\t\t *\n\t\t * @param {string} name The field name.\n\t\t * @return {string} `{{name}}`.\n\t\t */\n\t\tplaceholderOf(name) {\n\t\t\treturn `{{${name}}}`\n\t\t},\n\t},\n}\n</script>\n\n<style scoped>\n.cn-mail-tab {\n\tdisplay: flex;\n\tflex-direction: column;\n\tgap: 16px;\n\tpadding: 12px;\n}\n\n.cn-mail-tab__header {\n\tdisplay: flex;\n\tflex-wrap: wrap;\n\talign-items: flex-start;\n\tjustify-content: space-between;\n\tgap: 10px 16px;\n}\n\n.cn-mail-tab__heading {\n\tdisplay: flex;\n\tflex: 1 1 260px;\n\tflex-direction: column;\n\tgap: 3px;\n\tmin-width: 0;\n}\n\n.cn-mail-tab__header-actions {\n\tdisplay: flex;\n\tflex: none;\n\tflex-wrap: wrap;\n\tgap: 8px;\n}\n\n.cn-mail-tab__title {\n\tmargin: 0;\n\tfont-size: 16px;\n\tfont-weight: bold;\n}\n\n.cn-mail-tab__subtitle,\n.cn-mail-tab__hint {\n\tmargin: 0;\n\tcolor: var(--color-text-maxcontrast);\n}\n\n.cn-mail-tab__template-row {\n\tdisplay: flex;\n\tflex-wrap: wrap;\n\talign-items: flex-end;\n\tgap: 8px;\n}\n\n.cn-mail-tab__template-actions {\n\tdisplay: flex;\n\tflex-wrap: wrap;\n\tgap: 8px;\n}\n\n.cn-mail-tab__template-select {\n\tflex: 1 1 260px;\n}\n\n.cn-mail-tab__unresolved {\n\tmargin: 4px 0 0;\n\tpadding-inline-start: 20px;\n}\n\n.cn-mail-tab__unresolved code {\n\tbackground: var(--color-background-dark);\n\tpadding: 2px 6px;\n\tborder-radius: var(--border-radius);\n\tfont-family: var(--font-face-mono, monospace);\n}\n</style>\n"],"names":["_openBlock","_createElementBlock","_createBlock","_createVNode","_toDisplayString","_createTextVNode","_createElementVNode","_Fragment","_renderList"],"mappings":";;;AASM,EAAA,KAAK,EAAC,aAAa;AAAC,EAAA,aAAW,EAAC,aAAa;;;;AAW1C,EAAA,KAAA,EAAA,qBAAA;AAAA,EAAA,aAAA,EAAA,oBAAA;;AACD,MAAA,UAAA,GAAA,EAAA,KAAM,EAAE,sBAAsB,GAAA;;;AACb,EAAA,KAAI,EAAC,oBAAoB;;;;AAKrB,EAAA,KAAK,EAAC,uBAAuB;;;;AAIzB,EAAA,KAAK,EAAC,6BAAG;;;;AA2Bd,EAAA,KAAK,EAAC,2BAAM;AAAA,EAAA,aAAA,EAAA,0BAAA;;AAa/B,MAAA,UAAA,GAAA,EAAA,KAAK,EAAC,+BAA8B,GAAA;;;AAoBhC,EAAA,KAAA,EAAA,mBAAA;;AAiBL,MAAA,WAAA,GAAA,EAAA,KAAA,EAAA,yBAAA,GAAA;;;;;;;;;;;;;AAnGL,EAAA,QAAAA,SAAA,EAAA,EAAAC,kBAAA,QAAA;KAEM,KAAU,CAAA,WAAA;sBADhBC,WAOgB,CAAA,yBAAA,EAAA;;AALf,UAAA,IAAI,EAAE,QAAC,CAAA,CAAA,CAAA,eAAA,EAAA,uBAAA,CAAA;AACP,UAAA,WAAW,EAAE,QAAC,CAAA,CAAA,CAAA,eAAA,EAAA,qDAAA,CAAA;;wBAEd,MAAc;YAAdC,WAAc,CAAA,0BAAA,EAAA,EAAA,IAAA,EAAA,EAAA,EAAA,CAAA;;;;;WAKT,QAAA,CAAA,OAAA,IAAA,QAAA,CAAA,WAAA,IAAA,QAAA,CAAA,gBAAA;+CAoCA,iBAAA,EAAA;mCA1BC,iBAAA,EAAA;mBARM,QAAM,CAAA,OAAA;oCAAZF,kBAEA,CAAA,IAAA,EAFA,UAEA,EAAAG,eAAA,CADA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QAAA,CAAA,gBAAA;AACP,gBAAA,QAAC,EAAA,QAAA,CAAA,SAAA;;;;;;;;;;;"}
1
+ {"version":3,"file":"CnMailTab.vue3.js","sources":["../../../../src/components/CnMailTab/CnMailTab.vue?vue&type=template&id=474b24a4&lang.js"],"sourcesContent":["<!--\n - SPDX-FileCopyrightText: 2026 Conduction B.V.\n - SPDX-License-Identifier: EUPL-1.2\n-->\n<template>\n\t<div class=\"cn-mail-tab\" data-testid=\"cn-mail-tab\">\n\t\t<CnEmptyContent\n\t\t\tv-if=\"unavailable\"\n\t\t\t:name=\"t('nextcloud-vue', 'Mail is not available')\"\n\t\t\t:description=\"t('nextcloud-vue', 'Install Nextcloud Mail to draft and link mail here.')\">\n\t\t\t<template #icon>\n\t\t\t\t<EmailOffOutline :size=\"48\" />\n\t\t\t</template>\n\t\t</CnEmptyContent>\n\n\t\t<template v-else>\n\t\t\t<div v-if=\"heading || description || hasHeaderActions\" class=\"cn-mail-tab__header\" data-testid=\"cn-mail-tab-header\">\n\t\t\t\t<div class=\"cn-mail-tab__heading\">\n\t\t\t\t\t<h3 v-if=\"heading\" class=\"cn-mail-tab__title\">\n\t\t\t\t\t\t{{ heading }}\n\t\t\t\t\t</h3>\n\t\t\t\t\t<!-- Divs, not <p>: a theme that sizes every paragraph with !important\n\t\t\t\t\t would override the card's 14px description. -->\n\t\t\t\t\t<div v-if=\"description\" class=\"cn-mail-tab__subtitle\">\n\t\t\t\t\t\t{{ description }}\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t\t<div v-if=\"hasHeaderActions\" class=\"cn-mail-tab__header-actions\">\n\t\t\t\t\t<NcButton\n\t\t\t\t\t\tv-if=\"showLinkAction\"\n\t\t\t\t\t\tvariant=\"secondary\"\n\t\t\t\t\t\tdata-testid=\"cn-mail-tab-header-link\"\n\t\t\t\t\t\t@click=\"openLinkPicker\">\n\t\t\t\t\t\t<template #icon>\n\t\t\t\t\t\t\t<LinkVariant :size=\"18\" />\n\t\t\t\t\t\t</template>\n\t\t\t\t\t\t{{ t('nextcloud-vue', 'Link mail') }}\n\t\t\t\t\t</NcButton>\n\t\t\t\t\t<NcButton\n\t\t\t\t\t\tv-if=\"showComposeAction\"\n\t\t\t\t\t\tvariant=\"primary\"\n\t\t\t\t\t\t:disabled=\"draftEnabled && (closed || drafting)\"\n\t\t\t\t\t\t:href=\"draftEnabled ? undefined : composeUrl\"\n\t\t\t\t\t\t:target=\"draftEnabled ? undefined : '_blank'\"\n\t\t\t\t\t\tdata-testid=\"cn-mail-tab-header-compose\"\n\t\t\t\t\t\t@click=\"onCompose\">\n\t\t\t\t\t\t<template #icon>\n\t\t\t\t\t\t\t<EmailEditOutline :size=\"18\" />\n\t\t\t\t\t\t</template>\n\t\t\t\t\t\t{{ t('nextcloud-vue', 'Compose mail') }}\n\t\t\t\t\t</NcButton>\n\t\t\t\t</div>\n\t\t\t</div>\n\n\t\t\t<div v-if=\"draftEnabled\" class=\"cn-mail-tab__template-row\" data-testid=\"cn-mail-tab-template-row\">\n\t\t\t\t<NcSelect\n\t\t\t\t\tv-if=\"templatesEnabled\"\n\t\t\t\t\tv-model=\"selectedTemplate\"\n\t\t\t\t\tclass=\"cn-mail-tab__template-select\"\n\t\t\t\t\t:options=\"templates\"\n\t\t\t\t\t:disabled=\"templates.length === 0\"\n\t\t\t\t\t:inputLabel=\"t('nextcloud-vue', 'Email template')\"\n\t\t\t\t\t:label=\"templateLabelField\"\n\t\t\t\t\t:trackBy=\"templateIdField\"\n\t\t\t\t\t:placeholder=\"templatePlaceholder\"\n\t\t\t\t\t:clearable=\"true\" />\n\t\t\t\t<!-- The draft buttons stand together, 8px apart, beside the field. -->\n\t\t\t\t<div class=\"cn-mail-tab__template-actions\">\n\t\t\t\t\t<NcButton\n\t\t\t\t\t\tv-if=\"templatesEnabled\"\n\t\t\t\t\t\t:disabled=\"closed || drafting || !selectedTemplate\"\n\t\t\t\t\t\tdata-testid=\"cn-mail-tab-draft-template\"\n\t\t\t\t\t\t@click=\"draftFromTemplate\">\n\t\t\t\t\t\t<template #icon>\n\t\t\t\t\t\t\t<OpenInNew :size=\"16\" />\n\t\t\t\t\t\t</template>\n\t\t\t\t\t\t{{ t('nextcloud-vue', 'Open draft from template') }}\n\t\t\t\t\t</NcButton>\n\t\t\t\t\t<NcButton\n\t\t\t\t\t\tv-if=\"!showComposeAction || draftSource.blankButton === true\"\n\t\t\t\t\t\t:disabled=\"closed || drafting\"\n\t\t\t\t\t\tdata-testid=\"cn-mail-tab-draft-blank\"\n\t\t\t\t\t\t@click=\"draftBlank\">\n\t\t\t\t\t\t{{ t('nextcloud-vue', 'Empty draft') }}\n\t\t\t\t\t</NcButton>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t\t<div v-if=\"hint\" class=\"cn-mail-tab__hint\">\n\t\t\t\t{{ hint }}\n\t\t\t</div>\n\n\t\t\t<NcNoteCard\n\t\t\t\tv-if=\"error\"\n\t\t\t\ttype=\"error\"\n\t\t\t\t:heading=\"t('nextcloud-vue', 'Could not open draft')\"\n\t\t\t\trole=\"alert\">\n\t\t\t\t{{ error }}\n\t\t\t</NcNoteCard>\n\t\t\t<NcNoteCard\n\t\t\t\tv-if=\"unresolved.length > 0\"\n\t\t\t\ttype=\"warning\"\n\t\t\t\trole=\"status\"\n\t\t\t\tdata-testid=\"cn-mail-tab-unresolved\">\n\t\t\t\t<p>{{ t('nextcloud-vue', 'Some template fields could not be filled. Fill these in the draft yourself:') }}</p>\n\t\t\t\t<ul class=\"cn-mail-tab__unresolved\">\n\t\t\t\t\t<li v-for=\"name in unresolved\" :key=\"name\">\n\t\t\t\t\t\t<code>{{ placeholderOf(name) }}</code>\n\t\t\t\t\t</li>\n\t\t\t\t</ul>\n\t\t\t</NcNoteCard>\n\n\t\t\t<CnEmailTab\n\t\t\t\tv-if=\"linkedMail && objectKey\"\n\t\t\t\tref=\"linkedMail\"\n\t\t\t\tclass=\"cn-mail-tab__linked\"\n\t\t\t\t:showActions=\"!hasHeaderActions\"\n\t\t\t\t:objectId=\"objectKey\"\n\t\t\t\t:register=\"registerKey\"\n\t\t\t\t:schema=\"schemaKey\" />\n\t\t</template>\n\t</div>\n</template>\n\n<script>\nimport { translate as t } from '@nextcloud/l10n'\nimport { NcButton, NcNoteCard, NcSelect } from '@nextcloud/vue'\nimport EmailEditOutline from 'vue-material-design-icons/EmailEditOutline.vue'\nimport EmailOffOutline from 'vue-material-design-icons/EmailOffOutline.vue'\nimport LinkVariant from 'vue-material-design-icons/LinkVariant.vue'\nimport OpenInNew from 'vue-material-design-icons/OpenInNew.vue'\nimport CnEmailTab from '../../integrations/builtin/email/CnEmailTab.vue'\nimport CnEmptyContent from '../CnEmptyContent/CnEmptyContent.vue'\nimport { fetchEndpointSource, interpolateUrlTokens } from '../../composables/useEndpointSource.js'\nimport { evaluateVisibleWhenLocal } from '../../utils/visibleWhen.js'\n\n/** The actions `content.headerActions` can put in the tab's header. */\nconst HEADER_ACTIONS = ['compose', 'link']\n\n/**\n * Read a reference that may be a slug, an id or an object carrying either.\n *\n * @param {string|number|object} value The reference.\n * @return {string} The slug or id, or ''.\n */\nfunction keyOf(value) {\n\tif (value === null || value === undefined) {\n\t\treturn ''\n\t}\n\tif (typeof value === 'object') {\n\t\treturn String(value.slug || value.id || value.uuid || '')\n\t}\n\treturn String(value)\n}\n\n/**\n * CnMailTab — the mail of one record: drafts in Nextcloud Mail, from a\n * template or empty, above the mail linked to the record.\n *\n * Registered as the `mail` widget type. The app owns the endpoints and the\n * texts; the tab never sends mail. A draft is a POST to `draft.url`, whose\n * response may carry `draftUrl` (opened in a new tab) and `unresolved` (the\n * template fields the server could not fill). A 404 there means the app has\n * no Mail to draft into, and the tab says so instead of the controls.\n *\n * ```json\n * {\n * \"type\": \"mail\",\n * \"content\": {\n * \"heading\": \"Email\",\n * \"description\": \"Mail linked to this case\",\n * \"hint\": \"The draft opens in Nextcloud Mail.\",\n * \"templates\": { \"url\": \"/apps/app/api/types/@object.type/templates\", \"responsePath\": \"results\", \"labelField\": \"name\", \"idField\": \"id\" },\n * \"noTemplatesText\": \"No templates for this type yet\",\n * \"draft\": { \"url\": \"/apps/app/api/records/@objectId/templates/{templateId}/draft\", \"blankTemplateId\": \"blank\" },\n * \"closedWhen\": { \"field\": \"endDate\", \"op\": \"notEmpty\" },\n * \"linkedMail\": true,\n * \"headerActions\": [\"link\", \"compose\"]\n * }\n * }\n * ```\n *\n * URLs take the `@objectId` / `@object.<field>` tokens of `endpointSource`;\n * `{templateId}` in the draft URL is the chosen template's id, or\n * `blankTemplateId` for an empty draft. Without `templates` the row offers\n * the empty draft only; without `draft` there is no row. `closedWhen` is a\n * local visibleWhen condition on the record that disables drafting.\n * `linkedMail: false` leaves the linked mail to a separate `email`\n * integration card. `headerActions` puts buttons beside the heading:\n * `compose` opens the empty draft (or Nextcloud Mail's composer when there\n * is no `draft`) and replaces the row's empty-draft button, unless\n * `draft.blankButton` is true (DqZaakEmail draws both); `link` opens the\n * linked mail's picker and needs the linked mail. The linked mail then drops\n * its own buttons. Texts go through the host's translate.\n */\nexport default {\n\tname: 'CnMailTab',\n\n\tcomponents: {\n\t\tCnEmailTab,\n\t\tCnEmptyContent,\n\t\tEmailEditOutline,\n\t\tEmailOffOutline,\n\t\tLinkVariant,\n\t\tNcButton,\n\t\tNcNoteCard,\n\t\tNcSelect,\n\t\tOpenInNew,\n\t},\n\n\tinject: {\n\t\t/** The detail page's object context (`{ objectId, object }`), for tokens. */\n\t\tcnObjectContext: { default: null },\n\t\t/** The host's translate, for the manifest texts. */\n\t\tcnTranslate: { default: () => (key) => key },\n\t},\n\n\tprops: {\n\t\t/**\n\t\t * The widget config: `{ heading?, description?, hint?, templates?,\n\t\t * noTemplatesText?, draft?, closedWhen?, linkedMail?, headerActions? }`, as in the\n\t\t * component description and docs/components/cn-mail-tab.md.\n\t\t *\n\t\t * @type {object}\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's id, for `@objectId` and the linked mail. */\n\t\tobjectId: {\n\t\t\ttype: [String, Number],\n\t\t\tdefault: '',\n\t\t},\n\n\t\t/** The bound record, for `@object.<field>` and `closedWhen`. */\n\t\tobjectData: {\n\t\t\ttype: Object,\n\t\t\tdefault: null,\n\t\t},\n\n\t\t/** The bound record's register, for the linked mail. */\n\t\tregister: {\n\t\t\ttype: [String, Object],\n\t\t\tdefault: '',\n\t\t},\n\n\t\t/** The bound record's schema, for the linked mail. */\n\t\tschema: {\n\t\t\ttype: [String, Object],\n\t\t\tdefault: '',\n\t\t},\n\t},\n\n\temits: ['drafted'],\n\n\tdata() {\n\t\treturn {\n\t\t\ttemplates: [],\n\t\t\tselectedTemplate: null,\n\t\t\tdrafting: false,\n\t\t\terror: '',\n\t\t\tunresolved: [],\n\t\t\tunavailable: false,\n\t\t}\n\t},\n\n\tcomputed: {\n\t\t/** @return {object} The record, from the prop or the page context. */\n\t\trecord() {\n\t\t\tif (this.objectData) {\n\t\t\t\treturn this.objectData\n\t\t\t}\n\t\t\tconst ctx = this.cnObjectContext\n\t\t\tconst value = ctx && typeof ctx === 'object' && 'value' in ctx ? ctx.value : ctx\n\t\t\treturn (value && value.object) || {}\n\t\t},\n\n\t\t/** @return {string} The record id. */\n\t\tobjectKey() {\n\t\t\treturn keyOf(this.objectId) || keyOf(this.record.id) || keyOf(this.record['@self'] && this.record['@self'].id)\n\t\t},\n\n\t\t/** @return {string} The register slug or id, from the prop or else the record's own `@self`. */\n\t\tregisterKey() {\n\t\t\treturn keyOf(this.register) || keyOf(this.record['@self'] && this.record['@self'].register)\n\t\t},\n\n\t\t/** @return {string} The schema slug or id, from the prop or else the record's own `@self`. */\n\t\tschemaKey() {\n\t\t\treturn keyOf(this.schema) || keyOf(this.record['@self'] && this.record['@self'].schema)\n\t\t},\n\n\t\t/** @return {object} The token context for the URLs. */\n\t\ttokenContext() {\n\t\t\treturn { objectId: this.objectKey, object: this.record }\n\t\t},\n\n\t\t/** @return {string} The heading, translated, or ''. */\n\t\theading() {\n\t\t\treturn this.tr(this.content.heading)\n\t\t},\n\n\t\t/** @return {string} The line under the heading, translated, or ''. */\n\t\tdescription() {\n\t\t\treturn this.tr(this.content.description)\n\t\t},\n\n\t\t/** @return {string} The line under the template row, translated, or ''. */\n\t\thint() {\n\t\t\treturn this.tr(this.content.hint)\n\t\t},\n\n\t\t/** @return {object|null} The templates endpoint, or null. */\n\t\ttemplatesSource() {\n\t\t\tconst source = this.content.templates\n\t\t\treturn source && typeof source === 'object' && source.url ? source : null\n\t\t},\n\n\t\t/** @return {object|null} The draft endpoint, or null. */\n\t\tdraftSource() {\n\t\t\tconst source = this.content.draft\n\t\t\treturn source && typeof source === 'object' && source.url ? source : null\n\t\t},\n\n\t\t/** @return {boolean} Whether the template select and its button show. */\n\t\ttemplatesEnabled() {\n\t\t\treturn this.templatesSource !== null\n\t\t},\n\n\t\t/** @return {boolean} Whether the template row shows. */\n\t\tdraftEnabled() {\n\t\t\treturn this.draftSource !== null\n\t\t},\n\n\t\t/** @return {string} The template field shown in the select. */\n\t\ttemplateLabelField() {\n\t\t\treturn (this.templatesSource && this.templatesSource.labelField) || 'name'\n\t\t},\n\n\t\t/** @return {string} The template field that identifies it. */\n\t\ttemplateIdField() {\n\t\t\treturn (this.templatesSource && this.templatesSource.idField) || 'id'\n\t\t},\n\n\t\t/** @return {string} The select's placeholder. */\n\t\ttemplatePlaceholder() {\n\t\t\tif (this.templates.length === 0) {\n\t\t\t\treturn this.tr(this.content.noTemplatesText) || t('nextcloud-vue', 'No templates yet')\n\t\t\t}\n\t\t\treturn t('nextcloud-vue', 'Select a template (optional)…')\n\t\t},\n\n\t\t/** @return {boolean} Whether `closedWhen` holds for the record. */\n\t\tclosed() {\n\t\t\tconst cond = this.content.closedWhen\n\t\t\tif (!cond) {\n\t\t\t\treturn false\n\t\t\t}\n\t\t\treturn evaluateVisibleWhenLocal(cond, this.record)\n\t\t},\n\n\t\t/** @return {string} The templates URL after tokens, to refetch on change. */\n\t\ttemplatesUrl() {\n\t\t\treturn this.templatesSource ? interpolateUrlTokens(this.templatesSource.url, this.tokenContext) : ''\n\t\t},\n\n\t\t/** @return {boolean} Whether the linked mail list shows. */\n\t\tlinkedMail() {\n\t\t\treturn this.content.linkedMail !== false\n\t\t},\n\n\t\t/**\n\t\t * The known header actions the config asks for.\n\t\t *\n\t\t * @return {string[]} `compose` and or `link`.\n\t\t * @spec openspec/changes/mail-tab-compose-and-link/specs/mail-tab-compose-and-link/spec.md#requirement-the-mail-tab-can-carry-compose-mail-and-link-mail-in-its-header\n\t\t */\n\t\theaderActions() {\n\t\t\tconst list = Array.isArray(this.content.headerActions) ? this.content.headerActions : []\n\t\t\treturn list.filter((key) => HEADER_ACTIONS.includes(key))\n\t\t},\n\n\t\t/** @return {boolean} Whether the header shows \"Compose mail\". */\n\t\tshowComposeAction() {\n\t\t\treturn this.headerActions.includes('compose')\n\t\t},\n\n\t\t/** @return {boolean} Whether the header shows \"Link mail\": it opens the linked mail's picker. */\n\t\tshowLinkAction() {\n\t\t\treturn this.headerActions.includes('link') && this.linkedMail && this.objectKey !== ''\n\t\t},\n\n\t\t/** @return {boolean} Whether the header holds any button. */\n\t\thasHeaderActions() {\n\t\t\treturn this.showComposeAction || this.showLinkAction\n\t\t},\n\n\t\t/** @return {string} Nextcloud Mail's composer, for an app without a draft endpoint. */\n\t\tcomposeUrl() {\n\t\t\treturn (typeof OC !== 'undefined' && typeof OC.generateUrl === 'function')\n\t\t\t\t? OC.generateUrl('/apps/mail/box/draft')\n\t\t\t\t: '/index.php/apps/mail/box/draft'\n\t\t},\n\t},\n\n\twatch: {\n\t\ttemplatesUrl: {\n\t\t\timmediate: true,\n\t\t\thandler() {\n\t\t\t\tthis.loadTemplates()\n\t\t\t},\n\t\t},\n\t},\n\n\tmethods: {\n\t\tt,\n\n\t\t/**\n\t\t * Translate a manifest text through the host.\n\t\t *\n\t\t * @param {string} text The text.\n\t\t * @return {string} The translation, or '' for no text.\n\t\t */\n\t\ttr(text) {\n\t\t\tif (typeof text !== 'string' || text === '') {\n\t\t\t\treturn ''\n\t\t\t}\n\t\t\treturn this.cnTranslate(text)\n\t\t},\n\n\t\t/**\n\t\t * Read the templates. A failed read leaves the empty draft usable.\n\t\t *\n\t\t * @return {Promise<void>}\n\t\t */\n\t\tasync loadTemplates() {\n\t\t\tif (!this.templatesSource) {\n\t\t\t\tthis.templates = []\n\t\t\t\treturn\n\t\t\t}\n\t\t\ttry {\n\t\t\t\tconst payload = await fetchEndpointSource(this.templatesSource, this.tokenContext)\n\t\t\t\tconst list = Array.isArray(payload) ? payload : (payload && Array.isArray(payload.results) ? payload.results : [])\n\t\t\t\tthis.templates = list\n\t\t\t} catch (err) {\n\t\t\t\t// eslint-disable-next-line no-console\n\t\t\t\tconsole.warn('[CnMailTab] could not read the templates', err)\n\t\t\t\tthis.templates = []\n\t\t\t}\n\t\t},\n\n\t\t/** @return {Promise<void>} */\n\t\tdraftFromTemplate() {\n\t\t\treturn this.openDraft(this.selectedTemplate)\n\t\t},\n\n\t\t/**\n\t\t * \"Compose mail\": the empty draft through the app's endpoint. Without\n\t\t * one the button is a link to Mail's composer and needs no handler.\n\t\t *\n\t\t * @return {Promise<void>|undefined}\n\t\t */\n\t\tonCompose() {\n\t\t\treturn this.draftEnabled ? this.draftBlank() : undefined\n\t\t},\n\n\t\t/**\n\t\t * \"Link mail\": the linked mail's picker, which links the chosen\n\t\t * message to the record through its own endpoint.\n\t\t *\n\t\t * @return {void}\n\t\t */\n\t\topenLinkPicker() {\n\t\t\tconst linked = this.$refs.linkedMail\n\t\t\tif (linked && typeof linked.openPicker === 'function') {\n\t\t\t\tlinked.openPicker()\n\t\t\t}\n\t\t},\n\n\t\t/** @return {Promise<void>} */\n\t\tdraftBlank() {\n\t\t\tthis.selectedTemplate = null\n\t\t\treturn this.openDraft(null)\n\t\t},\n\n\t\t/**\n\t\t * Ask the app to create a Nextcloud Mail draft and open it.\n\t\t *\n\t\t * @param {object|null} template The chosen template, or null for an empty draft.\n\t\t * @return {Promise<void>}\n\t\t */\n\t\tasync openDraft(template) {\n\t\t\tif (this.closed || !this.draftSource) {\n\t\t\t\treturn\n\t\t\t}\n\t\t\tthis.drafting = true\n\t\t\tthis.error = ''\n\t\t\tthis.unresolved = []\n\t\t\ttry {\n\t\t\t\tconst id = template ? template[this.templateIdField] : (this.draftSource.blankTemplateId || 'blank')\n\t\t\t\tconst path = interpolateUrlTokens(this.draftSource.url, this.tokenContext)\n\t\t\t\t\t.replace('{templateId}', encodeURIComponent(String(id)))\n\t\t\t\tconst [{ default: axios }, { generateUrl }] = await Promise.all([\n\t\t\t\t\timport('@nextcloud/axios'),\n\t\t\t\t\timport('@nextcloud/router'),\n\t\t\t\t])\n\t\t\t\tconst { data } = await axios.post(generateUrl(path), {})\n\t\t\t\tthis.unresolved = Array.isArray(data && data.unresolved) ? data.unresolved : []\n\t\t\t\tif (data && data.draftUrl) {\n\t\t\t\t\twindow.open(data.draftUrl, '_blank', 'noopener')\n\t\t\t\t}\n\t\t\t\t/**\n\t\t\t\t * @event drafted A draft was made from a template. Carries the\n\t\t\t\t * draft endpoint's response, including `draftUrl` and\n\t\t\t\t * `unresolved` when the endpoint returns them.\n\t\t\t\t * @type {object}\n\t\t\t\t */\n\t\t\t\tthis.$emit('drafted', data)\n\t\t\t} catch (err) {\n\t\t\t\tconst response = err && err.response\n\t\t\t\tif (response && response.status === 404) {\n\t\t\t\t\tthis.unavailable = true\n\t\t\t\t}\n\t\t\t\tthis.error = (response && response.data && response.data.message)\n\t\t\t\t\t|| (err && err.message)\n\t\t\t\t\t|| t('nextcloud-vue', 'The draft could not be opened.')\n\t\t\t} finally {\n\t\t\t\tthis.drafting = false\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * Write a template field the way the template spells it.\n\t\t *\n\t\t * @param {string} name The field name.\n\t\t * @return {string} `{{name}}`.\n\t\t */\n\t\tplaceholderOf(name) {\n\t\t\treturn `{{${name}}}`\n\t\t},\n\t},\n}\n</script>\n\n<style scoped>\n.cn-mail-tab {\n\tdisplay: flex;\n\tflex-direction: column;\n\tgap: 16px;\n\tpadding: 12px;\n}\n\n.cn-mail-tab__header {\n\tdisplay: flex;\n\tflex-wrap: wrap;\n\talign-items: flex-start;\n\tjustify-content: space-between;\n\tgap: 10px 16px;\n}\n\n.cn-mail-tab__heading {\n\tdisplay: flex;\n\tflex: 1 1 260px;\n\tflex-direction: column;\n\tgap: 3px;\n\tmin-width: 0;\n}\n\n.cn-mail-tab__header-actions {\n\tdisplay: flex;\n\tflex: none;\n\tflex-wrap: wrap;\n\tgap: 8px;\n}\n\n.cn-mail-tab__title {\n\tmargin: 0;\n\tfont-size: 16px;\n\tfont-weight: bold;\n}\n\n.cn-mail-tab__subtitle,\n.cn-mail-tab__hint {\n\tmargin: 0;\n\tcolor: var(--color-text-maxcontrast);\n}\n\n.cn-mail-tab__template-row {\n\tdisplay: flex;\n\tflex-wrap: wrap;\n\talign-items: flex-end;\n\tgap: 8px;\n}\n\n.cn-mail-tab__template-actions {\n\tdisplay: flex;\n\tflex-wrap: wrap;\n\tgap: 8px;\n}\n\n.cn-mail-tab__template-select {\n\tflex: 1 1 260px;\n}\n\n.cn-mail-tab__unresolved {\n\tmargin: 4px 0 0;\n\tpadding-inline-start: 20px;\n}\n\n.cn-mail-tab__unresolved code {\n\tbackground: var(--color-background-dark);\n\tpadding: 2px 6px;\n\tborder-radius: var(--border-radius);\n\tfont-family: var(--font-face-mono, monospace);\n}\n</style>\n"],"names":["_openBlock","_createElementBlock","_createBlock","_createVNode","_toDisplayString","_createTextVNode","_createElementVNode","_Fragment","_renderList"],"mappings":";;;AASM,EAAA,KAAK,EAAC,aAAa;AAAC,EAAA,aAAW,EAAC,aAAa;;;;AAW1C,EAAA,KAAA,EAAA,qBAAA;AAAA,EAAA,aAAA,EAAA,oBAAA;;AACD,MAAA,UAAA,GAAA,EAAA,KAAM,EAAE,sBAAsB,GAAA;;;AACb,EAAA,KAAI,EAAC,oBAAoB;;;;AAKrB,EAAA,KA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OAAO,EAAC,QAAA,CAAA,CAAA,CAAA,eAAA,EAAA,sBAAA,CAAA;AACT,gBAAA,IAAI,EAAC,OAAO;;iCACZ,MAAW;kDAAR,KAAK,CAAA,KAAA,CAAA,EAAA,CAAA,YAAA;;;;;AAGF,UAAA,CAAA,KAAA,CAAA,UAAU,CAAC,MAAM,GAAA,CAAA;4BADvBF,WAWY,CAAA,qBAAA,EAAA;;AATZ,gBAAA,IAAI,EAAC,SAAS;AACb,gBAAA,IAAI,EAAA,QAAQ;AACX,gBAAA,aAAS,EAAC,wBAAwB;;uCAC/B;qCAAA,2BAAA,QAAA,CAAA,CAAA,CAAA,eAAA,EAAA,6EAAA,CAAA,CAAA,EAAA,CAAA,YAAA;AACL,kBAAAI,kBAAA,CAIK,MAJL,WAIK,EAAA;sCAHJL,kBAEK,CAAAM,QAAA,EAAA,IAAA,EAAAC,UAAA,CAFK,KAAA,CAAA,UAAA,EAAA,CAAA,IAAA,KAAA;2CAAVP,kBAEK,CAAA,IAAA,EAAA,EAFK,GAAA,EAAA,IAAA,EAAA,EAAA;;;;;;;;;AAOL,UAAA,CAAA,QAAA,CAAA,UAAU,IAAI,QAAA,CAAA,SAAA;4BADpBC;;AAEA,gBAAA,GAAG,EAAC,YAAY;AAChB,gBAAA,KAAK,EAAC,qBAAe;AACpB,gBAAA,WAAO,GAAA,QAAA,CAAA,gBAAA;AACP,gBAAA,QAAC,EAAA,QAAA,CAAA,SAAA;;;;;;;;;;;"}
@@ -2,7 +2,7 @@ import script from './CnNotificationMatrix.vue2.js';
2
2
  import { render } from './CnNotificationMatrix.vue3.js';
3
3
 
4
4
  script.render = render;
5
- script.__scopeId = "data-v-a251060e";
5
+ script.__scopeId = "data-v-4d92dc65";
6
6
  const __sfc_main = script;
7
7
 
8
8
  export { __sfc_main as default };
@@ -1,4 +1,5 @@
1
1
  import { translate } from '@nextcloud/l10n';
2
+ import ChevronRight from 'vue-material-design-icons/ChevronRight.vue';
2
3
  import { normalizeLook } from '../../composables/useLook.js';
3
4
  import { channelAvailability, resolvePreference, PREFERENCE_LEVELS } from '../../utils/notificationPreference.js';
4
5
  import { GLOBAL_SCOPE, valueForScope, scopeRowsFor } from '../../utils/preferenceScopes.js';
@@ -77,6 +78,8 @@ function appDefaultFor(event, channel) {
77
78
  var script = {
78
79
  name: 'CnNotificationMatrix',
79
80
 
81
+ components: { ChevronRight },
82
+
80
83
  inject: {
81
84
  /** The look CnAppRoot (or the page) draws in. */
82
85
  cnLook: { default: 'nextcloud' },