Skip to content

Commit c8b8b71

Browse files
feat: v8 (#3137)
* feat!: add text composer and poll composer integration to the message input (#3085) * chore: modify gh workflows * feat: removal of StreamChatGenerics (#2993) * feat: remove StreamChatGenerics and introduce interface merging * fix: some of the outstanding todos * chore: add default interfaces * chore: remove SCG from sample app * fix: remove redundant types * fix: remove type module * fix: change the way interface declaration is consumed * fix: ignore ts complaints for interface declaration * chore: migrate TypescriptMessagingApp away from SCG * chore: migrate the Expo sample app away from SCG * fix: commit missing files * fix: revert mistaken change * fix: add resolutions for symlinked libs * chore: remove support for react-native-document-picker (#3000) * BREAKING CHANGE: V7 release candidate * chore: add rc channel * fix: typo in branch name * feat: trigger breaking change for v7 (#3005) BREAKING CHANGE: Release V7 * chore: remove dryRun * chore: bump stream-chat version to latest rc * chore: bump stream-chat to latest * feat: introduce expo-video support (#3010) * feat: introduce support for expo-video * fix: remove redundant test * fix: add check for audio component * fix: lint issues * fix: different types inference with latest stream-chat changes * chore(deps): update sample apps too * fix: remove generics from new hook * fix: remove remnants from SCG and fix missing types * fix: lint issues * fix: replace TouchableOpacity with Pressable * fix: move to RN TouchableOpacity instead * chore(deps): update peer deps * chore: remove unused hooks * chore: remove deps scope * fix: all instances of FormatMessageResponse in respect to the new llc changes * chore: ref branch specifically * fix: try clearing cache * fix: remove cache clean * fix: remove console.log * fix: use latest commit * fix: use latest rc of llc * chore: use specific commit again * fix: SCG remnants from merge * fix: lint issues * fix: lint issues * fix: unify file and image types (#3050) * fix: unify file and image types * fix: refine types * fix: remove props from auto complete input * chore: update deps * fix: failing tests and AutoCompleteInput type * chore: update custom data module interfaces * fix: change RNFile to FileReference as per latest client changes (#3061) * fix: merge conflicts * fix: remove MessageType type from the SDK * fix: resolve conflicts from V7 branch * fix: broken tests * fix: useMessageActions remove reserved fields logic * revert: useMessageActions change * fix: confine readBy data to Message Status component * fix: change date separator and group styles to ref * fix: add app changes * feat: use new text composer for RN SDK * fix: bump stream-chat to latest rc * chore: bump stream-chat version to latest rc again * fix: thread messages state not updating properly * chore: change type to inferred one * fix: set correct core lib versions * chore: bump stream-chat to latest rc again * chore: update sample app yarn.locks as well * fix: refine the implementation * fix: add useCallback * fix: keyboard taking full screen issue when the prefer cross-fade transition setting is enabled (#3073) * fix: respect the hasCommand channel prop as well * fix: keybaord taking full screen issue when the prefer cross-fade transition setting is enabled (#3072) * fix: keybaord taking full screen issue when the prefer cross-fade transition setting is enabled * chore: bump stream-chat-js rc again * chore: full reinstall after merge from develop * fix: add back mistakenly removed mime dep * feat: add poll composer * feat: add emoji middleware and make text input better * fix: add channel command middleware * fix: add channel command middleware * fix: remove unused values from message input context * fix: remove unused values from message input context * fix: code clean up * fix: point out a bug with the ban user command * fix: added option reordering fix * fix: improve the emoji and command middleware and cleanup * fix: quoted message state using the message composer * fix: improve poll composer integration * fix: reduce prop surface area from auto complete input * fix: tests * fix: poll composer crash bug * fix: change emoji middleware name * chore: remove workflow changes * fix: auto complete input changes * refactor: add improvements * refactor: add poll changes * fix: add back react memo * fix: input buttons hasText optimization * fix: commands button hastext optimization * fix: create poll options useEffect --------- Co-authored-by: Ivan Sekovanikj <[email protected]> Co-authored-by: Ivan Sekovanikj <[email protected]> * feat!: message composer attachment manager integration and improve send flow (#3093) * chore: modify gh workflows * feat: removal of StreamChatGenerics (#2993) * feat: remove StreamChatGenerics and introduce interface merging * fix: some of the outstanding todos * chore: add default interfaces * chore: remove SCG from sample app * fix: remove redundant types * fix: remove type module * fix: change the way interface declaration is consumed * fix: ignore ts complaints for interface declaration * chore: migrate TypescriptMessagingApp away from SCG * chore: migrate the Expo sample app away from SCG * fix: commit missing files * fix: revert mistaken change * fix: add resolutions for symlinked libs * chore: remove support for react-native-document-picker (#3000) * BREAKING CHANGE: V7 release candidate * chore: add rc channel * fix: typo in branch name * feat: trigger breaking change for v7 (#3005) BREAKING CHANGE: Release V7 * chore: remove dryRun * chore: bump stream-chat version to latest rc * chore: bump stream-chat to latest * feat: introduce expo-video support (#3010) * feat: introduce support for expo-video * fix: remove redundant test * fix: add check for audio component * fix: lint issues * fix: different types inference with latest stream-chat changes * chore(deps): update sample apps too * fix: remove generics from new hook * fix: remove remnants from SCG and fix missing types * fix: lint issues * fix: replace TouchableOpacity with Pressable * fix: move to RN TouchableOpacity instead * chore(deps): update peer deps * chore: remove unused hooks * chore: remove deps scope * fix: all instances of FormatMessageResponse in respect to the new llc changes * chore: ref branch specifically * fix: try clearing cache * fix: remove cache clean * fix: remove console.log * fix: use latest commit * fix: use latest rc of llc * chore: use specific commit again * fix: SCG remnants from merge * fix: lint issues * fix: lint issues * fix: unify file and image types (#3050) * fix: unify file and image types * fix: refine types * fix: remove props from auto complete input * chore: update deps * fix: failing tests and AutoCompleteInput type * chore: update custom data module interfaces * fix: change RNFile to FileReference as per latest client changes (#3061) * fix: merge conflicts * fix: remove MessageType type from the SDK * fix: resolve conflicts from V7 branch * fix: broken tests * fix: useMessageActions remove reserved fields logic * revert: useMessageActions change * fix: confine readBy data to Message Status component * fix: change date separator and group styles to ref * fix: add app changes * feat: use new text composer for RN SDK * fix: bump stream-chat to latest rc * chore: bump stream-chat version to latest rc again * fix: thread messages state not updating properly * chore: change type to inferred one * fix: set correct core lib versions * chore: bump stream-chat to latest rc again * chore: update sample app yarn.locks as well * fix: refine the implementation * fix: add useCallback * fix: keyboard taking full screen issue when the prefer cross-fade transition setting is enabled (#3073) * fix: respect the hasCommand channel prop as well * fix: keybaord taking full screen issue when the prefer cross-fade transition setting is enabled (#3072) * fix: keybaord taking full screen issue when the prefer cross-fade transition setting is enabled * chore: bump stream-chat-js rc again * chore: full reinstall after merge from develop * fix: add back mistakenly removed mime dep * feat: add poll composer * feat: add emoji middleware and make text input better * fix: add channel command middleware * fix: add channel command middleware * fix: remove unused values from message input context * fix: remove unused values from message input context * fix: code clean up * fix: point out a bug with the ban user command * fix: added option reordering fix * fix: improve the emoji and command middleware and cleanup * fix: quoted message state using the message composer * fix: improve poll composer integration * fix: reduce prop surface area from auto complete input * fix: tests * feat: add integration for attachment manager * fix: yarn.lock update * fix: poll composer crash bug * fix: change emoji middleware name * chore: remove workflow changes * feat: move attachment picker context to Channel wrapper and handle only bottom sheet stuff in it * fix: add app refactor * fix: add app refactor * fix: auto complete input changes * refactor: add improvements * refactor: add poll changes * fix: add back react memo * fix: input buttons hasText optimization * fix: improve upload preview components * fix: improve upload preview components * fix: audio attachment issues * chore: resolve conflicts * fix: sync up changes * fix: sync up changes * fix: commands button hastext optimization * fix: create poll options useEffect * fix: comment * fix: default values * fix: try out picker in channel * fix: attachment picker component usage * fix: cleanup for the attachment manager * fix: input button hasText bug * fix: file unsupported types * fix: style for upload unsupported indicator * fix: improve upload new file * fix: send button and audiorecordingbutton re-renders * fix: send button and audiorecordingbutton re-renders * revert: the memo change * fix: remove profiler code * fix: optimize send button performance * fix: type export from audio recording button * fix: iLocalUri utility * fix: update yarn lock * fix: attachment send while offline support is enabled * fix: make sending flow faster and bug free and fix bug with cooldown * fix: edited message usage * fix: attachments draft middleware * fix: make command control middleware better * fix: use text composer for command handling * tests: add tests * tests: add tests * fix: remove thread from MessageInput * perf: messages rerendering on every composer change * perf: remove editing state from channel ctx and add composer ctx * fix: double editing issue * fix: introduce hasText * fix: quoted message edited update bug * fix: quoted message edited update bug * fix: close poll modal before send to avoid reset on the UI * fix: selected picker bug * fix: memoize the photos * fix: performance issue with quoted message checks * fix: further optimize memo checks * perf: separate composer ctxs and optimize usage (#3112) * perf: abstract away composer api and usage * fix: remove props inport and remove comments --------- Co-authored-by: Khushal Agarwal <[email protected]> * fix: change how message composer config is set * perf: make attachbutton better * fix: poll option animation breaking (#3115) * fix: poll option animation breaking * fix: add container animation * chore: remove console.log * fix: revert not needed prop drilling * fix: use draft attachments middlware * fix: image upload preview loading indicator * tests: add tests setup * tests: add tests setup * tests: add more tests * perf: improve the input buttons and command input perf * fix: sample app channel header component perf * fix: remove isCommandUIEnabled from channel context * chore: temporarily comment out commands feature * chore: bump stream-chat to latest * chore: comment out setting up middleware again * fix: send button visibility when async audio off and fixed few tests --------- Co-authored-by: Ivan Sekovanikj <[email protected]> Co-authored-by: Ivan Sekovanikj <[email protected]> * chore: update lock files * fix: check the send link capability before sending message (#3116) * fix: check the send link capability before sending message * fix: formatting * fix: poll creation and optimistic updates (#3117) * fix: poll creation and optimistic updates * fix: multi poll sending edge case * fix: improve command button usage * test: fix more tests and remove isValidMessage tests as its already handled on LLC * fix: remove redundant styles from image upload preview * feat: draft message (#3114) * chore: modify gh workflows * feat: removal of StreamChatGenerics (#2993) * feat: remove StreamChatGenerics and introduce interface merging * fix: some of the outstanding todos * chore: add default interfaces * chore: remove SCG from sample app * fix: remove redundant types * fix: remove type module * fix: change the way interface declaration is consumed * fix: ignore ts complaints for interface declaration * chore: migrate TypescriptMessagingApp away from SCG * chore: migrate the Expo sample app away from SCG * fix: commit missing files * fix: revert mistaken change * fix: add resolutions for symlinked libs * chore: remove support for react-native-document-picker (#3000) * BREAKING CHANGE: V7 release candidate * chore: add rc channel * fix: typo in branch name * feat: trigger breaking change for v7 (#3005) BREAKING CHANGE: Release V7 * chore: remove dryRun * chore: bump stream-chat version to latest rc * chore: bump stream-chat to latest * feat: introduce expo-video support (#3010) * feat: introduce support for expo-video * fix: remove redundant test * fix: add check for audio component * fix: lint issues * fix: different types inference with latest stream-chat changes * chore(deps): update sample apps too * fix: remove generics from new hook * fix: remove remnants from SCG and fix missing types * fix: lint issues * fix: replace TouchableOpacity with Pressable * fix: move to RN TouchableOpacity instead * chore(deps): update peer deps * chore: remove unused hooks * chore: remove deps scope * fix: all instances of FormatMessageResponse in respect to the new llc changes * chore: ref branch specifically * fix: try clearing cache * fix: remove cache clean * fix: remove console.log * fix: use latest commit * fix: use latest rc of llc * chore: use specific commit again * fix: SCG remnants from merge * fix: lint issues * fix: lint issues * fix: unify file and image types (#3050) * fix: unify file and image types * fix: refine types * fix: remove props from auto complete input * chore: update deps * fix: failing tests and AutoCompleteInput type * chore: update custom data module interfaces * fix: change RNFile to FileReference as per latest client changes (#3061) * fix: merge conflicts * fix: remove MessageType type from the SDK * fix: resolve conflicts from V7 branch * fix: broken tests * fix: useMessageActions remove reserved fields logic * revert: useMessageActions change * fix: confine readBy data to Message Status component * fix: change date separator and group styles to ref * fix: add app changes * feat: use new text composer for RN SDK * fix: bump stream-chat to latest rc * chore: bump stream-chat version to latest rc again * fix: thread messages state not updating properly * chore: change type to inferred one * fix: set correct core lib versions * chore: bump stream-chat to latest rc again * chore: update sample app yarn.locks as well * fix: refine the implementation * fix: add useCallback * fix: keyboard taking full screen issue when the prefer cross-fade transition setting is enabled (#3073) * fix: respect the hasCommand channel prop as well * fix: keybaord taking full screen issue when the prefer cross-fade transition setting is enabled (#3072) * fix: keybaord taking full screen issue when the prefer cross-fade transition setting is enabled * chore: bump stream-chat-js rc again * chore: full reinstall after merge from develop * fix: add back mistakenly removed mime dep * feat: add poll composer * feat: add emoji middleware and make text input better * fix: add channel command middleware * fix: add channel command middleware * fix: remove unused values from message input context * fix: remove unused values from message input context * fix: code clean up * fix: point out a bug with the ban user command * fix: added option reordering fix * fix: improve the emoji and command middleware and cleanup * fix: quoted message state using the message composer * fix: improve poll composer integration * fix: reduce prop surface area from auto complete input * fix: tests * feat: add integration for attachment manager * fix: yarn.lock update * fix: poll composer crash bug * fix: change emoji middleware name * chore: remove workflow changes * feat: move attachment picker context to Channel wrapper and handle only bottom sheet stuff in it * fix: add app refactor * fix: add app refactor * fix: auto complete input changes * refactor: add improvements * refactor: add poll changes * fix: add back react memo * fix: input buttons hasText optimization * fix: improve upload preview components * fix: improve upload preview components * fix: audio attachment issues * chore: resolve conflicts * fix: sync up changes * fix: sync up changes * fix: commands button hastext optimization * fix: create poll options useEffect * fix: comment * fix: default values * fix: try out picker in channel * fix: attachment picker component usage * fix: cleanup for the attachment manager * fix: input button hasText bug * fix: file unsupported types * fix: style for upload unsupported indicator * fix: improve upload new file * fix: send button and audiorecordingbutton re-renders * fix: send button and audiorecordingbutton re-renders * revert: the memo change * fix: remove profiler code * fix: optimize send button performance * fix: type export from audio recording button * fix: iLocalUri utility * fix: update yarn lock * fix: attachment send while offline support is enabled * fix: make sending flow faster and bug free and fix bug with cooldown * fix: edited message usage * fix: attachments draft middleware * fix: make command control middleware better * fix: use text composer for command handling * feat: add support for draft message * fix: draft config * feat: add offline support for draft messages * fix: getDraft bug and add draft support for thread list * fix: set draft config from app * fix: thread list listen to messagecomposer events * fix: drafts issue * fix: add test id * tests: add tests * tests: add tests * tests: add tests * fix: remove thread from MessageInput * perf: messages rerendering on every composer change * perf: remove editing state from channel ctx and add composer ctx * fix: double editing issue * fix: introduce hasText * fix: quoted message edited update bug * fix: quoted message edited update bug * fix: close poll modal before send to avoid reset on the UI * fix: selected picker bug * fix: memoize the photos * fix: performance issue with quoted message checks * fix: further optimize memo checks * feat: add draftscreen to sample app * perf: separate composer ctxs and optimize usage (#3112) * perf: abstract away composer api and usage * fix: remove props inport and remove comments --------- Co-authored-by: Khushal Agarwal <[email protected]> * fix: usage of global config * fix: usage of global config * fix: change how message composer config is set * fix: application of global config in sample app * perf: make attachbutton better * fix: editing usage * fix: drafts messages in channel without parent id * fix: unify the message preview component to channel preview and thread list item * fix: add message preview to draft list * fix: poll option animation breaking (#3115) * fix: poll option animation breaking * fix: add container animation * chore: remove console.log * fix: revert not needed prop drilling * fix: improve draft manager * fix: improve draft manager * fix: remove parent_id prop * fix: use draft attachments middlware * fix: image upload preview loading indicator * tests: add tests setup * tests: add tests setup * tests: add more tests * perf: improve the input buttons and command input perf * fix: sample app channel header component perf * fix: remove isCommandUIEnabled from channel context * chore: update yarn lock and pod file * fix: improve uselatestmessagepreview * fix: adjust theme changes * refactor: introduce selectDraftMessageFromDraft * fix: getDraft endpoint return value * fix: register subscriptions when the thread var change * chore: update yarn lock files * revert: thread dep change * fix: handle only draft events in channel preview and thread list item * fix: delete draft message when new created * fix: guard from parent id * fix: get drafts with parent message and cid * fix: remove console logs * fix: drafts state and offline support quirks * fix: offline mode drafts and jsi quirks * fix: thread draft bugs, thread draft pending tasks, schema and mapping * fix: rename type to threadId for clarity --------- Co-authored-by: Ivan Sekovanikj <[email protected]> Co-authored-by: Ivan Sekovanikj <[email protected]> * fix: use composer for show thread message in channel checkbox (#3122) * fix: use composer for show thread message in channel checkbox * fix: how threadList prop is passed * test: add test for message input context and few other components/utils (#3121) * test: add test for message input context and few other components/utils * fix: lint issues * chore: update podlock file * test: fix more broken tests * fix: tests * fix: more tests * fix: sync issue * fix: final broken test * fix: remove unused props from message input * fix: remove unused props from message input * fix: openFilePicker removal and fix show more options * chore: setup v8 rc candidate and workflows (#3127) * chore: setup v8 rc candidate and workflows * chore: setup v8 rc candidate and workflows * feat: handle command injection on the sdk (#3124) * feat: handle command injection through middleware * chore: update pod lock file * chore: update yarn lock files * fix: use middleware from LLC * fix: remove isCommandUIEnabled prop * fix: add back refactor * fix: add setup command middleware for sample app * chore: update podlock file * fix: remove redundant text selector * chore: update yarn lock and podfile lock * fix: middleware usage * chore: update podfile.lock * fix: broken tests due to 0.79 merge * fix: restructure file and image upload preview to attachment upload preview list (#3133) * feat: restructure images and files upload preview * feat: create useAudioPreviewManager * fix: paused bug when audio is uploadesd * fix: restructure useeffect * fix: draft pending task deletion * fix: poll switch inputs issue with async state (#3135) * fix: poll switch inputs issue with async state * fix: poll switch inputs issue with async state * fix: poll switch inputs issue with async state * chore: bump stream-chat to latest * feat: bump i18n to latest and do all necessary changes in the SDK to support it * chore: update relevant yarn.locks * fix: linter issues * fix: import cycles issue for polls and translations * fix: message composer cyclical deps * chore: bump expomessaging yarn.lock * fix: limit offline messages * fix: update pod lock files BREAKING CHANGE: commit for v8 bump * Revert "chore: setup v8 rc candidate and workflows (#3127)" This reverts commit 7a0dad8. * chore: bump sample apps all around --------- Co-authored-by: Ivan Sekovanikj <[email protected]> Co-authored-by: Ivan Sekovanikj <[email protected]>
1 parent 703b0ae commit c8b8b71

File tree

265 files changed

+10047
-15139
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

265 files changed

+10047
-15139
lines changed

examples/ExpoMessaging/app/channel/[cid]/index.tsx

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
import React, { useContext, useEffect } from 'react';
1+
import React, { useContext } from 'react';
22
import { SafeAreaView, View } from 'react-native';
3-
import { Channel, MessageInput, MessageList, useAttachmentPickerContext } from 'stream-chat-expo';
3+
import { Channel, MessageInput, MessageList } from 'stream-chat-expo';
44
import { Stack, useRouter } from 'expo-router';
55
import { AuthProgressLoader } from '../../../components/AuthProgressLoader';
66
import { AppContext } from '../../../context/AppContext';
@@ -9,13 +9,8 @@ import { useHeaderHeight } from '@react-navigation/elements';
99
export default function ChannelScreen() {
1010
const router = useRouter();
1111
const { setThread, channel } = useContext(AppContext);
12-
const { setTopInset } = useAttachmentPickerContext();
1312
const headerHeight = useHeaderHeight();
1413

15-
useEffect(() => {
16-
setTopInset(headerHeight);
17-
}, [headerHeight, setTopInset]);
18-
1914
if (!channel) {
2015
return <AuthProgressLoader />;
2116
}

examples/ExpoMessaging/components/ChatWrapper.tsx

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import React, { PropsWithChildren, useRef } from 'react';
1+
import React, { PropsWithChildren } from 'react';
22
import {
33
Chat,
44
OverlayProvider,
@@ -8,7 +8,6 @@ import {
88
} from 'stream-chat-expo';
99
import { AuthProgressLoader } from './AuthProgressLoader';
1010
import { STREAM_API_KEY, user, userToken } from '../constants';
11-
import { useSafeAreaInsets } from 'react-native-safe-area-context';
1211
import { useStreamChatTheme } from '../useStreamChatTheme';
1312

1413
const streami18n = new Streami18n({
@@ -20,7 +19,6 @@ SqliteClient.logger = (level, message, extraData) => {
2019
};
2120

2221
export const ChatWrapper = ({ children }: PropsWithChildren<{}>) => {
23-
const { bottom } = useSafeAreaInsets();
2422
const chatClient = useCreateChatClient({
2523
apiKey: STREAM_API_KEY,
2624
userData: user,
@@ -33,12 +31,8 @@ export const ChatWrapper = ({ children }: PropsWithChildren<{}>) => {
3331
}
3432

3533
return (
36-
<OverlayProvider
37-
bottomInset={bottom}
38-
i18nInstance={streami18n}
39-
value={{ style: theme }}
40-
>
41-
<Chat enableOfflineSupport client={chatClient} i18nInstance={streami18n}>
34+
<OverlayProvider i18nInstance={streami18n} value={{ style: theme }}>
35+
<Chat client={chatClient} i18nInstance={streami18n}>
4236
{children}
4337
</Chat>
4438
</OverlayProvider>

examples/ExpoMessaging/yarn.lock

Lines changed: 25 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1404,6 +1404,11 @@
14041404
dependencies:
14051405
regenerator-runtime "^0.14.0"
14061406

1407+
"@babel/runtime@^7.27.1":
1408+
version "7.27.6"
1409+
resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.27.6.tgz#ec4070a04d76bae8ddbb10770ba55714a417b7c6"
1410+
integrity sha512-vbavdySgbTTrmFE+EsiqUTzlOr5bzlnJtUv9PynGCAKvfQqjIXbvFdumPM/GxMDfyuGMJaJAU6TO4zc1Jf1i8Q==
1411+
14071412
"@babel/template@^7.20.7", "@babel/template@^7.21.9":
14081413
version "7.21.9"
14091414
resolved "https://registry.yarnpkg.com/@babel/template/-/template-7.21.9.tgz#bf8dad2859130ae46088a99c1f265394877446fb"
@@ -2581,6 +2586,11 @@
25812586
dependencies:
25822587
"@types/yargs-parser" "*"
25832588

2589+
"@ungap/structured-clone@^1.3.0":
2590+
version "1.3.0"
2591+
resolved "https://registry.yarnpkg.com/@ungap/structured-clone/-/structured-clone-1.3.0.tgz#d06bbb384ebcf6c505fde1c3d0ed4ddffe0aaff8"
2592+
integrity sha512-WmoN8qaIAo7WTYWbAZuG8PYEhn5fkz7dZrqTBZ7dtt//lL2Gwms1IcnQ5yHqjDfX8Ft5j4YzDM23f87zBfDe9g==
2593+
25842594
"@urql/core@^5.0.0", "@urql/core@^5.0.6":
25852595
version "5.0.8"
25862596
resolved "https://registry.yarnpkg.com/@urql/core/-/core-5.0.8.tgz#eba39eaa2bf9a0a963383e87a65cba7a9ca794bd"
@@ -4120,6 +4130,13 @@ i18next@^21.10.0:
41204130
dependencies:
41214131
"@babel/runtime" "^7.17.2"
41224132

4133+
i18next@^25.2.1:
4134+
version "25.2.1"
4135+
resolved "https://registry.yarnpkg.com/i18next/-/i18next-25.2.1.tgz#23cf8794904f551f577558d93c84b0fb6cd489a2"
4136+
integrity sha512-+UoXK5wh+VlE1Zy5p6MjcvctHXAhRwQKCxiJD8noKZzIXmnAX8gdHX5fLPA3MEVxEN4vbZkQFy8N0LyD9tUqPw==
4137+
dependencies:
4138+
"@babel/runtime" "^7.27.1"
4139+
41234140
ieee754@^1.1.13:
41244141
version "1.2.1"
41254142
resolved "https://registry.yarnpkg.com/ieee754/-/ieee754-1.2.1.tgz#8eb7a10a63fff25d15a57b001586d177d1b0d352"
@@ -6110,10 +6127,10 @@ [email protected]:
61106127
version "0.0.0"
61116128
uid ""
61126129

6113-
stream-chat-react-native-core@7.1.2:
6114-
version "7.1.2"
6115-
resolved "https://registry.yarnpkg.com/stream-chat-react-native-core/-/stream-chat-react-native-core-7.1.2.tgz#5870a1188ecbf8c3b705d74379d19ff77efce2c5"
6116-
integrity sha512-Ob+V8tt+7L+7BRkWyWbFlju6E/8MAoB/NUZ8ENtEEijq5QBNWnVvZctQSZuekIOVrfoP9EenlIOPadHnN/mvYA==
6130+
stream-chat-react-native-core@7.2.0:
6131+
version "7.2.0"
6132+
resolved "https://registry.yarnpkg.com/stream-chat-react-native-core/-/stream-chat-react-native-core-7.2.0.tgz#9c60f0235a84f22077dd56c57a532e19701dcd15"
6133+
integrity sha512-DXToshO7/6Bu+Rk03fTeP3W3LFlkOpRph/Iu9OtAU0QzDdG2IgMa1tNhiDEmFmJHjWROjFZtBmyV1Cuk4vFiAQ==
61176134
dependencies:
61186135
"@gorhom/bottom-sheet" "^5.1.6"
61196136
dayjs "1.11.13"
@@ -6133,10 +6150,10 @@ [email protected]:
61336150
version "0.0.0"
61346151
uid ""
61356152

6136-
stream-chat@^9.7.0:
6137-
version "9.7.0"
6138-
resolved "https://registry.yarnpkg.com/stream-chat/-/stream-chat-9.7.0.tgz#8302a4dfd2b68115c57cd0a102976542a79cf132"
6139-
integrity sha512-8K4RQAUFfznCxpJ5CMIrMQQLroaZ1snB4aR/Xnwa9UpxNCzn3kIi61AVkfsaHTHGojPz5LA3c3faVb251u4HnA==
6153+
stream-chat@^9.7.0, stream-chat@^9.9.0:
6154+
version "9.9.0"
6155+
resolved "https://registry.yarnpkg.com/stream-chat/-/stream-chat-9.9.0.tgz#59ac996e6e0ca6b3e3a0041954ae99a43541ec13"
6156+
integrity sha512-4tqedL7NfDhwJIKRBKGdvNu4x0ifKO+qxyc9TEWe+LLaW3Qed4txKysrVKnDfj/rx3iZuIwrMV7VeW5yxZfP5w==
61406157
dependencies:
61416158
"@types/jsonwebtoken" "^9.0.8"
61426159
"@types/ws" "^8.5.14"

examples/SampleApp/App.tsx

Lines changed: 34 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,12 @@ import { DevSettings, LogBox, Platform, useColorScheme } from 'react-native';
33
import { createDrawerNavigator } from '@react-navigation/drawer';
44
import { DarkTheme, DefaultTheme, NavigationContainer } from '@react-navigation/native';
55
import { createStackNavigator } from '@react-navigation/stack';
6-
import { SafeAreaProvider, useSafeAreaInsets } from 'react-native-safe-area-context';
6+
import { SafeAreaProvider } from 'react-native-safe-area-context';
77
import {
88
Chat,
9+
createTextComposerEmojiMiddleware,
910
OverlayProvider,
11+
setupCommandUIMiddlewares,
1012
SqliteClient,
1113
ThemeProvider,
1214
useOverlayContext,
@@ -34,8 +36,12 @@ import { OneOnOneChannelDetailScreen } from './src/screens/OneOnOneChannelDetail
3436
import { SharedGroupsScreen } from './src/screens/SharedGroupsScreen';
3537
import { ThreadScreen } from './src/screens/ThreadScreen';
3638
import { UserSelectorScreen } from './src/screens/UserSelectorScreen';
39+
import { init, SearchIndex } from 'emoji-mart';
40+
import data from '@emoji-mart/data';
3741

38-
import type { LocalMessage, StreamChat } from 'stream-chat';
42+
import type { LocalMessage, StreamChat, TextComposerMiddleware } from 'stream-chat';
43+
44+
init({ data });
3945

4046
if (__DEV__) {
4147
DevSettings.addMenuItem('Reset local DB (offline storage)', () => {
@@ -118,6 +124,31 @@ const App = () => {
118124
};
119125
}, []);
120126

127+
useEffect(() => {
128+
if (!chatClient) {
129+
return;
130+
}
131+
chatClient.setMessageComposerSetupFunction(({ composer }) => {
132+
composer.updateConfig({
133+
drafts: {
134+
enabled: true,
135+
},
136+
});
137+
138+
setupCommandUIMiddlewares(composer);
139+
140+
composer.textComposer.middlewareExecutor.insert({
141+
middleware: [
142+
createTextComposerEmojiMiddleware({
143+
emojiSearchIndex: SearchIndex,
144+
}) as TextComposerMiddleware,
145+
],
146+
position: { after: 'stream-io/text-composer/mentions-middleware' },
147+
unique: true,
148+
});
149+
});
150+
}, [chatClient]);
151+
121152
return (
122153
<SafeAreaProvider
123154
style={{
@@ -169,12 +200,11 @@ const isMessageAIGenerated = (message: LocalMessage) => !!message.ai_generated;
169200
const DrawerNavigatorWrapper: React.FC<{
170201
chatClient: StreamChat;
171202
}> = ({ chatClient }) => {
172-
const { bottom } = useSafeAreaInsets();
173203
const streamChatTheme = useStreamChatTheme();
174204

175205
return (
176206
<GestureHandlerRootView style={{ flex: 1 }}>
177-
<OverlayProvider bottomInset={bottom} value={{ style: streamChatTheme }}>
207+
<OverlayProvider value={{ style: streamChatTheme }}>
178208
<Chat
179209
client={chatClient}
180210
enableOfflineSupport

examples/SampleApp/ios/Podfile.lock

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2425,7 +2425,7 @@ PODS:
24252425
- libwebp (~> 1.0)
24262426
- SDWebImage/Core (~> 5.10)
24272427
- SocketRocket (0.7.1)
2428-
- stream-chat-react-native (7.1.2):
2428+
- stream-chat-react-native (7.2.0):
24292429
- DoubleConversion
24302430
- glog
24312431
- hermes-engine
@@ -2872,7 +2872,7 @@ SPEC CHECKSUMS:
28722872
SDWebImage: a7f831e1a65eb5e285e3fb046a23fcfbf08e696d
28732873
SDWebImageWebPCoder: 908b83b6adda48effe7667cd2b7f78c897e5111d
28742874
SocketRocket: d4aabe649be1e368d1318fdf28a022d714d65748
2875-
stream-chat-react-native: 45d46c6a3188edf8dfe9c85cd884457ccc232b74
2875+
stream-chat-react-native: 2de2866392bfecadf005ec5f0b1f882b613b89ba
28762876
Yoga: b2eaabf17044cd4273a661b14eb83f9fd2c90491
28772877

28782878
PODFILE CHECKSUM: 4f662370295f8f9cee909f1a4c59a614999a209d

examples/SampleApp/package.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
"clean-all": "yarn clean && rm -rf node_modules && rm -rf ios/Pods && rm -rf vendor && bundle install && yarn install && cd ios && bundle exec pod install && cd -"
2424
},
2525
"dependencies": {
26+
"@emoji-mart/data": "^1.2.1",
2627
"@notifee/react-native": "^9.1.8",
2728
"@op-engineering/op-sqlite": "^14.0.4",
2829
"@react-native-async-storage/async-storage": "^2.2.0",
@@ -36,6 +37,8 @@
3637
"@react-navigation/native": "^7.1.10",
3738
"@react-navigation/stack": "^7.3.3",
3839
"react": "19.0.0",
40+
"emoji-mart": "^5.6.0",
41+
"lodash.mergewith": "^4.6.2",
3942
"react-native": "^0.79.3",
4043
"react-native-audio-recorder-player": "^3.6.13",
4144
"react-native-blob-util": "^0.22.2",
@@ -64,6 +67,7 @@
6467
"@react-native/typescript-config": "0.79.3",
6568
"@rnx-kit/metro-config": "^2.1.0",
6669
"@types/jest": "^29.5.14",
70+
"@types/lodash.mergewith": "^4.6.9",
6771
"@types/react": "^19.0.0",
6872
"@types/react-test-renderer": "^19.0.0",
6973
"eslint": "^9.28.0",

examples/SampleApp/src/components/BottomTabs.tsx

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import { MentionsTab } from '../icons/MentionsTab';
1111

1212
import type { BottomTabBarProps } from '@react-navigation/bottom-tabs';
1313
import type { Route } from '@react-navigation/native';
14+
import { DraftsTab } from '../icons/DraftsTab';
1415

1516
const styles = StyleSheet.create({
1617
notification: {
@@ -44,6 +45,13 @@ const getTab = (key: string) => {
4445
notification: <ChannelsUnreadCountBadge />,
4546
title: 'Chats',
4647
};
48+
case 'DraftsScreen':
49+
return {
50+
icon: <DraftsTab />,
51+
iconActive: <DraftsTab active />,
52+
title: 'Drafts',
53+
notification: <ChannelsUnreadCountBadge />,
54+
};
4755
case 'ThreadsScreen':
4856
return {
4957
icon: <ThreadsTab />,

examples/SampleApp/src/components/ChannelPreview.tsx

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -71,9 +71,7 @@ const CustomChannelPreviewStatus = (
7171
);
7272
};
7373

74-
export const ChannelPreview: React.FC<ChannelPreviewMessengerProps> = (
75-
props,
76-
) => {
74+
export const ChannelPreview: React.FC<ChannelPreviewMessengerProps> = (props) => {
7775
const { channel } = props;
7876

7977
const { setOverlay } = useAppOverlayContext();

0 commit comments

Comments
 (0)