@sendbird/uikit-react-native 1.0.2 → 1.1.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/README.md +7 -7
- package/lib/commonjs/components/FileViewer.js +319 -0
- package/lib/commonjs/components/FileViewer.js.map +1 -0
- package/lib/commonjs/components/MessageRenderer/FileMessage/VideoFileMessage.js +116 -0
- package/lib/commonjs/components/MessageRenderer/FileMessage/VideoFileMessage.js.map +1 -0
- package/lib/commonjs/components/MessageRenderer/FileMessage/index.js +8 -0
- package/lib/commonjs/components/MessageRenderer/FileMessage/index.js.map +1 -1
- package/lib/commonjs/components/MessageRenderer/MessageOutgoingStatus.js +20 -65
- package/lib/commonjs/components/MessageRenderer/MessageOutgoingStatus.js.map +1 -1
- package/lib/commonjs/components/UserActionBar.js +1 -3
- package/lib/commonjs/components/UserActionBar.js.map +1 -1
- package/lib/commonjs/components/UserSelectableBar.js +1 -3
- package/lib/commonjs/components/UserSelectableBar.js.map +1 -1
- package/lib/commonjs/constants.js +7 -1
- package/lib/commonjs/constants.js.map +1 -1
- package/lib/commonjs/containers/GroupChannelPreviewContainer.js +157 -0
- package/lib/commonjs/containers/GroupChannelPreviewContainer.js.map +1 -0
- package/lib/commonjs/{InternalErrorBoundary.js → containers/InternalErrorBoundaryContainer.js} +5 -5
- package/lib/commonjs/containers/InternalErrorBoundaryContainer.js.map +1 -0
- package/lib/commonjs/{SendbirdUIKitContainer.js → containers/SendbirdUIKitContainer.js} +15 -12
- package/lib/commonjs/containers/SendbirdUIKitContainer.js.map +1 -0
- package/lib/commonjs/contexts/PlatformService.js +4 -2
- package/lib/commonjs/contexts/PlatformService.js.map +1 -1
- package/lib/commonjs/contexts/SendbirdChat.js +6 -2
- package/lib/commonjs/contexts/SendbirdChat.js.map +1 -1
- package/lib/commonjs/domain/groupChannel/component/GroupChannelInput/SendInput.js +1 -1
- package/lib/commonjs/domain/groupChannel/component/GroupChannelInput/SendInput.js.map +1 -1
- package/lib/commonjs/domain/groupChannel/component/GroupChannelMessageList.js +30 -7
- package/lib/commonjs/domain/groupChannel/component/GroupChannelMessageList.js.map +1 -1
- package/lib/commonjs/domain/groupChannel/module/moduleContext.js +2 -3
- package/lib/commonjs/domain/groupChannel/module/moduleContext.js.map +1 -1
- package/lib/commonjs/domain/groupChannel/types.js.map +1 -1
- package/lib/commonjs/domain/groupChannelList/types.js.map +1 -1
- package/lib/commonjs/domain/groupChannelSettings/module/moduleContext.js +1 -1
- package/lib/commonjs/domain/groupChannelSettings/module/moduleContext.js.map +1 -1
- package/lib/commonjs/fragments/createGroupChannelCreateFragment.js +3 -7
- package/lib/commonjs/fragments/createGroupChannelCreateFragment.js.map +1 -1
- package/lib/commonjs/fragments/createGroupChannelFragment.js +14 -12
- package/lib/commonjs/fragments/createGroupChannelFragment.js.map +1 -1
- package/lib/commonjs/fragments/createGroupChannelListFragment.js +10 -40
- package/lib/commonjs/fragments/createGroupChannelListFragment.js.map +1 -1
- package/lib/commonjs/fragments/createGroupChannelMembersFragment.js +1 -1
- package/lib/commonjs/fragments/createGroupChannelMembersFragment.js.map +1 -1
- package/lib/commonjs/hooks/useContext.js.map +1 -1
- package/lib/commonjs/index.js +30 -3
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/{InternalLocalCacheStorage.js → libs/InternalLocalCacheStorage.js} +0 -0
- package/lib/commonjs/libs/InternalLocalCacheStorage.js.map +1 -0
- package/lib/commonjs/localization/StringSet.type.js +8 -0
- package/lib/commonjs/localization/StringSet.type.js.map +1 -1
- package/lib/commonjs/platform/createFileService.expo.js +21 -2
- package/lib/commonjs/platform/createFileService.expo.js.map +1 -1
- package/lib/commonjs/platform/createFileService.native.js +20 -3
- package/lib/commonjs/platform/createFileService.native.js.map +1 -1
- package/lib/commonjs/platform/createMediaService.expo.js +64 -0
- package/lib/commonjs/platform/createMediaService.expo.js.map +1 -0
- package/lib/commonjs/platform/createMediaService.native.js +67 -0
- package/lib/commonjs/platform/createMediaService.native.js.map +1 -0
- package/lib/commonjs/platform/createNotificationService.expo.js.map +1 -1
- package/lib/commonjs/platform/types.js.map +1 -1
- package/lib/commonjs/version.js +1 -1
- package/lib/commonjs/version.js.map +1 -1
- package/lib/module/components/FileViewer.js +300 -0
- package/lib/module/components/FileViewer.js.map +1 -0
- package/lib/module/components/MessageRenderer/FileMessage/VideoFileMessage.js +100 -0
- package/lib/module/components/MessageRenderer/FileMessage/VideoFileMessage.js.map +1 -0
- package/lib/module/components/MessageRenderer/FileMessage/index.js +6 -0
- package/lib/module/components/MessageRenderer/FileMessage/index.js.map +1 -1
- package/lib/module/components/MessageRenderer/MessageOutgoingStatus.js +17 -60
- package/lib/module/components/MessageRenderer/MessageOutgoingStatus.js.map +1 -1
- package/lib/module/components/UserActionBar.js +1 -1
- package/lib/module/components/UserActionBar.js.map +1 -1
- package/lib/module/components/UserSelectableBar.js +1 -1
- package/lib/module/components/UserSelectableBar.js.map +1 -1
- package/lib/module/constants.js +5 -0
- package/lib/module/constants.js.map +1 -1
- package/lib/module/containers/GroupChannelPreviewContainer.js +135 -0
- package/lib/module/containers/GroupChannelPreviewContainer.js.map +1 -0
- package/lib/module/{InternalErrorBoundary.js → containers/InternalErrorBoundaryContainer.js} +5 -5
- package/lib/module/containers/InternalErrorBoundaryContainer.js.map +1 -0
- package/lib/module/{SendbirdUIKitContainer.js → containers/SendbirdUIKitContainer.js} +15 -12
- package/lib/module/containers/SendbirdUIKitContainer.js.map +1 -0
- package/lib/module/contexts/PlatformService.js +4 -2
- package/lib/module/contexts/PlatformService.js.map +1 -1
- package/lib/module/contexts/SendbirdChat.js +6 -2
- package/lib/module/contexts/SendbirdChat.js.map +1 -1
- package/lib/module/domain/groupChannel/component/GroupChannelInput/SendInput.js +1 -1
- package/lib/module/domain/groupChannel/component/GroupChannelInput/SendInput.js.map +1 -1
- package/lib/module/domain/groupChannel/component/GroupChannelMessageList.js +28 -7
- package/lib/module/domain/groupChannel/component/GroupChannelMessageList.js.map +1 -1
- package/lib/module/domain/groupChannel/module/moduleContext.js +2 -3
- package/lib/module/domain/groupChannel/module/moduleContext.js.map +1 -1
- package/lib/module/domain/groupChannel/types.js.map +1 -1
- package/lib/module/domain/groupChannelList/types.js.map +1 -1
- package/lib/module/domain/groupChannelSettings/module/moduleContext.js +1 -1
- package/lib/module/domain/groupChannelSettings/module/moduleContext.js.map +1 -1
- package/lib/module/fragments/createGroupChannelCreateFragment.js +4 -4
- package/lib/module/fragments/createGroupChannelCreateFragment.js.map +1 -1
- package/lib/module/fragments/createGroupChannelFragment.js +16 -14
- package/lib/module/fragments/createGroupChannelFragment.js.map +1 -1
- package/lib/module/fragments/createGroupChannelListFragment.js +14 -41
- package/lib/module/fragments/createGroupChannelListFragment.js.map +1 -1
- package/lib/module/fragments/createGroupChannelMembersFragment.js +1 -1
- package/lib/module/fragments/createGroupChannelMembersFragment.js.map +1 -1
- package/lib/module/hooks/useContext.js.map +1 -1
- package/lib/module/index.js +5 -2
- package/lib/module/index.js.map +1 -1
- package/lib/module/{InternalLocalCacheStorage.js → libs/InternalLocalCacheStorage.js} +0 -0
- package/lib/module/libs/InternalLocalCacheStorage.js.map +1 -0
- package/lib/module/localization/StringSet.type.js +8 -0
- package/lib/module/localization/StringSet.type.js.map +1 -1
- package/lib/module/platform/createFileService.expo.js +21 -2
- package/lib/module/platform/createFileService.expo.js.map +1 -1
- package/lib/module/platform/createFileService.native.js +20 -3
- package/lib/module/platform/createFileService.native.js.map +1 -1
- package/lib/module/platform/createMediaService.expo.js +54 -0
- package/lib/module/platform/createMediaService.expo.js.map +1 -0
- package/lib/module/platform/createMediaService.native.js +57 -0
- package/lib/module/platform/createMediaService.native.js.map +1 -0
- package/lib/module/platform/createNotificationService.expo.js.map +1 -1
- package/lib/module/platform/types.js.map +1 -1
- package/lib/module/version.js +1 -1
- package/lib/module/version.js.map +1 -1
- package/lib/typescript/src/components/FileViewer.d.ts +12 -0
- package/lib/typescript/src/components/MessageRenderer/FileMessage/VideoFileMessage.d.ts +3 -0
- package/lib/typescript/src/components/UserActionBar.d.ts +2 -3
- package/lib/typescript/src/components/UserSelectableBar.d.ts +2 -3
- package/lib/typescript/src/constants.d.ts +5 -0
- package/lib/typescript/src/containers/GroupChannelPreviewContainer.d.ts +8 -0
- package/lib/typescript/src/{InternalErrorBoundary.d.ts → containers/InternalErrorBoundaryContainer.d.ts} +3 -3
- package/lib/typescript/src/{SendbirdUIKitContainer.d.ts → containers/SendbirdUIKitContainer.d.ts} +9 -5
- package/lib/typescript/src/contexts/PlatformService.d.ts +3 -2
- package/lib/typescript/src/contexts/SendbirdChat.d.ts +5 -1
- package/lib/typescript/src/domain/groupChannel/component/GroupChannelMessageList.d.ts +3 -2
- package/lib/typescript/src/domain/groupChannel/types.d.ts +6 -2
- package/lib/typescript/src/domain/groupChannelList/types.d.ts +2 -2
- package/lib/typescript/src/hooks/useContext.d.ts +7 -5
- package/lib/typescript/src/index.d.ts +4 -1
- package/lib/typescript/src/{InternalLocalCacheStorage.d.ts → libs/InternalLocalCacheStorage.d.ts} +2 -2
- package/lib/typescript/src/localization/StringSet.type.d.ts +4 -0
- package/lib/typescript/src/platform/createMediaService.expo.d.ts +9 -0
- package/lib/typescript/src/platform/createMediaService.native.d.ts +9 -0
- package/lib/typescript/src/platform/createNotificationService.expo.d.ts +1 -1
- package/lib/typescript/src/platform/types.d.ts +20 -1
- package/lib/typescript/src/version.d.ts +1 -1
- package/package.json +14 -5
- package/src/components/FileViewer.tsx +283 -0
- package/src/components/MessageRenderer/FileMessage/VideoFileMessage.tsx +91 -0
- package/src/components/MessageRenderer/FileMessage/index.tsx +6 -0
- package/src/components/MessageRenderer/MessageOutgoingStatus.tsx +14 -54
- package/src/components/UserActionBar.tsx +1 -1
- package/src/components/UserSelectableBar.tsx +1 -1
- package/src/constants.ts +5 -0
- package/src/containers/GroupChannelPreviewContainer.tsx +117 -0
- package/src/{InternalErrorBoundary.tsx → containers/InternalErrorBoundaryContainer.tsx} +4 -4
- package/src/{SendbirdUIKitContainer.tsx → containers/SendbirdUIKitContainer.tsx} +26 -14
- package/src/contexts/PlatformService.tsx +15 -3
- package/src/contexts/SendbirdChat.tsx +13 -5
- package/src/domain/groupChannel/component/GroupChannelInput/SendInput.tsx +1 -1
- package/src/domain/groupChannel/component/GroupChannelMessageList.tsx +23 -6
- package/src/domain/groupChannel/module/moduleContext.tsx +6 -13
- package/src/domain/groupChannel/types.ts +8 -2
- package/src/domain/groupChannelList/types.ts +3 -2
- package/src/domain/groupChannelSettings/module/moduleContext.tsx +5 -10
- package/src/fragments/createGroupChannelCreateFragment.tsx +38 -41
- package/src/fragments/createGroupChannelFragment.tsx +24 -34
- package/src/fragments/createGroupChannelListFragment.tsx +13 -35
- package/src/fragments/createGroupChannelMembersFragment.tsx +34 -39
- package/src/hooks/useContext.ts +3 -5
- package/src/index.ts +6 -2
- package/src/{InternalLocalCacheStorage.ts → libs/InternalLocalCacheStorage.ts} +1 -1
- package/src/localization/StringSet.type.ts +8 -0
- package/src/platform/createFileService.expo.ts +17 -2
- package/src/platform/createFileService.native.ts +16 -3
- package/src/platform/createMediaService.expo.tsx +30 -0
- package/src/platform/createMediaService.native.tsx +37 -0
- package/src/platform/createNotificationService.expo.ts +1 -1
- package/src/platform/types.ts +26 -1
- package/src/version.ts +1 -1
- package/lib/commonjs/InternalErrorBoundary.js.map +0 -1
- package/lib/commonjs/InternalLocalCacheStorage.js.map +0 -1
- package/lib/commonjs/SendbirdUIKitContainer.js.map +0 -1
- package/lib/module/InternalErrorBoundary.js.map +0 -1
- package/lib/module/InternalLocalCacheStorage.js.map +0 -1
- package/lib/module/SendbirdUIKitContainer.js.map +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["React","createExpoMediaService","avModule","thumbnailModule","VideoComponent","source","resizeMode","onLoad","props","getVideoThumbnail","url","quality","timeMills","uri","getThumbnailAsync","time","path"],"sources":["createMediaService.expo.tsx"],"sourcesContent":["import type * as ExpoAV from 'expo-av';\nimport type * as ExpoVideoThumbnail from 'expo-video-thumbnails';\nimport React from 'react';\n\nimport type { MediaServiceInterface } from './types';\n\ntype Modules = {\n avModule: typeof ExpoAV;\n thumbnailModule: typeof ExpoVideoThumbnail;\n};\n\nconst createExpoMediaService = ({ avModule, thumbnailModule }: Modules): MediaServiceInterface => {\n return {\n VideoComponent({ source, resizeMode, onLoad, ...props }) {\n // FIXME: type error https://github.com/expo/expo/issues/17101\n // @ts-ignore\n return <avModule.Video {...props} source={source} resizeMode={resizeMode} onLoad={onLoad} useNativeControls />;\n },\n async getVideoThumbnail({ url, quality, timeMills }) {\n try {\n const { uri } = await thumbnailModule.getThumbnailAsync(url, { quality, time: timeMills });\n return { path: uri };\n } catch {\n return null;\n }\n },\n };\n};\n\nexport default createExpoMediaService;\n"],"mappings":";;AAEA,OAAOA,KAAP,MAAkB,OAAlB;;AASA,MAAMC,sBAAsB,GAAG,QAAmE;EAAA,IAAlE;IAAEC,QAAF;IAAYC;EAAZ,CAAkE;EAChG,OAAO;IACLC,cAAc,QAA2C;MAAA,IAA1C;QAAEC,MAAF;QAAUC,UAAV;QAAsBC,MAAtB;QAA8B,GAAGC;MAAjC,CAA0C;MACvD;MACA;MACA,oBAAO,oBAAC,QAAD,CAAU,KAAV,eAAoBA,KAApB;QAA2B,MAAM,EAAEH,MAAnC;QAA2C,UAAU,EAAEC,UAAvD;QAAmE,MAAM,EAAEC,MAA3E;QAAmF,iBAAiB;MAApG,GAAP;IACD,CALI;;IAML,MAAME,iBAAN,QAAqD;MAAA,IAA7B;QAAEC,GAAF;QAAOC,OAAP;QAAgBC;MAAhB,CAA6B;;MACnD,IAAI;QACF,MAAM;UAAEC;QAAF,IAAU,MAAMV,eAAe,CAACW,iBAAhB,CAAkCJ,GAAlC,EAAuC;UAAEC,OAAF;UAAWI,IAAI,EAAEH;QAAjB,CAAvC,CAAtB;QACA,OAAO;UAAEI,IAAI,EAAEH;QAAR,CAAP;MACD,CAHD,CAGE,MAAM;QACN,OAAO,IAAP;MACD;IACF;;EAbI,CAAP;AAeD,CAhBD;;AAkBA,eAAeZ,sBAAf"}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
2
|
+
|
|
3
|
+
import React from 'react';
|
|
4
|
+
|
|
5
|
+
function hash(str) {
|
|
6
|
+
return String(Math.abs(str.split('').reduce((a, c) => (a << 5) - a + c.charCodeAt(0) | 0, 0)));
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
const createNativeMediaService = _ref => {
|
|
10
|
+
let {
|
|
11
|
+
VideoComponent,
|
|
12
|
+
thumbnailModule
|
|
13
|
+
} = _ref;
|
|
14
|
+
return {
|
|
15
|
+
VideoComponent(_ref2) {
|
|
16
|
+
let {
|
|
17
|
+
source,
|
|
18
|
+
resizeMode,
|
|
19
|
+
onLoad,
|
|
20
|
+
...props
|
|
21
|
+
} = _ref2;
|
|
22
|
+
return /*#__PURE__*/React.createElement(VideoComponent, _extends({}, props, {
|
|
23
|
+
source: source,
|
|
24
|
+
resizeMode: resizeMode,
|
|
25
|
+
onLoad: onLoad,
|
|
26
|
+
controls: true
|
|
27
|
+
}));
|
|
28
|
+
},
|
|
29
|
+
|
|
30
|
+
async getVideoThumbnail(_ref3) {
|
|
31
|
+
let {
|
|
32
|
+
url,
|
|
33
|
+
timeMills
|
|
34
|
+
} = _ref3;
|
|
35
|
+
|
|
36
|
+
try {
|
|
37
|
+
const {
|
|
38
|
+
path
|
|
39
|
+
} = await thumbnailModule.createThumbnail({
|
|
40
|
+
url,
|
|
41
|
+
format: 'jpeg',
|
|
42
|
+
timeStamp: timeMills,
|
|
43
|
+
cacheName: hash(url)
|
|
44
|
+
});
|
|
45
|
+
return {
|
|
46
|
+
path
|
|
47
|
+
};
|
|
48
|
+
} catch {
|
|
49
|
+
return null;
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
};
|
|
54
|
+
};
|
|
55
|
+
|
|
56
|
+
export default createNativeMediaService;
|
|
57
|
+
//# sourceMappingURL=createMediaService.native.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["React","hash","str","String","Math","abs","split","reduce","a","c","charCodeAt","createNativeMediaService","VideoComponent","thumbnailModule","source","resizeMode","onLoad","props","getVideoThumbnail","url","timeMills","path","createThumbnail","format","timeStamp","cacheName"],"sources":["createMediaService.native.tsx"],"sourcesContent":["import React from 'react';\nimport type * as CreateThumbnail from 'react-native-create-thumbnail';\nimport type Video from 'react-native-video';\n\nimport type { MediaServiceInterface } from './types';\n\ntype Modules = {\n VideoComponent: typeof Video;\n thumbnailModule: typeof CreateThumbnail;\n};\n\nfunction hash(str: string) {\n return String(Math.abs(str.split('').reduce((a, c) => ((a << 5) - a + c.charCodeAt(0)) | 0, 0)));\n}\n\nconst createNativeMediaService = ({ VideoComponent, thumbnailModule }: Modules): MediaServiceInterface => {\n return {\n VideoComponent({ source, resizeMode, onLoad, ...props }) {\n return <VideoComponent {...props} source={source} resizeMode={resizeMode} onLoad={onLoad} controls />;\n },\n async getVideoThumbnail({ url, timeMills }) {\n try {\n const { path } = await thumbnailModule.createThumbnail({\n url,\n format: 'jpeg',\n timeStamp: timeMills,\n cacheName: hash(url),\n });\n return { path };\n } catch {\n return null;\n }\n },\n };\n};\n\nexport default createNativeMediaService;\n"],"mappings":";;AAAA,OAAOA,KAAP,MAAkB,OAAlB;;AAWA,SAASC,IAAT,CAAcC,GAAd,EAA2B;EACzB,OAAOC,MAAM,CAACC,IAAI,CAACC,GAAL,CAASH,GAAG,CAACI,KAAJ,CAAU,EAAV,EAAcC,MAAd,CAAqB,CAACC,CAAD,EAAIC,CAAJ,KAAW,CAACD,CAAC,IAAI,CAAN,IAAWA,CAAX,GAAeC,CAAC,CAACC,UAAF,CAAa,CAAb,CAAhB,GAAmC,CAAlE,EAAqE,CAArE,CAAT,CAAD,CAAb;AACD;;AAED,MAAMC,wBAAwB,GAAG,QAAyE;EAAA,IAAxE;IAAEC,cAAF;IAAkBC;EAAlB,CAAwE;EACxG,OAAO;IACLD,cAAc,QAA2C;MAAA,IAA1C;QAAEE,MAAF;QAAUC,UAAV;QAAsBC,MAAtB;QAA8B,GAAGC;MAAjC,CAA0C;MACvD,oBAAO,oBAAC,cAAD,eAAoBA,KAApB;QAA2B,MAAM,EAAEH,MAAnC;QAA2C,UAAU,EAAEC,UAAvD;QAAmE,MAAM,EAAEC,MAA3E;QAAmF,QAAQ;MAA3F,GAAP;IACD,CAHI;;IAIL,MAAME,iBAAN,QAA4C;MAAA,IAApB;QAAEC,GAAF;QAAOC;MAAP,CAAoB;;MAC1C,IAAI;QACF,MAAM;UAAEC;QAAF,IAAW,MAAMR,eAAe,CAACS,eAAhB,CAAgC;UACrDH,GADqD;UAErDI,MAAM,EAAE,MAF6C;UAGrDC,SAAS,EAAEJ,SAH0C;UAIrDK,SAAS,EAAExB,IAAI,CAACkB,GAAD;QAJsC,CAAhC,CAAvB;QAMA,OAAO;UAAEE;QAAF,CAAP;MACD,CARD,CAQE,MAAM;QACN,OAAO,IAAP;MACD;IACF;;EAhBI,CAAP;AAkBD,CAnBD;;AAqBA,eAAeV,wBAAf"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["createExpoNotificationService","messagingModule","authorizedStatus","IosAuthorizationStatus","AUTHORIZED","PROVISIONAL","getAPNSToken","response","getDevicePushTokenAsync","data","getFCMToken","hasPushPermission","status","getPermissionsAsync","Boolean","granted","ios","includes","requestPushPermission","requestPermissionsAsync","onTokenRefresh","handler","subscription","addPushTokenListener","removePushTokenSubscription"],"sources":["createNotificationService.expo.ts"],"sourcesContent":["import type ExpoNotification from 'expo-notifications';\n\nimport type { ExpoPushPermissionResponse } from '../utils/expoPermissionGranted';\nimport type { NotificationServiceInterface } from './types';\n\nconst createExpoNotificationService = (messagingModule: typeof ExpoNotification): NotificationServiceInterface => {\n const authorizedStatus = [\n messagingModule.IosAuthorizationStatus.AUTHORIZED,\n messagingModule.IosAuthorizationStatus.PROVISIONAL,\n ];\n\n return {\n async getAPNSToken(): Promise<string | null> {\n const response = await messagingModule.getDevicePushTokenAsync();\n return response.data;\n },\n async getFCMToken(): Promise<string | null> {\n const response = await messagingModule.getDevicePushTokenAsync();\n return response.data;\n },\n async hasPushPermission(): Promise<boolean> {\n const status = (await messagingModule.getPermissionsAsync()) as ExpoPushPermissionResponse;\n return Boolean(status.granted || (status.ios?.status && authorizedStatus.includes(status.ios.status)));\n },\n async requestPushPermission(): Promise<boolean> {\n const status = (await messagingModule.requestPermissionsAsync()) as ExpoPushPermissionResponse;\n return Boolean(status.granted || (status.ios?.status && authorizedStatus.includes(status.ios.status)));\n },\n onTokenRefresh(handler: (token: string) => void): () => void | undefined {\n const subscription = messagingModule.addPushTokenListener(({ data }) => handler(data));\n return () => messagingModule.removePushTokenSubscription(subscription);\n },\n };\n};\n\nexport default createExpoNotificationService;\n"],"mappings":"AAKA,MAAMA,6BAA6B,GAAIC,eAAD,IAA4E;EAChH,MAAMC,gBAAgB,GAAG,CACvBD,eAAe,CAACE,sBAAhB,CAAuCC,UADhB,EAEvBH,eAAe,CAACE,sBAAhB,CAAuCE,WAFhB,CAAzB;EAKA,OAAO;IACL,MAAMC,YAAN,GAA6C;MAC3C,MAAMC,QAAQ,GAAG,MAAMN,eAAe,CAACO,uBAAhB,EAAvB;MACA,OAAOD,QAAQ,CAACE,IAAhB;IACD,CAJI;;IAKL,MAAMC,WAAN,GAA4C;MAC1C,MAAMH,QAAQ,GAAG,MAAMN,eAAe,CAACO,uBAAhB,EAAvB;MACA,OAAOD,QAAQ,CAACE,IAAhB;IACD,CARI;;IASL,MAAME,iBAAN,GAA4C;MAAA;;MAC1C,MAAMC,MAAM,GAAI,MAAMX,eAAe,CAACY,mBAAhB,EAAtB;MACA,OAAOC,OAAO,CAACF,MAAM,CAACG,OAAP,IAAmB,gBAAAH,MAAM,CAACI,GAAP,4DAAYJ,MAAZ,KAAsBV,gBAAgB,CAACe,QAAjB,CAA0BL,MAAM,CAACI,GAAP,CAAWJ,MAArC,CAA1C,CAAd;IACD,CAZI;;IAaL,MAAMM,qBAAN,GAAgD;MAAA;;MAC9C,MAAMN,MAAM,GAAI,MAAMX,eAAe,CAACkB,uBAAhB,EAAtB;MACA,OAAOL,OAAO,CAACF,MAAM,CAACG,OAAP,IAAmB,iBAAAH,MAAM,CAACI,GAAP,8DAAYJ,MAAZ,KAAsBV,gBAAgB,CAACe,QAAjB,CAA0BL,MAAM,CAACI,GAAP,CAAWJ,MAArC,CAA1C,CAAd;IACD,CAhBI;;IAiBLQ,cAAc,CAACC,OAAD,EAA2D;MACvE,MAAMC,YAAY,GAAGrB,eAAe,CAACsB,oBAAhB,CAAqC;QAAA,IAAC;UAAEd;QAAF,CAAD;QAAA,OAAcY,OAAO,CAACZ,IAAD,CAArB;MAAA,CAArC,CAArB;MACA,OAAO,MAAMR,eAAe,CAACuB,2BAAhB,CAA4CF,YAA5C,CAAb;IACD;;EApBI,CAAP;AAsBD,CA5BD;;AA8BA,eAAetB,6BAAf"}
|
|
1
|
+
{"version":3,"names":["createExpoNotificationService","messagingModule","authorizedStatus","IosAuthorizationStatus","AUTHORIZED","PROVISIONAL","getAPNSToken","response","getDevicePushTokenAsync","data","getFCMToken","hasPushPermission","status","getPermissionsAsync","Boolean","granted","ios","includes","requestPushPermission","requestPermissionsAsync","onTokenRefresh","handler","subscription","addPushTokenListener","removePushTokenSubscription"],"sources":["createNotificationService.expo.ts"],"sourcesContent":["import type * as ExpoNotification from 'expo-notifications';\n\nimport type { ExpoPushPermissionResponse } from '../utils/expoPermissionGranted';\nimport type { NotificationServiceInterface } from './types';\n\nconst createExpoNotificationService = (messagingModule: typeof ExpoNotification): NotificationServiceInterface => {\n const authorizedStatus = [\n messagingModule.IosAuthorizationStatus.AUTHORIZED,\n messagingModule.IosAuthorizationStatus.PROVISIONAL,\n ];\n\n return {\n async getAPNSToken(): Promise<string | null> {\n const response = await messagingModule.getDevicePushTokenAsync();\n return response.data;\n },\n async getFCMToken(): Promise<string | null> {\n const response = await messagingModule.getDevicePushTokenAsync();\n return response.data;\n },\n async hasPushPermission(): Promise<boolean> {\n const status = (await messagingModule.getPermissionsAsync()) as ExpoPushPermissionResponse;\n return Boolean(status.granted || (status.ios?.status && authorizedStatus.includes(status.ios.status)));\n },\n async requestPushPermission(): Promise<boolean> {\n const status = (await messagingModule.requestPermissionsAsync()) as ExpoPushPermissionResponse;\n return Boolean(status.granted || (status.ios?.status && authorizedStatus.includes(status.ios.status)));\n },\n onTokenRefresh(handler: (token: string) => void): () => void | undefined {\n const subscription = messagingModule.addPushTokenListener(({ data }) => handler(data));\n return () => messagingModule.removePushTokenSubscription(subscription);\n },\n };\n};\n\nexport default createExpoNotificationService;\n"],"mappings":"AAKA,MAAMA,6BAA6B,GAAIC,eAAD,IAA4E;EAChH,MAAMC,gBAAgB,GAAG,CACvBD,eAAe,CAACE,sBAAhB,CAAuCC,UADhB,EAEvBH,eAAe,CAACE,sBAAhB,CAAuCE,WAFhB,CAAzB;EAKA,OAAO;IACL,MAAMC,YAAN,GAA6C;MAC3C,MAAMC,QAAQ,GAAG,MAAMN,eAAe,CAACO,uBAAhB,EAAvB;MACA,OAAOD,QAAQ,CAACE,IAAhB;IACD,CAJI;;IAKL,MAAMC,WAAN,GAA4C;MAC1C,MAAMH,QAAQ,GAAG,MAAMN,eAAe,CAACO,uBAAhB,EAAvB;MACA,OAAOD,QAAQ,CAACE,IAAhB;IACD,CARI;;IASL,MAAME,iBAAN,GAA4C;MAAA;;MAC1C,MAAMC,MAAM,GAAI,MAAMX,eAAe,CAACY,mBAAhB,EAAtB;MACA,OAAOC,OAAO,CAACF,MAAM,CAACG,OAAP,IAAmB,gBAAAH,MAAM,CAACI,GAAP,4DAAYJ,MAAZ,KAAsBV,gBAAgB,CAACe,QAAjB,CAA0BL,MAAM,CAACI,GAAP,CAAWJ,MAArC,CAA1C,CAAd;IACD,CAZI;;IAaL,MAAMM,qBAAN,GAAgD;MAAA;;MAC9C,MAAMN,MAAM,GAAI,MAAMX,eAAe,CAACkB,uBAAhB,EAAtB;MACA,OAAOL,OAAO,CAACF,MAAM,CAACG,OAAP,IAAmB,iBAAAH,MAAM,CAACI,GAAP,8DAAYJ,MAAZ,KAAsBV,gBAAgB,CAACe,QAAjB,CAA0BL,MAAM,CAACI,GAAP,CAAWJ,MAArC,CAA1C,CAAd;IACD,CAhBI;;IAiBLQ,cAAc,CAACC,OAAD,EAA2D;MACvE,MAAMC,YAAY,GAAGrB,eAAe,CAACsB,oBAAhB,CAAqC;QAAA,IAAC;UAAEd;QAAF,CAAD;QAAA,OAAcY,OAAO,CAACZ,IAAD,CAArB;MAAA,CAArC,CAArB;MACA,OAAO,MAAMR,eAAe,CAACuB,2BAAhB,CAA4CF,YAA5C,CAAb;IACD;;EApBI,CAAP;AAsBD,CA5BD;;AA8BA,eAAetB,6BAAf"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":[],"sources":["types.ts"],"sourcesContent":["export type Unsubscribe = () => void | undefined;\nexport type DownloadedPath = string;\nexport type FilePickerResponse = FileType | null;\nexport type FileType = { uri: string; size: number; name: string; type: string };\n\nexport interface NotificationServiceInterface {\n hasPushPermission(): Promise<boolean>;\n requestPushPermission(): Promise<boolean>;\n\n getAPNSToken(): Promise<string | null>;\n getFCMToken(): Promise<string | null>;\n onTokenRefresh(handler: (token: string) => void): Unsubscribe;\n}\n\nexport interface ClipboardServiceInterface {\n setString(text: string): void;\n getString(): Promise<string>;\n}\n\nexport interface FileServiceInterface extends FilePickerServiceInterface, FileSystemServiceInterface {}\n\nexport interface OpenResultListener {\n onOpenFailureWithToastMessage?: () => void;\n}\nexport interface OpenMediaLibraryOptions extends OpenResultListener {\n selectionLimit?: number;\n mediaType?: 'photo' | 'video' | 'all';\n}\nexport interface OpenCameraOptions extends OpenResultListener {\n cameraType?: 'front' | 'back';\n mediaType?: 'photo' | 'video';\n}\nexport type OpenDocumentOptions = OpenResultListener;\nexport interface SaveOptions {\n fileUrl: string;\n fileName: string;\n fileType?: string | null;\n}\n\nexport interface FilePickerServiceInterface {\n openMediaLibrary(options?: OpenMediaLibraryOptions): Promise<null | FilePickerResponse[]>;\n openCamera(options?: OpenCameraOptions): Promise<FilePickerResponse>;\n openDocument(options?: OpenDocumentOptions): Promise<FilePickerResponse>;\n}\n\nexport interface FileSystemServiceInterface {\n // NOTE: On iOS, You can access the downloaded files by providing options below to info.plist\n // - Supports opening documents in place\n // - Application supports iTunes file sharing\n save(options?: SaveOptions): Promise<DownloadedPath | null>;\n}\n"],"mappings":""}
|
|
1
|
+
{"version":3,"names":[],"sources":["types.ts"],"sourcesContent":["export type Unsubscribe = () => void | undefined;\nexport type DownloadedPath = string;\nexport type FilePickerResponse = FileType | null;\nexport type FileType = { uri: string; size: number; name: string; type: string };\n\n// ---------- NotificationService ---------- //\nexport interface NotificationServiceInterface {\n hasPushPermission(): Promise<boolean>;\n requestPushPermission(): Promise<boolean>;\n\n getAPNSToken(): Promise<string | null>;\n getFCMToken(): Promise<string | null>;\n onTokenRefresh(handler: (token: string) => void): Unsubscribe;\n}\n\n// ---------- ClipboardService ---------- //\nexport interface ClipboardServiceInterface {\n setString(text: string): void;\n getString(): Promise<string>;\n}\n\n// ---------- FileService ---------- //\nexport interface FileServiceInterface extends FilePickerServiceInterface, FileSystemServiceInterface {}\n\nexport interface OpenResultListener {\n onOpenFailureWithToastMessage?: () => void;\n}\nexport interface OpenMediaLibraryOptions extends OpenResultListener {\n selectionLimit?: number;\n mediaType?: 'photo' | 'video' | 'all';\n}\nexport interface OpenCameraOptions extends OpenResultListener {\n cameraType?: 'front' | 'back';\n mediaType?: 'photo' | 'video' | 'all';\n}\nexport type OpenDocumentOptions = OpenResultListener;\nexport interface SaveOptions {\n fileUrl: string;\n fileName: string;\n fileType?: string | null;\n}\n\nexport interface FilePickerServiceInterface {\n openMediaLibrary(options?: OpenMediaLibraryOptions): Promise<null | FilePickerResponse[]>;\n openCamera(options?: OpenCameraOptions): Promise<FilePickerResponse>;\n openDocument(options?: OpenDocumentOptions): Promise<FilePickerResponse>;\n}\n\nexport interface FileSystemServiceInterface {\n // NOTE: On iOS, You can access the downloaded files by providing options below to info.plist\n // - Supports opening documents in place\n // - Application supports iTunes file sharing\n save(options?: SaveOptions): Promise<DownloadedPath | null>;\n}\n\n// ---------- MediaService ---------- //\ninterface VideoProps {\n source: { uri: string } | number;\n resizeMode?: 'cover' | 'contain' | 'stretch';\n onLoad?: () => void;\n}\ninterface GetVideoThumbnailOptions {\n url: string;\n timeMills?: number;\n quality?: number;\n}\nexport interface MediaServiceInterface {\n VideoComponent<Props = {}>(props: VideoProps & Props): JSX.Element;\n getVideoThumbnail(options: GetVideoThumbnailOptions): Promise<{ path: string } | null>;\n // compressImage(options: {\n // path: string;\n // compressionRate: number;\n // resizingWidth: number;\n // resizingHeight: number;\n // }): Promise<{ path: string }>;\n}\n"],"mappings":""}
|
package/lib/module/version.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["VERSION"],"sources":["version.ts"],"sourcesContent":["const VERSION = '1.
|
|
1
|
+
{"version":3,"names":["VERSION"],"sources":["version.ts"],"sourcesContent":["const VERSION = '1.1.1';\nexport default VERSION;\n"],"mappings":"AAAA,MAAMA,OAAO,GAAG,OAAhB;AACA,eAAeA,OAAf"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { SendbirdFileMessage } from '@sendbird/uikit-utils';
|
|
2
|
+
declare type Props = {
|
|
3
|
+
fileMessage: SendbirdFileMessage;
|
|
4
|
+
deleteMessage: () => Promise<void>;
|
|
5
|
+
onClose: () => void;
|
|
6
|
+
onPressDownload?: (message: SendbirdFileMessage) => void;
|
|
7
|
+
onPressDelete?: (message: SendbirdFileMessage) => void;
|
|
8
|
+
headerShown?: boolean;
|
|
9
|
+
headerTopInset?: number;
|
|
10
|
+
};
|
|
11
|
+
declare const FileViewer: ({ headerShown, deleteMessage, headerTopInset, fileMessage, onPressDownload, onPressDelete, onClose, }: Props) => JSX.Element;
|
|
12
|
+
export default FileViewer;
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
1
|
declare type Props = {
|
|
3
2
|
uri: string;
|
|
4
3
|
name: string;
|
|
@@ -7,5 +6,5 @@ declare type Props = {
|
|
|
7
6
|
disabled: boolean;
|
|
8
7
|
onPressActionMenu?: () => void;
|
|
9
8
|
};
|
|
10
|
-
declare const
|
|
11
|
-
export default
|
|
9
|
+
declare const UserActionBar: ({ muted, uri, name, disabled, onPressActionMenu, label }: Props) => JSX.Element;
|
|
10
|
+
export default UserActionBar;
|
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
1
|
declare type Props = {
|
|
3
2
|
uri: string;
|
|
4
3
|
name: string;
|
|
5
4
|
selected: boolean;
|
|
6
5
|
disabled: boolean;
|
|
7
6
|
};
|
|
8
|
-
declare const
|
|
9
|
-
export default
|
|
7
|
+
declare const UserSelectableBar: ({ uri, name, selected, disabled }: Props) => JSX.Element;
|
|
8
|
+
export default UserSelectableBar;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { SendbirdGroupChannel } from '@sendbird/uikit-utils';
|
|
2
|
+
declare type Props = {
|
|
3
|
+
channel: SendbirdGroupChannel;
|
|
4
|
+
onPress: () => void;
|
|
5
|
+
onLongPress: () => void;
|
|
6
|
+
};
|
|
7
|
+
declare const GroupChannelPreviewContainer: ({ onPress, onLongPress, channel }: Props) => JSX.Element;
|
|
8
|
+
export default GroupChannelPreviewContainer;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React, { ErrorInfo } from 'react';
|
|
2
|
-
import type { ErrorBoundaryProps } from '
|
|
3
|
-
declare class
|
|
2
|
+
import type { ErrorBoundaryProps } from '../types';
|
|
3
|
+
declare class InternalErrorBoundaryContainer extends React.PureComponent<{
|
|
4
4
|
onError?: (props: ErrorBoundaryProps) => void;
|
|
5
5
|
ErrorInfoComponent?: (props: ErrorBoundaryProps) => JSX.Element;
|
|
6
6
|
children?: React.ReactNode;
|
|
@@ -16,4 +16,4 @@ declare class InternalErrorBoundary extends React.PureComponent<{
|
|
|
16
16
|
reset: () => void;
|
|
17
17
|
render: () => JSX.Element | null;
|
|
18
18
|
}
|
|
19
|
-
export default
|
|
19
|
+
export default InternalErrorBoundaryContainer;
|
package/lib/typescript/src/{SendbirdUIKitContainer.d.ts → containers/SendbirdUIKitContainer.d.ts}
RENAMED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import type { HeaderStyleContextType, UIKitTheme } from '@sendbird/uikit-react-native-foundation';
|
|
3
3
|
import type { SendbirdChatSDK } from '@sendbird/uikit-utils';
|
|
4
|
-
import type { StringSet } from '
|
|
5
|
-
import type { ClipboardServiceInterface, FileServiceInterface, NotificationServiceInterface } from '
|
|
6
|
-
import type { ErrorBoundaryProps, LocalCacheStorage } from '
|
|
4
|
+
import type { StringSet } from '../localization/StringSet.type';
|
|
5
|
+
import type { ClipboardServiceInterface, FileServiceInterface, MediaServiceInterface, NotificationServiceInterface } from '../platform/types';
|
|
6
|
+
import type { ErrorBoundaryProps, LocalCacheStorage } from '../types';
|
|
7
7
|
export declare const SendbirdUIKit: Readonly<{
|
|
8
|
-
VERSION: "1.
|
|
8
|
+
VERSION: "1.1.1";
|
|
9
9
|
PLATFORM: string;
|
|
10
10
|
}>;
|
|
11
11
|
export declare type SendbirdUIKitContainerProps = React.PropsWithChildren<{
|
|
@@ -14,11 +14,14 @@ export declare type SendbirdUIKitContainerProps = React.PropsWithChildren<{
|
|
|
14
14
|
file: FileServiceInterface;
|
|
15
15
|
notification: NotificationServiceInterface;
|
|
16
16
|
clipboard: ClipboardServiceInterface;
|
|
17
|
+
media?: MediaServiceInterface;
|
|
17
18
|
};
|
|
18
19
|
chatOptions?: {
|
|
19
20
|
localCacheStorage?: LocalCacheStorage;
|
|
20
|
-
enableAutoPushTokenRegistration?: boolean;
|
|
21
21
|
onInitialized?: (sdkInstance: SendbirdChatSDK) => SendbirdChatSDK;
|
|
22
|
+
enableAutoPushTokenRegistration?: boolean;
|
|
23
|
+
enableChannelListTypingIndicator?: boolean;
|
|
24
|
+
enableChannelListMessageReceiptStatus?: boolean;
|
|
22
25
|
};
|
|
23
26
|
localization?: {
|
|
24
27
|
stringSet?: StringSet;
|
|
@@ -27,6 +30,7 @@ export declare type SendbirdUIKitContainerProps = React.PropsWithChildren<{
|
|
|
27
30
|
theme?: UIKitTheme;
|
|
28
31
|
statusBarTranslucent?: boolean;
|
|
29
32
|
defaultHeaderTitleAlign?: 'left' | 'center';
|
|
33
|
+
defaultHeaderHeight?: number;
|
|
30
34
|
HeaderComponent?: HeaderStyleContextType['HeaderComponent'];
|
|
31
35
|
};
|
|
32
36
|
toast?: {
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import type { ClipboardServiceInterface, FileServiceInterface, NotificationServiceInterface } from '../platform/types';
|
|
2
|
+
import type { ClipboardServiceInterface, FileServiceInterface, MediaServiceInterface, NotificationServiceInterface } from '../platform/types';
|
|
3
3
|
declare type Props = React.PropsWithChildren<{
|
|
4
4
|
fileService: FileServiceInterface;
|
|
5
5
|
clipboardService: ClipboardServiceInterface;
|
|
6
6
|
notificationService: NotificationServiceInterface;
|
|
7
|
+
mediaService?: MediaServiceInterface;
|
|
7
8
|
}>;
|
|
8
9
|
export declare const PlatformServiceContext: React.Context<Props | null>;
|
|
9
|
-
export declare const PlatformServiceProvider: ({ children, fileService, clipboardService, notificationService }: Props) => JSX.Element;
|
|
10
|
+
export declare const PlatformServiceProvider: ({ children, fileService, clipboardService, notificationService, mediaService, }: Props) => JSX.Element;
|
|
10
11
|
export {};
|
|
@@ -4,6 +4,8 @@ import type { FileType } from '../platform/types';
|
|
|
4
4
|
declare type Props = React.PropsWithChildren<{
|
|
5
5
|
sdkInstance: SendbirdChatSDK;
|
|
6
6
|
enableAutoPushTokenRegistration: boolean;
|
|
7
|
+
enableChannelListTypingIndicator: boolean;
|
|
8
|
+
enableChannelListMessageReceiptStatus: boolean;
|
|
7
9
|
}>;
|
|
8
10
|
declare type Context = {
|
|
9
11
|
sdk: SendbirdChatSDK;
|
|
@@ -13,6 +15,8 @@ declare type Context = {
|
|
|
13
15
|
markAsDeliveredWithChannel: (channel: SendbirdGroupChannel) => void;
|
|
14
16
|
features: {
|
|
15
17
|
autoPushTokenRegistrationEnabled: boolean;
|
|
18
|
+
channelListTypingIndicatorEnabled: boolean;
|
|
19
|
+
channelListMessageReceiptStatusEnabled: boolean;
|
|
16
20
|
deliveryReceiptEnabled: boolean;
|
|
17
21
|
broadcastChannelEnabled: boolean;
|
|
18
22
|
superGroupChannelEnabled: boolean;
|
|
@@ -20,5 +24,5 @@ declare type Context = {
|
|
|
20
24
|
};
|
|
21
25
|
};
|
|
22
26
|
export declare const SendbirdChatContext: React.Context<Context | null>;
|
|
23
|
-
export declare const SendbirdChatProvider: ({ children, sdkInstance, enableAutoPushTokenRegistration }: Props) => JSX.Element;
|
|
27
|
+
export declare const SendbirdChatProvider: ({ children, sdkInstance, enableAutoPushTokenRegistration, enableChannelListMessageReceiptStatus, enableChannelListTypingIndicator, }: Props) => JSX.Element;
|
|
24
28
|
export {};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import type { SendbirdMessage } from '@sendbird/uikit-utils';
|
|
3
|
-
declare const _default: React.MemoExoticComponent<({ currentUserId, channel, messages, renderMessage, nextMessages, newMessagesFromMembers, onBottomReached, onTopReached, renderNewMessagesButton, renderScrollToBottomButton, onResendFailedMessage, onDeleteMessage, onPressImageMessage, flatListProps, enableMessageGrouping, }: {
|
|
3
|
+
declare const _default: React.MemoExoticComponent<({ currentUserId, channel, messages, renderMessage, nextMessages, newMessagesFromMembers, onBottomReached, onTopReached, renderNewMessagesButton, renderScrollToBottomButton, onResendFailedMessage, onDeleteMessage, onPressImageMessage, onPressMediaMessage, flatListProps, enableMessageGrouping, }: {
|
|
4
4
|
enableMessageGrouping: boolean;
|
|
5
5
|
currentUserId?: string | undefined;
|
|
6
6
|
channel: import("sendbird").GroupChannel;
|
|
@@ -11,7 +11,7 @@ declare const _default: React.MemoExoticComponent<({ currentUserId, channel, mes
|
|
|
11
11
|
onBottomReached: () => void;
|
|
12
12
|
onResendFailedMessage: (failedMessage: import("sendbird").FileMessage | import("sendbird").UserMessage) => Promise<void>;
|
|
13
13
|
onDeleteMessage: (message: import("sendbird").FileMessage | import("sendbird").UserMessage) => Promise<void>;
|
|
14
|
-
|
|
14
|
+
onPressMediaMessage?: ((message: import("sendbird").FileMessage, deleteMessage: () => Promise<void>, uri: string) => void) | undefined;
|
|
15
15
|
renderMessage: (props: {
|
|
16
16
|
message: SendbirdMessage;
|
|
17
17
|
prevMessage?: SendbirdMessage | undefined;
|
|
@@ -32,5 +32,6 @@ declare const _default: React.MemoExoticComponent<({ currentUserId, channel, mes
|
|
|
32
32
|
onPress: () => void;
|
|
33
33
|
}> | null;
|
|
34
34
|
flatListProps?: Omit<import("react-native").FlatListProps<SendbirdMessage>, "data" | "renderItem"> | undefined;
|
|
35
|
+
onPressImageMessage?: ((message: import("sendbird").FileMessage, uri: string) => void) | undefined;
|
|
35
36
|
}) => JSX.Element>;
|
|
36
37
|
export default _default;
|
|
@@ -12,7 +12,7 @@ export interface GroupChannelProps {
|
|
|
12
12
|
onPressHeaderRight: GroupChannelProps['Header']['onPressHeaderRight'];
|
|
13
13
|
onBeforeSendFileMessage?: (params: SendbirdFileMessageParams) => SendbirdFileMessageParams | Promise<SendbirdFileMessageParams>;
|
|
14
14
|
onBeforeSendUserMessage?: (params: SendbirdUserMessageParams) => SendbirdUserMessageParams | Promise<SendbirdUserMessageParams>;
|
|
15
|
-
|
|
15
|
+
onPressMediaMessage?: GroupChannelProps['MessageList']['onPressMediaMessage'];
|
|
16
16
|
renderMessage?: GroupChannelProps['MessageList']['renderMessage'];
|
|
17
17
|
renderNewMessagesButton?: GroupChannelProps['MessageList']['renderNewMessagesButton'];
|
|
18
18
|
renderScrollToBottomButton?: GroupChannelProps['MessageList']['renderScrollToBottomButton'];
|
|
@@ -23,6 +23,8 @@ export interface GroupChannelProps {
|
|
|
23
23
|
sortComparator?: UseGroupChannelMessagesOptions['sortComparator'];
|
|
24
24
|
collectionCreator?: UseGroupChannelMessagesOptions['collectionCreator'];
|
|
25
25
|
queryCreator?: UseGroupChannelMessagesOptions['queryCreator'];
|
|
26
|
+
/** @deprecated `onPressImageMessage` is deprecated, please use `onPressMediaMessage` instead **/
|
|
27
|
+
onPressImageMessage?: GroupChannelProps['MessageList']['onPressImageMessage'];
|
|
26
28
|
};
|
|
27
29
|
Header: {
|
|
28
30
|
onPressHeaderLeft: () => void;
|
|
@@ -39,7 +41,7 @@ export interface GroupChannelProps {
|
|
|
39
41
|
onBottomReached: () => void;
|
|
40
42
|
onResendFailedMessage: (failedMessage: SendbirdUserMessage | SendbirdFileMessage) => Promise<void>;
|
|
41
43
|
onDeleteMessage: (message: SendbirdUserMessage | SendbirdFileMessage) => Promise<void>;
|
|
42
|
-
|
|
44
|
+
onPressMediaMessage?: (message: SendbirdFileMessage, deleteMessage: () => Promise<void>, uri: string) => void;
|
|
43
45
|
renderMessage: (props: {
|
|
44
46
|
message: SendbirdMessage;
|
|
45
47
|
prevMessage?: SendbirdMessage;
|
|
@@ -60,6 +62,8 @@ export interface GroupChannelProps {
|
|
|
60
62
|
onPress: () => void;
|
|
61
63
|
}>;
|
|
62
64
|
flatListProps?: Omit<FlatListProps<SendbirdMessage>, 'data' | 'renderItem'>;
|
|
65
|
+
/** @deprecated `onPressImageMessage` is deprecated, please use `onPressMediaMessage` instead **/
|
|
66
|
+
onPressImageMessage?: (message: SendbirdFileMessage, uri: string) => void;
|
|
63
67
|
};
|
|
64
68
|
Input: {
|
|
65
69
|
channel: SendbirdGroupChannel;
|
|
@@ -21,8 +21,8 @@ export interface GroupChannelListProps {
|
|
|
21
21
|
renderGroupChannelPreview?: (channel: SendbirdGroupChannel, onLongPressChannel: () => void) => React.ReactElement | null;
|
|
22
22
|
/** Custom Query creator for channels query **/
|
|
23
23
|
queryCreator?: UseGroupChannelListOptions['queryCreator'];
|
|
24
|
-
/**
|
|
25
|
-
|
|
24
|
+
/** Custom Collection creator for group channel collection **/
|
|
25
|
+
collectionCreator?: UseGroupChannelListOptions['collectionCreator'];
|
|
26
26
|
/** FlatList props for GroupChannelList.List **/
|
|
27
27
|
flatListProps?: GroupChannelListProps['List']['flatListProps'];
|
|
28
28
|
/** Action menu item creator for onLongPress **/
|
|
@@ -1,21 +1,23 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
export declare const useLocalization: () => LocalizationContextType;
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
export declare const useLocalization: () => import("../contexts/Localization").LocalizationContextType;
|
|
4
3
|
export declare const usePlatformService: () => {
|
|
5
4
|
fileService: import("..").FileServiceInterface;
|
|
6
5
|
clipboardService: import("..").ClipboardServiceInterface;
|
|
7
6
|
notificationService: import("..").NotificationServiceInterface;
|
|
7
|
+
mediaService?: import("../platform/types").MediaServiceInterface | undefined;
|
|
8
8
|
} & {
|
|
9
|
-
children?:
|
|
9
|
+
children?: import("react").ReactNode;
|
|
10
10
|
};
|
|
11
11
|
export declare const useSendbirdChat: () => {
|
|
12
12
|
sdk: import("sendbird").SendBirdInstance;
|
|
13
13
|
currentUser?: import("sendbird").User | undefined;
|
|
14
|
-
setCurrentUser:
|
|
14
|
+
setCurrentUser: import("react").Dispatch<import("react").SetStateAction<import("sendbird").User | undefined>>;
|
|
15
15
|
updateCurrentUserInfo: (nickname: string, profile?: string | import("..").FileType | undefined) => Promise<import("sendbird").User>;
|
|
16
16
|
markAsDeliveredWithChannel: (channel: import("sendbird").GroupChannel) => void;
|
|
17
17
|
features: {
|
|
18
18
|
autoPushTokenRegistrationEnabled: boolean;
|
|
19
|
+
channelListTypingIndicatorEnabled: boolean;
|
|
20
|
+
channelListMessageReceiptStatusEnabled: boolean;
|
|
19
21
|
deliveryReceiptEnabled: boolean;
|
|
20
22
|
broadcastChannelEnabled: boolean;
|
|
21
23
|
superGroupChannelEnabled: boolean;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
export { default as MessageRenderer } from './components/MessageRenderer';
|
|
2
2
|
export { default as ChannelCover } from './components/ChannelCover';
|
|
3
3
|
export { default as ChatFlatList } from './components/ChatFlatList';
|
|
4
|
+
export { default as FileViewer } from './components/FileViewer';
|
|
4
5
|
export { default as NewMessagesButton } from './components/NewMessagesButton';
|
|
5
6
|
export { default as ProviderLayout } from './components/ProviderLayout';
|
|
6
7
|
export { default as ScrollToBottomButton } from './components/ScrollToBottomButton';
|
|
@@ -31,9 +32,11 @@ export type { StringSet } from './localization/StringSet.type';
|
|
|
31
32
|
export { default as createNativeFileService } from './platform/createFileService.native';
|
|
32
33
|
export { default as createNativeClipboardService } from './platform/createClipboardService.native';
|
|
33
34
|
export { default as createNativeNotificationService } from './platform/createNotificationService.native';
|
|
35
|
+
export { default as createNativeMediaService } from './platform/createMediaService.native';
|
|
34
36
|
export { default as createExpoFileService } from './platform/createFileService.expo';
|
|
35
37
|
export { default as createExpoClipboardService } from './platform/createClipboardService.expo';
|
|
36
38
|
export { default as createExpoNotificationService } from './platform/createNotificationService.expo';
|
|
39
|
+
export { default as createExpoMediaService } from './platform/createMediaService.expo';
|
|
37
40
|
export type { FileServiceInterface, ClipboardServiceInterface, FilePickerServiceInterface, FileSystemServiceInterface, SaveOptions, OpenDocumentOptions, OpenCameraOptions, OpenMediaLibraryOptions, OpenResultListener, DownloadedPath, Unsubscribe, FilePickerResponse, FileType, NotificationServiceInterface, } from './platform/types';
|
|
38
41
|
/** Domain **/
|
|
39
42
|
export * from './domain/groupChannel';
|
|
@@ -46,5 +49,5 @@ export * from './domain/userList';
|
|
|
46
49
|
export type { UserListProps, UserListModule, UserListContextsType } from './domain/userList/types';
|
|
47
50
|
export * from './domain/groupChannelUserList/types';
|
|
48
51
|
/** UIKit **/
|
|
49
|
-
export { default as SendbirdUIKitContainer, SendbirdUIKit, SendbirdUIKitContainerProps, } from './SendbirdUIKitContainer';
|
|
52
|
+
export { default as SendbirdUIKitContainer, SendbirdUIKit, SendbirdUIKitContainerProps, } from './containers/SendbirdUIKitContainer';
|
|
50
53
|
export * from './types';
|
package/lib/typescript/src/{InternalLocalCacheStorage.d.ts → libs/InternalLocalCacheStorage.d.ts}
RENAMED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import type { KeyValuePairGet, KeyValuePairSet, LocalCacheStorage } from '
|
|
1
|
+
import type { KeyValuePairGet, KeyValuePairSet, LocalCacheStorage } from '../types';
|
|
2
2
|
export default class InternalLocalCacheStorage implements LocalCacheStorage {
|
|
3
3
|
private storage;
|
|
4
4
|
constructor(storage: LocalCacheStorage);
|
|
5
|
-
getAllKeys(): Promise<string[] |
|
|
5
|
+
getAllKeys(): Promise<readonly string[] | string[]>;
|
|
6
6
|
getItem(key: string): Promise<string | null>;
|
|
7
7
|
removeItem(key: string): Promise<void>;
|
|
8
8
|
setItem(key: string, value: string): Promise<void>;
|
|
@@ -107,6 +107,10 @@ export interface StringSet {
|
|
|
107
107
|
CHANNEL_NO_MEMBERS: string;
|
|
108
108
|
TYPING_INDICATOR_TYPINGS: (users: SendbirdUser[]) => string | undefined;
|
|
109
109
|
};
|
|
110
|
+
FILE_VIEWER: {
|
|
111
|
+
TITLE: (message: SendbirdFileMessage) => string;
|
|
112
|
+
SUBTITLE: (message: SendbirdFileMessage) => string;
|
|
113
|
+
};
|
|
110
114
|
PLACEHOLDER: {
|
|
111
115
|
NO_BANNED_MEMBERS: string;
|
|
112
116
|
NO_USERS: string;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type * as ExpoAV from 'expo-av';
|
|
2
|
+
import type * as ExpoVideoThumbnail from 'expo-video-thumbnails';
|
|
3
|
+
import type { MediaServiceInterface } from './types';
|
|
4
|
+
declare type Modules = {
|
|
5
|
+
avModule: typeof ExpoAV;
|
|
6
|
+
thumbnailModule: typeof ExpoVideoThumbnail;
|
|
7
|
+
};
|
|
8
|
+
declare const createExpoMediaService: ({ avModule, thumbnailModule }: Modules) => MediaServiceInterface;
|
|
9
|
+
export default createExpoMediaService;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type * as CreateThumbnail from 'react-native-create-thumbnail';
|
|
2
|
+
import type Video from 'react-native-video';
|
|
3
|
+
import type { MediaServiceInterface } from './types';
|
|
4
|
+
declare type Modules = {
|
|
5
|
+
VideoComponent: typeof Video;
|
|
6
|
+
thumbnailModule: typeof CreateThumbnail;
|
|
7
|
+
};
|
|
8
|
+
declare const createNativeMediaService: ({ VideoComponent, thumbnailModule }: Modules) => MediaServiceInterface;
|
|
9
|
+
export default createNativeMediaService;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type ExpoNotification from 'expo-notifications';
|
|
1
|
+
import type * as ExpoNotification from 'expo-notifications';
|
|
2
2
|
import type { NotificationServiceInterface } from './types';
|
|
3
3
|
declare const createExpoNotificationService: (messagingModule: typeof ExpoNotification) => NotificationServiceInterface;
|
|
4
4
|
export default createExpoNotificationService;
|
|
@@ -29,7 +29,7 @@ export interface OpenMediaLibraryOptions extends OpenResultListener {
|
|
|
29
29
|
}
|
|
30
30
|
export interface OpenCameraOptions extends OpenResultListener {
|
|
31
31
|
cameraType?: 'front' | 'back';
|
|
32
|
-
mediaType?: 'photo' | 'video';
|
|
32
|
+
mediaType?: 'photo' | 'video' | 'all';
|
|
33
33
|
}
|
|
34
34
|
export declare type OpenDocumentOptions = OpenResultListener;
|
|
35
35
|
export interface SaveOptions {
|
|
@@ -45,3 +45,22 @@ export interface FilePickerServiceInterface {
|
|
|
45
45
|
export interface FileSystemServiceInterface {
|
|
46
46
|
save(options?: SaveOptions): Promise<DownloadedPath | null>;
|
|
47
47
|
}
|
|
48
|
+
interface VideoProps {
|
|
49
|
+
source: {
|
|
50
|
+
uri: string;
|
|
51
|
+
} | number;
|
|
52
|
+
resizeMode?: 'cover' | 'contain' | 'stretch';
|
|
53
|
+
onLoad?: () => void;
|
|
54
|
+
}
|
|
55
|
+
interface GetVideoThumbnailOptions {
|
|
56
|
+
url: string;
|
|
57
|
+
timeMills?: number;
|
|
58
|
+
quality?: number;
|
|
59
|
+
}
|
|
60
|
+
export interface MediaServiceInterface {
|
|
61
|
+
VideoComponent<Props = {}>(props: VideoProps & Props): JSX.Element;
|
|
62
|
+
getVideoThumbnail(options: GetVideoThumbnailOptions): Promise<{
|
|
63
|
+
path: string;
|
|
64
|
+
} | null>;
|
|
65
|
+
}
|
|
66
|
+
export {};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare const VERSION = "1.
|
|
1
|
+
declare const VERSION = "1.1.1";
|
|
2
2
|
export default VERSION;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sendbird/uikit-react-native",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.1.1",
|
|
4
4
|
"description": "react-native-uikit",
|
|
5
5
|
"main": "lib/commonjs/index",
|
|
6
6
|
"module": "lib/module/index",
|
|
@@ -41,9 +41,9 @@
|
|
|
41
41
|
"access": "public"
|
|
42
42
|
},
|
|
43
43
|
"dependencies": {
|
|
44
|
-
"@sendbird/uikit-chat-hooks": "1.
|
|
45
|
-
"@sendbird/uikit-react-native-foundation": "1.
|
|
46
|
-
"@sendbird/uikit-utils": "1.
|
|
44
|
+
"@sendbird/uikit-chat-hooks": "1.1.1",
|
|
45
|
+
"@sendbird/uikit-react-native-foundation": "1.1.1",
|
|
46
|
+
"@sendbird/uikit-utils": "1.1.1"
|
|
47
47
|
},
|
|
48
48
|
"devDependencies": {
|
|
49
49
|
"@react-native-clipboard/clipboard": "^1.8.5",
|
|
@@ -53,24 +53,29 @@
|
|
|
53
53
|
"@react-native-firebase/messaging": "^14.4.0",
|
|
54
54
|
"@types/react": "*",
|
|
55
55
|
"@types/react-native": "*",
|
|
56
|
+
"@types/react-native-video": "^5.0.14",
|
|
56
57
|
"date-fns": "^2.28.0",
|
|
58
|
+
"expo-av": "^12.0.4",
|
|
57
59
|
"expo-clipboard": "^2.1.1",
|
|
58
60
|
"expo-document-picker": "^10.1.3",
|
|
59
61
|
"expo-file-system": "^13.1.4",
|
|
60
62
|
"expo-image-picker": "^12.0.2",
|
|
61
63
|
"expo-media-library": "^14.0.1",
|
|
62
64
|
"expo-notifications": "^0.14.1",
|
|
65
|
+
"expo-video-thumbnails": "^6.4.0",
|
|
63
66
|
"glob": "^7.2.0",
|
|
64
67
|
"inquirer": "^8.2.0",
|
|
65
68
|
"js-convert-case": "^4.2.0",
|
|
66
69
|
"react": "17.0.2",
|
|
67
70
|
"react-native": "0.66.4",
|
|
68
71
|
"react-native-builder-bob": "^0.18.0",
|
|
72
|
+
"react-native-create-thumbnail": "^1.5.1",
|
|
69
73
|
"react-native-document-picker": "^8.0.0",
|
|
70
74
|
"react-native-file-access": "^2.4.3",
|
|
71
75
|
"react-native-image-picker": "^4.7.1",
|
|
72
76
|
"react-native-permissions": "^3.6.0",
|
|
73
77
|
"react-native-safe-area-context": "^3.3.2",
|
|
78
|
+
"react-native-video": "^5.2.0",
|
|
74
79
|
"typescript": "^4.1.3"
|
|
75
80
|
},
|
|
76
81
|
"peerDependencies": {
|
|
@@ -79,18 +84,22 @@
|
|
|
79
84
|
"@react-native-community/netinfo": ">=9.3.0",
|
|
80
85
|
"@react-native-firebase/messaging": ">=14.4.0",
|
|
81
86
|
"date-fns": ">=2.28.0",
|
|
87
|
+
"expo-av": ">=12.0.4",
|
|
82
88
|
"expo-clipboard": ">=2.1.1",
|
|
83
89
|
"expo-document-picker": ">=10.1.3",
|
|
84
90
|
"expo-file-system": ">=13.1.4",
|
|
85
91
|
"expo-image-picker": ">=12.0.2",
|
|
86
92
|
"expo-notifications": ">=0.14.1",
|
|
93
|
+
"expo-video-thumbnails": ">=6.4.0",
|
|
87
94
|
"react": ">=16.13.1",
|
|
88
95
|
"react-native": ">=0.63.3",
|
|
96
|
+
"react-native-create-thumbnail": ">=1.5.1",
|
|
89
97
|
"react-native-document-picker": ">=8.0.0",
|
|
90
98
|
"react-native-file-access": ">=2.4.3",
|
|
91
99
|
"react-native-image-picker": ">=4.7.1",
|
|
92
100
|
"react-native-permissions": ">=3.6.0",
|
|
93
101
|
"react-native-safe-area-context": ">=3.3.2",
|
|
102
|
+
"react-native-video": ">=5.2.0",
|
|
94
103
|
"sendbird": "^3.1.22"
|
|
95
104
|
},
|
|
96
105
|
"peerDependenciesMeta": {
|
|
@@ -150,5 +159,5 @@
|
|
|
150
159
|
"readmeFile": "./README.md",
|
|
151
160
|
"displayName": "@sendbird/uikit-react-native"
|
|
152
161
|
},
|
|
153
|
-
"gitHead": "
|
|
162
|
+
"gitHead": "7b0384ecf1025f70e8a19f0490231273893f3f56"
|
|
154
163
|
}
|