@cosmicdrift/kumiko-renderer 0.413.1 → 0.414.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 (334) hide show
  1. package/dist/app/action-form-support.js +4 -0
  2. package/dist/app/content-previews.d.ts +39 -0
  3. package/dist/app/content-previews.js +28 -0
  4. package/dist/app/entity-edit-screen.js +2 -5
  5. package/dist/app/entity-list-screen.js +30 -50
  6. package/dist/app/form-schema.d.ts +1 -0
  7. package/dist/app/form-schema.js +24 -0
  8. package/dist/app/list-sort-options.d.ts +4 -0
  9. package/dist/app/list-sort-options.js +11 -0
  10. package/dist/app/named-filter-facet.d.ts +17 -3
  11. package/dist/app/named-filter-facet.js +88 -5
  12. package/dist/app/projection-detail-body.d.ts +2 -4
  13. package/dist/app/projection-detail-body.js +7 -1
  14. package/dist/app/projection-detail-guidance-data.d.ts +7 -0
  15. package/dist/app/projection-detail-guidance-data.js +101 -0
  16. package/dist/app/projection-detail-guidance.d.ts +13 -0
  17. package/dist/app/projection-detail-guidance.js +197 -0
  18. package/dist/app/projection-detail-header-model.d.ts +1 -3
  19. package/dist/app/projection-detail-header-model.js +4 -8
  20. package/dist/app/projection-detail-header-region.d.ts +2 -1
  21. package/dist/app/projection-detail-header-region.js +63 -23
  22. package/dist/app/projection-detail-header.d.ts +6 -1
  23. package/dist/app/projection-detail-header.js +75 -18
  24. package/dist/app/projection-detail-states.d.ts +3 -3
  25. package/dist/app/projection-list-body.js +4 -2
  26. package/dist/app/projection-list-render.js +3 -1
  27. package/dist/app/projection-list-shim.d.ts +4 -1
  28. package/dist/app/projection-list-shim.js +35 -8
  29. package/dist/app/reference-link.d.ts +3 -2
  30. package/dist/app/reference-link.js +19 -4
  31. package/dist/app/row-actions.js +3 -3
  32. package/dist/app/screen-access.d.ts +4 -0
  33. package/dist/app/screen-access.js +19 -0
  34. package/dist/app/screen-shared.js +3 -1
  35. package/dist/app/unique-label-keys.d.ts +1 -0
  36. package/dist/app/unique-label-keys.js +9 -0
  37. package/dist/app/use-entity-list-payload.d.ts +25 -0
  38. package/dist/app/use-entity-list-payload.js +57 -0
  39. package/dist/app/use-entity-range-facets.js +2 -3
  40. package/dist/app/use-facet-counts.d.ts +5 -0
  41. package/dist/app/use-facet-counts.js +7 -0
  42. package/dist/app/use-list-summary-row.d.ts +10 -0
  43. package/dist/app/use-list-summary-row.js +33 -0
  44. package/dist/app/use-named-filter-queue.d.ts +20 -0
  45. package/dist/app/use-named-filter-queue.js +9 -0
  46. package/dist/app/use-projection-detail-actions.d.ts +4 -4
  47. package/dist/app/use-projection-detail-actions.js +30 -1
  48. package/dist/app/use-projection-list-data.d.ts +5 -0
  49. package/dist/app/use-projection-list-data.js +35 -6
  50. package/dist/app/use-projection-list-query.d.ts +2 -0
  51. package/dist/app/use-projection-list-query.js +29 -16
  52. package/dist/app/use-related-list-tab-counts.js +5 -1
  53. package/dist/app/use-row-decoration.d.ts +11 -0
  54. package/dist/app/use-row-decoration.js +55 -0
  55. package/dist/app/use-screen-list-rows.d.ts +4 -1
  56. package/dist/app/use-screen-list-rows.js +14 -5
  57. package/dist/app/use-screen-list-table.d.ts +3 -1
  58. package/dist/app/use-screen-list-table.js +10 -1
  59. package/dist/app/write-failed-error.d.ts +1 -0
  60. package/dist/app/write-failed-error.js +10 -0
  61. package/dist/compact-tap-classes.d.ts +1 -0
  62. package/dist/compact-tap-classes.js +3 -0
  63. package/dist/components/embedded-list-field.js +13 -12
  64. package/dist/components/list-empty-state.d.ts +8 -1
  65. package/dist/components/list-empty-state.js +4 -1
  66. package/dist/components/list-group-page-bridges.d.ts +1 -1
  67. package/dist/components/list-group-page-bridges.js +2 -2
  68. package/dist/components/related-list-section.js +4 -22
  69. package/dist/components/render-edit-action-button.d.ts +3 -1
  70. package/dist/components/render-edit-action-button.js +5 -3
  71. package/dist/components/render-edit-render-model.d.ts +2 -2
  72. package/dist/components/render-edit-types.d.ts +4 -2
  73. package/dist/components/render-edit.js +3 -1
  74. package/dist/components/render-list-hint-columns.d.ts +8 -0
  75. package/dist/components/render-list-hint-columns.js +77 -0
  76. package/dist/components/render-list-reference-columns.js +4 -2
  77. package/dist/components/render-list-row-tone.d.ts +3 -0
  78. package/dist/components/render-list-row-tone.js +10 -0
  79. package/dist/components/render-list-table-props.d.ts +9 -1
  80. package/dist/components/render-list-table-props.js +4 -1
  81. package/dist/components/render-list-toolbar-action.d.ts +1 -2
  82. package/dist/components/render-list-toolbar-model.d.ts +3 -0
  83. package/dist/components/render-list-toolbar-model.js +21 -6
  84. package/dist/components/render-list-toolbar.d.ts +3 -2
  85. package/dist/components/render-list-toolbar.js +8 -6
  86. package/dist/components/render-list-types.d.ts +6 -1
  87. package/dist/components/render-list.js +26 -7
  88. package/dist/components/use-render-edit-controlled-sync.js +3 -5
  89. package/dist/components/use-render-edit-draft-save.js +7 -9
  90. package/dist/components/use-render-edit-schema.d.ts +3 -0
  91. package/dist/components/use-render-edit-schema.js +15 -0
  92. package/dist/components/use-render-edit-state.d.ts +1 -0
  93. package/dist/components/use-render-edit-state.js +4 -1
  94. package/dist/components/use-render-edit-steps.js +2 -3
  95. package/dist/components/use-render-list-columns.d.ts +3 -1
  96. package/dist/components/use-render-list-columns.js +22 -10
  97. package/dist/context/screen-focus-context.d.ts +14 -0
  98. package/dist/context/screen-focus-context.js +28 -0
  99. package/dist/data-table-facet-types.d.ts +2 -0
  100. package/dist/data-table-view-types.d.ts +20 -1
  101. package/dist/headless/form/form-controller.js +3 -1
  102. package/dist/headless/form/zod-bridge.d.ts +7 -1
  103. package/dist/headless/form/zod-bridge.js +10 -0
  104. package/dist/headless/index.d.ts +2 -1
  105. package/dist/headless/index.js +1 -0
  106. package/dist/headless/pwa-service-worker-meta.d.ts +1 -0
  107. package/dist/headless/pwa-service-worker-meta.js +3 -0
  108. package/dist/headless/view-model/index.d.ts +1 -1
  109. package/dist/headless/view-model/list-file-display.js +3 -2
  110. package/dist/headless/view-model/list.js +16 -0
  111. package/dist/headless/view-model/types.d.ts +33 -0
  112. package/dist/hooks/list-column-layout.js +2 -1
  113. package/dist/hooks/list-server-groups.js +14 -1
  114. package/dist/hooks/list-state-schema.d.ts +1 -0
  115. package/dist/hooks/list-state-schema.js +9 -1
  116. package/dist/hooks/use-debounced-value.d.ts +1 -0
  117. package/dist/hooks/use-debounced-value.js +11 -0
  118. package/dist/hooks/use-list-aggregates.d.ts +5 -1
  119. package/dist/hooks/use-list-aggregates.js +9 -5
  120. package/dist/hooks/use-list-table.d.ts +2 -1
  121. package/dist/hooks/use-list-table.js +3 -9
  122. package/dist/hooks/use-list-url-state.d.ts +2 -0
  123. package/dist/hooks/use-list-url-state.js +12 -4
  124. package/dist/hooks/use-list-view-state.js +23 -3
  125. package/dist/hooks/use-reference-lookup.js +7 -2
  126. package/dist/hooks/use-remembered-list-params.d.ts +6 -2
  127. package/dist/hooks/use-remembered-list-params.js +18 -3
  128. package/dist/hooks/use-store.js +0 -1
  129. package/dist/i18n-defaults.js +37 -2
  130. package/dist/index.d.ts +7 -2
  131. package/dist/index.js +4 -1
  132. package/dist/live/dispatcher-live.js +2 -0
  133. package/dist/metric-types.d.ts +2 -0
  134. package/dist/primitives-record-guidance.d.ts +53 -0
  135. package/dist/primitives-record-guidance.js +1 -0
  136. package/dist/primitives.d.ts +41 -31
  137. package/dist/server-clock.d.ts +6 -0
  138. package/dist/server-clock.js +20 -0
  139. package/dist/session/session-ended.d.ts +1 -0
  140. package/dist/session/session-ended.js +2 -2
  141. package/dist/status-tone.d.ts +1 -0
  142. package/dist/status-tone.js +5 -0
  143. package/dist/web/app/browser-locale.js +1 -1
  144. package/dist/web/app/client-plugin.d.ts +6 -1
  145. package/dist/web/app/create-app.d.ts +2 -1
  146. package/dist/web/app/create-app.js +15 -5
  147. package/dist/web/app/dashboard-body.js +25 -11
  148. package/dist/web/app/dashboard-header.d.ts +2 -1
  149. package/dist/web/app/dashboard-header.js +19 -7
  150. package/dist/web/app/dashboard-list-panel.d.ts +12 -0
  151. package/dist/web/app/dashboard-list-panel.js +149 -0
  152. package/dist/web/app/dashboard-narrow-gate.d.ts +6 -0
  153. package/dist/web/app/dashboard-narrow-gate.js +6 -0
  154. package/dist/web/app/dashboard-narrow-order.d.ts +3 -0
  155. package/dist/web/app/dashboard-narrow-order.js +6 -0
  156. package/dist/web/app/dashboard-navigation-link.d.ts +12 -0
  157. package/dist/web/app/dashboard-navigation-link.js +21 -0
  158. package/dist/web/app/dashboard-panels.d.ts +6 -23
  159. package/dist/web/app/dashboard-panels.js +53 -123
  160. package/dist/web/app/dashboard-reference-list-table.d.ts +5 -1
  161. package/dist/web/app/dashboard-reference-list-table.js +12 -4
  162. package/dist/web/app/dashboard-shared.d.ts +23 -7
  163. package/dist/web/app/dashboard-shared.js +44 -17
  164. package/dist/web/app/dashboard-stat-group-panel.d.ts +13 -0
  165. package/dist/web/app/dashboard-stat-group-panel.js +67 -0
  166. package/dist/web/app/dashboard-text-panel.d.ts +12 -0
  167. package/dist/web/app/dashboard-text-panel.js +163 -0
  168. package/dist/web/app/dashboard-text.d.ts +2 -0
  169. package/dist/web/app/dashboard-text.js +1 -1
  170. package/dist/web/app/dashboard-visibility.js +1 -1
  171. package/dist/web/app/relative-time.js +2 -1
  172. package/dist/web/editor/editor-footer.d.ts +28 -0
  173. package/dist/web/editor/editor-footer.js +23 -0
  174. package/dist/web/editor/editor-frame.d.ts +23 -0
  175. package/dist/web/editor/editor-frame.js +24 -0
  176. package/dist/web/editor/editor-header.d.ts +36 -0
  177. package/dist/web/editor/editor-header.js +30 -0
  178. package/dist/web/editor/editor-rail.d.ts +32 -0
  179. package/dist/web/editor/editor-rail.js +37 -0
  180. package/dist/web/editor/editor-workbench.d.ts +34 -0
  181. package/dist/web/editor/editor-workbench.js +19 -0
  182. package/dist/web/editor/index.d.ts +6 -0
  183. package/dist/web/editor/index.js +6 -0
  184. package/dist/web/editor/relative-when.d.ts +1 -0
  185. package/dist/web/editor/relative-when.js +18 -0
  186. package/dist/web/index.d.ts +7 -1
  187. package/dist/web/index.js +5 -1
  188. package/dist/web/layout/default-app-shell.js +6 -4
  189. package/dist/web/layout/focus-aware-sidebar.d.ts +4 -7
  190. package/dist/web/layout/focus-aware-sidebar.js +5 -7
  191. package/dist/web/layout/header-action-pinned.d.ts +8 -0
  192. package/dist/web/layout/header-action-pinned.js +25 -0
  193. package/dist/web/layout/nav-collapse-state.d.ts +5 -0
  194. package/dist/web/layout/nav-collapse-state.js +66 -0
  195. package/dist/web/layout/nav-tree.js +25 -5
  196. package/dist/web/layout/page-header-slot.d.ts +2 -0
  197. package/dist/web/layout/page-header-slot.js +4 -0
  198. package/dist/web/layout/screen-focus.d.ts +8 -0
  199. package/dist/web/layout/screen-focus.js +42 -0
  200. package/dist/web/layout/shell-focus.d.ts +6 -5
  201. package/dist/web/layout/shell-focus.js +12 -9
  202. package/dist/web/layout/shell-header.js +38 -10
  203. package/dist/web/layout/sidebar-open-state.d.ts +6 -0
  204. package/dist/web/layout/sidebar-open-state.js +28 -0
  205. package/dist/web/layout/uniform-bar-controls.d.ts +2 -2
  206. package/dist/web/layout/uniform-bar-controls.js +4 -3
  207. package/dist/web/layout/use-in-app-inbox.js +8 -1
  208. package/dist/web/layout/workspace-shell.js +6 -4
  209. package/dist/web/lib/upload-file-ref.d.ts +2 -2
  210. package/dist/web/lib/upload-file-ref.js +4 -9
  211. package/dist/web/presence/use-presence.js +7 -2
  212. package/dist/web/primitives/banner.d.ts +1 -1
  213. package/dist/web/primitives/banner.js +14 -6
  214. package/dist/web/primitives/calendar-day-picker.js +24 -5
  215. package/dist/web/primitives/card.js +1 -1
  216. package/dist/web/primitives/code-input.js +6 -1
  217. package/dist/web/primitives/data-table/actions-column.d.ts +1 -0
  218. package/dist/web/primitives/data-table/actions-column.js +4 -2
  219. package/dist/web/primitives/data-table/card-body.d.ts +5 -0
  220. package/dist/web/primitives/data-table/card-body.js +47 -5
  221. package/dist/web/primitives/data-table/card-frame.d.ts +8 -0
  222. package/dist/web/primitives/data-table/card-frame.js +9 -0
  223. package/dist/web/primitives/data-table/card-row.js +40 -7
  224. package/dist/web/primitives/data-table/card-sort-select.d.ts +6 -2
  225. package/dist/web/primitives/data-table/card-sort-select.js +10 -7
  226. package/dist/web/primitives/data-table/card-view.js +12 -2
  227. package/dist/web/primitives/data-table/column-picker-section.js +9 -2
  228. package/dist/web/primitives/data-table/column-resize-handle.js +3 -4
  229. package/dist/web/primitives/data-table/column-role.d.ts +1 -0
  230. package/dist/web/primitives/data-table/column-role.js +1 -0
  231. package/dist/web/primitives/data-table/data-cell-props.d.ts +5 -0
  232. package/dist/web/primitives/data-table/data-cell-props.js +5 -0
  233. package/dist/web/primitives/data-table/density.js +1 -0
  234. package/dist/web/primitives/data-table/facet-cluster.d.ts +2 -1
  235. package/dist/web/primitives/data-table/facet-cluster.js +2 -2
  236. package/dist/web/primitives/data-table/group-band.js +4 -0
  237. package/dist/web/primitives/data-table/hint-cell.d.ts +16 -0
  238. package/dist/web/primitives/data-table/hint-cell.js +74 -0
  239. package/dist/web/primitives/data-table/hint-column-width.d.ts +3 -0
  240. package/dist/web/primitives/data-table/hint-column-width.js +11 -0
  241. package/dist/web/primitives/data-table/measure-value.js +2 -3
  242. package/dist/web/primitives/data-table/row-action-column.d.ts +3 -0
  243. package/dist/web/primitives/data-table/row-action-column.js +4 -0
  244. package/dist/web/primitives/data-table/sort-options-select.d.ts +22 -0
  245. package/dist/web/primitives/data-table/sort-options-select.js +46 -0
  246. package/dist/web/primitives/data-table/sortable-header.d.ts +3 -1
  247. package/dist/web/primitives/data-table/sortable-header.js +5 -3
  248. package/dist/web/primitives/data-table/table-body.d.ts +1 -1
  249. package/dist/web/primitives/data-table/table-body.js +5 -3
  250. package/dist/web/primitives/data-table/table-chrome.js +3 -1
  251. package/dist/web/primitives/data-table/table-content.js +10 -5
  252. package/dist/web/primitives/data-table/table-data-cell.js +9 -3
  253. package/dist/web/primitives/data-table/table-header-row.js +5 -2
  254. package/dist/web/primitives/data-table/table-view.js +17 -3
  255. package/dist/web/primitives/data-table/toolbar-end-cluster.js +1 -1
  256. package/dist/web/primitives/data-table/toolbar.js +31 -3
  257. package/dist/web/primitives/data-table/totals-footer.d.ts +20 -0
  258. package/dist/web/primitives/data-table/totals-footer.js +40 -9
  259. package/dist/web/primitives/data-table/use-bulk-selection.js +2 -1
  260. package/dist/web/primitives/data-table/use-column-pins.js +4 -0
  261. package/dist/web/primitives/data-table/use-data-table-state.d.ts +1 -0
  262. package/dist/web/primitives/data-table/use-data-table-state.js +9 -5
  263. package/dist/web/primitives/data-table/use-measured-column-widths.js +5 -4
  264. package/dist/web/primitives/data-table/use-row-selection.js +22 -11
  265. package/dist/web/primitives/data-table/view-menu.js +7 -1
  266. package/dist/web/primitives/data-table-cell.d.ts +21 -2
  267. package/dist/web/primitives/data-table-cell.js +96 -19
  268. package/dist/web/primitives/embedded-file-cell.js +3 -2
  269. package/dist/web/primitives/embedded-list-cards.js +3 -4
  270. package/dist/web/primitives/facet-filter.d.ts +4 -2
  271. package/dist/web/primitives/facet-filter.js +26 -3
  272. package/dist/web/primitives/facet-search-filter.js +1 -1
  273. package/dist/web/primitives/file-thumbnail.d.ts +6 -2
  274. package/dist/web/primitives/file-thumbnail.js +13 -6
  275. package/dist/web/primitives/file-upload.js +3 -2
  276. package/dist/web/primitives/file-view-action.d.ts +6 -0
  277. package/dist/web/primitives/file-view-action.js +19 -0
  278. package/dist/web/primitives/files-dropzone.js +20 -9
  279. package/dist/web/primitives/form-footer-parts.d.ts +0 -1
  280. package/dist/web/primitives/form.js +0 -1
  281. package/dist/web/primitives/hint-reason-row.d.ts +32 -0
  282. package/dist/web/primitives/hint-reason-row.js +45 -0
  283. package/dist/web/primitives/index.js +6 -0
  284. package/dist/web/primitives/layout-elements.d.ts +1 -1
  285. package/dist/web/primitives/layout-elements.js +2 -2
  286. package/dist/web/primitives/metric.js +8 -6
  287. package/dist/web/primitives/page-header.d.ts +1 -1
  288. package/dist/web/primitives/page-header.js +8 -1
  289. package/dist/web/primitives/pager.js +29 -18
  290. package/dist/web/primitives/reason-box.d.ts +20 -0
  291. package/dist/web/primitives/reason-box.js +13 -0
  292. package/dist/web/primitives/record-breadcrumb.d.ts +3 -0
  293. package/dist/web/primitives/record-breadcrumb.js +11 -0
  294. package/dist/web/primitives/record-steps.d.ts +3 -0
  295. package/dist/web/primitives/record-steps.js +45 -0
  296. package/dist/web/primitives/record-summary.d.ts +3 -0
  297. package/dist/web/primitives/record-summary.js +18 -0
  298. package/dist/web/primitives/row-actions.d.ts +3 -1
  299. package/dist/web/primitives/row-actions.js +14 -5
  300. package/dist/web/primitives/segmented-select.js +5 -7
  301. package/dist/web/pwa/pwa-support.d.ts +4 -0
  302. package/dist/web/pwa/pwa-support.js +113 -0
  303. package/dist/web/sse/live-events.js +2 -2
  304. package/dist/web/tokens.js +0 -3
  305. package/dist/web/widgets/chart-parts.d.ts +7 -1
  306. package/dist/web/widgets/chart-parts.js +10 -4
  307. package/dist/web/widgets/collapsible-section.js +1 -1
  308. package/dist/web/widgets/dashboard-list-cards.d.ts +17 -0
  309. package/dist/web/widgets/dashboard-list-cards.js +54 -0
  310. package/dist/web/widgets/dashboard-list.d.ts +37 -5
  311. package/dist/web/widgets/dashboard-list.js +95 -20
  312. package/dist/web/widgets/drawer-sizing.js +1 -1
  313. package/dist/web/widgets/floating-panel.js +4 -2
  314. package/dist/web/widgets/index.d.ts +2 -0
  315. package/dist/web/widgets/index.js +2 -0
  316. package/dist/web/widgets/infinity-list.js +18 -11
  317. package/dist/web/widgets/preview-width-frame.d.ts +7 -0
  318. package/dist/web/widgets/preview-width-frame.js +10 -0
  319. package/dist/web/widgets/section-card.d.ts +1 -1
  320. package/dist/web/widgets/stacked-area-chrome.js +3 -3
  321. package/dist/web/widgets/stacked-area-tooltip.js +2 -10
  322. package/dist/web/widgets/stat-box-cell.d.ts +19 -0
  323. package/dist/web/widgets/stat-box-cell.js +10 -0
  324. package/dist/web/widgets/stat.d.ts +10 -1
  325. package/dist/web/widgets/stat.js +14 -5
  326. package/dist/web/widgets/status-badge.d.ts +7 -5
  327. package/dist/web/widgets/status-badge.js +2 -2
  328. package/dist/web/widgets/step-bar.d.ts +1 -1
  329. package/dist/web/widgets/step-bar.js +37 -7
  330. package/dist/web/widgets/upload-zone.d.ts +8 -1
  331. package/dist/web/widgets/upload-zone.js +13 -3
  332. package/package.json +5 -5
  333. package/src/changes.json +217 -0
  334. package/src/web/styles.css +9 -0
@@ -7,6 +7,7 @@ import type { DataTableTableBlock } from "./data-table-view-types.ts";
7
7
  import type { EmbeddedListInputProps } from "./embedded-list-types.ts";
8
8
  import type { FieldIssue, ListColumnViewModel, ListRowViewModel, RuntimeRenderer } from "./headless/index.ts";
9
9
  import type { MetricBandProps, MetricProps } from "./metric-types.ts";
10
+ import type { RecordBreadcrumbProps, RecordStepsProps, RecordSummaryProps } from "./primitives-record-guidance.ts";
10
11
  import type { StatusBadgeOptionTone, StatusTone } from "./status-tone.ts";
11
12
  export type { EmbeddedListCellType, EmbeddedListColumn, EmbeddedListInputProps, EmbeddedListTotal, } from "./embedded-list-types.ts";
12
13
  export type { RuntimeRenderer };
@@ -110,15 +111,15 @@ export type LinkProps = {
110
111
  * touch the main border edge to edge, which matters because `<main>` no
111
112
  * longer provides its own padding. */
112
113
  export type BannerProps = {
113
- /** "error" for alerts (conflict, network error), "info" for neutral
114
- * placeholders (not-found, loading), "loading" for load states, "warning"
115
- * for a non-blocking but attention-grabbing notice (e.g. secretMint's
116
- * "this is shown only once"), "primary" for a call-to-action notice (neutral
117
- * background, accent in the primary color; pair it with `title` and `actions`),
118
- * "hint" for a quiet aside on a muted background (e.g. per-entry results of
119
- * a submit, with an "Open" link in `actions`), "ok" for a completed state
120
- * (e.g. "Done, nothing left to do here"). */
114
+ /** "error" for alerts (conflict, network error), "info" for neutral placeholders (not-found,
115
+ * loading), "loading" for load states, "warning" for a non-blocking but attention-grabbing
116
+ * notice (e.g. secretMint's "this is shown only once"), "primary" for a call-to-action
117
+ * notice (neutral background, accent in the primary color; pair it with `title` and
118
+ * `actions`), "hint" for a quiet aside on a muted background (e.g. per-entry results of a
119
+ * submit, with an "Open" link in `actions`), "ok" for a completed state (e.g. "Done"). */
121
120
  readonly variant?: "error" | "info" | "loading" | "warning" | "primary" | "hint" | "ok";
121
+ /** Title and text run on one line (text right behind the bold title); the text is dropped below sm, so a phone shows title and actions only. */
122
+ readonly inline?: boolean;
122
123
  /** "compact" is one line: the title reads inline before the text. */
123
124
  readonly density?: "default" | "compact";
124
125
  /** Icon left of the text. */
@@ -640,7 +641,7 @@ export type DataTableSort = {
640
641
  readonly field: string;
641
642
  readonly dir: DataTableSortDir;
642
643
  };
643
- export type DataTableRowActionMode = "adaptive" | "inline";
644
+ export type DataTableRowActionMode = "adaptive" | "inline" | "menu";
644
645
  export type DataTableRowAction = {
645
646
  /** Stable ID for aria-labels and data-testids. */
646
647
  readonly id: string;
@@ -690,6 +691,7 @@ export declare function shouldRenderActionsIconOnly(actions: readonly {
690
691
  export type { BulkRowOutcome, DataTableBulk, DataTableBulkAction, } from "./data-table-bulk-types.ts";
691
692
  export type { DataTableDateRangeFacet, DataTableFacet, DataTableFacetChip, } from "./data-table-facet-types.ts";
692
693
  export type { MetricBandProps, MetricProps } from "./metric-types.ts";
694
+ export type { RecordBreadcrumbProps, RecordStepsProps, RecordSummaryProps, } from "./primitives-record-guidance.ts";
693
695
  export type DataTableProps = {
694
696
  readonly columns: readonly ListColumnViewModel[];
695
697
  readonly rows: readonly ListRowViewModel[];
@@ -702,14 +704,15 @@ export type DataTableProps = {
702
704
  * `onSortChange`, header clicks remain disabled and `columns.sortable` is
703
705
  * only semantic metadata. */
704
706
  readonly sort?: DataTableSort | null;
705
- /** Called with the next sort state after a header click.
706
- * The conventional three-state cycle is asc → desc → null. The caller
707
- * uses it to update URL state or a query parameter and refetch. */
707
+ /** Called with the next sort state after a header click (asc → desc → null);
708
+ * the caller updates URL state or the query parameter and refetches. */
708
709
  readonly onSortChange?: (next: DataTableSort | null) => void;
709
- /** Per-row actions rendered in a right-hand column as inline buttons
710
- * (≤2 actions) or a kebab dropdown (>2). The caller supplies the resolved
711
- * form, with translated labels and wired `onTrigger`; DataTable handles
712
- * only rendering and the confirmation dialog. */
710
+ readonly sortOptions?: readonly (DataTableSort & {
711
+ readonly label: string;
712
+ })[];
713
+ readonly toolbarSort?: true;
714
+ /** Per-row actions in a right-hand column: inline buttons (≤2) or a kebab (>2). The caller supplies
715
+ * translated labels and wired `onTrigger`; DataTable renders and confirms. */
713
716
  readonly rowActions?: readonly DataTableRowAction[];
714
717
  /** How the row-action column renders:
715
718
  * - `"adaptive"` (default): with `onRowClick` all actions except the
@@ -718,7 +721,8 @@ export type DataTableProps = {
718
721
  * kebab (a single action gets no kebab).
719
722
  * - `"inline"`: ALWAYS inline buttons, left-aligned, even with >2 (no
720
723
  * kebab). Actions then sit at the same x-position across all rows
721
- * (no drifting with label width) and all lists in an app look alike. */
724
+ * (no drifting with label width) and all lists in an app look alike.
725
+ * - `"menu"`: every action in the kebab, the row opener included; phone cards draw none. */
722
726
  readonly rowActionMode?: DataTableRowActionMode;
723
727
  /** Present: row checkboxes plus a selection bar that runs these actions once per selected row. */
724
728
  readonly bulk?: DataTableBulk;
@@ -954,16 +958,16 @@ export type SectionProps = {
954
958
  * just a container that sizes to its content and, once the ancestor chain
955
959
  * is height-constrained, shrinks so one scrolling child can scroll
956
960
  * internally instead of the page growing. Web:
957
- * `<div className="flex min-h-0 flex-col">`. Native: Views are
958
- * already flex-column and the parent is already a bounded viewport there,
959
- * so a native impl may render this as a bare Fragment. Used only as the
960
- * terminal link in `RenderEdit`'s `fillHeight` chain (`RelatedListSection`'s
961
- * `hideTitle` branch) — `Section`/`Card` were rejected here because both
962
- * carry title/padding/border chrome this spot doesn't want and would double
963
- * up with the table's own padding. */
961
+ * `<div className="flex min-h-0 flex-col">`. Native: Views are already
962
+ * flex-column in a bounded viewport, so a native impl may render a bare
963
+ * Fragment. Used as the terminal link in `RenderEdit`'s `fillHeight` chain
964
+ * (`RelatedListSection`'s `hideTitle` branch) and as the app layer's only
965
+ * class-carrying layout wrapper, since it must not render DOM tags itself. */
964
966
  export type FillContainerProps = {
965
967
  readonly children: ReactNode;
966
968
  readonly testId?: string;
969
+ /** Layout extras, merged via cn(). */
970
+ readonly className?: string;
967
971
  /** Claims the remaining height of the flex chain (`flex-1`) instead of
968
972
  * sizing to its content, so a footer inside the child sits at the bottom
969
973
  * edge even with few rows. Set only when the screen fills the shell
@@ -1239,12 +1243,12 @@ export type StepBarProps = {
1239
1243
  * labels fit a phone and whose done steps must stay tappable. */
1240
1244
  readonly narrowLayout?: "label" | "steps";
1241
1245
  /** "vertical" renders a step rail (from `lg`, with `compactLabel` as the
1242
- * single line below it) instead of the chip row. Default "horizontal". */
1243
- readonly orientation?: "horizontal" | "vertical";
1246
+ * single line below it); "stacked": plain stage list at every width. Default "horizontal". */
1247
+ readonly orientation?: "horizontal" | "vertical" | "stacked";
1244
1248
  /** Vertical only: rail heading ("Step 4 of 6") and optional description. */
1245
1249
  readonly heading?: string;
1246
1250
  readonly description?: string;
1247
- /** Vertical only: line under each step label, same order as `steps`. */
1251
+ /** Vertical and stacked only: line under each step label, same order as `steps`. */
1248
1252
  readonly subtitles?: readonly (string | undefined)[];
1249
1253
  /** Vertical only: box under the rail announcing the next step. */
1250
1254
  readonly upNext?: {
@@ -1328,13 +1332,13 @@ export type PageHeaderProps = {
1328
1332
  readonly recordTitle?: string;
1329
1333
  readonly status?: ReactNode;
1330
1334
  readonly actions?: ReactNode;
1335
+ /** Screen renders its own h1: the shell header shows only the parent crumb, as text. */
1336
+ readonly bodyTitle?: boolean;
1331
1337
  /** Land in the shell header's overflow menu at phone width. */
1332
1338
  readonly overflowItems?: readonly ActionMenuItemSpec[];
1333
- /** Hide the shell header's breadcrumb while mounted, for a screen that stands in
1334
- * for the one the route names (a locked screen's fallback). */
1339
+ /** Hide the shell header's breadcrumb while mounted (a locked screen's fallback). */
1335
1340
  readonly hideBreadcrumb?: boolean;
1336
- /** Label the breadcrumb with this screen (id as in the route) instead of the one
1337
- * the route names, for a locked screen's fallback. Wins over `hideBreadcrumb`. */
1341
+ /** Label the breadcrumb with this screen (route id) instead of the routed one; wins over `hideBreadcrumb`. */
1338
1342
  readonly breadcrumbScreenId?: string;
1339
1343
  };
1340
1344
  /** One item in an `ActionOverflowMenu` (header/row actions beyond the
@@ -1504,6 +1508,12 @@ export type CorePrimitives = {
1504
1508
  readonly PageHeader?: ComponentType<PageHeaderProps>;
1505
1509
  /** Optional — additive rollout, see StickyActionBar. */
1506
1510
  readonly MetricBand?: ComponentType<MetricBandProps>;
1511
+ /** Optional — without it the detail screen renders the path as plain links. */
1512
+ readonly RecordBreadcrumb?: ComponentType<RecordBreadcrumbProps>;
1513
+ /** Optional — without it the summary renders as plain text. */
1514
+ readonly RecordSummary?: ComponentType<RecordSummaryProps>;
1515
+ /** Optional — without it the steps render as a plain card. */
1516
+ readonly RecordSteps?: ComponentType<RecordStepsProps>;
1507
1517
  /** Optional: without an implementation, callers with >2 header/row
1508
1518
  * actions fall back to today's all-buttons-inline rendering. */
1509
1519
  readonly ActionOverflowMenu?: ComponentType<ActionOverflowMenuProps>;
@@ -0,0 +1,6 @@
1
+ /** Remembers how far the server clock is ahead of the device clock; ignores a missing or invalid header. */
2
+ export declare function noteServerClock(headers: Pick<Headers, "get">): void;
3
+ /** The server's current time, as best known from the last answer. */
4
+ export declare function serverNowMs(): number;
5
+ /** Test seam: forget the offset. */
6
+ export declare function resetServerClock(): void;
@@ -0,0 +1,20 @@
1
+ // A device clock can be minutes off, and "As of 10:42" or "5 minutes ago" must agree with the
2
+ // server's timestamps. The offset comes from the `x-kumiko-now` header (the app clock, which a
3
+ // fixed test or screenshot clock overrides) and otherwise from the HTTP `Date` header; without
4
+ // either (cross-origin answers hide both) the device clock stays.
5
+ const APP_NOW_HEADER = "x-kumiko-now";
6
+ let offsetMs = 0;
7
+ /** Remembers how far the server clock is ahead of the device clock; ignores a missing or invalid header. */
8
+ export function noteServerClock(headers) {
9
+ const serverMs = Date.parse(headers.get(APP_NOW_HEADER) ?? headers.get("date") ?? "");
10
+ if (Number.isFinite(serverMs))
11
+ offsetMs = serverMs - Date.now();
12
+ }
13
+ /** The server's current time, as best known from the last answer. */
14
+ export function serverNowMs() {
15
+ return Date.now() + offsetMs;
16
+ }
17
+ /** Test seam: forget the offset. */
18
+ export function resetServerClock() {
19
+ offsetMs = 0;
20
+ }
@@ -2,6 +2,7 @@ import { type ReactNode } from "react";
2
2
  import type { Dispatcher, DispatcherError } from "../headless/index.ts";
3
3
  export declare const SESSION_ENDED_ERROR_CODES: readonly ["session_invalid", "invalid_token", "missing_token", "unauthenticated"];
4
4
  export declare function isSessionEndedError(error: Pick<DispatcherError, "code" | "httpStatus">): boolean;
5
+ export declare function isSessionEndedCause(thrown: unknown): boolean;
5
6
  export type SessionEndedSignal = {
6
7
  notify(): void;
7
8
  subscribe(listener: () => void): () => void;
@@ -12,7 +12,7 @@ export function isSessionEndedError(error) {
12
12
  return (error.httpStatus === 401 &&
13
13
  SESSION_ENDED_ERROR_CODES.some((sessionEndedCode) => sessionEndedCode === error.code));
14
14
  }
15
- function isSessionEndedThrow(thrown) {
15
+ export function isSessionEndedCause(thrown) {
16
16
  if (typeof thrown !== "object" || thrown === null)
17
17
  return false;
18
18
  if (!("code" in thrown) || !("httpStatus" in thrown))
@@ -54,7 +54,7 @@ export function withSessionEndedDetection(dispatcher, signal) {
54
54
  yield* dispatcher.stream(type, payload, opts);
55
55
  }
56
56
  catch (thrown) {
57
- if (isSessionEndedThrow(thrown))
57
+ if (isSessionEndedCause(thrown))
58
58
  signal.notify();
59
59
  throw thrown;
60
60
  }
@@ -4,3 +4,4 @@ export type StatusTone = "ok" | "warn" | "bad" | "critical" | "muted";
4
4
  export type StatusBadgeOptionTone = StatusTone | "accent";
5
5
  export declare function statusToneForOptionTone(tone: SelectOptionTone): StatusBadgeOptionTone | undefined;
6
6
  export declare function statusToneForValue(value: string): StatusTone | undefined;
7
+ export declare function isSelectOptionTone(value: unknown): value is SelectOptionTone;
@@ -1,3 +1,5 @@
1
+ import { SELECT_OPTION_TONES } from "@cosmicdrift/kumiko-types/fields";
2
+ import { isOneOf } from "@cosmicdrift/kumiko-types/type-guards";
1
3
  // Status value -> StatusTone heuristic, shared by every surface that shows a
2
4
  // raw status value without a tone of its own (projectionDetail header badge,
3
5
  // list cells). Covers the common status vocabularies; unknown values stay
@@ -49,3 +51,6 @@ export function statusToneForValue(value) {
49
51
  // would hand back `Object.prototype.constructor` & friends as a "tone".
50
52
  return Object.hasOwn(STATUS_TONE_BY_VALUE, slug) ? STATUS_TONE_BY_VALUE[slug] : undefined;
51
53
  }
54
+ export function isSelectOptionTone(value) {
55
+ return isOneOf(SELECT_OPTION_TONES, value);
56
+ }
@@ -54,7 +54,7 @@ export function createBrowserLocaleResolver(options = {}) {
54
54
  const timeZone = detectTimeZone();
55
55
  return {
56
56
  translate: (key) => key,
57
- locale: () => store.getSnapshot(), // @wrapper-known semantic-alias
57
+ locale: () => store.getSnapshot(),
58
58
  timeZone: () => timeZone,
59
59
  subscribe: store.subscribe,
60
60
  setLocale: (next) => {
@@ -1,7 +1,7 @@
1
1
  import type { TargetRef, TreeChildrenSubscribe } from "@cosmicdrift/kumiko-framework/engine";
2
2
  import type { ContentEditorFormat } from "@cosmicdrift/kumiko-types/nav";
3
3
  import type { ComponentType, ReactNode } from "react";
4
- import type { ClientActionHandler, ColumnRendererComponent, ContentEditorComponent, ExtensionSectionComponent, QualifiedContentCollection, TranslationsByLocale } from "../../index.ts";
4
+ import type { ClientActionHandler, ColumnRendererComponent, ContentEditorComponent, ContentPreviewsMap, ExtensionSectionComponent, QualifiedContentCollection, TranslationsByLocale } from "../../index.ts";
5
5
  /** What a `navProvidersFromCollections` factory returns: the providers plus
6
6
  * the entities whose live events should re-fire them. Without `entities` a
7
7
  * derived tree would sit stale until re-mount — the hand-wired path has the
@@ -80,6 +80,11 @@ export type ClientFeatureDefinition = {
80
80
  * format. Same last-wins semantics as columnRenderers. Public component
81
81
  * contract: `{ value, onChange, variables, readOnly }`. */
82
82
  readonly contentEditors?: Partial<Record<ContentEditorFormat, ContentEditorComponent>>;
83
+ /** Preview renderers for the editor workbench's preview mode, keyed by target
84
+ * ("pdf" | "mail" | "web" | "text"). Each renderer calls its own server path with its own
85
+ * access rule. A target without a renderer falls back to "text". Same last-wins
86
+ * semantics as contentEditors. */
87
+ readonly contentPreviews?: ContentPreviewsMap;
83
88
  /** Editor resolver components keyed by featureId:action. When a TreeNode
84
89
  * with a target is clicked, EditorPanel looks up and renders the component
85
90
  * here. Components receive target (with args) and an onClose callback. If
@@ -2,7 +2,7 @@ import type { TreeChildrenSubscribe } from "@cosmicdrift/kumiko-framework/engine
2
2
  import { type ErrorInfo, type ReactNode } from "react";
3
3
  import { type Root } from "react-dom/client";
4
4
  import type { Dispatcher, ListRowViewModel, LocaleResolver, Translate } from "../../headless/index.ts";
5
- import { type AppSchema, type ContentEditorComponent, type DraftStorage, type FeatureSchema, type FormWidth, type NavApi, type PrimitivesRegistry, type QualifiedContentCollection } from "../../index.ts";
5
+ import { type AppSchema, type ContentEditorComponent, type ContentPreviewsMap, type DraftStorage, type FeatureSchema, type FormWidth, type NavApi, type PrimitivesRegistry, type QualifiedContentCollection } from "../../index.ts";
6
6
  import { type ClientFeatureDefinition } from "./client-plugin.tsx";
7
7
  export declare function qualifyNavProviderKey(feature: string, id: string): string;
8
8
  export declare function buildNavProviderMaps(clientFeatures: readonly ClientFeatureDefinition[], collections: readonly QualifiedContentCollection[]): {
@@ -109,6 +109,7 @@ export declare function firstOpenScreenQn(features: readonly FeatureSchema[]): s
109
109
  export declare function firstLandingScreenQnForProjectedSchema(features: readonly FeatureSchema[]): string | undefined;
110
110
  export declare function resolveRootScreenQn(features: readonly FeatureSchema[], explicitScreenQn: string | undefined, schemaIsRoleProjected: boolean): string | undefined;
111
111
  export declare function mergeContentEditors(clientFeatures: readonly ClientFeatureDefinition[]): Record<string, ContentEditorComponent>;
112
+ export declare function mergeContentPreviews(clientFeatures: readonly ClientFeatureDefinition[]): ContentPreviewsMap;
112
113
  export declare function createKumikoApp(options?: CreateKumikoAppOptions): {
113
114
  readonly root: Root;
114
115
  };
@@ -3,12 +3,14 @@ import { isOpenToAllGranted } from "@cosmicdrift/kumiko-framework/ui-types";
3
3
  import { createContext, useContext, useEffect, useMemo, useRef, useState, } from "react";
4
4
  import { createRoot } from "react-dom/client";
5
5
  import { rendererError, rendererWarn } from "../../dev-console.js";
6
- import { AppFeaturesProvider, BasePathProvider, ClientActionsProvider, ColumnRenderersProvider, ContentEditorsProvider, CustomScreensProvider, createSessionEndedSignal, DashboardBodyProvider, DispatcherProvider, DraftStorageProvider, ErrorBoundary, ExtensionSectionsProvider, hasDetailScreen, KumikoScreen, kumikoDefaultTranslations, LeaveGuardDialog, LiveEventsProvider, LocaleProvider, mergeTranslations, NavProvider, navigateWithReturnTo, PrimitivesProvider, qualifyScreenId, ScreenMissingState, SessionEndedSignalProvider, TokensProvider, toAppSchema, translationsByLocaleFromKeys, useBasePath, useNav, usePrimitives, useTranslation, withSessionEndedDetection, } from "../../index.js";
6
+ import { AppFeaturesProvider, BasePathProvider, ClientActionsProvider, ColumnRenderersProvider, ContentEditorsProvider, ContentPreviewsProvider, CustomScreensProvider, createSessionEndedSignal, DashboardBodyProvider, DispatcherProvider, DraftStorageProvider, ErrorBoundary, ExtensionSectionsProvider, hasDetailScreen, KumikoScreen, kumikoDefaultTranslations, LeaveGuardDialog, LiveEventsProvider, LocaleProvider, mergeTranslations, NavProvider, navigateWithReturnTo, PrimitivesProvider, qualifyScreenId, ScreenMissingState, SessionEndedSignalProvider, TokensProvider, toAppSchema, translationsByLocaleFromKeys, useBasePath, useNav, usePrimitives, useTranslation, withSessionEndedDetection, } from "../../index.js";
7
7
  import { createLiveDispatcher } from "../../live/index.js";
8
8
  import { lastSegment } from "../layout/nav-tree.js";
9
+ import { ScreenFocus } from "../layout/screen-focus.js";
9
10
  import { clearFileMetaCache } from "../primitives/file-thumbnail.js";
10
11
  import { defaultPrimitives, ScreenWidthProvider } from "../primitives/index.js";
11
12
  import { ToastProvider } from "../primitives/toast.js";
13
+ import { PwaSupport } from "../pwa/pwa-support.js";
12
14
  import { createEventSourceLiveEvents } from "../sse/live-events.js";
13
15
  import { useBrowserTokensApi } from "../tokens.js";
14
16
  import { UpdateChecker } from "../version/update-checker.js";
@@ -161,7 +163,8 @@ function mergeByKey(clientFeatures, pick, label) {
161
163
  if (entries === undefined)
162
164
  continue;
163
165
  for (const [key, value] of Object.entries(entries)) {
164
- if (merged[key] !== undefined) {
166
+ // The same value registered by two plugins (a shared preview renderer) is no override.
167
+ if (merged[key] !== undefined && merged[key] !== value) {
165
168
  rendererWarn(`[kumiko] ${label} "${key}" defined by multiple clientFeatures — last definition (from "${f.name}") wins.`);
166
169
  }
167
170
  merged[key] = value;
@@ -175,6 +178,11 @@ function mergeByKey(clientFeatures, pick, label) {
175
178
  export function mergeContentEditors(clientFeatures) {
176
179
  return mergeByKey(clientFeatures, (f) => f.contentEditors, "contentEditor");
177
180
  }
181
+ // Merges the preview-renderer map; a target without an entry renders through the "text"
182
+ // fallback of useContentPreview.
183
+ export function mergeContentPreviews(clientFeatures) {
184
+ return mergeByKey(clientFeatures, (f) => f.contentPreviews, "contentPreview");
185
+ }
178
186
  // Fail loud at boot instead of per-URL: a mounted server feature can
179
187
  // declare a `type: "custom"` screen that's reachable directly by URL
180
188
  // even without nav placement — without this check, a missing client
@@ -238,7 +246,7 @@ function KumikoAppRoot(props) {
238
246
  warnMissingCustomScreens(loaded, props.customScreens);
239
247
  setApp(loaded);
240
248
  }, schemaIsRoleProjected: isFetchMode, ...(isFetchMode && { onUnmountResetSchema: () => setApp(undefined) }), ...(props.translate !== undefined && { translate: props.translate }), ...(props.onRowClick !== undefined && { onRowClick: props.onRowClick }), ...(props.shell !== undefined && { shell: props.shell }) }));
241
- return (_jsx(TokensBoot, { children: _jsxs(LocaleProvider, { resolver: props.localeResolver, fallbackBundles: fallbackBundles, children: [_jsx(DocumentLangSync, { resolver: props.localeResolver }), _jsx(PrimitivesProvider, { value: props.primitives, children: _jsx(ScreenWidthProvider, { width: props.screenWidth, children: _jsx(AppFeaturesProvider, { features: app?.features ?? EMPTY_FEATURES, children: _jsx(DispatcherProvider, { dispatcher: props.dispatcher, children: _jsx(DraftStorageProvider, { value: props.draftStorage, children: _jsx(LiveEventsProvider, { value: props.liveEvents, children: _jsx(DashboardBodyProvider, { value: WebDashboardBody, children: _jsx(CustomScreensProvider, { value: props.customScreens, children: _jsx(ColumnRenderersProvider, { value: props.columnRenderers, children: _jsx(ContentEditorsProvider, { value: props.contentEditors, children: _jsx(ExtensionSectionsProvider, { value: props.extensionSectionComponents, children: _jsx(ClientActionsProvider, { value: props.clientActions, children: _jsx(NavProvidersProvider, { value: navProviders, entities: navEntities, children: _jsx(ResolversProvider, { resolvers: props.resolvers, children: _jsx(ToastProvider, { children: _jsxs(ToastActionNotifier, { children: [_jsx(UpdateChecker, {}), _jsx(LeaveGuardDialog, {}), _jsx(SessionEndedSignalProvider, { signal: props.sessionEndedSignal, children: stackWrappers(props.providers, stackWrappers(props.gates, _jsx(ListStateStoreBoot, { children: screenNode }))) })] }) }) }) }) }) }) }) }) }) }) }) }) }) }) }) })] }) }));
249
+ return (_jsx(TokensBoot, { children: _jsxs(LocaleProvider, { resolver: props.localeResolver, fallbackBundles: fallbackBundles, children: [_jsx(DocumentLangSync, { resolver: props.localeResolver }), _jsx(PrimitivesProvider, { value: props.primitives, children: _jsx(ScreenWidthProvider, { width: props.screenWidth, children: _jsx(AppFeaturesProvider, { features: app?.features ?? EMPTY_FEATURES, children: _jsx(DispatcherProvider, { dispatcher: props.dispatcher, children: _jsx(DraftStorageProvider, { value: props.draftStorage, children: _jsx(LiveEventsProvider, { value: props.liveEvents, children: _jsx(DashboardBodyProvider, { value: WebDashboardBody, children: _jsx(CustomScreensProvider, { value: props.customScreens, children: _jsx(ColumnRenderersProvider, { value: props.columnRenderers, children: _jsx(ContentEditorsProvider, { value: props.contentEditors, children: _jsx(ContentPreviewsProvider, { value: props.contentPreviews, children: _jsx(ExtensionSectionsProvider, { value: props.extensionSectionComponents, children: _jsx(ClientActionsProvider, { value: props.clientActions, children: _jsx(NavProvidersProvider, { value: navProviders, entities: navEntities, children: _jsx(ResolversProvider, { resolvers: props.resolvers, children: _jsx(ToastProvider, { children: _jsxs(ToastActionNotifier, { children: [_jsx(UpdateChecker, {}), _jsx(PwaSupport, {}), _jsx(LeaveGuardDialog, {}), _jsx(SessionEndedSignalProvider, { signal: props.sessionEndedSignal, children: stackWrappers(props.providers, stackWrappers(props.gates, _jsx(ListStateStoreBoot, { children: screenNode }))) })] }) }) }) }) }) }) }) }) }) }) }) }) }) }) }) }) })] }) }));
242
250
  }
243
251
  // Sits INSIDE the clientFeature gates (e.g. an auth gate) — a gate that
244
252
  // renders a login placeholder instead of children keeps this component
@@ -332,6 +340,7 @@ export function createKumikoApp(options = {}) {
332
340
  const extensionSectionComponents = mergeByKey(clientFeatures, (f) => f.extensionSectionComponents, "extensionSectionComponent");
333
341
  const clientActions = mergeByKey(clientFeatures, (f) => f.clientActions, "clientAction");
334
342
  const contentEditors = mergeContentEditors(clientFeatures);
343
+ const contentPreviews = mergeContentPreviews(clientFeatures);
335
344
  // Aggregate editor resolvers — keyed by "featureId:action". Same
336
345
  // last-wins semantics as columnRenderers. Warns on collision.
337
346
  const resolvers = new Map();
@@ -360,7 +369,7 @@ export function createKumikoApp(options = {}) {
360
369
  options.onError?.(error, info, context);
361
370
  };
362
371
  const root = createRoot(container);
363
- root.render(_jsx(ErrorBoundary, { scope: "root", onError: handleBoundaryError, fallback: ({ errorId }) => _jsx(RootErrorFallback, { errorId: errorId }), children: _jsx(BoundaryErrorHandlerContext.Provider, { value: handleBoundaryError, children: _jsx(BasePathProvider, { basePath: basePath, children: _jsx(KumikoAppRoot, { initialApp: initialApp, screenQn: options.screenQn, ...(options.schemaUrl !== undefined && { schemaUrl: options.schemaUrl }), clientFeatures: clientFeatures, providers: providers, gates: gates, customScreens: customScreens, columnRenderers: columnRenderers, extensionSectionComponents: extensionSectionComponents, clientActions: clientActions, contentEditors: contentEditors, resolvers: resolvers, dispatcher: dispatcher, sessionEndedSignal: sessionEndedSignal, draftStorage: draftStorage, primitives: primitives, liveEvents: liveEvents, localeResolver: localeResolver, navAdapter: navAdapter, screenWidth: options.screenWidth, ...(options.translate !== undefined && { translate: options.translate }), ...(options.onRowClick !== undefined && { onRowClick: options.onRowClick }), ...(options.shell !== undefined && { shell: options.shell }) }) }) }) }));
372
+ root.render(_jsx(ErrorBoundary, { scope: "root", onError: handleBoundaryError, fallback: ({ errorId }) => _jsx(RootErrorFallback, { errorId: errorId }), children: _jsx(BoundaryErrorHandlerContext.Provider, { value: handleBoundaryError, children: _jsx(BasePathProvider, { basePath: basePath, children: _jsx(KumikoAppRoot, { initialApp: initialApp, screenQn: options.screenQn, ...(options.schemaUrl !== undefined && { schemaUrl: options.schemaUrl }), clientFeatures: clientFeatures, providers: providers, gates: gates, customScreens: customScreens, columnRenderers: columnRenderers, extensionSectionComponents: extensionSectionComponents, clientActions: clientActions, contentEditors: contentEditors, contentPreviews: contentPreviews, resolvers: resolvers, dispatcher: dispatcher, sessionEndedSignal: sessionEndedSignal, draftStorage: draftStorage, primitives: primitives, liveEvents: liveEvents, localeResolver: localeResolver, navAdapter: navAdapter, screenWidth: options.screenWidth, ...(options.translate !== undefined && { translate: options.translate }), ...(options.onRowClick !== undefined && { onRowClick: options.onRowClick }), ...(options.shell !== undefined && { shell: options.shell }) }) }) }) }));
364
373
  return { root };
365
374
  }
366
375
  // TokensBoot uses the browser-backed TokensApi hook (class-based
@@ -454,6 +463,7 @@ function RoutedScreen({ app, fallbackQn, translate, onRowClick, }) {
454
463
  activeScreen: ownerFeature?.screens.find((s) => qualifyScreenId(ownerFeature.featureName, s.id) === qualifiedQn),
455
464
  };
456
465
  }, [nav.route, app, fallbackQn]);
466
+ const allScreens = useMemo(() => app.features.flatMap((f) => f.screens), [app.features]);
457
467
  const effectiveOnRowClick = useMemo(() => {
458
468
  if (!hasRowClickTarget(app, activeScreen, onRowClick))
459
469
  return undefined;
@@ -516,5 +526,5 @@ function RoutedScreen({ app, fallbackQn, translate, onRowClick, }) {
516
526
  const schemaForScreen = feature;
517
527
  return (_jsx(ErrorBoundary, { scope: "screen", ...(onBoundaryError !== undefined && {
518
528
  onError: (error, info, context) => onBoundaryError(error, info, { ...context, screen: qn }),
519
- }), fallback: ({ error, errorId, reset }) => (_jsx(ScreenErrorFallback, { screen: qn, error: error, errorId: errorId, onReset: reset })), children: _jsx(KumikoScreen, { schema: schemaForScreen, qn: qn, ...(translate !== undefined && { translate }), ...(entityId !== undefined && { entityId }), onRowClick: effectiveOnRowClick, ...(effectiveOnCopyLink !== undefined && { onCopyLink: effectiveOnCopyLink }) }) }, `${qn}/${entityId ?? ""}`));
529
+ }), fallback: ({ error, errorId, reset }) => (_jsx(ScreenErrorFallback, { screen: qn, error: error, errorId: errorId, onReset: reset })), children: _jsx(ScreenFocus, { screen: activeScreen, screens: allScreens, children: _jsx(KumikoScreen, { schema: schemaForScreen, qn: qn, ...(translate !== undefined && { translate }), ...(entityId !== undefined && { entityId }), onRowClick: effectiveOnRowClick, ...(effectiveOnCopyLink !== undefined && { onCopyLink: effectiveOnCopyLink }) }) }) }, `${qn}/${entityId ?? ""}`));
520
530
  }
@@ -1,17 +1,29 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { useNav, usePageHeaderCompact, usePageHeaderSlotAvailable, usePrimitives, useTranslation, } from "../../index.js";
3
3
  import { PageSection } from "../primitives/layout.js";
4
+ import { useIsBelowSmViewport } from "../primitives/use-narrow-viewport.js";
4
5
  import { buildScopeBadge, dashboardDescription, recordTitleText, renderActionErrorBanner, renderDescriptionAndNotice, renderHeaderActionsBar, renderPageHeaderSlot, renderRecordError, renderRecordMissing, renderTitleRow, } from "./dashboard-header.js";
5
- import { ChartPanelBody, CustomPanelBody, FeedPanelBody, ListPanelBody, ProgressListPanelBody, StatGroupPanelBody, StatPanelBody, TextPanelBody, } from "./dashboard-panels.js";
6
+ import { ListPanelBody } from "./dashboard-list-panel.js";
7
+ import { HiddenOnNarrow } from "./dashboard-narrow-gate.js";
8
+ import { panelsInNarrowOrder } from "./dashboard-narrow-order.js";
9
+ import { ChartPanelBody, CustomPanelBody, FeedPanelBody, ProgressListPanelBody, StatPanelBody, } from "./dashboard-panels.js";
6
10
  import { ScreenPanelTile } from "./dashboard-screen-tiles.js";
7
- import { DashboardQueryContext, HALF_PANEL, PanelLoadedContext, useDashboardFormats, WIDE_PANEL, } from "./dashboard-shared.js";
11
+ import { DashboardQueryContext, HALF_PANEL, PanelLoadedContext, STAT_PANEL, THIRD_PANEL, TWO_THIRDS_PANEL, useDashboardFormats, WIDE_PANEL, } from "./dashboard-shared.js";
12
+ import { StatGroupPanelBody } from "./dashboard-stat-group-panel.js";
13
+ import { TextPanelBody } from "./dashboard-text-panel.js";
8
14
  import { GatedGridCell, useDashboardVisibility, VisibilityGateQueries, VisibilityQueryContext, } from "./dashboard-visibility.js";
9
15
  import { useDashboardHeaderActions, useDashboardRecord, useDashboardScreenParams, } from "./use-dashboard-screen-state.js";
16
+ const SPAN_CLASS_NAMES = {
17
+ half: HALF_PANEL,
18
+ full: WIDE_PANEL,
19
+ third: THIRD_PANEL,
20
+ "two-thirds": TWO_THIRDS_PANEL,
21
+ };
10
22
  function panelSpanClassName(panel) {
11
23
  if (panel.kind === "stat")
12
- return undefined;
24
+ return STAT_PANEL;
13
25
  if ("span" in panel && panel.span !== undefined)
14
- return panel.span === "half" ? HALF_PANEL : WIDE_PANEL;
26
+ return SPAN_CLASS_NAMES[panel.span];
15
27
  if (panel.kind === "feed" || panel.kind === "progress-list")
16
28
  return HALF_PANEL;
17
29
  return WIDE_PANEL;
@@ -36,22 +48,22 @@ function PanelBody({ panel, label, featureName, screenId, screenParams, translat
36
48
  return (_jsx(ChartPanelBody, { panel: panel, label: text, screenParams: screenParams, translate: translate }));
37
49
  }
38
50
  if (panel.kind === "list") {
39
- return (_jsx(ListPanelBody, { panel: panel, label: text, featureName: featureName, screenParams: screenParams, translate: translate }));
51
+ return (_jsx(ListPanelBody, { panel: panel, label: text, featureName: featureName, screenId: screenId, screenParams: screenParams, translate: translate }));
40
52
  }
41
53
  if (panel.kind === "feed") {
42
54
  return (_jsx(FeedPanelBody, { panel: panel, label: text, screenParams: screenParams, translate: translate }));
43
55
  }
44
56
  if (panel.kind === "text") {
45
- return _jsx(TextPanelBody, { panel: panel, label: label, translate: translate });
57
+ return (_jsx(TextPanelBody, { panel: panel, label: label, screenParams: screenParams, translate: translate }));
46
58
  }
47
59
  return (_jsx(ProgressListPanelBody, { panel: panel, label: text, screenParams: screenParams, translate: translate }));
48
60
  }
49
61
  function renderDashboardPanel(panel, featureName, screenId, screenParams, translate) {
50
62
  if (panel.kind === "screen") {
51
- return (_jsx(ScreenPanelTile, { panel: panel, featureName: featureName, recordId: screenParams.recordId, translate: translate }, panel.id));
63
+ return (_jsx(HiddenOnNarrow, { hide: panel.hideOnNarrow === true, children: _jsx(ScreenPanelTile, { panel: panel, featureName: featureName, recordId: screenParams.recordId, translate: translate }) }, panel.id));
52
64
  }
53
65
  const label = panel.kind === "custom" || panel.label === undefined ? undefined : translate(panel.label);
54
- return (_jsx(GatedGridCell, { panel: panel, screenParams: screenParams, label: label ?? panel.id, className: panelSpanClassName(panel), children: _jsx(PanelBody, { panel: panel, label: label, featureName: featureName, screenId: screenId, screenParams: screenParams, translate: translate }) }, panel.id));
66
+ return (_jsx(HiddenOnNarrow, { hide: panel.hideOnNarrow === true, children: _jsx(GatedGridCell, { panel: panel, screenParams: screenParams, label: label ?? panel.id, className: panelSpanClassName(panel), children: _jsx(PanelBody, { panel: panel, label: label, featureName: featureName, screenId: screenId, screenParams: screenParams, translate: translate }) }) }, panel.id));
55
67
  }
56
68
  export function WebDashboardBody({ featureName, screen, translate, }) {
57
69
  const t = useTranslation();
@@ -60,7 +72,8 @@ export function WebDashboardBody({ featureName, screen, translate, }) {
60
72
  const nav = useNav();
61
73
  const headerSlotAvailable = usePageHeaderSlotAvailable();
62
74
  const headerCompactContext = usePageHeaderCompact();
63
- const { formatDateTime } = useDashboardFormats();
75
+ const { formatLongDate } = useDashboardFormats();
76
+ const belowSm = useIsBelowSmViewport();
64
77
  const params = useDashboardScreenParams(screen, effectiveTranslate, nav);
65
78
  const { screenParams } = params;
66
79
  const visibility = useDashboardVisibility(screen.panels, screenParams);
@@ -87,10 +100,11 @@ export function WebDashboardBody({ featureName, screen, translate, }) {
87
100
  picker: params.picker,
88
101
  rangeControl: params.rangeControl,
89
102
  loadedAtMs: params.loadedAtMs,
90
- formatDateTime,
103
+ formatLongDate,
104
+ belowSm,
91
105
  };
92
106
  const headerActionsBar = renderHeaderActionsBar(model);
93
107
  // The shell header owns the title; the badge and the actions sit in it there.
94
108
  const badgeInHeader = scopeBadge !== null && usesPageHeaderSlot;
95
- return (_jsx(PanelLoadedContext.Provider, { value: params.reportLoaded, children: _jsx(DashboardQueryContext.Provider, { value: record.queryRuntime, children: _jsxs(PageSection, { className: "flex flex-col gap-4", testId: `dashboard-${screen.id}`, children: [renderPageHeaderSlot(model, headerActionsBar, badgeInHeader), renderTitleRow(model, headerActionsBar, badgeInHeader), renderActionErrorBanner(primitives, actionError), renderRecordError(model, recordQuery.error, recordRow, refetchRecord), renderDescriptionAndNotice(model, description), _jsxs(VisibilityQueryContext.Provider, { value: visibility.gateResultsWithPending, children: [_jsx(VisibilityGateQueries, { gates: visibility.visibilityGates, onResult: visibility.gateResults.report, onForget: visibility.gateResults.forget }), _jsx("div", { className: "grid grid-cols-1 gap-4 sm:grid-cols-2 lg:grid-cols-4", children: screen.panels.map((panel) => renderDashboardPanel(panel, featureName, screen.id, screenParams, effectiveTranslate)) })] })] }) }) }));
109
+ return (_jsx(PanelLoadedContext.Provider, { value: params.reportLoaded, children: _jsx(DashboardQueryContext.Provider, { value: record.queryRuntime, children: _jsxs(PageSection, { className: "flex flex-col gap-4", testId: `dashboard-${screen.id}`, children: [renderPageHeaderSlot(model, headerActionsBar, badgeInHeader), renderTitleRow(model, headerActionsBar, badgeInHeader), renderActionErrorBanner(primitives, actionError), renderRecordError(model, recordQuery.error, recordRow, refetchRecord), renderDescriptionAndNotice(model, description), _jsxs(VisibilityQueryContext.Provider, { value: visibility.gateResultsWithPending, children: [_jsx(VisibilityGateQueries, { gates: visibility.visibilityGates, onResult: visibility.gateResults.report, onForget: visibility.gateResults.forget }), _jsx("div", { className: "grid grid-cols-1 gap-4 sm:grid-cols-2 lg:grid-cols-12", children: panelsInNarrowOrder(screen.panels, belowSm).map((panel) => renderDashboardPanel(panel, featureName, screen.id, screenParams, effectiveTranslate)) })] })] }) }) }));
96
110
  }
@@ -19,7 +19,8 @@ export type DashboardHeaderModel = {
19
19
  readonly picker: ReactNode;
20
20
  readonly rangeControl: ReactNode;
21
21
  readonly loadedAtMs: ReturnType<typeof useLoadedAt>["loadedAtMs"];
22
- readonly formatDateTime: ReturnType<typeof useDashboardFormats>["formatDateTime"];
22
+ readonly formatLongDate: ReturnType<typeof useDashboardFormats>["formatLongDate"];
23
+ readonly belowSm: boolean;
23
24
  };
24
25
  export declare function recordTitleText(row: Readonly<Record<string, unknown>> | null, field: string | undefined): string | undefined;
25
26
  export declare function buildScopeBadge(screen: DashboardScreenDefinition, translate: Translate): ReactNode;
@@ -31,16 +31,19 @@ export function renderHeaderActionsBar(model) {
31
31
  export function renderPageHeaderSlot(model, headerActionsBar, badgeInHeader) {
32
32
  const { PageHeader } = model.primitives;
33
33
  const { recordTitle, scopeBadge, usesPageHeaderSlot } = model;
34
- const showPageHeader = usesPageHeaderSlot && (badgeInHeader || recordTitle !== undefined || headerActionsBar !== null);
34
+ // The stamp is hidden below sm; counting it there would leave an empty header bar.
35
+ const dateStamp = usesPageHeaderSlot && !model.belowSm ? renderDateStamp(model) : null;
36
+ const showPageHeader = usesPageHeaderSlot &&
37
+ (badgeInHeader || dateStamp !== null || recordTitle !== undefined || headerActionsBar !== null);
35
38
  return (showPageHeader &&
36
- PageHeader !== undefined && (_jsx(PageHeader, { ...(recordTitle !== undefined && { title: recordTitle }), ...(badgeInHeader && { status: scopeBadge }), ...(headerActionsBar !== null && { actions: headerActionsBar }) })));
39
+ PageHeader !== undefined && (_jsx(PageHeader, { ...(recordTitle !== undefined && { title: recordTitle }), ...((badgeInHeader || dateStamp !== null) && {
40
+ status: (_jsxs(_Fragment, { children: [badgeInHeader && scopeBadge, dateStamp] })),
41
+ }), ...(headerActionsBar !== null && { actions: headerActionsBar }) })));
37
42
  }
38
43
  export function renderTitleRow(model, headerActionsBar, badgeInHeader) {
39
44
  const { Heading } = model.primitives;
40
45
  const { screen, usesPageHeaderSlot, recordTitle, scopeBadge, picker, rangeControl } = model;
41
- return (_jsxs("div", { className: "flex flex-wrap items-end justify-between gap-3", children: [_jsxs("div", { className: "flex min-w-0 flex-wrap items-center gap-2", children: [!usesPageHeaderSlot && recordTitle !== undefined && (_jsx(Heading, { variant: "page", testId: `dashboard-${screen.id}-record-title`, children: recordTitle })), !badgeInHeader && scopeBadge, picker] }), _jsxs("div", { className: "flex flex-wrap items-center gap-3", children: [!usesPageHeaderSlot && headerActionsBar, screen.showUpdatedAt !== false && hasDataPanel(screen.panels) && (_jsx("span", { "data-testid": `dashboard-${screen.id}-updated-at`, className: "text-xs tabular-nums text-muted-foreground", children: model.t("kumiko.dashboard.updated-at", {
42
- time: model.formatDateTime(model.loadedAtMs),
43
- }) })), rangeControl] })] }));
46
+ return (_jsxs("div", { className: "flex flex-wrap items-end justify-between gap-3", children: [_jsxs("div", { className: "flex min-w-0 flex-wrap items-center gap-2", children: [!usesPageHeaderSlot && recordTitle !== undefined && (_jsx(Heading, { variant: "page", testId: `dashboard-${screen.id}-record-title`, children: recordTitle })), !badgeInHeader && scopeBadge, picker] }), _jsxs("div", { className: "flex flex-wrap items-center gap-3", children: [!usesPageHeaderSlot && headerActionsBar, !usesPageHeaderSlot && renderDateStamp(model), rangeControl] })] }));
44
47
  }
45
48
  export function renderActionErrorBanner(primitives, actionError) {
46
49
  const { Banner } = primitives;
@@ -51,9 +54,18 @@ export function renderRecordError(model, error, recordRow, refetchRecord) {
51
54
  return (error !== null &&
52
55
  recordRow === null && (_jsxs("div", { role: "alert", "data-testid": `dashboard-${model.screen.id}-record-error`, className: "flex flex-col items-start gap-2 text-sm", children: [_jsx("span", { className: "text-status-bad", children: dispatcherErrorText(error, model.t) }), _jsx(Button, { variant: "secondary", onClick: () => void refetchRecord(), children: model.t("kumiko.dashboard.panel.error.retry") })] })));
53
56
  }
54
- // A dashboard that only embeds screens loads no data of its own, so "Stand" would say nothing.
57
+ // The server clock's day, not the device's: it moves with the answers the panels load.
58
+ // A dashboard that only embeds screens loads no data of its own, so a date would say nothing.
59
+ function renderDateStamp(model) {
60
+ const { screen } = model;
61
+ if (screen.showUpdatedAt === false || !hasDataPanel(screen.panels))
62
+ return null;
63
+ return (_jsx("span", { "data-testid": `dashboard-${screen.id}-updated-at`, className: "whitespace-nowrap text-sm text-muted-foreground max-sm:hidden", children: model.formatLongDate(model.loadedAtMs) }));
64
+ }
55
65
  function hasDataPanel(panels) {
56
- return panels.some((panel) => panel.kind !== "screen" && panel.kind !== "text" && panel.kind !== "custom");
66
+ return panels.some((panel) => panel.kind === "text"
67
+ ? panel.query !== undefined
68
+ : panel.kind !== "screen" && panel.kind !== "custom");
57
69
  }
58
70
  export function renderDescriptionAndNotice(model, description) {
59
71
  const { Text, Banner } = model.primitives;
@@ -0,0 +1,12 @@
1
+ import type { DashboardListPanel } from "@cosmicdrift/kumiko-framework/ui-types";
2
+ import type { ReactNode } from "react";
3
+ import type { Translate } from "../../headless/index.ts";
4
+ import { type ScreenParams } from "./dashboard-shared.tsx";
5
+ export declare function ListPanelBody({ panel, label, featureName, screenId, screenParams, translate, }: {
6
+ readonly panel: DashboardListPanel;
7
+ readonly label: string;
8
+ readonly featureName: string;
9
+ readonly screenId: string;
10
+ readonly screenParams: ScreenParams;
11
+ readonly translate: Translate;
12
+ }): ReactNode;