@mgamadeus/ddd-admin-ui 0.1.0-rc.6 → 0.2.1

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 (572) hide show
  1. package/.claude/skills/ddd-admin-ui-specialist/SKILL.md +56 -2
  2. package/CHANGELOG.md +243 -1
  3. package/README.md +266 -26
  4. package/STANDARDS.md +173 -2
  5. package/dist/components.css +27 -3
  6. package/dist/data/DeltaText.d.ts +29 -0
  7. package/dist/data/DeltaText.d.ts.map +1 -0
  8. package/dist/data/DeltaText.js +36 -0
  9. package/dist/data/DeltaText.js.map +1 -0
  10. package/dist/data/MetricGrid.d.ts +15 -0
  11. package/dist/data/MetricGrid.d.ts.map +1 -0
  12. package/dist/data/MetricGrid.js +17 -0
  13. package/dist/data/MetricGrid.js.map +1 -0
  14. package/dist/data/MetricTile.d.ts +32 -0
  15. package/dist/data/MetricTile.d.ts.map +1 -0
  16. package/dist/data/MetricTile.js +13 -0
  17. package/dist/data/MetricTile.js.map +1 -0
  18. package/dist/data/NoteList.d.ts +19 -0
  19. package/dist/data/NoteList.d.ts.map +1 -0
  20. package/dist/data/NoteList.js +23 -0
  21. package/dist/data/NoteList.js.map +1 -0
  22. package/dist/data/delta.d.ts +40 -0
  23. package/dist/data/delta.d.ts.map +1 -0
  24. package/dist/data/delta.js +40 -0
  25. package/dist/data/delta.js.map +1 -0
  26. package/dist/data/index.d.ts +6 -0
  27. package/dist/data/index.d.ts.map +1 -0
  28. package/dist/data/index.js +7 -0
  29. package/dist/data/index.js.map +1 -0
  30. package/dist/design-studio/contract.d.ts +162 -0
  31. package/dist/design-studio/contract.d.ts.map +1 -0
  32. package/dist/design-studio/contract.js +2 -0
  33. package/dist/design-studio/contract.js.map +1 -0
  34. package/dist/design-studio/index.d.ts +45 -0
  35. package/dist/design-studio/index.d.ts.map +1 -0
  36. package/dist/design-studio/index.js +47 -0
  37. package/dist/design-studio/index.js.map +1 -0
  38. package/dist/form/ColorValueField.d.ts +37 -0
  39. package/dist/form/ColorValueField.d.ts.map +1 -0
  40. package/dist/form/ColorValueField.js +74 -0
  41. package/dist/form/ColorValueField.js.map +1 -0
  42. package/dist/form/FormDialog.d.ts +1 -0
  43. package/dist/form/FormDialog.d.ts.map +1 -1
  44. package/dist/form/FormDialog.js +3 -1
  45. package/dist/form/FormDialog.js.map +1 -1
  46. package/dist/form/FormDrawer.d.ts +12 -1
  47. package/dist/form/FormDrawer.d.ts.map +1 -1
  48. package/dist/form/FormDrawer.js +9 -2
  49. package/dist/form/FormDrawer.js.map +1 -1
  50. package/dist/form/index.d.ts +2 -0
  51. package/dist/form/index.d.ts.map +1 -1
  52. package/dist/form/index.js +2 -0
  53. package/dist/form/index.js.map +1 -1
  54. package/dist/glass/QuickFilterPills.d.ts +7 -0
  55. package/dist/glass/QuickFilterPills.d.ts.map +1 -1
  56. package/dist/glass/QuickFilterPills.js +4 -3
  57. package/dist/glass/QuickFilterPills.js.map +1 -1
  58. package/dist/i18n/format.d.ts +3 -2
  59. package/dist/i18n/format.d.ts.map +1 -1
  60. package/dist/i18n/format.js +3 -2
  61. package/dist/i18n/format.js.map +1 -1
  62. package/dist/i18n/formatLocale.d.ts +8 -0
  63. package/dist/i18n/formatLocale.d.ts.map +1 -0
  64. package/dist/i18n/formatLocale.js +10 -0
  65. package/dist/i18n/formatLocale.js.map +1 -0
  66. package/dist/i18n/hints.json +498 -1
  67. package/dist/i18n/index.d.ts +1 -0
  68. package/dist/i18n/index.d.ts.map +1 -1
  69. package/dist/i18n/index.js +1 -0
  70. package/dist/i18n/index.js.map +1 -1
  71. package/dist/i18n-keys.json +4444 -351
  72. package/dist/list/ActionsHeaderText.d.ts +5 -0
  73. package/dist/list/ActionsHeaderText.d.ts.map +1 -0
  74. package/dist/list/ActionsHeaderText.js +9 -0
  75. package/dist/list/ActionsHeaderText.js.map +1 -0
  76. package/dist/list/Combobox.d.ts +11 -1
  77. package/dist/list/Combobox.d.ts.map +1 -1
  78. package/dist/list/Combobox.js +10 -7
  79. package/dist/list/Combobox.js.map +1 -1
  80. package/dist/list/EntityListBody.d.ts +9 -1
  81. package/dist/list/EntityListBody.d.ts.map +1 -1
  82. package/dist/list/EntityListBody.js +5 -3
  83. package/dist/list/EntityListBody.js.map +1 -1
  84. package/dist/list/EntityListBulkBar.d.ts +45 -3
  85. package/dist/list/EntityListBulkBar.d.ts.map +1 -1
  86. package/dist/list/EntityListBulkBar.js +31 -5
  87. package/dist/list/EntityListBulkBar.js.map +1 -1
  88. package/dist/list/EntityListEmpty.d.ts +9 -3
  89. package/dist/list/EntityListEmpty.d.ts.map +1 -1
  90. package/dist/list/EntityListEmpty.js +3 -3
  91. package/dist/list/EntityListEmpty.js.map +1 -1
  92. package/dist/list/EntityListTable.d.ts +3 -2
  93. package/dist/list/EntityListTable.d.ts.map +1 -1
  94. package/dist/list/EntityListTable.js +12 -8
  95. package/dist/list/EntityListTable.js.map +1 -1
  96. package/dist/list/EntityListToolbar.d.ts +30 -0
  97. package/dist/list/EntityListToolbar.d.ts.map +1 -1
  98. package/dist/list/EntityListToolbar.js +18 -4
  99. package/dist/list/EntityListToolbar.js.map +1 -1
  100. package/dist/list/EntityListViewToggle.d.ts +4 -1
  101. package/dist/list/EntityListViewToggle.d.ts.map +1 -1
  102. package/dist/list/EntityListViewToggle.js +15 -4
  103. package/dist/list/EntityListViewToggle.js.map +1 -1
  104. package/dist/list/cells.d.ts +10 -2
  105. package/dist/list/cells.d.ts.map +1 -1
  106. package/dist/list/cells.js +15 -6
  107. package/dist/list/cells.js.map +1 -1
  108. package/dist/list/columns.d.ts +85 -0
  109. package/dist/list/columns.d.ts.map +1 -0
  110. package/dist/list/columns.js +88 -0
  111. package/dist/list/columns.js.map +1 -0
  112. package/dist/list/filters.d.ts +19 -1
  113. package/dist/list/filters.d.ts.map +1 -1
  114. package/dist/list/filters.js +47 -3
  115. package/dist/list/filters.js.map +1 -1
  116. package/dist/list/index.d.ts +6 -0
  117. package/dist/list/index.d.ts.map +1 -1
  118. package/dist/list/index.js +3 -0
  119. package/dist/list/index.js.map +1 -1
  120. package/dist/logic/browser/normalizeImage.d.ts +69 -0
  121. package/dist/logic/browser/normalizeImage.d.ts.map +1 -0
  122. package/dist/logic/browser/normalizeImage.js +147 -0
  123. package/dist/logic/browser/normalizeImage.js.map +1 -0
  124. package/dist/logic/index.d.ts +25 -2
  125. package/dist/logic/index.d.ts.map +1 -1
  126. package/dist/logic/index.js +15 -1
  127. package/dist/logic/index.js.map +1 -1
  128. package/dist/logic/pure/colorValue.d.ts +22 -0
  129. package/dist/logic/pure/colorValue.d.ts.map +1 -0
  130. package/dist/logic/pure/colorValue.js +34 -0
  131. package/dist/logic/pure/colorValue.js.map +1 -0
  132. package/dist/logic/pure/confirm.d.ts +1 -0
  133. package/dist/logic/pure/confirm.d.ts.map +1 -1
  134. package/dist/logic/pure/confirm.js.map +1 -1
  135. package/dist/logic/pure/dateRangePresets.d.ts +33 -0
  136. package/dist/logic/pure/dateRangePresets.d.ts.map +1 -0
  137. package/dist/logic/pure/dateRangePresets.js +41 -0
  138. package/dist/logic/pure/dateRangePresets.js.map +1 -0
  139. package/dist/logic/pure/format.d.ts +3 -3
  140. package/dist/logic/pure/format.d.ts.map +1 -1
  141. package/dist/logic/pure/format.js +13 -12
  142. package/dist/logic/pure/format.js.map +1 -1
  143. package/dist/logic/pure/imageCrop.d.ts +99 -0
  144. package/dist/logic/pure/imageCrop.d.ts.map +1 -0
  145. package/dist/logic/pure/imageCrop.js +198 -0
  146. package/dist/logic/pure/imageCrop.js.map +1 -0
  147. package/dist/logic/pure/injectedApi.d.ts +83 -0
  148. package/dist/logic/pure/injectedApi.d.ts.map +1 -0
  149. package/dist/logic/pure/injectedApi.js +87 -0
  150. package/dist/logic/pure/injectedApi.js.map +1 -0
  151. package/dist/logic/pure/listTracks.d.ts +14 -2
  152. package/dist/logic/pure/listTracks.d.ts.map +1 -1
  153. package/dist/logic/pure/listTracks.js +15 -4
  154. package/dist/logic/pure/listTracks.js.map +1 -1
  155. package/dist/logic/pure/locales.d.ts +22 -0
  156. package/dist/logic/pure/locales.d.ts.map +1 -1
  157. package/dist/logic/pure/locales.js +43 -0
  158. package/dist/logic/pure/locales.js.map +1 -1
  159. package/dist/logic/pure/navigation.d.ts +159 -0
  160. package/dist/logic/pure/navigation.d.ts.map +1 -0
  161. package/dist/logic/pure/navigation.js +158 -0
  162. package/dist/logic/pure/navigation.js.map +1 -0
  163. package/dist/logic/pure/runSequential.d.ts +42 -0
  164. package/dist/logic/pure/runSequential.d.ts.map +1 -1
  165. package/dist/logic/pure/runSequential.js +65 -13
  166. package/dist/logic/pure/runSequential.js.map +1 -1
  167. package/dist/logic/pure/textLimits.d.ts +18 -0
  168. package/dist/logic/pure/textLimits.d.ts.map +1 -0
  169. package/dist/logic/pure/textLimits.js +14 -0
  170. package/dist/logic/pure/textLimits.js.map +1 -0
  171. package/dist/logic/react/textLimits.d.ts +8 -0
  172. package/dist/logic/react/textLimits.d.ts.map +1 -0
  173. package/dist/logic/react/textLimits.js +9 -0
  174. package/dist/logic/react/textLimits.js.map +1 -0
  175. package/dist/logic/react/useEntityTranslations.d.ts +16 -1
  176. package/dist/logic/react/useEntityTranslations.d.ts.map +1 -1
  177. package/dist/logic/react/useEntityTranslations.js +18 -4
  178. package/dist/logic/react/useEntityTranslations.js.map +1 -1
  179. package/dist/logic/react/useMediaQuery.d.ts +14 -0
  180. package/dist/logic/react/useMediaQuery.d.ts.map +1 -0
  181. package/dist/logic/react/useMediaQuery.js +24 -0
  182. package/dist/logic/react/useMediaQuery.js.map +1 -0
  183. package/dist/logic/react/useMemoryUrlState.d.ts +13 -0
  184. package/dist/logic/react/useMemoryUrlState.d.ts.map +1 -0
  185. package/dist/logic/react/useMemoryUrlState.js +41 -0
  186. package/dist/logic/react/useMemoryUrlState.js.map +1 -0
  187. package/dist/logic/react/useOptimisticRowPatches.d.ts +16 -0
  188. package/dist/logic/react/useOptimisticRowPatches.d.ts.map +1 -0
  189. package/dist/logic/react/useOptimisticRowPatches.js +39 -0
  190. package/dist/logic/react/useOptimisticRowPatches.js.map +1 -0
  191. package/dist/markdown/MarkdownEditor.d.ts +36 -0
  192. package/dist/markdown/MarkdownEditor.d.ts.map +1 -0
  193. package/dist/markdown/MarkdownEditor.js +36 -0
  194. package/dist/markdown/MarkdownEditor.js.map +1 -0
  195. package/dist/markdown/MarkdownPreview.d.ts +15 -0
  196. package/dist/markdown/MarkdownPreview.d.ts.map +1 -0
  197. package/dist/markdown/MarkdownPreview.js +17 -0
  198. package/dist/markdown/MarkdownPreview.js.map +1 -0
  199. package/dist/markdown/index.d.ts +7 -0
  200. package/dist/markdown/index.d.ts.map +1 -0
  201. package/dist/markdown/index.js +9 -0
  202. package/dist/markdown/index.js.map +1 -0
  203. package/dist/markdown/loadMarkdownLibrary.d.ts +28 -0
  204. package/dist/markdown/loadMarkdownLibrary.d.ts.map +1 -0
  205. package/dist/markdown/loadMarkdownLibrary.js +40 -0
  206. package/dist/markdown/loadMarkdownLibrary.js.map +1 -0
  207. package/dist/markdown/markdownPipeline.d.ts +20 -0
  208. package/dist/markdown/markdownPipeline.d.ts.map +1 -0
  209. package/dist/markdown/markdownPipeline.js +50 -0
  210. package/dist/markdown/markdownPipeline.js.map +1 -0
  211. package/dist/markdown/renderMarkdownEditor.d.ts +18 -0
  212. package/dist/markdown/renderMarkdownEditor.d.ts.map +1 -0
  213. package/dist/markdown/renderMarkdownEditor.js +14 -0
  214. package/dist/markdown/renderMarkdownEditor.js.map +1 -0
  215. package/dist/markdown/useMarkdownLibrary.d.ts +24 -0
  216. package/dist/markdown/useMarkdownLibrary.d.ts.map +1 -0
  217. package/dist/markdown/useMarkdownLibrary.js +47 -0
  218. package/dist/markdown/useMarkdownLibrary.js.map +1 -0
  219. package/dist/media/ImageCropDialog.d.ts +48 -0
  220. package/dist/media/ImageCropDialog.d.ts.map +1 -0
  221. package/dist/media/ImageCropDialog.js +203 -0
  222. package/dist/media/ImageCropDialog.js.map +1 -0
  223. package/dist/media/MediaItemField.d.ts.map +1 -1
  224. package/dist/media/MediaItemField.js +3 -1
  225. package/dist/media/MediaItemField.js.map +1 -1
  226. package/dist/media/MediaItemPickerDialog.d.ts +1 -0
  227. package/dist/media/MediaItemPickerDialog.d.ts.map +1 -1
  228. package/dist/media/MediaItemPickerDialog.js +3 -1
  229. package/dist/media/MediaItemPickerDialog.js.map +1 -1
  230. package/dist/media/index.d.ts +2 -0
  231. package/dist/media/index.d.ts.map +1 -1
  232. package/dist/media/index.js +2 -0
  233. package/dist/media/index.js.map +1 -1
  234. package/dist/next/index.d.ts +1 -0
  235. package/dist/next/index.d.ts.map +1 -1
  236. package/dist/next/index.js +1 -0
  237. package/dist/next/index.js.map +1 -1
  238. package/dist/next/useNextPathname.d.ts +7 -0
  239. package/dist/next/useNextPathname.d.ts.map +1 -0
  240. package/dist/next/useNextPathname.js +9 -0
  241. package/dist/next/useNextPathname.js.map +1 -0
  242. package/dist/page/DetailHeader.d.ts.map +1 -1
  243. package/dist/page/DetailHeader.js +3 -1
  244. package/dist/page/DetailHeader.js.map +1 -1
  245. package/dist/page/MaintenanceActionCard.d.ts +29 -0
  246. package/dist/page/MaintenanceActionCard.d.ts.map +1 -0
  247. package/dist/page/MaintenanceActionCard.js +21 -0
  248. package/dist/page/MaintenanceActionCard.js.map +1 -0
  249. package/dist/page/PageHeader.d.ts.map +1 -1
  250. package/dist/page/PageHeader.js +3 -1
  251. package/dist/page/PageHeader.js.map +1 -1
  252. package/dist/page/RouteError.d.ts +26 -0
  253. package/dist/page/RouteError.d.ts.map +1 -0
  254. package/dist/page/RouteError.js +35 -0
  255. package/dist/page/RouteError.js.map +1 -0
  256. package/dist/page/RouteLoading.d.ts +16 -0
  257. package/dist/page/RouteLoading.d.ts.map +1 -0
  258. package/dist/page/RouteLoading.js +17 -0
  259. package/dist/page/RouteLoading.js.map +1 -0
  260. package/dist/page/SectionHeader.d.ts.map +1 -1
  261. package/dist/page/SectionHeader.js +3 -1
  262. package/dist/page/SectionHeader.js.map +1 -1
  263. package/dist/page/index.d.ts +6 -0
  264. package/dist/page/index.d.ts.map +1 -1
  265. package/dist/page/index.js +5 -0
  266. package/dist/page/index.js.map +1 -1
  267. package/dist/primitives/alert.d.ts +1 -1
  268. package/dist/primitives/badge.d.ts +1 -1
  269. package/dist/primitives/confirmDialogView.d.ts +1 -0
  270. package/dist/primitives/confirmDialogView.d.ts.map +1 -1
  271. package/dist/primitives/confirmDialogView.js +3 -1
  272. package/dist/primitives/confirmDialogView.js.map +1 -1
  273. package/dist/primitives/descriptionContent.d.ts +8 -0
  274. package/dist/primitives/descriptionContent.d.ts.map +1 -0
  275. package/dist/primitives/descriptionContent.js +7 -0
  276. package/dist/primitives/descriptionContent.js.map +1 -0
  277. package/dist/primitives/index.d.ts +1 -0
  278. package/dist/primitives/index.d.ts.map +1 -1
  279. package/dist/primitives/index.js +1 -0
  280. package/dist/primitives/index.js.map +1 -1
  281. package/dist/primitives/pathname.d.ts +22 -0
  282. package/dist/primitives/pathname.d.ts.map +1 -0
  283. package/dist/primitives/pathname.js +23 -0
  284. package/dist/primitives/pathname.js.map +1 -0
  285. package/dist/primitives/segmented-control.d.ts +37 -3
  286. package/dist/primitives/segmented-control.d.ts.map +1 -1
  287. package/dist/primitives/segmented-control.js +45 -10
  288. package/dist/primitives/segmented-control.js.map +1 -1
  289. package/dist/provider/AdminUiProvider.d.ts +2 -2
  290. package/dist/provider/AdminUiProvider.d.ts.map +1 -1
  291. package/dist/provider/AdminUiProvider.js +14 -3
  292. package/dist/provider/AdminUiProvider.js.map +1 -1
  293. package/dist/provider/index.d.ts +1 -1
  294. package/dist/provider/index.d.ts.map +1 -1
  295. package/dist/provider/types.d.ts +19 -0
  296. package/dist/provider/types.d.ts.map +1 -1
  297. package/dist/scripts/check-contrast.mjs +353 -0
  298. package/dist/shell/AccountMenu.d.ts +51 -0
  299. package/dist/shell/AccountMenu.d.ts.map +1 -0
  300. package/dist/shell/AccountMenu.js +34 -0
  301. package/dist/shell/AccountMenu.js.map +1 -0
  302. package/dist/shell/AppShell.d.ts +68 -0
  303. package/dist/shell/AppShell.d.ts.map +1 -0
  304. package/dist/shell/AppShell.js +56 -0
  305. package/dist/shell/AppShell.js.map +1 -0
  306. package/dist/shell/LanguageMenu.d.ts +36 -0
  307. package/dist/shell/LanguageMenu.d.ts.map +1 -0
  308. package/dist/shell/LanguageMenu.js +33 -0
  309. package/dist/shell/LanguageMenu.js.map +1 -0
  310. package/dist/shell/NavItemMarks.d.ts +21 -0
  311. package/dist/shell/NavItemMarks.d.ts.map +1 -0
  312. package/dist/shell/NavItemMarks.js +30 -0
  313. package/dist/shell/NavItemMarks.js.map +1 -0
  314. package/dist/shell/ShellBreadcrumbs.d.ts +26 -0
  315. package/dist/shell/ShellBreadcrumbs.d.ts.map +1 -0
  316. package/dist/shell/ShellBreadcrumbs.js +78 -0
  317. package/dist/shell/ShellBreadcrumbs.js.map +1 -0
  318. package/dist/shell/ShellDocumentTitle.d.ts +27 -0
  319. package/dist/shell/ShellDocumentTitle.d.ts.map +1 -0
  320. package/dist/shell/ShellDocumentTitle.js +50 -0
  321. package/dist/shell/ShellDocumentTitle.js.map +1 -0
  322. package/dist/shell/ShellMobileMenu.d.ts +33 -0
  323. package/dist/shell/ShellMobileMenu.d.ts.map +1 -0
  324. package/dist/shell/ShellMobileMenu.js +33 -0
  325. package/dist/shell/ShellMobileMenu.js.map +1 -0
  326. package/dist/shell/ShellNavLink.d.ts +18 -0
  327. package/dist/shell/ShellNavLink.d.ts.map +1 -0
  328. package/dist/shell/ShellNavLink.js +16 -0
  329. package/dist/shell/ShellNavLink.js.map +1 -0
  330. package/dist/shell/ShellNavList.d.ts +18 -0
  331. package/dist/shell/ShellNavList.d.ts.map +1 -0
  332. package/dist/shell/ShellNavList.js +45 -0
  333. package/dist/shell/ShellNavList.js.map +1 -0
  334. package/dist/shell/ShellNavRail.d.ts +11 -0
  335. package/dist/shell/ShellNavRail.d.ts.map +1 -0
  336. package/dist/shell/ShellNavRail.js +97 -0
  337. package/dist/shell/ShellNavRail.js.map +1 -0
  338. package/dist/shell/ShellSidebar.d.ts +32 -0
  339. package/dist/shell/ShellSidebar.d.ts.map +1 -0
  340. package/dist/shell/ShellSidebar.js +29 -0
  341. package/dist/shell/ShellSidebar.js.map +1 -0
  342. package/dist/shell/ShellTopBar.d.ts +23 -0
  343. package/dist/shell/ShellTopBar.d.ts.map +1 -0
  344. package/dist/shell/ShellTopBar.js +25 -0
  345. package/dist/shell/ShellTopBar.js.map +1 -0
  346. package/dist/shell/index.d.ts +28 -0
  347. package/dist/shell/index.d.ts.map +1 -0
  348. package/dist/shell/index.js +19 -0
  349. package/dist/shell/index.js.map +1 -0
  350. package/dist/shell/navClasses.d.ts +12 -0
  351. package/dist/shell/navClasses.d.ts.map +1 -0
  352. package/dist/shell/navClasses.js +14 -0
  353. package/dist/shell/navClasses.js.map +1 -0
  354. package/dist/shell/shellContext.d.ts +30 -0
  355. package/dist/shell/shellContext.d.ts.map +1 -0
  356. package/dist/shell/shellContext.js +7 -0
  357. package/dist/shell/shellContext.js.map +1 -0
  358. package/dist/shell/useShellShortcut.d.ts +12 -0
  359. package/dist/shell/useShellShortcut.d.ts.map +1 -0
  360. package/dist/shell/useShellShortcut.js +42 -0
  361. package/dist/shell/useShellShortcut.js.map +1 -0
  362. package/dist/shell/useSidebarCollapsed.d.ts +10 -0
  363. package/dist/shell/useSidebarCollapsed.d.ts.map +1 -0
  364. package/dist/shell/useSidebarCollapsed.js +49 -0
  365. package/dist/shell/useSidebarCollapsed.js.map +1 -0
  366. package/dist/shell-background/ShaderBackground.d.ts +27 -0
  367. package/dist/shell-background/ShaderBackground.d.ts.map +1 -0
  368. package/dist/shell-background/ShaderBackground.js +92 -0
  369. package/dist/shell-background/ShaderBackground.js.map +1 -0
  370. package/dist/shell-background/ShaderCanvas.d.ts +16 -0
  371. package/dist/shell-background/ShaderCanvas.d.ts.map +1 -0
  372. package/dist/shell-background/ShaderCanvas.js +197 -0
  373. package/dist/shell-background/ShaderCanvas.js.map +1 -0
  374. package/dist/shell-background/index.d.ts +5 -0
  375. package/dist/shell-background/index.d.ts.map +1 -0
  376. package/dist/shell-background/index.js +5 -0
  377. package/dist/shell-background/index.js.map +1 -0
  378. package/dist/shell-background/shader.d.ts +81 -0
  379. package/dist/shell-background/shader.d.ts.map +1 -0
  380. package/dist/shell-background/shader.js +194 -0
  381. package/dist/shell-background/shader.js.map +1 -0
  382. package/dist/showcase/Showcase.d.ts +12 -2
  383. package/dist/showcase/Showcase.d.ts.map +1 -1
  384. package/dist/showcase/Showcase.js +24 -6
  385. package/dist/showcase/Showcase.js.map +1 -1
  386. package/dist/showcase/coverage.d.ts.map +1 -1
  387. package/dist/showcase/coverage.js +55 -4
  388. package/dist/showcase/coverage.js.map +1 -1
  389. package/dist/showcase/fixtures.d.ts +9 -0
  390. package/dist/showcase/fixtures.d.ts.map +1 -0
  391. package/dist/showcase/fixtures.js +268 -0
  392. package/dist/showcase/fixtures.js.map +1 -0
  393. package/dist/showcase/index.d.ts +2 -0
  394. package/dist/showcase/index.d.ts.map +1 -1
  395. package/dist/showcase/index.js +1 -0
  396. package/dist/showcase/index.js.map +1 -1
  397. package/dist/showcase/sections/DataShowcase.d.ts +3 -0
  398. package/dist/showcase/sections/DataShowcase.d.ts.map +1 -0
  399. package/dist/showcase/sections/DataShowcase.js +15 -0
  400. package/dist/showcase/sections/DataShowcase.js.map +1 -0
  401. package/dist/showcase/sections/FormAdditionsShowcase.d.ts +3 -0
  402. package/dist/showcase/sections/FormAdditionsShowcase.d.ts.map +1 -0
  403. package/dist/showcase/sections/FormAdditionsShowcase.js +15 -0
  404. package/dist/showcase/sections/FormAdditionsShowcase.js.map +1 -0
  405. package/dist/showcase/sections/FormShowcase.d.ts.map +1 -1
  406. package/dist/showcase/sections/FormShowcase.js +2 -1
  407. package/dist/showcase/sections/FormShowcase.js.map +1 -1
  408. package/dist/showcase/sections/ListAdditionsShowcase.d.ts +3 -0
  409. package/dist/showcase/sections/ListAdditionsShowcase.d.ts.map +1 -0
  410. package/dist/showcase/sections/ListAdditionsShowcase.js +61 -0
  411. package/dist/showcase/sections/ListAdditionsShowcase.js.map +1 -0
  412. package/dist/showcase/sections/ListShowcase.d.ts.map +1 -1
  413. package/dist/showcase/sections/ListShowcase.js +2 -1
  414. package/dist/showcase/sections/ListShowcase.js.map +1 -1
  415. package/dist/showcase/sections/MarkdownShowcase.d.ts +21 -0
  416. package/dist/showcase/sections/MarkdownShowcase.d.ts.map +1 -0
  417. package/dist/showcase/sections/MarkdownShowcase.js +28 -0
  418. package/dist/showcase/sections/MarkdownShowcase.js.map +1 -0
  419. package/dist/showcase/sections/MediaCropShowcase.d.ts +3 -0
  420. package/dist/showcase/sections/MediaCropShowcase.d.ts.map +1 -0
  421. package/dist/showcase/sections/MediaCropShowcase.js +56 -0
  422. package/dist/showcase/sections/MediaCropShowcase.js.map +1 -0
  423. package/dist/showcase/sections/MediaShowcase.d.ts.map +1 -1
  424. package/dist/showcase/sections/MediaShowcase.js +2 -1
  425. package/dist/showcase/sections/MediaShowcase.js.map +1 -1
  426. package/dist/showcase/sections/PageAdditionsShowcase.d.ts +3 -0
  427. package/dist/showcase/sections/PageAdditionsShowcase.d.ts.map +1 -0
  428. package/dist/showcase/sections/PageAdditionsShowcase.js +7 -0
  429. package/dist/showcase/sections/PageAdditionsShowcase.js.map +1 -0
  430. package/dist/showcase/sections/PageShowcase.d.ts.map +1 -1
  431. package/dist/showcase/sections/PageShowcase.js +4 -3
  432. package/dist/showcase/sections/PageShowcase.js.map +1 -1
  433. package/dist/showcase/sections/PrimitivesAdditionsShowcase.d.ts +3 -0
  434. package/dist/showcase/sections/PrimitivesAdditionsShowcase.d.ts.map +1 -0
  435. package/dist/showcase/sections/PrimitivesAdditionsShowcase.js +20 -0
  436. package/dist/showcase/sections/PrimitivesAdditionsShowcase.js.map +1 -0
  437. package/dist/showcase/sections/PrimitivesShowcase.d.ts.map +1 -1
  438. package/dist/showcase/sections/PrimitivesShowcase.js +3 -2
  439. package/dist/showcase/sections/PrimitivesShowcase.js.map +1 -1
  440. package/dist/showcase/sections/ShellShowcase.d.ts +3 -0
  441. package/dist/showcase/sections/ShellShowcase.d.ts.map +1 -0
  442. package/dist/showcase/sections/ShellShowcase.js +71 -0
  443. package/dist/showcase/sections/ShellShowcase.js.map +1 -0
  444. package/dist/showcase/sections/TranslationsShowcase.d.ts +2 -0
  445. package/dist/showcase/sections/TranslationsShowcase.d.ts.map +1 -1
  446. package/dist/showcase/sections/TranslationsShowcase.js +5 -1
  447. package/dist/showcase/sections/TranslationsShowcase.js.map +1 -1
  448. package/dist/showcase/sections/WorkersShowcase.d.ts +3 -0
  449. package/dist/showcase/sections/WorkersShowcase.d.ts.map +1 -0
  450. package/dist/showcase/sections/WorkersShowcase.js +15 -0
  451. package/dist/showcase/sections/WorkersShowcase.js.map +1 -0
  452. package/dist/tokens.json +276 -5
  453. package/dist/translations/AppTranslationKeyDrawer.d.ts +14 -0
  454. package/dist/translations/AppTranslationKeyDrawer.d.ts.map +1 -0
  455. package/dist/translations/AppTranslationKeyDrawer.js +197 -0
  456. package/dist/translations/AppTranslationKeyDrawer.js.map +1 -0
  457. package/dist/translations/AppTranslationsScreen.d.ts +25 -0
  458. package/dist/translations/AppTranslationsScreen.d.ts.map +1 -0
  459. package/dist/translations/AppTranslationsScreen.js +139 -0
  460. package/dist/translations/AppTranslationsScreen.js.map +1 -0
  461. package/dist/translations/ConfigImportCards.d.ts +26 -0
  462. package/dist/translations/ConfigImportCards.d.ts.map +1 -0
  463. package/dist/translations/ConfigImportCards.js +59 -0
  464. package/dist/translations/ConfigImportCards.js.map +1 -0
  465. package/dist/translations/LanguagesScreen.d.ts +20 -0
  466. package/dist/translations/LanguagesScreen.d.ts.map +1 -0
  467. package/dist/translations/LanguagesScreen.js +110 -0
  468. package/dist/translations/LanguagesScreen.js.map +1 -0
  469. package/dist/translations/LocalesScreen.d.ts +22 -0
  470. package/dist/translations/LocalesScreen.d.ts.map +1 -0
  471. package/dist/translations/LocalesScreen.js +92 -0
  472. package/dist/translations/LocalesScreen.js.map +1 -0
  473. package/dist/translations/TranslatableField.d.ts +13 -2
  474. package/dist/translations/TranslatableField.d.ts.map +1 -1
  475. package/dist/translations/TranslatableField.js +23 -5
  476. package/dist/translations/TranslatableField.js.map +1 -1
  477. package/dist/translations/TranslatableInput.d.ts.map +1 -1
  478. package/dist/translations/TranslatableInput.js +4 -1
  479. package/dist/translations/TranslatableInput.js.map +1 -1
  480. package/dist/translations/TranslatableMarkdown.d.ts +2 -0
  481. package/dist/translations/TranslatableMarkdown.d.ts.map +1 -1
  482. package/dist/translations/TranslatableMarkdown.js +12 -7
  483. package/dist/translations/TranslatableMarkdown.js.map +1 -1
  484. package/dist/translations/TranslationCompleteness.d.ts +11 -0
  485. package/dist/translations/TranslationCompleteness.d.ts.map +1 -0
  486. package/dist/translations/TranslationCompleteness.js +73 -0
  487. package/dist/translations/TranslationCompleteness.js.map +1 -0
  488. package/dist/translations/adminFormat.d.ts +27 -0
  489. package/dist/translations/adminFormat.d.ts.map +1 -0
  490. package/dist/translations/adminFormat.js +39 -0
  491. package/dist/translations/adminFormat.js.map +1 -0
  492. package/dist/translations/adminTypes.d.ts +136 -0
  493. package/dist/translations/adminTypes.d.ts.map +1 -0
  494. package/dist/translations/adminTypes.js +9 -0
  495. package/dist/translations/adminTypes.js.map +1 -0
  496. package/dist/translations/api.d.ts +225 -0
  497. package/dist/translations/api.d.ts.map +1 -0
  498. package/dist/translations/api.js +132 -0
  499. package/dist/translations/api.js.map +1 -0
  500. package/dist/translations/focusOverLimit.d.ts +7 -0
  501. package/dist/translations/focusOverLimit.d.ts.map +1 -0
  502. package/dist/translations/focusOverLimit.js +23 -0
  503. package/dist/translations/focusOverLimit.js.map +1 -0
  504. package/dist/translations/index.d.ts +22 -0
  505. package/dist/translations/index.d.ts.map +1 -1
  506. package/dist/translations/index.js +13 -0
  507. package/dist/translations/index.js.map +1 -1
  508. package/dist/translations/useContentLocales.d.ts +17 -0
  509. package/dist/translations/useContentLocales.d.ts.map +1 -0
  510. package/dist/translations/useContentLocales.js +33 -0
  511. package/dist/translations/useContentLocales.js.map +1 -0
  512. package/dist/translations/useEntityTranslator.d.ts +34 -0
  513. package/dist/translations/useEntityTranslator.d.ts.map +1 -0
  514. package/dist/translations/useEntityTranslator.js +49 -0
  515. package/dist/translations/useEntityTranslator.js.map +1 -0
  516. package/dist/workers/WorkerRestartButton.d.ts +19 -0
  517. package/dist/workers/WorkerRestartButton.d.ts.map +1 -0
  518. package/dist/workers/WorkerRestartButton.js +59 -0
  519. package/dist/workers/WorkerRestartButton.js.map +1 -0
  520. package/dist/workers/WorkerTransportScreen.d.ts +24 -0
  521. package/dist/workers/WorkerTransportScreen.d.ts.map +1 -0
  522. package/dist/workers/WorkerTransportScreen.js +121 -0
  523. package/dist/workers/WorkerTransportScreen.js.map +1 -0
  524. package/dist/workers/WorkersOverviewScreen.d.ts +30 -0
  525. package/dist/workers/WorkersOverviewScreen.d.ts.map +1 -0
  526. package/dist/workers/WorkersOverviewScreen.js +61 -0
  527. package/dist/workers/WorkersOverviewScreen.js.map +1 -0
  528. package/dist/workers/api.d.ts +113 -0
  529. package/dist/workers/api.d.ts.map +1 -0
  530. package/dist/workers/api.js +73 -0
  531. package/dist/workers/api.js.map +1 -0
  532. package/dist/workers/charts.d.ts +94 -0
  533. package/dist/workers/charts.d.ts.map +1 -0
  534. package/dist/workers/charts.js +238 -0
  535. package/dist/workers/charts.js.map +1 -0
  536. package/dist/workers/format.d.ts +96 -0
  537. package/dist/workers/format.d.ts.map +1 -0
  538. package/dist/workers/format.js +231 -0
  539. package/dist/workers/format.js.map +1 -0
  540. package/dist/workers/history.d.ts +20 -0
  541. package/dist/workers/history.d.ts.map +1 -0
  542. package/dist/workers/history.js +84 -0
  543. package/dist/workers/history.js.map +1 -0
  544. package/dist/workers/index.d.ts +24 -0
  545. package/dist/workers/index.d.ts.map +1 -0
  546. package/dist/workers/index.js +19 -0
  547. package/dist/workers/index.js.map +1 -0
  548. package/dist/workers/overview.d.ts +72 -0
  549. package/dist/workers/overview.d.ts.map +1 -0
  550. package/dist/workers/overview.js +323 -0
  551. package/dist/workers/overview.js.map +1 -0
  552. package/dist/workers/status.d.ts +11 -0
  553. package/dist/workers/status.d.ts.map +1 -0
  554. package/dist/workers/status.js +106 -0
  555. package/dist/workers/status.js.map +1 -0
  556. package/dist/workers/transport.d.ts +78 -0
  557. package/dist/workers/transport.d.ts.map +1 -0
  558. package/dist/workers/transport.js +407 -0
  559. package/dist/workers/transport.js.map +1 -0
  560. package/dist/workers/types.d.ts +234 -0
  561. package/dist/workers/types.d.ts.map +1 -0
  562. package/dist/workers/types.js +8 -0
  563. package/dist/workers/types.js.map +1 -0
  564. package/dist/workers/useWorkersWindow.d.ts +12 -0
  565. package/dist/workers/useWorkersWindow.d.ts.map +1 -0
  566. package/dist/workers/useWorkersWindow.js +38 -0
  567. package/dist/workers/useWorkersWindow.js.map +1 -0
  568. package/dist/workers/window.d.ts +30 -0
  569. package/dist/workers/window.d.ts.map +1 -0
  570. package/dist/workers/window.js +39 -0
  571. package/dist/workers/window.js.map +1 -0
  572. package/package.json +39 -4
@@ -0,0 +1,49 @@
1
+ 'use client';
2
+ import { normalizeTranslationsStore, parseTranslationKey } from '@mgamadeus/ddd-web/contract';
3
+ import { useCallback } from 'react';
4
+ import { useTranslate } from "../i18n/useTranslate.js";
5
+ /** The PHP class of a locale in a request body. */
6
+ export const LOCALE_OBJECT_TYPE = 'DDD\\Domain\\Common\\Entities\\Locales\\Locale';
7
+ const isRecord = (value) => typeof value === 'object' && value !== null && !Array.isArray(value);
8
+ /**
9
+ * The AI translation of an entity draft (`POST …/translateEntities`), one request per target locale: feed it to
10
+ * `useTranslationRunner` (`./logic`), which runs the locales a few at a time and lets each finish on its own — a long
11
+ * entity in many locales in one request runs into gateway timeouts. Aborting the runner aborts the requests in flight.
12
+ * Answers `undefined` while `enabled` is false.
13
+ *
14
+ * ```ts
15
+ * const translator = useEntityTranslator(translationsApi);
16
+ * const runner = useTranslationRunner();
17
+ * runner.run(targets, async (locale, signal) => applyStore(await translator!({ entity: draft, locale, signal })));
18
+ * ```
19
+ */
20
+ export const useEntityTranslator = (api, { defaultLocale = 'en::FORMAL', enabled = true } = {}) => {
21
+ const { t } = useTranslate();
22
+ const [translateEntities] = api.useTranslateEntitiesMutation();
23
+ const defaultLanguage = parseTranslationKey(defaultLocale)?.languageCode ?? 'en';
24
+ const translator = useCallback(async ({ entity, locale, signal }) => {
25
+ const languageCode = parseTranslationKey(locale)?.languageCode ?? locale;
26
+ const request = translateEntities({
27
+ entitiesToTranslate: { elements: [entity] },
28
+ localesToTranslate: {
29
+ elements: [{ objectType: LOCALE_OBJECT_TYPE, languageCode, countryShortCode: null, isDefaultLocaleForLanguage: languageCode === defaultLanguage }],
30
+ },
31
+ });
32
+ if (signal.aborted)
33
+ request.abort();
34
+ const abort = () => request.abort();
35
+ signal.addEventListener('abort', abort, { once: true });
36
+ try {
37
+ const translated = (await request.unwrap()).translatedEntities?.elements?.[0];
38
+ if (!translated)
39
+ throw new Error(t('No translation returned for %locale%', { replacements: { locale } }));
40
+ const infos = translated.translationInfos;
41
+ return isRecord(infos) ? normalizeTranslationsStore(infos.translationsStore) : {};
42
+ }
43
+ finally {
44
+ signal.removeEventListener('abort', abort);
45
+ }
46
+ }, [translateEntities, defaultLanguage, t]);
47
+ return enabled ? translator : undefined;
48
+ };
49
+ //# sourceMappingURL=useEntityTranslator.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useEntityTranslator.js","sourceRoot":"","sources":["../../src/translations/useEntityTranslator.ts"],"names":[],"mappings":"AAAA,YAAY,CAAC;AAEb,OAAO,EAAE,0BAA0B,EAAE,mBAAmB,EAA0B,MAAM,6BAA6B,CAAC;AACtH,OAAO,EAAE,WAAW,EAAE,MAAM,OAAO,CAAC;AAEpC,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AAIvD,mDAAmD;AACnD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,KAAK,EAAE,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC;QACxD,IAAI,CAAC;YACH,MAAM,UAAU,GAAG,CAAC,MAAM,OAAO,CAAC,MAAM,EAAE,CAAC,CAAC,kBAAkB,EAAE,QAAQ,EAAE,CAAC,CAAC,CAAC,CAAC;YAC9E,IAAI,CAAC,UAAU;gBAAE,MAAM,IAAI,KAAK,CAAC,CAAC,CAAC,sCAAsC,EAAE,EAAE,YAAY,EAAE,EAAE,MAAM,EAAE,EAAE,CAAC,CAAC,CAAC;YAC1G,MAAM,KAAK,GAAG,UAAU,CAAC,gBAAgB,CAAC;YAC1C,OAAO,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,0BAA0B,CAAC,KAAK,CAAC,iBAAiB,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;QACpF,CAAC;gBAAS,CAAC;YACT,MAAM,CAAC,mBAAmB,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC;QAC7C,CAAC;IACH,CAAC,EACD,CAAC,iBAAiB,EAAE,eAAe,EAAE,CAAC,CAAC,CACxC,CAAC;IAEF,OAAO,OAAO,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,SAAS,CAAC;AAC1C,CAAC,CAAC"}
@@ -0,0 +1,19 @@
1
+ import type { WorkersApi } from './api.js';
2
+ export interface WorkerRestartButtonProps {
3
+ api: WorkersApi;
4
+ /** One transport; without it every live worker process is asked. */
5
+ transport?: string;
6
+ /** Live processes now (the confirmation names the count). */
7
+ liveProcessCount?: number;
8
+ /** `icon` for a table row, `button` for a page header. */
9
+ variant?: 'button' | 'icon';
10
+ /** The monitoring is off: the backend refuses a restart (400), the button says why. */
11
+ monitoringEnabled?: boolean;
12
+ }
13
+ /**
14
+ * The only action of the workers screens (no scaling controls): a restart request. Each live process stops after its
15
+ * current message and whatever runs the workers starts it again; a process inside a long job finishes that job first.
16
+ * Confirmation first, then the asked processes. Disabled while `WriteAccessProvider` says no, or the monitoring is off.
17
+ */
18
+ export declare const WorkerRestartButton: ({ api, transport, liveProcessCount, variant, monitoringEnabled }: WorkerRestartButtonProps) => import("react").JSX.Element;
19
+ //# sourceMappingURL=WorkerRestartButton.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"WorkerRestartButton.d.ts","sourceRoot":"","sources":["../../src/workers/WorkerRestartButton.tsx"],"names":[],"mappings":"AAYA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAI3C,MAAM,WAAW,wBAAwB;IACvC,GAAG,EAAE,UAAU,CAAC;IAChB,oEAAoE;IACpE,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,6DAA6D;IAC7D,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,0DAA0D;IAC1D,OAAO,CAAC,EAAE,QAAQ,GAAG,MAAM,CAAC;IAC5B,uFAAuF;IACvF,iBAAiB,CAAC,EAAE,OAAO,CAAC;CAC7B;AASD;;;;GAIG;AACH,eAAO,MAAM,mBAAmB,GAAI,kEAAoF,wBAAwB,gCAqI/I,CAAC"}
@@ -0,0 +1,59 @@
1
+ 'use client';
2
+ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
3
+ import { normalizeDddError } from '@mgamadeus/ddd-web/contract';
4
+ import { RotateCcw } from 'lucide-react';
5
+ import { useState } from 'react';
6
+ import { useTranslate } from "../i18n/useTranslate.js";
7
+ import { notify } from "../logic/pure/notify.js";
8
+ import { useWriteAccess } from "../logic/react/writeAccess.js";
9
+ import { StatusCallout } from "../page/StatusCallout.js";
10
+ import { Button } from "../primitives/button.js";
11
+ import { Dialog, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogTitle } from "../primitives/dialog.js";
12
+ import { shortClassName, shortHost } from "./format.js";
13
+ const processCount = (t, count) => t('{count, plural, one {# process} other {# processes}}', { count });
14
+ /**
15
+ * The only action of the workers screens (no scaling controls): a restart request. Each live process stops after its
16
+ * current message and whatever runs the workers starts it again; a process inside a long job finishes that job first.
17
+ * Confirmation first, then the asked processes. Disabled while `WriteAccessProvider` says no, or the monitoring is off.
18
+ */
19
+ export const WorkerRestartButton = ({ api, transport, liveProcessCount, variant = 'button', monitoringEnabled = true }) => {
20
+ const { t } = useTranslate();
21
+ const writeAccess = useWriteAccess();
22
+ const [restart, restartState] = api.useRestartMutation();
23
+ const [open, setOpen] = useState(false);
24
+ const [result, setResult] = useState(null);
25
+ const [errorMessage, setErrorMessage] = useState(null);
26
+ const label = transport ? t('Restart workers of %transport%', { replacements: { transport } }) : t('Restart all workers');
27
+ const disabledReason = !writeAccess.allowed
28
+ ? (writeAccess.reason ?? t('Writes are switched off'))
29
+ : !monitoringEnabled
30
+ ? t('The worker monitoring is off: the live processes are not known, so none can be asked.')
31
+ : undefined;
32
+ const openDialog = () => {
33
+ setResult(null);
34
+ setErrorMessage(null);
35
+ setOpen(true);
36
+ };
37
+ const submit = async () => {
38
+ if (!writeAccess.allowed)
39
+ return;
40
+ setErrorMessage(null);
41
+ try {
42
+ const response = await restart(transport ? { transport } : {}).unwrap();
43
+ const restartResult = { requestedProcessCount: response.requestedProcessCount, processes: response.workerProcesses.elements ?? [] };
44
+ setResult(restartResult);
45
+ notify.success(t('Restart requested for %processes%', { replacements: { processes: processCount(t, restartResult.requestedProcessCount) } }));
46
+ }
47
+ catch (restartError) {
48
+ setErrorMessage(normalizeDddError(restartError, t('The restart could not be requested.')).message);
49
+ }
50
+ };
51
+ return (_jsxs("span", { className: "contents", onClick: event => event.stopPropagation(), children: [_jsx("span", { className: "inline-flex", title: disabledReason ?? label, "data-row-action-ignore": true, children: variant === 'icon' ? (_jsx(Button, { type: "button", variant: "ghost", size: "icon-sm", "aria-label": label, disabled: Boolean(disabledReason), onClick: openDialog, children: _jsx(RotateCcw, {}) })) : (_jsxs(Button, { type: "button", variant: "outline", disabled: Boolean(disabledReason), onClick: openDialog, children: [_jsx(RotateCcw, { "aria-hidden": true }), transport ? t('Restart workers') : t('Restart all workers')] })) }), _jsx(Dialog, { open: open, onOpenChange: setOpen, children: _jsx(DialogContent, { className: "sm:max-w-lg", children: result ? (_jsxs(_Fragment, { children: [_jsxs(DialogHeader, { children: [_jsx(DialogTitle, { children: result.requestedProcessCount === 0
52
+ ? t('No live process to ask')
53
+ : t('Asked %processes% to restart', { replacements: { processes: processCount(t, result.requestedProcessCount) } }) }), _jsx(DialogDescription, { children: result.requestedProcessCount === 0
54
+ ? t('No worker process is running right now: nothing to restart.')
55
+ : t('Each one stops after its current message and is started again. Its stop shows as “Restart requested” under Processes.') })] }), result.processes.length > 0 && (_jsx("ul", { className: "max-h-64 divide-y overflow-y-auto rounded-xl bg-tint", children: result.processes.map(process => (_jsxs("li", { className: "space-y-0.5 px-3 py-2", title: process.processKey ?? undefined, children: [_jsx("p", { className: "truncate font-mono text-xs", children: t('%host% · pid %pid%', { replacements: { host: shortHost(process.hostName), pid: process.processId ?? '—' } }) }), _jsxs("p", { className: "truncate text-xs text-muted-foreground", children: [process.transport, ' · ', process.currentMessageClass
56
+ ? t('finishing %messageClass% first', { replacements: { messageClass: shortClassName(process.currentMessageClass) } })
57
+ : t('idle, stops at its next tick')] })] }, process.processKey ?? String(process.id)))) })), _jsx(DialogFooter, { children: _jsx(Button, { type: "button", onClick: () => setOpen(false), children: t('Done', { context: 'dialog-action' }) }) })] })) : (_jsxs(_Fragment, { children: [_jsxs(DialogHeader, { children: [_jsx(DialogTitle, { children: transport ? t('Restart the workers of %transport%?', { replacements: { transport } }) : t('Restart all workers?') }), _jsx(DialogDescription, { children: t('Every live process stops after its current message and is started again with the current code and settings. A process inside a long job finishes that job first; nothing is scaled and no message is lost.') })] }), liveProcessCount !== undefined && (_jsxs("p", { className: "text-sm", children: [_jsx("span", { className: "font-semibold tabular-nums", children: processCount(t, liveProcessCount) }), ' ', _jsx("span", { className: "text-muted-foreground", children: t('live right now.') })] })), errorMessage && _jsx(StatusCallout, { tone: "destructive", size: "compact", title: errorMessage }), _jsxs(DialogFooter, { children: [_jsx(Button, { type: "button", variant: "outline", onClick: () => setOpen(false), children: t('Cancel', { context: 'dialog-action' }) }), _jsxs(Button, { type: "button", disabled: !writeAccess.allowed || restartState.isLoading, title: writeAccess.allowed ? undefined : writeAccess.reason, onClick: () => void submit(), children: [_jsx(RotateCcw, { "aria-hidden": true }), restartState.isLoading ? t('Requesting…') : t('Request restart')] })] })] })) }) })] }));
58
+ };
59
+ //# sourceMappingURL=WorkerRestartButton.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"WorkerRestartButton.js","sourceRoot":"","sources":["../../src/workers/WorkerRestartButton.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,EAAE,iBAAiB,EAAE,MAAM,6BAA6B,CAAC;AAChE,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACzC,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAEjC,OAAO,EAAoB,YAAY,EAAE,MAAM,yBAAyB,CAAC;AACzE,OAAO,EAAE,MAAM,EAAE,MAAM,yBAAyB,CAAC;AACjD,OAAO,EAAE,cAAc,EAAE,MAAM,+BAA+B,CAAC;AAC/D,OAAO,EAAE,aAAa,EAAE,MAAM,0BAA2B,CAAC;AAC1D,OAAO,EAAE,MAAM,EAAE,MAAM,yBAA0B,CAAC;AAClD,OAAO,EAAE,MAAM,EAAE,aAAa,EAAE,iBAAiB,EAAE,YAAY,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,yBAA0B,CAAC;AAE7H,OAAO,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAoBxD,MAAM,YAAY,GAAG,CAAC,CAAc,EAAE,KAAa,EAAU,EAAE,CAAC,CAAC,CAAC,sDAAsD,EAAE,EAAE,KAAK,EAAE,CAAC,CAAC;AAErI;;;;GAIG;AACH,MAAM,CAAC,MAAM,mBAAmB,GAAG,CAAC,EAAE,GAAG,EAAE,SAAS,EAAE,gBAAgB,EAAE,OAAO,GAAG,QAAQ,E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CAAC,KAAK,CAAC,YAClE,CAAC,CAAC,QAAQ,EAAE,EAAE,OAAO,EAAE,eAAe,EAAE,CAAC,GACnC,EACT,MAAC,MAAM,IACL,IAAI,EAAC,QAAQ,EACb,QAAQ,EAAE,CAAC,WAAW,CAAC,OAAO,IAAI,YAAY,CAAC,SAAS,EACxD,KAAK,EAAE,WAAW,CAAC,OAAO,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,WAAW,CAAC,MAAM,EAC3D,OAAO,EAAE,GAAG,EAAE,CAAC,KAAK,MAAM,EAAE,aAE5B,KAAC,SAAS,0BAAe,EACxB,YAAY,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,iBAAiB,CAAC,IAC1D,IACI,IACd,CACJ,GACa,GACT,IACJ,CACR,CAAC;AACJ,CAAC,CAAC"}
@@ -0,0 +1,24 @@
1
+ import type { UrlStateAdapter } from '../logic/pure/urlListState.js';
2
+ import type { WorkersApi } from './api.js';
3
+ import { type WorkerTransportTab } from './overview.js';
4
+ export interface WorkerTransportScreenProps {
5
+ api: WorkersApi;
6
+ /** The Messenger transport name (the host's route parameter, decoded). */
7
+ transport: string;
8
+ /** The workers overview (the back link). */
9
+ backHref: string;
10
+ /** Where window, tab and filters live (`window`, `tab`, `outcome`, `process`); without one they live in component state. */
11
+ urlStateAdapter?: UrlStateAdapter;
12
+ /** The first tab without an adapter (`processes` for a link from the live panel). */
13
+ initialTab?: WorkerTransportTab;
14
+ /** Live data refresh in ms while the tab is visible (default 15 s; 0 = off). */
15
+ pollingIntervalMs?: number;
16
+ /** Pins the end of the chart window (a showcase, a test). */
17
+ historyAnchorMs?: number;
18
+ }
19
+ /**
20
+ * One transport: state and worker list entry, the restart request, and three tabs — Overview (facts, charts over a
21
+ * window, message classes, live processes), Message runs and Processes. With a URL adapter every view is a link.
22
+ */
23
+ export declare const WorkerTransportScreen: ({ api, transport, backHref, urlStateAdapter, initialTab, pollingIntervalMs, historyAnchorMs, }: WorkerTransportScreenProps) => import("react").JSX.Element;
24
+ //# sourceMappingURL=WorkerTransportScreen.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"WorkerTransportScreen.d.ts","sourceRoot":"","sources":["../../src/workers/WorkerTransportScreen.tsx"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAC;AAUrE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAG3C,OAAO,EAAE,KAAK,kBAAkB,EAAsB,MAAM,gBAAgB,CAAC;AAoH7E,MAAM,WAAW,0BAA0B;IACzC,GAAG,EAAE,UAAU,CAAC;IAChB,0EAA0E;IAC1E,SAAS,EAAE,MAAM,CAAC;IAClB,4CAA4C;IAC5C,QAAQ,EAAE,MAAM,CAAC;IACjB,4HAA4H;IAC5H,eAAe,CAAC,EAAE,eAAe,CAAC;IAClC,qFAAqF;IACrF,UAAU,CAAC,EAAE,kBAAkB,CAAC;IAChC,gFAAgF;IAChF,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,6DAA6D;IAC7D,eAAe,CAAC,EAAE,MAAM,CAAC;CAC1B;AAED;;;GAGG;AACH,eAAO,MAAM,qBAAqB,GAAI,gGAQnC,0BAA0B,gCAkG5B,CAAC"}
@@ -0,0 +1,121 @@
1
+ 'use client';
2
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
+ import { getErrorStatus, normalizeDddError } from '@mgamadeus/ddd-web/contract';
4
+ import { m } from "../i18n/store.js";
5
+ import { useTranslate } from "../i18n/useTranslate.js";
6
+ import { EntityListCard } from "../list/EntityListCard.js";
7
+ import { StatusBadge } from "../list/StatusBadge.js";
8
+ import { useMemoryUrlState } from "../logic/react/useMemoryUrlState.js";
9
+ import { useUrlListState } from "../logic/react/useUrlListState.js";
10
+ import { DefinitionList } from "../page/DefinitionList.js";
11
+ import { EntityDetailShell } from "../page/EntityDetailShell.js";
12
+ import { EntityTabs } from "../page/EntityTabs.js";
13
+ import { SectionHeader } from "../page/SectionHeader.js";
14
+ import { StatusCallout } from "../page/StatusCallout.js";
15
+ import { Card, CardContent } from "../primitives/card.js";
16
+ import { Skeleton } from "../primitives/skeleton.js";
17
+ import { formatClockTime, formatCount, formatDurationMs, shortClassName, waitingStateContext, waitingStateLabel } from "./format.js";
18
+ import { WorkersWindowSwitch } from "./history.js";
19
+ import { WorkerProcessRange } from "./overview.js";
20
+ import { toWorkerTransportState, WORKER_TRANSPORT_STATE } from "./status.js";
21
+ import { toWorkerProcessFilter, toWorkerRunOutcomeFilter, WorkerMessageClassesTable, WorkerMessageRunsTab, WorkerProcessesTab, WorkerProcessesTable, WorkerTransportCharts, } from "./transport.js";
22
+ import { usePageVisible, useWorkersWindow } from "./useWorkersWindow.js";
23
+ import { WorkerRestartButton } from "./WorkerRestartButton.js";
24
+ import { DEFAULT_WORKERS_WINDOW, toWorkersWindowPreset, WORKERS_LIST_POLL_MS } from "./window.js";
25
+ const TABS = [
26
+ { id: 'overview', label: m('Overview') },
27
+ { id: 'runs', label: m('Message runs') },
28
+ { id: 'processes', label: m('Processes') },
29
+ ];
30
+ const toTransportTab = (value) => (value === 'runs' || value === 'processes' ? value : 'overview');
31
+ const LIST_KEYS = ['window', 'tab', 'outcome', 'process'];
32
+ /** One line of the worker list entry: scaling, limits, message log. */
33
+ const definitionText = (overview, t) => {
34
+ if (!overview)
35
+ return null;
36
+ const definition = overview.definition;
37
+ if (!overview.isDefined || !definition)
38
+ return t('No entry in the worker list');
39
+ return [
40
+ overview.isAutoscaled
41
+ ? t('Autoscaled %min%–%max%', { replacements: { min: overview.effectiveMin ?? 0, max: overview.effectiveMax ?? '?' } })
42
+ : t('Fixed at %max%', { replacements: { max: overview.effectiveMax ?? definition.replicas ?? '?' } }),
43
+ definition.limit ? t('restarts after %count% messages', { replacements: { count: formatCount(definition.limit) } }) : null,
44
+ definition.memoryLimit ? t('memory limit %limit%', { replacements: { limit: definition.memoryLimit } }) : null,
45
+ definition.scaleDownAfter ? t('scales down after %seconds% s idle', { replacements: { seconds: definition.scaleDownAfter } }) : null,
46
+ definition.messageLog ? t('message log: %value%', { replacements: { value: definition.messageLog } }) : null,
47
+ ]
48
+ .filter((part) => Boolean(part))
49
+ .join(' · ');
50
+ };
51
+ const TransportFacts = ({ overview, recentWindowSeconds }) => {
52
+ const { t } = useTranslate();
53
+ const failed = (overview.thrownCount ?? 0) + (overview.caughtCount ?? 0);
54
+ const minutes = Math.round(recentWindowSeconds / 60);
55
+ return (_jsx(Card, { className: "gap-0 py-0", children: _jsx(CardContent, { className: "p-4 sm:p-6", children: _jsx(DefinitionList, { columns: 4, items: [
56
+ {
57
+ label: m('State'),
58
+ value: _jsx(StatusBadge, { value: toWorkerTransportState(overview.state), map: WORKER_TRANSPORT_STATE }),
59
+ hint: overview.stuckSince ? t('Stuck since %time%', { replacements: { time: formatClockTime(overview.stuckSince) ?? '' } }) : undefined,
60
+ },
61
+ {
62
+ label: t('Waiting', { context: 'live-stat' }),
63
+ value: overview.waiting === null || overview.waiting === undefined
64
+ ? t(waitingStateLabel(overview.waitingState), waitingStateContext(overview.waitingState))
65
+ : formatCount(overview.waiting),
66
+ hint: overview.waitingSampledAt ? t('Counted at %time%', { replacements: { time: formatClockTime(overview.waitingSampledAt) ?? '' } }) : undefined,
67
+ },
68
+ { label: t('In work', { context: 'live-stat' }), value: formatCount(overview.inFlight ?? 0) },
69
+ {
70
+ label: m('Processes'),
71
+ value: (_jsx(WorkerProcessRange, { live: overview.liveProcessCount ?? 0, min: overview.effectiveMin, max: overview.effectiveMax, isAutoscaled: overview.isAutoscaled ?? false })),
72
+ },
73
+ { label: t('Handled (%minutes% min)', { replacements: { minutes } }), value: formatCount(overview.handledCount ?? 0) },
74
+ {
75
+ label: t('Failed (%minutes% min)', { replacements: { minutes } }),
76
+ value: formatCount(failed),
77
+ hint: failed > 0
78
+ ? t('%thrown% thrown · %caught% caught', { replacements: { thrown: formatCount(overview.thrownCount), caught: formatCount(overview.caughtCount) } })
79
+ : undefined,
80
+ },
81
+ { label: t('Avg duration (%minutes% min)', { replacements: { minutes } }), value: formatDurationMs(overview.durationAverageMs) },
82
+ {
83
+ label: t('Avg wait (%minutes% min)', { replacements: { minutes } }),
84
+ value: formatDurationMs(overview.waitAverageMs),
85
+ hint: overview.waitAverageMs === null || overview.waitAverageMs === undefined ? t('no dispatch times') : undefined,
86
+ },
87
+ ...(overview.lastErrorClass
88
+ ? [
89
+ {
90
+ label: m('Last error'),
91
+ wide: true,
92
+ value: (_jsxs("span", { className: "text-sm", children: [_jsx("span", { className: "font-medium text-destructive", children: shortClassName(overview.lastErrorClass) }), overview.lastErrorMessage ? ` · ${overview.lastErrorMessage}` : ''] })),
93
+ hint: overview.lastErrorAt ? t('at %time%', { replacements: { time: formatClockTime(overview.lastErrorAt) ?? '' } }) : undefined,
94
+ },
95
+ ]
96
+ : []),
97
+ ] }) }) }));
98
+ };
99
+ /**
100
+ * One transport: state and worker list entry, the restart request, and three tabs — Overview (facts, charts over a
101
+ * window, message classes, live processes), Message runs and Processes. With a URL adapter every view is a link.
102
+ */
103
+ export const WorkerTransportScreen = ({ api, transport, backHref, urlStateAdapter, initialTab, pollingIntervalMs = WORKERS_LIST_POLL_MS, historyAnchorMs, }) => {
104
+ const { t } = useTranslate();
105
+ const visible = usePageVisible();
106
+ const memory = useMemoryUrlState(initialTab && initialTab !== 'overview' ? { tab: initialTab } : {});
107
+ const { values, setValue } = useUrlListState(LIST_KEYS, { adapter: urlStateAdapter ?? memory.urlStateAdapter, uncounted: LIST_KEYS });
108
+ const tab = toTransportTab(values.tab);
109
+ const windowPreset = toWorkersWindowPreset(values.window);
110
+ const workersWindow = useWorkersWindow(windowPreset, historyAnchorMs);
111
+ const detailQuery = api.useTransportDetailQuery({ transport, from: workersWindow.from, to: workersWindow.to, stepSeconds: workersWindow.stepSeconds }, { skip: !transport, pollingInterval: visible ? pollingIntervalMs : 0 });
112
+ const detail = detailQuery.currentData?.workerTransportDetail ?? detailQuery.data?.workerTransportDetail;
113
+ const overview = detail?.transport;
114
+ const shellError = detailQuery.isError && !detail
115
+ ? getErrorStatus(detailQuery.error) === 404
116
+ ? t('There is no transport “%transport%”.', { replacements: { transport } })
117
+ : normalizeDddError(detailQuery.error, t('The transport could not be loaded.')).message
118
+ : undefined;
119
+ return (_jsx("div", { "data-slot": "worker-transport-screen", children: _jsxs(EntityDetailShell, { title: transport, fallbackTitle: t('Transport'), description: definitionText(overview, t), back: { href: backHref, label: t('Back to workers') }, isLoading: !detail && !shellError, error: shellError, actions: _jsx(WorkerRestartButton, { api: api, transport: transport, liveProcessCount: overview?.liveProcessCount }), children: [_jsx(EntityTabs, { "aria-label": t('Transport sections'), tabs: TABS, activeId: tab, onSelect: id => setValue('tab', id === 'overview' ? '' : id), align: "center", className: "mb-6" }), tab === 'overview' && (_jsxs("div", { className: "space-y-10", children: [overview ? _jsx(TransportFacts, { overview: overview, recentWindowSeconds: detail?.recentWindowSeconds ?? 900 }) : _jsx(Skeleton, { className: "h-40 rounded-2xl" }), _jsxs("section", { children: [_jsx(SectionHeader, { title: t('History', { context: 'workers-section' }), description: t('The transport over the window; point at a chart to read one step.'), actions: _jsx(WorkersWindowSwitch, { value: windowPreset, onChange: preset => setValue('window', preset === DEFAULT_WORKERS_WINDOW ? '' : preset) }) }), detail ? (_jsx(WorkerTransportCharts, { detail: detail, windowMs: workersWindow.windowMs, isRefreshing: detailQuery.isFetching && !detailQuery.isLoading })) : detailQuery.isError ? (_jsx(StatusCallout, { tone: "destructive", title: t('The history could not be loaded.') })) : (_jsx("div", { className: "grid grid-cols-1 gap-4 md:grid-cols-2", children: Array.from({ length: 4 }, (_, index) => (_jsx(Skeleton, { className: "h-[290px] rounded-2xl" }, index))) }))] }), _jsxs("section", { children: [_jsx(SectionHeader, { title: t('Message classes'), description: t('What the workers did per message class in the window.') }), _jsx(EntityListCard, { label: m('Message classes'), children: detail ? _jsx(WorkerMessageClassesTable, { messageClasses: detail.messageClasses?.elements ?? [] }) : _jsx(Skeleton, { className: "m-4 h-24 rounded-xl" }) })] }), _jsxs("section", { children: [_jsx(SectionHeader, { title: t('Live processes'), description: t('Running or busy now. A busy process is inside a handler and cannot report until it returns.') }), _jsx(EntityListCard, { label: m('Live processes'), children: _jsx(WorkerProcessesTable, { processes: detail?.processes?.elements ?? [], isLoading: !detail, emptyMessage: t('No live process right now.'), live: true }) })] })] })), tab === 'runs' && (_jsx(WorkerMessageRunsTab, { api: api, transport: transport, outcome: toWorkerRunOutcomeFilter(values.outcome), onOutcomeChange: outcome => setValue('outcome', outcome), messageLog: overview?.definition?.messageLog })), tab === 'processes' && (_jsx(WorkerProcessesTab, { api: api, transport: transport, filter: toWorkerProcessFilter(values.process), onFilterChange: filter => setValue('process', filter) }))] }) }));
120
+ };
121
+ //# sourceMappingURL=WorkerTransportScreen.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"WorkerTransportScreen.js","sourceRoot":"","sources":["../../src/workers/WorkerTransportScreen.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,EAAE,cAAc,EAAE,iBAAiB,EAAE,MAAM,6BAA6B,CAAC;AAEhF,OAAO,EAAE,CAAC,EAAE,MAAM,kBAAkB,CAAC;AACrC,OAAO,EAAoB,YAAY,EAAE,MAAM,yBAAyB,CAAC;AACzE,OAAO,EAAE,cAAc,EAAE,MAAM,2BAA4B,CAAC;AAC5D,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAyB,CAAC;AAEtD,OAAO,EAAE,iBAAiB,EAAE,MAAM,qCAAqC,CAAC;AACxE,OAAO,EAAE,eAAe,EAAE,MAAM,mCAAmC,CAAC;AACpE,OAAO,EAAE,cAAc,EAAE,MAAM,2BAA4B,CAAC;AAC5D,OAAO,EAAE,iBAAiB,EAAE,MAAM,8BAA+B,CAAC;AAClE,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAwB,CAAC;AACpD,OAAO,EAAE,aAAa,EA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AAW,IAAI,CACtB,KAAC,kBAAkB,IAAC,GAAG,EAAE,GAAG,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,EAAE,qBAAqB,CAAC,MAAM,CAAC,OAAO,CAAC,EAAE,cAAc,EAAE,MAAM,CAAC,EAAE,CAAC,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC,GAAI,CAC7J,IACiB,GAChB,CACP,CAAC;AACJ,CAAC,CAAC"}
@@ -0,0 +1,30 @@
1
+ import { type ReactNode } from 'react';
2
+ import type { UrlStateAdapter } from '../logic/pure/urlListState.js';
3
+ import type { WorkersApi } from './api.js';
4
+ import { type WorkerTransportHref } from './overview.js';
5
+ export interface WorkersOverviewScreenProps {
6
+ /** The hooks of `createWorkersApi`. */
7
+ api: WorkersApi;
8
+ /** The link of a transport's page (the host's route of `WorkerTransportScreen`). */
9
+ transportHref: WorkerTransportHref;
10
+ /**
11
+ * Where the window and the transport search live (`window`, `q`): the host's URL adapter, e.g.
12
+ * `useNextUrlStateAdapter({ listId: 'workers' })`. Without one they live in component state.
13
+ */
14
+ urlStateAdapter?: UrlStateAdapter;
15
+ title?: ReactNode;
16
+ description?: ReactNode;
17
+ /** Overview refresh in ms while the tab is visible (default 10 s; 0 = off). */
18
+ pollingIntervalMs?: number;
19
+ /** Pins the end of the history window (a showcase, a test); default: the current minute, sliding. */
20
+ historyAnchorMs?: number;
21
+ }
22
+ /**
23
+ * The workers of the application, read from the worker monitoring (`WorkersControllerTrait`): totals as tiles, two
24
+ * banners (monitoring off, sampler not running), the live row per transport with its processes, the throughput table,
25
+ * the history of every transport over a window, every transport with its state and the loops of the worker list. The
26
+ * overview refreshes every 10 s and the history every minute while the tab is visible. The only action is the restart
27
+ * request; there are no scaling controls.
28
+ */
29
+ export declare const WorkersOverviewScreen: ({ api, transportHref, urlStateAdapter, title, description, pollingIntervalMs, historyAnchorMs, }: WorkersOverviewScreenProps) => import("react").JSX.Element;
30
+ //# sourceMappingURL=WorkersOverviewScreen.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"WorkersOverviewScreen.d.ts","sourceRoot":"","sources":["../../src/workers/WorkersOverviewScreen.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,SAAS,EAAW,MAAM,OAAO,CAAC;AAMhD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAC;AAQrE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAG3C,OAAO,EAML,KAAK,mBAAmB,EAEzB,MAAM,gBAAgB,CAAC;AAOxB,MAAM,WAAW,0BAA0B;IACzC,uCAAuC;IACvC,GAAG,EAAE,UAAU,CAAC;IAChB,oFAAoF;IACpF,aAAa,EAAE,mBAAmB,CAAC;IACnC;;;OAGG;IACH,eAAe,CAAC,EAAE,eAAe,CAAC;IAClC,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB,WAAW,CAAC,EAAE,SAAS,CAAC;IACxB,+EAA+E;IAC/E,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,qGAAqG;IACrG,eAAe,CAAC,EAAE,MAAM,CAAC;CAC1B;AAED;;;;;;GAMG;AACH,eAAO,MAAM,qBAAqB,GAAI,kGAQnC,0BAA0B,gCAkJ5B,CAAC"}
@@ -0,0 +1,61 @@
1
+ 'use client';
2
+ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
3
+ import { normalizeDddError } from '@mgamadeus/ddd-web/contract';
4
+ import { RefreshCw } from 'lucide-react';
5
+ import { useMemo } from 'react';
6
+ import { m } from "../i18n/store.js";
7
+ import { useTranslate } from "../i18n/useTranslate.js";
8
+ import { EntityListCard } from "../list/EntityListCard.js";
9
+ import { EntityListToolbar } from "../list/EntityListToolbar.js";
10
+ import { useMemoryUrlState } from "../logic/react/useMemoryUrlState.js";
11
+ import { useUrlListState } from "../logic/react/useUrlListState.js";
12
+ import { PageSections } from "../page/PageLayout.js";
13
+ import { PageHeader } from "../page/PageHeader.js";
14
+ import { SectionHeader } from "../page/SectionHeader.js";
15
+ import { StatusCallout, StatusCalloutAction } from "../page/StatusCallout.js";
16
+ import { cn } from "../primitives/cn.js";
17
+ import { formatClockTime, parseWorkersTime, sortTransports } from "./format.js";
18
+ import { WorkersHistoryCharts, WorkersWindowSwitch } from "./history.js";
19
+ import { WorkerKpiTiles, WorkerKpiTilesSkeleton, WorkerLoopsCard, WorkersLivePanel, WorkersThroughputTable, WorkerTransportsTable, } from "./overview.js";
20
+ import { usePageVisible, useWorkersWindow } from "./useWorkersWindow.js";
21
+ import { WorkerRestartButton } from "./WorkerRestartButton.js";
22
+ import { DEFAULT_WORKERS_WINDOW, toWorkersWindowPreset, WORKERS_OVERVIEW_POLL_MS } from "./window.js";
23
+ const LIST_KEYS = ['window', 'q'];
24
+ /**
25
+ * The workers of the application, read from the worker monitoring (`WorkersControllerTrait`): totals as tiles, two
26
+ * banners (monitoring off, sampler not running), the live row per transport with its processes, the throughput table,
27
+ * the history of every transport over a window, every transport with its state and the loops of the worker list. The
28
+ * overview refreshes every 10 s and the history every minute while the tab is visible. The only action is the restart
29
+ * request; there are no scaling controls.
30
+ */
31
+ export const WorkersOverviewScreen = ({ api, transportHref, urlStateAdapter, title, description, pollingIntervalMs = WORKERS_OVERVIEW_POLL_MS, historyAnchorMs, }) => {
32
+ const { t } = useTranslate();
33
+ const visible = usePageVisible();
34
+ const memory = useMemoryUrlState();
35
+ const listState = useUrlListState(LIST_KEYS, { adapter: urlStateAdapter ?? memory.urlStateAdapter, uncounted: LIST_KEYS });
36
+ const { values, debounced, setValue } = listState;
37
+ const windowPreset = toWorkersWindowPreset(values.window);
38
+ const workersWindow = useWorkersWindow(windowPreset, historyAnchorMs);
39
+ const overviewQuery = api.useOverviewQuery(undefined, {
40
+ pollingInterval: visible ? pollingIntervalMs : 0,
41
+ refetchOnMountOrArgChange: true,
42
+ });
43
+ const overview = overviewQuery.data?.workersOverview;
44
+ const monitoringEnabled = overview?.monitoringEnabled ?? true;
45
+ const allTransports = useMemo(() => overview?.transports?.elements ?? [], [overview?.transports?.elements]);
46
+ const search = debounced.q.trim().toLowerCase();
47
+ const transports = useMemo(() => {
48
+ const sorted = sortTransports(allTransports);
49
+ return search ? sorted.filter(transport => (transport.transport ?? '').toLowerCase().includes(search)) : sorted;
50
+ }, [allTransports, search]);
51
+ const updatedAt = formatClockTime(overview?.generatedAt);
52
+ const nowMs = parseWorkersTime(overview?.generatedAt) ?? 0;
53
+ const overviewError = overviewQuery.isError ? normalizeDddError(overviewQuery.error, t('The worker overview could not be loaded.')).message : undefined;
54
+ return (_jsxs("div", { "data-slot": "workers-overview-screen", children: [_jsx(PageHeader, { title: title ?? t('Workers'), description: _jsxs(_Fragment, { children: [description ?? t('Messenger workers: queues, processes and message runs.'), updatedAt && (_jsxs("span", { className: "ml-2 inline-flex items-center gap-1 whitespace-nowrap", children: [_jsx(RefreshCw, { className: cn('size-3', overviewQuery.isFetching && 'animate-spin motion-reduce:animate-none'), "aria-hidden": true }), t('Updated %time%', { replacements: { time: updatedAt } })] }))] }), actions: _jsx(WorkerRestartButton, { api: api, liveProcessCount: overview?.totals?.liveProcessCount, monitoringEnabled: monitoringEnabled }) }), _jsxs(PageSections, { children: [_jsxs("div", { className: "space-y-4", children: [overviewError && !overview && (_jsx(StatusCallout, { tone: "destructive", title: t('The worker overview could not be loaded.'), description: overviewError, actions: _jsx(StatusCalloutAction, { onClick: () => void overviewQuery.refetch(), children: t('Retry') }) })), overview && overview.monitoringEnabled === false && (_jsx(StatusCallout, { tone: "warning", title: t('The worker monitoring is off'), description: t('Only the worker list and the live queue counts are shown: no processes, history or message runs. Switch it on and restart the workers.') })), overview?.monitoringEnabled && overview.samplerActive === false && (_jsx(StatusCallout, { tone: "warning", title: t('The sampler is not running'), description: t('The queue history has holes and lost processes are closed late. app:workers:sample must run every minute.') })), overview ? _jsx(WorkerKpiTiles, { overview: overview }) : !overviewError && _jsx(WorkerKpiTilesSkeleton, {})] }), overview && (_jsxs("section", { children: [_jsx(SectionHeader, { title: t('Live', { context: 'workers-section' }), description: t('Workers running against the configured range, messages in work and waiting.') }), _jsx(WorkersLivePanel, { transports: allTransports, processes: overview.processes?.elements ?? [], nowMs: nowMs, showProcesses: monitoringEnabled, transportHref: transportHref })] })), overview?.monitoringEnabled && (_jsxs("section", { children: [_jsx(SectionHeader, { title: t('Throughput'), description: t('Messages finished per transport in the last 5 and 15 minutes, the last hour and the last 24 hours, with the rate and what one worker finished per minute.') }), _jsx(WorkersThroughputTable, { transports: allTransports, totals: overview.totals, transportHref: transportHref })] })), monitoringEnabled && (_jsxs("section", { children: [_jsx(SectionHeader, { title: t('History', { context: 'workers-section' }), description: t('Every transport over the window; point at a chart to read one step.'), actions: _jsx(WorkersWindowSwitch, { value: windowPreset, onChange: preset => setValue('window', preset === DEFAULT_WORKERS_WINDOW ? '' : preset) }) }), _jsx(WorkersHistoryCharts, { api: api, window: workersWindow })] })), _jsxs("section", { children: [_jsx(SectionHeader, { title: t('Transports'), description: t('Most urgent first. Open a transport for its history, message runs and processes.') }), _jsx(EntityListCard, { label: m('Transports'), isRefetching: overviewQuery.isFetching && !overviewQuery.isLoading, toolbar: _jsx(EntityListToolbar, { search: {
55
+ value: values.q,
56
+ onChange: value => setValue('q', value),
57
+ placeholder: t('Search transports…'),
58
+ 'aria-label': t('Search transports'),
59
+ } }), children: _jsx(WorkerTransportsTable, { api: api, transports: transports, recentWindowSeconds: overview?.recentWindowSeconds, isLoading: overviewQuery.isLoading, error: overview ? undefined : overviewError, monitoringEnabled: monitoringEnabled, isSearchActive: Boolean(search), onClearSearch: () => setValue('q', ''), transportHref: transportHref }) })] }), overview && _jsx(WorkerLoopsCard, { loops: overview.loops?.elements ?? [] })] })] }));
60
+ };
61
+ //# sourceMappingURL=WorkersOverviewScreen.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"WorkersOverviewScreen.js","sourceRoot":"","sources":["../../src/workers/WorkersOverviewScreen.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC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GAAG,EAAE,KAAK,CAAC;wCACvC,WAAW,EAAE,CAAC,CAAC,oBAAoB,CAAC;wCACpC,YAAY,EAAE,CAAC,CAAC,mBAAmB,CAAC;qCACrC,GACD,YAGJ,KAAC,qBAAqB,IACpB,GAAG,EAAE,GAAG,EACR,UAAU,EAAE,UAAU,EACtB,mBAAmB,EAAE,QAAQ,EAAE,mBAAmB,EAClD,SAAS,EAAE,aAAa,CAAC,SAAS,EAClC,KAAK,EAAE,QAAQ,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,aAAa,EAC3C,iBAAiB,EAAE,iBAAiB,EACpC,cAAc,EAAE,OAAO,CAAC,MAAM,CAAC,EAC/B,aAAa,EAAE,GAAG,EAAE,CAAC,QAAQ,CAAC,GAAG,EAAE,EAAE,CAAC,EACtC,aAAa,EAAE,aAAa,GAC5B,GACa,IACT,EAET,QAAQ,IAAI,KAAC,eAAe,IAAC,KAAK,EAAE,QAAQ,CAAC,KAAK,EAAE,QAAQ,IAAI,EAAE,GAAI,IAC1D,IACX,CACP,CAAC;AACJ,CAAC,CAAC"}
@@ -0,0 +1,113 @@
1
+ import { type ApiMutationHook, type ApiQueryHook, type InjectableBaseApi, type InjectedRequest } from '../logic/pure/injectedApi.js';
2
+ import type { WorkerMessageRunsResponse, WorkerProcessesResponse, WorkersHistoryResponse, WorkersOverviewResponse, WorkersRestartArg, WorkersRestartResponse, WorkersWindowArg, WorkerTransportArg, WorkerTransportDetailResponse, WorkerTransportListArg } from './types.js';
3
+ /** The cache tag type of the workers operations (one per api; ids `LIVE`, `HISTORY`, `RUNS`). */
4
+ export declare const WORKERS_TAG = "AdminUiWorkers";
5
+ /** The hooks `createWorkersApi` returns; every workers screen takes them as its `api`. */
6
+ export interface WorkersApi {
7
+ /** `GET /overview`: every transport, the totals, the live processes, the loops. */
8
+ useOverviewQuery: ApiQueryHook<void, WorkersOverviewResponse>;
9
+ /** `GET /history?from&to&stepSeconds`: per transport and in total, over a window. */
10
+ useHistoryQuery: ApiQueryHook<WorkersWindowArg, WorkersHistoryResponse>;
11
+ /** `GET /transports/{transport}?from&to&stepSeconds` (404: unknown transport). */
12
+ useTransportDetailQuery: ApiQueryHook<WorkerTransportArg, WorkerTransportDetailResponse>;
13
+ /** `GET /transports/{transport}/messageRuns` (QueryOptions; newest first by default). */
14
+ useMessageRunsQuery: ApiQueryHook<WorkerTransportListArg, WorkerMessageRunsResponse>;
15
+ /** `GET /transports/{transport}/processes` (QueryOptions; newest first by default). */
16
+ useProcessesQuery: ApiQueryHook<WorkerTransportListArg, WorkerProcessesResponse>;
17
+ /** `POST /restart`: asks the live processes (of one transport, or all) to stop after their current message. */
18
+ useRestartMutation: ApiMutationHook<WorkersRestartArg, WorkersRestartResponse>;
19
+ }
20
+ export interface CreateWorkersApiOptions {
21
+ /** The host's RTK Query api (`createApi` with the React hooks module). */
22
+ baseApi: InjectableBaseApi;
23
+ /** Where the host mounts `WorkersControllerTrait`, without a trailing slash (`/api/admin/maintenance/workers`). */
24
+ apiPrefix: string;
25
+ }
26
+ /** The request of every operation, on `apiPrefix`. Pure: no RTK runtime. */
27
+ export declare const buildWorkersRequests: (apiPrefix: string) => {
28
+ overview: () => InjectedRequest;
29
+ history: (arg: WorkersWindowArg) => InjectedRequest;
30
+ transportDetail: ({ transport, ...window }: WorkerTransportArg) => InjectedRequest;
31
+ messageRuns: (arg: WorkerTransportListArg) => InjectedRequest;
32
+ processes: (arg: WorkerTransportListArg) => InjectedRequest;
33
+ restart: ({ transport }: WorkersRestartArg) => InjectedRequest;
34
+ };
35
+ /**
36
+ * The operations as injected (endpoint name → definition). Cache: the overview, the transport detail and the process
37
+ * lists provide `LIVE`, the history `HISTORY`, the message runs `RUNS`; the restart request invalidates `LIVE` (it
38
+ * changes `restartPending` and the processes' `restartRequestedAt`).
39
+ */
40
+ export declare const workersEndpointDefinitions: (apiPrefix: string) => {
41
+ readonly adminUiWorkersOverview: {
42
+ readonly kind: "query";
43
+ readonly request: () => InjectedRequest;
44
+ readonly providesTags: readonly [{
45
+ readonly type: "AdminUiWorkers";
46
+ readonly id: "LIVE";
47
+ }];
48
+ };
49
+ readonly adminUiWorkersHistory: {
50
+ readonly kind: "query";
51
+ readonly request: (arg: WorkersWindowArg) => InjectedRequest;
52
+ readonly providesTags: readonly [{
53
+ readonly type: "AdminUiWorkers";
54
+ readonly id: "HISTORY";
55
+ }];
56
+ };
57
+ readonly adminUiWorkerTransportDetail: {
58
+ readonly kind: "query";
59
+ readonly request: ({ transport, ...window }: WorkerTransportArg) => InjectedRequest;
60
+ readonly providesTags: readonly [{
61
+ readonly type: "AdminUiWorkers";
62
+ readonly id: "LIVE";
63
+ }, {
64
+ readonly type: "AdminUiWorkers";
65
+ readonly id: "HISTORY";
66
+ }];
67
+ };
68
+ readonly adminUiWorkerMessageRuns: {
69
+ readonly kind: "query";
70
+ readonly request: (arg: WorkerTransportListArg) => InjectedRequest;
71
+ readonly providesTags: readonly [{
72
+ readonly type: "AdminUiWorkers";
73
+ readonly id: "RUNS";
74
+ }];
75
+ };
76
+ readonly adminUiWorkerProcesses: {
77
+ readonly kind: "query";
78
+ readonly request: (arg: WorkerTransportListArg) => InjectedRequest;
79
+ readonly providesTags: readonly [{
80
+ readonly type: "AdminUiWorkers";
81
+ readonly id: "LIVE";
82
+ }];
83
+ };
84
+ readonly adminUiWorkersRestart: {
85
+ readonly kind: "mutation";
86
+ readonly request: ({ transport }: WorkersRestartArg) => InjectedRequest;
87
+ readonly invalidatesTags: readonly [{
88
+ readonly type: "AdminUiWorkers";
89
+ readonly id: "LIVE";
90
+ }];
91
+ };
92
+ };
93
+ /**
94
+ * Injects the workers operations into the host's RTK Query api and returns their hooks. Call it once at module scope;
95
+ * a second call with the same api and prefix returns the first result.
96
+ *
97
+ * ```ts
98
+ * export const workersApi = createWorkersApi({ baseApi: adminApi, apiPrefix: '/api/admin/maintenance/workers' });
99
+ * ```
100
+ */
101
+ export declare const createWorkersApi: ({ baseApi, apiPrefix }: CreateWorkersApiOptions) => WorkersApi;
102
+ /** Fixed answers of a `createStaticWorkersApi`; an operation without one stays loading. */
103
+ export interface StaticWorkersData {
104
+ overview?: WorkersOverviewResponse;
105
+ history?: (arg: WorkersWindowArg) => WorkersHistoryResponse | undefined;
106
+ transportDetail?: (arg: WorkerTransportArg) => WorkerTransportDetailResponse | undefined;
107
+ messageRuns?: (arg: WorkerTransportListArg) => WorkerMessageRunsResponse | undefined;
108
+ processes?: (arg: WorkerTransportListArg) => WorkerProcessesResponse | undefined;
109
+ restart?: (arg: WorkersRestartArg) => WorkersRestartResponse | Promise<WorkersRestartResponse>;
110
+ }
111
+ /** A `WorkersApi` answering fixed payloads, without a store or a request: for showcases, tests and design reviews. */
112
+ export declare const createStaticWorkersApi: (data: StaticWorkersData) => WorkersApi;
113
+ //# sourceMappingURL=api.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"api.d.ts","sourceRoot":"","sources":["../../src/workers/api.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,eAAe,EACpB,KAAK,YAAY,EACjB,KAAK,iBAAiB,EAEtB,KAAK,eAAe,EAMrB,MAAM,8BAA8B,CAAC;AACtC,OAAO,KAAK,EACV,yBAAyB,EACzB,uBAAuB,EACvB,sBAAsB,EACtB,uBAAuB,EACvB,iBAAiB,EACjB,sBAAsB,EACtB,gBAAgB,EAChB,kBAAkB,EAClB,6BAA6B,EAC7B,sBAAsB,EACvB,MAAM,YAAY,CAAC;AAEpB,iGAAiG;AACjG,eAAO,MAAM,WAAW,mBAAmB,CAAC;AAE5C,0FAA0F;AAC1F,MAAM,WAAW,UAAU;IACzB,mFAAmF;IACnF,gBAAgB,EAAE,YAAY,CAAC,IAAI,EAAE,uBAAuB,CAAC,CAAC;IAC9D,qFAAqF;IACrF,eAAe,EAAE,YAAY,CAAC,gBAAgB,EAAE,sBAAsB,CAAC,CAAC;IACxE,kFAAkF;IAClF,uBAAuB,EAAE,YAAY,CAAC,kBAAkB,EAAE,6BAA6B,CAAC,CAAC;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