stream-chat-react 14.6.0 → 14.7.0
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/cjs/{ReactPlayerWrapper.30240f76.js → ReactPlayerWrapper.c340ab05.js} +2 -2
- package/dist/cjs/{ReactPlayerWrapper.30240f76.js.map → ReactPlayerWrapper.c340ab05.js.map} +1 -1
- package/dist/cjs/audioProcessing.22303d69.js.map +1 -1
- package/dist/cjs/channel-detail.js +2 -2
- package/dist/cjs/channel-detail.js.map +1 -1
- package/dist/cjs/emojis.js +2 -2
- package/dist/cjs/emojis.js.map +1 -1
- package/dist/cjs/index.js +50 -52
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/mp3-encoder.js.map +1 -1
- package/dist/cjs/{useChannelHeaderOnlineStatus.6546ac83.js → useChannelHeaderOnlineStatus.d39ede24.js} +25 -9
- package/dist/cjs/{useChannelHeaderOnlineStatus.6546ac83.js.map → useChannelHeaderOnlineStatus.d39ede24.js.map} +1 -1
- package/dist/cjs/{useMessageComposerController.c0dad9bc.js → useMessageComposerController.f1a3d182.js} +2 -2
- package/dist/cjs/{useMessageComposerController.c0dad9bc.js.map → useMessageComposerController.f1a3d182.js.map} +1 -1
- package/dist/cjs/{useNotificationApi.eb753f31.js → useNotificationApi.87ba0b39.js} +13 -13
- package/dist/cjs/useNotificationApi.87ba0b39.js.map +1 -0
- package/dist/css/index.css +3 -3
- package/dist/css/index.css.map +1 -1
- package/dist/es/audioProcessing.766ca76c.mjs.map +1 -1
- package/dist/es/channel-detail.mjs +2 -2
- package/dist/es/channel-detail.mjs.map +1 -1
- package/dist/es/emojis.mjs +2 -2
- package/dist/es/emojis.mjs.map +1 -1
- package/dist/es/index.mjs +34 -36
- package/dist/es/index.mjs.map +1 -1
- package/dist/es/mp3-encoder.mjs.map +1 -1
- package/dist/es/{useChannelHeaderOnlineStatus.c5215b13.mjs → useChannelHeaderOnlineStatus.b3a51ca7.mjs} +24 -8
- package/dist/es/{useChannelHeaderOnlineStatus.c5215b13.mjs.map → useChannelHeaderOnlineStatus.b3a51ca7.mjs.map} +1 -1
- package/dist/es/{useMessageComposerController.29f189b4.mjs → useMessageComposerController.2309f433.mjs} +2 -2
- package/dist/es/{useMessageComposerController.29f189b4.mjs.map → useMessageComposerController.2309f433.mjs.map} +1 -1
- package/dist/es/{useNotificationApi.fa5cddf9.mjs → useNotificationApi.eff88f29.mjs} +9 -9
- package/dist/es/useNotificationApi.eff88f29.mjs.map +1 -0
- package/dist/types/components/Channel/Channel.d.ts.map +1 -1
- package/dist/types/components/Channel/hooks/useCreateChannelStateContext.d.ts.map +1 -1
- package/dist/types/components/ChannelList/ChannelList.d.ts.map +1 -1
- package/dist/types/components/ChannelList/hooks/useChannelListShape.d.ts.map +1 -1
- package/dist/types/components/ChannelListItem/hooks/useIsChannelMuted.d.ts.map +1 -1
- package/dist/types/components/Message/renderText/regex.d.ts.map +1 -1
- package/dist/types/components/MessageList/hooks/useMarkRead.d.ts.map +1 -1
- package/dist/types/context/ComponentContext.d.ts +2 -0
- package/dist/types/context/ComponentContext.d.ts.map +1 -1
- package/dist/types/i18n/Streami18n.d.ts +12 -12
- package/dist/types/i18n/Streami18n.d.ts.map +1 -1
- package/dist/types/i18n/types.d.ts +1 -1
- package/package.json +8 -7
- package/dist/cjs/useNotificationApi.eb753f31.js.map +0 -1
- package/dist/es/useNotificationApi.fa5cddf9.mjs.map +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const require_useNotificationApi = require("./useNotificationApi.
|
|
1
|
+
const require_useNotificationApi = require("./useNotificationApi.87ba0b39.js");
|
|
2
2
|
let react = require("react");
|
|
3
3
|
react = require_useNotificationApi.__toESM(react);
|
|
4
4
|
let react_jsx_runtime = require("react/jsx-runtime");
|
|
@@ -96,4 +96,4 @@ Object.defineProperty(exports, "useMessageComposerController", {
|
|
|
96
96
|
}
|
|
97
97
|
});
|
|
98
98
|
|
|
99
|
-
//# sourceMappingURL=useMessageComposerController.
|
|
99
|
+
//# sourceMappingURL=useMessageComposerController.f1a3d182.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useMessageComposerController.
|
|
1
|
+
{"version":3,"file":"useMessageComposerController.f1a3d182.js","names":[],"sources":["../../src/context/MessageComposerContext.tsx","../../src/components/MessageComposer/hooks/useIsCooldownActive.ts","../../src/components/MessageComposer/hooks/useMessageComposerController.ts"],"sourcesContent":["import React, { createContext, useContext } from 'react';\nimport type { PropsWithChildren } from 'react';\n\nimport type { MessageComposerProps } from '../components/MessageComposer';\nimport type { UseMessageComposerBindingsParams } from '../components/MessageComposer/hooks/useMessageComposerBindings';\n\nexport type MessageComposerContextValue = UseMessageComposerBindingsParams &\n Omit<MessageComposerProps, 'Input'>;\n\nexport const MessageComposerContext = createContext<\n UseMessageComposerBindingsParams | undefined\n>(undefined);\n\nexport const MessageComposerContextProvider = ({\n children,\n value,\n}: PropsWithChildren<{\n value: MessageComposerContextValue;\n}>) => (\n <MessageComposerContext.Provider\n value={value as unknown as MessageComposerContextValue}\n >\n {children}\n </MessageComposerContext.Provider>\n);\n\nexport const useMessageComposerContext = (\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n componentName?: string,\n) => {\n const contextValue = useContext(MessageComposerContext);\n\n if (!contextValue) {\n return {} as MessageComposerContextValue;\n }\n\n return contextValue as unknown as MessageComposerContextValue;\n};\n","import { useChannelStateContext } from '../../../context';\nimport { useStateStore } from '../../../store';\nimport type { CooldownTimerState } from 'stream-chat';\n\nconst cooldownTimerStateSelector = (state: CooldownTimerState) => ({\n isCooldownActive: !!state.cooldownRemaining,\n});\n\nexport const useIsCooldownActive = () => {\n const { channel } = useChannelStateContext();\n return useStateStore(channel.cooldownTimer.state, cooldownTimerStateSelector)\n .isCooldownActive;\n};\n","import { useEffect, useMemo } from 'react';\nimport { MessageComposer as MessageComposerController } from 'stream-chat';\nimport { useThreadContext } from '../../Threads';\nimport { useChannelStateContext, useChatContext } from '../../../context';\nimport { useLegacyThreadContext } from '../../Thread';\n\nexport const useMessageComposerController = () => {\n const { client } = useChatContext();\n const { messageComposerCache: queueCache } = client;\n const { channel } = useChannelStateContext();\n const { legacyThread: parentMessage } = useLegacyThreadContext();\n const threadInstance = useThreadContext();\n\n const cachedParentMessage = useMemo(() => {\n if (!parentMessage) return undefined;\n\n return parentMessage;\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [parentMessage?.id]);\n\n // composer hierarchy\n // edited message (always new) -> thread instance (own) -> thread message (always new) -> channel (own)\n // editedMessage ?? thread ?? parentMessage ?? channel;\n const messageComposer = useMemo(() => {\n if (threadInstance) {\n return threadInstance.messageComposer;\n } else if (cachedParentMessage) {\n const compositionContext = {\n ...cachedParentMessage,\n legacyThreadId: cachedParentMessage.id,\n };\n\n const tag = MessageComposerController.constructTag(compositionContext);\n\n const cachedComposer = queueCache.get(tag);\n if (cachedComposer) return cachedComposer;\n\n return new MessageComposerController({\n client,\n compositionContext,\n });\n } else {\n return channel.messageComposer;\n }\n }, [cachedParentMessage, channel, client, queueCache, threadInstance]);\n\n if (\n (['legacy_thread', 'message'] as MessageComposerController['contextType'][]).includes(\n messageComposer.contextType,\n ) &&\n !queueCache.peek(messageComposer.tag)\n ) {\n queueCache.add(messageComposer.tag, messageComposer);\n }\n\n useEffect(() => {\n const unsubscribe = messageComposer.registerSubscriptions();\n return () => {\n unsubscribe();\n };\n }, [messageComposer]);\n\n return messageComposer;\n};\n"],"mappings":";;;;;;AASA,IAAa,0BAAA,GAAA,MAAA,cAAA,CAEX,KAAA,CAAS;AAEX,IAAa,kCAAkC,EAC7C,UACA,YAIA,iBAAA,GAAA,kBAAA,IAAA,CAAC,uBAAuB,UAAxB;CACS;CAEN;AAC8B,CAAA;AAGnC,IAAa,6BAEX,kBACG;CACH,MAAM,gBAAA,GAAA,MAAA,WAAA,CAA0B,sBAAsB;CAEtD,IAAI,CAAC,cACH,OAAO,CAAC;CAGV,OAAO;AACT;;;ACjCA,IAAM,8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"}
|
|
@@ -31,10 +31,10 @@ let use_sync_external_store_shim = require("use-sync-external-store/shim");
|
|
|
31
31
|
let react_dom = require("react-dom");
|
|
32
32
|
let dayjs = require("dayjs");
|
|
33
33
|
dayjs = __toESM(dayjs);
|
|
34
|
-
let
|
|
35
|
-
|
|
36
|
-
let
|
|
37
|
-
|
|
34
|
+
let dayjs_plugin_calendar_js = require("dayjs/plugin/calendar.js");
|
|
35
|
+
dayjs_plugin_calendar_js = __toESM(dayjs_plugin_calendar_js);
|
|
36
|
+
let dayjs_plugin_localizedFormat_js = require("dayjs/plugin/localizedFormat.js");
|
|
37
|
+
dayjs_plugin_localizedFormat_js = __toESM(dayjs_plugin_localizedFormat_js);
|
|
38
38
|
let lodash_debounce = require("lodash.debounce");
|
|
39
39
|
lodash_debounce = __toESM(lodash_debounce);
|
|
40
40
|
let lodash_throttle = require("lodash.throttle");
|
|
@@ -662,8 +662,8 @@ var isLanguageSupported = (language) => {
|
|
|
662
662
|
};
|
|
663
663
|
//#endregion
|
|
664
664
|
//#region src/context/TranslationContext.tsx
|
|
665
|
-
dayjs.default.extend(
|
|
666
|
-
dayjs.default.extend(
|
|
665
|
+
dayjs.default.extend(dayjs_plugin_calendar_js.default);
|
|
666
|
+
dayjs.default.extend(dayjs_plugin_localizedFormat_js.default);
|
|
667
667
|
var TranslationContext = react.default.createContext({
|
|
668
668
|
t: defaultTranslatorFunction,
|
|
669
669
|
tDateTimeParser: defaultDateTimeParser,
|
|
@@ -724,7 +724,7 @@ var getNotificationTargetPanels = (notification) => {
|
|
|
724
724
|
var getNotificationTargetTag = (panel) => `target:${panel}`;
|
|
725
725
|
var addNotificationTargetTag = (panel, tags) => {
|
|
726
726
|
if (!panel) return tags ?? [];
|
|
727
|
-
return Array.from(new Set([getNotificationTargetTag(panel), ...tags ?? []]));
|
|
727
|
+
return Array.from(/* @__PURE__ */ new Set([getNotificationTargetTag(panel), ...tags ?? []]));
|
|
728
728
|
};
|
|
729
729
|
var isNotificationForPanel = (notification, panel, options) => {
|
|
730
730
|
const explicitTargetPanels = getNotificationTargetPanels(notification);
|
|
@@ -1739,7 +1739,7 @@ var initialState = {
|
|
|
1739
1739
|
var useCreateChannelStateContext = (value) => {
|
|
1740
1740
|
const { channel, channelCapabilitiesArray = [], channelConfig, channelUnreadUiState, error, giphyVersion, hasMore, hasMoreNewer, highlightedMessageId, imageAttachmentSizeHandler, loading, loadingMore, loadingMoreForJumpToChannelMessage, members, messages = [], mutes, notifications, pinnedMessages, read = {}, shouldGenerateVideoThumbnail, skipMessageDataMemoization, suppressAutoscroll, thread, threadHasMore, threadLoadingMore, threadMessages = [], videoAttachmentSizeHandler, watcher_count, watcherCount, watchers } = value;
|
|
1741
1741
|
const channelId = channel.cid;
|
|
1742
|
-
const lastRead = channel.initialized && channel.lastRead()?.getTime();
|
|
1742
|
+
const lastRead = channel.initialized && !channel.disconnected && channel.lastRead()?.getTime();
|
|
1743
1743
|
const membersLength = Object.keys(members || []).length;
|
|
1744
1744
|
const notificationsLength = notifications.length;
|
|
1745
1745
|
const readUsers = Object.values(read);
|
|
@@ -3432,7 +3432,7 @@ var ChannelInner = (props) => {
|
|
|
3432
3432
|
});
|
|
3433
3433
|
}, [isMounted]);
|
|
3434
3434
|
const loadMore = async (limit = 25) => {
|
|
3435
|
-
if (!online.current || !window.navigator.onLine || !channel.state.messagePagination.hasPrev) return 0;
|
|
3435
|
+
if (channel.disconnected || !online.current || !window.navigator.onLine || !channel.state.messagePagination.hasPrev) return 0;
|
|
3436
3436
|
const oldestMessage = state?.messages?.[0];
|
|
3437
3437
|
if (state.loadingMore || state.loadingMoreNewer || oldestMessage?.status !== "received") return 0;
|
|
3438
3438
|
dispatch({
|
|
@@ -4116,9 +4116,9 @@ var hasSystemNotificationTag = (notification) => notification.tags?.includes("sy
|
|
|
4116
4116
|
var getTargetTags = (targetPanels, inferredPanel, tags, modalManagerHasOpenDialog) => {
|
|
4117
4117
|
if (targetPanels) {
|
|
4118
4118
|
const effectiveTargetPanels = modalManagerHasOpenDialog && targetPanels.length > 0 ? [...targetPanels, "modal"] : targetPanels;
|
|
4119
|
-
return Array.from(new Set([...effectiveTargetPanels.map(getNotificationTargetTag), ...tags ?? []]));
|
|
4119
|
+
return Array.from(/* @__PURE__ */ new Set([...effectiveTargetPanels.map(getNotificationTargetTag), ...tags ?? []]));
|
|
4120
4120
|
}
|
|
4121
|
-
if (modalManagerHasOpenDialog) return Array.from(new Set([
|
|
4121
|
+
if (modalManagerHasOpenDialog) return Array.from(/* @__PURE__ */ new Set([
|
|
4122
4122
|
...inferredPanel ? [getNotificationTargetTag(inferredPanel)] : [],
|
|
4123
4123
|
getNotificationTargetTag("modal"),
|
|
4124
4124
|
...tags ?? []
|
|
@@ -4171,7 +4171,7 @@ var useNotificationApi = () => {
|
|
|
4171
4171
|
modalManagerHasOpenDialog
|
|
4172
4172
|
]),
|
|
4173
4173
|
addSystemNotification: (0, react.useCallback)(({ actions, context, duration, emitter, error, incident, message, severity, tags, type }) => {
|
|
4174
|
-
const notificationTags = Array.from(new Set([SYSTEM_NOTIFICATION_TAG, ...tags ?? []]));
|
|
4174
|
+
const notificationTags = Array.from(/* @__PURE__ */ new Set([SYSTEM_NOTIFICATION_TAG, ...tags ?? []]));
|
|
4175
4175
|
const resolvedType = getTypeFromIncident({
|
|
4176
4176
|
incident,
|
|
4177
4177
|
severity,
|
|
@@ -5501,4 +5501,4 @@ Object.defineProperty(exports, "validateAndGetMessage", {
|
|
|
5501
5501
|
}
|
|
5502
5502
|
});
|
|
5503
5503
|
|
|
5504
|
-
//# sourceMappingURL=useNotificationApi.
|
|
5504
|
+
//# sourceMappingURL=useNotificationApi.87ba0b39.js.map
|