stream-chat-react-native-core 5.14.0-beta.5 → 5.14.0-beta.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/commonjs/components/Chat/Chat.js +10 -23
- package/lib/commonjs/components/Chat/Chat.js.map +1 -1
- package/lib/commonjs/contexts/overlayContext/OverlayProvider.js +15 -28
- package/lib/commonjs/contexts/overlayContext/OverlayProvider.js.map +1 -1
- package/lib/commonjs/hooks/useStreami18n.js +13 -6
- package/lib/commonjs/hooks/useStreami18n.js.map +1 -1
- package/lib/commonjs/version.json +1 -1
- package/lib/module/components/Chat/Chat.js +10 -23
- package/lib/module/components/Chat/Chat.js.map +1 -1
- package/lib/module/contexts/overlayContext/OverlayProvider.js +15 -28
- package/lib/module/contexts/overlayContext/OverlayProvider.js.map +1 -1
- package/lib/module/hooks/useStreami18n.js +13 -6
- package/lib/module/hooks/useStreami18n.js.map +1 -1
- package/lib/module/version.json +1 -1
- package/lib/typescript/contexts/overlayContext/OverlayProvider.d.ts +1 -1
- package/lib/typescript/hooks/useStreami18n.d.ts +1 -1
- package/package.json +1 -1
- package/src/components/Attachment/__tests__/Giphy.test.js +13 -8
- package/src/components/Chat/Chat.tsx +2 -13
- package/src/contexts/overlayContext/OverlayProvider.tsx +1 -9
- package/src/hooks/useStreami18n.ts +11 -7
- package/src/version.json +1 -1
|
@@ -8,7 +8,6 @@ var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends")
|
|
|
8
8
|
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
9
9
|
var _react = _interopRequireWildcard(require("react"));
|
|
10
10
|
var _reactNative = require("react-native");
|
|
11
|
-
var _dayjs = _interopRequireDefault(require("dayjs"));
|
|
12
11
|
var _useAppSettings = require("./hooks/useAppSettings");
|
|
13
12
|
var _useCreateChatContext = require("./hooks/useCreateChatContext");
|
|
14
13
|
var _useIsOnline2 = require("./hooks/useIsOnline");
|
|
@@ -47,25 +46,14 @@ var ChatWithContext = function ChatWithContext(props) {
|
|
|
47
46
|
_useState2 = (0, _slicedToArray2["default"])(_useState, 2),
|
|
48
47
|
channel = _useState2[0],
|
|
49
48
|
setChannel = _useState2[1];
|
|
50
|
-
var
|
|
51
|
-
t: function t(key) {
|
|
52
|
-
return key;
|
|
53
|
-
},
|
|
54
|
-
tDateTimeParser: function tDateTimeParser(input) {
|
|
55
|
-
return (0, _dayjs["default"])(input);
|
|
56
|
-
}
|
|
57
|
-
}),
|
|
58
|
-
_useState4 = (0, _slicedToArray2["default"])(_useState3, 2),
|
|
59
|
-
translators = _useState4[0],
|
|
60
|
-
setTranslators = _useState4[1];
|
|
61
|
-
var loadingTranslators = (0, _useStreami18n.useStreami18n)(setTranslators, i18nInstance);
|
|
49
|
+
var translators = (0, _useStreami18n.useStreami18n)(i18nInstance);
|
|
62
50
|
var _useIsOnline = (0, _useIsOnline2.useIsOnline)(client, closeConnectionOnBackground),
|
|
63
51
|
connectionRecovering = _useIsOnline.connectionRecovering,
|
|
64
52
|
isOnline = _useIsOnline.isOnline;
|
|
65
|
-
var
|
|
66
|
-
|
|
67
|
-
initialisedDatabase =
|
|
68
|
-
setInitialisedDatabase =
|
|
53
|
+
var _useState3 = (0, _react.useState)(false),
|
|
54
|
+
_useState4 = (0, _slicedToArray2["default"])(_useState3, 2),
|
|
55
|
+
initialisedDatabase = _useState4[0],
|
|
56
|
+
setInitialisedDatabase = _useState4[1];
|
|
69
57
|
var mutedUsers = (0, _useMutedUsers.useMutedUsers)(client);
|
|
70
58
|
var debugRef = (0, _DebugContext.useDebugContext)();
|
|
71
59
|
var isDebugModeEnabled = __DEV__ && debugRef && debugRef.current;
|
|
@@ -111,13 +99,12 @@ var ChatWithContext = function ChatWithContext(props) {
|
|
|
111
99
|
client: client,
|
|
112
100
|
enableOfflineSupport: enableOfflineSupport
|
|
113
101
|
});
|
|
114
|
-
if (loadingTranslators) return null;
|
|
115
102
|
return _react["default"].createElement(_ChatContext.ChatProvider, {
|
|
116
103
|
value: chatContext,
|
|
117
104
|
__self: _this,
|
|
118
105
|
__source: {
|
|
119
106
|
fileName: _jsxFileName,
|
|
120
|
-
lineNumber:
|
|
107
|
+
lineNumber: 221,
|
|
121
108
|
columnNumber: 5
|
|
122
109
|
}
|
|
123
110
|
}, _react["default"].createElement(_TranslationContext.TranslationProvider, {
|
|
@@ -127,7 +114,7 @@ var ChatWithContext = function ChatWithContext(props) {
|
|
|
127
114
|
__self: _this,
|
|
128
115
|
__source: {
|
|
129
116
|
fileName: _jsxFileName,
|
|
130
|
-
lineNumber:
|
|
117
|
+
lineNumber: 222,
|
|
131
118
|
columnNumber: 7
|
|
132
119
|
}
|
|
133
120
|
}, _react["default"].createElement(_ThemeContext.ThemeProvider, {
|
|
@@ -135,14 +122,14 @@ var ChatWithContext = function ChatWithContext(props) {
|
|
|
135
122
|
__self: _this,
|
|
136
123
|
__source: {
|
|
137
124
|
fileName: _jsxFileName,
|
|
138
|
-
lineNumber:
|
|
125
|
+
lineNumber: 225,
|
|
139
126
|
columnNumber: 9
|
|
140
127
|
}
|
|
141
128
|
}, _react["default"].createElement(_ChannelsStateContext.ChannelsStateProvider, {
|
|
142
129
|
__self: _this,
|
|
143
130
|
__source: {
|
|
144
131
|
fileName: _jsxFileName,
|
|
145
|
-
lineNumber:
|
|
132
|
+
lineNumber: 226,
|
|
146
133
|
columnNumber: 11
|
|
147
134
|
}
|
|
148
135
|
}, children))));
|
|
@@ -156,7 +143,7 @@ var Chat = function Chat(props) {
|
|
|
156
143
|
__self: _this,
|
|
157
144
|
__source: {
|
|
158
145
|
fileName: _jsxFileName,
|
|
159
|
-
lineNumber:
|
|
146
|
+
lineNumber: 261,
|
|
160
147
|
columnNumber: 10
|
|
161
148
|
}
|
|
162
149
|
}));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_react","_interopRequireWildcard","require","_reactNative","_dayjs","_interopRequireDefault","_useAppSettings","_useCreateChatContext","_useIsOnline2","_useMutedUsers","_useSyncDatabase","_ChannelsStateContext","_ChatContext","_DebugContext","_OverlayContext","_ThemeContext","_TranslationContext","_useStreami18n","_init","_native","_QuickSqliteClient","_DBSyncManager","_version","_this","_jsxFileName","_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","obj","__esModule","_typeof","cache","has","get","newObj","hasPropertyDescriptor","Object","defineProperty","getOwnPropertyDescriptor","key","prototype","hasOwnProperty","call","desc","set","init","ChatWithContext","props","_client$user2","_client$user3","children","client","_props$closeConnectio","closeConnectionOnBackground","_props$enableOfflineS","enableOfflineSupport","i18nInstance","_props$ImageComponent","ImageComponent","Image","style","_useState","useState","_useState2","_slicedToArray2","channel","setChannel","_useState3","t","tDateTimeParser","input","Dayjs","_useState4","translators","setTranslators","loadingTranslators","useStreami18n","_useIsOnline","useIsOnline","connectionRecovering","isOnline","_useState5","_useState6","initialisedDatabase","setInitialisedDatabase","mutedUsers","useMutedUsers","debugRef","useDebugContext","isDebugModeEnabled","__DEV__","current","useEffect","setUserAgent","SDK","Platform","OS","version","recoverStateOnReconnect","persistUserOnConnectionFailure","setEventType","setSendEventParams","action","data","user","setActiveChannel","newChannel","_client$user","id","QuickSqliteClient","initializeDatabase","DBSyncManager","appSettings","useAppSettings","chatContext","useCreateChatContext","useSyncDatabase","createElement","ChatProvider","value","__self","__source","fileName","lineNumber","columnNumber","TranslationProvider","_extends2","userLanguage","language","DEFAULT_USER_LANGUAGE","ThemeProvider","ChannelsStateProvider","Chat","_useOverlayContext","useOverlayContext","exports"],"sources":["Chat.tsx"],"sourcesContent":["import React, { PropsWithChildren, useEffect, useState } from 'react';\nimport { Image, Platform } from 'react-native';\n\nimport Dayjs from 'dayjs';\n\nimport type { Channel, StreamChat } from 'stream-chat';\n\nimport { useAppSettings } from './hooks/useAppSettings';\nimport { useCreateChatContext } from './hooks/useCreateChatContext';\nimport { useIsOnline } from './hooks/useIsOnline';\nimport { useMutedUsers } from './hooks/useMutedUsers';\n\nimport { useSyncDatabase } from './hooks/useSyncDatabase';\n\nimport { ChannelsStateProvider } from '../../contexts/channelsStateContext/ChannelsStateContext';\nimport { ChatContextValue, ChatProvider } from '../../contexts/chatContext/ChatContext';\nimport { useDebugContext } from '../../contexts/debugContext/DebugContext';\nimport { useOverlayContext } from '../../contexts/overlayContext/OverlayContext';\nimport { DeepPartial, ThemeProvider } from '../../contexts/themeContext/ThemeContext';\nimport type { Theme } from '../../contexts/themeContext/utils/theme';\nimport {\n DEFAULT_USER_LANGUAGE,\n TranslationProvider,\n TranslatorFunctions,\n} from '../../contexts/translationContext/TranslationContext';\nimport { useStreami18n } from '../../hooks/useStreami18n';\nimport init from '../../init';\n\nimport { SDK } from '../../native';\nimport { QuickSqliteClient } from '../../store/QuickSqliteClient';\nimport type { DefaultStreamChatGenerics } from '../../types/types';\nimport { DBSyncManager } from '../../utils/DBSyncManager';\nimport type { Streami18n } from '../../utils/Streami18n';\nimport { version } from '../../version.json';\n\ninit();\n\nexport type ChatProps<\n StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics,\n> = Pick<ChatContextValue<StreamChatGenerics>, 'client'> &\n Partial<Pick<ChatContextValue<StreamChatGenerics>, 'ImageComponent'>> & {\n /**\n * When false, ws connection won't be disconnection upon backgrounding the app.\n * To receive push notifications, its necessary that user doesn't have active\n * websocket connection. So by default, we disconnect websocket connection when\n * app goes to background, and reconnect when app comes to foreground.\n */\n closeConnectionOnBackground?: boolean;\n /**\n * Enables offline storage and loading for chat data.\n */\n enableOfflineSupport?: boolean;\n /**\n * Instance of Streami18n class should be provided to Chat component to enable internationalization.\n *\n * Stream provides following list of in-built translations:\n * 1. English (en)\n * 2. Dutch (nl)\n * 3. ...\n * 4. ...\n *\n * Simplest way to start using chat components in one of the in-built languages would be following:\n *\n * ```\n * const i18n = new Streami18n('nl');\n * <Chat client={chatClient} i18nInstance={i18n}>\n * ...\n * </Chat>\n * ```\n *\n * If you would like to override certain keys in in-built translation.\n * UI will be automatically updated in this case.\n *\n * ```\n * const i18n = new Streami18n('nl');\n *\n * i18n.registerTranslation('nl', {\n * 'Nothing yet...': 'Nog Niet ...',\n * '{{ firstUser }} and {{ secondUser }} are typing...': '{{ firstUser }} en {{ secondUser }} zijn aan het typen...',\n * });\n *\n * <Chat client={chatClient} i18nInstance={i18n}>\n * ...\n * </Chat>\n * ```\n *\n * You can use the same function to add whole new language.\n *\n * ```\n * const i18n = new Streami18n('it');\n *\n * i18n.registerTranslation('it', {\n * 'Nothing yet...': 'Non ancora ...',\n * '{{ firstUser }} and {{ secondUser }} are typing...': '{{ firstUser }} a {{ secondUser }} stanno scrivendo...',\n * });\n *\n * // Make sure to call setLanguage to reflect new language in UI.\n * i18n.setLanguage('it');\n * <Chat client={chatClient} i18nInstance={i18n}>\n * ...\n * </Chat>\n * ```\n */\n i18nInstance?: Streami18n;\n /**\n * You can pass the theme object to customize the styles of Chat components. You can check the default theme in [theme.ts](https://github.com/GetStream/stream-chat-react-native/blob/main/package/src/contexts/themeContext/utils/theme.ts)\n *\n * Please check section about [themes in cookbook](https://github.com/GetStream/stream-chat-react-native/wiki/Cookbook-v3.0#theme) for details.\n *\n * ```\n * import type { DeepPartial, Theme } from 'stream-chat-react-native';\n *\n * const theme: DeepPartial<Theme> = {\n * messageSimple: {\n * file: {\n * container: {\n * backgroundColor: 'red',\n * },\n * icon: {\n * height: 16,\n * width: 16,\n * },\n * },\n * },\n * };\n *\n * <Chat style={theme}>\n * </Chat>\n * ```\n *\n * @overrideType object\n */\n style?: DeepPartial<Theme>;\n };\n\nconst ChatWithContext = <\n StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics,\n>(\n props: PropsWithChildren<ChatProps<StreamChatGenerics>>,\n) => {\n const {\n children,\n client,\n closeConnectionOnBackground = true,\n enableOfflineSupport = false,\n i18nInstance,\n ImageComponent = Image,\n style,\n } = props;\n\n const [channel, setChannel] = useState<Channel<StreamChatGenerics>>();\n const [translators, setTranslators] = useState<TranslatorFunctions>({\n t: (key: string) => key,\n tDateTimeParser: (input?: string | number | Date) => Dayjs(input),\n });\n\n /**\n * Setup translators\n */\n const loadingTranslators = useStreami18n(setTranslators, i18nInstance);\n\n /**\n * Setup connection event listeners\n */\n const { connectionRecovering, isOnline } = useIsOnline<StreamChatGenerics>(\n client,\n closeConnectionOnBackground,\n );\n\n const [initialisedDatabase, setInitialisedDatabase] = useState(false);\n\n /**\n * Setup muted user listener\n * TODO: reimplement\n */\n const mutedUsers = useMutedUsers<StreamChatGenerics>(client);\n\n const debugRef = useDebugContext();\n const isDebugModeEnabled = __DEV__ && debugRef && debugRef.current;\n\n useEffect(() => {\n if (client) {\n client.setUserAgent(`${SDK}-${Platform.OS}-${version}`);\n // This is to disable recovery related logic in js client, since we handle it in this SDK\n client.recoverStateOnReconnect = false;\n client.persistUserOnConnectionFailure = enableOfflineSupport;\n }\n\n if (isDebugModeEnabled) {\n if (debugRef.current.setEventType) debugRef.current.setEventType('send');\n if (debugRef.current.setSendEventParams)\n debugRef.current.setSendEventParams({\n action: 'Client',\n data: client.user,\n });\n }\n }, [client, enableOfflineSupport]);\n\n const setActiveChannel = (newChannel?: Channel<StreamChatGenerics>) => setChannel(newChannel);\n\n useEffect(() => {\n if (client.user?.id && enableOfflineSupport) {\n setInitialisedDatabase(false);\n QuickSqliteClient.initializeDatabase();\n DBSyncManager.init(client as unknown as StreamChat);\n setInitialisedDatabase(true);\n }\n }, [client?.user?.id, enableOfflineSupport]);\n\n const appSettings = useAppSettings(client, isOnline, enableOfflineSupport, initialisedDatabase);\n\n const chatContext = useCreateChatContext({\n appSettings,\n channel,\n client,\n connectionRecovering,\n enableOfflineSupport,\n ImageComponent,\n isOnline,\n mutedUsers,\n setActiveChannel,\n });\n\n useSyncDatabase({\n client,\n enableOfflineSupport,\n });\n\n if (loadingTranslators) return null;\n\n return (\n <ChatProvider<StreamChatGenerics> value={chatContext}>\n <TranslationProvider\n value={{ ...translators, userLanguage: client.user?.language || DEFAULT_USER_LANGUAGE }}\n >\n <ThemeProvider style={style}>\n <ChannelsStateProvider<StreamChatGenerics>>{children}</ChannelsStateProvider>\n </ThemeProvider>\n </TranslationProvider>\n </ChatProvider>\n );\n};\n\n/**\n * Chat - Wrapper component for Chat. The needs to be placed around any other chat components.\n * This Chat component provides the ChatContext to all other components.\n *\n * The ChatContext provides the following props:\n *\n * - channel - currently active channel\n * - client - client connection\n * - connectionRecovering - whether or not websocket is reconnecting\n * - isOnline - whether or not set user is active\n * - setActiveChannel - function to set the currently active channel\n *\n * The Chat Component takes the following generics in order:\n * - At (AttachmentType) - custom Attachment object extension\n * - Ct (ChannelType) - custom Channel object extension\n * - Co (CommandType) - custom Command string union extension\n * - Ev (EventType) - custom Event object extension\n * - Me (MessageType) - custom Message object extension\n * - Re (ReactionType) - custom Reaction object extension\n * - Us (UserType) - custom User object extension\n */\nexport const Chat = <\n StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics,\n>(\n props: PropsWithChildren<ChatProps<StreamChatGenerics>>,\n) => {\n const { style } = useOverlayContext();\n\n return <ChatWithContext {...{ style }} {...props} />;\n};\n"],"mappings":";;;;;;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AAEA,IAAAE,MAAA,GAAAC,sBAAA,CAAAH,OAAA;AAIA,IAAAI,eAAA,GAAAJ,OAAA;AACA,IAAAK,qBAAA,GAAAL,OAAA;AACA,IAAAM,aAAA,GAAAN,OAAA;AACA,IAAAO,cAAA,GAAAP,OAAA;AAEA,IAAAQ,gBAAA,GAAAR,OAAA;AAEA,IAAAS,qBAAA,GAAAT,OAAA;AACA,IAAAU,YAAA,GAAAV,OAAA;AACA,IAAAW,aAAA,GAAAX,OAAA;AACA,IAAAY,eAAA,GAAAZ,OAAA;AACA,IAAAa,aAAA,GAAAb,OAAA;AAEA,IAAAc,mBAAA,GAAAd,OAAA;AAKA,IAAAe,cAAA,GAAAf,OAAA;AACA,I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AAA,iBAAOrD,WAAW;MAAEsD,YAAY,EAAE,EAAA9E,aAAA,GAAAE,MAAM,CAACqD,IAAI,qBAAXvD,aAAA,CAAa+E,QAAQ,KAAIC;IAAqB,EAAG;IAAAT,MAAA,EAAAnG,KAAA;IAAAoG,QAAA;MAAAC,QAAA,EAAApG,YAAA;MAAAqG,UAAA;MAAAC,YAAA;IAAA;EAAA,GAExF9H,MAAA,YAAAuH,aAAA,CAACxG,aAAA,CAAAqH,aAAa;IAACtE,KAAK,EAAEA,KAAM;IAAA4D,MAAA,EAAAnG,KAAA;IAAAoG,QAAA;MAAAC,QAAA,EAAApG,YAAA;MAAAqG,UAAA;MAAAC,YAAA;IAAA;EAAA,GAC1B9H,MAAA,YAAAuH,aAAA,CAAC5G,qBAAA,CAAA0H,qBAAqB;IAAAX,MAAA,EAAAnG,KAAA;IAAAoG,QAAA;MAAAC,QAAA,EAAApG,YAAA;MAAAqG,UAAA;MAAAC,YAAA;IAAA;EAAA,GAAsB1E,QAAQ,CAAyB,CAC/D,CACI,CACT;AAEnB,CAAC;AAuBM,IAAMkF,IAAI,GAAG,SAAPA,IAAIA,CAGfrF,KAAuD,EACpD;EACH,IAAAsF,kBAAA,GAAkB,IAAAC,iCAAiB,GAAE;IAA7B1E,KAAK,GAAAyE,kBAAA,CAALzE,KAAK;EAEb,OAAO9D,MAAA,YAAAuH,aAAA,CAACvE,eAAe,MAAAgF,SAAA;IAAOlE,KAAK,EAALA;EAAK,GAAQb,KAAK;IAAAyE,MAAA,EAAAnG,KAAA;IAAAoG,QAAA;MAAAC,QAAA,EAAApG,YAAA;MAAAqG,UAAA;MAAAC,YAAA;IAAA;EAAA,GAAI;AACtD,CAAC;AAACW,OAAA,CAAAH,IAAA,GAAAA,IAAA"}
|
|
1
|
+
{"version":3,"names":["_react","_interopRequireWildcard","require","_reactNative","_useAppSettings","_useCreateChatContext","_useIsOnline2","_useMutedUsers","_useSyncDatabase","_ChannelsStateContext","_ChatContext","_DebugContext","_OverlayContext","_ThemeContext","_TranslationContext","_useStreami18n","_init","_interopRequireDefault","_native","_QuickSqliteClient","_DBSyncManager","_version","_this","_jsxFileName","_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","obj","__esModule","_typeof","cache","has","get","newObj","hasPropertyDescriptor","Object","defineProperty","getOwnPropertyDescriptor","key","prototype","hasOwnProperty","call","desc","set","init","ChatWithContext","props","_client$user2","_client$user3","children","client","_props$closeConnectio","closeConnectionOnBackground","_props$enableOfflineS","enableOfflineSupport","i18nInstance","_props$ImageComponent","ImageComponent","Image","style","_useState","useState","_useState2","_slicedToArray2","channel","setChannel","translators","useStreami18n","_useIsOnline","useIsOnline","connectionRecovering","isOnline","_useState3","_useState4","initialisedDatabase","setInitialisedDatabase","mutedUsers","useMutedUsers","debugRef","useDebugContext","isDebugModeEnabled","__DEV__","current","useEffect","setUserAgent","SDK","Platform","OS","version","recoverStateOnReconnect","persistUserOnConnectionFailure","setEventType","setSendEventParams","action","data","user","setActiveChannel","newChannel","_client$user","id","QuickSqliteClient","initializeDatabase","DBSyncManager","appSettings","useAppSettings","chatContext","useCreateChatContext","useSyncDatabase","createElement","ChatProvider","value","__self","__source","fileName","lineNumber","columnNumber","TranslationProvider","_extends2","userLanguage","language","DEFAULT_USER_LANGUAGE","ThemeProvider","ChannelsStateProvider","Chat","_useOverlayContext","useOverlayContext","exports"],"sources":["Chat.tsx"],"sourcesContent":["import React, { PropsWithChildren, useEffect, useState } from 'react';\nimport { Image, Platform } from 'react-native';\n\nimport type { Channel, StreamChat } from 'stream-chat';\n\nimport { useAppSettings } from './hooks/useAppSettings';\nimport { useCreateChatContext } from './hooks/useCreateChatContext';\nimport { useIsOnline } from './hooks/useIsOnline';\nimport { useMutedUsers } from './hooks/useMutedUsers';\n\nimport { useSyncDatabase } from './hooks/useSyncDatabase';\n\nimport { ChannelsStateProvider } from '../../contexts/channelsStateContext/ChannelsStateContext';\nimport { ChatContextValue, ChatProvider } from '../../contexts/chatContext/ChatContext';\nimport { useDebugContext } from '../../contexts/debugContext/DebugContext';\nimport { useOverlayContext } from '../../contexts/overlayContext/OverlayContext';\nimport { DeepPartial, ThemeProvider } from '../../contexts/themeContext/ThemeContext';\nimport type { Theme } from '../../contexts/themeContext/utils/theme';\nimport {\n DEFAULT_USER_LANGUAGE,\n TranslationProvider,\n} from '../../contexts/translationContext/TranslationContext';\nimport { useStreami18n } from '../../hooks/useStreami18n';\nimport init from '../../init';\n\nimport { SDK } from '../../native';\nimport { QuickSqliteClient } from '../../store/QuickSqliteClient';\nimport type { DefaultStreamChatGenerics } from '../../types/types';\nimport { DBSyncManager } from '../../utils/DBSyncManager';\nimport type { Streami18n } from '../../utils/Streami18n';\nimport { version } from '../../version.json';\n\ninit();\n\nexport type ChatProps<\n StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics,\n> = Pick<ChatContextValue<StreamChatGenerics>, 'client'> &\n Partial<Pick<ChatContextValue<StreamChatGenerics>, 'ImageComponent'>> & {\n /**\n * When false, ws connection won't be disconnection upon backgrounding the app.\n * To receive push notifications, its necessary that user doesn't have active\n * websocket connection. So by default, we disconnect websocket connection when\n * app goes to background, and reconnect when app comes to foreground.\n */\n closeConnectionOnBackground?: boolean;\n /**\n * Enables offline storage and loading for chat data.\n */\n enableOfflineSupport?: boolean;\n /**\n * Instance of Streami18n class should be provided to Chat component to enable internationalization.\n *\n * Stream provides following list of in-built translations:\n * 1. English (en)\n * 2. Dutch (nl)\n * 3. ...\n * 4. ...\n *\n * Simplest way to start using chat components in one of the in-built languages would be following:\n *\n * ```\n * const i18n = new Streami18n('nl');\n * <Chat client={chatClient} i18nInstance={i18n}>\n * ...\n * </Chat>\n * ```\n *\n * If you would like to override certain keys in in-built translation.\n * UI will be automatically updated in this case.\n *\n * ```\n * const i18n = new Streami18n('nl');\n *\n * i18n.registerTranslation('nl', {\n * 'Nothing yet...': 'Nog Niet ...',\n * '{{ firstUser }} and {{ secondUser }} are typing...': '{{ firstUser }} en {{ secondUser }} zijn aan het typen...',\n * });\n *\n * <Chat client={chatClient} i18nInstance={i18n}>\n * ...\n * </Chat>\n * ```\n *\n * You can use the same function to add whole new language.\n *\n * ```\n * const i18n = new Streami18n('it');\n *\n * i18n.registerTranslation('it', {\n * 'Nothing yet...': 'Non ancora ...',\n * '{{ firstUser }} and {{ secondUser }} are typing...': '{{ firstUser }} a {{ secondUser }} stanno scrivendo...',\n * });\n *\n * // Make sure to call setLanguage to reflect new language in UI.\n * i18n.setLanguage('it');\n * <Chat client={chatClient} i18nInstance={i18n}>\n * ...\n * </Chat>\n * ```\n */\n i18nInstance?: Streami18n;\n /**\n * You can pass the theme object to customize the styles of Chat components. You can check the default theme in [theme.ts](https://github.com/GetStream/stream-chat-react-native/blob/main/package/src/contexts/themeContext/utils/theme.ts)\n *\n * Please check section about [themes in cookbook](https://github.com/GetStream/stream-chat-react-native/wiki/Cookbook-v3.0#theme) for details.\n *\n * ```\n * import type { DeepPartial, Theme } from 'stream-chat-react-native';\n *\n * const theme: DeepPartial<Theme> = {\n * messageSimple: {\n * file: {\n * container: {\n * backgroundColor: 'red',\n * },\n * icon: {\n * height: 16,\n * width: 16,\n * },\n * },\n * },\n * };\n *\n * <Chat style={theme}>\n * </Chat>\n * ```\n *\n * @overrideType object\n */\n style?: DeepPartial<Theme>;\n };\n\nconst ChatWithContext = <\n StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics,\n>(\n props: PropsWithChildren<ChatProps<StreamChatGenerics>>,\n) => {\n const {\n children,\n client,\n closeConnectionOnBackground = true,\n enableOfflineSupport = false,\n i18nInstance,\n ImageComponent = Image,\n style,\n } = props;\n\n const [channel, setChannel] = useState<Channel<StreamChatGenerics>>();\n\n // Setup translators\n const translators = useStreami18n(i18nInstance);\n\n /**\n * Setup connection event listeners\n */\n const { connectionRecovering, isOnline } = useIsOnline<StreamChatGenerics>(\n client,\n closeConnectionOnBackground,\n );\n\n const [initialisedDatabase, setInitialisedDatabase] = useState(false);\n\n /**\n * Setup muted user listener\n * TODO: reimplement\n */\n const mutedUsers = useMutedUsers<StreamChatGenerics>(client);\n\n const debugRef = useDebugContext();\n const isDebugModeEnabled = __DEV__ && debugRef && debugRef.current;\n\n useEffect(() => {\n if (client) {\n client.setUserAgent(`${SDK}-${Platform.OS}-${version}`);\n // This is to disable recovery related logic in js client, since we handle it in this SDK\n client.recoverStateOnReconnect = false;\n client.persistUserOnConnectionFailure = enableOfflineSupport;\n }\n\n if (isDebugModeEnabled) {\n if (debugRef.current.setEventType) debugRef.current.setEventType('send');\n if (debugRef.current.setSendEventParams)\n debugRef.current.setSendEventParams({\n action: 'Client',\n data: client.user,\n });\n }\n }, [client, enableOfflineSupport]);\n\n const setActiveChannel = (newChannel?: Channel<StreamChatGenerics>) => setChannel(newChannel);\n\n useEffect(() => {\n if (client.user?.id && enableOfflineSupport) {\n setInitialisedDatabase(false);\n QuickSqliteClient.initializeDatabase();\n DBSyncManager.init(client as unknown as StreamChat);\n setInitialisedDatabase(true);\n }\n }, [client?.user?.id, enableOfflineSupport]);\n\n const appSettings = useAppSettings(client, isOnline, enableOfflineSupport, initialisedDatabase);\n\n const chatContext = useCreateChatContext({\n appSettings,\n channel,\n client,\n connectionRecovering,\n enableOfflineSupport,\n ImageComponent,\n isOnline,\n mutedUsers,\n setActiveChannel,\n });\n\n useSyncDatabase({\n client,\n enableOfflineSupport,\n });\n\n return (\n <ChatProvider<StreamChatGenerics> value={chatContext}>\n <TranslationProvider\n value={{ ...translators, userLanguage: client.user?.language || DEFAULT_USER_LANGUAGE }}\n >\n <ThemeProvider style={style}>\n <ChannelsStateProvider<StreamChatGenerics>>{children}</ChannelsStateProvider>\n </ThemeProvider>\n </TranslationProvider>\n </ChatProvider>\n );\n};\n\n/**\n * Chat - Wrapper component for Chat. The needs to be placed around any other chat components.\n * This Chat component provides the ChatContext to all other components.\n *\n * The ChatContext provides the following props:\n *\n * - channel - currently active channel\n * - client - client connection\n * - connectionRecovering - whether or not websocket is reconnecting\n * - isOnline - whether or not set user is active\n * - setActiveChannel - function to set the currently active channel\n *\n * The Chat Component takes the following generics in order:\n * - At (AttachmentType) - custom Attachment object extension\n * - Ct (ChannelType) - custom Channel object extension\n * - Co (CommandType) - custom Command string union extension\n * - Ev (EventType) - custom Event object extension\n * - Me (MessageType) - custom Message object extension\n * - Re (ReactionType) - custom Reaction object extension\n * - Us (UserType) - custom User object extension\n */\nexport const Chat = <\n StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics,\n>(\n props: PropsWithChildren<ChatProps<StreamChatGenerics>>,\n) => {\n const { style } = useOverlayContext();\n\n return <ChatWithContext {...{ style }} {...props} />;\n};\n"],"mappings":";;;;;;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AAIA,IAAAE,eAAA,GAAAF,OAAA;AACA,IAAAG,qBAAA,GAAAH,OAAA;AACA,IAAAI,aAAA,GAAAJ,OAAA;AACA,IAAAK,cAAA,GAAAL,OAAA;AAEA,IAAAM,gBAAA,GAAAN,OAAA;AAEA,IAAAO,qBAAA,GAAAP,OAAA;AACA,IAAAQ,YAAA,GAAAR,OAAA;AACA,IAAAS,aAAA,GAAAT,OAAA;AACA,IAAAU,eAAA,GAAAV,OAAA;AACA,IAAAW,aAAA,GAAAX,OAAA;AAEA,IAAAY,mBAAA,GAAAZ,OAAA;AAIA,IAAAa,cAAA,GAAAb,OAAA;AACA,IAAAc,KAAA,GAAAC,sBAAA,CAAAf,OAAA;AAEA,IAAAgB,OAAA,GAAAhB,OAAA;AACA,IAAAiB,kBAAA,GAAAjB,OAAA;AAEA,IAAAkB,cAAA,GAAAlB,OAAA;AAEA,IAAAmB,QAAA,GAAAnB,OAAA;AAA6C,IAAAoB,KAAA;EAAAC,YAAA;AAAA,SAAAC,yBAAAC,WAAA,eAAAC,OAAA,kCAAAC,iBAAA,OAAAD,OAAA,QAAAE,gBAAA,OAAAF,OAAA,YAAAF,wB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A,CAGf7E,KAAuD,EACpD;EACH,IAAA8E,kBAAA,GAAkB,IAAAC,iCAAiB,GAAE;IAA7BlE,KAAK,GAAAiE,kBAAA,CAALjE,KAAK;EAEb,OAAO7D,MAAA,YAAA8G,aAAA,CAAC/D,eAAe,MAAAwE,SAAA;IAAO1D,KAAK,EAALA;EAAK,GAAQb,KAAK;IAAAiE,MAAA,EAAA3F,KAAA;IAAA4F,QAAA;MAAAC,QAAA,EAAA5F,YAAA;MAAA6F,UAAA;MAAAC,YAAA;IAAA;EAAA,GAAI;AACtD,CAAC;AAACW,OAAA,CAAAH,IAAA,GAAAA,IAAA"}
|
|
@@ -9,7 +9,6 @@ var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/sli
|
|
|
9
9
|
var _react = _interopRequireWildcard(require("react"));
|
|
10
10
|
var _reactNative = require("react-native");
|
|
11
11
|
var _reactNativeReanimated = _interopRequireWildcard(require("react-native-reanimated"));
|
|
12
|
-
var _dayjs = _interopRequireDefault(require("dayjs"));
|
|
13
12
|
var _OverlayContext = require("./OverlayContext");
|
|
14
13
|
var _AttachmentPicker = require("../../components/AttachmentPicker/AttachmentPicker");
|
|
15
14
|
var _AttachmentPickerBottomSheetHandle = require("../../components/AttachmentPicker/components/AttachmentPickerBottomSheetHandle");
|
|
@@ -113,26 +112,15 @@ var OverlayProvider = function OverlayProvider(props) {
|
|
|
113
112
|
translucentStatusBar: translucentStatusBar
|
|
114
113
|
};
|
|
115
114
|
var bottomSheetRef = (0, _react.useRef)(null);
|
|
116
|
-
var _useState = (0, _react.useState)(
|
|
117
|
-
t: function t(key) {
|
|
118
|
-
return key;
|
|
119
|
-
},
|
|
120
|
-
tDateTimeParser: function tDateTimeParser(input) {
|
|
121
|
-
return (0, _dayjs["default"])(input);
|
|
122
|
-
}
|
|
123
|
-
}),
|
|
115
|
+
var _useState = (0, _react.useState)((value == null ? void 0 : value.overlay) || 'none'),
|
|
124
116
|
_useState2 = (0, _slicedToArray2["default"])(_useState, 2),
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
var _useState3 = (0, _react.useState)((value == null ? void 0 : value.overlay) || 'none'),
|
|
128
|
-
_useState4 = (0, _slicedToArray2["default"])(_useState3, 2),
|
|
129
|
-
overlay = _useState4[0],
|
|
130
|
-
setOverlay = _useState4[1];
|
|
117
|
+
overlay = _useState2[0],
|
|
118
|
+
setOverlay = _useState2[1];
|
|
131
119
|
var overlayOpacity = (0, _reactNativeReanimated.useSharedValue)(0);
|
|
132
120
|
var _Dimensions$get = _reactNative.Dimensions.get('screen'),
|
|
133
121
|
height = _Dimensions$get.height,
|
|
134
122
|
width = _Dimensions$get.width;
|
|
135
|
-
var
|
|
123
|
+
var translators = (0, _useStreami18n.useStreami18n)(i18nInstance);
|
|
136
124
|
(0, _react.useEffect)(function () {
|
|
137
125
|
var backAction = function backAction() {
|
|
138
126
|
if (overlay !== 'none') {
|
|
@@ -188,7 +176,6 @@ var OverlayProvider = function OverlayProvider(props) {
|
|
|
188
176
|
style: value == null ? void 0 : value.style,
|
|
189
177
|
translucentStatusBar: translucentStatusBar
|
|
190
178
|
};
|
|
191
|
-
if (loadingTranslators) return null;
|
|
192
179
|
return _react["default"].createElement(_TranslationContext.TranslationProvider, {
|
|
193
180
|
value: (0, _extends2["default"])({}, translators, {
|
|
194
181
|
userLanguage: _TranslationContext.DEFAULT_USER_LANGUAGE
|
|
@@ -196,7 +183,7 @@ var OverlayProvider = function OverlayProvider(props) {
|
|
|
196
183
|
__self: _this,
|
|
197
184
|
__source: {
|
|
198
185
|
fileName: _jsxFileName,
|
|
199
|
-
lineNumber:
|
|
186
|
+
lineNumber: 214,
|
|
200
187
|
columnNumber: 5
|
|
201
188
|
}
|
|
202
189
|
}, _react["default"].createElement(_OverlayContext.OverlayContext.Provider, {
|
|
@@ -204,14 +191,14 @@ var OverlayProvider = function OverlayProvider(props) {
|
|
|
204
191
|
__self: _this,
|
|
205
192
|
__source: {
|
|
206
193
|
fileName: _jsxFileName,
|
|
207
|
-
lineNumber:
|
|
194
|
+
lineNumber: 215,
|
|
208
195
|
columnNumber: 7
|
|
209
196
|
}
|
|
210
197
|
}, _react["default"].createElement(_MessageOverlayContext.MessageOverlayProvider, {
|
|
211
198
|
__self: _this,
|
|
212
199
|
__source: {
|
|
213
200
|
fileName: _jsxFileName,
|
|
214
|
-
lineNumber:
|
|
201
|
+
lineNumber: 216,
|
|
215
202
|
columnNumber: 9
|
|
216
203
|
}
|
|
217
204
|
}, _react["default"].createElement(_AttachmentPickerContext.AttachmentPickerProvider, {
|
|
@@ -219,14 +206,14 @@ var OverlayProvider = function OverlayProvider(props) {
|
|
|
219
206
|
__self: _this,
|
|
220
207
|
__source: {
|
|
221
208
|
fileName: _jsxFileName,
|
|
222
|
-
lineNumber:
|
|
209
|
+
lineNumber: 217,
|
|
223
210
|
columnNumber: 11
|
|
224
211
|
}
|
|
225
212
|
}, _react["default"].createElement(_ImageGalleryContext.ImageGalleryProvider, {
|
|
226
213
|
__self: _this,
|
|
227
214
|
__source: {
|
|
228
215
|
fileName: _jsxFileName,
|
|
229
|
-
lineNumber:
|
|
216
|
+
lineNumber: 218,
|
|
230
217
|
columnNumber: 13
|
|
231
218
|
}
|
|
232
219
|
}, children, _react["default"].createElement(_ThemeContext.ThemeProvider, {
|
|
@@ -234,7 +221,7 @@ var OverlayProvider = function OverlayProvider(props) {
|
|
|
234
221
|
__self: _this,
|
|
235
222
|
__source: {
|
|
236
223
|
fileName: _jsxFileName,
|
|
237
|
-
lineNumber:
|
|
224
|
+
lineNumber: 220,
|
|
238
225
|
columnNumber: 15
|
|
239
226
|
}
|
|
240
227
|
}, _react["default"].createElement(_reactNativeReanimated["default"].View, {
|
|
@@ -243,7 +230,7 @@ var OverlayProvider = function OverlayProvider(props) {
|
|
|
243
230
|
__self: _this,
|
|
244
231
|
__source: {
|
|
245
232
|
fileName: _jsxFileName,
|
|
246
|
-
lineNumber:
|
|
233
|
+
lineNumber: 221,
|
|
247
234
|
columnNumber: 17
|
|
248
235
|
}
|
|
249
236
|
}, _react["default"].createElement(_OverlayBackdrop.OverlayBackdrop, {
|
|
@@ -254,7 +241,7 @@ var OverlayProvider = function OverlayProvider(props) {
|
|
|
254
241
|
__self: _this,
|
|
255
242
|
__source: {
|
|
256
243
|
fileName: _jsxFileName,
|
|
257
|
-
lineNumber:
|
|
244
|
+
lineNumber: 225,
|
|
258
245
|
columnNumber: 19
|
|
259
246
|
}
|
|
260
247
|
})), overlay === 'message' && _react["default"].createElement(_MessageOverlay.MessageOverlay, {
|
|
@@ -268,7 +255,7 @@ var OverlayProvider = function OverlayProvider(props) {
|
|
|
268
255
|
__self: _this,
|
|
269
256
|
__source: {
|
|
270
257
|
fileName: _jsxFileName,
|
|
271
|
-
lineNumber:
|
|
258
|
+
lineNumber: 228,
|
|
272
259
|
columnNumber: 19
|
|
273
260
|
}
|
|
274
261
|
}), overlay === 'gallery' && _react["default"].createElement(_ImageGallery.ImageGallery, {
|
|
@@ -281,7 +268,7 @@ var OverlayProvider = function OverlayProvider(props) {
|
|
|
281
268
|
__self: _this,
|
|
282
269
|
__source: {
|
|
283
270
|
fileName: _jsxFileName,
|
|
284
|
-
lineNumber:
|
|
271
|
+
lineNumber: 239,
|
|
285
272
|
columnNumber: 19
|
|
286
273
|
}
|
|
287
274
|
}), _react["default"].createElement(_AttachmentPicker.AttachmentPicker, (0, _extends2["default"])({
|
|
@@ -290,7 +277,7 @@ var OverlayProvider = function OverlayProvider(props) {
|
|
|
290
277
|
__self: _this,
|
|
291
278
|
__source: {
|
|
292
279
|
fileName: _jsxFileName,
|
|
293
|
-
lineNumber:
|
|
280
|
+
lineNumber: 248,
|
|
294
281
|
columnNumber: 17
|
|
295
282
|
}
|
|
296
283
|
}))))))));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_react","_interopRequireWildcard","require","_reactNative","_reactNativeReanimated","_dayjs","_interopRequireDefault","_OverlayContext","_AttachmentPicker","_AttachmentPickerBottomSheetHandle","_AttachmentPickerError","_AttachmentPickerErrorImage","_CameraSelectorIcon","_FileSelectorIcon","_ImageOverlaySelectedComponent","_ImageSelectorIcon","_ImageGallery","_MessageOverlay","_OverlayBackdrop","_useStreami18n","_AttachmentPickerContext","_ImageGalleryContext","_MessageOverlayContext","_ThemeContext","_TranslationContext","_this","_jsxFileName","_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","obj","__esModule","_typeof","cache","has","get","newObj","hasPropertyDescriptor","Object","defineProperty","getOwnPropertyDescriptor","key","prototype","hasOwnProperty","call","desc","set","OverlayProvider","props","bottomSheetCloseTimeoutRef","useRef","_props$AttachmentPick","AttachmentPickerBottomSheetHandle","DefaultAttachmentPickerBottomSheetHandle","attachmentPickerBottomSheetHandleHeight","attachmentPickerBottomSheetHeight","_props$AttachmentPick2","AttachmentPickerError","DefaultAttachmentPickerError","attachmentPickerErrorButtonText","_props$AttachmentPick3","AttachmentPickerErrorImage","DefaultAttachmentPickerErrorImage","attachmentPickerErrorText","attachmentSelectionBarHeight","bottomInset","_props$CameraSelector","CameraSelectorIcon","DefaultCameraSelectorIcon","children","_props$closePicker","closePicker","ref","_ref$current","current","close","clearTimeout","setTimeout","_ref$current2","_props$FileSelectorIc","FileSelectorIcon","DefaultFileSelectorIcon","giphyVersion","i18nInstance","imageGalleryCustomComponents","imageGalleryGridHandleHeight","imageGalleryGridSnapPoints","_props$ImageOverlaySe","ImageOverlaySelectedComponent","DefaultImageOverlaySelectedComponent","_props$ImageSelectorI","ImageSelectorIcon","DefaultImageSelectorIcon","MessageActionList","MessageActionListItem","messageTextNumberOfLines","numberOfAttachmentImagesToLoadPerCall","numberOfAttachmentPickerImageColumns","numberOfImageGalleryGridColumns","_props$openPicker","openPicker","_ref$current3","snapToIndex","console","warn","topInset","translucentStatusBar","OverlayReactionList","OverlayReactions","OverlayReactionsAvatar","value","attachmentPickerProps","bottomSheetRef","_useState","useState","t","tDateTimeParser","input","Dayjs","_useState2","_slicedToArray2","translators","setTranslators","_useState3","overlay","_useState4","setOverlay","overlayOpacity","useSharedValue","_Dimensions$get","Dimensions","height","width","loadingTranslators","useStreami18n","useEffect","backAction","backHandler","BackHandler","addEventListener","remove","cancelAnimation","withTiming","attachmentPickerContext","overlayStyle","useAnimatedStyle","opacity","overlayContext","style","createElement","TranslationProvider","_extends2","userLanguage","DEFAULT_USER_LANGUAGE","__self","__source","fileName","lineNumber","columnNumber","OverlayContext","Provider","MessageOverlayProvider","AttachmentPickerProvider","ImageGalleryProvider","ThemeProvider","View","pointerEvents","StyleSheet","absoluteFill","OverlayBackdrop","MessageOverlay","ImageGallery","AttachmentPicker","exports"],"sources":["OverlayProvider.tsx"],"sourcesContent":["import React, { PropsWithChildren, useEffect, useRef, useState } from 'react';\n\nimport { BackHandler, Dimensions, StyleSheet, ViewStyle } from 'react-native';\n\nimport Animated, {\n cancelAnimation,\n useAnimatedStyle,\n useSharedValue,\n withTiming,\n} from 'react-native-reanimated';\n\nimport type BottomSheet from '@gorhom/bottom-sheet';\nimport Dayjs from 'dayjs';\n\nimport { OverlayContext, OverlayProviderProps } from './OverlayContext';\n\nimport { AttachmentPicker } from '../../components/AttachmentPicker/AttachmentPicker';\n\nimport { AttachmentPickerBottomSheetHandle as DefaultAttachmentPickerBottomSheetHandle } from '../../components/AttachmentPicker/components/AttachmentPickerBottomSheetHandle';\nimport { AttachmentPickerError as DefaultAttachmentPickerError } from '../../components/AttachmentPicker/components/AttachmentPickerError';\nimport { AttachmentPickerErrorImage as DefaultAttachmentPickerErrorImage } from '../../components/AttachmentPicker/components/AttachmentPickerErrorImage';\nimport { CameraSelectorIcon as DefaultCameraSelectorIcon } from '../../components/AttachmentPicker/components/CameraSelectorIcon';\nimport { FileSelectorIcon as DefaultFileSelectorIcon } from '../../components/AttachmentPicker/components/FileSelectorIcon';\nimport { ImageOverlaySelectedComponent as DefaultImageOverlaySelectedComponent } from '../../components/AttachmentPicker/components/ImageOverlaySelectedComponent';\nimport { ImageSelectorIcon as DefaultImageSelectorIcon } from '../../components/AttachmentPicker/components/ImageSelectorIcon';\nimport { ImageGallery } from '../../components/ImageGallery/ImageGallery';\nimport { MessageOverlay } from '../../components/MessageOverlay/MessageOverlay';\nimport { OverlayBackdrop } from '../../components/MessageOverlay/OverlayBackdrop';\nimport { useStreami18n } from '../../hooks/useStreami18n';\n\nimport type { DefaultStreamChatGenerics } from '../../types/types';\nimport { AttachmentPickerProvider } from '../attachmentPickerContext/AttachmentPickerContext';\nimport { ImageGalleryProvider } from '../imageGalleryContext/ImageGalleryContext';\nimport { MessageOverlayProvider } from '../messageOverlayContext/MessageOverlayContext';\nimport { ThemeProvider } from '../themeContext/ThemeContext';\nimport {\n DEFAULT_USER_LANGUAGE,\n TranslationProvider,\n TranslatorFunctions,\n} from '../translationContext/TranslationContext';\n\n/**\n * - The highest level of these components is the `OverlayProvider`. The `OverlayProvider` allows users to interact with messages on long press above the underlying views, use the full screen image viewer, and use the `AttachmentPicker` as a keyboard-esk view.\n * Because these views must exist above all others `OverlayProvider` should wrap your navigation stack as well. Assuming [`React Navigation`](https://reactnavigation.org/) is being used, your highest level navigation stack should be wrapped in the provider:\n *\n * ```js\n * <NavigationContainer>\n * <OverlayProvider>\n * <Stack.Navigator>\n * <Stack.Screen />\n * </Stack.Navigator>\n * </OverlayProvider>\n * </NavigationContainer>\n * ```\n *\n * - Don't forget to check our cookbook section of [OverlayProvider](https://github.com/GetStream/stream-chat-react-native/wiki/Cookbook-v3.0#overlayprovider)\n *\n * - Also check the [visual component guide](https://github.com/GetStream/stream-chat-react-native/wiki/Cookbook-v3.0#custom-components), to learn about component customizations.\n *\n * @example ./OverlayProvider.md\n */\nexport const OverlayProvider = <\n StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics,\n>(\n props: PropsWithChildren<OverlayProviderProps<StreamChatGenerics>>,\n) => {\n const bottomSheetCloseTimeoutRef = useRef<NodeJS.Timeout>();\n const {\n AttachmentPickerBottomSheetHandle = DefaultAttachmentPickerBottomSheetHandle,\n attachmentPickerBottomSheetHandleHeight,\n attachmentPickerBottomSheetHeight,\n AttachmentPickerError = DefaultAttachmentPickerError,\n attachmentPickerErrorButtonText,\n AttachmentPickerErrorImage = DefaultAttachmentPickerErrorImage,\n attachmentPickerErrorText,\n attachmentSelectionBarHeight,\n bottomInset,\n CameraSelectorIcon = DefaultCameraSelectorIcon,\n children,\n closePicker = (ref) => {\n if (ref.current?.close) {\n if (bottomSheetCloseTimeoutRef.current) {\n clearTimeout(bottomSheetCloseTimeoutRef.current);\n }\n ref.current.close();\n // Attempt to close the bottomsheet again to circumvent accidental opening on Android.\n // Details: This to prevent a race condition where the close function is called during the point when a internal container layout happens within the bottomsheet due to keyboard affecting the layout\n // If the container layout measures a shorter height than previous but if the close snapped to the previous height's position, the bottom sheet will show up\n // this short delay ensures that close function is always called after a container layout due to keyboard change\n // NOTE: this timeout has to be above 500 as the keyboardAnimationDuration is 500 in the bottomsheet library - see src/hooks/useKeyboard.ts there for more details\n bottomSheetCloseTimeoutRef.current = setTimeout(() => {\n ref.current?.close();\n }, 600);\n }\n },\n FileSelectorIcon = DefaultFileSelectorIcon,\n giphyVersion,\n i18nInstance,\n imageGalleryCustomComponents,\n imageGalleryGridHandleHeight,\n imageGalleryGridSnapPoints,\n ImageOverlaySelectedComponent = DefaultImageOverlaySelectedComponent,\n ImageSelectorIcon = DefaultImageSelectorIcon,\n MessageActionList,\n MessageActionListItem,\n messageTextNumberOfLines,\n numberOfAttachmentImagesToLoadPerCall,\n numberOfAttachmentPickerImageColumns,\n numberOfImageGalleryGridColumns,\n openPicker = (ref) => {\n if (bottomSheetCloseTimeoutRef.current) {\n clearTimeout(bottomSheetCloseTimeoutRef.current);\n }\n if (ref.current?.snapToIndex) {\n ref.current.snapToIndex(0);\n } else {\n console.warn('bottom and top insets must be set for the image picker to work correctly');\n }\n },\n topInset,\n translucentStatusBar,\n OverlayReactionList,\n OverlayReactions,\n OverlayReactionsAvatar,\n value,\n } = props;\n\n const attachmentPickerProps = {\n AttachmentPickerBottomSheetHandle,\n attachmentPickerBottomSheetHandleHeight,\n attachmentPickerBottomSheetHeight,\n AttachmentPickerError,\n attachmentPickerErrorButtonText,\n AttachmentPickerErrorImage,\n attachmentPickerErrorText,\n attachmentSelectionBarHeight,\n ImageOverlaySelectedComponent,\n numberOfAttachmentImagesToLoadPerCall,\n numberOfAttachmentPickerImageColumns,\n translucentStatusBar,\n };\n\n const bottomSheetRef = useRef<BottomSheet>(null);\n\n const [translators, setTranslators] = useState<TranslatorFunctions>({\n t: (key: string) => key,\n tDateTimeParser: (input?: string | number | Date) => Dayjs(input),\n });\n const [overlay, setOverlay] = useState(value?.overlay || 'none');\n\n const overlayOpacity = useSharedValue(0);\n const { height, width } = Dimensions.get('screen');\n\n // Setup translators\n const loadingTranslators = useStreami18n(setTranslators, i18nInstance);\n\n useEffect(() => {\n const backAction = () => {\n if (overlay !== 'none') {\n setOverlay('none');\n return true;\n }\n\n return false;\n };\n\n const backHandler = BackHandler.addEventListener('hardwareBackPress', backAction);\n\n return () => backHandler.remove();\n }, [overlay]);\n\n useEffect(\n () =>\n // cleanup the timeout if the component unmounts\n () => {\n if (bottomSheetCloseTimeoutRef.current) {\n clearTimeout(bottomSheetCloseTimeoutRef.current);\n }\n },\n [],\n );\n\n useEffect(() => {\n closePicker(bottomSheetRef);\n cancelAnimation(overlayOpacity);\n if (overlay !== 'none') {\n overlayOpacity.value = withTiming(1);\n } else {\n overlayOpacity.value = withTiming(0);\n }\n }, [overlay]);\n\n const attachmentPickerContext = {\n attachmentPickerBottomSheetHeight,\n attachmentSelectionBarHeight,\n bottomInset,\n CameraSelectorIcon,\n closePicker: () => closePicker(bottomSheetRef),\n FileSelectorIcon,\n ImageSelectorIcon,\n openPicker: () => openPicker(bottomSheetRef),\n topInset,\n };\n\n const overlayStyle = useAnimatedStyle<ViewStyle>(\n () => ({\n opacity: overlayOpacity.value,\n }),\n [],\n );\n\n const overlayContext = {\n overlay,\n setOverlay,\n style: value?.style,\n translucentStatusBar,\n };\n\n if (loadingTranslators) return null;\n\n return (\n <TranslationProvider value={{ ...translators, userLanguage: DEFAULT_USER_LANGUAGE }}>\n <OverlayContext.Provider value={overlayContext}>\n <MessageOverlayProvider<StreamChatGenerics>>\n <AttachmentPickerProvider value={attachmentPickerContext}>\n <ImageGalleryProvider>\n {children}\n <ThemeProvider style={overlayContext.style}>\n <Animated.View\n pointerEvents={overlay === 'none' ? 'none' : 'auto'}\n style={[StyleSheet.absoluteFill, overlayStyle]}\n >\n <OverlayBackdrop style={[StyleSheet.absoluteFill, { height, width }]} />\n </Animated.View>\n {overlay === 'message' && (\n <MessageOverlay<StreamChatGenerics>\n MessageActionList={MessageActionList}\n MessageActionListItem={MessageActionListItem}\n messageTextNumberOfLines={messageTextNumberOfLines}\n overlayOpacity={overlayOpacity}\n OverlayReactionList={OverlayReactionList}\n OverlayReactions={OverlayReactions}\n OverlayReactionsAvatar={OverlayReactionsAvatar}\n />\n )}\n {overlay === 'gallery' && (\n <ImageGallery<StreamChatGenerics>\n giphyVersion={giphyVersion}\n imageGalleryCustomComponents={imageGalleryCustomComponents}\n imageGalleryGridHandleHeight={imageGalleryGridHandleHeight}\n imageGalleryGridSnapPoints={imageGalleryGridSnapPoints}\n numberOfImageGalleryGridColumns={numberOfImageGalleryGridColumns}\n overlayOpacity={overlayOpacity}\n />\n )}\n <AttachmentPicker ref={bottomSheetRef} {...attachmentPickerProps} />\n </ThemeProvider>\n </ImageGalleryProvider>\n </AttachmentPickerProvider>\n </MessageOverlayProvider>\n </OverlayContext.Provider>\n </TranslationProvider>\n );\n};\n"],"mappings":";;;;;;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AAEA,IAAAC,YAAA,GAAAD,OAAA;AAEA,IAAAE,sBAAA,GAAAH,uBAAA,CAAAC,OAAA;AAQA,IAAAG,MAAA,GAAAC,sBAAA,CAAAJ,OAAA;AAEA,IAAAK,eAAA,GAAAL,OAAA;AAEA,IAAAM,iBAAA,GAAAN,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AA,EAElD,EACAlC,OAAO,KAAK,SAAS,IACpB9H,MAAA,YAAAuJ,aAAA,CAACvI,aAAA,CAAA6J,YAAY;IACXzF,YAAY,EAAEA,YAAa;IAC3BE,4BAA4B,EAAEA,4BAA6B;IAC3DC,4BAA4B,EAAEA,4BAA6B;IAC3DC,0BAA0B,EAAEA,0BAA2B;IACvDY,+BAA+B,EAAEA,+BAAgC;IACjE6B,cAAc,EAAEA,cAAe;IAAA2B,MAAA,EAAAnI,KAAA;IAAAoI,QAAA;MAAAC,QAAA,EAAApI,YAAA;MAAAqI,UAAA;MAAAC,YAAA;IAAA;EAAA,EAElC,EACDhK,MAAA,YAAAuJ,aAAA,CAAC/I,iBAAA,CAAAsK,gBAAgB,MAAArB,SAAA;IAAC/E,GAAG,EAAEwC;EAAe,GAAKD,qBAAqB;IAAA2C,MAAA,EAAAnI,KAAA;IAAAoI,QAAA;MAAAC,QAAA,EAAApI,YAAA;MAAAqI,UAAA;MAAAC,YAAA;IAAA;EAAA,GAAI,CACtD,CACK,CACE,CACJ,CACD,CACN;AAE1B,CAAC;AAACe,OAAA,CAAA9H,eAAA,GAAAA,eAAA"}
|
|
1
|
+
{"version":3,"names":["_react","_interopRequireWildcard","require","_reactNative","_reactNativeReanimated","_OverlayContext","_AttachmentPicker","_AttachmentPickerBottomSheetHandle","_AttachmentPickerError","_AttachmentPickerErrorImage","_CameraSelectorIcon","_FileSelectorIcon","_ImageOverlaySelectedComponent","_ImageSelectorIcon","_ImageGallery","_MessageOverlay","_OverlayBackdrop","_useStreami18n","_AttachmentPickerContext","_ImageGalleryContext","_MessageOverlayContext","_ThemeContext","_TranslationContext","_this","_jsxFileName","_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","obj","__esModule","_typeof","cache","has","get","newObj","hasPropertyDescriptor","Object","defineProperty","getOwnPropertyDescriptor","key","prototype","hasOwnProperty","call","desc","set","OverlayProvider","props","bottomSheetCloseTimeoutRef","useRef","_props$AttachmentPick","AttachmentPickerBottomSheetHandle","DefaultAttachmentPickerBottomSheetHandle","attachmentPickerBottomSheetHandleHeight","attachmentPickerBottomSheetHeight","_props$AttachmentPick2","AttachmentPickerError","DefaultAttachmentPickerError","attachmentPickerErrorButtonText","_props$AttachmentPick3","AttachmentPickerErrorImage","DefaultAttachmentPickerErrorImage","attachmentPickerErrorText","attachmentSelectionBarHeight","bottomInset","_props$CameraSelector","CameraSelectorIcon","DefaultCameraSelectorIcon","children","_props$closePicker","closePicker","ref","_ref$current","current","close","clearTimeout","setTimeout","_ref$current2","_props$FileSelectorIc","FileSelectorIcon","DefaultFileSelectorIcon","giphyVersion","i18nInstance","imageGalleryCustomComponents","imageGalleryGridHandleHeight","imageGalleryGridSnapPoints","_props$ImageOverlaySe","ImageOverlaySelectedComponent","DefaultImageOverlaySelectedComponent","_props$ImageSelectorI","ImageSelectorIcon","DefaultImageSelectorIcon","MessageActionList","MessageActionListItem","messageTextNumberOfLines","numberOfAttachmentImagesToLoadPerCall","numberOfAttachmentPickerImageColumns","numberOfImageGalleryGridColumns","_props$openPicker","openPicker","_ref$current3","snapToIndex","console","warn","topInset","translucentStatusBar","OverlayReactionList","OverlayReactions","OverlayReactionsAvatar","value","attachmentPickerProps","bottomSheetRef","_useState","useState","overlay","_useState2","_slicedToArray2","setOverlay","overlayOpacity","useSharedValue","_Dimensions$get","Dimensions","height","width","translators","useStreami18n","useEffect","backAction","backHandler","BackHandler","addEventListener","remove","cancelAnimation","withTiming","attachmentPickerContext","overlayStyle","useAnimatedStyle","opacity","overlayContext","style","createElement","TranslationProvider","_extends2","userLanguage","DEFAULT_USER_LANGUAGE","__self","__source","fileName","lineNumber","columnNumber","OverlayContext","Provider","MessageOverlayProvider","AttachmentPickerProvider","ImageGalleryProvider","ThemeProvider","View","pointerEvents","StyleSheet","absoluteFill","OverlayBackdrop","MessageOverlay","ImageGallery","AttachmentPicker","exports"],"sources":["OverlayProvider.tsx"],"sourcesContent":["import React, { PropsWithChildren, useEffect, useRef, useState } from 'react';\n\nimport { BackHandler, Dimensions, StyleSheet, ViewStyle } from 'react-native';\n\nimport Animated, {\n cancelAnimation,\n useAnimatedStyle,\n useSharedValue,\n withTiming,\n} from 'react-native-reanimated';\n\nimport type BottomSheet from '@gorhom/bottom-sheet';\n\nimport { OverlayContext, OverlayProviderProps } from './OverlayContext';\n\nimport { AttachmentPicker } from '../../components/AttachmentPicker/AttachmentPicker';\n\nimport { AttachmentPickerBottomSheetHandle as DefaultAttachmentPickerBottomSheetHandle } from '../../components/AttachmentPicker/components/AttachmentPickerBottomSheetHandle';\nimport { AttachmentPickerError as DefaultAttachmentPickerError } from '../../components/AttachmentPicker/components/AttachmentPickerError';\nimport { AttachmentPickerErrorImage as DefaultAttachmentPickerErrorImage } from '../../components/AttachmentPicker/components/AttachmentPickerErrorImage';\nimport { CameraSelectorIcon as DefaultCameraSelectorIcon } from '../../components/AttachmentPicker/components/CameraSelectorIcon';\nimport { FileSelectorIcon as DefaultFileSelectorIcon } from '../../components/AttachmentPicker/components/FileSelectorIcon';\nimport { ImageOverlaySelectedComponent as DefaultImageOverlaySelectedComponent } from '../../components/AttachmentPicker/components/ImageOverlaySelectedComponent';\nimport { ImageSelectorIcon as DefaultImageSelectorIcon } from '../../components/AttachmentPicker/components/ImageSelectorIcon';\nimport { ImageGallery } from '../../components/ImageGallery/ImageGallery';\nimport { MessageOverlay } from '../../components/MessageOverlay/MessageOverlay';\nimport { OverlayBackdrop } from '../../components/MessageOverlay/OverlayBackdrop';\nimport { useStreami18n } from '../../hooks/useStreami18n';\n\nimport type { DefaultStreamChatGenerics } from '../../types/types';\nimport { AttachmentPickerProvider } from '../attachmentPickerContext/AttachmentPickerContext';\nimport { ImageGalleryProvider } from '../imageGalleryContext/ImageGalleryContext';\nimport { MessageOverlayProvider } from '../messageOverlayContext/MessageOverlayContext';\nimport { ThemeProvider } from '../themeContext/ThemeContext';\nimport {\n DEFAULT_USER_LANGUAGE,\n TranslationProvider,\n} from '../translationContext/TranslationContext';\n\n/**\n * - The highest level of these components is the `OverlayProvider`. The `OverlayProvider` allows users to interact with messages on long press above the underlying views, use the full screen image viewer, and use the `AttachmentPicker` as a keyboard-esk view.\n * Because these views must exist above all others `OverlayProvider` should wrap your navigation stack as well. Assuming [`React Navigation`](https://reactnavigation.org/) is being used, your highest level navigation stack should be wrapped in the provider:\n *\n * ```js\n * <NavigationContainer>\n * <OverlayProvider>\n * <Stack.Navigator>\n * <Stack.Screen />\n * </Stack.Navigator>\n * </OverlayProvider>\n * </NavigationContainer>\n * ```\n *\n * - Don't forget to check our cookbook section of [OverlayProvider](https://github.com/GetStream/stream-chat-react-native/wiki/Cookbook-v3.0#overlayprovider)\n *\n * - Also check the [visual component guide](https://github.com/GetStream/stream-chat-react-native/wiki/Cookbook-v3.0#custom-components), to learn about component customizations.\n *\n * @example ./OverlayProvider.md\n */\nexport const OverlayProvider = <\n StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics,\n>(\n props: PropsWithChildren<OverlayProviderProps<StreamChatGenerics>>,\n) => {\n const bottomSheetCloseTimeoutRef = useRef<NodeJS.Timeout>();\n const {\n AttachmentPickerBottomSheetHandle = DefaultAttachmentPickerBottomSheetHandle,\n attachmentPickerBottomSheetHandleHeight,\n attachmentPickerBottomSheetHeight,\n AttachmentPickerError = DefaultAttachmentPickerError,\n attachmentPickerErrorButtonText,\n AttachmentPickerErrorImage = DefaultAttachmentPickerErrorImage,\n attachmentPickerErrorText,\n attachmentSelectionBarHeight,\n bottomInset,\n CameraSelectorIcon = DefaultCameraSelectorIcon,\n children,\n closePicker = (ref) => {\n if (ref.current?.close) {\n if (bottomSheetCloseTimeoutRef.current) {\n clearTimeout(bottomSheetCloseTimeoutRef.current);\n }\n ref.current.close();\n // Attempt to close the bottomsheet again to circumvent accidental opening on Android.\n // Details: This to prevent a race condition where the close function is called during the point when a internal container layout happens within the bottomsheet due to keyboard affecting the layout\n // If the container layout measures a shorter height than previous but if the close snapped to the previous height's position, the bottom sheet will show up\n // this short delay ensures that close function is always called after a container layout due to keyboard change\n // NOTE: this timeout has to be above 500 as the keyboardAnimationDuration is 500 in the bottomsheet library - see src/hooks/useKeyboard.ts there for more details\n bottomSheetCloseTimeoutRef.current = setTimeout(() => {\n ref.current?.close();\n }, 600);\n }\n },\n FileSelectorIcon = DefaultFileSelectorIcon,\n giphyVersion,\n i18nInstance,\n imageGalleryCustomComponents,\n imageGalleryGridHandleHeight,\n imageGalleryGridSnapPoints,\n ImageOverlaySelectedComponent = DefaultImageOverlaySelectedComponent,\n ImageSelectorIcon = DefaultImageSelectorIcon,\n MessageActionList,\n MessageActionListItem,\n messageTextNumberOfLines,\n numberOfAttachmentImagesToLoadPerCall,\n numberOfAttachmentPickerImageColumns,\n numberOfImageGalleryGridColumns,\n openPicker = (ref) => {\n if (bottomSheetCloseTimeoutRef.current) {\n clearTimeout(bottomSheetCloseTimeoutRef.current);\n }\n if (ref.current?.snapToIndex) {\n ref.current.snapToIndex(0);\n } else {\n console.warn('bottom and top insets must be set for the image picker to work correctly');\n }\n },\n topInset,\n translucentStatusBar,\n OverlayReactionList,\n OverlayReactions,\n OverlayReactionsAvatar,\n value,\n } = props;\n\n const attachmentPickerProps = {\n AttachmentPickerBottomSheetHandle,\n attachmentPickerBottomSheetHandleHeight,\n attachmentPickerBottomSheetHeight,\n AttachmentPickerError,\n attachmentPickerErrorButtonText,\n AttachmentPickerErrorImage,\n attachmentPickerErrorText,\n attachmentSelectionBarHeight,\n ImageOverlaySelectedComponent,\n numberOfAttachmentImagesToLoadPerCall,\n numberOfAttachmentPickerImageColumns,\n translucentStatusBar,\n };\n\n const bottomSheetRef = useRef<BottomSheet>(null);\n\n const [overlay, setOverlay] = useState(value?.overlay || 'none');\n\n const overlayOpacity = useSharedValue(0);\n const { height, width } = Dimensions.get('screen');\n\n // Setup translators\n const translators = useStreami18n(i18nInstance);\n\n useEffect(() => {\n const backAction = () => {\n if (overlay !== 'none') {\n setOverlay('none');\n return true;\n }\n\n return false;\n };\n\n const backHandler = BackHandler.addEventListener('hardwareBackPress', backAction);\n\n return () => backHandler.remove();\n }, [overlay]);\n\n useEffect(\n () =>\n // cleanup the timeout if the component unmounts\n () => {\n if (bottomSheetCloseTimeoutRef.current) {\n clearTimeout(bottomSheetCloseTimeoutRef.current);\n }\n },\n [],\n );\n\n useEffect(() => {\n closePicker(bottomSheetRef);\n cancelAnimation(overlayOpacity);\n if (overlay !== 'none') {\n overlayOpacity.value = withTiming(1);\n } else {\n overlayOpacity.value = withTiming(0);\n }\n }, [overlay]);\n\n const attachmentPickerContext = {\n attachmentPickerBottomSheetHeight,\n attachmentSelectionBarHeight,\n bottomInset,\n CameraSelectorIcon,\n closePicker: () => closePicker(bottomSheetRef),\n FileSelectorIcon,\n ImageSelectorIcon,\n openPicker: () => openPicker(bottomSheetRef),\n topInset,\n };\n\n const overlayStyle = useAnimatedStyle<ViewStyle>(\n () => ({\n opacity: overlayOpacity.value,\n }),\n [],\n );\n\n const overlayContext = {\n overlay,\n setOverlay,\n style: value?.style,\n translucentStatusBar,\n };\n\n return (\n <TranslationProvider value={{ ...translators, userLanguage: DEFAULT_USER_LANGUAGE }}>\n <OverlayContext.Provider value={overlayContext}>\n <MessageOverlayProvider<StreamChatGenerics>>\n <AttachmentPickerProvider value={attachmentPickerContext}>\n <ImageGalleryProvider>\n {children}\n <ThemeProvider style={overlayContext.style}>\n <Animated.View\n pointerEvents={overlay === 'none' ? 'none' : 'auto'}\n style={[StyleSheet.absoluteFill, overlayStyle]}\n >\n <OverlayBackdrop style={[StyleSheet.absoluteFill, { height, width }]} />\n </Animated.View>\n {overlay === 'message' && (\n <MessageOverlay<StreamChatGenerics>\n MessageActionList={MessageActionList}\n MessageActionListItem={MessageActionListItem}\n messageTextNumberOfLines={messageTextNumberOfLines}\n overlayOpacity={overlayOpacity}\n OverlayReactionList={OverlayReactionList}\n OverlayReactions={OverlayReactions}\n OverlayReactionsAvatar={OverlayReactionsAvatar}\n />\n )}\n {overlay === 'gallery' && (\n <ImageGallery<StreamChatGenerics>\n giphyVersion={giphyVersion}\n imageGalleryCustomComponents={imageGalleryCustomComponents}\n imageGalleryGridHandleHeight={imageGalleryGridHandleHeight}\n imageGalleryGridSnapPoints={imageGalleryGridSnapPoints}\n numberOfImageGalleryGridColumns={numberOfImageGalleryGridColumns}\n overlayOpacity={overlayOpacity}\n />\n )}\n <AttachmentPicker ref={bottomSheetRef} {...attachmentPickerProps} />\n </ThemeProvider>\n </ImageGalleryProvider>\n </AttachmentPickerProvider>\n </MessageOverlayProvider>\n </OverlayContext.Provider>\n </TranslationProvider>\n );\n};\n"],"mappings":";;;;;;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AAEA,IAAAC,YAAA,GAAAD,OAAA;AAEA,IAAAE,sBAAA,GAAAH,uBAAA,CAAAC,OAAA;AASA,IAAAG,eAAA,GAAAH,OAAA;AAEA,IAAAI,iBAAA,GAAAJ,OAAA;AAEA,IAAAK,kCAAA,GAAAL,OAAA;AACA,IAAAM,sBAAA,GAAAN,OAAA;AACA,IAAAO,2BAAA,GAAAP,OAAA;AACA,IAAAQ,mBAAA,GAAAR,OAAA;AACA,IAAAS,iBAAA,GAAAT,OAAA;AACA,IAAAU,8BAAA,GAAAV,OAAA;AACA,IAAAW,kBAAA,GAAAX,OAAA;AACA,IAAAY,aAAA,GAAAZ,OAAA;AACA,IAAAa,eAAA,GAAAb,OAAA;AACA,IAAAc,gBAAA,GAAAd,OAAA;AACA,IAAAe,cAAA,GAAAf,OAAA;AAGA,IAAAgB,wBAAA,GAAAhB,OAAA;AACA,IAAAiB,oBAAA,GAAAjB,OAAA;AACA,IAAAkB,sBAAA,GAAAlB,OAAA;AACA,IAAAmB,aAAA,GAAAnB,OAAA;AACA,IAAAoB,mBAAA,GAAApB,OAAA;AAGkD,IAAAqB,KAAA;EAAAC,YAAA;AAAA,SAAAC,yBAAAC,WAAA,eAAAC,OAAA,kCAAAC,iBAAA,OAAAD,OAAA,QAAAE,gBAAA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cAAe;IAC/BZ,mBAAmB,EAAEA,mBAAoB;IACzCC,gBAAgB,EAAEA,gBAAiB;IACnCC,sBAAsB,EAAEA,sBAAuB;IAAAqC,MAAA,EAAA3H,KAAA;IAAA4H,QAAA;MAAAC,QAAA,EAAA5H,YAAA;MAAA6H,UAAA;MAAAC,YAAA;IAAA;EAAA,EAElD,EACAnC,OAAO,KAAK,SAAS,IACpBnH,MAAA,YAAA6I,aAAA,CAAC/H,aAAA,CAAAqJ,YAAY;IACXjF,YAAY,EAAEA,YAAa;IAC3BE,4BAA4B,EAAEA,4BAA6B;IAC3DC,4BAA4B,EAAEA,4BAA6B;IAC3DC,0BAA0B,EAAEA,0BAA2B;IACvDY,+BAA+B,EAAEA,+BAAgC;IACjEqB,cAAc,EAAEA,cAAe;IAAA2B,MAAA,EAAA3H,KAAA;IAAA4H,QAAA;MAAAC,QAAA,EAAA5H,YAAA;MAAA6H,UAAA;MAAAC,YAAA;IAAA;EAAA,EAElC,EACDtJ,MAAA,YAAA6I,aAAA,CAACvI,iBAAA,CAAA8J,gBAAgB,MAAArB,SAAA;IAACvE,GAAG,EAAEwC;EAAe,GAAKD,qBAAqB;IAAAmC,MAAA,EAAA3H,KAAA;IAAA4H,QAAA;MAAAC,QAAA,EAAA5H,YAAA;MAAA6H,UAAA;MAAAC,YAAA;IAAA;EAAA,GAAI,CACtD,CACK,CACE,CACJ,CACD,CACN;AAE1B,CAAC;AAACe,OAAA,CAAAtH,eAAA,GAAAA,eAAA"}
|
|
@@ -6,13 +6,21 @@ exports.useStreami18n = void 0;
|
|
|
6
6
|
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
7
7
|
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
8
8
|
var _react = require("react");
|
|
9
|
+
var _dayjs = _interopRequireDefault(require("dayjs"));
|
|
9
10
|
var _useIsMountedRef = require("./useIsMountedRef");
|
|
10
11
|
var _Streami18n = require("../utils/Streami18n");
|
|
11
|
-
var useStreami18n = function useStreami18n(
|
|
12
|
-
var _useState = (0, _react.useState)(
|
|
12
|
+
var useStreami18n = function useStreami18n(i18nInstance) {
|
|
13
|
+
var _useState = (0, _react.useState)({
|
|
14
|
+
t: function t(key) {
|
|
15
|
+
return key;
|
|
16
|
+
},
|
|
17
|
+
tDateTimeParser: function tDateTimeParser(input) {
|
|
18
|
+
return (0, _dayjs["default"])(input);
|
|
19
|
+
}
|
|
20
|
+
}),
|
|
13
21
|
_useState2 = (0, _slicedToArray2["default"])(_useState, 2),
|
|
14
|
-
|
|
15
|
-
|
|
22
|
+
translators = _useState2[0],
|
|
23
|
+
setTranslators = _useState2[1];
|
|
16
24
|
var isMounted = (0, _useIsMountedRef.useIsMountedRef)();
|
|
17
25
|
(0, _react.useEffect)(function () {
|
|
18
26
|
var streami18n;
|
|
@@ -41,13 +49,12 @@ var useStreami18n = function useStreami18n(setTranslators, i18nInstance) {
|
|
|
41
49
|
streami18n.getTranslators().then(function (translator) {
|
|
42
50
|
if (translator && isMounted.current) setTranslators(translator);
|
|
43
51
|
});
|
|
44
|
-
setLoadingTranslators(false);
|
|
45
52
|
return function () {
|
|
46
53
|
unsubscribeOnTFuncOverrideListener();
|
|
47
54
|
unsubscribeOnLanguageChangeListener();
|
|
48
55
|
};
|
|
49
56
|
}, [i18nInstance]);
|
|
50
|
-
return
|
|
57
|
+
return translators;
|
|
51
58
|
};
|
|
52
59
|
exports.useStreami18n = useStreami18n;
|
|
53
60
|
//# sourceMappingURL=useStreami18n.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_react","require","_useIsMountedRef","_Streami18n","useStreami18n","
|
|
1
|
+
{"version":3,"names":["_react","require","_dayjs","_interopRequireDefault","_useIsMountedRef","_Streami18n","useStreami18n","i18nInstance","_useState","useState","t","key","tDateTimeParser","input","Dayjs","_useState2","_slicedToArray2","translators","setTranslators","isMounted","useIsMountedRef","useEffect","streami18n","Streami18n","language","updateTFunction","prevTranslator","_extends2","_streami18n$addOnLang","addOnLanguageChangeListener","unsubscribeOnLanguageChangeListener","unsubscribe","_streami18n$addOnTFun","addOnTFunctionOverrideListener","unsubscribeOnTFuncOverrideListener","getTranslators","then","translator","current","exports"],"sources":["useStreami18n.ts"],"sourcesContent":["import { useEffect, useState } from 'react';\n\nimport Dayjs from 'dayjs';\n\nimport { useIsMountedRef } from './useIsMountedRef';\n\nimport type { TranslatorFunctions } from '../contexts/translationContext/TranslationContext';\nimport { Streami18n } from '../utils/Streami18n';\n\nexport const useStreami18n = (i18nInstance?: Streami18n) => {\n const [translators, setTranslators] = useState<TranslatorFunctions>({\n t: (key: string) => key,\n tDateTimeParser: (input?: string | number | Date) => Dayjs(input),\n });\n const isMounted = useIsMountedRef();\n\n useEffect(() => {\n let streami18n: Streami18n;\n\n if (i18nInstance instanceof Streami18n) {\n streami18n = i18nInstance;\n } else {\n streami18n = new Streami18n({ language: 'en' });\n }\n\n const updateTFunction = (t: TranslatorFunctions['t']) => {\n setTranslators((prevTranslator) => ({ ...prevTranslator, t }));\n };\n\n const { unsubscribe: unsubscribeOnLanguageChangeListener } =\n streami18n.addOnLanguageChangeListener((t) => {\n updateTFunction(t);\n });\n\n const { unsubscribe: unsubscribeOnTFuncOverrideListener } =\n streami18n.addOnTFunctionOverrideListener((t) => {\n updateTFunction(t);\n });\n\n streami18n.getTranslators().then((translator) => {\n if (translator && isMounted.current) setTranslators(translator);\n });\n\n return () => {\n unsubscribeOnTFuncOverrideListener();\n unsubscribeOnLanguageChangeListener();\n };\n }, [i18nInstance]);\n\n return translators;\n};\n"],"mappings":";;;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AAEA,IAAAC,MAAA,GAAAC,sBAAA,CAAAF,OAAA;AAEA,IAAAG,gBAAA,GAAAH,OAAA;AAGA,IAAAI,WAAA,GAAAJ,OAAA;AAEO,IAAMK,aAAa,GAAG,SAAhBA,aAAaA,CAAIC,YAAyB,EAAK;EAC1D,IAAAC,SAAA,GAAsC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CAAC;IACjE,CAAC,CAAC;IAEF,OAAO,YAAM;MACXH,kCAAkC,EAAE;MACpCJ,mCAAmC,EAAE;IACvC,CAAC;EACH,CAAC,EAAE,CAACvB,YAAY,CAAC,CAAC;EAElB,OAAOU,WAAW;AACpB,CAAC;AAACsB,OAAA,CAAAjC,aAAA,GAAAA,aAAA"}
|
|
@@ -8,7 +8,6 @@ var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends")
|
|
|
8
8
|
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
9
9
|
var _react = _interopRequireWildcard(require("react"));
|
|
10
10
|
var _reactNative = require("react-native");
|
|
11
|
-
var _dayjs = _interopRequireDefault(require("dayjs"));
|
|
12
11
|
var _useAppSettings = require("./hooks/useAppSettings");
|
|
13
12
|
var _useCreateChatContext = require("./hooks/useCreateChatContext");
|
|
14
13
|
var _useIsOnline2 = require("./hooks/useIsOnline");
|
|
@@ -47,25 +46,14 @@ var ChatWithContext = function ChatWithContext(props) {
|
|
|
47
46
|
_useState2 = (0, _slicedToArray2["default"])(_useState, 2),
|
|
48
47
|
channel = _useState2[0],
|
|
49
48
|
setChannel = _useState2[1];
|
|
50
|
-
var
|
|
51
|
-
t: function t(key) {
|
|
52
|
-
return key;
|
|
53
|
-
},
|
|
54
|
-
tDateTimeParser: function tDateTimeParser(input) {
|
|
55
|
-
return (0, _dayjs["default"])(input);
|
|
56
|
-
}
|
|
57
|
-
}),
|
|
58
|
-
_useState4 = (0, _slicedToArray2["default"])(_useState3, 2),
|
|
59
|
-
translators = _useState4[0],
|
|
60
|
-
setTranslators = _useState4[1];
|
|
61
|
-
var loadingTranslators = (0, _useStreami18n.useStreami18n)(setTranslators, i18nInstance);
|
|
49
|
+
var translators = (0, _useStreami18n.useStreami18n)(i18nInstance);
|
|
62
50
|
var _useIsOnline = (0, _useIsOnline2.useIsOnline)(client, closeConnectionOnBackground),
|
|
63
51
|
connectionRecovering = _useIsOnline.connectionRecovering,
|
|
64
52
|
isOnline = _useIsOnline.isOnline;
|
|
65
|
-
var
|
|
66
|
-
|
|
67
|
-
initialisedDatabase =
|
|
68
|
-
setInitialisedDatabase =
|
|
53
|
+
var _useState3 = (0, _react.useState)(false),
|
|
54
|
+
_useState4 = (0, _slicedToArray2["default"])(_useState3, 2),
|
|
55
|
+
initialisedDatabase = _useState4[0],
|
|
56
|
+
setInitialisedDatabase = _useState4[1];
|
|
69
57
|
var mutedUsers = (0, _useMutedUsers.useMutedUsers)(client);
|
|
70
58
|
var debugRef = (0, _DebugContext.useDebugContext)();
|
|
71
59
|
var isDebugModeEnabled = __DEV__ && debugRef && debugRef.current;
|
|
@@ -111,13 +99,12 @@ var ChatWithContext = function ChatWithContext(props) {
|
|
|
111
99
|
client: client,
|
|
112
100
|
enableOfflineSupport: enableOfflineSupport
|
|
113
101
|
});
|
|
114
|
-
if (loadingTranslators) return null;
|
|
115
102
|
return _react["default"].createElement(_ChatContext.ChatProvider, {
|
|
116
103
|
value: chatContext,
|
|
117
104
|
__self: _this,
|
|
118
105
|
__source: {
|
|
119
106
|
fileName: _jsxFileName,
|
|
120
|
-
lineNumber:
|
|
107
|
+
lineNumber: 221,
|
|
121
108
|
columnNumber: 5
|
|
122
109
|
}
|
|
123
110
|
}, _react["default"].createElement(_TranslationContext.TranslationProvider, {
|
|
@@ -127,7 +114,7 @@ var ChatWithContext = function ChatWithContext(props) {
|
|
|
127
114
|
__self: _this,
|
|
128
115
|
__source: {
|
|
129
116
|
fileName: _jsxFileName,
|
|
130
|
-
lineNumber:
|
|
117
|
+
lineNumber: 222,
|
|
131
118
|
columnNumber: 7
|
|
132
119
|
}
|
|
133
120
|
}, _react["default"].createElement(_ThemeContext.ThemeProvider, {
|
|
@@ -135,14 +122,14 @@ var ChatWithContext = function ChatWithContext(props) {
|
|
|
135
122
|
__self: _this,
|
|
136
123
|
__source: {
|
|
137
124
|
fileName: _jsxFileName,
|
|
138
|
-
lineNumber:
|
|
125
|
+
lineNumber: 225,
|
|
139
126
|
columnNumber: 9
|
|
140
127
|
}
|
|
141
128
|
}, _react["default"].createElement(_ChannelsStateContext.ChannelsStateProvider, {
|
|
142
129
|
__self: _this,
|
|
143
130
|
__source: {
|
|
144
131
|
fileName: _jsxFileName,
|
|
145
|
-
lineNumber:
|
|
132
|
+
lineNumber: 226,
|
|
146
133
|
columnNumber: 11
|
|
147
134
|
}
|
|
148
135
|
}, children))));
|
|
@@ -156,7 +143,7 @@ var Chat = function Chat(props) {
|
|
|
156
143
|
__self: _this,
|
|
157
144
|
__source: {
|
|
158
145
|
fileName: _jsxFileName,
|
|
159
|
-
lineNumber:
|
|
146
|
+
lineNumber: 261,
|
|
160
147
|
columnNumber: 10
|
|
161
148
|
}
|
|
162
149
|
}));
|