stream-chat-react 13.14.2 → 13.14.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.
@@ -24,7 +24,7 @@ export const useChat = ({ client, defaultLanguage = 'en', i18nInstance, initialN
24
24
  useEffect(() => {
25
25
  if (!client)
26
26
  return;
27
- const version = "13.14.2";
27
+ const version = "13.14.4";
28
28
  const userAgent = client.getUserAgent();
29
29
  if (!userAgent.includes('stream-chat-react')) {
30
30
  // result looks like: 'stream-chat-react-2.3.2-stream-chat-javascript-client-browser-2.2.2'
@@ -81,5 +81,5 @@ export declare const mapToUserNameOrId: TooltipUsernameMapper;
81
81
  export declare const getReadByTooltipText: (users: UserResponse[], t: TFunction, client: StreamChat, tooltipUserNameMapper: TooltipUsernameMapper) => string;
82
82
  export declare const isOnlyEmojis: (text?: string) => boolean;
83
83
  export declare const isMessageBounced: (message: Pick<LocalMessage, 'type' | 'moderation' | 'moderation_details'>) => boolean;
84
- export declare const isMessageBlocked: (message: Pick<LocalMessage, 'type' | 'moderation' | 'moderation_details'>) => boolean;
84
+ export declare const isMessageBlocked: (message: Pick<LocalMessage, 'type' | 'moderation' | 'moderation_details' | 'shadowed'>) => boolean;
85
85
  export declare const isMessageEdited: (message: Pick<LocalMessage, 'message_text_updated_at'>) => boolean;
@@ -330,7 +330,8 @@ export const isOnlyEmojis = (text) => {
330
330
  export const isMessageBounced = (message) => message.type === 'error' &&
331
331
  (message.moderation_details?.action === 'MESSAGE_RESPONSE_ACTION_BOUNCE' ||
332
332
  message.moderation?.action === 'bounce');
333
- export const isMessageBlocked = (message) => message.type === 'error' &&
334
- (message.moderation_details?.action === 'MESSAGE_RESPONSE_ACTION_REMOVE' ||
335
- message.moderation?.action === 'remove');
333
+ export const isMessageBlocked = (message) => message.shadowed ||
334
+ (message.type === 'error' &&
335
+ (message.moderation_details?.action === 'MESSAGE_RESPONSE_ACTION_REMOVE' ||
336
+ message.moderation?.action === 'remove'));
336
337
  export const isMessageEdited = (message) => !!message.message_text_updated_at;
@@ -1,7 +1,8 @@
1
1
  import type { PropsWithChildren } from 'react';
2
2
  import React from 'react';
3
+ import type { NotificationSeverity } from 'stream-chat';
3
4
  export type CustomNotificationProps = {
4
- type: string;
5
+ type?: NotificationSeverity | string;
5
6
  active?: boolean;
6
7
  className?: string;
7
8
  };
@@ -4,6 +4,6 @@ const UnMemoizedCustomNotification = (props) => {
4
4
  const { active, children, className, type } = props;
5
5
  if (!active)
6
6
  return null;
7
- return (React.createElement("div", { "aria-live": 'polite', className: clsx(`str-chat__custom-notification notification-${type}`, `str-chat__notification`, `str-chat-react__notification`, className), "data-testid": 'custom-notification' }, children));
7
+ return (React.createElement("div", { "aria-live": 'polite', className: clsx(`str-chat__custom-notification`, `str-chat__notification`, `str-chat-react__notification`, { [`notification-${type}`]: type }, className), "data-testid": 'custom-notification' }, children));
8
8
  };
9
9
  export const CustomNotification = React.memo(UnMemoizedCustomNotification);