@cosmicdrift/kumiko-renderer 0.373.0 → 0.377.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 (466) hide show
  1. package/README.md +2 -2
  2. package/dist/app/action-form-support.d.ts +58 -0
  3. package/dist/app/action-form-support.js +96 -0
  4. package/dist/app/client-actions.d.ts +46 -0
  5. package/dist/app/client-actions.js +60 -0
  6. package/dist/app/column-renderers.js +1 -1
  7. package/dist/app/config-edit-shim.js +1 -1
  8. package/dist/app/content-preview.js +1 -6
  9. package/dist/app/custom-screens.js +1 -1
  10. package/dist/app/dashboard-body.d.ts +1 -1
  11. package/dist/app/entity-list-expanded-row.d.ts +1 -1
  12. package/dist/app/entity-list-expanded-row.js +4 -0
  13. package/dist/app/form-schema.d.ts +1 -1
  14. package/dist/app/form-schema.js +2 -2
  15. package/dist/app/header-actions-bar.d.ts +19 -0
  16. package/dist/app/header-actions-bar.js +30 -0
  17. package/dist/app/kumiko-screen.d.ts +1 -1
  18. package/dist/app/kumiko-screen.js +134 -66
  19. package/dist/app/list-empty-content.d.ts +2 -2
  20. package/dist/app/list-empty-content.js +3 -2
  21. package/dist/app/list-facets.d.ts +1 -1
  22. package/dist/app/nav.js +2 -2
  23. package/dist/app/query-state-banners.d.ts +1 -1
  24. package/dist/app/reference-link.d.ts +1 -1
  25. package/dist/app/row-actions.d.ts +10 -2
  26. package/dist/app/row-actions.js +85 -6
  27. package/dist/app/secret-mint-body.d.ts +1 -1
  28. package/dist/app/secrets-edit-body.d.ts +1 -1
  29. package/dist/app/use-record-actions.d.ts +12 -0
  30. package/dist/app/use-record-actions.js +30 -0
  31. package/dist/app/write-failed-error.d.ts +1 -1
  32. package/dist/components/availability-options-select.d.ts +1 -1
  33. package/dist/components/embedded-list-field.d.ts +1 -1
  34. package/dist/components/embedded-list-field.js +1 -1
  35. package/dist/components/file-list-field.d.ts +1 -1
  36. package/dist/components/grid-cell-for-field.d.ts +4 -2
  37. package/dist/components/grid-cell-for-field.js +2 -2
  38. package/dist/components/multi-select-checkboxes.d.ts +1 -1
  39. package/dist/components/multi-select-checkboxes.js +1 -1
  40. package/dist/components/query-options-select.d.ts +1 -1
  41. package/dist/components/related-list-section.d.ts +1 -1
  42. package/dist/components/related-list-section.js +16 -3
  43. package/dist/components/render-edit-logic.d.ts +1 -1
  44. package/dist/components/render-edit-types.d.ts +2 -2
  45. package/dist/components/render-edit.d.ts +1 -1
  46. package/dist/components/render-edit.js +5 -3
  47. package/dist/components/render-field.d.ts +5 -2
  48. package/dist/components/render-field.js +103 -9
  49. package/dist/components/render-list.d.ts +1 -1
  50. package/dist/components/render-list.js +20 -4
  51. package/dist/components/write-form-section.d.ts +1 -1
  52. package/dist/components/write-form-section.js +1 -1
  53. package/dist/context/dispatcher-context.d.ts +1 -1
  54. package/dist/format-when.js +1 -1
  55. package/dist/headless/apex/css.d.ts +3 -0
  56. package/dist/headless/apex/css.js +298 -0
  57. package/dist/headless/apex/index.d.ts +236 -0
  58. package/dist/headless/apex/index.js +377 -0
  59. package/dist/headless/apex/lightbox.d.ts +4 -0
  60. package/dist/headless/apex/lightbox.js +81 -0
  61. package/dist/headless/contracts/asset.d.ts +15 -0
  62. package/dist/headless/contracts/asset.js +17 -0
  63. package/dist/headless/contracts/index.d.ts +3 -0
  64. package/dist/headless/contracts/index.js +1 -0
  65. package/dist/headless/contracts/locale.d.ts +7 -0
  66. package/dist/headless/contracts/locale.js +11 -0
  67. package/dist/headless/contracts/primitives.d.ts +93 -0
  68. package/dist/headless/contracts/primitives.js +21 -0
  69. package/dist/headless/dispatcher/index.d.ts +2 -0
  70. package/dist/headless/dispatcher/index.js +1 -0
  71. package/dist/headless/dispatcher/types.d.ts +86 -0
  72. package/dist/headless/dispatcher/types.js +34 -0
  73. package/dist/headless/form/form-controller.d.ts +2 -0
  74. package/dist/headless/form/form-controller.js +409 -0
  75. package/dist/headless/form/index.d.ts +3 -0
  76. package/dist/headless/form/index.js +2 -0
  77. package/dist/headless/form/types.d.ts +76 -0
  78. package/dist/headless/form/types.js +1 -0
  79. package/dist/headless/form/zod-bridge.d.ts +10 -0
  80. package/dist/headless/form/zod-bridge.js +103 -0
  81. package/dist/headless/format/document-values.d.ts +12 -0
  82. package/dist/headless/format/document-values.js +70 -0
  83. package/dist/headless/format/escape.d.ts +5 -0
  84. package/dist/headless/format/escape.js +75 -0
  85. package/dist/headless/format/html-template.d.ts +9 -0
  86. package/dist/headless/format/html-template.js +39 -0
  87. package/dist/headless/format/index.d.ts +12 -0
  88. package/dist/headless/format/index.js +237 -0
  89. package/dist/headless/format/money.d.ts +3 -0
  90. package/dist/headless/format/money.js +39 -0
  91. package/dist/headless/index.d.ts +14 -0
  92. package/dist/headless/index.js +9 -0
  93. package/dist/headless/locale-routing/index.d.ts +41 -0
  94. package/dist/headless/locale-routing/index.js +145 -0
  95. package/dist/headless/nav/index.d.ts +2 -0
  96. package/dist/headless/nav/index.js +1 -0
  97. package/dist/headless/nav/resolve.d.ts +2 -0
  98. package/dist/headless/nav/resolve.js +71 -0
  99. package/dist/headless/nav/types.d.ts +26 -0
  100. package/dist/headless/nav/types.js +1 -0
  101. package/dist/headless/store/create-store.d.ts +2 -0
  102. package/dist/headless/store/create-store.js +43 -0
  103. package/dist/headless/store/equality.d.ts +1 -0
  104. package/dist/headless/store/equality.js +34 -0
  105. package/dist/headless/store/index.d.ts +3 -0
  106. package/dist/headless/store/index.js +2 -0
  107. package/dist/headless/store/types.d.ts +7 -0
  108. package/dist/headless/store/types.js +10 -0
  109. package/dist/headless/view-model/edit.d.ts +18 -0
  110. package/dist/headless/view-model/edit.js +501 -0
  111. package/dist/headless/view-model/embedded-list.d.ts +27 -0
  112. package/dist/headless/view-model/embedded-list.js +63 -0
  113. package/dist/headless/view-model/index.d.ts +7 -0
  114. package/dist/headless/view-model/index.js +3 -0
  115. package/dist/headless/view-model/list-file-display.d.ts +3 -0
  116. package/dist/headless/view-model/list-file-display.js +27 -0
  117. package/dist/headless/view-model/list.d.ts +16 -0
  118. package/dist/headless/view-model/list.js +229 -0
  119. package/dist/headless/view-model/types.d.ts +382 -0
  120. package/dist/headless/view-model/types.js +1 -0
  121. package/dist/hooks/use-ai-text.d.ts +1 -1
  122. package/dist/hooks/use-form.d.ts +1 -1
  123. package/dist/hooks/use-form.js +1 -1
  124. package/dist/hooks/use-mutation.d.ts +1 -1
  125. package/dist/hooks/use-query.d.ts +1 -1
  126. package/dist/hooks/use-store.d.ts +1 -1
  127. package/dist/hooks/use-store.js +7 -7
  128. package/dist/hooks/use-stream-handler.d.ts +1 -1
  129. package/dist/i18n-defaults.js +7 -0
  130. package/dist/i18n.d.ts +1 -1
  131. package/dist/i18n.js +1 -1
  132. package/dist/index.d.ts +5 -1
  133. package/dist/index.js +7 -4
  134. package/dist/live/csrf.d.ts +2 -0
  135. package/dist/live/csrf.js +60 -0
  136. package/dist/live/dispatcher-live.d.ts +7 -0
  137. package/dist/live/dispatcher-live.js +286 -0
  138. package/dist/live/envelopes.d.ts +101 -0
  139. package/dist/live/envelopes.js +35 -0
  140. package/dist/live/error-mapping.d.ts +16 -0
  141. package/dist/live/error-mapping.js +82 -0
  142. package/dist/live/index.d.ts +7 -0
  143. package/dist/live/index.js +5 -0
  144. package/dist/live/locale.d.ts +2 -0
  145. package/dist/live/locale.js +25 -0
  146. package/dist/live/sse-stream.d.ts +14 -0
  147. package/dist/live/sse-stream.js +128 -0
  148. package/dist/primitives.d.ts +53 -36
  149. package/dist/primitives.js +1 -1
  150. package/dist/session/session-ended.d.ts +1 -1
  151. package/dist/tokens.d.ts +3 -4
  152. package/dist/tokens.js +4 -5
  153. package/dist/web/app/app-schema-boot.d.ts +19 -0
  154. package/dist/web/app/app-schema-boot.js +124 -0
  155. package/dist/web/app/browser-locale.d.ts +22 -0
  156. package/dist/web/app/browser-locale.js +78 -0
  157. package/dist/web/app/client-plugin.d.ts +106 -0
  158. package/dist/web/app/client-plugin.js +12 -0
  159. package/dist/web/app/create-app.d.ts +104 -0
  160. package/dist/web/app/create-app.js +498 -0
  161. package/dist/web/app/create-public-surface.d.ts +36 -0
  162. package/dist/web/app/create-public-surface.js +40 -0
  163. package/dist/web/app/dashboard-body.d.ts +3 -0
  164. package/dist/web/app/dashboard-body.js +865 -0
  165. package/dist/web/app/dashboard-refresh.d.ts +6 -0
  166. package/dist/web/app/dashboard-refresh.js +15 -0
  167. package/dist/web/app/document-lang-sync.d.ts +4 -0
  168. package/dist/web/app/document-lang-sync.js +27 -0
  169. package/dist/web/app/draft-storage.d.ts +11 -0
  170. package/dist/web/app/draft-storage.js +53 -0
  171. package/dist/web/app/nav-providers-context.d.ts +13 -0
  172. package/dist/web/app/nav-providers-context.js +18 -0
  173. package/dist/web/app/nav.d.ts +40 -0
  174. package/dist/web/app/nav.js +231 -0
  175. package/dist/web/app/plain-content-editor.d.ts +3 -0
  176. package/dist/web/app/plain-content-editor.js +30 -0
  177. package/dist/web/app/relative-time.d.ts +10 -0
  178. package/dist/web/app/relative-time.js +56 -0
  179. package/dist/web/app/resolvers-context.d.ts +12 -0
  180. package/dist/web/app/resolvers-context.js +10 -0
  181. package/dist/web/app/rich-content-editor.d.ts +3 -0
  182. package/dist/web/app/rich-content-editor.js +15 -0
  183. package/dist/web/app/root-error-fallback.d.ts +2 -0
  184. package/dist/web/app/root-error-fallback.js +21 -0
  185. package/dist/web/app/screen-error-fallback.d.ts +6 -0
  186. package/dist/web/app/screen-error-fallback.js +17 -0
  187. package/dist/web/app/tiptap-editor.d.ts +3 -0
  188. package/dist/web/app/tiptap-editor.js +120 -0
  189. package/dist/web/app/toast-action-notifier.d.ts +5 -0
  190. package/dist/web/app/toast-action-notifier.js +17 -0
  191. package/dist/web/components/config-cascade.d.ts +13 -0
  192. package/dist/web/components/config-cascade.js +155 -0
  193. package/dist/web/components/config-source-badge.d.ts +6 -0
  194. package/dist/web/components/config-source-badge.js +55 -0
  195. package/dist/web/default-color-scheme.d.ts +2 -0
  196. package/dist/web/default-color-scheme.js +3 -0
  197. package/dist/web/icons.d.ts +94 -0
  198. package/dist/web/icons.js +100 -0
  199. package/dist/web/index.d.ts +78 -0
  200. package/dist/web/index.js +53 -0
  201. package/dist/web/layout/app-layout.d.ts +21 -0
  202. package/dist/web/layout/app-layout.js +8 -0
  203. package/dist/web/layout/avatar.d.ts +12 -0
  204. package/dist/web/layout/avatar.js +63 -0
  205. package/dist/web/layout/default-app-shell.d.ts +41 -0
  206. package/dist/web/layout/default-app-shell.js +16 -0
  207. package/dist/web/layout/editor-panel.d.ts +10 -0
  208. package/dist/web/layout/editor-panel.js +29 -0
  209. package/dist/web/layout/fill-classes.d.ts +9 -0
  210. package/dist/web/layout/fill-classes.js +15 -0
  211. package/dist/web/layout/filter-app-schema-navs.d.ts +7 -0
  212. package/dist/web/layout/filter-app-schema-navs.js +68 -0
  213. package/dist/web/layout/header-action-group.d.ts +6 -0
  214. package/dist/web/layout/header-action-group.js +8 -0
  215. package/dist/web/layout/header-overflow-menu.d.ts +4 -0
  216. package/dist/web/layout/header-overflow-menu.js +8 -0
  217. package/dist/web/layout/language-menu-items.d.ts +8 -0
  218. package/dist/web/layout/language-menu-items.js +16 -0
  219. package/dist/web/layout/language-switcher.d.ts +25 -0
  220. package/dist/web/layout/language-switcher.js +46 -0
  221. package/dist/web/layout/nav-tree.d.ts +19 -0
  222. package/dist/web/layout/nav-tree.js +536 -0
  223. package/dist/web/layout/page-header-slot.d.ts +25 -0
  224. package/dist/web/layout/page-header-slot.js +50 -0
  225. package/dist/web/layout/profile-menu.d.ts +13 -0
  226. package/dist/web/layout/profile-menu.js +6 -0
  227. package/dist/web/layout/shell-breadcrumb.d.ts +11 -0
  228. package/dist/web/layout/shell-breadcrumb.js +34 -0
  229. package/dist/web/layout/shell-header.d.ts +12 -0
  230. package/dist/web/layout/shell-header.js +159 -0
  231. package/dist/web/layout/sidebar-brand.d.ts +15 -0
  232. package/dist/web/layout/sidebar-brand.js +9 -0
  233. package/dist/web/layout/sidebar-panel.d.ts +41 -0
  234. package/dist/web/layout/sidebar-panel.js +107 -0
  235. package/dist/web/layout/sidebar-user.d.ts +8 -0
  236. package/dist/web/layout/sidebar-user.js +17 -0
  237. package/dist/web/layout/sidebar.d.ts +17 -0
  238. package/dist/web/layout/sidebar.js +11 -0
  239. package/dist/web/layout/target-resolver-stub.d.ts +13 -0
  240. package/dist/web/layout/target-resolver-stub.js +61 -0
  241. package/dist/web/layout/target-url.d.ts +12 -0
  242. package/dist/web/layout/target-url.js +77 -0
  243. package/dist/web/layout/theme-label.d.ts +15 -0
  244. package/dist/web/layout/theme-label.js +35 -0
  245. package/dist/web/layout/theme-menu-item.d.ts +12 -0
  246. package/dist/web/layout/theme-menu-item.js +16 -0
  247. package/dist/web/layout/theme-toggle.d.ts +17 -0
  248. package/dist/web/layout/theme-toggle.js +22 -0
  249. package/dist/web/layout/topbar.d.ts +8 -0
  250. package/dist/web/layout/topbar.js +4 -0
  251. package/dist/web/layout/workspace-shell.d.ts +63 -0
  252. package/dist/web/layout/workspace-shell.js +220 -0
  253. package/dist/web/layout/workspace-switcher.d.ts +15 -0
  254. package/dist/web/layout/workspace-switcher.js +36 -0
  255. package/dist/web/lib/accept-attr.d.ts +1 -0
  256. package/dist/web/lib/accept-attr.js +6 -0
  257. package/dist/web/lib/clamp.d.ts +1 -0
  258. package/dist/web/lib/clamp.js +3 -0
  259. package/dist/web/lib/cn.d.ts +6 -0
  260. package/dist/web/lib/cn.js +9 -0
  261. package/dist/web/lib/download.d.ts +2 -0
  262. package/dist/web/lib/download.js +24 -0
  263. package/dist/web/lib/file-ref-download.d.ts +15 -0
  264. package/dist/web/lib/file-ref-download.js +62 -0
  265. package/dist/web/lib/file-upload-form-data.d.ts +7 -0
  266. package/dist/web/lib/file-upload-form-data.js +11 -0
  267. package/dist/web/lib/resize-image.d.ts +1 -0
  268. package/dist/web/lib/resize-image.js +66 -0
  269. package/dist/web/lib/upload-file-ref.d.ts +9 -0
  270. package/dist/web/lib/upload-file-ref.js +29 -0
  271. package/dist/web/primitives/action-menu.d.ts +34 -0
  272. package/dist/web/primitives/action-menu.js +30 -0
  273. package/dist/web/primitives/calendar-popover.d.ts +13 -0
  274. package/dist/web/primitives/calendar-popover.js +76 -0
  275. package/dist/web/primitives/combobox.d.ts +56 -0
  276. package/dist/web/primitives/combobox.js +127 -0
  277. package/dist/web/primitives/date-field.d.ts +18 -0
  278. package/dist/web/primitives/date-field.js +74 -0
  279. package/dist/web/primitives/date-input.d.ts +1 -0
  280. package/dist/web/primitives/date-input.js +5 -0
  281. package/dist/web/primitives/date-parse.d.ts +11 -0
  282. package/dist/web/primitives/date-parse.js +159 -0
  283. package/dist/web/primitives/dialog.d.ts +3 -0
  284. package/dist/web/primitives/dialog.js +42 -0
  285. package/dist/web/primitives/drawer.d.ts +3 -0
  286. package/dist/web/primitives/drawer.js +17 -0
  287. package/dist/web/primitives/dropdown-menu.d.ts +15 -0
  288. package/dist/web/primitives/dropdown-menu.js +56 -0
  289. package/dist/web/primitives/embedded-list-input.d.ts +9 -0
  290. package/dist/web/primitives/embedded-list-input.js +382 -0
  291. package/dist/web/primitives/file-thumbnail.d.ts +25 -0
  292. package/dist/web/primitives/file-thumbnail.js +90 -0
  293. package/dist/web/primitives/file-upload.d.ts +21 -0
  294. package/dist/web/primitives/file-upload.js +56 -0
  295. package/dist/web/primitives/index.d.ts +34 -0
  296. package/dist/web/primitives/index.js +2021 -0
  297. package/dist/web/primitives/json-view.d.ts +7 -0
  298. package/dist/web/primitives/json-view.js +84 -0
  299. package/dist/web/primitives/layout.d.ts +27 -0
  300. package/dist/web/primitives/layout.js +30 -0
  301. package/dist/web/primitives/lightbox.d.ts +3 -0
  302. package/dist/web/primitives/lightbox.js +36 -0
  303. package/dist/web/primitives/locale-number.d.ts +2 -0
  304. package/dist/web/primitives/locale-number.js +54 -0
  305. package/dist/web/primitives/located-timestamp-input.d.ts +22 -0
  306. package/dist/web/primitives/located-timestamp-input.js +22 -0
  307. package/dist/web/primitives/metric.d.ts +5 -0
  308. package/dist/web/primitives/metric.js +18 -0
  309. package/dist/web/primitives/modal-shell.d.ts +17 -0
  310. package/dist/web/primitives/modal-shell.js +9 -0
  311. package/dist/web/primitives/modal.d.ts +3 -0
  312. package/dist/web/primitives/modal.js +13 -0
  313. package/dist/web/primitives/money-input.d.ts +18 -0
  314. package/dist/web/primitives/money-input.js +122 -0
  315. package/dist/web/primitives/narrow-pinned-footer.d.ts +12 -0
  316. package/dist/web/primitives/narrow-pinned-footer.js +153 -0
  317. package/dist/web/primitives/number-input.d.ts +18 -0
  318. package/dist/web/primitives/number-input.js +53 -0
  319. package/dist/web/primitives/option-groups.d.ts +11 -0
  320. package/dist/web/primitives/option-groups.js +27 -0
  321. package/dist/web/primitives/page-header.d.ts +3 -0
  322. package/dist/web/primitives/page-header.js +52 -0
  323. package/dist/web/primitives/promo-panel.d.ts +3 -0
  324. package/dist/web/primitives/promo-panel.js +11 -0
  325. package/dist/web/primitives/segmented-select.d.ts +21 -0
  326. package/dist/web/primitives/segmented-select.js +62 -0
  327. package/dist/web/primitives/share-actions.d.ts +4 -0
  328. package/dist/web/primitives/share-actions.js +56 -0
  329. package/dist/web/primitives/status-badge.d.ts +3 -0
  330. package/dist/web/primitives/status-badge.js +5 -0
  331. package/dist/web/primitives/sticky-action-bar.d.ts +5 -0
  332. package/dist/web/primitives/sticky-action-bar.js +15 -0
  333. package/dist/web/primitives/tabs.d.ts +3 -0
  334. package/dist/web/primitives/tabs.js +107 -0
  335. package/dist/web/primitives/timestamp-input.d.ts +27 -0
  336. package/dist/web/primitives/timestamp-input.js +87 -0
  337. package/dist/web/primitives/toast.d.ts +19 -0
  338. package/dist/web/primitives/toast.js +63 -0
  339. package/dist/web/primitives/tz-input.d.ts +11 -0
  340. package/dist/web/primitives/tz-input.js +8 -0
  341. package/dist/web/primitives/tz-options.d.ts +4 -0
  342. package/dist/web/primitives/tz-options.js +17 -0
  343. package/dist/web/primitives/use-keyboard-inset.d.ts +1 -0
  344. package/dist/web/primitives/use-keyboard-inset.js +28 -0
  345. package/dist/web/primitives/use-narrow-viewport.d.ts +4 -0
  346. package/dist/web/primitives/use-narrow-viewport.js +46 -0
  347. package/dist/web/react-css-custom-properties.d.ts +6 -0
  348. package/dist/web/react-css-custom-properties.js +1 -0
  349. package/dist/web/sse/live-events.d.ts +15 -0
  350. package/dist/web/sse/live-events.js +148 -0
  351. package/dist/web/theme-plugin.d.ts +41 -0
  352. package/dist/web/theme-plugin.js +123 -0
  353. package/dist/web/tokens.d.ts +24 -0
  354. package/dist/web/tokens.js +203 -0
  355. package/dist/web/ui/avatar.d.ts +11 -0
  356. package/dist/web/ui/avatar.js +25 -0
  357. package/dist/web/ui/badge.d.ts +9 -0
  358. package/dist/web/ui/badge.js +26 -0
  359. package/dist/web/ui/breadcrumb.d.ts +11 -0
  360. package/dist/web/ui/breadcrumb.js +29 -0
  361. package/dist/web/ui/button.d.ts +10 -0
  362. package/dist/web/ui/button.js +37 -0
  363. package/dist/web/ui/checkbox.d.ts +4 -0
  364. package/dist/web/ui/checkbox.js +11 -0
  365. package/dist/web/ui/input.d.ts +3 -0
  366. package/dist/web/ui/input.js +8 -0
  367. package/dist/web/ui/label.d.ts +4 -0
  368. package/dist/web/ui/label.js +10 -0
  369. package/dist/web/ui/resizable.d.ts +7 -0
  370. package/dist/web/ui/resizable.js +16 -0
  371. package/dist/web/ui/separator.d.ts +4 -0
  372. package/dist/web/ui/separator.js +10 -0
  373. package/dist/web/ui/sheet.d.ts +14 -0
  374. package/dist/web/ui/sheet.js +42 -0
  375. package/dist/web/ui/sidebar.d.ts +73 -0
  376. package/dist/web/ui/sidebar.js +211 -0
  377. package/dist/web/ui/skeleton.d.ts +2 -0
  378. package/dist/web/ui/skeleton.js +7 -0
  379. package/dist/web/ui/switch.d.ts +6 -0
  380. package/dist/web/ui/switch.js +10 -0
  381. package/dist/web/ui/table.d.ts +10 -0
  382. package/dist/web/ui/table.js +30 -0
  383. package/dist/web/ui/tabs.d.ts +11 -0
  384. package/dist/web/ui/tabs.js +31 -0
  385. package/dist/web/ui/textarea.d.ts +3 -0
  386. package/dist/web/ui/textarea.js +8 -0
  387. package/dist/web/ui/tooltip.d.ts +7 -0
  388. package/dist/web/ui/tooltip.js +19 -0
  389. package/dist/web/ui/use-mobile.d.ts +1 -0
  390. package/dist/web/ui/use-mobile.js +16 -0
  391. package/dist/web/version/update-checker.d.ts +9 -0
  392. package/dist/web/version/update-checker.js +88 -0
  393. package/dist/web/widgets/ai-text-field.d.ts +36 -0
  394. package/dist/web/widgets/ai-text-field.js +137 -0
  395. package/dist/web/widgets/chart-window.d.ts +58 -0
  396. package/dist/web/widgets/chart-window.js +190 -0
  397. package/dist/web/widgets/charts.d.ts +208 -0
  398. package/dist/web/widgets/charts.js +685 -0
  399. package/dist/web/widgets/collapsible-section.d.ts +10 -0
  400. package/dist/web/widgets/collapsible-section.js +17 -0
  401. package/dist/web/widgets/dashboard-list.d.ts +21 -0
  402. package/dist/web/widgets/dashboard-list.js +45 -0
  403. package/dist/web/widgets/detail-list.d.ts +15 -0
  404. package/dist/web/widgets/detail-list.js +8 -0
  405. package/dist/web/widgets/drawer.d.ts +65 -0
  406. package/dist/web/widgets/drawer.js +142 -0
  407. package/dist/web/widgets/feed-list.d.ts +13 -0
  408. package/dist/web/widgets/feed-list.js +9 -0
  409. package/dist/web/widgets/floating-panel.d.ts +30 -0
  410. package/dist/web/widgets/floating-panel.js +242 -0
  411. package/dist/web/widgets/form-fields.d.ts +93 -0
  412. package/dist/web/widgets/form-fields.js +50 -0
  413. package/dist/web/widgets/index.d.ts +27 -0
  414. package/dist/web/widgets/index.js +30 -0
  415. package/dist/web/widgets/infinity-list.d.ts +46 -0
  416. package/dist/web/widgets/infinity-list.js +211 -0
  417. package/dist/web/widgets/mode-switch.d.ts +21 -0
  418. package/dist/web/widgets/mode-switch.js +25 -0
  419. package/dist/web/widgets/photo-slots.d.ts +29 -0
  420. package/dist/web/widgets/photo-slots.js +52 -0
  421. package/dist/web/widgets/plan-card.d.ts +36 -0
  422. package/dist/web/widgets/plan-card.js +13 -0
  423. package/dist/web/widgets/progress-bar.d.ts +19 -0
  424. package/dist/web/widgets/progress-bar.js +24 -0
  425. package/dist/web/widgets/progress-list.d.ts +19 -0
  426. package/dist/web/widgets/progress-list.js +11 -0
  427. package/dist/web/widgets/public-shell.d.ts +22 -0
  428. package/dist/web/widgets/public-shell.js +15 -0
  429. package/dist/web/widgets/query-table.d.ts +29 -0
  430. package/dist/web/widgets/query-table.js +30 -0
  431. package/dist/web/widgets/result-panel.d.ts +69 -0
  432. package/dist/web/widgets/result-panel.js +30 -0
  433. package/dist/web/widgets/section-card.d.ts +12 -0
  434. package/dist/web/widgets/section-card.js +9 -0
  435. package/dist/web/widgets/sheet-parts.d.ts +9 -0
  436. package/dist/web/widgets/sheet-parts.js +11 -0
  437. package/dist/web/widgets/side-by-side-table.d.ts +31 -0
  438. package/dist/web/widgets/side-by-side-table.js +11 -0
  439. package/dist/web/widgets/stat.d.ts +54 -0
  440. package/dist/web/widgets/stat.js +65 -0
  441. package/dist/web/widgets/states.d.ts +23 -0
  442. package/dist/web/widgets/states.js +20 -0
  443. package/dist/web/widgets/status-badge.d.ts +15 -0
  444. package/dist/web/widgets/status-badge.js +24 -0
  445. package/dist/web/widgets/step-bar.d.ts +35 -0
  446. package/dist/web/widgets/step-bar.js +60 -0
  447. package/dist/web/widgets/upload-zone.d.ts +24 -0
  448. package/dist/web/widgets/upload-zone.js +108 -0
  449. package/dist/web/widgets/use-draft.d.ts +20 -0
  450. package/dist/web/widgets/use-draft.js +21 -0
  451. package/dist/web/widgets/use-pointer-drag.d.ts +21 -0
  452. package/dist/web/widgets/use-pointer-drag.js +53 -0
  453. package/package.json +105 -7
  454. package/src/changes.json +77 -0
  455. package/src/web/fonts/OFL.txt +93 -0
  456. package/src/web/fonts/ibm-plex-mono-latin-400.woff2 +0 -0
  457. package/src/web/fonts/ibm-plex-mono-latin-500.woff2 +0 -0
  458. package/src/web/fonts/ibm-plex-mono-latin-ext-400.woff2 +0 -0
  459. package/src/web/fonts/ibm-plex-mono-latin-ext-500.woff2 +0 -0
  460. package/src/web/fonts/ibm-plex-sans-latin-400.woff2 +0 -0
  461. package/src/web/fonts/ibm-plex-sans-latin-500.woff2 +0 -0
  462. package/src/web/fonts/ibm-plex-sans-latin-600.woff2 +0 -0
  463. package/src/web/fonts/ibm-plex-sans-latin-ext-400.woff2 +0 -0
  464. package/src/web/fonts/ibm-plex-sans-latin-ext-500.woff2 +0 -0
  465. package/src/web/fonts/ibm-plex-sans-latin-ext-600.woff2 +0 -0
  466. package/src/web/styles.css +401 -0
package/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # @cosmicdrift/kumiko-renderer
2
2
 
3
- Platform-agnostic React renderer for Kumiko screens: primitives contract, hooks, `KumikoScreen`, navigation and SSE abstractions. No DOM, no `EventSource`, no `react-dom`.
3
+ React renderer for Kumiko screens: primitives contract, hooks, `KumikoScreen`, navigation and SSE abstractions. The root entry has no DOM and no `EventSource`; the subpaths add the web bindings (`/web`), UI logic (`/headless`) and the HTTP dispatcher (`/live`).
4
4
 
5
5
  ## Install
6
6
 
@@ -8,6 +8,6 @@ Platform-agnostic React renderer for Kumiko screens: primitives contract, hooks,
8
8
  bun add @cosmicdrift/kumiko-renderer
9
9
  ```
10
10
 
11
- Pair it with `@cosmicdrift/kumiko-renderer-web` for the browser.
11
+ Import the browser bindings from `@cosmicdrift/kumiko-renderer/web`.
12
12
 
13
13
  Documentation: https://kumiko.rocks
@@ -0,0 +1,58 @@
1
+ import type { ActionFormLoad, ActionFormSuccessFact } from "@cosmicdrift/kumiko-framework/ui-types";
2
+ import { type ReactNode } from "react";
3
+ import type { DispatcherError, Translate } from "../headless/index.ts";
4
+ /** Record id of a `load` form: the route path id, else the drawer prefill `id`
5
+ * (the clicked row), else the URL `id` param. Only the id is read from these
6
+ * sources, never another value. */
7
+ export declare function resolveActionFormRecordId(sources: {
8
+ readonly routeEntityId: string | undefined;
9
+ readonly drawerOverrides: Readonly<Record<string, unknown>> | undefined;
10
+ readonly searchParams: Readonly<Record<string, string>>;
11
+ }): string | undefined;
12
+ export type ActionFormLoadState = {
13
+ readonly status: "missing-id";
14
+ } | {
15
+ readonly status: "loading";
16
+ } | {
17
+ readonly status: "error";
18
+ readonly error: DispatcherError;
19
+ } | {
20
+ readonly status: "missing-record";
21
+ } | {
22
+ readonly status: "ready";
23
+ readonly values: Readonly<Record<string, unknown>>;
24
+ };
25
+ /** A sensitive, writeOnly or password field never takes a value from a loaded
26
+ * record: the form must not echo a secret back into an input. */
27
+ export declare function isSecretFormField(field: unknown): boolean;
28
+ /** Loads the initial values of an actionForm declaring `load`; undefined for a
29
+ * form without `load`. */
30
+ export declare function useActionFormLoad(load: ActionFormLoad | undefined, recordId: string | undefined, fieldNames: readonly string[]): ActionFormLoadState | undefined;
31
+ /** Banner for every `load` state that is not "ready". */
32
+ export declare function ActionFormLoadStatus({ state, screenId, translate, }: {
33
+ readonly state: Exclude<ActionFormLoadState, {
34
+ readonly status: "ready";
35
+ }>;
36
+ readonly screenId: string;
37
+ readonly translate: Translate;
38
+ }): ReactNode;
39
+ export type ResolvedSuccessLink = {
40
+ readonly key: string;
41
+ readonly label: string;
42
+ readonly href: string;
43
+ readonly onPress: () => void;
44
+ };
45
+ export type ResolvedSuccessFact = {
46
+ readonly key: string;
47
+ readonly label: string;
48
+ readonly lines: readonly string[];
49
+ };
50
+ export type ActionFormSuccessState = {
51
+ readonly text: string;
52
+ readonly links: readonly ResolvedSuccessLink[];
53
+ readonly facts: readonly ResolvedSuccessFact[];
54
+ };
55
+ export declare function resolveSuccessFacts(facts: readonly ActionFormSuccessFact[] | undefined, data: unknown, translate: (key: string) => string, locale: string): readonly ResolvedSuccessFact[];
56
+ export declare function ActionFormSuccessBanner({ success, }: {
57
+ readonly success: ActionFormSuccessState;
58
+ }): ReactNode;
@@ -0,0 +1,96 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { propertyOf } from "@cosmicdrift/kumiko-types/type-guards";
3
+ import { useMemo } from "react";
4
+ import { useQuery } from "../hooks/use-query.js";
5
+ import { usePrimitives } from "../primitives.js";
6
+ import { QueryLoadingBanner } from "./query-state-banners.js";
7
+ import { dispatcherErrorText } from "./write-failed-error.js";
8
+ const DEFAULT_LOAD_ID_PARAM = "id";
9
+ function nonEmptyId(value) {
10
+ if (typeof value === "string" && value !== "")
11
+ return value;
12
+ return typeof value === "number" ? String(value) : undefined;
13
+ }
14
+ /** Record id of a `load` form: the route path id, else the drawer prefill `id`
15
+ * (the clicked row), else the URL `id` param. Only the id is read from these
16
+ * sources, never another value. */
17
+ export function resolveActionFormRecordId(sources) {
18
+ return (nonEmptyId(sources.routeEntityId) ??
19
+ nonEmptyId(sources.drawerOverrides?.[DEFAULT_LOAD_ID_PARAM]) ??
20
+ nonEmptyId(sources.searchParams[DEFAULT_LOAD_ID_PARAM]));
21
+ }
22
+ /** A sensitive, writeOnly or password field never takes a value from a loaded
23
+ * record: the form must not echo a secret back into an input. */
24
+ export function isSecretFormField(field) {
25
+ return (propertyOf(field, "sensitive") === true ||
26
+ propertyOf(field, "writeOnly") === true ||
27
+ propertyOf(field, "format") === "password");
28
+ }
29
+ function pickDeclaredFields(record, fieldNames) {
30
+ if (typeof record !== "object" || record === null)
31
+ return {};
32
+ const picked = {};
33
+ for (const name of fieldNames) {
34
+ const value = Object.hasOwn(record, name) ? Reflect.get(record, name) : undefined;
35
+ if (value !== undefined && value !== null)
36
+ picked[name] = value;
37
+ }
38
+ return picked;
39
+ }
40
+ /** Loads the initial values of an actionForm declaring `load`; undefined for a
41
+ * form without `load`. */
42
+ export function useActionFormLoad(load, recordId, fieldNames) {
43
+ const query = useQuery(load?.query ?? "", { [load?.idParam ?? DEFAULT_LOAD_ID_PARAM]: recordId }, { enabled: load !== undefined && recordId !== undefined });
44
+ const values = useMemo(() => pickDeclaredFields(query.data, fieldNames), [query.data, fieldNames]);
45
+ if (load === undefined)
46
+ return undefined;
47
+ if (recordId === undefined)
48
+ return { status: "missing-id" };
49
+ if (query.error !== null)
50
+ return { status: "error", error: query.error };
51
+ if (query.loading)
52
+ return { status: "loading" };
53
+ if (query.data === null)
54
+ return { status: "missing-record" };
55
+ return { status: "ready", values };
56
+ }
57
+ /** Banner for every `load` state that is not "ready". */
58
+ export function ActionFormLoadStatus({ state, screenId, translate, }) {
59
+ const { Banner, Text } = usePrimitives();
60
+ switch (state.status) {
61
+ case "loading":
62
+ return _jsx(QueryLoadingBanner, {});
63
+ case "error":
64
+ return (_jsx(Banner, { padded: true, variant: "error", testId: "kumiko-screen-error", children: dispatcherErrorText(state.error, translate) }));
65
+ case "missing-record":
66
+ return (_jsx(Banner, { padded: true, variant: "error", testId: "kumiko-screen-record-missing", children: translate("kumiko.record.not-found.title") }));
67
+ case "missing-id":
68
+ return (_jsxs(Banner, { padded: true, variant: "error", testId: "kumiko-screen-action-form-missing-id", children: ["Screen ", _jsx(Text, { variant: "code", children: screenId }), " (actionForm with load) needs a record id in the path or the clicked row."] }));
69
+ }
70
+ }
71
+ function factLine(entry, locale) {
72
+ if (typeof entry === "number")
73
+ return entry.toLocaleString(locale);
74
+ if (typeof entry === "string")
75
+ return entry;
76
+ if (typeof entry === "object" && entry !== null && "label" in entry) {
77
+ return typeof entry.label === "string" ? entry.label : undefined;
78
+ }
79
+ return undefined;
80
+ }
81
+ export function resolveSuccessFacts(facts, data, translate, locale) {
82
+ const resolved = [];
83
+ (facts ?? []).forEach((fact, index) => {
84
+ const value = propertyOf(data, fact.field);
85
+ const entries = Array.isArray(value) ? value : [value];
86
+ const lines = entries.flatMap((entry) => factLine(entry, locale) ?? []);
87
+ if (lines.length > 0) {
88
+ resolved.push({ key: String(index), label: translate(fact.label), lines });
89
+ }
90
+ });
91
+ return resolved;
92
+ }
93
+ export function ActionFormSuccessBanner({ success, }) {
94
+ const { Banner, Link, Text } = usePrimitives();
95
+ return (_jsxs(Banner, { variant: "info", testId: "action-form-success", children: [success.text, success.facts.map((fact) => (_jsxs(Text, { testId: `action-form-success-fact-${fact.key}`, children: [fact.label, ": ", fact.lines.join(", ")] }, fact.key))), success.links.map((link) => (_jsx(Link, { href: link.href, onPress: link.onPress, className: "ml-2 underline", testId: `action-form-success-link-${link.key}`, children: link.label }, link.key)))] }));
96
+ }
@@ -0,0 +1,46 @@
1
+ import type { RowActionClientAction } from "@cosmicdrift/kumiko-framework/ui-types";
2
+ import { type ReactNode } from "react";
3
+ import type { Translate } from "../headless/index.ts";
4
+ export type ClientActionOutcome = {
5
+ readonly ok: true;
6
+ }
7
+ /** `message` is an i18n key; a literal is shown as is. */
8
+ | {
9
+ readonly ok: false;
10
+ readonly message: string;
11
+ };
12
+ export type ClientActionHandler = (payload: Readonly<Record<string, unknown>>) => Promise<ClientActionOutcome>;
13
+ export type ClientActionsMap = Readonly<Record<string, ClientActionHandler>>;
14
+ export type ActionNotice = {
15
+ readonly tone: "success" | "error";
16
+ readonly text: string;
17
+ };
18
+ /** Shows the outcome of a client action. The platform layer provides it
19
+ * (renderer/web: a toast); without one a failure is thrown to the action
20
+ * host's own error surface and a success stays silent. */
21
+ export type ActionNotifier = (notice: ActionNotice) => void;
22
+ export type ClientActionRuntime = {
23
+ readonly handlers: ClientActionsMap | undefined;
24
+ readonly notify: ActionNotifier | undefined;
25
+ };
26
+ export declare function ClientActionsProvider({ children, value, }: {
27
+ readonly children: ReactNode;
28
+ readonly value: ClientActionsMap;
29
+ }): ReactNode;
30
+ export declare function ActionNoticeProvider({ children, notify, }: {
31
+ readonly children: ReactNode;
32
+ readonly notify: ActionNotifier;
33
+ }): ReactNode;
34
+ export declare function useClientActionHandler(name: string): ClientActionHandler | undefined;
35
+ /** Handlers plus notifier, as the action builders take them. */
36
+ export declare function useClientActionRuntime(): ClientActionRuntime;
37
+ /** Runs the handler registered for `action.action` and reports the outcome.
38
+ * Resolves true when the handler returned `{ ok: true }` (the caller then
39
+ * refetches). A failure goes to the notifier; without one it is thrown so the
40
+ * host's own error surface (row toast, header banner) shows it. */
41
+ export declare function runClientAction(options: {
42
+ readonly action: RowActionClientAction;
43
+ readonly payload: Readonly<Record<string, unknown>>;
44
+ readonly runtime: ClientActionRuntime | undefined;
45
+ readonly translate: Translate;
46
+ }): Promise<boolean>;
@@ -0,0 +1,60 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { createContext, useContext, useMemo } from "react";
3
+ const ClientActionsContext = createContext(undefined);
4
+ const ActionNoticeContext = createContext(undefined);
5
+ export function ClientActionsProvider({ children, value, }) {
6
+ return _jsx(ClientActionsContext.Provider, { value: value, children: children });
7
+ }
8
+ export function ActionNoticeProvider({ children, notify, }) {
9
+ return _jsx(ActionNoticeContext.Provider, { value: notify, children: children });
10
+ }
11
+ export function useClientActionHandler(name) {
12
+ return findClientActionHandler(useContext(ClientActionsContext), name);
13
+ }
14
+ /** Handlers plus notifier, as the action builders take them. */
15
+ export function useClientActionRuntime() {
16
+ const handlers = useContext(ClientActionsContext);
17
+ const notify = useContext(ActionNoticeContext);
18
+ return useMemo(() => ({ handlers, notify }), [handlers, notify]);
19
+ }
20
+ function findClientActionHandler(handlers, name) {
21
+ return handlers !== undefined && Object.hasOwn(handlers, name) ? handlers[name] : undefined;
22
+ }
23
+ function logClientActionProblem(name, problem, cause) {
24
+ // biome-ignore lint/suspicious/noConsole: the client has no logger; the toast text is generic, so the action name and cause must reach the DevTools console
25
+ console.error(`[kumiko] clientAction "${name}" ${problem}`, ...(cause === undefined ? [] : [cause]));
26
+ }
27
+ /** Runs the handler registered for `action.action` and reports the outcome.
28
+ * Resolves true when the handler returned `{ ok: true }` (the caller then
29
+ * refetches). A failure goes to the notifier; without one it is thrown so the
30
+ * host's own error surface (row toast, header banner) shows it. */
31
+ export async function runClientAction(options) {
32
+ const { action, payload, runtime, translate } = options;
33
+ const notify = runtime?.notify;
34
+ const fail = (text) => {
35
+ if (notify === undefined)
36
+ throw new Error(text);
37
+ notify({ tone: "error", text });
38
+ return false;
39
+ };
40
+ const handler = findClientActionHandler(runtime?.handlers, action.action);
41
+ if (handler === undefined) {
42
+ logClientActionProblem(action.action, "is not registered by any client feature");
43
+ return fail(translate("kumiko.clientAction.unregistered"));
44
+ }
45
+ let outcome;
46
+ try {
47
+ outcome = await handler(payload);
48
+ }
49
+ catch (error) {
50
+ logClientActionProblem(action.action, "threw", error);
51
+ return fail(translate("kumiko.clientAction.failed"));
52
+ }
53
+ if (!outcome.ok)
54
+ return fail(translate(outcome.message));
55
+ notify?.({
56
+ tone: "success",
57
+ text: translate(action.successMessage ?? "kumiko.clientAction.success"),
58
+ });
59
+ return true;
60
+ }
@@ -1,7 +1,7 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
2
  // Column-Renderer-Map: client-side Lookup für ListColumn-Spalten die im
3
3
  // Schema einen PlatformComponent-Renderer (`{ react: { __component: "Name" } }`)
4
- // statt einer String-Funktion angeben. createKumikoApp im renderer-web sammelt
4
+ // statt einer String-Funktion angeben. createKumikoApp im renderer/web sammelt
5
5
  // alle clientFeatures.columnRenderers und mountet den Provider; der DataTable-
6
6
  // Cell-Renderer schlägt den Component über `useColumnRenderer(name)` nach.
7
7
  //
@@ -12,8 +12,8 @@
12
12
  // zukünftiger Boot-Validator die schema.entities-Map cross-referenziert,
13
13
  // brechen die Type-Lies hier silent. Dann ist Zeit für eine echte
14
14
  // RenderConfigEdit-Komponente die direkt fields nimmt.
15
- import { I18N_KEY_PARAM } from "@cosmicdrift/kumiko-headless";
16
15
  import * as z from "zod";
16
+ import { I18N_KEY_PARAM } from "../headless/index.js";
17
17
  const CONFIG_EDIT_PSEUDO_ENTITY = "__config-edit__";
18
18
  /** Baut eine minimale EntityDefinition aus den Inline-Fields des
19
19
  * ConfigEdit-Screens. RenderEdit + computeEditViewModel iterieren
@@ -1,11 +1,6 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
- // Read-only render of a content editor's format with the collection's
3
- // example variableSchema values substituted in for `{{name}}` — reuses the
4
- // same registered editor the collection edits with (readOnly), so "rich"
5
- // renders formatted HTML and "plain"/"markdown" render as text through the
6
- // exact same component, no separate render path per format.
7
- import { escapeHtmlAttr } from "@cosmicdrift/kumiko-headless";
8
2
  import { useId } from "react";
3
+ import { escapeHtmlAttr } from "../headless/index.js";
9
4
  import { useContentEditor } from "./content-editors.js";
10
5
  const VARIABLE_PATTERN = /\{\{\s*(\w+)\s*\}\}/g;
11
6
  const noop = () => { };
@@ -1,7 +1,7 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
2
  // Custom-Screen-Components-Map: client-side Lookup für Screens vom Typ
3
3
  // `custom`. KumikoScreen schaut hier nach `screen.id` (oder qn) und
4
- // rendert die passende Component. createKumikoApp im renderer-web sammelt
4
+ // rendert die passende Component. createKumikoApp im renderer/web sammelt
5
5
  // alle clientFeatures.components und mountet den Provider; Tests die
6
6
  // einzelne Custom-Screens prüfen wollen, mounten den Provider direkt.
7
7
  import { createContext, useContext } from "react";
@@ -1,6 +1,6 @@
1
1
  import type { DashboardScreenDefinition } from "@cosmicdrift/kumiko-framework/ui-types";
2
- import type { Translate } from "@cosmicdrift/kumiko-headless";
3
2
  import { type ComponentType, type ReactNode } from "react";
3
+ import type { Translate } from "../headless/index.ts";
4
4
  export type DashboardBodyProps = {
5
5
  readonly featureName: string;
6
6
  readonly screen: DashboardScreenDefinition;
@@ -1,6 +1,6 @@
1
1
  import type { RowActionDrawer } from "@cosmicdrift/kumiko-framework/ui-types";
2
- import type { EditRelatedListSectionViewModel, ListRowViewModel, Translate } from "@cosmicdrift/kumiko-headless";
3
2
  import { type ReactNode } from "react";
3
+ import type { EditRelatedListSectionViewModel, ListRowViewModel, Translate } from "../headless/index.ts";
4
4
  export declare function EntityListExpandedRow({ section, row, featureName, translate, expansionNonce, openDrawer, onAfterWrite, onSubListInvalidated, }: {
5
5
  readonly section: EditRelatedListSectionViewModel;
6
6
  readonly row: ListRowViewModel;
@@ -5,6 +5,7 @@ import { RenderEditActionButton } from "../components/render-edit-action-button.
5
5
  import { useOptionalDispatcher } from "../context/dispatcher-context.js";
6
6
  import { useTranslation } from "../i18n.js";
7
7
  import { usePrimitives } from "../primitives.js";
8
+ import { useClientActionRuntime } from "./client-actions.js";
8
9
  import { useNav } from "./nav.js";
9
10
  import { useReturnHost } from "./return-to.js";
10
11
  import { buildRecordActions } from "./row-actions.js";
@@ -18,6 +19,7 @@ export function EntityListExpandedRow({ section, row, featureName, translate, ex
18
19
  const nav = useNav();
19
20
  const host = useReturnHost();
20
21
  const dispatcher = useOptionalDispatcher();
22
+ const clientActions = useClientActionRuntime();
21
23
  const [actionError, setActionError] = useState(null);
22
24
  const onTitleActionWritten = useCallback(async () => {
23
25
  onSubListInvalidated();
@@ -33,6 +35,7 @@ export function EntityListExpandedRow({ section, row, featureName, translate, ex
33
35
  dispatcher,
34
36
  openDrawer,
35
37
  onWriteSuccess: onTitleActionWritten,
38
+ clientActions,
36
39
  })
37
40
  : undefined, [
38
41
  section.actions,
@@ -43,6 +46,7 @@ export function EntityListExpandedRow({ section, row, featureName, translate, ex
43
46
  dispatcher,
44
47
  openDrawer,
45
48
  onTitleActionWritten,
49
+ clientActions,
46
50
  ]);
47
51
  const titleActionButtons = titleActions?.map((action) => (_jsx(RenderEditActionButton, { action: action, Button: Button, Dialog: Dialog, onError: setActionError }, action.id)));
48
52
  return (_jsxs(_Fragment, { children: [actionError !== null && (_jsx(Banner, { variant: "error", testId: `row-${row.id}-expansion-action-error`, children: actionError })), _jsx(RelatedListSection, { embedded: true, section: section, parentId: String(row.values["id"] ?? row.id), record: row.values, featureName: featureName, translate: effectiveTranslate, onOpenDrawer: openDrawer, onAfterWrite: onAfterWrite, ...(titleActionButtons !== undefined && { actions: titleActionButtons }) }, expansionNonce)] }));
@@ -1,6 +1,6 @@
1
1
  import type { EntityDefinition, EntityEditScreenDefinition } from "@cosmicdrift/kumiko-framework/ui-types";
2
- import { type EditFormMode } from "@cosmicdrift/kumiko-headless";
3
2
  import * as z from "zod";
3
+ import { type EditFormMode } from "../headless/index.ts";
4
4
  export declare function isPresent(value: unknown): boolean;
5
5
  export declare const REQUIRED_FIELD_I18N_KEY = "kumiko.validation.required";
6
6
  export declare const OPTION_NOT_AVAILABLE_I18N_KEY = "kumiko.validation.optionNotAvailable";
@@ -1,6 +1,6 @@
1
1
  import { evalFieldCondition, findUnavailableSelectOptions, isUnchangedValue, NO_WIDGET_FIELD_TYPES, } from "@cosmicdrift/kumiko-framework/ui-types";
2
- import { I18N_KEY_PARAM } from "@cosmicdrift/kumiko-headless";
3
2
  import * as z from "zod";
3
+ import { I18N_KEY_PARAM } from "../headless/index.js";
4
4
  import { layoutEditFields } from "./layout-fields.js";
5
5
  // `required` means "has a value", not "is truthy" — `false` and `0` count
6
6
  // as present, only the actually-empty representations don't.
@@ -103,7 +103,7 @@ export function buildFormSchema(entity, screen, verb, unchangedFrom) {
103
103
  code: "custom",
104
104
  path: [spec.field],
105
105
  message: `"${spec.field}" is required.`,
106
- // I18N_KEY_PARAM override, see packages/headless/src/form/zod-bridge.ts.
106
+ // I18N_KEY_PARAM override, see packages/renderer/src/headless/form/zod-bridge.ts.
107
107
  params: { [I18N_KEY_PARAM]: REQUIRED_FIELD_I18N_KEY },
108
108
  });
109
109
  }
@@ -0,0 +1,19 @@
1
+ import type { ReactNode } from "react";
2
+ import type { RenderEditAction } from "../components/render-edit-types.ts";
3
+ import type { usePrimitives } from "../primitives.tsx";
4
+ export declare function HeaderActionsBar({ actions, Button, Dialog, ActionOverflowMenu, onError, collapseAfterPrimary, compact, preferredPrimaryId, PageHeader, overflowTestId, }: {
5
+ /** `primaryAction` of the screen: wins over the edit/primary-style precedence. */
6
+ readonly preferredPrimaryId?: string;
7
+ /** Header slot layout: only the primary action stays a button, the rest goes into the menu. */
8
+ readonly collapseAfterPrimary?: boolean;
9
+ /** Phone-width shell header: an icon-only primary button, the rest in the shell's overflow menu. */
10
+ readonly compact?: boolean;
11
+ readonly PageHeader?: ReturnType<typeof usePrimitives>["PageHeader"];
12
+ readonly actions: readonly RenderEditAction[];
13
+ readonly Button: ReturnType<typeof usePrimitives>["Button"];
14
+ readonly Dialog: ReturnType<typeof usePrimitives>["Dialog"];
15
+ readonly ActionOverflowMenu: ReturnType<typeof usePrimitives>["ActionOverflowMenu"];
16
+ readonly onError: (text: string | null) => void;
17
+ /** Test id of the overflow menu; projectionDetail's by default. */
18
+ readonly overflowTestId?: string;
19
+ }): ReactNode;
@@ -0,0 +1,30 @@
1
+ import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { RenderEditActionButton } from "../components/render-edit-action-button.js";
3
+ import { useActionMenuItems } from "../components/use-action-menu-items.js";
4
+ import { useTranslation } from "../i18n.js";
5
+ import { compactHeaderPrimary, orderPlainHeaderActions, primaryHeaderAction, } from "./header-actions.js";
6
+ // Header actions bar (A7): <=2 actions render as plain buttons; >2 with an
7
+ // `ActionOverflowMenu` primitive collapse to the primary button plus a menu
8
+ // for the rest — same rule as RowActionsCell for table rows. Owns confirm
9
+ // state for menu items: RenderEditActionButton already owns a per-button
10
+ // confirm dialog for the always-visible primary action, but a menu item has
11
+ // no button of its own to carry one.
12
+ export function HeaderActionsBar({ actions, Button, Dialog, ActionOverflowMenu, onError, collapseAfterPrimary = false, compact = false, preferredPrimaryId, PageHeader, overflowTestId = "kumiko-screen-projection-detail-actions-overflow", }) {
13
+ const t = useTranslation();
14
+ const { toMenuItem, confirmDialog: pendingActionDialog } = useActionMenuItems({
15
+ Dialog,
16
+ onError,
17
+ });
18
+ if (compact && PageHeader !== undefined) {
19
+ const compactPrimary = compactHeaderPrimary(actions, preferredPrimaryId);
20
+ const overflowActions = actions.filter((a) => a !== compactPrimary?.action);
21
+ return (_jsxs(_Fragment, { children: [compactPrimary !== undefined && (_jsx(RenderEditActionButton, { action: compactPrimary.action, Button: Button, Dialog: Dialog, iconOnly: compactPrimary.iconOnly, compactLabel: true, onError: onError }, compactPrimary.action.id)), overflowActions.length > 0 && (_jsx(PageHeader, { overflowItems: overflowActions.map(toMenuItem) })), pendingActionDialog] }));
22
+ }
23
+ const maxPlainButtons = collapseAfterPrimary ? 1 : 2;
24
+ if (actions.length <= maxPlainButtons || ActionOverflowMenu === undefined) {
25
+ return (_jsx(_Fragment, { children: orderPlainHeaderActions(actions, preferredPrimaryId).map((action) => (_jsx(RenderEditActionButton, { action: action, Button: Button, Dialog: Dialog, hideIcon: true, onError: onError }, action.id))) }));
26
+ }
27
+ const primary = primaryHeaderAction(actions, preferredPrimaryId);
28
+ const rest = actions.filter((a) => a.id !== primary?.id);
29
+ return (_jsxs(_Fragment, { children: [primary !== undefined && (_jsx(RenderEditActionButton, { action: primary, Button: Button, Dialog: Dialog, hideIcon: true, onError: onError }, primary.id)), _jsx(ActionOverflowMenu, { label: t("kumiko.list.row-actions.more"), testId: overflowTestId, items: rest.map(toMenuItem) }), pendingActionDialog] }));
30
+ }
@@ -1,6 +1,6 @@
1
1
  import type { ScreenDefinition } from "@cosmicdrift/kumiko-framework/ui-types";
2
- import type { FormValues, ListRowViewModel, Translate } from "@cosmicdrift/kumiko-headless";
3
2
  import { type ReactNode } from "react";
3
+ import type { FormValues, ListRowViewModel, Translate } from "../headless/index.ts";
4
4
  import { type ListSort } from "../hooks/use-list-url-state.ts";
5
5
  import type { FeatureSchema } from "./feature-schema.ts";
6
6
  import { qualifyScreenId } from "./qualify-screen-id.ts";