@brainfish-ai/components 0.23.1 → 0.23.3
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/chat-search.d.ts +1 -1
- package/dist/discoveries-created.d.ts +49 -0
- package/dist/esm/chunks/{ChatSearch.DO8oQOlu.js → ChatSearch.DVi90w5m.js} +12 -15
- package/dist/esm/chunks/ChatSearch.DVi90w5m.js.map +1 -0
- package/dist/esm/chunks/{FormattedMessage.DFWDPJoI.js → FormattedMessage.Br7XTLD2.js} +5 -50
- package/dist/esm/chunks/FormattedMessage.Br7XTLD2.js.map +1 -0
- package/dist/esm/chunks/MermaidDiagram.xQ0CVFOI.js +50 -0
- package/dist/esm/chunks/MermaidDiagram.xQ0CVFOI.js.map +1 -0
- package/dist/esm/chunks/{chart.CTzWtshH.js → chart.BmBO7tNe.js} +3 -2
- package/dist/esm/chunks/{chart.CTzWtshH.js.map → chart.BmBO7tNe.js.map} +1 -1
- package/dist/esm/chunks/{status-badge.MOegXsYs.js → formatDate.CuWGpZ_T.js} +10 -18
- package/dist/esm/chunks/formatDate.CuWGpZ_T.js.map +1 -0
- package/dist/esm/chunks/{hooks.DI5ftshU.js → hooks.Dii4V-O3.js} +11 -18
- package/dist/esm/chunks/hooks.Dii4V-O3.js.map +1 -0
- package/dist/esm/chunks/{layout.Cw9KlzMD.js → layout.B4f3-2zh.js} +2 -2
- package/dist/esm/chunks/{layout.Cw9KlzMD.js.map → layout.B4f3-2zh.js.map} +1 -1
- package/dist/esm/chunks/{review-list.CVJB3TFg.js → review-list.Dhuy7ITv.js} +3 -2
- package/dist/esm/chunks/{review-list.CVJB3TFg.js.map → review-list.Dhuy7ITv.js.map} +1 -1
- package/dist/esm/chunks/{sidebar.BejmvpB3.js → sidebar.kcxBRKYA.js} +12 -3
- package/dist/esm/chunks/sidebar.kcxBRKYA.js.map +1 -0
- package/dist/esm/chunks/status-badge.eFJ1PYeb.js +18 -0
- package/dist/esm/chunks/status-badge.eFJ1PYeb.js.map +1 -0
- package/dist/esm/chunks/useChartDateFormatters.DG-OZUxq.js +11 -0
- package/dist/esm/chunks/useChartDateFormatters.DG-OZUxq.js.map +1 -0
- package/dist/esm/components/chart-area-linear.js +3 -23
- package/dist/esm/components/chart-area-linear.js.map +1 -1
- package/dist/esm/components/chart-radial-stacked.js +1 -1
- package/dist/esm/components/chat-search.js +1 -1
- package/dist/esm/components/convos.js +3 -2
- package/dist/esm/components/convos.js.map +1 -1
- package/dist/esm/components/discoveries-created.js +65 -0
- package/dist/esm/components/discoveries-created.js.map +1 -0
- package/dist/esm/components/markdown.js +2 -1
- package/dist/esm/components/markdown.js.map +1 -1
- package/dist/esm/components/ui/icon.js +17 -7
- package/dist/esm/components/ui/icon.js.map +1 -1
- package/dist/esm/global.css +1 -1
- package/dist/esm/index.js +6 -5
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/layouts/full-layout.js +1 -1
- package/dist/esm/layouts/sidebar.js +1 -1
- package/dist/esm/scenes/knowledge-review.js +2 -2
- package/dist/icon.d.ts +0 -14
- package/dist/index.d.ts +1 -15
- package/dist/stats.html +1 -1
- package/package.json +1 -1
- package/dist/esm/chunks/ChatSearch.DO8oQOlu.js.map +0 -1
- package/dist/esm/chunks/FormattedMessage.DFWDPJoI.js.map +0 -1
- package/dist/esm/chunks/hooks.DI5ftshU.js.map +0 -1
- package/dist/esm/chunks/sidebar.BejmvpB3.js.map +0 -1
- package/dist/esm/chunks/status-badge.MOegXsYs.js.map +0 -1
package/dist/chat-search.d.ts
CHANGED
|
@@ -215,7 +215,7 @@ export declare interface ChatSearchProps {
|
|
|
215
215
|
searchEndpoint: string;
|
|
216
216
|
answerEndpoint: string;
|
|
217
217
|
answerStreamEndpoint: string;
|
|
218
|
-
|
|
218
|
+
uploadEndpoint?: string;
|
|
219
219
|
feedbackEndpoint?: string;
|
|
220
220
|
feedbackReasonEndpoint?: string;
|
|
221
221
|
loadConversationEndpoint?: string;
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { default as default_2 } from 'react';
|
|
2
|
+
import * as React_2 from 'react';
|
|
3
|
+
|
|
4
|
+
declare type ChartConfig = {
|
|
5
|
+
[k in string]: {
|
|
6
|
+
label?: React_2.ReactNode;
|
|
7
|
+
icon?: React_2.ComponentType;
|
|
8
|
+
} & ({
|
|
9
|
+
color?: string;
|
|
10
|
+
theme?: never;
|
|
11
|
+
} | {
|
|
12
|
+
color?: never;
|
|
13
|
+
theme: Record<keyof typeof THEMES, string>;
|
|
14
|
+
});
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
export declare function DiscoveriesCreated({ total, trend, trendValue, subBreakdowns, sourceTotals, data, chartConfig, locale, className, }: DiscoveriesCreatedProps): default_2.JSX.Element;
|
|
18
|
+
|
|
19
|
+
export declare interface DiscoveriesCreatedProps {
|
|
20
|
+
total: number;
|
|
21
|
+
trend: Trend;
|
|
22
|
+
trendValue: string;
|
|
23
|
+
subBreakdowns: Array<{
|
|
24
|
+
label: string;
|
|
25
|
+
value: number;
|
|
26
|
+
}>;
|
|
27
|
+
sourceTotals: Array<{
|
|
28
|
+
key: string;
|
|
29
|
+
label: string;
|
|
30
|
+
value: number;
|
|
31
|
+
}>;
|
|
32
|
+
data: Array<Record<string, number | string | Date>>;
|
|
33
|
+
chartConfig: ChartConfig;
|
|
34
|
+
locale?: string;
|
|
35
|
+
className?: string;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
declare const THEMES: {
|
|
39
|
+
readonly light: "";
|
|
40
|
+
readonly dark: ".dark";
|
|
41
|
+
};
|
|
42
|
+
|
|
43
|
+
declare enum Trend {
|
|
44
|
+
UP = "up",
|
|
45
|
+
DOWN = "down",
|
|
46
|
+
FLAT = "flat"
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
export { }
|
|
@@ -5,7 +5,7 @@ import remarkGfm from 'remark-gfm';
|
|
|
5
5
|
import { TooltipProvider, Tooltip, TooltipTrigger, TooltipContent } from '../components/ui/tooltip.js';
|
|
6
6
|
import { Button } from '../components/ui/button.js';
|
|
7
7
|
import { XCircle, X, Check, Copy, CaretDown, ArrowSquareOut, CaretRight, ArrowsVertical, Globe, LockSimple, MagnifyingGlass, Image, ArrowRight, ArrowLeft, ArrowsInSimple, ArrowsOutSimple } from '@phosphor-icons/react';
|
|
8
|
-
import { F as FormattedMessage,
|
|
8
|
+
import { F as FormattedMessage, a as addPopupWidgetUtm, M as MemoizedReactMarkdown } from './FormattedMessage.Br7XTLD2.js';
|
|
9
9
|
import { appendErrors, useForm, Controller } from 'react-hook-form';
|
|
10
10
|
import { validateFieldsNatively, toNestErrors } from '@hookform/resolvers';
|
|
11
11
|
import require$$0 from 'ajv';
|
|
@@ -28,7 +28,7 @@ import { Switch } from '../components/ui/switch.js';
|
|
|
28
28
|
import { C as Combobox } from './combobox.DNYCWyub.js';
|
|
29
29
|
import { T as TwoLevelCombobox } from './two-level-combobox.DsWPDcI6.js';
|
|
30
30
|
import { X as X$1 } from 'lucide-react';
|
|
31
|
-
import { l as loadConversation, c as createConversationId,
|
|
31
|
+
import { l as loadConversation, c as createConversationId, a as uploadFileToApi, b as useAutocomplete, s as sendFeedbackReason, d as sendFeedback, e as searchApi, f as fetchAnswerStream, g as fetchFollowUpQuestions } from './hooks.Dii4V-O3.js';
|
|
32
32
|
import { ScrollArea } from '../components/ui/scroll-area.js';
|
|
33
33
|
|
|
34
34
|
import '../ChatSearch.css';function Suggestions({ suggestions, onQuestionClick, title = "Suggested questions" }) {
|
|
@@ -4593,7 +4593,7 @@ const MAX_FILE_SIZE = 10 * 1024 * 1024;
|
|
|
4593
4593
|
const MAX_FILE_COUNT = 5;
|
|
4594
4594
|
let nextFileId = 0;
|
|
4595
4595
|
const generateFileId = () => `file-${++nextFileId}`;
|
|
4596
|
-
function useFileAttachment({
|
|
4596
|
+
function useFileAttachment({ uploadEndpoint, headers, getConversationId, onError }) {
|
|
4597
4597
|
const [attachedFiles, setAttachedFiles] = useState([]);
|
|
4598
4598
|
const removeFile = useCallback((id) => {
|
|
4599
4599
|
setAttachedFiles((prev) => {
|
|
@@ -4628,8 +4628,8 @@ function useFileAttachment({ presignedUrlEndpoint, headers, getConversationId, o
|
|
|
4628
4628
|
if (filesToAdd.length < validFiles.length) {
|
|
4629
4629
|
onError?.("Maximum 5 images. Some images were not attached.");
|
|
4630
4630
|
}
|
|
4631
|
-
if (!
|
|
4632
|
-
console.error("[useFileAttachment]
|
|
4631
|
+
if (!uploadEndpoint) {
|
|
4632
|
+
console.error("[useFileAttachment] uploadEndpoint is not configured — file attachment is unavailable.");
|
|
4633
4633
|
onError?.("Something went wrong. Please try again later.");
|
|
4634
4634
|
return;
|
|
4635
4635
|
}
|
|
@@ -4645,15 +4645,12 @@ function useFileAttachment({ presignedUrlEndpoint, headers, getConversationId, o
|
|
|
4645
4645
|
newFiles.forEach((newFile) => {
|
|
4646
4646
|
void (async () => {
|
|
4647
4647
|
try {
|
|
4648
|
-
const {
|
|
4649
|
-
endpoint:
|
|
4648
|
+
const { publicUrl } = await uploadFileToApi({
|
|
4649
|
+
endpoint: uploadEndpoint,
|
|
4650
4650
|
conversationId,
|
|
4651
|
-
|
|
4652
|
-
contentType: newFile.file.type,
|
|
4653
|
-
size: newFile.file.size,
|
|
4651
|
+
file: newFile.file,
|
|
4654
4652
|
headers
|
|
4655
4653
|
});
|
|
4656
|
-
await uploadFileToS3(uploadUrl, newFile.file);
|
|
4657
4654
|
setAttachedFiles((prev) => prev.map((f) => f.id === newFile.id ? { ...f, status: "uploaded", publicUrl } : f));
|
|
4658
4655
|
} catch (error) {
|
|
4659
4656
|
console.error("Upload failed:", error);
|
|
@@ -4667,7 +4664,7 @@ function useFileAttachment({ presignedUrlEndpoint, headers, getConversationId, o
|
|
|
4667
4664
|
})();
|
|
4668
4665
|
});
|
|
4669
4666
|
},
|
|
4670
|
-
[attachedFiles,
|
|
4667
|
+
[attachedFiles, uploadEndpoint, headers, getConversationId, onError]
|
|
4671
4668
|
);
|
|
4672
4669
|
const clearAttachedFiles = useCallback(() => {
|
|
4673
4670
|
attachedFiles.forEach((f) => URL.revokeObjectURL(f.preview));
|
|
@@ -5803,7 +5800,7 @@ const ChatSearchComponent = forwardRef(
|
|
|
5803
5800
|
fetchRegionConfig,
|
|
5804
5801
|
searchEndpoint,
|
|
5805
5802
|
answerStreamEndpoint,
|
|
5806
|
-
|
|
5803
|
+
uploadEndpoint,
|
|
5807
5804
|
feedbackEndpoint,
|
|
5808
5805
|
feedbackReasonEndpoint,
|
|
5809
5806
|
loadConversationEndpoint,
|
|
@@ -5865,7 +5862,7 @@ const ChatSearchComponent = forwardRef(
|
|
|
5865
5862
|
return conversationId;
|
|
5866
5863
|
}, [currentConversationId, setCurrentConversationId]);
|
|
5867
5864
|
const { attachedFiles, isUploading, addFiles, removeFile, clearAttachedFiles, getUploadedAttachments } = useFileAttachment({
|
|
5868
|
-
|
|
5865
|
+
uploadEndpoint,
|
|
5869
5866
|
headers,
|
|
5870
5867
|
getConversationId: getOrCreateConversationId,
|
|
5871
5868
|
onError: showToast
|
|
@@ -6686,4 +6683,4 @@ const ChatSearch = forwardRef(({ featureFlags, ...props }, ref) => /* @__PURE__
|
|
|
6686
6683
|
ChatSearch.displayName = "ChatSearch";
|
|
6687
6684
|
|
|
6688
6685
|
export { ChatSearch as C, ChatSearchProvider as a, useIsChatSearchDirty as b, useChatSearch as u };
|
|
6689
|
-
//# sourceMappingURL=ChatSearch.
|
|
6686
|
+
//# sourceMappingURL=ChatSearch.DVi90w5m.js.map
|