@ethora/chat-component 26.6.5 → 26.6.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 (48) hide show
  1. package/dist/assets/icons.d.ts +0 -4
  2. package/dist/components/MainComponents/ChatHeader.d.ts +1 -2
  3. package/dist/components/MainComponents/ProfileImagePlaceholder.d.ts +0 -2
  4. package/dist/components/MainComponents/Switch.d.ts +0 -8
  5. package/dist/components/MessageBubble/MessageTranslations.d.ts +10 -0
  6. package/dist/components/RoomComponents/ChatRoomItem.d.ts +2 -2
  7. package/dist/firebase-messaging-sw.js +4 -16
  8. package/dist/helpers/callLogMessage.d.ts +0 -22
  9. package/dist/helpers/createUserNameFromSetUser.d.ts +1 -36
  10. package/dist/helpers/resolveIconColor.d.ts +3 -5
  11. package/dist/hooks/useChatSettingState.d.ts +0 -2
  12. package/dist/hooks/useChatWrapperInit.d.ts +1 -3
  13. package/dist/hooks/useSendMessage.d.ts +0 -1
  14. package/dist/main.d.ts +2 -1
  15. package/dist/main.js +77070 -19
  16. package/dist/main.js.map +1 -1
  17. package/dist/networking/apiClient.d.ts +15 -7
  18. package/dist/networking/authRefresh.d.ts +102 -0
  19. package/dist/networking/xmppClient.d.ts +49 -2
  20. package/dist/roomStore/Middleware/unreadMidlleware.d.ts +0 -1
  21. package/dist/roomStore/callSlice.d.ts +0 -1
  22. package/dist/roomStore/chatSettingsSlice.d.ts +2 -25
  23. package/dist/roomStore/roomsSlice.d.ts +1 -8
  24. package/dist/types/models/config.model.d.ts +15 -122
  25. package/dist/types/models/language.model.d.ts +1 -1
  26. package/dist/types/models/message.model.d.ts +0 -1
  27. package/dist/version.d.ts +1 -1
  28. package/package.json +1 -1
  29. package/public/firebase-messaging-sw.js +4 -16
  30. package/dist/VideoCallOverlay-DQ2ajQ0G.js +0 -23647
  31. package/dist/VideoCallOverlay-DQ2ajQ0G.js.map +0 -1
  32. package/dist/components/MainComponents/LanguageSelectorModal.d.ts +0 -3
  33. package/dist/components/MessageBubble/MessageTranslate.d.ts +0 -25
  34. package/dist/components/MessageBubble/TranslatedMessageBody.d.ts +0 -21
  35. package/dist/components/Notification/NotificationPermissionBanner.d.ts +0 -16
  36. package/dist/components/RoomComponents/OnlineUsersPopover.d.ts +0 -11
  37. package/dist/helpers/isLikelyMucJid.d.ts +0 -1
  38. package/dist/helpers/scheduleAckCatchup.d.ts +0 -27
  39. package/dist/helpers/toBaseLanguage.d.ts +0 -8
  40. package/dist/hooks/useIsMobileViewport.d.ts +0 -1
  41. package/dist/hooks/useMessageTranslation.d.ts +0 -28
  42. package/dist/hooks/useRoomPresence.d.ts +0 -10
  43. package/dist/i18n/strings.d.ts +0 -15
  44. package/dist/i18n/useT.d.ts +0 -33
  45. package/dist/main-CvjGO1ik.js +0 -74444
  46. package/dist/main-CvjGO1ik.js.map +0 -1
  47. package/dist/networking/helpers/refreshChecker.d.ts +0 -1
  48. package/dist/utils/translateModePolicy.d.ts +0 -19
@@ -1,7 +1,3 @@
1
- export declare const GlobeIcon: ({ color, ...props }: {
2
- [x: string]: any;
3
- color?: string;
4
- }) => import("react/jsx-runtime").JSX.Element;
5
1
  export declare const AddNewIcon: ({ color, ...props }: {
6
2
  [x: string]: any;
7
3
  color?: string;
@@ -1,9 +1,8 @@
1
1
  import { default as React } from 'react';
2
- import { IConfig, IRoom } from '../../types/types';
2
+ import { IRoom } from '../../types/types';
3
3
  interface ChatHeaderProps {
4
4
  currentRoom: IRoom;
5
5
  handleBackClick?: (value: boolean) => void;
6
6
  }
7
- export declare const shouldShowLanguageSelector: (translatesConfig: IConfig["translates"] | undefined) => boolean;
8
7
  declare const ChatHeader: React.FC<ChatHeaderProps>;
9
8
  export default ChatHeader;
@@ -16,8 +16,6 @@ interface ProfileImagePlaceholderProps {
16
16
  active?: boolean;
17
17
  placeholderIcon?: React.ReactNode;
18
18
  disableOverlay?: boolean;
19
- /** Show a green online-status dot on the avatar. */
20
- online?: boolean;
21
19
  }
22
20
  export declare const ProfileImagePlaceholder: React.FC<ProfileImagePlaceholderProps>;
23
21
  export {};
@@ -4,14 +4,6 @@ interface SwitchProps {
4
4
  bgColor?: string;
5
5
  onSwitchOn?: () => void;
6
6
  onSwitchOff?: () => void;
7
- /**
8
- * Reflects an existing value (e.g. redux state) instead of always
9
- * starting from "off". Optional and defaults to undefined so every
10
- * existing fire-and-forget caller keeps its original always-starts-off
11
- * behaviour unchanged - only pass this when the switch represents a
12
- * real, already-known boolean.
13
- */
14
- checked?: boolean;
15
7
  }
16
8
  declare const Switch: React.FC<SwitchProps>;
17
9
  export default Switch;
@@ -0,0 +1,10 @@
1
+ import { FC } from 'react';
2
+ import { IConfig, IMessage } from '../../types/types';
3
+ interface MessageTranslationsProps {
4
+ message: IMessage;
5
+ langSource?: string;
6
+ isUser: boolean;
7
+ config?: IConfig;
8
+ }
9
+ declare const MessageTranslations: FC<MessageTranslationsProps>;
10
+ export default MessageTranslations;
@@ -7,5 +7,5 @@ interface ChatRoomItemProps {
7
7
  performClick: (chat: IRoom) => void;
8
8
  config: IConfig;
9
9
  }
10
- declare const _default: React.NamedExoticComponent<ChatRoomItemProps>;
11
- export default _default;
10
+ declare const ChatRoomItem: React.FC<ChatRoomItemProps>;
11
+ export default ChatRoomItem;
@@ -384,10 +384,9 @@ async function handlePush(raw = {}, source = 'push') {
384
384
  });
385
385
 
386
386
  const visible = isVisibleClients(windowClients);
387
- const hasAnyClient = windowClients.length > 0;
388
387
 
389
388
  if (DEBUG) log('clients:', dumpClients(windowClients));
390
- log('visibleClientExists:', visible, 'anyClientExists:', hasAnyClient);
389
+ log('visibleClientExists:', visible);
391
390
 
392
391
  await broadcastDebugMessage({
393
392
  source,
@@ -446,20 +445,9 @@ async function handlePush(raw = {}, source = 'push') {
446
445
  },
447
446
  };
448
447
 
449
- // Calls: a client that's merely backgrounded (open, just not the
450
- // visible/focused tab) is NOT the "nobody will hear this ring" case -
451
- // VideoCallOverlay already rings its own OS notification for exactly
452
- // that state (see its comment: this SW push is meant to be the
453
- // fully-offline fallback). `visible` collapses "backgrounded but open"
454
- // and "fully closed" into the same false, which duplicated that
455
- // client-side ring every time the tab was merely hidden. Suppress on
456
- // ANY open client for calls; regular messages keep the visible-only
457
- // check they already had.
458
- const suppress = isCall ? hasAnyClient : visible;
459
-
460
- if (!suppress) {
448
+ if (!visible) {
461
449
  log('SHOW NOTIFICATION', {
462
- reason: isCall ? 'NO_CLIENT_AT_ALL' : 'NO_VISIBLE_CLIENT',
450
+ reason: 'NO_VISIBLE_CLIENT',
463
451
  tag: options.tag,
464
452
  isCall,
465
453
  });
@@ -468,7 +456,7 @@ async function handlePush(raw = {}, source = 'push') {
468
456
  }
469
457
 
470
458
  log('SKIP NOTIFICATION', {
471
- reason: isCall ? 'CLIENT_OPEN_WILL_RING_ITSELF' : 'VISIBLE_CLIENT',
459
+ reason: 'VISIBLE_CLIENT',
472
460
  });
473
461
  }
474
462
 
@@ -8,26 +8,4 @@ export interface CallLogMeta {
8
8
  }
9
9
  export declare const isCallLogMessage: (message: unknown) => boolean;
10
10
  export declare const callStateHasLogData: (attrs: Record<string, any>) => boolean;
11
- export declare const formatCallDuration: (ms: number) => string;
12
11
  export declare const transformCallLogMessage: (message: IMessage, selfXmppUsername: string) => IMessage;
13
- export declare const buildLocalCallLogMessage: (params: {
14
- callId: string;
15
- direction: "outgoing" | "incoming";
16
- durationMs: number;
17
- kind: "audio" | "video";
18
- selfXmppUsername: string;
19
- }) => IMessage;
20
- /**
21
- * The label for a call-log entry, built at RENDER time from the callLog
22
- * meta rather than read off `message.body`.
23
- *
24
- * transformCallLogMessage bakes an English sentence into `body` the moment
25
- * the stanza arrives, which freezes the language: switch to Chinese and
26
- * every call log you already received stays English forever, because the
27
- * text is data by then, not a rendering. The meta (direction/duration/
28
- * missed) is the actual fact - the sentence is a view of it, so it belongs
29
- * where the view is. `body` stays as the fallback for entries received
30
- * before this existed, and for the notification/sidebar preview paths that
31
- * only have the raw message.
32
- */
33
- export declare const formatCallLogLabel: (callLog: CallLogMeta | undefined, t: (key: string, vars?: Record<string, string | number>) => string, fallbackBody?: string) => string;
@@ -1,37 +1,2 @@
1
- import { IMessage, RoomMember } from '../types/types';
2
- /**
3
- * Cache-only lookup. Returns the literal "Deleted User" as a MISS sentinel
4
- * when `usersSet` has no entry for `userId` yet - callers that want a
5
- * better fallback (e.g. resolveSenderDisplayName below) check for that
6
- * exact string rather than treating it as a real name.
7
- */
1
+ import { RoomMember } from '../types/types';
8
2
  export declare const createUserNameFromSetUser: (usersSet: Record<string, RoomMember>, userId: string) => string;
9
- /**
10
- * The sender's display name, resolved WITHOUT depending on `usersSet`
11
- * having already been hydrated.
12
- *
13
- * `usersSet` is populated by a separate fetch (member list / presence) that
14
- * can still be in flight when a message arrives - most reliably right after
15
- * reconnect, when a burst of catch-up messages can land before that fetch
16
- * resolves. A cache-only lookup shows the literal "Deleted User" for every
17
- * one of those messages, even though the sender is very much not deleted.
18
- *
19
- * The message itself already carries the sender's name on the wire: every
20
- * client that sends through this SDK stamps `senderFirstName` /
21
- * `senderLastName` / `fullName` onto the outgoing stanza's `<data>` element
22
- * (see sendTextMessage.xmpp.ts / sendTextMessageWithTranslateTag.xmpp.ts),
23
- * and createMessageFromXml spreads those onto the top-level message object.
24
- * Preferring that over the cache removes the timing dependency entirely for
25
- * the common case, and "Deleted User" becomes what it should have always
26
- * been: a rare last resort, not "usersSet hasn't loaded yet".
27
- *
28
- * Mirrors roomsSlice.ts's enrichMessageAuthor, which does the same
29
- * self-healing for the message list - this is that same resolution used
30
- * where a live decision is needed once (e.g. a notification), rather than
31
- * baked into a message object that re-resolves on every store update.
32
- */
33
- export declare const resolveSenderDisplayName: (message: Pick<IMessage, "user"> & {
34
- fullName?: string;
35
- senderFirstName?: string;
36
- senderLastName?: string;
37
- }, usersSet: Record<string, RoomMember>) => string;
@@ -12,11 +12,9 @@ export declare const resolveIconColor: (config?: Pick<IConfig, "colors"> | null)
12
12
  * Resolve the background colour to use behind the chat's icon "chips" (attach,
13
13
  * send, microphone, file preview, etc.).
14
14
  *
15
- * Priority: explicit `config.colors.iconsBg` → a soft neutral default. We do
16
- * NOT fall back to `colors.secondary`: that's a text/heading colour (often
17
- * near-black), and using it here rendered the icon chips as harsh black
18
- * squares. `secondary` also drives avatar backgrounds, so keeping it out of
19
- * this resolver lets hosts theme text without blacking out the icons.
15
+ * Priority: explicit `config.colors.iconsBg` → `config.colors.secondary` →
16
+ * white. Lets a host theme the icon backgrounds independently from `secondary`
17
+ * via `colors.iconsBg`, while keeping the historical white default.
20
18
  */
21
19
  export declare const resolveIconBgColor: (config?: Pick<IConfig, "colors"> | null) => string;
22
20
  /** CSS variable read by the chat's chrome icons as their default colour. */
@@ -6,6 +6,4 @@ export declare const useChatSettingState: () => {
6
6
  deleteModal: any;
7
7
  selectedUser: any;
8
8
  langSource: any;
9
- translateSendEnabled: any;
10
- translateMode: any;
11
9
  };
@@ -1,4 +1,4 @@
1
- import { IConfig, Iso639_1Codes } from '../types/types';
1
+ import { IConfig } from '../types/types';
2
2
  import { default as XmppClient } from '../networking/xmppClient';
3
3
  interface useChatWrapperInitProps {
4
4
  roomJID: string | null | undefined;
@@ -15,7 +15,5 @@ interface useChatWrapperInitResult {
15
15
  setClient: React.Dispatch<React.SetStateAction<XmppClient | null>>;
16
16
  isConnectionLost: boolean;
17
17
  }
18
- export declare const resolveLegacyTranslatesLangSource: (translatesConfig?: IConfig["translates"]) => Iso639_1Codes | undefined;
19
- export declare const resolveExternalReaderLocaleLangSource: (readerLocale?: string) => Iso639_1Codes | undefined;
20
18
  declare const useChatWrapperInit: ({ roomJID, wasAutoSelected, config, }: useChatWrapperInitProps) => useChatWrapperInitResult;
21
19
  export default useChatWrapperInit;
@@ -1,4 +1,3 @@
1
- export declare const shouldTagOutgoingTranslateSource: (translatesEnabled: boolean | undefined, translateSendEnabled: boolean | undefined) => boolean;
2
1
  export declare const useSendMessage: () => {
3
2
  sendMessage: (message: string, activeRoomJID: string, isReply?: boolean, isChecked?: boolean, mainMessage?: string) => Promise<void>;
4
3
  sendMedia: (data: File, type: string, activeRoomJID: string, isReply?: boolean, isChecked?: boolean, mainMessage?: string) => Promise<void>;
package/dist/main.d.ts CHANGED
@@ -4,7 +4,6 @@
4
4
  export { XmppProvider } from './context/xmppProvider';
5
5
  export { ReduxWrapper as Chat } from './components/MainComponents/ReduxWrapper';
6
6
  export { useUnread } from './hooks/useUnreadMessagesCounter';
7
- export { useRoomPresence, useIsUserOnline } from './hooks/useRoomPresence';
8
7
  export { logoutService } from './hooks/useLogout';
9
8
  export { useQRCodeChat, handleQRChatId } from './hooks/useQRCodeChatHandler';
10
9
  export { useInAppNotifications } from './hooks/useInAppNotifications';
@@ -14,3 +13,5 @@ export { applyTypography, clearTypography } from './helpers/applyTypography';
14
13
  export { useTypography } from './hooks/useTypography';
15
14
  export type { TypographyConfig, FontFaceSource, } from './types/models/config.model';
16
15
  export { ChatInputTestIds, MessageBubbleTestIds, RoomListTestIds, AuthTestIds, } from './testIds';
16
+ export { refreshAuthTokens, refreshAuthTokensQuietly, RefreshFatalError, isRefreshFatalError, } from './networking/authRefresh';
17
+ export type { RefreshErrorCode, RefreshResult, RefreshOptions, } from './networking/authRefresh';