stream-chat-react 13.13.4 → 13.13.6

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,4 +1,4 @@
1
- import Dayjs, { isDayjs } from 'dayjs';
1
+ import Dayjs from 'dayjs';
2
2
  export const notValidDateWarning = 'MessageTimestamp was called without a message, or message has invalid created_at date.';
3
3
  export const noParsingFunctionWarning = 'MessageTimestamp was called but there is no datetime parsing function available';
4
4
  export const isNumberOrString = (output) => typeof output === 'string' || typeof output === 'number';
@@ -55,7 +55,9 @@ export function getDateString({ calendar, calendarFormats, format, formatDate, m
55
55
  }
56
56
  export const predefinedFormatters = {
57
57
  durationFormatter: (streamI18n) => (value, _, { format, withSuffix }) => {
58
- if (format && isDayjs(streamI18n.DateTimeParser)) {
58
+ // NOTE: isDayjs is not exported in "dayjs" package for ESM, hence we access
59
+ // `isDayjs` from Dayjs instance
60
+ if (format && Dayjs.isDayjs(streamI18n.DateTimeParser)) {
59
61
  return streamI18n.DateTimeParser.duration(value).format(format);
60
62
  }
61
63
  return streamI18n.DateTimeParser.duration(value).humanize(!!withSuffix);
@@ -1466,7 +1466,7 @@ function getDateString({
1466
1466
  }
1467
1467
  var predefinedFormatters = {
1468
1468
  durationFormatter: (streamI18n) => (value, _, { format, withSuffix }) => {
1469
- if (format && (0, import_dayjs.isDayjs)(streamI18n.DateTimeParser)) {
1469
+ if (format && import_dayjs.default.isDayjs(streamI18n.DateTimeParser)) {
1470
1470
  return streamI18n.DateTimeParser.duration(value).format(
1471
1471
  format
1472
1472
  );
@@ -28641,6 +28641,7 @@ var useMarkRead = ({
28641
28641
  const { markRead, setChannelUnreadUiState } = useChannelActionContext("useMarkRead");
28642
28642
  const { channel } = useChannelStateContext("useMarkRead");
28643
28643
  (0, import_react173.useEffect)(() => {
28644
+ if (!channel.getConfig()?.read_events) return;
28644
28645
  const shouldMarkRead = () => !document.hidden && !wasMarkedUnread && !messageListIsThread && isMessageListScrolledToBottom && client.user?.id && !hasReadLastMessage(channel, client.user.id);
28645
28646
  const onVisibilityChange = () => {
28646
28647
  if (shouldMarkRead()) markRead();
@@ -37418,7 +37419,7 @@ var useChat = ({
37418
37419
  };
37419
37420
  (0, import_react289.useEffect)(() => {
37420
37421
  if (!client) return;
37421
- const version = "13.13.4";
37422
+ const version = "13.13.6";
37422
37423
  const userAgent = client.getUserAgent();
37423
37424
  if (!userAgent.includes("stream-chat-react")) {
37424
37425
  client.setUserAgent(`stream-chat-react-${version}-${userAgent}`);