@brainfish-ai/components 0.13.6 → 0.13.8
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/colors/blue.d.ts +13 -0
- package/dist/colors/customColor.d.ts +4 -0
- package/dist/colors/dark.d.ts +13 -0
- package/dist/colors/green.d.ts +13 -0
- package/dist/colors/index.d.ts +128 -0
- package/dist/colors/orange.d.ts +13 -0
- package/dist/colors/pink.d.ts +13 -0
- package/dist/colors/primary.d.ts +20 -0
- package/dist/colors/purple.d.ts +13 -0
- package/dist/colors/red.d.ts +13 -0
- package/dist/colors/yellow.d.ts +13 -0
- package/dist/components/chat-search/Answer.d.ts +29 -0
- package/dist/components/chat-search/AnswerActions.d.ts +13 -0
- package/dist/components/chat-search/AnswerBlock.d.ts +8 -0
- package/dist/components/chat-search/ChatSearch.d.ts +11 -0
- package/dist/components/chat-search/ChatSearchContext.d.ts +34 -0
- package/dist/components/chat-search/FollowUpQuestions.d.ts +7 -0
- package/dist/components/chat-search/FollowUpSearchBar.d.ts +11 -0
- package/dist/components/chat-search/Header.d.ts +9 -0
- package/dist/components/chat-search/LoadingConversation.d.ts +2 -0
- package/dist/components/chat-search/LoadingSkeleton.d.ts +6 -0
- package/dist/components/chat-search/NextBestActions.d.ts +8 -0
- package/dist/components/chat-search/PrimarySearch.d.ts +29 -0
- package/dist/components/chat-search/ScrollToBottomArrow.d.ts +6 -0
- package/dist/components/chat-search/Suggestions.d.ts +9 -0
- package/dist/components/chat-search/TimelineNavigation.d.ts +9 -0
- package/dist/components/chat-search/blocks/ActionButtons.d.ts +5 -0
- package/dist/components/chat-search/blocks/ActionInputForm.d.ts +20 -0
- package/dist/components/chat-search/blocks/MarkdownText.d.ts +8 -0
- package/dist/components/chat-search/blocks/utils.d.ts +15 -0
- package/dist/components/chat-search/helpers/excuteClientAction.d.ts +9 -0
- package/dist/components/chat-search/helpers/nextBestActions.d.ts +7 -0
- package/dist/components/chat-search/hooks/index.d.ts +7 -0
- package/dist/components/chat-search/hooks/useAccessibleColor.d.ts +1 -0
- package/dist/components/chat-search/hooks/useAnswerList.d.ts +217 -0
- package/dist/components/chat-search/hooks/useConversationId.d.ts +5 -0
- package/dist/components/chat-search/hooks/useConversationLoader.d.ts +17 -0
- package/dist/components/chat-search/hooks/useDarkMode.d.ts +1 -0
- package/dist/components/chat-search/hooks/useIsChatSearchDirty.d.ts +1 -0
- package/dist/components/chat-search/hooks/useScrollManager.d.ts +6 -0
- package/dist/components/chat-search/hooks/useSubscriptionManager.d.ts +4 -0
- package/dist/components/chat-search/hooks/useUrlManager.d.ts +8 -0
- package/dist/components/chat-search/index.d.ts +5 -0
- package/dist/components/chat-search/text-config.d.ts +3 -0
- package/dist/components/chat-search/theme.d.ts +0 -0
- package/dist/components/chat-search/types.d.ts +253 -0
- package/dist/{combobox.d.ts → components/combobox/combobox.d.ts} +14 -18
- package/dist/components/combobox/index.d.ts +1 -0
- package/dist/components/data-table/data-table.d.ts +17 -0
- package/dist/components/data-table/index.d.ts +2 -0
- package/dist/{date-picker.d.ts → components/date-picker/date-picker.d.ts} +9 -12
- package/dist/components/date-picker/index.d.ts +1 -0
- package/dist/components/feedback/feedback-reason.d.ts +10 -0
- package/dist/{feedback.d.ts → components/feedback/feedback.d.ts} +17 -21
- package/dist/components/feedback/index.d.ts +1 -0
- package/dist/components/file-upload/file-upload-status.d.ts +17 -0
- package/dist/components/file-upload/file-upload.d.ts +4 -0
- package/dist/components/file-upload/index.d.ts +4 -0
- package/dist/components/file-upload/types.d.ts +18 -0
- package/dist/components/file-upload/utils.d.ts +1 -0
- package/dist/components/filter/components/CustomValueInput.d.ts +11 -0
- package/dist/components/filter/components/MultiSelectDropdown.d.ts +10 -0
- package/dist/components/filter/components/SingleSelectDropdown.d.ts +9 -0
- package/dist/components/filter/filter.d.ts +6 -0
- package/dist/components/filter/filters.d.ts +12 -0
- package/dist/components/filter/hooks.d.ts +9 -0
- package/dist/components/filter/index.d.ts +3 -0
- package/dist/{filter.d.ts → components/filter/types.d.ts} +59 -82
- package/dist/components/generating-star/generating-star.d.ts +6 -0
- package/dist/components/generating-star/index.d.ts +2 -0
- package/dist/components/markdown/CodeBlock.d.ts +7 -0
- package/dist/components/markdown/FormattedMessage.d.ts +14 -0
- package/dist/components/markdown/Frame.d.ts +10 -0
- package/dist/components/markdown/MemoizedReactMarkdown.d.ts +6 -0
- package/dist/components/markdown/MermaidDiagram.d.ts +6 -0
- package/dist/components/markdown/ZoomableImage.d.ts +7 -0
- package/dist/components/markdown/embeds/Loom.d.ts +7 -0
- package/dist/components/markdown/embeds/NativeVideo.d.ts +6 -0
- package/dist/components/markdown/embeds/Supademo.d.ts +7 -0
- package/dist/components/markdown/embeds/Typeform.d.ts +7 -0
- package/dist/components/markdown/embeds/Vimeo.d.ts +7 -0
- package/dist/components/markdown/embeds/Wistia.d.ts +7 -0
- package/dist/components/markdown/embeds/Youtube.d.ts +7 -0
- package/dist/components/markdown/embeds/index.d.ts +9 -0
- package/dist/components/markdown/index.d.ts +6 -0
- package/dist/components/markdown/utils/codeblock.d.ts +6 -0
- package/dist/components/markdown/utils/stripNewLines.d.ts +1 -0
- package/dist/components/select/index.d.ts +1 -0
- package/dist/{select.d.ts → components/select/simpleSelect.d.ts} +15 -20
- package/dist/env.d.ts +5 -0
- package/dist/esm/chunks/{ChatSearch.D_zJGwAf.js → ChatSearch.JQEWTiqr.js} +77 -31
- package/dist/esm/chunks/ChatSearch.JQEWTiqr.js.map +1 -0
- package/dist/esm/chunks/{FormattedMessage.D94rlhro.js → FormattedMessage.CpTetIzd.js} +146 -14
- package/dist/esm/chunks/FormattedMessage.CpTetIzd.js.map +1 -0
- package/dist/esm/chunks/{combobox.D30-HM1I.js → combobox.B5aw7PrS.js} +2 -2
- package/dist/esm/chunks/{combobox.D30-HM1I.js.map → combobox.B5aw7PrS.js.map} +1 -1
- package/dist/esm/chunks/{data-table.CeeSYokg.js → data-table.qS51pU0z.js} +2 -2
- package/dist/esm/chunks/{data-table.CeeSYokg.js.map → data-table.qS51pU0z.js.map} +1 -1
- package/dist/esm/chunks/{date-picker.WGre3lsB.js → date-picker.DqcdwXZS.js} +2 -2
- package/dist/esm/chunks/{date-picker.WGre3lsB.js.map → date-picker.DqcdwXZS.js.map} +1 -1
- package/dist/esm/chunks/{filters.Dx9TXuJ4.js → filters.Bd9OruMH.js} +2 -2
- package/dist/esm/chunks/{filters.Dx9TXuJ4.js.map → filters.Bd9OruMH.js.map} +1 -1
- package/dist/esm/chunks/{generating-star.C6eGHpse.js → generating-star.B0RUXRff.js} +2 -2
- package/dist/esm/chunks/{generating-star.C6eGHpse.js.map → generating-star.B0RUXRff.js.map} +1 -1
- package/dist/esm/chunks/{simpleSelect.Bzw8xrbM.js → simpleSelect.BfAgKOea.js} +2 -2
- package/dist/esm/chunks/{simpleSelect.Bzw8xrbM.js.map → simpleSelect.BfAgKOea.js.map} +1 -1
- package/dist/esm/chunks/{utils.DmKr1Ojo.js → utils.DaMF_LVC.js} +2 -3
- package/dist/esm/chunks/utils.DaMF_LVC.js.map +1 -0
- package/dist/esm/components/chat-search.js +1 -1
- package/dist/esm/components/combobox.js +1 -1
- package/dist/esm/components/data-table.js +1 -1
- package/dist/esm/components/date-picker.js +1 -1
- package/dist/esm/components/filter.js +1 -1
- package/dist/esm/components/generating-star.js +1 -1
- package/dist/esm/components/markdown.js +1 -1
- package/dist/esm/components/select.js +1 -1
- package/dist/esm/components/ui/accordion.js +1 -1
- package/dist/esm/components/ui/accordion.js.map +1 -1
- package/dist/esm/components/ui/badge.js +1 -1
- package/dist/esm/components/ui/button.js +1 -1
- package/dist/esm/components/ui/calendar.js +1 -1
- package/dist/esm/components/ui/card.js +1 -1
- package/dist/esm/components/ui/command.js +1 -1
- package/dist/esm/components/ui/dialog.js +1 -1
- package/dist/esm/components/ui/dialog.js.map +1 -1
- package/dist/esm/components/ui/dropdown-menu.js +1 -1
- package/dist/esm/components/ui/input.js +1 -1
- package/dist/esm/components/ui/label.js +1 -1
- package/dist/esm/components/ui/popover.js +1 -1
- package/dist/esm/components/ui/progress.js +1 -1
- package/dist/esm/components/ui/scroll-area.js +1 -1
- package/dist/esm/components/ui/select.js +1 -1
- package/dist/esm/components/ui/switch.js +1 -1
- package/dist/esm/components/ui/table.js +1 -1
- package/dist/esm/components/ui/textarea.js +1 -1
- package/dist/esm/components/ui/tooltip.js +1 -1
- package/dist/esm/index.css +1 -1
- package/dist/esm/index.js +8 -8
- package/dist/index.d.ts +27 -1063
- package/dist/lib/addUtmParams.d.ts +20 -0
- package/dist/lib/api.d.ts +96 -0
- package/dist/lib/feature-flags.d.ts +9 -0
- package/dist/lib/features.d.ts +3 -0
- package/dist/lib/fetchClient.d.ts +19 -0
- package/dist/lib/getContentType.d.ts +1 -0
- package/dist/lib/hooks.d.ts +15 -0
- package/dist/lib/utils.d.ts +8 -0
- package/dist/stats.html +1 -1
- package/package.json +8 -2
- package/dist/accordion.d.ts +0 -12
- package/dist/badge.d.ts +0 -14
- package/dist/button.d.ts +0 -16
- package/dist/calendar.d.ts +0 -12
- package/dist/card.d.ts +0 -17
- package/dist/chat-search.d.ts +0 -414
- package/dist/collapsible.d.ts +0 -10
- package/dist/command.d.ts +0 -90
- package/dist/components/chat-search.d.ts +0 -2
- package/dist/components/combobox.d.ts +0 -2
- package/dist/components/data-table.d.ts +0 -2
- package/dist/components/date-picker.d.ts +0 -2
- package/dist/components/feedback.d.ts +0 -2
- package/dist/components/filter.d.ts +0 -2
- package/dist/components/generating-star.d.ts +0 -6
- package/dist/components/markdown.d.ts +0 -2
- package/dist/components/select.d.ts +0 -2
- package/dist/data-table.d.ts +0 -23
- package/dist/dialog.d.ts +0 -30
- package/dist/dropdown-menu.d.ts +0 -43
- package/dist/esm/chunks/ChatSearch.D_zJGwAf.js.map +0 -1
- package/dist/esm/chunks/FormattedMessage.D94rlhro.js.map +0 -1
- package/dist/esm/chunks/utils.DmKr1Ojo.js.map +0 -1
- package/dist/generating-star.d.ts +0 -10
- package/dist/icon.d.ts +0 -26
- package/dist/input.d.ts +0 -11
- package/dist/label.d.ts +0 -8
- package/dist/markdown.d.ts +0 -54
- package/dist/popover.d.ts +0 -12
- package/dist/progress.d.ts +0 -8
- package/dist/scroll-area.d.ts +0 -8
- package/dist/switch.d.ts +0 -6
- package/dist/table.d.ts +0 -19
- package/dist/textarea.d.ts +0 -5
- package/dist/tooltip.d.ts +0 -18
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Adds UTM parameters to a URL for tracking purposes.
|
|
3
|
+
*
|
|
4
|
+
* @param url The URL to add UTM parameters to
|
|
5
|
+
* @param options UTM parameters to add (all optional)
|
|
6
|
+
* @param options.source The UTM source (e.g., 'brainfish')
|
|
7
|
+
* @param options.medium The UTM medium (e.g., 'popup_widget')
|
|
8
|
+
* @param options.campaign Optional UTM campaign parameter
|
|
9
|
+
* @returns The URL with UTM parameters added
|
|
10
|
+
*/
|
|
11
|
+
export declare function addUtmParameters(url: string, options: {
|
|
12
|
+
source?: string;
|
|
13
|
+
medium?: string;
|
|
14
|
+
campaign?: string;
|
|
15
|
+
}): string;
|
|
16
|
+
/**
|
|
17
|
+
* Curried function that adds popup widget-specific UTM parameters to URLs.
|
|
18
|
+
* Uses 'brainfish' as source and 'popup_widget' as medium.
|
|
19
|
+
*/
|
|
20
|
+
export declare const addPopupWidgetUtm: (url: string) => string;
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
import { SearchResponse, FeedbackResponse, APIFeedbackResponse, SearchResult, ActionInputs, ClientExecutionResult, SearchQueryAttributes } from '../components/chat-search/types';
|
|
2
|
+
export declare function searchApi({ endpoint, query, collectionId, headers, conversationId, attributes, secretAttributes, allowedRegions, }: {
|
|
3
|
+
endpoint: string;
|
|
4
|
+
query: string;
|
|
5
|
+
collectionId?: string;
|
|
6
|
+
headers?: Record<string, string>;
|
|
7
|
+
conversationId?: string;
|
|
8
|
+
attributes?: SearchQueryAttributes;
|
|
9
|
+
secretAttributes?: string;
|
|
10
|
+
allowedRegions?: string[];
|
|
11
|
+
}): Promise<SearchResponse>;
|
|
12
|
+
export declare function fetchAnswer({ endpoint, searchQueryId, headers, conversationId, }: {
|
|
13
|
+
endpoint: string;
|
|
14
|
+
searchQueryId: string;
|
|
15
|
+
headers?: Record<string, string>;
|
|
16
|
+
conversationId?: string;
|
|
17
|
+
}): Promise<Response>;
|
|
18
|
+
export declare function fetchAnswerStream({ endpoint, headers, body, }: {
|
|
19
|
+
endpoint: string;
|
|
20
|
+
headers?: Record<string, string>;
|
|
21
|
+
body: {
|
|
22
|
+
type: 'generate-for-query';
|
|
23
|
+
conversationId?: string;
|
|
24
|
+
searchQueryId: string;
|
|
25
|
+
} | {
|
|
26
|
+
type: 'invoke-action';
|
|
27
|
+
conversationId?: string;
|
|
28
|
+
searchQueryId: string;
|
|
29
|
+
searchIntentId: string;
|
|
30
|
+
actionId: string;
|
|
31
|
+
parameters: ActionInputs;
|
|
32
|
+
} | {
|
|
33
|
+
type: 'client-execution-result';
|
|
34
|
+
conversationId?: string;
|
|
35
|
+
searchQueryId: string;
|
|
36
|
+
searchIntentId: string;
|
|
37
|
+
actionId: string;
|
|
38
|
+
results: ClientExecutionResult;
|
|
39
|
+
};
|
|
40
|
+
}): Promise<Response>;
|
|
41
|
+
export declare function createConversationId(): string;
|
|
42
|
+
export declare function sendFeedback({ endpoint, searchQueryId, response, headers, conversationId, }: {
|
|
43
|
+
endpoint: string;
|
|
44
|
+
searchQueryId: string;
|
|
45
|
+
response: FeedbackResponse;
|
|
46
|
+
headers?: Record<string, string>;
|
|
47
|
+
conversationId?: string;
|
|
48
|
+
}): Promise<void>;
|
|
49
|
+
export declare function sendFeedbackReason({ endpoint, searchQueryId, reason, headers, }: {
|
|
50
|
+
endpoint: string;
|
|
51
|
+
searchQueryId: string;
|
|
52
|
+
reason: string;
|
|
53
|
+
headers?: Record<string, string>;
|
|
54
|
+
conversationId?: string;
|
|
55
|
+
}): Promise<void>;
|
|
56
|
+
export interface ConversationResponse {
|
|
57
|
+
data: Array<{
|
|
58
|
+
question: string;
|
|
59
|
+
answer: string;
|
|
60
|
+
searchQueryId: string;
|
|
61
|
+
searchResults?: SearchResult[];
|
|
62
|
+
searchIntentId?: string;
|
|
63
|
+
feedback?: APIFeedbackResponse;
|
|
64
|
+
}>;
|
|
65
|
+
}
|
|
66
|
+
export declare function loadConversation({ endpoint, conversationId, headers, signal, }: {
|
|
67
|
+
endpoint: string;
|
|
68
|
+
conversationId: string;
|
|
69
|
+
headers?: Record<string, string>;
|
|
70
|
+
signal?: AbortSignal;
|
|
71
|
+
}): Promise<{
|
|
72
|
+
data: ConversationResponse['data'];
|
|
73
|
+
}>;
|
|
74
|
+
export declare function fetchFollowUpQuestions({ endpoint, searchQueryId, headers, conversationId, }: {
|
|
75
|
+
endpoint: string;
|
|
76
|
+
searchQueryId: string;
|
|
77
|
+
headers?: Record<string, string>;
|
|
78
|
+
conversationId?: string;
|
|
79
|
+
}): Promise<string[]>;
|
|
80
|
+
interface AutocompleteResponse {
|
|
81
|
+
response: {
|
|
82
|
+
results: Array<{
|
|
83
|
+
id: string;
|
|
84
|
+
question: string;
|
|
85
|
+
}>;
|
|
86
|
+
};
|
|
87
|
+
}
|
|
88
|
+
export declare function fetchAutocomplete({ endpoint, query, collectionId, headers, conversationId, allowedRegions, }: {
|
|
89
|
+
endpoint: string;
|
|
90
|
+
query: string;
|
|
91
|
+
collectionId?: string;
|
|
92
|
+
headers?: Record<string, string>;
|
|
93
|
+
conversationId?: string;
|
|
94
|
+
allowedRegions?: string[];
|
|
95
|
+
}): Promise<AutocompleteResponse>;
|
|
96
|
+
export {};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { default as React, ReactNode } from 'react';
|
|
2
|
+
export type FeatureFlags = {
|
|
3
|
+
[key: string]: boolean | string | number;
|
|
4
|
+
};
|
|
5
|
+
export declare function FeatureFlagProvider({ children, flags }: {
|
|
6
|
+
children: ReactNode;
|
|
7
|
+
flags: FeatureFlags | undefined;
|
|
8
|
+
}): React.JSX.Element;
|
|
9
|
+
export declare function useBooleanFlagValue(flagKey: string, defaultValue: boolean): boolean;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
interface RetryOptions {
|
|
2
|
+
maxRetries?: number;
|
|
3
|
+
baseDelay?: number;
|
|
4
|
+
shouldRetry?: (error: Error, attempt: number) => boolean | Promise<boolean>;
|
|
5
|
+
}
|
|
6
|
+
interface FallbackConfig {
|
|
7
|
+
emptyResponse?: string;
|
|
8
|
+
errorResponse?: string;
|
|
9
|
+
}
|
|
10
|
+
interface RequestConfig<T> extends Omit<RequestInit, 'body'> {
|
|
11
|
+
retry?: RetryOptions;
|
|
12
|
+
body?: T;
|
|
13
|
+
isStream?: boolean;
|
|
14
|
+
fallback?: FallbackConfig;
|
|
15
|
+
}
|
|
16
|
+
export declare function configureRetry(options: RetryOptions): void;
|
|
17
|
+
export declare function configureFallback(config: FallbackConfig): void;
|
|
18
|
+
export declare function makeRequest<TResponse, TBody = unknown>(url: string | URL, config?: RequestConfig<TBody>): Promise<TResponse>;
|
|
19
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function getContentType(attachmentId: string, apiHost?: string, signal?: AbortSignal): Promise<'image' | 'video' | 'audio' | 'pdf' | 'unknown'>;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { Suggestion } from '../components/chat-search/types';
|
|
2
|
+
export declare function useDebounce<T>(value: T, delay: number): T;
|
|
3
|
+
export declare function useAutocomplete({ query, endpoint, allowedRegions, collectionId, headers, conversationId, delay, }: {
|
|
4
|
+
query: string;
|
|
5
|
+
endpoint: string;
|
|
6
|
+
allowedRegions?: string[];
|
|
7
|
+
collectionId?: string;
|
|
8
|
+
headers?: Record<string, string>;
|
|
9
|
+
conversationId?: string;
|
|
10
|
+
delay?: number;
|
|
11
|
+
}): {
|
|
12
|
+
suggestions: Suggestion[];
|
|
13
|
+
isLoading: boolean;
|
|
14
|
+
error: string | undefined;
|
|
15
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { ClassValue } from 'clsx';
|
|
2
|
+
export declare function cn(...inputs: ClassValue[]): string;
|
|
3
|
+
export declare function useId(prefix?: string): string;
|
|
4
|
+
export declare function isAnswerUncertain(response: string): {
|
|
5
|
+
uncertain: boolean;
|
|
6
|
+
language: string | null;
|
|
7
|
+
};
|
|
8
|
+
export declare function getLuminance(rgb: string): number;
|