@sisense/sdk-ui 1.11.0 → 1.13.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 (117) hide show
  1. package/dist/ai/api/chat-rest-api.d.ts +3 -4
  2. package/dist/ai/api/hooks.d.ts +2 -2
  3. package/dist/ai/api/types.d.ts +2 -16
  4. package/dist/ai/buttons/scroll-to-bottom-button.d.ts +3 -0
  5. package/dist/ai/buttons/thumbs-down-button.d.ts +2 -1
  6. package/dist/ai/buttons/thumbs-up-button.d.ts +2 -1
  7. package/dist/ai/chat-config.d.ts +18 -0
  8. package/dist/ai/chat-dropup.d.ts +2 -1
  9. package/dist/ai/chat-input.d.ts +3 -1
  10. package/dist/ai/common/constants.d.ts +1 -0
  11. package/dist/ai/common/icon-button.d.ts +2 -3
  12. package/dist/ai/common/tooltip.d.ts +2 -2
  13. package/dist/ai/data-topics/data-topic-list.d.ts +0 -1
  14. package/dist/ai/icons/light-bulb-icon.d.ts +1 -3
  15. package/dist/ai/icons/scroll-to-bottom-icon.d.ts +1 -0
  16. package/dist/ai/index.d.ts +1 -0
  17. package/dist/ai/messages/clickable-message.d.ts +2 -1
  18. package/dist/ai/messages/feedback-wrapper.d.ts +2 -2
  19. package/dist/ai/messages/text-message.d.ts +5 -0
  20. package/dist/ai/scroll-to-bottom.d.ts +7 -0
  21. package/dist/ai/use-last-nlq-response.d.ts +19 -0
  22. package/dist/ai.cjs +471 -0
  23. package/dist/ai.js +1143 -1228
  24. package/dist/api/types/dashboard-dto.d.ts +2 -1
  25. package/dist/app/client-application.d.ts +1 -0
  26. package/dist/chart/helpers/use-chart-renderer-props.d.ts +1 -0
  27. package/dist/chart/helpers/use-synced-data.d.ts +1 -1
  28. package/dist/chart-options-processor/chart-options-service.d.ts +4 -0
  29. package/dist/chart-options-processor/subtype-to-design-options.d.ts +13 -1
  30. package/dist/chart-options-processor/translations/funnel-plot-options.d.ts +2 -1
  31. package/dist/chart-options-processor/translations/pie-plot-options.d.ts +2 -1
  32. package/dist/chart-options-processor/translations/tooltip-utils.d.ts +2 -0
  33. package/dist/common/components/loading-indicator.d.ts +17 -4
  34. package/dist/common/components/loading-overlay.d.ts +1 -0
  35. package/dist/common/hooks/use-fetch.d.ts +1 -1
  36. package/dist/common/hooks/use-has-changed.d.ts +9 -0
  37. package/dist/common/hooks/use-should-load.d.ts +12 -0
  38. package/dist/common-filters/common-filters-connector.d.ts +9 -0
  39. package/dist/common-filters/selection-utils.d.ts +11 -0
  40. package/dist/common-filters/types.d.ts +14 -0
  41. package/dist/common-filters/use-common-filters.d.ts +13 -0
  42. package/dist/common-filters/utils.d.ts +9 -0
  43. package/dist/common-filters/widget-header-clear-selection-button.d.ts +3 -0
  44. package/dist/dashboard/components/content-panel.d.ts +41 -0
  45. package/dist/dashboard/components/dashboard-container.d.ts +2 -0
  46. package/dist/dashboard/components/dashboard-header.d.ts +2 -0
  47. package/dist/dashboard/components/plugin-service.d.ts +21 -0
  48. package/dist/dashboard/constants.d.ts +2 -0
  49. package/dist/dashboard/dashboard-by-id.d.ts +7 -0
  50. package/dist/dashboard/dashboard.d.ts +8 -0
  51. package/dist/dashboard/types.d.ts +44 -0
  52. package/dist/dashboard/utils.d.ts +2 -0
  53. package/dist/dashboard-widget/translate-dashboard-filters.d.ts +4772 -2
  54. package/dist/dashboard-widget/translate-widget-data-options.d.ts +1 -1
  55. package/dist/dashboard-widget/translate-widget-filters.d.ts +200 -37
  56. package/dist/dashboard-widget/types.d.ts +1 -0
  57. package/dist/dashboard-widget/utils.d.ts +3 -1
  58. package/dist/dynamic-size-container/dynamic-size-container.d.ts +8 -0
  59. package/dist/filters/components/cascading-filter-tile/cascading-filter-tile.d.ts +25 -0
  60. package/dist/filters/components/cascading-filter-tile/cascading-level-filter.d.ts +21 -0
  61. package/dist/filters/components/cascading-filter-tile/index.d.ts +1 -0
  62. package/dist/filters/components/common/date-range-field-button.d.ts +3 -6
  63. package/dist/filters/components/criteria-filter-tile/criteria-filter-operations.d.ts +2 -2
  64. package/dist/filters/components/criteria-filter-tile/criteria-filter-tile.d.ts +6 -0
  65. package/dist/filters/components/custom-filter-tile.d.ts +43 -0
  66. package/dist/filters/components/date-filter/date-filter/date-filter.d.ts +15 -0
  67. package/dist/filters/components/date-filter/date-range-filter-tile/date-range-filter-display.d.ts +6 -0
  68. package/dist/filters/components/date-filter/date-range-filter-tile/date-range-filter-tile.d.ts +12 -0
  69. package/dist/filters/components/date-filter/date-range-filter-tile/editable-date-range-filter.d.ts +14 -0
  70. package/dist/filters/components/date-filter/date-range-filter-tile/use-date-limits.d.ts +1 -2
  71. package/dist/filters/components/date-filter/relative-date-filter-tile/relative-date-filter-tile.d.ts +8 -2
  72. package/dist/filters/components/date-filter/relative-date-filter-tile/relative-date-filter.d.ts +4 -4
  73. package/dist/filters/components/filter-tile.d.ts +21 -1
  74. package/dist/filters/components/filters-panel/filters-panel-tile.d.ts +4 -2
  75. package/dist/filters/components/filters-panel/filters-panel.d.ts +4 -2
  76. package/dist/filters/components/icons/arrow-icon.d.ts +6 -0
  77. package/dist/filters/components/icons/double-arrow-icon.d.ts +6 -0
  78. package/dist/filters/components/member-filter-tile/member-filter-tile.d.ts +4 -1
  79. package/dist/filters/components/member-filter-tile/member-list.d.ts +1 -1
  80. package/dist/filters/hooks/use-synchronized-filter.d.ts +12 -0
  81. package/dist/filters/index.d.ts +2 -0
  82. package/dist/filters/utils.d.ts +7 -0
  83. package/dist/highcharts-memorized.d.ts +1 -1
  84. package/dist/index.cjs +830 -0
  85. package/dist/index.d.ts +2 -0
  86. package/dist/index.js +25012 -20426
  87. package/dist/models/dashboard/dashboard-model.d.ts +66 -0
  88. package/dist/models/dashboard/get-dashboard-model.d.ts +3 -1
  89. package/dist/models/dashboard/get-dashboard-models.d.ts +2 -1
  90. package/dist/models/dashboard/index.d.ts +1 -1
  91. package/dist/models/dashboard/translate-dashboard-utils.d.ts +7 -0
  92. package/dist/models/dashboard/types.d.ts +5 -14
  93. package/dist/models/dashboard/use-get-dashboard-model.d.ts +1 -1
  94. package/dist/models/dashboard/use-get-dashboard-models.d.ts +1 -1
  95. package/dist/models/widget/get-widget-model.d.ts +2 -1
  96. package/dist/models/widget/translate-widget.d.ts +5 -2
  97. package/dist/models/widget/types.d.ts +9 -0
  98. package/dist/models/widget/widget-model.d.ts +31 -1
  99. package/dist/query/query-result-date-formatting.d.ts +1 -0
  100. package/dist/query-execution/query-params-comparator.d.ts +1 -7
  101. package/dist/query-execution/use-execute-pivot-query.d.ts +2 -5
  102. package/dist/query-execution/use-execute-query-by-widget-id.d.ts +3 -4
  103. package/dist/translation/resources/en.d.ts +5 -0
  104. package/dist/translation/resources/index.d.ts +10 -0
  105. package/dist/types.d.ts +40 -13
  106. package/dist/useQuery-C8plkncQ.cjs +603 -0
  107. package/dist/{debounce-BbwkW3DX.js → useQuery-D5W0RM1R.js} +21443 -21103
  108. package/dist/utils/create-cache.d.ts +0 -1
  109. package/dist/utils/utility-types.d.ts +1 -0
  110. package/dist/widgets/common/drilldown-breadcrumbs/styled-buttons.d.ts +2 -2
  111. package/package.json +12 -8
  112. package/dist/ai/icons/thumbs-down-hovered-icon.d.ts +0 -2
  113. package/dist/ai/icons/thumbs-up-hovered-icon.d.ts +0 -2
  114. package/dist/ai/messages/clear-history-success-message.d.ts +0 -1
  115. package/dist/filters/components/icons/arrow-right-icon.d.ts +0 -2
  116. package/dist/filters/components/icons/double-arrow-right-icon.d.ts +0 -2
  117. package/dist/models/dashboard/translate-dashboard.d.ts +0 -4
@@ -1,11 +1,10 @@
1
1
  import { HttpClient } from '@sisense/sdk-rest-client';
2
- import type { Chat, ChatRequest, ChatResponse, ChatWithoutHistory, DataModel, GetNlgQueryResultRequest, GetNlgQueryResultResponse, LlmConfig, Perspective, QueryRecommendationConfig, QueryRecommendationResponse, SendFeedbackRequest } from './types';
2
+ import type { Chat, ChatRequest, ChatResponse, ChatWithoutHistory, ChatContext, GetNlgQueryResultRequest, GetNlgQueryResultResponse, LlmConfig, QueryRecommendationConfig, QueryRecommendationResponse, SendFeedbackRequest } from './types';
3
3
  import { DataSourceField } from '@sisense/sdk-query-client';
4
4
  export declare class ChatRestApi {
5
5
  private httpClient;
6
6
  constructor(httpClient: HttpClient);
7
- getDataModels: () => Promise<DataModel[]>;
8
- getPerspectives: () => Promise<Perspective[]>;
7
+ getChatContexts: () => Promise<ChatContext[]>;
9
8
  private getNlgQueryResult;
10
9
  private getQueryRecommendations;
11
10
  private setLlmConfig;
@@ -25,7 +24,7 @@ export declare class ChatRestApi {
25
24
  chat: {
26
25
  getAll: () => Promise<ChatWithoutHistory[]>;
27
26
  getById: (chatId: string) => Promise<Chat>;
28
- create: (contextId: string) => Promise<Chat>;
27
+ create: (sourceId: string) => Promise<Chat>;
29
28
  post: (chatId: string, request: ChatRequest) => Promise<ChatResponse>;
30
29
  clearHistory: (chatId: string) => Promise<void>;
31
30
  };
@@ -1,9 +1,9 @@
1
- import type { ChatContext, ChatResponse } from './types';
1
+ import type { ChatResponse } from './types';
2
2
  /**
3
3
  * @internal
4
4
  */
5
5
  export declare const useGetDataTopics: () => {
6
- data: ChatContext[] | undefined;
6
+ data: import("./types").ChatContext[] | undefined;
7
7
  isLoading: boolean;
8
8
  fetchStatus: import("@tanstack/react-query").FetchStatus;
9
9
  };
@@ -1,12 +1,9 @@
1
1
  import { JaqlQueryPayload, MetadataItem } from '@sisense/sdk-query-client';
2
2
  import { ChartDataOptions } from '../../types';
3
3
  export interface ChatContext {
4
- id: string;
5
- name: string;
6
- type: ChatContextType;
7
- description: string;
4
+ title: string;
5
+ live: boolean;
8
6
  }
9
- export type ChatContextType = 'datamodel' | 'perspective';
10
7
  export interface NlqMessage {
11
8
  role: 'assistant';
12
9
  content: string;
@@ -20,7 +17,6 @@ export type ChatMessage = RegularMessage | NlqMessage;
20
17
  export interface Chat {
21
18
  chatId: string;
22
19
  contextId: string;
23
- contextType: ChatContextType;
24
20
  contextTitle: string;
25
21
  lastUpdate: string;
26
22
  tenantId: string;
@@ -94,16 +90,6 @@ export interface QueryRecommendationConfig {
94
90
  }
95
91
  export type QueryRecommendation = Omit<NlqResponseData, 'followupQuestions'>;
96
92
  export type QueryRecommendationResponse = QueryRecommendation[];
97
- export interface DataModel {
98
- oid: string;
99
- title: string;
100
- }
101
- export interface Perspective {
102
- oid: string;
103
- name: string;
104
- description: string;
105
- isDefault: boolean;
106
- }
107
93
  export interface GetNlgQueryResultRequest {
108
94
  jaql: Pick<JaqlQueryPayload, 'datasource' | 'metadata' | 'filterRelations'>;
109
95
  }
@@ -0,0 +1,3 @@
1
+ export declare const ScrollToBottomButton: ({ onClick }: {
2
+ onClick: () => void;
3
+ }) => import("react/jsx-runtime").JSX.Element;
@@ -1,5 +1,6 @@
1
1
  type ThumbsDownButtonProps = {
2
2
  onClick?: () => void;
3
+ disabled?: boolean;
3
4
  };
4
- export default function ThumbsDownButton({ onClick }: ThumbsDownButtonProps): import("react/jsx-runtime").JSX.Element;
5
+ export default function ThumbsDownButton({ onClick, disabled }: ThumbsDownButtonProps): import("react/jsx-runtime").JSX.Element;
5
6
  export {};
@@ -1,5 +1,6 @@
1
1
  type ThumbsUpButtonProps = {
2
2
  onClick?: () => void;
3
+ disabled?: boolean;
3
4
  };
4
- export default function ThumbsUpButton({ onClick }: ThumbsUpButtonProps): import("react/jsx-runtime").JSX.Element;
5
+ export default function ThumbsUpButton({ onClick, disabled }: ThumbsUpButtonProps): import("react/jsx-runtime").JSX.Element;
5
6
  export {};
@@ -37,8 +37,18 @@ export interface ChatConfig {
37
37
  * The welcome text to show at the top of a chat session.
38
38
  *
39
39
  * A value of `false` will hide the welcome text.
40
+ *
41
+ * If not specified, a default message will be displayed.
40
42
  */
41
43
  welcomeText?: string | false;
44
+ /**
45
+ * The message text to show above the initial suggested questions in a chat session.
46
+ *
47
+ * A value of `false` will hide the text.
48
+ *
49
+ * If not specified, a default message will be displayed.
50
+ */
51
+ suggestionsWelcomeText?: string | false;
42
52
  /**
43
53
  * Boolean flag to show or hide the header in a chat session.
44
54
  *
@@ -53,6 +63,14 @@ export interface ChatConfig {
53
63
  * @internal
54
64
  */
55
65
  enableInsights?: boolean;
66
+ /**
67
+ * Boolean flag to start a clean chat on every load.
68
+ *
69
+ * Note: When the flag is `true`, chat history will be preserved and stored for the session but will not be fetched or displayed. Changing this setting back to `false` will make the entire history visible again, even if it was previously hidden. Use the "Clear History" button to completely erase the history.
70
+ *
71
+ * @default false
72
+ */
73
+ hideHistory?: boolean;
56
74
  }
57
75
  export declare const DEFAULTS: Readonly<ChatConfig>;
58
76
  export type ChatConfigProviderProps = {
@@ -6,6 +6,7 @@ interface ChatDropupProps {
6
6
  onSelection: (q: string) => void;
7
7
  anchorEl: HTMLElement | null;
8
8
  text: string;
9
+ recommendationsError: boolean;
9
10
  }
10
- export default function ChatDropup({ recentPrompts, suggestions, isLoading, onSelection, anchorEl, text, }: ChatDropupProps): import("react/jsx-runtime").JSX.Element;
11
+ export default function ChatDropup({ recentPrompts, suggestions, isLoading, onSelection, anchorEl, text, recommendationsError, }: ChatDropupProps): import("react/jsx-runtime").JSX.Element;
11
12
  export {};
@@ -5,5 +5,7 @@ export type ChatInputProps = {
5
5
  recentPrompts: string[];
6
6
  suggestions: string[];
7
7
  isLoading: boolean;
8
+ recommendationsError: boolean;
9
+ onChange?: (text: string) => void;
8
10
  };
9
- export default function ChatInput({ onSendMessage, onClearHistoryClick, disabled, recentPrompts, suggestions, isLoading, }: ChatInputProps): import("react/jsx-runtime").JSX.Element;
11
+ export default function ChatInput({ onSendMessage, onClearHistoryClick, disabled, recentPrompts, suggestions, isLoading, recommendationsError, onChange, }: ChatInputProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1 @@
1
+ export declare const CHAT_INPUT_MAX_LENGTH = 500;
@@ -1,12 +1,11 @@
1
1
  /// <reference types="react" />
2
2
  import { type IconButtonProps as MuiIconButtonProps } from '@mui/material/IconButton';
3
- import { CompleteThemeSettings } from '../../types';
4
3
  interface IconButtonProps extends MuiIconButtonProps {
5
- $themeSettings?: CompleteThemeSettings;
4
+ $hoverColor?: string;
6
5
  }
7
6
  declare const IconButton: import("@emotion/styled").StyledComponent<import("@mui/material/IconButton").IconButtonOwnProps & Omit<import("@mui/material").ButtonBaseOwnProps, "classes"> & import("@mui/material/OverridableComponent").CommonProps & Omit<Omit<import("react").DetailedHTMLProps<import("react").ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, "ref"> & {
8
7
  ref?: ((instance: HTMLButtonElement | null) => void) | import("react").RefObject<HTMLButtonElement> | null | undefined;
9
- }, "children" | "style" | "disabled" | "size" | "className" | "tabIndex" | "color" | "action" | "classes" | "sx" | "centerRipple" | "disableRipple" | "disableTouchRipple" | "focusRipple" | "focusVisibleClassName" | "LinkComponent" | "onFocusVisible" | "TouchRippleProps" | "touchRippleRef" | "disableFocusRipple" | "edge"> & {
8
+ }, "children" | "style" | "disabled" | "size" | "className" | "tabIndex" | "color" | "sx" | "classes" | "action" | "centerRipple" | "disableRipple" | "disableTouchRipple" | "focusRipple" | "focusVisibleClassName" | "LinkComponent" | "onFocusVisible" | "TouchRippleProps" | "touchRippleRef" | "disableFocusRipple" | "edge"> & {
10
9
  theme?: import("@emotion/react").Theme | undefined;
11
10
  } & IconButtonProps, {}, {}>;
12
11
  export default IconButton;
@@ -1,4 +1,4 @@
1
1
  import { type TooltipProps as MuiTooltipProps } from '@mui/material/Tooltip';
2
- type TooltipProps = Pick<MuiTooltipProps, 'title' | 'children'>;
3
- export default function Tooltip({ title, children }: TooltipProps): import("react/jsx-runtime").JSX.Element;
2
+ type TooltipProps = Pick<MuiTooltipProps, 'title' | 'placement' | 'children'>;
3
+ export default function Tooltip({ title, placement, children }: TooltipProps): import("react/jsx-runtime").JSX.Element;
4
4
  export {};
@@ -1,6 +1,5 @@
1
1
  export interface DataTopic {
2
2
  title: string;
3
- description: string;
4
3
  onClick?: () => void;
5
4
  }
6
5
  export interface Props {
@@ -1,3 +1 @@
1
- export default function LightBulbIcon({ hover }: {
2
- hover?: boolean;
3
- }): import("react/jsx-runtime").JSX.Element;
1
+ export default function LightBulbIcon(): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1 @@
1
+ export default function ScrollToBottomIcon(): import("react/jsx-runtime").JSX.Element;
@@ -3,6 +3,7 @@ export { type ChatConfig } from './chat-config';
3
3
  export { useGetNlgQueryResult, type UseGetNlgQueryResultParams, type UseGetNlgQueryResultState, } from './use-get-nlg-query-result';
4
4
  export { useGetQueryRecommendations, type UseGetQueryRecommendationsParams, type UseGetQueryRecommendationsState, } from './use-get-query-recommendations';
5
5
  export { useChatSession, type UseChatSessionResult } from './use-chat-session';
6
+ export { useLastNlqResponse } from './use-last-nlq-response';
6
7
  export { useGetDataSourceFields } from './use-get-data-source-fields';
7
8
  export type { GetNlgQueryResultRequest, QueryRecommendationResponse, QueryRecommendation, NlqResponseData, ChartRecommendations, AxesMapping, AxesMappingKey, AllPossibleChartOptionKeys, KeysOfUnion, } from './api/types';
8
9
  export { Chatbot, type ChatbotProps } from './chatbot';
@@ -6,6 +6,7 @@ type Props = {
6
6
  disabled?: boolean;
7
7
  onMouseEnter?: () => void;
8
8
  onMouseLeave?: () => void;
9
+ accessibleName?: string;
9
10
  };
10
- export default function ClickableMessage({ children, align, onClick, onMouseEnter, onMouseLeave, }: Props): import("react/jsx-runtime").JSX.Element;
11
+ export default function ClickableMessage({ children, align, onClick, onMouseEnter, onMouseLeave, accessibleName, }: Props): import("react/jsx-runtime").JSX.Element;
11
12
  export {};
@@ -4,7 +4,7 @@ type FeedbackWrapperProps = {
4
4
  data: object;
5
5
  type: string;
6
6
  buttonVisibility?: 'onHover' | 'always' | 'never';
7
- children: ReactNode;
7
+ renderContent: (buttonRow: JSX.Element) => ReactNode;
8
8
  };
9
- export default function FeedbackWrapper({ sourceId, data, type, buttonVisibility, children, }: FeedbackWrapperProps): import("react/jsx-runtime").JSX.Element;
9
+ export default function FeedbackWrapper({ sourceId, data, type, buttonVisibility, renderContent, }: FeedbackWrapperProps): import("react/jsx-runtime").JSX.Element;
10
10
  export {};
@@ -1,6 +1,11 @@
1
+ import { Themable } from '../../theme-provider/types';
1
2
  import { FC, PropsWithChildren } from 'react';
2
3
  type Alignable = {
3
4
  align: 'left' | 'right' | 'full';
4
5
  };
6
+ export declare const MessageContainer: import("@emotion/styled").StyledComponent<{
7
+ theme?: import("@emotion/react").Theme | undefined;
8
+ as?: import("react").ElementType<any, keyof import("react").JSX.IntrinsicElements> | undefined;
9
+ } & Themable & Alignable, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
5
10
  declare const TextMessage: FC<PropsWithChildren<Alignable>>;
6
11
  export default TextMessage;
@@ -0,0 +1,7 @@
1
+ type ScrollToBottomProps = {
2
+ isVisible: boolean;
3
+ anchorElement: HTMLDivElement | null;
4
+ onClick: () => void;
5
+ };
6
+ export declare const ScrollToBottom: ({ isVisible, onClick, anchorElement }: ScrollToBottomProps) => import("react/jsx-runtime").JSX.Element;
7
+ export {};
@@ -0,0 +1,19 @@
1
+ import type { NlqResponseData } from './api/types';
2
+ /**
3
+ * Parameters for the useLastNlqResponse hook.
4
+ *
5
+ * @internal
6
+ */
7
+ interface UseLastNlqResponseParams {
8
+ /** The title of the data model or perspective */
9
+ contextTitle: string;
10
+ }
11
+ /**
12
+ * React hook that returns the last NLQ response for the chat that corresponds
13
+ * to the given data model or perspective.
14
+ *
15
+ * @param params - Parameters for the hook
16
+ * @internal
17
+ */
18
+ export declare const useLastNlqResponse: ({ contextTitle, }: UseLastNlqResponseParams) => NlqResponseData | null;
19
+ export {};