stream-chat-react 13.14.2 → 13.14.3

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.3";
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'
@@ -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);
@@ -24122,9 +24122,10 @@ var UnMemoizedCustomNotification = (props) => {
24122
24122
  {
24123
24123
  "aria-live": "polite",
24124
24124
  className: (0, import_clsx44.default)(
24125
- `str-chat__custom-notification notification-${type}`,
24125
+ `str-chat__custom-notification`,
24126
24126
  `str-chat__notification`,
24127
24127
  `str-chat-react__notification`,
24128
+ { [`notification-${type}`]: type },
24128
24129
  className
24129
24130
  ),
24130
24131
  "data-testid": "custom-notification"
@@ -29148,7 +29149,7 @@ var import_react184 = require("react");
29148
29149
 
29149
29150
  // src/utils/findReverse.ts
29150
29151
  var findReverse = (items, matches) => {
29151
- for (let i = items.length - 1; i > 0; i -= 1) {
29152
+ for (let i = items.length - 1; i >= 0; i -= 1) {
29152
29153
  if (matches(items[i])) {
29153
29154
  return items[i];
29154
29155
  }
@@ -37421,7 +37422,7 @@ var useChat = ({
37421
37422
  };
37422
37423
  (0, import_react289.useEffect)(() => {
37423
37424
  if (!client) return;
37424
- const version = "13.14.2";
37425
+ const version = "13.14.3";
37425
37426
  const userAgent = client.getUserAgent();
37426
37427
  if (!userAgent.includes("stream-chat-react")) {
37427
37428
  client.setUserAgent(`stream-chat-react-${version}-${userAgent}`);