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
|
@@ -16,7 +16,6 @@ var _duration = _interopRequireDefault(require("dayjs/plugin/duration"));
|
|
|
16
16
|
var _AttachmentPickerItem = require("./components/AttachmentPickerItem");
|
|
17
17
|
var _AttachmentPickerContext = require("../../contexts/attachmentPickerContext/AttachmentPickerContext");
|
|
18
18
|
var _ThemeContext = require("../../contexts/themeContext/ThemeContext");
|
|
19
|
-
var _TranslationContext = require("../../contexts/translationContext/TranslationContext");
|
|
20
19
|
var _useViewport2 = require("../../hooks/useViewport");
|
|
21
20
|
var _native = require("../../native");
|
|
22
21
|
var _this = this,
|
|
@@ -38,6 +37,7 @@ var AttachmentPicker = _react["default"].forwardRef(function (props, ref) {
|
|
|
38
37
|
attachmentPickerErrorButtonText = props.attachmentPickerErrorButtonText,
|
|
39
38
|
AttachmentPickerErrorImage = props.AttachmentPickerErrorImage,
|
|
40
39
|
attachmentPickerErrorText = props.attachmentPickerErrorText,
|
|
40
|
+
AttachmentPickerIOSSelectMorePhotos = props.AttachmentPickerIOSSelectMorePhotos,
|
|
41
41
|
ImageOverlaySelectedComponent = props.ImageOverlaySelectedComponent,
|
|
42
42
|
numberOfAttachmentImagesToLoadPerCall = props.numberOfAttachmentImagesToLoadPerCall,
|
|
43
43
|
numberOfAttachmentPickerImageColumns = props.numberOfAttachmentPickerImageColumns,
|
|
@@ -82,8 +82,6 @@ var AttachmentPicker = _react["default"].forwardRef(function (props, ref) {
|
|
|
82
82
|
photos = _useState10[0],
|
|
83
83
|
setPhotos = _useState10[1];
|
|
84
84
|
var attemptedToLoadPhotosOnOpenRef = (0, _react.useRef)(false);
|
|
85
|
-
var _useTranslationContex = (0, _TranslationContext.useTranslationContext)(),
|
|
86
|
-
t = _useTranslationContex.t;
|
|
87
85
|
var getMorePhotos = (0, _react.useCallback)((0, _asyncToGenerator2["default"])(_regenerator["default"].mark(function _callee() {
|
|
88
86
|
var endCursor, results;
|
|
89
87
|
return _regenerator["default"].wrap(function _callee$(_context) {
|
|
@@ -251,17 +249,15 @@ var AttachmentPicker = _react["default"].forwardRef(function (props, ref) {
|
|
|
251
249
|
__self: _this,
|
|
252
250
|
__source: {
|
|
253
251
|
fileName: _jsxFileName,
|
|
254
|
-
lineNumber:
|
|
252
|
+
lineNumber: 301,
|
|
255
253
|
columnNumber: 9
|
|
256
254
|
}
|
|
257
|
-
}, iOSLimited && _react["default"].createElement(
|
|
258
|
-
onPress: _native.iOS14RefreshGallerySelection,
|
|
259
|
-
title: t('Select More Photos'),
|
|
255
|
+
}, iOSLimited && _react["default"].createElement(AttachmentPickerIOSSelectMorePhotos, {
|
|
260
256
|
__self: _this,
|
|
261
257
|
__source: {
|
|
262
258
|
fileName: _jsxFileName,
|
|
263
|
-
lineNumber:
|
|
264
|
-
columnNumber:
|
|
259
|
+
lineNumber: 317,
|
|
260
|
+
columnNumber: 26
|
|
265
261
|
}
|
|
266
262
|
}), _react["default"].createElement(_bottomSheet.BottomSheetFlatList, {
|
|
267
263
|
contentContainerStyle: [styles.container, {
|
|
@@ -279,7 +275,7 @@ var AttachmentPicker = _react["default"].forwardRef(function (props, ref) {
|
|
|
279
275
|
__self: _this,
|
|
280
276
|
__source: {
|
|
281
277
|
fileName: _jsxFileName,
|
|
282
|
-
lineNumber:
|
|
278
|
+
lineNumber: 318,
|
|
283
279
|
columnNumber: 11
|
|
284
280
|
}
|
|
285
281
|
})), selectedPicker === 'images' && photoError && _react["default"].createElement(AttachmentPickerError, {
|
|
@@ -290,7 +286,7 @@ var AttachmentPicker = _react["default"].forwardRef(function (props, ref) {
|
|
|
290
286
|
__self: _this,
|
|
291
287
|
__source: {
|
|
292
288
|
fileName: _jsxFileName,
|
|
293
|
-
lineNumber:
|
|
289
|
+
lineNumber: 333,
|
|
294
290
|
columnNumber: 11
|
|
295
291
|
}
|
|
296
292
|
}));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_react","_interopRequireWildcard","require","_reactNative","_bottomSheet","_dayjs","_interopRequireDefault","_duration","_AttachmentPickerItem","_AttachmentPickerContext","_ThemeContext","_TranslationContext","_useViewport2","_native","_this","_jsxFileName","_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","obj","__esModule","_typeof","cache","has","get","newObj","hasPropertyDescriptor","Object","defineProperty","getOwnPropertyDescriptor","key","prototype","hasOwnProperty","call","desc","set","dayjs","extend","duration","styles","StyleSheet","create","container","flexGrow","fullScreenHeight","Dimensions","height","AttachmentPicker","React","forwardRef","props","ref","AttachmentPickerBottomSheetHandle","attachmentPickerBottomSheetHandleHeight","attachmentPickerBottomSheetHeight","AttachmentPickerError","attachmentPickerErrorButtonText","AttachmentPickerErrorImage","attachmentPickerErrorText","ImageOverlaySelectedComponent","numberOfAttachmentImagesToLoadPerCall","numberOfAttachmentPickerImageColumns","translucentStatusBar","_useTheme","useTheme","_useTheme$theme","theme","bottomSheetContentContainer","attachmentPicker","white","colors","_useAttachmentPickerC","useAttachmentPickerContext","closePicker","maxNumberOfFiles","selectedFiles","selectedImages","selectedPicker","setSelectedFiles","setSelectedImages","setSelectedPicker","topInset","_useViewport","useViewport","vh","screenHeight","_useState","useState","_useState2","_slicedToArray2","currentIndex","setCurrentIndex","endCursorRef","useRef","_useState3","_useState4","photoError","setPhotoError","_useState5","_useState6","iOSLimited","setIosLimited","hasNextPageRef","_useState7","_useState8","loadingPhotos","setLoadingPhotos","_useState9","_useState10","photos","setPhotos","attemptedToLoadPhotosOnOpenRef","_useTranslationContex","useTranslationContext","t","getMorePhotos","useCallback","_asyncToGenerator2","_regenerator","mark","_callee","endCursor","results","wrap","_callee$","_context","prev","next","current","getPhotos","after","first","sent","prevPhotos","concat","_toConsumableArray2","assets","hasNextPage","t0","stop","getMorePhotosRef","useEffect","_oniOS14GalleryLibrar","oniOS14GalleryLibrarySelectionChange","undefined","unsubscribe","backAction","backHandler","BackHandler","addEventListener","remove","onKeyboardOpenHandler","keyboardShowEvent","Platform","OS","keyboardSubscription","Keyboard","addListener","removeListener","selectedPhotos","map","asset","numberOfUploads","length","selected","some","image","id","uri","file","handleHeight","getAndroidBottomBarHeightAdjustment","_StatusBar$currentHei","statusBarHeight","StatusBar","currentHeight","bottomBarHeight","getInitialSnapPoint","initialSnapPoint","finalSnapPoint","snapPoints","useMemo","createElement","Fragment","containerHeight","enablePanDownToClose","handleComponent","index","onChange","__self","__source","fileName","lineNumber","columnNumber","Button","onPress","iOS14RefreshGallerySelection","title","BottomSheetFlatList","contentContainerStyle","backgroundColor","opacity","data","keyExtractor","item","numColumns","onEndReached","renderItem","renderAttachmentPickerItem","exports","displayName"],"sources":["AttachmentPicker.tsx"],"sourcesContent":["import React, { useCallback, useEffect, useMemo, useRef, useState } from 'react';\nimport {\n BackHandler,\n Button,\n Dimensions,\n Keyboard,\n Platform,\n StatusBar,\n StyleSheet,\n} from 'react-native';\n\nimport BottomSheet, { BottomSheetFlatList, BottomSheetHandleProps } from '@gorhom/bottom-sheet';\nimport dayjs from 'dayjs';\nimport duration from 'dayjs/plugin/duration';\n\nimport type { AttachmentPickerErrorProps } from './components/AttachmentPickerError';\n\nimport { renderAttachmentPickerItem } from './components/AttachmentPickerItem';\n\nimport { useAttachmentPickerContext } from '../../contexts/attachmentPickerContext/AttachmentPickerContext';\nimport { useTheme } from '../../contexts/themeContext/ThemeContext';\nimport { useTranslationContext } from '../../contexts/translationContext/TranslationContext';\nimport { useViewport } from '../../hooks/useViewport';\nimport {\n getPhotos,\n iOS14RefreshGallerySelection,\n oniOS14GalleryLibrarySelectionChange,\n} from '../../native';\nimport type { Asset } from '../../types/types';\n\ndayjs.extend(duration);\n\nconst styles = StyleSheet.create({\n container: {\n flexGrow: 1,\n },\n});\n\nconst fullScreenHeight = Dimensions.get('window').height;\n\nexport type AttachmentPickerProps = {\n /**\n * Custom UI component to render [draggable handle](https://github.com/GetStream/stream-chat-react-native/blob/main/screenshots/docs/1.png) of attachment picker.\n *\n * **Default** [AttachmentPickerBottomSheetHandle](https://github.com/GetStream/stream-chat-react-native/blob/main/package/src/components/AttachmentPicker/components/AttachmentPickerBottomSheetHandle.tsx)\n */\n AttachmentPickerBottomSheetHandle: React.FC<BottomSheetHandleProps>;\n /**\n * Custom UI component to render error component while opening attachment picker.\n *\n * **Default** [AttachmentPickerError](https://github.com/GetStream/stream-chat-react-native/blob/main/package/src/components/AttachmentPicker/components/AttachmentPickerError.tsx)\n */\n AttachmentPickerError: React.ComponentType<AttachmentPickerErrorProps>;\n /**\n * Custom UI component to render error image for attachment picker\n *\n * **Default** [AttachmentPickerErrorImage](https://github.com/GetStream/stream-chat-react-native/blob/main/package/src/components/AttachmentPicker/components/AttachmentPickerErrorImage.tsx)\n */\n AttachmentPickerErrorImage: React.ComponentType;\n /**\n * Custom UI component to render overlay component, that shows up on top of [selected image](https://github.com/GetStream/stream-chat-react-native/blob/main/screenshots/docs/1.png) (with tick mark)\n *\n * **Default** [ImageOverlaySelectedComponent](https://github.com/GetStream/stream-chat-react-native/blob/main/package/src/components/AttachmentPicker/components/ImageOverlaySelectedComponent.tsx)\n */\n ImageOverlaySelectedComponent: React.ComponentType;\n attachmentPickerBottomSheetHandleHeight?: number;\n attachmentPickerBottomSheetHeight?: number;\n attachmentPickerErrorButtonText?: string;\n attachmentPickerErrorText?: string;\n numberOfAttachmentImagesToLoadPerCall?: number;\n numberOfAttachmentPickerImageColumns?: number;\n translucentStatusBar?: boolean;\n};\n\nexport const AttachmentPicker = React.forwardRef(\n (props: AttachmentPickerProps, ref: React.ForwardedRef<BottomSheet>) => {\n const {\n AttachmentPickerBottomSheetHandle,\n attachmentPickerBottomSheetHandleHeight,\n attachmentPickerBottomSheetHeight,\n AttachmentPickerError,\n attachmentPickerErrorButtonText,\n AttachmentPickerErrorImage,\n attachmentPickerErrorText,\n ImageOverlaySelectedComponent,\n numberOfAttachmentImagesToLoadPerCall,\n numberOfAttachmentPickerImageColumns,\n translucentStatusBar,\n } = props;\n\n const {\n theme: {\n attachmentPicker: { bottomSheetContentContainer },\n colors: { white },\n },\n } = useTheme();\n const {\n closePicker,\n maxNumberOfFiles,\n selectedFiles,\n selectedImages,\n selectedPicker,\n setSelectedFiles,\n setSelectedImages,\n setSelectedPicker,\n topInset,\n } = useAttachmentPickerContext();\n const { vh } = useViewport();\n\n const screenHeight = vh(100);\n\n const [currentIndex, setCurrentIndex] = useState(-1);\n const endCursorRef = useRef<string>();\n const [photoError, setPhotoError] = useState(false);\n const [iOSLimited, setIosLimited] = useState(false);\n const hasNextPageRef = useRef(true);\n const [loadingPhotos, setLoadingPhotos] = useState(false);\n const [photos, setPhotos] = useState<Asset[]>([]);\n const attemptedToLoadPhotosOnOpenRef = useRef(false);\n const { t } = useTranslationContext();\n\n const getMorePhotos = useCallback(async () => {\n if (\n hasNextPageRef.current &&\n !loadingPhotos &&\n currentIndex > -1 &&\n selectedPicker === 'images'\n ) {\n setPhotoError(false);\n setLoadingPhotos(true);\n const endCursor = endCursorRef.current;\n try {\n const results = await getPhotos({\n after: endCursor,\n first: numberOfAttachmentImagesToLoadPerCall ?? 60,\n });\n endCursorRef.current = results.endCursor;\n setPhotos((prevPhotos) =>\n endCursor ? [...prevPhotos, ...results.assets] : results.assets,\n );\n setIosLimited(results.iOSLimited);\n hasNextPageRef.current = !!results.hasNextPage;\n } catch (error) {\n setPhotoError(true);\n }\n setLoadingPhotos(false);\n }\n }, [currentIndex, selectedPicker, loadingPhotos]);\n\n // we need to use ref here to avoid running effect when getMorePhotos changes\n const getMorePhotosRef = useRef(getMorePhotos);\n getMorePhotosRef.current = getMorePhotos;\n\n useEffect(() => {\n if (selectedPicker !== 'images') return;\n // ios 14 library selection change event is fired when user reselects the images that are permitted to be readable by the app\n const { unsubscribe } = oniOS14GalleryLibrarySelectionChange(() => {\n // we reset the cursor and has next page to true to facilitate fetching of the first page of photos again\n hasNextPageRef.current = true;\n endCursorRef.current = undefined;\n // fetch the first page of photos again\n getMorePhotosRef.current();\n });\n return unsubscribe;\n }, [selectedPicker]);\n\n useEffect(() => {\n const backAction = () => {\n if (selectedPicker) {\n setSelectedPicker(undefined);\n closePicker();\n return true;\n }\n\n return false;\n };\n\n const backHandler = BackHandler.addEventListener('hardwareBackPress', backAction);\n\n return () => backHandler.remove();\n }, [selectedPicker, closePicker]);\n\n useEffect(() => {\n const onKeyboardOpenHandler = () => {\n if (selectedPicker) {\n setSelectedPicker(undefined);\n }\n closePicker();\n };\n const keyboardShowEvent = Platform.OS === 'ios' ? 'keyboardWillShow' : 'keyboardDidShow';\n const keyboardSubscription = Keyboard.addListener(keyboardShowEvent, onKeyboardOpenHandler);\n\n return () => {\n if (keyboardSubscription?.remove) {\n keyboardSubscription.remove();\n return;\n }\n\n // To keep compatibility with older versions of React Native, where `remove()` is not available\n Keyboard.removeListener(keyboardShowEvent, onKeyboardOpenHandler);\n };\n }, [closePicker, selectedPicker]);\n\n useEffect(() => {\n if (currentIndex < 0) {\n setSelectedPicker(undefined);\n if (!loadingPhotos) {\n endCursorRef.current = undefined;\n hasNextPageRef.current = true;\n attemptedToLoadPhotosOnOpenRef.current = false;\n setPhotoError(false);\n }\n }\n }, [currentIndex, loadingPhotos]);\n\n useEffect(() => {\n if (\n !attemptedToLoadPhotosOnOpenRef.current &&\n selectedPicker === 'images' &&\n endCursorRef.current === undefined &&\n currentIndex > -1 &&\n !loadingPhotos\n ) {\n getMorePhotos();\n // we do this only once on open for avoiding to request permissions in rationale dialog again and again on Android\n attemptedToLoadPhotosOnOpenRef.current = true;\n }\n }, [currentIndex, selectedPicker, getMorePhotos, loadingPhotos]);\n\n const selectedPhotos = photos.map((asset) => ({\n asset,\n ImageOverlaySelectedComponent,\n maxNumberOfFiles,\n numberOfAttachmentPickerImageColumns,\n numberOfUploads: selectedFiles.length + selectedImages.length,\n // `id` is available for Expo MediaLibrary while Cameraroll doesn't share id therefore we use `uri`\n selected:\n selectedImages.some((image) =>\n image.id ? image.id === asset.id : image.uri === asset.uri,\n ) ||\n selectedFiles.some((file) => (file.id ? file.id === asset.id : file.uri === asset.uri)),\n selectedFiles,\n selectedImages,\n setSelectedFiles,\n setSelectedImages,\n }));\n\n const handleHeight = attachmentPickerBottomSheetHandleHeight || 20;\n\n /**\n * This is to handle issues with Android measurements coming back incorrect.\n * If the StatusBar height is perfectly 1/2 of the difference between the two\n * dimensions for screen and window, it is incorrect and we need to account for\n * this. If you use a translucent header bar more adjustments are needed.\n */\n const getAndroidBottomBarHeightAdjustment = (): number => {\n if (Platform.OS === 'android') {\n const statusBarHeight = StatusBar.currentHeight ?? 0;\n const bottomBarHeight = fullScreenHeight - screenHeight - statusBarHeight;\n if (bottomBarHeight === statusBarHeight) {\n return translucentStatusBar ? 0 : statusBarHeight;\n } else {\n if (translucentStatusBar) {\n if (bottomBarHeight > statusBarHeight) {\n return -bottomBarHeight + statusBarHeight;\n } else {\n return bottomBarHeight > 0 ? -statusBarHeight : 0;\n }\n } else {\n return bottomBarHeight > 0 ? 0 : statusBarHeight;\n }\n }\n }\n return 0;\n };\n\n const getInitialSnapPoint = (): number => {\n if (attachmentPickerBottomSheetHeight !== undefined) {\n return attachmentPickerBottomSheetHeight;\n }\n if (Platform.OS === 'android') {\n return (\n 308 +\n (fullScreenHeight - screenHeight + getAndroidBottomBarHeightAdjustment()) -\n handleHeight\n );\n } else {\n return 308 + (fullScreenHeight - screenHeight);\n }\n };\n\n const initialSnapPoint = getInitialSnapPoint();\n\n const finalSnapPoint =\n Platform.OS === 'android'\n ? fullScreenHeight - topInset - handleHeight\n : fullScreenHeight - topInset;\n\n /**\n * Snap points changing cause a rerender of the position,\n * this is an issue if you are calling close on the bottom sheet.\n */\n const snapPoints = useMemo(\n () => [initialSnapPoint, finalSnapPoint],\n [initialSnapPoint, finalSnapPoint],\n );\n\n return (\n <>\n <BottomSheet\n containerHeight={fullScreenHeight}\n enablePanDownToClose={true}\n handleComponent={\n /**\n * using `null` here instead of `style={{ opacity: photoError ? 0 : 1 }}`\n * as opacity is not an allowed style\n */\n photoError ? null : AttachmentPickerBottomSheetHandle\n }\n handleHeight={handleHeight}\n index={-1}\n onChange={setCurrentIndex}\n ref={ref}\n snapPoints={snapPoints}\n >\n {iOSLimited && (\n <Button onPress={iOS14RefreshGallerySelection} title={t('Select More Photos')} />\n )}\n <BottomSheetFlatList\n contentContainerStyle={[\n styles.container,\n { backgroundColor: white },\n bottomSheetContentContainer,\n { opacity: photoError ? 0 : 1 },\n ]}\n data={selectedPhotos}\n keyExtractor={(item) => item.asset.uri}\n numColumns={numberOfAttachmentPickerImageColumns ?? 3}\n onEndReached={photoError ? undefined : getMorePhotos}\n renderItem={renderAttachmentPickerItem}\n />\n </BottomSheet>\n {selectedPicker === 'images' && photoError && (\n <AttachmentPickerError\n attachmentPickerBottomSheetHeight={initialSnapPoint}\n attachmentPickerErrorButtonText={attachmentPickerErrorButtonText}\n AttachmentPickerErrorImage={AttachmentPickerErrorImage}\n attachmentPickerErrorText={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AS,EAChB;MAAE8J,eAAe,EAAEnI;IAAM,CAAC,EAC1BF,2BAA2B,EAC3B;MAAEsI,OAAO,EAAEzG,UAAU,GAAG,CAAC,GAAG;IAAE,CAAC,CAC/B;IACF0G,IAAI,EAAE3C,cAAe;IACrB4C,YAAY,EAAE,SAAAA,aAACC,IAAI;MAAA,OAAKA,IAAI,CAAC3C,KAAK,CAACO,GAAG;IAAA,CAAC;IACvCqC,UAAU,EAAEhJ,oCAAoC,WAApCA,oCAAoC,GAAI,CAAE;IACtDiJ,YAAY,EAAE9G,UAAU,GAAGgD,SAAS,GAAG7B,aAAc;IACrD4F,UAAU,EAAEC,gDAA2B;IAAAnB,MAAA,EAAAjL,KAAA;IAAAkL,QAAA;MAAAC,QAAA,EAAAlL,YAAA;MAAAmL,UAAA;MAAAC,YAAA;IAAA;EAAA,CACxC,CACU,CAAC,EACbpH,cAAc,KAAK,QAAQ,IAAImB,UAAU,IACxClG,MAAA,YAAAwL,aAAA,CAAC/H,qBAAqB;IACpBD,iCAAiC,EAAE4H,gBAAiB;IACpD1H,+BAA+B,EAAEA,+BAAgC;IACjEC,0BAA0B,EAAEA,0BAA2B;IACvDC,yBAAyB,EAAEA,yBAA0B;IAAAmI,MAAA,EAAAjL,KAAA;IAAAkL,QAAA;MAAAC,QAAA,EAAAlL,YAAA;MAAAmL,UAAA;MAAAC,YAAA;IAAA;EAAA,CACtD,CAEH,CAAC;AAEP,CACF,CAAC;AAACgB,OAAA,CAAAlK,gBAAA,GAAAA,gBAAA;AAEFA,gBAAgB,CAACmK,WAAW,GAAG,kBAAkB"}
|
|
1
|
+
{"version":3,"names":["_react","_interopRequireWildcard","require","_reactNative","_bottomSheet","_dayjs","_interopRequireDefault","_duration","_AttachmentPickerItem","_AttachmentPickerContext","_ThemeContext","_useViewport2","_native","_this","_jsxFileName","_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","obj","__esModule","_typeof","cache","has","get","newObj","hasPropertyDescriptor","Object","defineProperty","getOwnPropertyDescriptor","key","prototype","hasOwnProperty","call","desc","set","dayjs","extend","duration","styles","StyleSheet","create","container","flexGrow","fullScreenHeight","Dimensions","height","AttachmentPicker","React","forwardRef","props","ref","AttachmentPickerBottomSheetHandle","attachmentPickerBottomSheetHandleHeight","attachmentPickerBottomSheetHeight","AttachmentPickerError","attachmentPickerErrorButtonText","AttachmentPickerErrorImage","attachmentPickerErrorText","AttachmentPickerIOSSelectMorePhotos","ImageOverlaySelectedComponent","numberOfAttachmentImagesToLoadPerCall","numberOfAttachmentPickerImageColumns","translucentStatusBar","_useTheme","useTheme","_useTheme$theme","theme","bottomSheetContentContainer","attachmentPicker","white","colors","_useAttachmentPickerC","useAttachmentPickerContext","closePicker","maxNumberOfFiles","selectedFiles","selectedImages","selectedPicker","setSelectedFiles","setSelectedImages","setSelectedPicker","topInset","_useViewport","useViewport","vh","screenHeight","_useState","useState","_useState2","_slicedToArray2","currentIndex","setCurrentIndex","endCursorRef","useRef","_useState3","_useState4","photoError","setPhotoError","_useState5","_useState6","iOSLimited","setIosLimited","hasNextPageRef","_useState7","_useState8","loadingPhotos","setLoadingPhotos","_useState9","_useState10","photos","setPhotos","attemptedToLoadPhotosOnOpenRef","getMorePhotos","useCallback","_asyncToGenerator2","_regenerator","mark","_callee","endCursor","results","wrap","_callee$","_context","prev","next","current","getPhotos","after","first","sent","prevPhotos","concat","_toConsumableArray2","assets","hasNextPage","t0","stop","getMorePhotosRef","useEffect","_oniOS14GalleryLibrar","oniOS14GalleryLibrarySelectionChange","undefined","unsubscribe","backAction","backHandler","BackHandler","addEventListener","remove","onKeyboardOpenHandler","keyboardShowEvent","Platform","OS","keyboardSubscription","Keyboard","addListener","removeListener","selectedPhotos","map","asset","numberOfUploads","length","selected","some","image","id","uri","file","handleHeight","getAndroidBottomBarHeightAdjustment","_StatusBar$currentHei","statusBarHeight","StatusBar","currentHeight","bottomBarHeight","getInitialSnapPoint","initialSnapPoint","finalSnapPoint","snapPoints","useMemo","createElement","Fragment","containerHeight","enablePanDownToClose","handleComponent","index","onChange","__self","__source","fileName","lineNumber","columnNumber","BottomSheetFlatList","contentContainerStyle","backgroundColor","opacity","data","keyExtractor","item","numColumns","onEndReached","renderItem","renderAttachmentPickerItem","exports","displayName"],"sources":["AttachmentPicker.tsx"],"sourcesContent":["import React, { useCallback, useEffect, useMemo, useRef, useState } from 'react';\nimport { BackHandler, Dimensions, Keyboard, Platform, StatusBar, StyleSheet } from 'react-native';\n\nimport BottomSheet, { BottomSheetFlatList, BottomSheetHandleProps } from '@gorhom/bottom-sheet';\nimport dayjs from 'dayjs';\nimport duration from 'dayjs/plugin/duration';\n\nimport type { AttachmentPickerErrorProps } from './components/AttachmentPickerError';\n\nimport { renderAttachmentPickerItem } from './components/AttachmentPickerItem';\n\nimport { useAttachmentPickerContext } from '../../contexts/attachmentPickerContext/AttachmentPickerContext';\nimport { useTheme } from '../../contexts/themeContext/ThemeContext';\nimport { useViewport } from '../../hooks/useViewport';\nimport { getPhotos, oniOS14GalleryLibrarySelectionChange } from '../../native';\nimport type { Asset } from '../../types/types';\n\ndayjs.extend(duration);\n\nconst styles = StyleSheet.create({\n container: {\n flexGrow: 1,\n },\n});\n\nconst fullScreenHeight = Dimensions.get('window').height;\n\nexport type AttachmentPickerProps = {\n /**\n * Custom UI component to render [draggable handle](https://github.com/GetStream/stream-chat-react-native/blob/main/screenshots/docs/1.png) of attachment picker.\n *\n * **Default** [AttachmentPickerBottomSheetHandle](https://github.com/GetStream/stream-chat-react-native/blob/main/package/src/components/AttachmentPicker/components/AttachmentPickerBottomSheetHandle.tsx)\n */\n AttachmentPickerBottomSheetHandle: React.FC<BottomSheetHandleProps>;\n /**\n * Custom UI component to render error component while opening attachment picker.\n *\n * **Default** [AttachmentPickerError](https://github.com/GetStream/stream-chat-react-native/blob/main/package/src/components/AttachmentPicker/components/AttachmentPickerError.tsx)\n */\n AttachmentPickerError: React.ComponentType<AttachmentPickerErrorProps>;\n /**\n * Custom UI component to render error image for attachment picker\n *\n * **Default** [AttachmentPickerErrorImage](https://github.com/GetStream/stream-chat-react-native/blob/main/package/src/components/AttachmentPicker/components/AttachmentPickerErrorImage.tsx)\n */\n AttachmentPickerErrorImage: React.ComponentType;\n /**\n * Custom UI Component to render select more photos for selected gallery access in iOS.\n */\n AttachmentPickerIOSSelectMorePhotos: React.ComponentType;\n /**\n * Custom UI component to render overlay component, that shows up on top of [selected image](https://github.com/GetStream/stream-chat-react-native/blob/main/screenshots/docs/1.png) (with tick mark)\n *\n * **Default** [ImageOverlaySelectedComponent](https://github.com/GetStream/stream-chat-react-native/blob/main/package/src/components/AttachmentPicker/components/ImageOverlaySelectedComponent.tsx)\n */\n ImageOverlaySelectedComponent: React.ComponentType;\n attachmentPickerBottomSheetHandleHeight?: number;\n attachmentPickerBottomSheetHeight?: number;\n attachmentPickerErrorButtonText?: string;\n attachmentPickerErrorText?: string;\n numberOfAttachmentImagesToLoadPerCall?: number;\n numberOfAttachmentPickerImageColumns?: number;\n translucentStatusBar?: boolean;\n};\n\nexport const AttachmentPicker = React.forwardRef(\n (props: AttachmentPickerProps, ref: React.ForwardedRef<BottomSheet>) => {\n const {\n AttachmentPickerBottomSheetHandle,\n attachmentPickerBottomSheetHandleHeight,\n attachmentPickerBottomSheetHeight,\n AttachmentPickerError,\n attachmentPickerErrorButtonText,\n AttachmentPickerErrorImage,\n attachmentPickerErrorText,\n AttachmentPickerIOSSelectMorePhotos,\n ImageOverlaySelectedComponent,\n numberOfAttachmentImagesToLoadPerCall,\n numberOfAttachmentPickerImageColumns,\n translucentStatusBar,\n } = props;\n\n const {\n theme: {\n attachmentPicker: { bottomSheetContentContainer },\n colors: { white },\n },\n } = useTheme();\n const {\n closePicker,\n maxNumberOfFiles,\n selectedFiles,\n selectedImages,\n selectedPicker,\n setSelectedFiles,\n setSelectedImages,\n setSelectedPicker,\n topInset,\n } = useAttachmentPickerContext();\n const { vh } = useViewport();\n\n const screenHeight = vh(100);\n\n const [currentIndex, setCurrentIndex] = useState(-1);\n const endCursorRef = useRef<string>();\n const [photoError, setPhotoError] = useState(false);\n const [iOSLimited, setIosLimited] = useState(false);\n const hasNextPageRef = useRef(true);\n const [loadingPhotos, setLoadingPhotos] = useState(false);\n const [photos, setPhotos] = useState<Asset[]>([]);\n const attemptedToLoadPhotosOnOpenRef = useRef(false);\n\n const getMorePhotos = useCallback(async () => {\n if (\n hasNextPageRef.current &&\n !loadingPhotos &&\n currentIndex > -1 &&\n selectedPicker === 'images'\n ) {\n setPhotoError(false);\n setLoadingPhotos(true);\n const endCursor = endCursorRef.current;\n try {\n const results = await getPhotos({\n after: endCursor,\n first: numberOfAttachmentImagesToLoadPerCall ?? 60,\n });\n endCursorRef.current = results.endCursor;\n setPhotos((prevPhotos) =>\n endCursor ? [...prevPhotos, ...results.assets] : results.assets,\n );\n setIosLimited(results.iOSLimited);\n hasNextPageRef.current = !!results.hasNextPage;\n } catch (error) {\n setPhotoError(true);\n }\n setLoadingPhotos(false);\n }\n }, [currentIndex, selectedPicker, loadingPhotos]);\n\n // we need to use ref here to avoid running effect when getMorePhotos changes\n const getMorePhotosRef = useRef(getMorePhotos);\n getMorePhotosRef.current = getMorePhotos;\n\n useEffect(() => {\n if (selectedPicker !== 'images') return;\n // ios 14 library selection change event is fired when user reselects the images that are permitted to be readable by the app\n const { unsubscribe } = oniOS14GalleryLibrarySelectionChange(() => {\n // we reset the cursor and has next page to true to facilitate fetching of the first page of photos again\n hasNextPageRef.current = true;\n endCursorRef.current = undefined;\n // fetch the first page of photos again\n getMorePhotosRef.current();\n });\n return unsubscribe;\n }, [selectedPicker]);\n\n useEffect(() => {\n const backAction = () => {\n if (selectedPicker) {\n setSelectedPicker(undefined);\n closePicker();\n return true;\n }\n\n return false;\n };\n\n const backHandler = BackHandler.addEventListener('hardwareBackPress', backAction);\n\n return () => backHandler.remove();\n }, [selectedPicker, closePicker]);\n\n useEffect(() => {\n const onKeyboardOpenHandler = () => {\n if (selectedPicker) {\n setSelectedPicker(undefined);\n }\n closePicker();\n };\n const keyboardShowEvent = Platform.OS === 'ios' ? 'keyboardWillShow' : 'keyboardDidShow';\n const keyboardSubscription = Keyboard.addListener(keyboardShowEvent, onKeyboardOpenHandler);\n\n return () => {\n if (keyboardSubscription?.remove) {\n keyboardSubscription.remove();\n return;\n }\n\n // To keep compatibility with older versions of React Native, where `remove()` is not available\n Keyboard.removeListener(keyboardShowEvent, onKeyboardOpenHandler);\n };\n }, [closePicker, selectedPicker]);\n\n useEffect(() => {\n if (currentIndex < 0) {\n setSelectedPicker(undefined);\n if (!loadingPhotos) {\n endCursorRef.current = undefined;\n hasNextPageRef.current = true;\n attemptedToLoadPhotosOnOpenRef.current = false;\n setPhotoError(false);\n }\n }\n }, [currentIndex, loadingPhotos]);\n\n useEffect(() => {\n if (\n !attemptedToLoadPhotosOnOpenRef.current &&\n selectedPicker === 'images' &&\n endCursorRef.current === undefined &&\n currentIndex > -1 &&\n !loadingPhotos\n ) {\n getMorePhotos();\n // we do this only once on open for avoiding to request permissions in rationale dialog again and again on Android\n attemptedToLoadPhotosOnOpenRef.current = true;\n }\n }, [currentIndex, selectedPicker, getMorePhotos, loadingPhotos]);\n\n const selectedPhotos = photos.map((asset) => ({\n asset,\n ImageOverlaySelectedComponent,\n maxNumberOfFiles,\n numberOfAttachmentPickerImageColumns,\n numberOfUploads: selectedFiles.length + selectedImages.length,\n // `id` is available for Expo MediaLibrary while Cameraroll doesn't share id therefore we use `uri`\n selected:\n selectedImages.some((image) =>\n image.id ? image.id === asset.id : image.uri === asset.uri,\n ) ||\n selectedFiles.some((file) => (file.id ? file.id === asset.id : file.uri === asset.uri)),\n selectedFiles,\n selectedImages,\n setSelectedFiles,\n setSelectedImages,\n }));\n\n const handleHeight = attachmentPickerBottomSheetHandleHeight || 20;\n\n /**\n * This is to handle issues with Android measurements coming back incorrect.\n * If the StatusBar height is perfectly 1/2 of the difference between the two\n * dimensions for screen and window, it is incorrect and we need to account for\n * this. If you use a translucent header bar more adjustments are needed.\n */\n const getAndroidBottomBarHeightAdjustment = (): number => {\n if (Platform.OS === 'android') {\n const statusBarHeight = StatusBar.currentHeight ?? 0;\n const bottomBarHeight = fullScreenHeight - screenHeight - statusBarHeight;\n if (bottomBarHeight === statusBarHeight) {\n return translucentStatusBar ? 0 : statusBarHeight;\n } else {\n if (translucentStatusBar) {\n if (bottomBarHeight > statusBarHeight) {\n return -bottomBarHeight + statusBarHeight;\n } else {\n return bottomBarHeight > 0 ? -statusBarHeight : 0;\n }\n } else {\n return bottomBarHeight > 0 ? 0 : statusBarHeight;\n }\n }\n }\n return 0;\n };\n\n const getInitialSnapPoint = (): number => {\n if (attachmentPickerBottomSheetHeight !== undefined) {\n return attachmentPickerBottomSheetHeight;\n }\n if (Platform.OS === 'android') {\n return (\n 308 +\n (fullScreenHeight - screenHeight + getAndroidBottomBarHeightAdjustment()) -\n handleHeight\n );\n } else {\n return 308 + (fullScreenHeight - screenHeight);\n }\n };\n\n const initialSnapPoint = getInitialSnapPoint();\n\n const finalSnapPoint =\n Platform.OS === 'android'\n ? fullScreenHeight - topInset - handleHeight\n : fullScreenHeight - topInset;\n\n /**\n * Snap points changing cause a rerender of the position,\n * this is an issue if you are calling close on the bottom sheet.\n */\n const snapPoints = useMemo(\n () => [initialSnapPoint, finalSnapPoint],\n [initialSnapPoint, finalSnapPoint],\n );\n\n return (\n <>\n <BottomSheet\n containerHeight={fullScreenHeight}\n enablePanDownToClose={true}\n handleComponent={\n /**\n * using `null` here instead of `style={{ opacity: photoError ? 0 : 1 }}`\n * as opacity is not an allowed style\n */\n photoError ? null : AttachmentPickerBottomSheetHandle\n }\n handleHeight={handleHeight}\n index={-1}\n onChange={setCurrentIndex}\n ref={ref}\n snapPoints={snapPoints}\n >\n {iOSLimited && <AttachmentPickerIOSSelectMorePhotos />}\n <BottomSheetFlatList\n contentContainerStyle={[\n styles.container,\n { backgroundColor: white },\n bottomSheetContentContainer,\n { opacity: photoError ? 0 : 1 },\n ]}\n data={selectedPhotos}\n keyExtractor={(item) => item.asset.uri}\n numColumns={numberOfAttachmentPickerImageColumns ?? 3}\n onEndReached={photoError ? undefined : getMorePhotos}\n renderItem={renderAttachmentPickerItem}\n />\n </BottomSheet>\n {selectedPicker === 'images' && photoError && (\n <AttachmentPickerError\n attachmentPickerBottomSheetHeight={initialSnapPoint}\n attachmentPickerErrorButtonText={attachmentPickerErrorButtonText}\n AttachmentPickerErrorImage={AttachmentPickerErrorImage}\n attachmentPickerErrorText={attachmentPickerErrorText}\n />\n )}\n </>\n );\n },\n);\n\nAttachmentPicker.displayName = 'AttachmentPicker';\n"],"mappings":";;;;;;;;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AAEA,IAAAE,YAAA,GAAAH,uBAAA,CAAAC,OAAA;AACA,IAAAG,MAAA,GAAAC,sBAAA,CAAAJ,OAAA;AACA,IAAAK,SAAA,GAAAD,sBAAA,CAAAJ,OAAA;AAIA,IAAAM,qBAAA,GAAAN,OAAA;AAEA,IAAAO,wBAAA,GAAAP,OAAA;AACA,IAAAQ,aAAA,GAAAR,OAAA;AACA,IAAAS,aAAA,GAAAT,OAAA;AACA,IAAAU,OAAA,GAAAV,OAAA;AAA+E,IAAAW,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,SAAAf,wBAAAmB,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,CAAA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AAC,EACtDhM,MAAA,YAAAqL,aAAA,CAACjL,YAAA,CAAA6L,mBAAmB;IAClBC,qBAAqB,EAAE,CACrB1J,MAAM,CAACG,SAAS,EAChB;MAAEwJ,eAAe,EAAE5H;IAAM,CAAC,EAC1BF,2BAA2B,EAC3B;MAAE+H,OAAO,EAAElG,UAAU,GAAG,CAAC,GAAG;IAAE,CAAC,CAC/B;IACFmG,IAAI,EAAEvC,cAAe;IACrBwC,YAAY,EAAE,SAAAA,aAACC,IAAI;MAAA,OAAKA,IAAI,CAACvC,KAAK,CAACO,GAAG;IAAA,CAAC;IACvCiC,UAAU,EAAEzI,oCAAoC,WAApCA,oCAAoC,GAAI,CAAE;IACtD0I,YAAY,EAAEvG,UAAU,GAAG6C,SAAS,GAAG7B,aAAc;IACrDwF,UAAU,EAAEC,gDAA2B;IAAAf,MAAA,EAAA/K,KAAA;IAAAgL,QAAA;MAAAC,QAAA,EAAAhL,YAAA;MAAAiL,UAAA;MAAAC,YAAA;IAAA;EAAA,CACxC,CACU,CAAC,EACbjH,cAAc,KAAK,QAAQ,IAAImB,UAAU,IACxClG,MAAA,YAAAqL,aAAA,CAAC7H,qBAAqB;IACpBD,iCAAiC,EAAE0H,gBAAiB;IACpDxH,+BAA+B,EAAEA,+BAAgC;IACjEC,0BAA0B,EAAEA,0BAA2B;IACvDC,yBAAyB,EAAEA,yBAA0B;IAAAiI,MAAA,EAAA/K,KAAA;IAAAgL,QAAA;MAAAC,QAAA,EAAAhL,YAAA;MAAAiL,UAAA;MAAAC,YAAA;IAAA;EAAA,CACtD,CAEH,CAAC;AAEP,CACF,CAAC;AAACY,OAAA,CAAA5J,gBAAA,GAAAA,gBAAA;AAEFA,gBAAgB,CAAC6J,WAAW,GAAG,kBAAkB"}
|
package/lib/commonjs/components/AttachmentPicker/components/AttachmentPickerIOSSelectMorePhotos.js
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
2
|
+
Object.defineProperty(exports, "__esModule", {
|
|
3
|
+
value: true
|
|
4
|
+
});
|
|
5
|
+
exports.AttachmentPickerIOSSelectMorePhotos = void 0;
|
|
6
|
+
var _react = _interopRequireDefault(require("react"));
|
|
7
|
+
var _reactNative = require("react-native");
|
|
8
|
+
var _TranslationContext = require("../../../contexts/translationContext/TranslationContext");
|
|
9
|
+
var _native = require("../../../native");
|
|
10
|
+
var _this = this,
|
|
11
|
+
_jsxFileName = "/home/runner/work/stream-chat-react-native/stream-chat-react-native/package/src/components/AttachmentPicker/components/AttachmentPickerIOSSelectMorePhotos.tsx";
|
|
12
|
+
var AttachmentPickerIOSSelectMorePhotos = function AttachmentPickerIOSSelectMorePhotos() {
|
|
13
|
+
var _useTranslationContex = (0, _TranslationContext.useTranslationContext)(),
|
|
14
|
+
t = _useTranslationContex.t;
|
|
15
|
+
return _react["default"].createElement(_reactNative.Button, {
|
|
16
|
+
onPress: _native.iOS14RefreshGallerySelection,
|
|
17
|
+
title: t('Select More Photos'),
|
|
18
|
+
__self: _this,
|
|
19
|
+
__source: {
|
|
20
|
+
fileName: _jsxFileName,
|
|
21
|
+
lineNumber: 9,
|
|
22
|
+
columnNumber: 10
|
|
23
|
+
}
|
|
24
|
+
});
|
|
25
|
+
};
|
|
26
|
+
exports.AttachmentPickerIOSSelectMorePhotos = AttachmentPickerIOSSelectMorePhotos;
|
|
27
|
+
//# sourceMappingURL=AttachmentPickerIOSSelectMorePhotos.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_react","_interopRequireDefault","require","_reactNative","_TranslationContext","_native","_this","_jsxFileName","AttachmentPickerIOSSelectMorePhotos","_useTranslationContex","useTranslationContext","t","createElement","Button","onPress","iOS14RefreshGallerySelection","title","__self","__source","fileName","lineNumber","columnNumber","exports"],"sources":["AttachmentPickerIOSSelectMorePhotos.tsx"],"sourcesContent":["import React from 'react';\nimport { Button } from 'react-native';\n\nimport { useTranslationContext } from '../../../contexts/translationContext/TranslationContext';\nimport { iOS14RefreshGallerySelection } from '../../../native';\n\nexport const AttachmentPickerIOSSelectMorePhotos = () => {\n const { t } = useTranslationContext();\n return <Button onPress={iOS14RefreshGallerySelection} title={t('Select More Photos')} />;\n};\n"],"mappings":";;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AAEA,IAAAE,mBAAA,GAAAF,OAAA;AACA,IAAAG,OAAA,GAAAH,OAAA;AAA+D,IAAAI,KAAA;EAAAC,YAAA;AAExD,IAAMC,mCAAmC,GAAG,SAAtCA,mCAAmCA,CAAA,EAAS;EACvD,IAAAC,qBAAA,GAAc,IAAAC,yCAAqB,EAAC,CAAC;IAA7BC,CAAC,GAAAF,qBAAA,CAADE,CAAC;EACT,OAAOX,MAAA,YAAAY,aAAA,CAACT,YAAA,CAAAU,MAAM;IAACC,OAAO,EAAEC,oCAA6B;IAACC,KAAK,EAAEL,CAAC,CAAC,oBAAoB,CAAE;IAAAM,MAAA,EAAAX,KAAA;IAAAY,QAAA;MAAAC,QAAA,EAAAZ,YAAA;MAAAa,UAAA;MAAAC,YAAA;IAAA;EAAA,CAAE,CAAC;AAC1F,CAAC;AAACC,OAAA,CAAAd,mCAAA,GAAAA,mCAAA"}
|
|
@@ -24,6 +24,7 @@ var _init = _interopRequireDefault(require("../../init"));
|
|
|
24
24
|
var _native = require("../../native");
|
|
25
25
|
var _QuickSqliteClient = require("../../store/QuickSqliteClient");
|
|
26
26
|
var _DBSyncManager = require("../../utils/DBSyncManager");
|
|
27
|
+
var _StreamChatRN = require("../../utils/StreamChatRN");
|
|
27
28
|
var _version = require("../../version.json");
|
|
28
29
|
var _this = this,
|
|
29
30
|
_jsxFileName = "/home/runner/work/stream-chat-react-native/stream-chat-react-native/package/src/components/Chat/Chat.tsx";
|
|
@@ -41,6 +42,8 @@ var ChatWithContext = function ChatWithContext(props) {
|
|
|
41
42
|
i18nInstance = props.i18nInstance,
|
|
42
43
|
_props$ImageComponent = props.ImageComponent,
|
|
43
44
|
ImageComponent = _props$ImageComponent === void 0 ? _reactNative.Image : _props$ImageComponent,
|
|
45
|
+
_props$resizableCDNHo = props.resizableCDNHosts,
|
|
46
|
+
resizableCDNHosts = _props$resizableCDNHo === void 0 ? ['.stream-io-cdn.com'] : _props$resizableCDNHo,
|
|
44
47
|
style = props.style;
|
|
45
48
|
var _useState = (0, _react.useState)(),
|
|
46
49
|
_useState2 = (0, _slicedToArray2["default"])(_useState, 2),
|
|
@@ -57,6 +60,9 @@ var ChatWithContext = function ChatWithContext(props) {
|
|
|
57
60
|
var mutedUsers = (0, _useMutedUsers.useMutedUsers)(client);
|
|
58
61
|
var debugRef = (0, _DebugContext.useDebugContext)();
|
|
59
62
|
var isDebugModeEnabled = __DEV__ && debugRef && debugRef.current;
|
|
63
|
+
_StreamChatRN.StreamChatRN.setConfig({
|
|
64
|
+
resizableCDNHosts: resizableCDNHosts
|
|
65
|
+
});
|
|
60
66
|
(0, _react.useEffect)(function () {
|
|
61
67
|
if (client) {
|
|
62
68
|
client.setUserAgent(_native.SDK + "-" + _reactNative.Platform.OS + "-" + _version.version);
|
|
@@ -93,6 +99,7 @@ var ChatWithContext = function ChatWithContext(props) {
|
|
|
93
99
|
ImageComponent: ImageComponent,
|
|
94
100
|
isOnline: isOnline,
|
|
95
101
|
mutedUsers: mutedUsers,
|
|
102
|
+
resizableCDNHosts: resizableCDNHosts,
|
|
96
103
|
setActiveChannel: setActiveChannel
|
|
97
104
|
});
|
|
98
105
|
(0, _useSyncDatabase.useSyncDatabase)({
|
|
@@ -108,7 +115,7 @@ var ChatWithContext = function ChatWithContext(props) {
|
|
|
108
115
|
__self: _this,
|
|
109
116
|
__source: {
|
|
110
117
|
fileName: _jsxFileName,
|
|
111
|
-
lineNumber:
|
|
118
|
+
lineNumber: 232,
|
|
112
119
|
columnNumber: 5
|
|
113
120
|
}
|
|
114
121
|
}, _react["default"].createElement(_TranslationContext.TranslationProvider, {
|
|
@@ -118,7 +125,7 @@ var ChatWithContext = function ChatWithContext(props) {
|
|
|
118
125
|
__self: _this,
|
|
119
126
|
__source: {
|
|
120
127
|
fileName: _jsxFileName,
|
|
121
|
-
lineNumber:
|
|
128
|
+
lineNumber: 233,
|
|
122
129
|
columnNumber: 7
|
|
123
130
|
}
|
|
124
131
|
}, _react["default"].createElement(_ThemeContext.ThemeProvider, {
|
|
@@ -126,14 +133,14 @@ var ChatWithContext = function ChatWithContext(props) {
|
|
|
126
133
|
__self: _this,
|
|
127
134
|
__source: {
|
|
128
135
|
fileName: _jsxFileName,
|
|
129
|
-
lineNumber:
|
|
136
|
+
lineNumber: 236,
|
|
130
137
|
columnNumber: 9
|
|
131
138
|
}
|
|
132
139
|
}, _react["default"].createElement(_ChannelsStateContext.ChannelsStateProvider, {
|
|
133
140
|
__self: _this,
|
|
134
141
|
__source: {
|
|
135
142
|
fileName: _jsxFileName,
|
|
136
|
-
lineNumber:
|
|
143
|
+
lineNumber: 237,
|
|
137
144
|
columnNumber: 11
|
|
138
145
|
}
|
|
139
146
|
}, children))));
|
|
@@ -147,7 +154,7 @@ var Chat = function Chat(props) {
|
|
|
147
154
|
__self: _this,
|
|
148
155
|
__source: {
|
|
149
156
|
fileName: _jsxFileName,
|
|
150
|
-
lineNumber:
|
|
157
|
+
lineNumber: 272,
|
|
151
158
|
columnNumber: 10
|
|
152
159
|
}
|
|
153
160
|
}));
|
|
@@ -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,W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7E,KAAuD,EACpD;EACH,IAAA8E,kBAAA,GAAkB,IAAAC,iCAAiB,EAAC,CAAC;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,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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kF,kBAAA,GAAkB,IAAAC,iCAAiB,EAAC,CAAC;IAA7BpE,KAAK,GAAAmE,kBAAA,CAALnE,KAAK;EAEb,OAAOhE,MAAA,YAAAmH,aAAA,CAACnE,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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,GAAA,EAAAM,MAAA,YAAAA,MAAA;
|
|
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 * 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,wB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G,SAA3BA,wBAAwBA,CAAIC,KAA0D,EAAK;IAC/F,IAAMC,WAAW,GAAGT,cAAc,CAAqB,CAAC;IAExD,OAAO9C,MAAA,YAAAuC,aAAA,CAACa,SAAS,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
|
}))))))));
|