@ethora/chat-component 26.6.3 → 26.6.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.
Files changed (45) 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 +0 -1
  15. package/dist/main.js +76762 -19
  16. package/dist/main.js.map +1 -1
  17. package/dist/networking/xmppClient.d.ts +0 -2
  18. package/dist/roomStore/Middleware/unreadMidlleware.d.ts +0 -1
  19. package/dist/roomStore/callSlice.d.ts +0 -1
  20. package/dist/roomStore/chatSettingsSlice.d.ts +1 -25
  21. package/dist/roomStore/roomsSlice.d.ts +1 -8
  22. package/dist/types/models/config.model.d.ts +0 -122
  23. package/dist/types/models/language.model.d.ts +1 -1
  24. package/dist/types/models/message.model.d.ts +0 -1
  25. package/dist/version.d.ts +1 -1
  26. package/package.json +1 -1
  27. package/public/firebase-messaging-sw.js +4 -16
  28. package/dist/VideoCallOverlay-DwlOo5Jp.js +0 -23647
  29. package/dist/VideoCallOverlay-DwlOo5Jp.js.map +0 -1
  30. package/dist/components/MainComponents/LanguageSelectorModal.d.ts +0 -3
  31. package/dist/components/MessageBubble/MessageTranslate.d.ts +0 -25
  32. package/dist/components/MessageBubble/TranslatedMessageBody.d.ts +0 -21
  33. package/dist/components/Notification/NotificationPermissionBanner.d.ts +0 -16
  34. package/dist/components/RoomComponents/OnlineUsersPopover.d.ts +0 -11
  35. package/dist/helpers/isLikelyMucJid.d.ts +0 -1
  36. package/dist/helpers/scheduleAckCatchup.d.ts +0 -27
  37. package/dist/helpers/toBaseLanguage.d.ts +0 -8
  38. package/dist/hooks/useIsMobileViewport.d.ts +0 -1
  39. package/dist/hooks/useMessageTranslation.d.ts +0 -28
  40. package/dist/hooks/useRoomPresence.d.ts +0 -10
  41. package/dist/i18n/strings.d.ts +0 -15
  42. package/dist/i18n/useT.d.ts +0 -33
  43. package/dist/main-aegXJZvS.js +0 -74357
  44. package/dist/main-aegXJZvS.js.map +0 -1
  45. package/dist/utils/translateModePolicy.d.ts +0 -19
@@ -18,7 +18,6 @@ export declare class XmppClient implements XmppClientInterface {
18
18
  private reconnecting;
19
19
  private reconnectPromise;
20
20
  presencesReady: boolean;
21
- private sendAllPresencesInFlight;
22
21
  private connectionSteps;
23
22
  private messageQueue;
24
23
  private highLaneBurstLimit;
@@ -93,7 +92,6 @@ export declare class XmppClient implements XmppClientInterface {
93
92
  private startAdaptivePing;
94
93
  private markActivity;
95
94
  sendAllPresencesAndMarkReady(): Promise<void>;
96
- private runAllPresencesSweep;
97
95
  reconnect(): Promise<void>;
98
96
  allRoomPresencesStanza(): Promise<AllRoomPresenceSummary>;
99
97
  ensureConnected(timeout?: number): Promise<void>;
@@ -1,3 +1,2 @@
1
1
  import { Middleware } from '@reduxjs/toolkit';
2
- export declare const resolveTouchedRooms: (action: any, prevState: any, nextState: any) => Set<string>;
3
2
  export declare const unreadMiddleware: Middleware;
@@ -13,7 +13,6 @@ export interface CallState {
13
13
  token: string | null;
14
14
  error: string | null;
15
15
  startedAt: number | null;
16
- connectedAt: number | null;
17
16
  }
18
17
  export declare const startOutgoingCall: import('@reduxjs/toolkit').ActionCreatorWithOptionalPayload<{
19
18
  roomJid: string;
@@ -8,36 +8,12 @@ interface ChatState {
8
8
  selectedUser?: IUser;
9
9
  activeFile?: ModalFile;
10
10
  langSource?: Iso639_1Codes;
11
- /**
12
- * Whether THIS reader's own outgoing messages get tagged with
13
- * `<translate source="xx"/>` (see sendTextMessageWithTranslateTag) so
14
- * translations can be generated for them. Defaults to true so existing
15
- * hosts that already set `config.translates.enabled` see no change
16
- * until a reader explicitly opts out via the language-selector toggle.
17
- *
18
- * Turning this off does NOT untag anything already sent - a message
19
- * ships with whatever tag was active at send time, permanently. Turning
20
- * it back on only affects messages sent from that point forward. Same
21
- * asymmetry the other direction: turning it on doesn't retroactively
22
- * tag old messages either - see the disclaimer surfaced next to the
23
- * toggle in LanguageSelectorModal.
24
- */
25
- translateSendEnabled?: boolean;
26
- /**
27
- * Reader's own auto/manual pick from the language-selector modal's
28
- * switcher. Undefined means "never touched it" - falls back to
29
- * `config.translates.mode` (see resolveTranslateMode). Ignored entirely
30
- * when the host sets `config.translates.forceType: true`, which is also
31
- * why the switcher itself doesn't render in that case - nothing should
32
- * ever write here that a host has pinned.
33
- */
34
- translateMode?: 'auto' | 'manual';
35
11
  }
36
12
  export declare const setUser: import('@reduxjs/toolkit').ActionCreatorWithOptionalPayload<User, "chatSettingStore/setUser">, setConfig: import('@reduxjs/toolkit').ActionCreatorWithNonInferrablePayload<"chatSettingStore/setConfig">, refreshTokens: import('@reduxjs/toolkit').ActionCreatorWithOptionalPayload<{
37
13
  token: string;
38
14
  refreshToken: string;
39
15
  }, "chatSettingStore/refreshTokens">, logout: import('@reduxjs/toolkit').ActionCreatorWithoutPayload<"chatSettingStore/logout">, setActiveModal: import('@reduxjs/toolkit').ActionCreatorWithOptionalPayload<string, "chatSettingStore/setActiveModal">, setDeleteModal: import('@reduxjs/toolkit').ActionCreatorWithOptionalPayload<DeleteModal, "chatSettingStore/setDeleteModal">, setSelectedUser: import('@reduxjs/toolkit').ActionCreatorWithOptionalPayload<IUser, "chatSettingStore/setSelectedUser">, updateUser: import('@reduxjs/toolkit').ActionCreatorWithOptionalPayload<{
40
16
  updates: Partial<User>;
41
- }, "chatSettingStore/updateUser">, setActiveFile: import('@reduxjs/toolkit').ActionCreatorWithOptionalPayload<ModalFile, "chatSettingStore/setActiveFile">, setLangSource: import('@reduxjs/toolkit').ActionCreatorWithOptionalPayload<Iso639_1Codes, "chatSettingStore/setLangSource">, setTranslateSendEnabled: import('@reduxjs/toolkit').ActionCreatorWithOptionalPayload<boolean, "chatSettingStore/setTranslateSendEnabled">, setTranslateMode: import('@reduxjs/toolkit').ActionCreatorWithOptionalPayload<"auto" | "manual", "chatSettingStore/setTranslateMode">;
17
+ }, "chatSettingStore/updateUser">, setActiveFile: import('@reduxjs/toolkit').ActionCreatorWithOptionalPayload<ModalFile, "chatSettingStore/setActiveFile">, setLangSource: import('@reduxjs/toolkit').ActionCreatorWithOptionalPayload<Iso639_1Codes, "chatSettingStore/setLangSource">;
42
18
  declare const _default: import('redux').Reducer<ChatState>;
43
19
  export default _default;
@@ -9,7 +9,6 @@ interface RoomMessagesState {
9
9
  editAction?: EditAction;
10
10
  isLoading: boolean;
11
11
  usersSet: Record<string, RoomMember>;
12
- presenceByRoom: Record<string, string[]>;
13
12
  reportRoom: {
14
13
  isOpen: boolean;
15
14
  };
@@ -68,13 +67,7 @@ export declare const addRoom: import('@reduxjs/toolkit').ActionCreatorWithOption
68
67
  chatJID?: string;
69
68
  }, "roomMessages/setRoomNoMessages">, setCurrentRoom: import('@reduxjs/toolkit').ActionCreatorWithOptionalPayload<{
70
69
  roomJID: string | null;
71
- }, "roomMessages/setCurrentRoom">, setMemberOnline: import('@reduxjs/toolkit').ActionCreatorWithOptionalPayload<{
72
- roomJID: string;
73
- xmppUsername: string;
74
- }, "roomMessages/setMemberOnline">, setMemberOffline: import('@reduxjs/toolkit').ActionCreatorWithOptionalPayload<{
75
- roomJID: string;
76
- xmppUsername: string;
77
- }, "roomMessages/setMemberOffline">, setChatUiVisible: import('@reduxjs/toolkit').ActionCreatorWithOptionalPayload<boolean, "roomMessages/setChatUiVisible">, setRoomRole: import('@reduxjs/toolkit').ActionCreatorWithOptionalPayload<{
70
+ }, "roomMessages/setCurrentRoom">, setChatUiVisible: import('@reduxjs/toolkit').ActionCreatorWithOptionalPayload<boolean, "roomMessages/setChatUiVisible">, setRoomRole: import('@reduxjs/toolkit').ActionCreatorWithOptionalPayload<{
78
71
  chatJID: string;
79
72
  role: string;
80
73
  }, "roomMessages/setRoomRole">, setReactions: import('@reduxjs/toolkit').ActionCreatorWithOptionalPayload<ReactionAction, "roomMessages/setReactions">, setLogoutState: import('@reduxjs/toolkit').ActionCreatorWithoutPayload<"roomMessages/setLogoutState">, setActiveMessage: import('@reduxjs/toolkit').ActionCreatorWithOptionalPayload<{
@@ -222,88 +222,6 @@ export interface IConfig {
222
222
  translates?: {
223
223
  enabled: boolean;
224
224
  translations?: Iso639_1Codes;
225
- /**
226
- * 'auto' shows the translation inline automatically. 'manual' shows a
227
- * "Translate" link the reader clicks (LinkedIn-style), then renders the
228
- * result inline with a "Show original" toggle. Default 'auto'.
229
- *
230
- * Neither mode calls any translation service - both only ever display
231
- * `message.translations`, whatever arrived attached to the stanza (see
232
- * `readerLocale` below for how a message gets translated in the first
233
- * place). This is purely a display choice: show it immediately, or let
234
- * the reader ask for it.
235
- */
236
- mode?: 'auto' | 'manual';
237
- /**
238
- * Pins `mode` as fixed host policy. When true, the language-selector
239
- * modal's auto/manual switcher does not render at all, and the reader
240
- * has no way to override `mode` - it's always whatever the host set.
241
- * Defaults to false: the reader can flip between auto and manual
242
- * themselves via the switcher, which then wins over `mode` (the host's
243
- * declared default, used until the reader touches it).
244
- */
245
- forceType?: boolean;
246
- /**
247
- * Reader's full locale (BCP-47, e.g. "fr-CA"). Falls back to
248
- * `config.i18n.locale`. The region is passed through to `onTranslate` so
249
- * the service can distinguish fr-CA vs fr-FR; the Translate button
250
- * visibility comparison ignores the region (en-US vs en-CA => no button).
251
- *
252
- * This is also how a host drives the reader's language from OUTSIDE the
253
- * chat component: set it (e.g. from your own app's language switcher)
254
- * and pass the updated config down as a normal prop. Whenever it
255
- * changes, the component syncs it into the same internal state the
256
- * in-chat language picker writes to - so it drives both what a reader
257
- * sees translated INTO and the source language declared on their own
258
- * outgoing messages. Leave unset to let the reader manage it themselves
259
- * via the picker (see `showLanguageSelector`).
260
- */
261
- readerLocale?: string;
262
- /**
263
- * Shows/hides the globe-icon language picker in the chat header.
264
- * Defaults to true whenever `enabled` is true. Set to false when the
265
- * host manages the reader's language itself (via `readerLocale`) and
266
- * an in-chat picker would just be a second, redundant control.
267
- */
268
- showLanguageSelector?: boolean;
269
- /**
270
- * Shows/hides the list of selectable languages INSIDE the picker
271
- * (English/Español/...). Defaults to true. Set to false to keep only
272
- * the enable/disable-translates toggle - for hosts that drive the
273
- * reader's language externally via `readerLocale` and don't want a
274
- * second, redundant language list, but still want the reader to control
275
- * whether their own outgoing messages get tagged for translation.
276
- */
277
- showLanguageList?: boolean;
278
- /**
279
- * Host-provided translation function. When set, the manual Translate
280
- * action calls this - wire it to your own service - instead of reading
281
- * `message.translations`. Optional; omit to use only what already
282
- * arrived over XMPP.
283
- */
284
- onTranslate?: (text: string, ctx: {
285
- sourceLocale?: string;
286
- targetLocale: string;
287
- message: IMessage;
288
- }) => Promise<string>;
289
- /**
290
- * Host predicate deciding whether to show the Translate action for a given
291
- * message. When omitted, the component compares base languages (message
292
- * source vs reader, region ignored) and shows the action when they differ.
293
- */
294
- showTranslateForMessage?: (message: IMessage) => boolean;
295
- };
296
- /**
297
- * Static UI i18n (interface captions like "Search...", "Type message").
298
- * `locale` is a BCP-47 tag the host passes from the device/user (e.g. "en",
299
- * "fr-CA", "es-US"); captions resolve to its base language. `strings`
300
- * overrides or extends any built-in caption by key (see src/i18n/strings.ts).
301
- * Built-in languages: en, fr, es. Independent from `translates` (dynamic
302
- * per-message translation).
303
- */
304
- i18n?: {
305
- locale?: string;
306
- strings?: Record<string, string>;
307
225
  };
308
226
  disableRoomConfig?: boolean;
309
227
  disableProfilesInteractions?: boolean;
@@ -443,46 +361,6 @@ export interface IConfig {
443
361
  iconPath?: string;
444
362
  badgePath?: string;
445
363
  softAsk?: boolean;
446
- /**
447
- * In-app banner that nudges the user to turn on browser notifications.
448
- * Off by default. The banner renders one of two states automatically from
449
- * the current `Notification.permission`:
450
- * - "default" (never asked) → an "Enable notifications" card with a button
451
- * that triggers the browser permission prompt;
452
- * - "denied" (blocked) → a "Notifications are blocked" card explaining how
453
- * to re-allow it from the browser's site settings.
454
- * It hides itself entirely once permission is "granted", when the browser
455
- * has no Notification API, or when `pushNotifications.enabled` is not true.
456
- * Every label is overridable so it can be localised.
457
- */
458
- permissionBanner?: {
459
- /** Master switch for the banner. Default false (opt-in). */
460
- enabled?: boolean;
461
- /** Show the prompt while permission is "default". Default true. */
462
- showWhenDefault?: boolean;
463
- /**
464
- * Show the notice while permission is "denied". Default false: a blocked
465
- * state can only be fixed by hand in the browser's site settings, so by
466
- * default we don't nag. Set true to opt back into the reminder.
467
- */
468
- showWhenBlocked?: boolean;
469
- /** Render a dismiss (×) control. Default true. Dismissal lasts the tab session. */
470
- dismissible?: boolean;
471
- /** Where the fixed banner is anchored. Default "bottom-right". */
472
- position?: 'top-left' | 'top-right' | 'top-center' | 'bottom-left' | 'bottom-right' | 'bottom-center';
473
- /** Title for the "enable" state. Default "Enable notifications". */
474
- enableTitle?: string;
475
- /** Description for the "enable" state. */
476
- enableDescription?: string;
477
- /** Button label for the "enable" state. Default "Enable notifications". */
478
- enableButtonLabel?: string;
479
- /** Title for the "blocked" state. Default "Notifications are blocked". */
480
- blockedTitle?: string;
481
- /** Description for the "blocked" state. */
482
- blockedDescription?: string;
483
- /** Inline style overrides merged onto the banner container. */
484
- style?: React.CSSProperties;
485
- };
486
364
  onClick?: (params: {
487
365
  roomJID?: string;
488
366
  messageId?: string;
@@ -1,4 +1,4 @@
1
- export type Iso639_1Codes = 'en' | 'en-CA' | 'es' | 'es-US' | 'pt' | 'ht' | 'fr' | 'fr-CA' | 'zh';
1
+ export type Iso639_1Codes = 'en' | 'es' | 'pt' | 'ht' | 'zh';
2
2
  export interface Language {
3
3
  iso639_1: Iso639_1Codes;
4
4
  name: string;
@@ -22,7 +22,6 @@ export interface IMessage {
22
22
  activeMessage?: boolean;
23
23
  isReply?: boolean | string;
24
24
  isDeleted?: boolean;
25
- isEdited?: boolean;
26
25
  mainMessage?: string;
27
26
  reply?: IReply[];
28
27
  reaction?: Record<string, ReactionMessage>;
package/dist/version.d.ts CHANGED
@@ -1 +1 @@
1
- export declare const ETHORA_CHAT_COMPONENT_VERSION = "26.6.1";
1
+ export declare const ETHORA_CHAT_COMPONENT_VERSION = "26.06.04";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ethora/chat-component",
3
- "version": "26.6.3",
3
+ "version": "26.6.4",
4
4
  "type": "module",
5
5
  "main": "dist/main.js",
6
6
  "types": "dist/main.d.ts",
@@ -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