@brainfish-ai/components 0.13.6 → 0.13.7

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 (184) hide show
  1. package/dist/colors/blue.d.ts +13 -0
  2. package/dist/colors/customColor.d.ts +4 -0
  3. package/dist/colors/dark.d.ts +13 -0
  4. package/dist/colors/green.d.ts +13 -0
  5. package/dist/colors/index.d.ts +128 -0
  6. package/dist/colors/orange.d.ts +13 -0
  7. package/dist/colors/pink.d.ts +13 -0
  8. package/dist/colors/primary.d.ts +20 -0
  9. package/dist/colors/purple.d.ts +13 -0
  10. package/dist/colors/red.d.ts +13 -0
  11. package/dist/colors/yellow.d.ts +13 -0
  12. package/dist/components/chat-search/Answer.d.ts +29 -0
  13. package/dist/components/chat-search/AnswerActions.d.ts +13 -0
  14. package/dist/components/chat-search/AnswerBlock.d.ts +8 -0
  15. package/dist/components/chat-search/ChatSearch.d.ts +11 -0
  16. package/dist/components/chat-search/ChatSearchContext.d.ts +34 -0
  17. package/dist/components/chat-search/FollowUpQuestions.d.ts +7 -0
  18. package/dist/components/chat-search/FollowUpSearchBar.d.ts +11 -0
  19. package/dist/components/chat-search/Header.d.ts +9 -0
  20. package/dist/components/chat-search/LoadingConversation.d.ts +2 -0
  21. package/dist/components/chat-search/LoadingSkeleton.d.ts +6 -0
  22. package/dist/components/chat-search/NextBestActions.d.ts +8 -0
  23. package/dist/components/chat-search/PrimarySearch.d.ts +29 -0
  24. package/dist/components/chat-search/ScrollToBottomArrow.d.ts +6 -0
  25. package/dist/components/chat-search/Suggestions.d.ts +9 -0
  26. package/dist/components/chat-search/TimelineNavigation.d.ts +9 -0
  27. package/dist/components/chat-search/blocks/ActionButtons.d.ts +5 -0
  28. package/dist/components/chat-search/blocks/ActionInputForm.d.ts +20 -0
  29. package/dist/components/chat-search/blocks/MarkdownText.d.ts +8 -0
  30. package/dist/components/chat-search/blocks/utils.d.ts +15 -0
  31. package/dist/components/chat-search/helpers/excuteClientAction.d.ts +9 -0
  32. package/dist/components/chat-search/helpers/nextBestActions.d.ts +7 -0
  33. package/dist/components/chat-search/hooks/index.d.ts +7 -0
  34. package/dist/components/chat-search/hooks/useAccessibleColor.d.ts +1 -0
  35. package/dist/components/chat-search/hooks/useAnswerList.d.ts +217 -0
  36. package/dist/components/chat-search/hooks/useConversationId.d.ts +5 -0
  37. package/dist/components/chat-search/hooks/useConversationLoader.d.ts +17 -0
  38. package/dist/components/chat-search/hooks/useDarkMode.d.ts +1 -0
  39. package/dist/components/chat-search/hooks/useIsChatSearchDirty.d.ts +1 -0
  40. package/dist/components/chat-search/hooks/useScrollManager.d.ts +5 -0
  41. package/dist/components/chat-search/hooks/useSubscriptionManager.d.ts +4 -0
  42. package/dist/components/chat-search/hooks/useUrlManager.d.ts +8 -0
  43. package/dist/components/chat-search/index.d.ts +5 -0
  44. package/dist/components/chat-search/text-config.d.ts +3 -0
  45. package/dist/components/chat-search/theme.d.ts +0 -0
  46. package/dist/components/chat-search/types.d.ts +253 -0
  47. package/dist/{combobox.d.ts → components/combobox/combobox.d.ts} +14 -18
  48. package/dist/components/combobox/index.d.ts +1 -0
  49. package/dist/components/data-table/data-table.d.ts +17 -0
  50. package/dist/components/data-table/index.d.ts +2 -0
  51. package/dist/{date-picker.d.ts → components/date-picker/date-picker.d.ts} +9 -12
  52. package/dist/components/date-picker/index.d.ts +1 -0
  53. package/dist/components/feedback/feedback-reason.d.ts +10 -0
  54. package/dist/{feedback.d.ts → components/feedback/feedback.d.ts} +17 -21
  55. package/dist/components/feedback/index.d.ts +1 -0
  56. package/dist/components/file-upload/file-upload-status.d.ts +17 -0
  57. package/dist/components/file-upload/file-upload.d.ts +4 -0
  58. package/dist/components/file-upload/index.d.ts +4 -0
  59. package/dist/components/file-upload/types.d.ts +18 -0
  60. package/dist/components/file-upload/utils.d.ts +1 -0
  61. package/dist/components/filter/components/CustomValueInput.d.ts +11 -0
  62. package/dist/components/filter/components/MultiSelectDropdown.d.ts +10 -0
  63. package/dist/components/filter/components/SingleSelectDropdown.d.ts +9 -0
  64. package/dist/components/filter/filter.d.ts +6 -0
  65. package/dist/components/filter/filters.d.ts +12 -0
  66. package/dist/components/filter/hooks.d.ts +9 -0
  67. package/dist/components/filter/index.d.ts +3 -0
  68. package/dist/{filter.d.ts → components/filter/types.d.ts} +59 -82
  69. package/dist/components/generating-star/generating-star.d.ts +6 -0
  70. package/dist/components/generating-star/index.d.ts +2 -0
  71. package/dist/components/markdown/CodeBlock.d.ts +7 -0
  72. package/dist/components/markdown/FormattedMessage.d.ts +14 -0
  73. package/dist/components/markdown/Frame.d.ts +10 -0
  74. package/dist/components/markdown/MemoizedReactMarkdown.d.ts +6 -0
  75. package/dist/components/markdown/MermaidDiagram.d.ts +6 -0
  76. package/dist/components/markdown/ZoomableImage.d.ts +7 -0
  77. package/dist/components/markdown/embeds/Loom.d.ts +7 -0
  78. package/dist/components/markdown/embeds/NativeVideo.d.ts +6 -0
  79. package/dist/components/markdown/embeds/Supademo.d.ts +7 -0
  80. package/dist/components/markdown/embeds/Typeform.d.ts +7 -0
  81. package/dist/components/markdown/embeds/Vimeo.d.ts +7 -0
  82. package/dist/components/markdown/embeds/Wistia.d.ts +7 -0
  83. package/dist/components/markdown/embeds/Youtube.d.ts +7 -0
  84. package/dist/components/markdown/embeds/index.d.ts +9 -0
  85. package/dist/components/markdown/index.d.ts +6 -0
  86. package/dist/components/markdown/utils/codeblock.d.ts +6 -0
  87. package/dist/components/markdown/utils/stripNewLines.d.ts +1 -0
  88. package/dist/components/select/index.d.ts +1 -0
  89. package/dist/{select.d.ts → components/select/simpleSelect.d.ts} +15 -20
  90. package/dist/env.d.ts +5 -0
  91. package/dist/esm/chunks/{ChatSearch.D_zJGwAf.js → ChatSearch.CxwRDkGx.js} +55 -24
  92. package/dist/esm/chunks/ChatSearch.CxwRDkGx.js.map +1 -0
  93. package/dist/esm/chunks/{FormattedMessage.D94rlhro.js → FormattedMessage.CpTetIzd.js} +146 -14
  94. package/dist/esm/chunks/FormattedMessage.CpTetIzd.js.map +1 -0
  95. package/dist/esm/chunks/{combobox.D30-HM1I.js → combobox.B5aw7PrS.js} +2 -2
  96. package/dist/esm/chunks/{combobox.D30-HM1I.js.map → combobox.B5aw7PrS.js.map} +1 -1
  97. package/dist/esm/chunks/{data-table.CeeSYokg.js → data-table.qS51pU0z.js} +2 -2
  98. package/dist/esm/chunks/{data-table.CeeSYokg.js.map → data-table.qS51pU0z.js.map} +1 -1
  99. package/dist/esm/chunks/{date-picker.WGre3lsB.js → date-picker.DqcdwXZS.js} +2 -2
  100. package/dist/esm/chunks/{date-picker.WGre3lsB.js.map → date-picker.DqcdwXZS.js.map} +1 -1
  101. package/dist/esm/chunks/{filters.Dx9TXuJ4.js → filters.Bd9OruMH.js} +2 -2
  102. package/dist/esm/chunks/{filters.Dx9TXuJ4.js.map → filters.Bd9OruMH.js.map} +1 -1
  103. package/dist/esm/chunks/{generating-star.C6eGHpse.js → generating-star.B0RUXRff.js} +2 -2
  104. package/dist/esm/chunks/{generating-star.C6eGHpse.js.map → generating-star.B0RUXRff.js.map} +1 -1
  105. package/dist/esm/chunks/{simpleSelect.Bzw8xrbM.js → simpleSelect.BfAgKOea.js} +2 -2
  106. package/dist/esm/chunks/{simpleSelect.Bzw8xrbM.js.map → simpleSelect.BfAgKOea.js.map} +1 -1
  107. package/dist/esm/chunks/{utils.DmKr1Ojo.js → utils.DaMF_LVC.js} +2 -3
  108. package/dist/esm/chunks/utils.DaMF_LVC.js.map +1 -0
  109. package/dist/esm/components/chat-search.js +1 -1
  110. package/dist/esm/components/combobox.js +1 -1
  111. package/dist/esm/components/data-table.js +1 -1
  112. package/dist/esm/components/date-picker.js +1 -1
  113. package/dist/esm/components/filter.js +1 -1
  114. package/dist/esm/components/generating-star.js +1 -1
  115. package/dist/esm/components/markdown.js +1 -1
  116. package/dist/esm/components/select.js +1 -1
  117. package/dist/esm/components/ui/accordion.js +1 -1
  118. package/dist/esm/components/ui/accordion.js.map +1 -1
  119. package/dist/esm/components/ui/badge.js +1 -1
  120. package/dist/esm/components/ui/button.js +1 -1
  121. package/dist/esm/components/ui/calendar.js +1 -1
  122. package/dist/esm/components/ui/card.js +1 -1
  123. package/dist/esm/components/ui/command.js +1 -1
  124. package/dist/esm/components/ui/dialog.js +1 -1
  125. package/dist/esm/components/ui/dialog.js.map +1 -1
  126. package/dist/esm/components/ui/dropdown-menu.js +1 -1
  127. package/dist/esm/components/ui/input.js +1 -1
  128. package/dist/esm/components/ui/label.js +1 -1
  129. package/dist/esm/components/ui/popover.js +1 -1
  130. package/dist/esm/components/ui/progress.js +1 -1
  131. package/dist/esm/components/ui/scroll-area.js +1 -1
  132. package/dist/esm/components/ui/select.js +1 -1
  133. package/dist/esm/components/ui/switch.js +1 -1
  134. package/dist/esm/components/ui/table.js +1 -1
  135. package/dist/esm/components/ui/textarea.js +1 -1
  136. package/dist/esm/components/ui/tooltip.js +1 -1
  137. package/dist/esm/index.css +1 -1
  138. package/dist/esm/index.js +8 -8
  139. package/dist/index.d.ts +27 -1063
  140. package/dist/lib/addUtmParams.d.ts +20 -0
  141. package/dist/lib/api.d.ts +96 -0
  142. package/dist/lib/feature-flags.d.ts +9 -0
  143. package/dist/lib/features.d.ts +3 -0
  144. package/dist/lib/fetchClient.d.ts +19 -0
  145. package/dist/lib/getContentType.d.ts +1 -0
  146. package/dist/lib/hooks.d.ts +15 -0
  147. package/dist/lib/utils.d.ts +8 -0
  148. package/dist/stats.html +1 -1
  149. package/package.json +8 -2
  150. package/dist/accordion.d.ts +0 -12
  151. package/dist/badge.d.ts +0 -14
  152. package/dist/button.d.ts +0 -16
  153. package/dist/calendar.d.ts +0 -12
  154. package/dist/card.d.ts +0 -17
  155. package/dist/chat-search.d.ts +0 -414
  156. package/dist/collapsible.d.ts +0 -10
  157. package/dist/command.d.ts +0 -90
  158. package/dist/components/chat-search.d.ts +0 -2
  159. package/dist/components/combobox.d.ts +0 -2
  160. package/dist/components/data-table.d.ts +0 -2
  161. package/dist/components/date-picker.d.ts +0 -2
  162. package/dist/components/feedback.d.ts +0 -2
  163. package/dist/components/filter.d.ts +0 -2
  164. package/dist/components/generating-star.d.ts +0 -6
  165. package/dist/components/markdown.d.ts +0 -2
  166. package/dist/components/select.d.ts +0 -2
  167. package/dist/data-table.d.ts +0 -23
  168. package/dist/dialog.d.ts +0 -30
  169. package/dist/dropdown-menu.d.ts +0 -43
  170. package/dist/esm/chunks/ChatSearch.D_zJGwAf.js.map +0 -1
  171. package/dist/esm/chunks/FormattedMessage.D94rlhro.js.map +0 -1
  172. package/dist/esm/chunks/utils.DmKr1Ojo.js.map +0 -1
  173. package/dist/generating-star.d.ts +0 -10
  174. package/dist/icon.d.ts +0 -26
  175. package/dist/input.d.ts +0 -11
  176. package/dist/label.d.ts +0 -8
  177. package/dist/markdown.d.ts +0 -54
  178. package/dist/popover.d.ts +0 -12
  179. package/dist/progress.d.ts +0 -8
  180. package/dist/scroll-area.d.ts +0 -8
  181. package/dist/switch.d.ts +0 -6
  182. package/dist/table.d.ts +0 -19
  183. package/dist/textarea.d.ts +0 -5
  184. package/dist/tooltip.d.ts +0 -18
@@ -0,0 +1,217 @@
1
+ import { ActionInputs, ActionInput, Answer, AnswerBlock, FeedbackResponse, JSONSchema, SearchResult } from '../types';
2
+ export declare const AnswersActions: {
3
+ readonly SET_ANSWERS: "answers/set_answers";
4
+ readonly CLEAR_ALL: "answers/clear_all";
5
+ readonly APPEND_NEW_ANSWER: "answers/create_empty_answer";
6
+ readonly APPEND_BLOCK: "answers/append_block";
7
+ readonly APPEND_ANSWER_CHUNK: "answers/append_stream_chunk";
8
+ readonly SET_SEARCH_RESULTS: "answers/update_search_results";
9
+ readonly SET_FOLLOW_UP_QUESTIONS: "answers/set_follow_up_questions";
10
+ readonly COMPLETE_ANSWER: "answers/finish_streaming";
11
+ readonly SET_ANSWER_ERROR: "answers/set_error_state";
12
+ readonly SET_USER_FEEDBACK: "answers/set_user_feedback";
13
+ readonly CLEAR_USER_FEEDBACK: "answers/clear_user_feedback";
14
+ readonly MARK_AS_UNCERTAIN: "answers/mark_as_uncertain";
15
+ readonly NO_ARTICLES_FOUND: "answers/no_articles_found";
16
+ readonly GET_ACTION_INPUTS: "answers/request_action_inputs";
17
+ readonly INVOKE_ACTION: "answers/invoke_action";
18
+ readonly ADD_ACTION_BUTTONS: "answers/add_action_buttons";
19
+ };
20
+ type SetAnswers = {
21
+ type: typeof AnswersActions.SET_ANSWERS;
22
+ payload: {
23
+ answers: Answer[];
24
+ };
25
+ };
26
+ type ClearAll = {
27
+ type: typeof AnswersActions.CLEAR_ALL;
28
+ };
29
+ type AppendNewAnswer = {
30
+ type: typeof AnswersActions.APPEND_NEW_ANSWER;
31
+ payload: {
32
+ id?: string;
33
+ query: string;
34
+ };
35
+ };
36
+ type SetSearchResults = {
37
+ type: typeof AnswersActions.SET_SEARCH_RESULTS;
38
+ payload: {
39
+ searchQueryId: string;
40
+ results: SearchResult[];
41
+ index?: number;
42
+ state?: Answer['state'];
43
+ };
44
+ };
45
+ type AppendAnswerChunk = {
46
+ type: typeof AnswersActions.APPEND_ANSWER_CHUNK;
47
+ payload: {
48
+ text: string;
49
+ index?: number;
50
+ };
51
+ };
52
+ type SetAnswerError = {
53
+ type: typeof AnswersActions.SET_ANSWER_ERROR;
54
+ payload: {
55
+ error: string;
56
+ index?: number;
57
+ };
58
+ };
59
+ type SetUserFeedback = {
60
+ type: typeof AnswersActions.SET_USER_FEEDBACK;
61
+ payload: {
62
+ feedback: FeedbackResponse;
63
+ index?: number;
64
+ };
65
+ };
66
+ type ClearUserFeedback = {
67
+ type: typeof AnswersActions.CLEAR_USER_FEEDBACK;
68
+ payload: {
69
+ index?: number;
70
+ };
71
+ };
72
+ type SetFollowUpQuestions = {
73
+ type: typeof AnswersActions.SET_FOLLOW_UP_QUESTIONS;
74
+ payload: {
75
+ questions: string[];
76
+ index?: number;
77
+ };
78
+ };
79
+ type AppendBlock = {
80
+ type: typeof AnswersActions.APPEND_BLOCK;
81
+ payload: {
82
+ block: AnswerBlock;
83
+ index?: number;
84
+ };
85
+ };
86
+ type CompleteAnswer = {
87
+ type: typeof AnswersActions.COMPLETE_ANSWER;
88
+ payload: {
89
+ index?: number;
90
+ };
91
+ };
92
+ type MarkAsUncertain = {
93
+ type: typeof AnswersActions.MARK_AS_UNCERTAIN;
94
+ payload: {
95
+ uncertaintyText: string;
96
+ index?: number;
97
+ };
98
+ };
99
+ type GetActionInputs = {
100
+ type: typeof AnswersActions.GET_ACTION_INPUTS;
101
+ payload: {
102
+ searchIntentId: string;
103
+ actionId: string;
104
+ inputs: ActionInput[];
105
+ schema: JSONSchema<ActionInputs>;
106
+ initialValues: ActionInputs;
107
+ onSubmit: (parameters: ActionInputs) => void;
108
+ index?: number;
109
+ };
110
+ };
111
+ type AddActionButtons = {
112
+ type: typeof AnswersActions.ADD_ACTION_BUTTONS;
113
+ payload: {
114
+ searchIntentId: string;
115
+ actions: Array<{
116
+ id: string;
117
+ type: string;
118
+ action: {
119
+ version: string;
120
+ options: {
121
+ title?: string;
122
+ [key: string]: any;
123
+ };
124
+ };
125
+ }>;
126
+ index?: number;
127
+ };
128
+ };
129
+ type InvokeAction = {
130
+ type: typeof AnswersActions.INVOKE_ACTION;
131
+ payload: {
132
+ index?: number;
133
+ };
134
+ };
135
+ type NoArticlesFound = {
136
+ type: typeof AnswersActions.NO_ARTICLES_FOUND;
137
+ payload: {
138
+ index?: number;
139
+ };
140
+ };
141
+ export type AnswerListAction = SetAnswers | ClearAll | AppendNewAnswer | SetSearchResults | AppendAnswerChunk | SetAnswerError | SetUserFeedback | ClearUserFeedback | SetFollowUpQuestions | AppendBlock | CompleteAnswer | MarkAsUncertain | InvokeAction | GetActionInputs | AddActionButtons | NoArticlesFound;
142
+ export declare const setAnswers: ({ answers }: {
143
+ answers: Answer[];
144
+ }) => SetAnswers;
145
+ export declare const clearAll: () => ClearAll;
146
+ export declare const appendNewAnswer: ({ id, query }: {
147
+ id?: string | undefined;
148
+ query: string;
149
+ }) => AppendNewAnswer;
150
+ export declare const setSearchResults: ({ searchQueryId, results, index, state, }: {
151
+ searchQueryId: string;
152
+ results: SearchResult[];
153
+ index?: number | undefined;
154
+ state?: import('../types').AnswerState | undefined;
155
+ }) => SetSearchResults;
156
+ export declare const appendAnswerChunk: ({ text, index }: {
157
+ text: string;
158
+ index?: number | undefined;
159
+ }) => AppendAnswerChunk;
160
+ export declare const setAnswerError: ({ error, index }: {
161
+ error: string;
162
+ index?: number | undefined;
163
+ }) => SetAnswerError;
164
+ export declare const setUserFeedback: ({ feedback, index }: {
165
+ feedback: FeedbackResponse;
166
+ index?: number | undefined;
167
+ }) => SetUserFeedback;
168
+ export declare const clearUserFeedback: ({ index }?: {
169
+ index?: number | undefined;
170
+ }) => ClearUserFeedback;
171
+ export declare const setFollowUpQuestions: ({ questions, index }: {
172
+ questions: string[];
173
+ index?: number | undefined;
174
+ }) => SetFollowUpQuestions;
175
+ export declare const appendBlock: ({ block, index }: {
176
+ block: AnswerBlock;
177
+ index?: number | undefined;
178
+ }) => AppendBlock;
179
+ export declare const completeAnswer: ({ index }?: {
180
+ index?: number | undefined;
181
+ }) => CompleteAnswer;
182
+ export declare const markAsUncertain: ({ uncertaintyText, index }: {
183
+ uncertaintyText: string;
184
+ index?: number | undefined;
185
+ }) => MarkAsUncertain;
186
+ export declare const invokeAction: ({ index }?: {
187
+ index?: number | undefined;
188
+ }) => InvokeAction;
189
+ export declare const noArticlesFound: ({ index }?: {
190
+ index?: number | undefined;
191
+ }) => NoArticlesFound;
192
+ export declare const getActionInputs: ({ searchIntentId, actionId, inputs, schema, initialValues, onSubmit, index, }: {
193
+ searchIntentId: string;
194
+ actionId: string;
195
+ inputs: ActionInput[];
196
+ schema: JSONSchema<ActionInputs>;
197
+ initialValues: ActionInputs;
198
+ onSubmit: (parameters: ActionInputs) => void;
199
+ index?: number | undefined;
200
+ }) => GetActionInputs;
201
+ export declare const addActionButtons: ({ searchIntentId, actions, index, }: {
202
+ searchIntentId: string;
203
+ actions: {
204
+ id: string;
205
+ type: string;
206
+ action: {
207
+ version: string;
208
+ options: {
209
+ [key: string]: any;
210
+ title?: string | undefined;
211
+ };
212
+ };
213
+ }[];
214
+ index?: number | undefined;
215
+ }) => AddActionButtons;
216
+ export declare const useAnswerList: () => [Answer[], import('react').Dispatch<AnswerListAction>];
217
+ export {};
@@ -0,0 +1,5 @@
1
+ export declare const useConversationId: (searchPath?: string) => {
2
+ conversationId: string | undefined;
3
+ setConversationId: (id: string) => void;
4
+ clearConversationId: () => void;
5
+ };
@@ -0,0 +1,17 @@
1
+ import { TextConfig } from '../text-config';
2
+ interface UseLoadConversationProps {
3
+ loadConversationEndpoint: string | undefined;
4
+ headers?: Record<string, string>;
5
+ mergedTextConfig: TextConfig;
6
+ }
7
+ /**
8
+ * Hook to load a conversation by ID.
9
+ * @param loadConversationEndpoint - The endpoint to use to load the conversation.
10
+ * @param headers - The headers to use when loading the conversation.
11
+ * @param mergedTextConfig - The text configuration to use.
12
+ * @returns The function to load a conversation by ID.
13
+ */
14
+ export declare const useConversationLoader: ({ loadConversationEndpoint, headers, mergedTextConfig }: UseLoadConversationProps) => {
15
+ loadConversationById: (conversationId: string) => (() => void) | undefined;
16
+ };
17
+ export {};
@@ -0,0 +1 @@
1
+ export declare const useDarkMode: () => boolean;
@@ -0,0 +1 @@
1
+ export declare const useIsChatSearchDirty: () => boolean;
@@ -0,0 +1,5 @@
1
+ import { RefObject } from 'react';
2
+ export declare const useScrollManager: (answerRefs: RefObject<(HTMLDivElement | null)[]>, containerRef: RefObject<HTMLDivElement | null>) => {
3
+ scrollToLastAnswer: () => void;
4
+ scrollToAnswer: (index: number) => void;
5
+ };
@@ -0,0 +1,4 @@
1
+ import { ChatSearchState } from '../types';
2
+ export declare const useSubscriptionManager: () => {
3
+ subscribeToStateChanges: (callback: (state: ChatSearchState) => void) => () => void;
4
+ };
@@ -0,0 +1,8 @@
1
+ /**
2
+ * Manages the URL based on the conversation ID and answers.
3
+ * @param searchPath - The path to use in the URL.
4
+ */
5
+ export declare const useUrlManager: (searchPath?: string) => {
6
+ updateUrlWithConversationId: (conversationId: string) => void;
7
+ removeConversationIdFromUrl: () => void;
8
+ };
@@ -0,0 +1,5 @@
1
+ export { default as ChatSearch } from './ChatSearch';
2
+ export type { ChatSearchHandle } from './ChatSearch';
3
+ export type { Answer, ChatSearchProps, Collection, ChatSearchState } from './types';
4
+ export { ChatSearchProvider, useChatSearch } from './ChatSearchContext';
5
+ export * from './hooks/useIsChatSearchDirty';
@@ -0,0 +1,3 @@
1
+ import { TextConfig as TextConfigType } from './types';
2
+ export type TextConfig = TextConfigType;
3
+ export declare const defaultTextConfig: TextConfig;
File without changes
@@ -0,0 +1,253 @@
1
+ import { JSONSchemaType } from 'ajv';
2
+ import { FeatureFlags } from '../../lib/feature-flags';
3
+ export type JSONSchema<T> = JSONSchemaType<T>;
4
+ export interface TextConfig {
5
+ headerText?: string;
6
+ searchPlaceholder?: string;
7
+ attachImageText?: string;
8
+ allDocumentsText?: string;
9
+ loadingSearchText?: string;
10
+ loadingAnswerText?: string;
11
+ errorText?: string;
12
+ followUpPlaceholder?: string;
13
+ positiveAnswerText?: string;
14
+ negativeAnswerText?: string;
15
+ suggestionsTitle?: string;
16
+ uncertaintyFallbackText?: Record<string, string>;
17
+ }
18
+ export declare enum ActionType {
19
+ CallPhone = "call_phone",
20
+ OpenUrl = "open_url",
21
+ SendEmail = "send_email",
22
+ RunCallback = "run_callback"
23
+ }
24
+ export type FeedbackResponse = 'accept' | 'reject';
25
+ export type APIFeedbackResponse = 'positive' | 'negative';
26
+ /**
27
+ * Defines a URL redirect rule with pattern matching
28
+ * @example { source: '/knowledge/:id/:path', destination: '/knowledge/test/:path' }
29
+ */
30
+ export type RedirectRule = {
31
+ source: string;
32
+ destination: string;
33
+ };
34
+ export type MarkdownTextBlock = {
35
+ id: string;
36
+ type: 'markdown-text';
37
+ text: string;
38
+ };
39
+ export type ActionButtonsBlock = {
40
+ id: string;
41
+ type: 'action-buttons';
42
+ };
43
+ export type ActionInputFormBlock = {
44
+ id: string;
45
+ type: 'action-input-form';
46
+ state: 'ready' | 'processing' | 'completed';
47
+ actionId: string;
48
+ initialValues: ActionInputs;
49
+ schema: ActionInputsSchema;
50
+ onSubmit?: (inputs: ActionInputs) => void;
51
+ inputs: ActionInput[];
52
+ };
53
+ export type ActionInput = {
54
+ name: string;
55
+ required: boolean;
56
+ schema: {
57
+ type: string;
58
+ title: string;
59
+ description: string;
60
+ oneOf?: {
61
+ const: string;
62
+ title: string;
63
+ }[];
64
+ };
65
+ type: string;
66
+ ui: {
67
+ type: string;
68
+ };
69
+ };
70
+ export type AnswerBlock = MarkdownTextBlock | ActionButtonsBlock | ActionInputFormBlock;
71
+ export type CreateAnswerBlock = Omit<MarkdownTextBlock, 'id'> | Omit<ActionButtonsBlock, 'id'> | Omit<ActionInputFormBlock, 'id'>;
72
+ export type AnswerState = 'fetching-search-results' | 'fetching-stream' | 'streaming' | 'getting-action-inputs' | 'completed';
73
+ export type ActionClick = {
74
+ action: NextBestAction;
75
+ searchQueryId: string;
76
+ query: string;
77
+ answer: string;
78
+ };
79
+ export type Action = {
80
+ id: string;
81
+ type: ActionType;
82
+ action: {
83
+ version: string;
84
+ options: {
85
+ title?: string;
86
+ [key: string]: any;
87
+ };
88
+ };
89
+ };
90
+ export interface Answer {
91
+ id: string;
92
+ state: AnswerState;
93
+ question: string;
94
+ blocks: AnswerBlock[];
95
+ searchResults?: SearchResult[];
96
+ followUpQuestions?: string[];
97
+ searchQueryId?: string;
98
+ feedback?: FeedbackResponse;
99
+ isUncertain?: boolean;
100
+ uncertaintyLanguage?: string | null;
101
+ uncertaintyFallbackText?: string;
102
+ searchIntentId?: string;
103
+ actions?: Action[];
104
+ }
105
+ export type ActionInputValue = string | number | boolean | null;
106
+ export type ActionInputs = Record<string, ActionInputValue>;
107
+ export type ActionInputsSchema = JSONSchemaType<ActionInputs>;
108
+ export type AnswerStreamRequest = {
109
+ type: 'generate-for-query';
110
+ searchQueryId: string;
111
+ conversationId?: string;
112
+ } | {
113
+ type: 'invoke-action';
114
+ searchIntentId: string;
115
+ actionId: string;
116
+ parameters: ActionInputs;
117
+ conversationId?: string;
118
+ };
119
+ export type ClientExecutionResult = {
120
+ success: boolean;
121
+ data?: Record<string, any>;
122
+ reason?: string;
123
+ };
124
+ export interface SearchResult {
125
+ id: string;
126
+ title: string;
127
+ url: string;
128
+ }
129
+ export interface SearchResponse {
130
+ results: SearchResult[];
131
+ searchQueryId: string;
132
+ isAgenticResponse?: boolean;
133
+ }
134
+ export interface FollowUpQuestionsResponse {
135
+ questions: string[];
136
+ }
137
+ export interface Collection {
138
+ id: string;
139
+ name: string;
140
+ }
141
+ export interface Suggestion {
142
+ id: string;
143
+ question: string;
144
+ conversationId?: string;
145
+ messageCount?: number;
146
+ }
147
+ export interface ChatSearchProps {
148
+ suggestions?: Suggestion[];
149
+ collections?: Array<{
150
+ id: string;
151
+ name: string;
152
+ }>;
153
+ selectedCollectionId?: string;
154
+ onCollectionChange?: (collectionId: string) => void;
155
+ searchEndpoint: string;
156
+ answerEndpoint: string;
157
+ answerStreamEndpoint: string;
158
+ feedbackEndpoint?: string;
159
+ feedbackReasonEndpoint?: string;
160
+ loadConversationEndpoint?: string;
161
+ followUpQuestionsEndpoint?: string;
162
+ autocompleteEndpoint?: string;
163
+ disableFollowUpQuestions?: boolean;
164
+ disableImageAttachment?: boolean;
165
+ disableFeedback?: boolean;
166
+ disclaimer?: string;
167
+ offset?: number;
168
+ headers?: Record<string, string>;
169
+ textConfig?: TextConfig;
170
+ searchPath?: string;
171
+ className?: string;
172
+ onToggleSizeButtonClick?: () => void;
173
+ trackEvent?: (eventName: string, data?: Record<string, any>) => void;
174
+ featureFlags?: FeatureFlags;
175
+ onCloseWidget?: () => void;
176
+ isWidgetMode?: boolean;
177
+ nextBestActions?: NextBestAction[];
178
+ bodyActionButtons?: NextBestAction[];
179
+ onNextBestActionClick?: ({ action, searchQueryId, query, answer, }: {
180
+ action: NextBestAction;
181
+ searchQueryId: string;
182
+ query: string;
183
+ answer: string;
184
+ }) => void;
185
+ userData?: Record<string, unknown> | null;
186
+ redirectRules?: RedirectRule[];
187
+ secretAttributes?: string;
188
+ allowedRegions?: string[];
189
+ style?: React.CSSProperties;
190
+ }
191
+ export interface ChatSearchState {
192
+ showResults: boolean;
193
+ answers: Answer[];
194
+ isLoading: boolean;
195
+ error?: string;
196
+ }
197
+ type TextChunk = {
198
+ type: 'answer-text-chunk';
199
+ content: string;
200
+ };
201
+ type GetActionInputs = {
202
+ type: 'get-action-inputs';
203
+ schema: ActionInputsSchema;
204
+ values: Record<string, string | number | boolean | null>;
205
+ searchIntentId: string;
206
+ actionId: string;
207
+ inputs: ActionInput[];
208
+ actionType: string;
209
+ actionKey: string;
210
+ };
211
+ export type ActionButtons = {
212
+ type: 'action-buttons';
213
+ actions: Array<{
214
+ id: string;
215
+ type: string;
216
+ action: {
217
+ version: string;
218
+ options: {
219
+ title?: string;
220
+ phoneNumber?: string;
221
+ to?: string;
222
+ [key: string]: any;
223
+ };
224
+ };
225
+ }>;
226
+ searchIntentId: string;
227
+ };
228
+ export type Citations = {
229
+ type: 'citations';
230
+ data: SearchResult[];
231
+ };
232
+ export type AnswerStreamEvent = TextChunk | GetActionInputs | ActionButtons | Citations;
233
+ type UrlString = string & {
234
+ __url: never;
235
+ };
236
+ export declare const validateUrlString: (value: string) => UrlString;
237
+ export declare enum NextBestActionType {
238
+ Link = "link",
239
+ Email = "email",
240
+ Phone = "phone",
241
+ Callback = "callback",
242
+ Function = "function"
243
+ }
244
+ export type NextBestAction = {
245
+ id?: string;
246
+ label: string;
247
+ type: NextBestActionType;
248
+ icon?: string | UrlString;
249
+ value: any;
250
+ };
251
+ export type SearchQueryAttribute = string | number | boolean | null;
252
+ export type SearchQueryAttributes = Record<string, SearchQueryAttribute>;
253
+ export {};
@@ -1,18 +1,14 @@
1
- import * as React_2 from 'react';
2
-
3
- export declare function Combobox({ options, defaultValueLabel, placeholder, noResultsLabel, className, onOpenChange, onChange, }: ComboboxProps): React_2.JSX.Element;
4
-
5
- export declare interface ComboboxProps {
6
- options: {
7
- value: string;
8
- label: string;
9
- }[];
10
- defaultValueLabel: string;
11
- placeholder: string;
12
- noResultsLabel: string;
13
- className?: string;
14
- onOpenChange?: (open: boolean) => void;
15
- onChange?: (value: string) => void;
16
- }
17
-
18
- export { }
1
+ import * as React from 'react';
2
+ export interface ComboboxProps {
3
+ options: {
4
+ value: string;
5
+ label: string;
6
+ }[];
7
+ defaultValueLabel: string;
8
+ placeholder: string;
9
+ noResultsLabel: string;
10
+ className?: string;
11
+ onOpenChange?: (open: boolean) => void;
12
+ onChange?: (value: string) => void;
13
+ }
14
+ export declare function Combobox({ options, defaultValueLabel, placeholder, noResultsLabel, className, onOpenChange, onChange, }: ComboboxProps): React.JSX.Element;
@@ -0,0 +1 @@
1
+ export * from './combobox';
@@ -0,0 +1,17 @@
1
+ import { default as React } from 'react';
2
+ import { ColumnDef, Row } from '@tanstack/react-table';
3
+ export type ExtendedColumnDef<TData, TValue = unknown> = ColumnDef<TData, TValue> & {
4
+ expandedContent?: (row: Row<TData>) => React.ReactNode;
5
+ };
6
+ export interface DataTableProps<TData, TValue> extends React.HTMLAttributes<HTMLDivElement> {
7
+ columns: ExtendedColumnDef<TData, TValue>[];
8
+ data: TData[];
9
+ getRowCanExpand?: (row: Row<TData>) => boolean;
10
+ className?: string;
11
+ expandeRowClassName?: string;
12
+ isLoading?: boolean;
13
+ skeletonRowCount?: number;
14
+ }
15
+ export declare function DataTable<TData extends Record<string, any> & {
16
+ id?: string | number;
17
+ }, TValue>({ columns, data, getRowCanExpand, className, expandeRowClassName, isLoading, skeletonRowCount, ...props }: DataTableProps<TData, TValue>): React.JSX.Element;
@@ -0,0 +1,2 @@
1
+ export { DataTable } from './data-table';
2
+ export type { DataTableProps, ExtendedColumnDef } from './data-table';
@@ -1,12 +1,9 @@
1
- import * as React_2 from 'react';
2
-
3
- export declare function DatePicker({ date, setDate, className, placeholder }: DatePickerProps): React_2.JSX.Element;
4
-
5
- declare interface DatePickerProps {
6
- date: Date | undefined;
7
- setDate: (date: Date | undefined) => void;
8
- className?: string;
9
- placeholder?: string;
10
- }
11
-
12
- export { }
1
+ import * as React from 'react';
2
+ interface DatePickerProps {
3
+ date: Date | undefined;
4
+ setDate: (date: Date | undefined) => void;
5
+ className?: string;
6
+ placeholder?: string;
7
+ }
8
+ export declare function DatePicker({ date, setDate, className, placeholder }: DatePickerProps): React.JSX.Element;
9
+ export {};
@@ -0,0 +1 @@
1
+ export * from './date-picker';
@@ -0,0 +1,10 @@
1
+ import { default as React } from 'react';
2
+ interface FeedbackReasonProps {
3
+ open: boolean;
4
+ onSubmit?: (reason: string) => void;
5
+ thankYouText?: string;
6
+ placeholder?: string;
7
+ maxLength?: number;
8
+ }
9
+ export declare function FeedbackReason({ open, onSubmit, thankYouText, placeholder, maxLength, }: FeedbackReasonProps): React.JSX.Element;
10
+ export {};
@@ -1,21 +1,17 @@
1
- import { default as default_2 } from 'react';
2
-
3
- export declare function Feedback({ feedback, onFeedback, textConfig, disabled, feedbackReasonLength, feedbackReasonPlaceholder, onFeedbackReasonSubmit, feedbackReasonThankYouText, }: FeedbackProps): default_2.JSX.Element;
4
-
5
- declare interface FeedbackProps {
6
- feedback?: FeedbackResponse;
7
- onFeedback?: (response: FeedbackResponse) => void;
8
- textConfig?: {
9
- positiveAnswerText?: string;
10
- negativeAnswerText?: string;
11
- };
12
- disabled?: boolean;
13
- feedbackReasonLength?: number;
14
- feedbackReasonPlaceholder?: string;
15
- onFeedbackReasonSubmit?: (reason: string) => void;
16
- feedbackReasonThankYouText?: string;
17
- }
18
-
19
- export declare type FeedbackResponse = 'accept' | 'reject';
20
-
21
- export { }
1
+ import { default as React } from 'react';
2
+ export type FeedbackResponse = 'accept' | 'reject';
3
+ interface FeedbackProps {
4
+ feedback?: FeedbackResponse;
5
+ onFeedback?: (response: FeedbackResponse) => void;
6
+ textConfig?: {
7
+ positiveAnswerText?: string;
8
+ negativeAnswerText?: string;
9
+ };
10
+ disabled?: boolean;
11
+ feedbackReasonLength?: number;
12
+ feedbackReasonPlaceholder?: string;
13
+ onFeedbackReasonSubmit?: (reason: string) => void;
14
+ feedbackReasonThankYouText?: string;
15
+ }
16
+ export declare function Feedback({ feedback, onFeedback, textConfig, disabled, feedbackReasonLength, feedbackReasonPlaceholder, onFeedbackReasonSubmit, feedbackReasonThankYouText, }: FeedbackProps): React.JSX.Element;
17
+ export {};
@@ -0,0 +1 @@
1
+ export { Feedback, type FeedbackResponse } from './feedback';