@sisense/sdk-ui 2.24.0 → 2.25.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 (123) hide show
  1. package/dist/ai.cjs +59 -59
  2. package/dist/ai.js +919 -980
  3. package/dist/analytics-composer/node.cjs +1 -1
  4. package/dist/analytics-composer/node.js +856 -1030
  5. package/dist/analytics-composer.cjs +1 -1
  6. package/dist/analytics-composer.js +6 -6
  7. package/dist/{execute-query-b9oy2Egy.js → apply-styled-options-to-query-BsBTwL6W.js} +1518 -1446
  8. package/dist/apply-styled-options-to-query-mFJvsssw.cjs +1 -0
  9. package/dist/{index-Ck-0gJC9.cjs → index-BX9p-XrU.cjs} +1 -1
  10. package/dist/{index-r66Tjiqj.js → index-D7mHzfx0.js} +9 -0
  11. package/dist/index.cjs +467 -452
  12. package/dist/index.js +25112 -32394
  13. package/dist/index.umd.js +708 -685
  14. package/dist/packages/sdk-ui/src/domains/dashboarding/dashboard-model/types.d.ts +1 -1
  15. package/dist/packages/sdk-ui/src/domains/dashboarding/dashboard-model/use-dashboard-model/dashboard-model-reducer/persist-dashboard-model-middleware.d.ts +17 -5
  16. package/dist/packages/sdk-ui/src/domains/dashboarding/dashboard-model/use-dashboard-model/dashboard-model-reducer/types.d.ts +4 -1
  17. package/dist/packages/sdk-ui/src/domains/dashboarding/hooks/duplicate-widget/use-duplicate-widget-menu-item.d.ts +1 -1
  18. package/dist/packages/sdk-ui/src/domains/dashboarding/hooks/rename-widget/use-widget-renaming.d.ts +1 -1
  19. package/dist/packages/sdk-ui/src/domains/dashboarding/index.d.ts +2 -0
  20. package/dist/packages/sdk-ui/src/domains/dashboarding/persistence/persistence-manager.d.ts +11 -0
  21. package/dist/packages/sdk-ui/src/domains/dashboarding/persistence/types.d.ts +52 -0
  22. package/dist/packages/sdk-ui/src/domains/dashboarding/types.d.ts +5 -28
  23. package/dist/packages/sdk-ui/src/domains/dashboarding/use-composed-dashboard.d.ts +4 -2
  24. package/dist/packages/sdk-ui/src/domains/narrative/components/narrative-collapsible.d.ts +13 -0
  25. package/dist/packages/sdk-ui/src/domains/narrative/components/narrative-top-slot-shell.d.ts +21 -0
  26. package/dist/packages/sdk-ui/src/domains/narrative/components/widget-narrative-interactive.d.ts +11 -0
  27. package/dist/packages/sdk-ui/src/domains/narrative/components/widget-narrative.d.ts +40 -0
  28. package/dist/packages/sdk-ui/src/domains/narrative/core/build-narrative-request.d.ts +36 -0
  29. package/dist/packages/sdk-ui/src/domains/narrative/core/get-narrative-dimensions-and-measures.d.ts +22 -0
  30. package/dist/packages/sdk-ui/src/domains/narrative/core/widget-narrative-options.d.ts +28 -0
  31. package/dist/packages/sdk-ui/src/domains/narrative/core/widget-props-to-narrative-params.d.ts +36 -0
  32. package/dist/packages/sdk-ui/src/domains/narrative/hooks/use-get-widget-narrative.d.ts +62 -0
  33. package/dist/packages/sdk-ui/src/domains/narrative/hooks/use-widget-narrative-state.d.ts +39 -0
  34. package/dist/packages/sdk-ui/src/domains/visualizations/core/chart-data-options/apply-styled-options-to-query.d.ts +87 -0
  35. package/dist/packages/sdk-ui/src/domains/visualizations/core/chart-data-options/translate-data-options.d.ts +13 -1
  36. package/dist/packages/sdk-ui/src/domains/visualizations/core/query-definition/compose-code-to-readable.d.ts +12 -0
  37. package/dist/packages/sdk-ui/src/domains/visualizations/core/query-definition/index.d.ts +6 -0
  38. package/dist/packages/sdk-ui/src/domains/visualizations/core/query-definition/query-definition.d.ts +26 -0
  39. package/dist/packages/sdk-ui/src/domains/visualizations/core/query-definition/query-params-to-view-model.d.ts +12 -0
  40. package/dist/packages/sdk-ui/src/domains/visualizations/core/query-definition/query-pill-bubble-tooltip.d.ts +12 -0
  41. package/dist/packages/sdk-ui/src/domains/visualizations/core/query-definition/query-pill.d.ts +13 -0
  42. package/dist/packages/sdk-ui/src/domains/visualizations/core/query-definition/types.d.ts +51 -0
  43. package/dist/packages/sdk-ui/src/domains/widgets/components/widget-by-id/translate-widget-style-options/to-widget-dto-style.d.ts +50 -2
  44. package/dist/packages/sdk-ui/src/domains/widgets/widget-model/widget-model-translator/utils.d.ts +9 -0
  45. package/dist/packages/sdk-ui/src/domains/widgets/widget-model/widget-model-translator/widget-model-translator.d.ts +5 -2
  46. package/dist/packages/sdk-ui/src/infra/api/narrative/narrative-api-types.d.ts +32 -0
  47. package/dist/packages/sdk-ui/src/infra/api/narrative/narrative-constants.d.ts +6 -0
  48. package/dist/packages/sdk-ui/src/{modules/ai/api/narration-endpoints.d.ts → infra/api/narrative/narrative-endpoints.d.ts} +8 -7
  49. package/dist/packages/sdk-ui/src/infra/api/narrative/send-ai-feedback.d.ts +8 -0
  50. package/dist/packages/sdk-ui/src/infra/contexts/emotion-cache-provider/emotion-cache-provider.d.ts +31 -3
  51. package/dist/packages/sdk-ui/src/infra/contexts/emotion-cache-provider/stylis-plugins/css-selector-prefix-plugin.d.ts +18 -0
  52. package/dist/packages/sdk-ui/src/infra/translation/resources/__external__/de-de.d.ts +9 -0
  53. package/dist/packages/sdk-ui/src/infra/translation/resources/__external__/en-us.d.ts +9 -0
  54. package/dist/packages/sdk-ui/src/infra/translation/resources/__external__/es-ar.d.ts +9 -0
  55. package/dist/packages/sdk-ui/src/infra/translation/resources/__external__/es-es.d.ts +9 -0
  56. package/dist/packages/sdk-ui/src/infra/translation/resources/__external__/fr-fr.d.ts +9 -0
  57. package/dist/packages/sdk-ui/src/infra/translation/resources/__external__/it-it.d.ts +9 -0
  58. package/dist/packages/sdk-ui/src/infra/translation/resources/__external__/ja-jp.d.ts +9 -0
  59. package/dist/packages/sdk-ui/src/infra/translation/resources/__external__/ko-kr.d.ts +9 -0
  60. package/dist/packages/sdk-ui/src/infra/translation/resources/__external__/nl-nl.d.ts +9 -0
  61. package/dist/packages/sdk-ui/src/infra/translation/resources/__external__/pt-br.d.ts +9 -0
  62. package/dist/packages/sdk-ui/src/infra/translation/resources/__external__/ru-ru.d.ts +9 -0
  63. package/dist/packages/sdk-ui/src/infra/translation/resources/__external__/tr-tr.d.ts +9 -0
  64. package/dist/packages/sdk-ui/src/infra/translation/resources/__external__/zh-cn.d.ts +9 -0
  65. package/dist/packages/sdk-ui/src/infra/translation/resources/en.d.ts +9 -0
  66. package/dist/packages/sdk-ui/src/infra/translation/resources/index.d.ts +18 -0
  67. package/dist/packages/sdk-ui/src/modules/ai/api/chat-rest-api.d.ts +1 -1
  68. package/dist/packages/sdk-ui/src/modules/ai/api/types.d.ts +5 -18
  69. package/dist/packages/sdk-ui/src/modules/ai/chart/nlq-chart-widget.d.ts +2 -0
  70. package/dist/packages/sdk-ui/src/modules/ai/common/collapsible.d.ts +3 -0
  71. package/dist/packages/sdk-ui/src/modules/ai/get-nlg-insights-from-widget.d.ts +5 -13
  72. package/dist/packages/sdk-ui/src/modules/ai/index.d.ts +1 -1
  73. package/dist/packages/sdk-ui/src/modules/ai/use-get-nlg-insights.d.ts +4 -26
  74. package/dist/packages/sdk-ui/src/modules/analytics-composer/nlq-v3-translator/types.d.ts +3 -7
  75. package/dist/packages/sdk-ui/src/props.d.ts +1 -1
  76. package/dist/packages/sdk-ui/src/public-api/sisense-internal.d.ts +7 -1
  77. package/dist/packages/sdk-ui/src/types.d.ts +1 -1
  78. package/dist/parse-compose-code-DfZskSng.js +352 -0
  79. package/dist/parse-compose-code-v4J9BrUg.cjs +1 -0
  80. package/dist/translations/de-de.cjs +1 -1
  81. package/dist/translations/de-de.js +10 -1
  82. package/dist/translations/en-us.cjs +1 -1
  83. package/dist/translations/en-us.js +1 -1
  84. package/dist/translations/es-ar.cjs +1 -1
  85. package/dist/translations/es-ar.js +10 -1
  86. package/dist/translations/es-es.cjs +1 -1
  87. package/dist/translations/es-es.js +10 -1
  88. package/dist/translations/fr-fr.cjs +1 -1
  89. package/dist/translations/fr-fr.js +10 -1
  90. package/dist/translations/it-it.cjs +1 -1
  91. package/dist/translations/it-it.js +12 -3
  92. package/dist/translations/ja-jp.cjs +1 -1
  93. package/dist/translations/ja-jp.js +12 -3
  94. package/dist/translations/ko-kr.cjs +1 -1
  95. package/dist/translations/ko-kr.js +12 -3
  96. package/dist/translations/nl-nl.cjs +1 -1
  97. package/dist/translations/nl-nl.js +12 -3
  98. package/dist/translations/pt-br.cjs +1 -1
  99. package/dist/translations/pt-br.js +10 -1
  100. package/dist/translations/ru-ru.cjs +1 -1
  101. package/dist/translations/ru-ru.js +12 -3
  102. package/dist/translations/tr-tr.cjs +1 -1
  103. package/dist/translations/tr-tr.js +10 -1
  104. package/dist/translations/zh-cn.cjs +1 -1
  105. package/dist/translations/zh-cn.js +12 -3
  106. package/dist/{types-DJtC8_5_.js → types-BBp2sp_s.js} +1 -1
  107. package/dist/types-GFLaiax5.cjs +1 -0
  108. package/dist/use-hover-DsnmY-p_.cjs +721 -0
  109. package/dist/{quota-notification-CeKnEyQG.js → use-hover-mptQLQ4S.js} +27603 -19263
  110. package/dist/{utils-D8O1_kl3.cjs → utils-BlNqPAG8.cjs} +45 -45
  111. package/dist/{utils-BCp2ISWh.js → utils-DTUC-wtI.js} +7724 -7512
  112. package/dist/{widget-composer-BkHZISs7.cjs → widget-composer-CDb2iOoS.cjs} +1 -1
  113. package/dist/{widget-composer-CDNL9_XF.js → widget-composer-D0BZrLna.js} +3 -3
  114. package/package.json +11 -10
  115. package/dist/dimensions-C1R5YRt-.js +0 -204
  116. package/dist/dimensions-C7yXAoZs.cjs +0 -1
  117. package/dist/execute-query-0Y9Fn9Pf.cjs +0 -1
  118. package/dist/packages/sdk-ui/src/infra/styled/index.d.ts +0 -4
  119. package/dist/packages/sdk-ui/src/infra/styled/with-css-selector-prefix.d.ts +0 -2
  120. package/dist/packages/sdk-ui/src/modules/analytics-composer/nlq-v3-translator/query/constants.d.ts +0 -8
  121. package/dist/packages/sdk-ui/src/modules/analytics-composer/nlq-v3-translator/shared/utils/parse-compose-code.d.ts +0 -34
  122. package/dist/quota-notification-BqRYSJ7r.cjs +0 -713
  123. package/dist/types-C0QU2tsE.cjs +0 -1
@@ -1,8 +1,20 @@
1
1
  import { Attribute, Measure } from '@sisense/sdk-data';
2
2
  import { ChartType } from '../../../../types';
3
- import { CategoricalChartDataOptions, CategoricalChartDataOptionsInternal, ChartDataOptions, ChartDataOptionsInternal, PivotTableDataOptions, PivotTableDataOptionsInternal, TableDataOptions, TableDataOptionsInternal } from './types';
3
+ import { CategoricalChartDataOptions, CategoricalChartDataOptionsInternal, ChartDataOptions, ChartDataOptionsInternal, PivotTableDataOptions, PivotTableDataOptionsInternal, StyledColumn, StyledMeasureColumn, TableDataOptions, TableDataOptionsInternal } from './types';
4
4
  export declare function translateChartDataOptions(chartType: ChartType, dataOptions: ChartDataOptions): ChartDataOptionsInternal;
5
5
  export declare const translateCategoricalChartDataOptions: (categorical: CategoricalChartDataOptions) => CategoricalChartDataOptionsInternal;
6
+ /**
7
+ * Styled dimension columns used by charts for the same axes as {@link getAttributes}.
8
+ *
9
+ * @internal
10
+ */
11
+ export declare function getStyledDimensionColumns(dataOptions: ChartDataOptionsInternal, chartType: ChartType): StyledColumn[];
12
+ /**
13
+ * Styled measure columns used by charts for the same axes as {@link getMeasures}.
14
+ *
15
+ * @internal
16
+ */
17
+ export declare function getStyledMeasureColumns(dataOptions: ChartDataOptionsInternal, chartType: ChartType): StyledMeasureColumn[];
6
18
  export declare function getAttributes(dataOptions: ChartDataOptionsInternal, chartType: ChartType): Attribute[];
7
19
  export declare function getMeasures(dataOptions: ChartDataOptionsInternal, chartType: ChartType): Measure[];
8
20
  export declare function translateTableDataOptions(dataOptions: TableDataOptions): TableDataOptionsInternal;
@@ -0,0 +1,12 @@
1
+ import type { FunctionCall } from '@sisense/sdk-data';
2
+ import type { QueryPillItem } from './types';
3
+ export type TooltipModel = {
4
+ layoutText: string;
5
+ typeLabel: 'Measure' | 'Dimension' | 'Filter';
6
+ column: string;
7
+ formula: string;
8
+ };
9
+ /** @internal */
10
+ export declare function functionCallToString(functionCall: FunctionCall, ignoreArgs?: string[]): string;
11
+ /** @internal */
12
+ export declare function getQueryPillTooltipModel(item: QueryPillItem): TooltipModel | null;
@@ -0,0 +1,6 @@
1
+ export { QueryDefinition } from './query-definition';
2
+ export type { QueryDefinitionProps } from './query-definition';
3
+ export { QueryPill } from './query-pill';
4
+ export type { QueryPillProps } from './query-pill';
5
+ export type { QueryPillCategory, QueryPillItem, ConnectorItem, QueryDefinitionViewModel, } from './types';
6
+ export { isConnectorItem, isPillItem } from './types';
@@ -0,0 +1,26 @@
1
+ import { type FunctionComponent } from 'react';
2
+ import type { BaseQueryParams } from '../../../../domains/query-execution/types';
3
+ import type { ChartProps } from '../../../../props';
4
+ /**
5
+ * Props for the QueryDefinition component.
6
+ *
7
+ * @sisenseInternal
8
+ */
9
+ export interface QueryDefinitionProps {
10
+ /** Either chart props (uses getTranslatedDataOptions internally) or base query params */
11
+ query: BaseQueryParams | ChartProps;
12
+ /** When true (default), pills show JSON tooltip on hover. */
13
+ showTooltip?: boolean;
14
+ /**
15
+ * Optional DOM box to clamp tooltips (e.g. chart card). Omit for viewport-only — the component
16
+ * root is only one row tall and must not be used as boundary (breaks vertical placement).
17
+ */
18
+ tooltipBoundaryElement?: HTMLElement | null;
19
+ }
20
+ /**
21
+ * Read-only query definition as colored pills above the widget.
22
+ * Order: Measures → Dimensions → Filters; collapsed to 4 pills with “Show N more” / “Show less”.
23
+ *
24
+ * @sisenseInternal
25
+ */
26
+ export declare const QueryDefinition: FunctionComponent<QueryDefinitionProps>;
@@ -0,0 +1,12 @@
1
+ import type { BaseQueryParams } from '../../../../domains/query-execution/types';
2
+ import type { QueryDefinitionViewModel } from './types';
3
+ /**
4
+ * Builds the query definition view model from base query params.
5
+ * Order: Measures → "by" → Dimensions → "for"/"where" → Filters.
6
+ * Operators (comparison/sort) are not derived from BaseQueryParams in v1.
7
+ *
8
+ * @param params - BaseQueryParams from chart or query
9
+ * @returns QueryDefinitionViewModel (pills and connectors)
10
+ * @internal
11
+ */
12
+ export declare function baseQueryParamsToViewModel(params: BaseQueryParams): QueryDefinitionViewModel;
@@ -0,0 +1,12 @@
1
+ import { type FunctionComponent, type ReactNode } from 'react';
2
+ export interface QueryPillBubbleTooltipProps {
3
+ children: ReactNode;
4
+ content: ReactNode;
5
+ open: boolean;
6
+ onOpenChange: (open: boolean) => void;
7
+ /** false = prefer above pill (default); true = prefer below (>3 lines of JSON). */
8
+ preferBelow?: boolean;
9
+ /** Tooltip stays inside this box (e.g. widget / story panel); intersects with viewport. */
10
+ boundaryElement?: HTMLElement | null;
11
+ }
12
+ export declare const QueryPillBubbleTooltip: FunctionComponent<QueryPillBubbleTooltipProps>;
@@ -0,0 +1,13 @@
1
+ import type { FunctionComponent } from 'react';
2
+ import type { QueryPillItem } from './types';
3
+ export interface QueryPillProps {
4
+ item: QueryPillItem;
5
+ showTooltip?: boolean;
6
+ tooltipBoundaryElement?: HTMLElement | null;
7
+ }
8
+ /**
9
+ * Read-only query-definition pill; JSON tooltip is a portal bubble with a real triangle.
10
+ *
11
+ * @internal
12
+ */
13
+ export declare const QueryPill: FunctionComponent<QueryPillProps>;
@@ -0,0 +1,51 @@
1
+ import { Attribute, Filter, FilterRelations, Measure } from '@sisense/sdk-data';
2
+ /**
3
+ * Category of a query pill for styling (color).
4
+ *
5
+ * @sisenseInternal
6
+ */
7
+ export type QueryPillCategory = 'measure' | 'dimension' | 'filter' | 'operator';
8
+ /**
9
+ * A single pill item in the query definition (measure, dimension, filter, or operator).
10
+ *
11
+ * @sisenseInternal
12
+ */
13
+ export interface QueryPillItem {
14
+ type: 'pill';
15
+ /** Display label (friendly name) */
16
+ label: string;
17
+ /** Category for pill color */
18
+ category: QueryPillCategory;
19
+ /** Optional stable id for keys */
20
+ id?: string;
21
+ /** Source entity for debug/tooltip JSON (measure, dimension attribute, filter, etc.) */
22
+ tooltipData?: Attribute | Measure | Filter | FilterRelations;
23
+ }
24
+ /**
25
+ * Connector between pill groups (plain text, no pill styling).
26
+ *
27
+ * @internal
28
+ */
29
+ export interface ConnectorItem {
30
+ type: 'connector';
31
+ label: string;
32
+ }
33
+ /**
34
+ * View model for the QueryDefinition component: ordered list of pills and connectors.
35
+ * Order: Measures → "by" → Dimensions → "for"/"where" → Filters → Operators.
36
+ *
37
+ * @sisenseInternal
38
+ */
39
+ export type QueryDefinitionViewModel = (QueryPillItem | ConnectorItem)[];
40
+ /**
41
+ * Type guard for connector items.
42
+ *
43
+ * @internal
44
+ */
45
+ export declare function isConnectorItem(item: QueryPillItem | ConnectorItem): item is ConnectorItem;
46
+ /**
47
+ * Type guard for pill items.
48
+ *
49
+ * @internal
50
+ */
51
+ export declare function isPillItem(item: QueryPillItem | ConnectorItem): item is QueryPillItem;
@@ -1,5 +1,6 @@
1
- import type { AreaStyleOptions, AxisLabel, DataLimits, LegendOptions, LineStyleOptions, LineWidth, Markers, Navigator, SeriesLabels } from '../../../../../types.js';
2
- import type { AxisStyle, CartesianWidgetStyle, WidgetSubtype } from '../types.js';
1
+ import { AppSettings } from '../../../../../infra/app/settings/settings.js';
2
+ import type { AreaStyleOptions, AxisLabel, CompleteThemeSettings, DataLimits, IndicatorStyleOptions, LegendOptions, LineStyleOptions, LineWidth, Markers, Navigator, PieStyleOptions, SeriesLabels, WidgetStyleOptions } from '../../../../../types.js';
3
+ import type { AxisStyle, CartesianWidgetStyle, WidgetDesign, WidgetStyle, WidgetSubtype } from '../types.js';
3
4
  /**
4
5
  * Maps SDK legend options to Fusion DTO legend style.
5
6
  *
@@ -51,6 +52,53 @@ export declare function toMarkersStyle(markers?: Markers): CartesianWidgetStyle[
51
52
  * @internal
52
53
  */
53
54
  export declare function toDataLimitsStyle(dataLimits?: DataLimits): CartesianWidgetStyle['dataLimits'];
55
+ /**
56
+ * Returns true when {@link WidgetModel.styleOptions} carries any widget container / design
57
+ * field that was produced by {@link getFlattenWidgetDesign} (and should be written back).
58
+ *
59
+ * @internal
60
+ */
61
+ export declare function hasWidgetContainerStyleFields(styleOptions: WidgetStyleOptions): boolean;
62
+ /**
63
+ * Rebuilds Fusion `style.widgetDesign` from flattened container options (inverse of
64
+ * {@link getFlattenWidgetDesign}).
65
+ *
66
+ * Missing fields default to the corresponding values from `themeSettings.widget` so that
67
+ * the resulting {@link WidgetDesign} is always fully populated which is critical for the widget design feature in Fusion.
68
+ *
69
+ * @internal
70
+ */
71
+ export declare function toWidgetDesign(styleOptions: WidgetStyleOptions, widgetTheme: CompleteThemeSettings['widget']): WidgetDesign | undefined;
72
+ /**
73
+ * Attaches `style.widgetDesign` built from widget container fields in `styleOptions`.
74
+ * When the feature flag is off, or when `styleOptions` carries no container fields, the
75
+ * base style is returned unchanged.
76
+ *
77
+ * @param baseStyle - The base style to be attached with the widget design
78
+ * @param styleOptions - The style options to be used for the widget design
79
+ * @param themeSettings - The theme settings to be used for the widget design
80
+ * @param appSettings - The application settings to be used for the widget design
81
+ * @returns The widget style with the widget design
82
+ */
83
+ export declare function withWidgetDesign(baseStyle: WidgetStyle, styleOptions: WidgetStyleOptions, themeSettings: CompleteThemeSettings, appSettings?: AppSettings): WidgetStyle;
84
+ /**
85
+ * Maps SDK pie chart style options to Fusion PieWidgetStyle (DTO).
86
+ * Inverse of {@link extractPieChartStyleOptions}.
87
+ *
88
+ * @param styleOptions - Pie style options from WidgetModel.styleOptions
89
+ * @returns Fusion PieWidgetStyle for the widget DTO
90
+ * @internal
91
+ */
92
+ export declare function toPieWidgetStyle(styleOptions: PieStyleOptions): WidgetStyle;
93
+ /**
94
+ * Maps SDK indicator style options to Fusion IndicatorWidgetStyle (DTO).
95
+ * Inverse of {@link extractIndicatorChartStyleOptions}.
96
+ *
97
+ * @param styleOptions - Indicator style options from WidgetModel.styleOptions
98
+ * @returns Fusion IndicatorWidgetStyle for the widget DTO
99
+ * @internal
100
+ */
101
+ export declare function toIndicatorWidgetStyle(styleOptions: IndicatorStyleOptions): WidgetStyle;
54
102
  /**
55
103
  * Maps SDK line chart style options to Fusion CartesianWidgetStyle (DTO).
56
104
  * Used when serializing a line chart widget back to WidgetDto.
@@ -0,0 +1,9 @@
1
+ import { AppSettings } from '../../../../infra/app/settings/settings.js';
2
+ /**
3
+ * Checks if widget design style is enabled.
4
+ * Pure function with default fallback.
5
+ *
6
+ * @param appSettings - Optional application settings
7
+ * @returns True if widget design is enabled
8
+ */
9
+ export declare const isWidgetDesignEnabled: (appSettings?: AppSettings) => boolean;
@@ -175,7 +175,10 @@ export declare function fromWidgetProps(widgetProps: WidgetProps): WidgetModel;
175
175
  *
176
176
  * @param widgetModel - The WidgetModel to be converted to a widgetDto
177
177
  * @param dataSource - The full datasource details
178
+ * @param themeSettings - The theme settings to be used for the widget design
179
+ * @param appSettings - The application settings to be used for the widget design
178
180
  * @returns WidgetDto
179
- * @internal
181
+ *
182
+ * @sisenseInternal
180
183
  */
181
- export declare function toWidgetDto(widgetModel: WidgetModel, dataSource?: JaqlDataSourceForDto): WidgetDto;
184
+ export declare function toWidgetDto(widgetModel: WidgetModel, dataSource?: JaqlDataSourceForDto, themeSettings?: CompleteThemeSettings, appSettings?: AppSettings): WidgetDto;
@@ -0,0 +1,32 @@
1
+ import type { JaqlQueryPayload } from '@sisense/sdk-query-client';
2
+ export interface GetNlgInsightsRequest {
3
+ /**
4
+ * @privateRemarks
5
+ * JAQL sent with narrative requests. Chart narratives omit pivot-only fields; pivot narratives
6
+ * include full `JaqlQueryPayload` fields (`format`, `grandTotals`, `queryGuid`, etc.).
7
+ * The SDK sets the payload `by` field to `ComposeSDK` when calling the narrative API.
8
+ *
9
+ */
10
+ jaql: Partial<JaqlQueryPayload> & Pick<JaqlQueryPayload, 'datasource' | 'metadata'>;
11
+ verbosity?: 'Low' | 'High';
12
+ }
13
+ /** @internal */
14
+ export type NarrativeRequest = GetNlgInsightsRequest;
15
+ export interface NarrativeResponse {
16
+ data?: {
17
+ answer: string;
18
+ };
19
+ responseType: 'Text';
20
+ }
21
+ /**
22
+ * Payload for `api/v2/ai/feedback`.
23
+ *
24
+ * @internal
25
+ */
26
+ export interface SendAiFeedbackRequest {
27
+ type: string;
28
+ data: object;
29
+ sourceId: string;
30
+ rating: -1 | 1;
31
+ }
32
+ export type GetNlgInsightsResponse = NarrativeResponse;
@@ -0,0 +1,6 @@
1
+ /**
2
+ * Client origin tag for narrative AI requests (aligned with JAQL `by` for query execution).
3
+ *
4
+ * @internal
5
+ */
6
+ export declare const NARRATIVE_BY_CSDK = "ComposeSDK";
@@ -1,19 +1,20 @@
1
1
  import type { HttpClient } from '@sisense/sdk-rest-client';
2
- import type { GetNlgInsightsRequest, GetNlgInsightsResponse } from './types.js';
2
+ import type { NarrativeRequest, NarrativeResponse } from './narrative-api-types.js';
3
3
  /** Unified narrative endpoint. Try first; fall back to legacy on 404. */
4
- export declare const UNIFIED_NARRATION_ENDPOINT = "api/v2/ai/narrative";
4
+ export declare const UNIFIED_NARRATIVE_ENDPOINT = "api/v2/ai/narrative";
5
5
  /** Legacy endpoint (used when unified narrative returns 404). */
6
- export declare const LEGACY_NARRATION_ENDPOINT = "api/v2/ai/nlg/queryResult";
6
+ export declare const LEGACY_NARRATIVE_ENDPOINT = "api/v2/ai/nlg/queryResult";
7
7
  /**
8
- * Options for getNarrations. All endpoint choice logic lives in this module.
8
+ * Options for getNarrative. All endpoint choice logic lives in this module.
9
+ *
9
10
  * @internal
10
11
  */
11
- export type GetNarrationsOptions = {
12
+ export type GetNarrativeOptions = {
12
13
  isUnifiedNarrationEnabled?: boolean;
13
14
  isSisenseAiEnabled?: boolean;
14
15
  };
15
16
  /**
16
- * Fetches narrations. Single place for endpoint logic: isUnifiedNarrationEnabled === false → legacy only;
17
+ * Fetches Narrative. Single place for endpoint logic: isUnifiedNarrationEnabled === false → legacy only;
17
18
  * otherwise try unified endpoint first, fall back to legacy on 404.
18
19
  *
19
20
  * @param httpClient - HttpClient instance
@@ -22,4 +23,4 @@ export type GetNarrationsOptions = {
22
23
  * @returns Promise with narration response
23
24
  * @internal
24
25
  */
25
- export declare function getNarrations(httpClient: HttpClient, request: GetNlgInsightsRequest, options?: GetNarrationsOptions): Promise<GetNlgInsightsResponse>;
26
+ export declare function getNarrative(httpClient: HttpClient, request: NarrativeRequest, options?: GetNarrativeOptions): Promise<NarrativeResponse>;
@@ -0,0 +1,8 @@
1
+ import type { HttpClient } from '@sisense/sdk-rest-client';
2
+ import type { SendAiFeedbackRequest } from './narrative-api-types.js';
3
+ /**
4
+ * Posts AI / chart insight feedback (thumbs).
5
+ *
6
+ * @internal
7
+ */
8
+ export declare function sendAiFeedback(httpClient: HttpClient, request: SendAiFeedbackRequest): Promise<unknown>;
@@ -1,10 +1,38 @@
1
1
  import React, { ReactNode } from 'react';
2
2
  export interface EmotionCacheProviderProps {
3
3
  children: ReactNode;
4
+ /**
5
+ * An ancestor CSS selector (e.g. `'#sdk-scope'`) to prepend to every Emotion
6
+ * CSS rule to increase specificity.
7
+ *
8
+ * When omitted (`undefined`), no prefix logic is applied.
9
+ */
10
+ cssSelectorPrefix?: string;
4
11
  }
5
12
  /**
6
- * A provider component that uses the Emotion cache, but only creates one if a nonce is found in the DOM.
7
- * This ensures that styles are injected in a way that is compliant with CSP if necessary.
8
- * If no nonce is found, it simply renders the children without the CacheProvider.
13
+ * Provides an Emotion cache to the component tree. Handles two concerns:
14
+ *
15
+ * 1. **CSP nonce** when a `<meta property="csp-nonce">` tag is present, a
16
+ * cache carrying that nonce is created so Emotion's `<style>` tags comply
17
+ * with Content Security Policy.
18
+ *
19
+ * 2. **CSS selector prefix** — when `cssSelectorPrefix` is provided, a Stylis
20
+ * plugin is installed that prepends the selector to every compiled CSS rule,
21
+ * increasing specificity so CSDK styles win over host-app overrides.
22
+ *
23
+ * The component is designed to be used at two levels:
24
+ *
25
+ * - **Top-level** (in `SisenseContextProvider`, no `cssSelectorPrefix` prop) —
26
+ * creates a nonce-only cache if needed and establishes the internal context
27
+ * so nested instances can detect they are not the first provider.
28
+ *
29
+ * - **Nested** (in `ThemeProvider`, with `cssSelectorPrefix` prop) — compares
30
+ * the requested prefix against the ancestor's value via `EmotionCacheContext`.
31
+ * A new cache is created only when the prefix has actually changed; otherwise
32
+ * children are rendered as-is, reusing the ancestor's cache.
33
+ *
34
+ * When a nested provider creates a cache (nonce is always included when present),
35
+ * it also updates `EmotionCacheContext` so that further nested providers can
36
+ * detect the new prefix value and avoid creating duplicate caches.
9
37
  */
10
38
  export declare const EmotionCacheProvider: React.FC<EmotionCacheProviderProps>;
@@ -0,0 +1,18 @@
1
+ import type { Middleware } from 'stylis';
2
+ /**
3
+ * Creates a Stylis plugin that prepends a CSS selector prefix to every rule.
4
+ *
5
+ * Given configured prefix, for example "#sdk-root", a compiled rule like ".css-abc { color: red }"
6
+ * becomes "#sdk-root .css-abc { color: red }", increasing its specificity so
7
+ * that library styles win over same-specificity rules from the host application.
8
+ *
9
+ * Operating at the Stylis (CSS compilation) layer means all CSS is covered —
10
+ * template strings, interpolation functions, object styles, and keyframe
11
+ * declarations — without any changes to the styled-component call sites.
12
+ *
13
+ * @param prefix - An ancestor CSS selector, e.g. `'#sdk-scope'` or `'.my-app'`.
14
+ * Must match an element that wraps all library components in the DOM.
15
+ * @returns A Stylis v4 middleware function compatible with `@emotion/cache`'s
16
+ * `stylisPlugins` option.
17
+ */
18
+ export declare function createCssSelectorPrefixPlugin(prefix: string): Middleware;
@@ -428,6 +428,15 @@ declare const _default: {
428
428
  loadingOverlay: {
429
429
  label: string;
430
430
  };
431
+ queryDefinition: {
432
+ showMorePills: string;
433
+ showLess: string;
434
+ connectorBy: string;
435
+ connectorWhere: string;
436
+ tooltipType: string;
437
+ tooltipColumn: string;
438
+ tooltipFormula: string;
439
+ };
431
440
  measures: {
432
441
  countShort: string;
433
442
  countDistinct: string;
@@ -428,6 +428,15 @@ declare const _default: {
428
428
  loadingOverlay: {
429
429
  label: string;
430
430
  };
431
+ queryDefinition: {
432
+ showMorePills: string;
433
+ showLess: string;
434
+ connectorBy: string;
435
+ connectorWhere: string;
436
+ tooltipType: string;
437
+ tooltipColumn: string;
438
+ tooltipFormula: string;
439
+ };
431
440
  measures: {
432
441
  countShort: string;
433
442
  countDistinct: string;
@@ -428,6 +428,15 @@ declare const _default: {
428
428
  loadingOverlay: {
429
429
  label: string;
430
430
  };
431
+ queryDefinition: {
432
+ showMorePills: string;
433
+ showLess: string;
434
+ connectorBy: string;
435
+ connectorWhere: string;
436
+ tooltipType: string;
437
+ tooltipColumn: string;
438
+ tooltipFormula: string;
439
+ };
431
440
  measures: {
432
441
  countShort: string;
433
442
  countDistinct: string;
@@ -428,6 +428,15 @@ declare const _default: {
428
428
  loadingOverlay: {
429
429
  label: string;
430
430
  };
431
+ queryDefinition: {
432
+ showMorePills: string;
433
+ showLess: string;
434
+ connectorBy: string;
435
+ connectorWhere: string;
436
+ tooltipType: string;
437
+ tooltipColumn: string;
438
+ tooltipFormula: string;
439
+ };
431
440
  measures: {
432
441
  countShort: string;
433
442
  countDistinct: string;
@@ -428,6 +428,15 @@ declare const _default: {
428
428
  loadingOverlay: {
429
429
  label: string;
430
430
  };
431
+ queryDefinition: {
432
+ showMorePills: string;
433
+ showLess: string;
434
+ connectorBy: string;
435
+ connectorWhere: string;
436
+ tooltipType: string;
437
+ tooltipColumn: string;
438
+ tooltipFormula: string;
439
+ };
431
440
  measures: {
432
441
  countShort: string;
433
442
  countDistinct: string;
@@ -428,6 +428,15 @@ declare const _default: {
428
428
  loadingOverlay: {
429
429
  label: string;
430
430
  };
431
+ queryDefinition: {
432
+ showMorePills: string;
433
+ showLess: string;
434
+ connectorBy: string;
435
+ connectorWhere: string;
436
+ tooltipType: string;
437
+ tooltipColumn: string;
438
+ tooltipFormula: string;
439
+ };
431
440
  measures: {
432
441
  countShort: string;
433
442
  countDistinct: string;
@@ -428,6 +428,15 @@ declare const _default: {
428
428
  loadingOverlay: {
429
429
  label: string;
430
430
  };
431
+ queryDefinition: {
432
+ showMorePills: string;
433
+ showLess: string;
434
+ connectorBy: string;
435
+ connectorWhere: string;
436
+ tooltipType: string;
437
+ tooltipColumn: string;
438
+ tooltipFormula: string;
439
+ };
431
440
  measures: {
432
441
  countShort: string;
433
442
  countDistinct: string;
@@ -428,6 +428,15 @@ declare const _default: {
428
428
  loadingOverlay: {
429
429
  label: string;
430
430
  };
431
+ queryDefinition: {
432
+ showMorePills: string;
433
+ showLess: string;
434
+ connectorBy: string;
435
+ connectorWhere: string;
436
+ tooltipType: string;
437
+ tooltipColumn: string;
438
+ tooltipFormula: string;
439
+ };
431
440
  measures: {
432
441
  countShort: string;
433
442
  countDistinct: string;
@@ -428,6 +428,15 @@ declare const _default: {
428
428
  loadingOverlay: {
429
429
  label: string;
430
430
  };
431
+ queryDefinition: {
432
+ showMorePills: string;
433
+ showLess: string;
434
+ connectorBy: string;
435
+ connectorWhere: string;
436
+ tooltipType: string;
437
+ tooltipColumn: string;
438
+ tooltipFormula: string;
439
+ };
431
440
  measures: {
432
441
  countShort: string;
433
442
  countDistinct: string;
@@ -428,6 +428,15 @@ declare const _default: {
428
428
  loadingOverlay: {
429
429
  label: string;
430
430
  };
431
+ queryDefinition: {
432
+ showMorePills: string;
433
+ showLess: string;
434
+ connectorBy: string;
435
+ connectorWhere: string;
436
+ tooltipType: string;
437
+ tooltipColumn: string;
438
+ tooltipFormula: string;
439
+ };
431
440
  measures: {
432
441
  countShort: string;
433
442
  countDistinct: string;
@@ -428,6 +428,15 @@ declare const _default: {
428
428
  loadingOverlay: {
429
429
  label: string;
430
430
  };
431
+ queryDefinition: {
432
+ showMorePills: string;
433
+ showLess: string;
434
+ connectorBy: string;
435
+ connectorWhere: string;
436
+ tooltipType: string;
437
+ tooltipColumn: string;
438
+ tooltipFormula: string;
439
+ };
431
440
  measures: {
432
441
  countShort: string;
433
442
  countDistinct: string;
@@ -428,6 +428,15 @@ declare const _default: {
428
428
  loadingOverlay: {
429
429
  label: string;
430
430
  };
431
+ queryDefinition: {
432
+ showMorePills: string;
433
+ showLess: string;
434
+ connectorBy: string;
435
+ connectorWhere: string;
436
+ tooltipType: string;
437
+ tooltipColumn: string;
438
+ tooltipFormula: string;
439
+ };
431
440
  measures: {
432
441
  countShort: string;
433
442
  countDistinct: string;
@@ -428,6 +428,15 @@ declare const _default: {
428
428
  loadingOverlay: {
429
429
  label: string;
430
430
  };
431
+ queryDefinition: {
432
+ showMorePills: string;
433
+ showLess: string;
434
+ connectorBy: string;
435
+ connectorWhere: string;
436
+ tooltipType: string;
437
+ tooltipColumn: string;
438
+ tooltipFormula: string;
439
+ };
431
440
  measures: {
432
441
  countShort: string;
433
442
  countDistinct: string;
@@ -425,6 +425,15 @@ export declare const translation: {
425
425
  loadingOverlay: {
426
426
  label: string;
427
427
  };
428
+ queryDefinition: {
429
+ showMorePills: string;
430
+ showLess: string;
431
+ connectorBy: string;
432
+ connectorWhere: string;
433
+ tooltipType: string;
434
+ tooltipColumn: string;
435
+ tooltipFormula: string;
436
+ };
428
437
  measures: {
429
438
  countShort: string;
430
439
  countDistinct: string;