stream-chat-react 12.6.0 → 12.6.1

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.
@@ -1,6 +1,5 @@
1
1
  import { useCallback, useEffect, useRef, useState } from 'react';
2
2
  import { defaultDateTimeParser, isLanguageSupported, Streami18n, } from '../../../i18n';
3
- import { version } from '../../../version';
4
3
  export const useChat = ({ client, defaultLanguage = 'en', i18nInstance, initialNavOpen, }) => {
5
4
  const [translators, setTranslators] = useState({
6
5
  t: (key) => key,
@@ -28,7 +27,8 @@ export const useChat = ({ client, defaultLanguage = 'en', i18nInstance, initialN
28
27
  const userAgent = client.getUserAgent();
29
28
  if (!userAgent.includes('stream-chat-react')) {
30
29
  // result looks like: 'stream-chat-react-2.3.2-stream-chat-javascript-client-browser-2.2.2'
31
- client.setUserAgent(`stream-chat-react-${version}-${userAgent}`);
30
+ // __STREAM_CHAT_REACT_VERSION__ is replaced during the build process with the current version
31
+ client.setUserAgent(`stream-chat-react-__STREAM_CHAT_REACT_VERSION__-${userAgent}`);
32
32
  }
33
33
  client.threads.registerSubscriptions();
34
34
  client.polls.registerSubscriptions();
@@ -1689,10 +1689,10 @@ var require_Parser = __commonJS({
1689
1689
  if (!this.consumeWhitespace()) {
1690
1690
  this.error("Invalid XML declaration");
1691
1691
  }
1692
- let version2 = Boolean(scanner.consumeStringFast("version")) && this.consumeEqual() && this.consumeSystemLiteral();
1693
- if (version2 === false) {
1692
+ let version = Boolean(scanner.consumeStringFast("version")) && this.consumeEqual() && this.consumeSystemLiteral();
1693
+ if (version === false) {
1694
1694
  this.error("XML version is missing or invalid");
1695
- } else if (!/^1\.[0-9]+$/.test(version2)) {
1695
+ } else if (!/^1\.[0-9]+$/.test(version)) {
1696
1696
  this.error("Invalid character in version number");
1697
1697
  }
1698
1698
  if (this.consumeWhitespace()) {
@@ -49937,11 +49937,6 @@ var import_react255 = __toESM(require("react"));
49937
49937
 
49938
49938
  // src/components/Chat/hooks/useChat.ts
49939
49939
  var import_react252 = require("react");
49940
-
49941
- // src/version.ts
49942
- var version = "0.0.0-development";
49943
-
49944
- // src/components/Chat/hooks/useChat.ts
49945
49940
  var useChat = ({
49946
49941
  client,
49947
49942
  defaultLanguage = "en",
@@ -49972,7 +49967,7 @@ var useChat = ({
49972
49967
  if (!client) return;
49973
49968
  const userAgent = client.getUserAgent();
49974
49969
  if (!userAgent.includes("stream-chat-react")) {
49975
- client.setUserAgent(`stream-chat-react-${version}-${userAgent}`);
49970
+ client.setUserAgent(`stream-chat-react-12.6.1-${userAgent}`);
49976
49971
  }
49977
49972
  client.threads.registerSubscriptions();
49978
49973
  client.polls.registerSubscriptions();