@aintela/bi 0.2.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 (175) hide show
  1. package/README.md +299 -0
  2. package/dist/BiClientProvider-CWJochvi.js +219 -0
  3. package/dist/BiClientProvider-CWJochvi.js.map +1 -0
  4. package/dist/ChartCardDefaultsContext-Cl5T25H0.js +32 -0
  5. package/dist/ChartCardDefaultsContext-Cl5T25H0.js.map +1 -0
  6. package/dist/ChartContext-C_f_6khG.js +14 -0
  7. package/dist/ChartContext-C_f_6khG.js.map +1 -0
  8. package/dist/DashboardParametersContext-Clv--79U.js +39 -0
  9. package/dist/DashboardParametersContext-Clv--79U.js.map +1 -0
  10. package/dist/cards/ChartCard.d.ts +62 -0
  11. package/dist/cards/DataTableCard.d.ts +55 -0
  12. package/dist/cards/GaugeCard.d.ts +20 -0
  13. package/dist/cards/GaugeGroup.d.ts +12 -0
  14. package/dist/cards/MapBubbles.d.ts +35 -0
  15. package/dist/cards/MapConnections.d.ts +28 -0
  16. package/dist/cards/MetricCard.d.ts +15 -0
  17. package/dist/cards/MetricGroupCard.d.ts +10 -0
  18. package/dist/cards/TreeMapCard.d.ts +15 -0
  19. package/dist/cards/geoLayers.d.ts +23 -0
  20. package/dist/cards/index.d.ts +24 -0
  21. package/dist/cards/licenseGuard.d.ts +9 -0
  22. package/dist/cards/mapUtils.d.ts +23 -0
  23. package/dist/cards/useContainerRectangle.d.ts +9 -0
  24. package/dist/cards/worldMapPath.d.ts +7 -0
  25. package/dist/cards.d.ts +2 -0
  26. package/dist/cards.js +28 -0
  27. package/dist/cards.js.map +1 -0
  28. package/dist/client/BiClient.d.ts +160 -0
  29. package/dist/client/BiClientProvider.d.ts +21 -0
  30. package/dist/client/index.d.ts +4 -0
  31. package/dist/client.d.ts +2 -0
  32. package/dist/client.js +11 -0
  33. package/dist/client.js.map +1 -0
  34. package/dist/composer/environment/environmentDom.d.ts +31 -0
  35. package/dist/composer/environment/types.d.ts +67 -0
  36. package/dist/composer/icons/cardTypeIcons.d.ts +31 -0
  37. package/dist/composer/index.d.ts +66 -0
  38. package/dist/composer/llm/ExampleCardSketch.d.ts +22 -0
  39. package/dist/composer/llm/ExamplePad.d.ts +18 -0
  40. package/dist/composer/llm/PrototypePad.d.ts +13 -0
  41. package/dist/composer/llm/useDashboardPad.d.ts +25 -0
  42. package/dist/composer/models/catalog.d.ts +33 -0
  43. package/dist/composer/models/sketchModels.d.ts +102 -0
  44. package/dist/composer/models/utils.d.ts +9 -0
  45. package/dist/composer/pad/CardSketch.d.ts +25 -0
  46. package/dist/composer/pad/ClonedComponent.d.ts +13 -0
  47. package/dist/composer/pad/DashboardPad.d.ts +38 -0
  48. package/dist/composer/pad/DashboardPadEditor.d.ts +35 -0
  49. package/dist/composer/pad/DashboardPadSketch.d.ts +31 -0
  50. package/dist/composer/pad/DatasetParameterizationControls.d.ts +34 -0
  51. package/dist/composer/pad/FilterSketch.d.ts +10 -0
  52. package/dist/composer/pad/HoverButton.d.ts +12 -0
  53. package/dist/composer/pad/TitleSketch.d.ts +19 -0
  54. package/dist/composer/pad/ToolBox.d.ts +11 -0
  55. package/dist/composer/store/ComposerProvider.d.ts +36 -0
  56. package/dist/composer/store/createComposerStore.d.ts +107 -0
  57. package/dist/composer/store/drafts.d.ts +20 -0
  58. package/dist/composer/view/ComposerChatBinding.d.ts +10 -0
  59. package/dist/composer/view/ComposerView.d.ts +49 -0
  60. package/dist/composer/view/DashboardPin.d.ts +3 -0
  61. package/dist/composer/view/DashboardSidePanel.d.ts +10 -0
  62. package/dist/composer/view/DrawablePrompt.d.ts +22 -0
  63. package/dist/composer/view/EntryEmptyState.d.ts +22 -0
  64. package/dist/composer/view/SpotlightOverlay.d.ts +21 -0
  65. package/dist/composer/view/composerAnimations.d.ts +11 -0
  66. package/dist/composer/view/composerTypes.d.ts +18 -0
  67. package/dist/composer/view/data/suggestions.d.ts +10 -0
  68. package/dist/composer/view/data/templates.d.ts +33 -0
  69. package/dist/composer/view/surfaces.d.ts +19 -0
  70. package/dist/composer/view/useComposerChatBridge.d.ts +43 -0
  71. package/dist/composer.d.ts +2 -0
  72. package/dist/composer.js +99 -0
  73. package/dist/composer.js.map +1 -0
  74. package/dist/createBiTheme-TyUv_UHM.js +93 -0
  75. package/dist/createBiTheme-TyUv_UHM.js.map +1 -0
  76. package/dist/data/ChartCardDefaultsContext.d.ts +43 -0
  77. package/dist/data/dataUtils.d.ts +152 -0
  78. package/dist/data/index.d.ts +5 -0
  79. package/dist/data/queryModel.d.ts +23 -0
  80. package/dist/data.d.ts +2 -0
  81. package/dist/data.js +37 -0
  82. package/dist/data.js.map +1 -0
  83. package/dist/dataUtils-CAUE5uZY.js +372 -0
  84. package/dist/dataUtils-CAUE5uZY.js.map +1 -0
  85. package/dist/filters/VizAutoComplete.d.ts +23 -0
  86. package/dist/filters/VizDatePicker.d.ts +9 -0
  87. package/dist/filters/VizDateRangePicker.d.ts +14 -0
  88. package/dist/filters/VizSelect.d.ts +12 -0
  89. package/dist/filters/VizTextField.d.ts +8 -0
  90. package/dist/filters/VizTriggerButton.d.ts +9 -0
  91. package/dist/filters/filterFactory.d.ts +30 -0
  92. package/dist/filters/friendlyName.d.ts +4 -0
  93. package/dist/filters/index.d.ts +15 -0
  94. package/dist/filters.d.ts +2 -0
  95. package/dist/filters.js +15 -0
  96. package/dist/filters.js.map +1 -0
  97. package/dist/grid/BiErrorBoundary.d.ts +24 -0
  98. package/dist/grid/ChartContext.d.ts +14 -0
  99. package/dist/grid/GridCard.d.ts +45 -0
  100. package/dist/grid/GridCardPlaceHolder.d.ts +8 -0
  101. package/dist/grid/GridLayout.d.ts +147 -0
  102. package/dist/grid/gridModels.d.ts +33 -0
  103. package/dist/grid/index.d.ts +14 -0
  104. package/dist/grid/types.d.ts +23 -0
  105. package/dist/grid/useGridConfigTranslator.d.ts +72 -0
  106. package/dist/grid.d.ts +2 -0
  107. package/dist/grid.js +20 -0
  108. package/dist/grid.js.map +1 -0
  109. package/dist/hooks/DashboardParametersContext.d.ts +32 -0
  110. package/dist/hooks/index.d.ts +8 -0
  111. package/dist/hooks/useDashboardData.d.ts +20 -0
  112. package/dist/hooks/useDashboardLazyData.d.ts +79 -0
  113. package/dist/hooks.d.ts +2 -0
  114. package/dist/hooks.js +16 -0
  115. package/dist/hooks.js.map +1 -0
  116. package/dist/index-BYc79sSy.js +131 -0
  117. package/dist/index-BYc79sSy.js.map +1 -0
  118. package/dist/index-C6JQ6770.js +4545 -0
  119. package/dist/index-C6JQ6770.js.map +1 -0
  120. package/dist/index-CZbCaXMC.js +15 -0
  121. package/dist/index-CZbCaXMC.js.map +1 -0
  122. package/dist/index-D3OoOPjl.js +259 -0
  123. package/dist/index-D3OoOPjl.js.map +1 -0
  124. package/dist/index-D7Oo_dC-.js +94 -0
  125. package/dist/index-D7Oo_dC-.js.map +1 -0
  126. package/dist/index-D7tVPX8d.js +347 -0
  127. package/dist/index-D7tVPX8d.js.map +1 -0
  128. package/dist/index-DGyvUtY3.js +494 -0
  129. package/dist/index-DGyvUtY3.js.map +1 -0
  130. package/dist/index-DOpx0R4Y.js +41 -0
  131. package/dist/index-DOpx0R4Y.js.map +1 -0
  132. package/dist/index-wtSLspPh.js +1065 -0
  133. package/dist/index-wtSLspPh.js.map +1 -0
  134. package/dist/index.d.ts +12 -0
  135. package/dist/index.js +236 -0
  136. package/dist/index.js.map +1 -0
  137. package/dist/inline/Chart.d.ts +29 -0
  138. package/dist/inline/IFrame.d.ts +19 -0
  139. package/dist/inline/Metric.d.ts +16 -0
  140. package/dist/inline/MetricGroup.d.ts +11 -0
  141. package/dist/inline/index.d.ts +9 -0
  142. package/dist/inline/parseKnownNumbers.d.ts +11 -0
  143. package/dist/inline.d.ts +2 -0
  144. package/dist/inline.js +9 -0
  145. package/dist/inline.js.map +1 -0
  146. package/dist/runtime/IDashboardDefinition.d.ts +22 -0
  147. package/dist/runtime/biModuleSurface.d.ts +2 -0
  148. package/dist/runtime/createBiUiTools.d.ts +74 -0
  149. package/dist/runtime/index.d.ts +9 -0
  150. package/dist/runtime/loadDashboardBundle.d.ts +32 -0
  151. package/dist/runtime/registerBiModules.d.ts +36 -0
  152. package/dist/runtime/version.d.ts +6 -0
  153. package/dist/runtime.d.ts +2 -0
  154. package/dist/runtime.js +19 -0
  155. package/dist/runtime.js.map +1 -0
  156. package/dist/style.css +1 -0
  157. package/dist/theme/BiThemeBridge.d.ts +32 -0
  158. package/dist/theme/biPalette.d.ts +23 -0
  159. package/dist/theme/createBiTheme.d.ts +25 -0
  160. package/dist/theme/index.d.ts +5 -0
  161. package/dist/theme.d.ts +2 -0
  162. package/dist/theme.js +15 -0
  163. package/dist/theme.js.map +1 -0
  164. package/dist/version-DnqajORq.js +83 -0
  165. package/dist/version-DnqajORq.js.map +1 -0
  166. package/dist/viewer/ScriptDashboardViewer.d.ts +82 -0
  167. package/dist/viewer/ScriptDashboardViewerVertical.d.ts +24 -0
  168. package/dist/viewer/cardMetadata.d.ts +15 -0
  169. package/dist/viewer/index.d.ts +8 -0
  170. package/dist/viewer/models.d.ts +67 -0
  171. package/dist/viewer/useDashboardBundle.d.ts +73 -0
  172. package/dist/viewer.d.ts +2 -0
  173. package/dist/viewer.js +9 -0
  174. package/dist/viewer.js.map +1 -0
  175. package/package.json +196 -0
@@ -0,0 +1,82 @@
1
+ import { default as React } from 'react';
2
+ import { Layout, LayoutItem } from 'react-grid-layout';
3
+ import { SvgIconComponent } from '@mui/icons-material';
4
+ import { BiClient } from '../client';
5
+ import { Dashboard, CardSpecificType } from './models';
6
+ import { DashboardWaitingOptions } from './useDashboardBundle';
7
+ export type { DashboardWaitingOptions };
8
+ export interface ScriptDashboardExportArgs {
9
+ dashboard: Dashboard;
10
+ /** Current filter values, as the cards see them. */
11
+ parameters: Record<string, string | string[]>;
12
+ datasetOverride?: string;
13
+ }
14
+ export interface ScriptDashboardHeaderRenderArgs {
15
+ name?: string;
16
+ iconName?: string;
17
+ /** Already-built filter elements ready to drop into the host's chrome. */
18
+ filters: React.ReactNode | null;
19
+ hasFilters: boolean;
20
+ /** Trigger the host's PDF export (`onExportPdf`), or `undefined` when none was given. */
21
+ onExportPdf?: () => void;
22
+ /** Open the host's schedule UI (`onSchedule`), or `undefined`. */
23
+ onSchedule?: () => void;
24
+ /** Navigate to the host's editor (`onEdit`), or `undefined`. */
25
+ onEdit?: () => void;
26
+ exporting: boolean;
27
+ readonly: boolean;
28
+ canEdit: boolean;
29
+ canSchedule: boolean;
30
+ dashboard: Dashboard | null;
31
+ /** The host's dataset control (`datasetOverrideControl` prop), `null` unless admin + parameterised. */
32
+ datasetOverrideControl: React.ReactNode | null;
33
+ }
34
+ export interface ScriptDashboardViewerProps {
35
+ /** Defaults to the ambient `BiClientProvider`. */
36
+ client?: BiClient;
37
+ dashboardId?: string;
38
+ parameters?: Record<string, string | string[]>;
39
+ height?: number | string;
40
+ dragLocked?: boolean;
41
+ /** Provide the dashboard document directly instead of fetching it. */
42
+ dashboard?: Dashboard;
43
+ /** When true, layout items are resizable and `onLayoutCommit` receives user edits. */
44
+ editable?: boolean;
45
+ /** Render the classic title row + buttons + filters bar instead of the compact filters-only bar. */
46
+ useClassicHeader?: boolean;
47
+ onDashloadLoaded?: (dashboard: Dashboard) => void;
48
+ onFiltersChanged?: (filters: Record<string, unknown>) => void;
49
+ /** Replace the built-in header with a host-rendered bar. Receives the built filters + handlers. */
50
+ headerRender?: (args: ScriptDashboardHeaderRenderArgs) => React.ReactNode;
51
+ /** Show the "waiting for generation" overlay and poll the sub-agent. */
52
+ dashboardWaiting?: DashboardWaitingOptions;
53
+ /** Data-refresh tick → cards refetch with `noCache`. Does NOT re-instantiate the bundle. */
54
+ llmRenderCount?: number;
55
+ /** Bundle re-instantiation trigger — bump only on real code (re)generation. */
56
+ codeGeneration?: number;
57
+ /** Print / read-only preview (was the `?printPreview=true` URL flag). */
58
+ isPrintPreview?: boolean;
59
+ /** Export the dashboard (e.g. call your PDF endpoint). The viewer tracks the `exporting` state around it. */
60
+ onExportPdf?: (args: ScriptDashboardExportArgs) => Promise<void> | void;
61
+ /** Open your scheduling UI. */
62
+ onSchedule?: () => void;
63
+ scheduleLabel?: string;
64
+ /** Navigate to your editor. */
65
+ onEdit?: () => void;
66
+ /** User finished a resize / drag (never fired on prop syncs). */
67
+ onLayoutCommit?: (layout: Layout, oldItem: LayoutItem, newItem: LayoutItem) => void;
68
+ /** Admin-only runtime dataset override threaded into every data fetch. */
69
+ datasetOverride?: string;
70
+ /** Whether the viewer is shown to an admin (gates `datasetOverrideControl`). */
71
+ isAdmin?: boolean;
72
+ /** A ready-to-render dataset picker the host owns; shown when `isAdmin` and the dashboard is parameterised. */
73
+ datasetOverrideControl?: React.ReactNode;
74
+ /** Icon for a card's header, by its specific type. Default: no icon. */
75
+ resolveCardIcon?: (specificType: CardSpecificType) => string | SvgIconComponent | undefined;
76
+ /** Series palette for every chart in this dashboard (defaults to `theme.palette.bi.series`). */
77
+ chartPalette?: readonly string[];
78
+ /** Show the floating zoom slider (default true outside print preview). */
79
+ showZoomControl?: boolean;
80
+ }
81
+ export declare const ScriptDashboardViewer: React.FC<ScriptDashboardViewerProps>;
82
+ export default ScriptDashboardViewer;
@@ -0,0 +1,24 @@
1
+ import { default as React } from 'react';
2
+ import { SvgIconComponent } from '@mui/icons-material';
3
+ import { BiClient } from '../client';
4
+ import { Dashboard, CardSpecificType } from './models';
5
+ import { DashboardWaitingOptions } from './useDashboardBundle';
6
+ export interface ScriptDashboardViewerVerticalProps {
7
+ client?: BiClient;
8
+ dashboardId?: string;
9
+ parameters?: Record<string, string | string[]>;
10
+ height?: number | string;
11
+ dashboard?: Dashboard;
12
+ onDashloadLoaded?: (dashboard: Dashboard) => void;
13
+ onFiltersChanged?: (filters: Record<string, unknown>) => void;
14
+ dashboardWaiting?: DashboardWaitingOptions;
15
+ /** Data-refresh tick → `refreshTick` (cards refetch). Does NOT re-instantiate the bundle. */
16
+ llmRenderCount?: number;
17
+ /** Bundle re-instantiation trigger — bump only on real code (re)generation. */
18
+ codeGeneration?: number;
19
+ isPrintPreview?: boolean;
20
+ datasetOverride?: string;
21
+ resolveCardIcon?: (specificType: CardSpecificType) => string | SvgIconComponent | undefined;
22
+ }
23
+ export declare const ScriptDashboardViewerVertical: React.FC<ScriptDashboardViewerVerticalProps>;
24
+ export default ScriptDashboardViewerVertical;
@@ -0,0 +1,15 @@
1
+ import { GridCardColor } from '../grid/GridCard';
2
+ import { DashboardCardDefinition } from '../runtime/IDashboardDefinition';
3
+ import { CardCategory, CardSpecificType, Dashboard } from './models';
4
+ /** Card category → GridCard accent variant. */
5
+ export declare const CATEGORY_PREFIXES: Record<CardCategory, GridCardColor>;
6
+ /**
7
+ * Per-card metadata: the sketch (`dashboard.cards[i]`) overrides the bundle's
8
+ * hardcoded title / specificType / category; the bundle's values are the
9
+ * fallback.
10
+ */
11
+ export declare function resolveCardMetadata(card: DashboardCardDefinition, dashboard: Dashboard | undefined): {
12
+ title: string | undefined;
13
+ specificType: CardSpecificType | undefined;
14
+ category: CardCategory | undefined;
15
+ };
@@ -0,0 +1,8 @@
1
+ export { useDashboardBundle } from './useDashboardBundle';
2
+ export type { UseDashboardBundleOptions, DashboardBundleResult as UseDashboardBundleResult, DashboardBundleSnackbarState, DashboardWaitingOptions } from './useDashboardBundle';
3
+ export { ScriptDashboardViewer } from './ScriptDashboardViewer';
4
+ export type { ScriptDashboardViewerProps, ScriptDashboardHeaderRenderArgs, ScriptDashboardExportArgs } from './ScriptDashboardViewer';
5
+ export { ScriptDashboardViewerVertical } from './ScriptDashboardViewerVertical';
6
+ export type { ScriptDashboardViewerVerticalProps } from './ScriptDashboardViewerVertical';
7
+ export { CATEGORY_PREFIXES, resolveCardMetadata } from './cardMetadata';
8
+ export type { Dashboard, SketchCardItem, CardCategory, CardSpecificType, VizFilterComponent, VizAutoCompleteComponent, VizDateRangePickerComponent, VizBaseComponent } from './models';
@@ -0,0 +1,67 @@
1
+ import { LayoutItem, ResponsiveLayouts } from 'react-grid-layout';
2
+ import { TodoItem } from '@aintela/chat/models';
3
+ import { GridConfig } from '../grid/gridModels';
4
+ import { SketchedFilter } from '../filters/filterFactory';
5
+ export type CardCategory = 'Generic' | 'Métrica' | 'Tabela' | 'Gráfico' | 'Mapa' | 'Árvore' | 'Medidor';
6
+ export type CardSpecificType = 'Generic' | 'MetricComparison' | 'TableAuto' | 'TableBars' | 'TableHeatmap' | 'TableLarge' | 'ChartAuto' | 'ChartLine' | 'ChartBarH' | 'ChartBarV' | 'ChartArea' | 'ChartStackedArea' | 'ChartStackedBar' | 'ChartCombo' | 'ChartPie' | 'ChartDonut' | 'Scatter' | 'MapBubbles' | 'MapConnections' | 'Treemap' | 'Gauge';
7
+ /** A card on the dashboard sketch: its grid item plus authoring metadata. */
8
+ export interface SketchCardItem extends LayoutItem {
9
+ name?: string;
10
+ todoItem?: TodoItem;
11
+ muiIconName?: string;
12
+ color?: string;
13
+ turnOpen?: boolean;
14
+ actionDescription?: string;
15
+ category?: CardCategory;
16
+ specificType?: CardSpecificType;
17
+ }
18
+ /** Base filter component with `$type` discriminator. */
19
+ export interface VizBaseComponent {
20
+ name: string;
21
+ parameter_name: string;
22
+ $type: string;
23
+ }
24
+ export interface VizAutoCompleteComponent extends VizBaseComponent {
25
+ $type: 'VizAutoComplete';
26
+ name: 'VizAutoComplete';
27
+ multipleSelection: boolean;
28
+ valueFieldName: string;
29
+ queryHash?: string | null;
30
+ displayFieldName?: string | null;
31
+ }
32
+ export interface VizDateRangePickerComponent extends VizBaseComponent {
33
+ $type: 'VizDateRangePicker';
34
+ name: 'VizDateRangePicker';
35
+ initialStartValue: string;
36
+ initialEndValue: string;
37
+ parameterStartDateName: string;
38
+ parameterEndDateName: string;
39
+ }
40
+ export type VizFilterComponent = VizAutoCompleteComponent | VizDateRangePickerComponent;
41
+ export interface Dashboard {
42
+ id?: string;
43
+ name: string;
44
+ remarks?: string;
45
+ userPrompt?: string;
46
+ layoutType?: 'Naked' | 'Boxed';
47
+ /** Session whose workspace holds the compiled bundle. */
48
+ originalSessionId?: string | null;
49
+ jsFileName?: string;
50
+ clientId?: string;
51
+ muiIconName?: string;
52
+ grid_definition?: GridConfig | null;
53
+ dashboardFolderId?: string;
54
+ updated_grid_definition?: ResponsiveLayouts;
55
+ filter_components?: VizFilterComponent[];
56
+ cards?: SketchCardItem[];
57
+ filters?: SketchedFilter[];
58
+ updatedAt?: Date | null;
59
+ created?: Date | null;
60
+ description?: string | null;
61
+ userId?: string | null;
62
+ accountId?: string | null;
63
+ pinned?: boolean;
64
+ /** Authored against a template dataset; every query uses `{{DATASET}}`. */
65
+ isDatasetParameterized?: boolean;
66
+ defaultDatasetName?: string;
67
+ }
@@ -0,0 +1,73 @@
1
+ import { MutableRefObject, ReactNode, Dispatch, SetStateAction } from 'react';
2
+ import { LayoutItem } from 'react-grid-layout';
3
+ import { SubAgentDto } from '@aintela/chat/models';
4
+ import { BiClient } from '../client';
5
+ import { DashboardCardDefinition } from '../runtime/IDashboardDefinition';
6
+ import { Dashboard } from './models';
7
+ export interface DashboardWaitingOptions {
8
+ /** Id of the SubAgent currently generating this dashboard. */
9
+ subAgentId: string;
10
+ /**
11
+ * Chat session the sub-agent runs in. Falls back to
12
+ * `dashboard.originalSessionId` (undefined while the dashboard is still
13
+ * being generated — pass it explicitly for the waiting case).
14
+ */
15
+ sessionId?: string;
16
+ /** Polling interval in ms while the sub-agent is running. Minimum / default 10000. */
17
+ pollIntervalMs?: number;
18
+ }
19
+ export interface UseDashboardBundleOptions {
20
+ /** Defaults to the ambient `BiClientProvider`. */
21
+ client?: BiClient;
22
+ dashboardId?: string;
23
+ parameters?: Record<string, string | string[]>;
24
+ dashboard?: Dashboard;
25
+ dashboardWaiting?: DashboardWaitingOptions;
26
+ /**
27
+ * Re-instantiation trigger: bump ONLY when the bundle CODE is (re)generated,
28
+ * loaded or explicitly refreshed. Not for per-edit layout commits — the
29
+ * agent-emitted JS only changes on a rebuild, and the server derives the
30
+ * filename from the dashboard NAME so `jsFileName` cannot signal one.
31
+ */
32
+ codeGeneration?: number;
33
+ onDashloadLoaded?: (dashboard: Dashboard) => void;
34
+ onFiltersChanged?: (filters: Record<string, unknown>) => void;
35
+ /** Keep `isResizable` on layout items (read-only viewers leave it false). */
36
+ editable?: boolean;
37
+ /** Print / read-only preview (was the `?printPreview=true` URL flag). */
38
+ isPrintPreview?: boolean;
39
+ }
40
+ export interface DashboardBundleSnackbarState {
41
+ open: boolean;
42
+ message: string;
43
+ severity: 'success' | 'error';
44
+ }
45
+ export interface DashboardBundleResult {
46
+ dashboard: Dashboard | undefined;
47
+ cards: DashboardCardDefinition[] | null;
48
+ style: ReactNode | null;
49
+ loading: boolean;
50
+ error: string | null;
51
+ setError: (e: string | null) => void;
52
+ filters: ReactNode;
53
+ filterOptions: {
54
+ onChange: (key: string, value: string | string[]) => void;
55
+ parameters: Record<string, string | string[]>;
56
+ readonly: boolean;
57
+ };
58
+ stateParameters: Record<string, string | string[]>;
59
+ handleParameterChange: (key: string, value: string | string[]) => void;
60
+ containerRef: MutableRefObject<HTMLDivElement | null>;
61
+ containerWidth: number;
62
+ rawLayoutDefinition: LayoutItem[] | undefined;
63
+ layoutDefinition: LayoutItem[] | undefined;
64
+ effectiveDashboardId: string | undefined;
65
+ isPrintPreview: boolean;
66
+ snackbar: DashboardBundleSnackbarState;
67
+ setSnackbar: Dispatch<SetStateAction<DashboardBundleSnackbarState>>;
68
+ subAgentStatus: SubAgentDto | null;
69
+ isSubAgentTracked: boolean;
70
+ subAgentDone: boolean;
71
+ subAgentFailed: boolean;
72
+ }
73
+ export declare function useDashboardBundle(options: UseDashboardBundleOptions): DashboardBundleResult;
@@ -0,0 +1,2 @@
1
+ export * from './viewer/index'
2
+ export {}
package/dist/viewer.js ADDED
@@ -0,0 +1,9 @@
1
+ import { b as e, K as s, L as d, ar as o, aL as t } from "./index-C6JQ6770.js";
2
+ export {
3
+ e as CATEGORY_PREFIXES,
4
+ s as ScriptDashboardViewer,
5
+ d as ScriptDashboardViewerVertical,
6
+ o as resolveCardMetadata,
7
+ t as useDashboardBundle
8
+ };
9
+ //# sourceMappingURL=viewer.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"viewer.js","sources":[],"sourcesContent":[],"names":[],"mappings":";"}
package/package.json ADDED
@@ -0,0 +1,196 @@
1
+ {
2
+ "name": "@aintela/bi",
3
+ "version": "0.2.0",
4
+ "description": "BI visualisation components, dashboard grid, hooks, the dashboard composer (sketch pad + authoring view) and the LLM runtime registry for the AIA platform (extracted from Envision's dashboard app).",
5
+ "type": "module",
6
+ "license": "UNLICENSED",
7
+ "publishConfig": {
8
+ "access": "public"
9
+ },
10
+ "main": "./dist/index.js",
11
+ "types": "./dist/index.d.ts",
12
+ "sideEffects": [
13
+ "**/*.css"
14
+ ],
15
+ "exports": {
16
+ ".": {
17
+ "types": "./dist/index.d.ts",
18
+ "import": "./dist/index.js"
19
+ },
20
+ "./data": {
21
+ "types": "./dist/data.d.ts",
22
+ "import": "./dist/data.js"
23
+ },
24
+ "./inline": {
25
+ "types": "./dist/inline.d.ts",
26
+ "import": "./dist/inline.js"
27
+ },
28
+ "./cards": {
29
+ "types": "./dist/cards.d.ts",
30
+ "import": "./dist/cards.js"
31
+ },
32
+ "./grid": {
33
+ "types": "./dist/grid.d.ts",
34
+ "import": "./dist/grid.js"
35
+ },
36
+ "./runtime": {
37
+ "types": "./dist/runtime.d.ts",
38
+ "import": "./dist/runtime.js"
39
+ },
40
+ "./hooks": {
41
+ "types": "./dist/hooks.d.ts",
42
+ "import": "./dist/hooks.js"
43
+ },
44
+ "./filters": {
45
+ "types": "./dist/filters.d.ts",
46
+ "import": "./dist/filters.js"
47
+ },
48
+ "./viewer": {
49
+ "types": "./dist/viewer.d.ts",
50
+ "import": "./dist/viewer.js"
51
+ },
52
+ "./theme": {
53
+ "types": "./dist/theme.d.ts",
54
+ "import": "./dist/theme.js"
55
+ },
56
+ "./client": {
57
+ "types": "./dist/client.d.ts",
58
+ "import": "./dist/client.js"
59
+ },
60
+ "./composer": {
61
+ "types": "./dist/composer.d.ts",
62
+ "import": "./dist/composer.js"
63
+ },
64
+ "./style": "./dist/style.css",
65
+ "./style.css": "./dist/style.css"
66
+ },
67
+ "typesVersions": {
68
+ "*": {
69
+ "data": [
70
+ "./dist/data.d.ts"
71
+ ],
72
+ "inline": [
73
+ "./dist/inline.d.ts"
74
+ ],
75
+ "cards": [
76
+ "./dist/cards.d.ts"
77
+ ],
78
+ "grid": [
79
+ "./dist/grid.d.ts"
80
+ ],
81
+ "runtime": [
82
+ "./dist/runtime.d.ts"
83
+ ],
84
+ "hooks": [
85
+ "./dist/hooks.d.ts"
86
+ ],
87
+ "filters": [
88
+ "./dist/filters.d.ts"
89
+ ],
90
+ "viewer": [
91
+ "./dist/viewer.d.ts"
92
+ ],
93
+ "theme": [
94
+ "./dist/theme.d.ts"
95
+ ],
96
+ "client": [
97
+ "./dist/client.d.ts"
98
+ ],
99
+ "composer": [
100
+ "./dist/composer.d.ts"
101
+ ]
102
+ }
103
+ },
104
+ "files": [
105
+ "dist",
106
+ "README.md"
107
+ ],
108
+ "scripts": {
109
+ "build": "vite build",
110
+ "dev": "vite build --watch",
111
+ "typecheck": "tsc --noEmit",
112
+ "test": "vitest run",
113
+ "test:watch": "vitest",
114
+ "lint": "eslint \"src/**/*.{ts,tsx}\" && stylelint \"src/**/*.css\"",
115
+ "prepack": "vite build"
116
+ },
117
+ "peerDependencies": {
118
+ "@aintela/chat": "^0.4.25",
119
+ "@emotion/react": "^11.14.0",
120
+ "@emotion/styled": "^11.14.0",
121
+ "@mui/icons-material": "^7.0.0",
122
+ "@mui/material": "^7.0.0",
123
+ "@mui/x-data-grid-pro": "^8.0.0",
124
+ "@mui/x-date-pickers": "^8.0.0",
125
+ "@mui/x-date-pickers-pro": "^8.0.0",
126
+ "dayjs": "^1.11.0",
127
+ "framer-motion": "^11.18.0 || ^12.0.0",
128
+ "react": "^18.2.0",
129
+ "react-dom": "^18.2.0",
130
+ "react-grid-layout": "^2.2.0",
131
+ "react-simple-maps": "^3.0.0",
132
+ "recharts": "^2.15.0 || ^3.0.0",
133
+ "zustand": "^5.0.0"
134
+ },
135
+ "peerDependenciesMeta": {
136
+ "@mui/x-date-pickers": {
137
+ "optional": true
138
+ },
139
+ "@mui/x-date-pickers-pro": {
140
+ "optional": true
141
+ },
142
+ "zustand": {
143
+ "optional": true
144
+ },
145
+ "framer-motion": {
146
+ "optional": true
147
+ }
148
+ },
149
+ "devDependencies": {
150
+ "@aintela/chat": "0.4.25",
151
+ "@emotion/react": "^11.14.0",
152
+ "@emotion/styled": "^11.14.1",
153
+ "@eslint/js": "^9.39.0",
154
+ "@mui/icons-material": "^7.3.0",
155
+ "@mui/material": "^7.3.0",
156
+ "@mui/x-data-grid-pro": "^8.29.0",
157
+ "@mui/x-date-pickers": "^8.29.0",
158
+ "@mui/x-date-pickers-pro": "^8.29.0",
159
+ "@testing-library/dom": "^10.4.1",
160
+ "@testing-library/react": "^16.3.0",
161
+ "@types/node": "^22.18.0",
162
+ "@types/react": "^18.3.0",
163
+ "@types/react-dom": "^18.3.0",
164
+ "@types/react-simple-maps": "^3.0.6",
165
+ "@vitejs/plugin-react": "^4.5.2",
166
+ "axios": "^1.11.0",
167
+ "date-fns": "^4.1.0",
168
+ "dayjs": "^1.11.19",
169
+ "eslint": "^9.39.0",
170
+ "framer-motion": "^11.18.2",
171
+ "globals": "^16.2.0",
172
+ "happy-dom": "^20.11.0",
173
+ "lodash": "^4.17.21",
174
+ "notistack": "^3.0.2",
175
+ "react": "^18.3.1",
176
+ "react-dom": "^18.3.1",
177
+ "react-grid-layout": "^2.2.2",
178
+ "react-markdown": "^10.1.0",
179
+ "react-router-dom": "^7.8.2",
180
+ "react-simple-maps": "^3.0.0",
181
+ "react-syntax-highlighter": "^16.1.0",
182
+ "recharts": "^2.15.4",
183
+ "reflect-metadata": "^0.2.2",
184
+ "rehype-raw": "^7.0.0",
185
+ "remark-gfm": "^4.0.1",
186
+ "stylelint": "^16.26.0",
187
+ "typedjson": "^1.8.0",
188
+ "typescript": "~5.8.3",
189
+ "typescript-eslint": "^8.34.1",
190
+ "use-debounce": "^10.0.5",
191
+ "vite": "^6.3.5",
192
+ "vite-plugin-dts": "^4.5.0",
193
+ "vitest": "^3.2.4",
194
+ "zustand": "^5.0.8"
195
+ }
196
+ }