@conduction/nextcloud-vue 2.164.0 → 2.165.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 (43) hide show
  1. package/dist/esm/components/CnLinkCardsPage/CnLinkCardsPage.vue.js +1 -1
  2. package/dist/esm/components/CnLinkCardsPage/CnLinkCardsPage.vue2.js.map +1 -1
  3. package/dist/esm/components/CnLinkCardsPage/CnLinkCardsPage.vue3.js.map +1 -1
  4. package/dist/esm/components/CnMailTab/CnMailTab.vue.js +1 -1
  5. package/dist/esm/components/CnMailTab/CnMailTab.vue2.js +43 -2
  6. package/dist/esm/components/CnMailTab/CnMailTab.vue2.js.map +1 -1
  7. package/dist/esm/components/CnMailTab/CnMailTab.vue3.js.map +1 -1
  8. package/dist/esm/components/CnModuleCard/CnModuleCard.vue.js +1 -1
  9. package/dist/esm/components/CnModuleCard/CnModuleCard.vue2.js.map +1 -1
  10. package/dist/esm/components/CnModuleCard/CnModuleCard.vue3.js.map +1 -1
  11. package/dist/esm/components/CnObjectDataWidget/CnObjectDataWidget.vue.js +1 -1
  12. package/dist/esm/components/CnObjectDataWidget/CnObjectDataWidget.vue2.js +7 -1
  13. package/dist/esm/components/CnObjectDataWidget/CnObjectDataWidget.vue2.js.map +1 -1
  14. package/dist/esm/components/CnObjectDataWidget/CnObjectDataWidget.vue3.js.map +1 -1
  15. package/dist/esm/components/CnStatWidget/CnStatWidget.vue.js +1 -1
  16. package/dist/esm/components/CnStatWidget/CnStatWidget.vue2.js +49 -1
  17. package/dist/esm/components/CnStatWidget/CnStatWidget.vue2.js.map +1 -1
  18. package/dist/esm/components/CnStatWidget/CnStatWidget.vue3.js.map +1 -1
  19. package/dist/esm/components/CnWeekStripWidget/CnWeekStripWidget.vue.js +1 -1
  20. package/dist/esm/components/CnWeekStripWidget/CnWeekStripWidget.vue2.js +48 -8
  21. package/dist/esm/components/CnWeekStripWidget/CnWeekStripWidget.vue2.js.map +1 -1
  22. package/dist/esm/components/CnWeekStripWidget/CnWeekStripWidget.vue3.js +33 -31
  23. package/dist/esm/components/CnWeekStripWidget/CnWeekStripWidget.vue3.js.map +1 -1
  24. package/dist/esm/library-style.js +1 -1
  25. package/dist/esm/nextcloud-vue.css +203 -178
  26. package/dist/esm/utils/filterRangeLabel.js +5 -3
  27. package/dist/esm/utils/filterRangeLabel.js.map +1 -1
  28. package/dist/esm/utils/validateManifestV2.compiled.js +3 -3
  29. package/dist/esm/utils/validateManifestV2.compiled.js.map +1 -1
  30. package/dist/nextcloud-vue.cjs.js +303 -165
  31. package/dist/nextcloud-vue.cjs.js.map +2 -2
  32. package/dist/nextcloud-vue.css +203 -178
  33. package/package.json +1 -1
  34. package/src/components/CnLinkCardsPage/CnLinkCardsPage.vue +4 -0
  35. package/src/components/CnMailTab/CnMailTab.vue +43 -2
  36. package/src/components/CnModuleCard/CnModuleCard.vue +4 -0
  37. package/src/components/CnObjectDataWidget/CnObjectDataWidget.vue +7 -1
  38. package/src/components/CnStatWidget/CnStatWidget.vue +49 -1
  39. package/src/components/CnWeekStripWidget/CnWeekStripWidget.vue +60 -9
  40. package/src/css/look-board-detail.css +12 -5
  41. package/src/schemas/app-manifest-v2.schema.json +5 -3
  42. package/src/utils/filterRangeLabel.js +5 -3
  43. package/src/utils/validateManifestV2.compiled.js +3 -3
@@ -1 +1 @@
1
- {"version":3,"file":"CnLinkCardsPage.vue3.js","sources":["../../../../src/components/CnLinkCardsPage/CnLinkCardsPage.vue?vue&type=template&id=57ef0479&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-link-cards-page\" :class=\"{ 'cn-link-cards-page--board': isBoardLook }\" data-testid=\"cn-link-cards-page\">\n\t\t<!-- The board look draws the page's own header: the title as the page's\n\t\t h1 with the buildiq square on its row, the line under it (PqModules,\n\t\t PqReports). The plain look draws the same h1 without the row, above\n\t\t the categories' h2. -->\n\t\t<div class=\"cn-link-cards-page__header\">\n\t\t\t<div v-if=\"isBoardLook\" class=\"cn-link-cards-page__title-row\">\n\t\t\t\t<h1 v-if=\"resolvedTitle\" class=\"cn-link-cards-page__title\">\n\t\t\t\t\t{{ resolvedTitle }}\n\t\t\t\t</h1>\n\t\t\t\t<div class=\"cn-link-cards-page__header-actions\">\n\t\t\t\t\t<CnBuildiqEditButton />\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t\t<h1 v-else-if=\"resolvedTitle\" class=\"cn-link-cards-page__title\">\n\t\t\t\t{{ resolvedTitle }}\n\t\t\t</h1>\n\t\t\t<p v-if=\"resolvedDescription\" class=\"cn-link-cards-page__description\">\n\t\t\t\t{{ resolvedDescription }}\n\t\t\t</p>\n\t\t</div>\n\n\t\t<section\n\t\t\tv-if=\"visibleModules.length > 0\"\n\t\t\tclass=\"cn-link-cards-page__modules\"\n\t\t\t:aria-labelledby=\"`cn-link-cards-modules-${uid}`\"\n\t\t\tdata-testid=\"cn-link-cards-modules\">\n\t\t\t<div class=\"cn-link-cards-page__modules-head\">\n\t\t\t\t<h3 :id=\"`cn-link-cards-modules-${uid}`\" class=\"cn-link-cards-page__modules-title\">\n\t\t\t\t\t{{ resolvedModulesTitle }}\n\t\t\t\t</h3>\n\t\t\t\t<span class=\"cn-link-cards-page__modules-count\" data-testid=\"cn-link-cards-modules-count\">\n\t\t\t\t\t{{ modulesCount }}\n\t\t\t\t</span>\n\t\t\t</div>\n\t\t\t<div class=\"cn-link-cards-page__modules-grid\">\n\t\t\t\t<CnModuleCard\n\t\t\t\t\tv-for=\"module in visibleModules\"\n\t\t\t\t\t:key=\"module.id\"\n\t\t\t\t\t:module=\"module\"\n\t\t\t\t\t:headingId=\"`cn-link-cards-module-${uid}-${module.key}`\" />\n\t\t\t</div>\n\t\t\t<p v-if=\"resolvedFootnote\" class=\"cn-link-cards-page__modules-note\" data-testid=\"cn-link-cards-modules-note\">\n\t\t\t\t<InformationOutline :size=\"18\" class=\"cn-link-cards-page__modules-note-icon\" />\n\t\t\t\t<span>{{ resolvedFootnote }}</span>\n\t\t\t</p>\n\t\t</section>\n\n\t\t<p\n\t\t\tv-if=\"groups.length === 0 && visibleModules.length === 0\"\n\t\t\tclass=\"cn-link-cards-page__empty\"\n\t\t\tdata-testid=\"cn-link-cards-empty\">\n\t\t\t{{ resolvedEmptyLabel }}\n\t\t</p>\n\n\t\t<section\n\t\t\tv-for=\"group in groups\"\n\t\t\t:key=\"group.key\"\n\t\t\tclass=\"cn-link-cards-page__group\"\n\t\t\t:class=\"{ 'cn-link-cards-page__group--list': isListStyle }\"\n\t\t\t:aria-labelledby=\"group.label ? group.headingId : null\"\n\t\t\t:aria-label=\"group.label ? null : resolvedTitle || null\"\n\t\t\tdata-testid=\"cn-link-cards-group\"\n\t\t\t:data-group=\"group.key\">\n\t\t\t<h2\n\t\t\t\tv-if=\"group.label\"\n\t\t\t\t:id=\"group.headingId\"\n\t\t\t\tclass=\"cn-link-cards-page__caption\">\n\t\t\t\t{{ group.label }}\n\t\t\t</h2>\n\t\t\t<!-- groupStyle \"list\": the group is one card of rows, each an icon\n\t\t\t chip, the label over its description, and a trailing chevron\n\t\t\t (an external-link icon for a URL). -->\n\t\t\t<ul v-if=\"isListStyle\" class=\"cn-link-cards-page__list\">\n\t\t\t\t<li v-for=\"card in group.cards\" :key=\"card.id\">\n\t\t\t\t\t<a\n\t\t\t\t\t\tclass=\"cn-link-cards-page__row\"\n\t\t\t\t\t\tdata-testid=\"cn-link-card\"\n\t\t\t\t\t\t:data-card-id=\"card.id\"\n\t\t\t\t\t\t:href=\"card.url\"\n\t\t\t\t\t\t:target=\"card.external ? '_blank' : null\"\n\t\t\t\t\t\t:rel=\"card.external ? 'noopener noreferrer' : null\"\n\t\t\t\t\t\t:role=\"card.action ? 'button' : null\"\n\t\t\t\t\t\t:aria-describedby=\"card.description ? card.descriptionId : null\"\n\t\t\t\t\t\t@click=\"open(card, $event)\"\n\t\t\t\t\t\t@keydown.space=\"open(card, $event)\">\n\t\t\t\t\t\t<span v-if=\"card.icon\" class=\"cn-link-cards-page__row-icon\" aria-hidden=\"true\">\n\t\t\t\t\t\t\t<CnIcon :name=\"card.icon\" :size=\"20\" />\n\t\t\t\t\t\t</span>\n\t\t\t\t\t\t<span class=\"cn-link-cards-page__row-body\">\n\t\t\t\t\t\t\t<span class=\"cn-link-cards-page__row-label\">{{ card.label }}</span>\n\t\t\t\t\t\t\t<span\n\t\t\t\t\t\t\t\tv-if=\"card.description\"\n\t\t\t\t\t\t\t\t:id=\"card.descriptionId\"\n\t\t\t\t\t\t\t\tclass=\"cn-link-cards-page__row-description\">\n\t\t\t\t\t\t\t\t{{ card.description }}\n\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t</span>\n\t\t\t\t\t\t<OpenInNew v-if=\"trailingOf(card) === 'external'\" :size=\"18\" class=\"cn-link-cards-page__row-trailing\" />\n\t\t\t\t\t\t<ChevronRight v-else :size=\"20\" class=\"cn-link-cards-page__row-trailing\" />\n\t\t\t\t\t</a>\n\t\t\t\t</li>\n\t\t\t</ul>\n\t\t\t<ul v-else class=\"cn-link-cards-page__grid\">\n\t\t\t\t<li v-for=\"card in group.cards\" :key=\"card.id\" class=\"cn-link-cards-page__cell\">\n\t\t\t\t\t<!-- A real <a href>, so the card can be middle-clicked, copied\n\t\t\t\t\t and announced as a link. A plain click on an in-app card\n\t\t\t\t\t is routed, which keeps the page from reloading. -->\n\t\t\t\t\t<a\n\t\t\t\t\t\tclass=\"cn-link-cards-page__card\"\n\t\t\t\t\t\tdata-testid=\"cn-link-card\"\n\t\t\t\t\t\t:data-card-id=\"card.id\"\n\t\t\t\t\t\t:href=\"card.url\"\n\t\t\t\t\t\t:target=\"card.external ? '_blank' : null\"\n\t\t\t\t\t\t:rel=\"card.external ? 'noopener noreferrer' : null\"\n\t\t\t\t\t\t:role=\"card.action ? 'button' : null\"\n\t\t\t\t\t\t:aria-describedby=\"card.description ? card.descriptionId : null\"\n\t\t\t\t\t\t@click=\"open(card, $event)\"\n\t\t\t\t\t\t@keydown.space=\"open(card, $event)\">\n\t\t\t\t\t\t<CnIcon\n\t\t\t\t\t\t\tv-if=\"card.icon\"\n\t\t\t\t\t\t\t:name=\"card.icon\"\n\t\t\t\t\t\t\t:size=\"24\"\n\t\t\t\t\t\t\tclass=\"cn-link-cards-page__icon\"\n\t\t\t\t\t\t\taria-hidden=\"true\" />\n\t\t\t\t\t\t<span class=\"cn-link-cards-page__body\">\n\t\t\t\t\t\t\t<span class=\"cn-link-cards-page__label\">{{ card.label }}</span>\n\t\t\t\t\t\t\t<span\n\t\t\t\t\t\t\t\tv-if=\"card.description\"\n\t\t\t\t\t\t\t\t:id=\"card.descriptionId\"\n\t\t\t\t\t\t\t\tclass=\"cn-link-cards-page__card-description\">\n\t\t\t\t\t\t\t\t{{ card.description }}\n\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t<span\n\t\t\t\t\t\t\t\tv-if=\"statusOf(card)\"\n\t\t\t\t\t\t\t\tclass=\"cn-link-cards-page__status\"\n\t\t\t\t\t\t\t\t:class=\"`cn-link-cards-page__status--${statusVariant(card).tone}`\"\n\t\t\t\t\t\t\t\tdata-testid=\"cn-link-card-status\">\n\t\t\t\t\t\t\t\t{{ statusOf(card) }}\n\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t</span>\n\t\t\t\t\t\t<OpenInNew\n\t\t\t\t\t\t\tv-if=\"trailingOf(card) === 'external'\"\n\t\t\t\t\t\t\t:size=\"18\"\n\t\t\t\t\t\t\tclass=\"cn-link-cards-page__trailing\" />\n\t\t\t\t\t\t<ChevronRight v-else :size=\"20\" class=\"cn-link-cards-page__trailing\" />\n\t\t\t\t\t</a>\n\t\t\t\t</li>\n\t\t\t</ul>\n\t\t</section>\n\t\t<!-- `panel`: a closing card beside the groups, such as the menu\n\t\t structure an administrator set: a badge, a paragraph with a link,\n\t\t and a titled list of facts. -->\n\t\t<section\n\t\t\tv-if=\"resolvedPanel\"\n\t\t\tclass=\"cn-link-cards-page__panel\"\n\t\t\t:aria-label=\"resolvedPanel.label || null\"\n\t\t\tdata-testid=\"cn-link-cards-panel\">\n\t\t\t<div class=\"cn-link-cards-page__panel-lead\">\n\t\t\t\t<span\n\t\t\t\t\tv-if=\"resolvedPanel.badge\"\n\t\t\t\t\tclass=\"cn-link-cards-page__panel-badge\"\n\t\t\t\t\t:class=\"`cn-link-cards-page__panel-badge--${resolvedPanel.badgeTone}`\"\n\t\t\t\t\tdata-testid=\"cn-link-cards-panel-badge\">\n\t\t\t\t\t<CnIcon\n\t\t\t\t\t\tv-if=\"resolvedPanel.badgeIcon\"\n\t\t\t\t\t\t:name=\"resolvedPanel.badgeIcon\"\n\t\t\t\t\t\t:size=\"14\"\n\t\t\t\t\t\taria-hidden=\"true\" />\n\t\t\t\t\t{{ resolvedPanel.badge }}\n\t\t\t\t</span>\n\t\t\t\t<p v-if=\"resolvedPanel.text\" class=\"cn-link-cards-page__panel-text\">\n\t\t\t\t\t{{ resolvedPanel.text }}\n\t\t\t\t</p>\n\t\t\t\t<a\n\t\t\t\t\tv-if=\"resolvedPanel.link\"\n\t\t\t\t\tclass=\"cn-link-cards-page__panel-link\"\n\t\t\t\t\tdata-testid=\"cn-link-cards-panel-link\"\n\t\t\t\t\t:href=\"resolvedPanel.link.url\"\n\t\t\t\t\t:target=\"resolvedPanel.link.external ? '_blank' : null\"\n\t\t\t\t\t:rel=\"resolvedPanel.link.external ? 'noopener noreferrer' : null\"\n\t\t\t\t\t@click=\"open(resolvedPanel.link, $event)\">\n\t\t\t\t\t{{ resolvedPanel.link.label }}\n\t\t\t\t</a>\n\t\t\t</div>\n\t\t\t<div v-if=\"resolvedPanel.title || resolvedPanel.facts.length > 0\" class=\"cn-link-cards-page__panel-facts\">\n\t\t\t\t<h2 v-if=\"resolvedPanel.title\" class=\"cn-link-cards-page__panel-title\">\n\t\t\t\t\t{{ resolvedPanel.title }}\n\t\t\t\t</h2>\n\t\t\t\t<span v-if=\"resolvedPanel.subtitle\" class=\"cn-link-cards-page__panel-subtitle\">\n\t\t\t\t\t{{ resolvedPanel.subtitle }}\n\t\t\t\t</span>\n\t\t\t\t<dl v-if=\"resolvedPanel.facts.length > 0\" class=\"cn-link-cards-page__panel-list\">\n\t\t\t\t\t<template v-for=\"fact in resolvedPanel.facts\" :key=\"fact.key\">\n\t\t\t\t\t\t<dt>{{ fact.label }}</dt>\n\t\t\t\t\t\t<dd data-testid=\"cn-link-cards-panel-fact\">\n\t\t\t\t\t\t\t{{ fact.value }}\n\t\t\t\t\t\t\t<span v-if=\"fact.note\" class=\"cn-link-cards-page__panel-note\">{{ fact.note }}</span>\n\t\t\t\t\t\t</dd>\n\t\t\t\t\t</template>\n\t\t\t\t</dl>\n\t\t\t</div>\n\t\t</section>\n\t</div>\n</template>\n\n<script>\nimport { translatePlural as n, translate as t } from '@nextcloud/l10n'\nimport ChevronRight from 'vue-material-design-icons/ChevronRight.vue'\nimport InformationOutline from 'vue-material-design-icons/InformationOutline.vue'\nimport OpenInNew from 'vue-material-design-icons/OpenInNew.vue'\nimport CnBuildiqEditButton from '../CnBuildiqEditButton/CnBuildiqEditButton.vue'\nimport CnModuleCard from '../CnModuleCard/CnModuleCard.vue'\nimport { normalizeLook } from '../../composables/useLook.js'\nimport { isAppInstalled } from '../../utils/appInstalled.js'\nimport { fetchAggregateValue } from '../../utils/fetchAggregate.js'\nimport { followLinkClick, resolveHref } from '../../utils/linkNavigation.js'\nimport { passesContextPredicates } from '../../utils/visibleIfContext.js'\nimport { CnIcon } from '../CnIcon/index.js'\n\nlet linkCardsPageUid = 0\n\nconst STATUS_TONES = ['neutral', 'error', 'warning', 'success']\n\nconst BADGE_TONES = ['primary', 'purple']\n\n/**\n * The tone of a card's status pill: `status.tone` when it is one of the known\n * tones, else neutral.\n *\n * @param {unknown} status The declared status.\n * @return {string} The tone.\n */\nfunction statusToneOf(status) {\n\tconst tone = status && typeof status === 'object' ? status.tone : null\n\treturn STATUS_TONES.includes(tone) ? tone : 'neutral'\n}\n\n/**\n * Read a dotted path from an object.\n *\n * @param {unknown} root The object.\n * @param {string} path The path.\n * @return {unknown} The value, or undefined.\n */\nfunction readPath(root, path) {\n\treturn String(path).split('.').reduce((node, key) => (node && typeof node === 'object' && Object.hasOwn(node, key) ? node[key] : undefined), root)\n}\n\n/**\n * Fill `{runtime.<path>}` tokens from the manifest's runtime. A token with\n * no value becomes ''.\n *\n * @param {string} text The text.\n * @param {object|null} runtime The runtime.\n * @return {string} The filled text.\n */\nfunction fillRuntime(text, runtime) {\n\tif (typeof text !== 'string' || !text.includes('{runtime.')) {\n\t\treturn text\n\t}\n\treturn text.replace(/\\{runtime\\.([A-Za-z0-9_.]+)\\}/g, (match, path) => {\n\t\tconst value = readPath(runtime, path)\n\t\treturn value === undefined || value === null ? '' : String(value)\n\t})\n}\n\n/**\n * One number for a card's status line.\n *\n * @param {object} source An aggregate descriptor or `{ url, path?, params?, where?, sumOf? }`; `where` keeps only the list items whose fields equal its values, `sumOf` adds up a field of each (an array field by its length) instead of counting them.\n * @return {Promise<number|null>} The number, or null.\n */\nasync function fetchStatusValue(source) {\n\tif (!source || typeof source !== 'object') {\n\t\treturn null\n\t}\n\tif (typeof source.url === 'string' && source.url !== '') {\n\t\tconst [{ default: axios }, { generateUrl }] = await Promise.all([\n\t\t\timport('@nextcloud/axios'),\n\t\t\timport('@nextcloud/router'),\n\t\t])\n\t\tconst url = source.url.startsWith('/apps/') ? generateUrl(source.url) : source.url\n\t\tconst { data } = await axios.get(url, { params: source.params || {} })\n\t\tconst picked = readPath(data, source.path || 'total')\n\t\tconst list = Array.isArray(picked) ? picked : (picked === undefined && Array.isArray(data) ? data : null)\n\t\tif (list !== null) {\n\t\t\tconst where = source.where && typeof source.where === 'object' ? Object.entries(source.where) : []\n\t\t\tconst matching = list.filter((item) => where.every(([key, wanted]) => readPath(item, key) === wanted))\n\t\t\tif (typeof source.sumOf === 'string' && source.sumOf !== '') {\n\t\t\t\treturn matching.reduce((sum, item) => {\n\t\t\t\t\tconst value = readPath(item, source.sumOf)\n\t\t\t\t\treturn sum + (Array.isArray(value) ? value.length : (typeof value === 'number' ? value : 0))\n\t\t\t\t}, 0)\n\t\t\t}\n\t\t\treturn matching.length\n\t\t}\n\t\treturn typeof picked === 'number' ? picked : null\n\t}\n\treturn fetchAggregateValue(source)\n}\n\n/**\n * CnLinkCardsPage: the `type: \"links\"` page. Link cards, grouped under captions.\n *\n * One page that opens every page a short menu leaves out. A card has a\n * label, a one-line description, an optional icon and a target. Groups come\n * from `categories`, in the order they are declared; a card names its group\n * with `category`.\n *\n * ```json\n * { \"id\": \"Modules\", \"route\": \"/modules\", \"type\": \"links\", \"title\": \"Modules and more\",\n * \"config\": {\n * \"description\": \"Every page that is not in the daily menu.\",\n * \"categories\": { \"sales\": \"Sales\", \"marketing\": \"Marketing\" },\n * \"cards\": [\n * { \"id\": \"Leads\", \"label\": \"Leads\", \"description\": \"Every deal you are working on.\",\n * \"icon\": \"CashMultiple\", \"category\": \"sales\", \"route\": \"Leads\" }\n * ]\n * } }\n * ```\n *\n * Every string goes through the app's translate function. A card is hidden\n * by the same `visibleIf` and `permission` a menu entry takes, and a group\n * with no visible card is not drawn.\n */\nexport default {\n\tname: 'CnLinkCardsPage',\n\n\tcomponents: { ChevronRight, CnBuildiqEditButton, CnIcon, CnModuleCard, InformationOutline, OpenInNew },\n\n\tinject: {\n\t\t/** The app's translate function, provided by CnAppRoot. Identity outside one. */\n\t\tcnTranslate: { default: () => (key) => key },\n\t\t/** The effective manifest, for `visibleIf` predicates against `runtime`. */\n\t\tcnManifest: { default: null },\n\t\t/** The permissions the user holds. Empty means the app did not say, and allows. */\n\t\tcnPermissions: { default: () => [] },\n\t\t/** The look the app takes: `board` draws the page's own header. */\n\t\tcnLook: { default: 'nextcloud' },\n\t\t/** Opens the user settings dialog, provided by CnAppRoot. Null outside one. */\n\t\tcnOpenUserSettings: { default: null },\n\t},\n\n\tprops: {\n\t\t/** The whole manifest page, for a host that mounts this component itself. CnPageRenderer passes the flattened props below instead. */\n\t\tpage: {\n\t\t\ttype: Object,\n\t\t\tdefault: () => ({}),\n\t\t},\n\n\t\t/**\n\t\t * The cards: `{ id, label, description?, icon?, category?, route?, params?, query?, href?, visibleIf?, permission? }`.\n\t\t * `route` is a route name, or a path when it starts with `/`.\n\t\t *\n\t\t * @type {Array<object>|null}\n\t\t */\n\t\tcards: {\n\t\t\ttype: Array,\n\t\t\tdefault: null,\n\t\t},\n\n\t\t/**\n\t\t * Group key to caption. Sets the order of the groups.\n\t\t *\n\t\t * @type {Record<string, string>|null}\n\t\t */\n\t\tcategories: {\n\t\t\ttype: Object,\n\t\t\tdefault: null,\n\t\t},\n\n\t\t/** The heading. */\n\t\ttitle: {\n\t\t\ttype: String,\n\t\t\tdefault: null,\n\t\t},\n\n\t\t/** The lead paragraph under the heading. */\n\t\tdescription: {\n\t\t\ttype: String,\n\t\t\tdefault: null,\n\t\t},\n\n\t\t/**\n\t\t * The modules: `{ id, label, description?, icon?, enabled?, enabledIf?,\n\t\t * route?, pages: [{ label, route, highlight? }], settings?: { label?, prefix?,\n\t\t * route?, href?, permission?, visibleIf? }, permission?, visibleIf? }`.\n\t\t * Drawn as module cards above the link cards.\n\t\t *\n\t\t * @type {Array<object>|null}\n\t\t */\n\t\tmodules: {\n\t\t\ttype: Array,\n\t\t\tdefault: null,\n\t\t},\n\n\t\t/** `cards` (default): a grid of link cards per group. `list`: one card per group with a row per link. */\n\t\tgroupStyle: {\n\t\t\ttype: String,\n\t\t\tdefault: null,\n\t\t},\n\n\t\t/** Heading of the modules section. Defaults to \"Modules\". */\n\t\tmodulesTitle: {\n\t\t\ttype: String,\n\t\t\tdefault: null,\n\t\t},\n\n\t\t/** A note under the module cards. */\n\t\tfootnote: {\n\t\t\ttype: String,\n\t\t\tdefault: null,\n\t\t},\n\n\t\t/**\n\t\t * A closing card: `{ label?, badge?: { label, icon? }, text?, link?: { label,\n\t\t * route?, href? }, title?, subtitle?, facts?: [{ label, value, note?, visibleIf? }],\n\t\t * permission?, visibleIf? }`. Every string is translated, then\n\t\t * `{runtime.<path>}` is filled from the manifest's `runtime`.\n\t\t *\n\t\t * @type {object|null}\n\t\t */\n\t\tpanel: {\n\t\t\ttype: Object,\n\t\t\tdefault: null,\n\t\t},\n\n\t\t/** Text shown when no card is visible. */\n\t\temptyLabel: {\n\t\t\ttype: String,\n\t\t\tdefault: null,\n\t\t},\n\n\t\t/**\n\t\t * Translate function. Falls back to the injected `cnTranslate`.\n\t\t *\n\t\t * @type {((key: string) => string)|null}\n\t\t */\n\t\ttranslate: {\n\t\t\ttype: Function,\n\t\t\tdefault: null,\n\t\t},\n\t},\n\n\tdata() {\n\t\tlinkCardsPageUid += 1\n\t\treturn {\n\t\t\tuid: linkCardsPageUid,\n\t\t\tstatusData: {},\n\t\t}\n\t},\n\n\tcomputed: {\n\t\t/**\n\t\t * Whether the app takes the board look (`cnLook` is `board`).\n\t\t *\n\t\t * @spec openspec/changes/links-page-board-header/specs/links-page-board-header/spec.md#requirement-a-board-links-page-draws-the-page-header\n\t\t * @return {boolean}\n\t\t */\n\t\tisBoardLook() {\n\t\t\treturn normalizeLook(this.cnLook) === 'board'\n\t\t},\n\n\t\t/**\n\t\t * The config, from the flattened props or from `page.config`. Props win.\n\t\t *\n\t\t * @return {object} The config.\n\t\t * @spec openspec/changes/link-cards-page/specs/link-cards-page/spec.md#requirement-a-links-page-renders-grouped-link-cards\n\t\t */\n\t\tconfig() {\n\t\t\tconst fromPage = (this.page && this.page.config) || {}\n\t\t\tconst fromProps = {}\n\t\t\tfor (const key of ['cards', 'categories', 'description', 'title', 'emptyLabel', 'modules', 'modulesTitle', 'footnote', 'groupStyle', 'panel']) {\n\t\t\t\tif (this[key] !== null && this[key] !== undefined) {\n\t\t\t\t\tfromProps[key] = this[key]\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn { ...fromPage, ...fromProps }\n\t\t},\n\n\t\t/**\n\t\t * The heading, translated.\n\t\t *\n\t\t * @return {string} The title, or '' when the page declares none.\n\t\t * @spec openspec/changes/link-cards-page/specs/link-cards-page/spec.md#requirement-a-links-page-renders-grouped-link-cards\n\t\t */\n\t\tresolvedTitle() {\n\t\t\treturn this.tr(this.config.title || (this.page && this.page.title) || '')\n\t\t},\n\n\t\t/**\n\t\t * The lead paragraph, translated.\n\t\t *\n\t\t * @return {string} The description.\n\t\t * @spec openspec/changes/link-cards-page/specs/link-cards-page/spec.md#requirement-a-links-page-renders-grouped-link-cards\n\t\t */\n\t\tresolvedDescription() {\n\t\t\treturn this.tr(this.config.description || '')\n\t\t},\n\n\t\t/**\n\t\t * The empty-state text.\n\t\t *\n\t\t * @return {string} The text.\n\t\t * @spec openspec/changes/link-cards-page/specs/link-cards-page/spec.md#requirement-a-links-page-renders-grouped-link-cards\n\t\t */\n\t\tresolvedEmptyLabel() {\n\t\t\treturn this.config.emptyLabel ? this.tr(this.config.emptyLabel) : t('nextcloud-vue', 'Nothing to open here.')\n\t\t},\n\n\t\t/**\n\t\t * The cards a reader may see and can open, with text translated and\n\t\t * the link resolved. A card that is gated away, or has no target that\n\t\t * resolves, is left out: a card that does nothing is worse than none.\n\t\t *\n\t\t * @return {Array<object>} The cards.\n\t\t * @spec openspec/changes/link-cards-page/specs/link-cards-page/spec.md#requirement-a-card-is-a-real-link\n\t\t */\n\t\tvisibleCards() {\n\t\t\tconst declared = Array.isArray(this.config.cards) ? this.config.cards : []\n\t\t\tconst runtime = this.cnManifest?.runtime ?? null\n\t\t\treturn declared\n\t\t\t\t.filter((card) => card && card.id && card.label)\n\t\t\t\t.filter((card) => this.passesPermission(card) && this.passesVisibleIf(card, runtime))\n\t\t\t\t.map((card) => {\n\t\t\t\t\tconst target = this.targetOf(card)\n\t\t\t\t\treturn {\n\t\t\t\t\t\tid: String(card.id),\n\t\t\t\t\t\tlabel: this.tr(card.label),\n\t\t\t\t\t\tdescription: this.tr(card.description || ''),\n\t\t\t\t\t\tdescriptionId: `cn-link-card-desc-${this.uid}-${String(card.id).replace(/[^A-Za-z0-9_-]/g, '-')}`,\n\t\t\t\t\t\ticon: card.icon || '',\n\t\t\t\t\t\tcategory: card.category || '',\n\t\t\t\t\t\tstatus: card.status ?? null,\n\t\t\t\t\t\tstatusValues: card.statusValues && typeof card.statusValues === 'object' ? card.statusValues : null,\n\t\t\t\t\t\texternal: target.external,\n\t\t\t\t\t\tlocation: target.location,\n\t\t\t\t\t\turl: target.url,\n\t\t\t\t\t\taction: target.action || '',\n\t\t\t\t\t}\n\t\t\t\t})\n\t\t\t\t.filter((card) => card.url !== '')\n\t\t},\n\n\t\t/**\n\t\t * The modules a reader may see, with text translated and links\n\t\t * resolved. `enabled` is the declared boolean, or the result of\n\t\t * `enabledIf` (a visibleIf condition against `runtime`). A page that\n\t\t * resolves to nothing is dropped; the admin-settings link only shows when\n\t\t * its own `permission` and `visibleIf` pass.\n\t\t *\n\t\t * @return {Array<object>} The modules.\n\t\t * @spec openspec/changes/screens-links-module-cards/specs/link-cards-page/spec.md#requirement-a-links-page-can-show-modules\n\t\t */\n\t\tvisibleModules() {\n\t\t\tconst declared = Array.isArray(this.config.modules) ? this.config.modules : []\n\t\t\tconst runtime = this.cnManifest?.runtime ?? null\n\t\t\treturn declared\n\t\t\t\t.filter((module) => module && module.id && module.label)\n\t\t\t\t.filter((module) => this.passesPermission(module) && this.passesVisibleIf(module, runtime))\n\t\t\t\t.map((module) => {\n\t\t\t\t\tconst pages = (Array.isArray(module.pages) ? module.pages : [])\n\t\t\t\t\t\t.filter((page) => page && page.label)\n\t\t\t\t\t\t.map((page, index) => ({ key: String(index), label: this.tr(page.label), highlight: page.highlight === true, ...this.targetOf(page) }))\n\t\t\t\t\t\t.filter((page) => page.url !== '')\n\t\t\t\t\tconst own = this.targetOf(module)\n\t\t\t\t\tconst open = own.url !== '' ? own : (pages[0] || null)\n\t\t\t\t\tconst settingsDeclared = module.settings && typeof module.settings === 'object' ? module.settings : null\n\t\t\t\t\tconst settingsTarget = settingsDeclared && this.passesPermission(settingsDeclared) && this.passesVisibleIf(settingsDeclared, runtime)\n\t\t\t\t\t\t? this.targetOf(settingsDeclared)\n\t\t\t\t\t\t: null\n\t\t\t\t\treturn {\n\t\t\t\t\t\tid: String(module.id),\n\t\t\t\t\t\tkey: String(module.id).replace(/[^A-Za-z0-9_-]/g, '-'),\n\t\t\t\t\t\tlabel: this.tr(module.label),\n\t\t\t\t\t\tdescription: this.tr(module.description || ''),\n\t\t\t\t\t\ticon: module.icon || '',\n\t\t\t\t\t\tenabled: this.moduleEnabled(module, runtime),\n\t\t\t\t\t\tpages,\n\t\t\t\t\t\topen,\n\t\t\t\t\t\tsettings: settingsTarget && settingsTarget.url !== ''\n\t\t\t\t\t\t\t? { ...settingsTarget, label: this.tr(settingsDeclared.label || ''), prefix: this.tr(settingsDeclared.prefix || '') }\n\t\t\t\t\t\t\t: null,\n\t\t\t\t\t}\n\t\t\t\t})\n\t\t},\n\n\t\t/**\n\t\t * Whether the groups are drawn as list cards (`config.groupStyle: \"list\"`).\n\t\t *\n\t\t * @return {boolean} True for list cards.\n\t\t * @spec openspec/changes/screens-links-module-cards/specs/link-cards-page/spec.md#requirement-a-group-can-be-a-list-card\n\t\t */\n\t\tisListStyle() {\n\t\t\treturn this.config.groupStyle === 'list'\n\t\t},\n\n\t\t/**\n\t\t * The modules heading, translated.\n\t\t *\n\t\t * @return {string} The heading.\n\t\t * @spec openspec/changes/screens-links-module-cards/specs/link-cards-page/spec.md#requirement-a-links-page-can-show-modules\n\t\t */\n\t\tresolvedModulesTitle() {\n\t\t\treturn this.config.modulesTitle ? this.tr(this.config.modulesTitle) : t('nextcloud-vue', 'Modules')\n\t\t},\n\n\t\t/**\n\t\t * \"3 of 6 are in the menu\".\n\t\t *\n\t\t * @return {string} The count.\n\t\t * @spec openspec/changes/screens-links-module-cards/specs/link-cards-page/spec.md#requirement-a-links-page-can-show-modules\n\t\t */\n\t\tmodulesCount() {\n\t\t\tconst on = this.visibleModules.filter((module) => module.enabled).length\n\t\t\treturn n('nextcloud-vue', '{on} of %n is in the menu', '{on} of %n are in the menu', this.visibleModules.length, { on })\n\t\t},\n\n\t\t/**\n\t\t * The note under the module cards, translated.\n\t\t *\n\t\t * @return {string} The note, or ''.\n\t\t * @spec openspec/changes/screens-links-module-cards/specs/link-cards-page/spec.md#requirement-a-links-page-can-show-modules\n\t\t */\n\t\tresolvedFootnote() {\n\t\t\treturn this.tr(this.config.footnote || '')\n\t\t},\n\n\t\t/**\n\t\t * The closing panel, translated and filled, or null when none is\n\t\t * declared or it is gated away. A fact gated by its own `visibleIf`\n\t\t * is left out.\n\t\t *\n\t\t * @return {object|null} The panel.\n\t\t * @spec openspec/changes/link-cards-status-and-panel/specs/link-cards-page/spec.md#requirement-a-links-page-can-close-with-a-panel\n\t\t * @spec openspec/changes/link-cards-settings-action/specs/link-cards-page/spec.md#requirement-the-panel-badge-takes-a-tone\n\t\t */\n\t\tresolvedPanel() {\n\t\t\tconst panel = this.config.panel\n\t\t\tif (!panel || typeof panel !== 'object') {\n\t\t\t\treturn null\n\t\t\t}\n\t\t\tconst runtime = this.cnManifest?.runtime ?? null\n\t\t\tif (!this.passesPermission(panel) || !this.passesVisibleIf(panel, runtime)) {\n\t\t\t\treturn null\n\t\t\t}\n\t\t\tconst fill = (value) => fillRuntime(this.tr(value || ''), runtime)\n\t\t\tconst linkTarget = panel.link && typeof panel.link === 'object' ? this.targetOf(panel.link) : null\n\t\t\tconst facts = (Array.isArray(panel.facts) ? panel.facts : [])\n\t\t\t\t.filter((fact) => fact && fact.label && this.passesVisibleIf(fact, runtime))\n\t\t\t\t.map((fact, index) => ({ key: String(index), label: fill(fact.label), value: fill(fact.value), note: fill(fact.note) }))\n\t\t\treturn {\n\t\t\t\tlabel: fill(panel.label),\n\t\t\t\tbadge: panel.badge ? fill(panel.badge.label) : '',\n\t\t\t\tbadgeIcon: panel.badge?.icon || '',\n\t\t\t\tbadgeTone: BADGE_TONES.includes(panel.badge?.tone) ? panel.badge.tone : 'primary',\n\t\t\t\ttext: fill(panel.text),\n\t\t\t\tlink: linkTarget && linkTarget.url !== '' ? { ...linkTarget, label: fill(panel.link.label) } : null,\n\t\t\t\ttitle: fill(panel.title),\n\t\t\t\tsubtitle: fill(panel.subtitle),\n\t\t\t\tfacts,\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * The groups to draw: ungrouped cards first under no caption, then\n\t\t * one group per category in declaration order. A group without a\n\t\t * visible card is left out.\n\t\t *\n\t\t * @return {Array<{key: string, label: string, headingId: string, cards: Array<object>}>} The groups.\n\t\t * @spec openspec/changes/link-cards-page/specs/link-cards-page/spec.md#requirement-a-links-page-renders-grouped-link-cards\n\t\t */\n\t\tgroups() {\n\t\t\tconst declared = (this.config.categories && typeof this.config.categories === 'object') ? this.config.categories : {}\n\t\t\tconst keys = Object.keys(declared)\n\t\t\tconst loose = this.visibleCards.filter((card) => !keys.includes(card.category))\n\t\t\tconst groups = loose.length > 0 ? [{ key: '', label: '', headingId: '', cards: loose }] : []\n\t\t\tkeys.forEach((key, index) => {\n\t\t\t\tconst cards = this.visibleCards.filter((card) => card.category === key)\n\t\t\t\tif (cards.length > 0) {\n\t\t\t\t\tgroups.push({\n\t\t\t\t\t\tkey,\n\t\t\t\t\t\tlabel: this.tr(declared[key]),\n\t\t\t\t\t\theadingId: `cn-link-cards-group-${this.uid}-${index}`,\n\t\t\t\t\t\tcards,\n\t\t\t\t\t})\n\t\t\t\t}\n\t\t\t})\n\t\t\treturn groups\n\t\t},\n\t},\n\n\twatch: {\n\t\tvisibleCards: {\n\t\t\thandler() {\n\t\t\t\tthis.loadStatusValues()\n\t\t\t},\n\n\t\t\timmediate: true,\n\t\t},\n\t},\n\n\tmethods: {\n\t\t/**\n\t\t * A card's status line, translated, with `{name}` filled from its\n\t\t * `statusValues` and `{runtime.<path>}` from the manifest's `runtime`.\n\t\t * A status that still waits on a value it names is not shown.\n\t\t *\n\t\t * @param {object} card The resolved card.\n\t\t * @return {string} The status, or ''.\n\t\t * @spec openspec/changes/link-cards-status-and-panel/specs/link-cards-page/spec.md#requirement-a-link-card-can-carry-a-status\n\t\t */\n\t\tstatusOf(card) {\n\t\t\tconst { text } = this.statusVariant(card)\n\t\t\tif (typeof text !== 'string' || text === '') {\n\t\t\t\treturn ''\n\t\t\t}\n\t\t\tconst values = this.statusData[card.id] || {}\n\t\t\tlet waiting = false\n\t\t\tconst filled = this.tr(text).replace(/\\{([A-Za-z0-9_]+)\\}/g, (match, name) => {\n\t\t\t\tif (!card.statusValues || !Object.hasOwn(card.statusValues, name)) {\n\t\t\t\t\treturn match\n\t\t\t\t}\n\t\t\t\tif (values[name] === undefined || values[name] === null) {\n\t\t\t\t\twaiting = true\n\t\t\t\t\treturn match\n\t\t\t\t}\n\t\t\t\treturn String(values[name])\n\t\t\t})\n\t\t\treturn waiting ? '' : fillRuntime(filled, this.cnManifest?.runtime ?? null)\n\t\t},\n\n\t\t/**\n\t\t * Which form of a card's status applies: `zero` when the counted value\n\t\t * (`status.countOf`, else the first of `statusValues`) is 0, `plural`\n\t\t * when it is not 1, else the status itself.\n\t\t *\n\t\t * @param {object} card The resolved card.\n\t\t * @return {{text: string, tone: string}} The text and its tone.\n\t\t * @spec openspec/changes/link-cards-status-and-panel/specs/link-cards-page/spec.md#requirement-a-link-card-can-carry-a-status\n\t\t */\n\t\tstatusVariant(card) {\n\t\t\tconst declared = card.status\n\t\t\tif (typeof declared === 'string') {\n\t\t\t\treturn { text: declared, tone: 'neutral' }\n\t\t\t}\n\t\t\tif (!declared || typeof declared !== 'object') {\n\t\t\t\treturn { text: '', tone: 'neutral' }\n\t\t\t}\n\t\t\tconst names = card.statusValues ? Object.keys(card.statusValues) : []\n\t\t\tconst counted = (this.statusData[card.id] || {})[declared.countOf || names[0]]\n\t\t\tconst zero = declared.zero\n\t\t\tif (counted === 0 && zero) {\n\t\t\t\treturn typeof zero === 'string' ? { text: zero, tone: 'neutral' } : { text: zero.text, tone: statusToneOf(zero) }\n\t\t\t}\n\t\t\tconst text = typeof counted === 'number' && counted !== 1 && declared.plural ? declared.plural : declared.text\n\t\t\treturn { text, tone: statusToneOf(declared) }\n\t\t},\n\n\t\t/**\n\t\t * Fetch the numbers the cards' status lines name. A source is an\n\t\t * aggregate descriptor (`{ register, schema, metric?, field?, filter? }`)\n\t\t * or `{ url, path? }`, a GET whose JSON holds the number at `path`\n\t\t * (default `total`; a list counts its items, those matching `where`\n\t\t * when given). A failed\n\t\t * fetch leaves that status out.\n\t\t *\n\t\t * @return {Promise<void>}\n\t\t * @spec openspec/changes/link-cards-status-and-panel/specs/link-cards-page/spec.md#requirement-a-link-card-can-carry-a-status\n\t\t */\n\t\tasync loadStatusValues() {\n\t\t\tfor (const card of this.visibleCards) {\n\t\t\t\tif (!card.statusValues || this.statusData[card.id]) {\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\t\t\t\tthis.statusData = { ...this.statusData, [card.id]: {} }\n\t\t\t\tfor (const [name, source] of Object.entries(card.statusValues)) {\n\t\t\t\t\tlet value\n\t\t\t\t\ttry {\n\t\t\t\t\t\tvalue = await fetchStatusValue(source)\n\t\t\t\t\t} catch {\n\t\t\t\t\t\tvalue = null\n\t\t\t\t\t}\n\t\t\t\t\tthis.statusData = { ...this.statusData, [card.id]: { ...this.statusData[card.id], [name]: value } }\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * Whether a module is in the menu: its `enabled` boolean, else its\n\t\t * `enabledIf` condition evaluated as a `visibleIf`, else false.\n\t\t *\n\t\t * @param {object} module The declared module.\n\t\t * @param {object|null} runtime `manifest.runtime`, or null.\n\t\t * @return {boolean} True when the module is in the menu.\n\t\t * @spec openspec/changes/screens-links-module-cards/specs/link-cards-page/spec.md#requirement-a-links-page-can-show-modules\n\t\t */\n\t\t/**\n\t\t * The icon at the end of a list row: an external-link icon for a URL,\n\t\t * a chevron for a page in the app. A resolved `trailing` wins.\n\t\t *\n\t\t * @param {object} card The resolved card.\n\t\t * @return {string} `external` or `chevron`.\n\t\t * @spec openspec/changes/screens-links-module-cards/specs/link-cards-page/spec.md#requirement-a-group-can-be-a-list-card\n\t\t */\n\t\ttrailingOf(card) {\n\t\t\tif (card.trailing === 'external' || card.trailing === 'chevron') {\n\t\t\t\treturn card.trailing\n\t\t\t}\n\t\t\treturn card.external ? 'external' : 'chevron'\n\t\t},\n\n\t\tmoduleEnabled(module, runtime) {\n\t\t\tif (typeof module.enabled === 'boolean') {\n\t\t\t\treturn module.enabled\n\t\t\t}\n\t\t\tif (module.enabledIf && typeof module.enabledIf === 'object') {\n\t\t\t\treturn this.passesVisibleIf({ visibleIf: module.enabledIf }, runtime)\n\t\t\t}\n\t\t\treturn false\n\t\t},\n\n\t\t/**\n\t\t * Translate a manifest string through the app's translate function.\n\t\t *\n\t\t * @param {string} value The declared string.\n\t\t * @return {string} The translation, or the input unchanged.\n\t\t * @spec openspec/changes/link-cards-page/specs/link-cards-page/spec.md#requirement-a-links-page-renders-grouped-link-cards\n\t\t */\n\t\ttr(value) {\n\t\t\tif (typeof value !== 'string' || value === '') {\n\t\t\t\treturn value\n\t\t\t}\n\t\t\treturn (this.translate ?? this.cnTranslate)(value)\n\t\t},\n\n\t\t/**\n\t\t * Whether the user holds the card's `permission`. Same rule as the\n\t\t * menu: no permission declared, or no permissions known, allows.\n\t\t *\n\t\t * @param {object} card The card.\n\t\t * @return {boolean} True when the card may render.\n\t\t * @spec openspec/changes/link-cards-page/specs/link-cards-page/spec.md#requirement-cards-honour-menu-visibility-conditions\n\t\t */\n\t\tpassesPermission(card) {\n\t\t\tconst held = Array.isArray(this.cnPermissions) ? this.cnPermissions : []\n\t\t\tif (!card.permission || held.length === 0) {\n\t\t\t\treturn true\n\t\t\t}\n\t\t\treturn held.includes(card.permission)\n\t\t},\n\n\t\t/**\n\t\t * Evaluate a card's `visibleIf` the way CnAppNav evaluates a menu\n\t\t * entry's: `appInstalled` first, then dot-path predicates against\n\t\t * the manifest's `runtime`.\n\t\t *\n\t\t * @param {object} card The card.\n\t\t * @param {object|null} runtime `manifest.runtime`, or null.\n\t\t * @return {boolean} True when the card may render.\n\t\t * @spec openspec/changes/link-cards-page/specs/link-cards-page/spec.md#requirement-cards-honour-menu-visibility-conditions\n\t\t */\n\t\tpassesVisibleIf(card, runtime) {\n\t\t\tconst condition = card.visibleIf\n\t\t\tif (!condition || typeof condition !== 'object') {\n\t\t\t\treturn true\n\t\t\t}\n\t\t\tif (condition.appInstalled && !isAppInstalled(condition.appInstalled)) {\n\t\t\t\treturn false\n\t\t\t}\n\t\t\treturn passesContextPredicates(condition, runtime)\n\t\t},\n\n\t\t/**\n\t\t * Where a card goes. An `href` is an external URL. A `route` is a\n\t\t * route name, or a path when it starts with `/`, resolved by the\n\t\t * router so the link carries the app's base with or without\n\t\t * `/index.php`. `action: \"user-settings\"` opens the user settings\n\t\t * dialog, and resolves only inside a host that offers it.\n\t\t *\n\t\t * @param {object} card The card.\n\t\t * @return {{external: boolean, location: object|null, url: string, action?: string}} The target; `url` is '' when it cannot be resolved.\n\t\t * @spec openspec/changes/link-cards-page/specs/link-cards-page/spec.md#requirement-a-card-is-a-real-link\n\t\t * @spec openspec/changes/link-cards-settings-action/specs/link-cards-page/spec.md#requirement-a-link-card-can-open-the-user-settings\n\t\t */\n\t\ttargetOf(card) {\n\t\t\tif (card.action === 'user-settings') {\n\t\t\t\treturn typeof this.cnOpenUserSettings === 'function'\n\t\t\t\t\t? { external: false, location: null, url: '#', action: card.action }\n\t\t\t\t\t: { external: false, location: null, url: '' }\n\t\t\t}\n\t\t\tif (typeof card.route === 'string' && card.route !== '') {\n\t\t\t\tconst location = card.route.startsWith('/') ? { path: card.route } : { name: card.route }\n\t\t\t\tif (card.params && typeof card.params === 'object') {\n\t\t\t\t\tlocation.params = card.params\n\t\t\t\t}\n\t\t\t\tif (card.query && typeof card.query === 'object') {\n\t\t\t\t\tlocation.query = card.query\n\t\t\t\t}\n\t\t\t\treturn { external: false, location, url: resolveHref(location, this.$router) }\n\t\t\t}\n\t\t\tif (typeof card.href === 'string' && card.href !== '') {\n\t\t\t\treturn { external: true, location: null, url: card.href }\n\t\t\t}\n\t\t\treturn { external: false, location: null, url: '' }\n\t\t},\n\n\t\t/**\n\t\t * Route a plain click on an in-app card. A modified or middle click,\n\t\t * and every click on an external card, is left to the browser. A\n\t\t * settings card opens the user settings dialog, on a click or on the\n\t\t * space key, as a button does.\n\t\t *\n\t\t * @param {object} card The resolved card.\n\t\t * @param {MouseEvent|KeyboardEvent} event The click or key press.\n\t\t * @return {void}\n\t\t * @spec openspec/changes/link-cards-page/specs/link-cards-page/spec.md#requirement-a-card-is-a-real-link\n\t\t * @spec openspec/changes/link-cards-settings-action/specs/link-cards-page/spec.md#requirement-a-link-card-can-open-the-user-settings\n\t\t */\n\t\topen(card, event) {\n\t\t\tif (card.action === 'user-settings') {\n\t\t\t\tevent.preventDefault()\n\t\t\t\tthis.cnOpenUserSettings()\n\t\t\t\treturn\n\t\t\t}\n\t\t\tif (event.type === 'keydown') {\n\t\t\t\treturn\n\t\t\t}\n\t\t\tif (card.external || !card.location) {\n\t\t\t\treturn\n\t\t\t}\n\t\t\tfollowLinkClick(event, card.location, this.$router)\n\t\t},\n\t},\n}\n</script>\n\n<style scoped>\n.cn-link-cards-page {\n\tdisplay: flex;\n\tflex-direction: column;\n\tgap: calc(6 * var(--default-grid-baseline));\n\tpadding: calc(5 * var(--default-grid-baseline));\n}\n\n/* Clear the Nextcloud navigation toggle button (44px wide, absolutely\n positioned at the left edge of .app-content) plus 12px breathing room, as\n CnPageHeader does. Only the header shifts; the cards keep the full width. */\n.cn-link-cards-page__header {\n\tpadding-inline-start: 56px;\n}\n\n.cn-link-cards-page__title {\n\tmargin: 0 0 var(--default-grid-baseline);\n}\n\n/* Board look: the boards' page header (PqModules): the title as a 28px h1\n with the buildiq square at the end of its row, the 15px line 6px under it,\n 4px above and 8px under the header; the sections 20px apart.\n @spec openspec/changes/links-page-board-header/specs/links-page-board-header/spec.md#requirement-a-board-links-page-draws-the-page-header */\n.cn-link-cards-page--board {\n\tgap: 20px;\n}\n\n.cn-link-cards-page--board .cn-link-cards-page__header {\n\tdisplay: flex;\n\tflex-direction: column;\n\tgap: 6px;\n\tpadding: 4px 0 8px;\n}\n\n.cn-link-cards-page--board .cn-link-cards-page__title-row {\n\tdisplay: flex;\n\tflex-wrap: wrap;\n\tjustify-content: space-between;\n\talign-items: flex-start;\n\tgap: 12px 24px;\n}\n\n.cn-link-cards-page--board .cn-link-cards-page__title {\n\tflex: 1 1 320px;\n\tmin-width: 0;\n\tmargin: 0;\n\tfont-size: 28px;\n\tfont-weight: 700;\n\tline-height: 1.2;\n}\n\n.cn-link-cards-page--board .cn-link-cards-page__header-actions {\n\tflex: none;\n\tdisplay: flex;\n\tflex-wrap: wrap;\n\tgap: 10px;\n}\n\n.cn-link-cards-page--board .cn-link-cards-page__description {\n\tmax-width: none;\n\tfont-size: 15px;\n}\n\n.cn-link-cards-page__description,\n.cn-link-cards-page__empty {\n\tcolor: var(--color-text-maxcontrast);\n\tmargin: 0;\n\tmax-width: 70ch;\n}\n\n.cn-link-cards-page__group {\n\tdisplay: flex;\n\tflex-direction: column;\n\tgap: calc(3 * var(--default-grid-baseline));\n}\n\n.cn-link-cards-page__caption {\n\tcolor: var(--color-text-maxcontrast);\n\tfont-size: 0.85em;\n\tfont-weight: 600;\n\tletter-spacing: 0.06em;\n\tmargin: 0;\n\ttext-transform: uppercase;\n}\n\n.cn-link-cards-page__grid {\n\tdisplay: grid;\n\tgap: calc(3 * var(--default-grid-baseline));\n\tgrid-template-columns: repeat(auto-fill, minmax(240px, 1fr));\n\tlist-style: none;\n\tmargin: 0;\n\tpadding: 0;\n}\n\n.cn-link-cards-page__cell {\n\tdisplay: flex;\n}\n\n.cn-link-cards-page__card {\n\talign-items: flex-start;\n\tbackground: var(--color-main-background);\n\tborder: 1px solid var(--color-border-dark);\n\tborder-radius: var(--border-radius-large);\n\tcolor: var(--color-main-text);\n\tdisplay: flex;\n\tflex: 1;\n\tgap: calc(3 * var(--default-grid-baseline));\n\tmin-width: 0;\n\tpadding: calc(4 * var(--default-grid-baseline));\n\ttransition: background-color var(--animation-quick, 100ms) ease, border-color var(--animation-quick, 100ms) ease, box-shadow var(--animation-quick, 100ms) ease;\n}\n\n/* A card is a link, and it must not look like a line of prose. A theme may\n underline every link with `!important` (thematiq: `a { text-decoration:\n underline !important }`, specificity 0,0,1). Among `!important` rules the\n higher specificity wins, so this class rule has to carry it too; without it\n the label and the description both rendered underlined on a live Nextcloud. */\n.cn-link-cards-page__card,\n.cn-link-cards-page__card:hover,\n.cn-link-cards-page__card:focus,\n.cn-link-cards-page__card:active {\n\ttext-decoration: none !important;\n}\n\n/* Hover moves the whole card: border, background and a soft lift. */\n.cn-link-cards-page__card:hover {\n\tbackground: var(--color-background-hover);\n\tborder-color: var(--color-primary-element);\n\tbox-shadow: 0 2px 6px var(--color-box-shadow);\n}\n\n@media (prefers-reduced-motion: reduce) {\n\t.cn-link-cards-page__card {\n\t\ttransition: none;\n\t}\n}\n\n.cn-link-cards-page__card:focus-visible {\n\tborder-color: var(--color-primary-element);\n\toutline: 2px solid var(--color-primary-element);\n\toutline-offset: 2px;\n}\n\n.cn-link-cards-page__icon {\n\tcolor: var(--color-primary-element);\n\tflex: none;\n}\n\n.cn-link-cards-page__body {\n\tdisplay: flex;\n\tflex: 1 1 auto;\n\tflex-direction: column;\n\tgap: var(--default-grid-baseline);\n\tmin-width: 0;\n}\n\n.cn-link-cards-page__trailing {\n\tflex: none;\n\tcolor: var(--color-text-maxcontrast);\n}\n\n/* The label is the card's title. Its colour is set here, on the span, because\n a theme may force its link colour on the `a` itself; an inherited link\n colour made the title read as a hyperlink. */\n.cn-link-cards-page__label {\n\tcolor: var(--color-main-text);\n\tfont-size: 1.05em;\n\tfont-weight: 700;\n\tline-height: 1.3;\n\toverflow-wrap: anywhere;\n}\n\n.cn-link-cards-page__card-description {\n\tcolor: var(--color-text-maxcontrast);\n\tfont-size: 0.9em;\n\tline-height: 1.4;\n}\n\n.cn-link-cards-page__group--list {\n\tpadding: 20px 22px;\n\tborder: 1px solid var(--color-border);\n\tborder-radius: var(--border-radius-container-large, 12px);\n\tbackground: var(--color-main-background);\n\tgap: 6px;\n}\n\n.cn-link-cards-page__group--list .cn-link-cards-page__caption {\n\tmargin: 0 0 8px;\n\tcolor: var(--color-main-text);\n\tfont-size: 17px;\n\tfont-weight: 700;\n\tline-height: normal;\n\tletter-spacing: normal;\n\ttext-transform: none;\n}\n\n.cn-link-cards-page__list {\n\tmargin: 0;\n\tpadding: 0;\n\tlist-style: none;\n}\n\n.cn-link-cards-page__row {\n\tdisplay: flex;\n\talign-items: center;\n\tgap: 12px;\n\tpadding: 10px 0;\n\tborder-top: 1px solid var(--color-background-dark);\n\tcolor: var(--color-main-text);\n}\n\n.cn-link-cards-page__row,\n.cn-link-cards-page__row:hover,\n.cn-link-cards-page__row:focus,\n.cn-link-cards-page__row:active {\n\ttext-decoration: none !important;\n}\n\n.cn-link-cards-page__row:focus-visible {\n\toutline: 2px solid var(--color-primary-element);\n\toutline-offset: 2px;\n}\n\n.cn-link-cards-page__row-icon {\n\tdisplay: flex;\n\tflex: none;\n\talign-items: center;\n\tjustify-content: center;\n\twidth: 34px;\n\theight: 34px;\n\tborder-radius: var(--border-radius-element, 8px);\n\tbackground: var(--color-background-dark);\n}\n\n.cn-link-cards-page__row-body {\n\tdisplay: flex;\n\tflex: 1 1 auto;\n\tflex-direction: column;\n\tgap: 2px;\n\tmin-width: 0;\n}\n\n.cn-link-cards-page__row-label {\n\tfont-size: 15px;\n\tfont-weight: 600;\n}\n\n.cn-link-cards-page__row-description {\n\tfont-size: 13px;\n\tcolor: var(--color-text-maxcontrast);\n}\n\n.cn-link-cards-page__row-trailing {\n\tflex: none;\n\tcolor: var(--color-text-maxcontrast);\n}\n\n.cn-link-cards-page__modules {\n\tdisplay: flex;\n\tflex-direction: column;\n\tgap: 14px;\n}\n\n.cn-link-cards-page__modules-head {\n\tdisplay: flex;\n\tflex-wrap: wrap;\n\tjustify-content: space-between;\n\talign-items: baseline;\n\tgap: 8px;\n}\n\n.cn-link-cards-page__modules-title {\n\tmargin: 0;\n\tfont-size: 20px;\n\tfont-weight: 700;\n}\n\n.cn-link-cards-page__modules-count {\n\tfont-size: 14px;\n\tcolor: var(--color-text-maxcontrast);\n}\n\n.cn-link-cards-page__modules-grid {\n\tdisplay: grid;\n\tgrid-template-columns: repeat(auto-fill, minmax(260px, 1fr));\n\tgap: 16px;\n}\n\n.cn-link-cards-page__modules-note {\n\tdisplay: flex;\n\talign-items: flex-start;\n\tgap: 8px;\n\tmargin: 0;\n\tfont-size: 14px;\n\tcolor: var(--color-text-maxcontrast);\n}\n\n.cn-link-cards-page__modules-note-icon {\n\tflex: none;\n}\n/* A card's status pill under its description (board PqGeavanceerdHub). */\n.cn-link-cards-page__status {\n\talign-self: flex-start;\n\tbackground: var(--color-background-dark, #f0f1f3);\n\tborder-radius: 12px;\n\tcolor: var(--color-main-text);\n\tdisplay: inline-block;\n\tfont-size: 13px;\n\tfont-weight: 600;\n\tpadding: 3px 10px;\n}\n\n.cn-link-cards-page__status--error {\n\tbackground: var(--color-error-light, #fcedec);\n\tcolor: var(--color-error-text, #a30000);\n}\n\n.cn-link-cards-page__status--warning {\n\tbackground: var(--color-warning-light, #fff4de);\n\tcolor: var(--color-warning-text, #7a4f00);\n}\n\n.cn-link-cards-page__status--success {\n\tbackground: var(--color-success-light, #e7f3ea);\n\tcolor: var(--color-success-text, #1e6b2a);\n}\n\n/* The closing panel: a lead column (badge, paragraph, link) beside a titled\n list of facts, wrapping under each other on a narrow screen. */\n.cn-link-cards-page__panel {\n\tbackground: var(--color-main-background);\n\tborder: 1px solid var(--color-border-dark);\n\tborder-radius: var(--border-radius-large);\n\tdisplay: flex;\n\tflex-wrap: wrap;\n\tgap: 24px;\n\tpadding: 22px;\n}\n\n.cn-link-cards-page__panel-lead {\n\tdisplay: flex;\n\tflex: 1 1 280px;\n\tflex-direction: column;\n\tgap: 10px;\n}\n\n.cn-link-cards-page__panel-badge {\n\talign-items: center;\n\talign-self: flex-start;\n\tbackground: var(--color-primary-element-light);\n\tborder-radius: 12px;\n\tcolor: var(--color-primary-element-light-text);\n\tdisplay: inline-flex;\n\tfont-size: 13px;\n\tfont-weight: 600;\n\tgap: 6px;\n\tline-height: normal;\n\tpadding: 3px 10px;\n}\n\n.cn-link-cards-page__panel-badge--purple {\n\tbackground: var(--cn-status-purple-bg);\n\tcolor: var(--cn-status-purple-text);\n}\n\n.cn-link-cards-page__panel-text {\n\tline-height: 1.5;\n\tmargin: 0;\n}\n\n.cn-link-cards-page__panel-link {\n\tfont-size: 14px;\n\tfont-weight: 600;\n}\n\n.cn-link-cards-page__panel-facts {\n\tdisplay: flex;\n\tflex: 1 1 380px;\n\tflex-direction: column;\n\tgap: 12px;\n}\n\n.cn-link-cards-page__panel-title {\n\tfont-size: 18px;\n\tfont-weight: 700;\n\tmargin: 0;\n}\n\n.cn-link-cards-page__panel-subtitle,\n.cn-link-cards-page__panel-list dt,\n.cn-link-cards-page__panel-note {\n\tcolor: var(--color-text-maxcontrast);\n}\n\n.cn-link-cards-page__panel-subtitle {\n\tfont-size: 14px;\n}\n\n.cn-link-cards-page__panel-list {\n\tdisplay: grid;\n\tgap: 8px 16px;\n\tgrid-template-columns: max-content 1fr;\n\tmargin: 0;\n}\n\n.cn-link-cards-page__panel-list dd {\n\tfont-weight: 600;\n\tmargin: 0;\n}\n\n.cn-link-cards-page__panel-note {\n\tdisplay: block;\n\tfont-size: 13px;\n\tfont-weight: 400;\n}\n</style>\n"],"names":["_createElementBlock","_normalizeClass","_openBlock","_toDisplayString","_createElementVNode","_createVNode","_Fragment","_renderList","_createBlock","_withKeys"],"mappings":";;AAgBO,MAAA,UAAA,GAAA,EAAA,KAAK,EAAC,4BAA4B,GAAA;;;AACd,EAAA,KAAA,EAAA,+BAAA;;;;AAClB,EAAA,KAAA,EAAA,2BAAA;;AAGA,MAAA,UAAA,GAAA,EAAA,KAAK,EAAC,oCAAO,GAAA;;;AAIhB,EAAA,KAA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AF,kBAAA,CAAI,MAAJ,EAAA,WAAI,EAAAG,eAAA,CAAA,IAAA,CAAA,IAAA,CAAA,EAAA,CAAA,YAAA;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"CnLinkCardsPage.vue3.js","sources":["../../../../src/components/CnLinkCardsPage/CnLinkCardsPage.vue?vue&type=template&id=7f045276&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-link-cards-page\" :class=\"{ 'cn-link-cards-page--board': isBoardLook }\" data-testid=\"cn-link-cards-page\">\n\t\t<!-- The board look draws the page's own header: the title as the page's\n\t\t h1 with the buildiq square on its row, the line under it (PqModules,\n\t\t PqReports). The plain look draws the same h1 without the row, above\n\t\t the categories' h2. -->\n\t\t<div class=\"cn-link-cards-page__header\">\n\t\t\t<div v-if=\"isBoardLook\" class=\"cn-link-cards-page__title-row\">\n\t\t\t\t<h1 v-if=\"resolvedTitle\" class=\"cn-link-cards-page__title\">\n\t\t\t\t\t{{ resolvedTitle }}\n\t\t\t\t</h1>\n\t\t\t\t<div class=\"cn-link-cards-page__header-actions\">\n\t\t\t\t\t<CnBuildiqEditButton />\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t\t<h1 v-else-if=\"resolvedTitle\" class=\"cn-link-cards-page__title\">\n\t\t\t\t{{ resolvedTitle }}\n\t\t\t</h1>\n\t\t\t<p v-if=\"resolvedDescription\" class=\"cn-link-cards-page__description\">\n\t\t\t\t{{ resolvedDescription }}\n\t\t\t</p>\n\t\t</div>\n\n\t\t<section\n\t\t\tv-if=\"visibleModules.length > 0\"\n\t\t\tclass=\"cn-link-cards-page__modules\"\n\t\t\t:aria-labelledby=\"`cn-link-cards-modules-${uid}`\"\n\t\t\tdata-testid=\"cn-link-cards-modules\">\n\t\t\t<div class=\"cn-link-cards-page__modules-head\">\n\t\t\t\t<h3 :id=\"`cn-link-cards-modules-${uid}`\" class=\"cn-link-cards-page__modules-title\">\n\t\t\t\t\t{{ resolvedModulesTitle }}\n\t\t\t\t</h3>\n\t\t\t\t<span class=\"cn-link-cards-page__modules-count\" data-testid=\"cn-link-cards-modules-count\">\n\t\t\t\t\t{{ modulesCount }}\n\t\t\t\t</span>\n\t\t\t</div>\n\t\t\t<div class=\"cn-link-cards-page__modules-grid\">\n\t\t\t\t<CnModuleCard\n\t\t\t\t\tv-for=\"module in visibleModules\"\n\t\t\t\t\t:key=\"module.id\"\n\t\t\t\t\t:module=\"module\"\n\t\t\t\t\t:headingId=\"`cn-link-cards-module-${uid}-${module.key}`\" />\n\t\t\t</div>\n\t\t\t<p v-if=\"resolvedFootnote\" class=\"cn-link-cards-page__modules-note\" data-testid=\"cn-link-cards-modules-note\">\n\t\t\t\t<InformationOutline :size=\"18\" class=\"cn-link-cards-page__modules-note-icon\" />\n\t\t\t\t<span>{{ resolvedFootnote }}</span>\n\t\t\t</p>\n\t\t</section>\n\n\t\t<p\n\t\t\tv-if=\"groups.length === 0 && visibleModules.length === 0\"\n\t\t\tclass=\"cn-link-cards-page__empty\"\n\t\t\tdata-testid=\"cn-link-cards-empty\">\n\t\t\t{{ resolvedEmptyLabel }}\n\t\t</p>\n\n\t\t<section\n\t\t\tv-for=\"group in groups\"\n\t\t\t:key=\"group.key\"\n\t\t\tclass=\"cn-link-cards-page__group\"\n\t\t\t:class=\"{ 'cn-link-cards-page__group--list': isListStyle }\"\n\t\t\t:aria-labelledby=\"group.label ? group.headingId : null\"\n\t\t\t:aria-label=\"group.label ? null : resolvedTitle || null\"\n\t\t\tdata-testid=\"cn-link-cards-group\"\n\t\t\t:data-group=\"group.key\">\n\t\t\t<h2\n\t\t\t\tv-if=\"group.label\"\n\t\t\t\t:id=\"group.headingId\"\n\t\t\t\tclass=\"cn-link-cards-page__caption\">\n\t\t\t\t{{ group.label }}\n\t\t\t</h2>\n\t\t\t<!-- groupStyle \"list\": the group is one card of rows, each an icon\n\t\t\t chip, the label over its description, and a trailing chevron\n\t\t\t (an external-link icon for a URL). -->\n\t\t\t<ul v-if=\"isListStyle\" class=\"cn-link-cards-page__list\">\n\t\t\t\t<li v-for=\"card in group.cards\" :key=\"card.id\">\n\t\t\t\t\t<a\n\t\t\t\t\t\tclass=\"cn-link-cards-page__row\"\n\t\t\t\t\t\tdata-testid=\"cn-link-card\"\n\t\t\t\t\t\t:data-card-id=\"card.id\"\n\t\t\t\t\t\t:href=\"card.url\"\n\t\t\t\t\t\t:target=\"card.external ? '_blank' : null\"\n\t\t\t\t\t\t:rel=\"card.external ? 'noopener noreferrer' : null\"\n\t\t\t\t\t\t:role=\"card.action ? 'button' : null\"\n\t\t\t\t\t\t:aria-describedby=\"card.description ? card.descriptionId : null\"\n\t\t\t\t\t\t@click=\"open(card, $event)\"\n\t\t\t\t\t\t@keydown.space=\"open(card, $event)\">\n\t\t\t\t\t\t<span v-if=\"card.icon\" class=\"cn-link-cards-page__row-icon\" aria-hidden=\"true\">\n\t\t\t\t\t\t\t<CnIcon :name=\"card.icon\" :size=\"20\" />\n\t\t\t\t\t\t</span>\n\t\t\t\t\t\t<span class=\"cn-link-cards-page__row-body\">\n\t\t\t\t\t\t\t<span class=\"cn-link-cards-page__row-label\">{{ card.label }}</span>\n\t\t\t\t\t\t\t<span\n\t\t\t\t\t\t\t\tv-if=\"card.description\"\n\t\t\t\t\t\t\t\t:id=\"card.descriptionId\"\n\t\t\t\t\t\t\t\tclass=\"cn-link-cards-page__row-description\">\n\t\t\t\t\t\t\t\t{{ card.description }}\n\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t</span>\n\t\t\t\t\t\t<OpenInNew v-if=\"trailingOf(card) === 'external'\" :size=\"18\" class=\"cn-link-cards-page__row-trailing\" />\n\t\t\t\t\t\t<ChevronRight v-else :size=\"20\" class=\"cn-link-cards-page__row-trailing\" />\n\t\t\t\t\t</a>\n\t\t\t\t</li>\n\t\t\t</ul>\n\t\t\t<ul v-else class=\"cn-link-cards-page__grid\">\n\t\t\t\t<li v-for=\"card in group.cards\" :key=\"card.id\" class=\"cn-link-cards-page__cell\">\n\t\t\t\t\t<!-- A real <a href>, so the card can be middle-clicked, copied\n\t\t\t\t\t and announced as a link. A plain click on an in-app card\n\t\t\t\t\t is routed, which keeps the page from reloading. -->\n\t\t\t\t\t<a\n\t\t\t\t\t\tclass=\"cn-link-cards-page__card\"\n\t\t\t\t\t\tdata-testid=\"cn-link-card\"\n\t\t\t\t\t\t:data-card-id=\"card.id\"\n\t\t\t\t\t\t:href=\"card.url\"\n\t\t\t\t\t\t:target=\"card.external ? '_blank' : null\"\n\t\t\t\t\t\t:rel=\"card.external ? 'noopener noreferrer' : null\"\n\t\t\t\t\t\t:role=\"card.action ? 'button' : null\"\n\t\t\t\t\t\t:aria-describedby=\"card.description ? card.descriptionId : null\"\n\t\t\t\t\t\t@click=\"open(card, $event)\"\n\t\t\t\t\t\t@keydown.space=\"open(card, $event)\">\n\t\t\t\t\t\t<CnIcon\n\t\t\t\t\t\t\tv-if=\"card.icon\"\n\t\t\t\t\t\t\t:name=\"card.icon\"\n\t\t\t\t\t\t\t:size=\"24\"\n\t\t\t\t\t\t\tclass=\"cn-link-cards-page__icon\"\n\t\t\t\t\t\t\taria-hidden=\"true\" />\n\t\t\t\t\t\t<span class=\"cn-link-cards-page__body\">\n\t\t\t\t\t\t\t<span class=\"cn-link-cards-page__label\">{{ card.label }}</span>\n\t\t\t\t\t\t\t<span\n\t\t\t\t\t\t\t\tv-if=\"card.description\"\n\t\t\t\t\t\t\t\t:id=\"card.descriptionId\"\n\t\t\t\t\t\t\t\tclass=\"cn-link-cards-page__card-description\">\n\t\t\t\t\t\t\t\t{{ card.description }}\n\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t<span\n\t\t\t\t\t\t\t\tv-if=\"statusOf(card)\"\n\t\t\t\t\t\t\t\tclass=\"cn-link-cards-page__status\"\n\t\t\t\t\t\t\t\t:class=\"`cn-link-cards-page__status--${statusVariant(card).tone}`\"\n\t\t\t\t\t\t\t\tdata-testid=\"cn-link-card-status\">\n\t\t\t\t\t\t\t\t{{ statusOf(card) }}\n\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t</span>\n\t\t\t\t\t\t<OpenInNew\n\t\t\t\t\t\t\tv-if=\"trailingOf(card) === 'external'\"\n\t\t\t\t\t\t\t:size=\"18\"\n\t\t\t\t\t\t\tclass=\"cn-link-cards-page__trailing\" />\n\t\t\t\t\t\t<ChevronRight v-else :size=\"20\" class=\"cn-link-cards-page__trailing\" />\n\t\t\t\t\t</a>\n\t\t\t\t</li>\n\t\t\t</ul>\n\t\t</section>\n\t\t<!-- `panel`: a closing card beside the groups, such as the menu\n\t\t structure an administrator set: a badge, a paragraph with a link,\n\t\t and a titled list of facts. -->\n\t\t<section\n\t\t\tv-if=\"resolvedPanel\"\n\t\t\tclass=\"cn-link-cards-page__panel\"\n\t\t\t:aria-label=\"resolvedPanel.label || null\"\n\t\t\tdata-testid=\"cn-link-cards-panel\">\n\t\t\t<div class=\"cn-link-cards-page__panel-lead\">\n\t\t\t\t<span\n\t\t\t\t\tv-if=\"resolvedPanel.badge\"\n\t\t\t\t\tclass=\"cn-link-cards-page__panel-badge\"\n\t\t\t\t\t:class=\"`cn-link-cards-page__panel-badge--${resolvedPanel.badgeTone}`\"\n\t\t\t\t\tdata-testid=\"cn-link-cards-panel-badge\">\n\t\t\t\t\t<CnIcon\n\t\t\t\t\t\tv-if=\"resolvedPanel.badgeIcon\"\n\t\t\t\t\t\t:name=\"resolvedPanel.badgeIcon\"\n\t\t\t\t\t\t:size=\"14\"\n\t\t\t\t\t\taria-hidden=\"true\" />\n\t\t\t\t\t{{ resolvedPanel.badge }}\n\t\t\t\t</span>\n\t\t\t\t<p v-if=\"resolvedPanel.text\" class=\"cn-link-cards-page__panel-text\">\n\t\t\t\t\t{{ resolvedPanel.text }}\n\t\t\t\t</p>\n\t\t\t\t<a\n\t\t\t\t\tv-if=\"resolvedPanel.link\"\n\t\t\t\t\tclass=\"cn-link-cards-page__panel-link\"\n\t\t\t\t\tdata-testid=\"cn-link-cards-panel-link\"\n\t\t\t\t\t:href=\"resolvedPanel.link.url\"\n\t\t\t\t\t:target=\"resolvedPanel.link.external ? '_blank' : null\"\n\t\t\t\t\t:rel=\"resolvedPanel.link.external ? 'noopener noreferrer' : null\"\n\t\t\t\t\t@click=\"open(resolvedPanel.link, $event)\">\n\t\t\t\t\t{{ resolvedPanel.link.label }}\n\t\t\t\t</a>\n\t\t\t</div>\n\t\t\t<div v-if=\"resolvedPanel.title || resolvedPanel.facts.length > 0\" class=\"cn-link-cards-page__panel-facts\">\n\t\t\t\t<h2 v-if=\"resolvedPanel.title\" class=\"cn-link-cards-page__panel-title\">\n\t\t\t\t\t{{ resolvedPanel.title }}\n\t\t\t\t</h2>\n\t\t\t\t<span v-if=\"resolvedPanel.subtitle\" class=\"cn-link-cards-page__panel-subtitle\">\n\t\t\t\t\t{{ resolvedPanel.subtitle }}\n\t\t\t\t</span>\n\t\t\t\t<dl v-if=\"resolvedPanel.facts.length > 0\" class=\"cn-link-cards-page__panel-list\">\n\t\t\t\t\t<template v-for=\"fact in resolvedPanel.facts\" :key=\"fact.key\">\n\t\t\t\t\t\t<dt>{{ fact.label }}</dt>\n\t\t\t\t\t\t<dd data-testid=\"cn-link-cards-panel-fact\">\n\t\t\t\t\t\t\t{{ fact.value }}\n\t\t\t\t\t\t\t<span v-if=\"fact.note\" class=\"cn-link-cards-page__panel-note\">{{ fact.note }}</span>\n\t\t\t\t\t\t</dd>\n\t\t\t\t\t</template>\n\t\t\t\t</dl>\n\t\t\t</div>\n\t\t</section>\n\t</div>\n</template>\n\n<script>\nimport { translatePlural as n, translate as t } from '@nextcloud/l10n'\nimport ChevronRight from 'vue-material-design-icons/ChevronRight.vue'\nimport InformationOutline from 'vue-material-design-icons/InformationOutline.vue'\nimport OpenInNew from 'vue-material-design-icons/OpenInNew.vue'\nimport CnBuildiqEditButton from '../CnBuildiqEditButton/CnBuildiqEditButton.vue'\nimport CnModuleCard from '../CnModuleCard/CnModuleCard.vue'\nimport { normalizeLook } from '../../composables/useLook.js'\nimport { isAppInstalled } from '../../utils/appInstalled.js'\nimport { fetchAggregateValue } from '../../utils/fetchAggregate.js'\nimport { followLinkClick, resolveHref } from '../../utils/linkNavigation.js'\nimport { passesContextPredicates } from '../../utils/visibleIfContext.js'\nimport { CnIcon } from '../CnIcon/index.js'\n\nlet linkCardsPageUid = 0\n\nconst STATUS_TONES = ['neutral', 'error', 'warning', 'success']\n\nconst BADGE_TONES = ['primary', 'purple']\n\n/**\n * The tone of a card's status pill: `status.tone` when it is one of the known\n * tones, else neutral.\n *\n * @param {unknown} status The declared status.\n * @return {string} The tone.\n */\nfunction statusToneOf(status) {\n\tconst tone = status && typeof status === 'object' ? status.tone : null\n\treturn STATUS_TONES.includes(tone) ? tone : 'neutral'\n}\n\n/**\n * Read a dotted path from an object.\n *\n * @param {unknown} root The object.\n * @param {string} path The path.\n * @return {unknown} The value, or undefined.\n */\nfunction readPath(root, path) {\n\treturn String(path).split('.').reduce((node, key) => (node && typeof node === 'object' && Object.hasOwn(node, key) ? node[key] : undefined), root)\n}\n\n/**\n * Fill `{runtime.<path>}` tokens from the manifest's runtime. A token with\n * no value becomes ''.\n *\n * @param {string} text The text.\n * @param {object|null} runtime The runtime.\n * @return {string} The filled text.\n */\nfunction fillRuntime(text, runtime) {\n\tif (typeof text !== 'string' || !text.includes('{runtime.')) {\n\t\treturn text\n\t}\n\treturn text.replace(/\\{runtime\\.([A-Za-z0-9_.]+)\\}/g, (match, path) => {\n\t\tconst value = readPath(runtime, path)\n\t\treturn value === undefined || value === null ? '' : String(value)\n\t})\n}\n\n/**\n * One number for a card's status line.\n *\n * @param {object} source An aggregate descriptor or `{ url, path?, params?, where?, sumOf? }`; `where` keeps only the list items whose fields equal its values, `sumOf` adds up a field of each (an array field by its length) instead of counting them.\n * @return {Promise<number|null>} The number, or null.\n */\nasync function fetchStatusValue(source) {\n\tif (!source || typeof source !== 'object') {\n\t\treturn null\n\t}\n\tif (typeof source.url === 'string' && source.url !== '') {\n\t\tconst [{ default: axios }, { generateUrl }] = await Promise.all([\n\t\t\timport('@nextcloud/axios'),\n\t\t\timport('@nextcloud/router'),\n\t\t])\n\t\tconst url = source.url.startsWith('/apps/') ? generateUrl(source.url) : source.url\n\t\tconst { data } = await axios.get(url, { params: source.params || {} })\n\t\tconst picked = readPath(data, source.path || 'total')\n\t\tconst list = Array.isArray(picked) ? picked : (picked === undefined && Array.isArray(data) ? data : null)\n\t\tif (list !== null) {\n\t\t\tconst where = source.where && typeof source.where === 'object' ? Object.entries(source.where) : []\n\t\t\tconst matching = list.filter((item) => where.every(([key, wanted]) => readPath(item, key) === wanted))\n\t\t\tif (typeof source.sumOf === 'string' && source.sumOf !== '') {\n\t\t\t\treturn matching.reduce((sum, item) => {\n\t\t\t\t\tconst value = readPath(item, source.sumOf)\n\t\t\t\t\treturn sum + (Array.isArray(value) ? value.length : (typeof value === 'number' ? value : 0))\n\t\t\t\t}, 0)\n\t\t\t}\n\t\t\treturn matching.length\n\t\t}\n\t\treturn typeof picked === 'number' ? picked : null\n\t}\n\treturn fetchAggregateValue(source)\n}\n\n/**\n * CnLinkCardsPage: the `type: \"links\"` page. Link cards, grouped under captions.\n *\n * One page that opens every page a short menu leaves out. A card has a\n * label, a one-line description, an optional icon and a target. Groups come\n * from `categories`, in the order they are declared; a card names its group\n * with `category`.\n *\n * ```json\n * { \"id\": \"Modules\", \"route\": \"/modules\", \"type\": \"links\", \"title\": \"Modules and more\",\n * \"config\": {\n * \"description\": \"Every page that is not in the daily menu.\",\n * \"categories\": { \"sales\": \"Sales\", \"marketing\": \"Marketing\" },\n * \"cards\": [\n * { \"id\": \"Leads\", \"label\": \"Leads\", \"description\": \"Every deal you are working on.\",\n * \"icon\": \"CashMultiple\", \"category\": \"sales\", \"route\": \"Leads\" }\n * ]\n * } }\n * ```\n *\n * Every string goes through the app's translate function. A card is hidden\n * by the same `visibleIf` and `permission` a menu entry takes, and a group\n * with no visible card is not drawn.\n */\nexport default {\n\tname: 'CnLinkCardsPage',\n\n\tcomponents: { ChevronRight, CnBuildiqEditButton, CnIcon, CnModuleCard, InformationOutline, OpenInNew },\n\n\tinject: {\n\t\t/** The app's translate function, provided by CnAppRoot. Identity outside one. */\n\t\tcnTranslate: { default: () => (key) => key },\n\t\t/** The effective manifest, for `visibleIf` predicates against `runtime`. */\n\t\tcnManifest: { default: null },\n\t\t/** The permissions the user holds. Empty means the app did not say, and allows. */\n\t\tcnPermissions: { default: () => [] },\n\t\t/** The look the app takes: `board` draws the page's own header. */\n\t\tcnLook: { default: 'nextcloud' },\n\t\t/** Opens the user settings dialog, provided by CnAppRoot. Null outside one. */\n\t\tcnOpenUserSettings: { default: null },\n\t},\n\n\tprops: {\n\t\t/** The whole manifest page, for a host that mounts this component itself. CnPageRenderer passes the flattened props below instead. */\n\t\tpage: {\n\t\t\ttype: Object,\n\t\t\tdefault: () => ({}),\n\t\t},\n\n\t\t/**\n\t\t * The cards: `{ id, label, description?, icon?, category?, route?, params?, query?, href?, visibleIf?, permission? }`.\n\t\t * `route` is a route name, or a path when it starts with `/`.\n\t\t *\n\t\t * @type {Array<object>|null}\n\t\t */\n\t\tcards: {\n\t\t\ttype: Array,\n\t\t\tdefault: null,\n\t\t},\n\n\t\t/**\n\t\t * Group key to caption. Sets the order of the groups.\n\t\t *\n\t\t * @type {Record<string, string>|null}\n\t\t */\n\t\tcategories: {\n\t\t\ttype: Object,\n\t\t\tdefault: null,\n\t\t},\n\n\t\t/** The heading. */\n\t\ttitle: {\n\t\t\ttype: String,\n\t\t\tdefault: null,\n\t\t},\n\n\t\t/** The lead paragraph under the heading. */\n\t\tdescription: {\n\t\t\ttype: String,\n\t\t\tdefault: null,\n\t\t},\n\n\t\t/**\n\t\t * The modules: `{ id, label, description?, icon?, enabled?, enabledIf?,\n\t\t * route?, pages: [{ label, route, highlight? }], settings?: { label?, prefix?,\n\t\t * route?, href?, permission?, visibleIf? }, permission?, visibleIf? }`.\n\t\t * Drawn as module cards above the link cards.\n\t\t *\n\t\t * @type {Array<object>|null}\n\t\t */\n\t\tmodules: {\n\t\t\ttype: Array,\n\t\t\tdefault: null,\n\t\t},\n\n\t\t/** `cards` (default): a grid of link cards per group. `list`: one card per group with a row per link. */\n\t\tgroupStyle: {\n\t\t\ttype: String,\n\t\t\tdefault: null,\n\t\t},\n\n\t\t/** Heading of the modules section. Defaults to \"Modules\". */\n\t\tmodulesTitle: {\n\t\t\ttype: String,\n\t\t\tdefault: null,\n\t\t},\n\n\t\t/** A note under the module cards. */\n\t\tfootnote: {\n\t\t\ttype: String,\n\t\t\tdefault: null,\n\t\t},\n\n\t\t/**\n\t\t * A closing card: `{ label?, badge?: { label, icon? }, text?, link?: { label,\n\t\t * route?, href? }, title?, subtitle?, facts?: [{ label, value, note?, visibleIf? }],\n\t\t * permission?, visibleIf? }`. Every string is translated, then\n\t\t * `{runtime.<path>}` is filled from the manifest's `runtime`.\n\t\t *\n\t\t * @type {object|null}\n\t\t */\n\t\tpanel: {\n\t\t\ttype: Object,\n\t\t\tdefault: null,\n\t\t},\n\n\t\t/** Text shown when no card is visible. */\n\t\temptyLabel: {\n\t\t\ttype: String,\n\t\t\tdefault: null,\n\t\t},\n\n\t\t/**\n\t\t * Translate function. Falls back to the injected `cnTranslate`.\n\t\t *\n\t\t * @type {((key: string) => string)|null}\n\t\t */\n\t\ttranslate: {\n\t\t\ttype: Function,\n\t\t\tdefault: null,\n\t\t},\n\t},\n\n\tdata() {\n\t\tlinkCardsPageUid += 1\n\t\treturn {\n\t\t\tuid: linkCardsPageUid,\n\t\t\tstatusData: {},\n\t\t}\n\t},\n\n\tcomputed: {\n\t\t/**\n\t\t * Whether the app takes the board look (`cnLook` is `board`).\n\t\t *\n\t\t * @spec openspec/changes/links-page-board-header/specs/links-page-board-header/spec.md#requirement-a-board-links-page-draws-the-page-header\n\t\t * @return {boolean}\n\t\t */\n\t\tisBoardLook() {\n\t\t\treturn normalizeLook(this.cnLook) === 'board'\n\t\t},\n\n\t\t/**\n\t\t * The config, from the flattened props or from `page.config`. Props win.\n\t\t *\n\t\t * @return {object} The config.\n\t\t * @spec openspec/changes/link-cards-page/specs/link-cards-page/spec.md#requirement-a-links-page-renders-grouped-link-cards\n\t\t */\n\t\tconfig() {\n\t\t\tconst fromPage = (this.page && this.page.config) || {}\n\t\t\tconst fromProps = {}\n\t\t\tfor (const key of ['cards', 'categories', 'description', 'title', 'emptyLabel', 'modules', 'modulesTitle', 'footnote', 'groupStyle', 'panel']) {\n\t\t\t\tif (this[key] !== null && this[key] !== undefined) {\n\t\t\t\t\tfromProps[key] = this[key]\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn { ...fromPage, ...fromProps }\n\t\t},\n\n\t\t/**\n\t\t * The heading, translated.\n\t\t *\n\t\t * @return {string} The title, or '' when the page declares none.\n\t\t * @spec openspec/changes/link-cards-page/specs/link-cards-page/spec.md#requirement-a-links-page-renders-grouped-link-cards\n\t\t */\n\t\tresolvedTitle() {\n\t\t\treturn this.tr(this.config.title || (this.page && this.page.title) || '')\n\t\t},\n\n\t\t/**\n\t\t * The lead paragraph, translated.\n\t\t *\n\t\t * @return {string} The description.\n\t\t * @spec openspec/changes/link-cards-page/specs/link-cards-page/spec.md#requirement-a-links-page-renders-grouped-link-cards\n\t\t */\n\t\tresolvedDescription() {\n\t\t\treturn this.tr(this.config.description || '')\n\t\t},\n\n\t\t/**\n\t\t * The empty-state text.\n\t\t *\n\t\t * @return {string} The text.\n\t\t * @spec openspec/changes/link-cards-page/specs/link-cards-page/spec.md#requirement-a-links-page-renders-grouped-link-cards\n\t\t */\n\t\tresolvedEmptyLabel() {\n\t\t\treturn this.config.emptyLabel ? this.tr(this.config.emptyLabel) : t('nextcloud-vue', 'Nothing to open here.')\n\t\t},\n\n\t\t/**\n\t\t * The cards a reader may see and can open, with text translated and\n\t\t * the link resolved. A card that is gated away, or has no target that\n\t\t * resolves, is left out: a card that does nothing is worse than none.\n\t\t *\n\t\t * @return {Array<object>} The cards.\n\t\t * @spec openspec/changes/link-cards-page/specs/link-cards-page/spec.md#requirement-a-card-is-a-real-link\n\t\t */\n\t\tvisibleCards() {\n\t\t\tconst declared = Array.isArray(this.config.cards) ? this.config.cards : []\n\t\t\tconst runtime = this.cnManifest?.runtime ?? null\n\t\t\treturn declared\n\t\t\t\t.filter((card) => card && card.id && card.label)\n\t\t\t\t.filter((card) => this.passesPermission(card) && this.passesVisibleIf(card, runtime))\n\t\t\t\t.map((card) => {\n\t\t\t\t\tconst target = this.targetOf(card)\n\t\t\t\t\treturn {\n\t\t\t\t\t\tid: String(card.id),\n\t\t\t\t\t\tlabel: this.tr(card.label),\n\t\t\t\t\t\tdescription: this.tr(card.description || ''),\n\t\t\t\t\t\tdescriptionId: `cn-link-card-desc-${this.uid}-${String(card.id).replace(/[^A-Za-z0-9_-]/g, '-')}`,\n\t\t\t\t\t\ticon: card.icon || '',\n\t\t\t\t\t\tcategory: card.category || '',\n\t\t\t\t\t\tstatus: card.status ?? null,\n\t\t\t\t\t\tstatusValues: card.statusValues && typeof card.statusValues === 'object' ? card.statusValues : null,\n\t\t\t\t\t\texternal: target.external,\n\t\t\t\t\t\tlocation: target.location,\n\t\t\t\t\t\turl: target.url,\n\t\t\t\t\t\taction: target.action || '',\n\t\t\t\t\t}\n\t\t\t\t})\n\t\t\t\t.filter((card) => card.url !== '')\n\t\t},\n\n\t\t/**\n\t\t * The modules a reader may see, with text translated and links\n\t\t * resolved. `enabled` is the declared boolean, or the result of\n\t\t * `enabledIf` (a visibleIf condition against `runtime`). A page that\n\t\t * resolves to nothing is dropped; the admin-settings link only shows when\n\t\t * its own `permission` and `visibleIf` pass.\n\t\t *\n\t\t * @return {Array<object>} The modules.\n\t\t * @spec openspec/changes/screens-links-module-cards/specs/link-cards-page/spec.md#requirement-a-links-page-can-show-modules\n\t\t */\n\t\tvisibleModules() {\n\t\t\tconst declared = Array.isArray(this.config.modules) ? this.config.modules : []\n\t\t\tconst runtime = this.cnManifest?.runtime ?? null\n\t\t\treturn declared\n\t\t\t\t.filter((module) => module && module.id && module.label)\n\t\t\t\t.filter((module) => this.passesPermission(module) && this.passesVisibleIf(module, runtime))\n\t\t\t\t.map((module) => {\n\t\t\t\t\tconst pages = (Array.isArray(module.pages) ? module.pages : [])\n\t\t\t\t\t\t.filter((page) => page && page.label)\n\t\t\t\t\t\t.map((page, index) => ({ key: String(index), label: this.tr(page.label), highlight: page.highlight === true, ...this.targetOf(page) }))\n\t\t\t\t\t\t.filter((page) => page.url !== '')\n\t\t\t\t\tconst own = this.targetOf(module)\n\t\t\t\t\tconst open = own.url !== '' ? own : (pages[0] || null)\n\t\t\t\t\tconst settingsDeclared = module.settings && typeof module.settings === 'object' ? module.settings : null\n\t\t\t\t\tconst settingsTarget = settingsDeclared && this.passesPermission(settingsDeclared) && this.passesVisibleIf(settingsDeclared, runtime)\n\t\t\t\t\t\t? this.targetOf(settingsDeclared)\n\t\t\t\t\t\t: null\n\t\t\t\t\treturn {\n\t\t\t\t\t\tid: String(module.id),\n\t\t\t\t\t\tkey: String(module.id).replace(/[^A-Za-z0-9_-]/g, '-'),\n\t\t\t\t\t\tlabel: this.tr(module.label),\n\t\t\t\t\t\tdescription: this.tr(module.description || ''),\n\t\t\t\t\t\ticon: module.icon || '',\n\t\t\t\t\t\tenabled: this.moduleEnabled(module, runtime),\n\t\t\t\t\t\tpages,\n\t\t\t\t\t\topen,\n\t\t\t\t\t\tsettings: settingsTarget && settingsTarget.url !== ''\n\t\t\t\t\t\t\t? { ...settingsTarget, label: this.tr(settingsDeclared.label || ''), prefix: this.tr(settingsDeclared.prefix || '') }\n\t\t\t\t\t\t\t: null,\n\t\t\t\t\t}\n\t\t\t\t})\n\t\t},\n\n\t\t/**\n\t\t * Whether the groups are drawn as list cards (`config.groupStyle: \"list\"`).\n\t\t *\n\t\t * @return {boolean} True for list cards.\n\t\t * @spec openspec/changes/screens-links-module-cards/specs/link-cards-page/spec.md#requirement-a-group-can-be-a-list-card\n\t\t */\n\t\tisListStyle() {\n\t\t\treturn this.config.groupStyle === 'list'\n\t\t},\n\n\t\t/**\n\t\t * The modules heading, translated.\n\t\t *\n\t\t * @return {string} The heading.\n\t\t * @spec openspec/changes/screens-links-module-cards/specs/link-cards-page/spec.md#requirement-a-links-page-can-show-modules\n\t\t */\n\t\tresolvedModulesTitle() {\n\t\t\treturn this.config.modulesTitle ? this.tr(this.config.modulesTitle) : t('nextcloud-vue', 'Modules')\n\t\t},\n\n\t\t/**\n\t\t * \"3 of 6 are in the menu\".\n\t\t *\n\t\t * @return {string} The count.\n\t\t * @spec openspec/changes/screens-links-module-cards/specs/link-cards-page/spec.md#requirement-a-links-page-can-show-modules\n\t\t */\n\t\tmodulesCount() {\n\t\t\tconst on = this.visibleModules.filter((module) => module.enabled).length\n\t\t\treturn n('nextcloud-vue', '{on} of %n is in the menu', '{on} of %n are in the menu', this.visibleModules.length, { on })\n\t\t},\n\n\t\t/**\n\t\t * The note under the module cards, translated.\n\t\t *\n\t\t * @return {string} The note, or ''.\n\t\t * @spec openspec/changes/screens-links-module-cards/specs/link-cards-page/spec.md#requirement-a-links-page-can-show-modules\n\t\t */\n\t\tresolvedFootnote() {\n\t\t\treturn this.tr(this.config.footnote || '')\n\t\t},\n\n\t\t/**\n\t\t * The closing panel, translated and filled, or null when none is\n\t\t * declared or it is gated away. A fact gated by its own `visibleIf`\n\t\t * is left out.\n\t\t *\n\t\t * @return {object|null} The panel.\n\t\t * @spec openspec/changes/link-cards-status-and-panel/specs/link-cards-page/spec.md#requirement-a-links-page-can-close-with-a-panel\n\t\t * @spec openspec/changes/link-cards-settings-action/specs/link-cards-page/spec.md#requirement-the-panel-badge-takes-a-tone\n\t\t */\n\t\tresolvedPanel() {\n\t\t\tconst panel = this.config.panel\n\t\t\tif (!panel || typeof panel !== 'object') {\n\t\t\t\treturn null\n\t\t\t}\n\t\t\tconst runtime = this.cnManifest?.runtime ?? null\n\t\t\tif (!this.passesPermission(panel) || !this.passesVisibleIf(panel, runtime)) {\n\t\t\t\treturn null\n\t\t\t}\n\t\t\tconst fill = (value) => fillRuntime(this.tr(value || ''), runtime)\n\t\t\tconst linkTarget = panel.link && typeof panel.link === 'object' ? this.targetOf(panel.link) : null\n\t\t\tconst facts = (Array.isArray(panel.facts) ? panel.facts : [])\n\t\t\t\t.filter((fact) => fact && fact.label && this.passesVisibleIf(fact, runtime))\n\t\t\t\t.map((fact, index) => ({ key: String(index), label: fill(fact.label), value: fill(fact.value), note: fill(fact.note) }))\n\t\t\treturn {\n\t\t\t\tlabel: fill(panel.label),\n\t\t\t\tbadge: panel.badge ? fill(panel.badge.label) : '',\n\t\t\t\tbadgeIcon: panel.badge?.icon || '',\n\t\t\t\tbadgeTone: BADGE_TONES.includes(panel.badge?.tone) ? panel.badge.tone : 'primary',\n\t\t\t\ttext: fill(panel.text),\n\t\t\t\tlink: linkTarget && linkTarget.url !== '' ? { ...linkTarget, label: fill(panel.link.label) } : null,\n\t\t\t\ttitle: fill(panel.title),\n\t\t\t\tsubtitle: fill(panel.subtitle),\n\t\t\t\tfacts,\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * The groups to draw: ungrouped cards first under no caption, then\n\t\t * one group per category in declaration order. A group without a\n\t\t * visible card is left out.\n\t\t *\n\t\t * @return {Array<{key: string, label: string, headingId: string, cards: Array<object>}>} The groups.\n\t\t * @spec openspec/changes/link-cards-page/specs/link-cards-page/spec.md#requirement-a-links-page-renders-grouped-link-cards\n\t\t */\n\t\tgroups() {\n\t\t\tconst declared = (this.config.categories && typeof this.config.categories === 'object') ? this.config.categories : {}\n\t\t\tconst keys = Object.keys(declared)\n\t\t\tconst loose = this.visibleCards.filter((card) => !keys.includes(card.category))\n\t\t\tconst groups = loose.length > 0 ? [{ key: '', label: '', headingId: '', cards: loose }] : []\n\t\t\tkeys.forEach((key, index) => {\n\t\t\t\tconst cards = this.visibleCards.filter((card) => card.category === key)\n\t\t\t\tif (cards.length > 0) {\n\t\t\t\t\tgroups.push({\n\t\t\t\t\t\tkey,\n\t\t\t\t\t\tlabel: this.tr(declared[key]),\n\t\t\t\t\t\theadingId: `cn-link-cards-group-${this.uid}-${index}`,\n\t\t\t\t\t\tcards,\n\t\t\t\t\t})\n\t\t\t\t}\n\t\t\t})\n\t\t\treturn groups\n\t\t},\n\t},\n\n\twatch: {\n\t\tvisibleCards: {\n\t\t\thandler() {\n\t\t\t\tthis.loadStatusValues()\n\t\t\t},\n\n\t\t\timmediate: true,\n\t\t},\n\t},\n\n\tmethods: {\n\t\t/**\n\t\t * A card's status line, translated, with `{name}` filled from its\n\t\t * `statusValues` and `{runtime.<path>}` from the manifest's `runtime`.\n\t\t * A status that still waits on a value it names is not shown.\n\t\t *\n\t\t * @param {object} card The resolved card.\n\t\t * @return {string} The status, or ''.\n\t\t * @spec openspec/changes/link-cards-status-and-panel/specs/link-cards-page/spec.md#requirement-a-link-card-can-carry-a-status\n\t\t */\n\t\tstatusOf(card) {\n\t\t\tconst { text } = this.statusVariant(card)\n\t\t\tif (typeof text !== 'string' || text === '') {\n\t\t\t\treturn ''\n\t\t\t}\n\t\t\tconst values = this.statusData[card.id] || {}\n\t\t\tlet waiting = false\n\t\t\tconst filled = this.tr(text).replace(/\\{([A-Za-z0-9_]+)\\}/g, (match, name) => {\n\t\t\t\tif (!card.statusValues || !Object.hasOwn(card.statusValues, name)) {\n\t\t\t\t\treturn match\n\t\t\t\t}\n\t\t\t\tif (values[name] === undefined || values[name] === null) {\n\t\t\t\t\twaiting = true\n\t\t\t\t\treturn match\n\t\t\t\t}\n\t\t\t\treturn String(values[name])\n\t\t\t})\n\t\t\treturn waiting ? '' : fillRuntime(filled, this.cnManifest?.runtime ?? null)\n\t\t},\n\n\t\t/**\n\t\t * Which form of a card's status applies: `zero` when the counted value\n\t\t * (`status.countOf`, else the first of `statusValues`) is 0, `plural`\n\t\t * when it is not 1, else the status itself.\n\t\t *\n\t\t * @param {object} card The resolved card.\n\t\t * @return {{text: string, tone: string}} The text and its tone.\n\t\t * @spec openspec/changes/link-cards-status-and-panel/specs/link-cards-page/spec.md#requirement-a-link-card-can-carry-a-status\n\t\t */\n\t\tstatusVariant(card) {\n\t\t\tconst declared = card.status\n\t\t\tif (typeof declared === 'string') {\n\t\t\t\treturn { text: declared, tone: 'neutral' }\n\t\t\t}\n\t\t\tif (!declared || typeof declared !== 'object') {\n\t\t\t\treturn { text: '', tone: 'neutral' }\n\t\t\t}\n\t\t\tconst names = card.statusValues ? Object.keys(card.statusValues) : []\n\t\t\tconst counted = (this.statusData[card.id] || {})[declared.countOf || names[0]]\n\t\t\tconst zero = declared.zero\n\t\t\tif (counted === 0 && zero) {\n\t\t\t\treturn typeof zero === 'string' ? { text: zero, tone: 'neutral' } : { text: zero.text, tone: statusToneOf(zero) }\n\t\t\t}\n\t\t\tconst text = typeof counted === 'number' && counted !== 1 && declared.plural ? declared.plural : declared.text\n\t\t\treturn { text, tone: statusToneOf(declared) }\n\t\t},\n\n\t\t/**\n\t\t * Fetch the numbers the cards' status lines name. A source is an\n\t\t * aggregate descriptor (`{ register, schema, metric?, field?, filter? }`)\n\t\t * or `{ url, path? }`, a GET whose JSON holds the number at `path`\n\t\t * (default `total`; a list counts its items, those matching `where`\n\t\t * when given). A failed\n\t\t * fetch leaves that status out.\n\t\t *\n\t\t * @return {Promise<void>}\n\t\t * @spec openspec/changes/link-cards-status-and-panel/specs/link-cards-page/spec.md#requirement-a-link-card-can-carry-a-status\n\t\t */\n\t\tasync loadStatusValues() {\n\t\t\tfor (const card of this.visibleCards) {\n\t\t\t\tif (!card.statusValues || this.statusData[card.id]) {\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\t\t\t\tthis.statusData = { ...this.statusData, [card.id]: {} }\n\t\t\t\tfor (const [name, source] of Object.entries(card.statusValues)) {\n\t\t\t\t\tlet value\n\t\t\t\t\ttry {\n\t\t\t\t\t\tvalue = await fetchStatusValue(source)\n\t\t\t\t\t} catch {\n\t\t\t\t\t\tvalue = null\n\t\t\t\t\t}\n\t\t\t\t\tthis.statusData = { ...this.statusData, [card.id]: { ...this.statusData[card.id], [name]: value } }\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * Whether a module is in the menu: its `enabled` boolean, else its\n\t\t * `enabledIf` condition evaluated as a `visibleIf`, else false.\n\t\t *\n\t\t * @param {object} module The declared module.\n\t\t * @param {object|null} runtime `manifest.runtime`, or null.\n\t\t * @return {boolean} True when the module is in the menu.\n\t\t * @spec openspec/changes/screens-links-module-cards/specs/link-cards-page/spec.md#requirement-a-links-page-can-show-modules\n\t\t */\n\t\t/**\n\t\t * The icon at the end of a list row: an external-link icon for a URL,\n\t\t * a chevron for a page in the app. A resolved `trailing` wins.\n\t\t *\n\t\t * @param {object} card The resolved card.\n\t\t * @return {string} `external` or `chevron`.\n\t\t * @spec openspec/changes/screens-links-module-cards/specs/link-cards-page/spec.md#requirement-a-group-can-be-a-list-card\n\t\t */\n\t\ttrailingOf(card) {\n\t\t\tif (card.trailing === 'external' || card.trailing === 'chevron') {\n\t\t\t\treturn card.trailing\n\t\t\t}\n\t\t\treturn card.external ? 'external' : 'chevron'\n\t\t},\n\n\t\tmoduleEnabled(module, runtime) {\n\t\t\tif (typeof module.enabled === 'boolean') {\n\t\t\t\treturn module.enabled\n\t\t\t}\n\t\t\tif (module.enabledIf && typeof module.enabledIf === 'object') {\n\t\t\t\treturn this.passesVisibleIf({ visibleIf: module.enabledIf }, runtime)\n\t\t\t}\n\t\t\treturn false\n\t\t},\n\n\t\t/**\n\t\t * Translate a manifest string through the app's translate function.\n\t\t *\n\t\t * @param {string} value The declared string.\n\t\t * @return {string} The translation, or the input unchanged.\n\t\t * @spec openspec/changes/link-cards-page/specs/link-cards-page/spec.md#requirement-a-links-page-renders-grouped-link-cards\n\t\t */\n\t\ttr(value) {\n\t\t\tif (typeof value !== 'string' || value === '') {\n\t\t\t\treturn value\n\t\t\t}\n\t\t\treturn (this.translate ?? this.cnTranslate)(value)\n\t\t},\n\n\t\t/**\n\t\t * Whether the user holds the card's `permission`. Same rule as the\n\t\t * menu: no permission declared, or no permissions known, allows.\n\t\t *\n\t\t * @param {object} card The card.\n\t\t * @return {boolean} True when the card may render.\n\t\t * @spec openspec/changes/link-cards-page/specs/link-cards-page/spec.md#requirement-cards-honour-menu-visibility-conditions\n\t\t */\n\t\tpassesPermission(card) {\n\t\t\tconst held = Array.isArray(this.cnPermissions) ? this.cnPermissions : []\n\t\t\tif (!card.permission || held.length === 0) {\n\t\t\t\treturn true\n\t\t\t}\n\t\t\treturn held.includes(card.permission)\n\t\t},\n\n\t\t/**\n\t\t * Evaluate a card's `visibleIf` the way CnAppNav evaluates a menu\n\t\t * entry's: `appInstalled` first, then dot-path predicates against\n\t\t * the manifest's `runtime`.\n\t\t *\n\t\t * @param {object} card The card.\n\t\t * @param {object|null} runtime `manifest.runtime`, or null.\n\t\t * @return {boolean} True when the card may render.\n\t\t * @spec openspec/changes/link-cards-page/specs/link-cards-page/spec.md#requirement-cards-honour-menu-visibility-conditions\n\t\t */\n\t\tpassesVisibleIf(card, runtime) {\n\t\t\tconst condition = card.visibleIf\n\t\t\tif (!condition || typeof condition !== 'object') {\n\t\t\t\treturn true\n\t\t\t}\n\t\t\tif (condition.appInstalled && !isAppInstalled(condition.appInstalled)) {\n\t\t\t\treturn false\n\t\t\t}\n\t\t\treturn passesContextPredicates(condition, runtime)\n\t\t},\n\n\t\t/**\n\t\t * Where a card goes. An `href` is an external URL. A `route` is a\n\t\t * route name, or a path when it starts with `/`, resolved by the\n\t\t * router so the link carries the app's base with or without\n\t\t * `/index.php`. `action: \"user-settings\"` opens the user settings\n\t\t * dialog, and resolves only inside a host that offers it.\n\t\t *\n\t\t * @param {object} card The card.\n\t\t * @return {{external: boolean, location: object|null, url: string, action?: string}} The target; `url` is '' when it cannot be resolved.\n\t\t * @spec openspec/changes/link-cards-page/specs/link-cards-page/spec.md#requirement-a-card-is-a-real-link\n\t\t * @spec openspec/changes/link-cards-settings-action/specs/link-cards-page/spec.md#requirement-a-link-card-can-open-the-user-settings\n\t\t */\n\t\ttargetOf(card) {\n\t\t\tif (card.action === 'user-settings') {\n\t\t\t\treturn typeof this.cnOpenUserSettings === 'function'\n\t\t\t\t\t? { external: false, location: null, url: '#', action: card.action }\n\t\t\t\t\t: { external: false, location: null, url: '' }\n\t\t\t}\n\t\t\tif (typeof card.route === 'string' && card.route !== '') {\n\t\t\t\tconst location = card.route.startsWith('/') ? { path: card.route } : { name: card.route }\n\t\t\t\tif (card.params && typeof card.params === 'object') {\n\t\t\t\t\tlocation.params = card.params\n\t\t\t\t}\n\t\t\t\tif (card.query && typeof card.query === 'object') {\n\t\t\t\t\tlocation.query = card.query\n\t\t\t\t}\n\t\t\t\treturn { external: false, location, url: resolveHref(location, this.$router) }\n\t\t\t}\n\t\t\tif (typeof card.href === 'string' && card.href !== '') {\n\t\t\t\treturn { external: true, location: null, url: card.href }\n\t\t\t}\n\t\t\treturn { external: false, location: null, url: '' }\n\t\t},\n\n\t\t/**\n\t\t * Route a plain click on an in-app card. A modified or middle click,\n\t\t * and every click on an external card, is left to the browser. A\n\t\t * settings card opens the user settings dialog, on a click or on the\n\t\t * space key, as a button does.\n\t\t *\n\t\t * @param {object} card The resolved card.\n\t\t * @param {MouseEvent|KeyboardEvent} event The click or key press.\n\t\t * @return {void}\n\t\t * @spec openspec/changes/link-cards-page/specs/link-cards-page/spec.md#requirement-a-card-is-a-real-link\n\t\t * @spec openspec/changes/link-cards-settings-action/specs/link-cards-page/spec.md#requirement-a-link-card-can-open-the-user-settings\n\t\t */\n\t\topen(card, event) {\n\t\t\tif (card.action === 'user-settings') {\n\t\t\t\tevent.preventDefault()\n\t\t\t\tthis.cnOpenUserSettings()\n\t\t\t\treturn\n\t\t\t}\n\t\t\tif (event.type === 'keydown') {\n\t\t\t\treturn\n\t\t\t}\n\t\t\tif (card.external || !card.location) {\n\t\t\t\treturn\n\t\t\t}\n\t\t\tfollowLinkClick(event, card.location, this.$router)\n\t\t},\n\t},\n}\n</script>\n\n<style scoped>\n.cn-link-cards-page {\n\tdisplay: flex;\n\tflex-direction: column;\n\tgap: calc(6 * var(--default-grid-baseline));\n\tpadding: calc(5 * var(--default-grid-baseline));\n}\n\n/* Clear the Nextcloud navigation toggle button (44px wide, absolutely\n positioned at the left edge of .app-content) plus 12px breathing room, as\n CnPageHeader does. Only the header shifts; the cards keep the full width. */\n.cn-link-cards-page__header {\n\tpadding-inline-start: 56px;\n}\n\n.cn-link-cards-page__title {\n\tmargin: 0 0 var(--default-grid-baseline);\n}\n\n/* Board look: the boards' page header (PqModules): the title as a 28px h1\n with the buildiq square at the end of its row, the 15px line 6px under it,\n 4px above and 8px under the header; the sections 20px apart.\n @spec openspec/changes/links-page-board-header/specs/links-page-board-header/spec.md#requirement-a-board-links-page-draws-the-page-header */\n.cn-link-cards-page--board {\n\tgap: 20px;\n}\n\n.cn-link-cards-page--board .cn-link-cards-page__header {\n\tdisplay: flex;\n\tflex-direction: column;\n\tgap: 6px;\n\tpadding: 4px 0 8px;\n}\n\n.cn-link-cards-page--board .cn-link-cards-page__title-row {\n\tdisplay: flex;\n\tflex-wrap: wrap;\n\tjustify-content: space-between;\n\talign-items: flex-start;\n\tgap: 12px 24px;\n}\n\n.cn-link-cards-page--board .cn-link-cards-page__title {\n\tflex: 1 1 320px;\n\tmin-width: 0;\n\tmargin: 0;\n\tfont-size: 28px;\n\tfont-weight: 700;\n\tline-height: 1.2;\n}\n\n.cn-link-cards-page--board .cn-link-cards-page__header-actions {\n\tflex: none;\n\tdisplay: flex;\n\tflex-wrap: wrap;\n\tgap: 10px;\n}\n\n.cn-link-cards-page--board .cn-link-cards-page__description {\n\tmax-width: none;\n\tfont-size: 15px;\n}\n\n.cn-link-cards-page__description,\n.cn-link-cards-page__empty {\n\tcolor: var(--color-text-maxcontrast);\n\tmargin: 0;\n\tmax-width: 70ch;\n}\n\n.cn-link-cards-page__group {\n\tdisplay: flex;\n\tflex-direction: column;\n\tgap: calc(3 * var(--default-grid-baseline));\n}\n\n.cn-link-cards-page__caption {\n\tcolor: var(--color-text-maxcontrast);\n\tfont-size: 0.85em;\n\tfont-weight: 600;\n\tletter-spacing: 0.06em;\n\tmargin: 0;\n\ttext-transform: uppercase;\n}\n\n.cn-link-cards-page__grid {\n\tdisplay: grid;\n\tgap: calc(3 * var(--default-grid-baseline));\n\tgrid-template-columns: repeat(auto-fill, minmax(240px, 1fr));\n\tlist-style: none;\n\tmargin: 0;\n\tpadding: 0;\n}\n\n.cn-link-cards-page__cell {\n\tdisplay: flex;\n}\n\n.cn-link-cards-page__card {\n\talign-items: flex-start;\n\tbackground: var(--color-main-background);\n\tborder: 1px solid var(--color-border-dark);\n\tborder-radius: var(--border-radius-large);\n\tcolor: var(--color-main-text);\n\tdisplay: flex;\n\tflex: 1;\n\tgap: calc(3 * var(--default-grid-baseline));\n\tmin-width: 0;\n\tpadding: calc(4 * var(--default-grid-baseline));\n\ttransition: background-color var(--animation-quick, 100ms) ease, border-color var(--animation-quick, 100ms) ease, box-shadow var(--animation-quick, 100ms) ease;\n}\n\n/* A card is a link, and it must not look like a line of prose. A theme may\n underline every link with `!important` (thematiq: `a { text-decoration:\n underline !important }`, specificity 0,0,1). Among `!important` rules the\n higher specificity wins, so this class rule has to carry it too; without it\n the label and the description both rendered underlined on a live Nextcloud. */\n.cn-link-cards-page__card,\n.cn-link-cards-page__card:hover,\n.cn-link-cards-page__card:focus,\n.cn-link-cards-page__card:active {\n\ttext-decoration: none !important;\n}\n\n/* Hover moves the whole card: border, background and a soft lift. */\n.cn-link-cards-page__card:hover {\n\tbackground: var(--color-background-hover);\n\tborder-color: var(--color-primary-element);\n\tbox-shadow: 0 2px 6px var(--color-box-shadow);\n}\n\n@media (prefers-reduced-motion: reduce) {\n\t.cn-link-cards-page__card {\n\t\ttransition: none;\n\t}\n}\n\n.cn-link-cards-page__card:focus-visible {\n\tborder-color: var(--color-primary-element);\n\toutline: 2px solid var(--color-primary-element);\n\toutline-offset: 2px;\n}\n\n.cn-link-cards-page__icon {\n\tcolor: var(--color-primary-element);\n\tflex: none;\n}\n\n.cn-link-cards-page__body {\n\tdisplay: flex;\n\tflex: 1 1 auto;\n\tflex-direction: column;\n\tgap: var(--default-grid-baseline);\n\tmin-width: 0;\n}\n\n.cn-link-cards-page__trailing {\n\tflex: none;\n\tcolor: var(--color-text-maxcontrast);\n}\n\n/* The label is the card's title. Its colour is set here, on the span, because\n a theme may force its link colour on the `a` itself; an inherited link\n colour made the title read as a hyperlink. */\n.cn-link-cards-page__label {\n\tcolor: var(--color-main-text);\n\tfont-size: 1.05em;\n\tfont-weight: 700;\n\tline-height: 1.3;\n\toverflow-wrap: anywhere;\n}\n\n.cn-link-cards-page__card-description {\n\tcolor: var(--color-text-maxcontrast);\n\tfont-size: 0.9em;\n\tline-height: 1.4;\n}\n\n.cn-link-cards-page__group--list {\n\tpadding: 20px 22px;\n\tborder: 1px solid var(--color-border);\n\tborder-radius: var(--border-radius-container-large, 12px);\n\tbackground: var(--color-main-background);\n\tgap: 6px;\n}\n\n.cn-link-cards-page__group--list .cn-link-cards-page__caption {\n\tmargin: 0 0 8px;\n\tcolor: var(--color-main-text);\n\tfont-size: 17px;\n\tfont-weight: 700;\n\tline-height: normal;\n\tletter-spacing: normal;\n\ttext-transform: none;\n}\n\n.cn-link-cards-page__list {\n\tmargin: 0;\n\tpadding: 0;\n\tlist-style: none;\n}\n\n/* A list row is a link the boards draw in the main ink; the row hands the\n theme's link rule (`!important`) that ink. */\n.cn-link-cards-page__row {\n\t--nldesign-color-on-surface: var(--color-main-text);\n\t--nldesign-component-link-color: var(--color-main-text);\n\tdisplay: flex;\n\talign-items: center;\n\tgap: 12px;\n\tpadding: 10px 0;\n\tborder-top: 1px solid var(--color-background-dark);\n\tcolor: var(--color-main-text);\n}\n\n.cn-link-cards-page__row,\n.cn-link-cards-page__row:hover,\n.cn-link-cards-page__row:focus,\n.cn-link-cards-page__row:active {\n\ttext-decoration: none !important;\n}\n\n.cn-link-cards-page__row:focus-visible {\n\toutline: 2px solid var(--color-primary-element);\n\toutline-offset: 2px;\n}\n\n.cn-link-cards-page__row-icon {\n\tdisplay: flex;\n\tflex: none;\n\talign-items: center;\n\tjustify-content: center;\n\twidth: 34px;\n\theight: 34px;\n\tborder-radius: var(--border-radius-element, 8px);\n\tbackground: var(--color-background-dark);\n}\n\n.cn-link-cards-page__row-body {\n\tdisplay: flex;\n\tflex: 1 1 auto;\n\tflex-direction: column;\n\tgap: 2px;\n\tmin-width: 0;\n}\n\n.cn-link-cards-page__row-label {\n\tfont-size: 15px;\n\tfont-weight: 600;\n}\n\n.cn-link-cards-page__row-description {\n\tfont-size: 13px;\n\tcolor: var(--color-text-maxcontrast);\n}\n\n.cn-link-cards-page__row-trailing {\n\tflex: none;\n\tcolor: var(--color-text-maxcontrast);\n}\n\n.cn-link-cards-page__modules {\n\tdisplay: flex;\n\tflex-direction: column;\n\tgap: 14px;\n}\n\n.cn-link-cards-page__modules-head {\n\tdisplay: flex;\n\tflex-wrap: wrap;\n\tjustify-content: space-between;\n\talign-items: baseline;\n\tgap: 8px;\n}\n\n.cn-link-cards-page__modules-title {\n\tmargin: 0;\n\tfont-size: 20px;\n\tfont-weight: 700;\n}\n\n.cn-link-cards-page__modules-count {\n\tfont-size: 14px;\n\tcolor: var(--color-text-maxcontrast);\n}\n\n.cn-link-cards-page__modules-grid {\n\tdisplay: grid;\n\tgrid-template-columns: repeat(auto-fill, minmax(260px, 1fr));\n\tgap: 16px;\n}\n\n.cn-link-cards-page__modules-note {\n\tdisplay: flex;\n\talign-items: flex-start;\n\tgap: 8px;\n\tmargin: 0;\n\tfont-size: 14px;\n\tcolor: var(--color-text-maxcontrast);\n}\n\n.cn-link-cards-page__modules-note-icon {\n\tflex: none;\n}\n/* A card's status pill under its description (board PqGeavanceerdHub). */\n.cn-link-cards-page__status {\n\talign-self: flex-start;\n\tbackground: var(--color-background-dark, #f0f1f3);\n\tborder-radius: 12px;\n\tcolor: var(--color-main-text);\n\tdisplay: inline-block;\n\tfont-size: 13px;\n\tfont-weight: 600;\n\tpadding: 3px 10px;\n}\n\n.cn-link-cards-page__status--error {\n\tbackground: var(--color-error-light, #fcedec);\n\tcolor: var(--color-error-text, #a30000);\n}\n\n.cn-link-cards-page__status--warning {\n\tbackground: var(--color-warning-light, #fff4de);\n\tcolor: var(--color-warning-text, #7a4f00);\n}\n\n.cn-link-cards-page__status--success {\n\tbackground: var(--color-success-light, #e7f3ea);\n\tcolor: var(--color-success-text, #1e6b2a);\n}\n\n/* The closing panel: a lead column (badge, paragraph, link) beside a titled\n list of facts, wrapping under each other on a narrow screen. */\n.cn-link-cards-page__panel {\n\tbackground: var(--color-main-background);\n\tborder: 1px solid var(--color-border-dark);\n\tborder-radius: var(--border-radius-large);\n\tdisplay: flex;\n\tflex-wrap: wrap;\n\tgap: 24px;\n\tpadding: 22px;\n}\n\n.cn-link-cards-page__panel-lead {\n\tdisplay: flex;\n\tflex: 1 1 280px;\n\tflex-direction: column;\n\tgap: 10px;\n}\n\n.cn-link-cards-page__panel-badge {\n\talign-items: center;\n\talign-self: flex-start;\n\tbackground: var(--color-primary-element-light);\n\tborder-radius: 12px;\n\tcolor: var(--color-primary-element-light-text);\n\tdisplay: inline-flex;\n\tfont-size: 13px;\n\tfont-weight: 600;\n\tgap: 6px;\n\tline-height: normal;\n\tpadding: 3px 10px;\n}\n\n.cn-link-cards-page__panel-badge--purple {\n\tbackground: var(--cn-status-purple-bg);\n\tcolor: var(--cn-status-purple-text);\n}\n\n.cn-link-cards-page__panel-text {\n\tline-height: 1.5;\n\tmargin: 0;\n}\n\n.cn-link-cards-page__panel-link {\n\tfont-size: 14px;\n\tfont-weight: 600;\n}\n\n.cn-link-cards-page__panel-facts {\n\tdisplay: flex;\n\tflex: 1 1 380px;\n\tflex-direction: column;\n\tgap: 12px;\n}\n\n.cn-link-cards-page__panel-title {\n\tfont-size: 18px;\n\tfont-weight: 700;\n\tmargin: 0;\n}\n\n.cn-link-cards-page__panel-subtitle,\n.cn-link-cards-page__panel-list dt,\n.cn-link-cards-page__panel-note {\n\tcolor: var(--color-text-maxcontrast);\n}\n\n.cn-link-cards-page__panel-subtitle {\n\tfont-size: 14px;\n}\n\n.cn-link-cards-page__panel-list {\n\tdisplay: grid;\n\tgap: 8px 16px;\n\tgrid-template-columns: max-content 1fr;\n\tmargin: 0;\n}\n\n.cn-link-cards-page__panel-list dd {\n\tfont-weight: 600;\n\tmargin: 0;\n}\n\n.cn-link-cards-page__panel-note {\n\tdisplay: block;\n\tfont-size: 13px;\n\tfont-weight: 400;\n}\n</style>\n"],"names":["_createElementBlock","_normalizeClass","_openBlock","_toDisplayString","_createElementVNode","_createVNode","_Fragment","_renderList","_createBlock","_withKeys"],"mappings":";;AAgBO,MAAA,UAAA,GAAA,EAAA,KAAK,EAAC,4BAA4B,GAAA;;;AACd,EAAA,KAAA,EAAA,+BAAA;;;;AAClB,EAAA,KAAA,EAAA,2BAAA;;AAGA,MAAA,UAAA,GAAA,EAAA,KAAK,EAAC,oCAAO,GAAA;;;AAIhB,EAAA,KAAA,EAAA,2BAAA;;;;AAGG,EAAA,KAAA,EAAA,iCAAA;;;AAUD,MAAA,UAAA,GAAA,EAAA,KAAK,EAAC,kCAAQ,GAAA;;;AAIZ,EAAA,KAAK,EAAC,mCAAA;AAAA,EAAA,aAAA,EAAA,6BAAA;;AAIR,MAAA,WAAA,GAAA,EAAA,KAAK,EAAC,kCAAkC,GAAA;;;;;;;;AAe7C,EAAA,KAAK,EAAC,2BAAA;AACN,EAAA,aAAW,EAAA,qBAAW;;;;;;AAsBC,EAAA,KAAE,EAAA,0BAAA;;;;;AAajB,EAAA,KAAA,EAAA,8BAAA;AAAA,EAAA,aAAA,EAAA,MAAA;;AAGC,MAAA,WAAA,GAAA,EAAA,KAAK,EAAC,8BAA8B,GAAA;AACnC,MAAA,WAAA,GAAA,EAAA,KAAK,EAAC,+BAAU,GAAA;;;;AAavB,EAAA,KAAA,EAAA,0BAAA;;;AAsBM,MAAA,WAAA,GAAA,EAAA,KAAK,EAAC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,CAAA,aAAa,CAAC,QAAA;qDAEnB,mBAAA,EADHA,eAAA,CAAA,QAAA,CAAA,aAAa,CAAC,QAAQ,CAAA,EAAA,CAAA,YAAA;;iBAEhB,QAAa,CAAA,aAAA,CAAC,KAAK,CAAC,MAAM,GAAA,CAAA;AAAjC,qBAAAD,SAAA,EAAA,EAAAF,kBAAA,OAAA;mEACG,EAAA,IAAA,EAAAO,UAAA,CAAA,QAAA,CAAA,aAAA,CAAA,KAAA,GAAA,IAAA,KAAA;;AAAA,0BAAA,GAAA,EAAA,IAAA,CAAA,GAAA;;0BACJH,kBAAS,CAAA,IAAA,EAAA,IAAA,EAAAD,eAAA,CAAF,IAAE,CAAA,KAAA,CAAA,EAAA,CAAA,YAAA;AACT,0BAAAC,kBAAA,CAGA,MAHA,WAGA,EAAA;4DAFE,IAAA,CAAA,KAAA,CAAA,GAAA,GACD,EAAA,CAAA,YAAA;AAAI,4BAAA,CAAA,IAAA,CAAA,IAAA;AAAJ,iCAAAF,SAAA,EAAA,EAAAF,kBAAA,CAAI,MAAJ,EAAA,WAAI,EAAAG,eAAA,CAAA,IAAA,CAAA,IAAA,CAAA,EAAA,CAAA,YAAA;;;;;;;;;;;;;;;;"}
@@ -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-474b24a4";
5
+ script.__scopeId = "data-v-495e6034";
6
6
  const __sfc_main = script;
7
7
 
8
8
  export { __sfc_main as default };
@@ -29,6 +29,28 @@ function keyOf(value) {
29
29
  return String(value)
30
30
  }
31
31
 
32
+ /**
33
+ * The template a `templates.preselect` rule picks: `"first"` the first one,
34
+ * `"only"` the one when the list holds exactly one, `{ field, value }` the
35
+ * first whose field holds the value.
36
+ *
37
+ * @param {object[]} list The templates.
38
+ * @param {string|object} rule The rule.
39
+ * @return {object|null} The template, or null.
40
+ */
41
+ function preselectedTemplate(list, rule) {
42
+ if (rule === 'first') {
43
+ return list[0] || null
44
+ }
45
+ if (rule === 'only') {
46
+ return list.length === 1 ? list[0] : null
47
+ }
48
+ if (rule && typeof rule === 'object' && typeof rule.field === 'string') {
49
+ return list.find((item) => item && item[rule.field] === rule.value) || null
50
+ }
51
+ return null
52
+ }
53
+
32
54
  /**
33
55
  * CnMailTab — the mail of one record: drafts in Nextcloud Mail, from a
34
56
  * template or empty, above the mail linked to the record.
@@ -46,7 +68,7 @@ function keyOf(value) {
46
68
  * "heading": "Email",
47
69
  * "description": "Mail linked to this case",
48
70
  * "hint": "The draft opens in Nextcloud Mail.",
49
- * "templates": { "url": "/apps/app/api/types/@object.type/templates", "responsePath": "results", "labelField": "name", "idField": "id" },
71
+ * "templates": { "url": "/apps/app/api/types/@object.type/templates", "responsePath": "results", "labelField": "name", "idField": "id", "preselect": "first" },
50
72
  * "noTemplatesText": "No templates for this type yet",
51
73
  * "draft": { "url": "/apps/app/api/records/@objectId/templates/{templateId}/draft", "blankTemplateId": "blank" },
52
74
  * "closedWhen": { "field": "endDate", "op": "notEmpty" },
@@ -59,7 +81,10 @@ function keyOf(value) {
59
81
  * URLs take the `@objectId` / `@object.<field>` tokens of `endpointSource`;
60
82
  * `{templateId}` in the draft URL is the chosen template's id, or
61
83
  * `blankTemplateId` for an empty draft. Without `templates` the row offers
62
- * the empty draft only; without `draft` there is no row. `closedWhen` is a
84
+ * the empty draft only; without `draft` there is no row. `templates.preselect`
85
+ * picks a template when the list is read (`"first"`, `"only"` or
86
+ * `{ field, value }`), so the template draft button is ready without a pick;
87
+ * a pick still in the list is kept. `closedWhen` is a
63
88
  * local visibleWhen condition on the record that disables drafting.
64
89
  * `linkedMail: false` leaves the linked mail to a separate `email`
65
90
  * integration card. `headerActions` puts buttons beside the heading:
@@ -320,6 +345,7 @@ var script = {
320
345
  const payload = await fetchEndpointSource(this.templatesSource, this.tokenContext);
321
346
  const list = Array.isArray(payload) ? payload : (payload && Array.isArray(payload.results) ? payload.results : []);
322
347
  this.templates = list;
348
+ this.applyPreselect();
323
349
  } catch (err) {
324
350
  // eslint-disable-next-line no-console
325
351
  console.warn('[CnMailTab] could not read the templates', err);
@@ -327,6 +353,21 @@ var script = {
327
353
  }
328
354
  },
329
355
 
356
+ /**
357
+ * Keep a pick that is still in the list; otherwise select what `templates.preselect` picks.
358
+ *
359
+ * @return {void}
360
+ * @spec openspec/changes/mail-tab-template-preselect/specs/mail-tab-template-preselect/spec.md#requirement-the-mail-tab-can-preselect-a-template
361
+ */
362
+ applyPreselect() {
363
+ const idField = this.templateIdField;
364
+ const picked = this.selectedTemplate;
365
+ if (picked && this.templates.some((item) => item && item[idField] === picked[idField])) {
366
+ return
367
+ }
368
+ this.selectedTemplate = preselectedTemplate(this.templates, this.templatesSource && this.templatesSource.preselect);
369
+ },
370
+
330
371
  /** @return {Promise<void>} */
331
372
  draftFromTemplate() {
332
373
  return this.openDraft(this.selectedTemplate)
@@ -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, 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,OA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MAAM,QAAO,GAAI,GAAE,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
+ {"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 * The template a `templates.preselect` rule picks: `\"first\"` the first one,\n * `\"only\"` the one when the list holds exactly one, `{ field, value }` the\n * first whose field holds the value.\n *\n * @param {object[]} list The templates.\n * @param {string|object} rule The rule.\n * @return {object|null} The template, or null.\n */\nfunction preselectedTemplate(list, rule) {\n\tif (rule === 'first') {\n\t\treturn list[0] || null\n\t}\n\tif (rule === 'only') {\n\t\treturn list.length === 1 ? list[0] : null\n\t}\n\tif (rule && typeof rule === 'object' && typeof rule.field === 'string') {\n\t\treturn list.find((item) => item && item[rule.field] === rule.value) || null\n\t}\n\treturn null\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\", \"preselect\": \"first\" },\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. `templates.preselect`\n * picks a template when the list is read (`\"first\"`, `\"only\"` or\n * `{ field, value }`), so the template draft button is ready without a pick;\n * a pick still in the list is kept. `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\tthis.applyPreselect()\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/**\n\t\t * Keep a pick that is still in the list; otherwise select what `templates.preselect` picks.\n\t\t *\n\t\t * @return {void}\n\t\t * @spec openspec/changes/mail-tab-template-preselect/specs/mail-tab-template-preselect/spec.md#requirement-the-mail-tab-can-preselect-a-template\n\t\t */\n\t\tapplyPreselect() {\n\t\t\tconst idField = this.templateIdField\n\t\t\tconst picked = this.selectedTemplate\n\t\t\tif (picked && this.templates.some((item) => item && item[idField] === picked[idField])) {\n\t\t\t\treturn\n\t\t\t}\n\t\t\tthis.selectedTemplate = preselectedTemplate(this.templates, this.templatesSource && this.templatesSource.preselect)\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,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