@conduction/nextcloud-vue 2.60.0 → 2.61.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 (56) hide show
  1. package/dist/esm/components/CnAppNav/CnAppNav.vue2.js +41 -1
  2. package/dist/esm/components/CnAppNav/CnAppNav.vue2.js.map +1 -1
  3. package/dist/esm/components/CnAppNav/CnAppNav.vue3.js.map +1 -1
  4. package/dist/esm/components/CnBannerWidget/CnBannerWidget.vue2.js +9 -2
  5. package/dist/esm/components/CnBannerWidget/CnBannerWidget.vue2.js.map +1 -1
  6. package/dist/esm/components/CnBannerWidget/CnBannerWidget.vue3.js.map +1 -1
  7. package/dist/esm/components/CnDashboardPage/CnDashboardPage.vue2.js +10 -2
  8. package/dist/esm/components/CnDashboardPage/CnDashboardPage.vue2.js.map +1 -1
  9. package/dist/esm/components/CnDashboardPage/CnDashboardPage.vue3.js.map +1 -1
  10. package/dist/esm/components/CnDetailPage/CnDetailPage.vue2.js.map +1 -1
  11. package/dist/esm/components/CnDetailPage/CnDetailPage.vue3.js +6 -5
  12. package/dist/esm/components/CnDetailPage/CnDetailPage.vue3.js.map +1 -1
  13. package/dist/esm/components/CnHeaderWidget/CnHeaderWidget.vue2.js +3 -1
  14. package/dist/esm/components/CnHeaderWidget/CnHeaderWidget.vue2.js.map +1 -1
  15. package/dist/esm/components/CnHeaderWidget/CnHeaderWidget.vue3.js.map +1 -1
  16. package/dist/esm/components/CnLinkCardsPage/CnLinkCardsPage.vue.js +10 -0
  17. package/dist/esm/components/CnLinkCardsPage/CnLinkCardsPage.vue.js.map +1 -0
  18. package/dist/esm/components/CnLinkCardsPage/CnLinkCardsPage.vue2.js +316 -0
  19. package/dist/esm/components/CnLinkCardsPage/CnLinkCardsPage.vue2.js.map +1 -0
  20. package/dist/esm/components/CnLinkCardsPage/CnLinkCardsPage.vue3.js +105 -0
  21. package/dist/esm/components/CnLinkCardsPage/CnLinkCardsPage.vue3.js.map +1 -0
  22. package/dist/esm/components/CnPageRenderer/pageTypes.js +1 -0
  23. package/dist/esm/components/CnPageRenderer/pageTypes.js.map +1 -1
  24. package/dist/esm/index.js +6 -0
  25. package/dist/esm/index.js.map +1 -1
  26. package/dist/esm/l10n/en.json.js +1 -0
  27. package/dist/esm/l10n/en.json.js.map +1 -1
  28. package/dist/esm/l10n/nl.json.js +1 -0
  29. package/dist/esm/l10n/nl.json.js.map +1 -1
  30. package/dist/esm/nextcloud-vue.css +92 -2
  31. package/dist/esm/utils/headers.js +28 -2
  32. package/dist/esm/utils/headers.js.map +1 -1
  33. package/dist/esm/utils/validateManifestV2.compiled.js +2 -2
  34. package/dist/esm/utils/validateManifestV2.compiled.js.map +1 -1
  35. package/dist/nextcloud-vue.cjs.js +8741 -8229
  36. package/dist/nextcloud-vue.cjs.js.map +2 -2
  37. package/dist/nextcloud-vue.css +92 -2
  38. package/l10n/en.json +1 -0
  39. package/l10n/nl.json +1 -0
  40. package/package.json +1 -1
  41. package/scripts/.jsdoc-baselines.json +1 -0
  42. package/src/components/CnAppNav/CnAppNav.vue +41 -1
  43. package/src/components/CnBannerWidget/CnBannerWidget.vue +9 -2
  44. package/src/components/CnDashboardPage/CnDashboardPage.vue +10 -2
  45. package/src/components/CnDetailPage/CnDetailPage.vue +4 -1
  46. package/src/components/CnHeaderWidget/CnHeaderWidget.vue +3 -1
  47. package/src/components/CnLinkCardsPage/CnLinkCardsPage.vue +484 -0
  48. package/src/components/CnLinkCardsPage/index.js +4 -0
  49. package/src/components/CnPageRenderer/pageTypes.js +1 -0
  50. package/src/components/index.js +1 -0
  51. package/src/css/detail-page.css +10 -2
  52. package/src/index.js +7 -0
  53. package/src/schemas/app-manifest-v2.schema.json +44 -2
  54. package/src/types/manifest.d.ts +1 -1
  55. package/src/utils/headers.js +28 -2
  56. package/src/utils/validateManifestV2.compiled.js +2 -2
@@ -449,7 +449,9 @@ var script = {
449
449
  'flex-direction': 'column',
450
450
  'align-items': this.flexAlignFromTextAlign,
451
451
  'justify-content': VERTICAL_ALIGN_FLEX[this.verticalAlign],
452
- padding: this.isPlain ? '0' : '16px 24px',
452
+ // Plain drops the coloured background, not the card padding:
453
+ // at 0 the greeting sat flush against the card's left edge.
454
+ padding: this.isPlain ? '16px' : '16px 24px',
453
455
  'box-sizing': 'border-box',
454
456
  gap: '8px',
455
457
  'text-align': this.textAlign,
@@ -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 }\" :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<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 { 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\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}`. All fields are optional except `title`\n\t\t * (or `greeting`); unknown enum values collapse to documented defaults\n\t\t * and the renderer never throws.\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 * 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\twidth: '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\tpadding: this.isPlain ? '0' : '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 * 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.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\tleft: -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":["t"],"mappings":";;;;AAmDA,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,CAAA,KAAK,EAAE,GAAG;CACV,MAAM,EAAE,GAAG;AACX,CAAA,KAAK,EAAE,GAAG;CACV,MAAM,EAAE,GAAG;AACZ,CAAC,EAAA;;AAED,MAAM,mBAAkB,GAAI,MAAM,CAAC,MAAM,CAAC;AACzC,CAAA,GAAG,EAAE,YAAY;AACjB,CAAA,MAAM,EAAE,QAAQ;AAChB,CAAA,MAAM,EAAE,UAAU;AACnB,CAAC,EAAA;;AAED;;AAEC;;AAEA;AACA;A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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 }\" :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<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 { 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\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}`. All fields are optional except `title`\n\t\t * (or `greeting`); unknown enum values collapse to documented defaults\n\t\t * and the renderer never throws.\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 * 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\twidth: '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 * 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.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\tleft: -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":["t"],"mappings":";;;;AAmDA,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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tB;;AAED;;;AAGC;AACA;AACA;;;AAGD,EAAA,YAAY,CAAC,KAAK,EAAE;GACnB,IAAI,OAAO,UAAU,QAAQ,EAAE;IAC9B,OAAO,KAAI;AACZ,IAAA;GACA,MAAM,KAAM,GAAE,KAAK,CAAC,IAAI,EAAE,CAAC,KAAK,CAAC,mBAAmB,EAAA;GACpD,IAAI,CAAC,KAAK,EAAE;IACX,OAAO,KAAI;AACZ,IAAA;AACA,GAAA,MAAM,GAAE,GAAI,KAAK,CAAC,CAAC,EAAA;AACnB,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,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 +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 }\" :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<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 { 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\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}`. All fields are optional except `title`\n\t\t * (or `greeting`); unknown enum values collapse to documented defaults\n\t\t * and the renderer never throws.\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 * 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\twidth: '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\tpadding: this.isPlain ? '0' : '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 * 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.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\tleft: -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"],"mappings":";;;;;;uBAWGA;IAAG,KAAK,EAAAC,cAAA,CAAA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ACA,YAAA,YAAU,EAAE,QAAU,CAAA,YAAA;6BACpB,QAAQ,CAAA,QAAA,CAAA,EAAA,EAAA,2BAAA,UAAA,CAAA;;;KAIN,QAAe,CAAA,kBAAA;sBADrBA;;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 }\" :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<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 { 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\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}`. All fields are optional except `title`\n\t\t * (or `greeting`); unknown enum values collapse to documented defaults\n\t\t * and the renderer never throws.\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 * 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\twidth: '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 * 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.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\tleft: -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"],"mappings":";;;;;;uBAWGA;IAAG,KAAK,EAAAC,cAAA,CAAA,CAAC,kBAAW,EAAA,EAAA,yBAAA,EAAA,QAAA,CAAA,OAAA,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,GAAA,EAAA,QAAA,CAAA,MAAA;AACA,YAAA,YAAU,EAAE,QAAU,CAAA,YAAA;6BACpB,QAAQ,CAAA,QAAA,CAAA,EAAA,EAAA,2BAAA,UAAA,CAAA;;;KAIN,QAAe,CAAA,kBAAA;sBADrBA;;AAEA,UAAA,KAAG,EAAA,yBAAA;;;;;;;;;;;;"}
@@ -0,0 +1,10 @@
1
+ import script from './CnLinkCardsPage.vue2.js';
2
+ import { render } from './CnLinkCardsPage.vue3.js';
3
+
4
+ script.render = render;
5
+ script.__scopeId = "data-v-2f9a546b";
6
+ script.__file = "src/components/CnLinkCardsPage/CnLinkCardsPage.vue";
7
+ const __sfc_main = script;
8
+
9
+ export { __sfc_main as default };
10
+ //# sourceMappingURL=CnLinkCardsPage.vue.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CnLinkCardsPage.vue.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;"}