@sisense/sdk-ui 1.6.0 → 1.7.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/api/chat-api-provider.d.ts +1 -1
- package/dist/ai/api/chat-history.d.ts +18 -0
- package/dist/ai/api/errors.d.ts +2 -0
- package/dist/ai/api/hooks.d.ts +2 -13
- package/dist/ai/api/types.d.ts +11 -9
- package/dist/ai/chat-style-provider.d.ts +15 -0
- package/dist/ai/chatbot.d.ts +7 -0
- package/dist/ai/{error-page.d.ts → common/error-container.d.ts} +1 -1
- package/dist/ai/suggestions/suggestion-item.d.ts +1 -2
- package/dist/ai/use-chat-session.d.ts +1 -0
- package/dist/ai.js +2064 -3702
- package/dist/alert-box/alert-box.d.ts +1 -1
- package/dist/app/client-application.d.ts +27 -0
- package/dist/app/settings/settings.d.ts +1 -1
- package/dist/boxplot-utils.d.ts +2 -1
- package/dist/chart-options-processor/translations/base-design-options.d.ts +1 -0
- package/dist/charts/indicator/indicator-legacy-chart-options/legacy-chart-options-to-theme-settings-dictionary.d.ts +2 -0
- package/dist/charts/indicator/indicator-legacy-chart-options/override-with-value-color.d.ts +1 -2
- package/dist/common/hooks/use-fetch.d.ts +42 -0
- package/dist/const.d.ts +1 -0
- package/dist/dashboard-widget/dashboard-widget.d.ts +2 -1
- package/dist/dynamic-size-container/dynamic-size-container.d.ts +4 -3
- package/dist/formulas/use-get-shared-formula.d.ts +2 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.js +4704 -4459
- package/dist/models/dashboard/use-get-dashboard-model.d.ts +2 -1
- package/dist/models/dashboard/use-get-dashboard-models.d.ts +2 -1
- package/dist/models/widget/use-get-widget-model.d.ts +2 -1
- package/dist/models/widget/widget-model.d.ts +2 -1
- package/dist/pivot-table/formatters/data-cell-formatters/data-cell-value-formatter.d.ts +3 -0
- package/dist/pivot-table/formatters/data-cell-formatters/index.d.ts +1 -0
- package/dist/pivot-table/formatters/header-cell-formatters/header-cell-value-formatter.d.ts +3 -0
- package/dist/pivot-table/formatters/header-cell-formatters/index.d.ts +1 -0
- package/dist/pivot-table/formatters/index.d.ts +2 -0
- package/dist/pivot-table/formatters/types.d.ts +4 -0
- package/dist/pivot-table/formatters/utils.d.ts +5 -0
- package/dist/pivot-table/sorting-utils.d.ts +56 -0
- package/dist/pivot-table/use-apply-pivot-table-formatting.d.ts +11 -0
- package/dist/pivot-table/use-get-pivot-table-query.d.ts +1 -1
- package/dist/props.d.ts +3 -2
- package/dist/query/execute-query.d.ts +5 -5
- package/dist/query-execution/execute-query-by-widget-id.d.ts +2 -1
- package/dist/query-execution/index.d.ts +2 -1
- package/dist/query-execution/query-params-comparator.d.ts +8 -0
- package/dist/query-execution/types.d.ts +7 -0
- package/dist/query-execution/use-execute-query-by-widget-id.d.ts +2 -1
- package/dist/query-execution/use-execute-query.d.ts +3 -10
- package/dist/query-execution/use-query-cache.d.ts +10 -0
- package/dist/sisense-context/sisense-query-client-provider.d.ts +2 -0
- package/dist/{with-tracking-e2a077f9.js → useQuery-aa258c0d.js} +70359 -58170
- package/dist/utils/create-cache.d.ts +33 -0
- package/package.json +8 -8
|
@@ -8,7 +8,7 @@ import { ChatRestApi } from './chat-rest-api';
|
|
|
8
8
|
export declare const ChatApiContext: import("react").Context<ChatRestApi | undefined>;
|
|
9
9
|
export declare const useChatApi: () => ChatRestApi | undefined;
|
|
10
10
|
/**
|
|
11
|
-
* React component
|
|
11
|
+
* React component that initializes the necessary wrappers to enable API calls and caching.
|
|
12
12
|
*
|
|
13
13
|
* @internal
|
|
14
14
|
*/
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { ChatMessage } from './types';
|
|
2
|
+
export declare const CHAT_HISTORY_QUERY_KEY = "chatHistory";
|
|
3
|
+
/**
|
|
4
|
+
* Hook that calls the clear history API and updates the cache.
|
|
5
|
+
*
|
|
6
|
+
* @internal
|
|
7
|
+
*/
|
|
8
|
+
export declare const useClearChatHistory: (chatId: string | undefined) => import("@tanstack/react-query").UseMutationResult<void, unknown, void, unknown>;
|
|
9
|
+
/**
|
|
10
|
+
* Hook that calls the get chat API and handles errors by clearing the history.
|
|
11
|
+
*
|
|
12
|
+
* @internal
|
|
13
|
+
*/
|
|
14
|
+
export declare const useChatHistory: (chatId: string | undefined) => {
|
|
15
|
+
history: ChatMessage[] | undefined;
|
|
16
|
+
isLoading: boolean;
|
|
17
|
+
isError: boolean;
|
|
18
|
+
};
|
package/dist/ai/api/errors.d.ts
CHANGED
|
@@ -1,2 +1,4 @@
|
|
|
1
1
|
export declare const UNEXPECTED_ERROR = "Oh snap, something went wrong. Please try again later.";
|
|
2
2
|
export declare const UNEXPECTED_CHAT_RESPONSE_ERROR = "Oh snap, something went wrong. Please try again later or try asking a different question.";
|
|
3
|
+
export declare const FETCH_HISTORY_ERROR = "Something went wrong and we were unable to retrieve the chat thread. Let's start over!";
|
|
4
|
+
export declare const CHAT_UNAVAILABLE_ERROR = "Chat unavailable. Please try again later.";
|
package/dist/ai/api/hooks.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { ChatContext,
|
|
1
|
+
import type { ChatContext, ChatResponse } from './types';
|
|
2
2
|
/**
|
|
3
3
|
* @internal
|
|
4
4
|
*/
|
|
@@ -17,18 +17,7 @@ export declare const useGetAllChats: () => {
|
|
|
17
17
|
/**
|
|
18
18
|
* @internal
|
|
19
19
|
*/
|
|
20
|
-
export declare const useMaybeCreateChat: (contextId: string | undefined, shouldCreate: boolean) => void
|
|
21
|
-
/**
|
|
22
|
-
* @internal
|
|
23
|
-
*/
|
|
24
|
-
export declare const useGetChatHistory: (id: string | undefined) => {
|
|
25
|
-
data: ChatMessage[] | undefined;
|
|
26
|
-
isLoading: boolean;
|
|
27
|
-
};
|
|
28
|
-
/**
|
|
29
|
-
* @internal
|
|
30
|
-
*/
|
|
31
|
-
export declare const useClearChatHistory: (chatId: string | undefined) => import("@tanstack/react-query").UseMutationResult<void, unknown, void, unknown>;
|
|
20
|
+
export declare const useMaybeCreateChat: (contextId: string | undefined, shouldCreate: boolean) => import("@tanstack/react-query").UseMutationResult<import("./types").Chat | undefined, unknown, void, unknown>;
|
|
32
21
|
export declare const useSendChatMessage: (chatId: string | undefined) => {
|
|
33
22
|
mutate: import("@tanstack/react-query").UseMutateFunction<ChatResponse | undefined, unknown, string, void>;
|
|
34
23
|
isLoading: boolean;
|
package/dist/ai/api/types.d.ts
CHANGED
|
@@ -7,11 +7,6 @@ export interface ChatContext {
|
|
|
7
7
|
description: string;
|
|
8
8
|
}
|
|
9
9
|
export type ChatContextType = 'datamodel' | 'perspective';
|
|
10
|
-
interface TextMessage {
|
|
11
|
-
role: 'assistant';
|
|
12
|
-
content: string;
|
|
13
|
-
type: 'Text';
|
|
14
|
-
}
|
|
15
10
|
export interface NlqMessage {
|
|
16
11
|
role: 'assistant';
|
|
17
12
|
content: string;
|
|
@@ -21,8 +16,7 @@ interface RegularMessage {
|
|
|
21
16
|
role: 'user' | 'assistant';
|
|
22
17
|
content: string;
|
|
23
18
|
}
|
|
24
|
-
type
|
|
25
|
-
export type ChatMessage = RegularMessage | SystemMessage;
|
|
19
|
+
export type ChatMessage = RegularMessage | NlqMessage;
|
|
26
20
|
export interface Chat {
|
|
27
21
|
chatId: string;
|
|
28
22
|
contextId: string;
|
|
@@ -54,7 +48,15 @@ interface TextResponse {
|
|
|
54
48
|
answer: string;
|
|
55
49
|
};
|
|
56
50
|
chatId: string;
|
|
57
|
-
responseType: '
|
|
51
|
+
responseType: 'text';
|
|
52
|
+
}
|
|
53
|
+
interface ErrorResponse {
|
|
54
|
+
data: {
|
|
55
|
+
message: string;
|
|
56
|
+
code: string;
|
|
57
|
+
answer: string;
|
|
58
|
+
};
|
|
59
|
+
responseType: 'error';
|
|
58
60
|
}
|
|
59
61
|
export type KeysOfUnion<T> = T extends T ? keyof T : never;
|
|
60
62
|
export type AllPossibleChartOptionKeys = KeysOfUnion<ChartDataOptions>;
|
|
@@ -86,7 +88,7 @@ export interface NlqResponse {
|
|
|
86
88
|
timestamp: string;
|
|
87
89
|
responseType: 'nlq';
|
|
88
90
|
}
|
|
89
|
-
export type ChatResponse = NlqResponse | TextResponse;
|
|
91
|
+
export type ChatResponse = NlqResponse | TextResponse | ErrorResponse;
|
|
90
92
|
export interface QueryRecommendationConfig {
|
|
91
93
|
numOfRecommendations: number;
|
|
92
94
|
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
export interface ChatStyle {
|
|
3
|
+
backgroundColor?: string;
|
|
4
|
+
primaryTextColor?: string;
|
|
5
|
+
secondaryTextColor?: string;
|
|
6
|
+
messageBackgroundColor?: string;
|
|
7
|
+
inputBackgroundColor?: string;
|
|
8
|
+
border?: false | string;
|
|
9
|
+
}
|
|
10
|
+
export type ChatStyleProviderProps = {
|
|
11
|
+
children: ReactNode;
|
|
12
|
+
value: ChatStyle;
|
|
13
|
+
};
|
|
14
|
+
export declare const useChatStyle: () => ChatStyle;
|
|
15
|
+
export declare const ChatStyleProvider: ({ children, value }: ChatStyleProviderProps) => JSX.Element;
|
package/dist/ai/chatbot.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { CSSProperties } from 'react';
|
|
2
2
|
import { ChatConfig } from './chat-config';
|
|
3
|
+
import { ChatStyle } from './chat-style-provider';
|
|
3
4
|
/**
|
|
4
5
|
* Props for {@link Chatbot} component.
|
|
5
6
|
*/
|
|
@@ -16,6 +17,12 @@ export type ChatbotProps = {
|
|
|
16
17
|
* If not specified, a default height of `900px` will be used.
|
|
17
18
|
*/
|
|
18
19
|
height?: CSSProperties['height'];
|
|
20
|
+
/**
|
|
21
|
+
* Style settings for the chatbot
|
|
22
|
+
*
|
|
23
|
+
* @internal
|
|
24
|
+
*/
|
|
25
|
+
style?: ChatStyle;
|
|
19
26
|
/**
|
|
20
27
|
* Various configuration options for the chatbot
|
|
21
28
|
*/
|
|
@@ -3,5 +3,4 @@ export interface SuggestedItemProps {
|
|
|
3
3
|
question: string;
|
|
4
4
|
onClick: () => void;
|
|
5
5
|
}
|
|
6
|
-
|
|
7
|
-
export default SuggestionItem;
|
|
6
|
+
export default function SuggestionItem({ question, onClick }: SuggestedItemProps): JSX.Element;
|
|
@@ -11,6 +11,7 @@ export interface UseChatSessionResult {
|
|
|
11
11
|
sendMessage: (message: string) => void;
|
|
12
12
|
isAwaitingResponse: boolean;
|
|
13
13
|
isLoading: boolean;
|
|
14
|
+
lastError: Error | null;
|
|
14
15
|
}
|
|
15
16
|
export declare const isNlqMessage: (message: ChatMessage | null | undefined) => message is NlqMessage;
|
|
16
17
|
/**
|