@vertesia/ui 0.80.0-dev.20251121 → 0.80.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 (277) hide show
  1. package/README.md +105 -0
  2. package/lib/esm/core/components/MenuList.js +2 -5
  3. package/lib/esm/core/components/MenuList.js.map +1 -1
  4. package/lib/esm/core/components/MessageBox.js +1 -1
  5. package/lib/esm/core/components/MessageBox.js.map +1 -1
  6. package/lib/esm/core/components/shadcn/dialog.js +16 -2
  7. package/lib/esm/core/components/shadcn/dialog.js.map +1 -1
  8. package/lib/esm/core/components/shadcn/filters/filter/SelectFilter.js +6 -9
  9. package/lib/esm/core/components/shadcn/filters/filter/SelectFilter.js.map +1 -1
  10. package/lib/esm/core/components/shadcn/filters/filterBar.js +1 -1
  11. package/lib/esm/core/components/shadcn/filters/filterBar.js.map +1 -1
  12. package/lib/esm/core/components/shadcn/selectBox.js +23 -5
  13. package/lib/esm/core/components/shadcn/selectBox.js.map +1 -1
  14. package/lib/esm/core/components/shadcn/tabs.js +3 -3
  15. package/lib/esm/core/components/shadcn/tabs.js.map +1 -1
  16. package/lib/esm/env/index.js +3 -0
  17. package/lib/esm/env/index.js.map +1 -1
  18. package/lib/esm/features/agent/chat/AgentChart.js +184 -0
  19. package/lib/esm/features/agent/chat/AgentChart.js.map +1 -0
  20. package/lib/esm/features/agent/chat/ModernAgentConversation.js +87 -10
  21. package/lib/esm/features/agent/chat/ModernAgentConversation.js.map +1 -1
  22. package/lib/esm/features/agent/chat/ModernAgentOutput/AllMessagesMixed.js +6 -2
  23. package/lib/esm/features/agent/chat/ModernAgentOutput/AllMessagesMixed.js.map +1 -1
  24. package/lib/esm/features/agent/chat/ModernAgentOutput/Header.js +4 -4
  25. package/lib/esm/features/agent/chat/ModernAgentOutput/Header.js.map +1 -1
  26. package/lib/esm/features/agent/chat/ModernAgentOutput/InlineSlidingPlanPanel.js +4 -1
  27. package/lib/esm/features/agent/chat/ModernAgentOutput/InlineSlidingPlanPanel.js.map +1 -1
  28. package/lib/esm/features/agent/chat/ModernAgentOutput/MessageInput.js +12 -4
  29. package/lib/esm/features/agent/chat/ModernAgentOutput/MessageInput.js.map +1 -1
  30. package/lib/esm/features/agent/chat/ModernAgentOutput/MessageItem.js +60 -56
  31. package/lib/esm/features/agent/chat/ModernAgentOutput/MessageItem.js.map +1 -1
  32. package/lib/esm/features/agent/chat/index.js +1 -0
  33. package/lib/esm/features/agent/chat/index.js.map +1 -1
  34. package/lib/esm/features/agent/createChartTool.js +354 -0
  35. package/lib/esm/features/agent/createChartTool.js.map +1 -0
  36. package/lib/esm/features/agent/examples.js +295 -0
  37. package/lib/esm/features/agent/examples.js.map +1 -0
  38. package/lib/esm/features/agent/index.js +2 -0
  39. package/lib/esm/features/agent/index.js.map +1 -1
  40. package/lib/esm/features/agent/visualization.js +165 -0
  41. package/lib/esm/features/agent/visualization.js.map +1 -0
  42. package/lib/esm/features/facets/CollectionsFacetsNav.js +5 -1
  43. package/lib/esm/features/facets/CollectionsFacetsNav.js.map +1 -1
  44. package/lib/esm/features/index.js +1 -0
  45. package/lib/esm/features/index.js.map +1 -1
  46. package/lib/esm/features/layout/GenericPageNavHeader.js +14 -4
  47. package/lib/esm/features/layout/GenericPageNavHeader.js.map +1 -1
  48. package/lib/esm/features/magic-pdf/AnnotatedImageSlider.js +268 -0
  49. package/lib/esm/features/magic-pdf/AnnotatedImageSlider.js.map +1 -0
  50. package/lib/esm/features/magic-pdf/DownloadPopover.js +11 -11
  51. package/lib/esm/features/magic-pdf/DownloadPopover.js.map +1 -1
  52. package/lib/esm/features/magic-pdf/ExtractedContentView.js +77 -0
  53. package/lib/esm/features/magic-pdf/ExtractedContentView.js.map +1 -0
  54. package/lib/esm/features/magic-pdf/MagicPdfProvider.js +242 -0
  55. package/lib/esm/features/magic-pdf/MagicPdfProvider.js.map +1 -0
  56. package/lib/esm/features/magic-pdf/MagicPdfView.js +41 -47
  57. package/lib/esm/features/magic-pdf/MagicPdfView.js.map +1 -1
  58. package/lib/esm/features/pdf-viewer/PdfPageRenderer.js +261 -0
  59. package/lib/esm/features/pdf-viewer/PdfPageRenderer.js.map +1 -0
  60. package/lib/esm/features/pdf-viewer/PdfPageSlider.js +276 -0
  61. package/lib/esm/features/pdf-viewer/PdfPageSlider.js.map +1 -0
  62. package/lib/esm/features/pdf-viewer/SimplePdfViewer.js +71 -0
  63. package/lib/esm/features/pdf-viewer/SimplePdfViewer.js.map +1 -0
  64. package/lib/esm/features/pdf-viewer/index.js +4 -0
  65. package/lib/esm/features/pdf-viewer/index.js.map +1 -0
  66. package/lib/esm/features/store/collections/EditCollectionView.js +3 -5
  67. package/lib/esm/features/store/collections/EditCollectionView.js.map +1 -1
  68. package/lib/esm/features/store/collections/SharedPropsEditor.js +1 -2
  69. package/lib/esm/features/store/collections/SharedPropsEditor.js.map +1 -1
  70. package/lib/esm/features/store/objects/DocumentSearchResults.js +0 -7
  71. package/lib/esm/features/store/objects/DocumentSearchResults.js.map +1 -1
  72. package/lib/esm/features/store/objects/components/ContentOverview.js +273 -83
  73. package/lib/esm/features/store/objects/components/ContentOverview.js.map +1 -1
  74. package/lib/esm/features/store/objects/components/useContentPanelHooks.js +153 -0
  75. package/lib/esm/features/store/objects/components/useContentPanelHooks.js.map +1 -0
  76. package/lib/esm/features/store/objects/layout/DocumentTableColumn.js +3 -3
  77. package/lib/esm/features/store/objects/layout/DocumentTableColumn.js.map +1 -1
  78. package/lib/esm/features/store/objects/layout/renderers.js +13 -0
  79. package/lib/esm/features/store/objects/layout/renderers.js.map +1 -1
  80. package/lib/esm/features/utils/index.js +2 -0
  81. package/lib/esm/features/utils/index.js.map +1 -1
  82. package/lib/esm/features/utils/mimeType.js +8 -0
  83. package/lib/esm/features/utils/mimeType.js.map +1 -1
  84. package/lib/esm/features/utils/print.js +181 -0
  85. package/lib/esm/features/utils/print.js.map +1 -0
  86. package/lib/esm/features/utils/workflowStatus.js +43 -0
  87. package/lib/esm/features/utils/workflowStatus.js.map +1 -0
  88. package/lib/esm/router/HistoryNavigator.js +22 -2
  89. package/lib/esm/router/HistoryNavigator.js.map +1 -1
  90. package/lib/esm/shell/login/UserInfo.js +2 -1
  91. package/lib/esm/shell/login/UserInfo.js.map +1 -1
  92. package/lib/esm/shell/login/UserSessionMenu.js +7 -1
  93. package/lib/esm/shell/login/UserSessionMenu.js.map +1 -1
  94. package/lib/esm/widgets/form/Form.js +6 -2
  95. package/lib/esm/widgets/form/Form.js.map +1 -1
  96. package/lib/esm/widgets/markdown/MarkdownRenderer.js +226 -4
  97. package/lib/esm/widgets/markdown/MarkdownRenderer.js.map +1 -1
  98. package/lib/esm/widgets/schema-editor/ManagedSchema.js +0 -3
  99. package/lib/esm/widgets/schema-editor/ManagedSchema.js.map +1 -1
  100. package/lib/esm/widgets/schema-editor/json-schema4-utils.js +1 -1
  101. package/lib/esm/widgets/schema-editor/json-schema4-utils.js.map +1 -1
  102. package/lib/esm/widgets/xml-viewer/components/XMLViewer.js +18 -9
  103. package/lib/esm/widgets/xml-viewer/components/XMLViewer.js.map +1 -1
  104. package/lib/esm/widgets/xml-viewer/constants/index.js +10 -0
  105. package/lib/esm/widgets/xml-viewer/constants/index.js.map +1 -1
  106. package/lib/tsconfig.tsbuildinfo +1 -1
  107. package/lib/types/core/components/MessageBox.d.ts.map +1 -1
  108. package/lib/types/core/components/shadcn/dialog.d.ts +2 -1
  109. package/lib/types/core/components/shadcn/dialog.d.ts.map +1 -1
  110. package/lib/types/core/components/shadcn/filters/filterBar.d.ts.map +1 -1
  111. package/lib/types/core/components/shadcn/selectBox.d.ts +5 -1
  112. package/lib/types/core/components/shadcn/selectBox.d.ts.map +1 -1
  113. package/lib/types/core/components/shadcn/tabs.d.ts +3 -1
  114. package/lib/types/core/components/shadcn/tabs.d.ts.map +1 -1
  115. package/lib/types/env/index.d.ts +2 -0
  116. package/lib/types/env/index.d.ts.map +1 -1
  117. package/lib/types/features/agent/chat/AgentChart.d.ts +48 -0
  118. package/lib/types/features/agent/chat/AgentChart.d.ts.map +1 -0
  119. package/lib/types/features/agent/chat/ModernAgentConversation.d.ts.map +1 -1
  120. package/lib/types/features/agent/chat/ModernAgentOutput/AllMessagesMixed.d.ts +3 -2
  121. package/lib/types/features/agent/chat/ModernAgentOutput/AllMessagesMixed.d.ts.map +1 -1
  122. package/lib/types/features/agent/chat/ModernAgentOutput/Header.d.ts +2 -1
  123. package/lib/types/features/agent/chat/ModernAgentOutput/Header.d.ts.map +1 -1
  124. package/lib/types/features/agent/chat/ModernAgentOutput/InlineSlidingPlanPanel.d.ts +4 -2
  125. package/lib/types/features/agent/chat/ModernAgentOutput/InlineSlidingPlanPanel.d.ts.map +1 -1
  126. package/lib/types/features/agent/chat/ModernAgentOutput/MessageInput.d.ts +2 -4
  127. package/lib/types/features/agent/chat/ModernAgentOutput/MessageInput.d.ts.map +1 -1
  128. package/lib/types/features/agent/chat/ModernAgentOutput/MessageItem.d.ts.map +1 -1
  129. package/lib/types/features/agent/chat/index.d.ts +1 -0
  130. package/lib/types/features/agent/chat/index.d.ts.map +1 -1
  131. package/lib/types/features/agent/createChartTool.d.ts +178 -0
  132. package/lib/types/features/agent/createChartTool.d.ts.map +1 -0
  133. package/lib/types/features/agent/examples.d.ts +59 -0
  134. package/lib/types/features/agent/examples.d.ts.map +1 -0
  135. package/lib/types/features/agent/index.d.ts +2 -0
  136. package/lib/types/features/agent/index.d.ts.map +1 -1
  137. package/lib/types/features/agent/visualization.d.ts +95 -0
  138. package/lib/types/features/agent/visualization.d.ts.map +1 -0
  139. package/lib/types/features/facets/CollectionsFacetsNav.d.ts.map +1 -1
  140. package/lib/types/features/index.d.ts +1 -0
  141. package/lib/types/features/index.d.ts.map +1 -1
  142. package/lib/types/features/layout/GenericPageNavHeader.d.ts.map +1 -1
  143. package/lib/types/features/magic-pdf/AnnotatedImageSlider.d.ts +13 -0
  144. package/lib/types/features/magic-pdf/AnnotatedImageSlider.d.ts.map +1 -0
  145. package/lib/types/features/magic-pdf/DownloadPopover.d.ts.map +1 -1
  146. package/lib/types/features/magic-pdf/ExtractedContentView.d.ts +8 -0
  147. package/lib/types/features/magic-pdf/ExtractedContentView.d.ts.map +1 -0
  148. package/lib/types/features/magic-pdf/MagicPdfProvider.d.ts +58 -0
  149. package/lib/types/features/magic-pdf/MagicPdfProvider.d.ts.map +1 -0
  150. package/lib/types/features/magic-pdf/MagicPdfView.d.ts +1 -1
  151. package/lib/types/features/magic-pdf/MagicPdfView.d.ts.map +1 -1
  152. package/lib/types/features/pdf-viewer/PdfPageRenderer.d.ts +83 -0
  153. package/lib/types/features/pdf-viewer/PdfPageRenderer.d.ts.map +1 -0
  154. package/lib/types/features/pdf-viewer/PdfPageSlider.d.ts +29 -0
  155. package/lib/types/features/pdf-viewer/PdfPageSlider.d.ts.map +1 -0
  156. package/lib/types/features/pdf-viewer/SimplePdfViewer.d.ts +19 -0
  157. package/lib/types/features/pdf-viewer/SimplePdfViewer.d.ts.map +1 -0
  158. package/lib/types/features/pdf-viewer/index.d.ts +4 -0
  159. package/lib/types/features/pdf-viewer/index.d.ts.map +1 -0
  160. package/lib/types/features/store/collections/EditCollectionView.d.ts.map +1 -1
  161. package/lib/types/features/store/collections/SharedPropsEditor.d.ts.map +1 -1
  162. package/lib/types/features/store/objects/DocumentSearchResults.d.ts.map +1 -1
  163. package/lib/types/features/store/objects/components/ContentOverview.d.ts.map +1 -1
  164. package/lib/types/features/store/objects/components/useContentPanelHooks.d.ts +30 -0
  165. package/lib/types/features/store/objects/components/useContentPanelHooks.d.ts.map +1 -0
  166. package/lib/types/features/store/objects/layout/renderers.d.ts.map +1 -1
  167. package/lib/types/features/utils/index.d.ts +2 -0
  168. package/lib/types/features/utils/index.d.ts.map +1 -1
  169. package/lib/types/features/utils/mimeType.d.ts +1 -0
  170. package/lib/types/features/utils/mimeType.d.ts.map +1 -1
  171. package/lib/types/features/utils/print.d.ts +10 -0
  172. package/lib/types/features/utils/print.d.ts.map +1 -0
  173. package/lib/types/features/utils/workflowStatus.d.ts +10 -0
  174. package/lib/types/features/utils/workflowStatus.d.ts.map +1 -0
  175. package/lib/types/router/HistoryNavigator.d.ts +3 -0
  176. package/lib/types/router/HistoryNavigator.d.ts.map +1 -1
  177. package/lib/types/shell/login/UserInfo.d.ts.map +1 -1
  178. package/lib/types/shell/login/UserSessionMenu.d.ts.map +1 -1
  179. package/lib/types/widgets/form/Form.d.ts.map +1 -1
  180. package/lib/types/widgets/markdown/MarkdownRenderer.d.ts +5 -1
  181. package/lib/types/widgets/markdown/MarkdownRenderer.d.ts.map +1 -1
  182. package/lib/types/widgets/schema-editor/ManagedSchema.d.ts.map +1 -1
  183. package/lib/types/widgets/xml-viewer/components/XMLViewer.d.ts.map +1 -1
  184. package/lib/types/widgets/xml-viewer/constants/index.d.ts +10 -0
  185. package/lib/types/widgets/xml-viewer/constants/index.d.ts.map +1 -1
  186. package/lib/vertesia-ui-core.js +1 -1
  187. package/lib/vertesia-ui-core.js.map +1 -1
  188. package/lib/vertesia-ui-env.js +1 -1
  189. package/lib/vertesia-ui-env.js.map +1 -1
  190. package/lib/vertesia-ui-features.js +1 -1
  191. package/lib/vertesia-ui-features.js.map +1 -1
  192. package/lib/vertesia-ui-layout.js +1 -1
  193. package/lib/vertesia-ui-layout.js.map +1 -1
  194. package/lib/vertesia-ui-router.js +1 -1
  195. package/lib/vertesia-ui-router.js.map +1 -1
  196. package/lib/vertesia-ui-session.js +1 -1
  197. package/lib/vertesia-ui-session.js.map +1 -1
  198. package/lib/vertesia-ui-shell.js +1 -1
  199. package/lib/vertesia-ui-shell.js.map +1 -1
  200. package/lib/vertesia-ui-widgets.js +1 -1
  201. package/lib/vertesia-ui-widgets.js.map +1 -1
  202. package/package.json +11 -8
  203. package/src/core/components/MenuList.tsx +3 -6
  204. package/src/core/components/MessageBox.tsx +7 -2
  205. package/src/core/components/SelectBox.tsx +1 -1
  206. package/src/core/components/shadcn/dialog.tsx +19 -1
  207. package/src/core/components/shadcn/filters/filter/SelectFilter.tsx +31 -31
  208. package/src/core/components/shadcn/filters/filterBar.tsx +1 -0
  209. package/src/core/components/shadcn/selectBox.tsx +32 -6
  210. package/src/core/components/shadcn/tabs.tsx +3 -2
  211. package/src/env/index.ts +5 -0
  212. package/src/features/agent/CHART_INSTRUCTIONS.md +228 -0
  213. package/src/features/agent/chat/AgentChart.tsx +601 -0
  214. package/src/features/agent/chat/ModernAgentConversation.tsx +123 -11
  215. package/src/features/agent/chat/ModernAgentOutput/AllMessagesMixed.tsx +8 -2
  216. package/src/features/agent/chat/ModernAgentOutput/Header.tsx +12 -2
  217. package/src/features/agent/chat/ModernAgentOutput/InlineSlidingPlanPanel.tsx +6 -1
  218. package/src/features/agent/chat/ModernAgentOutput/MessageInput.tsx +15 -10
  219. package/src/features/agent/chat/ModernAgentOutput/MessageItem.tsx +122 -87
  220. package/src/features/agent/chat/index.ts +1 -0
  221. package/src/features/agent/createChartTool.ts +364 -0
  222. package/src/features/agent/examples.ts +321 -0
  223. package/src/features/agent/index.ts +2 -0
  224. package/src/features/agent/visualization.ts +227 -0
  225. package/src/features/facets/CollectionsFacetsNav.tsx +5 -1
  226. package/src/features/index.ts +1 -0
  227. package/src/features/layout/GenericPageNavHeader.tsx +15 -4
  228. package/src/features/magic-pdf/AnnotatedImageSlider.tsx +482 -0
  229. package/src/features/magic-pdf/DownloadPopover.tsx +45 -40
  230. package/src/features/magic-pdf/ExtractedContentView.tsx +132 -0
  231. package/src/features/magic-pdf/MagicPdfProvider.tsx +297 -0
  232. package/src/features/magic-pdf/MagicPdfView.tsx +184 -91
  233. package/src/features/pdf-viewer/PdfPageRenderer.tsx +612 -0
  234. package/src/features/pdf-viewer/PdfPageSlider.tsx +473 -0
  235. package/src/features/pdf-viewer/SimplePdfViewer.tsx +142 -0
  236. package/src/features/pdf-viewer/index.ts +3 -0
  237. package/src/features/store/collections/EditCollectionView.tsx +3 -5
  238. package/src/features/store/collections/SharedPropsEditor.tsx +1 -2
  239. package/src/features/store/objects/DocumentSearchResults.tsx +0 -7
  240. package/src/features/store/objects/components/ContentOverview.tsx +677 -210
  241. package/src/features/store/objects/components/useContentPanelHooks.ts +169 -0
  242. package/src/features/store/objects/layout/DocumentTableColumn.tsx +3 -3
  243. package/src/features/store/objects/layout/knowledge.md +1 -0
  244. package/src/features/store/objects/layout/renderers.tsx +25 -0
  245. package/src/features/utils/index.ts +3 -1
  246. package/src/features/utils/mimeType.ts +10 -1
  247. package/src/features/utils/print.ts +189 -0
  248. package/src/features/utils/workflowStatus.ts +44 -0
  249. package/src/router/HistoryNavigator.ts +30 -2
  250. package/src/shell/login/UserInfo.tsx +2 -0
  251. package/src/shell/login/UserSessionMenu.tsx +12 -1
  252. package/src/widgets/form/Form.tsx +8 -3
  253. package/src/widgets/markdown/MarkdownRenderer.tsx +350 -6
  254. package/src/widgets/schema-editor/ManagedSchema.ts +0 -3
  255. package/src/widgets/schema-editor/json-schema4-utils.ts +1 -1
  256. package/src/widgets/xml-viewer/components/XMLViewer.tsx +22 -10
  257. package/src/widgets/xml-viewer/constants/index.ts +11 -0
  258. package/lib/esm/features/magic-pdf/PageSlider.js +0 -70
  259. package/lib/esm/features/magic-pdf/PageSlider.js.map +0 -1
  260. package/lib/esm/features/magic-pdf/PdfPageProvider.js +0 -188
  261. package/lib/esm/features/magic-pdf/PdfPageProvider.js.map +0 -1
  262. package/lib/esm/features/magic-pdf/TextPageView.js +0 -62
  263. package/lib/esm/features/magic-pdf/TextPageView.js.map +0 -1
  264. package/lib/esm/features/magic-pdf/useResizeOnDrag.js +0 -34
  265. package/lib/esm/features/magic-pdf/useResizeOnDrag.js.map +0 -1
  266. package/lib/types/features/magic-pdf/PageSlider.d.ts +0 -9
  267. package/lib/types/features/magic-pdf/PageSlider.d.ts.map +0 -1
  268. package/lib/types/features/magic-pdf/PdfPageProvider.d.ts +0 -39
  269. package/lib/types/features/magic-pdf/PdfPageProvider.d.ts.map +0 -1
  270. package/lib/types/features/magic-pdf/TextPageView.d.ts +0 -8
  271. package/lib/types/features/magic-pdf/TextPageView.d.ts.map +0 -1
  272. package/lib/types/features/magic-pdf/useResizeOnDrag.d.ts +0 -9
  273. package/lib/types/features/magic-pdf/useResizeOnDrag.d.ts.map +0 -1
  274. package/src/features/magic-pdf/PageSlider.tsx +0 -142
  275. package/src/features/magic-pdf/PdfPageProvider.tsx +0 -310
  276. package/src/features/magic-pdf/TextPageView.tsx +0 -91
  277. package/src/features/magic-pdf/useResizeOnDrag.ts +0 -42
@@ -0,0 +1,227 @@
1
+ /**
2
+ * Visualization helpers for tools to emit chart specs that the UI can render.
3
+ *
4
+ * Format: ChartSpec v1 rendered by AgentChart component
5
+ */
6
+
7
+ import type { AgentChartSpec } from './chat/AgentChart';
8
+
9
+ export type ChartSpecV1 = AgentChartSpec;
10
+
11
+ /**
12
+ * Build a side-by-side bar chart comparing two scenarios across numeric metrics.
13
+ */
14
+ export function buildScenarioComparisonBarChart(params: {
15
+ title?: string;
16
+ leftLabel: string;
17
+ rightLabel: string;
18
+ metrics: Array<{
19
+ label: string;
20
+ left: number;
21
+ right: number;
22
+ }>;
23
+ description?: string;
24
+ collapseInitially?: boolean;
25
+ }): ChartSpecV1 {
26
+ const { title, leftLabel, rightLabel, metrics, description, collapseInitially } = params;
27
+ const data = metrics.map((m) => ({ label: m.label, left: m.left, right: m.right }));
28
+ const spec: ChartSpecV1 = {
29
+ version: '1.0',
30
+ library: 'recharts',
31
+ chart: 'bar',
32
+ title: title || 'Scenario Comparison',
33
+ description,
34
+ data,
35
+ xKey: 'label',
36
+ series: [
37
+ { key: 'left', label: leftLabel, type: 'bar' },
38
+ { key: 'right', label: rightLabel, type: 'bar' },
39
+ ],
40
+ yAxis: { left: { label: 'Value' } },
41
+ options: { stacked: false, referenceZero: false, collapseInitially },
42
+ };
43
+ return spec;
44
+ }
45
+
46
+ /**
47
+ * Build a delta percentage bar chart to visualize changes between scenarios.
48
+ */
49
+ export function buildScenarioDeltaPercentChart(params: {
50
+ title?: string;
51
+ metrics: Array<{
52
+ label: string;
53
+ left: number;
54
+ right: number;
55
+ }>;
56
+ description?: string;
57
+ collapseInitially?: boolean;
58
+ }): ChartSpecV1 {
59
+ const { title, metrics, description, collapseInitially } = params;
60
+ const data = metrics.map((m) => ({
61
+ label: m.label,
62
+ deltaPct: m.left !== 0 ? ((m.right - m.left) / m.left) * 100 : 0,
63
+ }));
64
+ const spec: ChartSpecV1 = {
65
+ version: '1.0',
66
+ library: 'recharts',
67
+ chart: 'bar',
68
+ title: title || 'Change vs. Baseline (%)',
69
+ description,
70
+ data,
71
+ xKey: 'label',
72
+ series: [
73
+ { key: 'deltaPct', label: '% Change', type: 'bar' },
74
+ ],
75
+ yAxis: { left: { label: '% Change' } },
76
+ options: { stacked: false, referenceZero: true, collapseInitially },
77
+ };
78
+ return spec;
79
+ }
80
+
81
+ /**
82
+ * Helper to wrap a chart spec in a markdown code fence the UI will render.
83
+ */
84
+ export function toChartMarkdown(spec: ChartSpecV1): string {
85
+ const json = JSON.stringify(spec, null, 2);
86
+ return [
87
+ '```chart',
88
+ json,
89
+ '```',
90
+ ].join('\n');
91
+ }
92
+
93
+ /**
94
+ * Build a cashflow composed chart (Calls/Distributions bars + Net Cashflow line)
95
+ */
96
+ export function buildCashflowComposedChart(params: {
97
+ title?: string;
98
+ description?: string;
99
+ rows: Array<{
100
+ period: string; // e.g. '2024-Q1' or '2024'
101
+ calls: number;
102
+ distributions: number;
103
+ netCashflow?: number;
104
+ }>;
105
+ collapseInitially?: boolean;
106
+ }): ChartSpecV1 {
107
+ const { title, description, rows, collapseInitially } = params;
108
+ const spec: ChartSpecV1 = {
109
+ version: '1.0',
110
+ library: 'recharts',
111
+ chart: 'composed',
112
+ title: title || 'Cashflow Timeline',
113
+ description,
114
+ data: rows.map((r) => ({
115
+ period: r.period,
116
+ calls: r.calls,
117
+ distributions: r.distributions,
118
+ netCashflow: r.netCashflow ?? (r.distributions - r.calls),
119
+ })),
120
+ xKey: 'period',
121
+ series: [
122
+ { key: 'calls', label: 'Calls', type: 'bar', color: '#ef4444' },
123
+ { key: 'distributions', label: 'Distributions', type: 'bar', color: '#22c55e' },
124
+ { key: 'netCashflow', label: 'Net Cashflow', type: 'line', color: '#0ea5e9', yAxisId: 'right', dot: false },
125
+ ],
126
+ yAxis: { left: { label: 'Amount' }, right: { label: 'Net' } },
127
+ options: { stacked: false, referenceZero: true, collapseInitially },
128
+ };
129
+ return spec;
130
+ }
131
+
132
+ /**
133
+ * Build a multi-line performance chart (TVPI/DPI/RVPI)
134
+ */
135
+ export function buildPerformanceLineChart(params: {
136
+ title?: string;
137
+ description?: string;
138
+ rows: Array<{
139
+ period: string;
140
+ tvpi?: number;
141
+ dpi?: number;
142
+ rvpi?: number;
143
+ }>;
144
+ collapseInitially?: boolean;
145
+ }): ChartSpecV1 {
146
+ const { title, description, rows, collapseInitially } = params;
147
+ const data = rows.map((r) => ({
148
+ period: r.period,
149
+ tvpi: r.tvpi ?? null,
150
+ dpi: r.dpi ?? null,
151
+ rvpi: r.rvpi ?? null,
152
+ }));
153
+ const spec: ChartSpecV1 = {
154
+ version: '1.0',
155
+ library: 'recharts',
156
+ chart: 'line',
157
+ title: title || 'Performance (J‑Curve)',
158
+ description,
159
+ data,
160
+ xKey: 'period',
161
+ series: [
162
+ { key: 'tvpi', label: 'TVPI', type: 'line', color: '#4f46e5', dot: false },
163
+ { key: 'dpi', label: 'DPI', type: 'line', color: '#16a34a', dot: false },
164
+ { key: 'rvpi', label: 'RVPI', type: 'line', color: '#f59e0b', dot: false },
165
+ ],
166
+ yAxis: { left: { label: 'Multiple (x)' } },
167
+ options: { stacked: false, referenceZero: true, collapseInitially },
168
+ };
169
+ return spec;
170
+ }
171
+
172
+ /**
173
+ * Build a TVPI-only overlay chart (two series, e.g., left vs right scenario)
174
+ */
175
+ export function buildTvpiOverlayChart(params: {
176
+ title?: string;
177
+ description?: string;
178
+ rows: Array<{ period: string; tvpi_left?: number; tvpi_right?: number }>;
179
+ leftLabel: string;
180
+ rightLabel: string;
181
+ collapseInitially?: boolean;
182
+ }): ChartSpecV1 {
183
+ const { title, description, rows, leftLabel, rightLabel, collapseInitially } = params;
184
+ const spec: ChartSpecV1 = {
185
+ version: '1.0',
186
+ library: 'recharts',
187
+ chart: 'line',
188
+ title: title || 'TVPI Over Time',
189
+ description,
190
+ data: rows,
191
+ xKey: 'period',
192
+ series: [
193
+ { key: 'tvpi_left', label: `TVPI – ${leftLabel}`, type: 'line', color: '#4f46e5', dot: false },
194
+ { key: 'tvpi_right', label: `TVPI – ${rightLabel}`, type: 'line', color: '#6366f1', dot: false },
195
+ ],
196
+ yAxis: { left: { label: 'Multiple (x)' } },
197
+ options: { stacked: false, referenceZero: true, collapseInitially },
198
+ };
199
+ return spec;
200
+ }
201
+
202
+ /**
203
+ * Build a NAV over time line chart (single line, right or left axis)
204
+ */
205
+ export function buildNavLineChart(params: {
206
+ title?: string;
207
+ description?: string;
208
+ rows: Array<{ period: string; nav: number }>;
209
+ collapseInitially?: boolean;
210
+ }): ChartSpecV1 {
211
+ const { title, description, rows, collapseInitially } = params;
212
+ const spec: ChartSpecV1 = {
213
+ version: '1.0',
214
+ library: 'recharts',
215
+ chart: 'line',
216
+ title: title || 'NAV Over Time',
217
+ description,
218
+ data: rows.map(r => ({ period: r.period, nav: r.nav })),
219
+ xKey: 'period',
220
+ series: [
221
+ { key: 'nav', label: 'NAV', type: 'line', color: '#0ea5e9', dot: false },
222
+ ],
223
+ yAxis: { left: { label: 'NAV' } },
224
+ options: { stacked: false, referenceZero: true, collapseInitially },
225
+ };
226
+ return spec;
227
+ }
@@ -40,7 +40,11 @@ export function useCollectionsFilterGroups(facets: CollectionsFacetsNavProps['fa
40
40
  placeholder: 'Type',
41
41
  type: 'select' as const,
42
42
  multiple: true,
43
- options: typeOptions
43
+ options: typeOptions,
44
+ filterBy: (value: string, searchText: string) => {
45
+ const option = typeOptions.find(opt => opt.value === value);
46
+ return option?.label?.toLowerCase().includes(searchText.toLowerCase()) ?? false;
47
+ }
44
48
  };
45
49
  customFilterGroups.push(typeFilterGroup);
46
50
  }
@@ -4,6 +4,7 @@ export * from "./errors/index.js";
4
4
  export * from "./facets/index.js";
5
5
  export * from "./layout/index.js";
6
6
  export * from "./magic-pdf/index.js";
7
+ export * from "./pdf-viewer/index.js";
7
8
  export * from "./permissions/index.js";
8
9
  export * from "./store/index.js";
9
10
  export * from "./user/index.js";
@@ -20,6 +20,14 @@ interface GenericPageNavHeaderProps {
20
20
  export function GenericPageNavHeader({ className, children, title, description, actions, breadcrumbs, isCompact = false, useDynamicBreadcrumbs = true }: GenericPageNavHeaderProps) {
21
21
  const navigate = useNavigate();
22
22
 
23
+ function formatTitle(title: string): string {
24
+ return title
25
+ .replace(/[-_]/g, ' ')
26
+ .split(' ')
27
+ .map(word => capitalize(word))
28
+ .join(' ');
29
+ }
30
+
23
31
  const buildBreadcrumbLabel = (entry: any): string => {
24
32
  const href = entry?.href || '';
25
33
  if (!href) return 'Page';
@@ -28,12 +36,15 @@ export function GenericPageNavHeader({ className, children, title, description,
28
36
  const pathSegments: string[] = (cleanHref as string).split('/').filter((segment: string) => segment.length > 0);
29
37
 
30
38
  if (pathSegments.length === 3) {
39
+ if (entry.title !== document.title && entry.title) {
40
+ return entry.title;
41
+ }
31
42
  const secondSegment = pathSegments[1];
32
- return `${capitalize(secondSegment)} Detail`;
43
+ return `${formatTitle(secondSegment)} Detail (...${pathSegments[2].slice(-6)})`;
33
44
  } else if (pathSegments.length >= 2) {
34
- return capitalize(pathSegments[pathSegments.length - 1]);
45
+ return formatTitle(pathSegments[pathSegments.length - 1]);
35
46
  } else if (pathSegments.length === 1) {
36
- return capitalize(pathSegments[0]);
47
+ return formatTitle(pathSegments[0]);
37
48
  }
38
49
 
39
50
  return 'Page';
@@ -51,7 +62,7 @@ export function GenericPageNavHeader({ className, children, title, description,
51
62
  items.push({
52
63
  label: buildBreadcrumbLabel(entry),
53
64
  href: entry.href,
54
- onClick: () => window.history.go(-stepsBack)
65
+ onClick: () => navigate(entry.href, { stepsBack: stepsBack })
55
66
  });
56
67
  });
57
68
  }