stream-chat-react-native-core 5.26.1-beta.2 → 5.27.0-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/commonjs/components/AttachmentPicker/AttachmentPicker.js +7 -11
- package/lib/commonjs/components/AttachmentPicker/AttachmentPicker.js.map +1 -1
- package/lib/commonjs/components/AttachmentPicker/components/AttachmentPickerIOSSelectMorePhotos.js +27 -0
- package/lib/commonjs/components/AttachmentPicker/components/AttachmentPickerIOSSelectMorePhotos.js.map +1 -0
- package/lib/commonjs/components/Chat/Chat.js +12 -5
- package/lib/commonjs/components/Chat/Chat.js.map +1 -1
- package/lib/commonjs/components/Chat/hooks/useCreateChatContext.js +2 -0
- package/lib/commonjs/components/Chat/hooks/useCreateChatContext.js.map +1 -1
- package/lib/commonjs/contexts/chatContext/ChatContext.js +2 -2
- package/lib/commonjs/contexts/chatContext/ChatContext.js.map +1 -1
- package/lib/commonjs/contexts/overlayContext/OverlayProvider.js +15 -11
- package/lib/commonjs/contexts/overlayContext/OverlayProvider.js.map +1 -1
- package/lib/commonjs/i18n/es.json +32 -32
- package/lib/commonjs/i18n/fr.json +32 -32
- package/lib/commonjs/i18n/he.json +32 -32
- package/lib/commonjs/i18n/hi.json +31 -31
- package/lib/commonjs/i18n/it.json +31 -31
- package/lib/commonjs/i18n/ja.json +31 -31
- package/lib/commonjs/i18n/ko.json +31 -31
- package/lib/commonjs/i18n/nl.json +31 -31
- package/lib/commonjs/i18n/pt-BR.json +31 -31
- package/lib/commonjs/i18n/ru.json +31 -31
- package/lib/commonjs/i18n/tr.json +31 -31
- package/lib/commonjs/index.js +7 -0
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/utils/StreamChatRN.js.map +1 -1
- package/lib/commonjs/version.json +1 -1
- package/lib/module/components/AttachmentPicker/AttachmentPicker.js +7 -11
- package/lib/module/components/AttachmentPicker/AttachmentPicker.js.map +1 -1
- package/lib/module/components/AttachmentPicker/components/AttachmentPickerIOSSelectMorePhotos.js +27 -0
- package/lib/module/components/AttachmentPicker/components/AttachmentPickerIOSSelectMorePhotos.js.map +1 -0
- package/lib/module/components/Chat/Chat.js +12 -5
- package/lib/module/components/Chat/Chat.js.map +1 -1
- package/lib/module/components/Chat/hooks/useCreateChatContext.js +2 -0
- package/lib/module/components/Chat/hooks/useCreateChatContext.js.map +1 -1
- package/lib/module/contexts/chatContext/ChatContext.js +2 -2
- package/lib/module/contexts/chatContext/ChatContext.js.map +1 -1
- package/lib/module/contexts/overlayContext/OverlayProvider.js +15 -11
- package/lib/module/contexts/overlayContext/OverlayProvider.js.map +1 -1
- package/lib/module/i18n/es.json +32 -32
- package/lib/module/i18n/fr.json +32 -32
- package/lib/module/i18n/he.json +32 -32
- package/lib/module/i18n/hi.json +31 -31
- package/lib/module/i18n/it.json +31 -31
- package/lib/module/i18n/ja.json +31 -31
- package/lib/module/i18n/ko.json +31 -31
- package/lib/module/i18n/nl.json +31 -31
- package/lib/module/i18n/pt-BR.json +31 -31
- package/lib/module/i18n/ru.json +31 -31
- package/lib/module/i18n/tr.json +31 -31
- package/lib/module/index.js +7 -0
- package/lib/module/index.js.map +1 -1
- package/lib/module/utils/StreamChatRN.js.map +1 -1
- package/lib/module/version.json +1 -1
- package/lib/typescript/components/AttachmentPicker/AttachmentPicker.d.ts +4 -0
- package/lib/typescript/components/AttachmentPicker/components/AttachmentPickerIOSSelectMorePhotos.d.ts +2 -0
- package/lib/typescript/components/Chat/Chat.d.ts +1 -1
- package/lib/typescript/components/Chat/hooks/useCreateChatContext.d.ts +1 -1
- package/lib/typescript/contexts/chatContext/ChatContext.d.ts +4 -0
- package/lib/typescript/i18n/es.json +32 -32
- package/lib/typescript/i18n/fr.json +32 -32
- package/lib/typescript/i18n/he.json +32 -32
- package/lib/typescript/i18n/hi.json +31 -31
- package/lib/typescript/i18n/it.json +31 -31
- package/lib/typescript/i18n/ja.json +31 -31
- package/lib/typescript/i18n/ko.json +31 -31
- package/lib/typescript/i18n/nl.json +31 -31
- package/lib/typescript/i18n/pt-BR.json +31 -31
- package/lib/typescript/i18n/ru.json +31 -31
- package/lib/typescript/i18n/tr.json +31 -31
- package/lib/typescript/index.d.ts +1 -1
- package/lib/typescript/utils/StreamChatRN.d.ts +2 -0
- package/package.json +1 -1
- package/src/components/AttachmentPicker/AttachmentPicker.tsx +8 -19
- package/src/components/AttachmentPicker/components/AttachmentPickerIOSSelectMorePhotos.tsx +10 -0
- package/src/components/Chat/Chat.tsx +7 -1
- package/src/components/Chat/hooks/useCreateChatContext.ts +2 -0
- package/src/contexts/chatContext/ChatContext.tsx +4 -0
- package/src/contexts/overlayContext/OverlayProvider.tsx +3 -0
- package/src/i18n/es.json +32 -32
- package/src/i18n/fr.json +32 -32
- package/src/i18n/he.json +32 -32
- package/src/i18n/hi.json +31 -31
- package/src/i18n/it.json +31 -31
- package/src/i18n/ja.json +31 -31
- package/src/i18n/ko.json +31 -31
- package/src/i18n/nl.json +31 -31
- package/src/i18n/pt-BR.json +31 -31
- package/src/i18n/ru.json +31 -31
- package/src/i18n/tr.json +31 -31
- package/src/index.ts +1 -1
- package/src/utils/StreamChatRN.ts +2 -0
- package/src/version.json +1 -1
|
@@ -1 +1 @@
|
|
|
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 initialisedDatabase,\n });\n\n if (enableOfflineSupport && !initialisedDatabase) {\n return null;\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,wBAAA,YAAAA,yBAAAC,WAAA,WAAAA,WAAA,GAAAG,gBAAA,GAAAD,iBAAA,KAAAF,WAAA;AAAA,SAAAxB,wBAAA4B,GAAA,EAAAJ,WAAA,SAAAA,WAAA,IAAAI,GAAA,IAAAA,GAAA,CAAAC,UAAA,WAAAD,GAAA,QAAAA,GAAA,aAAAE,OAAA,CAAAF,GAAA,yBAAAA,GAAA,uCAAAA,GAAA,UAAAG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AAA,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,EAAG,CAAC;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","_StreamChatRN","_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","_props$resizableCDNHo","resizableCDNHosts","style","_useState","useState","_useState2","_slicedToArray2","channel","setChannel","translators","useStreami18n","_useIsOnline","useIsOnline","connectionRecovering","isOnline","_useState3","_useState4","initialisedDatabase","setInitialisedDatabase","mutedUsers","useMutedUsers","debugRef","useDebugContext","isDebugModeEnabled","__DEV__","current","StreamChatRN","setConfig","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 { StreamChatRN } from '../../utils/StreamChatRN';\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' | 'resizableCDNHosts'>> & {\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 resizableCDNHosts = ['.stream-io-cdn.com'],\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 // Set the `resizableCDNHosts` as per the prop.\n StreamChatRN.setConfig({ resizableCDNHosts });\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 resizableCDNHosts,\n setActiveChannel,\n });\n\n useSyncDatabase({\n client,\n enableOfflineSupport,\n initialisedDatabase,\n });\n\n if (enableOfflineSupport && !initialisedDatabase) {\n return null;\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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eAAe,MAAA4E,SAAA;IAAO5D,KAAK,EAALA;EAAK,GAAQf,KAAK;IAAAqE,MAAA,EAAA/F,KAAA;IAAAgG,QAAA;MAAAC,QAAA,EAAAhG,YAAA;MAAAiG,UAAA;MAAAC,YAAA;IAAA;EAAA,EAAG,CAAC;AACtD,CAAC;AAACW,OAAA,CAAAH,IAAA,GAAAA,IAAA"}
|
|
@@ -12,6 +12,7 @@ var useCreateChatContext = function useCreateChatContext(_ref) {
|
|
|
12
12
|
ImageComponent = _ref.ImageComponent,
|
|
13
13
|
isOnline = _ref.isOnline,
|
|
14
14
|
mutedUsers = _ref.mutedUsers,
|
|
15
|
+
resizableCDNHosts = _ref.resizableCDNHosts,
|
|
15
16
|
setActiveChannel = _ref.setActiveChannel;
|
|
16
17
|
var channelId = channel == null ? void 0 : channel.id;
|
|
17
18
|
var clientValues = client ? "" + client.clientID + Object.keys(client.activeChannels).length + Object.keys(client.listeners).length + client.mutedChannels.length : 'Offline';
|
|
@@ -26,6 +27,7 @@ var useCreateChatContext = function useCreateChatContext(_ref) {
|
|
|
26
27
|
ImageComponent: ImageComponent,
|
|
27
28
|
isOnline: isOnline,
|
|
28
29
|
mutedUsers: mutedUsers,
|
|
30
|
+
resizableCDNHosts: resizableCDNHosts,
|
|
29
31
|
setActiveChannel: setActiveChannel
|
|
30
32
|
};
|
|
31
33
|
}, [channelId, clientValues, connectionRecovering, isOnline, mutedUsersLength]);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_react","require","useCreateChatContext","_ref","appSettings","channel","client","connectionRecovering","enableOfflineSupport","ImageComponent","isOnline","mutedUsers","setActiveChannel","channelId","id","clientValues","clientID","Object","keys","activeChannels","length","listeners","mutedChannels","mutedUsersLength","chatContext","useMemo","exports"],"sources":["useCreateChatContext.ts"],"sourcesContent":["import { useMemo } from 'react';\n\nimport type { ChatContextValue } from '../../../contexts/chatContext/ChatContext';\nimport type { DefaultStreamChatGenerics } from '../../../types/types';\n\nexport const useCreateChatContext = <\n StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics,\n>({\n appSettings,\n channel,\n client,\n connectionRecovering,\n enableOfflineSupport,\n ImageComponent,\n isOnline,\n mutedUsers,\n setActiveChannel,\n}: ChatContextValue<StreamChatGenerics>) => {\n const channelId = channel?.id;\n const clientValues = client\n ? `${client.clientID}${Object.keys(client.activeChannels).length}${\n Object.keys(client.listeners).length\n }${client.mutedChannels.length}`\n : 'Offline';\n const mutedUsersLength = mutedUsers.length;\n\n const chatContext: ChatContextValue<StreamChatGenerics> = useMemo(\n () => ({\n appSettings,\n channel,\n client,\n connectionRecovering,\n enableOfflineSupport,\n ImageComponent,\n isOnline,\n mutedUsers,\n setActiveChannel,\n }),\n [channelId, clientValues, connectionRecovering, isOnline, mutedUsersLength],\n );\n\n return chatContext;\n};\n"],"mappings":";;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AAKO,IAAMC,oBAAoB,GAAG,SAAvBA,oBAAoBA,CAAAC,IAAA,
|
|
1
|
+
{"version":3,"names":["_react","require","useCreateChatContext","_ref","appSettings","channel","client","connectionRecovering","enableOfflineSupport","ImageComponent","isOnline","mutedUsers","resizableCDNHosts","setActiveChannel","channelId","id","clientValues","clientID","Object","keys","activeChannels","length","listeners","mutedChannels","mutedUsersLength","chatContext","useMemo","exports"],"sources":["useCreateChatContext.ts"],"sourcesContent":["import { useMemo } from 'react';\n\nimport type { ChatContextValue } from '../../../contexts/chatContext/ChatContext';\nimport type { DefaultStreamChatGenerics } from '../../../types/types';\n\nexport const useCreateChatContext = <\n StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics,\n>({\n appSettings,\n channel,\n client,\n connectionRecovering,\n enableOfflineSupport,\n ImageComponent,\n isOnline,\n mutedUsers,\n resizableCDNHosts,\n setActiveChannel,\n}: ChatContextValue<StreamChatGenerics>) => {\n const channelId = channel?.id;\n const clientValues = client\n ? `${client.clientID}${Object.keys(client.activeChannels).length}${\n Object.keys(client.listeners).length\n }${client.mutedChannels.length}`\n : 'Offline';\n const mutedUsersLength = mutedUsers.length;\n\n const chatContext: ChatContextValue<StreamChatGenerics> = useMemo(\n () => ({\n appSettings,\n channel,\n client,\n connectionRecovering,\n enableOfflineSupport,\n ImageComponent,\n isOnline,\n mutedUsers,\n resizableCDNHosts,\n setActiveChannel,\n }),\n [channelId, clientValues, connectionRecovering, isOnline, mutedUsersLength],\n );\n\n return chatContext;\n};\n"],"mappings":";;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AAKO,IAAMC,oBAAoB,GAAG,SAAvBA,oBAAoBA,CAAAC,IAAA,EAaW;EAAA,IAV1CC,WAAW,GAAAD,IAAA,CAAXC,WAAW;IACXC,OAAO,GAAAF,IAAA,CAAPE,OAAO;IACPC,MAAM,GAAAH,IAAA,CAANG,MAAM;IACNC,oBAAoB,GAAAJ,IAAA,CAApBI,oBAAoB;IACpBC,oBAAoB,GAAAL,IAAA,CAApBK,oBAAoB;IACpBC,cAAc,GAAAN,IAAA,CAAdM,cAAc;IACdC,QAAQ,GAAAP,IAAA,CAARO,QAAQ;IACRC,UAAU,GAAAR,IAAA,CAAVQ,UAAU;IACVC,iBAAiB,GAAAT,IAAA,CAAjBS,iBAAiB;IACjBC,gBAAgB,GAAAV,IAAA,CAAhBU,gBAAgB;EAEhB,IAAMC,SAAS,GAAGT,OAAO,oBAAPA,OAAO,CAAEU,EAAE;EAC7B,IAAMC,YAAY,GAAGV,MAAM,QACpBA,MAAM,CAACW,QAAQ,GAAGC,MAAM,CAACC,IAAI,CAACb,MAAM,CAACc,cAAc,CAAC,CAACC,MAAM,GAC5DH,MAAM,CAACC,IAAI,CAACb,MAAM,CAACgB,SAAS,CAAC,CAACD,MAAM,GACnCf,MAAM,CAACiB,aAAa,CAACF,MAAM,GAC9B,SAAS;EACb,IAAMG,gBAAgB,GAAGb,UAAU,CAACU,MAAM;EAE1C,IAAMI,WAAiD,GAAG,IAAAC,cAAO,EAC/D;IAAA,OAAO;MACLtB,WAAW,EAAXA,WAAW;MACXC,OAAO,EAAPA,OAAO;MACPC,MAAM,EAANA,MAAM;MACNC,oBAAoB,EAApBA,oBAAoB;MACpBC,oBAAoB,EAApBA,oBAAoB;MACpBC,cAAc,EAAdA,cAAc;MACdC,QAAQ,EAARA,QAAQ;MACRC,UAAU,EAAVA,UAAU;MACVC,iBAAiB,EAAjBA,iBAAiB;MACjBC,gBAAgB,EAAhBA;IACF,CAAC;EAAA,CAAC,EACF,CAACC,SAAS,EAAEE,YAAY,EAAET,oBAAoB,EAAEG,QAAQ,EAAEc,gBAAgB,CAC5E,CAAC;EAED,OAAOC,WAAW;AACpB,CAAC;AAACE,OAAA,CAAAzB,oBAAA,GAAAA,oBAAA"}
|
|
@@ -23,7 +23,7 @@ var ChatProvider = function ChatProvider(_ref) {
|
|
|
23
23
|
__self: _this,
|
|
24
24
|
__source: {
|
|
25
25
|
fileName: _jsxFileName,
|
|
26
|
-
lineNumber:
|
|
26
|
+
lineNumber: 84,
|
|
27
27
|
columnNumber: 3
|
|
28
28
|
}
|
|
29
29
|
}, children);
|
|
@@ -44,7 +44,7 @@ var withChatContext = function withChatContext(Component) {
|
|
|
44
44
|
__self: _this,
|
|
45
45
|
__source: {
|
|
46
46
|
fileName: _jsxFileName,
|
|
47
|
-
lineNumber:
|
|
47
|
+
lineNumber: 117,
|
|
48
48
|
columnNumber: 12
|
|
49
49
|
}
|
|
50
50
|
}));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_react","_interopRequireWildcard","require","_defaultBaseContextValue","_getDisplayName","_isTestEnvironment","_this","_jsxFileName","_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","obj","__esModule","_typeof","cache","has","get","newObj","hasPropertyDescriptor","Object","defineProperty","getOwnPropertyDescriptor","key","prototype","hasOwnProperty","call","desc","set","ChatContext","React","createContext","DEFAULT_BASE_CONTEXT_VALUE","exports","ChatProvider","_ref","children","value","createElement","Provider","__self","__source","fileName","lineNumber","columnNumber","useChatContext","contextValue","useContext","isTestEnvironment","Error","withChatContext","Component","WithChatContextComponent","props","chatContext","_extends2","displayName","getDisplayName"],"sources":["ChatContext.tsx"],"sourcesContent":["import React, { PropsWithChildren, useContext } from 'react';\nimport type { ImageProps } from 'react-native';\n\nimport type { AppSettingsAPIResponse, Channel, Mute, StreamChat } from 'stream-chat';\n\nimport type { DefaultStreamChatGenerics, UnknownType } from '../../types/types';\nimport { DEFAULT_BASE_CONTEXT_VALUE } from '../utils/defaultBaseContextValue';\n\nimport { getDisplayName } from '../utils/getDisplayName';\nimport { isTestEnvironment } from '../utils/isTestEnvironment';\n\nexport type ChatContextValue<\n StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics,\n> = {\n /**\n * Object of application settings returned from Stream.\n * */\n appSettings: AppSettingsAPIResponse<StreamChatGenerics> | null;\n /**\n * The StreamChat client object\n *\n * ```\n * import { StreamChat } from 'stream-chat';\n * import { Chat } from 'stream-chat-react-native';\n *\n * const client = StreamChat.getInstance('api_key);\n * await client.connectUser('user_id', 'userToken');\n *\n * <Chat client={client}>\n * </Chat>\n * ```\n *\n * @overrideType StreamChat\n * */\n client: StreamChat<StreamChatGenerics>;\n connectionRecovering: boolean;\n enableOfflineSupport: boolean;\n /**\n * Drop in replacement of all the underlying Image components within SDK. This is useful for the purpose of offline caching of images. Please check the Offline Support Guide for usage.\n */\n ImageComponent: React.ComponentType<ImageProps>;\n isOnline: boolean | null;\n mutedUsers: Mute<StreamChatGenerics>[];\n /**\n * @param newChannel Channel to set as active.\n *\n * @overrideType Function\n */\n setActiveChannel: (newChannel?: Channel<StreamChatGenerics>) => void;\n /**\n * Instance of channel object from stream-chat package.\n *\n * Please check the docs around how to create or query channel - https://getstream.io/chat/docs/javascript/creating_channels/?language=javascript\n *\n * ```\n * import { StreamChat, Channel } from 'stream-chat';\n * import { Chat, Channel} from 'stream-chat-react-native';\n *\n * const client = StreamChat.getInstance('api_key');\n * await client.connectUser('user_id', 'user_token');\n * const channel = client.channel('messaging', 'channel_id');\n * await channel.watch();\n * ```\n *\n * @overrideType Channel\n */\n channel?: Channel<StreamChatGenerics>;\n};\n\nexport const ChatContext = React.createContext(DEFAULT_BASE_CONTEXT_VALUE as ChatContextValue);\n\nexport const ChatProvider = <\n StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics,\n>({\n children,\n value,\n}: PropsWithChildren<{\n value?: ChatContextValue<StreamChatGenerics>;\n}>) => (\n <ChatContext.Provider value={value as unknown as ChatContextValue}>\n {children}\n </ChatContext.Provider>\n);\n\nexport const useChatContext = <\n StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics,\n>() => {\n const contextValue = useContext(ChatContext) as unknown as ChatContextValue<StreamChatGenerics>;\n\n if (contextValue === DEFAULT_BASE_CONTEXT_VALUE && !isTestEnvironment()) {\n throw new Error(\n `The useChatContext hook was called outside the ChatContext Provider. Make sure you have configured Chat component correctly - https://getstream.io/chat/docs/sdk/reactnative/basics/hello_stream_chat/#chat`,\n );\n }\n\n return contextValue;\n};\n\n/**\n * Typescript currently does not support partial inference so if ChatContext\n * typing is desired while using the HOC withChatContext the Props for the\n * wrapped component must be provided as the first generic.\n */\nexport const withChatContext = <\n P extends UnknownType,\n StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics,\n>(\n Component: React.ComponentType<P>,\n): React.FC<Omit<P, keyof ChatContextValue<StreamChatGenerics>>> => {\n const WithChatContextComponent = (props: Omit<P, keyof ChatContextValue<StreamChatGenerics>>) => {\n const chatContext = useChatContext<StreamChatGenerics>();\n\n return <Component {...(props as P)} {...chatContext} />;\n };\n WithChatContextComponent.displayName = `WithChatContext${getDisplayName(Component)}`;\n return WithChatContextComponent;\n};\n"],"mappings":";;;;;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AAMA,IAAAC,wBAAA,GAAAD,OAAA;AAEA,IAAAE,eAAA,GAAAF,OAAA;AACA,IAAA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ireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","obj","__esModule","_typeof","cache","has","get","newObj","hasPropertyDescriptor","Object","defineProperty","getOwnPropertyDescriptor","key","prototype","hasOwnProperty","call","desc","set","ChatContext","React","createContext","DEFAULT_BASE_CONTEXT_VALUE","exports","ChatProvider","_ref","children","value","createElement","Provider","__self","__source","fileName","lineNumber","columnNumber","useChatContext","contextValue","useContext","isTestEnvironment","Error","withChatContext","Component","WithChatContextComponent","props","chatContext","_extends2","displayName","getDisplayName"],"sources":["ChatContext.tsx"],"sourcesContent":["import React, { PropsWithChildren, useContext } from 'react';\nimport type { ImageProps } from 'react-native';\n\nimport type { AppSettingsAPIResponse, Channel, Mute, StreamChat } from 'stream-chat';\n\nimport type { DefaultStreamChatGenerics, UnknownType } from '../../types/types';\nimport { DEFAULT_BASE_CONTEXT_VALUE } from '../utils/defaultBaseContextValue';\n\nimport { getDisplayName } from '../utils/getDisplayName';\nimport { isTestEnvironment } from '../utils/isTestEnvironment';\n\nexport type ChatContextValue<\n StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics,\n> = {\n /**\n * Object of application settings returned from Stream.\n * */\n appSettings: AppSettingsAPIResponse<StreamChatGenerics> | null;\n /**\n * The StreamChat client object\n *\n * ```\n * import { StreamChat } from 'stream-chat';\n * import { Chat } from 'stream-chat-react-native';\n *\n * const client = StreamChat.getInstance('api_key);\n * await client.connectUser('user_id', 'userToken');\n *\n * <Chat client={client}>\n * </Chat>\n * ```\n *\n * @overrideType StreamChat\n * */\n client: StreamChat<StreamChatGenerics>;\n connectionRecovering: boolean;\n enableOfflineSupport: boolean;\n /**\n * Drop in replacement of all the underlying Image components within SDK. This is useful for the purpose of offline caching of images. Please check the Offline Support Guide for usage.\n */\n ImageComponent: React.ComponentType<ImageProps>;\n isOnline: boolean | null;\n mutedUsers: Mute<StreamChatGenerics>[];\n /**\n * @param newChannel Channel to set as active.\n *\n * @overrideType Function\n */\n setActiveChannel: (newChannel?: Channel<StreamChatGenerics>) => void;\n /**\n * Instance of channel object from stream-chat package.\n *\n * Please check the docs around how to create or query channel - https://getstream.io/chat/docs/javascript/creating_channels/?language=javascript\n *\n * ```\n * import { StreamChat, Channel } from 'stream-chat';\n * import { Chat, Channel} from 'stream-chat-react-native';\n *\n * const client = StreamChat.getInstance('api_key');\n * await client.connectUser('user_id', 'user_token');\n * const channel = client.channel('messaging', 'channel_id');\n * await channel.watch();\n * ```\n *\n * @overrideType Channel\n */\n channel?: Channel<StreamChatGenerics>;\n /**\n * This option allows you to specify a list of CDNs that offer image resizing.\n */\n resizableCDNHosts?: string[];\n};\n\nexport const ChatContext = React.createContext(DEFAULT_BASE_CONTEXT_VALUE as ChatContextValue);\n\nexport const ChatProvider = <\n StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics,\n>({\n children,\n value,\n}: PropsWithChildren<{\n value?: ChatContextValue<StreamChatGenerics>;\n}>) => (\n <ChatContext.Provider value={value as unknown as ChatContextValue}>\n {children}\n </ChatContext.Provider>\n);\n\nexport const useChatContext = <\n StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics,\n>() => {\n const contextValue = useContext(ChatContext) as unknown as ChatContextValue<StreamChatGenerics>;\n\n if (contextValue === DEFAULT_BASE_CONTEXT_VALUE && !isTestEnvironment()) {\n throw new Error(\n `The useChatContext hook was called outside the ChatContext Provider. Make sure you have configured Chat component correctly - https://getstream.io/chat/docs/sdk/reactnative/basics/hello_stream_chat/#chat`,\n );\n }\n\n return contextValue;\n};\n\n/**\n * Typescript currently does not support partial inference so if ChatContext\n * typing is desired while using the HOC withChatContext the Props for the\n * wrapped component must be provided as the first generic.\n */\nexport const withChatContext = <\n P extends UnknownType,\n StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics,\n>(\n Component: React.ComponentType<P>,\n): React.FC<Omit<P, keyof ChatContextValue<StreamChatGenerics>>> => {\n const WithChatContextComponent = (props: Omit<P, keyof ChatContextValue<StreamChatGenerics>>) => {\n const chatContext = useChatContext<StreamChatGenerics>();\n\n return <Component {...(props as P)} {...chatContext} />;\n };\n WithChatContextComponent.displayName = `WithChatContext${getDisplayName(Component)}`;\n return WithChatContextComponent;\n};\n"],"mappings":";;;;;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AAMA,IAAAC,wBAAA,GAAAD,OAAA;AAEA,IAAAE,eAAA,GAAAF,OAAA;AACA,IAAAG,kBAAA,GAAAH,OAAA;AAA+D,IAAAI,KAAA;EAAAC,YAAA;AAAA,SAAAC,yBAAAC,WAAA,eAAAC,OAAA,kCAAAC,iBAAA,OAAAD,OAAA,QAAAE,gBAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,yBAAAC,WAAA,WAAAA,WAAA,GAAAG,gBAAA,GAAAD,iBAAA,KAAAF,WAAA;AAAA,SAAAR,wBAAAY,GAAA,EAAAJ,WAAA,SAAAA,WAAA,IAAAI,GAAA,IAAAA,GAAA,CAAAC,UAAA,WAAAD,GAAA,QAAAA,GAAA,aAAAE,OAAA,CAAAF,GAAA,yBAAAA,GAAA,uCAAAA,GAAA,UAAAG,KAAA,GAAAR,wBAAA,CAAAC,WAAA,OAAAO,KAAA,IAAAA,KAAA,CAAAC,GAAA,CAAAJ,GAAA,YAAAG,KAAA,CAAAE,GAAA,CAAAL,GAAA,SAAAM,MAAA,WAAAC,qBAAA,GAAAC,MAAA,CAAAC,cAAA,IAAAD,MAAA,CAAAE,wBAAA,WAAAC,GAAA,IAAAX,GAAA,QAAAW,GAAA,kBAAAH,MAAA,CAAAI,SAAA,CAAAC,cAAA,CAAAC,IAAA,CAAAd,GAAA,EAAAW,GAAA,SAAAI,IAAA,GAAAR,qBAAA,GAAAC,MAAA,CAAAE,wBAAA,CAAAV,GAAA,EAAAW,GAAA,cAAAI,IAAA,KAAAA,IAAA,CAAAV,GAAA,IAAAU,IAAA,CAAAC,GAAA,KAAAR,MAAA,CAAAC,cAAA,CAAAH,M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S,MAAAI,SAAA,iBAAMF,KAAK,EAAYC,WAAW;MAAAd,MAAA,EAAAnC,KAAA;MAAAoC,QAAA;QAAAC,QAAA,EAAApC,YAAA;QAAAqC,UAAA;QAAAC,YAAA;MAAA;IAAA,EAAG,CAAC;EACzD,CAAC;EACDQ,wBAAwB,CAACI,WAAW,uBAAqB,IAAAC,8BAAc,EAACN,SAAS,CAAG;EACpF,OAAOC,wBAAwB;AACjC,CAAC;AAACnB,OAAA,CAAAiB,eAAA,GAAAA,eAAA"}
|
|
@@ -14,6 +14,7 @@ var _AttachmentPicker = require("../../components/AttachmentPicker/AttachmentPic
|
|
|
14
14
|
var _AttachmentPickerBottomSheetHandle = require("../../components/AttachmentPicker/components/AttachmentPickerBottomSheetHandle");
|
|
15
15
|
var _AttachmentPickerError = require("../../components/AttachmentPicker/components/AttachmentPickerError");
|
|
16
16
|
var _AttachmentPickerErrorImage = require("../../components/AttachmentPicker/components/AttachmentPickerErrorImage");
|
|
17
|
+
var _AttachmentPickerIOSSelectMorePhotos = require("../../components/AttachmentPicker/components/AttachmentPickerIOSSelectMorePhotos");
|
|
17
18
|
var _CameraSelectorIcon = require("../../components/AttachmentPicker/components/CameraSelectorIcon");
|
|
18
19
|
var _FileSelectorIcon = require("../../components/AttachmentPicker/components/FileSelectorIcon");
|
|
19
20
|
var _ImageOverlaySelectedComponent = require("../../components/AttachmentPicker/components/ImageOverlaySelectedComponent");
|
|
@@ -45,6 +46,8 @@ var OverlayProvider = function OverlayProvider(props) {
|
|
|
45
46
|
AttachmentPickerErrorImage = _props$AttachmentPick3 === void 0 ? _AttachmentPickerErrorImage.AttachmentPickerErrorImage : _props$AttachmentPick3,
|
|
46
47
|
attachmentPickerErrorText = props.attachmentPickerErrorText,
|
|
47
48
|
attachmentSelectionBarHeight = props.attachmentSelectionBarHeight,
|
|
49
|
+
_props$AttachmentPick4 = props.AttachmentPickerIOSSelectMorePhotos,
|
|
50
|
+
AttachmentPickerIOSSelectMorePhotos = _props$AttachmentPick4 === void 0 ? _AttachmentPickerIOSSelectMorePhotos.AttachmentPickerIOSSelectMorePhotos : _props$AttachmentPick4,
|
|
48
51
|
bottomInset = props.bottomInset,
|
|
49
52
|
_props$CameraSelector = props.CameraSelectorIcon,
|
|
50
53
|
CameraSelectorIcon = _props$CameraSelector === void 0 ? _CameraSelectorIcon.CameraSelectorIcon : _props$CameraSelector,
|
|
@@ -106,6 +109,7 @@ var OverlayProvider = function OverlayProvider(props) {
|
|
|
106
109
|
attachmentPickerErrorButtonText: attachmentPickerErrorButtonText,
|
|
107
110
|
AttachmentPickerErrorImage: AttachmentPickerErrorImage,
|
|
108
111
|
attachmentPickerErrorText: attachmentPickerErrorText,
|
|
112
|
+
AttachmentPickerIOSSelectMorePhotos: AttachmentPickerIOSSelectMorePhotos,
|
|
109
113
|
attachmentSelectionBarHeight: attachmentSelectionBarHeight,
|
|
110
114
|
ImageOverlaySelectedComponent: ImageOverlaySelectedComponent,
|
|
111
115
|
numberOfAttachmentImagesToLoadPerCall: numberOfAttachmentImagesToLoadPerCall,
|
|
@@ -184,7 +188,7 @@ var OverlayProvider = function OverlayProvider(props) {
|
|
|
184
188
|
__self: _this,
|
|
185
189
|
__source: {
|
|
186
190
|
fileName: _jsxFileName,
|
|
187
|
-
lineNumber:
|
|
191
|
+
lineNumber: 218,
|
|
188
192
|
columnNumber: 5
|
|
189
193
|
}
|
|
190
194
|
}, _react["default"].createElement(_OverlayContext.OverlayContext.Provider, {
|
|
@@ -192,14 +196,14 @@ var OverlayProvider = function OverlayProvider(props) {
|
|
|
192
196
|
__self: _this,
|
|
193
197
|
__source: {
|
|
194
198
|
fileName: _jsxFileName,
|
|
195
|
-
lineNumber:
|
|
199
|
+
lineNumber: 219,
|
|
196
200
|
columnNumber: 7
|
|
197
201
|
}
|
|
198
202
|
}, _react["default"].createElement(_MessageOverlayContext.MessageOverlayProvider, {
|
|
199
203
|
__self: _this,
|
|
200
204
|
__source: {
|
|
201
205
|
fileName: _jsxFileName,
|
|
202
|
-
lineNumber:
|
|
206
|
+
lineNumber: 220,
|
|
203
207
|
columnNumber: 9
|
|
204
208
|
}
|
|
205
209
|
}, _react["default"].createElement(_AttachmentPickerContext.AttachmentPickerProvider, {
|
|
@@ -207,14 +211,14 @@ var OverlayProvider = function OverlayProvider(props) {
|
|
|
207
211
|
__self: _this,
|
|
208
212
|
__source: {
|
|
209
213
|
fileName: _jsxFileName,
|
|
210
|
-
lineNumber:
|
|
214
|
+
lineNumber: 221,
|
|
211
215
|
columnNumber: 11
|
|
212
216
|
}
|
|
213
217
|
}, _react["default"].createElement(_ImageGalleryContext.ImageGalleryProvider, {
|
|
214
218
|
__self: _this,
|
|
215
219
|
__source: {
|
|
216
220
|
fileName: _jsxFileName,
|
|
217
|
-
lineNumber:
|
|
221
|
+
lineNumber: 222,
|
|
218
222
|
columnNumber: 13
|
|
219
223
|
}
|
|
220
224
|
}, children, _react["default"].createElement(_ThemeContext.ThemeProvider, {
|
|
@@ -222,7 +226,7 @@ var OverlayProvider = function OverlayProvider(props) {
|
|
|
222
226
|
__self: _this,
|
|
223
227
|
__source: {
|
|
224
228
|
fileName: _jsxFileName,
|
|
225
|
-
lineNumber:
|
|
229
|
+
lineNumber: 224,
|
|
226
230
|
columnNumber: 15
|
|
227
231
|
}
|
|
228
232
|
}, _react["default"].createElement(_reactNativeReanimated["default"].View, {
|
|
@@ -231,7 +235,7 @@ var OverlayProvider = function OverlayProvider(props) {
|
|
|
231
235
|
__self: _this,
|
|
232
236
|
__source: {
|
|
233
237
|
fileName: _jsxFileName,
|
|
234
|
-
lineNumber:
|
|
238
|
+
lineNumber: 225,
|
|
235
239
|
columnNumber: 17
|
|
236
240
|
}
|
|
237
241
|
}, _react["default"].createElement(_OverlayBackdrop.OverlayBackdrop, {
|
|
@@ -242,7 +246,7 @@ var OverlayProvider = function OverlayProvider(props) {
|
|
|
242
246
|
__self: _this,
|
|
243
247
|
__source: {
|
|
244
248
|
fileName: _jsxFileName,
|
|
245
|
-
lineNumber:
|
|
249
|
+
lineNumber: 229,
|
|
246
250
|
columnNumber: 19
|
|
247
251
|
}
|
|
248
252
|
})), overlay === 'message' && _react["default"].createElement(_MessageOverlay.MessageOverlay, {
|
|
@@ -256,7 +260,7 @@ var OverlayProvider = function OverlayProvider(props) {
|
|
|
256
260
|
__self: _this,
|
|
257
261
|
__source: {
|
|
258
262
|
fileName: _jsxFileName,
|
|
259
|
-
lineNumber:
|
|
263
|
+
lineNumber: 232,
|
|
260
264
|
columnNumber: 19
|
|
261
265
|
}
|
|
262
266
|
}), overlay === 'gallery' && _react["default"].createElement(_ImageGallery.ImageGallery, {
|
|
@@ -270,7 +274,7 @@ var OverlayProvider = function OverlayProvider(props) {
|
|
|
270
274
|
__self: _this,
|
|
271
275
|
__source: {
|
|
272
276
|
fileName: _jsxFileName,
|
|
273
|
-
lineNumber:
|
|
277
|
+
lineNumber: 243,
|
|
274
278
|
columnNumber: 19
|
|
275
279
|
}
|
|
276
280
|
}), _react["default"].createElement(_AttachmentPicker.AttachmentPicker, (0, _extends2["default"])({
|
|
@@ -279,7 +283,7 @@ var OverlayProvider = function OverlayProvider(props) {
|
|
|
279
283
|
__self: _this,
|
|
280
284
|
__source: {
|
|
281
285
|
fileName: _jsxFileName,
|
|
282
|
-
lineNumber:
|
|
286
|
+
lineNumber: 253,
|
|
283
287
|
columnNumber: 17
|
|
284
288
|
}
|
|
285
289
|
}))))))));
|
|
@@ -1 +1 @@
|
|
|
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","autoPlayVideo","_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 autoPlayVideo,\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 autoPlayVideo={autoPlayVideo}\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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CAAC;AAACe,OAAA,CAAAvH,eAAA,GAAAA,eAAA"}
|
|
1
|
+
{"version":3,"names":["_react","_interopRequireWildcard","require","_reactNative","_reactNativeReanimated","_OverlayContext","_AttachmentPicker","_AttachmentPickerBottomSheetHandle","_AttachmentPickerError","_AttachmentPickerErrorImage","_AttachmentPickerIOSSelectMorePhotos","_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","autoPlayVideo","_props$AttachmentPick","AttachmentPickerBottomSheetHandle","DefaultAttachmentPickerBottomSheetHandle","attachmentPickerBottomSheetHandleHeight","attachmentPickerBottomSheetHeight","_props$AttachmentPick2","AttachmentPickerError","DefaultAttachmentPickerError","attachmentPickerErrorButtonText","_props$AttachmentPick3","AttachmentPickerErrorImage","DefaultAttachmentPickerErrorImage","attachmentPickerErrorText","attachmentSelectionBarHeight","_props$AttachmentPick4","AttachmentPickerIOSSelectMorePhotos","DefaultAttachmentPickerIOSSelectMorePhotos","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 { AttachmentPickerIOSSelectMorePhotos as DefaultAttachmentPickerIOSSelectMorePhotos } from '../../components/AttachmentPicker/components/AttachmentPickerIOSSelectMorePhotos';\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 autoPlayVideo,\n AttachmentPickerBottomSheetHandle = DefaultAttachmentPickerBottomSheetHandle,\n attachmentPickerBottomSheetHandleHeight,\n attachmentPickerBottomSheetHeight,\n AttachmentPickerError = DefaultAttachmentPickerError,\n attachmentPickerErrorButtonText,\n AttachmentPickerErrorImage = DefaultAttachmentPickerErrorImage,\n attachmentPickerErrorText,\n attachmentSelectionBarHeight,\n AttachmentPickerIOSSelectMorePhotos = DefaultAttachmentPickerIOSSelectMorePhotos,\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 AttachmentPickerIOSSelectMorePhotos,\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 autoPlayVideo={autoPlayVideo}\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 </MessageOverlay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AAEA,gBAAiB;IACnCC,sBAAsB,EAAEA,sBAAuB;IAAAqC,MAAA,EAAA/H,KAAA;IAAAgI,QAAA;MAAAC,QAAA,EAAAhI,YAAA;MAAAiI,UAAA;MAAAC,YAAA;IAAA;EAAA,CAChD,CACF,EACAnC,OAAO,KAAK,SAAS,IACpBxH,MAAA,YAAAkJ,aAAA,CAACnI,aAAA,CAAAyJ,YAAY;IACXpH,aAAa,EAAEA,aAAc;IAC7BmC,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,EAAA/H,KAAA;IAAAgI,QAAA;MAAAC,QAAA,EAAAhI,YAAA;MAAAiI,UAAA;MAAAC,YAAA;IAAA;EAAA,CAChC,CACF,EACD3J,MAAA,YAAAkJ,aAAA,CAAC5I,iBAAA,CAAAmK,gBAAgB,MAAArB,SAAA;IAACvE,GAAG,EAAEwC;EAAe,GAAKD,qBAAqB;IAAAmC,MAAA,EAAA/H,KAAA;IAAAgI,QAAA;MAAAC,QAAA,EAAAhI,YAAA;MAAAiI,UAAA;MAAAC,YAAA;IAAA;EAAA,EAAG,CACtD,CACK,CACE,CACJ,CACD,CACN,CAAC;AAE1B,CAAC;AAACe,OAAA,CAAA1H,eAAA,GAAAA,eAAA"}
|
package/lib/module/i18n/es.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"1 Reply": "1 respuesta",
|
|
3
|
-
"1 Thread Reply": "
|
|
4
|
-
"Allow access to your Gallery": "
|
|
5
|
-
"Allow camera access in device settings": "
|
|
3
|
+
"1 Thread Reply": "",
|
|
4
|
+
"Allow access to your Gallery": "",
|
|
5
|
+
"Allow camera access in device settings": "",
|
|
6
6
|
"Also send to channel": "",
|
|
7
7
|
"Are you sure you want to permanently delete this message?": "",
|
|
8
8
|
"Are you sure?": "",
|
|
@@ -13,49 +13,49 @@
|
|
|
13
13
|
"Copy Message": "",
|
|
14
14
|
"Delete": "",
|
|
15
15
|
"Delete Message": "",
|
|
16
|
-
"Device camera is used to take photos or videos.": "
|
|
16
|
+
"Device camera is used to take photos or videos.": "",
|
|
17
17
|
"Do you want to send a copy of this message to a moderator for further investigation?": "",
|
|
18
18
|
"Edit Message": "",
|
|
19
|
-
"Editing Message": "
|
|
19
|
+
"Editing Message": "",
|
|
20
20
|
"Emoji matching": "",
|
|
21
|
-
"Empty message...": "",
|
|
21
|
+
"Empty message...": "Mensaje vacío...",
|
|
22
22
|
"Error loading": "Error al cargar",
|
|
23
|
-
"Error loading channel list...": "",
|
|
24
|
-
"Error loading messages for this channel...": "",
|
|
25
|
-
"Error while loading, please reload/refresh": "",
|
|
26
|
-
"File type not supported": "",
|
|
23
|
+
"Error loading channel list...": "Error al cargar la lista de canales...",
|
|
24
|
+
"Error loading messages for this channel...": "Error al cargar los mensajes de este canal...",
|
|
25
|
+
"Error while loading, please reload/refresh": "Error al cargar, por favor recarga/actualiza",
|
|
26
|
+
"File type not supported": "Tipo de archivo no admitido",
|
|
27
27
|
"Flag": "",
|
|
28
28
|
"Flag Message": "",
|
|
29
29
|
"Flag action failed either due to a network issue or the message is already flagged": "",
|
|
30
|
-
"How about sending your first message to a friend?": "",
|
|
30
|
+
"How about sending your first message to a friend?": "¿Qué tal enviar tu primer mensaje a un amigo?",
|
|
31
31
|
"Instant Commands": "",
|
|
32
|
-
"Let's start chatting!": "",
|
|
32
|
+
"Let's start chatting!": "¡Empecemos a charlar!",
|
|
33
33
|
"Links are disabled": "",
|
|
34
|
-
"Loading channels...": "",
|
|
35
|
-
"Loading messages...": "",
|
|
36
|
-
"Loading...": "",
|
|
34
|
+
"Loading channels...": "Cargando canales...",
|
|
35
|
+
"Loading messages...": "Cargando mensajes...",
|
|
36
|
+
"Loading...": "Cargando...",
|
|
37
37
|
"Maximum file size upload limit reached. Please upload a file below {{MAX_FILE_SIZE_TO_UPLOAD_IN_MB}} MB.": "",
|
|
38
|
-
"Message Reactions": "",
|
|
39
|
-
"Message deleted": "",
|
|
38
|
+
"Message Reactions": "Reacciones al mensaje",
|
|
39
|
+
"Message deleted": "Mensaje eliminado",
|
|
40
40
|
"Message flagged": "",
|
|
41
41
|
"Mute User": "",
|
|
42
|
-
"Not supported": "
|
|
43
|
-
"Nothing yet...": "",
|
|
42
|
+
"Not supported": "",
|
|
43
|
+
"Nothing yet...": "Aún no hay nada...",
|
|
44
44
|
"Ok": "",
|
|
45
45
|
"Only visible to you": "Solo visible para ti",
|
|
46
|
-
"Open Settings": "
|
|
47
|
-
"Photo": "",
|
|
48
|
-
"Photos and Videos": "
|
|
46
|
+
"Open Settings": "",
|
|
47
|
+
"Photo": "Foto",
|
|
48
|
+
"Photos and Videos": "",
|
|
49
49
|
"Pin to Conversation": "",
|
|
50
50
|
"Pinned by": "Fijado por",
|
|
51
|
-
"Please enable access to your photos and videos so you can share them.": "
|
|
51
|
+
"Please enable access to your photos and videos so you can share them.": "",
|
|
52
52
|
"Please select a channel first": "",
|
|
53
|
-
"Reconnecting...": "",
|
|
53
|
+
"Reconnecting...": "Reconectando...",
|
|
54
54
|
"Reply": "",
|
|
55
55
|
"Reply to Message": "Responder al mensaje",
|
|
56
56
|
"Resend": "",
|
|
57
57
|
"Search GIFs": "Buscar GIFs",
|
|
58
|
-
"Select More Photos": "
|
|
58
|
+
"Select More Photos": "",
|
|
59
59
|
"Send Anyway": "",
|
|
60
60
|
"Send a message": "Enviar un mensaje",
|
|
61
61
|
"Sending links is not allowed in this conversation": "",
|
|
@@ -63,17 +63,17 @@
|
|
|
63
63
|
"The message has been reported to a moderator.": "",
|
|
64
64
|
"Thread Reply": "",
|
|
65
65
|
"Unblock User": "",
|
|
66
|
-
"Unknown User": "
|
|
66
|
+
"Unknown User": "",
|
|
67
67
|
"Unmute User": "",
|
|
68
68
|
"Unpin from Conversation": "",
|
|
69
|
-
"Unread Messages": "
|
|
70
|
-
"Video": "",
|
|
71
|
-
"You": "",
|
|
69
|
+
"Unread Messages": "",
|
|
70
|
+
"Video": "Video",
|
|
71
|
+
"You": "Tú",
|
|
72
72
|
"You can't send messages in this channel": "No puedes enviar mensajes en este canal",
|
|
73
73
|
"{{ firstUser }} and {{ nonSelfUserLength }} more are typing": "{{ firstUser }} y {{ nonSelfUserLength }} más están escribiendo",
|
|
74
|
-
"{{ index }} of {{ photoLength }}": "
|
|
74
|
+
"{{ index }} of {{ photoLength }}": "",
|
|
75
75
|
"{{ replyCount }} Replies": "{{ replyCount }} Respuestas",
|
|
76
|
-
"{{ replyCount }} Thread Replies": "
|
|
76
|
+
"{{ replyCount }} Thread Replies": "",
|
|
77
77
|
"{{ user }} is typing": "{{ user }} está escribiendo",
|
|
78
|
-
"🏙 Attachment...": ""
|
|
78
|
+
"🏙 Attachment...": "🏙 Adjunto..."
|
|
79
79
|
}
|