@ethora/chat-component 26.7.5 → 26.7.7

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.
Files changed (174) hide show
  1. package/README.md +72 -16
  2. package/dist/ChatProfileModal-DehQM4Bo.js +2135 -0
  3. package/dist/FilePreviewModal-BcZLtVAy.js +743 -0
  4. package/dist/ManageDataModal-DWabKhSC.js +178 -0
  5. package/dist/MarkdownBody-CSY3YKDh.js +16874 -0
  6. package/dist/SideDrawer-DewJ-iPn.js +270 -0
  7. package/dist/UserProfileModal-BHZ0TULc.js +574 -0
  8. package/dist/UserSettingsModal-BxwVWNKo.js +50 -0
  9. package/dist/{VideoCallOverlay-C4M2I9oV.js → VideoCallOverlay-D5SuimGP.js} +9 -10
  10. package/dist/VisibilityModal-Bd67b4EM.js +132 -0
  11. package/dist/assets/icons.d.ts +30 -0
  12. package/dist/components/ContextMenu/ContextMenuComponents.d.ts +1 -3
  13. package/dist/components/EmojiPicker/LazyEmojiPicker.d.ts +3 -0
  14. package/dist/components/ExampleComponents/CustomMessage.d.ts +3 -3
  15. package/dist/components/Files/FilesList.d.ts +12 -0
  16. package/dist/components/Files/FilesPanel.d.ts +3 -0
  17. package/dist/components/Files/fileCategory.d.ts +13 -0
  18. package/dist/components/InputComponents/AttachmentPreview.d.ts +17 -0
  19. package/dist/components/InputComponents/MentionDropdown.d.ts +13 -0
  20. package/dist/components/InputComponents/MentionPickerModal.d.ts +19 -0
  21. package/dist/components/MainComponents/AttachmentList.d.ts +7 -0
  22. package/dist/components/MainComponents/ChatErrorBoundary.d.ts +53 -0
  23. package/dist/components/MainComponents/ChatErrorScreen.d.ts +24 -0
  24. package/dist/components/MainComponents/ChatRoomOpeningPreview.d.ts +24 -0
  25. package/dist/components/MainComponents/ChatWrapper.d.ts +1 -0
  26. package/dist/components/MainComponents/ChooseChatMessage.d.ts +11 -1
  27. package/dist/components/MainComponents/HeaderLogo.d.ts +18 -0
  28. package/dist/components/MainComponents/MediaMessage.d.ts +5 -0
  29. package/dist/components/MainComponents/MessageContainer.d.ts +2 -2
  30. package/dist/components/MainComponents/ReduxWrapper.d.ts +1 -2
  31. package/dist/components/MainComponents/SystemMessage.d.ts +1 -2
  32. package/dist/components/MenuRoom/MenuRoom.d.ts +1 -0
  33. package/dist/components/MessageBubble/CustomDivider.d.ts +3 -3
  34. package/dist/components/MessageBubble/Message.d.ts +2 -2
  35. package/dist/components/MessageBubble/MessageTranslate.d.ts +28 -10
  36. package/dist/components/MessageBubble/QuickReplies.d.ts +6 -5
  37. package/dist/components/Modals/ChatProfileModal/ChatProfileMemberRow.d.ts +18 -0
  38. package/dist/components/Modals/FilePreviewModal/FilePreviewModal.d.ts +17 -0
  39. package/dist/components/Modals/FilePreviewModal/ImageLightbox.d.ts +35 -0
  40. package/dist/components/Modals/FilePreviewModal/PdfView.d.ts +14 -3
  41. package/dist/components/Modals/Modal/Modal.d.ts +10 -0
  42. package/dist/components/Modals/Modal/ModalContent.d.ts +21 -0
  43. package/dist/components/Modals/ModalBox/ModalBox.d.ts +9 -0
  44. package/dist/components/Modals/ModalReportChat/ModalReportChat.d.ts +6 -1
  45. package/dist/components/Modals/ModalWrapper/ModalWrapper.d.ts +8 -0
  46. package/dist/components/Modals/NewChatModal/styledNewChatComponents.d.ts +12 -0
  47. package/dist/components/Modals/SettingsModals/SharedStyledComponents.d.ts +12 -0
  48. package/dist/components/Modals/SettingsModals/Visibility/StyledComponents.d.ts +1 -1
  49. package/dist/components/Modals/SideDrawer/DrawerProfileParts.d.ts +42 -0
  50. package/dist/components/Modals/SideDrawer/SideDrawer.d.ts +64 -0
  51. package/dist/components/Modals/SidePanel/SidePanel.d.ts +31 -0
  52. package/dist/components/Modals/UserProfileModal/EditUserModal.d.ts +5 -1
  53. package/dist/components/Modals/modalComponents.d.ts +6 -0
  54. package/dist/components/Modals/motionVariants.d.ts +37 -0
  55. package/dist/components/Modals/styledModalComponents.d.ts +13 -3
  56. package/dist/components/RoomComponents/ChatRoomItem.d.ts +0 -1
  57. package/dist/components/RoomComponents/OnlineUsersPopover.d.ts +0 -1
  58. package/dist/components/UsersList/StyledComponents.d.ts +5 -1
  59. package/dist/components/UsersList/UsersList.d.ts +23 -0
  60. package/dist/components/styled/Button.d.ts +11 -1
  61. package/dist/components/styled/ChatWrapperBox.d.ts +3 -1
  62. package/dist/components/styled/PdfMessage.d.ts +13 -0
  63. package/dist/components/styled/RoomListComponents/index.d.ts +22 -1
  64. package/dist/components/styled/SendInput.d.ts +19 -5
  65. package/dist/components/styled/StyledComponents.d.ts +1 -1
  66. package/dist/components/styled/StyledInputComponents/MediaComponents.d.ts +18 -0
  67. package/dist/components/styled/StyledInputComponents/StyledInputComponents.d.ts +21 -0
  68. package/dist/components/styled/TreadLabel.d.ts +2 -2
  69. package/dist/components/styled/UnsupportedType.d.ts +1 -1
  70. package/dist/context/ModalTransitionContext.d.ts +2 -0
  71. package/dist/examples/quiz/QuizDemo.d.ts +3 -0
  72. package/dist/examples/quiz/quizScript.d.ts +38 -0
  73. package/dist/examples/quiz/useDemoSession.d.ts +42 -0
  74. package/dist/examples/quiz/useQuizFlow.d.ts +47 -0
  75. package/dist/firebase-config.d.ts +2 -4
  76. package/dist/handleCopyClick-BoZWTBLC.js +108 -0
  77. package/dist/helpers/MarkdownBody.d.ts +7 -0
  78. package/dist/helpers/attachments.d.ts +33 -0
  79. package/dist/helpers/botMarkup.d.ts +30 -0
  80. package/dist/helpers/buildChatShareLink.d.ts +20 -0
  81. package/dist/helpers/cacheScope.d.ts +15 -1
  82. package/dist/helpers/constants/MODAL_TYPES.d.ts +13 -7
  83. package/dist/helpers/createRoomFromApi.d.ts +1 -1
  84. package/dist/helpers/ethoraLogger.d.ts +8 -0
  85. package/dist/helpers/fileKind.d.ts +17 -0
  86. package/dist/helpers/formatNumberWithCommas.d.ts +1 -1
  87. package/dist/helpers/hiddenRooms.d.ts +1 -1
  88. package/dist/helpers/historyPreloadScheduler.d.ts +1 -0
  89. package/dist/helpers/lazyEmoji.d.ts +3 -0
  90. package/dist/helpers/localStorageUser.d.ts +1 -1
  91. package/dist/helpers/markdownSanitizeSchema.d.ts +3 -0
  92. package/dist/helpers/mentions.d.ts +63 -0
  93. package/dist/helpers/parseMessageBody.d.ts +12 -2
  94. package/dist/helpers/pdf/loadPdfjs.d.ts +64 -0
  95. package/dist/helpers/remarkLineBreaks.d.ts +42 -0
  96. package/dist/helpers/resolveMessageTranslation.d.ts +34 -0
  97. package/dist/helpers/roomImageGallery.d.ts +53 -0
  98. package/dist/helpers/secureFileUrl.d.ts +8 -0
  99. package/dist/helpers/sendFailureWatchdog.d.ts +62 -0
  100. package/dist/helpers/transformTranslatations.d.ts +1 -2
  101. package/dist/hooks/pushSubscriptionSweep.d.ts +41 -0
  102. package/dist/hooks/useChatOpenPhase.d.ts +21 -0
  103. package/dist/hooks/useChatWrapperInit.d.ts +1 -0
  104. package/dist/hooks/useDelayedAction.d.ts +22 -0
  105. package/dist/hooks/useExclusiveRightPane.d.ts +25 -0
  106. package/dist/hooks/useExitTransition.d.ts +24 -0
  107. package/dist/hooks/useFilesEndpointSupport.d.ts +9 -0
  108. package/dist/hooks/useGetNewArchRoom.d.ts +3 -1
  109. package/dist/hooks/useInView.d.ts +17 -0
  110. package/dist/hooks/useMentionComposer.d.ts +45 -0
  111. package/dist/hooks/useMessageHeapState.d.ts +1 -1
  112. package/dist/hooks/useMessageTranslation.d.ts +4 -3
  113. package/dist/hooks/useModalDismiss.d.ts +27 -0
  114. package/dist/hooks/useMyFiles.d.ts +16 -0
  115. package/dist/hooks/usePdfThumbnail.d.ts +22 -0
  116. package/dist/hooks/useQRCodeChatHandler.d.ts +29 -1
  117. package/dist/hooks/useRoomMute.d.ts +19 -0
  118. package/dist/hooks/useRoomState.d.ts +1 -1
  119. package/dist/hooks/useSendMessage.d.ts +4 -3
  120. package/dist/hooks/useTypography.d.ts +1 -1
  121. package/dist/hooks/useUnreadMessagesCounter.d.ts +11 -2
  122. package/dist/index.esm-B-3fyDHY.js +28 -0
  123. package/dist/index.esm-CRM4VCRa.js +943 -0
  124. package/dist/index.esm-msbp26WN.js +3352 -0
  125. package/dist/index.esm2017-CL0mvq6y.js +1578 -0
  126. package/dist/main-C2FKeV6y.js +32375 -0
  127. package/dist/main.css +1 -1
  128. package/dist/main.d.ts +14 -0
  129. package/dist/main.js +18 -18
  130. package/dist/module-DGXkb0R_.js +2960 -0
  131. package/dist/native-CDi4YD_s.js +13 -0
  132. package/dist/networking/api-requests/files.api.d.ts +19 -0
  133. package/dist/networking/api-requests/rooms.api.d.ts +10 -2
  134. package/dist/networking/api-requests/translate.api.d.ts +15 -0
  135. package/dist/networking/api-requests/user.api.d.ts +2 -0
  136. package/dist/networking/sharedRequest.d.ts +4 -0
  137. package/dist/networking/xmpp/allRoomPresences.xmpp.d.ts +3 -1
  138. package/dist/networking/xmpp/createTimeoutPromise.xmpp.d.ts +14 -0
  139. package/dist/networking/xmpp/sendTextMessage.xmpp.d.ts +2 -1
  140. package/dist/networking/xmpp/sendTextMessageWithTranslateTag.xmpp.d.ts +2 -1
  141. package/dist/networking/xmppClient.d.ts +12 -3
  142. package/dist/pdf-B5b7qHu6.js +17130 -0
  143. package/dist/pdf.worker.min-COYn-gId.js +24385 -0
  144. package/dist/roomStore/index.d.ts +20 -0
  145. package/dist/roomStore/persistEncryption.d.ts +51 -0
  146. package/dist/roomStore/roomsSlice.d.ts +49 -6
  147. package/dist/styles/classNames.d.ts +35 -0
  148. package/dist/styles/motion.d.ts +71 -0
  149. package/dist/styles/tokens.d.ts +27 -0
  150. package/dist/testIds.d.ts +1 -1
  151. package/dist/types/models/attachment.model.d.ts +33 -0
  152. package/dist/types/models/config.model.d.ts +160 -19
  153. package/dist/types/models/file.model.d.ts +20 -0
  154. package/dist/types/models/message.model.d.ts +15 -6
  155. package/dist/types/models/room.model.d.ts +40 -2
  156. package/dist/types/types.d.ts +3 -1
  157. package/dist/utils/resendMessage.d.ts +22 -1
  158. package/dist/utils/translateModePolicy.d.ts +1 -0
  159. package/dist/wavesurfer.esm-D_a19qBW.js +952 -0
  160. package/package.json +22 -2
  161. package/dist/VideoCallOverlay-C4M2I9oV.js.map +0 -1
  162. package/dist/components/MainComponents/VirtualList.d.ts +0 -10
  163. package/dist/components/Modals/SettingsModals/BlockedUsers/BlockedUsersModal.d.ts +0 -6
  164. package/dist/components/Modals/SettingsModals/DocumentShares/DocumentSharesModal.d.ts +0 -6
  165. package/dist/components/Modals/SettingsModals/ManageDataModal/StyledComponents.d.ts +0 -0
  166. package/dist/components/Modals/SettingsModals/ProfileShares/ProfileShares.d.ts +0 -6
  167. package/dist/components/Modals/SettingsModals/Referrals/Referrals.d.ts +0 -6
  168. package/dist/hooks/useMessageQueue.d.ts +0 -4
  169. package/dist/main-DeiuFYsl.js +0 -55812
  170. package/dist/main-DeiuFYsl.js.map +0 -1
  171. package/dist/main.js.map +0 -1
  172. package/dist/networking/xmpp/getHistory.xmpp.d.ts +0 -3
  173. package/dist/networking/xmpp/listenerManager.d.ts +0 -17
  174. package/dist/utils/xmppMemoryMonitor.d.ts +0 -16
@@ -1,8 +1,12 @@
1
1
  import { default as React } from 'react';
2
- import { IConfig } from '../../types/types';
2
+ import { IConfig, IMentionSpan } from '../../types/types';
3
3
  export interface SendInputProps {
4
- sendMessage: (message: string) => void | Promise<void>;
5
- sendMedia: (data: any, type: string) => void | Promise<void>;
4
+ sendMessage: (message: string, mentions?: IMentionSpan[]) => void | Promise<void>;
5
+ /**
6
+ * Receives a `File[]` for picked attachments (one message, N files) and a
7
+ * `Blob` for voice notes. Single files still arrive as a one-element array.
8
+ */
9
+ sendMedia: (data: File[] | File | Blob, type: string) => void | Promise<void>;
6
10
  isLoading: boolean;
7
11
  editMessage?: string;
8
12
  config?: IConfig;
@@ -14,9 +18,19 @@ export interface SendInputProps {
14
18
  inputHeight?: number;
15
19
  showPreview?: boolean;
16
20
  previewParser?: (text: string) => (string | JSX.Element)[];
17
- onSendMessage?: (message: string) => void | Promise<void>;
18
- onSendMedia?: (data: any, type: string) => void | Promise<void>;
21
+ onSendMessage?: (message: string, mentions?: IMentionSpan[]) => void | Promise<void>;
22
+ onSendMedia?: (data: File[] | File | Blob, type: string) => void | Promise<void>;
19
23
  placeholderText?: string;
24
+ /** Disables the @-mention autocomplete (e.g. for a composer variant that
25
+ * doesn't want it). Defaults to enabled. */
26
+ disableMentions?: boolean;
27
+ /**
28
+ * Disables per-room draft persistence. Set it on any SECOND composer
29
+ * that is mounted for the same room as the main one - the thread
30
+ * composer, for instance - since drafts are keyed by room JID and two
31
+ * live composers would otherwise overwrite each other's text.
32
+ */
33
+ disableDrafts?: boolean;
20
34
  }
21
35
  declare const SendInput: React.FC<SendInputProps>;
22
36
  export default SendInput;
@@ -45,7 +45,7 @@ export declare const StyledLoaderWrapper: import('styled-components/dist/types')
45
45
  export declare const OrDelimiter: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components').FastOmit<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
46
46
  export declare const AlsoContainer: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components').FastOmit<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
47
47
  export declare const AlsoCheckbox: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components/dist/types').Substitute<import('react').DetailedHTMLProps<import('react').InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>, {
48
- accentColor: string;
48
+ $accentColor: string;
49
49
  }>> & string;
50
50
  export declare const Wrapper: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components/dist/types').Substitute<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {
51
51
  bgColor: string;
@@ -13,3 +13,21 @@ export declare const FileInformation: import('styled-components/dist/types').ISt
13
13
  export declare const FileName: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components').FastOmit<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, never>> & string;
14
14
  export declare const FileSizeContainer: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components').FastOmit<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
15
15
  export declare const FileSize: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components').FastOmit<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, never>> & string;
16
+ /** Wraps every attachment of one message. Single-file messages keep the
17
+ * old, un-gapped look because there is nothing to separate them from. */
18
+ export declare const AttachmentStack: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components').FastOmit<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
19
+ export declare const AttachmentGrid: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components/dist/types').Substitute<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {
20
+ $columns: number;
21
+ }>> & string;
22
+ export declare const AttachmentTile: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components').FastOmit<import('react').DetailedHTMLProps<import('react').ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, never>> & string;
23
+ export declare const PdfContainer: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components/dist/types').Substitute<import('react').DetailedHTMLProps<import('react').ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, {
24
+ $compact: boolean;
25
+ }>> & string;
26
+ export declare const PdfThumbnailFrame: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components/dist/types').Substitute<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {
27
+ $compact: boolean;
28
+ }>> & string;
29
+ /** Sits on the thumbnail while pdf.js parses so the row does not pop in. */
30
+ export declare const PdfThumbnailSkeleton: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components').FastOmit<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
31
+ export declare const PdfInformation: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components').FastOmit<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
32
+ export declare const PdfMetaRow: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components').FastOmit<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
33
+ export declare const PdfBadge: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components').FastOmit<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, never>> & string;
@@ -1,5 +1,21 @@
1
1
  export declare const InputContainer: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components').FastOmit<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
2
2
  export declare const MessageInputContainer: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components').FastOmit<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
3
+ /**
4
+ * Anchors the composer's emoji picker above the input row, inside
5
+ * InputContainer's positioning context (the same one MentionDropdown uses).
6
+ * Sits one layer above that dropdown so the two can never fight for the
7
+ * same pixels if both were ever open at once.
8
+ */
9
+ export declare const EmojiPickerPopover: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components').FastOmit<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
10
+ /**
11
+ * Drop-target state for drag-and-drop attachments. Covers the whole drop
12
+ * zone (the message area when the host marks one, else the composer) and is
13
+ * pointer-events: none so it can never swallow the drop it is announcing.
14
+ * Motion comes from the shared primitives, which already opt out under
15
+ * prefers-reduced-motion.
16
+ */
17
+ export declare const DropOverlay: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components').FastOmit<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
18
+ export declare const DropTarget: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components').FastOmit<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
3
19
  export declare const MessageInput: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components/dist/types').Substitute<import('react').DetailedHTMLProps<import('react').InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>, {
4
20
  $color?: string;
5
21
  $colorBg?: string;
@@ -12,6 +28,11 @@ export declare const FilePreviewContainer: import('styled-components/dist/types'
12
28
  export declare const FilePreview: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components').FastOmit<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
13
29
  export declare const ImagePreview: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components').FastOmit<import('react').DetailedHTMLProps<import('react').ImgHTMLAttributes<HTMLImageElement>, HTMLImageElement>, never>> & string;
14
30
  export declare const VideoPreview: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components').FastOmit<import('react').DetailedHTMLProps<import('react').VideoHTMLAttributes<HTMLVideoElement>, HTMLVideoElement>, never>> & string;
31
+ /** First page of a picked PDF, before it is sent. Fills the whole tile. */
32
+ export declare const DocumentPreview: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components').FastOmit<import('react').DetailedHTMLProps<import('react').ImgHTMLAttributes<HTMLImageElement>, HTMLImageElement>, never>> & string;
33
+ export declare const FilePreviewName: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components').FastOmit<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, never>> & string;
34
+ /** Why a pick was rejected (too many files, file too large). */
35
+ export declare const AttachmentNotice: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components').FastOmit<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
15
36
  export declare const StyledInput: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components/dist/types').Substitute<import('react').DetailedHTMLProps<import('react').InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>, {
16
37
  $colorBg?: string;
17
38
  }>> & string;
@@ -7,8 +7,8 @@ interface DateLabelProps {
7
7
  };
8
8
  }
9
9
  export declare const StyledDateLabel: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components/dist/types').Substitute<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {
10
- primary?: string;
11
- secondary?: string;
10
+ $primary?: string;
11
+ $secondary?: string;
12
12
  }>> & string;
13
13
  declare const TreadLabel: React.FC<DateLabelProps>;
14
14
  export default TreadLabel;
@@ -2,7 +2,7 @@ import { default as React } from 'react';
2
2
  interface FileDownloadProps {
3
3
  fileName: string;
4
4
  fileURL: string;
5
- mimetype: string;
5
+ mimetype?: string;
6
6
  size?: string;
7
7
  locationPreview?: string;
8
8
  }
@@ -0,0 +1,2 @@
1
+ export declare const ModalExitingProvider: import('react').Provider<boolean>;
2
+ export declare const useIsModalExiting: () => boolean;
@@ -0,0 +1,3 @@
1
+ import { default as React } from 'react';
2
+ declare const QuizDemo: React.FC;
3
+ export default QuizDemo;
@@ -0,0 +1,38 @@
1
+ /**
2
+ * The shape of a scripted question flow, and a sample script.
3
+ *
4
+ * This is EXAMPLE code, not part of the SDK surface: the engine only knows
5
+ * about a message carrying `quickReplies` and about sending the tapped value
6
+ * back into the room. Everything below - the notion of a "step", the order
7
+ * they run in, where the answers pile up - belongs to whoever drives the
8
+ * flow, whether that is a bot on the server or a host page like this one.
9
+ *
10
+ * The step types mirror the node palette of the flow builders these widgets
11
+ * are usually compared against (Say / Single Input / Options / Yes-No /
12
+ * Rating), minus the branching nodes.
13
+ */
14
+ export type QuizStepType = 'say' | 'input' | 'choice' | 'yesno' | 'rating';
15
+ export interface QuizOption {
16
+ name: string;
17
+ value: string;
18
+ }
19
+ export interface QuizStep {
20
+ /** Echoed back as `questionId` when one of this step's buttons is tapped. */
21
+ id: string;
22
+ type: QuizStepType;
23
+ /** What the bot says. */
24
+ text: string;
25
+ /** Short name for the closing summary. Falls back to `text`. */
26
+ label?: string;
27
+ /** Only for `choice`; `yesno` and `rating` synthesise their own. */
28
+ options?: QuizOption[];
29
+ }
30
+ /** Buttons a step offers. `say` and `input` steps offer none. */
31
+ export declare function optionsForStep(step: QuizStep): QuizOption[];
32
+ /**
33
+ * A six-question intake, written as an eye clinic's because that is the
34
+ * kind of site these flows land on. Deliberately mixes button steps with
35
+ * typed ones: a name and a contact detail cannot be picked from a list, and
36
+ * the two answer paths are the thing worth demonstrating.
37
+ */
38
+ export declare const DEFAULT_QUIZ_SCRIPT: QuizStep[];
@@ -0,0 +1,42 @@
1
+ /**
2
+ * A throwaway visitor + room, so the demo runs with no credentials.
3
+ *
4
+ * `POST /v2/widget/sessions` is the same endpoint the embeddable assistant
5
+ * uses to put an anonymous website visitor into a real MUC room: the server
6
+ * mints a visitor JID with a password and a room to talk in. Borrowing it
7
+ * here keeps this page open-and-run instead of "first go find a login" -
8
+ * and it is the only part of the demo that is demo-specific. A host
9
+ * embedding the chat normally already has a signed-in user.
10
+ */
11
+ export interface DemoSession {
12
+ appId: string;
13
+ baseUrl: string;
14
+ roomJID: string;
15
+ user: {
16
+ _id: string;
17
+ appId: string;
18
+ username: string;
19
+ name: string;
20
+ walletAddress: string;
21
+ firstName: string;
22
+ lastName: string;
23
+ xmppUsername: string;
24
+ xmppPassword: string;
25
+ token: string;
26
+ refreshToken: string;
27
+ defaultWallet: {
28
+ walletAddress: string;
29
+ };
30
+ };
31
+ xmppSettings: {
32
+ devServer: string;
33
+ host: string;
34
+ conference: string;
35
+ };
36
+ }
37
+ export declare function useDemoSession(): {
38
+ session: DemoSession;
39
+ connect: () => Promise<void>;
40
+ loading: boolean;
41
+ error: string;
42
+ };
@@ -0,0 +1,47 @@
1
+ import { QuizStep } from './quizScript';
2
+ /**
3
+ * Drives a scripted question flow on top of the engine's two primitives:
4
+ *
5
+ * 1. a bot message carrying `quickReplies` renders buttons under the
6
+ * bubble;
7
+ * 2. tapping one sends that button's value into the room as an ordinary
8
+ * message, and calls `config.eventHandlers.onQuickReply`.
9
+ *
10
+ * The flow itself lives here, in host code. In production the same script
11
+ * would run on the bot: it would send the questions over XMPP instead of
12
+ * this hook injecting them into the store, and nothing in the engine or in
13
+ * the bubble would change.
14
+ *
15
+ * Steps that ask for free text have no buttons, so their answer arrives as
16
+ * an ordinary typed message. We watch the room for the user's own new
17
+ * messages to catch those - see the subscription below.
18
+ */
19
+ export interface QuizAnswer {
20
+ stepId: string;
21
+ question: string;
22
+ answer: string;
23
+ /** How the answer was given, which is the interesting half of the demo. */
24
+ via: 'button' | 'typed';
25
+ }
26
+ export interface QuizBotIdentity {
27
+ id: string;
28
+ name: string;
29
+ avatar?: string;
30
+ }
31
+ export declare function useQuizFlow(script: QuizStep[], bot: QuizBotIdentity): {
32
+ onQuickReply: (event: {
33
+ messageId: string;
34
+ questionId: string;
35
+ reply: {
36
+ value: string;
37
+ };
38
+ }) => void;
39
+ start: () => void;
40
+ answers: QuizAnswer[];
41
+ isRunning: boolean;
42
+ currentStep: QuizStep;
43
+ stepIndex: number;
44
+ roomJID: any;
45
+ /** True while the composer is standing in for this step's buttons. */
46
+ awaitingTypedAnswer: boolean;
47
+ };
@@ -8,7 +8,5 @@ export declare const defaultConfig: {
8
8
  messagingSenderId: any;
9
9
  appId: any;
10
10
  };
11
- export declare const getFirebaseApp: (customConfig?: any) => FirebaseApp | null;
12
- export declare const getFirebaseMessaging: (customConfig?: any) => Messaging | null;
13
- export declare const app: FirebaseApp;
14
- export declare const messaging: Messaging;
11
+ export declare const getFirebaseApp: (customConfig?: any) => Promise<FirebaseApp | null>;
12
+ export declare const getFirebaseMessaging: (customConfig?: any) => Promise<Messaging | null>;
@@ -0,0 +1,108 @@
1
+ import { v as e, x as t } from "./main-C2FKeV6y.js";
2
+ const i = e.div`
3
+ display: flex;
4
+ flex-direction: column;
5
+ align-items: center;
6
+ gap: var(--ethora-space-4, 16px);
7
+ padding: var(--ethora-space-3, 12px) 0 var(--ethora-space-2, 8px);
8
+ text-align: center;
9
+
10
+ /*
11
+ * The avatar (ProfileImagePlaceholder) is always this block's first and
12
+ * only non-text child - both callers (ChatProfileModal, UserProfileModal)
13
+ * render it first, before the name. A soft ring around it - the panel's
14
+ * own background colour, then the same elevation a card gets - lifts it
15
+ * off the page as the one deliberately-composed focal point instead of a
16
+ * flat circle sitting in a vertical stack. Targeting the position (not a
17
+ * class) means this works without touching ProfileImagePlaceholder itself,
18
+ * which is outside this pass's file list.
19
+ */
20
+ & > *:first-child {
21
+ box-shadow:
22
+ 0 0 0 4px var(--ethora-color-bg, #fff),
23
+ var(--ethora-shadow-md, 0 4px 12px rgba(16, 24, 40, 0.1));
24
+ border-radius: var(--ethora-radius-full, 999px);
25
+ }
26
+ `, s = e.div`
27
+ font-size: var(--ethora-font-size-xl, 22px);
28
+ font-weight: var(--ethora-font-weight-bold, 700);
29
+ line-height: var(--ethora-line-height-tight, 1.25);
30
+ color: var(--ethora-color-text, #141414);
31
+ overflow-wrap: anywhere;
32
+ `, l = e.div`
33
+ margin-top: var(--ethora-space-1, 4px);
34
+ font-size: var(--ethora-font-size-sm, 14px);
35
+ font-weight: var(--ethora-font-weight-medium, 500);
36
+ color: var(--ethora-color-text-muted, #8c8c8c);
37
+ `, n = e.div`
38
+ display: flex;
39
+ flex-direction: column;
40
+ gap: var(--ethora-space-2, 8px);
41
+ width: 100%;
42
+ margin-top: var(--ethora-space-1, 4px);
43
+ `, c = e.p`
44
+ margin: 0;
45
+ font-size: var(--ethora-font-size-sm, 14px);
46
+ line-height: var(--ethora-line-height-normal, 1.5);
47
+ color: ${({ $empty: a }) => a ? "var(--ethora-color-text-muted, #8c8c8c)" : "var(--ethora-color-text, #141414)"};
48
+ font-style: ${({ $empty: a }) => a ? "italic" : "normal"};
49
+ text-align: start;
50
+ overflow-wrap: anywhere;
51
+ `, h = e.span`
52
+ display: inline-flex;
53
+ /* The pill is usually a child of a column flex container, which blockifies
54
+ inline-flex and stretches it to the full column width unless it opts out.
55
+ A pill that spans the whole panel reads as a banner, not as a tag. */
56
+ align-self: flex-start;
57
+ align-items: center;
58
+ gap: var(--ethora-space-1, 4px);
59
+ padding: var(--ethora-space-1, 4px) var(--ethora-space-3, 12px);
60
+ border-radius: var(--ethora-radius-full, 999px);
61
+ background: var(--ethora-color-primary-soft, #e7edf9);
62
+ color: var(--ethora-color-primary, #0052cd);
63
+ font-size: var(--ethora-font-size-xs, 12px);
64
+ font-weight: var(--ethora-font-weight-semibold, 600);
65
+
66
+ & > svg {
67
+ width: 14px;
68
+ height: 14px;
69
+ }
70
+ `, o = t`
71
+ padding: ${({ $compact: a }) => a ? "var(--ethora-space-4, 16px) var(--ethora-space-2, 8px)" : "var(--ethora-space-6, 24px) var(--ethora-space-4, 16px)"};
72
+ `, p = e.div`
73
+ display: flex;
74
+ flex-direction: column;
75
+ align-items: center;
76
+ justify-content: center;
77
+ text-align: center;
78
+ gap: var(--ethora-space-1, 4px);
79
+ color: var(--ethora-color-text-secondary, #5a5f66);
80
+ ${o}
81
+
82
+ & > svg {
83
+ opacity: 0.7;
84
+ margin-bottom: var(--ethora-space-1, 4px);
85
+ }
86
+ `, f = e.div`
87
+ font-size: var(--ethora-font-size-sm, 14px);
88
+ font-weight: var(--ethora-font-weight-medium, 500);
89
+ color: var(--ethora-color-text-secondary, #5a5f66);
90
+ `;
91
+ e.div`
92
+ font-size: var(--ethora-font-size-xs, 12px);
93
+ color: var(--ethora-color-text-muted, #8c8c8c);
94
+ `;
95
+ const d = (a) => {
96
+ navigator.clipboard.writeText(a);
97
+ };
98
+ export {
99
+ c as D,
100
+ i as P,
101
+ s as a,
102
+ n as b,
103
+ l as c,
104
+ h as d,
105
+ p as e,
106
+ f,
107
+ d as h
108
+ };
@@ -0,0 +1,7 @@
1
+ import { MentionClickHandler } from './parseMessageBody';
2
+ interface MarkdownBodyProps {
3
+ text: string;
4
+ onMentionClick?: MentionClickHandler;
5
+ }
6
+ declare const MarkdownBody: ({ text, onMentionClick }: MarkdownBodyProps) => import("react/jsx-runtime").JSX.Element;
7
+ export default MarkdownBody;
@@ -0,0 +1,33 @@
1
+ import { IAttachment, IMessage } from '../types/types';
2
+ /**
3
+ * Hard ceiling on how many attachments we will serialise into a stanza.
4
+ * The composer caps the picker far below this; this is the parser-side
5
+ * guard so a malformed or hostile stanza cannot make us render an
6
+ * unbounded grid.
7
+ */
8
+ export declare const MAX_ATTACHMENTS_PER_MESSAGE = 10;
9
+ /**
10
+ * Turns one raw wire/API object into an `IAttachment`, or null when there is
11
+ * nothing renderable in it. `location` is allowed to be empty: that is what
12
+ * an optimistic (still-uploading) attachment looks like.
13
+ */
14
+ export declare const normalizeAttachment: (raw: unknown) => IAttachment | null;
15
+ /** Accepts the parsed array, the raw JSON string, or junk. Never throws. */
16
+ export declare const parseAttachments: (raw: unknown) => IAttachment[];
17
+ /**
18
+ * The wire form: a JSON string on the `<data attachments="...">` attribute.
19
+ * Only the fields a receiver renders are sent - the stanza is already wide
20
+ * and every byte here is duplicated per attachment.
21
+ */
22
+ export declare const serializeAttachments: (attachments: IAttachment[]) => string;
23
+ /**
24
+ * The only supported way to read a media message's files.
25
+ *
26
+ * Order of truth: the multi-attach payload when present, otherwise the flat
27
+ * legacy fields synthesised into a single attachment. Every message that
28
+ * predates this feature - and every message from a client that does not
29
+ * speak it - takes the second path.
30
+ */
31
+ export declare const getMessageAttachments: (message?: Pick<IMessage, "attachments" | "location" | "locationPreview" | "mimetype" | "originalName" | "fileName" | "size"> | null) => IAttachment[];
32
+ /** Name to show for an attachment, with the URL tail as the last resort. */
33
+ export declare const getAttachmentName: (attachment: IAttachment) => string;
@@ -0,0 +1,30 @@
1
+ import { QuickReply } from './quickReplies';
2
+ /**
3
+ * Buttons an AI agent writes straight into its reply text.
4
+ *
5
+ * Bots built on the SDK attach buttons as the `quickReplies` attribute of the
6
+ * stanza's <data> element. An LLM agent cannot do that: all it controls is the
7
+ * text of its answer. So its system prompt teaches it an in-band form of the
8
+ * same thing, part of the Ethora chat protocol:
9
+ *
10
+ * <xml>
11
+ * <bot-data type="buttons">[Accept],[Reject]</bot-data>
12
+ * <body>Choose one please</body>
13
+ * </xml>
14
+ *
15
+ * This module turns that text into the same QuickReply buttons the attribute
16
+ * produces, plus the text that should actually be shown. It is written for
17
+ * model output, so it is deliberately forgiving about the envelope (the
18
+ * <xml>/<body> wrappers are optional, code fences are unwrapped, an
19
+ * HTML-escaped copy is accepted) and deliberately strict about what it
20
+ * hides: only a `type="buttons"` block is consumed, and nothing is stripped
21
+ * from a message that does not contain one.
22
+ */
23
+ export interface BotMarkup {
24
+ /** Text to display, with the machine-readable markup removed. */
25
+ text: string;
26
+ buttons: QuickReply[];
27
+ }
28
+ export declare const parseBotMarkup: (body: unknown) => BotMarkup;
29
+ /** The displayable text of a body, for previews and copy. */
30
+ export declare const stripBotMarkup: (body: unknown) => string;
@@ -0,0 +1,20 @@
1
+ /**
2
+ * Builds the "open this chat" link that the QR modal encodes.
3
+ *
4
+ * Two rules matter here:
5
+ *
6
+ * 1. The link has to point back at a page that actually mounts <Chat>.
7
+ * The old fallback invented a `/app/chat/` path from the current origin
8
+ * (and, with no window, an even older `beta.ethora.com` build-time URL),
9
+ * so scanning the QR on any deployment whose chat does not live at
10
+ * `/app/chat/` landed on a blank page. The current page is the one the
11
+ * user is looking at the chat in, so its own origin + pathname is the
12
+ * only entry point we can honestly guarantee. A host that serves chat
13
+ * somewhere else still overrides everything via `config.qrUrl`.
14
+ *
15
+ * 2. The parameter is written with URLSearchParams so an existing query
16
+ * string on the page (locale switches, host params) survives instead of
17
+ * being clobbered, and the id is encoded.
18
+ */
19
+ export declare const CHAT_LINK_PARAM = "chatId";
20
+ export declare const buildChatShareLink: (chatJid: string, qrUrl?: string, currentHref?: string) => string;
@@ -1,8 +1,22 @@
1
1
  import { IConfig } from '../types/types';
2
2
  export declare const buildCacheScope: (config?: IConfig) => string;
3
- export declare const clearScopedChatCache: () => void;
3
+ interface ClearScopedChatCacheOptions {
4
+ /**
5
+ * Keep the chat id a QR code / shared link just parked.
6
+ *
7
+ * That id is not cached data from a previous session, it is the room the
8
+ * user is arriving at RIGHT NOW. Wiping it on a first-run reset (which is
9
+ * exactly when someone opens a link on a fresh browser) dropped the
10
+ * destination on the floor: the selection was cleared, and the first room
11
+ * that happened to arrive over XMPP was opened instead. A genuine tenant
12
+ * switch still drops it - a bare chat id means nothing in another tenant.
13
+ */
14
+ keepPendingChatId?: boolean;
15
+ }
16
+ export declare const clearScopedChatCache: (options?: ClearScopedChatCacheOptions) => void;
4
17
  export declare const ensureScopedChatCache: (config?: IConfig) => {
5
18
  changed: boolean;
6
19
  scope: string;
7
20
  previousScope: string | null;
8
21
  };
22
+ export {};
@@ -4,12 +4,18 @@ export declare const MODAL_TYPES: {
4
4
  CHAT_PROFILE: string;
5
5
  MANAGE_DATA: string;
6
6
  VISIBILITY: string;
7
- PROFILE_SHARES: string;
8
- DOCUMENT_SHARES: string;
9
- BLOCKED_USERS: string;
10
- REFERRALS: string;
11
7
  FILE_PREVIEW: string;
12
8
  };
13
- export declare const MODAL_COMPONENTS: Record<string, React.FC<{
14
- handleCloseModal: () => void;
15
- }>>;
9
+ /**
10
+ * Panels reached from inside Settings. Their back button (and Escape) steps
11
+ * back to the Settings list rather than closing the drawer outright.
12
+ */
13
+ export declare const SETTINGS_SUB_MODAL_TYPES: string[];
14
+ /**
15
+ * Panels that open as the chat's right-hand COLUMN rather than as a centred
16
+ * card on top of it: the profile/settings family. These take part in the
17
+ * layout (see `components/Modals/SidePanel/SidePanel.tsx`), so opening one
18
+ * narrows the conversation instead of covering it. Everything else (file
19
+ * preview and the confirm dialogs) keeps the centred-dialog presentation.
20
+ */
21
+ export declare const SIDE_PANEL_MODAL_TYPES: string[];
@@ -1,2 +1,2 @@
1
1
  import { ApiRoom, IRoom } from '../types/types';
2
- export declare const createRoomFromApi: (room: ApiRoom, service?: string, usersArrayLength?: number) => IRoom;
2
+ export declare const createRoomFromApi: (room: ApiRoom, service?: string, usersArrayLength?: number) => IRoom | null;
@@ -4,4 +4,12 @@ export declare const ethoraLogger: {
4
4
  debug: (...args: unknown[]) => void;
5
5
  error: (...args: unknown[]) => void;
6
6
  always: (...args: unknown[]) => void;
7
+ /**
8
+ * For failures that must never be silent, whatever the verbose-console
9
+ * setting is: today, an uncaught render error caught by the SDK's error
10
+ * boundary. `error` above stays gated so routine debug noise remains
11
+ * opt-in; this one does not, because a swallowed crash leaves the host
12
+ * with a replaced chat pane and no explanation anywhere.
13
+ */
14
+ criticalError: (...args: unknown[]) => void;
7
15
  };
@@ -0,0 +1,17 @@
1
+ /**
2
+ * One place that answers "what do we render for this file?".
3
+ *
4
+ * Before this, every surface (bubble, room list, notification toast, the
5
+ * composer) re-derived the answer from `mimetype` alone with a slightly
6
+ * different set of `startsWith` checks, and none of them looked at the file
7
+ * name. That is why a PDF uploaded as `application/octet-stream` (which our
8
+ * storage does for anything it cannot sniff) ended up in the audio branch.
9
+ */
10
+ export type FileKind = 'image' | 'video' | 'audio' | 'pdf' | 'file';
11
+ /** Lowercase extension without the dot; '' when the name carries none. */
12
+ export declare const getFileExtension: (name?: string) => string;
13
+ export declare const isPdfFile: (mimetype?: string, name?: string) => boolean;
14
+ export declare const getFileKind: (mimetype?: string, name?: string) => FileKind;
15
+ export declare const formatFileSize: (sizeInBytes?: string | number) => string;
16
+ /** Middle-truncates the base name, always keeping the extension visible. */
17
+ export declare const formatFileName: (name: string, maxLength: number) => string;
@@ -1 +1 @@
1
- export declare function formatNumberWithCommas(num: number | string): string;
1
+ export declare function formatNumberWithCommas(num: number | string, locale?: string): string;
@@ -2,7 +2,7 @@ import { IConfig, IRoom } from '../types/types';
2
2
  type RoomLike = Pick<IRoom, 'jid' | 'title' | 'name'>;
3
3
  /**
4
4
  * True when the room is listed in `config.hiddenRooms` (by JID or by
5
- * case-insensitive title). Hidden rooms stay joined — they are only
5
+ * case-insensitive title). Hidden rooms stay joined - they are only
6
6
  * suppressed from the room list and the unread counters.
7
7
  */
8
8
  export declare const isRoomHidden: (room: RoomLike | null | undefined, config?: Pick<IConfig, "hiddenRooms"> | null) => boolean;
@@ -9,6 +9,7 @@ interface HistoryPreloadSchedulerOptions {
9
9
  selectedRoomJid?: string | null;
10
10
  defaultRoomJids?: string[];
11
11
  forceReload?: boolean;
12
+ completionState?: 'done' | 'partial';
12
13
  }
13
14
  export declare const runHistoryPreloadScheduler: (options: HistoryPreloadSchedulerOptions) => Promise<void>;
14
15
  export default runHistoryPreloadScheduler;
@@ -0,0 +1,3 @@
1
+ export declare const loadEmojiData: () => Promise<any>;
2
+ export declare const getEmojiNativeById: (id: string) => string;
3
+ export declare const useEmojiData: () => boolean;
@@ -1 +1 @@
1
- export declare const getLocalStorageUser: () => import('../types/types').User;
1
+ export declare const getLocalStorageUser: () => import('../main').User;
@@ -0,0 +1,3 @@
1
+ import { Options as SanitizeSchema } from 'rehype-sanitize';
2
+ export declare const markdownSanitizeSchema: SanitizeSchema;
3
+ export default markdownSanitizeSchema;