@sendbird/uikit-react-native 2.2.0 → 2.3.0

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.
Files changed (135) hide show
  1. package/README.md +42 -17
  2. package/lib/commonjs/components/FileViewer.js +2 -5
  3. package/lib/commonjs/components/FileViewer.js.map +1 -1
  4. package/lib/commonjs/components/MessageRenderer/FileMessage/ImageFileMessage.js +1 -1
  5. package/lib/commonjs/components/MessageRenderer/FileMessage/ImageFileMessage.js.map +1 -1
  6. package/lib/commonjs/components/MessageRenderer/FileMessage/VideoFileMessage.js +1 -1
  7. package/lib/commonjs/components/MessageRenderer/FileMessage/VideoFileMessage.js.map +1 -1
  8. package/lib/commonjs/components/MessageRenderer/FileMessage/index.js +1 -6
  9. package/lib/commonjs/components/MessageRenderer/FileMessage/index.js.map +1 -1
  10. package/lib/commonjs/components/MessageRenderer/UserMessage/BaseUserMessage.js +2 -2
  11. package/lib/commonjs/components/MessageRenderer/UserMessage/BaseUserMessage.js.map +1 -1
  12. package/lib/commonjs/components/MessageRenderer/UserMessage/OpenGraphUserMessage.js +5 -3
  13. package/lib/commonjs/components/MessageRenderer/UserMessage/OpenGraphUserMessage.js.map +1 -1
  14. package/lib/commonjs/containers/SendbirdUIKitContainer.js +14 -3
  15. package/lib/commonjs/containers/SendbirdUIKitContainer.js.map +1 -1
  16. package/lib/commonjs/contexts/PlatformServiceCtx.js.map +1 -1
  17. package/lib/commonjs/contexts/SendbirdChatCtx.js +10 -14
  18. package/lib/commonjs/contexts/SendbirdChatCtx.js.map +1 -1
  19. package/lib/commonjs/domain/groupChannel/component/GroupChannelInput/SendInput.js +68 -13
  20. package/lib/commonjs/domain/groupChannel/component/GroupChannelInput/SendInput.js.map +1 -1
  21. package/lib/commonjs/domain/groupChannel/component/GroupChannelInput/index.js +1 -0
  22. package/lib/commonjs/domain/groupChannel/component/GroupChannelInput/index.js.map +1 -1
  23. package/lib/commonjs/domain/groupChannel/component/GroupChannelMessageList.js +3 -1
  24. package/lib/commonjs/domain/groupChannel/component/GroupChannelMessageList.js.map +1 -1
  25. package/lib/commonjs/domain/groupChannelSettings/module/moduleContext.js +2 -2
  26. package/lib/commonjs/domain/groupChannelSettings/module/moduleContext.js.map +1 -1
  27. package/lib/commonjs/fragments/createGroupChannelListFragment.js +4 -14
  28. package/lib/commonjs/fragments/createGroupChannelListFragment.js.map +1 -1
  29. package/lib/commonjs/hooks/useKeyboardStatus.js +13 -9
  30. package/lib/commonjs/hooks/useKeyboardStatus.js.map +1 -1
  31. package/lib/commonjs/index.js.map +1 -1
  32. package/lib/commonjs/libs/ImageCompressionConfig.js +38 -0
  33. package/lib/commonjs/libs/ImageCompressionConfig.js.map +1 -0
  34. package/lib/commonjs/libs/SBUUtils.js +27 -0
  35. package/lib/commonjs/libs/SBUUtils.js.map +1 -1
  36. package/lib/commonjs/localization/StringSet.type.js +3 -0
  37. package/lib/commonjs/localization/StringSet.type.js.map +1 -1
  38. package/lib/commonjs/platform/createMediaService.expo.js +35 -1
  39. package/lib/commonjs/platform/createMediaService.expo.js.map +1 -1
  40. package/lib/commonjs/platform/createMediaService.native.js +41 -6
  41. package/lib/commonjs/platform/createMediaService.native.js.map +1 -1
  42. package/lib/commonjs/platform/dynamicModule.js +9 -57
  43. package/lib/commonjs/platform/dynamicModule.js.map +1 -1
  44. package/lib/commonjs/platform/types.js.map +1 -1
  45. package/lib/commonjs/version.js +1 -1
  46. package/lib/commonjs/version.js.map +1 -1
  47. package/lib/module/components/FileViewer.js +2 -5
  48. package/lib/module/components/FileViewer.js.map +1 -1
  49. package/lib/module/components/MessageRenderer/FileMessage/ImageFileMessage.js +1 -1
  50. package/lib/module/components/MessageRenderer/FileMessage/ImageFileMessage.js.map +1 -1
  51. package/lib/module/components/MessageRenderer/FileMessage/VideoFileMessage.js +1 -1
  52. package/lib/module/components/MessageRenderer/FileMessage/VideoFileMessage.js.map +1 -1
  53. package/lib/module/components/MessageRenderer/FileMessage/index.js +1 -5
  54. package/lib/module/components/MessageRenderer/FileMessage/index.js.map +1 -1
  55. package/lib/module/components/MessageRenderer/UserMessage/BaseUserMessage.js +2 -2
  56. package/lib/module/components/MessageRenderer/UserMessage/BaseUserMessage.js.map +1 -1
  57. package/lib/module/components/MessageRenderer/UserMessage/OpenGraphUserMessage.js +4 -4
  58. package/lib/module/components/MessageRenderer/UserMessage/OpenGraphUserMessage.js.map +1 -1
  59. package/lib/module/containers/SendbirdUIKitContainer.js +13 -3
  60. package/lib/module/containers/SendbirdUIKitContainer.js.map +1 -1
  61. package/lib/module/contexts/PlatformServiceCtx.js.map +1 -1
  62. package/lib/module/contexts/SendbirdChatCtx.js +12 -14
  63. package/lib/module/contexts/SendbirdChatCtx.js.map +1 -1
  64. package/lib/module/domain/groupChannel/component/GroupChannelInput/SendInput.js +69 -14
  65. package/lib/module/domain/groupChannel/component/GroupChannelInput/SendInput.js.map +1 -1
  66. package/lib/module/domain/groupChannel/component/GroupChannelInput/index.js +1 -0
  67. package/lib/module/domain/groupChannel/component/GroupChannelInput/index.js.map +1 -1
  68. package/lib/module/domain/groupChannel/component/GroupChannelMessageList.js +3 -2
  69. package/lib/module/domain/groupChannel/component/GroupChannelMessageList.js.map +1 -1
  70. package/lib/module/domain/groupChannelSettings/module/moduleContext.js +2 -2
  71. package/lib/module/domain/groupChannelSettings/module/moduleContext.js.map +1 -1
  72. package/lib/module/fragments/createGroupChannelListFragment.js +5 -9
  73. package/lib/module/fragments/createGroupChannelListFragment.js.map +1 -1
  74. package/lib/module/hooks/useKeyboardStatus.js +12 -9
  75. package/lib/module/hooks/useKeyboardStatus.js.map +1 -1
  76. package/lib/module/index.js.map +1 -1
  77. package/lib/module/libs/ImageCompressionConfig.js +30 -0
  78. package/lib/module/libs/ImageCompressionConfig.js.map +1 -0
  79. package/lib/module/libs/SBUUtils.js +26 -1
  80. package/lib/module/libs/SBUUtils.js.map +1 -1
  81. package/lib/module/localization/StringSet.type.js +3 -0
  82. package/lib/module/localization/StringSet.type.js.map +1 -1
  83. package/lib/module/platform/createMediaService.expo.js +33 -1
  84. package/lib/module/platform/createMediaService.expo.js.map +1 -1
  85. package/lib/module/platform/createMediaService.native.js +38 -5
  86. package/lib/module/platform/createMediaService.native.js.map +1 -1
  87. package/lib/module/platform/dynamicModule.js +10 -56
  88. package/lib/module/platform/dynamicModule.js.map +1 -1
  89. package/lib/module/platform/types.js.map +1 -1
  90. package/lib/module/version.js +1 -1
  91. package/lib/module/version.js.map +1 -1
  92. package/lib/typescript/src/containers/SendbirdUIKitContainer.d.ts +10 -7
  93. package/lib/typescript/src/contexts/PlatformServiceCtx.d.ts +8 -2
  94. package/lib/typescript/src/contexts/SendbirdChatCtx.d.ts +8 -3
  95. package/lib/typescript/src/hooks/useContext.d.ts +2 -29
  96. package/lib/typescript/src/index.d.ts +1 -1
  97. package/lib/typescript/src/libs/ImageCompressionConfig.d.ts +16 -0
  98. package/lib/typescript/src/libs/SBUUtils.d.ts +6 -0
  99. package/lib/typescript/src/localization/StringSet.type.d.ts +3 -0
  100. package/lib/typescript/src/platform/createMediaService.expo.d.ts +5 -1
  101. package/lib/typescript/src/platform/createMediaService.native.d.ts +7 -5
  102. package/lib/typescript/src/platform/dynamicModule.d.ts +7 -12
  103. package/lib/typescript/src/platform/types.d.ts +28 -3
  104. package/lib/typescript/src/version.d.ts +1 -1
  105. package/package.json +15 -5
  106. package/src/components/FileViewer.tsx +2 -5
  107. package/src/components/MessageRenderer/FileMessage/ImageFileMessage.tsx +6 -1
  108. package/src/components/MessageRenderer/FileMessage/VideoFileMessage.tsx +1 -1
  109. package/src/components/MessageRenderer/FileMessage/index.tsx +1 -4
  110. package/src/components/MessageRenderer/UserMessage/BaseUserMessage.tsx +2 -2
  111. package/src/components/MessageRenderer/UserMessage/OpenGraphUserMessage.tsx +4 -4
  112. package/src/containers/SendbirdUIKitContainer.tsx +25 -6
  113. package/src/contexts/PlatformServiceCtx.tsx +9 -2
  114. package/src/contexts/SendbirdChatCtx.tsx +22 -19
  115. package/src/domain/groupChannel/component/GroupChannelInput/SendInput.tsx +82 -14
  116. package/src/domain/groupChannel/component/GroupChannelInput/index.tsx +1 -0
  117. package/src/domain/groupChannel/component/GroupChannelMessageList.tsx +3 -2
  118. package/src/domain/groupChannelSettings/module/moduleContext.tsx +8 -2
  119. package/src/fragments/createGroupChannelListFragment.tsx +5 -9
  120. package/src/hooks/useKeyboardStatus.ts +10 -5
  121. package/src/index.ts +1 -0
  122. package/src/libs/ImageCompressionConfig.ts +31 -0
  123. package/src/libs/SBUUtils.ts +28 -1
  124. package/src/localization/StringSet.type.ts +7 -0
  125. package/src/platform/createMediaService.expo.tsx +24 -1
  126. package/src/platform/createMediaService.native.tsx +31 -9
  127. package/src/platform/dynamicModule.ts +17 -59
  128. package/src/platform/types.ts +29 -7
  129. package/src/version.ts +1 -1
  130. package/lib/commonjs/utils/common.js +0 -19
  131. package/lib/commonjs/utils/common.js.map +0 -1
  132. package/lib/module/utils/common.js +0 -7
  133. package/lib/module/utils/common.js.map +0 -1
  134. package/lib/typescript/src/utils/common.d.ts +0 -1
  135. package/src/utils/common.ts +0 -8
@@ -1,15 +1,27 @@
1
1
  import type * as ExpoAV from 'expo-av';
2
+ import type * as ExpoFS from 'expo-file-system';
3
+ import type * as ExpoImageManipulator from 'expo-image-manipulator';
2
4
  import type * as ExpoVideoThumbnail from 'expo-video-thumbnails';
3
5
  import React from 'react';
4
6
 
7
+ import { getDownscaleSize } from '@sendbird/uikit-utils';
8
+
9
+ import SBUUtils from '../libs/SBUUtils';
5
10
  import type { MediaServiceInterface } from './types';
6
11
 
7
12
  type Modules = {
8
13
  avModule: typeof ExpoAV;
9
14
  thumbnailModule: typeof ExpoVideoThumbnail;
15
+ imageManipulator: typeof ExpoImageManipulator;
16
+ fsModule: typeof ExpoFS;
10
17
  };
11
18
 
12
- const createExpoMediaService = ({ avModule, thumbnailModule }: Modules): MediaServiceInterface => {
19
+ const createExpoMediaService = ({
20
+ avModule,
21
+ thumbnailModule,
22
+ imageManipulator,
23
+ fsModule,
24
+ }: Modules): MediaServiceInterface => {
13
25
  return {
14
26
  VideoComponent({ source, resizeMode, onLoad, ...props }) {
15
27
  // FIXME: type error https://github.com/expo/expo/issues/17101
@@ -24,6 +36,17 @@ const createExpoMediaService = ({ avModule, thumbnailModule }: Modules): MediaSe
24
36
  return null;
25
37
  }
26
38
  },
39
+ async compressImage({ maxWidth, maxHeight, compressionRate = 1, uri }) {
40
+ const originSize = await SBUUtils.getImageSize(uri);
41
+ const resizingSize = getDownscaleSize(originSize, { width: maxWidth, height: maxHeight });
42
+
43
+ const { uri: compressedURI } = await imageManipulator.manipulateAsync(uri, [{ resize: resizingSize }], {
44
+ compress: Math.min(Math.max(0, compressionRate), 1),
45
+ });
46
+ const { size = 0 } = await fsModule.getInfoAsync(uri);
47
+
48
+ return { uri: compressedURI, size };
49
+ },
27
50
  };
28
51
  };
29
52
 
@@ -1,19 +1,24 @@
1
+ import type * as RNImageResizer from '@bam.tech/react-native-image-resizer';
1
2
  import React from 'react';
2
- import type * as CreateThumbnail from 'react-native-create-thumbnail';
3
- import type Video from 'react-native-video';
3
+ import type * as RNCreateThumbnail from 'react-native-create-thumbnail';
4
+ import type RNVideo from 'react-native-video';
4
5
 
6
+ import { getDownscaleSize, getFileExtension, hash } from '@sendbird/uikit-utils';
7
+
8
+ import SBUUtils from '../libs/SBUUtils';
5
9
  import type { MediaServiceInterface } from './types';
6
10
 
7
11
  type Modules = {
8
- VideoComponent: typeof Video;
9
- thumbnailModule: typeof CreateThumbnail;
12
+ VideoComponent: typeof RNVideo;
13
+ thumbnailModule: typeof RNCreateThumbnail;
14
+ imageResizerModule: typeof RNImageResizer;
10
15
  };
11
16
 
12
- function hash(str: string) {
13
- return String(Math.abs(str.split('').reduce((a, c) => ((a << 5) - a + c.charCodeAt(0)) | 0, 0)));
14
- }
15
-
16
- const createNativeMediaService = ({ VideoComponent, thumbnailModule }: Modules): MediaServiceInterface => {
17
+ const createNativeMediaService = ({
18
+ VideoComponent,
19
+ thumbnailModule,
20
+ imageResizerModule,
21
+ }: Modules): MediaServiceInterface => {
17
22
  return {
18
23
  VideoComponent({ source, resizeMode, onLoad, ...props }) {
19
24
  return <VideoComponent {...props} source={source} resizeMode={resizeMode} onLoad={onLoad} controls />;
@@ -31,6 +36,23 @@ const createNativeMediaService = ({ VideoComponent, thumbnailModule }: Modules):
31
36
  return null;
32
37
  }
33
38
  },
39
+ async compressImage({ uri, maxWidth, maxHeight, compressionRate = 1 }) {
40
+ const originSize = await SBUUtils.getImageSize(uri);
41
+ const { width, height } = getDownscaleSize(originSize, { width: maxWidth, height: maxHeight });
42
+ const extension = (() => {
43
+ return { 'png': 'PNG', 'jpeg': 'JPEG', 'jpg': 'JPEG' }[getFileExtension(uri)] ?? 'JPEG';
44
+ })() as 'PNG' | 'JPEG';
45
+
46
+ const { size: resizedSize, uri: compressedURI } = await imageResizerModule.default.createResizedImage(
47
+ uri,
48
+ width,
49
+ height,
50
+ extension,
51
+ Math.min(Math.max(0, compressionRate), 1) * 100,
52
+ );
53
+
54
+ return { uri: compressedURI, size: resizedSize };
55
+ },
34
56
  };
35
57
  };
36
58
 
@@ -1,43 +1,28 @@
1
1
  /* eslint-disable no-console */
2
- import type RNNetInfo from '@react-native-community/netinfo';
3
- import { NativeModules } from 'react-native';
4
- import type RNFastImage from 'react-native-fast-image';
5
- import type RNFileAccess from 'react-native-file-access';
2
+ import type * as RNCNetInfo from '@react-native-community/netinfo';
3
+ import { NativeModules, UIManager } from 'react-native';
6
4
 
7
5
  import { Logger } from '@sendbird/uikit-utils';
8
6
 
9
- export interface DynamicModules {
10
- 'react-native-file-access': typeof RNFileAccess;
11
- 'react-native-fast-image': typeof RNFastImage;
12
- '@react-native-community/netinfo': typeof RNNetInfo;
13
- }
14
7
  export type SBUNativeModule = keyof DynamicModules;
15
8
 
16
9
  interface SBUDynamicModuleInfo {
17
10
  packageName: SBUNativeModule;
18
- minVersion: string;
19
- moduleName: string;
11
+ nativeModuleNamespace: string;
20
12
  getPackage: <T>(logLevel: 'error' | 'warn' | 'none') => T;
21
13
  url: string;
14
+ isComponent?: boolean;
22
15
  }
23
16
 
24
- export function checkVersion(minVersion: string, currentVersion: string) {
25
- const [minMajor, minMinor, minPatch] = minVersion.split('.');
26
- const [currMajor, currMinor, currPatch] = currentVersion.split('.');
27
-
28
- if (minMajor < currMajor) return true;
29
- if (minMajor === currMajor) {
30
- if (minMinor < currMinor) return true;
31
- if (minMinor === currMinor) {
32
- return minPatch <= currPatch;
17
+ function checkLink(dmi: SBUDynamicModuleInfo, logLevel: 'error' | 'warn' | 'none') {
18
+ const nativeModule = (() => {
19
+ if (dmi.isComponent) {
20
+ return UIManager.getViewManagerConfig(dmi.nativeModuleNamespace);
21
+ } else {
22
+ return NativeModules[dmi.nativeModuleNamespace];
33
23
  }
34
- return false;
35
- }
36
- return false;
37
- }
24
+ })();
38
25
 
39
- function checkLink(dmi: SBUDynamicModuleInfo, logLevel: 'error' | 'warn' | 'none') {
40
- const nativeModule = NativeModules[dmi.moduleName];
41
26
  if (!nativeModule) {
42
27
  const message = `[UIKit] Cannot use native module, you should install and link ${dmi.packageName} (${dmi.url})`;
43
28
  if (logLevel === 'error') console.error(message);
@@ -45,41 +30,14 @@ function checkLink(dmi: SBUDynamicModuleInfo, logLevel: 'error' | 'warn' | 'none
45
30
  }
46
31
  }
47
32
 
48
- const SBUDynamicModuleRegistry: Record<SBUNativeModule, SBUDynamicModuleInfo> = {
49
- 'react-native-file-access': {
50
- minVersion: '2.4.3',
51
- packageName: 'react-native-file-access',
52
- moduleName: 'RNFileAccess',
53
- url: 'https://github.com/alpha0010/react-native-file-access',
54
- getPackage(logLevel) {
55
- checkLink(this, logLevel);
56
-
57
- try {
58
- return require('react-native-file-access');
59
- } catch (e) {
60
- return null;
61
- }
62
- },
63
- },
64
- 'react-native-fast-image': {
65
- minVersion: '8.5.11',
66
- packageName: 'react-native-fast-image',
67
- moduleName: 'FastImageView',
68
- url: 'https://github.com/DylanVann/react-native-fast-image',
69
- getPackage(logLevel) {
70
- checkLink(this, logLevel);
33
+ export interface DynamicModules {
34
+ '@react-native-community/netinfo': typeof RNCNetInfo;
35
+ }
71
36
 
72
- try {
73
- return require('react-native-fast-image');
74
- } catch (e) {
75
- return null;
76
- }
77
- },
78
- },
37
+ const SBUDynamicModuleRegistry: Record<SBUNativeModule, SBUDynamicModuleInfo> = {
79
38
  '@react-native-community/netinfo': {
80
- minVersion: '9.3.0',
81
39
  packageName: '@react-native-community/netinfo',
82
- moduleName: 'RNCNetInfo',
40
+ nativeModuleNamespace: 'RNCNetInfo',
83
41
  url: 'https://github.com/react-native-netinfo/react-native-netinfo',
84
42
  getPackage(logLevel) {
85
43
  checkLink(this, logLevel);
@@ -95,7 +53,7 @@ const SBUDynamicModuleRegistry: Record<SBUNativeModule, SBUDynamicModuleInfo> =
95
53
 
96
54
  const SBUDynamicModule = {
97
55
  register(mdi: SBUDynamicModuleInfo) {
98
- SBUDynamicModuleRegistry[mdi.moduleName as SBUNativeModule] = mdi;
56
+ SBUDynamicModuleRegistry[mdi.nativeModuleNamespace as SBUNativeModule] = mdi;
99
57
  },
100
58
  getInfo(name: SBUNativeModule) {
101
59
  return SBUDynamicModuleRegistry[name] ?? null;
@@ -66,13 +66,35 @@ interface GetVideoThumbnailOptions {
66
66
  timeMills?: number;
67
67
  quality?: number;
68
68
  }
69
+
70
+ interface CompressImageOptions {
71
+ /**
72
+ * A uri of image file to compress
73
+ * */
74
+ uri: string;
75
+
76
+ /**
77
+ * A resize width, apply only to downscale
78
+ * */
79
+ maxWidth?: number;
80
+
81
+ /**
82
+ * A resize height, apply only to downscale
83
+ * */
84
+ maxHeight?: number;
85
+
86
+ /**
87
+ * A value in range 0.0 - 1.0 specifying compression level of the result image.
88
+ * 1 means highest quality and 0 the lowest quality.
89
+ * */
90
+ compressionRate?: number;
91
+ }
92
+
93
+ type GetVideoThumbnailResult = Promise<{ path: string } | null>;
94
+ type CompressImageResult = Promise<{ uri: string; size: number } | null>;
95
+
69
96
  export interface MediaServiceInterface {
70
97
  VideoComponent<Props = {}>(props: VideoProps & Props): JSX.Element;
71
- getVideoThumbnail(options: GetVideoThumbnailOptions): Promise<{ path: string } | null>;
72
- // compressImage(options: {
73
- // path: string;
74
- // compressionRate: number;
75
- // resizingWidth: number;
76
- // resizingHeight: number;
77
- // }): Promise<{ path: string }>;
98
+ getVideoThumbnail(options: GetVideoThumbnailOptions): GetVideoThumbnailResult;
99
+ compressImage(options: CompressImageOptions): CompressImageResult;
78
100
  }
package/src/version.ts CHANGED
@@ -1,2 +1,2 @@
1
- const VERSION = '2.2.0';
1
+ const VERSION = '2.3.0';
2
2
  export default VERSION;
@@ -1,19 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.openUrl = void 0;
7
-
8
- var _reactNative = require("react-native");
9
-
10
- var _uikitUtils = require("@sendbird/uikit-utils");
11
-
12
- const openUrl = url => {
13
- const targetUrl = url.startsWith('http') ? url : 'https://' + url;
14
-
15
- _reactNative.Linking.openURL(targetUrl).catch(err => _uikitUtils.Logger.warn('Cannot open url', err));
16
- };
17
-
18
- exports.openUrl = openUrl;
19
- //# sourceMappingURL=common.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["openUrl","url","targetUrl","startsWith","Linking","openURL","catch","err","Logger","warn"],"sources":["common.ts"],"sourcesContent":["import { Linking } from 'react-native';\n\nimport { Logger } from '@sendbird/uikit-utils';\n\nexport const openUrl = (url: string) => {\n const targetUrl = url.startsWith('http') ? url : 'https://' + url;\n Linking.openURL(targetUrl).catch((err) => Logger.warn('Cannot open url', err));\n};\n"],"mappings":";;;;;;;AAAA;;AAEA;;AAEO,MAAMA,OAAO,GAAIC,GAAD,IAAiB;EACtC,MAAMC,SAAS,GAAGD,GAAG,CAACE,UAAJ,CAAe,MAAf,IAAyBF,GAAzB,GAA+B,aAAaA,GAA9D;;EACAG,oBAAA,CAAQC,OAAR,CAAgBH,SAAhB,EAA2BI,KAA3B,CAAkCC,GAAD,IAASC,kBAAA,CAAOC,IAAP,CAAY,iBAAZ,EAA+BF,GAA/B,CAA1C;AACD,CAHM"}
@@ -1,7 +0,0 @@
1
- import { Linking } from 'react-native';
2
- import { Logger } from '@sendbird/uikit-utils';
3
- export const openUrl = url => {
4
- const targetUrl = url.startsWith('http') ? url : 'https://' + url;
5
- Linking.openURL(targetUrl).catch(err => Logger.warn('Cannot open url', err));
6
- };
7
- //# sourceMappingURL=common.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["Linking","Logger","openUrl","url","targetUrl","startsWith","openURL","catch","err","warn"],"sources":["common.ts"],"sourcesContent":["import { Linking } from 'react-native';\n\nimport { Logger } from '@sendbird/uikit-utils';\n\nexport const openUrl = (url: string) => {\n const targetUrl = url.startsWith('http') ? url : 'https://' + url;\n Linking.openURL(targetUrl).catch((err) => Logger.warn('Cannot open url', err));\n};\n"],"mappings":"AAAA,SAASA,OAAT,QAAwB,cAAxB;AAEA,SAASC,MAAT,QAAuB,uBAAvB;AAEA,OAAO,MAAMC,OAAO,GAAIC,GAAD,IAAiB;EACtC,MAAMC,SAAS,GAAGD,GAAG,CAACE,UAAJ,CAAe,MAAf,IAAyBF,GAAzB,GAA+B,aAAaA,GAA9D;EACAH,OAAO,CAACM,OAAR,CAAgBF,SAAhB,EAA2BG,KAA3B,CAAkCC,GAAD,IAASP,MAAM,CAACQ,IAAP,CAAY,iBAAZ,EAA+BD,GAA/B,CAA1C;AACD,CAHM"}
@@ -1 +0,0 @@
1
- export declare const openUrl: (url: string) => void;
@@ -1,8 +0,0 @@
1
- import { Linking } from 'react-native';
2
-
3
- import { Logger } from '@sendbird/uikit-utils';
4
-
5
- export const openUrl = (url: string) => {
6
- const targetUrl = url.startsWith('http') ? url : 'https://' + url;
7
- Linking.openURL(targetUrl).catch((err) => Logger.warn('Cannot open url', err));
8
- };