stream-chat-react-native-core 5.15.0 → 5.15.1-beta.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.
- package/lib/commonjs/components/ChannelList/ChannelList.js +4 -2
- package/lib/commonjs/components/ChannelList/ChannelList.js.map +1 -1
- package/lib/commonjs/components/ChannelList/hooks/useCreateChannelsContext.js +2 -0
- package/lib/commonjs/components/ChannelList/hooks/useCreateChannelsContext.js.map +1 -1
- package/lib/commonjs/components/ChannelPreview/ChannelPreviewMessenger.js +2 -4
- package/lib/commonjs/components/ChannelPreview/ChannelPreviewMessenger.js.map +1 -1
- package/lib/commonjs/components/ChannelPreview/ChannelPreviewMutedStatus.js +4 -5
- package/lib/commonjs/components/ChannelPreview/ChannelPreviewMutedStatus.js.map +1 -1
- package/lib/commonjs/contexts/channelsContext/ChannelsContext.js +2 -2
- package/lib/commonjs/contexts/channelsContext/ChannelsContext.js.map +1 -1
- package/lib/commonjs/version.json +1 -1
- package/lib/module/components/ChannelList/ChannelList.js +4 -2
- package/lib/module/components/ChannelList/ChannelList.js.map +1 -1
- package/lib/module/components/ChannelList/hooks/useCreateChannelsContext.js +2 -0
- package/lib/module/components/ChannelList/hooks/useCreateChannelsContext.js.map +1 -1
- package/lib/module/components/ChannelPreview/ChannelPreviewMessenger.js +2 -4
- package/lib/module/components/ChannelPreview/ChannelPreviewMessenger.js.map +1 -1
- package/lib/module/components/ChannelPreview/ChannelPreviewMutedStatus.js +4 -5
- package/lib/module/components/ChannelPreview/ChannelPreviewMutedStatus.js.map +1 -1
- package/lib/module/contexts/channelsContext/ChannelsContext.js +2 -2
- package/lib/module/contexts/channelsContext/ChannelsContext.js.map +1 -1
- package/lib/module/version.json +1 -1
- package/lib/typescript/components/ChannelList/ChannelList.d.ts +1 -1
- package/lib/typescript/components/ChannelList/hooks/useCreateChannelsContext.d.ts +1 -1
- package/lib/typescript/components/ChannelPreview/ChannelPreviewMutedStatus.d.ts +1 -6
- package/lib/typescript/components/Message/hooks/useMessageActionHandlers.d.ts +1 -1
- package/lib/typescript/components/Message/hooks/useMessageActions.d.ts +1 -1
- package/lib/typescript/contexts/channelsContext/ChannelsContext.d.ts +1 -2
- package/package.json +1 -1
- package/src/components/ChannelList/ChannelList.tsx +3 -0
- package/src/components/ChannelList/hooks/useCreateChannelsContext.ts +2 -0
- package/src/components/ChannelPreview/ChannelPreviewMessenger.tsx +1 -1
- package/src/components/ChannelPreview/ChannelPreviewMutedStatus.tsx +3 -18
- package/src/contexts/channelsContext/ChannelsContext.tsx +1 -3
- package/src/version.json +1 -1
|
@@ -83,6 +83,7 @@ var ChannelList = function ChannelList(props) {
|
|
|
83
83
|
Preview = _props$Preview === void 0 ? _ChannelPreviewMessenger.ChannelPreviewMessenger : _props$Preview,
|
|
84
84
|
PreviewAvatar = props.PreviewAvatar,
|
|
85
85
|
PreviewMessage = props.PreviewMessage,
|
|
86
|
+
PreviewMutedStatus = props.PreviewMutedStatus,
|
|
86
87
|
PreviewStatus = props.PreviewStatus,
|
|
87
88
|
PreviewTitle = props.PreviewTitle,
|
|
88
89
|
PreviewUnreadCount = props.PreviewUnreadCount,
|
|
@@ -196,6 +197,7 @@ var ChannelList = function ChannelList(props) {
|
|
|
196
197
|
Preview: Preview,
|
|
197
198
|
PreviewAvatar: PreviewAvatar,
|
|
198
199
|
PreviewMessage: PreviewMessage,
|
|
200
|
+
PreviewMutedStatus: PreviewMutedStatus,
|
|
199
201
|
PreviewStatus: PreviewStatus,
|
|
200
202
|
PreviewTitle: PreviewTitle,
|
|
201
203
|
PreviewUnreadCount: PreviewUnreadCount,
|
|
@@ -214,14 +216,14 @@ var ChannelList = function ChannelList(props) {
|
|
|
214
216
|
__self: _this,
|
|
215
217
|
__source: {
|
|
216
218
|
fileName: _jsxFileName,
|
|
217
|
-
lineNumber:
|
|
219
|
+
lineNumber: 412,
|
|
218
220
|
columnNumber: 5
|
|
219
221
|
}
|
|
220
222
|
}, _react["default"].createElement(List, {
|
|
221
223
|
__self: _this,
|
|
222
224
|
__source: {
|
|
223
225
|
fileName: _jsxFileName,
|
|
224
|
-
lineNumber:
|
|
226
|
+
lineNumber: 413,
|
|
225
227
|
columnNumber: 7
|
|
226
228
|
}
|
|
227
229
|
}));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_react","_interopRequireWildcard","require","_ChannelListFooterLoadingIndicator","_ChannelListHeaderErrorIndicator","_ChannelListHeaderNetworkDownIndicator","_ChannelListLoadingIndicator","_ChannelListMessenger","_useAddedToChannelNotification","_useChannelDeleted","_useChannelHidden","_useChannelTruncated","_useChannelUpdated","_useChannelVisible","_useNewMessage","_useNewMessageNotification","_useRemovedFromChannelNotification","_useUserPresence","_useCreateChannelsContext","_usePaginatedChannels2","_Skeleton","_ChannelsContext","_ChatContext","_upsertCidsForQuery","_ChannelPreviewMessenger","_EmptyStateIndicator","_LoadingErrorIndicator","_this","_jsxFileName","_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","obj","__esModule","_typeof","cache","has","get","newObj","hasPropertyDescriptor","Object","defineProperty","getOwnPropertyDescriptor","key","prototype","hasOwnProperty","call","desc","set","DEFAULT_FILTERS","DEFAULT_OPTIONS","DEFAULT_SORT","ChannelList","props","_props$additionalFlat","additionalFlatListProps","channelRenderFilterFn","_props$EmptyStateIndi","EmptyStateIndicator","EmptyStateIndicatorDefault","_props$FooterLoadingI","FooterLoadingIndicator","ChannelListFooterLoadingIndicator","_props$filters","filters","_props$HeaderErrorInd","HeaderErrorIndicator","ChannelListHeaderErrorIndicator","_props$HeaderNetworkD","HeaderNetworkDownIndicator","ChannelListHeaderNetworkDownIndicator","_props$List","List","ChannelListMessenger","ListHeaderComponent","_props$LoadingErrorIn","LoadingErrorIndicator","LoadingErrorIndicatorDefault","_props$LoadingIndicat","LoadingIndicator","ChannelListLoadingIndicator","_props$loadMoreThresh","loadMoreThreshold","_props$lockChannelOrd","lockChannelOrder","_props$maxUnreadCount","maxUnreadCount","_props$numberOfSkelet","numberOfSkeletons","onAddedToChannel","onChannelDeleted","onChannelHidden","onChannelVisible","onChannelTruncated","onChannelUpdated","onMessageNew","onRemovedFromChannel","onSelect","onNewMessage","onNewMessageNotification","_props$options","options","_props$Preview","Preview","ChannelPreviewMessenger","PreviewAvatar","PreviewMessage","PreviewStatus","PreviewTitle","PreviewUnreadCount","setFlatListRef","_props$Skeleton","Skeleton","SkeletonDefault","_props$sort","sort","_useState","useState","_useState2","_slicedToArray2","forceUpdate","setForceUpdate","_useChatContext","useChatContext","enableOfflineSupport","_usePaginatedChannels","usePaginatedChannels","channels","error","hasNextPage","loadingChannels","loadingNextPage","loadNextPage","refreshing","refreshList","reloadList","setChannels","staticChannelsActive","useAddedToChannelNotification","useChannelDeleted","useChannelHidden","useChannelTruncated","useChannelUpdated","useChannelVisible","useNewMessage","useNewMessageNotification","useRemovedFromChannelNotification","useUserPresence","channelIdsStr","reduce","acc","channel","cid","useEffect","upsertCidsForQuery","cids","map","c","channelsContext","useCreateChannelsContext","ref","createElement","ChannelsProvider","value","__self","__source","fileName","lineNumber","columnNumber","exports"],"sources":["ChannelList.tsx"],"sourcesContent":["import React, { useEffect, useState } from 'react';\n\nimport type { FlatList } from 'react-native-gesture-handler';\n\nimport type { Channel, ChannelFilters, ChannelOptions, ChannelSort, Event } from 'stream-chat';\n\nimport { ChannelListFooterLoadingIndicator } from './ChannelListFooterLoadingIndicator';\nimport { ChannelListHeaderErrorIndicator } from './ChannelListHeaderErrorIndicator';\nimport { ChannelListHeaderNetworkDownIndicator } from './ChannelListHeaderNetworkDownIndicator';\nimport { ChannelListLoadingIndicator } from './ChannelListLoadingIndicator';\nimport { ChannelListMessenger, ChannelListMessengerProps } from './ChannelListMessenger';\nimport { useAddedToChannelNotification } from './hooks/listeners/useAddedToChannelNotification';\nimport { useChannelDeleted } from './hooks/listeners/useChannelDeleted';\nimport { useChannelHidden } from './hooks/listeners/useChannelHidden';\nimport { useChannelTruncated } from './hooks/listeners/useChannelTruncated';\nimport { useChannelUpdated } from './hooks/listeners/useChannelUpdated';\nimport { useChannelVisible } from './hooks/listeners/useChannelVisible';\nimport { useNewMessage } from './hooks/listeners/useNewMessage';\nimport { useNewMessageNotification } from './hooks/listeners/useNewMessageNotification';\nimport { useRemovedFromChannelNotification } from './hooks/listeners/useRemovedFromChannelNotification';\nimport { useUserPresence } from './hooks/listeners/useUserPresence';\nimport { useCreateChannelsContext } from './hooks/useCreateChannelsContext';\nimport { usePaginatedChannels } from './hooks/usePaginatedChannels';\nimport { Skeleton as SkeletonDefault } from './Skeleton';\n\nimport {\n ChannelsContextValue,\n ChannelsProvider,\n} from '../../contexts/channelsContext/ChannelsContext';\nimport { useChatContext } from '../../contexts/chatContext/ChatContext';\nimport { upsertCidsForQuery } from '../../store/apis/upsertCidsForQuery';\nimport type { DefaultStreamChatGenerics } from '../../types/types';\nimport { ChannelPreviewMessenger } from '../ChannelPreview/ChannelPreviewMessenger';\nimport { EmptyStateIndicator as EmptyStateIndicatorDefault } from '../Indicators/EmptyStateIndicator';\nimport { LoadingErrorIndicator as LoadingErrorIndicatorDefault } from '../Indicators/LoadingErrorIndicator';\n\nexport type ChannelListProps<\n StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics,\n> = Partial<\n Pick<\n ChannelsContextValue<StreamChatGenerics>,\n | 'additionalFlatListProps'\n | 'EmptyStateIndicator'\n | 'FooterLoadingIndicator'\n | 'HeaderErrorIndicator'\n | 'HeaderNetworkDownIndicator'\n | 'LoadingErrorIndicator'\n | 'LoadingIndicator'\n | 'Preview'\n | 'setFlatListRef'\n | 'ListHeaderComponent'\n | 'onSelect'\n | 'PreviewAvatar'\n | 'PreviewMessage'\n | 'PreviewStatus'\n | 'PreviewTitle'\n | 'PreviewUnreadCount'\n | 'loadMoreThreshold'\n | 'Skeleton'\n | 'maxUnreadCount'\n | 'numberOfSkeletons'\n >\n> & {\n /** Optional function to filter channels prior to rendering the list. Do not use any complex logic that would delay the loading of the ChannelList. We recommend using a pure function with array methods like filter/sort/reduce. */\n channelRenderFilterFn?: (\n channels: Array<Channel<StreamChatGenerics>>,\n ) => Array<Channel<StreamChatGenerics>>;\n /**\n * Object containing channel query filters\n *\n * @see See [Channel query documentation](https://getstream.io/chat/docs/query_channels) for a list of available filter fields\n *\n * @overrideType object\n * */\n filters?: ChannelFilters<StreamChatGenerics>;\n /**\n * Custom UI component to display the list of channels\n *\n * Default: [ChannelListMessenger](https://getstream.io/chat/docs/sdk/reactnative/ui-components/channel-list-messenger/)\n */\n List?: React.ComponentType<ChannelListMessengerProps<StreamChatGenerics>>;\n /**\n * If set to true, channels won't dynamically sort by most recent message, defaults to false\n */\n lockChannelOrder?: boolean;\n /**\n * Function that overrides default behavior when a user gets added to a channel\n *\n * @param setChannels Setter for internal state property - `channels`. It's created from useState() hook.\n * @param event An [Event Object](https://getstream.io/chat/docs/event_object) corresponding to `notification.added_to_channel` event\n *\n * @overrideType Function\n * */\n onAddedToChannel?: (\n setChannels: React.Dispatch<React.SetStateAction<Channel<StreamChatGenerics>[] | null>>,\n event: Event<StreamChatGenerics>,\n ) => void;\n /**\n * Function that overrides default behavior when a channel gets deleted. In absence of this prop, the channel will be removed from the list.\n *\n * @param setChannels Setter for internal state property - `channels`. It's created from useState() hook.\n * @param event An [Event object](https://getstream.io/chat/docs/event_object) corresponding to `channel.deleted` event\n *\n * @overrideType Function\n * */\n onChannelDeleted?: (\n setChannels: React.Dispatch<React.SetStateAction<Channel<StreamChatGenerics>[] | null>>,\n event: Event<StreamChatGenerics>,\n ) => void;\n /**\n * Function that overrides default behavior when a channel gets hidden. In absence of this prop, the channel will be removed from the list.\n *\n * @param setChannels Setter for internal state property - `channels`. It's created from useState() hook.\n * @param event An [Event object](https://getstream.io/chat/docs/event_object) corresponding to `channel.hidden` event\n *\n * @overrideType Function\n * */\n onChannelHidden?: (\n setChannels: React.Dispatch<React.SetStateAction<Channel<StreamChatGenerics>[] | null>>,\n event: Event<StreamChatGenerics>,\n ) => void;\n /**\n * Function to customize behavior when a channel gets truncated\n *\n * @param setChannels Setter for internal state property - `channels`. It's created from useState() hook.\n * @param event [Event object](https://getstream.io/chat/docs/event_object) corresponding to `channel.truncated` event\n *\n * @overrideType Function\n * */\n onChannelTruncated?: (\n setChannels: React.Dispatch<React.SetStateAction<Channel<StreamChatGenerics>[] | null>>,\n event: Event<StreamChatGenerics>,\n ) => void;\n /**\n * Function that overrides default behavior when a channel gets updated\n *\n * @param setChannels Setter for internal state property - `channels`. It's created from useState() hook.\n * @param event An [Event object](https://getstream.io/chat/docs/event_object) corresponding to `channel.updated` event\n *\n * @overrideType Function\n * */\n onChannelUpdated?: (\n setChannels: React.Dispatch<React.SetStateAction<Channel<StreamChatGenerics>[] | null>>,\n event: Event<StreamChatGenerics>,\n ) => void;\n /**\n * Function that overrides default behavior when a channel gets visible. In absence of this prop, the channel will be added to the list.\n *\n * @param setChannels Setter for internal state property - `channels`. It's created from useState() hook.\n * @param event An [Event object](https://getstream.io/chat/docs/event_object) corresponding to `channel.visible` event\n *\n * @overrideType Function\n * */\n onChannelVisible?: (\n setChannels: React.Dispatch<React.SetStateAction<Channel<StreamChatGenerics>[] | null>>,\n event: Event<StreamChatGenerics>,\n ) => void;\n /**\n * @deprecated use onNewMessageNotification instead\n *\n * Override the default listener/handler for event `notification.message_new`\n * This event is received on channel, which is not being watched.\n *\n * @param setChannels Setter for internal state property - `channels`. It's created from useState() hook.\n * @param event An [Event object](https://getstream.io/chat/docs/event_object) corresponding to `notification.message_new` event\n *\n * @overrideType Function\n * */\n onMessageNew?: (\n setChannels: React.Dispatch<React.SetStateAction<Channel<StreamChatGenerics>[] | null>>,\n event: Event<StreamChatGenerics>,\n ) => void;\n /**\n * Override the default listener/handler for event `message.new`\n * This event is received on channel, when a new message is added on a channel.\n *\n * @param lockChannelOrder If set to true, channels won't dynamically sort by most recent message, defaults to false\n * @param setChannels Setter for internal state property - `channels`. It's created from useState() hook.\n * @param event An [Event object](https://getstream.io/chat/docs/event_object) corresponding to `message.new` event\n *\n * @overrideType Function\n * */\n onNewMessage?: (\n lockChannelOrder: boolean,\n setChannels: React.Dispatch<React.SetStateAction<Channel<StreamChatGenerics>[] | null>>,\n event: Event<StreamChatGenerics>,\n ) => void;\n /**\n * Override the default listener/handler for event `notification.message_new`\n * This event is received on channel, which is not being watched.\n *\n * @param setChannels Setter for internal state property - `channels`. It's created from useState() hook.\n * @param event An [Event object](https://getstream.io/chat/docs/event_object) corresponding to `notification.message_new` event\n *\n * @overrideType Function\n * */\n onNewMessageNotification?: (\n setChannels: React.Dispatch<React.SetStateAction<Channel<StreamChatGenerics>[] | null>>,\n event: Event<StreamChatGenerics>,\n ) => void;\n /**\n * Function that overrides default behavior when a user gets removed from a channel\n *\n * @param setChannels Setter for internal state property - `channels`. It's created from useState() hook.\n * @param event An [Event object](https://getstream.io/chat/docs/event_object) corresponding to `notification.removed_from_channel` event\n *\n * @overrideType Function\n * */\n onRemovedFromChannel?: (\n setChannels: React.Dispatch<React.SetStateAction<Channel<StreamChatGenerics>[] | null>>,\n event: Event<StreamChatGenerics>,\n ) => void;\n /**\n * Object containing channel query options\n * @see See [Channel query documentation](https://getstream.io/chat/docs/query_channels) for a list of available option fields\n * */\n options?: ChannelOptions;\n /**\n * Object containing channel sort parameters\n * @see See [Channel query documentation](https://getstream.io/chat/docs/query_channels) for a list of available sorting fields\n * */\n sort?: ChannelSort<StreamChatGenerics>;\n};\n\nconst DEFAULT_FILTERS = {};\nconst DEFAULT_OPTIONS = {};\nconst DEFAULT_SORT = {};\n\n/**\n * This component fetches a list of channels, allowing you to select the channel you want to open.\n * The ChannelList doesn't provide any UI for the underlying React Native FlatList. UI is determined by the `List` component which is\n * provided to the ChannelList component as a prop. By default, the ChannelListMessenger component is used as the list UI.\n *\n * @example ./ChannelList.md\n */\nexport const ChannelList = <\n StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics,\n>(\n props: ChannelListProps<StreamChatGenerics>,\n) => {\n const {\n additionalFlatListProps = {},\n channelRenderFilterFn,\n EmptyStateIndicator = EmptyStateIndicatorDefault,\n FooterLoadingIndicator = ChannelListFooterLoadingIndicator,\n filters = DEFAULT_FILTERS,\n HeaderErrorIndicator = ChannelListHeaderErrorIndicator,\n HeaderNetworkDownIndicator = ChannelListHeaderNetworkDownIndicator,\n List = ChannelListMessenger,\n ListHeaderComponent,\n LoadingErrorIndicator = LoadingErrorIndicatorDefault,\n LoadingIndicator = ChannelListLoadingIndicator,\n // https://stackoverflow.com/a/60666252/10826415\n loadMoreThreshold = 0.1,\n lockChannelOrder = false,\n maxUnreadCount = 255,\n numberOfSkeletons = 6,\n onAddedToChannel,\n onChannelDeleted,\n onChannelHidden,\n onChannelVisible,\n onChannelTruncated,\n onChannelUpdated,\n onMessageNew,\n onRemovedFromChannel,\n onSelect,\n onNewMessage,\n onNewMessageNotification,\n options = DEFAULT_OPTIONS,\n Preview = ChannelPreviewMessenger,\n PreviewAvatar,\n PreviewMessage,\n PreviewStatus,\n PreviewTitle,\n PreviewUnreadCount,\n setFlatListRef,\n Skeleton = SkeletonDefault,\n sort = DEFAULT_SORT,\n } = props;\n\n const [forceUpdate, setForceUpdate] = useState(0);\n const { enableOfflineSupport } = useChatContext<StreamChatGenerics>();\n const {\n channels,\n error,\n hasNextPage,\n loadingChannels,\n loadingNextPage,\n loadNextPage,\n refreshing,\n refreshList,\n reloadList,\n setChannels,\n staticChannelsActive,\n } = usePaginatedChannels<StreamChatGenerics>({\n enableOfflineSupport,\n filters,\n options,\n setForceUpdate,\n sort,\n });\n\n // Setup event listeners\n useAddedToChannelNotification({\n onAddedToChannel,\n setChannels,\n });\n\n useChannelDeleted({\n onChannelDeleted,\n setChannels,\n });\n\n useChannelHidden({\n onChannelHidden,\n setChannels,\n });\n\n useChannelTruncated({\n onChannelTruncated,\n refreshList,\n setChannels,\n setForceUpdate,\n });\n\n useChannelUpdated({\n onChannelUpdated,\n setChannels,\n });\n\n useChannelVisible({\n onChannelVisible,\n setChannels,\n });\n\n useNewMessage({\n lockChannelOrder,\n onNewMessage,\n setChannels,\n });\n\n useNewMessageNotification({\n onMessageNew,\n onNewMessageNotification,\n setChannels,\n });\n\n useRemovedFromChannelNotification({\n onRemovedFromChannel,\n setChannels,\n });\n\n useUserPresence({\n setChannels,\n });\n\n const channelIdsStr = channels?.reduce((acc, channel) => `${acc}${channel.cid}`, '');\n\n useEffect(() => {\n if (channels === null || staticChannelsActive || !enableOfflineSupport) {\n return;\n }\n\n upsertCidsForQuery({\n cids: channels.map((c) => c.cid),\n filters,\n sort,\n });\n }, [channelIdsStr, staticChannelsActive]);\n\n const channelsContext = useCreateChannelsContext({\n additionalFlatListProps,\n channels: channelRenderFilterFn ? channelRenderFilterFn(channels ?? []) : channels,\n EmptyStateIndicator,\n error,\n FooterLoadingIndicator,\n forceUpdate,\n hasNextPage,\n HeaderErrorIndicator,\n HeaderNetworkDownIndicator,\n ListHeaderComponent,\n loadingChannels,\n LoadingErrorIndicator,\n LoadingIndicator,\n loadingNextPage,\n loadMoreThreshold,\n loadNextPage,\n maxUnreadCount,\n numberOfSkeletons,\n onSelect,\n Preview,\n PreviewAvatar,\n PreviewMessage,\n PreviewStatus,\n PreviewTitle,\n PreviewUnreadCount,\n refreshing,\n refreshList,\n reloadList,\n setFlatListRef: (ref: FlatList<Channel<StreamChatGenerics>> | null) => {\n if (setFlatListRef) {\n setFlatListRef(ref);\n }\n },\n Skeleton,\n });\n\n return (\n <ChannelsProvider value={channelsContext}>\n <List<StreamChatGenerics> />\n </ChannelsProvider>\n );\n};\n"],"mappings":";;;;;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AAMA,IAAAC,kCAAA,GAAAD,OAAA;AACA,IAAAE,gCAAA,GAAAF,OAAA;AACA,IAAAG,sCAAA,GAAAH,OAAA;AACA,IAAAI,4BAAA,GAAAJ,OAAA;AACA,IAAAK,qBAAA,GAAAL,OAAA;AACA,IAAAM,8BAAA,GAAAN,OAAA;AACA,IAAA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ACpBG,0BAA0B,EAA1BA,0BAA0B;IAC1BK,mBAAmB,EAAnBA,mBAAmB;IACnBwD,eAAe,EAAfA,eAAe;IACftD,qBAAqB,EAArBA,qBAAqB;IACrBG,gBAAgB,EAAhBA,gBAAgB;IAChBoD,eAAe,EAAfA,eAAe;IACfjD,iBAAiB,EAAjBA,iBAAiB;IACjBkD,YAAY,EAAZA,YAAY;IACZ9C,cAAc,EAAdA,cAAc;IACdE,iBAAiB,EAAjBA,iBAAiB;IACjBS,QAAQ,EAARA,QAAQ;IACRM,OAAO,EAAPA,OAAO;IACPE,aAAa,EAAbA,aAAa;IACbC,cAAc,EAAdA,cAAc;IACdC,aAAa,EAAbA,aAAa;IACbC,YAAY,EAAZA,YAAY;IACZC,kBAAkB,EAAlBA,kBAAkB;IAClBwB,UAAU,EAAVA,UAAU;IACVC,WAAW,EAAXA,WAAW;IACXC,UAAU,EAAVA,UAAU;IACVzB,cAAc,EAAE,SAAAA,eAACkD,GAAiD,EAAK;MACrE,IAAIlD,eAAc,EAAE;QAClBA,eAAc,CAACkD,GAAG,CAAC;MACrB;IACF,CAAC;IACDhD,QAAQ,EAARA;EACF,CAAC,CAAC;EAEF,OACElH,MAAA,YAAAmK,aAAA,CAAC9I,gBAAA,CAAA+I,gBAAgB;IAACC,KAAK,EAAEL,eAAgB;IAAAM,MAAA,EAAA3I,KAAA;IAAA4I,QAAA;MAAAC,QAAA,EAAA5I,YAAA;MAAA6I,UAAA;MAAAC,YAAA;IAAA;EAAA,GACvC1K,MAAA,YAAAmK,aAAA,CAACzF,IAAI;IAAA4F,MAAA,EAAA3I,KAAA;IAAA4I,QAAA;MAAAC,QAAA,EAAA5I,YAAA;MAAA6I,UAAA;MAAAC,YAAA;IAAA;EAAA,EAAuB,CACX;AAEvB,CAAC;AAACC,OAAA,CAAArH,WAAA,GAAAA,WAAA"}
|
|
1
|
+
{"version":3,"names":["_react","_interopRequireWildcard","require","_ChannelListFooterLoadingIndicator","_ChannelListHeaderErrorIndicator","_ChannelListHeaderNetworkDownIndicator","_ChannelListLoadingIndicator","_ChannelListMessenger","_useAddedToChannelNotification","_useChannelDeleted","_useChannelHidden","_useChannelTruncated","_useChannelUpdated","_useChannelVisible","_useNewMessage","_useNewMessageNotification","_useRemovedFromChannelNotification","_useUserPresence","_useCreateChannelsContext","_usePaginatedChannels2","_Skeleton","_ChannelsContext","_ChatContext","_upsertCidsForQuery","_ChannelPreviewMessenger","_EmptyStateIndicator","_LoadingErrorIndicator","_this","_jsxFileName","_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","obj","__esModule","_typeof","cache","has","get","newObj","hasPropertyDescriptor","Object","defineProperty","getOwnPropertyDescriptor","key","prototype","hasOwnProperty","call","desc","set","DEFAULT_FILTERS","DEFAULT_OPTIONS","DEFAULT_SORT","ChannelList","props","_props$additionalFlat","additionalFlatListProps","channelRenderFilterFn","_props$EmptyStateIndi","EmptyStateIndicator","EmptyStateIndicatorDefault","_props$FooterLoadingI","FooterLoadingIndicator","ChannelListFooterLoadingIndicator","_props$filters","filters","_props$HeaderErrorInd","HeaderErrorIndicator","ChannelListHeaderErrorIndicator","_props$HeaderNetworkD","HeaderNetworkDownIndicator","ChannelListHeaderNetworkDownIndicator","_props$List","List","ChannelListMessenger","ListHeaderComponent","_props$LoadingErrorIn","LoadingErrorIndicator","LoadingErrorIndicatorDefault","_props$LoadingIndicat","LoadingIndicator","ChannelListLoadingIndicator","_props$loadMoreThresh","loadMoreThreshold","_props$lockChannelOrd","lockChannelOrder","_props$maxUnreadCount","maxUnreadCount","_props$numberOfSkelet","numberOfSkeletons","onAddedToChannel","onChannelDeleted","onChannelHidden","onChannelVisible","onChannelTruncated","onChannelUpdated","onMessageNew","onRemovedFromChannel","onSelect","onNewMessage","onNewMessageNotification","_props$options","options","_props$Preview","Preview","ChannelPreviewMessenger","PreviewAvatar","PreviewMessage","PreviewMutedStatus","PreviewStatus","PreviewTitle","PreviewUnreadCount","setFlatListRef","_props$Skeleton","Skeleton","SkeletonDefault","_props$sort","sort","_useState","useState","_useState2","_slicedToArray2","forceUpdate","setForceUpdate","_useChatContext","useChatContext","enableOfflineSupport","_usePaginatedChannels","usePaginatedChannels","channels","error","hasNextPage","loadingChannels","loadingNextPage","loadNextPage","refreshing","refreshList","reloadList","setChannels","staticChannelsActive","useAddedToChannelNotification","useChannelDeleted","useChannelHidden","useChannelTruncated","useChannelUpdated","useChannelVisible","useNewMessage","useNewMessageNotification","useRemovedFromChannelNotification","useUserPresence","channelIdsStr","reduce","acc","channel","cid","useEffect","upsertCidsForQuery","cids","map","c","channelsContext","useCreateChannelsContext","ref","createElement","ChannelsProvider","value","__self","__source","fileName","lineNumber","columnNumber","exports"],"sources":["ChannelList.tsx"],"sourcesContent":["import React, { useEffect, useState } from 'react';\n\nimport type { FlatList } from 'react-native-gesture-handler';\n\nimport type { Channel, ChannelFilters, ChannelOptions, ChannelSort, Event } from 'stream-chat';\n\nimport { ChannelListFooterLoadingIndicator } from './ChannelListFooterLoadingIndicator';\nimport { ChannelListHeaderErrorIndicator } from './ChannelListHeaderErrorIndicator';\nimport { ChannelListHeaderNetworkDownIndicator } from './ChannelListHeaderNetworkDownIndicator';\nimport { ChannelListLoadingIndicator } from './ChannelListLoadingIndicator';\nimport { ChannelListMessenger, ChannelListMessengerProps } from './ChannelListMessenger';\nimport { useAddedToChannelNotification } from './hooks/listeners/useAddedToChannelNotification';\nimport { useChannelDeleted } from './hooks/listeners/useChannelDeleted';\nimport { useChannelHidden } from './hooks/listeners/useChannelHidden';\nimport { useChannelTruncated } from './hooks/listeners/useChannelTruncated';\nimport { useChannelUpdated } from './hooks/listeners/useChannelUpdated';\nimport { useChannelVisible } from './hooks/listeners/useChannelVisible';\nimport { useNewMessage } from './hooks/listeners/useNewMessage';\nimport { useNewMessageNotification } from './hooks/listeners/useNewMessageNotification';\nimport { useRemovedFromChannelNotification } from './hooks/listeners/useRemovedFromChannelNotification';\nimport { useUserPresence } from './hooks/listeners/useUserPresence';\nimport { useCreateChannelsContext } from './hooks/useCreateChannelsContext';\nimport { usePaginatedChannels } from './hooks/usePaginatedChannels';\nimport { Skeleton as SkeletonDefault } from './Skeleton';\n\nimport {\n ChannelsContextValue,\n ChannelsProvider,\n} from '../../contexts/channelsContext/ChannelsContext';\nimport { useChatContext } from '../../contexts/chatContext/ChatContext';\nimport { upsertCidsForQuery } from '../../store/apis/upsertCidsForQuery';\nimport type { DefaultStreamChatGenerics } from '../../types/types';\nimport { ChannelPreviewMessenger } from '../ChannelPreview/ChannelPreviewMessenger';\nimport { EmptyStateIndicator as EmptyStateIndicatorDefault } from '../Indicators/EmptyStateIndicator';\nimport { LoadingErrorIndicator as LoadingErrorIndicatorDefault } from '../Indicators/LoadingErrorIndicator';\n\nexport type ChannelListProps<\n StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics,\n> = Partial<\n Pick<\n ChannelsContextValue<StreamChatGenerics>,\n | 'additionalFlatListProps'\n | 'EmptyStateIndicator'\n | 'FooterLoadingIndicator'\n | 'HeaderErrorIndicator'\n | 'HeaderNetworkDownIndicator'\n | 'LoadingErrorIndicator'\n | 'LoadingIndicator'\n | 'Preview'\n | 'setFlatListRef'\n | 'ListHeaderComponent'\n | 'onSelect'\n | 'PreviewAvatar'\n | 'PreviewMessage'\n | 'PreviewMutedStatus'\n | 'PreviewStatus'\n | 'PreviewTitle'\n | 'PreviewUnreadCount'\n | 'loadMoreThreshold'\n | 'Skeleton'\n | 'maxUnreadCount'\n | 'numberOfSkeletons'\n >\n> & {\n /** Optional function to filter channels prior to rendering the list. Do not use any complex logic that would delay the loading of the ChannelList. We recommend using a pure function with array methods like filter/sort/reduce. */\n channelRenderFilterFn?: (\n channels: Array<Channel<StreamChatGenerics>>,\n ) => Array<Channel<StreamChatGenerics>>;\n /**\n * Object containing channel query filters\n *\n * @see See [Channel query documentation](https://getstream.io/chat/docs/query_channels) for a list of available filter fields\n *\n * @overrideType object\n * */\n filters?: ChannelFilters<StreamChatGenerics>;\n /**\n * Custom UI component to display the list of channels\n *\n * Default: [ChannelListMessenger](https://getstream.io/chat/docs/sdk/reactnative/ui-components/channel-list-messenger/)\n */\n List?: React.ComponentType<ChannelListMessengerProps<StreamChatGenerics>>;\n /**\n * If set to true, channels won't dynamically sort by most recent message, defaults to false\n */\n lockChannelOrder?: boolean;\n /**\n * Function that overrides default behavior when a user gets added to a channel\n *\n * @param setChannels Setter for internal state property - `channels`. It's created from useState() hook.\n * @param event An [Event Object](https://getstream.io/chat/docs/event_object) corresponding to `notification.added_to_channel` event\n *\n * @overrideType Function\n * */\n onAddedToChannel?: (\n setChannels: React.Dispatch<React.SetStateAction<Channel<StreamChatGenerics>[] | null>>,\n event: Event<StreamChatGenerics>,\n ) => void;\n /**\n * Function that overrides default behavior when a channel gets deleted. In absence of this prop, the channel will be removed from the list.\n *\n * @param setChannels Setter for internal state property - `channels`. It's created from useState() hook.\n * @param event An [Event object](https://getstream.io/chat/docs/event_object) corresponding to `channel.deleted` event\n *\n * @overrideType Function\n * */\n onChannelDeleted?: (\n setChannels: React.Dispatch<React.SetStateAction<Channel<StreamChatGenerics>[] | null>>,\n event: Event<StreamChatGenerics>,\n ) => void;\n /**\n * Function that overrides default behavior when a channel gets hidden. In absence of this prop, the channel will be removed from the list.\n *\n * @param setChannels Setter for internal state property - `channels`. It's created from useState() hook.\n * @param event An [Event object](https://getstream.io/chat/docs/event_object) corresponding to `channel.hidden` event\n *\n * @overrideType Function\n * */\n onChannelHidden?: (\n setChannels: React.Dispatch<React.SetStateAction<Channel<StreamChatGenerics>[] | null>>,\n event: Event<StreamChatGenerics>,\n ) => void;\n /**\n * Function to customize behavior when a channel gets truncated\n *\n * @param setChannels Setter for internal state property - `channels`. It's created from useState() hook.\n * @param event [Event object](https://getstream.io/chat/docs/event_object) corresponding to `channel.truncated` event\n *\n * @overrideType Function\n * */\n onChannelTruncated?: (\n setChannels: React.Dispatch<React.SetStateAction<Channel<StreamChatGenerics>[] | null>>,\n event: Event<StreamChatGenerics>,\n ) => void;\n /**\n * Function that overrides default behavior when a channel gets updated\n *\n * @param setChannels Setter for internal state property - `channels`. It's created from useState() hook.\n * @param event An [Event object](https://getstream.io/chat/docs/event_object) corresponding to `channel.updated` event\n *\n * @overrideType Function\n * */\n onChannelUpdated?: (\n setChannels: React.Dispatch<React.SetStateAction<Channel<StreamChatGenerics>[] | null>>,\n event: Event<StreamChatGenerics>,\n ) => void;\n /**\n * Function that overrides default behavior when a channel gets visible. In absence of this prop, the channel will be added to the list.\n *\n * @param setChannels Setter for internal state property - `channels`. It's created from useState() hook.\n * @param event An [Event object](https://getstream.io/chat/docs/event_object) corresponding to `channel.visible` event\n *\n * @overrideType Function\n * */\n onChannelVisible?: (\n setChannels: React.Dispatch<React.SetStateAction<Channel<StreamChatGenerics>[] | null>>,\n event: Event<StreamChatGenerics>,\n ) => void;\n /**\n * @deprecated use onNewMessageNotification instead\n *\n * Override the default listener/handler for event `notification.message_new`\n * This event is received on channel, which is not being watched.\n *\n * @param setChannels Setter for internal state property - `channels`. It's created from useState() hook.\n * @param event An [Event object](https://getstream.io/chat/docs/event_object) corresponding to `notification.message_new` event\n *\n * @overrideType Function\n * */\n onMessageNew?: (\n setChannels: React.Dispatch<React.SetStateAction<Channel<StreamChatGenerics>[] | null>>,\n event: Event<StreamChatGenerics>,\n ) => void;\n /**\n * Override the default listener/handler for event `message.new`\n * This event is received on channel, when a new message is added on a channel.\n *\n * @param lockChannelOrder If set to true, channels won't dynamically sort by most recent message, defaults to false\n * @param setChannels Setter for internal state property - `channels`. It's created from useState() hook.\n * @param event An [Event object](https://getstream.io/chat/docs/event_object) corresponding to `message.new` event\n *\n * @overrideType Function\n * */\n onNewMessage?: (\n lockChannelOrder: boolean,\n setChannels: React.Dispatch<React.SetStateAction<Channel<StreamChatGenerics>[] | null>>,\n event: Event<StreamChatGenerics>,\n ) => void;\n /**\n * Override the default listener/handler for event `notification.message_new`\n * This event is received on channel, which is not being watched.\n *\n * @param setChannels Setter for internal state property - `channels`. It's created from useState() hook.\n * @param event An [Event object](https://getstream.io/chat/docs/event_object) corresponding to `notification.message_new` event\n *\n * @overrideType Function\n * */\n onNewMessageNotification?: (\n setChannels: React.Dispatch<React.SetStateAction<Channel<StreamChatGenerics>[] | null>>,\n event: Event<StreamChatGenerics>,\n ) => void;\n /**\n * Function that overrides default behavior when a user gets removed from a channel\n *\n * @param setChannels Setter for internal state property - `channels`. It's created from useState() hook.\n * @param event An [Event object](https://getstream.io/chat/docs/event_object) corresponding to `notification.removed_from_channel` event\n *\n * @overrideType Function\n * */\n onRemovedFromChannel?: (\n setChannels: React.Dispatch<React.SetStateAction<Channel<StreamChatGenerics>[] | null>>,\n event: Event<StreamChatGenerics>,\n ) => void;\n /**\n * Object containing channel query options\n * @see See [Channel query documentation](https://getstream.io/chat/docs/query_channels) for a list of available option fields\n * */\n options?: ChannelOptions;\n /**\n * Object containing channel sort parameters\n * @see See [Channel query documentation](https://getstream.io/chat/docs/query_channels) for a list of available sorting fields\n * */\n sort?: ChannelSort<StreamChatGenerics>;\n};\n\nconst DEFAULT_FILTERS = {};\nconst DEFAULT_OPTIONS = {};\nconst DEFAULT_SORT = {};\n\n/**\n * This component fetches a list of channels, allowing you to select the channel you want to open.\n * The ChannelList doesn't provide any UI for the underlying React Native FlatList. UI is determined by the `List` component which is\n * provided to the ChannelList component as a prop. By default, the ChannelListMessenger component is used as the list UI.\n *\n * @example ./ChannelList.md\n */\nexport const ChannelList = <\n StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics,\n>(\n props: ChannelListProps<StreamChatGenerics>,\n) => {\n const {\n additionalFlatListProps = {},\n channelRenderFilterFn,\n EmptyStateIndicator = EmptyStateIndicatorDefault,\n FooterLoadingIndicator = ChannelListFooterLoadingIndicator,\n filters = DEFAULT_FILTERS,\n HeaderErrorIndicator = ChannelListHeaderErrorIndicator,\n HeaderNetworkDownIndicator = ChannelListHeaderNetworkDownIndicator,\n List = ChannelListMessenger,\n ListHeaderComponent,\n LoadingErrorIndicator = LoadingErrorIndicatorDefault,\n LoadingIndicator = ChannelListLoadingIndicator,\n // https://stackoverflow.com/a/60666252/10826415\n loadMoreThreshold = 0.1,\n lockChannelOrder = false,\n maxUnreadCount = 255,\n numberOfSkeletons = 6,\n onAddedToChannel,\n onChannelDeleted,\n onChannelHidden,\n onChannelVisible,\n onChannelTruncated,\n onChannelUpdated,\n onMessageNew,\n onRemovedFromChannel,\n onSelect,\n onNewMessage,\n onNewMessageNotification,\n options = DEFAULT_OPTIONS,\n Preview = ChannelPreviewMessenger,\n PreviewAvatar,\n PreviewMessage,\n PreviewMutedStatus,\n PreviewStatus,\n PreviewTitle,\n PreviewUnreadCount,\n setFlatListRef,\n Skeleton = SkeletonDefault,\n sort = DEFAULT_SORT,\n } = props;\n\n const [forceUpdate, setForceUpdate] = useState(0);\n const { enableOfflineSupport } = useChatContext<StreamChatGenerics>();\n const {\n channels,\n error,\n hasNextPage,\n loadingChannels,\n loadingNextPage,\n loadNextPage,\n refreshing,\n refreshList,\n reloadList,\n setChannels,\n staticChannelsActive,\n } = usePaginatedChannels<StreamChatGenerics>({\n enableOfflineSupport,\n filters,\n options,\n setForceUpdate,\n sort,\n });\n\n // Setup event listeners\n useAddedToChannelNotification({\n onAddedToChannel,\n setChannels,\n });\n\n useChannelDeleted({\n onChannelDeleted,\n setChannels,\n });\n\n useChannelHidden({\n onChannelHidden,\n setChannels,\n });\n\n useChannelTruncated({\n onChannelTruncated,\n refreshList,\n setChannels,\n setForceUpdate,\n });\n\n useChannelUpdated({\n onChannelUpdated,\n setChannels,\n });\n\n useChannelVisible({\n onChannelVisible,\n setChannels,\n });\n\n useNewMessage({\n lockChannelOrder,\n onNewMessage,\n setChannels,\n });\n\n useNewMessageNotification({\n onMessageNew,\n onNewMessageNotification,\n setChannels,\n });\n\n useRemovedFromChannelNotification({\n onRemovedFromChannel,\n setChannels,\n });\n\n useUserPresence({\n setChannels,\n });\n\n const channelIdsStr = channels?.reduce((acc, channel) => `${acc}${channel.cid}`, '');\n\n useEffect(() => {\n if (channels === null || staticChannelsActive || !enableOfflineSupport) {\n return;\n }\n\n upsertCidsForQuery({\n cids: channels.map((c) => c.cid),\n filters,\n sort,\n });\n }, [channelIdsStr, staticChannelsActive]);\n\n const channelsContext = useCreateChannelsContext({\n additionalFlatListProps,\n channels: channelRenderFilterFn ? channelRenderFilterFn(channels ?? []) : channels,\n EmptyStateIndicator,\n error,\n FooterLoadingIndicator,\n forceUpdate,\n hasNextPage,\n HeaderErrorIndicator,\n HeaderNetworkDownIndicator,\n ListHeaderComponent,\n loadingChannels,\n LoadingErrorIndicator,\n LoadingIndicator,\n loadingNextPage,\n loadMoreThreshold,\n loadNextPage,\n maxUnreadCount,\n numberOfSkeletons,\n onSelect,\n Preview,\n PreviewAvatar,\n PreviewMessage,\n PreviewMutedStatus,\n PreviewStatus,\n PreviewTitle,\n PreviewUnreadCount,\n refreshing,\n refreshList,\n reloadList,\n setFlatListRef: (ref: FlatList<Channel<StreamChatGenerics>> | null) => {\n if (setFlatListRef) {\n setFlatListRef(ref);\n }\n },\n Skeleton,\n });\n\n return (\n <ChannelsProvider value={channelsContext}>\n <List<StreamChatGenerics> />\n </ChannelsProvider>\n );\n};\n"],"mappings":";;;;;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AAMA,IAAAC,kCAAA,GAAAD,OAAA;AACA,IAAAE,gCAAA,GAAAF,OAAA;AACA,IAAAG,sCAAA,GAAAH,OAAA;AACA,IAAAI,4BAAA,GAAAJ,OAAA;AACA,IAAAK,qBAAA,GAAAL,OAAA;AACA,IAAAM,8BAAA,GAAAN,OAAA;AACA,IAAAO,kBAAA,GAAAP,OAAA;AACA,IAAAQ,iBAAA,GAAAR,OAAA;AACA,IAAAS,oBAAA,GAAAT,OAAA;AACA,IAAAU,kBAAA,GAAAV,OAAA;AACA,IAAAW,kBAAA,GAAAX,OAAA;AACA,IAAAY,cAAA,GAAAZ,OAAA;AACA,IAAAa,0BAAA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ChBqD,eAAe,EAAfA,eAAe;IACflD,iBAAiB,EAAjBA,iBAAiB;IACjBmD,YAAY,EAAZA,YAAY;IACZ/C,cAAc,EAAdA,cAAc;IACdE,iBAAiB,EAAjBA,iBAAiB;IACjBS,QAAQ,EAARA,QAAQ;IACRM,OAAO,EAAPA,OAAO;IACPE,aAAa,EAAbA,aAAa;IACbC,cAAc,EAAdA,cAAc;IACdC,kBAAkB,EAAlBA,kBAAkB;IAClBC,aAAa,EAAbA,aAAa;IACbC,YAAY,EAAZA,YAAY;IACZC,kBAAkB,EAAlBA,kBAAkB;IAClBwB,UAAU,EAAVA,UAAU;IACVC,WAAW,EAAXA,WAAW;IACXC,UAAU,EAAVA,UAAU;IACVzB,cAAc,EAAE,SAAAA,eAACkD,GAAiD,EAAK;MACrE,IAAIlD,eAAc,EAAE;QAClBA,eAAc,CAACkD,GAAG,CAAC;MACrB;IACF,CAAC;IACDhD,QAAQ,EAARA;EACF,CAAC,CAAC;EAEF,OACEnH,MAAA,YAAAoK,aAAA,CAAC/I,gBAAA,CAAAgJ,gBAAgB;IAACC,KAAK,EAAEL,eAAgB;IAAAM,MAAA,EAAA5I,KAAA;IAAA6I,QAAA;MAAAC,QAAA,EAAA7I,YAAA;MAAA8I,UAAA;MAAAC,YAAA;IAAA;EAAA,GACvC3K,MAAA,YAAAoK,aAAA,CAAC1F,IAAI;IAAA6F,MAAA,EAAA5I,KAAA;IAAA6I,QAAA;MAAAC,QAAA,EAAA7I,YAAA;MAAA8I,UAAA;MAAAC,YAAA;IAAA;EAAA,EAAuB,CACX;AAEvB,CAAC;AAACC,OAAA,CAAAtH,WAAA,GAAAA,WAAA"}
|
|
@@ -26,6 +26,7 @@ var useCreateChannelsContext = function useCreateChannelsContext(_ref) {
|
|
|
26
26
|
Preview = _ref.Preview,
|
|
27
27
|
PreviewAvatar = _ref.PreviewAvatar,
|
|
28
28
|
PreviewMessage = _ref.PreviewMessage,
|
|
29
|
+
PreviewMutedStatus = _ref.PreviewMutedStatus,
|
|
29
30
|
PreviewStatus = _ref.PreviewStatus,
|
|
30
31
|
PreviewTitle = _ref.PreviewTitle,
|
|
31
32
|
PreviewUnreadCount = _ref.PreviewUnreadCount,
|
|
@@ -65,6 +66,7 @@ var useCreateChannelsContext = function useCreateChannelsContext(_ref) {
|
|
|
65
66
|
Preview: Preview,
|
|
66
67
|
PreviewAvatar: PreviewAvatar,
|
|
67
68
|
PreviewMessage: PreviewMessage,
|
|
69
|
+
PreviewMutedStatus: PreviewMutedStatus,
|
|
68
70
|
PreviewStatus: PreviewStatus,
|
|
69
71
|
PreviewTitle: PreviewTitle,
|
|
70
72
|
PreviewUnreadCount: PreviewUnreadCount,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_react","require","useCreateChannelsContext","_ref","additionalFlatListProps","channels","EmptyStateIndicator","error","FooterLoadingIndicator","forceUpdate","hasNextPage","HeaderErrorIndicator","HeaderNetworkDownIndicator","ListHeaderComponent","loadingChannels","LoadingErrorIndicator","LoadingIndicator","loadingNextPage","loadMoreThreshold","loadNextPage","maxUnreadCount","numberOfSkeletons","onSelect","Preview","PreviewAvatar","PreviewMessage","PreviewStatus","PreviewTitle","PreviewUnreadCount","refreshing","refreshList","reloadList","setFlatListRef","Skeleton","channelValueString","map","channel","_channel$data$name","_channel$data","_channel$id","data","name","id","Object","values","state","members","member","_member$user","user","online","join","channelsContext","useMemo","exports"],"sources":["useCreateChannelsContext.ts"],"sourcesContent":["import { useMemo } from 'react';\n\nimport type { ChannelsContextValue } from '../../../contexts/channelsContext/ChannelsContext';\nimport type { DefaultStreamChatGenerics } from '../../../types/types';\n\nexport const useCreateChannelsContext = <\n StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics,\n>({\n additionalFlatListProps,\n channels,\n EmptyStateIndicator,\n error,\n FooterLoadingIndicator,\n forceUpdate,\n hasNextPage,\n HeaderErrorIndicator,\n HeaderNetworkDownIndicator,\n ListHeaderComponent,\n loadingChannels,\n LoadingErrorIndicator,\n LoadingIndicator,\n loadingNextPage,\n loadMoreThreshold,\n loadNextPage,\n maxUnreadCount,\n numberOfSkeletons,\n onSelect,\n Preview,\n PreviewAvatar,\n PreviewMessage,\n PreviewStatus,\n PreviewTitle,\n PreviewUnreadCount,\n refreshing,\n refreshList,\n reloadList,\n setFlatListRef,\n Skeleton,\n}: ChannelsContextValue<StreamChatGenerics>) => {\n const channelValueString = channels\n ?.map(\n (channel) =>\n `${channel.data?.name ?? ''}${channel.id ?? ''}${Object.values(channel.state.members)\n .map((member) => member.user?.online)\n .join()}`,\n )\n .join();\n const channelsContext: ChannelsContextValue<StreamChatGenerics> = useMemo(\n () => ({\n additionalFlatListProps,\n channels,\n EmptyStateIndicator,\n error,\n FooterLoadingIndicator,\n forceUpdate,\n hasNextPage,\n HeaderErrorIndicator,\n HeaderNetworkDownIndicator,\n ListHeaderComponent,\n loadingChannels,\n LoadingErrorIndicator,\n LoadingIndicator,\n loadingNextPage,\n loadMoreThreshold,\n loadNextPage,\n maxUnreadCount,\n numberOfSkeletons,\n onSelect,\n Preview,\n PreviewAvatar,\n PreviewMessage,\n PreviewStatus,\n PreviewTitle,\n PreviewUnreadCount,\n refreshing,\n refreshList,\n reloadList,\n setFlatListRef,\n Skeleton,\n }),\n [\n channelValueString,\n error,\n forceUpdate,\n hasNextPage,\n loadingChannels,\n loadingNextPage,\n refreshing,\n ],\n );\n\n return channelsContext;\n};\n"],"mappings":";;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AAKO,IAAMC,wBAAwB,GAAG,SAA3BA,wBAAwBA,CAAAC,IAAA,
|
|
1
|
+
{"version":3,"names":["_react","require","useCreateChannelsContext","_ref","additionalFlatListProps","channels","EmptyStateIndicator","error","FooterLoadingIndicator","forceUpdate","hasNextPage","HeaderErrorIndicator","HeaderNetworkDownIndicator","ListHeaderComponent","loadingChannels","LoadingErrorIndicator","LoadingIndicator","loadingNextPage","loadMoreThreshold","loadNextPage","maxUnreadCount","numberOfSkeletons","onSelect","Preview","PreviewAvatar","PreviewMessage","PreviewMutedStatus","PreviewStatus","PreviewTitle","PreviewUnreadCount","refreshing","refreshList","reloadList","setFlatListRef","Skeleton","channelValueString","map","channel","_channel$data$name","_channel$data","_channel$id","data","name","id","Object","values","state","members","member","_member$user","user","online","join","channelsContext","useMemo","exports"],"sources":["useCreateChannelsContext.ts"],"sourcesContent":["import { useMemo } from 'react';\n\nimport type { ChannelsContextValue } from '../../../contexts/channelsContext/ChannelsContext';\nimport type { DefaultStreamChatGenerics } from '../../../types/types';\n\nexport const useCreateChannelsContext = <\n StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics,\n>({\n additionalFlatListProps,\n channels,\n EmptyStateIndicator,\n error,\n FooterLoadingIndicator,\n forceUpdate,\n hasNextPage,\n HeaderErrorIndicator,\n HeaderNetworkDownIndicator,\n ListHeaderComponent,\n loadingChannels,\n LoadingErrorIndicator,\n LoadingIndicator,\n loadingNextPage,\n loadMoreThreshold,\n loadNextPage,\n maxUnreadCount,\n numberOfSkeletons,\n onSelect,\n Preview,\n PreviewAvatar,\n PreviewMessage,\n PreviewMutedStatus,\n PreviewStatus,\n PreviewTitle,\n PreviewUnreadCount,\n refreshing,\n refreshList,\n reloadList,\n setFlatListRef,\n Skeleton,\n}: ChannelsContextValue<StreamChatGenerics>) => {\n const channelValueString = channels\n ?.map(\n (channel) =>\n `${channel.data?.name ?? ''}${channel.id ?? ''}${Object.values(channel.state.members)\n .map((member) => member.user?.online)\n .join()}`,\n )\n .join();\n const channelsContext: ChannelsContextValue<StreamChatGenerics> = useMemo(\n () => ({\n additionalFlatListProps,\n channels,\n EmptyStateIndicator,\n error,\n FooterLoadingIndicator,\n forceUpdate,\n hasNextPage,\n HeaderErrorIndicator,\n HeaderNetworkDownIndicator,\n ListHeaderComponent,\n loadingChannels,\n LoadingErrorIndicator,\n LoadingIndicator,\n loadingNextPage,\n loadMoreThreshold,\n loadNextPage,\n maxUnreadCount,\n numberOfSkeletons,\n onSelect,\n Preview,\n PreviewAvatar,\n PreviewMessage,\n PreviewMutedStatus,\n PreviewStatus,\n PreviewTitle,\n PreviewUnreadCount,\n refreshing,\n refreshList,\n reloadList,\n setFlatListRef,\n Skeleton,\n }),\n [\n channelValueString,\n error,\n forceUpdate,\n hasNextPage,\n loadingChannels,\n loadingNextPage,\n refreshing,\n ],\n );\n\n return channelsContext;\n};\n"],"mappings":";;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AAKO,IAAMC,wBAAwB,GAAG,SAA3BA,wBAAwBA,CAAAC,IAAA,EAkCW;EAAA,IA/B9CC,uBAAuB,GAAAD,IAAA,CAAvBC,uBAAuB;IACvBC,QAAQ,GAAAF,IAAA,CAARE,QAAQ;IACRC,mBAAmB,GAAAH,IAAA,CAAnBG,mBAAmB;IACnBC,KAAK,GAAAJ,IAAA,CAALI,KAAK;IACLC,sBAAsB,GAAAL,IAAA,CAAtBK,sBAAsB;IACtBC,WAAW,GAAAN,IAAA,CAAXM,WAAW;IACXC,WAAW,GAAAP,IAAA,CAAXO,WAAW;IACXC,oBAAoB,GAAAR,IAAA,CAApBQ,oBAAoB;IACpBC,0BAA0B,GAAAT,IAAA,CAA1BS,0BAA0B;IAC1BC,mBAAmB,GAAAV,IAAA,CAAnBU,mBAAmB;IACnBC,eAAe,GAAAX,IAAA,CAAfW,eAAe;IACfC,qBAAqB,GAAAZ,IAAA,CAArBY,qBAAqB;IACrBC,gBAAgB,GAAAb,IAAA,CAAhBa,gBAAgB;IAChBC,eAAe,GAAAd,IAAA,CAAfc,eAAe;IACfC,iBAAiB,GAAAf,IAAA,CAAjBe,iBAAiB;IACjBC,YAAY,GAAAhB,IAAA,CAAZgB,YAAY;IACZC,cAAc,GAAAjB,IAAA,CAAdiB,cAAc;IACdC,iBAAiB,GAAAlB,IAAA,CAAjBkB,iBAAiB;IACjBC,QAAQ,GAAAnB,IAAA,CAARmB,QAAQ;IACRC,OAAO,GAAApB,IAAA,CAAPoB,OAAO;IACPC,aAAa,G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,EAAXA,WAAW;MACXC,WAAW,EAAXA,WAAW;MACXC,oBAAoB,EAApBA,oBAAoB;MACpBC,0BAA0B,EAA1BA,0BAA0B;MAC1BC,mBAAmB,EAAnBA,mBAAmB;MACnBC,eAAe,EAAfA,eAAe;MACfC,qBAAqB,EAArBA,qBAAqB;MACrBC,gBAAgB,EAAhBA,gBAAgB;MAChBC,eAAe,EAAfA,eAAe;MACfC,iBAAiB,EAAjBA,iBAAiB;MACjBC,YAAY,EAAZA,YAAY;MACZC,cAAc,EAAdA,cAAc;MACdC,iBAAiB,EAAjBA,iBAAiB;MACjBC,QAAQ,EAARA,QAAQ;MACRC,OAAO,EAAPA,OAAO;MACPC,aAAa,EAAbA,aAAa;MACbC,cAAc,EAAdA,cAAc;MACdC,kBAAkB,EAAlBA,kBAAkB;MAClBC,aAAa,EAAbA,aAAa;MACbC,YAAY,EAAZA,YAAY;MACZC,kBAAkB,EAAlBA,kBAAkB;MAClBC,UAAU,EAAVA,UAAU;MACVC,WAAW,EAAXA,WAAW;MACXC,UAAU,EAAVA,UAAU;MACVC,cAAc,EAAdA,cAAc;MACdC,QAAQ,EAARA;IACF,CAAC;EAAA,CAAC,EACF,CACEC,kBAAkB,EAClB5B,KAAK,EACLE,WAAW,EACXC,WAAW,EACXI,eAAe,EACfG,eAAe,EACfa,UAAU,CACX,CACF;EAED,OAAOuB,eAAe;AACxB,CAAC;AAACE,OAAA,CAAArD,wBAAA,GAAAA,wBAAA"}
|
|
@@ -137,14 +137,12 @@ var ChannelPreviewMessengerWithContext = function ChannelPreviewMessengerWithCon
|
|
|
137
137
|
lineNumber: 158,
|
|
138
138
|
columnNumber: 11
|
|
139
139
|
}
|
|
140
|
-
}, _react["default"].createElement(PreviewMutedStatus, {
|
|
141
|
-
channel: channel,
|
|
142
|
-
muted: isChannelMuted,
|
|
140
|
+
}, isChannelMuted && _react["default"].createElement(PreviewMutedStatus, {
|
|
143
141
|
__self: _this,
|
|
144
142
|
__source: {
|
|
145
143
|
fileName: _jsxFileName,
|
|
146
144
|
lineNumber: 159,
|
|
147
|
-
columnNumber:
|
|
145
|
+
columnNumber: 32
|
|
148
146
|
}
|
|
149
147
|
}), _react["default"].createElement(PreviewUnreadCount, {
|
|
150
148
|
channel: channel,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_react","_interopRequireDefault","require","_reactNative","_reactNativeGestureHandler","_ChannelAvatar","_ChannelPreviewMessage","_ChannelPreviewMutedStatus","_ChannelPreviewStatus","_ChannelPreviewTitle","_ChannelPreviewUnreadCount","_useChannelPreviewDisplayName","_ChannelsContext","_ThemeContext","_utils","_this","_jsxFileName","styles","StyleSheet","create","container","borderBottomWidth","flex","flexDirection","paddingHorizontal","paddingVertical","contentContainer","row","alignItems","justifyContent","paddingLeft","statusContainer","display","title","fontSize","fontWeight","maxWidth","vw","ChannelPreviewMessengerWithContext","props","channel","formatLatestMessageDate","latestMessagePreview","maxUnreadCount","onSelect","_props$PreviewAvatar","PreviewAvatar","ChannelAvatar","_props$PreviewMessage","PreviewMessage","ChannelPreviewMessage","_props$PreviewStatus","PreviewStatus","ChannelPreviewStatus","_props$PreviewTitle","PreviewTitle","ChannelPreviewTitle","_props$PreviewUnreadC","PreviewUnreadCount","ChannelPreviewUnreadCount","_props$PreviewMutedSt","PreviewMutedStatus","ChannelPreviewMutedStatus","unread","_useTheme","useTheme","_useTheme$theme","theme","_useTheme$theme$chann","channelPreview","_useTheme$theme$color","colors","border","white_snow","displayName","useChannelPreviewDisplayName","Math","floor","isChannelMuted","muteStatus","muted","createElement","TouchableOpacity","onPress","style","backgroundColor","borderBottomColor","testID","__self","__source","fileName","lineNumber","columnNumber","View","id","MemoizedChannelPreviewMessengerWithContext","React","memo","ChannelPreviewMessenger","_useChannelsContext","useChannelsContext","_extends2","exports"],"sources":["ChannelPreviewMessenger.tsx"],"sourcesContent":["import React from 'react';\nimport { StyleSheet, View } from 'react-native';\nimport { TouchableOpacity } from 'react-native-gesture-handler';\n\nimport { ChannelAvatar } from './ChannelAvatar';\nimport type { ChannelPreviewProps } from './ChannelPreview';\nimport { ChannelPreviewMessage } from './ChannelPreviewMessage';\nimport { ChannelPreviewMutedStatus } from './ChannelPreviewMutedStatus';\nimport { ChannelPreviewStatus } from './ChannelPreviewStatus';\nimport { ChannelPreviewTitle } from './ChannelPreviewTitle';\nimport { ChannelPreviewUnreadCount } from './ChannelPreviewUnreadCount';\nimport { useChannelPreviewDisplayName } from './hooks/useChannelPreviewDisplayName';\n\nimport type { LatestMessagePreview } from './hooks/useLatestMessagePreview';\n\nimport {\n ChannelsContextValue,\n useChannelsContext,\n} from '../../contexts/channelsContext/ChannelsContext';\nimport { useTheme } from '../../contexts/themeContext/ThemeContext';\nimport type { DefaultStreamChatGenerics } from '../../types/types';\nimport { vw } from '../../utils/utils';\n\nconst styles = StyleSheet.create({\n container: {\n borderBottomWidth: 1,\n flex: 1,\n flexDirection: 'row',\n paddingHorizontal: 8,\n paddingVertical: 12,\n },\n contentContainer: { flex: 1 },\n row: {\n alignItems: 'center',\n flex: 1,\n flexDirection: 'row',\n justifyContent: 'space-between',\n paddingLeft: 8,\n },\n statusContainer: {\n display: 'flex',\n flexDirection: 'row',\n },\n title: { fontSize: 14, fontWeight: '700' },\n});\n\nconst maxWidth = vw(80) - 16 - 40;\n\nexport type ChannelPreviewMessengerPropsWithContext<\n StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics,\n> = Pick<ChannelPreviewProps<StreamChatGenerics>, 'channel'> &\n Pick<\n ChannelsContextValue<StreamChatGenerics>,\n | 'maxUnreadCount'\n | 'onSelect'\n | 'PreviewAvatar'\n | 'PreviewMessage'\n | 'PreviewMutedStatus'\n | 'PreviewStatus'\n | 'PreviewTitle'\n | 'PreviewUnreadCount'\n > & {\n /**\n * Latest message on a channel, formatted for preview\n *\n * e.g.,\n *\n * ```json\n * {\n * created_at: '' ,\n * messageObject: { ... },\n * previews: {\n * bold: true,\n * text: 'This is the message preview text'\n * },\n * status: 0 | 1 | 2 // read states of the latest message.\n * }\n * ```\n *\n * The read status is either of the following:\n *\n * 0: The message was not sent by the current user\n * 1: The message was sent by the current user and is unread\n * 2: The message was sent by the current user and is read\n *\n * @overrideType object\n */\n latestMessagePreview: LatestMessagePreview<StreamChatGenerics>;\n /**\n * Formatter function for date of latest message.\n * @param date Message date\n * @returns Formatted date string\n *\n * By default today's date is shown in 'HH:mm A' format and other dates\n * are displayed in 'DD/MM/YY' format. props.latestMessage.created_at is the\n * default formatted date. This default logic is part of ChannelPreview component.\n */\n formatLatestMessageDate?: (date: Date) => string;\n /** Number of unread messages on the channel */\n unread?: number;\n };\n\nconst ChannelPreviewMessengerWithContext = <\n StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics,\n>(\n props: ChannelPreviewMessengerPropsWithContext<StreamChatGenerics>,\n) => {\n const {\n channel,\n formatLatestMessageDate,\n latestMessagePreview,\n maxUnreadCount,\n onSelect,\n PreviewAvatar = ChannelAvatar,\n PreviewMessage = ChannelPreviewMessage,\n PreviewStatus = ChannelPreviewStatus,\n PreviewTitle = ChannelPreviewTitle,\n PreviewUnreadCount = ChannelPreviewUnreadCount,\n PreviewMutedStatus = ChannelPreviewMutedStatus,\n unread,\n } = props;\n\n const {\n theme: {\n channelPreview: { container, contentContainer, row, title },\n colors: { border, white_snow },\n },\n } = useTheme();\n\n const displayName = useChannelPreviewDisplayName(\n channel,\n Math.floor(maxWidth / ((title.fontSize || styles.title.fontSize) / 2)),\n );\n\n const isChannelMuted = channel.muteStatus().muted;\n\n return (\n <TouchableOpacity\n onPress={() => {\n if (onSelect) {\n onSelect(channel);\n }\n }}\n style={[\n styles.container,\n { backgroundColor: white_snow, borderBottomColor: border },\n container,\n ]}\n testID='channel-preview-button'\n >\n <PreviewAvatar channel={channel} />\n <View\n style={[styles.contentContainer, contentContainer]}\n testID={`channel-preview-content-${channel.id}`}\n >\n <View style={[styles.row, row]}>\n <PreviewTitle channel={channel} displayName={displayName} />\n <View style={[styles.statusContainer, row]}>\n <PreviewMutedStatus channel={channel} muted={isChannelMuted} />\n <PreviewUnreadCount channel={channel} maxUnreadCount={maxUnreadCount} unread={unread} />\n </View>\n </View>\n <View style={[styles.row, row]}>\n <PreviewMessage latestMessagePreview={latestMessagePreview} />\n <PreviewStatus\n channel={channel}\n formatLatestMessageDate={formatLatestMessageDate}\n latestMessagePreview={latestMessagePreview}\n />\n </View>\n </View>\n </TouchableOpacity>\n );\n};\n\nexport type ChannelPreviewMessengerProps<\n StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics,\n> = Partial<\n Omit<\n ChannelPreviewMessengerPropsWithContext<StreamChatGenerics>,\n 'channel' | 'latestMessagePreview'\n >\n> &\n Pick<\n ChannelPreviewMessengerPropsWithContext<StreamChatGenerics>,\n 'channel' | 'latestMessagePreview'\n >;\n\nconst MemoizedChannelPreviewMessengerWithContext = React.memo(\n ChannelPreviewMessengerWithContext,\n) as typeof ChannelPreviewMessengerWithContext;\n\n/**\n * This UI component displays an individual preview item for each channel in a list. It also receives all props\n * from the ChannelPreview component.\n */\nexport const ChannelPreviewMessenger = <\n StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics,\n>(\n props: ChannelPreviewMessengerProps<StreamChatGenerics>,\n) => {\n const {\n maxUnreadCount,\n onSelect,\n PreviewAvatar,\n PreviewMessage,\n PreviewMutedStatus,\n PreviewStatus,\n PreviewTitle,\n PreviewUnreadCount,\n } = useChannelsContext<StreamChatGenerics>();\n return (\n <MemoizedChannelPreviewMessengerWithContext\n {...{\n maxUnreadCount,\n onSelect,\n PreviewAvatar,\n PreviewMessage,\n PreviewMutedStatus,\n PreviewStatus,\n PreviewTitle,\n PreviewUnreadCount,\n }}\n {...props}\n />\n );\n};\n\nChannelPreviewMessenger.displayName = 'ChannelPreviewMessenger{channelPreview}';\n"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OA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c;IACdY,kBAAkB,EAAlBA,kBAAkB;IAClBT,aAAa,EAAbA,aAAa;IACbG,YAAY,EAAZA,YAAY;IACZG,kBAAkB,EAAlBA;EAAkB,GAEhBnB,KAAK;IAAAiD,MAAA,EAAAzE,KAAA;IAAA0E,QAAA;MAAAC,QAAA,EAAA1E,YAAA;MAAA2E,UAAA;MAAAC,YAAA;IAAA;EAAA,GACT;AAEN,CAAC;AAACU,OAAA,CAAAJ,uBAAA,GAAAA,uBAAA;AAEFA,uBAAuB,CAACxB,WAAW,GAAG,yCAAyC"}
|
|
1
|
+
{"version":3,"names":["_react","_interopRequireDefault","require","_reactNative","_reactNativeGestureHandler","_ChannelAvatar","_ChannelPreviewMessage","_ChannelPreviewMutedStatus","_ChannelPreviewStatus","_ChannelPreviewTitle","_ChannelPreviewUnreadCount","_useChannelPreviewDisplayName","_ChannelsContext","_ThemeContext","_utils","_this","_jsxFileName","styles","StyleSheet","create","container","borderBottomWidth","flex","flexDirection","paddingHorizontal","paddingVertical","contentContainer","row","alignItems","justifyContent","paddingLeft","statusContainer","display","title","fontSize","fontWeight","maxWidth","vw","ChannelPreviewMessengerWithContext","props","channel","formatLatestMessageDate","latestMessagePreview","maxUnreadCount","onSelect","_props$PreviewAvatar","PreviewAvatar","ChannelAvatar","_props$PreviewMessage","PreviewMessage","ChannelPreviewMessage","_props$PreviewStatus","PreviewStatus","ChannelPreviewStatus","_props$PreviewTitle","PreviewTitle","ChannelPreviewTitle","_props$PreviewUnreadC","PreviewUnreadCount","ChannelPreviewUnreadCount","_props$PreviewMutedSt","PreviewMutedStatus","ChannelPreviewMutedStatus","unread","_useTheme","useTheme","_useTheme$theme","theme","_useTheme$theme$chann","channelPreview","_useTheme$theme$color","colors","border","white_snow","displayName","useChannelPreviewDisplayName","Math","floor","isChannelMuted","muteStatus","muted","createElement","TouchableOpacity","onPress","style","backgroundColor","borderBottomColor","testID","__self","__source","fileName","lineNumber","columnNumber","View","id","MemoizedChannelPreviewMessengerWithContext","React","memo","ChannelPreviewMessenger","_useChannelsContext","useChannelsContext","_extends2","exports"],"sources":["ChannelPreviewMessenger.tsx"],"sourcesContent":["import React from 'react';\nimport { StyleSheet, View } from 'react-native';\nimport { TouchableOpacity } from 'react-native-gesture-handler';\n\nimport { ChannelAvatar } from './ChannelAvatar';\nimport type { ChannelPreviewProps } from './ChannelPreview';\nimport { ChannelPreviewMessage } from './ChannelPreviewMessage';\nimport { ChannelPreviewMutedStatus } from './ChannelPreviewMutedStatus';\nimport { ChannelPreviewStatus } from './ChannelPreviewStatus';\nimport { ChannelPreviewTitle } from './ChannelPreviewTitle';\nimport { ChannelPreviewUnreadCount } from './ChannelPreviewUnreadCount';\nimport { useChannelPreviewDisplayName } from './hooks/useChannelPreviewDisplayName';\n\nimport type { LatestMessagePreview } from './hooks/useLatestMessagePreview';\n\nimport {\n ChannelsContextValue,\n useChannelsContext,\n} from '../../contexts/channelsContext/ChannelsContext';\nimport { useTheme } from '../../contexts/themeContext/ThemeContext';\nimport type { DefaultStreamChatGenerics } from '../../types/types';\nimport { vw } from '../../utils/utils';\n\nconst styles = StyleSheet.create({\n container: {\n borderBottomWidth: 1,\n flex: 1,\n flexDirection: 'row',\n paddingHorizontal: 8,\n paddingVertical: 12,\n },\n contentContainer: { flex: 1 },\n row: {\n alignItems: 'center',\n flex: 1,\n flexDirection: 'row',\n justifyContent: 'space-between',\n paddingLeft: 8,\n },\n statusContainer: {\n display: 'flex',\n flexDirection: 'row',\n },\n title: { fontSize: 14, fontWeight: '700' },\n});\n\nconst maxWidth = vw(80) - 16 - 40;\n\nexport type ChannelPreviewMessengerPropsWithContext<\n StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics,\n> = Pick<ChannelPreviewProps<StreamChatGenerics>, 'channel'> &\n Pick<\n ChannelsContextValue<StreamChatGenerics>,\n | 'maxUnreadCount'\n | 'onSelect'\n | 'PreviewAvatar'\n | 'PreviewMessage'\n | 'PreviewMutedStatus'\n | 'PreviewStatus'\n | 'PreviewTitle'\n | 'PreviewUnreadCount'\n > & {\n /**\n * Latest message on a channel, formatted for preview\n *\n * e.g.,\n *\n * ```json\n * {\n * created_at: '' ,\n * messageObject: { ... },\n * previews: {\n * bold: true,\n * text: 'This is the message preview text'\n * },\n * status: 0 | 1 | 2 // read states of the latest message.\n * }\n * ```\n *\n * The read status is either of the following:\n *\n * 0: The message was not sent by the current user\n * 1: The message was sent by the current user and is unread\n * 2: The message was sent by the current user and is read\n *\n * @overrideType object\n */\n latestMessagePreview: LatestMessagePreview<StreamChatGenerics>;\n /**\n * Formatter function for date of latest message.\n * @param date Message date\n * @returns Formatted date string\n *\n * By default today's date is shown in 'HH:mm A' format and other dates\n * are displayed in 'DD/MM/YY' format. props.latestMessage.created_at is the\n * default formatted date. This default logic is part of ChannelPreview component.\n */\n formatLatestMessageDate?: (date: Date) => string;\n /** Number of unread messages on the channel */\n unread?: number;\n };\n\nconst ChannelPreviewMessengerWithContext = <\n StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics,\n>(\n props: ChannelPreviewMessengerPropsWithContext<StreamChatGenerics>,\n) => {\n const {\n channel,\n formatLatestMessageDate,\n latestMessagePreview,\n maxUnreadCount,\n onSelect,\n PreviewAvatar = ChannelAvatar,\n PreviewMessage = ChannelPreviewMessage,\n PreviewStatus = ChannelPreviewStatus,\n PreviewTitle = ChannelPreviewTitle,\n PreviewUnreadCount = ChannelPreviewUnreadCount,\n PreviewMutedStatus = ChannelPreviewMutedStatus,\n unread,\n } = props;\n\n const {\n theme: {\n channelPreview: { container, contentContainer, row, title },\n colors: { border, white_snow },\n },\n } = useTheme();\n\n const displayName = useChannelPreviewDisplayName(\n channel,\n Math.floor(maxWidth / ((title.fontSize || styles.title.fontSize) / 2)),\n );\n\n const isChannelMuted = channel.muteStatus().muted;\n\n return (\n <TouchableOpacity\n onPress={() => {\n if (onSelect) {\n onSelect(channel);\n }\n }}\n style={[\n styles.container,\n { backgroundColor: white_snow, borderBottomColor: border },\n container,\n ]}\n testID='channel-preview-button'\n >\n <PreviewAvatar channel={channel} />\n <View\n style={[styles.contentContainer, contentContainer]}\n testID={`channel-preview-content-${channel.id}`}\n >\n <View style={[styles.row, row]}>\n <PreviewTitle channel={channel} displayName={displayName} />\n <View style={[styles.statusContainer, row]}>\n {isChannelMuted && <PreviewMutedStatus />}\n <PreviewUnreadCount channel={channel} maxUnreadCount={maxUnreadCount} unread={unread} />\n </View>\n </View>\n <View style={[styles.row, row]}>\n <PreviewMessage latestMessagePreview={latestMessagePreview} />\n <PreviewStatus\n channel={channel}\n formatLatestMessageDate={formatLatestMessageDate}\n latestMessagePreview={latestMessagePreview}\n />\n </View>\n </View>\n </TouchableOpacity>\n );\n};\n\nexport type ChannelPreviewMessengerProps<\n StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics,\n> = Partial<\n Omit<\n ChannelPreviewMessengerPropsWithContext<StreamChatGenerics>,\n 'channel' | 'latestMessagePreview'\n >\n> &\n Pick<\n ChannelPreviewMessengerPropsWithContext<StreamChatGenerics>,\n 'channel' | 'latestMessagePreview'\n >;\n\nconst MemoizedChannelPreviewMessengerWithContext = React.memo(\n ChannelPreviewMessengerWithContext,\n) as typeof ChannelPreviewMessengerWithContext;\n\n/**\n * This UI component displays an individual preview item for each channel in a list. It also receives all props\n * from the ChannelPreview component.\n */\nexport const ChannelPreviewMessenger = <\n StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics,\n>(\n props: ChannelPreviewMessengerProps<StreamChatGenerics>,\n) => {\n const {\n maxUnreadCount,\n onSelect,\n PreviewAvatar,\n PreviewMessage,\n PreviewMutedStatus,\n PreviewStatus,\n PreviewTitle,\n PreviewUnreadCount,\n } = useChannelsContext<StreamChatGenerics>();\n return (\n <MemoizedChannelPreviewMessengerWithContext\n {...{\n maxUnreadCount,\n onSelect,\n PreviewAvatar,\n PreviewMessage,\n PreviewMutedStatus,\n PreviewStatus,\n PreviewTitle,\n PreviewUnreadCount,\n }}\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C,MAAAM,SAAA;IAEvC1D,cAAc,EAAdA,cAAc;IACdC,QAAQ,EAARA,QAAQ;IACRE,aAAa,EAAbA,aAAa;IACbG,cAAc,EAAdA,cAAc;IACdY,kBAAkB,EAAlBA,kBAAkB;IAClBT,aAAa,EAAbA,aAAa;IACbG,YAAY,EAAZA,YAAY;IACZG,kBAAkB,EAAlBA;EAAkB,GAEhBnB,KAAK;IAAAiD,MAAA,EAAAzE,KAAA;IAAA0E,QAAA;MAAAC,QAAA,EAAA1E,YAAA;MAAA2E,UAAA;MAAAC,YAAA;IAAA;EAAA,GACT;AAEN,CAAC;AAACU,OAAA,CAAAJ,uBAAA,GAAAA,uBAAA;AAEFA,uBAAuB,CAACxB,WAAW,GAAG,yCAAyC"}
|
|
@@ -14,8 +14,7 @@ var styles = _reactNative.StyleSheet.create({
|
|
|
14
14
|
marginRight: 8
|
|
15
15
|
}
|
|
16
16
|
});
|
|
17
|
-
var ChannelPreviewMutedStatus = function ChannelPreviewMutedStatus(
|
|
18
|
-
var muted = props.muted;
|
|
17
|
+
var ChannelPreviewMutedStatus = function ChannelPreviewMutedStatus() {
|
|
19
18
|
var _useTheme = (0, _ThemeContext.useTheme)(),
|
|
20
19
|
_useTheme$theme = _useTheme.theme,
|
|
21
20
|
_useTheme$theme$chann = _useTheme$theme.channelPreview.mutedStatus,
|
|
@@ -23,7 +22,7 @@ var ChannelPreviewMutedStatus = function ChannelPreviewMutedStatus(props) {
|
|
|
23
22
|
iconStyle = _useTheme$theme$chann.iconStyle,
|
|
24
23
|
width = _useTheme$theme$chann.width,
|
|
25
24
|
grey_dark = _useTheme$theme.colors.grey_dark;
|
|
26
|
-
return
|
|
25
|
+
return _react["default"].createElement(_icons.Mute, {
|
|
27
26
|
height: height,
|
|
28
27
|
pathFill: grey_dark,
|
|
29
28
|
style: [styles.iconStyle, iconStyle],
|
|
@@ -31,10 +30,10 @@ var ChannelPreviewMutedStatus = function ChannelPreviewMutedStatus(props) {
|
|
|
31
30
|
__self: _this,
|
|
32
31
|
__source: {
|
|
33
32
|
fileName: _jsxFileName,
|
|
34
|
-
lineNumber:
|
|
33
|
+
lineNumber: 28,
|
|
35
34
|
columnNumber: 5
|
|
36
35
|
}
|
|
37
|
-
})
|
|
36
|
+
});
|
|
38
37
|
};
|
|
39
38
|
exports.ChannelPreviewMutedStatus = ChannelPreviewMutedStatus;
|
|
40
39
|
//# sourceMappingURL=ChannelPreviewMutedStatus.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_react","_interopRequireDefault","require","_reactNative","_ThemeContext","_icons","_this","_jsxFileName","styles","StyleSheet","create","iconStyle","marginRight","ChannelPreviewMutedStatus","
|
|
1
|
+
{"version":3,"names":["_react","_interopRequireDefault","require","_reactNative","_ThemeContext","_icons","_this","_jsxFileName","styles","StyleSheet","create","iconStyle","marginRight","ChannelPreviewMutedStatus","_useTheme","useTheme","_useTheme$theme","theme","_useTheme$theme$chann","channelPreview","mutedStatus","height","width","grey_dark","colors","createElement","Mute","pathFill","style","__self","__source","fileName","lineNumber","columnNumber","exports"],"sources":["ChannelPreviewMutedStatus.tsx"],"sourcesContent":["import React from 'react';\n\nimport { StyleSheet } from 'react-native';\n\nimport { useTheme } from '../../contexts/themeContext/ThemeContext';\nimport { Mute } from '../../icons';\n\nconst styles = StyleSheet.create({\n iconStyle: {\n marginRight: 8,\n },\n});\n\n/**\n * This UI component displays an avatar for a particular channel.\n */\nexport const ChannelPreviewMutedStatus = () => {\n const {\n theme: {\n channelPreview: {\n mutedStatus: { height, iconStyle, width },\n },\n colors: { grey_dark },\n },\n } = useTheme();\n\n return (\n <Mute\n height={height}\n pathFill={grey_dark}\n style={[styles.iconStyle, iconStyle]}\n width={width}\n />\n );\n};\n"],"mappings":";;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AAEA,IAAAC,YAAA,GAAAD,OAAA;AAEA,IAAAE,aAAA,GAAAF,OAAA;AACA,IAAAG,MAAA,GAAAH,OAAA;AAAmC,IAAAI,KAAA;EAAAC,YAAA;AAEnC,IAAMC,MAAM,GAAGC,uBAAU,CAACC,MAAM,CAAC;EAC/BC,SAAS,EAAE;IACTC,WAAW,EAAE;EACf;AACF,CAAC,CAAC;AAKK,IAAMC,yBAAyB,GAAG,SAA5BA,yBAAyBA,CAAA,EAAS;EAC7C,IAAAC,SAAA,GAOI,IAAAC,sBAAQ,GAAE;IAAAC,eAAA,GAAAF,SAAA,CANZG,KAAK;IAAAC,qBAAA,GAAAF,eAAA,CACHG,cAAc,CACZC,WAAW;IAAIC,MAAM,GAAAH,qBAAA,CAANG,MAAM;IAAEV,SAAS,GAAAO,qBAAA,CAATP,SAAS;IAAEW,KAAK,GAAAJ,qBAAA,CAALI,KAAK;IAE/BC,SAAS,GAAAP,eAAA,CAAnBQ,MAAM,CAAID,SAAS;EAIvB,OACEvB,MAAA,YAAAyB,aAAA,CAACpB,MAAA,CAAAqB,IAAI;IACHL,MAAM,EAAEA,MAAO;IACfM,QAAQ,EAAEJ,SAAU;IACpBK,KAAK,EAAE,CAACpB,MAAM,CAACG,SAAS,EAAEA,SAAS,CAAE;IACrCW,KAAK,EAAEA,KAAM;IAAAO,MAAA,EAAAvB,KAAA;IAAAwB,QAAA;MAAAC,QAAA,EAAAxB,YAAA;MAAAyB,UAAA;MAAAC,YAAA;IAAA;EAAA,EACb;AAEN,CAAC;AAACC,OAAA,CAAArB,yBAAA,GAAAA,yBAAA"}
|
|
@@ -23,7 +23,7 @@ var ChannelsProvider = function ChannelsProvider(_ref) {
|
|
|
23
23
|
__self: _this,
|
|
24
24
|
__source: {
|
|
25
25
|
fileName: _jsxFileName,
|
|
26
|
-
lineNumber:
|
|
26
|
+
lineNumber: 223,
|
|
27
27
|
columnNumber: 3
|
|
28
28
|
}
|
|
29
29
|
}, children);
|
|
@@ -44,7 +44,7 @@ var withChannelsContext = function withChannelsContext(Component) {
|
|
|
44
44
|
__self: _this,
|
|
45
45
|
__source: {
|
|
46
46
|
fileName: _jsxFileName,
|
|
47
|
-
lineNumber:
|
|
47
|
+
lineNumber: 259,
|
|
48
48
|
columnNumber: 12
|
|
49
49
|
}
|
|
50
50
|
}));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_react","_interopRequireWildcard","require","_defaultBaseContextValue","_getDisplayName","_isTestEnvironment","_this","_jsxFileName","_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","obj","__esModule","_typeof","cache","has","get","newObj","hasPropertyDescriptor","Object","defineProperty","getOwnPropertyDescriptor","key","prototype","hasOwnProperty","call","desc","set","ChannelsContext","React","createContext","DEFAULT_BASE_CONTEXT_VALUE","exports","ChannelsProvider","_ref","children","value","createElement","Provider","__self","__source","fileName","lineNumber","columnNumber","useChannelsContext","contextValue","useContext","isTestEnvironment","Error","withChannelsContext","Component","WithChannelsContextComponent","props","channelsContext","_extends2","displayName","getDisplayName"],"sources":["ChannelsContext.tsx"],"sourcesContent":["import React, { PropsWithChildren, useContext } from 'react';\n\nimport type { FlatListProps } from 'react-native';\nimport type { FlatList } from 'react-native-gesture-handler';\n\nimport type { ChannelPreviewMutedStatusProps } from 'src/components/ChannelPreview/ChannelPreviewMutedStatus';\n\nimport type { Channel } from 'stream-chat';\n\nimport type { HeaderErrorProps } from '../../components/ChannelList/ChannelListHeaderErrorIndicator';\nimport type { QueryChannels } from '../../components/ChannelList/hooks/usePaginatedChannels';\nimport type { ChannelAvatarProps } from '../../components/ChannelPreview/ChannelAvatar';\nimport type { ChannelPreviewMessageProps } from '../../components/ChannelPreview/ChannelPreviewMessage';\nimport type { ChannelPreviewMessengerProps } from '../../components/ChannelPreview/ChannelPreviewMessenger';\nimport type { ChannelPreviewStatusProps } from '../../components/ChannelPreview/ChannelPreviewStatus';\nimport type { ChannelPreviewTitleProps } from '../../components/ChannelPreview/ChannelPreviewTitle';\nimport type { ChannelPreviewUnreadCountProps } from '../../components/ChannelPreview/ChannelPreviewUnreadCount';\nimport type { EmptyStateProps } from '../../components/Indicators/EmptyStateIndicator';\nimport type { LoadingErrorProps } from '../../components/Indicators/LoadingErrorIndicator';\nimport type { LoadingProps } from '../../components/Indicators/LoadingIndicator';\nimport type { DefaultStreamChatGenerics, UnknownType } from '../../types/types';\nimport { DEFAULT_BASE_CONTEXT_VALUE } from '../utils/defaultBaseContextValue';\n\nimport { getDisplayName } from '../utils/getDisplayName';\nimport { isTestEnvironment } from '../utils/isTestEnvironment';\n\nexport type ChannelsContextValue<\n StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics,\n> = {\n /**\n * Besides the existing default behavior of the ChannelListMessenger component, you can attach\n * additional props to the underlying React Native FlatList.\n *\n * You can find list of all the available FlatList props here - https://facebook.github.io/react-native/docs/flatlist#props\n *\n * **EXAMPLE:**\n *\n * ```\n * <ChannelListMessenger\n * channels={channels}\n * additionalFlatListProps={{ bounces: true }}\n * />\n * ```\n *\n * **Note:** Don't use `additionalFlatListProps` to access the FlatList ref, use `setFlatListRef`\n */\n additionalFlatListProps: Partial<FlatListProps<Channel<StreamChatGenerics>>>;\n /**\n * Channels can be either an array of channels or a promise which resolves to an array of channels\n */\n channels: Channel<StreamChatGenerics>[] | null;\n /**\n * Custom indicator to use when channel list is empty\n *\n * Default: [EmptyStateIndicator](https://getstream.io/chat/docs/sdk/reactnative/core-components/channel/#emptystateindicator)\n * */\n EmptyStateIndicator: React.ComponentType<EmptyStateProps>;\n /**\n * Custom loading indicator to display at bottom of the list, while loading further pages\n *\n * Default: [ChannelListFooterLoadingIndicator](https://getstream.io/chat/docs/sdk/reactnative/contexts/channels-context/#footerloadingindicator)\n */\n FooterLoadingIndicator: React.ComponentType;\n /**\n * Incremental number change to force update the FlatList\n */\n forceUpdate: number;\n /**\n * Whether or not the FlatList has another page to render\n */\n hasNextPage: boolean;\n /**\n * Custom indicator to display error at top of list, if loading/pagination error occurs\n *\n * Default: [ChannelListHeaderErrorIndicator](https://getstream.io/chat/docs/sdk/reactnative/contexts/channels-context/#headererrorindicator)\n */\n HeaderErrorIndicator: React.ComponentType<HeaderErrorProps>;\n /**\n * Custom indicator to display network-down error at top of list, if there is connectivity issue\n *\n * Default: [ChannelListHeaderNetworkDownIndicator](https://getstream.io/chat/docs/sdk/reactnative/contexts/channels-context/#headernetworkdownindicator)\n */\n HeaderNetworkDownIndicator: React.ComponentType;\n /**\n * Initial channels query loading state, triggers the LoadingIndicator\n */\n loadingChannels: boolean;\n /**\n * Custom indicator to use when there is error in fetching channels\n *\n * Default: [LoadingErrorIndicator](https://getstream.io/chat/docs/sdk/reactnative/contexts/channels-context/#loadingerrorindicator)\n * */\n LoadingErrorIndicator: React.ComponentType<LoadingErrorProps>;\n /**\n * Custom loading indicator to use on Channel List\n *\n * */\n LoadingIndicator: React.ComponentType<Pick<LoadingProps, 'listType'>>;\n /**\n * Whether or not additional channels are being loaded, triggers the FooterLoadingIndicator\n */\n loadingNextPage: boolean;\n /**\n * The React Native FlatList threshold to fetch more data\n * @see See loadMoreThreshold [doc](https://facebook.github.io/react-native/docs/flatlist#onendreachedthreshold)\n * */\n loadMoreThreshold: number;\n /**\n * Loads the next page of `channels`, which is present as a required prop\n */\n loadNextPage: QueryChannels;\n /**\n * Max number to display within notification badge. Default: 255 and it cannot be higher than that for now due to backend limitations\n */\n maxUnreadCount: number;\n /**\n * Number of skeletons that should show when loading. Default: 6\n */\n numberOfSkeletons: number;\n /**\n * Custom UI component to display individual channel list items\n *\n * Default: [ChannelPreviewMessenger](https://getstream.io/chat/docs/sdk/reactnative/ui-components/channel-preview-messenger/)\n */\n Preview: React.ComponentType<ChannelPreviewMessengerProps<StreamChatGenerics>>;\n /**\n * Triggered when the channel list is refreshing, displays a loading spinner at the top of the list\n */\n refreshing: boolean;\n /**\n * Function to refresh the channel list that is similar to `reloadList`, but it doesn't wipe out existing channels\n * from UI before loading the new ones\n */\n refreshList: () => void | Promise<void>;\n /**\n * Removes all the existing channels from UI and loads fresh channels\n * */\n reloadList: () => Promise<void>;\n // /**\n // * Function to set the currently active channel, acts as a bridge between ChannelList and Channel components\n // *\n // * @param channel A channel object\n // */\n // setActiveChannel?: (channel: Channel<StreamChatGenerics>) => void;\n /**\n * Function to gain access to the inner FlatList ref\n *\n * **Example:**\n *\n * ```\n * <ChannelListMessenger\n * setFlatListRef={(ref) => {\n * // Use ref for your own good\n * }}\n * ```\n */\n setFlatListRef: (ref: FlatList<Channel<StreamChatGenerics>> | null) => void;\n /**\n * Custom UI component to display loading channel skeletons\n *\n * Default: [Skeleton](https://getstream.io/chat/docs/sdk/reactnative/contexts/channels-context/#skeleton)\n */\n Skeleton: React.ComponentType;\n /**\n * Error in channels query, if any\n */\n error?: Error;\n ListHeaderComponent?: React.ComponentType;\n /**\n * Function to set the currently active channel, acts as a bridge between ChannelList and Channel components\n *\n * @param channel A channel object\n */\n onSelect?: (channel: Channel<StreamChatGenerics>) => void;\n /**\n * Custom UI component to render preview avatar.\n *\n * **Default** [ChannelAvatar](https://github.com/GetStream/stream-chat-react-native/blob/main/package/src/components/ChannelPreview/ChannelAvatar.tsx)\n */\n PreviewAvatar?: React.ComponentType<ChannelAvatarProps<StreamChatGenerics>>;\n /**\n * Custom UI component to render preview of latest message on channel.\n *\n * **Default** [ChannelPreviewMessage](https://github.com/GetStream/stream-chat-react-native/blob/main/package/src/components/ChannelPreview/ChannelPreviewMessage.tsx)\n */\n PreviewMessage?: React.ComponentType<ChannelPreviewMessageProps<StreamChatGenerics>>;\n /**\n * Custom UI component to render muted status.\n *\n * **Default** [ChannelMutedStatus](https://github.com/GetStream/stream-chat-react-native/blob/main/package/src/components/ChannelPreview/ChannelPreviewMutedStatus.tsx)\n */\n PreviewMutedStatus?: React.ComponentType<ChannelPreviewMutedStatusProps<StreamChatGenerics>>;\n /**\n * Custom UI component to render preview avatar.\n *\n * **Default** [ChannelPreviewStatus](https://github.com/GetStream/stream-chat-react-native/blob/main/package/src/components/ChannelPreview/ChannelPreviewStatus.tsx)\n */\n PreviewStatus?: React.ComponentType<ChannelPreviewStatusProps<StreamChatGenerics>>;\n /**\n * Custom UI component to render preview avatar.\n *\n * **Default** [ChannelPreviewTitle](https://github.com/GetStream/stream-chat-react-native/blob/main/package/src/components/ChannelPreview/ChannelPreviewTitle.tsx)\n */\n PreviewTitle?: React.ComponentType<ChannelPreviewTitleProps<StreamChatGenerics>>;\n /**\n * Custom UI component to render preview avatar.\n *\n * **Default** [ChannelPreviewUnreadCount](https://github.com/GetStream/stream-chat-react-native/blob/main/package/src/components/ChannelPreview/ChannelPreviewUnreadCount.tsx)\n */\n PreviewUnreadCount?: React.ComponentType<ChannelPreviewUnreadCountProps<StreamChatGenerics>>;\n};\n\nexport const ChannelsContext = React.createContext(\n DEFAULT_BASE_CONTEXT_VALUE as ChannelsContextValue,\n);\n\nexport const ChannelsProvider = <\n StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics,\n>({\n children,\n value,\n}: PropsWithChildren<{\n value: ChannelsContextValue<StreamChatGenerics>;\n}>) => (\n <ChannelsContext.Provider value={value as unknown as ChannelsContextValue}>\n {children}\n </ChannelsContext.Provider>\n);\n\nexport const useChannelsContext = <\n StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics,\n>() => {\n const contextValue = useContext(\n ChannelsContext,\n ) as unknown as ChannelsContextValue<StreamChatGenerics>;\n\n if (contextValue === DEFAULT_BASE_CONTEXT_VALUE && !isTestEnvironment()) {\n throw new Error(\n `The useChannelsContext hook was called outside of the ChannelsContext provider. Make sure you have configured ChannelList component correctly - https://getstream.io/chat/docs/sdk/reactnative/basics/hello_stream_chat/#channel-list`,\n );\n }\n\n return contextValue;\n};\n/**\n * Typescript currently does not support partial inference so if ChatContext\n * typing is desired while using the HOC withChannelContext the Props for the\n * wrapped component must be provided as the first generic.\n */\nexport const withChannelsContext = <\n P extends UnknownType,\n StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics,\n>(\n Component: React.ComponentType<P>,\n): React.FC<Omit<P, keyof ChannelsContextValue<StreamChatGenerics>>> => {\n const WithChannelsContextComponent = (\n props: Omit<P, keyof ChannelsContextValue<StreamChatGenerics>>,\n ) => {\n const channelsContext = useChannelsContext<StreamChatGenerics>();\n\n return <Component {...(props as P)} {...channelsContext} />;\n };\n WithChannelsContextComponent.displayName = `WithChannelsContext${getDisplayName(Component)}`;\n return WithChannelsContextComponent;\n};\n"],"mappings":";;;;;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AAqBA,IAAAC,wBAAA,GAAAD,OAAA;AAEA,IAAAE,eAAA,GAAAF,OAAA;AACA,IAAAG,kBAAA,GAAAH,OAAA;AAA+D,IAAAI,KAAA;EAAAC,YAAA;AAAA,SAAAC,yBAAAC,WAAA,eAAAC,OAAA,kCAAAC,iBAAA,OAAAD,OAAA,QAAAE,gBAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,yBAAAC,WAAA,WAAAA,WAAA,GAAAG,gBAAA,GAAAD,iBAAA,KAAAF,WAAA;AAAA,SAAAR,wBAAAY,GAAA,EAAAJ,WAAA,SAAAA,WAAA,IAAAI,GAAA,IAAAA,GAAA,CAAAC,UAAA,WAAAD,GAAA,QAAAA,GAAA,aAAAE,OAAA,CAAAF,GAAA,yBAAAA,GAAA,uCAAAA,GAAA,UAAAG,KAAA,GAAAR,wBAAA,CAAAC,WAAA,OAAAO,KAAA,IAAAA,KAAA,CAAAC,GAAA,CAAAJ,GAAA,YAAAG,KAAA,CAAAE,GAAA,CAAAL,GAAA,SAAAM,MAAA,WAAAC,qBAAA,GAAAC,MAAA,CAAAC,cAAA,IAAAD,MAAA,CAAAE,wBAAA,WAAAC,GAAA,IAAAX,GAAA,QAAAW,GAAA,kBAAAH,MAAA,CAAAI,SAAA,CAAAC,cAAA,CAAAC,IAAA,CAAAd,GAAA,EAAAW,GAAA,SAAAI,IAAA,GAAAR,qBAAA,GAAAC,MAAA,CAAAE,wBAAA,CAAAV,GAAA,EAAAW,GAAA,cAAAI,IAAA,KAAAA,IAAA,CAAA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,eAAe,GAAGT,kBAAkB,EAAsB;IAEhE,OAAO9C,MAAA,YAAAuC,aAAA,CAACa,SAAS,MAAAI,SAAA,iBAAMF,KAAK,EAAYC,eAAe;MAAAd,MAAA,EAAAnC,KAAA;MAAAoC,QAAA;QAAAC,QAAA,EAAApC,YAAA;QAAAqC,UAAA;QAAAC,YAAA;MAAA;IAAA,GAAI;EAC7D,CAAC;EACDQ,4BAA4B,CAACI,WAAW,2BAAyB,IAAAC,8BAAc,EAACN,SAAS,CAAG;EAC5F,OAAOC,4BAA4B;AACrC,CAAC;AAACnB,OAAA,CAAAiB,mBAAA,GAAAA,mBAAA"}
|
|
1
|
+
{"version":3,"names":["_react","_interopRequireWildcard","require","_defaultBaseContextValue","_getDisplayName","_isTestEnvironment","_this","_jsxFileName","_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","obj","__esModule","_typeof","cache","has","get","newObj","hasPropertyDescriptor","Object","defineProperty","getOwnPropertyDescriptor","key","prototype","hasOwnProperty","call","desc","set","ChannelsContext","React","createContext","DEFAULT_BASE_CONTEXT_VALUE","exports","ChannelsProvider","_ref","children","value","createElement","Provider","__self","__source","fileName","lineNumber","columnNumber","useChannelsContext","contextValue","useContext","isTestEnvironment","Error","withChannelsContext","Component","WithChannelsContextComponent","props","channelsContext","_extends2","displayName","getDisplayName"],"sources":["ChannelsContext.tsx"],"sourcesContent":["import React, { PropsWithChildren, useContext } from 'react';\n\nimport type { FlatListProps } from 'react-native';\nimport type { FlatList } from 'react-native-gesture-handler';\n\nimport type { Channel } from 'stream-chat';\n\nimport type { HeaderErrorProps } from '../../components/ChannelList/ChannelListHeaderErrorIndicator';\nimport type { QueryChannels } from '../../components/ChannelList/hooks/usePaginatedChannels';\nimport type { ChannelAvatarProps } from '../../components/ChannelPreview/ChannelAvatar';\nimport type { ChannelPreviewMessageProps } from '../../components/ChannelPreview/ChannelPreviewMessage';\nimport type { ChannelPreviewMessengerProps } from '../../components/ChannelPreview/ChannelPreviewMessenger';\nimport type { ChannelPreviewStatusProps } from '../../components/ChannelPreview/ChannelPreviewStatus';\nimport type { ChannelPreviewTitleProps } from '../../components/ChannelPreview/ChannelPreviewTitle';\nimport type { ChannelPreviewUnreadCountProps } from '../../components/ChannelPreview/ChannelPreviewUnreadCount';\nimport type { EmptyStateProps } from '../../components/Indicators/EmptyStateIndicator';\nimport type { LoadingErrorProps } from '../../components/Indicators/LoadingErrorIndicator';\nimport type { LoadingProps } from '../../components/Indicators/LoadingIndicator';\nimport type { DefaultStreamChatGenerics, UnknownType } from '../../types/types';\nimport { DEFAULT_BASE_CONTEXT_VALUE } from '../utils/defaultBaseContextValue';\n\nimport { getDisplayName } from '../utils/getDisplayName';\nimport { isTestEnvironment } from '../utils/isTestEnvironment';\n\nexport type ChannelsContextValue<\n StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics,\n> = {\n /**\n * Besides the existing default behavior of the ChannelListMessenger component, you can attach\n * additional props to the underlying React Native FlatList.\n *\n * You can find list of all the available FlatList props here - https://facebook.github.io/react-native/docs/flatlist#props\n *\n * **EXAMPLE:**\n *\n * ```\n * <ChannelListMessenger\n * channels={channels}\n * additionalFlatListProps={{ bounces: true }}\n * />\n * ```\n *\n * **Note:** Don't use `additionalFlatListProps` to access the FlatList ref, use `setFlatListRef`\n */\n additionalFlatListProps: Partial<FlatListProps<Channel<StreamChatGenerics>>>;\n /**\n * Channels can be either an array of channels or a promise which resolves to an array of channels\n */\n channels: Channel<StreamChatGenerics>[] | null;\n /**\n * Custom indicator to use when channel list is empty\n *\n * Default: [EmptyStateIndicator](https://getstream.io/chat/docs/sdk/reactnative/core-components/channel/#emptystateindicator)\n * */\n EmptyStateIndicator: React.ComponentType<EmptyStateProps>;\n /**\n * Custom loading indicator to display at bottom of the list, while loading further pages\n *\n * Default: [ChannelListFooterLoadingIndicator](https://getstream.io/chat/docs/sdk/reactnative/contexts/channels-context/#footerloadingindicator)\n */\n FooterLoadingIndicator: React.ComponentType;\n /**\n * Incremental number change to force update the FlatList\n */\n forceUpdate: number;\n /**\n * Whether or not the FlatList has another page to render\n */\n hasNextPage: boolean;\n /**\n * Custom indicator to display error at top of list, if loading/pagination error occurs\n *\n * Default: [ChannelListHeaderErrorIndicator](https://getstream.io/chat/docs/sdk/reactnative/contexts/channels-context/#headererrorindicator)\n */\n HeaderErrorIndicator: React.ComponentType<HeaderErrorProps>;\n /**\n * Custom indicator to display network-down error at top of list, if there is connectivity issue\n *\n * Default: [ChannelListHeaderNetworkDownIndicator](https://getstream.io/chat/docs/sdk/reactnative/contexts/channels-context/#headernetworkdownindicator)\n */\n HeaderNetworkDownIndicator: React.ComponentType;\n /**\n * Initial channels query loading state, triggers the LoadingIndicator\n */\n loadingChannels: boolean;\n /**\n * Custom indicator to use when there is error in fetching channels\n *\n * Default: [LoadingErrorIndicator](https://getstream.io/chat/docs/sdk/reactnative/contexts/channels-context/#loadingerrorindicator)\n * */\n LoadingErrorIndicator: React.ComponentType<LoadingErrorProps>;\n /**\n * Custom loading indicator to use on Channel List\n *\n * */\n LoadingIndicator: React.ComponentType<Pick<LoadingProps, 'listType'>>;\n /**\n * Whether or not additional channels are being loaded, triggers the FooterLoadingIndicator\n */\n loadingNextPage: boolean;\n /**\n * The React Native FlatList threshold to fetch more data\n * @see See loadMoreThreshold [doc](https://facebook.github.io/react-native/docs/flatlist#onendreachedthreshold)\n * */\n loadMoreThreshold: number;\n /**\n * Loads the next page of `channels`, which is present as a required prop\n */\n loadNextPage: QueryChannels;\n /**\n * Max number to display within notification badge. Default: 255 and it cannot be higher than that for now due to backend limitations\n */\n maxUnreadCount: number;\n /**\n * Number of skeletons that should show when loading. Default: 6\n */\n numberOfSkeletons: number;\n /**\n * Custom UI component to display individual channel list items\n *\n * Default: [ChannelPreviewMessenger](https://getstream.io/chat/docs/sdk/reactnative/ui-components/channel-preview-messenger/)\n */\n Preview: React.ComponentType<ChannelPreviewMessengerProps<StreamChatGenerics>>;\n /**\n * Triggered when the channel list is refreshing, displays a loading spinner at the top of the list\n */\n refreshing: boolean;\n /**\n * Function to refresh the channel list that is similar to `reloadList`, but it doesn't wipe out existing channels\n * from UI before loading the new ones\n */\n refreshList: () => void | Promise<void>;\n /**\n * Removes all the existing channels from UI and loads fresh channels\n * */\n reloadList: () => Promise<void>;\n // /**\n // * Function to set the currently active channel, acts as a bridge between ChannelList and Channel components\n // *\n // * @param channel A channel object\n // */\n // setActiveChannel?: (channel: Channel<StreamChatGenerics>) => void;\n /**\n * Function to gain access to the inner FlatList ref\n *\n * **Example:**\n *\n * ```\n * <ChannelListMessenger\n * setFlatListRef={(ref) => {\n * // Use ref for your own good\n * }}\n * ```\n */\n setFlatListRef: (ref: FlatList<Channel<StreamChatGenerics>> | null) => void;\n /**\n * Custom UI component to display loading channel skeletons\n *\n * Default: [Skeleton](https://getstream.io/chat/docs/sdk/reactnative/contexts/channels-context/#skeleton)\n */\n Skeleton: React.ComponentType;\n /**\n * Error in channels query, if any\n */\n error?: Error;\n ListHeaderComponent?: React.ComponentType;\n /**\n * Function to set the currently active channel, acts as a bridge between ChannelList and Channel components\n *\n * @param channel A channel object\n */\n onSelect?: (channel: Channel<StreamChatGenerics>) => void;\n /**\n * Custom UI component to render preview avatar.\n *\n * **Default** [ChannelAvatar](https://github.com/GetStream/stream-chat-react-native/blob/main/package/src/components/ChannelPreview/ChannelAvatar.tsx)\n */\n PreviewAvatar?: React.ComponentType<ChannelAvatarProps<StreamChatGenerics>>;\n /**\n * Custom UI component to render preview of latest message on channel.\n *\n * **Default** [ChannelPreviewMessage](https://github.com/GetStream/stream-chat-react-native/blob/main/package/src/components/ChannelPreview/ChannelPreviewMessage.tsx)\n */\n PreviewMessage?: React.ComponentType<ChannelPreviewMessageProps<StreamChatGenerics>>;\n /**\n * Custom UI component to render muted status.\n *\n * **Default** [ChannelMutedStatus](https://github.com/GetStream/stream-chat-react-native/blob/main/package/src/components/ChannelPreview/ChannelPreviewMutedStatus.tsx)\n */\n PreviewMutedStatus?: React.ComponentType;\n /**\n * Custom UI component to render preview avatar.\n *\n * **Default** [ChannelPreviewStatus](https://github.com/GetStream/stream-chat-react-native/blob/main/package/src/components/ChannelPreview/ChannelPreviewStatus.tsx)\n */\n PreviewStatus?: React.ComponentType<ChannelPreviewStatusProps<StreamChatGenerics>>;\n /**\n * Custom UI component to render preview avatar.\n *\n * **Default** [ChannelPreviewTitle](https://github.com/GetStream/stream-chat-react-native/blob/main/package/src/components/ChannelPreview/ChannelPreviewTitle.tsx)\n */\n PreviewTitle?: React.ComponentType<ChannelPreviewTitleProps<StreamChatGenerics>>;\n /**\n * Custom UI component to render preview avatar.\n *\n * **Default** [ChannelPreviewUnreadCount](https://github.com/GetStream/stream-chat-react-native/blob/main/package/src/components/ChannelPreview/ChannelPreviewUnreadCount.tsx)\n */\n PreviewUnreadCount?: React.ComponentType<ChannelPreviewUnreadCountProps<StreamChatGenerics>>;\n};\n\nexport const ChannelsContext = React.createContext(\n DEFAULT_BASE_CONTEXT_VALUE as ChannelsContextValue,\n);\n\nexport const ChannelsProvider = <\n StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics,\n>({\n children,\n value,\n}: PropsWithChildren<{\n value: ChannelsContextValue<StreamChatGenerics>;\n}>) => (\n <ChannelsContext.Provider value={value as unknown as ChannelsContextValue}>\n {children}\n </ChannelsContext.Provider>\n);\n\nexport const useChannelsContext = <\n StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics,\n>() => {\n const contextValue = useContext(\n ChannelsContext,\n ) as unknown as ChannelsContextValue<StreamChatGenerics>;\n\n if (contextValue === DEFAULT_BASE_CONTEXT_VALUE && !isTestEnvironment()) {\n throw new Error(\n `The useChannelsContext hook was called outside of the ChannelsContext provider. Make sure you have configured ChannelList component correctly - https://getstream.io/chat/docs/sdk/reactnative/basics/hello_stream_chat/#channel-list`,\n );\n }\n\n return contextValue;\n};\n/**\n * Typescript currently does not support partial inference so if ChatContext\n * typing is desired while using the HOC withChannelContext the Props for the\n * wrapped component must be provided as the first generic.\n */\nexport const withChannelsContext = <\n P extends UnknownType,\n StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics,\n>(\n Component: React.ComponentType<P>,\n): React.FC<Omit<P, keyof ChannelsContextValue<StreamChatGenerics>>> => {\n const WithChannelsContextComponent = (\n props: Omit<P, keyof ChannelsContextValue<StreamChatGenerics>>,\n ) => {\n const channelsContext = useChannelsContext<StreamChatGenerics>();\n\n return <Component {...(props as P)} {...channelsContext} />;\n };\n WithChannelsContextComponent.displayName = `WithChannelsContext${getDisplayName(Component)}`;\n return WithChannelsContextComponent;\n};\n"],"mappings":";;;;;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AAmBA,IAAAC,wBAAA,GAAAD,OAAA;AAEA,IAAAE,eAAA,GAAAF,OAAA;AACA,IAAAG,kBAAA,GAAAH,OAAA;AAA+D,IAAAI,KAAA;EAAAC,YAAA;AAAA,SAAAC,yBAAAC,WAAA,eAAAC,OAAA,kCAAAC,iBAAA,OAAAD,OAAA,QAAAE,gBAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,yBAAAC,WAAA,WAAAA,WAAA,GAAAG,gBAAA,GAAAD,iBAAA,KAAAF,WAAA;AAAA,SAAAR,wBAAAY,GAAA,EAAAJ,WAAA,SAAAA,WAAA,IAAAI,GAAA,IAAAA,GAAA,CAAAC,UAAA,WAAAD,GAAA,QAAAA,GAAA,aAAAE,OAAA,CAAAF,GAAA,yBAAAA,GAAA,uCAAAA,GAAA,UAAAG,KAAA,GAAAR,wBAAA,CAAAC,WAAA,OAAAO,KAAA,IAAAA,KAAA,CAAAC,GAAA,CAAAJ,GAAA,YAAAG,KAAA,CAAAE,GAAA,CAAAL,GAAA,SAAAM,MAAA,WAAAC,qBAAA,GAAAC,MAAA,CAAAC,cAAA,IAAAD,MAAA,CAAAE,wBAAA,WAAAC,GAAA,IAAAX,GAAA,QAAAW,GAAA,kBAAAH,MAAA,CAAAI,SAA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,kBAAA,GAAAA,kBAAA;AAMK,IAAMK,mBAAmB,GAAG,SAAtBA,mBAAmBA,CAI9BC,SAAiC,EACqC;EACtE,IAAMC,4BAA4B,GAAG,SAA/BA,4BAA4BA,CAChCC,KAA8D,EAC3D;IACH,IAAMC,eAAe,GAAGT,kBAAkB,EAAsB;IAEhE,OAAO9C,MAAA,YAAAuC,aAAA,CAACa,SAAS,MAAAI,SAAA,iBAAMF,KAAK,EAAYC,eAAe;MAAAd,MAAA,EAAAnC,KAAA;MAAAoC,QAAA;QAAAC,QAAA,EAAApC,YAAA;QAAAqC,UAAA;QAAAC,YAAA;MAAA;IAAA,GAAI;EAC7D,CAAC;EACDQ,4BAA4B,CAACI,WAAW,2BAAyB,IAAAC,8BAAc,EAACN,SAAS,CAAG;EAC5F,OAAOC,4BAA4B;AACrC,CAAC;AAACnB,OAAA,CAAAiB,mBAAA,GAAAA,mBAAA"}
|
|
@@ -83,6 +83,7 @@ var ChannelList = function ChannelList(props) {
|
|
|
83
83
|
Preview = _props$Preview === void 0 ? _ChannelPreviewMessenger.ChannelPreviewMessenger : _props$Preview,
|
|
84
84
|
PreviewAvatar = props.PreviewAvatar,
|
|
85
85
|
PreviewMessage = props.PreviewMessage,
|
|
86
|
+
PreviewMutedStatus = props.PreviewMutedStatus,
|
|
86
87
|
PreviewStatus = props.PreviewStatus,
|
|
87
88
|
PreviewTitle = props.PreviewTitle,
|
|
88
89
|
PreviewUnreadCount = props.PreviewUnreadCount,
|
|
@@ -196,6 +197,7 @@ var ChannelList = function ChannelList(props) {
|
|
|
196
197
|
Preview: Preview,
|
|
197
198
|
PreviewAvatar: PreviewAvatar,
|
|
198
199
|
PreviewMessage: PreviewMessage,
|
|
200
|
+
PreviewMutedStatus: PreviewMutedStatus,
|
|
199
201
|
PreviewStatus: PreviewStatus,
|
|
200
202
|
PreviewTitle: PreviewTitle,
|
|
201
203
|
PreviewUnreadCount: PreviewUnreadCount,
|
|
@@ -214,14 +216,14 @@ var ChannelList = function ChannelList(props) {
|
|
|
214
216
|
__self: _this,
|
|
215
217
|
__source: {
|
|
216
218
|
fileName: _jsxFileName,
|
|
217
|
-
lineNumber:
|
|
219
|
+
lineNumber: 412,
|
|
218
220
|
columnNumber: 5
|
|
219
221
|
}
|
|
220
222
|
}, _react["default"].createElement(List, {
|
|
221
223
|
__self: _this,
|
|
222
224
|
__source: {
|
|
223
225
|
fileName: _jsxFileName,
|
|
224
|
-
lineNumber:
|
|
226
|
+
lineNumber: 413,
|
|
225
227
|
columnNumber: 7
|
|
226
228
|
}
|
|
227
229
|
}));
|