stream-chat-react-native 5.11.3-beta.6 → 5.12.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/package.json +13 -4
- package/src/handlers/index.ts +1 -4
- package/src/handlers/oniOS14GalleryLibrarySelectionChange.ts +22 -0
- package/src/index.js +11 -6
- package/src/optionalDependencies/Video.ts +3 -3
- package/src/optionalDependencies/index.ts +5 -0
- package/src/{handlers → optionalDependencies}/setClipboardString.ts +1 -0
- /package/src/{handlers → optionalDependencies}/pickDocument.ts +0 -0
- /package/src/{handlers → optionalDependencies}/shareImage.ts +0 -0
- /package/src/{handlers → optionalDependencies}/triggerHaptic.ts +0 -0
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "stream-chat-react-native",
|
|
3
3
|
"description": "The official React Native SDK for Stream Chat, a service for building chat applications",
|
|
4
|
-
"version": "5.
|
|
4
|
+
"version": "5.12.0-beta.1",
|
|
5
5
|
"author": {
|
|
6
6
|
"company": "Stream.io Inc",
|
|
7
7
|
"name": "Stream.io Inc"
|
|
@@ -11,11 +11,12 @@
|
|
|
11
11
|
"types": "types/index.d.ts",
|
|
12
12
|
"dependencies": {
|
|
13
13
|
"es6-symbol": "^3.1.3",
|
|
14
|
-
"stream-chat-react-native-core": "5.
|
|
14
|
+
"stream-chat-react-native-core": "5.12.0-beta.1"
|
|
15
15
|
},
|
|
16
16
|
"peerDependencies": {
|
|
17
17
|
"@react-native-camera-roll/camera-roll": ">=5.0.0",
|
|
18
18
|
"@react-native-community/netinfo": ">=2.0.7",
|
|
19
|
+
"@react-native-clipboard/clipboard": "^1.11.1",
|
|
19
20
|
"@stream-io/flat-list-mvcp": "^0.10.2",
|
|
20
21
|
"react-native": ">=0.60.0",
|
|
21
22
|
"react-native-document-picker": ">=3.2.0",
|
|
@@ -23,12 +24,20 @@
|
|
|
23
24
|
"react-native-haptic-feedback": ">=1.11.0",
|
|
24
25
|
"react-native-image-crop-picker": ">=0.33.2",
|
|
25
26
|
"react-native-image-resizer": ">=1.4.2",
|
|
26
|
-
"react-native-share": ">=4.1.0"
|
|
27
|
-
"@react-native-clipboard/clipboard": "^1.11.1"
|
|
27
|
+
"react-native-share": ">=4.1.0"
|
|
28
28
|
},
|
|
29
29
|
"peerDependenciesMeta": {
|
|
30
30
|
"@react-native-clipboard/clipboard": {
|
|
31
31
|
"optional": true
|
|
32
|
+
},
|
|
33
|
+
"react-native-share": {
|
|
34
|
+
"optional": true
|
|
35
|
+
},
|
|
36
|
+
"react-native-document-picker": {
|
|
37
|
+
"optional": true
|
|
38
|
+
},
|
|
39
|
+
"react-native-haptic-feedback": {
|
|
40
|
+
"optional": true
|
|
32
41
|
}
|
|
33
42
|
},
|
|
34
43
|
"scripts": {
|
package/src/handlers/index.ts
CHANGED
|
@@ -1,13 +1,10 @@
|
|
|
1
|
-
export * from './shareImage';
|
|
2
1
|
export * from './deleteFile';
|
|
3
2
|
export * from './compressImage';
|
|
4
3
|
export * from './getLocalAssetUri';
|
|
5
4
|
export * from './getPhotos';
|
|
6
5
|
export * from './NetInfo';
|
|
7
|
-
export * from './pickDocument';
|
|
8
6
|
export * from './saveFile';
|
|
9
|
-
export * from './setClipboardString';
|
|
10
7
|
export * from './takePhoto';
|
|
11
|
-
export * from './triggerHaptic';
|
|
12
8
|
export * from './Sound';
|
|
13
9
|
export * from './Video';
|
|
10
|
+
export * from './oniOS14GalleryLibrarySelectionChange';
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { Platform } from 'react-native';
|
|
2
|
+
|
|
3
|
+
import { cameraRollEventEmitter } from '@react-native-camera-roll/camera-roll';
|
|
4
|
+
|
|
5
|
+
const isAboveIOS14 = Platform.OS === 'ios' && parseInt(Platform.Version as string, 10) >= 14;
|
|
6
|
+
|
|
7
|
+
export function oniOS14GalleryLibrarySelectionChange(callback: () => void): {
|
|
8
|
+
unsubscribe: () => void;
|
|
9
|
+
} {
|
|
10
|
+
if (isAboveIOS14) {
|
|
11
|
+
const subscription = cameraRollEventEmitter.addListener('onLibrarySelectionChange', callback);
|
|
12
|
+
return {
|
|
13
|
+
unsubscribe: () => {
|
|
14
|
+
subscription.remove();
|
|
15
|
+
},
|
|
16
|
+
};
|
|
17
|
+
}
|
|
18
|
+
return {
|
|
19
|
+
// eslint-disable-next-line @typescript-eslint/no-empty-function
|
|
20
|
+
unsubscribe: () => {},
|
|
21
|
+
};
|
|
22
|
+
}
|
package/src/index.js
CHANGED
|
@@ -6,19 +6,23 @@ import { registerNativeHandlers } from 'stream-chat-react-native-core';
|
|
|
6
6
|
import {
|
|
7
7
|
compressImage,
|
|
8
8
|
deleteFile,
|
|
9
|
-
NetInfo,
|
|
10
9
|
getLocalAssetUri,
|
|
11
10
|
getPhotos,
|
|
12
|
-
|
|
11
|
+
NetInfo,
|
|
12
|
+
oniOS14GalleryLibrarySelectionChange,
|
|
13
13
|
saveFile,
|
|
14
|
-
setClipboardString,
|
|
15
|
-
shareImage,
|
|
16
14
|
Sound,
|
|
17
15
|
takePhoto,
|
|
18
|
-
triggerHaptic,
|
|
19
16
|
Video,
|
|
20
17
|
} from './handlers';
|
|
21
18
|
|
|
19
|
+
import {
|
|
20
|
+
pickDocument,
|
|
21
|
+
setClipboardString,
|
|
22
|
+
shareImage,
|
|
23
|
+
triggerHaptic,
|
|
24
|
+
} from './optionalDependencies';
|
|
25
|
+
|
|
22
26
|
registerNativeHandlers({
|
|
23
27
|
compressImage,
|
|
24
28
|
deleteFile,
|
|
@@ -26,10 +30,11 @@ registerNativeHandlers({
|
|
|
26
30
|
getLocalAssetUri,
|
|
27
31
|
getPhotos,
|
|
28
32
|
NetInfo,
|
|
33
|
+
oniOS14GalleryLibrarySelectionChange,
|
|
29
34
|
pickDocument,
|
|
30
35
|
saveFile,
|
|
31
|
-
setClipboardString,
|
|
32
36
|
SDK: 'stream-chat-react-native',
|
|
37
|
+
setClipboardString,
|
|
33
38
|
shareImage,
|
|
34
39
|
Sound,
|
|
35
40
|
takePhoto,
|
|
@@ -2,9 +2,6 @@ import { StyleProp, ViewStyle } from 'react-native';
|
|
|
2
2
|
|
|
3
3
|
let AudioVideoComponent:
|
|
4
4
|
| React.ComponentType<{
|
|
5
|
-
audioOnly?: boolean;
|
|
6
|
-
ignoreSilentSwitch?: 'ignore' | 'obey';
|
|
7
|
-
repeat?: boolean;
|
|
8
5
|
onBuffer: () => void;
|
|
9
6
|
onEnd: () => void;
|
|
10
7
|
onError: (error: Error) => void;
|
|
@@ -16,6 +13,9 @@ let AudioVideoComponent:
|
|
|
16
13
|
uri: string;
|
|
17
14
|
};
|
|
18
15
|
style: StyleProp<ViewStyle>;
|
|
16
|
+
audioOnly?: boolean;
|
|
17
|
+
ignoreSilentSwitch?: 'ignore' | 'obey';
|
|
18
|
+
repeat?: boolean;
|
|
19
19
|
}>
|
|
20
20
|
| undefined;
|
|
21
21
|
try {
|
|
File without changes
|
|
File without changes
|
|
File without changes
|