@brainfish-ai/components 0.25.3 → 0.25.4

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.
@@ -63,7 +63,8 @@ declare enum ActionType {
63
63
  LaunchZendeskChat = "launch_zendesk_chat",
64
64
  LaunchZendeskMessenger = "launch_zendesk_messenger",
65
65
  LaunchFreshdesk = "launch_freshdesk",
66
- LaunchSupportTicketForm = "launch_support_ticket_form"
66
+ LaunchSupportTicketForm = "launch_support_ticket_form",
67
+ LaunchZendeskSunshineChat = "launch_zendesk_sunshine_chat"
67
68
  }
68
69
 
69
70
  declare type AddActionButtons = {
@@ -253,6 +254,7 @@ export declare interface ChatSearchProps {
253
254
  isAgentAssist?: boolean;
254
255
  isSearchWidget?: boolean;
255
256
  hideCitations?: boolean;
257
+ conversationInlineSlot?: ReactNode;
256
258
  }
257
259
 
258
260
  export declare const ChatSearchProvider: default_2.FC<{
@@ -362,7 +364,8 @@ declare enum NextBestActionType {
362
364
  ZendeskChat = "zendesk_chat",
363
365
  ZendeskMessenger = "zendesk_messenger",
364
366
  IntercomChat = "intercom_chat",
365
- Freshdesk = "freshdesk"
367
+ Freshdesk = "freshdesk",
368
+ ZendeskSunshineChat = "zendesk_sunshine_chat"
366
369
  }
367
370
 
368
371
  declare type NoArticlesFound = {
@@ -1,16 +1,11 @@
1
1
  import { ConversationActionsProps } from './ConversationActions';
2
2
  import { ConversationInputProps } from './ConversationInput';
3
- import { ConversationLoadingProps } from './ConversationLoading';
4
3
  import { ConversationMessagesProps } from './ConversationMessages';
4
+ import { ConversationStatusProps } from './ConversationStatus';
5
5
  import { ConversationSuggestionsProps } from './ConversationSuggestions';
6
6
  import { default as default_2 } from 'react';
7
7
  import { ReactNode } from 'react';
8
8
 
9
- export declare type ActionButtonsPart = {
10
- type: 'action-buttons';
11
- actions: ConversationAction[];
12
- };
13
-
14
9
  export declare type Attachment = {
15
10
  id: string;
16
11
  type: 'image' | 'file';
@@ -39,16 +34,13 @@ export declare type Citation = {
39
34
  url: string;
40
35
  };
41
36
 
42
- export declare type CitationPart = {
43
- type: 'citation';
44
- citations: Citation[];
45
- };
46
-
47
37
  declare type Collection = {
48
38
  id: string;
49
39
  label: string;
50
40
  };
51
41
 
42
+ export declare type ContentBlock = TextBlock;
43
+
52
44
  export declare type ContextPill = {
53
45
  id: string;
54
46
  label: string;
@@ -67,7 +59,7 @@ export declare const Conversation: (({ messages, callbacks, children, suggestion
67
59
  Input: ({ placeholder, attachments, collections, contextPills, disabled, isElevated, className, }: ConversationInputProps) => default_2.JSX.Element;
68
60
  Suggestions: ({ items, className }: ConversationSuggestionsProps) => default_2.JSX.Element | null;
69
61
  Actions: ({ actions, onActionClick, className }: ConversationActionsProps) => default_2.JSX.Element | null;
70
- Loading: ({ className }: ConversationLoadingProps) => default_2.JSX.Element;
62
+ Loading: ({ className }: ConversationStatusProps) => default_2.JSX.Element;
71
63
  };
72
64
 
73
65
  export declare type ConversationAction = {
@@ -115,12 +107,6 @@ declare interface ConversationInputProps_2 {
115
107
  className?: string;
116
108
  }
117
109
 
118
- export declare const ConversationLoading: ({ className }: ConversationLoadingProps_2) => default_2.JSX.Element;
119
-
120
- declare interface ConversationLoadingProps_2 {
121
- className?: string;
122
- }
123
-
124
110
  export declare const ConversationMessageAssistant: ({ message, className }: ConversationMessageAssistantProps) => default_2.JSX.Element;
125
111
 
126
112
  declare interface ConversationMessageAssistantProps {
@@ -165,6 +151,12 @@ declare interface ConversationProviderProps {
165
151
  children: default_2.ReactNode;
166
152
  }
167
153
 
154
+ export declare const ConversationStatus: ({ className }: ConversationStatusProps_2) => default_2.JSX.Element;
155
+
156
+ declare interface ConversationStatusProps_2 {
157
+ className?: string;
158
+ }
159
+
168
160
  export declare const ConversationSuggestions: ({ items, className }: ConversationSuggestionsProps_2) => default_2.JSX.Element | null;
169
161
 
170
162
  declare interface ConversationSuggestionsProps_2 {
@@ -172,24 +164,16 @@ declare interface ConversationSuggestionsProps_2 {
172
164
  className?: string;
173
165
  }
174
166
 
175
- export declare type ImagePart = {
176
- type: 'image';
177
- url: string;
178
- alt?: string;
179
- };
180
-
181
167
  export declare type Message = {
182
168
  id: string;
183
169
  role: MessageRole;
184
- parts: MessagePart[];
170
+ content: ContentBlock[];
185
171
  status: MessageStatus;
186
172
  createdAt?: Date;
187
173
  feedback?: 'positive' | 'negative';
188
174
  };
189
175
 
190
- export declare type MessagePart = TextPart | ImagePart | CitationPart | ToolCallPart | ThinkingPart | ActionButtonsPart;
191
-
192
- export declare type MessageRole = 'user' | 'assistant';
176
+ export declare type MessageRole = 'user' | 'ai';
193
177
 
194
178
  export declare type MessageStatus = 'pending' | 'streaming' | 'completed' | 'error';
195
179
 
@@ -199,22 +183,10 @@ export declare type Suggestion = {
199
183
  icon?: string;
200
184
  };
201
185
 
202
- export declare type TextPart = {
186
+ export declare type TextBlock = {
203
187
  type: 'text';
204
188
  text: string;
205
- };
206
-
207
- export declare type ThinkingPart = {
208
- type: 'thinking';
209
- text: string;
210
- };
211
-
212
- export declare type ToolCallPart = {
213
- type: 'tool-call';
214
- toolName: string;
215
- status: 'pending' | 'running' | 'completed' | 'error';
216
- args?: Record<string, unknown>;
217
- result?: string;
189
+ citations?: Citation[];
218
190
  };
219
191
 
220
192
  export declare function useConversation(): ConversationContextValue;
@@ -3985,6 +3985,7 @@ var ActionType = /* @__PURE__ */ ((ActionType2) => {
3985
3985
  ActionType2["LaunchZendeskMessenger"] = "launch_zendesk_messenger";
3986
3986
  ActionType2["LaunchFreshdesk"] = "launch_freshdesk";
3987
3987
  ActionType2["LaunchSupportTicketForm"] = "launch_support_ticket_form";
3988
+ ActionType2["LaunchZendeskSunshineChat"] = "launch_zendesk_sunshine_chat";
3988
3989
  return ActionType2;
3989
3990
  })(ActionType || {});
3990
3991
  var NextBestActionType = /* @__PURE__ */ ((NextBestActionType2) => {
@@ -3997,6 +3998,7 @@ var NextBestActionType = /* @__PURE__ */ ((NextBestActionType2) => {
3997
3998
  NextBestActionType2["ZendeskMessenger"] = "zendesk_messenger";
3998
3999
  NextBestActionType2["IntercomChat"] = "intercom_chat";
3999
4000
  NextBestActionType2["Freshdesk"] = "freshdesk";
4001
+ NextBestActionType2["ZendeskSunshineChat"] = "zendesk_sunshine_chat";
4000
4002
  return NextBestActionType2;
4001
4003
  })(NextBestActionType || {});
4002
4004
 
@@ -4163,6 +4165,17 @@ const NextBestActions = ({ nextBestActions, onActionClick }) => {
4163
4165
  }
4164
4166
  }
4165
4167
  );
4168
+ case NextBestActionType.ZendeskSunshineChat:
4169
+ return /* @__PURE__ */ React__default.createElement(
4170
+ ActionButton,
4171
+ {
4172
+ key,
4173
+ icon: "CalendarBlank",
4174
+ label: action.label,
4175
+ index,
4176
+ onClick: () => handleClick()
4177
+ }
4178
+ );
4166
4179
  default:
4167
4180
  return /* @__PURE__ */ React__default.createElement(
4168
4181
  ActionButton,
@@ -4240,6 +4253,17 @@ const getActionMapping = (action) => {
4240
4253
  icon: "Notepad",
4241
4254
  getValue: (a) => a.action?.options?.formUrl || a.id,
4242
4255
  getLabel: (a) => a.action?.options?.title || "Submit a ticket"
4256
+ },
4257
+ [ActionType.LaunchZendeskSunshineChat]: {
4258
+ type: NextBestActionType.ZendeskSunshineChat,
4259
+ icon: "CalendarBlank",
4260
+ getValue: (a) => {
4261
+ return JSON.stringify({
4262
+ actionId: a.id,
4263
+ requireConfirmation: Boolean(a.action?.options?.requireConfirmation)
4264
+ });
4265
+ },
4266
+ getLabel: (a) => a.action?.options?.title || "Speak to an expert"
4243
4267
  }
4244
4268
  };
4245
4269
  const mapping = actionMapping[action.type] || {
@@ -5813,7 +5837,8 @@ const ChatSearchComponent = forwardRef(
5813
5837
  style,
5814
5838
  isSearchWidget = false,
5815
5839
  isAgentAssist = false,
5816
- hideCitations = false
5840
+ hideCitations = false,
5841
+ conversationInlineSlot
5817
5842
  }, ref) => {
5818
5843
  const {
5819
5844
  answers,
@@ -6634,6 +6659,7 @@ const ChatSearchComponent = forwardRef(
6634
6659
  disclaimer
6635
6660
  )
6636
6661
  ),
6662
+ conversationInlineSlot != null && /* @__PURE__ */ React__default.createElement("div", { className: "-mt-6 w-full max-w-[100vw] px-3 pb-0 pt-0 text-foreground md:px-0" }, conversationInlineSlot),
6637
6663
  /* @__PURE__ */ React__default.createElement("div", { ref: bottomRef })
6638
6664
  ),
6639
6665
  showResults && showFollowUp && /* @__PURE__ */ React__default.createElement(
@@ -6668,4 +6694,4 @@ const ChatSearch = forwardRef(({ featureFlags, ...props }, ref) => /* @__PURE__
6668
6694
  ChatSearch.displayName = "ChatSearch";
6669
6695
 
6670
6696
  export { ChatSearch as C, ChatSearchProvider as a, useIsChatSearchDirty as b, useChatSearch as u };
6671
- //# sourceMappingURL=ChatSearch.C7aXA1pe.js.map
6697
+ //# sourceMappingURL=ChatSearch.CL2VnSod.js.map