@sendbird/uikit-react-native 3.8.0 → 3.8.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.
Files changed (46) hide show
  1. package/lib/commonjs/components/ChannelInput/index.js.map +1 -1
  2. package/lib/commonjs/components/ReactionAddons/MessageReactionAddon.js +6 -3
  3. package/lib/commonjs/components/ReactionAddons/MessageReactionAddon.js.map +1 -1
  4. package/lib/commonjs/components/ReactionAddons/ReactionRoundedButton.js +4 -3
  5. package/lib/commonjs/components/ReactionAddons/ReactionRoundedButton.js.map +1 -1
  6. package/lib/commonjs/components/ReactionBottomSheets/ReactionUserListBottomSheet.js +1 -3
  7. package/lib/commonjs/components/ReactionBottomSheets/ReactionUserListBottomSheet.js.map +1 -1
  8. package/lib/commonjs/domain/groupChannel/component/GroupChannelSuggestedMentionList.js +3 -2
  9. package/lib/commonjs/domain/groupChannel/component/GroupChannelSuggestedMentionList.js.map +1 -1
  10. package/lib/commonjs/domain/groupChannelThread/component/GroupChannelThreadSuggestedMentionList.js +3 -2
  11. package/lib/commonjs/domain/groupChannelThread/component/GroupChannelThreadSuggestedMentionList.js.map +1 -1
  12. package/lib/commonjs/libs/EmojiManager.js +6 -0
  13. package/lib/commonjs/libs/EmojiManager.js.map +1 -1
  14. package/lib/commonjs/version.js +1 -1
  15. package/lib/commonjs/version.js.map +1 -1
  16. package/lib/module/components/ChannelInput/index.js.map +1 -1
  17. package/lib/module/components/ReactionAddons/MessageReactionAddon.js +6 -3
  18. package/lib/module/components/ReactionAddons/MessageReactionAddon.js.map +1 -1
  19. package/lib/module/components/ReactionAddons/ReactionRoundedButton.js +4 -3
  20. package/lib/module/components/ReactionAddons/ReactionRoundedButton.js.map +1 -1
  21. package/lib/module/components/ReactionBottomSheets/ReactionUserListBottomSheet.js +1 -3
  22. package/lib/module/components/ReactionBottomSheets/ReactionUserListBottomSheet.js.map +1 -1
  23. package/lib/module/domain/groupChannel/component/GroupChannelSuggestedMentionList.js +3 -2
  24. package/lib/module/domain/groupChannel/component/GroupChannelSuggestedMentionList.js.map +1 -1
  25. package/lib/module/domain/groupChannelThread/component/GroupChannelThreadSuggestedMentionList.js +3 -2
  26. package/lib/module/domain/groupChannelThread/component/GroupChannelThreadSuggestedMentionList.js.map +1 -1
  27. package/lib/module/libs/EmojiManager.js +6 -0
  28. package/lib/module/libs/EmojiManager.js.map +1 -1
  29. package/lib/module/version.js +1 -1
  30. package/lib/module/version.js.map +1 -1
  31. package/lib/typescript/src/components/ChannelInput/index.d.ts +4 -0
  32. package/lib/typescript/src/components/ReactionAddons/ReactionRoundedButton.d.ts +7 -3
  33. package/lib/typescript/src/containers/SendbirdUIKitContainer.d.ts +1 -1
  34. package/lib/typescript/src/domain/groupChannel/component/GroupChannelSuggestedMentionList.d.ts +1 -1
  35. package/lib/typescript/src/domain/groupChannelThread/component/GroupChannelThreadSuggestedMentionList.d.ts +1 -1
  36. package/lib/typescript/src/libs/EmojiManager.d.ts +3 -1
  37. package/lib/typescript/src/version.d.ts +1 -1
  38. package/package.json +5 -5
  39. package/src/components/ChannelInput/index.tsx +4 -0
  40. package/src/components/ReactionAddons/MessageReactionAddon.tsx +7 -5
  41. package/src/components/ReactionAddons/ReactionRoundedButton.tsx +8 -4
  42. package/src/components/ReactionBottomSheets/ReactionUserListBottomSheet.tsx +9 -3
  43. package/src/domain/groupChannel/component/GroupChannelSuggestedMentionList.tsx +6 -3
  44. package/src/domain/groupChannelThread/component/GroupChannelThreadSuggestedMentionList.tsx +6 -3
  45. package/src/libs/EmojiManager.ts +11 -3
  46. package/src/version.ts +1 -1
@@ -1 +1 @@
1
- {"version":3,"names":["InternalLocalCacheStorage","MemoryStorage","constructor","_defineProperty","getAllKeys","Object","keys","_data","getItem","key","removeItem","setItem","value","EmojiManager","internalStorage","container","get","emojiStorage","strItem","freeze","JSON","parse","set","stringify","emojiContainer","category","emojiCategories","_emojiCategoryMap","id","emoji","emojis","_allEmojiMap","_allEmoji","values","emojiCategoryMap","allEmojiMap","allEmoji","emojiHash","_this$emojiStorage$co"],"sources":["EmojiManager.ts"],"sourcesContent":["import type { SendbirdEmoji, SendbirdEmojiCategory, SendbirdEmojiContainer } from '@sendbird/uikit-utils';\n\nimport type { AsyncLocalCacheStorage } from '../types';\nimport InternalLocalCacheStorage from './InternalLocalCacheStorage';\n\nclass MemoryStorage implements AsyncLocalCacheStorage {\n _data: Record<string, string> = {};\n\n async getAllKeys(): Promise<readonly string[] | string[]> {\n return Object.keys(this._data);\n }\n\n async getItem(key: string): Promise<string | null> {\n return this._data[key];\n }\n\n async removeItem(key: string): Promise<void> {\n delete this._data[key];\n }\n\n async setItem(key: string, value: string): Promise<void> {\n this._data[key] = value;\n }\n}\n\nclass EmojiManager {\n static key = 'sendbird-uikit@emoji-manager';\n\n constructor(\n private internalStorage: InternalLocalCacheStorage = new InternalLocalCacheStorage(new MemoryStorage()),\n ) {}\n\n private emojiStorage = {\n container: null as null | SendbirdEmojiContainer,\n get: async () => {\n if (!this.emojiStorage.container) {\n const strItem = await this.internalStorage.getItem(EmojiManager.key);\n if (strItem) this.emojiStorage.container = Object.freeze(JSON.parse(strItem));\n }\n return this.emojiStorage.container;\n },\n set: async (container: SendbirdEmojiContainer) => {\n this.emojiStorage.container = Object.freeze(container);\n await this.internalStorage.setItem(EmojiManager.key, JSON.stringify(container));\n },\n };\n\n private _emojiCategoryMap: Record<string, SendbirdEmojiCategory> = {};\n public get emojiCategoryMap() {\n return this._emojiCategoryMap;\n }\n\n private _allEmojiMap: Record<string, SendbirdEmoji> = {};\n public get allEmojiMap() {\n return this._allEmojiMap;\n }\n\n private _allEmoji: SendbirdEmoji[] = [];\n public get allEmoji() {\n return this._allEmoji;\n }\n\n public init = async (emojiContainer?: SendbirdEmojiContainer) => {\n if (emojiContainer) await this.emojiStorage.set(emojiContainer);\n\n const container = await this.emojiStorage.get();\n\n if (container) {\n for (const category of container.emojiCategories) {\n this._emojiCategoryMap[category.id] = category;\n for (const emoji of category.emojis) {\n this._allEmojiMap[emoji.key] = emoji;\n }\n }\n this._allEmoji = Object.values(this._allEmojiMap);\n }\n };\n\n public get emojiHash() {\n return this.emojiStorage.container?.emojiHash;\n }\n}\n\nexport default EmojiManager;\n"],"mappings":";;;AAGA,OAAOA,yBAAyB,MAAM,6BAA6B;AAEnE,MAAMC,aAAa,CAAmC;EAAAC,YAAA;IAAAC,eAAA,gBACpB,CAAC,CAAC;EAAA;EAElC,MAAMC,UAAUA,CAAA,EAA0C;IACxD,OAAOC,MAAM,CAACC,IAAI,CAAC,IAAI,CAACC,KAAK,CAAC;EAChC;EAEA,MAAMC,OAAOA,CAACC,GAAW,EAA0B;IACjD,OAAO,IAAI,CAACF,KAAK,CAACE,GAAG,CAAC;EACxB;EAEA,MAAMC,UAAUA,CAACD,GAAW,EAAiB;IAC3C,OAAO,IAAI,CAACF,KAAK,CAACE,GAAG,CAAC;EACxB;EAEA,MAAME,OAAOA,CAACF,GAAW,EAAEG,KAAa,EAAiB;IACvD,IAAI,CAACL,KAAK,CAACE,GAAG,CAAC,GAAGG,KAAK;EACzB;AACF;AAEA,MAAMC,YAAY,CAAC;EAGjBX,WAAWA,CACDY,eAA0C,GAAG,IAAId,yBAAyB,CAAC,IAAIC,aAAa,CAAC,CAAC,CAAC,EACvG;IAAA,KADQa,eAA0C,GAA1CA,eAA0C;IAAAX,eAAA,uBAG7B;MACrBY,SAAS,EAAE,IAAqC;MAChDC,GAAG,EAAE,MAAAA,CAAA,KAAY;QACf,IAAI,CAAC,IAAI,CAACC,YAAY,CAACF,SAAS,EAAE;UAChC,MAAMG,OAAO,GAAG,MAAM,IAAI,CAACJ,eAAe,CAACN,OAAO,CAACK,YAAY,CAACJ,GAAG,CAAC;UACpE,IAAIS,OAAO,EAAE,IAAI,CAACD,YAAY,CAACF,SAAS,GAAGV,MAAM,CAACc,MAAM,CAACC,IAAI,CAACC,KAAK,CAACH,OAAO,CAAC,CAAC;QAC/E;QACA,OAAO,IAAI,CAACD,YAAY,CAACF,SA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;IACrB,QAAAA,qBAAA,GAAO,IAAI,CAACrB,YAAY,CAACF,SAAS,cAAAuB,qBAAA,uBAA3BA,qBAAA,CAA6BD,SAAS;EAC/C;AACF;AAAClC,eAAA,CAxDKU,YAAY,SACH,8BAA8B;AAyD7C,eAAeA,YAAY","ignoreList":[]}
1
+ {"version":3,"names":["Icon","InternalLocalCacheStorage","MemoryStorage","constructor","_defineProperty","getAllKeys","Object","keys","_data","getItem","key","removeItem","setItem","value","EmojiManager","internalStorage","container","get","emojiStorage","strItem","freeze","JSON","parse","set","stringify","emojiContainer","category","emojiCategories","_emojiCategoryMap","id","emoji","emojis","_allEmojiMap","_allEmoji","values","emojiCategoryMap","allEmojiMap","allEmoji","getEmojiIconSource","url","uri","Assets","question","emojiHash","_this$emojiStorage$co"],"sources":["EmojiManager.ts"],"sourcesContent":["import { ImageProps } from 'react-native';\n\nimport { Icon } from '@sendbird/uikit-react-native-foundation';\nimport type { SendbirdEmoji, SendbirdEmojiCategory, SendbirdEmojiContainer } from '@sendbird/uikit-utils';\n\nimport type { AsyncLocalCacheStorage } from '../types';\nimport InternalLocalCacheStorage from './InternalLocalCacheStorage';\n\nclass MemoryStorage implements AsyncLocalCacheStorage {\n _data: Record<string, string> = {};\n\n async getAllKeys(): Promise<readonly string[] | string[]> {\n return Object.keys(this._data);\n }\n\n async getItem(key: string): Promise<string | null> {\n return this._data[key];\n }\n\n async removeItem(key: string): Promise<void> {\n delete this._data[key];\n }\n\n async setItem(key: string, value: string): Promise<void> {\n this._data[key] = value;\n }\n}\ntype EmojiCategoryId = string;\ntype EmojiKey = string;\nclass EmojiManager {\n static key = 'sendbird-uikit@emoji-manager';\n\n constructor(\n private internalStorage: InternalLocalCacheStorage = new InternalLocalCacheStorage(new MemoryStorage()),\n ) {}\n\n private emojiStorage = {\n container: null as null | SendbirdEmojiContainer,\n get: async () => {\n if (!this.emojiStorage.container) {\n const strItem = await this.internalStorage.getItem(EmojiManager.key);\n if (strItem) this.emojiStorage.container = Object.freeze(JSON.parse(strItem));\n }\n return this.emojiStorage.container;\n },\n set: async (container: SendbirdEmojiContainer) => {\n this.emojiStorage.container = Object.freeze(container);\n await this.internalStorage.setItem(EmojiManager.key, JSON.stringify(container));\n },\n };\n\n private _emojiCategoryMap: Record<EmojiCategoryId, SendbirdEmojiCategory> = {};\n public get emojiCategoryMap() {\n return this._emojiCategoryMap;\n }\n\n private _allEmojiMap: Record<EmojiKey, SendbirdEmoji> = {};\n public get allEmojiMap() {\n return this._allEmojiMap;\n }\n\n private _allEmoji: SendbirdEmoji[] = [];\n public get allEmoji() {\n return this._allEmoji;\n }\n\n public getEmojiIconSource(emoji?: SendbirdEmoji | null | undefined): ImageProps['source'] {\n return emoji?.url ? { uri: emoji.url } : Icon.Assets.question;\n }\n\n public init = async (emojiContainer?: SendbirdEmojiContainer) => {\n if (emojiContainer) await this.emojiStorage.set(emojiContainer);\n\n const container = await this.emojiStorage.get();\n\n if (container) {\n for (const category of container.emojiCategories) {\n this._emojiCategoryMap[category.id] = category;\n for (const emoji of category.emojis) {\n this._allEmojiMap[emoji.key] = emoji;\n }\n }\n this._allEmoji = Object.values(this._allEmojiMap);\n }\n };\n\n public get emojiHash() {\n return this.emojiStorage.container?.emojiHash;\n }\n}\n\nexport default EmojiManager;\n"],"mappings":";;;AAEA,SAASA,IAAI,QAAQ,yCAAyC;AAI9D,OAAOC,yBAAyB,MAAM,6BAA6B;AAEnE,MAAMC,aAAa,CAAmC;EAAAC,YAAA;IAAAC,eAAA,gBACpB,CAAC,CAAC;EAAA;EAElC,MAAMC,UAAUA,CAAA,EAA0C;IACxD,OAAOC,MAAM,CAACC,IAAI,CAAC,IAAI,CAACC,KAAK,CAAC;EAChC;EAEA,MAAMC,OAAOA,CAACC,GAAW,EAA0B;IACjD,OAAO,IAAI,CAACF,KAAK,CAACE,GAAG,CAAC;EACxB;EAEA,MAAMC,UAAUA,CAACD,GAAW,EAAiB;IAC3C,OAAO,IAAI,CAACF,KAAK,CAACE,GAAG,CA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AG,CAAC,CAAC;MAE/C,IAAID,SAAS,EAAE;QACb,KAAK,MAAMU,QAAQ,IAAIV,SAAS,CAACW,eAAe,EAAE;UAChD,IAAI,CAACC,iBAAiB,CAACF,QAAQ,CAACG,EAAE,CAAC,GAAGH,QAAQ;UAC9C,KAAK,MAAMI,KAAK,IAAIJ,QAAQ,CAACK,MAAM,EAAE;YACnC,IAAI,CAACC,YAAY,CAACF,KAAK,CAACpB,GAAG,CAAC,GAAGoB,KAAK;UACtC;QACF;QACA,IAAI,CAACG,SAAS,GAAG3B,MAAM,CAAC4B,MAAM,CAAC,IAAI,CAACF,YAAY,CAAC;MACnD;IACF,CAAC;EAlDE;EAkBH,IAAWG,gBAAgBA,CAAA,EAAG;IAC5B,OAAO,IAAI,CAACP,iBAAiB;EAC/B;EAGA,IAAWQ,WAAWA,CAAA,EAAG;IACvB,OAAO,IAAI,CAACJ,YAAY;EAC1B;EAGA,IAAWK,QAAQA,CAAA,EAAG;IACpB,OAAO,IAAI,CAACJ,SAAS;EACvB;EAEOK,kBAAkBA,CAACR,KAAwC,EAAwB;IACxF,OAAOA,KAAK,aAALA,KAAK,eAALA,KAAK,CAAES,GAAG,GAAG;MAAEC,GAAG,EAAEV,KAAK,CAACS;IAAI,CAAC,GAAGvC,IAAI,CAACyC,MAAM,CAACC,QAAQ;EAC/D;EAkBA,IAAWC,SAASA,CAAA,EAAG;IAAA,IAAAC,qBAAA;IACrB,QAAAA,qBAAA,GAAO,IAAI,CAAC1B,YAAY,CAACF,SAAS,cAAA4B,qBAAA,uBAA3BA,qBAAA,CAA6BD,SAAS;EAC/C;AACF;AAACvC,eAAA,CA5DKU,YAAY,SACH,8BAA8B;AA6D7C,eAAeA,YAAY","ignoreList":[]}
@@ -1,3 +1,3 @@
1
- const VERSION = '3.8.0';
1
+ const VERSION = '3.8.1';
2
2
  export default VERSION;
3
3
  //# sourceMappingURL=version.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["VERSION"],"sources":["version.ts"],"sourcesContent":["const VERSION = '3.8.0';\nexport default VERSION;\n"],"mappings":"AAAA,MAAMA,OAAO,GAAG,OAAO;AACvB,eAAeA,OAAO","ignoreList":[]}
1
+ {"version":3,"names":["VERSION"],"sources":["version.ts"],"sourcesContent":["const VERSION = '3.8.1';\nexport default VERSION;\n"],"mappings":"AAAA,MAAMA,OAAO,GAAG,OAAO;AACvB,eAAeA,OAAO","ignoreList":[]}
@@ -13,6 +13,10 @@ export type SuggestedMentionListProps = {
13
13
  inputHeight: number;
14
14
  onPressToMention: (user: SendbirdMember, searchStringRange: Range) => void;
15
15
  mentionedUsers: MentionedUser[];
16
+ /**
17
+ * Whether to show user id information on each item.
18
+ * */
19
+ showUserId?: boolean;
16
20
  };
17
21
  export type ChannelInputProps = {
18
22
  style?: StyleProp<TextStyle>;
@@ -1,13 +1,17 @@
1
1
  import React from 'react';
2
- import { StyleProp, ViewStyle } from 'react-native';
2
+ import { ImageProps, StyleProp, ViewStyle } from 'react-native';
3
3
  type Props = {
4
- url: string;
4
+ source: ImageProps['source'];
5
5
  count: number;
6
6
  reacted: boolean;
7
7
  style: StyleProp<ViewStyle>;
8
+ /**
9
+ * @deprecated Please use `source` instead
10
+ * */
11
+ url?: string;
8
12
  };
9
13
  declare const ReactionRoundedButton: {
10
- ({ url, count, reacted, style }: Props): React.JSX.Element;
14
+ ({ source, count, reacted, style, url }: Props): React.JSX.Element;
11
15
  More({ pressed }: {
12
16
  pressed: boolean;
13
17
  }): React.JSX.Element;
@@ -14,7 +14,7 @@ import type { StringSet } from '../localization/StringSet.type';
14
14
  import type { ClipboardServiceInterface, FileServiceInterface, MediaServiceInterface, NotificationServiceInterface, PlayerServiceInterface, RecorderServiceInterface } from '../platform/types';
15
15
  import { ErrorBoundaryProps, LocalCacheStorage } from '../types';
16
16
  export declare const SendbirdUIKit: Readonly<{
17
- VERSION: "3.8.0";
17
+ VERSION: "3.8.1";
18
18
  PLATFORM: string;
19
19
  DEFAULT: {
20
20
  AUTO_PUSH_TOKEN_REGISTRATION: boolean;
@@ -1,4 +1,4 @@
1
1
  import React from 'react';
2
2
  import type { GroupChannelProps } from '../types';
3
- declare const GroupChannelSuggestedMentionList: ({ text, selection, inputHeight, bottomInset, onPressToMention, mentionedUsers, }: GroupChannelProps['SuggestedMentionList']) => React.JSX.Element;
3
+ declare const GroupChannelSuggestedMentionList: ({ text, selection, inputHeight, bottomInset, onPressToMention, mentionedUsers, showUserId, }: GroupChannelProps['SuggestedMentionList']) => React.JSX.Element;
4
4
  export default GroupChannelSuggestedMentionList;
@@ -1,4 +1,4 @@
1
1
  import React from 'react';
2
2
  import type { GroupChannelThreadProps } from '../types';
3
- declare const GroupChannelThreadSuggestedMentionList: ({ text, selection, inputHeight, bottomInset, onPressToMention, mentionedUsers, }: GroupChannelThreadProps['SuggestedMentionList']) => React.JSX.Element;
3
+ declare const GroupChannelThreadSuggestedMentionList: ({ text, selection, inputHeight, bottomInset, onPressToMention, mentionedUsers, showUserId, }: GroupChannelThreadProps['SuggestedMentionList']) => React.JSX.Element;
4
4
  export default GroupChannelThreadSuggestedMentionList;
@@ -1,4 +1,5 @@
1
- import type { SendbirdEmojiContainer } from '@sendbird/uikit-utils';
1
+ import { ImageProps } from 'react-native';
2
+ import type { SendbirdEmoji, SendbirdEmojiContainer } from '@sendbird/uikit-utils';
2
3
  import InternalLocalCacheStorage from './InternalLocalCacheStorage';
3
4
  declare class EmojiManager {
4
5
  private internalStorage;
@@ -11,6 +12,7 @@ declare class EmojiManager {
11
12
  get allEmojiMap(): Record<string, import("@sendbird/chat").Emoji>;
12
13
  private _allEmoji;
13
14
  get allEmoji(): import("@sendbird/chat").Emoji[];
15
+ getEmojiIconSource(emoji?: SendbirdEmoji | null | undefined): ImageProps['source'];
14
16
  init: (emojiContainer?: SendbirdEmojiContainer) => Promise<void>;
15
17
  get emojiHash(): string | undefined;
16
18
  }
@@ -1,2 +1,2 @@
1
- declare const VERSION = "3.8.0";
1
+ declare const VERSION = "3.8.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": "3.8.0",
3
+ "version": "3.8.1",
4
4
  "description": "Sendbird UIKit for React Native: A feature-rich and customizable chat UI kit with messaging, channel management, and user authentication.",
5
5
  "keywords": [
6
6
  "sendbird",
@@ -60,10 +60,10 @@
60
60
  },
61
61
  "dependencies": {
62
62
  "@openspacelabs/react-native-zoomable-view": "^2.1.5",
63
- "@sendbird/uikit-chat-hooks": "3.8.0",
64
- "@sendbird/uikit-react-native-foundation": "3.8.0",
63
+ "@sendbird/uikit-chat-hooks": "3.8.1",
64
+ "@sendbird/uikit-react-native-foundation": "3.8.1",
65
65
  "@sendbird/uikit-tools": "0.0.1-alpha.77",
66
- "@sendbird/uikit-utils": "3.8.0"
66
+ "@sendbird/uikit-utils": "3.8.1"
67
67
  },
68
68
  "devDependencies": {
69
69
  "@bam.tech/react-native-image-resizer": "^3.0.4",
@@ -208,5 +208,5 @@
208
208
  ]
209
209
  ]
210
210
  },
211
- "gitHead": "bec311112e7b16076db18c6597c73f6ffb3489ad"
211
+ "gitHead": "33f4e385cdccfdf83ac1b4fe1ab19955590c1330"
212
212
  }
@@ -37,6 +37,10 @@ export type SuggestedMentionListProps = {
37
37
  inputHeight: number;
38
38
  onPressToMention: (user: SendbirdMember, searchStringRange: Range) => void;
39
39
  mentionedUsers: MentionedUser[];
40
+ /**
41
+ * Whether to show user id information on each item.
42
+ * */
43
+ showUserId?: boolean;
40
44
  };
41
45
 
42
46
  export type ChannelInputProps = {
@@ -1,7 +1,6 @@
1
1
  import React from 'react';
2
- import { Pressable } from 'react-native';
2
+ import { ImageProps, Pressable } from 'react-native';
3
3
 
4
- import type { Emoji } from '@sendbird/chat';
5
4
  import { createStyleSheet, useUIKitTheme } from '@sendbird/uikit-react-native-foundation';
6
5
  import { useForceUpdate, useGroupChannelHandler } from '@sendbird/uikit-tools';
7
6
  import type { SendbirdBaseChannel, SendbirdBaseMessage, SendbirdReaction } from '@sendbird/uikit-utils';
@@ -33,7 +32,7 @@ const createOnPressReaction = (
33
32
  const createReactionButtons = (
34
33
  channel: SendbirdBaseChannel,
35
34
  message: SendbirdBaseMessage,
36
- getEmoji: (key: string) => Emoji,
35
+ getIconSource: (reactionKey: string) => ImageProps['source'],
37
36
  emojiLimit: number,
38
37
  onOpenReactionList: () => void,
39
38
  onOpenReactionUserList: (focusIndex: number) => void,
@@ -52,7 +51,7 @@ const createReactionButtons = (
52
51
  >
53
52
  {({ pressed }) => (
54
53
  <ReactionRoundedButton
55
- url={getEmoji(reaction.key).url}
54
+ source={getIconSource(reaction.key)}
56
55
  count={getReactionCount(reaction)}
57
56
  reacted={pressed || reaction.hasCurrentUserReacted}
58
57
  style={
@@ -104,7 +103,10 @@ const MessageReactionAddon = ({
104
103
  const reactionButtons = createReactionButtons(
105
104
  channel,
106
105
  message,
107
- (key) => emojiManager.allEmojiMap[key],
106
+ (reactionKey) => {
107
+ const emoji = emojiManager.allEmojiMap[reactionKey];
108
+ return emojiManager.getEmojiIconSource(emoji);
109
+ },
108
110
  emojiManager.allEmoji.length,
109
111
  () => openReactionList({ channel, message }),
110
112
  (focusIndex) => openReactionUserList({ channel, message, focusIndex }),
@@ -1,17 +1,21 @@
1
1
  import React from 'react';
2
- import { StyleProp, View, ViewStyle } from 'react-native';
2
+ import { ImageProps, StyleProp, View, ViewStyle } from 'react-native';
3
3
 
4
4
  import { Icon, Image, Text, createStyleSheet, useUIKitTheme } from '@sendbird/uikit-react-native-foundation';
5
5
  import { truncatedCount } from '@sendbird/uikit-utils';
6
6
 
7
7
  type Props = {
8
- url: string;
8
+ source: ImageProps['source'];
9
9
  count: number;
10
10
  reacted: boolean;
11
11
  style: StyleProp<ViewStyle>;
12
+ /**
13
+ * @deprecated Please use `source` instead
14
+ * */
15
+ url?: string;
12
16
  };
13
17
 
14
- const ReactionRoundedButton = ({ url, count, reacted, style }: Props) => {
18
+ const ReactionRoundedButton = ({ source, count, reacted, style, url }: Props) => {
15
19
  const { colors } = useUIKitTheme();
16
20
  const color = colors.ui.reaction.rounded;
17
21
 
@@ -23,7 +27,7 @@ const ReactionRoundedButton = ({ url, count, reacted, style }: Props) => {
23
27
  style,
24
28
  ]}
25
29
  >
26
- <Image source={{ uri: url }} style={styles.emoji} />
30
+ <Image source={source ? source : { uri: url }} style={styles.emoji} />
27
31
  <Text caption4 color={colors.onBackground01} numberOfLines={1} style={styles.count}>
28
32
  {truncatedCount(count, 99, '')}
29
33
  </Text>
@@ -10,7 +10,13 @@ import {
10
10
  createStyleSheet,
11
11
  useUIKitTheme,
12
12
  } from '@sendbird/uikit-react-native-foundation';
13
- import { SendbirdReaction, getReactionCount, truncatedCount, useSafeAreaPadding } from '@sendbird/uikit-utils';
13
+ import {
14
+ SendbirdEmoji,
15
+ SendbirdReaction,
16
+ getReactionCount,
17
+ truncatedCount,
18
+ useSafeAreaPadding,
19
+ } from '@sendbird/uikit-utils';
14
20
 
15
21
  import type { ReactionBottomSheetProps } from './index';
16
22
 
@@ -81,7 +87,7 @@ const ReactionUserListBottomSheet = ({
81
87
  {reactions.map((reaction, index) => {
82
88
  const isFocused = focusedReaction?.key === reaction.key;
83
89
  const isLastItem = reactions.length - 1 === index;
84
- const emoji = emojiManager.allEmojiMap[reaction.key];
90
+ const emoji = emojiManager.allEmojiMap[reaction.key] as SendbirdEmoji | undefined;
85
91
 
86
92
  return (
87
93
  <Pressable
@@ -102,7 +108,7 @@ const ReactionUserListBottomSheet = ({
102
108
  }
103
109
  }}
104
110
  >
105
- <Image source={{ uri: emoji.url }} style={styles.tabEmoji} />
111
+ <Image source={emojiManager.getEmojiIconSource(emoji)} style={styles.tabEmoji} />
106
112
  <Text button color={isFocused ? color.selected.highlight : color.enabled.highlight}>
107
113
  {truncatedCount(getReactionCount(reaction))}
108
114
  </Text>
@@ -26,6 +26,7 @@ const GroupChannelSuggestedMentionList = ({
26
26
  bottomInset,
27
27
  onPressToMention,
28
28
  mentionedUsers,
29
+ showUserId = true,
29
30
  }: GroupChannelProps['SuggestedMentionList']) => {
30
31
  const { width: screenWidth, height: screenHeight } = useWindowDimensions();
31
32
  const { channel } = useContext(GroupChannelContexts.Fragment);
@@ -79,9 +80,11 @@ const GroupChannelSuggestedMentionList = ({
79
80
  <Text body2 color={colors.onBackground01} numberOfLines={1} style={styles.userNickname}>
80
81
  {member.nickname || STRINGS.LABELS.USER_NO_NAME}
81
82
  </Text>
82
- <Text body3 color={colors.onBackground03} numberOfLines={1} style={styles.userId}>
83
- {member.userId}
84
- </Text>
83
+ {!!showUserId && (
84
+ <Text body3 color={colors.onBackground03} numberOfLines={1} style={styles.userId}>
85
+ {member.userId}
86
+ </Text>
87
+ )}
85
88
  <Divider style={{ position: 'absolute', bottom: 0 }} />
86
89
  </Box>
87
90
  </Pressable>
@@ -25,6 +25,7 @@ const GroupChannelThreadSuggestedMentionList = ({
25
25
  bottomInset,
26
26
  onPressToMention,
27
27
  mentionedUsers,
28
+ showUserId = true,
28
29
  }: GroupChannelThreadProps['SuggestedMentionList']) => {
29
30
  const { width: screenWidth, height: screenHeight } = useWindowDimensions();
30
31
  const { channel } = useContext(GroupChannelThreadContexts.Fragment);
@@ -78,9 +79,11 @@ const GroupChannelThreadSuggestedMentionList = ({
78
79
  <Text body2 color={colors.onBackground01} numberOfLines={1} style={styles.userNickname}>
79
80
  {member.nickname || STRINGS.LABELS.USER_NO_NAME}
80
81
  </Text>
81
- <Text body3 color={colors.onBackground03} numberOfLines={1} style={styles.userId}>
82
- {member.userId}
83
- </Text>
82
+ {!!showUserId && (
83
+ <Text body3 color={colors.onBackground03} numberOfLines={1} style={styles.userId}>
84
+ {member.userId}
85
+ </Text>
86
+ )}
84
87
  <Divider style={{ position: 'absolute', bottom: 0 }} />
85
88
  </View>
86
89
  </Pressable>
@@ -1,3 +1,6 @@
1
+ import { ImageProps } from 'react-native';
2
+
3
+ import { Icon } from '@sendbird/uikit-react-native-foundation';
1
4
  import type { SendbirdEmoji, SendbirdEmojiCategory, SendbirdEmojiContainer } from '@sendbird/uikit-utils';
2
5
 
3
6
  import type { AsyncLocalCacheStorage } from '../types';
@@ -22,7 +25,8 @@ class MemoryStorage implements AsyncLocalCacheStorage {
22
25
  this._data[key] = value;
23
26
  }
24
27
  }
25
-
28
+ type EmojiCategoryId = string;
29
+ type EmojiKey = string;
26
30
  class EmojiManager {
27
31
  static key = 'sendbird-uikit@emoji-manager';
28
32
 
@@ -45,12 +49,12 @@ class EmojiManager {
45
49
  },
46
50
  };
47
51
 
48
- private _emojiCategoryMap: Record<string, SendbirdEmojiCategory> = {};
52
+ private _emojiCategoryMap: Record<EmojiCategoryId, SendbirdEmojiCategory> = {};
49
53
  public get emojiCategoryMap() {
50
54
  return this._emojiCategoryMap;
51
55
  }
52
56
 
53
- private _allEmojiMap: Record<string, SendbirdEmoji> = {};
57
+ private _allEmojiMap: Record<EmojiKey, SendbirdEmoji> = {};
54
58
  public get allEmojiMap() {
55
59
  return this._allEmojiMap;
56
60
  }
@@ -60,6 +64,10 @@ class EmojiManager {
60
64
  return this._allEmoji;
61
65
  }
62
66
 
67
+ public getEmojiIconSource(emoji?: SendbirdEmoji | null | undefined): ImageProps['source'] {
68
+ return emoji?.url ? { uri: emoji.url } : Icon.Assets.question;
69
+ }
70
+
63
71
  public init = async (emojiContainer?: SendbirdEmojiContainer) => {
64
72
  if (emojiContainer) await this.emojiStorage.set(emojiContainer);
65
73
 
package/src/version.ts CHANGED
@@ -1,2 +1,2 @@
1
- const VERSION = '3.8.0';
1
+ const VERSION = '3.8.1';
2
2
  export default VERSION;