@conduction/nextcloud-vue 2.64.0 → 2.66.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 (84) hide show
  1. package/dist/esm/components/CnAppNav/CnAppNav.vue2.js +99 -3
  2. package/dist/esm/components/CnAppNav/CnAppNav.vue2.js.map +1 -1
  3. package/dist/esm/components/CnAppNav/CnAppNav.vue3.js +23 -7
  4. package/dist/esm/components/CnAppNav/CnAppNav.vue3.js.map +1 -1
  5. package/dist/esm/components/CnBreadcrumbs/CnBreadcrumbs.vue2.js +13 -0
  6. package/dist/esm/components/CnBreadcrumbs/CnBreadcrumbs.vue2.js.map +1 -1
  7. package/dist/esm/components/CnBreadcrumbs/CnBreadcrumbs.vue3.js +2 -1
  8. package/dist/esm/components/CnBreadcrumbs/CnBreadcrumbs.vue3.js.map +1 -1
  9. package/dist/esm/components/CnDashboardPage/CnDashboardPage.vue2.js +125 -4
  10. package/dist/esm/components/CnDashboardPage/CnDashboardPage.vue2.js.map +1 -1
  11. package/dist/esm/components/CnDashboardPage/CnDashboardPage.vue3.js +439 -381
  12. package/dist/esm/components/CnDashboardPage/CnDashboardPage.vue3.js.map +1 -1
  13. package/dist/esm/components/CnDataTable/CnColumnFilterPopover.vue2.js +9 -3
  14. package/dist/esm/components/CnDataTable/CnColumnFilterPopover.vue2.js.map +1 -1
  15. package/dist/esm/components/CnDataTable/CnColumnFilterPopover.vue3.js +1 -1
  16. package/dist/esm/components/CnDataTable/CnColumnFilterPopover.vue3.js.map +1 -1
  17. package/dist/esm/components/CnDetailPage/CnDetailPage.vue2.js +142 -26
  18. package/dist/esm/components/CnDetailPage/CnDetailPage.vue2.js.map +1 -1
  19. package/dist/esm/components/CnDetailPage/CnDetailPage.vue3.js +195 -124
  20. package/dist/esm/components/CnDetailPage/CnDetailPage.vue3.js.map +1 -1
  21. package/dist/esm/components/CnFkResolveCell/CnFkResolveCell.vue2.js +3 -1
  22. package/dist/esm/components/CnFkResolveCell/CnFkResolveCell.vue2.js.map +1 -1
  23. package/dist/esm/components/CnFormDialog/CnFormDialog.vue2.js +144 -4
  24. package/dist/esm/components/CnFormDialog/CnFormDialog.vue2.js.map +1 -1
  25. package/dist/esm/components/CnFormDialog/CnFormDialog.vue3.js.map +1 -1
  26. package/dist/esm/components/CnHeaderWidget/CnHeaderWidget.vue2.js +84 -11
  27. package/dist/esm/components/CnHeaderWidget/CnHeaderWidget.vue2.js.map +1 -1
  28. package/dist/esm/components/CnHeaderWidget/CnHeaderWidget.vue3.js +3 -2
  29. package/dist/esm/components/CnHeaderWidget/CnHeaderWidget.vue3.js.map +1 -1
  30. package/dist/esm/components/CnSegmentedControl/CnSegmentedControl.vue2.js +11 -0
  31. package/dist/esm/components/CnSegmentedControl/CnSegmentedControl.vue2.js.map +1 -1
  32. package/dist/esm/components/CnSegmentedControl/CnSegmentedControl.vue3.js +2 -1
  33. package/dist/esm/components/CnSegmentedControl/CnSegmentedControl.vue3.js.map +1 -1
  34. package/dist/esm/components/CnStagesWidget/CnStagesWidget.vue2.js.map +1 -1
  35. package/dist/esm/components/CnStagesWidget/CnStagesWidget.vue3.js.map +1 -1
  36. package/dist/esm/components/CnStatWidget/CnStatWidget.vue2.js +22 -3
  37. package/dist/esm/components/CnStatWidget/CnStatWidget.vue2.js.map +1 -1
  38. package/dist/esm/components/CnStatWidget/CnStatWidget.vue3.js +10 -3
  39. package/dist/esm/components/CnStatWidget/CnStatWidget.vue3.js.map +1 -1
  40. package/dist/esm/l10n/en.json.js +3 -0
  41. package/dist/esm/l10n/en.json.js.map +1 -1
  42. package/dist/esm/l10n/nl.json.js +3 -0
  43. package/dist/esm/l10n/nl.json.js.map +1 -1
  44. package/dist/esm/mixins/pageViews.js +400 -0
  45. package/dist/esm/mixins/pageViews.js.map +1 -0
  46. package/dist/esm/nextcloud-vue.css +182 -0
  47. package/dist/esm/store/useObjectStore.js +118 -33
  48. package/dist/esm/store/useObjectStore.js.map +1 -1
  49. package/dist/esm/utils/actionsDispatcher.js +25 -2
  50. package/dist/esm/utils/actionsDispatcher.js.map +1 -1
  51. package/dist/esm/utils/columnFilters.js +27 -3
  52. package/dist/esm/utils/columnFilters.js.map +1 -1
  53. package/dist/esm/utils/schema.js +40 -2
  54. package/dist/esm/utils/schema.js.map +1 -1
  55. package/dist/esm/utils/validateManifestV2.compiled.js +2 -2
  56. package/dist/esm/utils/validateManifestV2.compiled.js.map +1 -1
  57. package/dist/nextcloud-vue.cjs.js +2001 -684
  58. package/dist/nextcloud-vue.cjs.js.map +2 -2
  59. package/dist/nextcloud-vue.css +182 -0
  60. package/l10n/en.json +3 -0
  61. package/l10n/nl.json +3 -0
  62. package/package.json +1 -1
  63. package/src/components/CnAppNav/CnAppNav.vue +148 -7
  64. package/src/components/CnBreadcrumbs/CnBreadcrumbs.vue +14 -0
  65. package/src/components/CnDashboardPage/CnDashboardPage.vue +194 -10
  66. package/src/components/CnDataTable/CnColumnFilterPopover.vue +11 -5
  67. package/src/components/CnDetailPage/CnDetailPage.md +5 -1
  68. package/src/components/CnDetailPage/CnDetailPage.vue +208 -11
  69. package/src/components/CnFkResolveCell/CnFkResolveCell.vue +3 -1
  70. package/src/components/CnFormDialog/CnFormDialog.vue +144 -4
  71. package/src/components/CnHeaderWidget/CnHeaderWidget.vue +100 -13
  72. package/src/components/CnSegmentedControl/CnSegmentedControl.md +1 -1
  73. package/src/components/CnSegmentedControl/CnSegmentedControl.vue +12 -0
  74. package/src/components/CnStagesWidget/CnStagesWidget.vue +9 -0
  75. package/src/components/CnStatWidget/CnStatWidget.vue +33 -5
  76. package/src/css/detail-page.css +27 -0
  77. package/src/css/kpi-card.css +47 -0
  78. package/src/mixins/pageViews.js +396 -0
  79. package/src/schemas/app-manifest-v2.schema.json +51 -2
  80. package/src/store/useObjectStore.js +118 -33
  81. package/src/utils/actionsDispatcher.js +25 -2
  82. package/src/utils/columnFilters.js +29 -2
  83. package/src/utils/schema.js +40 -2
  84. package/src/utils/validateManifestV2.compiled.js +2 -2
@@ -9,6 +9,9 @@ const ALLOWED_TEXT_ALIGN = ['left', 'center', 'right'];
9
9
  const ALLOWED_VERTICAL_ALIGN = ['top', 'middle', 'bottom'];
10
10
  const ALLOWED_CTA_STYLES = ['primary', 'secondary', 'ghost'];
11
11
 
12
+ /** Marks a switch option that selects a page view rather than a route. */
13
+ const VIEW_OPTION_PREFIX = 'view:';
14
+
12
15
  const HEIGHT_PIXELS = Object.freeze({
13
16
  small: 120,
14
17
  medium: 200,
@@ -64,6 +67,12 @@ var script = {
64
67
  * untranslated key renders as itself.
65
68
  */
66
69
  cnTranslate: { default: () => (key) => key },
70
+ /**
71
+ * The views of the page this widget sits on, provided by
72
+ * CnDashboardPage / CnDetailPage (`views`). An option with a `view`
73
+ * selects one of them. Null outside such a page.
74
+ */
75
+ cnPageViews: { default: null },
67
76
  },
68
77
 
69
78
  props: {
@@ -71,12 +80,18 @@ var script = {
71
80
  * Persisted widget content: `{title, subtitle, backgroundImageUrl,
72
81
  * backgroundImageFileId, backgroundColor, overlayMode, overlayColor,
73
82
  * overlayOpacity, textColor, textAlign, verticalAlign, height, cta,
74
- * greeting, showDate, plain, views}`. All fields are optional except
83
+ * greeting, showDate, plain, ground, views}`. All fields are optional except
75
84
  * `title` (or `greeting`); unknown enum values collapse to documented
76
85
  * defaults and the renderer never throws. `views` is
77
- * `{ ariaLabel?, options: [{ label, route, params? }] }`: a segmented
78
- * control at the right of the heading whose checked option is the
79
- * current route; choosing another pushes its route.
86
+ * `{ ariaLabel?, options: [{ label, route, params? } | { label, view }] }`:
87
+ * a segmented control at the right of the heading whose checked option
88
+ * is the current route; choosing another pushes its route. An option
89
+ * with `view` selects that view of the page the widget sits on (the
90
+ * page's `views`) instead, and the page then draws no switch of its
91
+ * own. `ground: true`
92
+ * draws the greeting on the page ground: the plain look with no
93
+ * padding, a 32px heading and the date line 6px above it (a dashboard
94
+ * also drops the widget's card for it).
80
95
  *
81
96
  * @type {object}
82
97
  */
@@ -169,12 +184,45 @@ var script = {
169
184
  */
170
185
  viewOptions() {
171
186
  const raw = this.content && this.content.views && this.content.views.options;
172
- if (!Array.isArray(raw) || !this.$router) {
187
+ if (!Array.isArray(raw)) {
173
188
  return []
174
189
  }
190
+ const pageViewIds = this.pageViewIds;
175
191
  return raw
176
- .filter((o) => o && typeof o.label === 'string' && o.label !== '' && typeof o.route === 'string' && o.route !== '')
177
- .map((o) => ({ value: o.route, label: this.cnTranslate(o.label) }))
192
+ .filter((o) => o && typeof o.label === 'string' && o.label !== '')
193
+ .map((o) => {
194
+ if (typeof o.view === 'string' && o.view !== '') {
195
+ return pageViewIds.includes(o.view) ? { value: VIEW_OPTION_PREFIX + o.view, label: this.cnTranslate(o.label) } : null
196
+ }
197
+ if (typeof o.route === 'string' && o.route !== '' && this.$router) {
198
+ return { value: o.route, label: this.cnTranslate(o.label) }
199
+ }
200
+ return null
201
+ })
202
+ .filter(Boolean)
203
+ },
204
+
205
+ /**
206
+ * The ids of the page's views, empty outside a page with views.
207
+ *
208
+ * @spec openspec/changes/view-switch-containers/specs/view-switch-containers/spec.md#requirement-a-greeting-header-can-switch-the-pages-views
209
+ * @return {string[]}
210
+ */
211
+ pageViewIds() {
212
+ const views = this.cnPageViews && Array.isArray(this.cnPageViews.views) ? this.cnPageViews.views : [];
213
+ return views.map((view) => view.id)
214
+ },
215
+
216
+ /**
217
+ * The id of the page's view region when an option selects a view,
218
+ * for the options' `aria-controls`; '' otherwise.
219
+ *
220
+ * @spec openspec/changes/view-switch-containers/specs/view-switch-containers/spec.md#requirement-the-view-switch-is-accessible
221
+ * @return {string}
222
+ */
223
+ viewsRegionId() {
224
+ const hasViewOption = this.viewOptions.some((o) => o.value.startsWith(VIEW_OPTION_PREFIX));
225
+ return hasViewOption && this.cnPageViews ? (this.cnPageViews.regionId || '') : ''
178
226
  },
179
227
 
180
228
  /**
@@ -189,6 +237,11 @@ var script = {
189
237
  if (options.length === 0) {
190
238
  return null
191
239
  }
240
+ const activeView = this.cnPageViews ? this.cnPageViews.activeId : null;
241
+ const viewMatch = activeView ? options.find((o) => o.value === VIEW_OPTION_PREFIX + activeView) : null;
242
+ if (viewMatch) {
243
+ return viewMatch.value
244
+ }
192
245
  const current = this.$route && this.$route.name;
193
246
  const match = options.find((o) => o.value === current);
194
247
  return match ? match.value : options[0].value
@@ -203,7 +256,7 @@ var script = {
203
256
  */
204
257
  viewsLabel() {
205
258
  const label = this.content && this.content.views && this.content.views.ariaLabel;
206
- return label ? this.cnTranslate(label) : translate('nextcloud-vue', 'View')
259
+ return label ? this.cnTranslate(label) : translate('nextcloud-vue', 'Views')
207
260
  },
208
261
 
209
262
  /**
@@ -212,7 +265,20 @@ var script = {
212
265
  * @return {boolean}
213
266
  */
214
267
  isPlain() {
215
- return Boolean(this.content && this.content.plain === true)
268
+ return Boolean(this.content && (this.content.plain === true || this.content.ground === true))
269
+ },
270
+
271
+ /**
272
+ * Whether the greeting sits on the page ground (`content.ground`):
273
+ * the plain look without the card padding, so the date line and the
274
+ * heading align with the page edge as the board draws them. Off by
275
+ * default.
276
+ *
277
+ * @spec openspec/changes/zuiddrecht-pixel-gaps-2/specs/zuiddrecht-pixel-gaps-2/spec.md#requirement-a-greeting-can-sit-on-the-page-ground
278
+ * @return {boolean}
279
+ */
280
+ isGround() {
281
+ return Boolean(this.content && this.content.ground === true)
216
282
  },
217
283
 
218
284
  /**
@@ -508,9 +574,10 @@ var script = {
508
574
  'justify-content': VERTICAL_ALIGN_FLEX[this.verticalAlign],
509
575
  // Plain drops the coloured background, not the card padding:
510
576
  // at 0 the greeting sat flush against the card's left edge.
511
- padding: this.isPlain ? '16px' : '16px 24px',
577
+ // Ground has no card, so it has no padding either.
578
+ padding: this.isGround ? '0' : (this.isPlain ? '16px' : '16px 24px'),
512
579
  'box-sizing': 'border-box',
513
- gap: '8px',
580
+ gap: this.isGround ? '6px' : '8px',
514
581
  'text-align': this.textAlign,
515
582
  }
516
583
  },
@@ -623,6 +690,12 @@ var script = {
623
690
  * @return {void}
624
691
  */
625
692
  onViewChange(route) {
693
+ if (typeof route === 'string' && route.startsWith(VIEW_OPTION_PREFIX)) {
694
+ if (this.cnPageViews && typeof this.cnPageViews.select === 'function') {
695
+ this.cnPageViews.select(route.slice(VIEW_OPTION_PREFIX.length));
696
+ }
697
+ return
698
+ }
626
699
  if (!this.$router || !route || route === (this.$route && this.$route.name)) {
627
700
  return
628
701
  }
@@ -1 +1 @@
1
- {"version":3,"file":"CnHeaderWidget.vue2.js","sources":["../../../../src/components/CnHeaderWidget/CnHeaderWidget.vue"],"sourcesContent":["<!--\n - SPDX-FileCopyrightText: 2026 Conduction B.V.\n - SPDX-License-Identifier: EUPL-1.2\n-->\n\n<template>\n\t<div class=\"cn-header-widget\" :class=\"{ 'cn-header-widget--plain': isPlain, 'cn-header-widget--with-views': viewOptions.length > 0 }\" :style=\"wrapperStyle\">\n\t\t<div\n\t\t\tv-if=\"hasOverlay\"\n\t\t\tclass=\"cn-header-widget__overlay\"\n\t\t\t:style=\"overlayStyle\"\n\t\t\taria-hidden=\"true\" />\n\t\t<div class=\"cn-header-widget__content\" :style=\"contentStyle\">\n\t\t\t<p\n\t\t\t\tv-if=\"dateLine\"\n\t\t\t\tclass=\"cn-header-widget__date\"\n\t\t\t\t:style=\"dateStyle\"\n\t\t\t\tdata-testid=\"cn-header-widget-date\">\n\t\t\t\t{{ dateLine }}\n\t\t\t</p>\n\t\t\t<h2 v-if=\"hasTitle\" class=\"cn-header-widget__title\" :style=\"textStyle\">\n\t\t\t\t{{ headingText }}\n\t\t\t</h2>\n\t\t\t<p v-if=\"hasSubtitle\" class=\"cn-header-widget__subtitle\" :style=\"textStyle\">\n\t\t\t\t{{ subtitle }}\n\t\t\t</p>\n\t\t\t<a\n\t\t\t\tv-if=\"hasCta\"\n\t\t\t\t:href=\"ctaUrl\"\n\t\t\t\t:class=\"ctaClasses\"\n\t\t\t\t:target=\"ctaTarget\"\n\t\t\t\t:rel=\"ctaRel\"\n\t\t\t\t:aria-label=\"ctaAriaLabel\">\n\t\t\t\t{{ ctaLabel }}\n\t\t\t</a>\n\t\t</div>\n\t\t<!-- A view switch at the right of the heading (`content.views`): \"My\n\t\t work / My team\" as a segmented control whose options are routes. -->\n\t\t<div v-if=\"viewOptions.length > 0\" class=\"cn-header-widget__views\">\n\t\t\t<CnSegmentedControl\n\t\t\t\t:options=\"viewOptions\"\n\t\t\t\t:modelValue=\"activeView\"\n\t\t\t\t:ariaLabel=\"viewsLabel\"\n\t\t\t\tdata-testid=\"cn-header-widget-views\"\n\t\t\t\t@update:modelValue=\"onViewChange\" />\n\t\t</div>\n\t\t<img\n\t\t\tv-if=\"hasBackgroundImage\"\n\t\t\tclass=\"cn-header-widget__probe\"\n\t\t\t:src=\"backgroundImageUrl\"\n\t\t\talt=\"\"\n\t\t\taria-hidden=\"true\"\n\t\t\t@error=\"onImageError\">\n\t</div>\n</template>\n\n<script>\nimport { getCurrentUser } from '@nextcloud/auth'\nimport { getCanonicalLocale, translate as t } from '@nextcloud/l10n'\nimport CnSegmentedControl from '../CnSegmentedControl/CnSegmentedControl.vue'\nimport { resolveImageUrl } from '../../utils/resolveImageUrl.js'\n\nconst ALLOWED_OVERLAY_MODES = ['none', 'tint', 'gradient-bottom']\nconst ALLOWED_HEIGHTS = ['small', 'medium', 'large', 'xlarge']\nconst ALLOWED_TEXT_ALIGN = ['left', 'center', 'right']\nconst ALLOWED_VERTICAL_ALIGN = ['top', 'middle', 'bottom']\nconst ALLOWED_CTA_STYLES = ['primary', 'secondary', 'ghost']\n\nconst HEIGHT_PIXELS = Object.freeze({\n\tsmall: 120,\n\tmedium: 200,\n\tlarge: 320,\n\txlarge: 480,\n})\n\nconst VERTICAL_ALIGN_FLEX = Object.freeze({\n\ttop: 'flex-start',\n\tmiddle: 'center',\n\tbottom: 'flex-end',\n})\n\n/**\n * CnHeaderWidget — full-width banner widget for dashboards. Renders a\n * configurable header with title, optional subtitle, optional background\n * image, optional colour overlay, and optional call-to-action button.\n *\n * Image source precedence: `backgroundImageFileId` takes priority over\n * `backgroundImageUrl` (resolved via the Nextcloud core preview route). When\n * the image fails to load the renderer silently falls back to the solid\n * `backgroundColor`; no error UI is shown.\n *\n * Height presets map to fixed pixels: small=120, medium=200, large=320,\n * xlarge=480. Title is `<h2>`, subtitle `<p>`, CTA `<a>` — all semantic HTML.\n * External CTA URLs (http/https) open in a new tab with\n * `rel=\"noopener noreferrer\"`; relative / anchor URLs stay in the current tab.\n *\n * Optional greeting: `greeting: true` makes the heading greet the signed-in\n * user by time of day and first name (\"Good afternoon, Pieter\"; `\"full\"` uses\n * the whole display name), and `showDate: true` adds a line with today's\n * date above it. `plain: true` drops the coloured background and aligns the\n * text to the start, which is how a greeting usually sits on a dashboard.\n *\n * ```json\n * { \"widgetKey\": \"header\", \"props\": { \"content\": { \"greeting\": true, \"showDate\": true, \"plain\": true } } }\n * ```\n *\n * Registered as the `header` dashboard widget type via the renderer's\n * `index.js`.\n */\nexport default {\n\tname: 'CnHeaderWidget',\n\n\tcomponents: { CnSegmentedControl },\n\n\tinject: {\n\t\t/**\n\t\t * Host translate function provided by CnAppRoot as\n\t\t * `cnTranslate: this.translate` (bound to the host app's id). The\n\t\t * manifest-authored `content.title` / `content.subtitle` / CTA label\n\t\t * are run through it. Defaults to an identity function so an\n\t\t * untranslated key renders as itself.\n\t\t */\n\t\tcnTranslate: { default: () => (key) => key },\n\t},\n\n\tprops: {\n\t\t/**\n\t\t * Persisted widget content: `{title, subtitle, backgroundImageUrl,\n\t\t * backgroundImageFileId, backgroundColor, overlayMode, overlayColor,\n\t\t * overlayOpacity, textColor, textAlign, verticalAlign, height, cta,\n\t\t * greeting, showDate, plain, views}`. All fields are optional except\n\t\t * `title` (or `greeting`); unknown enum values collapse to documented\n\t\t * defaults and the renderer never throws. `views` is\n\t\t * `{ ariaLabel?, options: [{ label, route, params? }] }`: a segmented\n\t\t * control at the right of the heading whose checked option is the\n\t\t * current route; choosing another pushes its route.\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/* eslint-disable vue/no-unused-properties -- part of the widget contract: CnContainerChild and the dashboard pages bind :placement on every widget, so declaring it keeps it out of $attrs */\n\t\t/**\n\t\t * Placement entity — reserved to match the renderer contract.\n\t\t *\n\t\t * @type {object}\n\t\t */\n\t\tplacement: {\n\t\t\ttype: Object,\n\t\t\tdefault: null,\n\t\t},\n\t\t/* eslint-enable vue/no-unused-properties */\n\n\t\t/**\n\t\t * The moment the greeting and the date line are computed for. Leave\n\t\t * empty for the current time.\n\t\t *\n\t\t * @type {Date|null}\n\t\t */\n\t\tnow: {\n\t\t\ttype: Date,\n\t\t\tdefault: null,\n\t\t},\n\t},\n\n\tdata() {\n\t\treturn {\n\t\t\t// Set true once the background image fires a DOM `error` so\n\t\t\t// subsequent renders fall back to `backgroundColor` only. The\n\t\t\t// probe `<img>` is invisible — its only job is load-failure\n\t\t\t// detection for the CSS background.\n\t\t\timageFailed: false,\n\t\t}\n\t},\n\n\tcomputed: {\n\t\t/**\n\t\t * Effective translate function: the injected `cnTranslate` (the host\n\t\t * app's bound `t()`), identity by default.\n\t\t *\n\t\t * @return {(key: string) => string}\n\t\t */\n\t\teffectiveTranslate() {\n\t\t\treturn typeof this.cnTranslate === 'function' ? this.cnTranslate : (key) => key\n\t\t},\n\n\t\t/** The header title, translated, or '' when absent. */\n\t\ttitle() {\n\t\t\tconst value = this.content && this.content.title\n\t\t\treturn typeof value === 'string' && value !== '' ? this.effectiveTranslate(value) : ''\n\t\t},\n\n\t\t/** The header subtitle, translated, or '' when absent. */\n\t\tsubtitle() {\n\t\t\tconst value = this.content && this.content.subtitle\n\t\t\treturn typeof value === 'string' && value !== '' ? this.effectiveTranslate(value) : ''\n\t\t},\n\n\t\t/** Whether a heading renders: a non-empty title or a greeting. */\n\t\thasTitle() {\n\t\t\treturn this.headingText !== ''\n\t\t},\n\n\t\t/**\n\t\t * The moment the greeting and date line are computed for.\n\t\t *\n\t\t * @return {Date}\n\t\t * @spec openspec/changes/workplace-dashboard-primitives/specs/workplace-dashboard-primitives/spec.md#requirement-greeting-header\n\t\t */\n\t\treference() {\n\t\t\treturn this.now instanceof Date ? this.now : new Date()\n\t\t},\n\n\t\t/**\n\t\t * The view switch's options from `content.views.options`: each\n\t\t * `{ label, route, params? }` with a non-empty label and route becomes\n\t\t * a segmented-control option keyed on its route name (the label goes\n\t\t * through the host translate function). Empty without a router, so\n\t\t * the switch cannot offer routes it cannot follow.\n\t\t *\n\t\t * @spec openspec/changes/zuiddrecht-pixel-gaps/specs/zuiddrecht-pixel-gaps/spec.md#requirement-a-greeting-header-switches-views\n\t\t * @return {Array<{value: string, label: string}>}\n\t\t */\n\t\tviewOptions() {\n\t\t\tconst raw = this.content && this.content.views && this.content.views.options\n\t\t\tif (!Array.isArray(raw) || !this.$router) {\n\t\t\t\treturn []\n\t\t\t}\n\t\t\treturn raw\n\t\t\t\t.filter((o) => o && typeof o.label === 'string' && o.label !== '' && typeof o.route === 'string' && o.route !== '')\n\t\t\t\t.map((o) => ({ value: o.route, label: this.cnTranslate(o.label) }))\n\t\t},\n\n\t\t/**\n\t\t * The checked view: the option whose route is the current route, else\n\t\t * the first option (a switch always has one checked option).\n\t\t *\n\t\t * @spec openspec/changes/zuiddrecht-pixel-gaps/specs/zuiddrecht-pixel-gaps/spec.md#requirement-a-greeting-header-switches-views\n\t\t * @return {string|null}\n\t\t */\n\t\tactiveView() {\n\t\t\tconst options = this.viewOptions\n\t\t\tif (options.length === 0) {\n\t\t\t\treturn null\n\t\t\t}\n\t\t\tconst current = this.$route && this.$route.name\n\t\t\tconst match = options.find((o) => o.value === current)\n\t\t\treturn match ? match.value : options[0].value\n\t\t},\n\n\t\t/**\n\t\t * Accessible name of the view switch: `content.views.ariaLabel`\n\t\t * through the host translate function, else \"View\".\n\t\t *\n\t\t * @spec openspec/changes/zuiddrecht-pixel-gaps/specs/zuiddrecht-pixel-gaps/spec.md#requirement-a-greeting-header-switches-views\n\t\t * @return {string}\n\t\t */\n\t\tviewsLabel() {\n\t\t\tconst label = this.content && this.content.views && this.content.views.ariaLabel\n\t\t\treturn label ? this.cnTranslate(label) : t('nextcloud-vue', 'View')\n\t\t},\n\n\t\t/**\n\t\t * Whether the plain presentation is on (no coloured background).\n\t\t *\n\t\t * @return {boolean}\n\t\t */\n\t\tisPlain() {\n\t\t\treturn Boolean(this.content && this.content.plain === true)\n\t\t},\n\n\t\t/**\n\t\t * The name the greeting uses: the first word of the display name, or\n\t\t * the whole display name for `greeting: \"full\"`. '' when unknown.\n\t\t *\n\t\t * @return {string}\n\t\t * @spec openspec/changes/workplace-dashboard-primitives/specs/workplace-dashboard-primitives/spec.md#requirement-greeting-header\n\t\t */\n\t\tgreetingName() {\n\t\t\tlet user\n\t\t\ttry {\n\t\t\t\tuser = getCurrentUser()\n\t\t\t} catch {\n\t\t\t\tuser = null\n\t\t\t}\n\t\t\tconst displayName = (user && typeof user.displayName === 'string') ? user.displayName.trim() : ''\n\t\t\tif (displayName === '') {\n\t\t\t\treturn ''\n\t\t\t}\n\t\t\treturn this.content.greeting === 'full' ? displayName : displayName.split(/\\s+/)[0]\n\t\t},\n\n\t\t/**\n\t\t * The greeting for the time of day, with the user's name when known,\n\t\t * or '' when the greeting is off.\n\t\t *\n\t\t * @return {string}\n\t\t * @spec openspec/changes/workplace-dashboard-primitives/specs/workplace-dashboard-primitives/spec.md#requirement-greeting-header\n\t\t */\n\t\tgreetingText() {\n\t\t\tconst greeting = this.content && this.content.greeting\n\t\t\tif (greeting !== true && greeting !== 'full' && greeting !== 'first') {\n\t\t\t\treturn ''\n\t\t\t}\n\t\t\tconst hour = this.reference.getHours()\n\t\t\tconst name = this.greetingName\n\t\t\tif (hour < 12) {\n\t\t\t\treturn name ? t('nextcloud-vue', 'Good morning, {name}', { name }) : t('nextcloud-vue', 'Good morning')\n\t\t\t}\n\t\t\tif (hour < 18) {\n\t\t\t\treturn name ? t('nextcloud-vue', 'Good afternoon, {name}', { name }) : t('nextcloud-vue', 'Good afternoon')\n\t\t\t}\n\t\t\treturn name ? t('nextcloud-vue', 'Good evening, {name}', { name }) : t('nextcloud-vue', 'Good evening')\n\t\t},\n\n\t\t/**\n\t\t * The heading: the greeting when it is on, else the title.\n\t\t *\n\t\t * @return {string}\n\t\t * @spec openspec/changes/workplace-dashboard-primitives/specs/workplace-dashboard-primitives/spec.md#requirement-greeting-header\n\t\t */\n\t\theadingText() {\n\t\t\treturn this.greetingText || this.title\n\t\t},\n\n\t\t/**\n\t\t * Today's date written out (\"Monday 5 October 2026\"), or '' when\n\t\t * `showDate` is off.\n\t\t *\n\t\t * @return {string}\n\t\t * @spec openspec/changes/workplace-dashboard-primitives/specs/workplace-dashboard-primitives/spec.md#requirement-greeting-header\n\t\t */\n\t\tdateLine() {\n\t\t\tif (!this.content || this.content.showDate !== true) {\n\t\t\t\treturn ''\n\t\t\t}\n\t\t\tconst options = { weekday: 'long', day: 'numeric', month: 'long', year: 'numeric' }\n\t\t\tlet locale\n\t\t\ttry {\n\t\t\t\tlocale = getCanonicalLocale()\n\t\t\t} catch {\n\t\t\t\tlocale = undefined\n\t\t\t}\n\t\t\ttry {\n\t\t\t\treturn new Intl.DateTimeFormat(locale || undefined, options).format(this.reference)\n\t\t\t} catch {\n\t\t\t\treturn new Intl.DateTimeFormat(undefined, options).format(this.reference)\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * Inline style of the date line: the heading's colour, or the muted\n\t\t * text colour on a plain header.\n\t\t *\n\t\t * @return {object}\n\t\t * @spec openspec/changes/workplace-dashboard-primitives/specs/workplace-dashboard-primitives/spec.md#requirement-greeting-header\n\t\t */\n\t\tdateStyle() {\n\t\t\treturn {\n\t\t\t\tcolor: this.isPlain && !(this.content && this.content.textColor) ? 'var(--color-text-maxcontrast)' : this.textColor,\n\t\t\t\tmargin: 0,\n\t\t\t}\n\t\t},\n\n\t\t/** Whether a non-empty subtitle is set. */\n\t\thasSubtitle() {\n\t\t\treturn this.subtitle !== ''\n\t\t},\n\n\t\t/** Resolved background image URL (file id wins over URL). */\n\t\tbackgroundImageUrl() {\n\t\t\tconst fileId = this.content && this.content.backgroundImageFileId\n\t\t\tif (typeof fileId === 'number' && Number.isFinite(fileId) && fileId > 0) {\n\t\t\t\treturn `/index.php/core/preview?fileId=${fileId}&x=1024&y=512&a=1`\n\t\t\t}\n\t\t\tconst url = this.content && this.content.backgroundImageUrl\n\t\t\t// Accept http(s) plus uploaded/same-origin sources: data: and blob:\n\t\t\t// (from the form's upload) and root-relative paths (NC files/preview).\n\t\t\t// External http(s) images may still be blocked by the instance CSP —\n\t\t\t// uploading is the reliable, same-origin path. resolveImageUrl() adds\n\t\t\t// the webroot + /index.php to `/apps/...` resource paths so they load\n\t\t\t// on index.php-routed instances (other shapes pass through).\n\t\t\tif (typeof url === 'string' && /^(https?:\\/\\/|data:|blob:|\\/)/i.test(url)) {\n\t\t\t\treturn resolveImageUrl(url)\n\t\t\t}\n\t\t\treturn ''\n\t\t},\n\n\t\t/** Whether a usable, non-errored background image is present. */\n\t\thasBackgroundImage() {\n\t\t\treturn this.backgroundImageUrl !== '' && this.imageFailed === false\n\t\t},\n\n\t\t/**\n\t\t * Resolved background colour (default theme primary).\n\t\t *\n\t\t * @spec openspec/changes/workplace-dashboard-primitives/specs/workplace-dashboard-primitives/spec.md#requirement-greeting-header\n\t\t */\n\t\tbackgroundColor() {\n\t\t\tconst value = this.content && this.content.backgroundColor\n\t\t\tif (typeof value === 'string' && value !== '') {\n\t\t\t\treturn value\n\t\t\t}\n\t\t\tif (this.isPlain) {\n\t\t\t\treturn 'transparent'\n\t\t\t}\n\t\t\treturn 'var(--color-primary, #0070c0)'\n\t\t},\n\n\t\t/** Resolved overlay mode (`tint` when an image is present, else `none`). */\n\t\toverlayMode() {\n\t\t\tconst declared = this.content && this.content.overlayMode\n\t\t\tif (typeof declared === 'string' && ALLOWED_OVERLAY_MODES.includes(declared)) {\n\t\t\t\treturn declared\n\t\t\t}\n\t\t\treturn this.hasBackgroundImage ? 'tint' : 'none'\n\t\t},\n\n\t\t/** Whether an overlay should render. */\n\t\thasOverlay() {\n\t\t\treturn this.overlayMode !== 'none'\n\t\t},\n\n\t\t/** Resolved overlay colour. */\n\t\toverlayColor() {\n\t\t\tconst value = this.content && this.content.overlayColor\n\t\t\tif (typeof value === 'string' && value !== '') {\n\t\t\t\treturn value\n\t\t\t}\n\t\t\tconst bg = this.content && this.content.backgroundColor\n\t\t\treturn (typeof bg === 'string' && bg !== '') ? bg : '#000000'\n\t\t},\n\n\t\t/** Resolved overlay opacity, clamped to 0..1 (default 0.4). */\n\t\toverlayOpacity() {\n\t\t\tconst raw = this.content && this.content.overlayOpacity\n\t\t\tconst value = typeof raw === 'number' ? raw : Number.parseFloat(raw)\n\t\t\tif (Number.isFinite(value) === false) {\n\t\t\t\treturn 0.4\n\t\t\t}\n\t\t\tif (value < 0) {\n\t\t\t\treturn 0\n\t\t\t}\n\t\t\tif (value > 1) {\n\t\t\t\treturn 1\n\t\t\t}\n\t\t\treturn value\n\t\t},\n\n\t\t/** Resolved height preset key (default `medium`). */\n\t\theight() {\n\t\t\tconst declared = this.content && this.content.height\n\t\t\tif (typeof declared === 'string' && ALLOWED_HEIGHTS.includes(declared)) {\n\t\t\t\treturn declared\n\t\t\t}\n\t\t\treturn 'medium'\n\t\t},\n\n\t\t/** The pixel height for the active preset. */\n\t\theightPixels() {\n\t\t\treturn HEIGHT_PIXELS[this.height]\n\t\t},\n\n\t\t/**\n\t\t * Resolved text alignment (default `center`).\n\t\t *\n\t\t * @spec openspec/changes/workplace-dashboard-primitives/specs/workplace-dashboard-primitives/spec.md#requirement-greeting-header\n\t\t */\n\t\ttextAlign() {\n\t\t\tconst declared = this.content && this.content.textAlign\n\t\t\tif (typeof declared === 'string' && ALLOWED_TEXT_ALIGN.includes(declared)) {\n\t\t\t\treturn declared\n\t\t\t}\n\t\t\treturn this.isPlain ? 'left' : 'center'\n\t\t},\n\n\t\t/** Resolved vertical alignment (default `middle`). */\n\t\tverticalAlign() {\n\t\t\tconst declared = this.content && this.content.verticalAlign\n\t\t\tif (typeof declared === 'string' && ALLOWED_VERTICAL_ALIGN.includes(declared)) {\n\t\t\t\treturn declared\n\t\t\t}\n\t\t\treturn 'middle'\n\t\t},\n\n\t\t/**\n\t\t * Resolved text colour with an auto-contrast fallback.\n\t\t *\n\t\t * @spec openspec/changes/workplace-dashboard-primitives/specs/workplace-dashboard-primitives/spec.md#requirement-greeting-header\n\t\t */\n\t\ttextColor() {\n\t\t\tconst value = this.content && this.content.textColor\n\t\t\tif (typeof value === 'string' && value !== '') {\n\t\t\t\treturn value\n\t\t\t}\n\t\t\tif (this.hasBackgroundImage) {\n\t\t\t\treturn '#ffffff'\n\t\t\t}\n\t\t\tif (this.isPlain && !(this.content && this.content.backgroundColor)) {\n\t\t\t\treturn 'var(--color-main-text)'\n\t\t\t}\n\t\t\treturn this.isLightColor(this.backgroundColor) ? '#000000' : '#ffffff'\n\t\t},\n\n\t\t/** Inline style for the banner wrapper. */\n\t\twrapperStyle() {\n\t\t\tconst style = {\n\t\t\t\tposition: 'relative',\n\t\t\t\twidth: '100%',\n\t\t\t\t// Fill the dashboard grid cell so the banner resizes with the\n\t\t\t\t// widget. A fixed pixel height ignored the cell, which made the\n\t\t\t\t// banner un-resizable and made it overflow/scroll inside a\n\t\t\t\t// smaller cell. The grid controls the size now.\n\t\t\t\theight: '100%',\n\t\t\t\toverflow: 'hidden',\n\t\t\t\t'background-color': this.backgroundColor,\n\t\t\t}\n\t\t\tif (this.hasBackgroundImage) {\n\t\t\t\tstyle['background-image'] = `url(\"${this.backgroundImageUrl}\")`\n\t\t\t\tstyle['background-size'] = 'cover'\n\t\t\t\tstyle['background-position'] = 'center center'\n\t\t\t\tstyle['background-repeat'] = 'no-repeat'\n\t\t\t}\n\t\t\treturn style\n\t\t},\n\n\t\t/** Inline style for the overlay layer. */\n\t\toverlayStyle() {\n\t\t\tif (this.overlayMode === 'gradient-bottom') {\n\t\t\t\treturn {\n\t\t\t\t\tposition: 'absolute',\n\t\t\t\t\tinset: 0,\n\t\t\t\t\t'background-image': `linear-gradient(to bottom, transparent 50%, ${this.overlayColor} 100%)`,\n\t\t\t\t\t'pointer-events': 'none',\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn {\n\t\t\t\tposition: 'absolute',\n\t\t\t\tinset: 0,\n\t\t\t\t'background-color': this.overlayColor,\n\t\t\t\topacity: String(this.overlayOpacity),\n\t\t\t\t'pointer-events': 'none',\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * Inline style for the content flex container.\n\t\t *\n\t\t * @spec openspec/changes/workplace-dashboard-primitives/specs/workplace-dashboard-primitives/spec.md#requirement-greeting-header\n\t\t */\n\t\tcontentStyle() {\n\t\t\treturn {\n\t\t\t\tposition: 'relative',\n\t\t\t\t'z-index': 1,\n\t\t\t\t// Beside a view switch the content shares the row instead of\n\t\t\t\t// taking the whole width (see .cn-header-widget--with-views).\n\t\t\t\twidth: this.viewOptions.length > 0 ? 'auto' : '100%',\n\t\t\t\theight: '100%',\n\t\t\t\tdisplay: 'flex',\n\t\t\t\t'flex-direction': 'column',\n\t\t\t\t'align-items': this.flexAlignFromTextAlign,\n\t\t\t\t'justify-content': VERTICAL_ALIGN_FLEX[this.verticalAlign],\n\t\t\t\t// Plain drops the coloured background, not the card padding:\n\t\t\t\t// at 0 the greeting sat flush against the card's left edge.\n\t\t\t\tpadding: this.isPlain ? '16px' : '16px 24px',\n\t\t\t\t'box-sizing': 'border-box',\n\t\t\t\tgap: '8px',\n\t\t\t\t'text-align': this.textAlign,\n\t\t\t}\n\t\t},\n\n\t\t/** Flex cross-axis alignment derived from the text alignment. */\n\t\tflexAlignFromTextAlign() {\n\t\t\tif (this.textAlign === 'left') {\n\t\t\t\treturn 'flex-start'\n\t\t\t}\n\t\t\tif (this.textAlign === 'right') {\n\t\t\t\treturn 'flex-end'\n\t\t\t}\n\t\t\treturn 'center'\n\t\t},\n\n\t\t/** Inline style applying the resolved text colour. */\n\t\ttextStyle() {\n\t\t\treturn {\n\t\t\t\tcolor: this.textColor,\n\t\t\t\tmargin: 0,\n\t\t\t}\n\t\t},\n\n\t\t/** The validated CTA object, or null when incomplete. */\n\t\tcta() {\n\t\t\tconst raw = this.content && this.content.cta\n\t\t\tif (raw === null || typeof raw !== 'object') {\n\t\t\t\treturn null\n\t\t\t}\n\t\t\tconst label = typeof raw.label === 'string' ? raw.label.trim() : ''\n\t\t\tconst url = typeof raw.url === 'string' ? raw.url.trim() : ''\n\t\t\tif (label === '' || url === '') {\n\t\t\t\treturn null\n\t\t\t}\n\t\t\tlet style = raw.style\n\t\t\tif (typeof style !== 'string' || ALLOWED_CTA_STYLES.includes(style) === false) {\n\t\t\t\tstyle = 'primary'\n\t\t\t}\n\t\t\treturn { label, url, style }\n\t\t},\n\n\t\t/** Whether a complete CTA is present. */\n\t\thasCta() {\n\t\t\treturn this.cta !== null\n\t\t},\n\n\t\t/** The CTA label, translated. */\n\t\tctaLabel() {\n\t\t\treturn this.hasCta && this.cta.label ? this.effectiveTranslate(this.cta.label) : ''\n\t\t},\n\n\t\t/** The CTA URL. */\n\t\tctaUrl() {\n\t\t\treturn this.hasCta ? this.cta.url : ''\n\t\t},\n\n\t\t/** Whether the CTA URL is an external http(s) link. */\n\t\tctaIsExternal() {\n\t\t\treturn this.hasCta && /^https?:\\/\\//i.test(this.ctaUrl)\n\t\t},\n\n\t\t/** The CTA anchor target (`_blank` for external links). */\n\t\tctaTarget() {\n\t\t\treturn this.ctaIsExternal ? '_blank' : null\n\t\t},\n\n\t\t/** The CTA anchor rel for external links. */\n\t\tctaRel() {\n\t\t\treturn this.ctaIsExternal ? 'noopener noreferrer' : null\n\t\t},\n\n\t\t/** The accessible CTA label, annotating external links. */\n\t\tctaAriaLabel() {\n\t\t\tif (this.hasCta === false) {\n\t\t\t\treturn null\n\t\t\t}\n\t\t\tif (this.ctaIsExternal) {\n\t\t\t\treturn `${this.ctaLabel} (${t('nextcloud-vue', 'opens in new tab')})`\n\t\t\t}\n\t\t\treturn this.ctaLabel\n\t\t},\n\n\t\t/** The CTA class list (base + style modifier). */\n\t\tctaClasses() {\n\t\t\tif (this.hasCta === false) {\n\t\t\t\treturn []\n\t\t\t}\n\t\t\treturn [\n\t\t\t\t'cn-header-widget__cta',\n\t\t\t\t`cn-header-widget__cta--${this.cta.style}`,\n\t\t\t]\n\t\t},\n\t},\n\n\twatch: {\n\t\tbackgroundImageUrl() {\n\t\t\t// Re-arm the probe so a previously failing URL can recover when\n\t\t\t// the user edits the placement.\n\t\t\tthis.imageFailed = false\n\t\t},\n\t},\n\n\tmethods: {\n\t\t/**\n\t\t * Follow the chosen view: push its route (with the option's `params`\n\t\t * when declared). Nothing happens for the route already shown.\n\t\t *\n\t\t * @spec openspec/changes/zuiddrecht-pixel-gaps/specs/zuiddrecht-pixel-gaps/spec.md#requirement-a-greeting-header-switches-views\n\t\t * @param {string} route The chosen option's route name.\n\t\t * @return {void}\n\t\t */\n\t\tonViewChange(route) {\n\t\t\tif (!this.$router || !route || route === (this.$route && this.$route.name)) {\n\t\t\t\treturn\n\t\t\t}\n\t\t\tconst declared = (this.content.views.options || []).find((o) => o && o.route === route) || {}\n\t\t\tconst target = { name: route }\n\t\t\tif (declared.params && typeof declared.params === 'object') {\n\t\t\t\ttarget.params = declared.params\n\t\t\t}\n\t\t\tthis.$router.push(target)\n\t\t},\n\n\t\t/**\n\t\t * Mark the background image as broken so the renderer falls back to\n\t\t * the solid colour.\n\t\t *\n\t\t * @return {void}\n\t\t */\n\t\tonImageError() {\n\t\t\tthis.imageFailed = true\n\t\t},\n\n\t\t/**\n\t\t * Quick perceived-luminance check on a CSS hex colour. Returns true\n\t\t * for \"light\" (white text would be illegible). Non-hex colours\n\t\t * collapse to false (assume dark) — the safer default.\n\t\t *\n\t\t * @param {string} color the CSS colour value.\n\t\t * @return {boolean} true when the colour is perceived as light.\n\t\t */\n\t\tisLightColor(color) {\n\t\t\tif (typeof color !== 'string') {\n\t\t\t\treturn false\n\t\t\t}\n\t\t\tconst match = color.trim().match(/^#([0-9a-f]{6})$/i)\n\t\t\tif (!match) {\n\t\t\t\treturn false\n\t\t\t}\n\t\t\tconst hex = match[1]\n\t\t\tconst r = Number.parseInt(hex.slice(0, 2), 16)\n\t\t\tconst g = Number.parseInt(hex.slice(2, 4), 16)\n\t\t\tconst b = Number.parseInt(hex.slice(4, 6), 16)\n\t\t\tconst luma = (0.299 * r + 0.587 * g + 0.114 * b) / 255\n\t\t\treturn luma > 0.6\n\t\t},\n\t},\n}\n</script>\n\n<style scoped>\n.cn-header-widget {\n\twidth: 100%;\n\theight: 100%;\n\tmin-height: 120px;\n\tborder-radius: var(--border-radius-large, 8px);\n\toverflow: hidden;\n}\n\n.cn-header-widget--plain {\n\tmin-height: 0;\n\tborder-radius: 0;\n}\n\n/* With a view switch the heading and the switch share one row, the switch\n at the right and bottom-aligned with the heading; on a narrow card the\n switch wraps under it. */\n.cn-header-widget--with-views {\n\tdisplay: flex;\n\tflex-wrap: wrap;\n\talign-items: flex-end;\n\tjustify-content: space-between;\n\tgap: calc(2 * var(--default-grid-baseline)) calc(4 * var(--default-grid-baseline));\n}\n\n.cn-header-widget--with-views .cn-header-widget__content {\n\tflex: 1 1 320px;\n\twidth: auto;\n}\n\n.cn-header-widget__views {\n\tposition: relative;\n\tz-index: 1;\n\tflex: 0 0 auto;\n\tpadding: 16px;\n}\n\n.cn-header-widget__date {\n\tfont-size: 14px;\n\tline-height: 1.4;\n\tmargin: 0;\n}\n\n.cn-header-widget__overlay {\n\tposition: absolute;\n\tinset: 0;\n}\n\n.cn-header-widget__content {\n\tposition: relative;\n\tz-index: 1;\n}\n\n.cn-header-widget__title {\n\tfont-size: 28px;\n\tfont-weight: 700;\n\tline-height: 1.2;\n\tmargin: 0;\n}\n\n.cn-header-widget__subtitle {\n\tfont-size: 16px;\n\tline-height: 1.4;\n\tmargin: 0;\n\topacity: 0.95;\n}\n\n.cn-header-widget__cta {\n\tdisplay: inline-block;\n\tmargin-top: 8px;\n\tpadding: 10px 18px;\n\tborder-radius: var(--border-radius, 4px);\n\tfont-size: 14px;\n\tfont-weight: 600;\n\ttext-decoration: none;\n\tcursor: pointer;\n\ttransition: transform 0.15s ease, box-shadow 0.15s ease;\n}\n\n.cn-header-widget__cta:hover {\n\ttransform: translateY(-1px);\n\tbox-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);\n}\n\n.cn-header-widget__cta--primary {\n\tbackground-color: var(--color-primary, #0070c0);\n\tcolor: var(--color-primary-text, #ffffff);\n\tborder: 1px solid var(--color-primary, #0070c0);\n}\n\n.cn-header-widget__cta--secondary {\n\tbackground-color: var(--color-background-hover, rgba(255, 255, 255, 0.85));\n\tcolor: var(--color-main-text, #000000);\n\tborder: 1px solid var(--color-border, #cccccc);\n}\n\n.cn-header-widget__cta--ghost {\n\tbackground-color: transparent;\n\tcolor: inherit;\n\tborder: 1px solid currentColor;\n}\n\n.cn-header-widget__probe {\n\tposition: absolute;\n\twidth: 1px;\n\theight: 1px;\n\topacity: 0;\n\tpointer-events: none;\n\tinset-inline-start: -9999px;\n\ttop: -9999px;\n}\n\n@media print {\n\t.cn-header-widget {\n\t\tprint-color-adjust: exact;\n\t\t-webkit-print-color-adjust: exact;\n\t}\n}\n</style>\n"],"names":["CnSegmentedControl","t"],"mappings":";;;;;AA8DA,MAAM,qBAAsB,GAAE,CAAC,MAAM,EAAE,MAAM,EAAE,iBAAiB,EAAA;AAChE,MAAM,eAAc,GAAI,CAAC,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,QAAQ,EAAA;AAC7D,MAAM,kBAAmB,GAAE,CAAC,MAAM,EAAE,QAAQ,EAAE,OAAO,EAAA;AACrD,MAAM,yBAAyB,CAAC,KAAK,EAAE,QAAQ,EAAE,QAAQ,EAAA;AACzD,MAAM,kBAAiB,GAAI,CAAC,SAAS,EAAE,WAAW,EAAE,OAAO,EAAA;;AAE3D,MAAM,aAAY,GAAI,MAAM,CAAC,MAAM,CAAC;AACnC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AA,MAAM,CAAA,GAAI,MAAM,CAAC,QAAQ,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,EAAE,EAAA;AAC7C,GAAA,MAAM,CAAA,GAAI,MAAM,CAAC,QAAQ,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,EAAE,EAAA;AAC7C,GAAA,MAAM,CAAA,GAAI,MAAM,CAAC,QAAQ,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,EAAE,EAAA;AAC7C,GAAA,MAAM,IAAG,GAAI,CAAC,KAAI,GAAI,CAAE,GAAE,KAAI,GAAI,CAAA,GAAI,QAAQ,CAAC,IAAI,IAAE;GACrD,OAAO,IAAG,GAAI,GAAE;GAChB;EACD;AACF;;;;"}
1
+ {"version":3,"file":"CnHeaderWidget.vue2.js","sources":["../../../../src/components/CnHeaderWidget/CnHeaderWidget.vue"],"sourcesContent":["<!--\n - SPDX-FileCopyrightText: 2026 Conduction B.V.\n - SPDX-License-Identifier: EUPL-1.2\n-->\n\n<template>\n\t<div class=\"cn-header-widget\" :class=\"{ 'cn-header-widget--plain': isPlain, 'cn-header-widget--ground': isGround, 'cn-header-widget--with-views': viewOptions.length > 0 }\" :style=\"wrapperStyle\">\n\t\t<div\n\t\t\tv-if=\"hasOverlay\"\n\t\t\tclass=\"cn-header-widget__overlay\"\n\t\t\t:style=\"overlayStyle\"\n\t\t\taria-hidden=\"true\" />\n\t\t<div class=\"cn-header-widget__content\" :style=\"contentStyle\">\n\t\t\t<p\n\t\t\t\tv-if=\"dateLine\"\n\t\t\t\tclass=\"cn-header-widget__date\"\n\t\t\t\t:style=\"dateStyle\"\n\t\t\t\tdata-testid=\"cn-header-widget-date\">\n\t\t\t\t{{ dateLine }}\n\t\t\t</p>\n\t\t\t<h2 v-if=\"hasTitle\" class=\"cn-header-widget__title\" :style=\"textStyle\">\n\t\t\t\t{{ headingText }}\n\t\t\t</h2>\n\t\t\t<p v-if=\"hasSubtitle\" class=\"cn-header-widget__subtitle\" :style=\"textStyle\">\n\t\t\t\t{{ subtitle }}\n\t\t\t</p>\n\t\t\t<a\n\t\t\t\tv-if=\"hasCta\"\n\t\t\t\t:href=\"ctaUrl\"\n\t\t\t\t:class=\"ctaClasses\"\n\t\t\t\t:target=\"ctaTarget\"\n\t\t\t\t:rel=\"ctaRel\"\n\t\t\t\t:aria-label=\"ctaAriaLabel\">\n\t\t\t\t{{ ctaLabel }}\n\t\t\t</a>\n\t\t</div>\n\t\t<!-- A view switch at the right of the heading (`content.views`): \"My\n\t\t work / My team\" as a segmented control whose options are routes,\n\t\t or views of the page the widget sits on (`option.view`); a view\n\t\t option controls the page's view region. -->\n\t\t<div v-if=\"viewOptions.length > 0\" class=\"cn-header-widget__views\">\n\t\t\t<CnSegmentedControl\n\t\t\t\t:options=\"viewOptions\"\n\t\t\t\t:modelValue=\"activeView\"\n\t\t\t\t:ariaLabel=\"viewsLabel\"\n\t\t\t\t:controls=\"viewsRegionId\"\n\t\t\t\tdata-testid=\"cn-header-widget-views\"\n\t\t\t\t@update:modelValue=\"onViewChange\" />\n\t\t</div>\n\t\t<img\n\t\t\tv-if=\"hasBackgroundImage\"\n\t\t\tclass=\"cn-header-widget__probe\"\n\t\t\t:src=\"backgroundImageUrl\"\n\t\t\talt=\"\"\n\t\t\taria-hidden=\"true\"\n\t\t\t@error=\"onImageError\">\n\t</div>\n</template>\n\n<script>\nimport { getCurrentUser } from '@nextcloud/auth'\nimport { getCanonicalLocale, translate as t } from '@nextcloud/l10n'\nimport CnSegmentedControl from '../CnSegmentedControl/CnSegmentedControl.vue'\nimport { resolveImageUrl } from '../../utils/resolveImageUrl.js'\n\nconst ALLOWED_OVERLAY_MODES = ['none', 'tint', 'gradient-bottom']\nconst ALLOWED_HEIGHTS = ['small', 'medium', 'large', 'xlarge']\nconst ALLOWED_TEXT_ALIGN = ['left', 'center', 'right']\nconst ALLOWED_VERTICAL_ALIGN = ['top', 'middle', 'bottom']\nconst ALLOWED_CTA_STYLES = ['primary', 'secondary', 'ghost']\n\n/** Marks a switch option that selects a page view rather than a route. */\nconst VIEW_OPTION_PREFIX = 'view:'\n\nconst HEIGHT_PIXELS = Object.freeze({\n\tsmall: 120,\n\tmedium: 200,\n\tlarge: 320,\n\txlarge: 480,\n})\n\nconst VERTICAL_ALIGN_FLEX = Object.freeze({\n\ttop: 'flex-start',\n\tmiddle: 'center',\n\tbottom: 'flex-end',\n})\n\n/**\n * CnHeaderWidget — full-width banner widget for dashboards. Renders a\n * configurable header with title, optional subtitle, optional background\n * image, optional colour overlay, and optional call-to-action button.\n *\n * Image source precedence: `backgroundImageFileId` takes priority over\n * `backgroundImageUrl` (resolved via the Nextcloud core preview route). When\n * the image fails to load the renderer silently falls back to the solid\n * `backgroundColor`; no error UI is shown.\n *\n * Height presets map to fixed pixels: small=120, medium=200, large=320,\n * xlarge=480. Title is `<h2>`, subtitle `<p>`, CTA `<a>` — all semantic HTML.\n * External CTA URLs (http/https) open in a new tab with\n * `rel=\"noopener noreferrer\"`; relative / anchor URLs stay in the current tab.\n *\n * Optional greeting: `greeting: true` makes the heading greet the signed-in\n * user by time of day and first name (\"Good afternoon, Pieter\"; `\"full\"` uses\n * the whole display name), and `showDate: true` adds a line with today's\n * date above it. `plain: true` drops the coloured background and aligns the\n * text to the start, which is how a greeting usually sits on a dashboard.\n *\n * ```json\n * { \"widgetKey\": \"header\", \"props\": { \"content\": { \"greeting\": true, \"showDate\": true, \"plain\": true } } }\n * ```\n *\n * Registered as the `header` dashboard widget type via the renderer's\n * `index.js`.\n */\nexport default {\n\tname: 'CnHeaderWidget',\n\n\tcomponents: { CnSegmentedControl },\n\n\tinject: {\n\t\t/**\n\t\t * Host translate function provided by CnAppRoot as\n\t\t * `cnTranslate: this.translate` (bound to the host app's id). The\n\t\t * manifest-authored `content.title` / `content.subtitle` / CTA label\n\t\t * are run through it. Defaults to an identity function so an\n\t\t * untranslated key renders as itself.\n\t\t */\n\t\tcnTranslate: { default: () => (key) => key },\n\t\t/**\n\t\t * The views of the page this widget sits on, provided by\n\t\t * CnDashboardPage / CnDetailPage (`views`). An option with a `view`\n\t\t * selects one of them. Null outside such a page.\n\t\t */\n\t\tcnPageViews: { default: null },\n\t},\n\n\tprops: {\n\t\t/**\n\t\t * Persisted widget content: `{title, subtitle, backgroundImageUrl,\n\t\t * backgroundImageFileId, backgroundColor, overlayMode, overlayColor,\n\t\t * overlayOpacity, textColor, textAlign, verticalAlign, height, cta,\n\t\t * greeting, showDate, plain, ground, views}`. All fields are optional except\n\t\t * `title` (or `greeting`); unknown enum values collapse to documented\n\t\t * defaults and the renderer never throws. `views` is\n\t\t * `{ ariaLabel?, options: [{ label, route, params? } | { label, view }] }`:\n\t\t * a segmented control at the right of the heading whose checked option\n\t\t * is the current route; choosing another pushes its route. An option\n\t\t * with `view` selects that view of the page the widget sits on (the\n\t\t * page's `views`) instead, and the page then draws no switch of its\n\t\t * own. `ground: true`\n\t\t * draws the greeting on the page ground: the plain look with no\n\t\t * padding, a 32px heading and the date line 6px above it (a dashboard\n\t\t * also drops the widget's card for it).\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/* eslint-disable vue/no-unused-properties -- part of the widget contract: CnContainerChild and the dashboard pages bind :placement on every widget, so declaring it keeps it out of $attrs */\n\t\t/**\n\t\t * Placement entity — reserved to match the renderer contract.\n\t\t *\n\t\t * @type {object}\n\t\t */\n\t\tplacement: {\n\t\t\ttype: Object,\n\t\t\tdefault: null,\n\t\t},\n\t\t/* eslint-enable vue/no-unused-properties */\n\n\t\t/**\n\t\t * The moment the greeting and the date line are computed for. Leave\n\t\t * empty for the current time.\n\t\t *\n\t\t * @type {Date|null}\n\t\t */\n\t\tnow: {\n\t\t\ttype: Date,\n\t\t\tdefault: null,\n\t\t},\n\t},\n\n\tdata() {\n\t\treturn {\n\t\t\t// Set true once the background image fires a DOM `error` so\n\t\t\t// subsequent renders fall back to `backgroundColor` only. The\n\t\t\t// probe `<img>` is invisible — its only job is load-failure\n\t\t\t// detection for the CSS background.\n\t\t\timageFailed: false,\n\t\t}\n\t},\n\n\tcomputed: {\n\t\t/**\n\t\t * Effective translate function: the injected `cnTranslate` (the host\n\t\t * app's bound `t()`), identity by default.\n\t\t *\n\t\t * @return {(key: string) => string}\n\t\t */\n\t\teffectiveTranslate() {\n\t\t\treturn typeof this.cnTranslate === 'function' ? this.cnTranslate : (key) => key\n\t\t},\n\n\t\t/** The header title, translated, or '' when absent. */\n\t\ttitle() {\n\t\t\tconst value = this.content && this.content.title\n\t\t\treturn typeof value === 'string' && value !== '' ? this.effectiveTranslate(value) : ''\n\t\t},\n\n\t\t/** The header subtitle, translated, or '' when absent. */\n\t\tsubtitle() {\n\t\t\tconst value = this.content && this.content.subtitle\n\t\t\treturn typeof value === 'string' && value !== '' ? this.effectiveTranslate(value) : ''\n\t\t},\n\n\t\t/** Whether a heading renders: a non-empty title or a greeting. */\n\t\thasTitle() {\n\t\t\treturn this.headingText !== ''\n\t\t},\n\n\t\t/**\n\t\t * The moment the greeting and date line are computed for.\n\t\t *\n\t\t * @return {Date}\n\t\t * @spec openspec/changes/workplace-dashboard-primitives/specs/workplace-dashboard-primitives/spec.md#requirement-greeting-header\n\t\t */\n\t\treference() {\n\t\t\treturn this.now instanceof Date ? this.now : new Date()\n\t\t},\n\n\t\t/**\n\t\t * The view switch's options from `content.views.options`: each\n\t\t * `{ label, route, params? }` with a non-empty label and route becomes\n\t\t * a segmented-control option keyed on its route name (the label goes\n\t\t * through the host translate function). Empty without a router, so\n\t\t * the switch cannot offer routes it cannot follow.\n\t\t *\n\t\t * @spec openspec/changes/zuiddrecht-pixel-gaps/specs/zuiddrecht-pixel-gaps/spec.md#requirement-a-greeting-header-switches-views\n\t\t * @return {Array<{value: string, label: string}>}\n\t\t */\n\t\tviewOptions() {\n\t\t\tconst raw = this.content && this.content.views && this.content.views.options\n\t\t\tif (!Array.isArray(raw)) {\n\t\t\t\treturn []\n\t\t\t}\n\t\t\tconst pageViewIds = this.pageViewIds\n\t\t\treturn raw\n\t\t\t\t.filter((o) => o && typeof o.label === 'string' && o.label !== '')\n\t\t\t\t.map((o) => {\n\t\t\t\t\tif (typeof o.view === 'string' && o.view !== '') {\n\t\t\t\t\t\treturn pageViewIds.includes(o.view) ? { value: VIEW_OPTION_PREFIX + o.view, label: this.cnTranslate(o.label) } : null\n\t\t\t\t\t}\n\t\t\t\t\tif (typeof o.route === 'string' && o.route !== '' && this.$router) {\n\t\t\t\t\t\treturn { value: o.route, label: this.cnTranslate(o.label) }\n\t\t\t\t\t}\n\t\t\t\t\treturn null\n\t\t\t\t})\n\t\t\t\t.filter(Boolean)\n\t\t},\n\n\t\t/**\n\t\t * The ids of the page's views, empty outside a page with views.\n\t\t *\n\t\t * @spec openspec/changes/view-switch-containers/specs/view-switch-containers/spec.md#requirement-a-greeting-header-can-switch-the-pages-views\n\t\t * @return {string[]}\n\t\t */\n\t\tpageViewIds() {\n\t\t\tconst views = this.cnPageViews && Array.isArray(this.cnPageViews.views) ? this.cnPageViews.views : []\n\t\t\treturn views.map((view) => view.id)\n\t\t},\n\n\t\t/**\n\t\t * The id of the page's view region when an option selects a view,\n\t\t * for the options' `aria-controls`; '' otherwise.\n\t\t *\n\t\t * @spec openspec/changes/view-switch-containers/specs/view-switch-containers/spec.md#requirement-the-view-switch-is-accessible\n\t\t * @return {string}\n\t\t */\n\t\tviewsRegionId() {\n\t\t\tconst hasViewOption = this.viewOptions.some((o) => o.value.startsWith(VIEW_OPTION_PREFIX))\n\t\t\treturn hasViewOption && this.cnPageViews ? (this.cnPageViews.regionId || '') : ''\n\t\t},\n\n\t\t/**\n\t\t * The checked view: the option whose route is the current route, else\n\t\t * the first option (a switch always has one checked option).\n\t\t *\n\t\t * @spec openspec/changes/zuiddrecht-pixel-gaps/specs/zuiddrecht-pixel-gaps/spec.md#requirement-a-greeting-header-switches-views\n\t\t * @return {string|null}\n\t\t */\n\t\tactiveView() {\n\t\t\tconst options = this.viewOptions\n\t\t\tif (options.length === 0) {\n\t\t\t\treturn null\n\t\t\t}\n\t\t\tconst activeView = this.cnPageViews ? this.cnPageViews.activeId : null\n\t\t\tconst viewMatch = activeView ? options.find((o) => o.value === VIEW_OPTION_PREFIX + activeView) : null\n\t\t\tif (viewMatch) {\n\t\t\t\treturn viewMatch.value\n\t\t\t}\n\t\t\tconst current = this.$route && this.$route.name\n\t\t\tconst match = options.find((o) => o.value === current)\n\t\t\treturn match ? match.value : options[0].value\n\t\t},\n\n\t\t/**\n\t\t * Accessible name of the view switch: `content.views.ariaLabel`\n\t\t * through the host translate function, else \"View\".\n\t\t *\n\t\t * @spec openspec/changes/zuiddrecht-pixel-gaps/specs/zuiddrecht-pixel-gaps/spec.md#requirement-a-greeting-header-switches-views\n\t\t * @return {string}\n\t\t */\n\t\tviewsLabel() {\n\t\t\tconst label = this.content && this.content.views && this.content.views.ariaLabel\n\t\t\treturn label ? this.cnTranslate(label) : t('nextcloud-vue', 'Views')\n\t\t},\n\n\t\t/**\n\t\t * Whether the plain presentation is on (no coloured background).\n\t\t *\n\t\t * @return {boolean}\n\t\t */\n\t\tisPlain() {\n\t\t\treturn Boolean(this.content && (this.content.plain === true || this.content.ground === true))\n\t\t},\n\n\t\t/**\n\t\t * Whether the greeting sits on the page ground (`content.ground`):\n\t\t * the plain look without the card padding, so the date line and the\n\t\t * heading align with the page edge as the board draws them. Off by\n\t\t * default.\n\t\t *\n\t\t * @spec openspec/changes/zuiddrecht-pixel-gaps-2/specs/zuiddrecht-pixel-gaps-2/spec.md#requirement-a-greeting-can-sit-on-the-page-ground\n\t\t * @return {boolean}\n\t\t */\n\t\tisGround() {\n\t\t\treturn Boolean(this.content && this.content.ground === true)\n\t\t},\n\n\t\t/**\n\t\t * The name the greeting uses: the first word of the display name, or\n\t\t * the whole display name for `greeting: \"full\"`. '' when unknown.\n\t\t *\n\t\t * @return {string}\n\t\t * @spec openspec/changes/workplace-dashboard-primitives/specs/workplace-dashboard-primitives/spec.md#requirement-greeting-header\n\t\t */\n\t\tgreetingName() {\n\t\t\tlet user\n\t\t\ttry {\n\t\t\t\tuser = getCurrentUser()\n\t\t\t} catch {\n\t\t\t\tuser = null\n\t\t\t}\n\t\t\tconst displayName = (user && typeof user.displayName === 'string') ? user.displayName.trim() : ''\n\t\t\tif (displayName === '') {\n\t\t\t\treturn ''\n\t\t\t}\n\t\t\treturn this.content.greeting === 'full' ? displayName : displayName.split(/\\s+/)[0]\n\t\t},\n\n\t\t/**\n\t\t * The greeting for the time of day, with the user's name when known,\n\t\t * or '' when the greeting is off.\n\t\t *\n\t\t * @return {string}\n\t\t * @spec openspec/changes/workplace-dashboard-primitives/specs/workplace-dashboard-primitives/spec.md#requirement-greeting-header\n\t\t */\n\t\tgreetingText() {\n\t\t\tconst greeting = this.content && this.content.greeting\n\t\t\tif (greeting !== true && greeting !== 'full' && greeting !== 'first') {\n\t\t\t\treturn ''\n\t\t\t}\n\t\t\tconst hour = this.reference.getHours()\n\t\t\tconst name = this.greetingName\n\t\t\tif (hour < 12) {\n\t\t\t\treturn name ? t('nextcloud-vue', 'Good morning, {name}', { name }) : t('nextcloud-vue', 'Good morning')\n\t\t\t}\n\t\t\tif (hour < 18) {\n\t\t\t\treturn name ? t('nextcloud-vue', 'Good afternoon, {name}', { name }) : t('nextcloud-vue', 'Good afternoon')\n\t\t\t}\n\t\t\treturn name ? t('nextcloud-vue', 'Good evening, {name}', { name }) : t('nextcloud-vue', 'Good evening')\n\t\t},\n\n\t\t/**\n\t\t * The heading: the greeting when it is on, else the title.\n\t\t *\n\t\t * @return {string}\n\t\t * @spec openspec/changes/workplace-dashboard-primitives/specs/workplace-dashboard-primitives/spec.md#requirement-greeting-header\n\t\t */\n\t\theadingText() {\n\t\t\treturn this.greetingText || this.title\n\t\t},\n\n\t\t/**\n\t\t * Today's date written out (\"Monday 5 October 2026\"), or '' when\n\t\t * `showDate` is off.\n\t\t *\n\t\t * @return {string}\n\t\t * @spec openspec/changes/workplace-dashboard-primitives/specs/workplace-dashboard-primitives/spec.md#requirement-greeting-header\n\t\t */\n\t\tdateLine() {\n\t\t\tif (!this.content || this.content.showDate !== true) {\n\t\t\t\treturn ''\n\t\t\t}\n\t\t\tconst options = { weekday: 'long', day: 'numeric', month: 'long', year: 'numeric' }\n\t\t\tlet locale\n\t\t\ttry {\n\t\t\t\tlocale = getCanonicalLocale()\n\t\t\t} catch {\n\t\t\t\tlocale = undefined\n\t\t\t}\n\t\t\ttry {\n\t\t\t\treturn new Intl.DateTimeFormat(locale || undefined, options).format(this.reference)\n\t\t\t} catch {\n\t\t\t\treturn new Intl.DateTimeFormat(undefined, options).format(this.reference)\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * Inline style of the date line: the heading's colour, or the muted\n\t\t * text colour on a plain header.\n\t\t *\n\t\t * @return {object}\n\t\t * @spec openspec/changes/workplace-dashboard-primitives/specs/workplace-dashboard-primitives/spec.md#requirement-greeting-header\n\t\t */\n\t\tdateStyle() {\n\t\t\treturn {\n\t\t\t\tcolor: this.isPlain && !(this.content && this.content.textColor) ? 'var(--color-text-maxcontrast)' : this.textColor,\n\t\t\t\tmargin: 0,\n\t\t\t}\n\t\t},\n\n\t\t/** Whether a non-empty subtitle is set. */\n\t\thasSubtitle() {\n\t\t\treturn this.subtitle !== ''\n\t\t},\n\n\t\t/** Resolved background image URL (file id wins over URL). */\n\t\tbackgroundImageUrl() {\n\t\t\tconst fileId = this.content && this.content.backgroundImageFileId\n\t\t\tif (typeof fileId === 'number' && Number.isFinite(fileId) && fileId > 0) {\n\t\t\t\treturn `/index.php/core/preview?fileId=${fileId}&x=1024&y=512&a=1`\n\t\t\t}\n\t\t\tconst url = this.content && this.content.backgroundImageUrl\n\t\t\t// Accept http(s) plus uploaded/same-origin sources: data: and blob:\n\t\t\t// (from the form's upload) and root-relative paths (NC files/preview).\n\t\t\t// External http(s) images may still be blocked by the instance CSP —\n\t\t\t// uploading is the reliable, same-origin path. resolveImageUrl() adds\n\t\t\t// the webroot + /index.php to `/apps/...` resource paths so they load\n\t\t\t// on index.php-routed instances (other shapes pass through).\n\t\t\tif (typeof url === 'string' && /^(https?:\\/\\/|data:|blob:|\\/)/i.test(url)) {\n\t\t\t\treturn resolveImageUrl(url)\n\t\t\t}\n\t\t\treturn ''\n\t\t},\n\n\t\t/** Whether a usable, non-errored background image is present. */\n\t\thasBackgroundImage() {\n\t\t\treturn this.backgroundImageUrl !== '' && this.imageFailed === false\n\t\t},\n\n\t\t/**\n\t\t * Resolved background colour (default theme primary).\n\t\t *\n\t\t * @spec openspec/changes/workplace-dashboard-primitives/specs/workplace-dashboard-primitives/spec.md#requirement-greeting-header\n\t\t */\n\t\tbackgroundColor() {\n\t\t\tconst value = this.content && this.content.backgroundColor\n\t\t\tif (typeof value === 'string' && value !== '') {\n\t\t\t\treturn value\n\t\t\t}\n\t\t\tif (this.isPlain) {\n\t\t\t\treturn 'transparent'\n\t\t\t}\n\t\t\treturn 'var(--color-primary, #0070c0)'\n\t\t},\n\n\t\t/** Resolved overlay mode (`tint` when an image is present, else `none`). */\n\t\toverlayMode() {\n\t\t\tconst declared = this.content && this.content.overlayMode\n\t\t\tif (typeof declared === 'string' && ALLOWED_OVERLAY_MODES.includes(declared)) {\n\t\t\t\treturn declared\n\t\t\t}\n\t\t\treturn this.hasBackgroundImage ? 'tint' : 'none'\n\t\t},\n\n\t\t/** Whether an overlay should render. */\n\t\thasOverlay() {\n\t\t\treturn this.overlayMode !== 'none'\n\t\t},\n\n\t\t/** Resolved overlay colour. */\n\t\toverlayColor() {\n\t\t\tconst value = this.content && this.content.overlayColor\n\t\t\tif (typeof value === 'string' && value !== '') {\n\t\t\t\treturn value\n\t\t\t}\n\t\t\tconst bg = this.content && this.content.backgroundColor\n\t\t\treturn (typeof bg === 'string' && bg !== '') ? bg : '#000000'\n\t\t},\n\n\t\t/** Resolved overlay opacity, clamped to 0..1 (default 0.4). */\n\t\toverlayOpacity() {\n\t\t\tconst raw = this.content && this.content.overlayOpacity\n\t\t\tconst value = typeof raw === 'number' ? raw : Number.parseFloat(raw)\n\t\t\tif (Number.isFinite(value) === false) {\n\t\t\t\treturn 0.4\n\t\t\t}\n\t\t\tif (value < 0) {\n\t\t\t\treturn 0\n\t\t\t}\n\t\t\tif (value > 1) {\n\t\t\t\treturn 1\n\t\t\t}\n\t\t\treturn value\n\t\t},\n\n\t\t/** Resolved height preset key (default `medium`). */\n\t\theight() {\n\t\t\tconst declared = this.content && this.content.height\n\t\t\tif (typeof declared === 'string' && ALLOWED_HEIGHTS.includes(declared)) {\n\t\t\t\treturn declared\n\t\t\t}\n\t\t\treturn 'medium'\n\t\t},\n\n\t\t/** The pixel height for the active preset. */\n\t\theightPixels() {\n\t\t\treturn HEIGHT_PIXELS[this.height]\n\t\t},\n\n\t\t/**\n\t\t * Resolved text alignment (default `center`).\n\t\t *\n\t\t * @spec openspec/changes/workplace-dashboard-primitives/specs/workplace-dashboard-primitives/spec.md#requirement-greeting-header\n\t\t */\n\t\ttextAlign() {\n\t\t\tconst declared = this.content && this.content.textAlign\n\t\t\tif (typeof declared === 'string' && ALLOWED_TEXT_ALIGN.includes(declared)) {\n\t\t\t\treturn declared\n\t\t\t}\n\t\t\treturn this.isPlain ? 'left' : 'center'\n\t\t},\n\n\t\t/** Resolved vertical alignment (default `middle`). */\n\t\tverticalAlign() {\n\t\t\tconst declared = this.content && this.content.verticalAlign\n\t\t\tif (typeof declared === 'string' && ALLOWED_VERTICAL_ALIGN.includes(declared)) {\n\t\t\t\treturn declared\n\t\t\t}\n\t\t\treturn 'middle'\n\t\t},\n\n\t\t/**\n\t\t * Resolved text colour with an auto-contrast fallback.\n\t\t *\n\t\t * @spec openspec/changes/workplace-dashboard-primitives/specs/workplace-dashboard-primitives/spec.md#requirement-greeting-header\n\t\t */\n\t\ttextColor() {\n\t\t\tconst value = this.content && this.content.textColor\n\t\t\tif (typeof value === 'string' && value !== '') {\n\t\t\t\treturn value\n\t\t\t}\n\t\t\tif (this.hasBackgroundImage) {\n\t\t\t\treturn '#ffffff'\n\t\t\t}\n\t\t\tif (this.isPlain && !(this.content && this.content.backgroundColor)) {\n\t\t\t\treturn 'var(--color-main-text)'\n\t\t\t}\n\t\t\treturn this.isLightColor(this.backgroundColor) ? '#000000' : '#ffffff'\n\t\t},\n\n\t\t/** Inline style for the banner wrapper. */\n\t\twrapperStyle() {\n\t\t\tconst style = {\n\t\t\t\tposition: 'relative',\n\t\t\t\twidth: '100%',\n\t\t\t\t// Fill the dashboard grid cell so the banner resizes with the\n\t\t\t\t// widget. A fixed pixel height ignored the cell, which made the\n\t\t\t\t// banner un-resizable and made it overflow/scroll inside a\n\t\t\t\t// smaller cell. The grid controls the size now.\n\t\t\t\theight: '100%',\n\t\t\t\toverflow: 'hidden',\n\t\t\t\t'background-color': this.backgroundColor,\n\t\t\t}\n\t\t\tif (this.hasBackgroundImage) {\n\t\t\t\tstyle['background-image'] = `url(\"${this.backgroundImageUrl}\")`\n\t\t\t\tstyle['background-size'] = 'cover'\n\t\t\t\tstyle['background-position'] = 'center center'\n\t\t\t\tstyle['background-repeat'] = 'no-repeat'\n\t\t\t}\n\t\t\treturn style\n\t\t},\n\n\t\t/** Inline style for the overlay layer. */\n\t\toverlayStyle() {\n\t\t\tif (this.overlayMode === 'gradient-bottom') {\n\t\t\t\treturn {\n\t\t\t\t\tposition: 'absolute',\n\t\t\t\t\tinset: 0,\n\t\t\t\t\t'background-image': `linear-gradient(to bottom, transparent 50%, ${this.overlayColor} 100%)`,\n\t\t\t\t\t'pointer-events': 'none',\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn {\n\t\t\t\tposition: 'absolute',\n\t\t\t\tinset: 0,\n\t\t\t\t'background-color': this.overlayColor,\n\t\t\t\topacity: String(this.overlayOpacity),\n\t\t\t\t'pointer-events': 'none',\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * Inline style for the content flex container.\n\t\t *\n\t\t * @spec openspec/changes/workplace-dashboard-primitives/specs/workplace-dashboard-primitives/spec.md#requirement-greeting-header\n\t\t */\n\t\tcontentStyle() {\n\t\t\treturn {\n\t\t\t\tposition: 'relative',\n\t\t\t\t'z-index': 1,\n\t\t\t\t// Beside a view switch the content shares the row instead of\n\t\t\t\t// taking the whole width (see .cn-header-widget--with-views).\n\t\t\t\twidth: this.viewOptions.length > 0 ? 'auto' : '100%',\n\t\t\t\theight: '100%',\n\t\t\t\tdisplay: 'flex',\n\t\t\t\t'flex-direction': 'column',\n\t\t\t\t'align-items': this.flexAlignFromTextAlign,\n\t\t\t\t'justify-content': VERTICAL_ALIGN_FLEX[this.verticalAlign],\n\t\t\t\t// Plain drops the coloured background, not the card padding:\n\t\t\t\t// at 0 the greeting sat flush against the card's left edge.\n\t\t\t\t// Ground has no card, so it has no padding either.\n\t\t\t\tpadding: this.isGround ? '0' : (this.isPlain ? '16px' : '16px 24px'),\n\t\t\t\t'box-sizing': 'border-box',\n\t\t\t\tgap: this.isGround ? '6px' : '8px',\n\t\t\t\t'text-align': this.textAlign,\n\t\t\t}\n\t\t},\n\n\t\t/** Flex cross-axis alignment derived from the text alignment. */\n\t\tflexAlignFromTextAlign() {\n\t\t\tif (this.textAlign === 'left') {\n\t\t\t\treturn 'flex-start'\n\t\t\t}\n\t\t\tif (this.textAlign === 'right') {\n\t\t\t\treturn 'flex-end'\n\t\t\t}\n\t\t\treturn 'center'\n\t\t},\n\n\t\t/** Inline style applying the resolved text colour. */\n\t\ttextStyle() {\n\t\t\treturn {\n\t\t\t\tcolor: this.textColor,\n\t\t\t\tmargin: 0,\n\t\t\t}\n\t\t},\n\n\t\t/** The validated CTA object, or null when incomplete. */\n\t\tcta() {\n\t\t\tconst raw = this.content && this.content.cta\n\t\t\tif (raw === null || typeof raw !== 'object') {\n\t\t\t\treturn null\n\t\t\t}\n\t\t\tconst label = typeof raw.label === 'string' ? raw.label.trim() : ''\n\t\t\tconst url = typeof raw.url === 'string' ? raw.url.trim() : ''\n\t\t\tif (label === '' || url === '') {\n\t\t\t\treturn null\n\t\t\t}\n\t\t\tlet style = raw.style\n\t\t\tif (typeof style !== 'string' || ALLOWED_CTA_STYLES.includes(style) === false) {\n\t\t\t\tstyle = 'primary'\n\t\t\t}\n\t\t\treturn { label, url, style }\n\t\t},\n\n\t\t/** Whether a complete CTA is present. */\n\t\thasCta() {\n\t\t\treturn this.cta !== null\n\t\t},\n\n\t\t/** The CTA label, translated. */\n\t\tctaLabel() {\n\t\t\treturn this.hasCta && this.cta.label ? this.effectiveTranslate(this.cta.label) : ''\n\t\t},\n\n\t\t/** The CTA URL. */\n\t\tctaUrl() {\n\t\t\treturn this.hasCta ? this.cta.url : ''\n\t\t},\n\n\t\t/** Whether the CTA URL is an external http(s) link. */\n\t\tctaIsExternal() {\n\t\t\treturn this.hasCta && /^https?:\\/\\//i.test(this.ctaUrl)\n\t\t},\n\n\t\t/** The CTA anchor target (`_blank` for external links). */\n\t\tctaTarget() {\n\t\t\treturn this.ctaIsExternal ? '_blank' : null\n\t\t},\n\n\t\t/** The CTA anchor rel for external links. */\n\t\tctaRel() {\n\t\t\treturn this.ctaIsExternal ? 'noopener noreferrer' : null\n\t\t},\n\n\t\t/** The accessible CTA label, annotating external links. */\n\t\tctaAriaLabel() {\n\t\t\tif (this.hasCta === false) {\n\t\t\t\treturn null\n\t\t\t}\n\t\t\tif (this.ctaIsExternal) {\n\t\t\t\treturn `${this.ctaLabel} (${t('nextcloud-vue', 'opens in new tab')})`\n\t\t\t}\n\t\t\treturn this.ctaLabel\n\t\t},\n\n\t\t/** The CTA class list (base + style modifier). */\n\t\tctaClasses() {\n\t\t\tif (this.hasCta === false) {\n\t\t\t\treturn []\n\t\t\t}\n\t\t\treturn [\n\t\t\t\t'cn-header-widget__cta',\n\t\t\t\t`cn-header-widget__cta--${this.cta.style}`,\n\t\t\t]\n\t\t},\n\t},\n\n\twatch: {\n\t\tbackgroundImageUrl() {\n\t\t\t// Re-arm the probe so a previously failing URL can recover when\n\t\t\t// the user edits the placement.\n\t\t\tthis.imageFailed = false\n\t\t},\n\t},\n\n\tmethods: {\n\t\t/**\n\t\t * Follow the chosen view: push its route (with the option's `params`\n\t\t * when declared). Nothing happens for the route already shown.\n\t\t *\n\t\t * @spec openspec/changes/zuiddrecht-pixel-gaps/specs/zuiddrecht-pixel-gaps/spec.md#requirement-a-greeting-header-switches-views\n\t\t * @param {string} route The chosen option's route name.\n\t\t * @return {void}\n\t\t */\n\t\tonViewChange(route) {\n\t\t\tif (typeof route === 'string' && route.startsWith(VIEW_OPTION_PREFIX)) {\n\t\t\t\tif (this.cnPageViews && typeof this.cnPageViews.select === 'function') {\n\t\t\t\t\tthis.cnPageViews.select(route.slice(VIEW_OPTION_PREFIX.length))\n\t\t\t\t}\n\t\t\t\treturn\n\t\t\t}\n\t\t\tif (!this.$router || !route || route === (this.$route && this.$route.name)) {\n\t\t\t\treturn\n\t\t\t}\n\t\t\tconst declared = (this.content.views.options || []).find((o) => o && o.route === route) || {}\n\t\t\tconst target = { name: route }\n\t\t\tif (declared.params && typeof declared.params === 'object') {\n\t\t\t\ttarget.params = declared.params\n\t\t\t}\n\t\t\tthis.$router.push(target)\n\t\t},\n\n\t\t/**\n\t\t * Mark the background image as broken so the renderer falls back to\n\t\t * the solid colour.\n\t\t *\n\t\t * @return {void}\n\t\t */\n\t\tonImageError() {\n\t\t\tthis.imageFailed = true\n\t\t},\n\n\t\t/**\n\t\t * Quick perceived-luminance check on a CSS hex colour. Returns true\n\t\t * for \"light\" (white text would be illegible). Non-hex colours\n\t\t * collapse to false (assume dark) — the safer default.\n\t\t *\n\t\t * @param {string} color the CSS colour value.\n\t\t * @return {boolean} true when the colour is perceived as light.\n\t\t */\n\t\tisLightColor(color) {\n\t\t\tif (typeof color !== 'string') {\n\t\t\t\treturn false\n\t\t\t}\n\t\t\tconst match = color.trim().match(/^#([0-9a-f]{6})$/i)\n\t\t\tif (!match) {\n\t\t\t\treturn false\n\t\t\t}\n\t\t\tconst hex = match[1]\n\t\t\tconst r = Number.parseInt(hex.slice(0, 2), 16)\n\t\t\tconst g = Number.parseInt(hex.slice(2, 4), 16)\n\t\t\tconst b = Number.parseInt(hex.slice(4, 6), 16)\n\t\t\tconst luma = (0.299 * r + 0.587 * g + 0.114 * b) / 255\n\t\t\treturn luma > 0.6\n\t\t},\n\t},\n}\n</script>\n\n<style scoped>\n.cn-header-widget {\n\twidth: 100%;\n\theight: 100%;\n\tmin-height: 120px;\n\tborder-radius: var(--border-radius-large, 8px);\n\toverflow: hidden;\n}\n\n.cn-header-widget--plain {\n\tmin-height: 0;\n\tborder-radius: 0;\n}\n\n/* With a view switch the heading and the switch share one row, the switch\n at the right and bottom-aligned with the heading; on a narrow card the\n switch wraps under it. */\n.cn-header-widget--with-views {\n\tdisplay: flex;\n\tflex-wrap: wrap;\n\talign-items: flex-end;\n\tjustify-content: space-between;\n\tgap: calc(2 * var(--default-grid-baseline)) calc(4 * var(--default-grid-baseline));\n}\n\n.cn-header-widget--with-views .cn-header-widget__content {\n\tflex: 1 1 320px;\n\twidth: auto;\n}\n\n.cn-header-widget__views {\n\tposition: relative;\n\tz-index: 1;\n\tflex: 0 0 auto;\n\tpadding: 16px;\n}\n\n/* On the page ground (`content.ground`): no card, so no inset around the\n view switch, and the heading at the board's 32px. */\n.cn-header-widget--ground .cn-header-widget__views {\n\tpadding: 0;\n}\n\n.cn-header-widget--ground .cn-header-widget__title {\n\tfont-size: var(--cn-header-ground-title-size, 32px);\n\tletter-spacing: -0.01em;\n}\n\n.cn-header-widget__date {\n\tfont-size: 14px;\n\tline-height: 1.4;\n\tmargin: 0;\n}\n\n.cn-header-widget__overlay {\n\tposition: absolute;\n\tinset: 0;\n}\n\n.cn-header-widget__content {\n\tposition: relative;\n\tz-index: 1;\n}\n\n.cn-header-widget__title {\n\tfont-size: 28px;\n\tfont-weight: 700;\n\tline-height: 1.2;\n\tmargin: 0;\n}\n\n.cn-header-widget__subtitle {\n\tfont-size: 16px;\n\tline-height: 1.4;\n\tmargin: 0;\n\topacity: 0.95;\n}\n\n.cn-header-widget__cta {\n\tdisplay: inline-block;\n\tmargin-top: 8px;\n\tpadding: 10px 18px;\n\tborder-radius: var(--border-radius, 4px);\n\tfont-size: 14px;\n\tfont-weight: 600;\n\ttext-decoration: none;\n\tcursor: pointer;\n\ttransition: transform 0.15s ease, box-shadow 0.15s ease;\n}\n\n.cn-header-widget__cta:hover {\n\ttransform: translateY(-1px);\n\tbox-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);\n}\n\n.cn-header-widget__cta--primary {\n\tbackground-color: var(--color-primary, #0070c0);\n\tcolor: var(--color-primary-text, #ffffff);\n\tborder: 1px solid var(--color-primary, #0070c0);\n}\n\n.cn-header-widget__cta--secondary {\n\tbackground-color: var(--color-background-hover, rgba(255, 255, 255, 0.85));\n\tcolor: var(--color-main-text, #000000);\n\tborder: 1px solid var(--color-border, #cccccc);\n}\n\n.cn-header-widget__cta--ghost {\n\tbackground-color: transparent;\n\tcolor: inherit;\n\tborder: 1px solid currentColor;\n}\n\n.cn-header-widget__probe {\n\tposition: absolute;\n\twidth: 1px;\n\theight: 1px;\n\topacity: 0;\n\tpointer-events: none;\n\tinset-inline-start: -9999px;\n\ttop: -9999px;\n}\n\n@media print {\n\t.cn-header-widget {\n\t\tprint-color-adjust: exact;\n\t\t-webkit-print-color-adjust: exact;\n\t}\n}\n</style>\n"],"names":["CnSegmentedControl","t"],"mappings":";;;;;AAiEA,MAAM,qBAAsB,GAAE,CAAC,MAAM,EAAE,MAAM,EAAE,iBAAiB,EAAA;AAChE,MAAM,eAAc,GAAI,CAAC,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,QAAQ,EAAA;AAC7D,MAAM,kBAAmB,GAAE,CAAC,MAAM,EAAE,QAAQ,EAAE,OAAO,EAAA;AACrD,MAAM,yBAAyB,CAAC,KAAK,EAAE,QAAQ,EAAE,QAAQ,EAAA;AACzD,MAAM,kBAAiB,GAAI,CAAC,SAAS,EAAE,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CAAC,EAAE,EAAE,EAAA;AAC7C,GAAA,MAAM,IAAG,GAAI,CAAC,KAAI,GAAI,CAAE,GAAE,KAAI,GAAI,CAAA,GAAI,QAAQ,CAAC,IAAI,IAAE;GACrD,OAAO,IAAG,GAAI,GAAE;GAChB;EACD;AACF;;;;"}
@@ -11,7 +11,7 @@ function render(_ctx, _cache, $props, $setup, $data, $options) {
11
11
  const _component_CnSegmentedControl = resolveComponent("CnSegmentedControl");
12
12
 
13
13
  return (openBlock(), createElementBlock("div", {
14
- class: normalizeClass(["cn-header-widget", { 'cn-header-widget--plain': $options.isPlain, 'cn-header-widget--with-views': $options.viewOptions.length > 0 }]),
14
+ class: normalizeClass(["cn-header-widget", { 'cn-header-widget--plain': $options.isPlain, 'cn-header-widget--ground': $options.isGround, 'cn-header-widget--with-views': $options.viewOptions.length > 0 }]),
15
15
  style: normalizeStyle($options.wrapperStyle)
16
16
  }, [
17
17
  ($options.hasOverlay)
@@ -65,9 +65,10 @@ function render(_ctx, _cache, $props, $setup, $data, $options) {
65
65
  options: $options.viewOptions,
66
66
  modelValue: $options.activeView,
67
67
  ariaLabel: $options.viewsLabel,
68
+ controls: $options.viewsRegionId,
68
69
  "data-testid": "cn-header-widget-views",
69
70
  "onUpdate:modelValue": $options.onViewChange
70
- }, null, 8 /* PROPS */, ["options", "modelValue", "ariaLabel", "onUpdate:modelValue"])
71
+ }, null, 8 /* PROPS */, ["options", "modelValue", "ariaLabel", "controls", "onUpdate:modelValue"])
71
72
  ]))
72
73
  : createCommentVNode("v-if", true),
73
74
  ($options.hasBackgroundImage)
@@ -1 +1 @@
1
- {"version":3,"file":"CnHeaderWidget.vue3.js","sources":["../../../../src/components/CnHeaderWidget/CnHeaderWidget.vue?vue&type=template&id=1b97430f&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-header-widget\" :class=\"{ 'cn-header-widget--plain': isPlain, 'cn-header-widget--with-views': viewOptions.length > 0 }\" :style=\"wrapperStyle\">\n\t\t<div\n\t\t\tv-if=\"hasOverlay\"\n\t\t\tclass=\"cn-header-widget__overlay\"\n\t\t\t:style=\"overlayStyle\"\n\t\t\taria-hidden=\"true\" />\n\t\t<div class=\"cn-header-widget__content\" :style=\"contentStyle\">\n\t\t\t<p\n\t\t\t\tv-if=\"dateLine\"\n\t\t\t\tclass=\"cn-header-widget__date\"\n\t\t\t\t:style=\"dateStyle\"\n\t\t\t\tdata-testid=\"cn-header-widget-date\">\n\t\t\t\t{{ dateLine }}\n\t\t\t</p>\n\t\t\t<h2 v-if=\"hasTitle\" class=\"cn-header-widget__title\" :style=\"textStyle\">\n\t\t\t\t{{ headingText }}\n\t\t\t</h2>\n\t\t\t<p v-if=\"hasSubtitle\" class=\"cn-header-widget__subtitle\" :style=\"textStyle\">\n\t\t\t\t{{ subtitle }}\n\t\t\t</p>\n\t\t\t<a\n\t\t\t\tv-if=\"hasCta\"\n\t\t\t\t:href=\"ctaUrl\"\n\t\t\t\t:class=\"ctaClasses\"\n\t\t\t\t:target=\"ctaTarget\"\n\t\t\t\t:rel=\"ctaRel\"\n\t\t\t\t:aria-label=\"ctaAriaLabel\">\n\t\t\t\t{{ ctaLabel }}\n\t\t\t</a>\n\t\t</div>\n\t\t<!-- A view switch at the right of the heading (`content.views`): \"My\n\t\t work / My team\" as a segmented control whose options are routes. -->\n\t\t<div v-if=\"viewOptions.length > 0\" class=\"cn-header-widget__views\">\n\t\t\t<CnSegmentedControl\n\t\t\t\t:options=\"viewOptions\"\n\t\t\t\t:modelValue=\"activeView\"\n\t\t\t\t:ariaLabel=\"viewsLabel\"\n\t\t\t\tdata-testid=\"cn-header-widget-views\"\n\t\t\t\t@update:modelValue=\"onViewChange\" />\n\t\t</div>\n\t\t<img\n\t\t\tv-if=\"hasBackgroundImage\"\n\t\t\tclass=\"cn-header-widget__probe\"\n\t\t\t:src=\"backgroundImageUrl\"\n\t\t\talt=\"\"\n\t\t\taria-hidden=\"true\"\n\t\t\t@error=\"onImageError\">\n\t</div>\n</template>\n\n<script>\nimport { getCurrentUser } from '@nextcloud/auth'\nimport { getCanonicalLocale, translate as t } from '@nextcloud/l10n'\nimport CnSegmentedControl from '../CnSegmentedControl/CnSegmentedControl.vue'\nimport { resolveImageUrl } from '../../utils/resolveImageUrl.js'\n\nconst ALLOWED_OVERLAY_MODES = ['none', 'tint', 'gradient-bottom']\nconst ALLOWED_HEIGHTS = ['small', 'medium', 'large', 'xlarge']\nconst ALLOWED_TEXT_ALIGN = ['left', 'center', 'right']\nconst ALLOWED_VERTICAL_ALIGN = ['top', 'middle', 'bottom']\nconst ALLOWED_CTA_STYLES = ['primary', 'secondary', 'ghost']\n\nconst HEIGHT_PIXELS = Object.freeze({\n\tsmall: 120,\n\tmedium: 200,\n\tlarge: 320,\n\txlarge: 480,\n})\n\nconst VERTICAL_ALIGN_FLEX = Object.freeze({\n\ttop: 'flex-start',\n\tmiddle: 'center',\n\tbottom: 'flex-end',\n})\n\n/**\n * CnHeaderWidget — full-width banner widget for dashboards. Renders a\n * configurable header with title, optional subtitle, optional background\n * image, optional colour overlay, and optional call-to-action button.\n *\n * Image source precedence: `backgroundImageFileId` takes priority over\n * `backgroundImageUrl` (resolved via the Nextcloud core preview route). When\n * the image fails to load the renderer silently falls back to the solid\n * `backgroundColor`; no error UI is shown.\n *\n * Height presets map to fixed pixels: small=120, medium=200, large=320,\n * xlarge=480. Title is `<h2>`, subtitle `<p>`, CTA `<a>` — all semantic HTML.\n * External CTA URLs (http/https) open in a new tab with\n * `rel=\"noopener noreferrer\"`; relative / anchor URLs stay in the current tab.\n *\n * Optional greeting: `greeting: true` makes the heading greet the signed-in\n * user by time of day and first name (\"Good afternoon, Pieter\"; `\"full\"` uses\n * the whole display name), and `showDate: true` adds a line with today's\n * date above it. `plain: true` drops the coloured background and aligns the\n * text to the start, which is how a greeting usually sits on a dashboard.\n *\n * ```json\n * { \"widgetKey\": \"header\", \"props\": { \"content\": { \"greeting\": true, \"showDate\": true, \"plain\": true } } }\n * ```\n *\n * Registered as the `header` dashboard widget type via the renderer's\n * `index.js`.\n */\nexport default {\n\tname: 'CnHeaderWidget',\n\n\tcomponents: { CnSegmentedControl },\n\n\tinject: {\n\t\t/**\n\t\t * Host translate function provided by CnAppRoot as\n\t\t * `cnTranslate: this.translate` (bound to the host app's id). The\n\t\t * manifest-authored `content.title` / `content.subtitle` / CTA label\n\t\t * are run through it. Defaults to an identity function so an\n\t\t * untranslated key renders as itself.\n\t\t */\n\t\tcnTranslate: { default: () => (key) => key },\n\t},\n\n\tprops: {\n\t\t/**\n\t\t * Persisted widget content: `{title, subtitle, backgroundImageUrl,\n\t\t * backgroundImageFileId, backgroundColor, overlayMode, overlayColor,\n\t\t * overlayOpacity, textColor, textAlign, verticalAlign, height, cta,\n\t\t * greeting, showDate, plain, views}`. All fields are optional except\n\t\t * `title` (or `greeting`); unknown enum values collapse to documented\n\t\t * defaults and the renderer never throws. `views` is\n\t\t * `{ ariaLabel?, options: [{ label, route, params? }] }`: a segmented\n\t\t * control at the right of the heading whose checked option is the\n\t\t * current route; choosing another pushes its route.\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/* eslint-disable vue/no-unused-properties -- part of the widget contract: CnContainerChild and the dashboard pages bind :placement on every widget, so declaring it keeps it out of $attrs */\n\t\t/**\n\t\t * Placement entity — reserved to match the renderer contract.\n\t\t *\n\t\t * @type {object}\n\t\t */\n\t\tplacement: {\n\t\t\ttype: Object,\n\t\t\tdefault: null,\n\t\t},\n\t\t/* eslint-enable vue/no-unused-properties */\n\n\t\t/**\n\t\t * The moment the greeting and the date line are computed for. Leave\n\t\t * empty for the current time.\n\t\t *\n\t\t * @type {Date|null}\n\t\t */\n\t\tnow: {\n\t\t\ttype: Date,\n\t\t\tdefault: null,\n\t\t},\n\t},\n\n\tdata() {\n\t\treturn {\n\t\t\t// Set true once the background image fires a DOM `error` so\n\t\t\t// subsequent renders fall back to `backgroundColor` only. The\n\t\t\t// probe `<img>` is invisible — its only job is load-failure\n\t\t\t// detection for the CSS background.\n\t\t\timageFailed: false,\n\t\t}\n\t},\n\n\tcomputed: {\n\t\t/**\n\t\t * Effective translate function: the injected `cnTranslate` (the host\n\t\t * app's bound `t()`), identity by default.\n\t\t *\n\t\t * @return {(key: string) => string}\n\t\t */\n\t\teffectiveTranslate() {\n\t\t\treturn typeof this.cnTranslate === 'function' ? this.cnTranslate : (key) => key\n\t\t},\n\n\t\t/** The header title, translated, or '' when absent. */\n\t\ttitle() {\n\t\t\tconst value = this.content && this.content.title\n\t\t\treturn typeof value === 'string' && value !== '' ? this.effectiveTranslate(value) : ''\n\t\t},\n\n\t\t/** The header subtitle, translated, or '' when absent. */\n\t\tsubtitle() {\n\t\t\tconst value = this.content && this.content.subtitle\n\t\t\treturn typeof value === 'string' && value !== '' ? this.effectiveTranslate(value) : ''\n\t\t},\n\n\t\t/** Whether a heading renders: a non-empty title or a greeting. */\n\t\thasTitle() {\n\t\t\treturn this.headingText !== ''\n\t\t},\n\n\t\t/**\n\t\t * The moment the greeting and date line are computed for.\n\t\t *\n\t\t * @return {Date}\n\t\t * @spec openspec/changes/workplace-dashboard-primitives/specs/workplace-dashboard-primitives/spec.md#requirement-greeting-header\n\t\t */\n\t\treference() {\n\t\t\treturn this.now instanceof Date ? this.now : new Date()\n\t\t},\n\n\t\t/**\n\t\t * The view switch's options from `content.views.options`: each\n\t\t * `{ label, route, params? }` with a non-empty label and route becomes\n\t\t * a segmented-control option keyed on its route name (the label goes\n\t\t * through the host translate function). Empty without a router, so\n\t\t * the switch cannot offer routes it cannot follow.\n\t\t *\n\t\t * @spec openspec/changes/zuiddrecht-pixel-gaps/specs/zuiddrecht-pixel-gaps/spec.md#requirement-a-greeting-header-switches-views\n\t\t * @return {Array<{value: string, label: string}>}\n\t\t */\n\t\tviewOptions() {\n\t\t\tconst raw = this.content && this.content.views && this.content.views.options\n\t\t\tif (!Array.isArray(raw) || !this.$router) {\n\t\t\t\treturn []\n\t\t\t}\n\t\t\treturn raw\n\t\t\t\t.filter((o) => o && typeof o.label === 'string' && o.label !== '' && typeof o.route === 'string' && o.route !== '')\n\t\t\t\t.map((o) => ({ value: o.route, label: this.cnTranslate(o.label) }))\n\t\t},\n\n\t\t/**\n\t\t * The checked view: the option whose route is the current route, else\n\t\t * the first option (a switch always has one checked option).\n\t\t *\n\t\t * @spec openspec/changes/zuiddrecht-pixel-gaps/specs/zuiddrecht-pixel-gaps/spec.md#requirement-a-greeting-header-switches-views\n\t\t * @return {string|null}\n\t\t */\n\t\tactiveView() {\n\t\t\tconst options = this.viewOptions\n\t\t\tif (options.length === 0) {\n\t\t\t\treturn null\n\t\t\t}\n\t\t\tconst current = this.$route && this.$route.name\n\t\t\tconst match = options.find((o) => o.value === current)\n\t\t\treturn match ? match.value : options[0].value\n\t\t},\n\n\t\t/**\n\t\t * Accessible name of the view switch: `content.views.ariaLabel`\n\t\t * through the host translate function, else \"View\".\n\t\t *\n\t\t * @spec openspec/changes/zuiddrecht-pixel-gaps/specs/zuiddrecht-pixel-gaps/spec.md#requirement-a-greeting-header-switches-views\n\t\t * @return {string}\n\t\t */\n\t\tviewsLabel() {\n\t\t\tconst label = this.content && this.content.views && this.content.views.ariaLabel\n\t\t\treturn label ? this.cnTranslate(label) : t('nextcloud-vue', 'View')\n\t\t},\n\n\t\t/**\n\t\t * Whether the plain presentation is on (no coloured background).\n\t\t *\n\t\t * @return {boolean}\n\t\t */\n\t\tisPlain() {\n\t\t\treturn Boolean(this.content && this.content.plain === true)\n\t\t},\n\n\t\t/**\n\t\t * The name the greeting uses: the first word of the display name, or\n\t\t * the whole display name for `greeting: \"full\"`. '' when unknown.\n\t\t *\n\t\t * @return {string}\n\t\t * @spec openspec/changes/workplace-dashboard-primitives/specs/workplace-dashboard-primitives/spec.md#requirement-greeting-header\n\t\t */\n\t\tgreetingName() {\n\t\t\tlet user\n\t\t\ttry {\n\t\t\t\tuser = getCurrentUser()\n\t\t\t} catch {\n\t\t\t\tuser = null\n\t\t\t}\n\t\t\tconst displayName = (user && typeof user.displayName === 'string') ? user.displayName.trim() : ''\n\t\t\tif (displayName === '') {\n\t\t\t\treturn ''\n\t\t\t}\n\t\t\treturn this.content.greeting === 'full' ? displayName : displayName.split(/\\s+/)[0]\n\t\t},\n\n\t\t/**\n\t\t * The greeting for the time of day, with the user's name when known,\n\t\t * or '' when the greeting is off.\n\t\t *\n\t\t * @return {string}\n\t\t * @spec openspec/changes/workplace-dashboard-primitives/specs/workplace-dashboard-primitives/spec.md#requirement-greeting-header\n\t\t */\n\t\tgreetingText() {\n\t\t\tconst greeting = this.content && this.content.greeting\n\t\t\tif (greeting !== true && greeting !== 'full' && greeting !== 'first') {\n\t\t\t\treturn ''\n\t\t\t}\n\t\t\tconst hour = this.reference.getHours()\n\t\t\tconst name = this.greetingName\n\t\t\tif (hour < 12) {\n\t\t\t\treturn name ? t('nextcloud-vue', 'Good morning, {name}', { name }) : t('nextcloud-vue', 'Good morning')\n\t\t\t}\n\t\t\tif (hour < 18) {\n\t\t\t\treturn name ? t('nextcloud-vue', 'Good afternoon, {name}', { name }) : t('nextcloud-vue', 'Good afternoon')\n\t\t\t}\n\t\t\treturn name ? t('nextcloud-vue', 'Good evening, {name}', { name }) : t('nextcloud-vue', 'Good evening')\n\t\t},\n\n\t\t/**\n\t\t * The heading: the greeting when it is on, else the title.\n\t\t *\n\t\t * @return {string}\n\t\t * @spec openspec/changes/workplace-dashboard-primitives/specs/workplace-dashboard-primitives/spec.md#requirement-greeting-header\n\t\t */\n\t\theadingText() {\n\t\t\treturn this.greetingText || this.title\n\t\t},\n\n\t\t/**\n\t\t * Today's date written out (\"Monday 5 October 2026\"), or '' when\n\t\t * `showDate` is off.\n\t\t *\n\t\t * @return {string}\n\t\t * @spec openspec/changes/workplace-dashboard-primitives/specs/workplace-dashboard-primitives/spec.md#requirement-greeting-header\n\t\t */\n\t\tdateLine() {\n\t\t\tif (!this.content || this.content.showDate !== true) {\n\t\t\t\treturn ''\n\t\t\t}\n\t\t\tconst options = { weekday: 'long', day: 'numeric', month: 'long', year: 'numeric' }\n\t\t\tlet locale\n\t\t\ttry {\n\t\t\t\tlocale = getCanonicalLocale()\n\t\t\t} catch {\n\t\t\t\tlocale = undefined\n\t\t\t}\n\t\t\ttry {\n\t\t\t\treturn new Intl.DateTimeFormat(locale || undefined, options).format(this.reference)\n\t\t\t} catch {\n\t\t\t\treturn new Intl.DateTimeFormat(undefined, options).format(this.reference)\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * Inline style of the date line: the heading's colour, or the muted\n\t\t * text colour on a plain header.\n\t\t *\n\t\t * @return {object}\n\t\t * @spec openspec/changes/workplace-dashboard-primitives/specs/workplace-dashboard-primitives/spec.md#requirement-greeting-header\n\t\t */\n\t\tdateStyle() {\n\t\t\treturn {\n\t\t\t\tcolor: this.isPlain && !(this.content && this.content.textColor) ? 'var(--color-text-maxcontrast)' : this.textColor,\n\t\t\t\tmargin: 0,\n\t\t\t}\n\t\t},\n\n\t\t/** Whether a non-empty subtitle is set. */\n\t\thasSubtitle() {\n\t\t\treturn this.subtitle !== ''\n\t\t},\n\n\t\t/** Resolved background image URL (file id wins over URL). */\n\t\tbackgroundImageUrl() {\n\t\t\tconst fileId = this.content && this.content.backgroundImageFileId\n\t\t\tif (typeof fileId === 'number' && Number.isFinite(fileId) && fileId > 0) {\n\t\t\t\treturn `/index.php/core/preview?fileId=${fileId}&x=1024&y=512&a=1`\n\t\t\t}\n\t\t\tconst url = this.content && this.content.backgroundImageUrl\n\t\t\t// Accept http(s) plus uploaded/same-origin sources: data: and blob:\n\t\t\t// (from the form's upload) and root-relative paths (NC files/preview).\n\t\t\t// External http(s) images may still be blocked by the instance CSP —\n\t\t\t// uploading is the reliable, same-origin path. resolveImageUrl() adds\n\t\t\t// the webroot + /index.php to `/apps/...` resource paths so they load\n\t\t\t// on index.php-routed instances (other shapes pass through).\n\t\t\tif (typeof url === 'string' && /^(https?:\\/\\/|data:|blob:|\\/)/i.test(url)) {\n\t\t\t\treturn resolveImageUrl(url)\n\t\t\t}\n\t\t\treturn ''\n\t\t},\n\n\t\t/** Whether a usable, non-errored background image is present. */\n\t\thasBackgroundImage() {\n\t\t\treturn this.backgroundImageUrl !== '' && this.imageFailed === false\n\t\t},\n\n\t\t/**\n\t\t * Resolved background colour (default theme primary).\n\t\t *\n\t\t * @spec openspec/changes/workplace-dashboard-primitives/specs/workplace-dashboard-primitives/spec.md#requirement-greeting-header\n\t\t */\n\t\tbackgroundColor() {\n\t\t\tconst value = this.content && this.content.backgroundColor\n\t\t\tif (typeof value === 'string' && value !== '') {\n\t\t\t\treturn value\n\t\t\t}\n\t\t\tif (this.isPlain) {\n\t\t\t\treturn 'transparent'\n\t\t\t}\n\t\t\treturn 'var(--color-primary, #0070c0)'\n\t\t},\n\n\t\t/** Resolved overlay mode (`tint` when an image is present, else `none`). */\n\t\toverlayMode() {\n\t\t\tconst declared = this.content && this.content.overlayMode\n\t\t\tif (typeof declared === 'string' && ALLOWED_OVERLAY_MODES.includes(declared)) {\n\t\t\t\treturn declared\n\t\t\t}\n\t\t\treturn this.hasBackgroundImage ? 'tint' : 'none'\n\t\t},\n\n\t\t/** Whether an overlay should render. */\n\t\thasOverlay() {\n\t\t\treturn this.overlayMode !== 'none'\n\t\t},\n\n\t\t/** Resolved overlay colour. */\n\t\toverlayColor() {\n\t\t\tconst value = this.content && this.content.overlayColor\n\t\t\tif (typeof value === 'string' && value !== '') {\n\t\t\t\treturn value\n\t\t\t}\n\t\t\tconst bg = this.content && this.content.backgroundColor\n\t\t\treturn (typeof bg === 'string' && bg !== '') ? bg : '#000000'\n\t\t},\n\n\t\t/** Resolved overlay opacity, clamped to 0..1 (default 0.4). */\n\t\toverlayOpacity() {\n\t\t\tconst raw = this.content && this.content.overlayOpacity\n\t\t\tconst value = typeof raw === 'number' ? raw : Number.parseFloat(raw)\n\t\t\tif (Number.isFinite(value) === false) {\n\t\t\t\treturn 0.4\n\t\t\t}\n\t\t\tif (value < 0) {\n\t\t\t\treturn 0\n\t\t\t}\n\t\t\tif (value > 1) {\n\t\t\t\treturn 1\n\t\t\t}\n\t\t\treturn value\n\t\t},\n\n\t\t/** Resolved height preset key (default `medium`). */\n\t\theight() {\n\t\t\tconst declared = this.content && this.content.height\n\t\t\tif (typeof declared === 'string' && ALLOWED_HEIGHTS.includes(declared)) {\n\t\t\t\treturn declared\n\t\t\t}\n\t\t\treturn 'medium'\n\t\t},\n\n\t\t/** The pixel height for the active preset. */\n\t\theightPixels() {\n\t\t\treturn HEIGHT_PIXELS[this.height]\n\t\t},\n\n\t\t/**\n\t\t * Resolved text alignment (default `center`).\n\t\t *\n\t\t * @spec openspec/changes/workplace-dashboard-primitives/specs/workplace-dashboard-primitives/spec.md#requirement-greeting-header\n\t\t */\n\t\ttextAlign() {\n\t\t\tconst declared = this.content && this.content.textAlign\n\t\t\tif (typeof declared === 'string' && ALLOWED_TEXT_ALIGN.includes(declared)) {\n\t\t\t\treturn declared\n\t\t\t}\n\t\t\treturn this.isPlain ? 'left' : 'center'\n\t\t},\n\n\t\t/** Resolved vertical alignment (default `middle`). */\n\t\tverticalAlign() {\n\t\t\tconst declared = this.content && this.content.verticalAlign\n\t\t\tif (typeof declared === 'string' && ALLOWED_VERTICAL_ALIGN.includes(declared)) {\n\t\t\t\treturn declared\n\t\t\t}\n\t\t\treturn 'middle'\n\t\t},\n\n\t\t/**\n\t\t * Resolved text colour with an auto-contrast fallback.\n\t\t *\n\t\t * @spec openspec/changes/workplace-dashboard-primitives/specs/workplace-dashboard-primitives/spec.md#requirement-greeting-header\n\t\t */\n\t\ttextColor() {\n\t\t\tconst value = this.content && this.content.textColor\n\t\t\tif (typeof value === 'string' && value !== '') {\n\t\t\t\treturn value\n\t\t\t}\n\t\t\tif (this.hasBackgroundImage) {\n\t\t\t\treturn '#ffffff'\n\t\t\t}\n\t\t\tif (this.isPlain && !(this.content && this.content.backgroundColor)) {\n\t\t\t\treturn 'var(--color-main-text)'\n\t\t\t}\n\t\t\treturn this.isLightColor(this.backgroundColor) ? '#000000' : '#ffffff'\n\t\t},\n\n\t\t/** Inline style for the banner wrapper. */\n\t\twrapperStyle() {\n\t\t\tconst style = {\n\t\t\t\tposition: 'relative',\n\t\t\t\twidth: '100%',\n\t\t\t\t// Fill the dashboard grid cell so the banner resizes with the\n\t\t\t\t// widget. A fixed pixel height ignored the cell, which made the\n\t\t\t\t// banner un-resizable and made it overflow/scroll inside a\n\t\t\t\t// smaller cell. The grid controls the size now.\n\t\t\t\theight: '100%',\n\t\t\t\toverflow: 'hidden',\n\t\t\t\t'background-color': this.backgroundColor,\n\t\t\t}\n\t\t\tif (this.hasBackgroundImage) {\n\t\t\t\tstyle['background-image'] = `url(\"${this.backgroundImageUrl}\")`\n\t\t\t\tstyle['background-size'] = 'cover'\n\t\t\t\tstyle['background-position'] = 'center center'\n\t\t\t\tstyle['background-repeat'] = 'no-repeat'\n\t\t\t}\n\t\t\treturn style\n\t\t},\n\n\t\t/** Inline style for the overlay layer. */\n\t\toverlayStyle() {\n\t\t\tif (this.overlayMode === 'gradient-bottom') {\n\t\t\t\treturn {\n\t\t\t\t\tposition: 'absolute',\n\t\t\t\t\tinset: 0,\n\t\t\t\t\t'background-image': `linear-gradient(to bottom, transparent 50%, ${this.overlayColor} 100%)`,\n\t\t\t\t\t'pointer-events': 'none',\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn {\n\t\t\t\tposition: 'absolute',\n\t\t\t\tinset: 0,\n\t\t\t\t'background-color': this.overlayColor,\n\t\t\t\topacity: String(this.overlayOpacity),\n\t\t\t\t'pointer-events': 'none',\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * Inline style for the content flex container.\n\t\t *\n\t\t * @spec openspec/changes/workplace-dashboard-primitives/specs/workplace-dashboard-primitives/spec.md#requirement-greeting-header\n\t\t */\n\t\tcontentStyle() {\n\t\t\treturn {\n\t\t\t\tposition: 'relative',\n\t\t\t\t'z-index': 1,\n\t\t\t\t// Beside a view switch the content shares the row instead of\n\t\t\t\t// taking the whole width (see .cn-header-widget--with-views).\n\t\t\t\twidth: this.viewOptions.length > 0 ? 'auto' : '100%',\n\t\t\t\theight: '100%',\n\t\t\t\tdisplay: 'flex',\n\t\t\t\t'flex-direction': 'column',\n\t\t\t\t'align-items': this.flexAlignFromTextAlign,\n\t\t\t\t'justify-content': VERTICAL_ALIGN_FLEX[this.verticalAlign],\n\t\t\t\t// Plain drops the coloured background, not the card padding:\n\t\t\t\t// at 0 the greeting sat flush against the card's left edge.\n\t\t\t\tpadding: this.isPlain ? '16px' : '16px 24px',\n\t\t\t\t'box-sizing': 'border-box',\n\t\t\t\tgap: '8px',\n\t\t\t\t'text-align': this.textAlign,\n\t\t\t}\n\t\t},\n\n\t\t/** Flex cross-axis alignment derived from the text alignment. */\n\t\tflexAlignFromTextAlign() {\n\t\t\tif (this.textAlign === 'left') {\n\t\t\t\treturn 'flex-start'\n\t\t\t}\n\t\t\tif (this.textAlign === 'right') {\n\t\t\t\treturn 'flex-end'\n\t\t\t}\n\t\t\treturn 'center'\n\t\t},\n\n\t\t/** Inline style applying the resolved text colour. */\n\t\ttextStyle() {\n\t\t\treturn {\n\t\t\t\tcolor: this.textColor,\n\t\t\t\tmargin: 0,\n\t\t\t}\n\t\t},\n\n\t\t/** The validated CTA object, or null when incomplete. */\n\t\tcta() {\n\t\t\tconst raw = this.content && this.content.cta\n\t\t\tif (raw === null || typeof raw !== 'object') {\n\t\t\t\treturn null\n\t\t\t}\n\t\t\tconst label = typeof raw.label === 'string' ? raw.label.trim() : ''\n\t\t\tconst url = typeof raw.url === 'string' ? raw.url.trim() : ''\n\t\t\tif (label === '' || url === '') {\n\t\t\t\treturn null\n\t\t\t}\n\t\t\tlet style = raw.style\n\t\t\tif (typeof style !== 'string' || ALLOWED_CTA_STYLES.includes(style) === false) {\n\t\t\t\tstyle = 'primary'\n\t\t\t}\n\t\t\treturn { label, url, style }\n\t\t},\n\n\t\t/** Whether a complete CTA is present. */\n\t\thasCta() {\n\t\t\treturn this.cta !== null\n\t\t},\n\n\t\t/** The CTA label, translated. */\n\t\tctaLabel() {\n\t\t\treturn this.hasCta && this.cta.label ? this.effectiveTranslate(this.cta.label) : ''\n\t\t},\n\n\t\t/** The CTA URL. */\n\t\tctaUrl() {\n\t\t\treturn this.hasCta ? this.cta.url : ''\n\t\t},\n\n\t\t/** Whether the CTA URL is an external http(s) link. */\n\t\tctaIsExternal() {\n\t\t\treturn this.hasCta && /^https?:\\/\\//i.test(this.ctaUrl)\n\t\t},\n\n\t\t/** The CTA anchor target (`_blank` for external links). */\n\t\tctaTarget() {\n\t\t\treturn this.ctaIsExternal ? '_blank' : null\n\t\t},\n\n\t\t/** The CTA anchor rel for external links. */\n\t\tctaRel() {\n\t\t\treturn this.ctaIsExternal ? 'noopener noreferrer' : null\n\t\t},\n\n\t\t/** The accessible CTA label, annotating external links. */\n\t\tctaAriaLabel() {\n\t\t\tif (this.hasCta === false) {\n\t\t\t\treturn null\n\t\t\t}\n\t\t\tif (this.ctaIsExternal) {\n\t\t\t\treturn `${this.ctaLabel} (${t('nextcloud-vue', 'opens in new tab')})`\n\t\t\t}\n\t\t\treturn this.ctaLabel\n\t\t},\n\n\t\t/** The CTA class list (base + style modifier). */\n\t\tctaClasses() {\n\t\t\tif (this.hasCta === false) {\n\t\t\t\treturn []\n\t\t\t}\n\t\t\treturn [\n\t\t\t\t'cn-header-widget__cta',\n\t\t\t\t`cn-header-widget__cta--${this.cta.style}`,\n\t\t\t]\n\t\t},\n\t},\n\n\twatch: {\n\t\tbackgroundImageUrl() {\n\t\t\t// Re-arm the probe so a previously failing URL can recover when\n\t\t\t// the user edits the placement.\n\t\t\tthis.imageFailed = false\n\t\t},\n\t},\n\n\tmethods: {\n\t\t/**\n\t\t * Follow the chosen view: push its route (with the option's `params`\n\t\t * when declared). Nothing happens for the route already shown.\n\t\t *\n\t\t * @spec openspec/changes/zuiddrecht-pixel-gaps/specs/zuiddrecht-pixel-gaps/spec.md#requirement-a-greeting-header-switches-views\n\t\t * @param {string} route The chosen option's route name.\n\t\t * @return {void}\n\t\t */\n\t\tonViewChange(route) {\n\t\t\tif (!this.$router || !route || route === (this.$route && this.$route.name)) {\n\t\t\t\treturn\n\t\t\t}\n\t\t\tconst declared = (this.content.views.options || []).find((o) => o && o.route === route) || {}\n\t\t\tconst target = { name: route }\n\t\t\tif (declared.params && typeof declared.params === 'object') {\n\t\t\t\ttarget.params = declared.params\n\t\t\t}\n\t\t\tthis.$router.push(target)\n\t\t},\n\n\t\t/**\n\t\t * Mark the background image as broken so the renderer falls back to\n\t\t * the solid colour.\n\t\t *\n\t\t * @return {void}\n\t\t */\n\t\tonImageError() {\n\t\t\tthis.imageFailed = true\n\t\t},\n\n\t\t/**\n\t\t * Quick perceived-luminance check on a CSS hex colour. Returns true\n\t\t * for \"light\" (white text would be illegible). Non-hex colours\n\t\t * collapse to false (assume dark) — the safer default.\n\t\t *\n\t\t * @param {string} color the CSS colour value.\n\t\t * @return {boolean} true when the colour is perceived as light.\n\t\t */\n\t\tisLightColor(color) {\n\t\t\tif (typeof color !== 'string') {\n\t\t\t\treturn false\n\t\t\t}\n\t\t\tconst match = color.trim().match(/^#([0-9a-f]{6})$/i)\n\t\t\tif (!match) {\n\t\t\t\treturn false\n\t\t\t}\n\t\t\tconst hex = match[1]\n\t\t\tconst r = Number.parseInt(hex.slice(0, 2), 16)\n\t\t\tconst g = Number.parseInt(hex.slice(2, 4), 16)\n\t\t\tconst b = Number.parseInt(hex.slice(4, 6), 16)\n\t\t\tconst luma = (0.299 * r + 0.587 * g + 0.114 * b) / 255\n\t\t\treturn luma > 0.6\n\t\t},\n\t},\n}\n</script>\n\n<style scoped>\n.cn-header-widget {\n\twidth: 100%;\n\theight: 100%;\n\tmin-height: 120px;\n\tborder-radius: var(--border-radius-large, 8px);\n\toverflow: hidden;\n}\n\n.cn-header-widget--plain {\n\tmin-height: 0;\n\tborder-radius: 0;\n}\n\n/* With a view switch the heading and the switch share one row, the switch\n at the right and bottom-aligned with the heading; on a narrow card the\n switch wraps under it. */\n.cn-header-widget--with-views {\n\tdisplay: flex;\n\tflex-wrap: wrap;\n\talign-items: flex-end;\n\tjustify-content: space-between;\n\tgap: calc(2 * var(--default-grid-baseline)) calc(4 * var(--default-grid-baseline));\n}\n\n.cn-header-widget--with-views .cn-header-widget__content {\n\tflex: 1 1 320px;\n\twidth: auto;\n}\n\n.cn-header-widget__views {\n\tposition: relative;\n\tz-index: 1;\n\tflex: 0 0 auto;\n\tpadding: 16px;\n}\n\n.cn-header-widget__date {\n\tfont-size: 14px;\n\tline-height: 1.4;\n\tmargin: 0;\n}\n\n.cn-header-widget__overlay {\n\tposition: absolute;\n\tinset: 0;\n}\n\n.cn-header-widget__content {\n\tposition: relative;\n\tz-index: 1;\n}\n\n.cn-header-widget__title {\n\tfont-size: 28px;\n\tfont-weight: 700;\n\tline-height: 1.2;\n\tmargin: 0;\n}\n\n.cn-header-widget__subtitle {\n\tfont-size: 16px;\n\tline-height: 1.4;\n\tmargin: 0;\n\topacity: 0.95;\n}\n\n.cn-header-widget__cta {\n\tdisplay: inline-block;\n\tmargin-top: 8px;\n\tpadding: 10px 18px;\n\tborder-radius: var(--border-radius, 4px);\n\tfont-size: 14px;\n\tfont-weight: 600;\n\ttext-decoration: none;\n\tcursor: pointer;\n\ttransition: transform 0.15s ease, box-shadow 0.15s ease;\n}\n\n.cn-header-widget__cta:hover {\n\ttransform: translateY(-1px);\n\tbox-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);\n}\n\n.cn-header-widget__cta--primary {\n\tbackground-color: var(--color-primary, #0070c0);\n\tcolor: var(--color-primary-text, #ffffff);\n\tborder: 1px solid var(--color-primary, #0070c0);\n}\n\n.cn-header-widget__cta--secondary {\n\tbackground-color: var(--color-background-hover, rgba(255, 255, 255, 0.85));\n\tcolor: var(--color-main-text, #000000);\n\tborder: 1px solid var(--color-border, #cccccc);\n}\n\n.cn-header-widget__cta--ghost {\n\tbackground-color: transparent;\n\tcolor: inherit;\n\tborder: 1px solid currentColor;\n}\n\n.cn-header-widget__probe {\n\tposition: absolute;\n\twidth: 1px;\n\theight: 1px;\n\topacity: 0;\n\tpointer-events: none;\n\tinset-inline-start: -9999px;\n\ttop: -9999px;\n}\n\n@media print {\n\t.cn-header-widget {\n\t\tprint-color-adjust: exact;\n\t\t-webkit-print-color-adjust: exact;\n\t}\n}\n</style>\n"],"names":["_createElementBlock","_createElementVNode","_openBlock","_createVNode"],"mappings":";;;;;AA2CqC,EAAA,KAAE,EAAA,yBAAA;;;;;;;uBAhCpCA;AAAG,IAAA,KAAK,kBAAC,kBAAW,EAAA,EAAA,yBAAA,EAAA,gBAAA,EAAA,8BAAA,EAAA,QAAA,CAAA,WAAA,CAAA,MAAA,GAAA,CAAA,EAAA,CAAA,CAAA;AAAA,IAAA,KAAA,iBAAA,QAAA,CAAA,YAAA,CAAA;;KAEnB,QAAA,CAAA,UAAA;sBADFA,kBAImB,CAAA,KAAA,EAAA;;AAFjB,UAAA,KAAI,EAAC,2BAAS;AACd,UAAA,KAAK,iBAAE,QAAY,CAAA,YAAA,CAAA;AACnB,UAAA,aAAU,EAAC,MAAM;;;IACjBC,kBAuBI,CAAA,KAAA,EAAA;AAvBD,MAAA,KAAK,EAAC,2BAA0B;AAAA,MAAA,KAAA,iBAAA,QAAA,CAAA,YAAA,CAAA;;OAEjC,QAAA,CAAA,QAAA;0CAKC,CAAA,GAAA,EAAA;;AAJH,YAAA,KAAK,EAAC,wBAAwB;AAC7B,YAAA,KAAK,iBAAE,QAAQ,CAAA,SAAA,CAAA;AAChB,YAAA,aAAG,EAAA,uBAAA;6BACA,QAAQ,CAAA,QAAA,CAAA,EAAA,CAAA,mBAAA;;OAET,QAAA,CAAA,QAAA;wBAAHD,kBAEK,CAAA,IAAA,EAAA;;AAFF,YAAA,KAAA,EAAA,yBAAA;AAAA,YAAA,KAAA,iBAAA,QAAA,CAAA,SAAA,CAAA;6BACF,QAAA,CAAA,WAAA,CAAA,EAAA,CAAA,mBAAA;;OAEQ,QAAK,CAAA,WAAA;0CAEV,CAAA,GAAA,EAAA;;AAFU,YAAA,KAAA,EAAA,4BAAA;AAAA,YAAA,KAAA,iBAAA,QAAA,CAAA,SAAA,CAAA;6BACV,QAAQ,CAAA,QAAA,CAAA,EAAA,CAAA,mBAAA;;OAGL,QAAM,CAAA,MAAA;0CAOT,CAAA,GAAA,EAAA;;AANF,YAAA,IAAI,EAAE,QAAM,CAAA,MAAA;AACZ,YAAA,KAAC,iBAAA,QAAA,CAAA,UAAA,CAAA;AACD,YAAA,MAAE,EAAA,QAAA,CAAA,SAAA;AACF,YAAA,GAAI,EAAC,QAAM,CAAA,MAAA;wBACD,EAAE,QAAY,CAAA,YAAA;6BACtB,QAAQ,CAAA,QAAA,CAAA,EAAA,EAAA,2BAAA,UAAA,CAAA;;;AAKF,IAAA,CAAA,QAAA,CAAA,WAAW,CAAC,MAAM,GAAA,CAAA;AAA3B,SAAAE,SAAA,EAAA,EAAAF,kBAAA,CAOI,OAPJ,UAOI,EAAA;UANJG,WAKuB,CAAA,6BAAA,EAAA;AAJtB,YAAA,OAAE,EAAA,QAAA,CAAA,WAAA;AACF,YAAA,UAAA,EAAA,QAAA,CAAA,UAAA;AACA,YAAA,SAAS,EAAE,QAAU,CAAA,UAAA;AACtB,YAAA,aAAW,EAAC,wBAAiB;AAC5B,YAAA,qBAAiB,EAAE,QAAG,CAAA,YAAA;;;;KAGlB,QAAe,CAAA,kBAAA;sBADrBH;;AAEA,UAAA,KAAG,EAAA,yBAAA;;;;;;;;;;;;"}
1
+ {"version":3,"file":"CnHeaderWidget.vue3.js","sources":["../../../../src/components/CnHeaderWidget/CnHeaderWidget.vue?vue&type=template&id=1b97430f&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-header-widget\" :class=\"{ 'cn-header-widget--plain': isPlain, 'cn-header-widget--ground': isGround, 'cn-header-widget--with-views': viewOptions.length > 0 }\" :style=\"wrapperStyle\">\n\t\t<div\n\t\t\tv-if=\"hasOverlay\"\n\t\t\tclass=\"cn-header-widget__overlay\"\n\t\t\t:style=\"overlayStyle\"\n\t\t\taria-hidden=\"true\" />\n\t\t<div class=\"cn-header-widget__content\" :style=\"contentStyle\">\n\t\t\t<p\n\t\t\t\tv-if=\"dateLine\"\n\t\t\t\tclass=\"cn-header-widget__date\"\n\t\t\t\t:style=\"dateStyle\"\n\t\t\t\tdata-testid=\"cn-header-widget-date\">\n\t\t\t\t{{ dateLine }}\n\t\t\t</p>\n\t\t\t<h2 v-if=\"hasTitle\" class=\"cn-header-widget__title\" :style=\"textStyle\">\n\t\t\t\t{{ headingText }}\n\t\t\t</h2>\n\t\t\t<p v-if=\"hasSubtitle\" class=\"cn-header-widget__subtitle\" :style=\"textStyle\">\n\t\t\t\t{{ subtitle }}\n\t\t\t</p>\n\t\t\t<a\n\t\t\t\tv-if=\"hasCta\"\n\t\t\t\t:href=\"ctaUrl\"\n\t\t\t\t:class=\"ctaClasses\"\n\t\t\t\t:target=\"ctaTarget\"\n\t\t\t\t:rel=\"ctaRel\"\n\t\t\t\t:aria-label=\"ctaAriaLabel\">\n\t\t\t\t{{ ctaLabel }}\n\t\t\t</a>\n\t\t</div>\n\t\t<!-- A view switch at the right of the heading (`content.views`): \"My\n\t\t work / My team\" as a segmented control whose options are routes,\n\t\t or views of the page the widget sits on (`option.view`); a view\n\t\t option controls the page's view region. -->\n\t\t<div v-if=\"viewOptions.length > 0\" class=\"cn-header-widget__views\">\n\t\t\t<CnSegmentedControl\n\t\t\t\t:options=\"viewOptions\"\n\t\t\t\t:modelValue=\"activeView\"\n\t\t\t\t:ariaLabel=\"viewsLabel\"\n\t\t\t\t:controls=\"viewsRegionId\"\n\t\t\t\tdata-testid=\"cn-header-widget-views\"\n\t\t\t\t@update:modelValue=\"onViewChange\" />\n\t\t</div>\n\t\t<img\n\t\t\tv-if=\"hasBackgroundImage\"\n\t\t\tclass=\"cn-header-widget__probe\"\n\t\t\t:src=\"backgroundImageUrl\"\n\t\t\talt=\"\"\n\t\t\taria-hidden=\"true\"\n\t\t\t@error=\"onImageError\">\n\t</div>\n</template>\n\n<script>\nimport { getCurrentUser } from '@nextcloud/auth'\nimport { getCanonicalLocale, translate as t } from '@nextcloud/l10n'\nimport CnSegmentedControl from '../CnSegmentedControl/CnSegmentedControl.vue'\nimport { resolveImageUrl } from '../../utils/resolveImageUrl.js'\n\nconst ALLOWED_OVERLAY_MODES = ['none', 'tint', 'gradient-bottom']\nconst ALLOWED_HEIGHTS = ['small', 'medium', 'large', 'xlarge']\nconst ALLOWED_TEXT_ALIGN = ['left', 'center', 'right']\nconst ALLOWED_VERTICAL_ALIGN = ['top', 'middle', 'bottom']\nconst ALLOWED_CTA_STYLES = ['primary', 'secondary', 'ghost']\n\n/** Marks a switch option that selects a page view rather than a route. */\nconst VIEW_OPTION_PREFIX = 'view:'\n\nconst HEIGHT_PIXELS = Object.freeze({\n\tsmall: 120,\n\tmedium: 200,\n\tlarge: 320,\n\txlarge: 480,\n})\n\nconst VERTICAL_ALIGN_FLEX = Object.freeze({\n\ttop: 'flex-start',\n\tmiddle: 'center',\n\tbottom: 'flex-end',\n})\n\n/**\n * CnHeaderWidget — full-width banner widget for dashboards. Renders a\n * configurable header with title, optional subtitle, optional background\n * image, optional colour overlay, and optional call-to-action button.\n *\n * Image source precedence: `backgroundImageFileId` takes priority over\n * `backgroundImageUrl` (resolved via the Nextcloud core preview route). When\n * the image fails to load the renderer silently falls back to the solid\n * `backgroundColor`; no error UI is shown.\n *\n * Height presets map to fixed pixels: small=120, medium=200, large=320,\n * xlarge=480. Title is `<h2>`, subtitle `<p>`, CTA `<a>` — all semantic HTML.\n * External CTA URLs (http/https) open in a new tab with\n * `rel=\"noopener noreferrer\"`; relative / anchor URLs stay in the current tab.\n *\n * Optional greeting: `greeting: true` makes the heading greet the signed-in\n * user by time of day and first name (\"Good afternoon, Pieter\"; `\"full\"` uses\n * the whole display name), and `showDate: true` adds a line with today's\n * date above it. `plain: true` drops the coloured background and aligns the\n * text to the start, which is how a greeting usually sits on a dashboard.\n *\n * ```json\n * { \"widgetKey\": \"header\", \"props\": { \"content\": { \"greeting\": true, \"showDate\": true, \"plain\": true } } }\n * ```\n *\n * Registered as the `header` dashboard widget type via the renderer's\n * `index.js`.\n */\nexport default {\n\tname: 'CnHeaderWidget',\n\n\tcomponents: { CnSegmentedControl },\n\n\tinject: {\n\t\t/**\n\t\t * Host translate function provided by CnAppRoot as\n\t\t * `cnTranslate: this.translate` (bound to the host app's id). The\n\t\t * manifest-authored `content.title` / `content.subtitle` / CTA label\n\t\t * are run through it. Defaults to an identity function so an\n\t\t * untranslated key renders as itself.\n\t\t */\n\t\tcnTranslate: { default: () => (key) => key },\n\t\t/**\n\t\t * The views of the page this widget sits on, provided by\n\t\t * CnDashboardPage / CnDetailPage (`views`). An option with a `view`\n\t\t * selects one of them. Null outside such a page.\n\t\t */\n\t\tcnPageViews: { default: null },\n\t},\n\n\tprops: {\n\t\t/**\n\t\t * Persisted widget content: `{title, subtitle, backgroundImageUrl,\n\t\t * backgroundImageFileId, backgroundColor, overlayMode, overlayColor,\n\t\t * overlayOpacity, textColor, textAlign, verticalAlign, height, cta,\n\t\t * greeting, showDate, plain, ground, views}`. All fields are optional except\n\t\t * `title` (or `greeting`); unknown enum values collapse to documented\n\t\t * defaults and the renderer never throws. `views` is\n\t\t * `{ ariaLabel?, options: [{ label, route, params? } | { label, view }] }`:\n\t\t * a segmented control at the right of the heading whose checked option\n\t\t * is the current route; choosing another pushes its route. An option\n\t\t * with `view` selects that view of the page the widget sits on (the\n\t\t * page's `views`) instead, and the page then draws no switch of its\n\t\t * own. `ground: true`\n\t\t * draws the greeting on the page ground: the plain look with no\n\t\t * padding, a 32px heading and the date line 6px above it (a dashboard\n\t\t * also drops the widget's card for it).\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/* eslint-disable vue/no-unused-properties -- part of the widget contract: CnContainerChild and the dashboard pages bind :placement on every widget, so declaring it keeps it out of $attrs */\n\t\t/**\n\t\t * Placement entity — reserved to match the renderer contract.\n\t\t *\n\t\t * @type {object}\n\t\t */\n\t\tplacement: {\n\t\t\ttype: Object,\n\t\t\tdefault: null,\n\t\t},\n\t\t/* eslint-enable vue/no-unused-properties */\n\n\t\t/**\n\t\t * The moment the greeting and the date line are computed for. Leave\n\t\t * empty for the current time.\n\t\t *\n\t\t * @type {Date|null}\n\t\t */\n\t\tnow: {\n\t\t\ttype: Date,\n\t\t\tdefault: null,\n\t\t},\n\t},\n\n\tdata() {\n\t\treturn {\n\t\t\t// Set true once the background image fires a DOM `error` so\n\t\t\t// subsequent renders fall back to `backgroundColor` only. The\n\t\t\t// probe `<img>` is invisible — its only job is load-failure\n\t\t\t// detection for the CSS background.\n\t\t\timageFailed: false,\n\t\t}\n\t},\n\n\tcomputed: {\n\t\t/**\n\t\t * Effective translate function: the injected `cnTranslate` (the host\n\t\t * app's bound `t()`), identity by default.\n\t\t *\n\t\t * @return {(key: string) => string}\n\t\t */\n\t\teffectiveTranslate() {\n\t\t\treturn typeof this.cnTranslate === 'function' ? this.cnTranslate : (key) => key\n\t\t},\n\n\t\t/** The header title, translated, or '' when absent. */\n\t\ttitle() {\n\t\t\tconst value = this.content && this.content.title\n\t\t\treturn typeof value === 'string' && value !== '' ? this.effectiveTranslate(value) : ''\n\t\t},\n\n\t\t/** The header subtitle, translated, or '' when absent. */\n\t\tsubtitle() {\n\t\t\tconst value = this.content && this.content.subtitle\n\t\t\treturn typeof value === 'string' && value !== '' ? this.effectiveTranslate(value) : ''\n\t\t},\n\n\t\t/** Whether a heading renders: a non-empty title or a greeting. */\n\t\thasTitle() {\n\t\t\treturn this.headingText !== ''\n\t\t},\n\n\t\t/**\n\t\t * The moment the greeting and date line are computed for.\n\t\t *\n\t\t * @return {Date}\n\t\t * @spec openspec/changes/workplace-dashboard-primitives/specs/workplace-dashboard-primitives/spec.md#requirement-greeting-header\n\t\t */\n\t\treference() {\n\t\t\treturn this.now instanceof Date ? this.now : new Date()\n\t\t},\n\n\t\t/**\n\t\t * The view switch's options from `content.views.options`: each\n\t\t * `{ label, route, params? }` with a non-empty label and route becomes\n\t\t * a segmented-control option keyed on its route name (the label goes\n\t\t * through the host translate function). Empty without a router, so\n\t\t * the switch cannot offer routes it cannot follow.\n\t\t *\n\t\t * @spec openspec/changes/zuiddrecht-pixel-gaps/specs/zuiddrecht-pixel-gaps/spec.md#requirement-a-greeting-header-switches-views\n\t\t * @return {Array<{value: string, label: string}>}\n\t\t */\n\t\tviewOptions() {\n\t\t\tconst raw = this.content && this.content.views && this.content.views.options\n\t\t\tif (!Array.isArray(raw)) {\n\t\t\t\treturn []\n\t\t\t}\n\t\t\tconst pageViewIds = this.pageViewIds\n\t\t\treturn raw\n\t\t\t\t.filter((o) => o && typeof o.label === 'string' && o.label !== '')\n\t\t\t\t.map((o) => {\n\t\t\t\t\tif (typeof o.view === 'string' && o.view !== '') {\n\t\t\t\t\t\treturn pageViewIds.includes(o.view) ? { value: VIEW_OPTION_PREFIX + o.view, label: this.cnTranslate(o.label) } : null\n\t\t\t\t\t}\n\t\t\t\t\tif (typeof o.route === 'string' && o.route !== '' && this.$router) {\n\t\t\t\t\t\treturn { value: o.route, label: this.cnTranslate(o.label) }\n\t\t\t\t\t}\n\t\t\t\t\treturn null\n\t\t\t\t})\n\t\t\t\t.filter(Boolean)\n\t\t},\n\n\t\t/**\n\t\t * The ids of the page's views, empty outside a page with views.\n\t\t *\n\t\t * @spec openspec/changes/view-switch-containers/specs/view-switch-containers/spec.md#requirement-a-greeting-header-can-switch-the-pages-views\n\t\t * @return {string[]}\n\t\t */\n\t\tpageViewIds() {\n\t\t\tconst views = this.cnPageViews && Array.isArray(this.cnPageViews.views) ? this.cnPageViews.views : []\n\t\t\treturn views.map((view) => view.id)\n\t\t},\n\n\t\t/**\n\t\t * The id of the page's view region when an option selects a view,\n\t\t * for the options' `aria-controls`; '' otherwise.\n\t\t *\n\t\t * @spec openspec/changes/view-switch-containers/specs/view-switch-containers/spec.md#requirement-the-view-switch-is-accessible\n\t\t * @return {string}\n\t\t */\n\t\tviewsRegionId() {\n\t\t\tconst hasViewOption = this.viewOptions.some((o) => o.value.startsWith(VIEW_OPTION_PREFIX))\n\t\t\treturn hasViewOption && this.cnPageViews ? (this.cnPageViews.regionId || '') : ''\n\t\t},\n\n\t\t/**\n\t\t * The checked view: the option whose route is the current route, else\n\t\t * the first option (a switch always has one checked option).\n\t\t *\n\t\t * @spec openspec/changes/zuiddrecht-pixel-gaps/specs/zuiddrecht-pixel-gaps/spec.md#requirement-a-greeting-header-switches-views\n\t\t * @return {string|null}\n\t\t */\n\t\tactiveView() {\n\t\t\tconst options = this.viewOptions\n\t\t\tif (options.length === 0) {\n\t\t\t\treturn null\n\t\t\t}\n\t\t\tconst activeView = this.cnPageViews ? this.cnPageViews.activeId : null\n\t\t\tconst viewMatch = activeView ? options.find((o) => o.value === VIEW_OPTION_PREFIX + activeView) : null\n\t\t\tif (viewMatch) {\n\t\t\t\treturn viewMatch.value\n\t\t\t}\n\t\t\tconst current = this.$route && this.$route.name\n\t\t\tconst match = options.find((o) => o.value === current)\n\t\t\treturn match ? match.value : options[0].value\n\t\t},\n\n\t\t/**\n\t\t * Accessible name of the view switch: `content.views.ariaLabel`\n\t\t * through the host translate function, else \"View\".\n\t\t *\n\t\t * @spec openspec/changes/zuiddrecht-pixel-gaps/specs/zuiddrecht-pixel-gaps/spec.md#requirement-a-greeting-header-switches-views\n\t\t * @return {string}\n\t\t */\n\t\tviewsLabel() {\n\t\t\tconst label = this.content && this.content.views && this.content.views.ariaLabel\n\t\t\treturn label ? this.cnTranslate(label) : t('nextcloud-vue', 'Views')\n\t\t},\n\n\t\t/**\n\t\t * Whether the plain presentation is on (no coloured background).\n\t\t *\n\t\t * @return {boolean}\n\t\t */\n\t\tisPlain() {\n\t\t\treturn Boolean(this.content && (this.content.plain === true || this.content.ground === true))\n\t\t},\n\n\t\t/**\n\t\t * Whether the greeting sits on the page ground (`content.ground`):\n\t\t * the plain look without the card padding, so the date line and the\n\t\t * heading align with the page edge as the board draws them. Off by\n\t\t * default.\n\t\t *\n\t\t * @spec openspec/changes/zuiddrecht-pixel-gaps-2/specs/zuiddrecht-pixel-gaps-2/spec.md#requirement-a-greeting-can-sit-on-the-page-ground\n\t\t * @return {boolean}\n\t\t */\n\t\tisGround() {\n\t\t\treturn Boolean(this.content && this.content.ground === true)\n\t\t},\n\n\t\t/**\n\t\t * The name the greeting uses: the first word of the display name, or\n\t\t * the whole display name for `greeting: \"full\"`. '' when unknown.\n\t\t *\n\t\t * @return {string}\n\t\t * @spec openspec/changes/workplace-dashboard-primitives/specs/workplace-dashboard-primitives/spec.md#requirement-greeting-header\n\t\t */\n\t\tgreetingName() {\n\t\t\tlet user\n\t\t\ttry {\n\t\t\t\tuser = getCurrentUser()\n\t\t\t} catch {\n\t\t\t\tuser = null\n\t\t\t}\n\t\t\tconst displayName = (user && typeof user.displayName === 'string') ? user.displayName.trim() : ''\n\t\t\tif (displayName === '') {\n\t\t\t\treturn ''\n\t\t\t}\n\t\t\treturn this.content.greeting === 'full' ? displayName : displayName.split(/\\s+/)[0]\n\t\t},\n\n\t\t/**\n\t\t * The greeting for the time of day, with the user's name when known,\n\t\t * or '' when the greeting is off.\n\t\t *\n\t\t * @return {string}\n\t\t * @spec openspec/changes/workplace-dashboard-primitives/specs/workplace-dashboard-primitives/spec.md#requirement-greeting-header\n\t\t */\n\t\tgreetingText() {\n\t\t\tconst greeting = this.content && this.content.greeting\n\t\t\tif (greeting !== true && greeting !== 'full' && greeting !== 'first') {\n\t\t\t\treturn ''\n\t\t\t}\n\t\t\tconst hour = this.reference.getHours()\n\t\t\tconst name = this.greetingName\n\t\t\tif (hour < 12) {\n\t\t\t\treturn name ? t('nextcloud-vue', 'Good morning, {name}', { name }) : t('nextcloud-vue', 'Good morning')\n\t\t\t}\n\t\t\tif (hour < 18) {\n\t\t\t\treturn name ? t('nextcloud-vue', 'Good afternoon, {name}', { name }) : t('nextcloud-vue', 'Good afternoon')\n\t\t\t}\n\t\t\treturn name ? t('nextcloud-vue', 'Good evening, {name}', { name }) : t('nextcloud-vue', 'Good evening')\n\t\t},\n\n\t\t/**\n\t\t * The heading: the greeting when it is on, else the title.\n\t\t *\n\t\t * @return {string}\n\t\t * @spec openspec/changes/workplace-dashboard-primitives/specs/workplace-dashboard-primitives/spec.md#requirement-greeting-header\n\t\t */\n\t\theadingText() {\n\t\t\treturn this.greetingText || this.title\n\t\t},\n\n\t\t/**\n\t\t * Today's date written out (\"Monday 5 October 2026\"), or '' when\n\t\t * `showDate` is off.\n\t\t *\n\t\t * @return {string}\n\t\t * @spec openspec/changes/workplace-dashboard-primitives/specs/workplace-dashboard-primitives/spec.md#requirement-greeting-header\n\t\t */\n\t\tdateLine() {\n\t\t\tif (!this.content || this.content.showDate !== true) {\n\t\t\t\treturn ''\n\t\t\t}\n\t\t\tconst options = { weekday: 'long', day: 'numeric', month: 'long', year: 'numeric' }\n\t\t\tlet locale\n\t\t\ttry {\n\t\t\t\tlocale = getCanonicalLocale()\n\t\t\t} catch {\n\t\t\t\tlocale = undefined\n\t\t\t}\n\t\t\ttry {\n\t\t\t\treturn new Intl.DateTimeFormat(locale || undefined, options).format(this.reference)\n\t\t\t} catch {\n\t\t\t\treturn new Intl.DateTimeFormat(undefined, options).format(this.reference)\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * Inline style of the date line: the heading's colour, or the muted\n\t\t * text colour on a plain header.\n\t\t *\n\t\t * @return {object}\n\t\t * @spec openspec/changes/workplace-dashboard-primitives/specs/workplace-dashboard-primitives/spec.md#requirement-greeting-header\n\t\t */\n\t\tdateStyle() {\n\t\t\treturn {\n\t\t\t\tcolor: this.isPlain && !(this.content && this.content.textColor) ? 'var(--color-text-maxcontrast)' : this.textColor,\n\t\t\t\tmargin: 0,\n\t\t\t}\n\t\t},\n\n\t\t/** Whether a non-empty subtitle is set. */\n\t\thasSubtitle() {\n\t\t\treturn this.subtitle !== ''\n\t\t},\n\n\t\t/** Resolved background image URL (file id wins over URL). */\n\t\tbackgroundImageUrl() {\n\t\t\tconst fileId = this.content && this.content.backgroundImageFileId\n\t\t\tif (typeof fileId === 'number' && Number.isFinite(fileId) && fileId > 0) {\n\t\t\t\treturn `/index.php/core/preview?fileId=${fileId}&x=1024&y=512&a=1`\n\t\t\t}\n\t\t\tconst url = this.content && this.content.backgroundImageUrl\n\t\t\t// Accept http(s) plus uploaded/same-origin sources: data: and blob:\n\t\t\t// (from the form's upload) and root-relative paths (NC files/preview).\n\t\t\t// External http(s) images may still be blocked by the instance CSP —\n\t\t\t// uploading is the reliable, same-origin path. resolveImageUrl() adds\n\t\t\t// the webroot + /index.php to `/apps/...` resource paths so they load\n\t\t\t// on index.php-routed instances (other shapes pass through).\n\t\t\tif (typeof url === 'string' && /^(https?:\\/\\/|data:|blob:|\\/)/i.test(url)) {\n\t\t\t\treturn resolveImageUrl(url)\n\t\t\t}\n\t\t\treturn ''\n\t\t},\n\n\t\t/** Whether a usable, non-errored background image is present. */\n\t\thasBackgroundImage() {\n\t\t\treturn this.backgroundImageUrl !== '' && this.imageFailed === false\n\t\t},\n\n\t\t/**\n\t\t * Resolved background colour (default theme primary).\n\t\t *\n\t\t * @spec openspec/changes/workplace-dashboard-primitives/specs/workplace-dashboard-primitives/spec.md#requirement-greeting-header\n\t\t */\n\t\tbackgroundColor() {\n\t\t\tconst value = this.content && this.content.backgroundColor\n\t\t\tif (typeof value === 'string' && value !== '') {\n\t\t\t\treturn value\n\t\t\t}\n\t\t\tif (this.isPlain) {\n\t\t\t\treturn 'transparent'\n\t\t\t}\n\t\t\treturn 'var(--color-primary, #0070c0)'\n\t\t},\n\n\t\t/** Resolved overlay mode (`tint` when an image is present, else `none`). */\n\t\toverlayMode() {\n\t\t\tconst declared = this.content && this.content.overlayMode\n\t\t\tif (typeof declared === 'string' && ALLOWED_OVERLAY_MODES.includes(declared)) {\n\t\t\t\treturn declared\n\t\t\t}\n\t\t\treturn this.hasBackgroundImage ? 'tint' : 'none'\n\t\t},\n\n\t\t/** Whether an overlay should render. */\n\t\thasOverlay() {\n\t\t\treturn this.overlayMode !== 'none'\n\t\t},\n\n\t\t/** Resolved overlay colour. */\n\t\toverlayColor() {\n\t\t\tconst value = this.content && this.content.overlayColor\n\t\t\tif (typeof value === 'string' && value !== '') {\n\t\t\t\treturn value\n\t\t\t}\n\t\t\tconst bg = this.content && this.content.backgroundColor\n\t\t\treturn (typeof bg === 'string' && bg !== '') ? bg : '#000000'\n\t\t},\n\n\t\t/** Resolved overlay opacity, clamped to 0..1 (default 0.4). */\n\t\toverlayOpacity() {\n\t\t\tconst raw = this.content && this.content.overlayOpacity\n\t\t\tconst value = typeof raw === 'number' ? raw : Number.parseFloat(raw)\n\t\t\tif (Number.isFinite(value) === false) {\n\t\t\t\treturn 0.4\n\t\t\t}\n\t\t\tif (value < 0) {\n\t\t\t\treturn 0\n\t\t\t}\n\t\t\tif (value > 1) {\n\t\t\t\treturn 1\n\t\t\t}\n\t\t\treturn value\n\t\t},\n\n\t\t/** Resolved height preset key (default `medium`). */\n\t\theight() {\n\t\t\tconst declared = this.content && this.content.height\n\t\t\tif (typeof declared === 'string' && ALLOWED_HEIGHTS.includes(declared)) {\n\t\t\t\treturn declared\n\t\t\t}\n\t\t\treturn 'medium'\n\t\t},\n\n\t\t/** The pixel height for the active preset. */\n\t\theightPixels() {\n\t\t\treturn HEIGHT_PIXELS[this.height]\n\t\t},\n\n\t\t/**\n\t\t * Resolved text alignment (default `center`).\n\t\t *\n\t\t * @spec openspec/changes/workplace-dashboard-primitives/specs/workplace-dashboard-primitives/spec.md#requirement-greeting-header\n\t\t */\n\t\ttextAlign() {\n\t\t\tconst declared = this.content && this.content.textAlign\n\t\t\tif (typeof declared === 'string' && ALLOWED_TEXT_ALIGN.includes(declared)) {\n\t\t\t\treturn declared\n\t\t\t}\n\t\t\treturn this.isPlain ? 'left' : 'center'\n\t\t},\n\n\t\t/** Resolved vertical alignment (default `middle`). */\n\t\tverticalAlign() {\n\t\t\tconst declared = this.content && this.content.verticalAlign\n\t\t\tif (typeof declared === 'string' && ALLOWED_VERTICAL_ALIGN.includes(declared)) {\n\t\t\t\treturn declared\n\t\t\t}\n\t\t\treturn 'middle'\n\t\t},\n\n\t\t/**\n\t\t * Resolved text colour with an auto-contrast fallback.\n\t\t *\n\t\t * @spec openspec/changes/workplace-dashboard-primitives/specs/workplace-dashboard-primitives/spec.md#requirement-greeting-header\n\t\t */\n\t\ttextColor() {\n\t\t\tconst value = this.content && this.content.textColor\n\t\t\tif (typeof value === 'string' && value !== '') {\n\t\t\t\treturn value\n\t\t\t}\n\t\t\tif (this.hasBackgroundImage) {\n\t\t\t\treturn '#ffffff'\n\t\t\t}\n\t\t\tif (this.isPlain && !(this.content && this.content.backgroundColor)) {\n\t\t\t\treturn 'var(--color-main-text)'\n\t\t\t}\n\t\t\treturn this.isLightColor(this.backgroundColor) ? '#000000' : '#ffffff'\n\t\t},\n\n\t\t/** Inline style for the banner wrapper. */\n\t\twrapperStyle() {\n\t\t\tconst style = {\n\t\t\t\tposition: 'relative',\n\t\t\t\twidth: '100%',\n\t\t\t\t// Fill the dashboard grid cell so the banner resizes with the\n\t\t\t\t// widget. A fixed pixel height ignored the cell, which made the\n\t\t\t\t// banner un-resizable and made it overflow/scroll inside a\n\t\t\t\t// smaller cell. The grid controls the size now.\n\t\t\t\theight: '100%',\n\t\t\t\toverflow: 'hidden',\n\t\t\t\t'background-color': this.backgroundColor,\n\t\t\t}\n\t\t\tif (this.hasBackgroundImage) {\n\t\t\t\tstyle['background-image'] = `url(\"${this.backgroundImageUrl}\")`\n\t\t\t\tstyle['background-size'] = 'cover'\n\t\t\t\tstyle['background-position'] = 'center center'\n\t\t\t\tstyle['background-repeat'] = 'no-repeat'\n\t\t\t}\n\t\t\treturn style\n\t\t},\n\n\t\t/** Inline style for the overlay layer. */\n\t\toverlayStyle() {\n\t\t\tif (this.overlayMode === 'gradient-bottom') {\n\t\t\t\treturn {\n\t\t\t\t\tposition: 'absolute',\n\t\t\t\t\tinset: 0,\n\t\t\t\t\t'background-image': `linear-gradient(to bottom, transparent 50%, ${this.overlayColor} 100%)`,\n\t\t\t\t\t'pointer-events': 'none',\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn {\n\t\t\t\tposition: 'absolute',\n\t\t\t\tinset: 0,\n\t\t\t\t'background-color': this.overlayColor,\n\t\t\t\topacity: String(this.overlayOpacity),\n\t\t\t\t'pointer-events': 'none',\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * Inline style for the content flex container.\n\t\t *\n\t\t * @spec openspec/changes/workplace-dashboard-primitives/specs/workplace-dashboard-primitives/spec.md#requirement-greeting-header\n\t\t */\n\t\tcontentStyle() {\n\t\t\treturn {\n\t\t\t\tposition: 'relative',\n\t\t\t\t'z-index': 1,\n\t\t\t\t// Beside a view switch the content shares the row instead of\n\t\t\t\t// taking the whole width (see .cn-header-widget--with-views).\n\t\t\t\twidth: this.viewOptions.length > 0 ? 'auto' : '100%',\n\t\t\t\theight: '100%',\n\t\t\t\tdisplay: 'flex',\n\t\t\t\t'flex-direction': 'column',\n\t\t\t\t'align-items': this.flexAlignFromTextAlign,\n\t\t\t\t'justify-content': VERTICAL_ALIGN_FLEX[this.verticalAlign],\n\t\t\t\t// Plain drops the coloured background, not the card padding:\n\t\t\t\t// at 0 the greeting sat flush against the card's left edge.\n\t\t\t\t// Ground has no card, so it has no padding either.\n\t\t\t\tpadding: this.isGround ? '0' : (this.isPlain ? '16px' : '16px 24px'),\n\t\t\t\t'box-sizing': 'border-box',\n\t\t\t\tgap: this.isGround ? '6px' : '8px',\n\t\t\t\t'text-align': this.textAlign,\n\t\t\t}\n\t\t},\n\n\t\t/** Flex cross-axis alignment derived from the text alignment. */\n\t\tflexAlignFromTextAlign() {\n\t\t\tif (this.textAlign === 'left') {\n\t\t\t\treturn 'flex-start'\n\t\t\t}\n\t\t\tif (this.textAlign === 'right') {\n\t\t\t\treturn 'flex-end'\n\t\t\t}\n\t\t\treturn 'center'\n\t\t},\n\n\t\t/** Inline style applying the resolved text colour. */\n\t\ttextStyle() {\n\t\t\treturn {\n\t\t\t\tcolor: this.textColor,\n\t\t\t\tmargin: 0,\n\t\t\t}\n\t\t},\n\n\t\t/** The validated CTA object, or null when incomplete. */\n\t\tcta() {\n\t\t\tconst raw = this.content && this.content.cta\n\t\t\tif (raw === null || typeof raw !== 'object') {\n\t\t\t\treturn null\n\t\t\t}\n\t\t\tconst label = typeof raw.label === 'string' ? raw.label.trim() : ''\n\t\t\tconst url = typeof raw.url === 'string' ? raw.url.trim() : ''\n\t\t\tif (label === '' || url === '') {\n\t\t\t\treturn null\n\t\t\t}\n\t\t\tlet style = raw.style\n\t\t\tif (typeof style !== 'string' || ALLOWED_CTA_STYLES.includes(style) === false) {\n\t\t\t\tstyle = 'primary'\n\t\t\t}\n\t\t\treturn { label, url, style }\n\t\t},\n\n\t\t/** Whether a complete CTA is present. */\n\t\thasCta() {\n\t\t\treturn this.cta !== null\n\t\t},\n\n\t\t/** The CTA label, translated. */\n\t\tctaLabel() {\n\t\t\treturn this.hasCta && this.cta.label ? this.effectiveTranslate(this.cta.label) : ''\n\t\t},\n\n\t\t/** The CTA URL. */\n\t\tctaUrl() {\n\t\t\treturn this.hasCta ? this.cta.url : ''\n\t\t},\n\n\t\t/** Whether the CTA URL is an external http(s) link. */\n\t\tctaIsExternal() {\n\t\t\treturn this.hasCta && /^https?:\\/\\//i.test(this.ctaUrl)\n\t\t},\n\n\t\t/** The CTA anchor target (`_blank` for external links). */\n\t\tctaTarget() {\n\t\t\treturn this.ctaIsExternal ? '_blank' : null\n\t\t},\n\n\t\t/** The CTA anchor rel for external links. */\n\t\tctaRel() {\n\t\t\treturn this.ctaIsExternal ? 'noopener noreferrer' : null\n\t\t},\n\n\t\t/** The accessible CTA label, annotating external links. */\n\t\tctaAriaLabel() {\n\t\t\tif (this.hasCta === false) {\n\t\t\t\treturn null\n\t\t\t}\n\t\t\tif (this.ctaIsExternal) {\n\t\t\t\treturn `${this.ctaLabel} (${t('nextcloud-vue', 'opens in new tab')})`\n\t\t\t}\n\t\t\treturn this.ctaLabel\n\t\t},\n\n\t\t/** The CTA class list (base + style modifier). */\n\t\tctaClasses() {\n\t\t\tif (this.hasCta === false) {\n\t\t\t\treturn []\n\t\t\t}\n\t\t\treturn [\n\t\t\t\t'cn-header-widget__cta',\n\t\t\t\t`cn-header-widget__cta--${this.cta.style}`,\n\t\t\t]\n\t\t},\n\t},\n\n\twatch: {\n\t\tbackgroundImageUrl() {\n\t\t\t// Re-arm the probe so a previously failing URL can recover when\n\t\t\t// the user edits the placement.\n\t\t\tthis.imageFailed = false\n\t\t},\n\t},\n\n\tmethods: {\n\t\t/**\n\t\t * Follow the chosen view: push its route (with the option's `params`\n\t\t * when declared). Nothing happens for the route already shown.\n\t\t *\n\t\t * @spec openspec/changes/zuiddrecht-pixel-gaps/specs/zuiddrecht-pixel-gaps/spec.md#requirement-a-greeting-header-switches-views\n\t\t * @param {string} route The chosen option's route name.\n\t\t * @return {void}\n\t\t */\n\t\tonViewChange(route) {\n\t\t\tif (typeof route === 'string' && route.startsWith(VIEW_OPTION_PREFIX)) {\n\t\t\t\tif (this.cnPageViews && typeof this.cnPageViews.select === 'function') {\n\t\t\t\t\tthis.cnPageViews.select(route.slice(VIEW_OPTION_PREFIX.length))\n\t\t\t\t}\n\t\t\t\treturn\n\t\t\t}\n\t\t\tif (!this.$router || !route || route === (this.$route && this.$route.name)) {\n\t\t\t\treturn\n\t\t\t}\n\t\t\tconst declared = (this.content.views.options || []).find((o) => o && o.route === route) || {}\n\t\t\tconst target = { name: route }\n\t\t\tif (declared.params && typeof declared.params === 'object') {\n\t\t\t\ttarget.params = declared.params\n\t\t\t}\n\t\t\tthis.$router.push(target)\n\t\t},\n\n\t\t/**\n\t\t * Mark the background image as broken so the renderer falls back to\n\t\t * the solid colour.\n\t\t *\n\t\t * @return {void}\n\t\t */\n\t\tonImageError() {\n\t\t\tthis.imageFailed = true\n\t\t},\n\n\t\t/**\n\t\t * Quick perceived-luminance check on a CSS hex colour. Returns true\n\t\t * for \"light\" (white text would be illegible). Non-hex colours\n\t\t * collapse to false (assume dark) — the safer default.\n\t\t *\n\t\t * @param {string} color the CSS colour value.\n\t\t * @return {boolean} true when the colour is perceived as light.\n\t\t */\n\t\tisLightColor(color) {\n\t\t\tif (typeof color !== 'string') {\n\t\t\t\treturn false\n\t\t\t}\n\t\t\tconst match = color.trim().match(/^#([0-9a-f]{6})$/i)\n\t\t\tif (!match) {\n\t\t\t\treturn false\n\t\t\t}\n\t\t\tconst hex = match[1]\n\t\t\tconst r = Number.parseInt(hex.slice(0, 2), 16)\n\t\t\tconst g = Number.parseInt(hex.slice(2, 4), 16)\n\t\t\tconst b = Number.parseInt(hex.slice(4, 6), 16)\n\t\t\tconst luma = (0.299 * r + 0.587 * g + 0.114 * b) / 255\n\t\t\treturn luma > 0.6\n\t\t},\n\t},\n}\n</script>\n\n<style scoped>\n.cn-header-widget {\n\twidth: 100%;\n\theight: 100%;\n\tmin-height: 120px;\n\tborder-radius: var(--border-radius-large, 8px);\n\toverflow: hidden;\n}\n\n.cn-header-widget--plain {\n\tmin-height: 0;\n\tborder-radius: 0;\n}\n\n/* With a view switch the heading and the switch share one row, the switch\n at the right and bottom-aligned with the heading; on a narrow card the\n switch wraps under it. */\n.cn-header-widget--with-views {\n\tdisplay: flex;\n\tflex-wrap: wrap;\n\talign-items: flex-end;\n\tjustify-content: space-between;\n\tgap: calc(2 * var(--default-grid-baseline)) calc(4 * var(--default-grid-baseline));\n}\n\n.cn-header-widget--with-views .cn-header-widget__content {\n\tflex: 1 1 320px;\n\twidth: auto;\n}\n\n.cn-header-widget__views {\n\tposition: relative;\n\tz-index: 1;\n\tflex: 0 0 auto;\n\tpadding: 16px;\n}\n\n/* On the page ground (`content.ground`): no card, so no inset around the\n view switch, and the heading at the board's 32px. */\n.cn-header-widget--ground .cn-header-widget__views {\n\tpadding: 0;\n}\n\n.cn-header-widget--ground .cn-header-widget__title {\n\tfont-size: var(--cn-header-ground-title-size, 32px);\n\tletter-spacing: -0.01em;\n}\n\n.cn-header-widget__date {\n\tfont-size: 14px;\n\tline-height: 1.4;\n\tmargin: 0;\n}\n\n.cn-header-widget__overlay {\n\tposition: absolute;\n\tinset: 0;\n}\n\n.cn-header-widget__content {\n\tposition: relative;\n\tz-index: 1;\n}\n\n.cn-header-widget__title {\n\tfont-size: 28px;\n\tfont-weight: 700;\n\tline-height: 1.2;\n\tmargin: 0;\n}\n\n.cn-header-widget__subtitle {\n\tfont-size: 16px;\n\tline-height: 1.4;\n\tmargin: 0;\n\topacity: 0.95;\n}\n\n.cn-header-widget__cta {\n\tdisplay: inline-block;\n\tmargin-top: 8px;\n\tpadding: 10px 18px;\n\tborder-radius: var(--border-radius, 4px);\n\tfont-size: 14px;\n\tfont-weight: 600;\n\ttext-decoration: none;\n\tcursor: pointer;\n\ttransition: transform 0.15s ease, box-shadow 0.15s ease;\n}\n\n.cn-header-widget__cta:hover {\n\ttransform: translateY(-1px);\n\tbox-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);\n}\n\n.cn-header-widget__cta--primary {\n\tbackground-color: var(--color-primary, #0070c0);\n\tcolor: var(--color-primary-text, #ffffff);\n\tborder: 1px solid var(--color-primary, #0070c0);\n}\n\n.cn-header-widget__cta--secondary {\n\tbackground-color: var(--color-background-hover, rgba(255, 255, 255, 0.85));\n\tcolor: var(--color-main-text, #000000);\n\tborder: 1px solid var(--color-border, #cccccc);\n}\n\n.cn-header-widget__cta--ghost {\n\tbackground-color: transparent;\n\tcolor: inherit;\n\tborder: 1px solid currentColor;\n}\n\n.cn-header-widget__probe {\n\tposition: absolute;\n\twidth: 1px;\n\theight: 1px;\n\topacity: 0;\n\tpointer-events: none;\n\tinset-inline-start: -9999px;\n\ttop: -9999px;\n}\n\n@media print {\n\t.cn-header-widget {\n\t\tprint-color-adjust: exact;\n\t\t-webkit-print-color-adjust: exact;\n\t}\n}\n</style>\n"],"names":["_createElementBlock","_normalizeClass","_createElementVNode","_createVNode"],"mappings":";;;;;AA6C4B,EAAA,KAAA,EAAA,yBAAA;;;;;;;uBAlCzBA;IAAG,KAAK,EAAAC,cAAA,CAAA,CAAC,kBAAW,EAAA,EAAA,yBAAA,EAAA,QAAA,CAAA,OAAA,8BAAA,QAAA,CAAA,QAAA,EAAA,8BAAA,EAAA,QAAA,CAAA,WAAA,CAAA,MAAA,GAAA,CAAA,EAAA,CAAA,CAAA;AAAA,IAAA,KAAA,iBAAA,QAAA,CAAA,YAAA,CAAA;;KAEnB,QAAA,CAAA,UAAA;sBADFD,kBAImB,CAAA,KAAA,EAAA;;AAFjB,UAAA,KAAI,EAAC,2BAAS;AACd,UAAA,KAAK,iBAAE,QAAY,CAAA,YAAA,CAAA;AACnB,UAAA,aAAU,EAAC,MAAM;;;IACjBE,kBAuBI,CAAA,KAAA,EAAA;AAvBD,MAAA,KAAK,EAAC,2BAA0B;AAAA,MAAA,KAAA,iBAAA,QAAA,CAAA,YAAA,CAAA;;OAEjC,QAAA,CAAA,QAAA;0CAKC,CAAA,GAAA,EAAA;;AAJH,YAAA,KAAK,EAAC,wBAAwB;AAC7B,YAAA,KAAK,iBAAE,QAAQ,CAAA,SAAA,CAAA;AAChB,YAAA,aAAG,EAAA,uBAAA;6BACA,QAAQ,CAAA,QAAA,CAAA,EAAA,CAAA,mBAAA;;OAET,QAAA,CAAA,QAAA;wBAAHF,kBAEK,CAAA,IAAA,EAAA;;AAFF,YAAA,KAAA,EAAA,yBAAA;AAAA,YAAA,KAAA,iBAAA,QAAA,CAAA,SAAA,CAAA;6BACF,QAAA,CAAA,WAAA,CAAA,EAAA,CAAA,mBAAA;;OAEQ,QAAK,CAAA,WAAA;0CAEV,CAAA,GAAA,EAAA;;AAFU,YAAA,KAAA,EAAA,4BAAA;AAAA,YAAA,KAAA,iBAAA,QAAA,CAAA,SAAA,CAAA;6BACV,QAAQ,CAAA,QAAA,CAAA,EAAA,CAAA,mBAAA;;OAGL,QAAM,CAAA,MAAA;0CAOT,CAAA,GAAA,EAAA;;AANF,YAAA,IAAI,EAAE,QAAM,CAAA,MAAA;AACZ,YAAA,KAAC,iBAAA,QAAA,CAAA,UAAA,CAAA;AACD,YAAA,MAAE,EAAA,QAAA,CAAA,SAAA;AACF,YAAA,GAAI,EAAC,QAAM,CAAA,MAAA;wBACD,EAAE,QAAY,CAAA,YAAA;6BACtB,QAAS,CAAA,QAAA,CAAA,EAAA,EAAA,2BAAA,UAAA,CAAA;;;AAOH,IAAA,CAAA,QAAA,CAAA,WAAW,CAAC,MAAG,GAAA,CAAA;yCAQpB,iBAAA,EAAA;UAPJG,WAMuB,CAAA,6BAAA,EAAA;AALtB,YAAA,OAAO,EAAE,QAAW,CAAA,WAAA;AACpB,YAAA,UAAE,EAAA,QAAA,CAAA,UAAA;AACF,YAAA,SAAA,EAAA,QAAA,CAAA,UAAA;AACA,YAAA,QAAQ,EAAE,QAAY,CAAA,aAAA;AACvB,YAAA,aAAW,EAAC,wBAAiB;AAC5B,YAAA,qBAAiB,EAAE,QAAG,CAAA,YAAA;;;;KAGlB,QAAe,CAAA,kBAAA;sBADrBH;;AAEA,UAAA,KAAG,EAAA,yBAAA;;;;;;;;;;;;"}
@@ -57,6 +57,17 @@ var script = {
57
57
  default: '',
58
58
  },
59
59
 
60
+ /**
61
+ * Id of the element the options switch, such as the region holding a
62
+ * page view's widgets. Set as `aria-controls` on every option.
63
+ *
64
+ * @spec openspec/changes/view-switch-containers/specs/view-switch-containers/spec.md#requirement-the-view-switch-is-accessible
65
+ */
66
+ controls: {
67
+ type: String,
68
+ default: '',
69
+ },
70
+
60
71
  /** Stretch the control to the full width, with options of equal width. */
61
72
  stretch: {
62
73
  type: Boolean,