@brainfish-ai/components 0.28.12 → 0.29.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/conversation.d.ts +95 -33
- package/dist/esm/chunks/Conversation.BRyKMDlg.js +29 -0
- package/dist/esm/chunks/Conversation.BRyKMDlg.js.map +1 -0
- package/dist/esm/components/conversation.js +1 -1
- package/dist/esm/global.css +1 -1
- package/dist/esm/index.js +1 -1
- package/dist/index.d.ts +99 -37
- package/dist/stats.html +1 -1
- package/package.json +1 -1
- package/dist/esm/chunks/Conversation.D1Mqf3Qg.js +0 -15
- package/dist/esm/chunks/Conversation.D1Mqf3Qg.js.map +0 -1
package/dist/index.d.ts
CHANGED
|
@@ -360,6 +360,12 @@ declare type AppendNewAnswer = {
|
|
|
360
360
|
};
|
|
361
361
|
};
|
|
362
362
|
|
|
363
|
+
export declare type Article = {
|
|
364
|
+
id: string;
|
|
365
|
+
title: string;
|
|
366
|
+
url: string;
|
|
367
|
+
};
|
|
368
|
+
|
|
363
369
|
export declare interface ArticleNavItem extends Omit<SidebarNavItem, 'Icon' | 'items'> {
|
|
364
370
|
status?: 'discovery' | 'unpublished' | 'draft';
|
|
365
371
|
hasChildren?: boolean;
|
|
@@ -367,24 +373,21 @@ export declare interface ArticleNavItem extends Omit<SidebarNavItem, 'Icon' | 'i
|
|
|
367
373
|
items?: ArticleNavItem[];
|
|
368
374
|
}
|
|
369
375
|
|
|
370
|
-
export declare type Attachment =
|
|
371
|
-
id: string;
|
|
372
|
-
type: 'image' | 'file';
|
|
373
|
-
name: string;
|
|
374
|
-
url: string;
|
|
375
|
-
file?: File;
|
|
376
|
-
};
|
|
376
|
+
export declare type Attachment = FileAttachment | PageAttachment | EntityAttachment;
|
|
377
377
|
|
|
378
|
-
export declare type
|
|
379
|
-
type: 'select-
|
|
380
|
-
|
|
378
|
+
export declare type AttachmentAddAction = {
|
|
379
|
+
type: 'select-entity';
|
|
380
|
+
entity: BaseEntity;
|
|
381
381
|
} | {
|
|
382
|
-
type: 'select-
|
|
383
|
-
|
|
382
|
+
type: 'select-page';
|
|
383
|
+
page: Page;
|
|
384
384
|
} | {
|
|
385
|
-
type:
|
|
385
|
+
type: 'add-files';
|
|
386
|
+
files: File[];
|
|
386
387
|
};
|
|
387
388
|
|
|
389
|
+
export declare type AttachmentBlock = FileAttachmentBlock | EntityAttachmentBlock | PageAttachmentBlock;
|
|
390
|
+
|
|
388
391
|
declare type AttachmentType = 'image' | 'file';
|
|
389
392
|
|
|
390
393
|
export declare function Avatar({ className, size, ...props }: React_2.ComponentProps<typeof AvatarPrimitive.Root> & {
|
|
@@ -410,6 +413,13 @@ export declare const badgeVariants: (props?: ({
|
|
|
410
413
|
variant?: "default" | "disabled" | "destructive" | "success" | "warning" | null | undefined;
|
|
411
414
|
} & ClassProp) | undefined) => string;
|
|
412
415
|
|
|
416
|
+
declare type BaseEntity = {
|
|
417
|
+
id: string;
|
|
418
|
+
type: 'collection' | 'article' | 'channel';
|
|
419
|
+
title: string;
|
|
420
|
+
url: string;
|
|
421
|
+
};
|
|
422
|
+
|
|
413
423
|
declare function Body_2({ children }: {
|
|
414
424
|
children?: default_2.ReactNode;
|
|
415
425
|
}): default_2.JSX.Element;
|
|
@@ -624,6 +634,12 @@ export declare const CardHeader: React_2.ForwardRefExoticComponent<React_2.HTMLA
|
|
|
624
634
|
|
|
625
635
|
export declare const CardTitle: React_2.ForwardRefExoticComponent<React_2.HTMLAttributes<HTMLDivElement> & React_2.RefAttributes<HTMLDivElement>>;
|
|
626
636
|
|
|
637
|
+
export declare type Channel = {
|
|
638
|
+
id: string;
|
|
639
|
+
title: string;
|
|
640
|
+
url: string;
|
|
641
|
+
};
|
|
642
|
+
|
|
627
643
|
export declare function ChatLogo({ size, className, color }: ChatLogoProps): default_2.JSX.Element;
|
|
628
644
|
|
|
629
645
|
declare interface ChatLogoProps {
|
|
@@ -788,7 +804,8 @@ export declare interface Collection {
|
|
|
788
804
|
|
|
789
805
|
declare type Collection_2 = {
|
|
790
806
|
id: string;
|
|
791
|
-
|
|
807
|
+
title: string;
|
|
808
|
+
url: string;
|
|
792
809
|
};
|
|
793
810
|
|
|
794
811
|
export declare function Combobox<T extends ComboboxItem = ComboboxItem>({ options, defaultValueLabel, placeholder, noResultsLabel, className, onOpenChange, onChange, dropdownWidth, value: controlledValue, disabled, renderItem, renderValue, renderTrigger, appendToBody, }: ComboboxProps<T>): React_2.JSX.Element;
|
|
@@ -941,12 +958,14 @@ declare namespace Compounds {
|
|
|
941
958
|
}
|
|
942
959
|
}
|
|
943
960
|
|
|
944
|
-
export declare type ContentBlock = TextBlock;
|
|
961
|
+
export declare type ContentBlock = TextBlock | AttachmentBlock;
|
|
945
962
|
|
|
946
|
-
|
|
963
|
+
declare type ContextPill = {
|
|
947
964
|
id: string;
|
|
948
965
|
label: string;
|
|
949
|
-
|
|
966
|
+
iconType?: ContextPillIconType;
|
|
967
|
+
loading?: boolean;
|
|
968
|
+
progress?: number;
|
|
950
969
|
};
|
|
951
970
|
|
|
952
971
|
export declare const ContextPillBadge: ({ pill, onRemove }: ContextPillBadgeProps) => default_2.JSX.Element;
|
|
@@ -956,9 +975,11 @@ declare interface ContextPillBadgeProps {
|
|
|
956
975
|
onRemove?: (pill: ContextPill) => void;
|
|
957
976
|
}
|
|
958
977
|
|
|
959
|
-
export declare
|
|
978
|
+
export declare type ContextPillIconType = 'image' | 'video' | 'pdf' | 'doc' | 'file' | 'channel' | 'collection' | 'article' | 'page';
|
|
979
|
+
|
|
980
|
+
export declare const Conversation: (({ messages, callbacks, children, suggestions, actions, placeholder, attachments, collections, pages, acceptedFileTypes, showBranding, className, }: ConversationProps) => default_2.JSX.Element) & {
|
|
960
981
|
Messages: ({ className, bottomPadding, onContentBehind }: ConversationMessagesProps) => default_2.JSX.Element;
|
|
961
|
-
Input: ({ placeholder, attachments, collections,
|
|
982
|
+
Input: ({ placeholder, attachments, collections, pages, acceptedFileTypes, disabled, isElevated, className, }: ConversationInputProps) => default_2.JSX.Element;
|
|
962
983
|
Suggestions: ({ items, className }: ConversationSuggestionsProps) => default_2.JSX.Element | null;
|
|
963
984
|
Actions: ({ actions, onActionClick, className }: ConversationActionsProps) => default_2.JSX.Element | null;
|
|
964
985
|
Loading: ({ className }: ConversationStatusProps) => default_2.JSX.Element;
|
|
@@ -985,8 +1006,8 @@ export declare type ConversationCallbacks = {
|
|
|
985
1006
|
onSuggestionClick?: (suggestion: Suggestion) => void;
|
|
986
1007
|
onActionClick?: (action: ConversationAction, messageId: string) => void;
|
|
987
1008
|
onCitationClick?: (citation: Citation) => void;
|
|
988
|
-
|
|
989
|
-
|
|
1009
|
+
onAttachmentAdd?: (action: AttachmentAddAction) => void;
|
|
1010
|
+
onAttachmentRemove?: (attachment: Attachment) => void;
|
|
990
1011
|
onCopy?: (messageId: string, content: string) => void;
|
|
991
1012
|
};
|
|
992
1013
|
|
|
@@ -1001,15 +1022,14 @@ export declare interface ConversationContextValue {
|
|
|
1001
1022
|
isStreaming: boolean;
|
|
1002
1023
|
}
|
|
1003
1024
|
|
|
1004
|
-
export declare const ConversationInput: ({ placeholder, attachments, collections,
|
|
1025
|
+
export declare const ConversationInput: ({ placeholder, attachments, collections, pages, acceptedFileTypes, disabled, isElevated, className, }: ConversationInputProps_2) => default_2.JSX.Element;
|
|
1005
1026
|
|
|
1006
1027
|
declare interface ConversationInputProps_2 {
|
|
1007
1028
|
placeholder?: string;
|
|
1008
1029
|
attachments?: Attachment[];
|
|
1009
1030
|
collections?: Collection_2[];
|
|
1010
|
-
|
|
1011
|
-
|
|
1012
|
-
contextPills?: ContextPill[];
|
|
1031
|
+
pages?: Page[];
|
|
1032
|
+
acceptedFileTypes?: string[];
|
|
1013
1033
|
disabled?: boolean;
|
|
1014
1034
|
isElevated?: boolean;
|
|
1015
1035
|
className?: string;
|
|
@@ -1051,9 +1071,8 @@ declare interface ConversationProps {
|
|
|
1051
1071
|
placeholder?: string;
|
|
1052
1072
|
attachments?: Attachment[];
|
|
1053
1073
|
collections?: Collection_2[];
|
|
1054
|
-
|
|
1055
|
-
|
|
1056
|
-
contextPills?: ContextPill[];
|
|
1074
|
+
pages?: Page[];
|
|
1075
|
+
acceptedFileTypes?: string[];
|
|
1057
1076
|
showBranding?: boolean;
|
|
1058
1077
|
className?: string;
|
|
1059
1078
|
}
|
|
@@ -1182,6 +1201,17 @@ export declare const DropdownMenuSubTrigger: React_2.ForwardRefExoticComponent<O
|
|
|
1182
1201
|
|
|
1183
1202
|
export declare const DropdownMenuTrigger: React_2.ForwardRefExoticComponent<DropdownMenuPrimitive.DropdownMenuTriggerProps & React_2.RefAttributes<HTMLButtonElement>>;
|
|
1184
1203
|
|
|
1204
|
+
export declare type EntityAttachment = {
|
|
1205
|
+
id: string;
|
|
1206
|
+
type: 'entity';
|
|
1207
|
+
entity: BaseEntity;
|
|
1208
|
+
};
|
|
1209
|
+
|
|
1210
|
+
export declare type EntityAttachmentBlock = {
|
|
1211
|
+
type: 'entity';
|
|
1212
|
+
entity: BaseEntity;
|
|
1213
|
+
};
|
|
1214
|
+
|
|
1185
1215
|
export declare type ExtendedColumnDef<TData, TValue = unknown> = ColumnDef<TData, TValue> & {
|
|
1186
1216
|
expandedContent?: (row: Row<TData>) => default_2.ReactNode;
|
|
1187
1217
|
};
|
|
@@ -1192,6 +1222,28 @@ declare type FeatureFlags = {
|
|
|
1192
1222
|
|
|
1193
1223
|
declare type FeedbackResponse = 'accept' | 'reject';
|
|
1194
1224
|
|
|
1225
|
+
export declare type FileAttachment = {
|
|
1226
|
+
id: string;
|
|
1227
|
+
type: 'file';
|
|
1228
|
+
raw: File;
|
|
1229
|
+
loading?: boolean;
|
|
1230
|
+
progress?: number;
|
|
1231
|
+
file: {
|
|
1232
|
+
name: string;
|
|
1233
|
+
mimeType: string;
|
|
1234
|
+
url?: string;
|
|
1235
|
+
storageKey?: string;
|
|
1236
|
+
};
|
|
1237
|
+
};
|
|
1238
|
+
|
|
1239
|
+
export declare type FileAttachmentBlock = {
|
|
1240
|
+
type: 'file';
|
|
1241
|
+
fileName: string;
|
|
1242
|
+
mimeType: string;
|
|
1243
|
+
storageKey: string;
|
|
1244
|
+
url?: string;
|
|
1245
|
+
};
|
|
1246
|
+
|
|
1195
1247
|
export declare function FileUpload({ onDropAccepted, onDropRejected, accept, maxSize, // 5MB
|
|
1196
1248
|
maxFiles, multiple, className, disabled, title, description, supportsMessage, children, }: FileUploadProps): default_2.JSX.Element;
|
|
1197
1249
|
|
|
@@ -1727,6 +1779,25 @@ export declare enum Operator {
|
|
|
1727
1779
|
STARTS_WITH = "starts with"
|
|
1728
1780
|
}
|
|
1729
1781
|
|
|
1782
|
+
export declare type Page = {
|
|
1783
|
+
url: string;
|
|
1784
|
+
title: string;
|
|
1785
|
+
textContent?: string;
|
|
1786
|
+
};
|
|
1787
|
+
|
|
1788
|
+
export declare type PageAttachment = {
|
|
1789
|
+
id: string;
|
|
1790
|
+
type: 'page';
|
|
1791
|
+
page: Page;
|
|
1792
|
+
};
|
|
1793
|
+
|
|
1794
|
+
export declare type PageAttachmentBlock = {
|
|
1795
|
+
type: 'page';
|
|
1796
|
+
url: string;
|
|
1797
|
+
title: string;
|
|
1798
|
+
textContent?: string;
|
|
1799
|
+
};
|
|
1800
|
+
|
|
1730
1801
|
declare interface PhosphorIconProps extends IconProps {
|
|
1731
1802
|
iconName: string;
|
|
1732
1803
|
}
|
|
@@ -2041,8 +2112,6 @@ export declare interface SidebarProps extends React_2.ComponentPropsWithoutRef<'
|
|
|
2041
2112
|
sectionNavActiveId?: string;
|
|
2042
2113
|
}
|
|
2043
2114
|
|
|
2044
|
-
declare type SimpleAttachmentActionType = 'screenshot' | 'record-video' | 'add-file';
|
|
2045
|
-
|
|
2046
2115
|
export declare function SimpleSelect({ options, value, onChange, placeholder, disabled, className, appendToBody, }: SimpleSelectProps): React_2.JSX.Element;
|
|
2047
2116
|
|
|
2048
2117
|
export declare interface SimpleSelectProps {
|
|
@@ -2172,13 +2241,6 @@ export declare interface SuggestionCardSource {
|
|
|
2172
2241
|
|
|
2173
2242
|
export declare const Switch: React_2.ForwardRefExoticComponent<Omit<SwitchPrimitives.SwitchProps & React_2.RefAttributes<HTMLButtonElement>, "ref"> & React_2.RefAttributes<HTMLButtonElement>>;
|
|
2174
2243
|
|
|
2175
|
-
declare type Tab = {
|
|
2176
|
-
id: string;
|
|
2177
|
-
title: string;
|
|
2178
|
-
url: string;
|
|
2179
|
-
favIconUrl?: string;
|
|
2180
|
-
};
|
|
2181
|
-
|
|
2182
2244
|
export declare const Table: React_2.ForwardRefExoticComponent<React_2.HTMLAttributes<HTMLTableElement> & React_2.RefAttributes<HTMLTableElement>>;
|
|
2183
2245
|
|
|
2184
2246
|
export declare const TableBody: React_2.ForwardRefExoticComponent<React_2.HTMLAttributes<HTMLTableSectionElement> & React_2.RefAttributes<HTMLTableSectionElement>>;
|