@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.
- package/README.md +105 -0
- package/lib/esm/core/components/MenuList.js +2 -5
- package/lib/esm/core/components/MenuList.js.map +1 -1
- package/lib/esm/core/components/MessageBox.js +1 -1
- package/lib/esm/core/components/MessageBox.js.map +1 -1
- package/lib/esm/core/components/shadcn/dialog.js +16 -2
- package/lib/esm/core/components/shadcn/dialog.js.map +1 -1
- package/lib/esm/core/components/shadcn/filters/filter/SelectFilter.js +6 -9
- package/lib/esm/core/components/shadcn/filters/filter/SelectFilter.js.map +1 -1
- package/lib/esm/core/components/shadcn/filters/filterBar.js +1 -1
- package/lib/esm/core/components/shadcn/filters/filterBar.js.map +1 -1
- package/lib/esm/core/components/shadcn/selectBox.js +23 -5
- package/lib/esm/core/components/shadcn/selectBox.js.map +1 -1
- package/lib/esm/core/components/shadcn/tabs.js +3 -3
- package/lib/esm/core/components/shadcn/tabs.js.map +1 -1
- package/lib/esm/env/index.js +3 -0
- package/lib/esm/env/index.js.map +1 -1
- package/lib/esm/features/agent/chat/AgentChart.js +184 -0
- package/lib/esm/features/agent/chat/AgentChart.js.map +1 -0
- package/lib/esm/features/agent/chat/ModernAgentConversation.js +87 -10
- package/lib/esm/features/agent/chat/ModernAgentConversation.js.map +1 -1
- package/lib/esm/features/agent/chat/ModernAgentOutput/AllMessagesMixed.js +6 -2
- package/lib/esm/features/agent/chat/ModernAgentOutput/AllMessagesMixed.js.map +1 -1
- package/lib/esm/features/agent/chat/ModernAgentOutput/Header.js +4 -4
- package/lib/esm/features/agent/chat/ModernAgentOutput/Header.js.map +1 -1
- package/lib/esm/features/agent/chat/ModernAgentOutput/InlineSlidingPlanPanel.js +4 -1
- package/lib/esm/features/agent/chat/ModernAgentOutput/InlineSlidingPlanPanel.js.map +1 -1
- package/lib/esm/features/agent/chat/ModernAgentOutput/MessageInput.js +12 -4
- package/lib/esm/features/agent/chat/ModernAgentOutput/MessageInput.js.map +1 -1
- package/lib/esm/features/agent/chat/ModernAgentOutput/MessageItem.js +60 -56
- package/lib/esm/features/agent/chat/ModernAgentOutput/MessageItem.js.map +1 -1
- package/lib/esm/features/agent/chat/index.js +1 -0
- package/lib/esm/features/agent/chat/index.js.map +1 -1
- package/lib/esm/features/agent/createChartTool.js +354 -0
- package/lib/esm/features/agent/createChartTool.js.map +1 -0
- package/lib/esm/features/agent/examples.js +295 -0
- package/lib/esm/features/agent/examples.js.map +1 -0
- package/lib/esm/features/agent/index.js +2 -0
- package/lib/esm/features/agent/index.js.map +1 -1
- package/lib/esm/features/agent/visualization.js +165 -0
- package/lib/esm/features/agent/visualization.js.map +1 -0
- package/lib/esm/features/facets/CollectionsFacetsNav.js +5 -1
- package/lib/esm/features/facets/CollectionsFacetsNav.js.map +1 -1
- package/lib/esm/features/index.js +1 -0
- package/lib/esm/features/index.js.map +1 -1
- package/lib/esm/features/layout/GenericPageNavHeader.js +14 -4
- package/lib/esm/features/layout/GenericPageNavHeader.js.map +1 -1
- package/lib/esm/features/magic-pdf/AnnotatedImageSlider.js +268 -0
- package/lib/esm/features/magic-pdf/AnnotatedImageSlider.js.map +1 -0
- package/lib/esm/features/magic-pdf/DownloadPopover.js +11 -11
- package/lib/esm/features/magic-pdf/DownloadPopover.js.map +1 -1
- package/lib/esm/features/magic-pdf/ExtractedContentView.js +77 -0
- package/lib/esm/features/magic-pdf/ExtractedContentView.js.map +1 -0
- package/lib/esm/features/magic-pdf/MagicPdfProvider.js +242 -0
- package/lib/esm/features/magic-pdf/MagicPdfProvider.js.map +1 -0
- package/lib/esm/features/magic-pdf/MagicPdfView.js +41 -47
- package/lib/esm/features/magic-pdf/MagicPdfView.js.map +1 -1
- package/lib/esm/features/pdf-viewer/PdfPageRenderer.js +261 -0
- package/lib/esm/features/pdf-viewer/PdfPageRenderer.js.map +1 -0
- package/lib/esm/features/pdf-viewer/PdfPageSlider.js +276 -0
- package/lib/esm/features/pdf-viewer/PdfPageSlider.js.map +1 -0
- package/lib/esm/features/pdf-viewer/SimplePdfViewer.js +71 -0
- package/lib/esm/features/pdf-viewer/SimplePdfViewer.js.map +1 -0
- package/lib/esm/features/pdf-viewer/index.js +4 -0
- package/lib/esm/features/pdf-viewer/index.js.map +1 -0
- package/lib/esm/features/store/collections/EditCollectionView.js +3 -5
- package/lib/esm/features/store/collections/EditCollectionView.js.map +1 -1
- package/lib/esm/features/store/collections/SharedPropsEditor.js +1 -2
- package/lib/esm/features/store/collections/SharedPropsEditor.js.map +1 -1
- package/lib/esm/features/store/objects/DocumentSearchResults.js +0 -7
- package/lib/esm/features/store/objects/DocumentSearchResults.js.map +1 -1
- package/lib/esm/features/store/objects/components/ContentOverview.js +273 -83
- package/lib/esm/features/store/objects/components/ContentOverview.js.map +1 -1
- package/lib/esm/features/store/objects/components/useContentPanelHooks.js +153 -0
- package/lib/esm/features/store/objects/components/useContentPanelHooks.js.map +1 -0
- package/lib/esm/features/store/objects/layout/DocumentTableColumn.js +3 -3
- package/lib/esm/features/store/objects/layout/DocumentTableColumn.js.map +1 -1
- package/lib/esm/features/store/objects/layout/renderers.js +13 -0
- package/lib/esm/features/store/objects/layout/renderers.js.map +1 -1
- package/lib/esm/features/utils/index.js +2 -0
- package/lib/esm/features/utils/index.js.map +1 -1
- package/lib/esm/features/utils/mimeType.js +8 -0
- package/lib/esm/features/utils/mimeType.js.map +1 -1
- package/lib/esm/features/utils/print.js +181 -0
- package/lib/esm/features/utils/print.js.map +1 -0
- package/lib/esm/features/utils/workflowStatus.js +43 -0
- package/lib/esm/features/utils/workflowStatus.js.map +1 -0
- package/lib/esm/router/HistoryNavigator.js +22 -2
- package/lib/esm/router/HistoryNavigator.js.map +1 -1
- package/lib/esm/shell/login/UserInfo.js +2 -1
- package/lib/esm/shell/login/UserInfo.js.map +1 -1
- package/lib/esm/shell/login/UserSessionMenu.js +7 -1
- package/lib/esm/shell/login/UserSessionMenu.js.map +1 -1
- package/lib/esm/widgets/form/Form.js +6 -2
- package/lib/esm/widgets/form/Form.js.map +1 -1
- package/lib/esm/widgets/markdown/MarkdownRenderer.js +226 -4
- package/lib/esm/widgets/markdown/MarkdownRenderer.js.map +1 -1
- package/lib/esm/widgets/schema-editor/ManagedSchema.js +0 -3
- package/lib/esm/widgets/schema-editor/ManagedSchema.js.map +1 -1
- package/lib/esm/widgets/schema-editor/json-schema4-utils.js +1 -1
- package/lib/esm/widgets/schema-editor/json-schema4-utils.js.map +1 -1
- package/lib/esm/widgets/xml-viewer/components/XMLViewer.js +18 -9
- package/lib/esm/widgets/xml-viewer/components/XMLViewer.js.map +1 -1
- package/lib/esm/widgets/xml-viewer/constants/index.js +10 -0
- package/lib/esm/widgets/xml-viewer/constants/index.js.map +1 -1
- package/lib/tsconfig.tsbuildinfo +1 -1
- package/lib/types/core/components/MessageBox.d.ts.map +1 -1
- package/lib/types/core/components/shadcn/dialog.d.ts +2 -1
- package/lib/types/core/components/shadcn/dialog.d.ts.map +1 -1
- package/lib/types/core/components/shadcn/filters/filterBar.d.ts.map +1 -1
- package/lib/types/core/components/shadcn/selectBox.d.ts +5 -1
- package/lib/types/core/components/shadcn/selectBox.d.ts.map +1 -1
- package/lib/types/core/components/shadcn/tabs.d.ts +3 -1
- package/lib/types/core/components/shadcn/tabs.d.ts.map +1 -1
- package/lib/types/env/index.d.ts +2 -0
- package/lib/types/env/index.d.ts.map +1 -1
- package/lib/types/features/agent/chat/AgentChart.d.ts +48 -0
- package/lib/types/features/agent/chat/AgentChart.d.ts.map +1 -0
- package/lib/types/features/agent/chat/ModernAgentConversation.d.ts.map +1 -1
- package/lib/types/features/agent/chat/ModernAgentOutput/AllMessagesMixed.d.ts +3 -2
- package/lib/types/features/agent/chat/ModernAgentOutput/AllMessagesMixed.d.ts.map +1 -1
- package/lib/types/features/agent/chat/ModernAgentOutput/Header.d.ts +2 -1
- package/lib/types/features/agent/chat/ModernAgentOutput/Header.d.ts.map +1 -1
- package/lib/types/features/agent/chat/ModernAgentOutput/InlineSlidingPlanPanel.d.ts +4 -2
- package/lib/types/features/agent/chat/ModernAgentOutput/InlineSlidingPlanPanel.d.ts.map +1 -1
- package/lib/types/features/agent/chat/ModernAgentOutput/MessageInput.d.ts +2 -4
- package/lib/types/features/agent/chat/ModernAgentOutput/MessageInput.d.ts.map +1 -1
- package/lib/types/features/agent/chat/ModernAgentOutput/MessageItem.d.ts.map +1 -1
- package/lib/types/features/agent/chat/index.d.ts +1 -0
- package/lib/types/features/agent/chat/index.d.ts.map +1 -1
- package/lib/types/features/agent/createChartTool.d.ts +178 -0
- package/lib/types/features/agent/createChartTool.d.ts.map +1 -0
- package/lib/types/features/agent/examples.d.ts +59 -0
- package/lib/types/features/agent/examples.d.ts.map +1 -0
- package/lib/types/features/agent/index.d.ts +2 -0
- package/lib/types/features/agent/index.d.ts.map +1 -1
- package/lib/types/features/agent/visualization.d.ts +95 -0
- package/lib/types/features/agent/visualization.d.ts.map +1 -0
- package/lib/types/features/facets/CollectionsFacetsNav.d.ts.map +1 -1
- package/lib/types/features/index.d.ts +1 -0
- package/lib/types/features/index.d.ts.map +1 -1
- package/lib/types/features/layout/GenericPageNavHeader.d.ts.map +1 -1
- package/lib/types/features/magic-pdf/AnnotatedImageSlider.d.ts +13 -0
- package/lib/types/features/magic-pdf/AnnotatedImageSlider.d.ts.map +1 -0
- package/lib/types/features/magic-pdf/DownloadPopover.d.ts.map +1 -1
- package/lib/types/features/magic-pdf/ExtractedContentView.d.ts +8 -0
- package/lib/types/features/magic-pdf/ExtractedContentView.d.ts.map +1 -0
- package/lib/types/features/magic-pdf/MagicPdfProvider.d.ts +58 -0
- package/lib/types/features/magic-pdf/MagicPdfProvider.d.ts.map +1 -0
- package/lib/types/features/magic-pdf/MagicPdfView.d.ts +1 -1
- package/lib/types/features/magic-pdf/MagicPdfView.d.ts.map +1 -1
- package/lib/types/features/pdf-viewer/PdfPageRenderer.d.ts +83 -0
- package/lib/types/features/pdf-viewer/PdfPageRenderer.d.ts.map +1 -0
- package/lib/types/features/pdf-viewer/PdfPageSlider.d.ts +29 -0
- package/lib/types/features/pdf-viewer/PdfPageSlider.d.ts.map +1 -0
- package/lib/types/features/pdf-viewer/SimplePdfViewer.d.ts +19 -0
- package/lib/types/features/pdf-viewer/SimplePdfViewer.d.ts.map +1 -0
- package/lib/types/features/pdf-viewer/index.d.ts +4 -0
- package/lib/types/features/pdf-viewer/index.d.ts.map +1 -0
- package/lib/types/features/store/collections/EditCollectionView.d.ts.map +1 -1
- package/lib/types/features/store/collections/SharedPropsEditor.d.ts.map +1 -1
- package/lib/types/features/store/objects/DocumentSearchResults.d.ts.map +1 -1
- package/lib/types/features/store/objects/components/ContentOverview.d.ts.map +1 -1
- package/lib/types/features/store/objects/components/useContentPanelHooks.d.ts +30 -0
- package/lib/types/features/store/objects/components/useContentPanelHooks.d.ts.map +1 -0
- package/lib/types/features/store/objects/layout/renderers.d.ts.map +1 -1
- package/lib/types/features/utils/index.d.ts +2 -0
- package/lib/types/features/utils/index.d.ts.map +1 -1
- package/lib/types/features/utils/mimeType.d.ts +1 -0
- package/lib/types/features/utils/mimeType.d.ts.map +1 -1
- package/lib/types/features/utils/print.d.ts +10 -0
- package/lib/types/features/utils/print.d.ts.map +1 -0
- package/lib/types/features/utils/workflowStatus.d.ts +10 -0
- package/lib/types/features/utils/workflowStatus.d.ts.map +1 -0
- package/lib/types/router/HistoryNavigator.d.ts +3 -0
- package/lib/types/router/HistoryNavigator.d.ts.map +1 -1
- package/lib/types/shell/login/UserInfo.d.ts.map +1 -1
- package/lib/types/shell/login/UserSessionMenu.d.ts.map +1 -1
- package/lib/types/widgets/form/Form.d.ts.map +1 -1
- package/lib/types/widgets/markdown/MarkdownRenderer.d.ts +5 -1
- package/lib/types/widgets/markdown/MarkdownRenderer.d.ts.map +1 -1
- package/lib/types/widgets/schema-editor/ManagedSchema.d.ts.map +1 -1
- package/lib/types/widgets/xml-viewer/components/XMLViewer.d.ts.map +1 -1
- package/lib/types/widgets/xml-viewer/constants/index.d.ts +10 -0
- package/lib/types/widgets/xml-viewer/constants/index.d.ts.map +1 -1
- package/lib/vertesia-ui-core.js +1 -1
- package/lib/vertesia-ui-core.js.map +1 -1
- package/lib/vertesia-ui-env.js +1 -1
- package/lib/vertesia-ui-env.js.map +1 -1
- package/lib/vertesia-ui-features.js +1 -1
- package/lib/vertesia-ui-features.js.map +1 -1
- package/lib/vertesia-ui-layout.js +1 -1
- package/lib/vertesia-ui-layout.js.map +1 -1
- package/lib/vertesia-ui-router.js +1 -1
- package/lib/vertesia-ui-router.js.map +1 -1
- package/lib/vertesia-ui-session.js +1 -1
- package/lib/vertesia-ui-session.js.map +1 -1
- package/lib/vertesia-ui-shell.js +1 -1
- package/lib/vertesia-ui-shell.js.map +1 -1
- package/lib/vertesia-ui-widgets.js +1 -1
- package/lib/vertesia-ui-widgets.js.map +1 -1
- package/package.json +11 -8
- package/src/core/components/MenuList.tsx +3 -6
- package/src/core/components/MessageBox.tsx +7 -2
- package/src/core/components/SelectBox.tsx +1 -1
- package/src/core/components/shadcn/dialog.tsx +19 -1
- package/src/core/components/shadcn/filters/filter/SelectFilter.tsx +31 -31
- package/src/core/components/shadcn/filters/filterBar.tsx +1 -0
- package/src/core/components/shadcn/selectBox.tsx +32 -6
- package/src/core/components/shadcn/tabs.tsx +3 -2
- package/src/env/index.ts +5 -0
- package/src/features/agent/CHART_INSTRUCTIONS.md +228 -0
- package/src/features/agent/chat/AgentChart.tsx +601 -0
- package/src/features/agent/chat/ModernAgentConversation.tsx +123 -11
- package/src/features/agent/chat/ModernAgentOutput/AllMessagesMixed.tsx +8 -2
- package/src/features/agent/chat/ModernAgentOutput/Header.tsx +12 -2
- package/src/features/agent/chat/ModernAgentOutput/InlineSlidingPlanPanel.tsx +6 -1
- package/src/features/agent/chat/ModernAgentOutput/MessageInput.tsx +15 -10
- package/src/features/agent/chat/ModernAgentOutput/MessageItem.tsx +122 -87
- package/src/features/agent/chat/index.ts +1 -0
- package/src/features/agent/createChartTool.ts +364 -0
- package/src/features/agent/examples.ts +321 -0
- package/src/features/agent/index.ts +2 -0
- package/src/features/agent/visualization.ts +227 -0
- package/src/features/facets/CollectionsFacetsNav.tsx +5 -1
- package/src/features/index.ts +1 -0
- package/src/features/layout/GenericPageNavHeader.tsx +15 -4
- package/src/features/magic-pdf/AnnotatedImageSlider.tsx +482 -0
- package/src/features/magic-pdf/DownloadPopover.tsx +45 -40
- package/src/features/magic-pdf/ExtractedContentView.tsx +132 -0
- package/src/features/magic-pdf/MagicPdfProvider.tsx +297 -0
- package/src/features/magic-pdf/MagicPdfView.tsx +184 -91
- package/src/features/pdf-viewer/PdfPageRenderer.tsx +612 -0
- package/src/features/pdf-viewer/PdfPageSlider.tsx +473 -0
- package/src/features/pdf-viewer/SimplePdfViewer.tsx +142 -0
- package/src/features/pdf-viewer/index.ts +3 -0
- package/src/features/store/collections/EditCollectionView.tsx +3 -5
- package/src/features/store/collections/SharedPropsEditor.tsx +1 -2
- package/src/features/store/objects/DocumentSearchResults.tsx +0 -7
- package/src/features/store/objects/components/ContentOverview.tsx +677 -210
- package/src/features/store/objects/components/useContentPanelHooks.ts +169 -0
- package/src/features/store/objects/layout/DocumentTableColumn.tsx +3 -3
- package/src/features/store/objects/layout/knowledge.md +1 -0
- package/src/features/store/objects/layout/renderers.tsx +25 -0
- package/src/features/utils/index.ts +3 -1
- package/src/features/utils/mimeType.ts +10 -1
- package/src/features/utils/print.ts +189 -0
- package/src/features/utils/workflowStatus.ts +44 -0
- package/src/router/HistoryNavigator.ts +30 -2
- package/src/shell/login/UserInfo.tsx +2 -0
- package/src/shell/login/UserSessionMenu.tsx +12 -1
- package/src/widgets/form/Form.tsx +8 -3
- package/src/widgets/markdown/MarkdownRenderer.tsx +350 -6
- package/src/widgets/schema-editor/ManagedSchema.ts +0 -3
- package/src/widgets/schema-editor/json-schema4-utils.ts +1 -1
- package/src/widgets/xml-viewer/components/XMLViewer.tsx +22 -10
- package/src/widgets/xml-viewer/constants/index.ts +11 -0
- package/lib/esm/features/magic-pdf/PageSlider.js +0 -70
- package/lib/esm/features/magic-pdf/PageSlider.js.map +0 -1
- package/lib/esm/features/magic-pdf/PdfPageProvider.js +0 -188
- package/lib/esm/features/magic-pdf/PdfPageProvider.js.map +0 -1
- package/lib/esm/features/magic-pdf/TextPageView.js +0 -62
- package/lib/esm/features/magic-pdf/TextPageView.js.map +0 -1
- package/lib/esm/features/magic-pdf/useResizeOnDrag.js +0 -34
- package/lib/esm/features/magic-pdf/useResizeOnDrag.js.map +0 -1
- package/lib/types/features/magic-pdf/PageSlider.d.ts +0 -9
- package/lib/types/features/magic-pdf/PageSlider.d.ts.map +0 -1
- package/lib/types/features/magic-pdf/PdfPageProvider.d.ts +0 -39
- package/lib/types/features/magic-pdf/PdfPageProvider.d.ts.map +0 -1
- package/lib/types/features/magic-pdf/TextPageView.d.ts +0 -8
- package/lib/types/features/magic-pdf/TextPageView.d.ts.map +0 -1
- package/lib/types/features/magic-pdf/useResizeOnDrag.d.ts +0 -9
- package/lib/types/features/magic-pdf/useResizeOnDrag.d.ts.map +0 -1
- package/src/features/magic-pdf/PageSlider.tsx +0 -142
- package/src/features/magic-pdf/PdfPageProvider.tsx +0 -310
- package/src/features/magic-pdf/TextPageView.tsx +0 -91
- 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
|
}
|
package/src/features/index.ts
CHANGED
|
@@ -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 `${
|
|
43
|
+
return `${formatTitle(secondSegment)} Detail (...${pathSegments[2].slice(-6)})`;
|
|
33
44
|
} else if (pathSegments.length >= 2) {
|
|
34
|
-
return
|
|
45
|
+
return formatTitle(pathSegments[pathSegments.length - 1]);
|
|
35
46
|
} else if (pathSegments.length === 1) {
|
|
36
|
-
return
|
|
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: () =>
|
|
65
|
+
onClick: () => navigate(entry.href, { stepsBack: stepsBack })
|
|
55
66
|
});
|
|
56
67
|
});
|
|
57
68
|
}
|