@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.
Files changed (173) hide show
  1. package/dist/ai.cjs +59 -59
  2. package/dist/ai.js +1097 -1171
  3. package/dist/analytics-composer/node.cjs +1 -1
  4. package/dist/analytics-composer/node.js +587 -616
  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-Bzt2GrgO.js} +1635 -1530
  8. package/dist/apply-styled-options-to-query-COD9fRYD.cjs +1 -0
  9. package/dist/{dimensions-C1R5YRt-.js → dimensions-Ce2zWFrs.js} +1 -1
  10. package/dist/dimensions-u3w5qNF0.cjs +1 -0
  11. package/dist/{index-Ck-0gJC9.cjs → index-BX9p-XrU.cjs} +1 -1
  12. package/dist/{index-r66Tjiqj.js → index-D7mHzfx0.js} +9 -0
  13. package/dist/index.cjs +467 -452
  14. package/dist/index.js +27214 -34168
  15. package/dist/index.umd.js +718 -706
  16. package/dist/packages/sdk-ui/src/domains/dashboarding/dashboard-model/translate-dashboard-utils.d.ts +2 -0
  17. package/dist/packages/sdk-ui/src/domains/dashboarding/dashboard-model/types.d.ts +12 -1
  18. package/dist/packages/sdk-ui/src/domains/dashboarding/dashboard-model/use-dashboard-model/dashboard-model-reducer/persist-dashboard-model-middleware.d.ts +17 -5
  19. package/dist/packages/sdk-ui/src/domains/dashboarding/dashboard-model/use-dashboard-model/dashboard-model-reducer/types.d.ts +16 -1
  20. package/dist/packages/sdk-ui/src/domains/dashboarding/dashboard-model/use-dashboard-model/dashboard-model-reducer/utils.d.ts +5 -2
  21. package/dist/packages/sdk-ui/src/domains/dashboarding/hooks/duplicate-widget/use-duplicate-widget-menu-item.d.ts +1 -1
  22. package/dist/packages/sdk-ui/src/domains/dashboarding/hooks/rename-widget/use-widget-renaming.d.ts +1 -1
  23. package/dist/packages/sdk-ui/src/domains/dashboarding/hooks/use-widget-scroll-persistence.d.ts +16 -0
  24. package/dist/packages/sdk-ui/src/domains/dashboarding/index.d.ts +2 -0
  25. package/dist/packages/sdk-ui/src/domains/dashboarding/persistence/persistence-manager.d.ts +11 -0
  26. package/dist/packages/sdk-ui/src/domains/dashboarding/persistence/types.d.ts +52 -0
  27. package/dist/packages/sdk-ui/src/domains/dashboarding/types.d.ts +5 -28
  28. package/dist/packages/sdk-ui/src/domains/dashboarding/use-composed-dashboard.d.ts +6 -5
  29. package/dist/packages/sdk-ui/src/domains/data-browser/data-source-dimensional-model/hooks/use-get-data-source-dimensions.d.ts +10 -0
  30. package/dist/packages/sdk-ui/src/domains/data-browser/data-source-dimensional-model/hooks/use-get-data-source-fields.d.ts +2 -0
  31. package/dist/packages/sdk-ui/src/domains/drilldown/components/drilldown-widget/drilldown-widget.d.ts +2 -2
  32. package/dist/packages/sdk-ui/src/domains/narrative/components/narrative-collapsible.d.ts +13 -0
  33. package/dist/packages/sdk-ui/src/domains/narrative/components/narrative-top-slot-shell.d.ts +21 -0
  34. package/dist/packages/sdk-ui/src/domains/narrative/components/widget-narrative-interactive.d.ts +11 -0
  35. package/dist/packages/sdk-ui/src/domains/narrative/components/widget-narrative.d.ts +40 -0
  36. package/dist/packages/sdk-ui/src/domains/narrative/core/build-narrative-request.d.ts +36 -0
  37. package/dist/packages/sdk-ui/src/domains/narrative/core/get-narrative-dimensions-and-measures.d.ts +22 -0
  38. package/dist/packages/sdk-ui/src/domains/narrative/core/widget-narrative-options.d.ts +29 -0
  39. package/dist/packages/sdk-ui/src/domains/narrative/core/widget-props-to-narrative-params.d.ts +36 -0
  40. package/dist/packages/sdk-ui/src/domains/narrative/hooks/use-get-widget-narrative.d.ts +62 -0
  41. package/dist/packages/sdk-ui/src/domains/narrative/hooks/use-widget-narrative-state.d.ts +39 -0
  42. package/dist/packages/sdk-ui/src/domains/query-execution/core/date-formats/simple-date-format-replacers.d.ts +13 -0
  43. package/dist/packages/sdk-ui/src/domains/query-execution/hooks/use-execute-pivot-query/use-execute-pivot-query.d.ts +2 -2
  44. package/dist/packages/sdk-ui/src/domains/query-execution/hooks/use-execute-query/use-execute-query.d.ts +2 -2
  45. package/dist/packages/sdk-ui/src/domains/visualizations/components/area-chart.d.ts +2 -2
  46. package/dist/packages/sdk-ui/src/domains/visualizations/components/areamap-chart.d.ts +2 -2
  47. package/dist/packages/sdk-ui/src/domains/visualizations/components/bar-chart.d.ts +2 -2
  48. package/dist/packages/sdk-ui/src/domains/visualizations/components/boxplot-chart/boxplot-chart.d.ts +2 -2
  49. package/dist/packages/sdk-ui/src/domains/visualizations/components/chart/chart.d.ts +2 -2
  50. package/dist/packages/sdk-ui/src/domains/visualizations/components/chart/restructured-charts/highchart-based-charts/cartesians/helpers/highchart-options/axis.d.ts +1 -1
  51. package/dist/packages/sdk-ui/src/domains/visualizations/components/column-chart.d.ts +2 -2
  52. package/dist/packages/sdk-ui/src/domains/visualizations/components/funnel-chart.d.ts +2 -2
  53. package/dist/packages/sdk-ui/src/domains/visualizations/components/line-chart.d.ts +2 -2
  54. package/dist/packages/sdk-ui/src/domains/visualizations/components/pie-chart/pie-chart.d.ts +2 -2
  55. package/dist/packages/sdk-ui/src/domains/visualizations/components/polar-chart.d.ts +2 -2
  56. package/dist/packages/sdk-ui/src/domains/visualizations/components/scatter-chart.d.ts +2 -2
  57. package/dist/packages/sdk-ui/src/domains/visualizations/components/scattermap-chart.d.ts +2 -2
  58. package/dist/packages/sdk-ui/src/domains/visualizations/components/sunburst-chart/sunburst-chart.d.ts +2 -2
  59. package/dist/packages/sdk-ui/src/domains/visualizations/components/table/table.d.ts +2 -2
  60. package/dist/packages/sdk-ui/src/domains/visualizations/components/treemap-chart/treemap-chart.d.ts +2 -2
  61. package/dist/packages/sdk-ui/src/domains/visualizations/core/chart-data-options/apply-styled-options-to-query.d.ts +87 -0
  62. package/dist/packages/sdk-ui/src/domains/visualizations/core/chart-data-options/translate-data-options.d.ts +13 -1
  63. package/dist/packages/sdk-ui/src/domains/visualizations/core/chart-data-options/types.d.ts +6 -6
  64. package/dist/packages/sdk-ui/src/domains/visualizations/core/chart-options-processor/cartesian/utils/axis/axis-builders.d.ts +6 -1
  65. package/dist/packages/sdk-ui/src/domains/visualizations/core/chart-options-processor/plot-bands.d.ts +2 -1
  66. package/dist/packages/sdk-ui/src/domains/visualizations/core/chart-options-processor/translations/axis-section.d.ts +29 -1
  67. package/dist/packages/sdk-ui/src/domains/visualizations/core/chart-options-processor/translations/design-options.d.ts +1 -0
  68. package/dist/packages/sdk-ui/src/domains/visualizations/core/chart-options-processor/translations/tooltip-utils.d.ts +1 -1
  69. package/dist/packages/sdk-ui/src/domains/visualizations/core/query-definition/compose-code-to-readable.d.ts +32 -0
  70. package/dist/packages/sdk-ui/src/domains/visualizations/core/query-definition/index.d.ts +9 -0
  71. package/dist/packages/sdk-ui/src/domains/visualizations/core/query-definition/query-definition.d.ts +26 -0
  72. package/dist/packages/sdk-ui/src/domains/visualizations/core/query-definition/query-params-to-view-model.d.ts +16 -0
  73. package/dist/packages/sdk-ui/src/domains/visualizations/core/query-definition/query-pill-bubble-tooltip.d.ts +12 -0
  74. package/dist/packages/sdk-ui/src/domains/visualizations/core/query-definition/query-pill.d.ts +18 -0
  75. package/dist/packages/sdk-ui/src/domains/visualizations/core/query-definition/types.d.ts +51 -0
  76. package/dist/packages/sdk-ui/src/domains/widgets/components/widget-by-id/translate-widget-style-options/to-widget-dto-style.d.ts +166 -2
  77. package/dist/packages/sdk-ui/src/domains/widgets/components/widget-by-id/types.d.ts +18 -0
  78. package/dist/packages/sdk-ui/src/domains/widgets/components/widget-by-id/use-scroller-location-save.d.ts +8 -0
  79. package/dist/packages/sdk-ui/src/domains/widgets/components/widget-by-id/utils.d.ts +9 -0
  80. package/dist/packages/sdk-ui/src/domains/widgets/components/widget-by-id/widget-by-id.d.ts +2 -2
  81. package/dist/packages/sdk-ui/src/domains/widgets/components/widget-by-id/with-navigator-scroll-save.d.ts +10 -0
  82. package/dist/packages/sdk-ui/src/domains/widgets/widget-model/use-get-widget-model.d.ts +2 -2
  83. package/dist/packages/sdk-ui/src/domains/widgets/widget-model/widget-model-translator/to-widget-dto-panels.d.ts +170 -0
  84. package/dist/packages/sdk-ui/src/domains/widgets/widget-model/widget-model-translator/utils.d.ts +9 -0
  85. package/dist/packages/sdk-ui/src/domains/widgets/widget-model/widget-model-translator/widget-model-translator.d.ts +13 -16
  86. package/dist/packages/sdk-ui/src/infra/api/narrative/narrative-api-types.d.ts +32 -0
  87. package/dist/packages/sdk-ui/src/infra/api/narrative/narrative-constants.d.ts +6 -0
  88. package/dist/packages/sdk-ui/src/infra/api/narrative/narrative-endpoints.d.ts +26 -0
  89. package/dist/packages/sdk-ui/src/infra/api/narrative/send-ai-feedback.d.ts +8 -0
  90. package/dist/packages/sdk-ui/src/infra/api/rest-api.d.ts +12 -1
  91. package/dist/packages/sdk-ui/src/infra/app/settings/settings.d.ts +10 -2
  92. package/dist/packages/sdk-ui/src/infra/contexts/custom-widgets-provider/use-custom-widgets.d.ts +10 -3
  93. package/dist/packages/sdk-ui/src/infra/contexts/emotion-cache-provider/emotion-cache-provider.d.ts +31 -3
  94. package/dist/packages/sdk-ui/src/infra/contexts/emotion-cache-provider/stylis-plugins/css-selector-prefix-plugin.d.ts +18 -0
  95. package/dist/packages/sdk-ui/src/infra/plugins/plugin-context.d.ts +2 -2
  96. package/dist/packages/sdk-ui/src/infra/plugins/types.d.ts +2 -2
  97. package/dist/packages/sdk-ui/src/infra/plugins/widget-plugins/types.d.ts +9 -0
  98. package/dist/packages/sdk-ui/src/infra/translation/resources/__external__/de-de.d.ts +9 -0
  99. package/dist/packages/sdk-ui/src/infra/translation/resources/__external__/en-us.d.ts +9 -0
  100. package/dist/packages/sdk-ui/src/infra/translation/resources/__external__/es-ar.d.ts +9 -0
  101. package/dist/packages/sdk-ui/src/infra/translation/resources/__external__/es-es.d.ts +9 -0
  102. package/dist/packages/sdk-ui/src/infra/translation/resources/__external__/fr-fr.d.ts +9 -0
  103. package/dist/packages/sdk-ui/src/infra/translation/resources/__external__/it-it.d.ts +9 -0
  104. package/dist/packages/sdk-ui/src/infra/translation/resources/__external__/ja-jp.d.ts +9 -0
  105. package/dist/packages/sdk-ui/src/infra/translation/resources/__external__/ko-kr.d.ts +9 -0
  106. package/dist/packages/sdk-ui/src/infra/translation/resources/__external__/nl-nl.d.ts +9 -0
  107. package/dist/packages/sdk-ui/src/infra/translation/resources/__external__/pt-br.d.ts +9 -0
  108. package/dist/packages/sdk-ui/src/infra/translation/resources/__external__/ru-ru.d.ts +9 -0
  109. package/dist/packages/sdk-ui/src/infra/translation/resources/__external__/tr-tr.d.ts +9 -0
  110. package/dist/packages/sdk-ui/src/infra/translation/resources/__external__/zh-cn.d.ts +9 -0
  111. package/dist/packages/sdk-ui/src/infra/translation/resources/en.d.ts +9 -0
  112. package/dist/packages/sdk-ui/src/infra/translation/resources/index.d.ts +18 -0
  113. package/dist/packages/sdk-ui/src/modules/ai/api/chat-rest-api.d.ts +3 -4
  114. package/dist/packages/sdk-ui/src/modules/ai/api/types.d.ts +5 -18
  115. package/dist/packages/sdk-ui/src/modules/ai/chart/nlq-chart-widget.d.ts +2 -0
  116. package/dist/packages/sdk-ui/src/modules/ai/common/collapsible.d.ts +3 -0
  117. package/dist/packages/sdk-ui/src/modules/ai/get-nlg-insights-from-widget.d.ts +5 -13
  118. package/dist/packages/sdk-ui/src/modules/ai/index.d.ts +2 -1
  119. package/dist/packages/sdk-ui/src/modules/ai/use-get-nlg-insights.d.ts +4 -26
  120. package/dist/packages/sdk-ui/src/modules/analytics-composer/nlq-v3-translator/types.d.ts +3 -7
  121. package/dist/packages/sdk-ui/src/props.d.ts +1 -1
  122. package/dist/packages/sdk-ui/src/public-api/internal.d.ts +1 -1
  123. package/dist/packages/sdk-ui/src/public-api/sisense-internal.d.ts +7 -1
  124. package/dist/packages/sdk-ui/src/shared/utils/filter-relations.d.ts +2 -0
  125. package/dist/packages/sdk-ui/src/types.d.ts +8 -8
  126. package/dist/translations/de-de.cjs +1 -1
  127. package/dist/translations/de-de.js +10 -1
  128. package/dist/translations/en-us.cjs +1 -1
  129. package/dist/translations/en-us.js +1 -1
  130. package/dist/translations/es-ar.cjs +1 -1
  131. package/dist/translations/es-ar.js +10 -1
  132. package/dist/translations/es-es.cjs +1 -1
  133. package/dist/translations/es-es.js +10 -1
  134. package/dist/translations/fr-fr.cjs +1 -1
  135. package/dist/translations/fr-fr.js +10 -1
  136. package/dist/translations/it-it.cjs +1 -1
  137. package/dist/translations/it-it.js +12 -3
  138. package/dist/translations/ja-jp.cjs +1 -1
  139. package/dist/translations/ja-jp.js +12 -3
  140. package/dist/translations/ko-kr.cjs +1 -1
  141. package/dist/translations/ko-kr.js +12 -3
  142. package/dist/translations/nl-nl.cjs +1 -1
  143. package/dist/translations/nl-nl.js +12 -3
  144. package/dist/translations/pt-br.cjs +1 -1
  145. package/dist/translations/pt-br.js +10 -1
  146. package/dist/translations/ru-ru.cjs +1 -1
  147. package/dist/translations/ru-ru.js +12 -3
  148. package/dist/translations/tr-tr.cjs +1 -1
  149. package/dist/translations/tr-tr.js +10 -1
  150. package/dist/translations/zh-cn.cjs +1 -1
  151. package/dist/translations/zh-cn.js +12 -3
  152. package/dist/types-COBvZZm_.cjs +1 -0
  153. package/dist/{types-DJtC8_5_.js → types-D6jCGncV.js} +1 -1
  154. package/dist/{quota-notification-CeKnEyQG.js → use-hover-B1HPf4hF.js} +27827 -19390
  155. package/dist/use-hover-CaQrW_gv.cjs +721 -0
  156. package/dist/{utils-BCp2ISWh.js → utils-BQtueE3Z.js} +13632 -13251
  157. package/dist/utils-CAubp1g1.cjs +179 -0
  158. package/dist/{widget-composer-CDNL9_XF.js → widget-composer-BAJFWk3t.js} +3 -3
  159. package/dist/{widget-composer-BkHZISs7.cjs → widget-composer-C75b-E6W.cjs} +1 -1
  160. package/package.json +11 -10
  161. package/dist/dimensions-C7yXAoZs.cjs +0 -1
  162. package/dist/execute-query-0Y9Fn9Pf.cjs +0 -1
  163. package/dist/packages/sdk-ui/src/domains/widgets/components/table-widget/index.d.ts +0 -2
  164. package/dist/packages/sdk-ui/src/domains/widgets/components/table-widget/table-widget.d.ts +0 -22
  165. package/dist/packages/sdk-ui/src/domains/widgets/components/table-widget/types.d.ts +0 -61
  166. package/dist/packages/sdk-ui/src/infra/styled/index.d.ts +0 -4
  167. package/dist/packages/sdk-ui/src/infra/styled/with-css-selector-prefix.d.ts +0 -2
  168. package/dist/packages/sdk-ui/src/modules/ai/api/narration-endpoints.d.ts +0 -25
  169. package/dist/packages/sdk-ui/src/modules/analytics-composer/nlq-v3-translator/query/constants.d.ts +0 -8
  170. package/dist/packages/sdk-ui/src/modules/analytics-composer/nlq-v3-translator/shared/utils/parse-compose-code.d.ts +0 -34
  171. package/dist/quota-notification-BqRYSJ7r.cjs +0 -713
  172. package/dist/types-C0QU2tsE.cjs +0 -1
  173. package/dist/utils-D8O1_kl3.cjs +0 -190
@@ -0,0 +1,26 @@
1
+ import type { HttpClient } from '@sisense/sdk-rest-client';
2
+ import type { NarrativeRequest, NarrativeResponse } from './narrative-api-types.js';
3
+ /** Unified narrative endpoint. Try first; fall back to legacy on 404. */
4
+ export declare const UNIFIED_NARRATIVE_ENDPOINT = "api/v2/ai/narrative";
5
+ /** Legacy endpoint (used when unified narrative returns 404). */
6
+ export declare const LEGACY_NARRATIVE_ENDPOINT = "api/v2/ai/nlg/queryResult";
7
+ /**
8
+ * Options for getNarrative. All endpoint choice logic lives in this module.
9
+ *
10
+ * @internal
11
+ */
12
+ export type GetNarrativeOptions = {
13
+ isUnified?: boolean;
14
+ isSisenseAiEnabled?: boolean;
15
+ };
16
+ /**
17
+ * Fetches Narrative. Single place for endpoint logic: `isUnified === false` → legacy only;
18
+ * otherwise try unified endpoint first, fall back to legacy on 404.
19
+ *
20
+ * @param httpClient - HttpClient instance
21
+ * @param request - Narration request payload
22
+ * @param options - Optional; `isUnified` / `isSisenseAiEnabled` (e.g. from `app.settings.narrative`)
23
+ * @returns Promise with narration response
24
+ * @internal
25
+ */
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>;
@@ -6,6 +6,17 @@ import { PaletteDto } from '../../infra/api/types/palette-dto';
6
6
  import { HierarchyDto, SharedFormulaDto, WidgetDto } from '../../domains/widgets/components/widget-by-id/types';
7
7
  import { TranslatableError } from '../translation/translatable-error';
8
8
  import type { DashboardDto } from './types/dashboard-dto';
9
+ /** PATCH body for persisting Highcharts navigator scroller bounds on a dashboard widget. */
10
+ export type WidgetDashboardScrollerLocationPatch = {
11
+ options: Partial<NonNullable<WidgetDto['options']>> & {
12
+ previousScrollerLocation: {
13
+ min: number;
14
+ max: number;
15
+ };
16
+ };
17
+ };
18
+ /** Supported PATCH bodies for `RestApi.patchWidgetInDashboard`. */
19
+ export type PatchWidgetInDashboardBody = Partial<Pick<WidgetDto, 'title'>> | WidgetDashboardScrollerLocationPatch;
9
20
  type GetDashboardsOptions = {
10
21
  searchByTitle?: string;
11
22
  fields?: string[];
@@ -84,7 +95,7 @@ export declare class RestApi {
84
95
  /**
85
96
  * Partially update a widget in a dashboard.
86
97
  */
87
- patchWidgetInDashboard: (dashboardOid: string, widgetOid: string, patch: Partial<Pick<WidgetDto, 'title'>>, sharedMode?: boolean) => Promise<WidgetDto | undefined>;
98
+ patchWidgetInDashboard: (dashboardOid: string, widgetOid: string, patch: PatchWidgetInDashboardBody, sharedMode?: boolean) => Promise<WidgetDto | undefined>;
88
99
  /**
89
100
  * Get shared formulas by ids
90
101
  *
@@ -13,6 +13,7 @@ export type AppSettings = Required<ConfigurableAppSettings> & ServerSettings;
13
13
  type ConfigurableAppSettings = AppConfig;
14
14
  /**
15
15
  * User role permissions
16
+ *
16
17
  * @internal
17
18
  */
18
19
  type RoleManifest = {
@@ -63,14 +64,21 @@ type ServerSettings = {
63
64
  serverLanguage: string;
64
65
  serverVersion: string;
65
66
  serverFeatures: FeatureMap;
66
- isUnifiedNarrationEnabled?: boolean;
67
- isSisenseAiEnabled?: boolean;
67
+ narrative: {
68
+ /** From `api/v2/settings/ai` narration.enabled */
69
+ isEnabled: boolean;
70
+ /** From globals.props.narrationUnified */
71
+ isUnified: boolean;
72
+ /** Computed: unlimited (API sisenseAIEnabled or props) or credit-based narratives */
73
+ isSisenseAiEnabled: boolean;
74
+ };
68
75
  user: {
69
76
  tenant: {
70
77
  name: string;
71
78
  };
72
79
  /**
73
80
  * User role permissions
81
+ *
74
82
  * @internal
75
83
  */
76
84
  permissions: RoleManifest;
@@ -5,17 +5,22 @@ import { CustomWidgetComponent, CustomWidgetComponentProps } from './types';
5
5
  * @example
6
6
  * Example of registering a custom widget in a dashboard:
7
7
  * ```tsx
8
+ * import { useEffect } from 'react';
8
9
  * import { useCustomWidgets, DashboardById } from '@sisense/sdk-ui';
9
10
  * import CustomHistogramWidget from './custom-histogram-widget';
10
11
  *
11
12
  * const Example = () => {
12
- * const { registerCustomWidget } = useCustomWidgets();
13
- * registerCustomWidget('histogramwidget', CustomHistogramWidget);
13
+ * const { registerCustomWidget, unregisterCustomWidget } = useCustomWidgets();
14
+ *
15
+ * useEffect(() => {
16
+ * registerCustomWidget('histogramwidget', CustomHistogramWidget);
17
+ * // Optionally unregister on unmount (e.g. if the widget should only be available within this component)
18
+ * return () => unregisterCustomWidget('histogramwidget');
19
+ * }, [registerCustomWidget, unregisterCustomWidget]);
14
20
  *
15
21
  * return <DashboardById dashboardOid="your-dashboard-oid" />;
16
22
  * }
17
23
  * ```
18
- *
19
24
  * @group Dashboards
20
25
  */
21
26
  export declare const useCustomWidgets: () => UseCustomWidgetsResult;
@@ -25,6 +30,8 @@ export declare const useCustomWidgets: () => UseCustomWidgetsResult;
25
30
  export type UseCustomWidgetsResult = {
26
31
  /** Registers a custom widget. */
27
32
  registerCustomWidget: <T = CustomWidgetComponentProps>(customWidgetType: string, customWidget: CustomWidgetComponent<T>) => void;
33
+ /** Unregisters a legacy custom widget for the given type name. */
34
+ unregisterCustomWidget: (customWidgetType: string) => void;
28
35
  /** Checks if a custom widget is registered. */
29
36
  hasCustomWidget: (customWidgetType: string) => boolean;
30
37
  /** Gets a custom widget. */
@@ -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;
@@ -1,5 +1,5 @@
1
1
  /// <reference types="react" />
2
- import { WidgetPlugin } from './widget-plugins/types.js';
2
+ import type { AnyWidgetPlugin } from './widget-plugins/types.js';
3
3
  import type { WidgetPluginRegistry } from './widget-plugins/widget-plugin-registry.js';
4
4
  /**
5
5
  * Context for accessing registered plugins
@@ -10,7 +10,7 @@ export interface PluginContextValue {
10
10
  /**
11
11
  * Validated widget plugin declarations (metadata)
12
12
  */
13
- widgetPlugins: readonly WidgetPlugin[];
13
+ widgetPlugins: readonly AnyWidgetPlugin[];
14
14
  /**
15
15
  * Central widget component registry (used for lookup and legacy bridge)
16
16
  */
@@ -1,4 +1,4 @@
1
- import type { WidgetPlugin } from './widget-plugins/types.js';
1
+ import type { AnyWidgetPlugin } from './widget-plugins/types.js';
2
2
  /**
3
3
  * Base plugin information
4
4
  *
@@ -55,4 +55,4 @@ export interface PluginValidationResult {
55
55
  *
56
56
  * @sisenseInternal
57
57
  */
58
- export type Plugin = WidgetPlugin;
58
+ export type Plugin = AnyWidgetPlugin;
@@ -131,6 +131,15 @@ export interface WidgetPlugin<Props = CustomVisualizationProps, StyleOptions = C
131
131
  };
132
132
  };
133
133
  }
134
+ /**
135
+ * Any Widget plugin declaration
136
+ * Represents heterogeneous widget plugin declarations at registry/context boundaries.
137
+ * Generic params are intentionally erased because each plugin can define distinct props/style types.
138
+ * Do not consume component prop types from this alias directly.
139
+ *
140
+ * @sisenseInternal
141
+ */
142
+ export type AnyWidgetPlugin = WidgetPlugin<any, any>;
134
143
  /**
135
144
  * Props passed to a user-defined custom visualization component.
136
145
  *
@@ -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;
@@ -435,6 +435,15 @@ export declare const resources: {
435
435
  loadingOverlay: {
436
436
  label: string;
437
437
  };
438
+ queryDefinition: {
439
+ showMorePills: string;
440
+ showLess: string;
441
+ connectorBy: string;
442
+ connectorWhere: string;
443
+ tooltipType: string;
444
+ tooltipColumn: string;
445
+ tooltipFormula: string;
446
+ };
438
447
  measures: {
439
448
  countShort: string;
440
449
  countDistinct: string;
@@ -875,6 +884,15 @@ export declare const resources: {
875
884
  loadingOverlay: {
876
885
  label: string;
877
886
  };
887
+ queryDefinition: {
888
+ showMorePills: string;
889
+ showLess: string;
890
+ connectorBy: string;
891
+ connectorWhere: string;
892
+ tooltipType: string;
893
+ tooltipColumn: string;
894
+ tooltipFormula: string;
895
+ };
878
896
  measures: {
879
897
  countShort: string;
880
898
  countDistinct: string;
@@ -1,13 +1,12 @@
1
1
  import { HttpClient } from '@sisense/sdk-rest-client';
2
+ import { type GetNarrativeOptions } from '../../../infra/api/narrative/narrative-endpoints.js';
2
3
  import { ChatContextDetails } from '../../../modules/ai/api/types';
3
4
  import type { Chat, ChatContext, ChatRequest, ChatResponse, ChatWithoutHistory, GetNlgInsightsRequest, GetNlqResultRequest, LlmConfig, NlqResult, QueryRecommendationConfig, QueryRecommendationResponse, SendFeedbackRequest } from './types';
4
5
  /** @internal */
5
6
  export declare class ChatRestApi {
6
7
  private readonly volatile;
7
8
  private httpClient;
8
- private readonly isUnifiedNarrationEnabled;
9
- private readonly isSisenseAiEnabled;
10
- constructor(httpClient: HttpClient, volatile?: boolean, isUnifiedNarrationEnabled?: boolean, isSisenseAiEnabled?: boolean);
9
+ constructor(httpClient: HttpClient, volatile?: boolean);
11
10
  getChatContexts: () => Promise<ChatContext[]>;
12
11
  private getNlgInsights;
13
12
  private getQueryRecommendations;
@@ -20,7 +19,7 @@ export declare class ChatRestApi {
20
19
  private deleteChatHistory;
21
20
  private sendFeedback;
22
21
  ai: {
23
- getNlgInsights: (request: GetNlgInsightsRequest) => Promise<import('../../../modules/ai/api/types').GetNlgInsightsResponse>;
22
+ getNlgInsights: (request: GetNlgInsightsRequest, options?: GetNarrativeOptions) => Promise<import("../../../infra/api/narrative/narrative-api-types").NarrativeResponse>;
24
23
  getNlqResult: (contextTitle: string, request: GetNlqResultRequest) => Promise<NlqResult | undefined>;
25
24
  getQueryRecommendations: (contextTitle: string, config: QueryRecommendationConfig) => Promise<QueryRecommendationResponse | undefined>;
26
25
  setLlmConfig: (config: LlmConfig) => Promise<unknown>;
@@ -1,5 +1,5 @@
1
- import { JaqlQueryPayload } from '@sisense/sdk-query-client';
2
1
  import { WidgetProps } from '../../../domains/widgets/components/widget/types';
2
+ import type { GetNlgInsightsResponse as GetNlgInsightsResponseInfra, SendAiFeedbackRequest } from '../../../infra/api/narrative/narrative-api-types.js';
3
3
  import { ExpandedQueryModel } from '../../../modules/analytics-composer';
4
4
  export interface ChatContext {
5
5
  title: string;
@@ -102,17 +102,9 @@ export type NlqResult = Omit<NlqResponseData, 'followupQuestions'>;
102
102
  export interface QueryRecommendation extends Omit<NlqResponseData, 'followupQuestions'> {
103
103
  }
104
104
  export type QueryRecommendationResponse = QueryRecommendation[];
105
- export interface GetNlgInsightsRequest {
106
- jaql: Pick<JaqlQueryPayload, 'datasource' | 'metadata' | 'filterRelations'>;
107
- verbosity?: 'Low' | 'High';
108
- }
105
+ export type { GetNlgInsightsRequest } from '../../../infra/api/narrative/narrative-api-types.js';
109
106
  /** @internal */
110
- export interface GetNlgInsightsResponse {
111
- data?: {
112
- answer: string;
113
- };
114
- responseType: 'Text';
115
- }
107
+ export type GetNlgInsightsResponse = GetNlgInsightsResponseInfra;
116
108
  /** @internal */
117
109
  export declare const NLQ_RESULT_CHART_TYPES: readonly ["indicator", "column", "line", "table", "pie", "bar"];
118
110
  /** NLQ result chart types @expandType */
@@ -122,12 +114,8 @@ export interface GetNlqResultRequest {
122
114
  timezone?: string;
123
115
  chartTypes: NlqResultChartType[];
124
116
  }
125
- export interface SendFeedbackRequest {
126
- type: string;
127
- data: object;
128
- sourceId: string;
129
- rating: -1 | 1;
130
- }
117
+ /** @internal */
118
+ export type SendFeedbackRequest = SendAiFeedbackRequest;
131
119
  /**
132
120
  * The chat mode to use for a chat session
133
121
  *
@@ -135,4 +123,3 @@ export interface SendFeedbackRequest {
135
123
  * develop: Enable developers to build queries and charts for embedded analytics
136
124
  */
137
125
  export type ChatMode = 'analyze' | 'develop';
138
- export {};
@@ -40,6 +40,8 @@ export interface NlqChartWidgetProps {
40
40
  /**
41
41
  * React component that renders a chart widget based on NLQ response data.
42
42
  *
43
+ * @deprecated Prefer composing `ChartWidget` with `WidgetNarrative` when using `WidgetProps` for new embeds.
44
+ *
43
45
  * @example
44
46
  * ```tsx
45
47
  * import { NlqChartWidget, NlqResponseData } from '@sisense/sdk-ui/ai';
@@ -4,6 +4,9 @@ type CollapsibleProps = {
4
4
  /**
5
5
  * Text container with an expand/collapse button for text over the character limit.
6
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
+ *
7
10
  * @internal
8
11
  */
9
12
  export default function Collapsible({ text }: CollapsibleProps): import("react/jsx-runtime").JSX.Element;
@@ -1,31 +1,23 @@
1
- import { DataSource } from '@sisense/sdk-data';
2
1
  import { HttpClient } from '@sisense/sdk-rest-client';
2
+ import type { WidgetNarrativeNlgOptions } from '../../domains/narrative/core/widget-narrative-options.js';
3
3
  import { WidgetProps } from '../../domains/widgets/components/widget/types';
4
4
  /**
5
5
  * Options for {@link getNlgInsightsFromWidget} function.
6
+ *
6
7
  * @internal
7
8
  */
8
- export interface GetNlgInsightsFromWidgetOptions {
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. From props.isUnifiedNarrationEnabled. */
14
- isUnifiedNarrationEnabled?: boolean;
15
- isSisenseAiEnabled?: boolean;
16
- }
9
+ export type GetNlgInsightsFromWidgetOptions = WidgetNarrativeNlgOptions;
17
10
  /**
18
11
  * Pure function that fetches NLG insights from WidgetProps.
19
12
  *
20
13
  * This function converts WidgetProps to the required API format and makes an HTTP request
21
- * to get natural language insights about the chart data.
14
+ * to get natural language insights about the chart or pivot data.
22
15
  *
23
- * @param props - WidgetProps containing chart configuration
16
+ * @param props - WidgetProps containing chart or pivot configuration
24
17
  * @param httpClient - HttpClient instance for making API requests
25
18
  * @param options - Optional configuration including defaultDataSource and verbosity
26
19
  * @returns Promise that resolves to the NLG insights answer string
27
20
  * @throws Error if dataSource cannot be resolved or if API response is invalid
28
- *
29
21
  * @example
30
22
  * ```typescript
31
23
  * import { getNlgInsightsFromWidget } from '@sisense/sdk-ui/ai';
@@ -12,7 +12,8 @@ export { Chatbot, type ChatbotProps } from './chatbot.js';
12
12
  export { default as GetNlgInsights, type GetNlgInsightsProps } from './get-nlg-insights.js';
13
13
  export { NlqChartWidget, type NlqChartWidgetProps } from './chart/nlq-chart-widget.js';
14
14
  export { ChatRestApi } from './api/chat-rest-api.js';
15
+ export type { GetNarrativeOptions } from '../../infra/api/narrative/narrative-endpoints.js';
15
16
  export { CustomAiContextProvider, type CustomAiContext, type CustomAiContextProviderProps, } from './custom-ai-context-provider.js';
16
- export { prepareGetNlgInsightsPayload } from './use-get-nlg-insights.js';
17
+ export { prepareGetNlgInsightsPayload } from '../../domains/narrative/core/build-narrative-request.js';
17
18
  export { getNlgInsightsFromWidget, type GetNlgInsightsFromWidgetOptions, } from './get-nlg-insights-from-widget.js';
18
19
  export { widgetComposer } from '../../modules/analytics-composer';