@sisense/sdk-ui 2.24.0 → 2.26.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/dist/ai.cjs +59 -59
- package/dist/ai.js +1097 -1171
- package/dist/analytics-composer/node.cjs +1 -1
- package/dist/analytics-composer/node.js +587 -616
- package/dist/analytics-composer.cjs +1 -1
- package/dist/analytics-composer.js +6 -6
- package/dist/{execute-query-b9oy2Egy.js → apply-styled-options-to-query-Bzt2GrgO.js} +1635 -1530
- package/dist/apply-styled-options-to-query-COD9fRYD.cjs +1 -0
- package/dist/{dimensions-C1R5YRt-.js → dimensions-Ce2zWFrs.js} +1 -1
- package/dist/dimensions-u3w5qNF0.cjs +1 -0
- package/dist/{index-Ck-0gJC9.cjs → index-BX9p-XrU.cjs} +1 -1
- package/dist/{index-r66Tjiqj.js → index-D7mHzfx0.js} +9 -0
- package/dist/index.cjs +467 -452
- package/dist/index.js +27214 -34168
- package/dist/index.umd.js +718 -706
- package/dist/packages/sdk-ui/src/domains/dashboarding/dashboard-model/translate-dashboard-utils.d.ts +2 -0
- package/dist/packages/sdk-ui/src/domains/dashboarding/dashboard-model/types.d.ts +12 -1
- package/dist/packages/sdk-ui/src/domains/dashboarding/dashboard-model/use-dashboard-model/dashboard-model-reducer/persist-dashboard-model-middleware.d.ts +17 -5
- package/dist/packages/sdk-ui/src/domains/dashboarding/dashboard-model/use-dashboard-model/dashboard-model-reducer/types.d.ts +16 -1
- package/dist/packages/sdk-ui/src/domains/dashboarding/dashboard-model/use-dashboard-model/dashboard-model-reducer/utils.d.ts +5 -2
- package/dist/packages/sdk-ui/src/domains/dashboarding/hooks/duplicate-widget/use-duplicate-widget-menu-item.d.ts +1 -1
- package/dist/packages/sdk-ui/src/domains/dashboarding/hooks/rename-widget/use-widget-renaming.d.ts +1 -1
- package/dist/packages/sdk-ui/src/domains/dashboarding/hooks/use-widget-scroll-persistence.d.ts +16 -0
- package/dist/packages/sdk-ui/src/domains/dashboarding/index.d.ts +2 -0
- package/dist/packages/sdk-ui/src/domains/dashboarding/persistence/persistence-manager.d.ts +11 -0
- package/dist/packages/sdk-ui/src/domains/dashboarding/persistence/types.d.ts +52 -0
- package/dist/packages/sdk-ui/src/domains/dashboarding/types.d.ts +5 -28
- package/dist/packages/sdk-ui/src/domains/dashboarding/use-composed-dashboard.d.ts +6 -5
- package/dist/packages/sdk-ui/src/domains/data-browser/data-source-dimensional-model/hooks/use-get-data-source-dimensions.d.ts +10 -0
- package/dist/packages/sdk-ui/src/domains/data-browser/data-source-dimensional-model/hooks/use-get-data-source-fields.d.ts +2 -0
- package/dist/packages/sdk-ui/src/domains/drilldown/components/drilldown-widget/drilldown-widget.d.ts +2 -2
- package/dist/packages/sdk-ui/src/domains/narrative/components/narrative-collapsible.d.ts +13 -0
- package/dist/packages/sdk-ui/src/domains/narrative/components/narrative-top-slot-shell.d.ts +21 -0
- package/dist/packages/sdk-ui/src/domains/narrative/components/widget-narrative-interactive.d.ts +11 -0
- package/dist/packages/sdk-ui/src/domains/narrative/components/widget-narrative.d.ts +40 -0
- package/dist/packages/sdk-ui/src/domains/narrative/core/build-narrative-request.d.ts +36 -0
- package/dist/packages/sdk-ui/src/domains/narrative/core/get-narrative-dimensions-and-measures.d.ts +22 -0
- package/dist/packages/sdk-ui/src/domains/narrative/core/widget-narrative-options.d.ts +29 -0
- package/dist/packages/sdk-ui/src/domains/narrative/core/widget-props-to-narrative-params.d.ts +36 -0
- package/dist/packages/sdk-ui/src/domains/narrative/hooks/use-get-widget-narrative.d.ts +62 -0
- package/dist/packages/sdk-ui/src/domains/narrative/hooks/use-widget-narrative-state.d.ts +39 -0
- package/dist/packages/sdk-ui/src/domains/query-execution/core/date-formats/simple-date-format-replacers.d.ts +13 -0
- package/dist/packages/sdk-ui/src/domains/query-execution/hooks/use-execute-pivot-query/use-execute-pivot-query.d.ts +2 -2
- package/dist/packages/sdk-ui/src/domains/query-execution/hooks/use-execute-query/use-execute-query.d.ts +2 -2
- package/dist/packages/sdk-ui/src/domains/visualizations/components/area-chart.d.ts +2 -2
- package/dist/packages/sdk-ui/src/domains/visualizations/components/areamap-chart.d.ts +2 -2
- package/dist/packages/sdk-ui/src/domains/visualizations/components/bar-chart.d.ts +2 -2
- package/dist/packages/sdk-ui/src/domains/visualizations/components/boxplot-chart/boxplot-chart.d.ts +2 -2
- package/dist/packages/sdk-ui/src/domains/visualizations/components/chart/chart.d.ts +2 -2
- package/dist/packages/sdk-ui/src/domains/visualizations/components/chart/restructured-charts/highchart-based-charts/cartesians/helpers/highchart-options/axis.d.ts +1 -1
- package/dist/packages/sdk-ui/src/domains/visualizations/components/column-chart.d.ts +2 -2
- package/dist/packages/sdk-ui/src/domains/visualizations/components/funnel-chart.d.ts +2 -2
- package/dist/packages/sdk-ui/src/domains/visualizations/components/line-chart.d.ts +2 -2
- package/dist/packages/sdk-ui/src/domains/visualizations/components/pie-chart/pie-chart.d.ts +2 -2
- package/dist/packages/sdk-ui/src/domains/visualizations/components/polar-chart.d.ts +2 -2
- package/dist/packages/sdk-ui/src/domains/visualizations/components/scatter-chart.d.ts +2 -2
- package/dist/packages/sdk-ui/src/domains/visualizations/components/scattermap-chart.d.ts +2 -2
- package/dist/packages/sdk-ui/src/domains/visualizations/components/sunburst-chart/sunburst-chart.d.ts +2 -2
- package/dist/packages/sdk-ui/src/domains/visualizations/components/table/table.d.ts +2 -2
- package/dist/packages/sdk-ui/src/domains/visualizations/components/treemap-chart/treemap-chart.d.ts +2 -2
- package/dist/packages/sdk-ui/src/domains/visualizations/core/chart-data-options/apply-styled-options-to-query.d.ts +87 -0
- package/dist/packages/sdk-ui/src/domains/visualizations/core/chart-data-options/translate-data-options.d.ts +13 -1
- package/dist/packages/sdk-ui/src/domains/visualizations/core/chart-data-options/types.d.ts +6 -6
- package/dist/packages/sdk-ui/src/domains/visualizations/core/chart-options-processor/cartesian/utils/axis/axis-builders.d.ts +6 -1
- package/dist/packages/sdk-ui/src/domains/visualizations/core/chart-options-processor/plot-bands.d.ts +2 -1
- package/dist/packages/sdk-ui/src/domains/visualizations/core/chart-options-processor/translations/axis-section.d.ts +29 -1
- package/dist/packages/sdk-ui/src/domains/visualizations/core/chart-options-processor/translations/design-options.d.ts +1 -0
- package/dist/packages/sdk-ui/src/domains/visualizations/core/chart-options-processor/translations/tooltip-utils.d.ts +1 -1
- package/dist/packages/sdk-ui/src/domains/visualizations/core/query-definition/compose-code-to-readable.d.ts +32 -0
- package/dist/packages/sdk-ui/src/domains/visualizations/core/query-definition/index.d.ts +9 -0
- package/dist/packages/sdk-ui/src/domains/visualizations/core/query-definition/query-definition.d.ts +26 -0
- package/dist/packages/sdk-ui/src/domains/visualizations/core/query-definition/query-params-to-view-model.d.ts +16 -0
- package/dist/packages/sdk-ui/src/domains/visualizations/core/query-definition/query-pill-bubble-tooltip.d.ts +12 -0
- package/dist/packages/sdk-ui/src/domains/visualizations/core/query-definition/query-pill.d.ts +18 -0
- package/dist/packages/sdk-ui/src/domains/visualizations/core/query-definition/types.d.ts +51 -0
- package/dist/packages/sdk-ui/src/domains/widgets/components/widget-by-id/translate-widget-style-options/to-widget-dto-style.d.ts +166 -2
- package/dist/packages/sdk-ui/src/domains/widgets/components/widget-by-id/types.d.ts +18 -0
- package/dist/packages/sdk-ui/src/domains/widgets/components/widget-by-id/use-scroller-location-save.d.ts +8 -0
- package/dist/packages/sdk-ui/src/domains/widgets/components/widget-by-id/utils.d.ts +9 -0
- package/dist/packages/sdk-ui/src/domains/widgets/components/widget-by-id/widget-by-id.d.ts +2 -2
- package/dist/packages/sdk-ui/src/domains/widgets/components/widget-by-id/with-navigator-scroll-save.d.ts +10 -0
- package/dist/packages/sdk-ui/src/domains/widgets/widget-model/use-get-widget-model.d.ts +2 -2
- package/dist/packages/sdk-ui/src/domains/widgets/widget-model/widget-model-translator/to-widget-dto-panels.d.ts +170 -0
- package/dist/packages/sdk-ui/src/domains/widgets/widget-model/widget-model-translator/utils.d.ts +9 -0
- package/dist/packages/sdk-ui/src/domains/widgets/widget-model/widget-model-translator/widget-model-translator.d.ts +13 -16
- package/dist/packages/sdk-ui/src/infra/api/narrative/narrative-api-types.d.ts +32 -0
- package/dist/packages/sdk-ui/src/infra/api/narrative/narrative-constants.d.ts +6 -0
- package/dist/packages/sdk-ui/src/infra/api/narrative/narrative-endpoints.d.ts +26 -0
- package/dist/packages/sdk-ui/src/infra/api/narrative/send-ai-feedback.d.ts +8 -0
- package/dist/packages/sdk-ui/src/infra/api/rest-api.d.ts +12 -1
- package/dist/packages/sdk-ui/src/infra/app/settings/settings.d.ts +10 -2
- package/dist/packages/sdk-ui/src/infra/contexts/custom-widgets-provider/use-custom-widgets.d.ts +10 -3
- package/dist/packages/sdk-ui/src/infra/contexts/emotion-cache-provider/emotion-cache-provider.d.ts +31 -3
- package/dist/packages/sdk-ui/src/infra/contexts/emotion-cache-provider/stylis-plugins/css-selector-prefix-plugin.d.ts +18 -0
- package/dist/packages/sdk-ui/src/infra/plugins/plugin-context.d.ts +2 -2
- package/dist/packages/sdk-ui/src/infra/plugins/types.d.ts +2 -2
- package/dist/packages/sdk-ui/src/infra/plugins/widget-plugins/types.d.ts +9 -0
- package/dist/packages/sdk-ui/src/infra/translation/resources/__external__/de-de.d.ts +9 -0
- package/dist/packages/sdk-ui/src/infra/translation/resources/__external__/en-us.d.ts +9 -0
- package/dist/packages/sdk-ui/src/infra/translation/resources/__external__/es-ar.d.ts +9 -0
- package/dist/packages/sdk-ui/src/infra/translation/resources/__external__/es-es.d.ts +9 -0
- package/dist/packages/sdk-ui/src/infra/translation/resources/__external__/fr-fr.d.ts +9 -0
- package/dist/packages/sdk-ui/src/infra/translation/resources/__external__/it-it.d.ts +9 -0
- package/dist/packages/sdk-ui/src/infra/translation/resources/__external__/ja-jp.d.ts +9 -0
- package/dist/packages/sdk-ui/src/infra/translation/resources/__external__/ko-kr.d.ts +9 -0
- package/dist/packages/sdk-ui/src/infra/translation/resources/__external__/nl-nl.d.ts +9 -0
- package/dist/packages/sdk-ui/src/infra/translation/resources/__external__/pt-br.d.ts +9 -0
- package/dist/packages/sdk-ui/src/infra/translation/resources/__external__/ru-ru.d.ts +9 -0
- package/dist/packages/sdk-ui/src/infra/translation/resources/__external__/tr-tr.d.ts +9 -0
- package/dist/packages/sdk-ui/src/infra/translation/resources/__external__/zh-cn.d.ts +9 -0
- package/dist/packages/sdk-ui/src/infra/translation/resources/en.d.ts +9 -0
- package/dist/packages/sdk-ui/src/infra/translation/resources/index.d.ts +18 -0
- package/dist/packages/sdk-ui/src/modules/ai/api/chat-rest-api.d.ts +3 -4
- package/dist/packages/sdk-ui/src/modules/ai/api/types.d.ts +5 -18
- package/dist/packages/sdk-ui/src/modules/ai/chart/nlq-chart-widget.d.ts +2 -0
- package/dist/packages/sdk-ui/src/modules/ai/common/collapsible.d.ts +3 -0
- package/dist/packages/sdk-ui/src/modules/ai/get-nlg-insights-from-widget.d.ts +5 -13
- package/dist/packages/sdk-ui/src/modules/ai/index.d.ts +2 -1
- package/dist/packages/sdk-ui/src/modules/ai/use-get-nlg-insights.d.ts +4 -26
- package/dist/packages/sdk-ui/src/modules/analytics-composer/nlq-v3-translator/types.d.ts +3 -7
- package/dist/packages/sdk-ui/src/props.d.ts +1 -1
- package/dist/packages/sdk-ui/src/public-api/internal.d.ts +1 -1
- package/dist/packages/sdk-ui/src/public-api/sisense-internal.d.ts +7 -1
- package/dist/packages/sdk-ui/src/shared/utils/filter-relations.d.ts +2 -0
- package/dist/packages/sdk-ui/src/types.d.ts +8 -8
- package/dist/translations/de-de.cjs +1 -1
- package/dist/translations/de-de.js +10 -1
- package/dist/translations/en-us.cjs +1 -1
- package/dist/translations/en-us.js +1 -1
- package/dist/translations/es-ar.cjs +1 -1
- package/dist/translations/es-ar.js +10 -1
- package/dist/translations/es-es.cjs +1 -1
- package/dist/translations/es-es.js +10 -1
- package/dist/translations/fr-fr.cjs +1 -1
- package/dist/translations/fr-fr.js +10 -1
- package/dist/translations/it-it.cjs +1 -1
- package/dist/translations/it-it.js +12 -3
- package/dist/translations/ja-jp.cjs +1 -1
- package/dist/translations/ja-jp.js +12 -3
- package/dist/translations/ko-kr.cjs +1 -1
- package/dist/translations/ko-kr.js +12 -3
- package/dist/translations/nl-nl.cjs +1 -1
- package/dist/translations/nl-nl.js +12 -3
- package/dist/translations/pt-br.cjs +1 -1
- package/dist/translations/pt-br.js +10 -1
- package/dist/translations/ru-ru.cjs +1 -1
- package/dist/translations/ru-ru.js +12 -3
- package/dist/translations/tr-tr.cjs +1 -1
- package/dist/translations/tr-tr.js +10 -1
- package/dist/translations/zh-cn.cjs +1 -1
- package/dist/translations/zh-cn.js +12 -3
- package/dist/types-COBvZZm_.cjs +1 -0
- package/dist/{types-DJtC8_5_.js → types-D6jCGncV.js} +1 -1
- package/dist/{quota-notification-CeKnEyQG.js → use-hover-B1HPf4hF.js} +27827 -19390
- package/dist/use-hover-CaQrW_gv.cjs +721 -0
- package/dist/{utils-BCp2ISWh.js → utils-BQtueE3Z.js} +13632 -13251
- package/dist/utils-CAubp1g1.cjs +179 -0
- package/dist/{widget-composer-CDNL9_XF.js → widget-composer-BAJFWk3t.js} +3 -3
- package/dist/{widget-composer-BkHZISs7.cjs → widget-composer-C75b-E6W.cjs} +1 -1
- package/package.json +11 -10
- package/dist/dimensions-C7yXAoZs.cjs +0 -1
- package/dist/execute-query-0Y9Fn9Pf.cjs +0 -1
- package/dist/packages/sdk-ui/src/domains/widgets/components/table-widget/index.d.ts +0 -2
- package/dist/packages/sdk-ui/src/domains/widgets/components/table-widget/table-widget.d.ts +0 -22
- package/dist/packages/sdk-ui/src/domains/widgets/components/table-widget/types.d.ts +0 -61
- package/dist/packages/sdk-ui/src/infra/styled/index.d.ts +0 -4
- package/dist/packages/sdk-ui/src/infra/styled/with-css-selector-prefix.d.ts +0 -2
- package/dist/packages/sdk-ui/src/modules/ai/api/narration-endpoints.d.ts +0 -25
- package/dist/packages/sdk-ui/src/modules/analytics-composer/nlq-v3-translator/query/constants.d.ts +0 -8
- package/dist/packages/sdk-ui/src/modules/analytics-composer/nlq-v3-translator/shared/utils/parse-compose-code.d.ts +0 -34
- package/dist/quota-notification-BqRYSJ7r.cjs +0 -713
- package/dist/types-C0QU2tsE.cjs +0 -1
- package/dist/utils-D8O1_kl3.cjs +0 -190
package/dist/packages/sdk-ui/src/domains/dashboarding/dashboard-model/translate-dashboard-utils.d.ts
CHANGED
|
@@ -11,6 +11,7 @@ export declare const getJtdNavigateType: (widget: WidgetDto) => TriggerMethod;
|
|
|
11
11
|
export declare const convertDimensionsToDimIndexes: (widget: WidgetDto, dimensionIds: string[]) => string[];
|
|
12
12
|
/**
|
|
13
13
|
* Extract pivot targets configuration from widget DTO and build Map-based targets
|
|
14
|
+
*
|
|
14
15
|
* @param widget - Widget DTO with drillToDashboardConfig
|
|
15
16
|
* @returns Map of dimensions/measures to their targets or undefined if no targets found
|
|
16
17
|
* @internal
|
|
@@ -39,6 +40,7 @@ export declare function translateTabbersOptions(widgets?: WidgetDto[]): TabbersC
|
|
|
39
40
|
export declare function withSharedFormulas(dashboard: DashboardDto, api: RestApi): Promise<DashboardDto>;
|
|
40
41
|
/**
|
|
41
42
|
* Find dimension or measure by instanceId in widget panels and convert to proper type
|
|
43
|
+
*
|
|
42
44
|
* @param panels - Widget metadata panels to search
|
|
43
45
|
* @param pivotDimension - Instance ID to find, this is not a PivotDimId, it is the instanceId of the dimension or measure
|
|
44
46
|
* @returns Dimension/Measure object with optional location info or undefined if not found
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { CommonFiltersOptions } from '../../../domains/dashboarding/common-filters/types';
|
|
2
2
|
import type { JumpToDashboardConfig, JumpToDashboardConfigForPivot } from '../../../domains/dashboarding/hooks/jtd/jtd-types';
|
|
3
|
+
import type { WidgetDto } from '../../../domains/widgets/components/widget-by-id/types';
|
|
3
4
|
import { ColorPaletteTheme } from '../../../types';
|
|
4
5
|
export type { CommonFiltersOptions, CommonFiltersApplyMode, FiltersIgnoringRules, } from '../../../domains/dashboarding/common-filters/types';
|
|
5
6
|
/**
|
|
@@ -8,6 +9,7 @@ export type { CommonFiltersOptions, CommonFiltersApplyMode, FiltersIgnoringRules
|
|
|
8
9
|
export interface WidgetsPanelCell {
|
|
9
10
|
/**
|
|
10
11
|
* Flag that indicates if the cell is hidden
|
|
12
|
+
*
|
|
11
13
|
* @internal
|
|
12
14
|
*/
|
|
13
15
|
hidden?: boolean;
|
|
@@ -66,6 +68,7 @@ export type WidgetsPanelLayout = WidgetsPanelColumnLayout;
|
|
|
66
68
|
export type WidgetId = string;
|
|
67
69
|
/**
|
|
68
70
|
* Dashboard ID
|
|
71
|
+
*
|
|
69
72
|
* @internal
|
|
70
73
|
*/
|
|
71
74
|
export type DashboardId = string;
|
|
@@ -76,7 +79,7 @@ export type DashboardId = string;
|
|
|
76
79
|
*/
|
|
77
80
|
export type WidgetsOptions = Record<WidgetId, SpecificWidgetOptions>;
|
|
78
81
|
/**
|
|
79
|
-
*
|
|
82
|
+
* Dashboard-level options for a specific widget
|
|
80
83
|
*/
|
|
81
84
|
export type SpecificWidgetOptions = {
|
|
82
85
|
/**
|
|
@@ -87,6 +90,14 @@ export type SpecificWidgetOptions = {
|
|
|
87
90
|
* Jump To Dashboard config for widgets.
|
|
88
91
|
*/
|
|
89
92
|
jtdConfig?: JumpToDashboardConfig | JumpToDashboardConfigForPivot;
|
|
93
|
+
/**
|
|
94
|
+
* Partial snapshot of raw DTO fields preserved from the server response.
|
|
95
|
+
* Required to include all existing options/style when PATCHing a single field (e.g. previousScrollerLocation),
|
|
96
|
+
* because the server replaces the entire object rather than merging.
|
|
97
|
+
*
|
|
98
|
+
* @internal
|
|
99
|
+
*/
|
|
100
|
+
partialDtoOptions?: Partial<Pick<WidgetDto, 'options' | 'style'>>;
|
|
90
101
|
};
|
|
91
102
|
/**
|
|
92
103
|
* Style options for the dashboard.
|
|
@@ -1,13 +1,25 @@
|
|
|
1
1
|
import { RestApi } from '../../../../../infra/api/rest-api';
|
|
2
|
+
import { AppSettings } from '../../../../../infra/app/settings/settings';
|
|
3
|
+
import { CompleteThemeSettings } from '../../../../../types';
|
|
2
4
|
import { UseDashboardModelInternalAction } from './types.js';
|
|
5
|
+
export type PersistDashboardModelMiddlewareParams = {
|
|
6
|
+
/** Dashboard OID, or undefined if not initialized */
|
|
7
|
+
dashboardOid: string | undefined;
|
|
8
|
+
/** Internal dashboard model action to persist */
|
|
9
|
+
action: UseDashboardModelInternalAction;
|
|
10
|
+
/** Sisense REST API instance */
|
|
11
|
+
restApi: RestApi;
|
|
12
|
+
/** Whether the dashboard is in shared mode */
|
|
13
|
+
sharedMode: boolean;
|
|
14
|
+
/** Application settings forwarded to {@link toWidgetDto} (controls widget design feature flag) */
|
|
15
|
+
appSettings: AppSettings;
|
|
16
|
+
/** Theme settings forwarded to {@link toWidgetDto} (used as defaults for widget design) */
|
|
17
|
+
themeSettings: CompleteThemeSettings;
|
|
18
|
+
};
|
|
3
19
|
/**
|
|
4
20
|
* Middleware that persists the dashboard model changes to the Sisense server.
|
|
5
21
|
*
|
|
6
|
-
* @param dashboardOid - Dashboard OID, or undefined if not initialized
|
|
7
|
-
* @param action - Internal dashboard model action to persist
|
|
8
|
-
* @param restApi - Sisense REST API instance
|
|
9
|
-
* @param sharedMode - Whether the dashboard is in shared mode
|
|
10
22
|
* @returns Promise resolving to the action (possibly transformed, e.g. for ADD_WIDGET)
|
|
11
23
|
* @internal
|
|
12
24
|
*/
|
|
13
|
-
export declare function persistDashboardModelMiddleware(dashboardOid
|
|
25
|
+
export declare function persistDashboardModelMiddleware({ dashboardOid, action, restApi, sharedMode, appSettings, themeSettings, }: PersistDashboardModelMiddlewareParams): Promise<UseDashboardModelInternalAction>;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { Filter, FilterRelations } from '@sisense/sdk-data';
|
|
2
2
|
import { DashboardModel, SpecificWidgetOptions, WidgetsPanelLayout } from '../../../../../domains/dashboarding/dashboard-model';
|
|
3
|
+
import type { WidgetDto } from '../../../../../domains/widgets/components/widget-by-id/types';
|
|
3
4
|
import { WidgetModel } from '../../../../../domains/widgets/widget-model';
|
|
4
5
|
export type UseDashboardModelState = DashboardModel | null;
|
|
5
6
|
/**
|
|
@@ -27,10 +28,24 @@ export declare enum UseDashboardModelActionType {
|
|
|
27
28
|
* Fields that can be safely patched on a widget without full DTO reconstruction.
|
|
28
29
|
* Intentionally narrow — extend only when lossless roundtrip is guaranteed.
|
|
29
30
|
*
|
|
30
|
-
* @
|
|
31
|
+
* @sisenseInternal
|
|
31
32
|
*/
|
|
32
33
|
export type WidgetPatch = {
|
|
34
|
+
/**
|
|
35
|
+
* The title of the widget.
|
|
36
|
+
*/
|
|
33
37
|
title?: string;
|
|
38
|
+
/**
|
|
39
|
+
* Full widget options to send in the PATCH request.
|
|
40
|
+
* Must include all existing option fields alongside the changed ones, because
|
|
41
|
+
* the server replaces the entire options object rather than merging.
|
|
42
|
+
*/
|
|
43
|
+
options?: Partial<NonNullable<WidgetDto['options']>> & {
|
|
44
|
+
previousScrollerLocation: {
|
|
45
|
+
min: number;
|
|
46
|
+
max: number;
|
|
47
|
+
};
|
|
48
|
+
};
|
|
34
49
|
};
|
|
35
50
|
/**
|
|
36
51
|
* Internal actions for the dashboard model state used in {@link useDashboardModel}.
|
|
@@ -5,8 +5,11 @@ import { AddWidgetPayload } from './types.js';
|
|
|
5
5
|
/**
|
|
6
6
|
* Translates filters and relations to DTOs.
|
|
7
7
|
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
8
|
+
* `filterRelations[].datasource` is always a **string** (never `undefined`), so Fusion validation
|
|
9
|
+
* does not break. The value is derived from `filter.dataSource` / `filter.attribute.dataSource`
|
|
10
|
+
* when present; otherwise `''`.
|
|
11
|
+
*
|
|
12
|
+
* @param filtersOrFilterRelations - Flat filters or a filter-relations tree
|
|
10
13
|
*
|
|
11
14
|
* @sisenseInternal
|
|
12
15
|
*/
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import type { WidgetsOptions, WidgetsPanelLayout } from '../../../../domains/dashboarding/dashboard-model/types.js';
|
|
3
3
|
import { type WidgetProps } from '../../../../domains/widgets/components/widget/types.js';
|
|
4
|
-
import type { DashboardPersistenceManager } from '../../types.js';
|
|
4
|
+
import type { DashboardPersistenceManager } from '../../persistence/types.js';
|
|
5
5
|
/** Setter for widgets array (e.g. React setState or updater function). */
|
|
6
6
|
export type SetWidgets = React.Dispatch<React.SetStateAction<WidgetProps[]>>;
|
|
7
7
|
/** Setter for widgets options array (e.g. React setState or updater function). */
|
package/dist/packages/sdk-ui/src/domains/dashboarding/hooks/rename-widget/use-widget-renaming.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { WidgetProps } from '../../../../domains/widgets/components/widget/types.js';
|
|
2
|
-
import type { DashboardPersistenceManager } from '../../types.js';
|
|
2
|
+
import type { DashboardPersistenceManager } from '../../persistence/types.js';
|
|
3
3
|
/** Options for the widget renaming middleware hook. */
|
|
4
4
|
export type UseWidgetRenamingParams = {
|
|
5
5
|
/** Current widgets. */
|
package/dist/packages/sdk-ui/src/domains/dashboarding/hooks/use-widget-scroll-persistence.d.ts
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { WidgetsOptions } from '../../../domains/dashboarding/dashboard-model';
|
|
2
|
+
import type { DashboardPersistenceManager } from '../../../domains/dashboarding/persistence/types';
|
|
3
|
+
type ScrollerChangeHandler = (min: number, max: number) => void;
|
|
4
|
+
/**
|
|
5
|
+
* Returns a stable per-widget factory of debounced scroller-position savers.
|
|
6
|
+
* Each call with the same widgetOid reuses the same debounced function.
|
|
7
|
+
* All pending debouncers are cancelled on unmount.
|
|
8
|
+
*
|
|
9
|
+
* @param persistence - The dashboard persistence manager. When `undefined`, the returned factory is a no-op.
|
|
10
|
+
* @param widgetsOptions - Current widget DTO options map, used to include all existing options in the PATCH
|
|
11
|
+
* so the server does not discard other option fields when updating `previousScrollerLocation`.
|
|
12
|
+
* @returns Function that maps a widget OID to its debounced save handler.
|
|
13
|
+
* @internal
|
|
14
|
+
*/
|
|
15
|
+
export declare function useWidgetScrollPersistence(persistence: DashboardPersistenceManager | undefined, widgetsOptions?: WidgetsOptions): (widgetOid: string) => ScrollerChangeHandler;
|
|
16
|
+
export {};
|
|
@@ -2,5 +2,7 @@ export { DashboardById } from './dashboard-by-id.js';
|
|
|
2
2
|
export { Dashboard } from './dashboard.js';
|
|
3
3
|
export { useComposedDashboard, useComposedDashboardInternal, type ComposableDashboardProps, type UseComposedDashboardOptions, type ComposedDashboardResult, } from './use-composed-dashboard.js';
|
|
4
4
|
export { useDashboardTheme, type DashboardThemeParams } from './use-dashboard-theme.js';
|
|
5
|
+
export { createDashboardPersistenceManager } from './persistence/persistence-manager.js';
|
|
6
|
+
export type { DashboardPersistenceManager } from './persistence/types.js';
|
|
5
7
|
export * from './hooks/index.js';
|
|
6
8
|
export type { DashboardByIdProps, DashboardProps, DashboardLayoutOptions, DashboardStyleOptions, DashboardConfig, DashboardByIdConfig, WidgetsPanelConfig, EditModeConfig, DashboardFiltersPanelConfig, TabbersConfig, TabberConfig, TabberTabConfig, DashboardChangeEvent, DashboardFiltersUpdatedEvent, DashboardFiltersPanelCollapseChangedEvent, DashboardWidgetsPanelLayoutUpdatedEvent, DashboardWidgetsPanelIsEditingChangedEvent, DashboardWidgetsDeletedEvent, } from './types.js';
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { UseDashboardModelResult } from '../../../domains/dashboarding/dashboard-model';
|
|
2
|
+
import type { DashboardPersistenceManager } from './types.js';
|
|
3
|
+
/**
|
|
4
|
+
* Creates a {@link DashboardPersistenceManager} that forwards add/patch operations through
|
|
5
|
+
* the same `dispatchChanges` function returned by {@link useDashboardModelInternal} /
|
|
6
|
+
*
|
|
7
|
+
* @param dispatchDashboardModelChanges - Dashboard model dispatch (e.g. `dispatchChanges` from `useDashboardModelInternal`)
|
|
8
|
+
* @returns Persistence manager for the composition layer
|
|
9
|
+
* @sisenseInternal
|
|
10
|
+
*/
|
|
11
|
+
export declare function createDashboardPersistenceManager(dispatchDashboardModelChanges: UseDashboardModelResult['dispatchChanges']): DashboardPersistenceManager;
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import type { SpecificWidgetOptions, WidgetPatch, WidgetsPanelLayout } from '../../../domains/dashboarding/dashboard-model';
|
|
2
|
+
import type { WidgetProps } from '../../../domains/widgets/components/widget/types';
|
|
3
|
+
/**
|
|
4
|
+
* Interface for persisting dashboard changes from the composition layer (e.g. add widget).
|
|
5
|
+
*
|
|
6
|
+
* @sisenseInternal
|
|
7
|
+
*/
|
|
8
|
+
export type DashboardPersistenceManager = {
|
|
9
|
+
/**
|
|
10
|
+
* Adds a widget to the dashboard.
|
|
11
|
+
* @sisenseInternal
|
|
12
|
+
*/
|
|
13
|
+
addWidget: (
|
|
14
|
+
/**
|
|
15
|
+
* The new widget to add.
|
|
16
|
+
*/
|
|
17
|
+
widget: WidgetProps,
|
|
18
|
+
/**
|
|
19
|
+
* The layout with the new widget added to it.
|
|
20
|
+
*/
|
|
21
|
+
widgetsPanelLayout: WidgetsPanelLayout,
|
|
22
|
+
/**
|
|
23
|
+
* The dashboard-level options for the new widget.
|
|
24
|
+
*/
|
|
25
|
+
widgetOptions?: SpecificWidgetOptions) => Promise<{
|
|
26
|
+
/**
|
|
27
|
+
* The persisted widget (possibly modified by the server, e.g. new id).
|
|
28
|
+
*/
|
|
29
|
+
widget: WidgetProps;
|
|
30
|
+
/**
|
|
31
|
+
* The layout with updated widget (after server modifications).
|
|
32
|
+
*/
|
|
33
|
+
widgetsPanelLayout: WidgetsPanelLayout;
|
|
34
|
+
/**
|
|
35
|
+
* The options for the widget (after server modifications).
|
|
36
|
+
*/
|
|
37
|
+
widgetOptions?: SpecificWidgetOptions;
|
|
38
|
+
}>;
|
|
39
|
+
/**
|
|
40
|
+
* Patch a single field (e.g. title) on an existing widget.
|
|
41
|
+
* @sisenseInternal
|
|
42
|
+
*/
|
|
43
|
+
patchWidget: (
|
|
44
|
+
/**
|
|
45
|
+
* The oid of the widget to patch.
|
|
46
|
+
*/
|
|
47
|
+
widgetOid: string,
|
|
48
|
+
/**
|
|
49
|
+
* The patch to apply to the widget.
|
|
50
|
+
*/
|
|
51
|
+
patch: WidgetPatch) => Promise<void>;
|
|
52
|
+
};
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { ReactNode } from 'react';
|
|
2
2
|
import { DataSource, Filter, FilterRelations } from '@sisense/sdk-data';
|
|
3
|
-
import { DashboardStyleOptions,
|
|
3
|
+
import { DashboardStyleOptions, WidgetsOptions, WidgetsPanelLayout } from '../../domains/dashboarding/dashboard-model';
|
|
4
4
|
import { TabbersConfig } from '../../domains/dashboarding/hooks/use-tabber';
|
|
5
5
|
import { FiltersPanelConfig } from '../../domains/filters/components/filters-panel/types';
|
|
6
6
|
import { WidgetProps } from '../../domains/widgets/components/widget/types';
|
|
7
|
+
import type { DashboardPersistenceManager } from './persistence/types.js';
|
|
7
8
|
export type { DashboardStyleOptions, SpecificWidgetOptions, WidgetsPanelColumnLayout, WidgetsPanelLayout, WidgetsPanelCell, WidgetsPanelRow, WidgetsPanelColumn, } from '../../domains/dashboarding/dashboard-model';
|
|
8
9
|
export type { TabbersConfig, TabberConfig, TabberTabConfig, } from '../../domains/dashboarding/hooks/use-tabber';
|
|
9
10
|
/**
|
|
@@ -331,32 +332,7 @@ export interface DashboardLayoutOptions {
|
|
|
331
332
|
*/
|
|
332
333
|
widgetsPanel?: WidgetsPanelLayout;
|
|
333
334
|
}
|
|
334
|
-
|
|
335
|
-
* Interface for persisting dashboard changes from the composition layer (e.g. add widget).
|
|
336
|
-
*
|
|
337
|
-
* @internal
|
|
338
|
-
*/
|
|
339
|
-
export type DashboardPersistenceManager = {
|
|
340
|
-
/**
|
|
341
|
-
* Adds a widget to the dashboard.
|
|
342
|
-
*
|
|
343
|
-
* @param widget - The widget to add.
|
|
344
|
-
* @param widgetsPanelLayout - The layout to add the widget to.
|
|
345
|
-
* @param widgetOptions - The options for the widget.
|
|
346
|
-
* @returns The persisted widget (possibly modified by the server, e.g. new id), the new widgets panel layout and the widget options.
|
|
347
|
-
*/
|
|
348
|
-
addWidget: (widget: WidgetProps, widgetsPanelLayout: WidgetsPanelLayout, widgetOptions?: SpecificWidgetOptions) => Promise<{
|
|
349
|
-
widget: WidgetProps;
|
|
350
|
-
widgetsPanelLayout: WidgetsPanelLayout;
|
|
351
|
-
widgetOptions?: SpecificWidgetOptions;
|
|
352
|
-
}>;
|
|
353
|
-
/**
|
|
354
|
-
* Patch a single field (e.g. title) on an existing widget.
|
|
355
|
-
*
|
|
356
|
-
* @internal
|
|
357
|
-
*/
|
|
358
|
-
patchWidget: (widgetOid: string, patch: WidgetPatch) => Promise<void>;
|
|
359
|
-
};
|
|
335
|
+
export type { DashboardPersistenceManager };
|
|
360
336
|
/**
|
|
361
337
|
* Props for the Dashboard component
|
|
362
338
|
*/
|
|
@@ -397,7 +373,8 @@ export interface DashboardProps {
|
|
|
397
373
|
*/
|
|
398
374
|
onChange?: (event: DashboardChangeEvent) => void;
|
|
399
375
|
/**
|
|
400
|
-
*
|
|
376
|
+
* Persistence manager for the dashboard
|
|
377
|
+
* @sisenseInternal
|
|
401
378
|
*/
|
|
402
379
|
persistence?: DashboardPersistenceManager;
|
|
403
380
|
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { Filter, FilterRelations } from '@sisense/sdk-data';
|
|
2
2
|
import type { WidgetsPanelLayout } from '../../domains/dashboarding/dashboard-model';
|
|
3
|
-
import { DashboardPersistenceManager
|
|
3
|
+
import type { DashboardPersistenceManager } from './persistence/types.js';
|
|
4
|
+
import { DashboardProps } from './types.js';
|
|
4
5
|
export type ComposableDashboardProps = Pick<DashboardProps, 'filters' | 'widgets' | 'widgetsOptions' | 'layoutOptions' | 'config'>;
|
|
5
6
|
export type UseComposedDashboardOptions = {
|
|
6
7
|
/**
|
|
@@ -8,14 +9,16 @@ export type UseComposedDashboardOptions = {
|
|
|
8
9
|
*/
|
|
9
10
|
onFiltersChange?: (filters: Filter[] | FilterRelations) => void;
|
|
10
11
|
/**
|
|
11
|
-
*
|
|
12
|
+
* Persistence manager for the dashboard
|
|
13
|
+
*
|
|
14
|
+
* @sisenseInternal
|
|
12
15
|
*/
|
|
13
16
|
persistence?: DashboardPersistenceManager;
|
|
14
17
|
/**
|
|
15
18
|
* Runtime edit mode state. When provided (e.g. by Dashboard), used for duplicate-widget visibility
|
|
16
19
|
* instead of only config.widgetsPanel.editMode.isEditing.
|
|
17
|
-
* @internal
|
|
18
20
|
*
|
|
21
|
+
* @internal
|
|
19
22
|
* @deprecated Temporal workaround. Edit mode (with history management) should be managed by the `useComposedDashboard` hook instead of the Dashboard component.
|
|
20
23
|
*/
|
|
21
24
|
isEditing?: boolean;
|
|
@@ -76,11 +79,9 @@ export declare function useComposedDashboardInternal<D extends ComposableDashboa
|
|
|
76
79
|
* }
|
|
77
80
|
* export default CodeExample;
|
|
78
81
|
* ```
|
|
79
|
-
*
|
|
80
82
|
* @template {D extends ComposableDashboardProps | DashboardProps} D - The type parameter for a dashboard properties, restricted to ComposableDashboardProps or DashboardProps
|
|
81
83
|
* @param {D} initialDashboard - set of properties for the Dashboard component
|
|
82
84
|
* @param {UseComposedDashboardOptions} [options] - Options for the composable.
|
|
83
|
-
*
|
|
84
85
|
* @return {ComposedDashboardResult} An object containing the composed dashboard and APIs to interact with it.
|
|
85
86
|
* @group Dashboards
|
|
86
87
|
*/
|
|
@@ -69,10 +69,20 @@ export interface GetDataSourceDimensionsParams {
|
|
|
69
69
|
/** The search value to filter by */
|
|
70
70
|
searchValue?: string;
|
|
71
71
|
}
|
|
72
|
+
/**
|
|
73
|
+
* {@link useGetDataSourceDimensions} without tracking to be used inside other hooks or components.
|
|
74
|
+
*
|
|
75
|
+
* @param params - The parameters for getting the dimensions
|
|
76
|
+
* @returns The dimensions state
|
|
77
|
+
* @internal
|
|
78
|
+
*/
|
|
79
|
+
export declare function useGetDataSourceDimensionsInternal(params: GetDataSourceDimensionsParams): DataSourceDimensionsState;
|
|
72
80
|
/**
|
|
73
81
|
* Gets the dimensions of a data source.
|
|
74
82
|
*
|
|
75
83
|
* @param params - The parameters for getting the dimensions
|
|
76
84
|
* @returns The dimensions state
|
|
85
|
+
* @group Fusion Assets
|
|
86
|
+
* @fusionEmbed
|
|
77
87
|
*/
|
|
78
88
|
export declare const useGetDataSourceDimensions: (params: GetDataSourceDimensionsParams) => DataSourceDimensionsState;
|
|
@@ -9,6 +9,7 @@ import { RestApiHookState } from '../../../../shared/utils/utility-types';
|
|
|
9
9
|
* @param params.count - The number of items to return
|
|
10
10
|
* @param params.offset - The offset for pagination
|
|
11
11
|
* @param params.searchValue - The search value to filter by
|
|
12
|
+
* @param params.cacheTime - The cache time in milliseconds
|
|
12
13
|
* @returns The data source fields state
|
|
13
14
|
* @internal
|
|
14
15
|
*/
|
|
@@ -18,6 +19,7 @@ export declare const useGetDataSourceFields: (params: {
|
|
|
18
19
|
count?: number;
|
|
19
20
|
offset?: number;
|
|
20
21
|
searchValue?: string;
|
|
22
|
+
cacheTime?: number;
|
|
21
23
|
}) => DataSourceFieldsState;
|
|
22
24
|
type DataSourceFieldsState = RestApiHookState<'dataSourceFields', DataSourceField[]>;
|
|
23
25
|
export {};
|
package/dist/packages/sdk-ui/src/domains/drilldown/components/drilldown-widget/drilldown-widget.d.ts
CHANGED
|
@@ -22,8 +22,8 @@ import { DrilldownWidgetProps } from '../../../../props';
|
|
|
22
22
|
*
|
|
23
23
|
* <iframe
|
|
24
24
|
* src='https://csdk-playground.sisense.com/?example=use-cases%2Fdrilldown&mode=docs'
|
|
25
|
-
* width=800
|
|
26
|
-
* height=870
|
|
25
|
+
* width='800'
|
|
26
|
+
* height='870'
|
|
27
27
|
* style='border:none;'
|
|
28
28
|
* />
|
|
29
29
|
*
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
type NarrativeCollapsibleProps = {
|
|
2
|
+
text: string;
|
|
3
|
+
};
|
|
4
|
+
/**
|
|
5
|
+
* Text container with an expand/collapse control for long narrative text.
|
|
6
|
+
*
|
|
7
|
+
* Uses `max-height` + `overflow: hidden` when collapsed (not `line-clamp`), because
|
|
8
|
+
* `white-space: pre-wrap` is incompatible with `-webkit-line-clamp` in browsers.
|
|
9
|
+
*
|
|
10
|
+
* @internal
|
|
11
|
+
*/
|
|
12
|
+
export declare function NarrativeCollapsible({ text }: NarrativeCollapsibleProps): import("react/jsx-runtime").JSX.Element;
|
|
13
|
+
export {};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { Themable } from '../../../infra/contexts/theme-provider/types.js';
|
|
3
|
+
/** Horizontal space before the AI icon in the default (interactive) narrative row. */
|
|
4
|
+
export declare const NARRATIVE_TOP_SLOT_LEADING_GUTTER_PX = 18;
|
|
5
|
+
/** Space after feedback controls (interactive) and plain narrative right inset. */
|
|
6
|
+
export declare const NARRATIVE_TOP_SLOT_TRAILING_GUTTER_PX = 12;
|
|
7
|
+
/**
|
|
8
|
+
* Full-bleed chart panel styling for narrative content in a widget top slot,
|
|
9
|
+
* so it visually continues into the chart content area (same colors, no gray gutters).
|
|
10
|
+
*
|
|
11
|
+
* Use `$horizontalInset` for plain narrative (no leading AI icon) so text aligns with the
|
|
12
|
+
* interactive variant and sits off the container edge.
|
|
13
|
+
*
|
|
14
|
+
* @internal
|
|
15
|
+
*/
|
|
16
|
+
export declare const NarrativeTopSlotShell: import("@emotion/styled").StyledComponent<{
|
|
17
|
+
theme?: import("@emotion/react").Theme | undefined;
|
|
18
|
+
as?: import("react").ElementType<any, keyof import("react").JSX.IntrinsicElements> | undefined;
|
|
19
|
+
} & Themable & {
|
|
20
|
+
$horizontalInset?: boolean | undefined;
|
|
21
|
+
}, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
|
package/dist/packages/sdk-ui/src/domains/narrative/components/widget-narrative-interactive.d.ts
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { NarrativeRequest } from '../../../infra/api/narrative/narrative-api-types.js';
|
|
2
|
+
export type WidgetNarrativeInteractiveProps = {
|
|
3
|
+
summary: string;
|
|
4
|
+
narrativeRequest: NarrativeRequest;
|
|
5
|
+
};
|
|
6
|
+
/**
|
|
7
|
+
* Chart-area narrative text with optional thumbs feedback; mirrors legacy ChartInsights without `modules/ai`.
|
|
8
|
+
*
|
|
9
|
+
* @internal
|
|
10
|
+
*/
|
|
11
|
+
export declare function WidgetNarrativeInteractive({ summary, narrativeRequest, }: WidgetNarrativeInteractiveProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { WidgetProps } from '../../../domains/widgets/components/widget/types';
|
|
3
|
+
import type { WidgetNarrativeOptions } from '../core/widget-narrative-options.js';
|
|
4
|
+
/**
|
|
5
|
+
* Props for {@link WidgetNarrative}.
|
|
6
|
+
*
|
|
7
|
+
* @sisenseInternal
|
|
8
|
+
*/
|
|
9
|
+
export type WidgetNarrativeProps = {
|
|
10
|
+
/** Widget whose query drives the narrative (chart or pivot). */
|
|
11
|
+
widgetProps: WidgetProps;
|
|
12
|
+
/**
|
|
13
|
+
* `default` — collapsible narrative with AI feedback actions (same pattern as NLQ chart insights).
|
|
14
|
+
* `plain` — collapsible text only (similar to the `GetNlgInsights` component).
|
|
15
|
+
*/
|
|
16
|
+
variant?: 'default' | 'plain';
|
|
17
|
+
/** When false, the narrative query does not run (see {@link useWidgetNarrativeState}). */
|
|
18
|
+
enabled?: boolean;
|
|
19
|
+
} & WidgetNarrativeOptions;
|
|
20
|
+
/**
|
|
21
|
+
* Renders a natural-language narrative for chart or pivot `WidgetProps`. The request uses the same
|
|
22
|
+
* JAQL as the widget query (chart or pivot)—compose it next to or above a `ChartWidget` or
|
|
23
|
+
* `PivotTableWidget` with the same props.
|
|
24
|
+
*
|
|
25
|
+
* @example Widget header slot
|
|
26
|
+
* ```tsx
|
|
27
|
+
* <ChartWidget
|
|
28
|
+
* {...chartWidgetProps}
|
|
29
|
+
* topSlot={<WidgetNarrative widgetProps={chartWidgetProps} />}
|
|
30
|
+
* />
|
|
31
|
+
* ```
|
|
32
|
+
* @example Modal or custom layout (headless)
|
|
33
|
+
* ```tsx
|
|
34
|
+
* const { data, isLoading, supported } = useGetWidgetNarrative({ widgetProps });
|
|
35
|
+
* if (!supported) return null;
|
|
36
|
+
* return <DialogContent>{isLoading ? '…' : data}</DialogContent>;
|
|
37
|
+
* ```
|
|
38
|
+
* @sisenseInternal
|
|
39
|
+
*/
|
|
40
|
+
export declare const WidgetNarrative: import("react").FunctionComponent<WidgetNarrativeProps>;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { Attribute, DataSource, Filter, FilterRelations, Measure } from '@sisense/sdk-data';
|
|
2
|
+
import type { NarrativeRequest } from '../../../infra/api/narrative/narrative-api-types.js';
|
|
3
|
+
/**
|
|
4
|
+
* Parameters for {@link useGetNlgInsights} hook.
|
|
5
|
+
*/
|
|
6
|
+
export interface UseGetNlgInsightsParams {
|
|
7
|
+
/** The data source that the query targets - e.g. `Sample ECommerce` */
|
|
8
|
+
dataSource: DataSource;
|
|
9
|
+
/** Dimensions of the query */
|
|
10
|
+
dimensions?: Attribute[];
|
|
11
|
+
/** Measures of the query */
|
|
12
|
+
measures?: Measure[];
|
|
13
|
+
/** Filters of the query */
|
|
14
|
+
filters?: Filter[] | FilterRelations;
|
|
15
|
+
/**
|
|
16
|
+
* Boolean flag to enable/disable API call by default
|
|
17
|
+
*
|
|
18
|
+
* If not specified, the default value is `true`
|
|
19
|
+
*/
|
|
20
|
+
enabled?: boolean;
|
|
21
|
+
/** The verbosity of the NLG summarization */
|
|
22
|
+
verbosity?: 'Low' | 'High';
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Parameters for building a narration request (before JAQL payload expansion).
|
|
26
|
+
*
|
|
27
|
+
* @sisenseInternal
|
|
28
|
+
*/
|
|
29
|
+
export interface NarrativeQueryParams extends UseGetNlgInsightsParams {
|
|
30
|
+
}
|
|
31
|
+
/** @internal */
|
|
32
|
+
export declare function prepareNarrativeRequest(params: NarrativeQueryParams | NarrativeRequest): NarrativeRequest;
|
|
33
|
+
/**
|
|
34
|
+
* @deprecated Use {@link prepareNarrativeRequest}. Same function; kept for legacy `modules/ai` and framework wrappers.
|
|
35
|
+
*/
|
|
36
|
+
export declare const prepareGetNlgInsightsPayload: typeof prepareNarrativeRequest;
|
package/dist/packages/sdk-ui/src/domains/narrative/core/get-narrative-dimensions-and-measures.d.ts
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { Attribute, Measure } from '@sisense/sdk-data';
|
|
2
|
+
import { type AdaptMeasuresForQueryOptions } from '../../../domains/visualizations/core/chart-data-options/apply-styled-options-to-query.js';
|
|
3
|
+
import type { TableDataOptions } from '../../../domains/visualizations/core/chart-data-options/types.js';
|
|
4
|
+
import { ChartDataOptions, ChartType } from '../../../types';
|
|
5
|
+
/**
|
|
6
|
+
* Dimensions and measures for narration / JAQL, including styled sort, trend, and forecast.
|
|
7
|
+
*
|
|
8
|
+
* @internal
|
|
9
|
+
*/
|
|
10
|
+
export declare function getNarrativeDimensionsAndMeasures(chartDataOptions: ChartDataOptions, chartType: ChartType, adaptMeasureOptions?: AdaptMeasuresForQueryOptions): {
|
|
11
|
+
dimensions: Attribute[];
|
|
12
|
+
measures: Measure[];
|
|
13
|
+
};
|
|
14
|
+
/**
|
|
15
|
+
* Table dimensions and measures for narration / JAQL, including styled sort, trend, and forecast.
|
|
16
|
+
*
|
|
17
|
+
* @internal
|
|
18
|
+
*/
|
|
19
|
+
export declare function getNarrativeDimensionsAndMeasuresFromTable(dataOptions: TableDataOptions, adaptMeasureOptions?: AdaptMeasuresForQueryOptions): {
|
|
20
|
+
dimensions: Attribute[];
|
|
21
|
+
measures: Measure[];
|
|
22
|
+
};
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import type { DataSource } from '@sisense/sdk-data';
|
|
2
|
+
/**
|
|
3
|
+
* Options shared by {@link useGetWidgetNarrative} and imperative helpers such as
|
|
4
|
+
* {@link getNlgInsightsFromWidget}.
|
|
5
|
+
*
|
|
6
|
+
* @internal
|
|
7
|
+
*/
|
|
8
|
+
export interface WidgetNarrativeOptions {
|
|
9
|
+
/** Optional default data source to use if WidgetProps.dataSource is undefined */
|
|
10
|
+
defaultDataSource?: DataSource;
|
|
11
|
+
/** The verbosity of the NLG summarization */
|
|
12
|
+
verbosity?: 'Low' | 'High';
|
|
13
|
+
/** When false, legacy narration endpoint only; when true or undefined, try unified then fallback. */
|
|
14
|
+
isUnified?: boolean;
|
|
15
|
+
/** Computed SDK flag from server settings (`app.settings.narrative.isSisenseAiEnabled`), not raw AI API. */
|
|
16
|
+
isSisenseAiEnabled?: boolean;
|
|
17
|
+
/**
|
|
18
|
+
* When `true`, trend and forecast companion measures are omitted from the narrative JAQL so
|
|
19
|
+
* requests stay compatible with backends that do not yet support them.
|
|
20
|
+
*
|
|
21
|
+
* @default false
|
|
22
|
+
*/
|
|
23
|
+
ignoreTrendAndForecast?: boolean;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* @deprecated Use {@link WidgetNarrativeOptions}. Same shape; kept for legacy naming.
|
|
27
|
+
* @internal
|
|
28
|
+
*/
|
|
29
|
+
export type WidgetNarrativeNlgOptions = WidgetNarrativeOptions;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { DataSource } from '@sisense/sdk-data';
|
|
2
|
+
import { ChartWidgetProps } from '../../../domains/widgets/components/chart-widget/types';
|
|
3
|
+
import type { PivotTableWidgetProps } from '../../../domains/widgets/components/pivot-table-widget/types';
|
|
4
|
+
import type { WithCommonWidgetProps } from '../../../domains/widgets/components/widget/types';
|
|
5
|
+
import type { NarrativeRequest } from '../../../infra/api/narrative/narrative-api-types.js';
|
|
6
|
+
import type { NarrativeQueryParams } from './build-narrative-request.js';
|
|
7
|
+
/**
|
|
8
|
+
* Converts ChartWidgetProps to {@link NarrativeQueryParams} by extracting dimensions and measures
|
|
9
|
+
* from the chart data options.
|
|
10
|
+
*
|
|
11
|
+
* @param props - ChartWidgetProps to convert
|
|
12
|
+
* @param defaultDataSource - Optional default data source to use if props.dataSource is undefined
|
|
13
|
+
* @param verbosity - Optional verbosity for narrative text
|
|
14
|
+
* @param ignoreTrendAndForecast - When `true`, omits trend/forecast companion measures from the narrative JAQL
|
|
15
|
+
* @returns Params ready for {@link prepareNarrativeRequest}
|
|
16
|
+
* @throws If neither `props.dataSource` nor `defaultDataSource` is set
|
|
17
|
+
* @internal
|
|
18
|
+
*/
|
|
19
|
+
export declare function convertChartWidgetPropsToNarrativeParams(props: ChartWidgetProps, defaultDataSource?: DataSource, verbosity?: 'Low' | 'High', ignoreTrendAndForecast?: boolean): NarrativeQueryParams;
|
|
20
|
+
/**
|
|
21
|
+
* Builds a narrative API request from pivot widget props using the same JAQL as pivot query
|
|
22
|
+
* execution ({@link getPivotJaqlQueryPayload}).
|
|
23
|
+
*
|
|
24
|
+
* @param props - Pivot widget props (`widgetType: 'pivot'`)
|
|
25
|
+
* @param defaultDataSource - Used when `props.dataSource` is undefined
|
|
26
|
+
* @param verbosity - Optional verbosity for narrative text
|
|
27
|
+
* @param ignoreTrendAndForecast - When `true`, omits trend/forecast from pivot value columns in the narrative JAQL
|
|
28
|
+
* @returns Request ready for `getNarrative`
|
|
29
|
+
* @throws If data source cannot be resolved, or pivot query description is invalid
|
|
30
|
+
* @internal
|
|
31
|
+
*/
|
|
32
|
+
export declare function convertPivotWidgetPropsToNarrativeRequest(props: WithCommonWidgetProps<PivotTableWidgetProps, 'pivot'>, defaultDataSource?: DataSource, verbosity?: 'Low' | 'High', ignoreTrendAndForecast?: boolean): NarrativeRequest;
|
|
33
|
+
/**
|
|
34
|
+
* @deprecated Use {@link convertChartWidgetPropsToNarrativeParams}. Same function; kept for legacy `getNlgInsightsFromWidget`.
|
|
35
|
+
*/
|
|
36
|
+
export declare const convertChartWidgetPropsToUseGetNlgInsightsParams: typeof convertChartWidgetPropsToNarrativeParams;
|