@sisense/sdk-ui 2.23.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.
- package/dist/ai.cjs +59 -59
- package/dist/ai.js +919 -980
- package/dist/analytics-composer/node.cjs +1 -1
- package/dist/analytics-composer/node.js +1232 -1220
- package/dist/analytics-composer.cjs +1 -1
- package/dist/analytics-composer.js +6 -6
- package/dist/{execute-query-CHYTupEo.js → apply-styled-options-to-query-BsBTwL6W.js} +1522 -1447
- package/dist/apply-styled-options-to-query-mFJvsssw.cjs +1 -0
- package/dist/{index-Dx6wvLd3.cjs → index-BX9p-XrU.cjs} +1 -1
- package/dist/{index-DCAC0mJe.js → index-D7mHzfx0.js} +30 -1
- package/dist/index.cjs +731 -712
- package/dist/index.js +26018 -33110
- package/dist/index.umd.js +985 -958
- package/dist/packages/sdk-ui/src/domains/dashboarding/dashboard-model/types.d.ts +1 -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 +4 -1
- 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-csv-download.d.ts +24 -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 +25 -28
- package/dist/packages/sdk-ui/src/domains/dashboarding/use-composed-dashboard.d.ts +4 -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 +28 -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/visualizations/components/chart/helpers/use-translated-data-options.d.ts +12 -1
- 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/query-definition/compose-code-to-readable.d.ts +12 -0
- package/dist/packages/sdk-ui/src/domains/visualizations/core/query-definition/index.d.ts +6 -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 +12 -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 +13 -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/chart-widget/use-chart-widget-csv-download.d.ts +18 -0
- package/dist/packages/sdk-ui/src/domains/widgets/components/custom-widget/use-custom-widget-csv-download.d.ts +15 -0
- package/dist/packages/sdk-ui/src/domains/widgets/components/pivot-table-widget/use-pivot-widget-csv-download.d.ts +18 -0
- package/dist/packages/sdk-ui/src/domains/widgets/components/tabber-buttons-widget/types.d.ts +8 -8
- package/dist/packages/sdk-ui/src/domains/widgets/components/widget/types.d.ts +21 -1
- package/dist/packages/sdk-ui/src/domains/widgets/components/widget-by-id/translate-widget-style-options/to-widget-dto-style.d.ts +59 -2
- package/dist/packages/sdk-ui/src/domains/widgets/hooks/use-csv-query-file-loader.d.ts +16 -0
- package/dist/packages/sdk-ui/src/domains/widgets/hooks/use-with-csv-download-menu-item.d.ts +22 -0
- package/dist/packages/sdk-ui/src/domains/widgets/shared/widget-header/widget-menu-button.d.ts +1 -1
- 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 +5 -2
- 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/{modules/ai/api/narration-endpoints.d.ts → infra/api/narrative/narrative-endpoints.d.ts} +8 -7
- package/dist/packages/sdk-ui/src/infra/api/narrative/send-ai-feedback.d.ts +8 -0
- package/dist/packages/sdk-ui/src/infra/app/client-application.d.ts +2 -2
- package/dist/packages/sdk-ui/src/infra/contexts/custom-widgets-provider/custom-widgets-provider-adapter.d.ts +2 -1
- package/dist/packages/sdk-ui/src/infra/contexts/custom-widgets-provider/use-custom-widgets.d.ts +11 -4
- 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/custom-plugin-context-provider.d.ts +18 -0
- package/dist/packages/sdk-ui/src/infra/plugins/plugin-context.d.ts +29 -0
- package/dist/packages/sdk-ui/src/infra/{contexts/plugin-provider → plugins}/plugin-provider.d.ts +4 -2
- package/dist/packages/sdk-ui/src/infra/{contexts/plugin-provider → plugins}/types.d.ts +12 -4
- package/dist/packages/sdk-ui/src/infra/plugins/use-widget-plugin-registry.d.ts +7 -0
- package/dist/packages/sdk-ui/src/infra/{contexts/plugin-provider → plugins}/validate-plugins.d.ts +1 -1
- package/dist/packages/sdk-ui/src/infra/plugins/widget-plugins/types.d.ts +302 -0
- package/dist/packages/sdk-ui/src/infra/plugins/widget-plugins/widget-plugin-registry.d.ts +33 -0
- package/dist/packages/sdk-ui/src/infra/translation/resources/__external__/de-de.d.ts +29 -0
- package/dist/packages/sdk-ui/src/infra/translation/resources/__external__/en-us.d.ts +29 -0
- package/dist/packages/sdk-ui/src/infra/translation/resources/__external__/es-ar.d.ts +29 -0
- package/dist/packages/sdk-ui/src/infra/translation/resources/__external__/es-es.d.ts +29 -0
- package/dist/packages/sdk-ui/src/infra/translation/resources/__external__/fr-fr.d.ts +29 -0
- package/dist/packages/sdk-ui/src/infra/translation/resources/__external__/it-it.d.ts +29 -0
- package/dist/packages/sdk-ui/src/infra/translation/resources/__external__/ja-jp.d.ts +29 -0
- package/dist/packages/sdk-ui/src/infra/translation/resources/__external__/ko-kr.d.ts +29 -0
- package/dist/packages/sdk-ui/src/infra/translation/resources/__external__/nl-nl.d.ts +29 -0
- package/dist/packages/sdk-ui/src/infra/translation/resources/__external__/pt-br.d.ts +29 -0
- package/dist/packages/sdk-ui/src/infra/translation/resources/__external__/ru-ru.d.ts +29 -0
- package/dist/packages/sdk-ui/src/infra/translation/resources/__external__/tr-tr.d.ts +29 -0
- package/dist/packages/sdk-ui/src/infra/translation/resources/__external__/zh-cn.d.ts +29 -0
- package/dist/packages/sdk-ui/src/infra/translation/resources/en.d.ts +29 -0
- package/dist/packages/sdk-ui/src/infra/translation/resources/index.d.ts +58 -0
- package/dist/packages/sdk-ui/src/modules/ai/api/chat-rest-api.d.ts +1 -1
- 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 +1 -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/shared/expression/custom-formula/validate-custom-formula.d.ts +15 -3
- package/dist/packages/sdk-ui/src/modules/analytics-composer/nlq-v3-translator/shared/expression/formula-function-schemas.d.ts +22 -6
- package/dist/packages/sdk-ui/src/modules/analytics-composer/nlq-v3-translator/shared/utils/schema-index.d.ts +5 -2
- 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 +20 -2
- package/dist/packages/sdk-ui/src/public-api/internal.d.ts +2 -0
- package/dist/packages/sdk-ui/src/public-api/public.d.ts +1 -1
- package/dist/packages/sdk-ui/src/public-api/sisense-internal.d.ts +9 -1
- package/dist/packages/sdk-ui/src/shared/const.d.ts +5 -0
- package/dist/packages/sdk-ui/src/shared/types/menu-item.d.ts +5 -1
- package/dist/packages/sdk-ui/src/shared/utils/menu-item-converters.d.ts +12 -0
- package/dist/packages/sdk-ui/src/types.d.ts +1 -1
- package/dist/parse-compose-code-DfZskSng.js +352 -0
- package/dist/parse-compose-code-v4J9BrUg.cjs +1 -0
- package/dist/translations/de-de.cjs +1 -1
- package/dist/translations/de-de.js +31 -2
- 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 +31 -2
- package/dist/translations/es-es.cjs +1 -1
- package/dist/translations/es-es.js +31 -2
- package/dist/translations/fr-fr.cjs +1 -1
- package/dist/translations/fr-fr.js +31 -2
- package/dist/translations/it-it.cjs +1 -1
- package/dist/translations/it-it.js +31 -2
- package/dist/translations/ja-jp.cjs +1 -1
- package/dist/translations/ja-jp.js +31 -2
- package/dist/translations/ko-kr.cjs +1 -1
- package/dist/translations/ko-kr.js +31 -2
- package/dist/translations/nl-nl.cjs +1 -1
- package/dist/translations/nl-nl.js +31 -2
- package/dist/translations/pt-br.cjs +1 -1
- package/dist/translations/pt-br.js +31 -2
- package/dist/translations/ru-ru.cjs +1 -1
- package/dist/translations/ru-ru.js +31 -2
- package/dist/translations/tr-tr.cjs +1 -1
- package/dist/translations/tr-tr.js +31 -2
- package/dist/translations/zh-cn.cjs +1 -1
- package/dist/translations/zh-cn.js +31 -2
- package/dist/{types-B96nVbgX.js → types-BBp2sp_s.js} +1 -1
- package/dist/types-GFLaiax5.cjs +1 -0
- package/dist/use-hover-DsnmY-p_.cjs +721 -0
- package/dist/{quota-notification-CVl0isIV.js → use-hover-mptQLQ4S.js} +27865 -19277
- package/dist/{utils-CgV-jWWQ.cjs → utils-BlNqPAG8.cjs} +45 -45
- package/dist/{utils-ChqSLRbz.js → utils-DTUC-wtI.js} +7729 -7513
- package/dist/{widget-composer-Blul90Zb.cjs → widget-composer-CDb2iOoS.cjs} +1 -1
- package/dist/{widget-composer-Cf_CN3Ux.js → widget-composer-D0BZrLna.js} +3 -3
- package/package.json +11 -10
- package/dist/dimensions-2t18RSZC.cjs +0 -1
- package/dist/dimensions-C0BmtTH2.js +0 -204
- package/dist/execute-query-DmAyVFF5.cjs +0 -1
- package/dist/packages/sdk-ui/src/infra/contexts/plugin-provider/index.d.ts +0 -5
- package/dist/packages/sdk-ui/src/infra/contexts/plugin-provider/plugin-context.d.ts +0 -15
- 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/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 -15
- package/dist/quota-notification-RAaHp-eO.cjs +0 -713
- package/dist/types-DZ4vWh8j.cjs +0 -1
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import { Attribute, CalculatedMeasureColumn, Column, Measure, MeasureColumn } from '@sisense/sdk-data';
|
|
2
|
+
import type { CategoryStyle, SeriesStyle, StyledColumn, StyledMeasureColumn, ValueStyle } from './types.js';
|
|
3
|
+
/**
|
|
4
|
+
* Name prefixes for trend and forecast measures in query payloads (aligned with NLQ JSON and chart).
|
|
5
|
+
*
|
|
6
|
+
* @internal
|
|
7
|
+
*/
|
|
8
|
+
export declare const TREND_PREFIX = "$trend";
|
|
9
|
+
export declare const FORECAST_PREFIX = "$forecast";
|
|
10
|
+
/**
|
|
11
|
+
* Dimension + optional category style for {@link adaptDimensionsForQuery}.
|
|
12
|
+
* Structurally matches NLQ `DimensionTranslationItem`.
|
|
13
|
+
*
|
|
14
|
+
* @internal
|
|
15
|
+
*/
|
|
16
|
+
export type DimensionQueryAdaptItem = {
|
|
17
|
+
attribute: Attribute;
|
|
18
|
+
style?: CategoryStyle;
|
|
19
|
+
};
|
|
20
|
+
/**
|
|
21
|
+
* Measure + optional value style for {@link adaptMeasuresForQuery}.
|
|
22
|
+
* Structurally matches NLQ `MeasureTranslationItem`.
|
|
23
|
+
*
|
|
24
|
+
* @internal
|
|
25
|
+
*/
|
|
26
|
+
export type MeasureQueryAdaptItem = {
|
|
27
|
+
measure: Measure;
|
|
28
|
+
style?: ValueStyle & SeriesStyle;
|
|
29
|
+
};
|
|
30
|
+
/**
|
|
31
|
+
* Dimensional {@link Attribute} instances expose JAQL sort APIs; plain {@link Column} does not.
|
|
32
|
+
*
|
|
33
|
+
* @internal
|
|
34
|
+
*/
|
|
35
|
+
export declare function isDimensionalAttribute(column: Column): column is Attribute;
|
|
36
|
+
/**
|
|
37
|
+
* Narrative / NLQ query measures are dimensional {@link Measure} instances (e.g. from `measureFactory`).
|
|
38
|
+
*
|
|
39
|
+
* @internal
|
|
40
|
+
*/
|
|
41
|
+
export declare function isDimensionalMeasure(column: MeasureColumn | CalculatedMeasureColumn): column is Measure;
|
|
42
|
+
/**
|
|
43
|
+
* Builds a dimension adapt item using `StyledColumn`’s own shape (no `splitColumn` merge).
|
|
44
|
+
*
|
|
45
|
+
* @internal
|
|
46
|
+
*/
|
|
47
|
+
export declare function toDimensionQueryAdaptItem(sc: StyledColumn): DimensionQueryAdaptItem;
|
|
48
|
+
/**
|
|
49
|
+
* Builds a measure adapt item using `StyledMeasureColumn`’s own shape (no `splitColumn` merge).
|
|
50
|
+
*
|
|
51
|
+
* @internal
|
|
52
|
+
*/
|
|
53
|
+
export declare function toMeasureQueryAdaptItem(smc: StyledMeasureColumn): MeasureQueryAdaptItem;
|
|
54
|
+
/**
|
|
55
|
+
* Applies sort from styled dimensions to attributes (NLQ JSON → query semantics).
|
|
56
|
+
*
|
|
57
|
+
* @internal
|
|
58
|
+
*/
|
|
59
|
+
export declare function adaptDimensionsForQuery(items: DimensionQueryAdaptItem[]): Attribute[];
|
|
60
|
+
/**
|
|
61
|
+
* @internal
|
|
62
|
+
*/
|
|
63
|
+
export declare function isTrendMeasure(measure: Measure): boolean;
|
|
64
|
+
/**
|
|
65
|
+
* @internal
|
|
66
|
+
*/
|
|
67
|
+
export declare function isForecastMeasure(measure: Measure): boolean;
|
|
68
|
+
/**
|
|
69
|
+
* Options for {@link adaptMeasuresForQuery}.
|
|
70
|
+
*
|
|
71
|
+
* @internal
|
|
72
|
+
*/
|
|
73
|
+
export type AdaptMeasuresForQueryOptions = {
|
|
74
|
+
/**
|
|
75
|
+
* When `true`, trend and forecast companion measures are not appended (e.g. narrative when the
|
|
76
|
+
* backend does not yet support them).
|
|
77
|
+
*
|
|
78
|
+
* @default false
|
|
79
|
+
*/
|
|
80
|
+
ignoreTrendAndForecast?: boolean;
|
|
81
|
+
};
|
|
82
|
+
/**
|
|
83
|
+
* Applies sort, trend, and forecast companion measures (NLQ JSON → query semantics).
|
|
84
|
+
*
|
|
85
|
+
* @internal
|
|
86
|
+
*/
|
|
87
|
+
export declare function adaptMeasuresForQuery(items: MeasureQueryAdaptItem[], options?: AdaptMeasuresForQueryOptions): Measure[];
|
|
@@ -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';
|
package/dist/packages/sdk-ui/src/domains/visualizations/core/query-definition/query-definition.d.ts
ADDED
|
@@ -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;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { WidgetHeaderConfig } from '../../../../domains/widgets/shared/widget-header/types.js';
|
|
2
|
+
import type { ChartWidgetProps } from './types.js';
|
|
3
|
+
export type UseChartWidgetCsvDownloadParams = Pick<ChartWidgetProps, 'title' | 'dataOptions' | 'chartType' | 'filters' | 'highlights' | 'config' | 'dataSource'> & {
|
|
4
|
+
/** Base header config */
|
|
5
|
+
baseHeaderConfig: WidgetHeaderConfig;
|
|
6
|
+
};
|
|
7
|
+
export type UseChartWidgetCsvDownloadResult = {
|
|
8
|
+
headerConfig: WidgetHeaderConfig;
|
|
9
|
+
};
|
|
10
|
+
/**
|
|
11
|
+
* Enhances a chart widget's header with CSV download capabilities:
|
|
12
|
+
* - Adds the "Download > CSV File" header menu item.
|
|
13
|
+
* - Executes the CSV query and downloads the result as a CSV file.
|
|
14
|
+
*
|
|
15
|
+
* @param props - Chart widget props and base header config
|
|
16
|
+
* @returns Header config for {@link WidgetContainer}
|
|
17
|
+
*/
|
|
18
|
+
export declare function useChartWidgetCsvDownload(props: UseChartWidgetCsvDownloadParams): UseChartWidgetCsvDownloadResult;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { WidgetHeaderConfig } from '../../../../domains/widgets/shared/widget-header/types.js';
|
|
2
|
+
import type { CustomWidgetProps } from './types.js';
|
|
3
|
+
export type UseCustomWidgetCsvDownloadParams = Pick<CustomWidgetProps, 'title' | 'dataOptions' | 'filters' | 'highlights' | 'config' | 'dataSource'>;
|
|
4
|
+
export type UseCustomWidgetCsvDownloadResult = {
|
|
5
|
+
headerConfig: WidgetHeaderConfig;
|
|
6
|
+
};
|
|
7
|
+
/**
|
|
8
|
+
* Enhances a custom widget's header with CSV download capabilities:
|
|
9
|
+
* - Adds the "Download > CSV File" header menu item.
|
|
10
|
+
* - Executes the CSV query and downloads the result as a CSV file.
|
|
11
|
+
*
|
|
12
|
+
* @param widgetProps - Custom widget props needed for CSV
|
|
13
|
+
* @returns Header config for {@link WidgetContainer}
|
|
14
|
+
*/
|
|
15
|
+
export declare function useCustomWidgetCsvDownload(widgetProps: UseCustomWidgetCsvDownloadParams): UseCustomWidgetCsvDownloadResult;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { WidgetHeaderConfig } from '../../../../domains/widgets/shared/widget-header/types.js';
|
|
2
|
+
import type { PivotTableWidgetProps } from './types.js';
|
|
3
|
+
export type UsePivotWidgetCsvDownloadParams = Pick<PivotTableWidgetProps, 'title' | 'dataOptions' | 'filters' | 'highlights' | 'config' | 'dataSource'> & {
|
|
4
|
+
/** Header config from {@link useWidgetHeaderManagement} (rename menu, etc.). */
|
|
5
|
+
baseHeaderConfig: WidgetHeaderConfig;
|
|
6
|
+
};
|
|
7
|
+
export type UsePivotWidgetCsvDownloadResult = {
|
|
8
|
+
headerConfig: WidgetHeaderConfig;
|
|
9
|
+
};
|
|
10
|
+
/**
|
|
11
|
+
* Enhances a pivot table widget's header with CSV download capabilities:
|
|
12
|
+
* - Adds the "Download > CSV File" header menu item.
|
|
13
|
+
* - Executes the CSV query and downloads the result as a CSV file.
|
|
14
|
+
*
|
|
15
|
+
* @param props - Pivot widget props and base header config
|
|
16
|
+
* @returns Header config for {@link WidgetContainer}
|
|
17
|
+
*/
|
|
18
|
+
export declare function usePivotWidgetCsvDownload(props: UsePivotWidgetCsvDownloadParams): UsePivotWidgetCsvDownloadResult;
|
package/dist/packages/sdk-ui/src/domains/widgets/components/tabber-buttons-widget/types.d.ts
CHANGED
|
@@ -4,10 +4,6 @@ import { CustomWidgetProps } from '../../../../domains/widgets/components/custom
|
|
|
4
4
|
*
|
|
5
5
|
*/
|
|
6
6
|
export type TabberButtonsWidgetStyleOptions = {
|
|
7
|
-
/**
|
|
8
|
-
* Color of the widget description text
|
|
9
|
-
*/
|
|
10
|
-
descriptionColor?: string;
|
|
11
7
|
/**
|
|
12
8
|
* Background color of the selected tab
|
|
13
9
|
*/
|
|
@@ -22,6 +18,14 @@ export type TabberButtonsWidgetStyleOptions = {
|
|
|
22
18
|
* @defaultValue true
|
|
23
19
|
*/
|
|
24
20
|
showDescription?: boolean;
|
|
21
|
+
/**
|
|
22
|
+
* Description text displayed in the tabber widget (when showDescription is true)
|
|
23
|
+
*/
|
|
24
|
+
description?: string;
|
|
25
|
+
/**
|
|
26
|
+
* Color of the widget description text
|
|
27
|
+
*/
|
|
28
|
+
descriptionColor?: string;
|
|
25
29
|
/**
|
|
26
30
|
* Whether to show visual separators between tabs
|
|
27
31
|
*
|
|
@@ -120,8 +124,4 @@ export interface TabberButtonsWidgetProps extends CustomWidgetProps {
|
|
|
120
124
|
* Configuration for tabs including names and active tab index
|
|
121
125
|
*/
|
|
122
126
|
customOptions: TabberButtonsWidgetCustomOptions;
|
|
123
|
-
/**
|
|
124
|
-
* Description text displayed in the widget
|
|
125
|
-
*/
|
|
126
|
-
description?: string;
|
|
127
127
|
}
|
|
@@ -5,7 +5,7 @@ import type { CustomWidgetProps } from '../custom-widget/types';
|
|
|
5
5
|
import type { PivotTableWidgetProps } from '../pivot-table-widget/types';
|
|
6
6
|
import type { TextWidgetProps } from '../text-widget/types';
|
|
7
7
|
/**
|
|
8
|
-
* Generic widget configuration (e.g. header menu, toolbar).
|
|
8
|
+
* Generic widget configuration (e.g. header menu, toolbar, actions).
|
|
9
9
|
* Shared across chart, pivot, text, and custom widgets.
|
|
10
10
|
*/
|
|
11
11
|
export type WidgetConfig = {
|
|
@@ -13,6 +13,26 @@ export type WidgetConfig = {
|
|
|
13
13
|
* Configurations for the widget header (e.g. toolbar menu items)
|
|
14
14
|
*/
|
|
15
15
|
header?: WidgetHeaderConfig;
|
|
16
|
+
/**
|
|
17
|
+
* Configuration for widget actions.
|
|
18
|
+
*
|
|
19
|
+
* @sisenseInternal
|
|
20
|
+
*/
|
|
21
|
+
actions?: {
|
|
22
|
+
/**
|
|
23
|
+
* Configuration for downloading a CSV file.
|
|
24
|
+
*
|
|
25
|
+
* @sisenseInternal
|
|
26
|
+
*/
|
|
27
|
+
downloadCsv?: {
|
|
28
|
+
/**
|
|
29
|
+
* Determines whether the possibility to download a CSV is enabled.
|
|
30
|
+
*
|
|
31
|
+
* If not specified, the default value is `false`.
|
|
32
|
+
*/
|
|
33
|
+
enabled?: boolean;
|
|
34
|
+
};
|
|
35
|
+
};
|
|
16
36
|
};
|
|
17
37
|
/**
|
|
18
38
|
* Type of the widget component.
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import
|
|
2
|
-
import type {
|
|
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.
|
|
@@ -60,4 +108,13 @@ export declare function toDataLimitsStyle(dataLimits?: DataLimits): CartesianWid
|
|
|
60
108
|
* @internal
|
|
61
109
|
*/
|
|
62
110
|
export declare function toLineWidgetStyle(styleOptions: LineStyleOptions): CartesianWidgetStyle;
|
|
111
|
+
/**
|
|
112
|
+
* Converts area chart style options to Fusion CartesianWidgetStyle DTO.
|
|
113
|
+
* Used when serializing an area chart widget back to WidgetDto.
|
|
114
|
+
*
|
|
115
|
+
* @param styleOptions - Area style options from WidgetModel.styleOptions
|
|
116
|
+
* @param widgetSubtype - Resolved Fusion widget subtype (e.g. after `area/basic` default)
|
|
117
|
+
* @returns Fusion CartesianWidgetStyle for the widget DTO
|
|
118
|
+
*/
|
|
119
|
+
export declare function toAreaWidgetStyle(styleOptions: AreaStyleOptions, widgetSubtype: WidgetSubtype): CartesianWidgetStyle;
|
|
63
120
|
export {};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { ExecuteCsvQueryParams } from '../../../domains/query-execution/types.js';
|
|
2
|
+
export type CsvExecuteParams = Omit<ExecuteCsvQueryParams, 'enabled'> & {
|
|
3
|
+
/** Filename for the downloaded CSV file. Defaults to `data.csv`. */
|
|
4
|
+
filename?: string;
|
|
5
|
+
};
|
|
6
|
+
export type UseCsvQueryLoaderResult = {
|
|
7
|
+
/** Triggers CSV query execution and browser file download with the given params. */
|
|
8
|
+
execute: (params: CsvExecuteParams) => void;
|
|
9
|
+
};
|
|
10
|
+
/**
|
|
11
|
+
* Hook that executes a CSV query on demand and triggers a browser file download.
|
|
12
|
+
* Call `execute` with query params to start the download; no params are needed at hook initialisation.
|
|
13
|
+
*
|
|
14
|
+
* @returns `execute` callback
|
|
15
|
+
*/
|
|
16
|
+
export declare function useCsvQueryFileLoader(): UseCsvQueryLoaderResult;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { WidgetHeaderConfig } from '../../../domains/widgets/shared/widget-header/types.js';
|
|
2
|
+
export type UseWithCsvDownloadMenuParams = {
|
|
3
|
+
/** Base header config. */
|
|
4
|
+
baseHeaderConfig: WidgetHeaderConfig;
|
|
5
|
+
/** Whether the "Download CSV" menu item is enabled. */
|
|
6
|
+
enabled: boolean;
|
|
7
|
+
/** Triggers CSV query execution and browser download. */
|
|
8
|
+
onClick: () => void;
|
|
9
|
+
};
|
|
10
|
+
/**
|
|
11
|
+
* Appends a "Download > CSV File" item to the widget header menu when enabled.
|
|
12
|
+
*
|
|
13
|
+
* If a "Download" group already exists in the menu, the "CSV File" item is added to its `items`.
|
|
14
|
+
* Otherwise a new "Download" group containing "CSV File" is appended.
|
|
15
|
+
*
|
|
16
|
+
* @param params.baseHeaderConfig - Base header config.
|
|
17
|
+
* @param params.enabled - Whether the "Download CSV" menu item is enabled.
|
|
18
|
+
* @param params.onClick - Click handler for the "CSV File" leaf item.
|
|
19
|
+
* @returns Header config to pass to {@link WidgetContainer}
|
|
20
|
+
* @internal
|
|
21
|
+
*/
|
|
22
|
+
export declare function useWithCsvDownloadMenuItem({ baseHeaderConfig, enabled, onClick, }: UseWithCsvDownloadMenuParams): WidgetHeaderConfig;
|
package/dist/packages/sdk-ui/src/domains/widgets/widget-model/widget-model-translator/utils.d.ts
ADDED
|
@@ -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
|
-
*
|
|
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;
|
|
@@ -1,19 +1,20 @@
|
|
|
1
1
|
import type { HttpClient } from '@sisense/sdk-rest-client';
|
|
2
|
-
import type {
|
|
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
|
|
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
|
|
6
|
+
export declare const LEGACY_NARRATIVE_ENDPOINT = "api/v2/ai/nlg/queryResult";
|
|
7
7
|
/**
|
|
8
|
-
* Options for
|
|
8
|
+
* Options for getNarrative. All endpoint choice logic lives in this module.
|
|
9
|
+
*
|
|
9
10
|
* @internal
|
|
10
11
|
*/
|
|
11
|
-
export type
|
|
12
|
+
export type GetNarrativeOptions = {
|
|
12
13
|
isUnifiedNarrationEnabled?: boolean;
|
|
13
14
|
isSisenseAiEnabled?: boolean;
|
|
14
15
|
};
|
|
15
16
|
/**
|
|
16
|
-
* Fetches
|
|
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
|
|
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,11 +1,11 @@
|
|
|
1
1
|
import { SisenseContextProviderProps } from '../../index';
|
|
2
2
|
import { type ClientApplication } from './types';
|
|
3
|
-
type ClientApplicationParams = Pick<SisenseContextProviderProps, 'appConfig' | 'defaultDataSource' | 'url' | 'token' | 'wat' | 'ssoEnabled' | 'enableSilentPreAuth' | 'useFusionAuth' | 'alternativeSsoHost' | 'disableFusionPalette'> & {
|
|
3
|
+
type ClientApplicationParams = Pick<SisenseContextProviderProps, 'appConfig' | 'defaultDataSource' | 'url' | 'token' | 'wat' | 'ssoEnabled' | 'enableSilentPreAuth' | 'useFusionAuth' | 'alternativeSsoHost' | 'ssoMaxAuthRedirectAttempts' | 'ssoRedirectAttemptsTtlMs' | 'disableFusionPalette'> & {
|
|
4
4
|
/**
|
|
5
5
|
* @internal
|
|
6
6
|
*/
|
|
7
7
|
packageName?: string;
|
|
8
8
|
};
|
|
9
9
|
/** @internal */
|
|
10
|
-
export declare const createClientApplication: ({ defaultDataSource, url: rawUrl, token, wat, ssoEnabled, appConfig, enableSilentPreAuth, useFusionAuth, alternativeSsoHost, disableFusionPalette, packageName, }: ClientApplicationParams) => Promise<ClientApplication>;
|
|
10
|
+
export declare const createClientApplication: ({ defaultDataSource, url: rawUrl, token, wat, ssoEnabled, appConfig, enableSilentPreAuth, useFusionAuth, alternativeSsoHost, ssoMaxAuthRedirectAttempts, ssoRedirectAttemptsTtlMs, disableFusionPalette, packageName, }: ClientApplicationParams) => Promise<ClientApplication>;
|
|
11
11
|
export {};
|
|
@@ -10,7 +10,8 @@ export type CustomWidgetsContextAdapter<T = CustomWidgetComponentProps> = {
|
|
|
10
10
|
/**
|
|
11
11
|
* Custom Widget Provider Adapter component that allows passing external custom widgets context.
|
|
12
12
|
*
|
|
13
|
-
*
|
|
13
|
+
* Bridges pre-initialized custom widget data from an external wrapper to child React components.
|
|
14
|
+
* Syncs the widget registry with customWidgetsMap on updates and cleans up on unmount.
|
|
14
15
|
*
|
|
15
16
|
* @internal
|
|
16
17
|
*/
|