@protobase/ui 0.63.5 → 0.64.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 (273) hide show
  1. package/dist/account/change-email-dialog.js +1 -1
  2. package/dist/account/devices-section.js +11 -5
  3. package/dist/account/messages.js +2 -333
  4. package/dist/account/passkeys-section.js +2 -2
  5. package/dist/account/password-change-dialog.js +3 -3
  6. package/dist/account/sign-in-policy-form.js +6 -3
  7. package/dist/account/sign-in-providers-section.js +1 -1
  8. package/dist/account/staff-sign-in-log.js +4 -4
  9. package/dist/action-card/messages.js +2 -5
  10. package/dist/activity-chart/activity-chart.js +4 -6
  11. package/dist/activity-chart/messages.js +2 -11
  12. package/dist/app/app.js +1 -2
  13. package/dist/app/batch-failure.js +5 -1
  14. package/dist/app/change-confirm/messages.js +2 -13
  15. package/dist/app/change-confirm/use-change-confirm.js +1 -1
  16. package/dist/app/charts/chart-groups.js +3 -1
  17. package/dist/app/charts/group-bars.js +1 -1
  18. package/dist/app/charts/messages.js +2 -23
  19. package/dist/app/charts/period-chart.js +1 -1
  20. package/dist/app/comments/messages.js +2 -19
  21. package/dist/app/confirm-sign-in-messages.js +2 -19
  22. package/dist/app/confirm-sign-in.js +1 -1
  23. package/dist/app/create/create-page.js +3 -3
  24. package/dist/app/create/create-record-form.js +2 -2
  25. package/dist/app/create/create-route.js +1 -1
  26. package/dist/app/create/messages.js +2 -29
  27. package/dist/app/custom-section.js +1 -2
  28. package/dist/app/delete/blocked-delete.js +5 -2
  29. package/dist/app/delete/dialogs.js +21 -8
  30. package/dist/app/delete/messages.js +2 -63
  31. package/dist/app/delete/use-delete-flow.js +5 -4
  32. package/dist/app/displays/board-column.js +1 -1
  33. package/dist/app/displays/board-columns.js +1 -1
  34. package/dist/app/displays/board-display.js +21 -9
  35. package/dist/app/displays/calendar-display.js +15 -6
  36. package/dist/app/displays/cards-display.js +1 -1
  37. package/dist/app/displays/custom-display.js +1 -2
  38. package/dist/app/displays/list-cards.js +1 -1
  39. package/dist/app/displays/map-display.js +19 -6
  40. package/dist/app/displays/messages.js +2 -147
  41. package/dist/app/displays/period-controls.js +2 -2
  42. package/dist/app/displays/timeline-display.js +15 -6
  43. package/dist/app/displays/timeline-range.js +1 -1
  44. package/dist/app/displays/use-board-move.js +3 -3
  45. package/dist/app/displays/use-calendar-move.js +1 -1
  46. package/dist/app/document-title.js +1 -1
  47. package/dist/app/embedded-list/cut-off-note.js +7 -1
  48. package/dist/app/embedded-list/embedded-row-targets.js +3 -3
  49. package/dist/app/embedded-list/messages.js +2 -21
  50. package/dist/app/export/builder-port.js +1 -1
  51. package/dist/app/export/export-dialog.js +14 -8
  52. package/dist/app/export/messages.js +2 -75
  53. package/dist/app/export/use-export-flow.js +9 -3
  54. package/dist/app/field-editor.js +2 -2
  55. package/dist/app/field-errors.js +18 -7
  56. package/dist/app/field-messages.js +2 -45
  57. package/dist/app/field-types/members/messages.js +2 -15
  58. package/dist/app/field-types/messages.js +2 -5
  59. package/dist/app/field-types/widget-part.js +1 -1
  60. package/dist/app/file-field.js +3 -3
  61. package/dist/app/gallery/gallery-section.js +5 -2
  62. package/dist/app/gallery/messages.js +2 -27
  63. package/dist/app/gallery/photo-details.js +2 -2
  64. package/dist/app/hand-order/hand-sorted-list.js +1 -2
  65. package/dist/app/hand-order/messages.js +2 -29
  66. package/dist/app/hand-order/use-hand-order.js +1 -1
  67. package/dist/app/history/describe-change.js +1 -1
  68. package/dist/app/history/messages.js +2 -29
  69. package/dist/app/import/convert.js +19 -10
  70. package/dist/app/import/import-check-step.js +5 -5
  71. package/dist/app/import/import-dialog.js +5 -2
  72. package/dist/app/import/import-file-step.js +1 -1
  73. package/dist/app/import/import-mapping-step.js +3 -3
  74. package/dist/app/import/messages.js +2 -197
  75. package/dist/app/import/prepare-rows.js +11 -4
  76. package/dist/app/import/sheet-cell.js +1 -1
  77. package/dist/app/import/xlsx-reader.js +2 -2
  78. package/dist/app/import/zip-reader.js +4 -1
  79. package/dist/app/list-actions/use-list-actions.js +4 -1
  80. package/dist/app/list-edit/messages.js +2 -11
  81. package/dist/app/list-empty-state.js +7 -4
  82. package/dist/app/list-group-chart.js +1 -1
  83. package/dist/app/list-messages.js +2 -53
  84. package/dist/app/list-page.js +9 -9
  85. package/dist/app/live-update/messages.js +2 -11
  86. package/dist/app/map/messages.js +2 -11
  87. package/dist/app/messages.js +2 -139
  88. package/dist/app/meta-gate-messages.js +2 -13
  89. package/dist/app/nav-from-meta.js +2 -2
  90. package/dist/app/new-version/messages.js +2 -21
  91. package/dist/app/new-version/new-version-banner.js +1 -2
  92. package/dist/app/pages/action-inputs/action-inputs-dialog.js +1 -1
  93. package/dist/app/pages/action-inputs/input-answers.js +1 -1
  94. package/dist/app/pages/blocks/modal-form.js +1 -1
  95. package/dist/app/pages/blocks/settings.js +1 -1
  96. package/dist/app/pages/blocks/tabs.js +1 -1
  97. package/dist/app/pages/composed-page.js +1 -2
  98. package/dist/app/pages/custom-boundary.js +1 -2
  99. package/dist/app/pages/messages.js +2 -79
  100. package/dist/app/pages/render-node.js +2 -3
  101. package/dist/app/pages/use-run-action.js +14 -6
  102. package/dist/app/rank-after/dependency-rule.js +8 -2
  103. package/dist/app/rank-after/messages.js +2 -5
  104. package/dist/app/rank-after/ranked-place.js +7 -1
  105. package/dist/app/record-chart/messages.js +2 -25
  106. package/dist/app/record-lines-cell.js +4 -1
  107. package/dist/app/record-lines.js +2 -2
  108. package/dist/app/record-messages.js +2 -83
  109. package/dist/app/record-page.js +3 -3
  110. package/dist/app/record-row/messages.js +2 -23
  111. package/dist/app/record-row/record-row-body.js +1 -1
  112. package/dist/app/record-row/record-row.js +2 -2
  113. package/dist/app/record-row/saved-record-row.js +2 -2
  114. package/dist/app/related-cards/messages.js +2 -15
  115. package/dist/app/related-dots/dots-summary.js +1 -1
  116. package/dist/app/related-dots/messages.js +2 -5
  117. package/dist/app/related-dots/related-dots.js +2 -3
  118. package/dist/app/relation-picker.js +1 -1
  119. package/dist/app/runtime/messages.js +2 -55
  120. package/dist/app/runtime/runtime-status.js +12 -3
  121. package/dist/app/saved/messages.js +2 -19
  122. package/dist/app/saved/saved-list.js +2 -2
  123. package/dist/app/search/messages.js +2 -19
  124. package/dist/app/search/navigation-hits.js +1 -1
  125. package/dist/app/search/search-model.js +9 -3
  126. package/dist/app/searches/messages.js +2 -93
  127. package/dist/app/searches/save-search-button.js +3 -3
  128. package/dist/app/searches/saved-search-rows.js +2 -2
  129. package/dist/app/searches/saved-search-section.js +3 -3
  130. package/dist/app/searches/saved-searches.js +13 -11
  131. package/dist/app/searches/search-controls.js +1 -1
  132. package/dist/app/searches/search-diff.js +8 -2
  133. package/dist/app/searches/update-search-dialog.js +9 -3
  134. package/dist/app/searches/use-save-search.js +1 -1
  135. package/dist/app/searches/use-search-row.js +2 -2
  136. package/dist/app/sensitive-field.js +3 -3
  137. package/dist/app/source-notice.js +3 -3
  138. package/dist/app/staff-banner.js +12 -8
  139. package/dist/app/use-live-save.js +2 -2
  140. package/dist/app/value-badge.js +3 -4
  141. package/dist/app-shell/global-search.js +2 -2
  142. package/dist/app-shell/messages.js +2 -63
  143. package/dist/app-shell/sidebar-group.js +2 -2
  144. package/dist/app-shell/sidebar.js +1 -2
  145. package/dist/app-shell/top-bar.js +1 -1
  146. package/dist/assistant-dock/messages.js +2 -23
  147. package/dist/auth/auth-gate.js +1 -1
  148. package/dist/auth/auth-messages.js +9 -88
  149. package/dist/auth/email-code-form.js +2 -3
  150. package/dist/auth/forgot-password-form.js +2 -3
  151. package/dist/auth/messages.js +2 -203
  152. package/dist/auth/provider-sign-in-page.js +3 -3
  153. package/dist/auth/resend-code-button.js +1 -1
  154. package/dist/auth/reset-password-form.js +1 -1
  155. package/dist/auth/reset-password-page.js +1 -1
  156. package/dist/auth/sign-in-form.js +2 -2
  157. package/dist/auth/sign-up-code-form.js +2 -3
  158. package/dist/auth/sign-up-details-form.js +3 -4
  159. package/dist/auth/staff-sign-in-form.js +3 -3
  160. package/dist/calls/call-guests-panel.js +1 -1
  161. package/dist/calls/call-lobby-notice.js +1 -1
  162. package/dist/calls/call-mark.js +1 -1
  163. package/dist/calls/call-people.js +1 -1
  164. package/dist/calls/call-tile.js +2 -2
  165. package/dist/calls/messages.js +2 -139
  166. package/dist/carousel/carousel-controls.js +4 -1
  167. package/dist/carousel/messages.js +2 -13
  168. package/dist/chat/messages.js +2 -19
  169. package/dist/compact-table/compact-table.js +1 -1
  170. package/dist/compact-table/messages.js +2 -15
  171. package/dist/data-grid/cell-text.js +6 -5
  172. package/dist/data-grid/cells.js +7 -4
  173. package/dist/data-grid/grid-footer.js +1 -1
  174. package/dist/data-grid/grid-row.js +1 -1
  175. package/dist/data-grid/header-menu.js +1 -1
  176. package/dist/data-grid/messages.js +2 -49
  177. package/dist/data-grid/resize-handle.js +1 -1
  178. package/dist/data-grid/row-reorder.js +20 -5
  179. package/dist/filter-panel/active-filter-chips.js +1 -1
  180. package/dist/filter-panel/date-presets.js +2 -2
  181. package/dist/filter-panel/facet-combobox.js +1 -1
  182. package/dist/filter-panel/facet-group.js +1 -1
  183. package/dist/filter-panel/messages.js +2 -49
  184. package/dist/filter-panel/range-filter.js +1 -1
  185. package/dist/format/date.js +4 -4
  186. package/dist/format/messages.js +2 -21
  187. package/dist/format/money.js +1 -1
  188. package/dist/format/number.js +5 -2
  189. package/dist/forms/messages.js +2 -21
  190. package/dist/inline-child-table/inline-child-table.js +19 -4
  191. package/dist/inline-child-table/line-row.js +2 -2
  192. package/dist/inline-child-table/messages.js +2 -35
  193. package/dist/invitations/link-notice.js +2 -3
  194. package/dist/invitations/messages.js +2 -21
  195. package/dist/invitations/pending-invitation-row.js +1 -1
  196. package/dist/lists/messages.js +2 -5
  197. package/dist/live/columns-from-model.js +14 -31
  198. package/dist/live/display-value.js +1 -1
  199. package/dist/live/messages.js +2 -15
  200. package/dist/live/value-color.js +13 -3
  201. package/dist/live/view-fields.js +4 -2
  202. package/dist/locale/en.js +1399 -0
  203. package/dist/locale/messages.js +38 -7
  204. package/dist/locale/nl.js +1399 -0
  205. package/dist/markdown/messages.js +2 -13
  206. package/dist/mentions/messages.js +2 -13
  207. package/dist/notifications/bell/messages.js +2 -35
  208. package/dist/notifications/bell/unread-label.js +1 -1
  209. package/dist/organizations/invitation-page.js +31 -13
  210. package/dist/organizations/invitations-page.js +1 -1
  211. package/dist/organizations/members-page.js +2 -2
  212. package/dist/organizations/messages.js +2 -187
  213. package/dist/organizations/organization-page.js +4 -4
  214. package/dist/organizations/organizations-page.js +1 -1
  215. package/dist/package.js +1 -1
  216. package/dist/plugins/load-plugin.js +2 -2
  217. package/dist/plugins/messages.js +2 -33
  218. package/dist/plugins/plugin-notice.js +7 -5
  219. package/dist/primitives/badge.d.ts +2 -1
  220. package/dist/primitives/messages.js +2 -13
  221. package/dist/primitives/token.js +1 -1
  222. package/dist/record-view/field.js +2 -2
  223. package/dist/record-view/messages.js +2 -33
  224. package/dist/record-view/record-header.js +2 -2
  225. package/dist/roles/messages.js +2 -11
  226. package/dist/shell/assets/app-CN_7en9q.js +8 -0
  227. package/dist/shell/assets/{calls-CPiQcC70.js → calls-D5RK7EJu.js} +2 -2
  228. package/dist/shell/assets/export-worker-ClXdfeuq.js +15 -0
  229. package/dist/shell/assets/{index-_ZpZ2ro0.js → index-DMaCBpbN.js} +2 -2
  230. package/dist/shell/assets/{maplibre-CjNYwEqW.js → maplibre-CRmpQfDl.js} +3 -3
  231. package/dist/shell/assets/parse-worker-DxsmAjef.js +18 -0
  232. package/dist/shell/assets/preload-helper-BgLOXTzV.js +2 -0
  233. package/dist/shell/assets/{record-map-DjqQGqZ2.js → record-map-DsP4sXes.js} +2 -2
  234. package/dist/shell/assets/{records-map-DU29d6QK.js → records-map-WFMHgKdf.js} +2 -2
  235. package/dist/shell/assets/shared-protobase-ui-CP2mMFbh.js +2 -0
  236. package/dist/shell/assets/vendor-Kvdo8Jrw.js +73 -0
  237. package/dist/shell/index.html +5 -5
  238. package/dist/shell/protobase.shell.json +2 -2
  239. package/dist/shell/protobase.sw.js +2 -2
  240. package/dist/shell-source-maps/assets/app-CN_7en9q.js.map +1 -0
  241. package/dist/shell-source-maps/assets/{calls-CPiQcC70.js.map → calls-D5RK7EJu.js.map} +1 -1
  242. package/dist/shell-source-maps/assets/export-worker-ClXdfeuq.js.map +1 -0
  243. package/dist/shell-source-maps/assets/{index-_ZpZ2ro0.js.map → index-DMaCBpbN.js.map} +1 -1
  244. package/dist/shell-source-maps/assets/{maplibre-CjNYwEqW.js.map → maplibre-CRmpQfDl.js.map} +1 -1
  245. package/dist/shell-source-maps/assets/parse-worker-DxsmAjef.js.map +1 -0
  246. package/dist/shell-source-maps/assets/preload-helper-BgLOXTzV.js.map +1 -0
  247. package/dist/shell-source-maps/assets/{record-map-DjqQGqZ2.js.map → record-map-DsP4sXes.js.map} +1 -1
  248. package/dist/shell-source-maps/assets/{records-map-DU29d6QK.js.map → records-map-WFMHgKdf.js.map} +1 -1
  249. package/dist/shell-source-maps/assets/shared-protobase-ui-CP2mMFbh.js.map +1 -0
  250. package/dist/shell-source-maps/assets/vendor-Kvdo8Jrw.js.map +1 -0
  251. package/dist/side-panel/messages.js +2 -5
  252. package/dist/status/messages.js +2 -59
  253. package/dist/toasts/messages.js +2 -5
  254. package/dist/users/create-user-form.js +1 -1
  255. package/dist/users/messages.js +2 -49
  256. package/package.json +5 -4
  257. package/dist/app-shell/nav.js +0 -85
  258. package/dist/locale/slotted.js +0 -14
  259. package/dist/mocks/activity.js +0 -24
  260. package/dist/mocks/rng.js +0 -20
  261. package/dist/mocks/users.js +0 -63
  262. package/dist/shell/assets/app-BPv_SjnU.js +0 -9
  263. package/dist/shell/assets/export-worker-3e4Zsv0a.js +0 -3
  264. package/dist/shell/assets/parse-worker-UhbwEjS0.js +0 -6
  265. package/dist/shell/assets/preload-helper-SYSsmQ2O.js +0 -2
  266. package/dist/shell/assets/shared-protobase-ui-Cab5nqST.js +0 -2
  267. package/dist/shell/assets/vendor-iwLB0x-s.js +0 -63
  268. package/dist/shell-source-maps/assets/app-BPv_SjnU.js.map +0 -1
  269. package/dist/shell-source-maps/assets/export-worker-3e4Zsv0a.js.map +0 -1
  270. package/dist/shell-source-maps/assets/parse-worker-UhbwEjS0.js.map +0 -1
  271. package/dist/shell-source-maps/assets/preload-helper-SYSsmQ2O.js.map +0 -1
  272. package/dist/shell-source-maps/assets/shared-protobase-ui-Cab5nqST.js.map +0 -1
  273. package/dist/shell-source-maps/assets/vendor-iwLB0x-s.js.map +0 -1
@@ -17,10 +17,25 @@ const announcementsFor = (lines, lineName) => {
17
17
  };
18
18
  const place = (id) => lines.findIndex((line) => line.id === id) + 1;
19
19
  return {
20
- onDragStart: ({ active }) => text("pickedUp", name(active.id), place(active.id), lines.length),
21
- onDragOver: ({ active, over }) => over ? text("over", name(active.id), place(over.id), lines.length) : void 0,
22
- onDragEnd: ({ active, over }) => over ? text("dropped", name(active.id), place(over.id), lines.length) : text("droppedAtStart", name(active.id)),
23
- onDragCancel: ({ active }) => text("cancelled", name(active.id), place(active.id))
20
+ onDragStart: ({ active }) => text("pickedUp", {
21
+ name: name(active.id),
22
+ place: place(active.id),
23
+ count: lines.length
24
+ }),
25
+ onDragOver: ({ active, over }) => over ? text("over", {
26
+ name: name(active.id),
27
+ place: place(over.id),
28
+ count: lines.length
29
+ }) : void 0,
30
+ onDragEnd: ({ active, over }) => over ? text("dropped", {
31
+ name: name(active.id),
32
+ place: place(over.id),
33
+ count: lines.length
34
+ }) : text("droppedAtStart", { name: name(active.id) }),
35
+ onDragCancel: ({ active }) => text("cancelled", {
36
+ name: name(active.id),
37
+ place: place(active.id)
38
+ })
24
39
  };
25
40
  };
26
41
  /** The lines of a record as rows of the given columns, put in order by dragging or from each row's menu. */
@@ -37,7 +37,7 @@ const LineRow = ({ line, name, columns, position, count, reorderable, onRemove,
37
37
  reorderable ? /* @__PURE__ */ jsx("button", {
38
38
  ref: setActivatorNodeRef,
39
39
  type: "button",
40
- "aria-label": text("dragToReorder", name),
40
+ "aria-label": text("dragToReorder", { name }),
41
41
  ...attributes,
42
42
  ...listeners,
43
43
  style: { touchAction: "none" },
@@ -49,7 +49,7 @@ const LineRow = ({ line, name, columns, position, count, reorderable, onRemove,
49
49
  children: column.cell(line)
50
50
  }, column.key)),
51
51
  menu.length > 0 ? /* @__PURE__ */ jsx(LineMenu, {
52
- label: text("actionsFor", name),
52
+ label: text("actionsFor", { name }),
53
53
  items: menu
54
54
  }) : /* @__PURE__ */ jsx("span", {}),
55
55
  error && /* @__PURE__ */ jsx("p", {
@@ -1,38 +1,5 @@
1
- import { defineMessages } from "../locale/messages.js";
1
+ import { messages } from "../locale/messages.js";
2
2
  //#region src/inline-child-table/messages.ts
3
- const text = defineMessages({
4
- en: {
5
- instructions: "To pick up a line, press space or enter on its drag handle. Use the up and down arrow keys to move it, space or enter to drop it, and escape to cancel. The row menu also has Move up and Move down.",
6
- line: "line",
7
- pickedUp: (name, place, count) => `Picked up ${name}, line ${place} of ${count}.`,
8
- over: (name, place, count) => `${name} is over line ${place} of ${count}.`,
9
- dropped: (name, place, count) => `${name} was dropped at line ${place} of ${count}.`,
10
- droppedAtStart: (name) => `${name} was dropped where it started.`,
11
- cancelled: (name, place) => `Moving ${name} was cancelled. It is back at line ${place}.`,
12
- addLine: "Add line",
13
- noLines: "No lines yet.",
14
- moveUp: "Move up",
15
- moveDown: "Move down",
16
- removeLine: "Remove line",
17
- dragToReorder: (name) => `Drag to reorder ${name}`,
18
- actionsFor: (name) => `Actions for ${name}`
19
- },
20
- nl: {
21
- instructions: "Druk op spatie of enter op de sleepgreep om een regel op te pakken. Verplaats hem met de pijltjestoetsen omhoog en omlaag, zet hem neer met spatie of enter, en annuleer met escape. Het regelmenu heeft ook Omhoog en Omlaag.",
22
- line: "regel",
23
- pickedUp: (name, place, count) => `${name} opgepakt, regel ${place} van ${count}.`,
24
- over: (name, place, count) => `${name} is boven regel ${place} van ${count}.`,
25
- dropped: (name, place, count) => `${name} is neergezet op regel ${place} van ${count}.`,
26
- droppedAtStart: (name) => `${name} is neergezet waar hij begon.`,
27
- cancelled: (name, place) => `Verplaatsen van ${name} is geannuleerd. Hij staat weer op regel ${place}.`,
28
- addLine: "Regel toevoegen",
29
- noLines: "Nog geen regels.",
30
- moveUp: "Omhoog",
31
- moveDown: "Omlaag",
32
- removeLine: "Regel verwijderen",
33
- dragToReorder: (name) => `Sleep om ${name} te verplaatsen`,
34
- actionsFor: (name) => `Acties voor ${name}`
35
- }
36
- });
3
+ const text = messages("inline-child-table");
37
4
  //#endregion
38
5
  export { text };
@@ -1,14 +1,13 @@
1
- import { slotted } from "../locale/slotted.js";
2
1
  import { text } from "./messages.js";
3
2
  import { jsx } from "react/jsx-runtime";
4
3
  //#region src/invitations/link-notice.tsx
5
4
  /** The invitation link to pass on, when the app cannot email it. */
6
5
  const LinkNotice = ({ link }) => link ? /* @__PURE__ */ jsx("p", {
7
6
  className: "mt-3 break-all rounded-md border bg-muted px-3 py-2 text-xs",
8
- children: slotted(text("passLinkOn"), /* @__PURE__ */ jsx("span", {
7
+ children: text.rich("passLinkOn", { link: /* @__PURE__ */ jsx("span", {
9
8
  className: "font-mono",
10
9
  children: link
11
- }))
10
+ }) })
12
11
  }) : null;
13
12
  //#endregion
14
13
  export { LinkNotice };
@@ -1,24 +1,5 @@
1
- import { defineMessages } from "../locale/messages.js";
1
+ import { messages } from "../locale/messages.js";
2
2
  //#region src/invitations/messages.ts
3
- const text = defineMessages({
4
- en: {
5
- email: "Email",
6
- invite: "Invite",
7
- expired: "Expired",
8
- until: (date) => `Until ${date}`,
9
- sendAgain: "Send again",
10
- revoke: "Revoke",
11
- passLinkOn: "This app cannot send email, so pass this link on yourself. It works once, until the invitation expires: {}"
12
- },
13
- nl: {
14
- email: "E-mailadres",
15
- invite: "Uitnodigen",
16
- expired: "Verlopen",
17
- until: (date) => `Tot ${date}`,
18
- sendAgain: "Opnieuw sturen",
19
- revoke: "Intrekken",
20
- passLinkOn: "Deze app kan geen e-mail sturen, dus geef deze link zelf door. Die werkt één keer, tot de uitnodiging verloopt: {}"
21
- }
22
- });
3
+ const text = messages("invitations");
23
4
  //#endregion
24
5
  export { text };
@@ -28,7 +28,7 @@ const PendingInvitationRow = ({ email, gives, expiresAt, onResend, onRevoke }) =
28
28
  children: [
29
29
  gives,
30
30
  " · ",
31
- expired ? text("expired") : text("until", new Date(expiresAt).toLocaleDateString(formatTag()))
31
+ expired ? text("expired") : text("until", { date: new Date(expiresAt).toLocaleDateString(formatTag()) })
32
32
  ]
33
33
  })]
34
34
  }),
@@ -1,8 +1,5 @@
1
- import { defineMessages } from "../locale/messages.js";
1
+ import { messages } from "../locale/messages.js";
2
2
  //#region src/lists/messages.ts
3
- const text = defineMessages({
4
- en: { showMore: "Show more" },
5
- nl: { showMore: "Meer tonen" }
6
- });
3
+ const text = messages("lists");
7
4
  //#endregion
8
5
  export { text };
@@ -4,28 +4,10 @@ import { markdownExcerpt } from "../markdown/markdown-excerpt.js";
4
4
  import { isMarkdown } from "../markdown/markdown-hint.js";
5
5
  import { recordTitleField } from "./model-helpers.js";
6
6
  import { contactFormat } from "./contact-links.js";
7
+ import { valueTone } from "./value-color.js";
7
8
  import { listColumnNames } from "@protobase/schema/internal";
8
9
  import { enumLabel } from "@protobase/schema";
9
10
  //#region src/live/columns-from-model.ts
10
- const tones = {
11
- draft: "neutral",
12
- confirmed: "blue",
13
- picking: "amber",
14
- shipped: "violet",
15
- delivered: "green",
16
- cancelled: "red",
17
- sent: "blue",
18
- paid: "green",
19
- overdue: "red",
20
- lead: "blue",
21
- active: "green",
22
- dormant: "neutral",
23
- receipt: "green",
24
- issue: "blue",
25
- transfer: "violet",
26
- adjustment: "amber"
27
- };
28
- const toneFor = (value) => tones[value] ?? "neutral";
29
11
  const widths = {
30
12
  text: 200,
31
13
  id: 140,
@@ -47,7 +29,6 @@ const fixedKinds = /* @__PURE__ */ new Set([
47
29
  "boolean",
48
30
  "percent"
49
31
  ]);
50
- const idLike = /^(number|sku|reference|code)$/;
51
32
  const kindOf = (field, view, index) => {
52
33
  switch (field.type) {
53
34
  case "relation": return "relation";
@@ -56,14 +37,14 @@ const kindOf = (field, view, index) => {
56
37
  case "boolean": return "boolean";
57
38
  case "timestamp": return "datetime";
58
39
  case "date": return "date";
59
- case "decimal": return view?.format === "percent" ? "percent" : view?.prefix === "€" ? "money" : "number";
40
+ case "decimal": return view?.format === "percent" ? "percent" : view?.currency !== void 0 ? "money" : "number";
60
41
  case "integer":
61
- case "bigint": return /quantity|delta/.test(field.name) ? "signed" : "number";
62
- default: return idLike.test(field.name) || index === 0 && field.name === "id" ? "id" : "text";
42
+ case "bigint": return view?.format === "signed" ? "signed" : "number";
43
+ default: return view?.format === "code" || index === 0 && field.name === "id" ? "id" : "text";
63
44
  }
64
45
  };
65
46
  const currencyCents = (value) => Math.round(Number.parseFloat(String(value)) * 100);
66
- /** Grid columns for `names`, by default the view's list: kinds follow the field types and the view's format hints. */
47
+ /** Grid columns for `names`, by default the view's list: kinds follow the field types and the view's format and currency hints. */
67
48
  const columnsFromModel = (resource, view, highlight = [], names = listColumnNames(resource, view)) => {
68
49
  const title = recordTitleField(resource, view);
69
50
  return names.flatMap((name, index) => {
@@ -72,29 +53,31 @@ const columnsFromModel = (resource, view, highlight = [], names = listColumnName
72
53
  const viewField = view?.fields[name];
73
54
  const kind = kindOf(field, viewField, index);
74
55
  const labels = Object.fromEntries((field.enumValues ?? []).map((value) => [value, enumLabel(value, viewField?.valueLabels)]));
75
- const suffixWidth = viewField?.suffix ? Math.ceil(viewField.suffix.length * 7.2) : 0;
56
+ const prefix = (kind === "number" || kind === "signed") && viewField?.prefix ? viewField.prefix : void 0;
57
+ const affixWidth = Math.ceil(((prefix?.length ?? 0) + (viewField?.suffix?.length ?? 0)) * 7.2);
76
58
  return [{
77
59
  id: name,
78
60
  header: viewField?.label ?? humanize(name),
79
61
  kind,
80
- width: (name === "name" ? 260 : widths[kind]) + suffixWidth,
62
+ width: (name === "name" ? 260 : widths[kind]) + affixWidth,
81
63
  sortable: field.sortable,
82
- minWidth: Math.max(kind === "id" ? 150 : 0, headerWidth(viewField?.label ?? humanize(name), field.sortable), kind === "status" ? badgeWidth(Object.values(labels)) : 0, suffixWidth > 0 ? widths[kind] + suffixWidth : 0),
64
+ minWidth: Math.max(kind === "id" ? 150 : 0, headerWidth(viewField?.label ?? humanize(name), field.sortable), kind === "status" ? badgeWidth(Object.values(labels)) : 0, affixWidth > 0 ? widths[kind] + affixWidth : 0),
83
65
  ...fixedKinds.has(kind) && { fixed: true },
84
66
  ...name === title && { title: true },
85
67
  ...kind === "text" && name !== title && contactFormat(viewField) && { link: contactFormat(viewField) },
86
68
  ...highlight.includes(name) && { highlight: true },
87
69
  ...field.type === "enum" && {
88
- tones: Object.fromEntries((field.enumValues ?? []).map((value) => [value, toneFor(value)])),
70
+ tones: Object.fromEntries((field.enumValues ?? []).map((value) => [value, valueTone(viewField?.valueColors, value)])),
89
71
  labels
90
72
  },
91
73
  ...field.type === "enum" && viewField?.valueColors && { colors: viewField.valueColors },
92
74
  ...field.type === "enum" && viewField?.badgeShape && { shape: viewField.badgeShape },
75
+ ...prefix !== void 0 && { prefix },
93
76
  ...viewField?.suffix !== void 0 && { suffix: viewField.suffix },
94
77
  ...kind === "datetime" && viewField?.format === "relative" && { relative: true },
95
78
  ...kind === "money" && viewField?.decimals !== void 0 && { decimals: viewField.decimals },
96
- ...kind === "money" && {
97
- currency: "EUR",
79
+ ...kind === "money" && viewField?.currency !== void 0 && {
80
+ currency: viewField.currency,
98
81
  value: (row) => row[name] == null ? null : currencyCents(row[name])
99
82
  },
100
83
  ...(kind === "datetime" || kind === "date") && { value: (row) => row[name] == null ? null : Date.parse(String(row[name])) },
@@ -104,4 +87,4 @@ const columnsFromModel = (resource, view, highlight = [], names = listColumnName
104
87
  });
105
88
  };
106
89
  //#endregion
107
- export { columnsFromModel, listColumnNames, toneFor };
90
+ export { columnsFromModel, listColumnNames };
@@ -40,7 +40,7 @@ const valueTitle = (field, value, zone = viewerZone(), hints = {}) => {
40
40
  const ms = Date.parse(value);
41
41
  if (Number.isNaN(ms)) return void 0;
42
42
  if (hints.format === "relative") return formatDateTime(ms, zone);
43
- return text("shownIn", zoneLabel(ms, zone));
43
+ return text("shownIn", { zone: zoneLabel(ms, zone) });
44
44
  };
45
45
  //#endregion
46
46
  export { displayValue, valueTitle };
@@ -1,18 +1,5 @@
1
- import { defineMessages } from "../locale/messages.js";
1
+ import { messages } from "../locale/messages.js";
2
2
  //#region src/live/messages.ts
3
- const text = defineMessages({
4
- en: {
5
- yes: "Yes",
6
- no: "No",
7
- shownIn: (zone) => `Shown in ${zone}`,
8
- fileMissing: "File missing"
9
- },
10
- nl: {
11
- yes: "Ja",
12
- no: "Nee",
13
- shownIn: (zone) => `Getoond in ${zone}`,
14
- fileMissing: "Bestand ontbreekt"
15
- }
16
- });
3
+ const text = messages("live");
17
4
  //#endregion
18
5
  export { text };
@@ -1,8 +1,18 @@
1
+ import { isBadgeTone } from "@protobase/schema";
1
2
  //#region src/live/value-color.ts
2
- /** The colour a view gives a value's badge, if any. */
3
- const valueColor = (colors, value) => {
3
+ const declared = (colors, value) => {
4
4
  const key = String(value);
5
5
  return colors && Object.hasOwn(colors, key) ? colors[key] : void 0;
6
6
  };
7
+ /** The hex colour a view gives a value's badge, if any; a tone name is no colour. */
8
+ const valueColor = (colors, value) => {
9
+ const color = declared(colors, value);
10
+ return color === void 0 || isBadgeTone(color) ? void 0 : color;
11
+ };
12
+ /** The tone a view gives a value's badge, `neutral` when it names none. */
13
+ const valueTone = (colors, value) => {
14
+ const tone = declared(colors, value);
15
+ return tone !== void 0 && isBadgeTone(tone) ? tone : "neutral";
16
+ };
7
17
  //#endregion
8
- export { valueColor };
18
+ export { valueColor, valueTone };
@@ -68,11 +68,13 @@ const widgetFields = (view, model) => {
68
68
  };
69
69
  /** Whether a range draws its histogram: only a `range` widget that asks for one. */
70
70
  const rangeHistogram = (view, field) => (view?.filters ?? []).some((widget) => widget.kind === "range" && widget.field === field && widget.histogram);
71
- /** How a range's values read, by the view's prefix and suffix: "€450,000" for a euro amount, "85 m²". */
71
+ /** How a range's values read: money in the view's currency, "€450,000", else with its prefix and suffix, "85 m²". */
72
72
  const rangeFormat = (view, field) => {
73
73
  const hints = view?.fields[field];
74
74
  const suffix = hints?.suffix ?? "";
75
- return (value) => `${hints?.prefix === "€" ? formatMoney(value * 100).replace(".00", "") : String(value)}${suffix}`;
75
+ const currency = hints?.currency;
76
+ if (currency !== void 0) return (value) => `${formatMoney(value * 100, currency).replace(".00", "")}${suffix}`;
77
+ return (value) => `${hints?.prefix ?? ""}${value}${suffix}`;
76
78
  };
77
79
  //#endregion
78
80
  export { rangeFormat, rangeHistogram, widgetFields };