@ethora/chat-component 26.7.4 → 26.7.5

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/main.d.ts CHANGED
@@ -10,6 +10,8 @@ export { useQRCodeChat, handleQRChatId } from './hooks/useQRCodeChatHandler';
10
10
  export { useInAppNotifications } from './hooks/useInAppNotifications';
11
11
  export { default as usePushNotifications } from './hooks/usePushNotifications';
12
12
  export { resendMessage } from './utils/resendMessage';
13
+ export { parseQuickReplies } from './helpers/quickReplies';
14
+ export type { QuickReply } from './helpers/quickReplies';
13
15
  export { applyTypography, clearTypography } from './helpers/applyTypography';
14
16
  export { useTypography } from './hooks/useTypography';
15
17
  export type { TypographyConfig, FontFaceSource, } from './types/models/config.model';
package/dist/main.js CHANGED
@@ -1,26 +1,27 @@
1
- import { m as a, R as r, C as t, M as o, n as h, o as p, X as u, p as n, q as i, t as d, v as l, w as y, x as I, y as T, z as f, D as R, E as g, F as C, G as c, I as m, J as A, K as v } from "./main-DFqqDiy-.js";
1
+ import { m as a, R as r, C as t, M as o, n as p, o as h, X as u, p as i, q as n, t as d, v as l, w as y, x as I, y as T, z as R, D as f, E as c, F as g, G as C, I as m, J as A, K as Q, L as k } from "./main-DeiuFYsl.js";
2
2
  export {
3
3
  a as AuthTestIds,
4
4
  r as Chat,
5
5
  t as ChatInputTestIds,
6
6
  o as MessageBubbleTestIds,
7
- h as RefreshFatalError,
8
- p as RoomListTestIds,
7
+ p as RefreshFatalError,
8
+ h as RoomListTestIds,
9
9
  u as XmppProvider,
10
- n as applyTypography,
11
- i as clearTypography,
10
+ i as applyTypography,
11
+ n as clearTypography,
12
12
  d as handleQRChatId,
13
13
  l as isRefreshFatalError,
14
14
  y as logoutService,
15
- I as refreshAuthTokens,
16
- T as refreshAuthTokensQuietly,
15
+ I as parseQuickReplies,
16
+ T as refreshAuthTokens,
17
+ R as refreshAuthTokensQuietly,
17
18
  f as resendMessage,
18
- R as useInAppNotifications,
19
+ c as useInAppNotifications,
19
20
  g as useIsUserOnline,
20
21
  C as usePushNotifications,
21
- c as useQRCodeChat,
22
- m as useRoomPresence,
23
- A as useTypography,
24
- v as useUnread
22
+ m as useQRCodeChat,
23
+ A as useRoomPresence,
24
+ Q as useTypography,
25
+ k as useUnread
25
26
  };
26
27
  //# sourceMappingURL=main.js.map
@@ -3,6 +3,7 @@ import { xmppSettingsInterface } from './xmpp.model';
3
3
  import { PartialRoomWithMandatoryKeys, ConfigRoom } from './room.model';
4
4
  import { MessageBubble, MessageProps, IMessage } from './message.model';
5
5
  import { Iso639_1Codes } from './language.model';
6
+ import { QuickReply } from '../../helpers/quickReplies';
6
7
  import { default as React } from 'react';
7
8
  import { MessageNotificationToastProps } from '../../components/MessageNotification/MessageNotificationToast';
8
9
  /**
@@ -375,6 +376,24 @@ export interface IConfig {
375
376
  roomJID: string;
376
377
  user: any;
377
378
  }) => void;
379
+ /**
380
+ * Called after the user taps a button a bot attached to its message.
381
+ * The answer has ALREADY been sent into the room as an ordinary message
382
+ * by the time this fires - this is a notification, not an interception
383
+ * point, and a throw inside it is caught and logged.
384
+ *
385
+ * It exists so a host can drive a scripted flow (quiz, intake form,
386
+ * onboarding) on top of the same buttons a bot would send.
387
+ */
388
+ onQuickReply?: (event: {
389
+ /** Id of the bot message that offered the buttons. */
390
+ messageId: string;
391
+ roomJID: string;
392
+ /** The button that was tapped. */
393
+ reply: QuickReply;
394
+ /** `reply.questionId`, or the button's index when the bot sent none. */
395
+ questionId: string;
396
+ }) => void | Promise<void>;
378
397
  };
379
398
  disableTypingIndicator?: boolean;
380
399
  blockMessageSendingWhenProcessing?: boolean | {
@@ -33,6 +33,7 @@ export interface IMessage {
33
33
  size?: string;
34
34
  xmppId?: string;
35
35
  xmppFrom?: string;
36
+ quickReplies?: unknown;
36
37
  callLog?: {
37
38
  callId: string;
38
39
  direction: 'outgoing' | 'incoming';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ethora/chat-component",
3
- "version": "26.7.4",
3
+ "version": "26.7.5",
4
4
  "type": "module",
5
5
  "main": "dist/main.js",
6
6
  "types": "dist/main.d.ts",