stream-chat-react 13.13.5 → 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.
- package/dist/components/Chat/hooks/useChat.js +1 -1
- package/dist/experimental/index.browser.cjs.map +2 -2
- package/dist/experimental/index.node.cjs.map +2 -2
- package/dist/i18n/utils.js +4 -2
- package/dist/index.browser.cjs +2 -2
- package/dist/index.browser.cjs.map +2 -2
- package/dist/index.node.cjs +2 -2
- package/dist/index.node.cjs.map +2 -2
- package/dist/plugins/Emojis/index.browser.cjs.map +2 -2
- package/dist/plugins/Emojis/index.node.cjs.map +2 -2
- package/package.json +1 -1
package/dist/i18n/utils.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import 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
|
-
|
|
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);
|
package/dist/index.browser.cjs
CHANGED
|
@@ -1466,7 +1466,7 @@ function getDateString({
|
|
|
1466
1466
|
}
|
|
1467
1467
|
var predefinedFormatters = {
|
|
1468
1468
|
durationFormatter: (streamI18n) => (value, _, { format, withSuffix }) => {
|
|
1469
|
-
if (format &&
|
|
1469
|
+
if (format && import_dayjs.default.isDayjs(streamI18n.DateTimeParser)) {
|
|
1470
1470
|
return streamI18n.DateTimeParser.duration(value).format(
|
|
1471
1471
|
format
|
|
1472
1472
|
);
|
|
@@ -37419,7 +37419,7 @@ var useChat = ({
|
|
|
37419
37419
|
};
|
|
37420
37420
|
(0, import_react289.useEffect)(() => {
|
|
37421
37421
|
if (!client) return;
|
|
37422
|
-
const version = "13.13.
|
|
37422
|
+
const version = "13.13.6";
|
|
37423
37423
|
const userAgent = client.getUserAgent();
|
|
37424
37424
|
if (!userAgent.includes("stream-chat-react")) {
|
|
37425
37425
|
client.setUserAgent(`stream-chat-react-${version}-${userAgent}`);
|