@conduction/nextcloud-vue 2.56.0-beta.46 → 2.56.0-beta.48

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 (199) hide show
  1. package/dist/esm/components/CnActionsMenu/CnActionsMenu.vue2.js +1 -1
  2. package/dist/esm/components/CnActionsMenu/CnActionsMenu.vue2.js.map +1 -1
  3. package/dist/esm/components/CnActionsMenu/CnActionsMenu.vue3.js +2 -1
  4. package/dist/esm/components/CnActionsMenu/CnActionsMenu.vue3.js.map +1 -1
  5. package/dist/esm/components/CnAdminSettingsShell/CnAdminSettingsShell.vue.js +1 -1
  6. package/dist/esm/components/CnAdminSettingsShell/CnAdminSettingsShell.vue2.js +28 -8
  7. package/dist/esm/components/CnAdminSettingsShell/CnAdminSettingsShell.vue2.js.map +1 -1
  8. package/dist/esm/components/CnAdminSettingsShell/CnAdminSettingsShell.vue3.js +37 -2
  9. package/dist/esm/components/CnAdminSettingsShell/CnAdminSettingsShell.vue3.js.map +1 -1
  10. package/dist/esm/components/CnAppRoot/CnAppRoot.vue2.js +57 -4
  11. package/dist/esm/components/CnAppRoot/CnAppRoot.vue2.js.map +1 -1
  12. package/dist/esm/components/CnAppRoot/CnAppRoot.vue3.js +44 -17
  13. package/dist/esm/components/CnAppRoot/CnAppRoot.vue3.js.map +1 -1
  14. package/dist/esm/components/CnChoiceCards/CnChoiceCards.vue.js +1 -1
  15. package/dist/esm/components/CnChoiceCards/CnChoiceCards.vue2.js +44 -2
  16. package/dist/esm/components/CnChoiceCards/CnChoiceCards.vue2.js.map +1 -1
  17. package/dist/esm/components/CnChoiceCards/CnChoiceCards.vue3.js +140 -59
  18. package/dist/esm/components/CnChoiceCards/CnChoiceCards.vue3.js.map +1 -1
  19. package/dist/esm/components/CnCountdownWidget/CnCountdownWidget.vue.js +1 -1
  20. package/dist/esm/components/CnCountdownWidget/CnCountdownWidget.vue2.js +139 -3
  21. package/dist/esm/components/CnCountdownWidget/CnCountdownWidget.vue2.js.map +1 -1
  22. package/dist/esm/components/CnCountdownWidget/CnCountdownWidget.vue3.js +60 -12
  23. package/dist/esm/components/CnCountdownWidget/CnCountdownWidget.vue3.js.map +1 -1
  24. package/dist/esm/components/CnDashboardPage/CnDashboardPage.vue.js +1 -1
  25. package/dist/esm/components/CnDashboardPage/CnDashboardPage.vue2.js +111 -42
  26. package/dist/esm/components/CnDashboardPage/CnDashboardPage.vue2.js.map +1 -1
  27. package/dist/esm/components/CnDashboardPage/CnDashboardPage.vue3.js +117 -73
  28. package/dist/esm/components/CnDashboardPage/CnDashboardPage.vue3.js.map +1 -1
  29. package/dist/esm/components/CnDataTable/CnDataTable.vue2.js +34 -39
  30. package/dist/esm/components/CnDataTable/CnDataTable.vue2.js.map +1 -1
  31. package/dist/esm/components/CnDataTable/CnDataTable.vue3.js +7 -7
  32. package/dist/esm/components/CnDataTable/CnDataTable.vue3.js.map +1 -1
  33. package/dist/esm/components/CnDetailPage/CnDetailPage.vue2.js +5 -3
  34. package/dist/esm/components/CnDetailPage/CnDetailPage.vue2.js.map +1 -1
  35. package/dist/esm/components/CnDetailPage/CnDetailPage.vue3.js.map +1 -1
  36. package/dist/esm/components/CnFactsWidget/CnFactsWidget.vue.js +1 -1
  37. package/dist/esm/components/CnFactsWidget/CnFactsWidget.vue2.js +6 -4
  38. package/dist/esm/components/CnFactsWidget/CnFactsWidget.vue2.js.map +1 -1
  39. package/dist/esm/components/CnFactsWidget/CnFactsWidget.vue3.js.map +1 -1
  40. package/dist/esm/components/CnFeaturesAndRoadmapPage/CnFeaturesAndRoadmapPage.vue2.js +46 -0
  41. package/dist/esm/components/CnFeaturesAndRoadmapPage/CnFeaturesAndRoadmapPage.vue2.js.map +1 -1
  42. package/dist/esm/components/CnFeaturesAndRoadmapPage/CnFeaturesAndRoadmapPage.vue3.js +6 -2
  43. package/dist/esm/components/CnFeaturesAndRoadmapPage/CnFeaturesAndRoadmapPage.vue3.js.map +1 -1
  44. package/dist/esm/components/CnFeaturesAndRoadmapView/CnFeaturesAndRoadmapView.vue.js +1 -1
  45. package/dist/esm/components/CnFeaturesAndRoadmapView/CnFeaturesAndRoadmapView.vue2.js +82 -9
  46. package/dist/esm/components/CnFeaturesAndRoadmapView/CnFeaturesAndRoadmapView.vue2.js.map +1 -1
  47. package/dist/esm/components/CnFeaturesAndRoadmapView/CnFeaturesAndRoadmapView.vue3.js +104 -90
  48. package/dist/esm/components/CnFeaturesAndRoadmapView/CnFeaturesAndRoadmapView.vue3.js.map +1 -1
  49. package/dist/esm/components/CnFeaturesBoard/CnFeaturesBoard.vue.js +9 -0
  50. package/dist/esm/components/CnFeaturesBoard/CnFeaturesBoard.vue.js.map +1 -0
  51. package/dist/esm/components/CnFeaturesBoard/CnFeaturesBoard.vue2.js +355 -0
  52. package/dist/esm/components/CnFeaturesBoard/CnFeaturesBoard.vue2.js.map +1 -0
  53. package/dist/esm/components/CnFeaturesBoard/CnFeaturesBoard.vue3.js +462 -0
  54. package/dist/esm/components/CnFeaturesBoard/CnFeaturesBoard.vue3.js.map +1 -0
  55. package/dist/esm/components/CnFormDialog/CnFormDialog.vue.js +1 -1
  56. package/dist/esm/components/CnFormDialog/CnFormDialog.vue2.js +21 -0
  57. package/dist/esm/components/CnFormDialog/CnFormDialog.vue2.js.map +1 -1
  58. package/dist/esm/components/CnFormDialog/CnFormDialog.vue3.js +402 -391
  59. package/dist/esm/components/CnFormDialog/CnFormDialog.vue3.js.map +1 -1
  60. package/dist/esm/components/CnIcon/semanticIcons.js +2 -2
  61. package/dist/esm/components/CnIcon/semanticIcons.js.map +1 -1
  62. package/dist/esm/components/CnIndexPage/CnIndexPage.vue2.js +141 -7
  63. package/dist/esm/components/CnIndexPage/CnIndexPage.vue2.js.map +1 -1
  64. package/dist/esm/components/CnIndexPage/CnIndexPage.vue3.js +5 -2
  65. package/dist/esm/components/CnIndexPage/CnIndexPage.vue3.js.map +1 -1
  66. package/dist/esm/components/CnNcWidgetWidget/CnNcWidgetWidget.vue.js +1 -1
  67. package/dist/esm/components/CnNcWidgetWidget/CnNcWidgetWidget.vue2.js +22 -1
  68. package/dist/esm/components/CnNcWidgetWidget/CnNcWidgetWidget.vue2.js.map +1 -1
  69. package/dist/esm/components/CnNcWidgetWidget/CnNcWidgetWidget.vue3.js +20 -14
  70. package/dist/esm/components/CnNcWidgetWidget/CnNcWidgetWidget.vue3.js.map +1 -1
  71. package/dist/esm/components/CnNotificationPreferences/CnNotificationPreferences.vue.js +1 -1
  72. package/dist/esm/components/CnNotificationPreferences/CnNotificationPreferences.vue2.js +2 -0
  73. package/dist/esm/components/CnNotificationPreferences/CnNotificationPreferences.vue2.js.map +1 -1
  74. package/dist/esm/components/CnNotificationPreferences/CnNotificationPreferences.vue3.js +15 -5
  75. package/dist/esm/components/CnNotificationPreferences/CnNotificationPreferences.vue3.js.map +1 -1
  76. package/dist/esm/components/CnPageHeader/CnHeaderTrail.vue.js +8 -0
  77. package/dist/esm/components/CnPageHeader/CnHeaderTrail.vue.js.map +1 -0
  78. package/dist/esm/components/CnPageHeader/CnHeaderTrail.vue2.js +114 -0
  79. package/dist/esm/components/CnPageHeader/CnHeaderTrail.vue2.js.map +1 -0
  80. package/dist/esm/components/CnPageHeader/CnHeaderTrail.vue3.js +45 -0
  81. package/dist/esm/components/CnPageHeader/CnHeaderTrail.vue3.js.map +1 -0
  82. package/dist/esm/components/CnPageHeader/CnPageHeader.vue2.js +38 -2
  83. package/dist/esm/components/CnPageHeader/CnPageHeader.vue2.js.map +1 -1
  84. package/dist/esm/components/CnPageHeader/CnPageHeader.vue3.js +12 -2
  85. package/dist/esm/components/CnPageHeader/CnPageHeader.vue3.js.map +1 -1
  86. package/dist/esm/components/CnPagination/CnPagination.vue2.js.map +1 -1
  87. package/dist/esm/components/CnPagination/CnPagination.vue3.js +56 -51
  88. package/dist/esm/components/CnPagination/CnPagination.vue3.js.map +1 -1
  89. package/dist/esm/components/CnRecordListWidget/CnRecordListWidget.vue.js +1 -1
  90. package/dist/esm/components/CnRecordListWidget/CnRecordListWidget.vue2.js +3 -3
  91. package/dist/esm/components/CnRecordListWidget/CnRecordListWidget.vue2.js.map +1 -1
  92. package/dist/esm/components/CnRecordListWidget/CnRecordListWidget.vue3.js.map +1 -1
  93. package/dist/esm/components/CnRoadmapTab/CnRoadmapTab.vue.js +1 -1
  94. package/dist/esm/components/CnRoadmapTab/CnRoadmapTab.vue2.js +8 -30
  95. package/dist/esm/components/CnRoadmapTab/CnRoadmapTab.vue2.js.map +1 -1
  96. package/dist/esm/components/CnRoadmapTab/CnRoadmapTab.vue3.js.map +1 -1
  97. package/dist/esm/components/CnSettingsPage/CnSettingsPage.vue.js +1 -1
  98. package/dist/esm/components/CnSettingsPage/CnSettingsPage.vue2.js +24 -0
  99. package/dist/esm/components/CnSettingsPage/CnSettingsPage.vue2.js.map +1 -1
  100. package/dist/esm/components/CnSettingsPage/CnSettingsPage.vue3.js +3 -1
  101. package/dist/esm/components/CnSettingsPage/CnSettingsPage.vue3.js.map +1 -1
  102. package/dist/esm/components/CnTabs/CnTabs.vue.js +1 -1
  103. package/dist/esm/components/CnTabs/CnTabs.vue2.js +39 -2
  104. package/dist/esm/components/CnTabs/CnTabs.vue2.js.map +1 -1
  105. package/dist/esm/components/CnTabs/CnTabs.vue3.js.map +1 -1
  106. package/dist/esm/components/CnTabsWidget/CnTabsWidget.vue.js +1 -1
  107. package/dist/esm/components/CnTabsWidget/CnTabsWidget.vue2.js +85 -8
  108. package/dist/esm/components/CnTabsWidget/CnTabsWidget.vue2.js.map +1 -1
  109. package/dist/esm/components/CnTabsWidget/CnTabsWidget.vue3.js +37 -9
  110. package/dist/esm/components/CnTabsWidget/CnTabsWidget.vue3.js.map +1 -1
  111. package/dist/esm/components/CnUserSettingsDialog/CnUserSettingsDialog.vue.js +9 -0
  112. package/dist/esm/components/CnUserSettingsDialog/CnUserSettingsDialog.vue.js.map +1 -0
  113. package/dist/esm/components/CnUserSettingsDialog/CnUserSettingsDialog.vue2.js +164 -0
  114. package/dist/esm/components/CnUserSettingsDialog/CnUserSettingsDialog.vue2.js.map +1 -0
  115. package/dist/esm/components/CnUserSettingsDialog/CnUserSettingsDialog.vue3.js +93 -0
  116. package/dist/esm/components/CnUserSettingsDialog/CnUserSettingsDialog.vue3.js.map +1 -0
  117. package/dist/esm/components/CnVersionInfoCard/CnVersionInfoCard.vue.js +1 -1
  118. package/dist/esm/components/CnVersionInfoCard/CnVersionInfoCard.vue2.js.map +1 -1
  119. package/dist/esm/components/CnVersionInfoCard/CnVersionInfoCard.vue3.js +4 -3
  120. package/dist/esm/components/CnVersionInfoCard/CnVersionInfoCard.vue3.js.map +1 -1
  121. package/dist/esm/components/CnWidgetWrapper/CnWidgetWrapper.vue.js +1 -1
  122. package/dist/esm/components/CnWidgetWrapper/CnWidgetWrapper.vue2.js +32 -0
  123. package/dist/esm/components/CnWidgetWrapper/CnWidgetWrapper.vue2.js.map +1 -1
  124. package/dist/esm/components/CnWidgetWrapper/CnWidgetWrapper.vue3.js +31 -20
  125. package/dist/esm/components/CnWidgetWrapper/CnWidgetWrapper.vue3.js.map +1 -1
  126. package/dist/esm/composables/indexSources.js +9 -0
  127. package/dist/esm/composables/indexSources.js.map +1 -1
  128. package/dist/esm/l10n/en.json.js +24 -1
  129. package/dist/esm/l10n/en.json.js.map +1 -1
  130. package/dist/esm/l10n/nl.json.js +24 -1
  131. package/dist/esm/l10n/nl.json.js.map +1 -1
  132. package/dist/esm/library-style.js +1 -1
  133. package/dist/esm/nextcloud-vue.css +1190 -410
  134. package/dist/esm/utils/dueText.js +49 -8
  135. package/dist/esm/utils/dueText.js.map +1 -1
  136. package/dist/esm/utils/featureCatalog.js +135 -0
  137. package/dist/esm/utils/featureCatalog.js.map +1 -0
  138. package/dist/esm/utils/fillTemplate.js +74 -3
  139. package/dist/esm/utils/fillTemplate.js.map +1 -1
  140. package/dist/esm/utils/headerMeta.js +62 -12
  141. package/dist/esm/utils/headerMeta.js.map +1 -1
  142. package/dist/esm/utils/roadmapIssues.js +86 -0
  143. package/dist/esm/utils/roadmapIssues.js.map +1 -0
  144. package/dist/esm/utils/userDisplayName.js +47 -0
  145. package/dist/esm/utils/userDisplayName.js.map +1 -0
  146. package/dist/esm/utils/validateManifestV2.compiled.js +3 -3
  147. package/dist/esm/utils/validateManifestV2.compiled.js.map +1 -1
  148. package/dist/nextcloud-vue.cjs.js +16229 -13423
  149. package/dist/nextcloud-vue.cjs.js.map +2 -2
  150. package/dist/nextcloud-vue.css +1190 -410
  151. package/l10n/en.json +24 -1
  152. package/l10n/nl.json +24 -1
  153. package/package.json +1 -1
  154. package/src/components/CnActionsMenu/CnActionsMenu.vue +3 -1
  155. package/src/components/CnAdminSettingsShell/CnAdminSettingsShell.vue +39 -1
  156. package/src/components/CnAppRoot/CnAppRoot.md +2 -0
  157. package/src/components/CnAppRoot/CnAppRoot.vue +66 -5
  158. package/src/components/CnChoiceCards/CnChoiceCards.md +27 -0
  159. package/src/components/CnChoiceCards/CnChoiceCards.vue +168 -3
  160. package/src/components/CnCountdownWidget/CnCountdownWidget.vue +222 -6
  161. package/src/components/CnDashboardPage/CnDashboardPage.vue +141 -8
  162. package/src/components/CnDataTable/CnDataTable.md +1 -0
  163. package/src/components/CnDataTable/CnDataTable.vue +41 -46
  164. package/src/components/CnDetailPage/CnDetailPage.vue +5 -3
  165. package/src/components/CnFactsWidget/CnFactsWidget.vue +6 -4
  166. package/src/components/CnFeaturesAndRoadmapPage/CnFeaturesAndRoadmapPage.vue +51 -1
  167. package/src/components/CnFeaturesAndRoadmapView/CnFeaturesAndRoadmapView.vue +98 -13
  168. package/src/components/CnFeaturesBoard/CnFeaturesBoard.vue +1053 -0
  169. package/src/components/CnFormDialog/CnFormDialog.vue +606 -562
  170. package/src/components/CnIndexPage/CnIndexPage.vue +144 -7
  171. package/src/components/CnNcWidgetWidget/CnNcWidgetWidget.vue +23 -2
  172. package/src/components/CnNotificationPreferences/CnNotificationPreferences.vue +5 -0
  173. package/src/components/CnPageHeader/CnHeaderTrail.vue +140 -0
  174. package/src/components/CnPageHeader/CnPageHeader.md +11 -0
  175. package/src/components/CnPageHeader/CnPageHeader.vue +42 -0
  176. package/src/components/CnPagination/CnPagination.vue +10 -2
  177. package/src/components/CnRecordListWidget/CnRecordListWidget.vue +3 -3
  178. package/src/components/CnRoadmapTab/CnRoadmapTab.vue +6 -28
  179. package/src/components/CnSettingsPage/CnSettingsPage.vue +26 -0
  180. package/src/components/CnTabs/CnTabs.vue +39 -2
  181. package/src/components/CnTabsWidget/CnTabsWidget.vue +106 -13
  182. package/src/components/CnUserSettingsDialog/CnUserSettingsDialog.vue +305 -0
  183. package/src/components/CnVersionInfoCard/CnVersionInfoCard.vue +4 -3
  184. package/src/components/CnWidgetWrapper/CnWidgetWrapper.md +8 -0
  185. package/src/components/CnWidgetWrapper/CnWidgetWrapper.vue +43 -2
  186. package/src/composables/indexSources.js +9 -0
  187. package/src/css/dialog.css +61 -0
  188. package/src/css/look-board-detail.css +8 -0
  189. package/src/css/look-board-index.css +27 -1
  190. package/src/css/look-board.css +60 -0
  191. package/src/css/page-header.css +16 -0
  192. package/src/schemas/app-manifest-v2.schema.json +30 -17
  193. package/src/utils/dueText.js +49 -8
  194. package/src/utils/featureCatalog.js +132 -0
  195. package/src/utils/fillTemplate.js +73 -2
  196. package/src/utils/headerMeta.js +62 -12
  197. package/src/utils/roadmapIssues.js +82 -0
  198. package/src/utils/userDisplayName.js +54 -0
  199. package/src/utils/validateManifestV2.compiled.js +3 -3
@@ -10,7 +10,8 @@ import { parseDateValue } from './dateVariant.js';
10
10
  *
11
11
  * "3 dagen te laat" in the danger colour, "Vandaag", the short date for a
12
12
  * day still to come ("morgen", "20 okt"), and a configured text when the
13
- * field is empty ("Geen deadline"). One formatter for record-list rows and
13
+ * field is empty ("Geen deadline"). A day to come can read as a count instead
14
+ * ("nog 4 dagen", "nog 8 weken"). One formatter for record-list rows and
14
15
  * table cells, built on the relative date (`formatRelativeDate`).
15
16
  *
16
17
  * @module utils/dueText
@@ -24,8 +25,12 @@ import { parseDateValue } from './dateVariant.js';
24
25
  * Config (all optional): `todayLabel` (default "Due today"), `overdueLabel`
25
26
  * `{ one, other }` with `{count}` (default "{count} day overdue" / "{count} days
26
27
  * overdue"), `emptyText` (shown when the field is empty; without it an empty
27
- * field reads as nothing). Texts go through `translate` before `{count}` is
28
- * filled. Tones: `danger` (overdue), `today`, `upcoming`, `empty`.
28
+ * field reads as nothing), `upcomingLabel` `{ one, other }` with `{count}`
29
+ * (a day to come reads as the days left instead of the date), and
30
+ * `upcomingWeeksLabel` `{ one, other }` (from `upcomingWeeksFrom` days left,
31
+ * default 35, it reads the weeks left, rounded). Texts go through `translate`
32
+ * before `{count}` is filled. Tones: `danger` (overdue), `today`, `upcoming`,
33
+ * `empty`.
29
34
  *
30
35
  * @param {unknown} value A Date, a timestamp or an ISO string.
31
36
  * @param {object} [config] The `due` config.
@@ -42,10 +47,9 @@ function resolveDue(value, config, translate$1 = (text) => text, now = new Date(
42
47
  }
43
48
  const days = ageInDays(date, now);
44
49
  if (days > 0) {
45
- const labels = cfg.overdueLabel && typeof cfg.overdueLabel === 'object' ? cfg.overdueLabel : null;
46
- if (labels && (labels.one || labels.other)) {
47
- const template = translate$1((days === 1 ? labels.one : labels.other) || labels.other || labels.one);
48
- return { text: template.replace(/\{count\}/g, String(days)), tone: 'danger' }
50
+ const overdue = pluralLabel(cfg.overdueLabel, days, translate$1);
51
+ if (overdue !== null) {
52
+ return { text: overdue, tone: 'danger' }
49
53
  }
50
54
  return { text: translatePlural('nextcloud-vue', '{count} day overdue', '{count} days overdue', days, { count: days }), tone: 'danger' }
51
55
  }
@@ -53,7 +57,44 @@ function resolveDue(value, config, translate$1 = (text) => text, now = new Date(
53
57
  const label = typeof cfg.todayLabel === 'string' && cfg.todayLabel !== '' ? translate$1(cfg.todayLabel) : translate('nextcloud-vue', 'Due today');
54
58
  return { text: label, tone: 'today' }
55
59
  }
56
- return { text: formatRelativeDate(date, { now }), tone: 'upcoming' }
60
+ return { text: upcomingText(-days, cfg, translate$1) ?? formatRelativeDate(date, { now }), tone: 'upcoming' }
61
+ }
62
+
63
+ /**
64
+ * The days or weeks left before a date to come, or null without `upcomingLabel`.
65
+ *
66
+ * @param {number} left Whole days left, at least 1.
67
+ * @param {object} cfg The `due` config.
68
+ * @param {(text: string) => string} translate The host's translate.
69
+ * @return {string|null} The text, or null.
70
+ * @spec openspec/changes/due-text-upcoming-count/specs/due-text-upcoming-count/spec.md#requirement-a-due-date-to-come-can-read-as-the-time-left
71
+ */
72
+ function upcomingText(left, cfg, translate) {
73
+ const from = Number(cfg.upcomingWeeksFrom);
74
+ const weeksFrom = Number.isFinite(from) && from > 0 ? from : 35;
75
+ if (left >= weeksFrom) {
76
+ const weeks = pluralLabel(cfg.upcomingWeeksLabel, Math.round(left / 7), translate);
77
+ if (weeks !== null) {
78
+ return weeks
79
+ }
80
+ }
81
+ return pluralLabel(cfg.upcomingLabel, left, translate)
82
+ }
83
+
84
+ /**
85
+ * A `{ one, other }` label with `{count}` filled, or null when none is configured.
86
+ *
87
+ * @param {unknown} labels The configured label pair.
88
+ * @param {number} count The count.
89
+ * @param {(text: string) => string} translate The host's translate.
90
+ * @return {string|null} The text, or null.
91
+ */
92
+ function pluralLabel(labels, count, translate) {
93
+ if (!labels || typeof labels !== 'object' || !(labels.one || labels.other)) {
94
+ return null
95
+ }
96
+ const template = translate((count === 1 ? labels.one : labels.other) || labels.other || labels.one);
97
+ return template.replace(/\{count\}/g, String(count))
57
98
  }
58
99
 
59
100
  export { resolveDue };
@@ -1 +1 @@
1
- {"version":3,"file":"dueText.js","sources":["../../../src/utils/dueText.js"],"sourcesContent":["/**\n * SPDX-FileCopyrightText: 2026 Conduction B.V.\n * SPDX-License-Identifier: EUPL-1.2\n *\n * dueText: the text of a due date and the tone it is drawn in.\n *\n * \"3 dagen te laat\" in the danger colour, \"Vandaag\", the short date for a\n * day still to come (\"morgen\", \"20 okt\"), and a configured text when the\n * field is empty (\"Geen deadline\"). One formatter for record-list rows and\n * table cells, built on the relative date (`formatRelativeDate`).\n *\n * @module utils/dueText\n * @spec openspec/changes/screens-due-text/specs/due-text/spec.md#requirement-a-due-date-reads-as-text-with-a-tone\n */\n\nimport { translatePlural as n, translate as t } from '@nextcloud/l10n'\nimport { ageInDays, formatRelativeDate } from './boardDate.js'\nimport { parseDateValue } from './dateVariant.js'\n\n/**\n * The text and tone of a due date.\n *\n * Config (all optional): `todayLabel` (default \"Due today\"), `overdueLabel`\n * `{ one, other }` with `{count}` (default \"{count} day overdue\" / \"{count} days\n * overdue\"), `emptyText` (shown when the field is empty; without it an empty\n * field reads as nothing). Texts go through `translate` before `{count}` is\n * filled. Tones: `danger` (overdue), `today`, `upcoming`, `empty`.\n *\n * @param {unknown} value A Date, a timestamp or an ISO string.\n * @param {object} [config] The `due` config.\n * @param {(text: string) => string} [translate] The host's translate.\n * @param {Date} [now] The reference moment.\n * @return {{text: string, tone: string}|null} The text and tone, or null when there is nothing to show.\n */\nexport function resolveDue(value, config, translate = (text) => text, now = new Date()) {\n\tconst cfg = config && typeof config === 'object' ? config : {}\n\tconst date = parseDateValue(value)\n\tif (date === null) {\n\t\tconst empty = typeof cfg.emptyText === 'string' && cfg.emptyText !== '' ? translate(cfg.emptyText) : ''\n\t\treturn empty === '' ? null : { text: empty, tone: 'empty' }\n\t}\n\tconst days = ageInDays(date, now)\n\tif (days > 0) {\n\t\tconst labels = cfg.overdueLabel && typeof cfg.overdueLabel === 'object' ? cfg.overdueLabel : null\n\t\tif (labels && (labels.one || labels.other)) {\n\t\t\tconst template = translate((days === 1 ? labels.one : labels.other) || labels.other || labels.one)\n\t\t\treturn { text: template.replace(/\\{count\\}/g, String(days)), tone: 'danger' }\n\t\t}\n\t\treturn { text: n('nextcloud-vue', '{count} day overdue', '{count} days overdue', days, { count: days }), tone: 'danger' }\n\t}\n\tif (days === 0) {\n\t\tconst label = typeof cfg.todayLabel === 'string' && cfg.todayLabel !== '' ? translate(cfg.todayLabel) : t('nextcloud-vue', 'Due today')\n\t\treturn { text: label, tone: 'today' }\n\t}\n\treturn { text: formatRelativeDate(date, { now }), tone: 'upcoming' }\n}\n"],"names":["translate","n","t"],"mappings":";;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAIA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAAS,UAAU,CAAC,KAAK,EAAE,MAAM,EAAEA,WAAS,GAAG,CAAC,IAAI,KAAK,IAAI,EAAE,GAAG,GAAG,IAAI,IAAI,EAAE,EAAE;AACxF,CAAC,MAAM,GAAG,GAAG,MAAM,IAAI,OAAO,MAAM,KAAK,QAAQ,GAAG,MAAM,GAAG,GAAE;AAC/D,CAAC,MAAM,IAAI,GAAG,cAAc,CAAC,KAAK,EAAC;AACnC,CAAC,IAAI,IAAI,KAAK,IAAI,EAAE;AACpB,EAAE,MAAM,KAAK,GAAG,OAAO,GAAG,CAAC,SAAS,KAAK,QAAQ,IAAI,GAAG,CAAC,SAAS,KAAK,EAAE,GAAGA,WAAS,CAAC,GAAG,CAAC,SAAS,CAAC,GAAG,GAAE;AACzG,EAAE,OAAO,KAAK,KAAK,EAAE,GAAG,IAAI,GAAG,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,OAAO,EAAE;AAC7D,EAAE;AACF,CAAC,MAAM,IAAI,GAAG,SAAS,CAAC,IAAI,EAAE,GAAG,EAAC;AAClC,CAAC,IAAI,IAAI,GAAG,CAAC,EAAE;AACf,EAAE,MAAM,MAAM,GAAG,GAAG,CAAC,YAAY,IAAI,OAAO,GAAG,CAAC,YAAY,KAAK,QAAQ,GAAG,GAAG,CAAC,YAAY,GAAG,KAAI;AACnG,EAAE,IAAI,MAAM,KAAK,MAAM,CAAC,GAAG,IAAI,MAAM,CAAC,KAAK,CAAC,EAAE;AAC9C,GAAG,MAAM,QAAQ,GAAGA,WAAS,CAAC,CAAC,IAAI,KAAK,CAAC,GAAG,MAAM,CAAC,GAAG,GAAG,MAAM,CAAC,KAAK,KAAK,MAAM,CAAC,KAAK,IAAI,MAAM,CAAC,GAAG,EAAC;AACrG,GAAG,OAAO,EAAE,IAAI,EAAE,QAAQ,CAAC,OAAO,CAAC,YAAY,EAAE,MAAM,CAAC,IAAI,CAAC,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE;AAChF,GAAG;AACH,EAAE,OAAO,EAAE,IAAI,EAAEC,eAAC,CAAC,eAAe,EAAE,qBAAqB,EAAE,sBAAsB,EAAE,IAAI,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE;AAC3H,EAAE;AACF,CAAC,IAAI,IAAI,KAAK,CAAC,EAAE;AACjB,EAAE,MAAM,KAAK,GAAG,OAAO,GAAG,CAAC,UAAU,KAAK,QAAQ,IAAI,GAAG,CAAC,UAAU,KAAK,EAAE,GAAGD,WAAS,CAAC,GAAG,CAAC,UAAU,CAAC,GAAGE,SAAC,CAAC,eAAe,EAAE,WAAW,EAAC;AACzI,EAAE,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,OAAO,EAAE;AACvC,EAAE;AACF,CAAC,OAAO,EAAE,IAAI,EAAE,kBAAkB,CAAC,IAAI,EAAE,EAAE,GAAG,EAAE,CAAC,EAAE,IAAI,EAAE,UAAU,EAAE;AACrE;;;;"}
1
+ {"version":3,"file":"dueText.js","sources":["../../../src/utils/dueText.js"],"sourcesContent":["/**\n * SPDX-FileCopyrightText: 2026 Conduction B.V.\n * SPDX-License-Identifier: EUPL-1.2\n *\n * dueText: the text of a due date and the tone it is drawn in.\n *\n * \"3 dagen te laat\" in the danger colour, \"Vandaag\", the short date for a\n * day still to come (\"morgen\", \"20 okt\"), and a configured text when the\n * field is empty (\"Geen deadline\"). A day to come can read as a count instead\n * (\"nog 4 dagen\", \"nog 8 weken\"). One formatter for record-list rows and\n * table cells, built on the relative date (`formatRelativeDate`).\n *\n * @module utils/dueText\n * @spec openspec/changes/screens-due-text/specs/due-text/spec.md#requirement-a-due-date-reads-as-text-with-a-tone\n */\n\nimport { translatePlural as n, translate as t } from '@nextcloud/l10n'\nimport { ageInDays, formatRelativeDate } from './boardDate.js'\nimport { parseDateValue } from './dateVariant.js'\n\n/**\n * The text and tone of a due date.\n *\n * Config (all optional): `todayLabel` (default \"Due today\"), `overdueLabel`\n * `{ one, other }` with `{count}` (default \"{count} day overdue\" / \"{count} days\n * overdue\"), `emptyText` (shown when the field is empty; without it an empty\n * field reads as nothing), `upcomingLabel` `{ one, other }` with `{count}`\n * (a day to come reads as the days left instead of the date), and\n * `upcomingWeeksLabel` `{ one, other }` (from `upcomingWeeksFrom` days left,\n * default 35, it reads the weeks left, rounded). Texts go through `translate`\n * before `{count}` is filled. Tones: `danger` (overdue), `today`, `upcoming`,\n * `empty`.\n *\n * @param {unknown} value A Date, a timestamp or an ISO string.\n * @param {object} [config] The `due` config.\n * @param {(text: string) => string} [translate] The host's translate.\n * @param {Date} [now] The reference moment.\n * @return {{text: string, tone: string}|null} The text and tone, or null when there is nothing to show.\n */\nexport function resolveDue(value, config, translate = (text) => text, now = new Date()) {\n\tconst cfg = config && typeof config === 'object' ? config : {}\n\tconst date = parseDateValue(value)\n\tif (date === null) {\n\t\tconst empty = typeof cfg.emptyText === 'string' && cfg.emptyText !== '' ? translate(cfg.emptyText) : ''\n\t\treturn empty === '' ? null : { text: empty, tone: 'empty' }\n\t}\n\tconst days = ageInDays(date, now)\n\tif (days > 0) {\n\t\tconst overdue = pluralLabel(cfg.overdueLabel, days, translate)\n\t\tif (overdue !== null) {\n\t\t\treturn { text: overdue, tone: 'danger' }\n\t\t}\n\t\treturn { text: n('nextcloud-vue', '{count} day overdue', '{count} days overdue', days, { count: days }), tone: 'danger' }\n\t}\n\tif (days === 0) {\n\t\tconst label = typeof cfg.todayLabel === 'string' && cfg.todayLabel !== '' ? translate(cfg.todayLabel) : t('nextcloud-vue', 'Due today')\n\t\treturn { text: label, tone: 'today' }\n\t}\n\treturn { text: upcomingText(-days, cfg, translate) ?? formatRelativeDate(date, { now }), tone: 'upcoming' }\n}\n\n/**\n * The days or weeks left before a date to come, or null without `upcomingLabel`.\n *\n * @param {number} left Whole days left, at least 1.\n * @param {object} cfg The `due` config.\n * @param {(text: string) => string} translate The host's translate.\n * @return {string|null} The text, or null.\n * @spec openspec/changes/due-text-upcoming-count/specs/due-text-upcoming-count/spec.md#requirement-a-due-date-to-come-can-read-as-the-time-left\n */\nfunction upcomingText(left, cfg, translate) {\n\tconst from = Number(cfg.upcomingWeeksFrom)\n\tconst weeksFrom = Number.isFinite(from) && from > 0 ? from : 35\n\tif (left >= weeksFrom) {\n\t\tconst weeks = pluralLabel(cfg.upcomingWeeksLabel, Math.round(left / 7), translate)\n\t\tif (weeks !== null) {\n\t\t\treturn weeks\n\t\t}\n\t}\n\treturn pluralLabel(cfg.upcomingLabel, left, translate)\n}\n\n/**\n * A `{ one, other }` label with `{count}` filled, or null when none is configured.\n *\n * @param {unknown} labels The configured label pair.\n * @param {number} count The count.\n * @param {(text: string) => string} translate The host's translate.\n * @return {string|null} The text, or null.\n */\nfunction pluralLabel(labels, count, translate) {\n\tif (!labels || typeof labels !== 'object' || !(labels.one || labels.other)) {\n\t\treturn null\n\t}\n\tconst template = translate((count === 1 ? labels.one : labels.other) || labels.other || labels.one)\n\treturn template.replace(/\\{count\\}/g, String(count))\n}\n"],"names":["translate","n","t"],"mappings":";;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAIA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAAS,UAAU,CAAC,KAAK,EAAE,MAAM,EAAEA,WAAS,GAAG,CAAC,IAAI,KAAK,IAAI,EAAE,GAAG,GAAG,IAAI,IAAI,EAAE,EAAE;AACx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,MAAM,CAAC,GAAG,GAAG,MAAM,CAAC,KAAK,KAAK,MAAM,CAAC,KAAK,IAAI,MAAM,CAAC,GAAG,EAAC;AACpG,CAAC,OAAO,QAAQ,CAAC,OAAO,CAAC,YAAY,EAAE,MAAM,CAAC,KAAK,CAAC,CAAC;AACrD;;;;"}
@@ -0,0 +1,135 @@
1
+ /**
2
+ * SPDX-FileCopyrightText: 2026 Conduction B.V.
3
+ * SPDX-License-Identifier: EUPL-1.2
4
+ *
5
+ * featureCatalog: the feature list of the Features and roadmap page, read the
6
+ * way the board look draws it. A feature carries a status (available, beta,
7
+ * in progress or planned), an optional category and optional per-language
8
+ * titles (`title_nl`, `summary_nl`) next to the English ones.
9
+ *
10
+ * @module utils/featureCatalog
11
+ * @spec openspec/changes/screens-roadmap-board-look/specs/features-roadmap-board-look/spec.md
12
+ */
13
+
14
+ /** The statuses, in the order the filter and the captions list them. */
15
+ const FEATURE_STATUSES = Object.freeze(['available', 'beta', 'in_progress', 'planned']);
16
+
17
+ /** The badge variant of each status. */
18
+ const FEATURE_STATUS_VARIANTS = Object.freeze({
19
+ available: 'success',
20
+ beta: 'warning',
21
+ in_progress: 'primary',
22
+ planned: 'purple',
23
+ });
24
+
25
+ const STATUS_ALIASES = Object.freeze({
26
+ available: 'available',
27
+ stable: 'available',
28
+ done: 'available',
29
+ released: 'available',
30
+ shipped: 'available',
31
+ beta: 'beta',
32
+ preview: 'beta',
33
+ in_progress: 'in_progress',
34
+ 'in-progress': 'in_progress',
35
+ inprogress: 'in_progress',
36
+ building: 'in_progress',
37
+ development: 'in_progress',
38
+ planned: 'planned',
39
+ roadmap: 'planned',
40
+ proposed: 'planned',
41
+ soon: 'planned',
42
+ });
43
+
44
+ /**
45
+ * The status key of a feature. A feature without a status is one the app
46
+ * ships, as every entry of the list was before statuses existed.
47
+ *
48
+ * @param {unknown} raw The feature's `status`.
49
+ * @return {string} One of FEATURE_STATUSES.
50
+ * @spec openspec/changes/screens-roadmap-board-look/specs/features-roadmap-board-look/spec.md#requirement-a-feature-has-one-of-four-statuses
51
+ */
52
+ function featureStatus(raw) {
53
+ if (typeof raw !== 'string' || raw.trim() === '') {
54
+ return 'available'
55
+ }
56
+ return STATUS_ALIASES[raw.trim().toLowerCase()] || 'available'
57
+ }
58
+
59
+ /**
60
+ * A text field of a feature in the reader's language: `title_nl` for a Dutch
61
+ * reader when the feature has one, else `title`.
62
+ *
63
+ * @param {object} feature The feature.
64
+ * @param {string} field `title` or `summary`.
65
+ * @param {string} [language] The reader's language tag (`nl`, `nl_NL`, `de-DE`).
66
+ * @return {string} The text, or ''.
67
+ * @spec openspec/changes/screens-roadmap-board-look/specs/features-roadmap-board-look/spec.md#requirement-a-feature-reads-in-the-readers-language
68
+ */
69
+ function featureText(feature, field, language = '') {
70
+ if (!feature || typeof feature !== 'object') {
71
+ return ''
72
+ }
73
+ const base = String(language || '').split(/[-_]/)[0].toLowerCase();
74
+ const own = base ? feature[`${field}_${base}`] : undefined;
75
+ if (typeof own === 'string' && own.trim() !== '') {
76
+ return own
77
+ }
78
+ return typeof feature[field] === 'string' ? feature[field] : ''
79
+ }
80
+
81
+ /**
82
+ * How many features carry each status.
83
+ *
84
+ * @param {Array<{status: string}>} features Features with a normalised status.
85
+ * @return {{all: number, available: number, beta: number, in_progress: number, planned: number}} The counts.
86
+ * @spec openspec/changes/screens-roadmap-board-look/specs/features-roadmap-board-look/spec.md#requirement-the-status-filter-shows-a-count-per-status
87
+ */
88
+ function countByStatus(features) {
89
+ const counts = { all: features.length, available: 0, beta: 0, in_progress: 0, planned: 0 };
90
+ for (const feature of features) {
91
+ counts[feature.status] += 1;
92
+ }
93
+ return counts
94
+ }
95
+
96
+ /**
97
+ * The features in the reader's language, grouped by category. Groups follow
98
+ * the order of `categories`; features without a known category come first,
99
+ * under no caption. Inside a group the features keep their given order.
100
+ *
101
+ * @param {Array<object>} features The raw features.
102
+ * @param {object} [categories] Category key to caption.
103
+ * @param {string} [language] The reader's language tag.
104
+ * @return {Array<{key: string, label: string, features: Array<object>}>} The groups; a group without features is left out.
105
+ * @spec openspec/changes/screens-roadmap-board-look/specs/features-roadmap-board-look/spec.md#requirement-features-are-grouped-by-category
106
+ */
107
+ function groupFeatures(features, categories = {}, language = '') {
108
+ const captions = categories && typeof categories === 'object' && !Array.isArray(categories) ? categories : {};
109
+ const groups = [{ key: '', label: '', features: [] }];
110
+ const byKey = { '': groups[0] };
111
+ for (const [key, label] of Object.entries(captions)) {
112
+ const group = { key, label: String(label), features: [] };
113
+ groups.push(group);
114
+ byKey[key] = group;
115
+ }
116
+ for (const raw of Array.isArray(features) ? features : []) {
117
+ if (!raw || typeof raw !== 'object') {
118
+ continue
119
+ }
120
+ const feature = {
121
+ slug: String(raw.slug || raw.id || ''),
122
+ title: featureText(raw, 'title', language) || String(raw.slug || ''),
123
+ summary: featureText(raw, 'summary', language),
124
+ status: featureStatus(raw.status),
125
+ expected: typeof raw.expected === 'string' ? raw.expected : '',
126
+ docsUrl: typeof raw.docsUrl === 'string' ? raw.docsUrl : '',
127
+ };
128
+ const group = byKey[typeof raw.category === 'string' ? raw.category : ''] || byKey[''];
129
+ group.features.push(feature);
130
+ }
131
+ return groups.filter((group) => group.features.length > 0)
132
+ }
133
+
134
+ export { FEATURE_STATUSES, FEATURE_STATUS_VARIANTS, countByStatus, featureStatus, featureText, groupFeatures };
135
+ //# sourceMappingURL=featureCatalog.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"featureCatalog.js","sources":["../../../src/utils/featureCatalog.js"],"sourcesContent":["/**\n * SPDX-FileCopyrightText: 2026 Conduction B.V.\n * SPDX-License-Identifier: EUPL-1.2\n *\n * featureCatalog: the feature list of the Features and roadmap page, read the\n * way the board look draws it. A feature carries a status (available, beta,\n * in progress or planned), an optional category and optional per-language\n * titles (`title_nl`, `summary_nl`) next to the English ones.\n *\n * @module utils/featureCatalog\n * @spec openspec/changes/screens-roadmap-board-look/specs/features-roadmap-board-look/spec.md\n */\n\n/** The statuses, in the order the filter and the captions list them. */\nexport const FEATURE_STATUSES = Object.freeze(['available', 'beta', 'in_progress', 'planned'])\n\n/** The badge variant of each status. */\nexport const FEATURE_STATUS_VARIANTS = Object.freeze({\n\tavailable: 'success',\n\tbeta: 'warning',\n\tin_progress: 'primary',\n\tplanned: 'purple',\n})\n\nconst STATUS_ALIASES = Object.freeze({\n\tavailable: 'available',\n\tstable: 'available',\n\tdone: 'available',\n\treleased: 'available',\n\tshipped: 'available',\n\tbeta: 'beta',\n\tpreview: 'beta',\n\tin_progress: 'in_progress',\n\t'in-progress': 'in_progress',\n\tinprogress: 'in_progress',\n\tbuilding: 'in_progress',\n\tdevelopment: 'in_progress',\n\tplanned: 'planned',\n\troadmap: 'planned',\n\tproposed: 'planned',\n\tsoon: 'planned',\n})\n\n/**\n * The status key of a feature. A feature without a status is one the app\n * ships, as every entry of the list was before statuses existed.\n *\n * @param {unknown} raw The feature's `status`.\n * @return {string} One of FEATURE_STATUSES.\n * @spec openspec/changes/screens-roadmap-board-look/specs/features-roadmap-board-look/spec.md#requirement-a-feature-has-one-of-four-statuses\n */\nexport function featureStatus(raw) {\n\tif (typeof raw !== 'string' || raw.trim() === '') {\n\t\treturn 'available'\n\t}\n\treturn STATUS_ALIASES[raw.trim().toLowerCase()] || 'available'\n}\n\n/**\n * A text field of a feature in the reader's language: `title_nl` for a Dutch\n * reader when the feature has one, else `title`.\n *\n * @param {object} feature The feature.\n * @param {string} field `title` or `summary`.\n * @param {string} [language] The reader's language tag (`nl`, `nl_NL`, `de-DE`).\n * @return {string} The text, or ''.\n * @spec openspec/changes/screens-roadmap-board-look/specs/features-roadmap-board-look/spec.md#requirement-a-feature-reads-in-the-readers-language\n */\nexport function featureText(feature, field, language = '') {\n\tif (!feature || typeof feature !== 'object') {\n\t\treturn ''\n\t}\n\tconst base = String(language || '').split(/[-_]/)[0].toLowerCase()\n\tconst own = base ? feature[`${field}_${base}`] : undefined\n\tif (typeof own === 'string' && own.trim() !== '') {\n\t\treturn own\n\t}\n\treturn typeof feature[field] === 'string' ? feature[field] : ''\n}\n\n/**\n * How many features carry each status.\n *\n * @param {Array<{status: string}>} features Features with a normalised status.\n * @return {{all: number, available: number, beta: number, in_progress: number, planned: number}} The counts.\n * @spec openspec/changes/screens-roadmap-board-look/specs/features-roadmap-board-look/spec.md#requirement-the-status-filter-shows-a-count-per-status\n */\nexport function countByStatus(features) {\n\tconst counts = { all: features.length, available: 0, beta: 0, in_progress: 0, planned: 0 }\n\tfor (const feature of features) {\n\t\tcounts[feature.status] += 1\n\t}\n\treturn counts\n}\n\n/**\n * The features in the reader's language, grouped by category. Groups follow\n * the order of `categories`; features without a known category come first,\n * under no caption. Inside a group the features keep their given order.\n *\n * @param {Array<object>} features The raw features.\n * @param {object} [categories] Category key to caption.\n * @param {string} [language] The reader's language tag.\n * @return {Array<{key: string, label: string, features: Array<object>}>} The groups; a group without features is left out.\n * @spec openspec/changes/screens-roadmap-board-look/specs/features-roadmap-board-look/spec.md#requirement-features-are-grouped-by-category\n */\nexport function groupFeatures(features, categories = {}, language = '') {\n\tconst captions = categories && typeof categories === 'object' && !Array.isArray(categories) ? categories : {}\n\tconst groups = [{ key: '', label: '', features: [] }]\n\tconst byKey = { '': groups[0] }\n\tfor (const [key, label] of Object.entries(captions)) {\n\t\tconst group = { key, label: String(label), features: [] }\n\t\tgroups.push(group)\n\t\tbyKey[key] = group\n\t}\n\tfor (const raw of Array.isArray(features) ? features : []) {\n\t\tif (!raw || typeof raw !== 'object') {\n\t\t\tcontinue\n\t\t}\n\t\tconst feature = {\n\t\t\tslug: String(raw.slug || raw.id || ''),\n\t\t\ttitle: featureText(raw, 'title', language) || String(raw.slug || ''),\n\t\t\tsummary: featureText(raw, 'summary', language),\n\t\t\tstatus: featureStatus(raw.status),\n\t\t\texpected: typeof raw.expected === 'string' ? raw.expected : '',\n\t\t\tdocsUrl: typeof raw.docsUrl === 'string' ? raw.docsUrl : '',\n\t\t}\n\t\tconst group = byKey[typeof raw.category === 'string' ? raw.category : ''] || byKey['']\n\t\tgroup.features.push(feature)\n\t}\n\treturn groups.filter((group) => group.features.length > 0)\n}\n"],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACY,MAAC,gBAAgB,GAAG,MAAM,CAAC,MAAM,CAAC,CAAC,WAAW,EAAE,MAAM,EAAE,aAAa,EAAE,SAAS,CAAC,EAAC;AAC9F;AACA;AACY,MAAC,uBAAuB,GAAG,MAAM,CAAC,MAAM,CAAC;AACrD,CAAC,SAAS,EAAE,SAAS;AACrB,CAAC,IAAI,EAAE,SAAS;AAChB,CAAC,WAAW,EAAE,SAAS;AACvB,CAAC,OAAO,EAAE,QAAQ;AAClB,CAAC,EAAC;AACF;AACA,MAAM,cAAc,GAAG,MAAM,CAAC,MAAM,CAAC;AACrC,CAAC,SAAS,EAAE,WAAW;AACvB,CAAC,MAAM,EAAE,WAAW;AACpB,CAAC,IAAI,EAAE,WAAW;AAClB,CAAC,QAAQ,EAAE,WAAW;AACtB,CAAC,OAAO,EAAE,WAAW;AACrB,CAAC,IAAI,EAAE,MAAM;AACb,CAAC,OAAO,EAAE,MAAM;AAChB,CAAC,WAAW,EAAE,aAAa;AAC3B,CAAC,aAAa,EAAE,aAAa;AAC7B,CAAC,UAAU,EAAE,aAAa;AAC1B,CAAC,QAAQ,EAAE,aAAa;AACxB,CAAC,WAAW,EAAE,aAAa;AAC3B,CAAC,OAAO,EAAE,SAAS;AACnB,CAAC,OAAO,EAAE,SAAS;AACnB,CAAC,QAAQ,EAAE,SAAS;AACpB,CAAC,IAAI,EAAE,SAAS;AAChB,CAAC,EAAC;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAAS,aAAa,CAAC,GAAG,EAAE;AACnC,CAAC,IAAI,OAAO,GAAG,KAAK,QAAQ,IAAI,GAAG,CAAC,IAAI,EAAE,KAAK,EAAE,EAAE;AACnD,EAAE,OAAO,WAAW;AACpB,EAAE;AACF,CAA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,CAAC,IAAI,IAAI,EAAE,CAAC;AACvE,GAAG,OAAO,EAAE,WAAW,CAAC,GAAG,EAAE,SAAS,EAAE,QAAQ,CAAC;AACjD,GAAG,MAAM,EAAE,aAAa,CAAC,GAAG,CAAC,MAAM,CAAC;AACpC,GAAG,QAAQ,EAAE,OAAO,GAAG,CAAC,QAAQ,KAAK,QAAQ,GAAG,GAAG,CAAC,QAAQ,GAAG,EAAE;AACjE,GAAG,OAAO,EAAE,OAAO,GAAG,CAAC,OAAO,KAAK,QAAQ,GAAG,GAAG,CAAC,OAAO,GAAG,EAAE;AAC9D,IAAG;AACH,EAAE,MAAM,KAAK,GAAG,KAAK,CAAC,OAAO,GAAG,CAAC,QAAQ,KAAK,QAAQ,GAAG,GAAG,CAAC,QAAQ,GAAG,EAAE,CAAC,IAAI,KAAK,CAAC,EAAE,EAAC;AACxF,EAAE,KAAK,CAAC,QAAQ,CAAC,IAAI,CAAC,OAAO,EAAC;AAC9B,EAAE;AACF,CAAC,OAAO,MAAM,CAAC,MAAM,CAAC,CAAC,KAAK,KAAK,KAAK,CAAC,QAAQ,CAAC,MAAM,GAAG,CAAC,CAAC;AAC3D;;;;"}
@@ -2,6 +2,7 @@ import { formatBoardDate, formatBoardWeekday, formatTimeOfDay, formatRelativeDat
2
2
  import { parseDateValue } from './dateVariant.js';
3
3
  import { formatMoney } from './formatMetric.js';
4
4
  import { readPath } from './readPath.js';
5
+ import { userDisplayName } from './userDisplayName.js';
5
6
 
6
7
  // SPDX-FileCopyrightText: 2026 Conduction B.V.
7
8
  // SPDX-License-Identifier: EUPL-1.2
@@ -33,11 +34,37 @@ function formatBoardDateTime(value, now = new Date()) {
33
34
  return `${day}, ${time}`
34
35
  }
35
36
 
37
+ /**
38
+ * A date with the month written out: "7 oktober", or "6 oktober 2026"
39
+ * outside the current year or when `withYear` asks for it.
40
+ *
41
+ * @param {unknown} value A Date, a timestamp or an ISO string.
42
+ * @param {Date} now The reference moment.
43
+ * @param {boolean} [withYear] Always write the year.
44
+ * @return {string} The text, or '' when the value is not a date.
45
+ * @spec openspec/changes/screens-header-meta-tokens/specs/detail-page-board-look/spec.md#requirement-the-header-meta-line-formats-users-long-dates-and-enum-labels
46
+ */
47
+ function formatLongDate(value, now = new Date(), withYear = false) {
48
+ const date = parseDateValue(value);
49
+ if (date === null) {
50
+ return ''
51
+ }
52
+ const options = { day: 'numeric', month: 'long' };
53
+ if (withYear || date.getFullYear() !== now.getFullYear()) {
54
+ options.year = 'numeric';
55
+ }
56
+ try {
57
+ return new Intl.DateTimeFormat(boardDateLocale(), options).format(date)
58
+ } catch {
59
+ return new Intl.DateTimeFormat(undefined, options).format(date)
60
+ }
61
+ }
62
+
36
63
  /**
37
64
  * Format one token value.
38
65
  *
39
66
  * @param {unknown} value The raw value.
40
- * @param {string} format `date`, `datetime`, `weekday`, `time`, `relative`, `relativetime`, `days` or '' (as is).
67
+ * @param {string} format `date`, `datetime`, `weekday`, `longdate`, `time`, `user`, `currency`, `relative`, `relativetime`, `days` or '' (as is).
41
68
  * @param {Date} now The reference moment.
42
69
  * @param {string} [arg] The format's argument (`currency:EUR`, or a row path holding the code).
43
70
  * @param {object|null} [object] The row, for a currency read from a field.
@@ -57,6 +84,12 @@ function formatValue(value, format, now, arg = '', object = null, config = null)
57
84
  if (format === 'weekday') {
58
85
  return formatBoardWeekday(value, now, { today: arg === 'today' })
59
86
  }
87
+ if (format === 'longdate') {
88
+ return formatLongDate(value, now, arg === 'year')
89
+ }
90
+ if (format === 'user') {
91
+ return userDisplayName(value)
92
+ }
60
93
  if (format === 'time') {
61
94
  const date = parseDateValue(value);
62
95
  return date === null ? '' : formatTimeOfDay(date)
@@ -89,7 +122,10 @@ function formatValue(value, format, now, arg = '', object = null, config = null)
89
122
  * Every `{path}` token is a dot path into the object; `{path|date}` and
90
123
  * `{path|datetime}` format it as the boards write dates, `{path|weekday}` adds
91
124
  * the short weekday ("wo 7 okt"; `{path|weekday:today}` reads "Vandaag, wo 7 okt"
92
- * for today), `{path|time}` is the time of day ("08:45"), `{path|currency}`,
125
+ * for today), `{path|longdate}` writes the month out ("7 oktober";
126
+ * `{path|longdate:year}` always adds the year), `{path|time}` is the time
127
+ * of day ("08:45"), `{path|user}` is a user id's display name (looked up
128
+ * once, '' until it arrives), `{path|currency}`,
93
129
  * `{path|currency:EUR}` and `{path|currency:field}` write an amount in a
94
130
  * currency (a code, or the row field that holds it; without either, or when
95
131
  * the row field is empty, the app's reporting currency), `{path|relative}` and
@@ -149,5 +185,40 @@ function firstFilled(templates, object, translate = (key) => key, now = new Date
149
185
  return ''
150
186
  }
151
187
 
152
- export { fillTemplate, firstFilled, formatBoardDateTime };
188
+ /**
189
+ * Fill a template such as `"{identifier} · {requester}"` field by field
190
+ * (a table column's `secondary` line, a detail page's meta line).
191
+ *
192
+ * A field without a value takes its separator with it: the text between two
193
+ * fields belongs to the field after it, so an empty requester leaves
194
+ * "2026-0002", not "2026-0002 ·", and an empty first field does not leave a
195
+ * leading separator either. Text before the first field and after the last
196
+ * one is kept as written. A template whose fields all have values fills
197
+ * exactly as before.
198
+ *
199
+ * @spec openspec/changes/zuiddrecht-pixel-gaps-3/specs/zuiddrecht-pixel-gaps-3/spec.md#requirement-an-empty-field-takes-its-separator-with-it
200
+ * @param {string} template The template, with `{field}` placeholders.
201
+ * @param {(key: string) => string} valueOf The text of a field ('' when empty).
202
+ * @return {string} The filled template.
203
+ */
204
+ function joinTemplateParts(template, valueOf) {
205
+ // split() with a capture group alternates literal, field, literal, …
206
+ const parts = template.split(/\{([^}]+)\}/);
207
+ const lead = parts[0];
208
+ const tail = parts[parts.length - 1];
209
+ let body = '';
210
+ for (let i = 1; i < parts.length; i += 2) {
211
+ const value = valueOf(parts[i].trim());
212
+ if (value === '') {
213
+ continue
214
+ }
215
+ // The literal before this field: the separator, unless nothing has
216
+ // been written yet (then there is nothing to separate from).
217
+ const separator = i === 1 ? '' : parts[i - 1];
218
+ body += (body === '' ? '' : separator) + value;
219
+ }
220
+ return lead + body + tail
221
+ }
222
+
223
+ export { fillTemplate, firstFilled, formatBoardDateTime, formatLongDate, joinTemplateParts };
153
224
  //# sourceMappingURL=fillTemplate.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"fillTemplate.js","sources":["../../../src/utils/fillTemplate.js"],"sourcesContent":["// SPDX-FileCopyrightText: 2026 Conduction B.V.\n// SPDX-License-Identifier: EUPL-1.2\n\nimport { boardDateLocale, formatBoardDate, formatBoardWeekday, formatRelativeDate, formatTimeOfDay } from './boardDate.js'\nimport { parseDateValue } from './dateVariant.js'\nimport { formatMoney } from './formatMetric.js'\nimport { readPath } from './readPath.js'\n\nconst TOKEN = /\\{([^{}\\s|]+)(?:\\|([a-z]+)(?::([^{}\\s]+))?)?\\}/g\n\n/**\n * A moment in the board's short form with the time: \"4 okt, 10:52\", or\n * \"14 feb 2024, 09:00\" outside the current year.\n *\n * @param {unknown} value A Date, a timestamp or an ISO string.\n * @param {Date} [now] The reference moment.\n * @return {string} The text, or '' when the value is not a date.\n * @spec openspec/changes/screens-relation-pages/specs/relation-pages/spec.md#requirement-a-record-list-shows-the-objects-that-point-at-this-record\n */\nexport function formatBoardDateTime(value, now = new Date()) {\n\tconst day = formatBoardDate(value, now)\n\tconst date = parseDateValue(value)\n\tif (day === '' || date === null) {\n\t\treturn ''\n\t}\n\tlet time\n\ttry {\n\t\ttime = new Intl.DateTimeFormat(boardDateLocale(), { hour: '2-digit', minute: '2-digit' }).format(date)\n\t} catch {\n\t\ttime = new Intl.DateTimeFormat(undefined, { hour: '2-digit', minute: '2-digit' }).format(date)\n\t}\n\treturn `${day}, ${time}`\n}\n\n/**\n * Format one token value.\n *\n * @param {unknown} value The raw value.\n * @param {string} format `date`, `datetime`, `weekday`, `time`, `relative`, `relativetime`, `days` or '' (as is).\n * @param {Date} now The reference moment.\n * @param {string} [arg] The format's argument (`currency:EUR`, or a row path holding the code).\n * @param {object|null} [object] The row, for a currency read from a field.\n * @param {object|null} [config] The app config map, for the reporting currency.\n * @return {string} The text, '' when nothing can be shown.\n */\nfunction formatValue(value, format, now, arg = '', object = null, config = null) {\n\tif (value === null || value === undefined || value === '' || typeof value === 'object') {\n\t\treturn ''\n\t}\n\tif (format === 'date') {\n\t\treturn formatBoardDate(value, now)\n\t}\n\tif (format === 'datetime') {\n\t\treturn formatBoardDateTime(value, now)\n\t}\n\tif (format === 'weekday') {\n\t\treturn formatBoardWeekday(value, now, { today: arg === 'today' })\n\t}\n\tif (format === 'time') {\n\t\tconst date = parseDateValue(value)\n\t\treturn date === null ? '' : formatTimeOfDay(date)\n\t}\n\tif (format === 'currency') {\n\t\t// `{amount|currency:EUR}` names the code, `{amount|currency:price.code}`\n\t\t// reads it from the row, `{amount|currency}` is the app's reporting\n\t\t// currency (EUR without one).\n\t\tconst isCode = /^[A-Za-z]{3}$/.test(arg)\n\t\treturn formatMoney(value, { currency: isCode ? arg : undefined, currencyField: !isCode && arg ? arg : undefined }, object, config)\n\t}\n\tif (format === 'relative') {\n\t\treturn formatRelativeDate(value, { now })\n\t}\n\tif (format === 'relativetime') {\n\t\treturn formatRelativeDate(value, { now, withTime: true })\n\t}\n\tif (format === 'days') {\n\t\t// Whole days from the date to now (0 for today; negative for a future date).\n\t\tconst date = parseDateValue(value)\n\t\treturn date === null ? '' : String(Math.floor((now.getTime() - date.getTime()) / 86400000))\n\t}\n\treturn String(value)\n}\n\n/**\n * Fill a row template such as `\"{identifier} · {caseTypeName}\"` or\n * `\"Termijn {deadline|date}\"` from an object.\n *\n * Every `{path}` token is a dot path into the object; `{path|date}` and\n * `{path|datetime}` format it as the boards write dates, `{path|weekday}` adds\n * the short weekday (\"wo 7 okt\"; `{path|weekday:today}` reads \"Vandaag, wo 7 okt\"\n * for today), `{path|time}` is the time of day (\"08:45\"), `{path|currency}`,\n * `{path|currency:EUR}` and `{path|currency:field}` write an amount in a\n * currency (a code, or the row field that holds it; without either, or when\n * the row field is empty, the app's reporting currency), `{path|relative}` and\n * `{path|relativetime}` say \"today\", \"yesterday\" and then the short date\n * (\"vandaag, 09.42\"), and `{path|days}` is the\n * whole days since that date (\"has waited {createdAt|days} days\"). A token without a\n * value empties the WHOLE template, because \"Termijn \" is worse than nothing.\n * A template without tokens is returned as written (a constant label).\n *\n * @param {string} template The template, already translated.\n * @param {object|null} object The object to read.\n * @param {Date} [now] The reference moment for dates.\n * @param {{config?: object}|null} [context] The app config map, for the reporting currency of a money token.\n * @return {string} The filled text, or ''.\n * @spec openspec/changes/screens-relation-pages/specs/relation-pages/spec.md#requirement-a-record-list-shows-the-objects-that-point-at-this-record\n */\nexport function fillTemplate(template, object, now = new Date(), context = null) {\n\tif (typeof template !== 'string' || template.trim() === '') {\n\t\treturn ''\n\t}\n\tlet missing = false\n\tconst text = template.replace(TOKEN, (_match, path, format, arg) => {\n\t\tconst value = object && typeof object === 'object' ? readPath(object, path) : undefined\n\t\tconst shown = formatValue(value, format || '', now, arg || '', object, context && context.config ? context.config : null)\n\t\tif (shown === '') {\n\t\t\tmissing = true\n\t\t}\n\t\treturn shown\n\t})\n\treturn missing ? '' : text.trim()\n}\n\n/**\n * The first of several templates that fills: `[\"Klaar {closedAt|date}\",\n * \"Termijn {deadline|date}\"]` reads \"Klaar ...\" once the case is closed and\n * \"Termijn ...\" while it is open. A single string is one candidate.\n *\n * @param {string|string[]} templates The candidates, in order.\n * @param {object|null} object The object to read.\n * @param {(key: string) => string} [translate] Applied to each template before filling.\n * @param {Date} [now] The reference moment for dates.\n * @param {{config?: object}|null} [context] Passed on to `fillTemplate`.\n * @return {string} The first filled text, or ''.\n * @spec openspec/changes/screens-relation-pages/specs/relation-pages/spec.md#requirement-a-record-list-shows-the-objects-that-point-at-this-record\n */\nexport function firstFilled(templates, object, translate = (key) => key, now = new Date(), context = null) {\n\tconst list = Array.isArray(templates) ? templates : [templates]\n\tfor (const template of list) {\n\t\tif (typeof template !== 'string') {\n\t\t\tcontinue\n\t\t}\n\t\tconst text = fillTemplate(translate(template), object, now, context)\n\t\tif (text !== '') {\n\t\t\treturn text\n\t\t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AAE,OAAO,KAAK;AACd,EAAE,EAAC;AACH,CAAC,OAAO,OAAO,GAAG,EAAE,GAAG,IAAI,CAAC,IAAI,EAAE;AAClC,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAAS,WAAW,CAAC,SAAS,EAAE,MAAM,EAAE,SAAS,GAAG,CAAC,GAAG,KAAK,GAAG,EAAE,GAAG,GAAG,IAAI,IAAI,EAAE,EAAE,OAAO,GAAG,IAAI,EAAE;AAC3G,CAAC,MAAM,IAAI,GAAG,KAAK,CAAC,OAAO,CAAC,SAAS,CAAC,GAAG,SAAS,GAAG,CAAC,SAAS,EAAC;AAChE,CAAC,KAAK,MAAM,QAAQ,IAAI,IAAI,EAAE;AAC9B,EAAE,IAAI,OAAO,QAAQ,KAAK,QAAQ,EAAE;AACpC,GAAG,QAAQ;AACX,GAAG;AACH,EAAE,MAAM,IAAI,GAAG,YAAY,CAAC,SAAS,CAAC,QAAQ,CAAC,EAAE,MAAM,EAAE,GAAG,EAAE,OAAO,EAAC;AACtE,EAAE,IAAI,IAAI,KAAK,EAAE,EAAE;AACnB,GAAG,OAAO,IAAI;AACd,GAAG;AACH,EAAE;AACF,CAAC,OAAO,EAAE;AACV;;;;"}
1
+ {"version":3,"file":"fillTemplate.js","sources":["../../../src/utils/fillTemplate.js"],"sourcesContent":["// SPDX-FileCopyrightText: 2026 Conduction B.V.\n// SPDX-License-Identifier: EUPL-1.2\n\nimport { boardDateLocale, formatBoardDate, formatBoardWeekday, formatRelativeDate, formatTimeOfDay } from './boardDate.js'\nimport { parseDateValue } from './dateVariant.js'\nimport { formatMoney } from './formatMetric.js'\nimport { readPath } from './readPath.js'\nimport { userDisplayName } from './userDisplayName.js'\n\nconst TOKEN = /\\{([^{}\\s|]+)(?:\\|([a-z]+)(?::([^{}\\s]+))?)?\\}/g\n\n/**\n * A moment in the board's short form with the time: \"4 okt, 10:52\", or\n * \"14 feb 2024, 09:00\" outside the current year.\n *\n * @param {unknown} value A Date, a timestamp or an ISO string.\n * @param {Date} [now] The reference moment.\n * @return {string} The text, or '' when the value is not a date.\n * @spec openspec/changes/screens-relation-pages/specs/relation-pages/spec.md#requirement-a-record-list-shows-the-objects-that-point-at-this-record\n */\nexport function formatBoardDateTime(value, now = new Date()) {\n\tconst day = formatBoardDate(value, now)\n\tconst date = parseDateValue(value)\n\tif (day === '' || date === null) {\n\t\treturn ''\n\t}\n\tlet time\n\ttry {\n\t\ttime = new Intl.DateTimeFormat(boardDateLocale(), { hour: '2-digit', minute: '2-digit' }).format(date)\n\t} catch {\n\t\ttime = new Intl.DateTimeFormat(undefined, { hour: '2-digit', minute: '2-digit' }).format(date)\n\t}\n\treturn `${day}, ${time}`\n}\n\n/**\n * A date with the month written out: \"7 oktober\", or \"6 oktober 2026\"\n * outside the current year or when `withYear` asks for it.\n *\n * @param {unknown} value A Date, a timestamp or an ISO string.\n * @param {Date} now The reference moment.\n * @param {boolean} [withYear] Always write the year.\n * @return {string} The text, or '' when the value is not a date.\n * @spec openspec/changes/screens-header-meta-tokens/specs/detail-page-board-look/spec.md#requirement-the-header-meta-line-formats-users-long-dates-and-enum-labels\n */\nexport function formatLongDate(value, now = new Date(), withYear = false) {\n\tconst date = parseDateValue(value)\n\tif (date === null) {\n\t\treturn ''\n\t}\n\tconst options = { day: 'numeric', month: 'long' }\n\tif (withYear || date.getFullYear() !== now.getFullYear()) {\n\t\toptions.year = 'numeric'\n\t}\n\ttry {\n\t\treturn new Intl.DateTimeFormat(boardDateLocale(), options).format(date)\n\t} catch {\n\t\treturn new Intl.DateTimeFormat(undefined, options).format(date)\n\t}\n}\n\n/**\n * Format one token value.\n *\n * @param {unknown} value The raw value.\n * @param {string} format `date`, `datetime`, `weekday`, `longdate`, `time`, `user`, `currency`, `relative`, `relativetime`, `days` or '' (as is).\n * @param {Date} now The reference moment.\n * @param {string} [arg] The format's argument (`currency:EUR`, or a row path holding the code).\n * @param {object|null} [object] The row, for a currency read from a field.\n * @param {object|null} [config] The app config map, for the reporting currency.\n * @return {string} The text, '' when nothing can be shown.\n */\nfunction formatValue(value, format, now, arg = '', object = null, config = null) {\n\tif (value === null || value === undefined || value === '' || typeof value === 'object') {\n\t\treturn ''\n\t}\n\tif (format === 'date') {\n\t\treturn formatBoardDate(value, now)\n\t}\n\tif (format === 'datetime') {\n\t\treturn formatBoardDateTime(value, now)\n\t}\n\tif (format === 'weekday') {\n\t\treturn formatBoardWeekday(value, now, { today: arg === 'today' })\n\t}\n\tif (format === 'longdate') {\n\t\treturn formatLongDate(value, now, arg === 'year')\n\t}\n\tif (format === 'user') {\n\t\treturn userDisplayName(value)\n\t}\n\tif (format === 'time') {\n\t\tconst date = parseDateValue(value)\n\t\treturn date === null ? '' : formatTimeOfDay(date)\n\t}\n\tif (format === 'currency') {\n\t\t// `{amount|currency:EUR}` names the code, `{amount|currency:price.code}`\n\t\t// reads it from the row, `{amount|currency}` is the app's reporting\n\t\t// currency (EUR without one).\n\t\tconst isCode = /^[A-Za-z]{3}$/.test(arg)\n\t\treturn formatMoney(value, { currency: isCode ? arg : undefined, currencyField: !isCode && arg ? arg : undefined }, object, config)\n\t}\n\tif (format === 'relative') {\n\t\treturn formatRelativeDate(value, { now })\n\t}\n\tif (format === 'relativetime') {\n\t\treturn formatRelativeDate(value, { now, withTime: true })\n\t}\n\tif (format === 'days') {\n\t\t// Whole days from the date to now (0 for today; negative for a future date).\n\t\tconst date = parseDateValue(value)\n\t\treturn date === null ? '' : String(Math.floor((now.getTime() - date.getTime()) / 86400000))\n\t}\n\treturn String(value)\n}\n\n/**\n * Fill a row template such as `\"{identifier} · {caseTypeName}\"` or\n * `\"Termijn {deadline|date}\"` from an object.\n *\n * Every `{path}` token is a dot path into the object; `{path|date}` and\n * `{path|datetime}` format it as the boards write dates, `{path|weekday}` adds\n * the short weekday (\"wo 7 okt\"; `{path|weekday:today}` reads \"Vandaag, wo 7 okt\"\n * for today), `{path|longdate}` writes the month out (\"7 oktober\";\n * `{path|longdate:year}` always adds the year), `{path|time}` is the time\n * of day (\"08:45\"), `{path|user}` is a user id's display name (looked up\n * once, '' until it arrives), `{path|currency}`,\n * `{path|currency:EUR}` and `{path|currency:field}` write an amount in a\n * currency (a code, or the row field that holds it; without either, or when\n * the row field is empty, the app's reporting currency), `{path|relative}` and\n * `{path|relativetime}` say \"today\", \"yesterday\" and then the short date\n * (\"vandaag, 09.42\"), and `{path|days}` is the\n * whole days since that date (\"has waited {createdAt|days} days\"). A token without a\n * value empties the WHOLE template, because \"Termijn \" is worse than nothing.\n * A template without tokens is returned as written (a constant label).\n *\n * @param {string} template The template, already translated.\n * @param {object|null} object The object to read.\n * @param {Date} [now] The reference moment for dates.\n * @param {{config?: object}|null} [context] The app config map, for the reporting currency of a money token.\n * @return {string} The filled text, or ''.\n * @spec openspec/changes/screens-relation-pages/specs/relation-pages/spec.md#requirement-a-record-list-shows-the-objects-that-point-at-this-record\n */\nexport function fillTemplate(template, object, now = new Date(), context = null) {\n\tif (typeof template !== 'string' || template.trim() === '') {\n\t\treturn ''\n\t}\n\tlet missing = false\n\tconst text = template.replace(TOKEN, (_match, path, format, arg) => {\n\t\tconst value = object && typeof object === 'object' ? readPath(object, path) : undefined\n\t\tconst shown = formatValue(value, format || '', now, arg || '', object, context && context.config ? context.config : null)\n\t\tif (shown === '') {\n\t\t\tmissing = true\n\t\t}\n\t\treturn shown\n\t})\n\treturn missing ? '' : text.trim()\n}\n\n/**\n * The first of several templates that fills: `[\"Klaar {closedAt|date}\",\n * \"Termijn {deadline|date}\"]` reads \"Klaar ...\" once the case is closed and\n * \"Termijn ...\" while it is open. A single string is one candidate.\n *\n * @param {string|string[]} templates The candidates, in order.\n * @param {object|null} object The object to read.\n * @param {(key: string) => string} [translate] Applied to each template before filling.\n * @param {Date} [now] The reference moment for dates.\n * @param {{config?: object}|null} [context] Passed on to `fillTemplate`.\n * @return {string} The first filled text, or ''.\n * @spec openspec/changes/screens-relation-pages/specs/relation-pages/spec.md#requirement-a-record-list-shows-the-objects-that-point-at-this-record\n */\nexport function firstFilled(templates, object, translate = (key) => key, now = new Date(), context = null) {\n\tconst list = Array.isArray(templates) ? templates : [templates]\n\tfor (const template of list) {\n\t\tif (typeof template !== 'string') {\n\t\t\tcontinue\n\t\t}\n\t\tconst text = fillTemplate(translate(template), object, now, context)\n\t\tif (text !== '') {\n\t\t\treturn text\n\t\t}\n\t}\n\treturn ''\n}\n\n/**\n * Fill a template such as `\"{identifier} · {requester}\"` field by field\n * (a table column's `secondary` line, a detail page's meta line).\n *\n * A field without a value takes its separator with it: the text between two\n * fields belongs to the field after it, so an empty requester leaves\n * \"2026-0002\", not \"2026-0002 ·\", and an empty first field does not leave a\n * leading separator either. Text before the first field and after the last\n * one is kept as written. A template whose fields all have values fills\n * exactly as before.\n *\n * @spec openspec/changes/zuiddrecht-pixel-gaps-3/specs/zuiddrecht-pixel-gaps-3/spec.md#requirement-an-empty-field-takes-its-separator-with-it\n * @param {string} template The template, with `{field}` placeholders.\n * @param {(key: string) => string} valueOf The text of a field ('' when empty).\n * @return {string} The filled template.\n */\nexport function joinTemplateParts(template, valueOf) {\n\t// split() with a capture group alternates literal, field, literal, …\n\tconst parts = template.split(/\\{([^}]+)\\}/)\n\tconst lead = parts[0]\n\tconst tail = parts[parts.length - 1]\n\tlet body = ''\n\tfor (let i = 1; i < parts.length; i += 2) {\n\t\tconst value = valueOf(parts[i].trim())\n\t\tif (value === '') {\n\t\t\tcontinue\n\t\t}\n\t\t// The literal before this field: the separator, unless nothing has\n\t\t// been written yet (then there is nothing to separate from).\n\t\tconst separator = i === 1 ? '' : parts[i - 1]\n\t\tbody += (body === '' ? '' : separator) + value\n\t}\n\treturn lead + body + tail\n}\n"],"names":[],"mappings":";;;;;;AAAA;AACA;AACA;AAMA;AACA,MAAM,KAAK,GAAG,kDAAiD;AAC/D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAAS,mBAAmB,CAAC,KAAK,EAAE,GAAG,GAA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K;AAChD,EAAE;AACF,CAAC,OAAO,IAAI,GAAG,IAAI,GAAG,IAAI;AAC1B;;;;"}
@@ -1,28 +1,78 @@
1
- import { fillTemplate } from './fillTemplate.js';
1
+ import { joinTemplateParts, fillTemplate } from './fillTemplate.js';
2
+ import { readPath } from './readPath.js';
2
3
 
3
4
  // SPDX-FileCopyrightText: 2026 Conduction B.V.
4
5
  // SPDX-License-Identifier: EUPL-1.2
5
6
 
6
7
 
8
+ /**
9
+ * The text of one plain `{path}` token: an enum field reads as its label
10
+ * (`x-enum-labels` / `enumLabels` on the schema property, through the
11
+ * translate function), anything else as the stored value.
12
+ *
13
+ * @param {object} object The record.
14
+ * @param {string} path The dotted path.
15
+ * @param {object|null} schema The record's schema.
16
+ * @param {(text: string) => string} translate The translate function.
17
+ * @return {string} The text, or '' when the field is empty.
18
+ */
19
+ function plainTokenText(object, path, schema, translate) {
20
+ const value = readPath(object, path);
21
+ if (value === null || value === undefined || value === '' || typeof value === 'object') {
22
+ return ''
23
+ }
24
+ const property = schema && schema.properties && !path.includes('.') ? schema.properties[path] : null;
25
+ const labels = property && (property.enumLabels || property['x-enum-labels']);
26
+ if (labels && typeof labels === 'object' && typeof labels[String(value)] === 'string') {
27
+ return translate(labels[String(value)])
28
+ }
29
+ return String(value)
30
+ }
31
+
7
32
  /**
8
33
  * Fill a header meta template such as `"via {channel}"` or
9
- * `"received {createdAt|relative}"` from a record.
34
+ * `"{amount|currency:EUR} · {cashier|user} · {at|longdate} {at|time}"` from
35
+ * a record.
10
36
  *
11
37
  * Every `{path}` token (a dotted path into the record) is replaced by its
12
- * value; `{path|date}`, `{path|datetime}`, `{path|relative}`,
13
- * `{path|relativetime}` and `{path|days}` format a date as a record-list
14
- * row does (the shared `fillTemplate`). A token with no value drops the
15
- * WHOLE line, because "via " is worse than nothing. A template without
16
- * tokens is returned as written.
38
+ * value, an enum field by its label. `{path|format}` tokens format as a
39
+ * record-list row does (the shared `fillTemplate`: date, datetime, weekday,
40
+ * longdate, time, user, currency, relative, relativetime, days). A token
41
+ * without a value drops itself and the separator before it, so a missing
42
+ * cashier leaves "€ 96,41 · 7 oktober"; a line whose every token is empty
43
+ * is '' ("via " is worse than nothing). A template without tokens is
44
+ * returned as written.
17
45
  *
18
46
  * @param {string} template The template, already translated.
19
47
  * @param {object|null} object The record.
20
- * @param {Date} [now] The reference moment for dates.
21
- * @return {string} The line, or '' when it cannot be filled.
22
- * @spec openspec/changes/screens-detail-page-parity/specs/detail-page-board-look/spec.md#requirement-the-detail-header-is-two-rows-on-the-ground
48
+ * @param {Date|{now?: Date, schema?: object, translate?: Function, config?: object}} [options] The reference moment, or options: `schema` for enum labels, `translate` for those labels, `config` for the reporting currency.
49
+ * @return {string} The line, or '' when nothing can be filled.
50
+ * @spec openspec/changes/screens-header-meta-tokens/specs/detail-page-board-look/spec.md#requirement-the-header-meta-line-formats-users-long-dates-and-enum-labels
23
51
  */
24
- function resolveHeaderMeta(template, object, now = new Date()) {
25
- return fillTemplate(template, object, now)
52
+ function resolveHeaderMeta(template, object, options = {}) {
53
+ const settings = options instanceof Date ? { now: options } : (options || {});
54
+ const now = settings.now || new Date();
55
+ const translate = typeof settings.translate === 'function' ? settings.translate : (text) => text;
56
+ if (typeof template !== 'string' || template.trim() === '') {
57
+ return ''
58
+ }
59
+ if (!/\{[^}]+\}/.test(template)) {
60
+ return template.trim()
61
+ }
62
+ if (!object || typeof object !== 'object') {
63
+ return ''
64
+ }
65
+ let filled = 0;
66
+ const line = joinTemplateParts(template, (token) => {
67
+ const text = token.includes('|')
68
+ ? fillTemplate(`{${token}}`, object, now, settings.config ? { config: settings.config } : null)
69
+ : plainTokenText(object, token, settings.schema || null, translate);
70
+ if (text !== '') {
71
+ filled += 1;
72
+ }
73
+ return text
74
+ });
75
+ return filled === 0 ? '' : line.trim()
26
76
  }
27
77
 
28
78
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"headerMeta.js","sources":["../../../src/utils/headerMeta.js"],"sourcesContent":["// SPDX-FileCopyrightText: 2026 Conduction B.V.\n// SPDX-License-Identifier: EUPL-1.2\n\nimport { fillTemplate } from './fillTemplate.js'\n\n/**\n * Fill a header meta template such as `\"via {channel}\"` or\n * `\"received {createdAt|relative}\"` from a record.\n *\n * Every `{path}` token (a dotted path into the record) is replaced by its\n * value; `{path|date}`, `{path|datetime}`, `{path|relative}`,\n * `{path|relativetime}` and `{path|days}` format a date as a record-list\n * row does (the shared `fillTemplate`). A token with no value drops the\n * WHOLE line, because \"via \" is worse than nothing. A template without\n * tokens is returned as written.\n *\n * @param {string} template The template, already translated.\n * @param {object|null} object The record.\n * @param {Date} [now] The reference moment for dates.\n * @return {string} The line, or '' when it cannot be filled.\n * @spec openspec/changes/screens-detail-page-parity/specs/detail-page-board-look/spec.md#requirement-the-detail-header-is-two-rows-on-the-ground\n */\nexport function resolveHeaderMeta(template, object, now = new Date()) {\n\treturn fillTemplate(template, object, now)\n}\n\n/**\n * Whether a widget definition is the record's activity (the History tab or\n * card): an audit-trail or timeline widget, or the `activity` integration.\n *\n * @param {object|null} widget The widget definition.\n * @return {boolean} True for an activity widget.\n * @spec openspec/changes/screens-detail-page-parity/specs/detail-page-board-look/spec.md#requirement-history-is-the-last-tab\n */\nexport function isActivityWidget(widget) {\n\tif (!widget || typeof widget !== 'object') {\n\t\treturn false\n\t}\n\tif (widget.type === 'audit-trail' || widget.type === 'timeline') {\n\t\treturn true\n\t}\n\treturn widget.type === 'integration' && widget.integrationId === 'activity'\n}\n"],"names":[],"mappings":";;AAAA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAAS,iBAAiB,CAAC,QAAQ,EAAE,MAAM,EAAE,GAAG,GAAG,IAAI,IAAI,EAAE,EAAE;AACtE,CAAC,OAAO,YAAY,CAAC,QAAQ,EAAE,MAAM,EAAE,GAAG,CAAC;AAC3C,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAAS,gBAAgB,CAAC,MAAM,EAAE;AACzC,CAAC,IAAI,CAAC,MAAM,IAAI,OAAO,MAAM,KAAK,QAAQ,EAAE;AAC5C,EAAE,OAAO,KAAK;AACd,EAAE;AACF,CAAC,IAAI,MAAM,CAAC,IAAI,KAAK,aAAa,IAAI,MAAM,CAAC,IAAI,KAAK,UAAU,EAAE;AAClE,EAAE,OAAO,IAAI;AACb,EAAE;AACF,CAAC,OAAO,MAAM,CAAC,IAAI,KAAK,aAAa,IAAI,MAAM,CAAC,aAAa,KAAK,UAAU;AAC5E;;;;"}
1
+ {"version":3,"file":"headerMeta.js","sources":["../../../src/utils/headerMeta.js"],"sourcesContent":["// SPDX-FileCopyrightText: 2026 Conduction B.V.\n// SPDX-License-Identifier: EUPL-1.2\n\nimport { fillTemplate, joinTemplateParts } from './fillTemplate.js'\nimport { readPath } from './readPath.js'\n\n/**\n * The text of one plain `{path}` token: an enum field reads as its label\n * (`x-enum-labels` / `enumLabels` on the schema property, through the\n * translate function), anything else as the stored value.\n *\n * @param {object} object The record.\n * @param {string} path The dotted path.\n * @param {object|null} schema The record's schema.\n * @param {(text: string) => string} translate The translate function.\n * @return {string} The text, or '' when the field is empty.\n */\nfunction plainTokenText(object, path, schema, translate) {\n\tconst value = readPath(object, path)\n\tif (value === null || value === undefined || value === '' || typeof value === 'object') {\n\t\treturn ''\n\t}\n\tconst property = schema && schema.properties && !path.includes('.') ? schema.properties[path] : null\n\tconst labels = property && (property.enumLabels || property['x-enum-labels'])\n\tif (labels && typeof labels === 'object' && typeof labels[String(value)] === 'string') {\n\t\treturn translate(labels[String(value)])\n\t}\n\treturn String(value)\n}\n\n/**\n * Fill a header meta template such as `\"via {channel}\"` or\n * `\"{amount|currency:EUR} · {cashier|user} · {at|longdate} {at|time}\"` from\n * a record.\n *\n * Every `{path}` token (a dotted path into the record) is replaced by its\n * value, an enum field by its label. `{path|format}` tokens format as a\n * record-list row does (the shared `fillTemplate`: date, datetime, weekday,\n * longdate, time, user, currency, relative, relativetime, days). A token\n * without a value drops itself and the separator before it, so a missing\n * cashier leaves \"€ 96,41 · 7 oktober\"; a line whose every token is empty\n * is '' (\"via \" is worse than nothing). A template without tokens is\n * returned as written.\n *\n * @param {string} template The template, already translated.\n * @param {object|null} object The record.\n * @param {Date|{now?: Date, schema?: object, translate?: Function, config?: object}} [options] The reference moment, or options: `schema` for enum labels, `translate` for those labels, `config` for the reporting currency.\n * @return {string} The line, or '' when nothing can be filled.\n * @spec openspec/changes/screens-header-meta-tokens/specs/detail-page-board-look/spec.md#requirement-the-header-meta-line-formats-users-long-dates-and-enum-labels\n */\nexport function resolveHeaderMeta(template, object, options = {}) {\n\tconst settings = options instanceof Date ? { now: options } : (options || {})\n\tconst now = settings.now || new Date()\n\tconst translate = typeof settings.translate === 'function' ? settings.translate : (text) => text\n\tif (typeof template !== 'string' || template.trim() === '') {\n\t\treturn ''\n\t}\n\tif (!/\\{[^}]+\\}/.test(template)) {\n\t\treturn template.trim()\n\t}\n\tif (!object || typeof object !== 'object') {\n\t\treturn ''\n\t}\n\tlet filled = 0\n\tconst line = joinTemplateParts(template, (token) => {\n\t\tconst text = token.includes('|')\n\t\t\t? fillTemplate(`{${token}}`, object, now, settings.config ? { config: settings.config } : null)\n\t\t\t: plainTokenText(object, token, settings.schema || null, translate)\n\t\tif (text !== '') {\n\t\t\tfilled += 1\n\t\t}\n\t\treturn text\n\t})\n\treturn filled === 0 ? '' : line.trim()\n}\n\n/**\n * Whether a widget definition is the record's activity (the History tab or\n * card): an audit-trail or timeline widget, or the `activity` integration.\n *\n * @param {object|null} widget The widget definition.\n * @return {boolean} True for an activity widget.\n * @spec openspec/changes/screens-detail-page-parity/specs/detail-page-board-look/spec.md#requirement-history-is-the-last-tab\n */\nexport function isActivityWidget(widget) {\n\tif (!widget || typeof widget !== 'object') {\n\t\treturn false\n\t}\n\tif (widget.type === 'audit-trail' || widget.type === 'timeline') {\n\t\treturn true\n\t}\n\treturn widget.type === 'integration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