@sisense/sdk-ui 1.3.0 → 1.4.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/ai-context-provider.d.ts +32 -0
- package/dist/ai/api/chat-api-provider.d.ts +17 -0
- package/dist/ai/api/chat-rest-api.d.ts +3 -1
- package/dist/ai/api/errors.d.ts +1 -0
- package/dist/ai/api/hooks.d.ts +10 -49
- package/dist/ai/api/types.d.ts +16 -27
- package/dist/ai/buttons/thumbs-down-button.d.ts +6 -0
- package/dist/ai/buttons/thumbs-up-button.d.ts +6 -0
- package/dist/ai/chat-box.d.ts +3 -3
- package/dist/ai/chat-config.d.ts +28 -0
- package/dist/ai/chat-home.d.ts +5 -1
- package/dist/ai/chat-router.d.ts +2 -0
- package/dist/ai/chatbot.d.ts +26 -4
- package/dist/ai/common/tooltip.d.ts +5 -0
- package/dist/ai/error-page.d.ts +10 -0
- package/dist/ai/get-nlg-query-result.d.ts +78 -0
- package/dist/ai/icons/thumbs-down-hovered-icon.d.ts +2 -0
- package/dist/ai/icons/thumbs-down-icon.d.ts +2 -0
- package/dist/ai/icons/thumbs-up-hovered-icon.d.ts +2 -0
- package/dist/ai/icons/thumbs-up-icon.d.ts +2 -0
- package/dist/ai/index.d.ts +6 -3
- package/dist/ai/loading-page.d.ts +2 -0
- package/dist/ai/messages/clear-history-success-message.d.ts +2 -0
- package/dist/ai/messages/feedback-wrapper.d.ts +9 -0
- package/dist/ai/messages/get-widget-options.d.ts +2 -1
- package/dist/ai/messages/message-resolver.d.ts +1 -2
- package/dist/ai/messages/text-message.d.ts +1 -1
- package/dist/ai/toolbar.d.ts +2 -2
- package/dist/ai/use-chat-session.d.ts +1 -1
- package/dist/ai/use-get-nlg-query-result.d.ts +103 -0
- package/dist/ai/use-get-query-recommendations.d.ts +67 -0
- package/dist/ai.js +1866 -1518
- package/dist/{chart.d.ts → chart/chart.d.ts} +1 -1
- package/dist/chart/helpers/use-synced-data.d.ts +8 -0
- package/dist/chart/helpers/use-translated-data-options.d.ts +7 -0
- package/dist/chart/index.d.ts +1 -0
- package/dist/chart-data/types.d.ts +1 -0
- package/dist/chart-data-options/translate-data-options.d.ts +5 -1
- package/dist/chart-data-options/types.d.ts +107 -12
- package/dist/chart-options-processor/boxplot-chart-options.d.ts +2 -2
- package/dist/chart-options-processor/category-chart-options.d.ts +1 -1
- package/dist/chart-options-processor/chart-options-service.d.ts +7 -0
- package/dist/chart-options-processor/plot-bands.d.ts +2 -2
- package/dist/chart-options-processor/scatter-chart-options.d.ts +2 -2
- package/dist/chart-options-processor/style-to-design-options-translator/index.d.ts +1 -0
- package/dist/chart-options-processor/style-to-design-options-translator/prepare-design-options.d.ts +4 -0
- package/dist/chart-options-processor/style-to-design-options-translator/translate-style-to-design-options.d.ts +2 -2
- package/dist/chart-options-processor/translations/base-design-options.d.ts +3 -3
- package/dist/chart-options-processor/translations/boxplot/boxplot-plot-options.d.ts +2 -2
- package/dist/chart-options-processor/translations/design-options.d.ts +2 -2
- package/dist/chart-options-processor/translations/number-format-config.d.ts +10 -16
- package/dist/chart-options-processor/translations/translations-to-highcharts.d.ts +4 -4
- package/dist/chart-options-processor/translations/types.d.ts +18 -6
- package/dist/chart-options-processor/translations/value-label-section.d.ts +9 -4
- package/dist/charts/indicator/indicator-legacy-chart-options/prepare-ticker-options.d.ts +2 -0
- package/dist/charts/map-charts/areamap/areamap.d.ts +2 -2
- package/dist/charts/map-charts/scattermap/scattermap.d.ts +9 -3
- package/dist/charts/map-charts/scattermap/utils/location.d.ts +3 -0
- package/dist/charts/table/helpers/calc-column-widths.d.ts +3 -1
- package/dist/common/hooks/data-load-state-reducer.d.ts +10 -0
- package/dist/common/hooks/use-hover.d.ts +8 -0
- package/dist/common/icons/yellow-exclamation-mark-icon.d.ts +2 -0
- package/dist/dashboard-widget/translate-widget-data-options.d.ts +1 -1
- package/dist/decorators/hook-decorators/with-tracking.d.ts +11 -0
- package/dist/formulas/fetch-formula.d.ts +2 -0
- package/dist/formulas/index.d.ts +1 -0
- package/dist/formulas/use-get-shared-formula.d.ts +5 -0
- package/dist/index.d.ts +4 -4
- package/dist/index.js +34073 -10282
- package/dist/indicator-canvas.d.ts +2 -2
- package/dist/models/dashboard/use-get-dashboard-model.d.ts +8 -0
- package/dist/models/dashboard/use-get-dashboard-models.d.ts +6 -0
- package/dist/pivot-table/index.d.ts +1 -0
- package/dist/pivot-table/pivot-table.d.ts +42 -0
- package/dist/pivot-table/use-get-pivot-table-query.d.ts +14 -0
- package/dist/props.d.ts +62 -4
- package/dist/sisense-chart/sisense-chart.d.ts +2 -2
- package/dist/types.d.ts +74 -9
- package/dist/utils/utility-types.d.ts +12 -0
- package/dist/widgets/common/drilldown-breadcrumbs/styled-buttons.d.ts +2 -2
- package/dist/widgets/common/drilldown.d.ts +1 -1
- package/dist/{table-widget-b467cc86.js → with-tracking-b583e949.js} +38407 -38268
- package/package.json +13 -13
- package/dist/ai/api/chat-api-context.d.ts +0 -12
- package/dist/ai/chatbot-context.d.ts +0 -11
- package/dist/ai/nlg-query-result.d.ts +0 -20
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
import type { GetNlgQueryResultRequest } from './api/types.js';
|
|
2
|
+
/**
|
|
3
|
+
* Parameters for {@link useGetNlgQueryResult} hook.
|
|
4
|
+
*
|
|
5
|
+
*/
|
|
6
|
+
export interface UseGetNlgQueryResultParams extends GetNlgQueryResultRequest {
|
|
7
|
+
/**
|
|
8
|
+
* Boolean flag to enable/disable API call by default
|
|
9
|
+
*
|
|
10
|
+
* If not specified, the default value is `true`
|
|
11
|
+
*/
|
|
12
|
+
enabled?: boolean;
|
|
13
|
+
}
|
|
14
|
+
export declare const useGetNlgQueryResultInternal: (params: UseGetNlgQueryResultParams) => {
|
|
15
|
+
data: string | undefined;
|
|
16
|
+
isError: boolean;
|
|
17
|
+
isLoading: boolean;
|
|
18
|
+
isSuccess: boolean;
|
|
19
|
+
fetchStatus: import("@tanstack/react-query").FetchStatus;
|
|
20
|
+
refetch: () => void;
|
|
21
|
+
};
|
|
22
|
+
/**
|
|
23
|
+
* React hook that fetches an analysis of the provided JAQL using natural language generation (NLG).
|
|
24
|
+
*
|
|
25
|
+
* Note that in the example below, this hook expects `metadata` to be in standard JAQL syntax.
|
|
26
|
+
*
|
|
27
|
+
* ::: warning Note
|
|
28
|
+
* This hook is currently under private beta for selected customers and is subject to change as we make fixes and improvements.
|
|
29
|
+
* :::
|
|
30
|
+
*
|
|
31
|
+
* @example
|
|
32
|
+
* ```tsx
|
|
33
|
+
* import { SisenseContextProvider } from '@sisense/sdk-ui';
|
|
34
|
+
* import { AiContextProvider, useGetNlgQueryResult } from '@sisense/sdk-ui/ai';
|
|
35
|
+
*
|
|
36
|
+
* function Page() {
|
|
37
|
+
* const { data } = useGetNlgQueryResult({
|
|
38
|
+
* dataSource: 'Sample ECommerce',
|
|
39
|
+
* metadata: [
|
|
40
|
+
* {
|
|
41
|
+
* jaql: {
|
|
42
|
+
* column: 'Date',
|
|
43
|
+
* datatype: 'datetime',
|
|
44
|
+
* dim: '[Commerce.Date]',
|
|
45
|
+
* firstday: 'mon',
|
|
46
|
+
* level: 'years',
|
|
47
|
+
* table: 'Commerce',
|
|
48
|
+
* title: 'Date',
|
|
49
|
+
* },
|
|
50
|
+
* format: {
|
|
51
|
+
* mask: {
|
|
52
|
+
* days: 'shortDate',
|
|
53
|
+
* isdefault: true,
|
|
54
|
+
* minutes: 'HH:mm',
|
|
55
|
+
* months: 'MM/yyyy',
|
|
56
|
+
* quarters: 'yyyy Q',
|
|
57
|
+
* weeks: 'ww yyyy',
|
|
58
|
+
* years: 'yyyy',
|
|
59
|
+
* },
|
|
60
|
+
* },
|
|
61
|
+
* },
|
|
62
|
+
* {
|
|
63
|
+
* jaql: {
|
|
64
|
+
* agg: 'sum',
|
|
65
|
+
* column: 'Revenue',
|
|
66
|
+
* datatype: 'numeric',
|
|
67
|
+
* dim: '[Commerce.Revenue]',
|
|
68
|
+
* table: 'Commerce',
|
|
69
|
+
* title: 'total of Revenue',
|
|
70
|
+
* },
|
|
71
|
+
* },
|
|
72
|
+
* ],
|
|
73
|
+
* });
|
|
74
|
+
* return (
|
|
75
|
+
* <>
|
|
76
|
+
* <h1>Summary</h1>
|
|
77
|
+
* <p>{data}</p>
|
|
78
|
+
* </>
|
|
79
|
+
* );
|
|
80
|
+
* }
|
|
81
|
+
*
|
|
82
|
+
* function App() {
|
|
83
|
+
* return (
|
|
84
|
+
* <SisenseContextProvider {...sisenseContextProps}>
|
|
85
|
+
* <AiContextProvider>
|
|
86
|
+
* <Page />
|
|
87
|
+
* </AiContextProvider>
|
|
88
|
+
* </SisenseContextProvider>
|
|
89
|
+
* );
|
|
90
|
+
* }
|
|
91
|
+
* ```
|
|
92
|
+
* @param params - {@link UseGetNlgQueryResultParams}
|
|
93
|
+
* @returns Response object containing a text summary
|
|
94
|
+
* @beta
|
|
95
|
+
*/
|
|
96
|
+
export declare const useGetNlgQueryResult: (params: UseGetNlgQueryResultParams) => {
|
|
97
|
+
data: string | undefined;
|
|
98
|
+
isError: boolean;
|
|
99
|
+
isLoading: boolean;
|
|
100
|
+
isSuccess: boolean;
|
|
101
|
+
fetchStatus: import("@tanstack/react-query").FetchStatus;
|
|
102
|
+
refetch: () => void;
|
|
103
|
+
};
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Parameters for {@link useGetQueryRecommendations} hook.
|
|
3
|
+
*/
|
|
4
|
+
export interface UseGetQueryRecommendationsParams {
|
|
5
|
+
/** Data model title or perspective title */
|
|
6
|
+
contextTitle: string;
|
|
7
|
+
/**
|
|
8
|
+
* Number of recommendations that should be returned
|
|
9
|
+
*
|
|
10
|
+
* If not specified, the default value is `4`
|
|
11
|
+
*/
|
|
12
|
+
count?: number;
|
|
13
|
+
}
|
|
14
|
+
export declare const useGetQueryRecommendationsInternal: (params: UseGetQueryRecommendationsParams) => {
|
|
15
|
+
data: import(".").QueryRecommendationResponse;
|
|
16
|
+
isLoading: boolean;
|
|
17
|
+
};
|
|
18
|
+
/**
|
|
19
|
+
* React hook that fetches recommended questions for a data model or perspective.
|
|
20
|
+
*
|
|
21
|
+
* This hook includes the same code that fetches the initial suggested questions in the chatbot.
|
|
22
|
+
*
|
|
23
|
+
* ::: warning Note
|
|
24
|
+
* This hook is currently under private beta for selected customers and is subject to change as we make fixes and improvements.
|
|
25
|
+
* :::
|
|
26
|
+
*
|
|
27
|
+
* @example
|
|
28
|
+
* ```tsx
|
|
29
|
+
* import { SisenseContextProvider } from '@sisense/sdk-ui';
|
|
30
|
+
* import { AiContextProvider, useGetQueryRecommendations } from '@sisense/sdk-ui/ai';
|
|
31
|
+
*
|
|
32
|
+
* function Page() {
|
|
33
|
+
* const { data } = useGetQueryRecommendations({
|
|
34
|
+
* contextTitle: 'Sample ECommerce',
|
|
35
|
+
* });
|
|
36
|
+
*
|
|
37
|
+
* if (!data) {
|
|
38
|
+
* return <div>Loading recommendations</div>;
|
|
39
|
+
* }
|
|
40
|
+
*
|
|
41
|
+
* return (
|
|
42
|
+
* <ul>
|
|
43
|
+
* {data.map((item, index) => (
|
|
44
|
+
* <li key={index}>{item.nlqPrompt}</li>
|
|
45
|
+
* ))}
|
|
46
|
+
* </ul>
|
|
47
|
+
* );
|
|
48
|
+
* }
|
|
49
|
+
*
|
|
50
|
+
* function App() {
|
|
51
|
+
* return (
|
|
52
|
+
* <SisenseContextProvider {...sisenseContextProps}>
|
|
53
|
+
* <AiContextProvider>
|
|
54
|
+
* <Page />
|
|
55
|
+
* </AiContextProvider>
|
|
56
|
+
* </SisenseContextProvider>
|
|
57
|
+
* );
|
|
58
|
+
* }
|
|
59
|
+
* ```
|
|
60
|
+
* @param params - {@link UseGetQueryRecommendationsParams}
|
|
61
|
+
* @returns An array of objects, each containing recommended question text and its corresponding JAQL
|
|
62
|
+
* @beta
|
|
63
|
+
*/
|
|
64
|
+
export declare const useGetQueryRecommendations: (params: UseGetQueryRecommendationsParams) => {
|
|
65
|
+
data: import(".").QueryRecommendationResponse;
|
|
66
|
+
isLoading: boolean;
|
|
67
|
+
};
|