@sendbird/uikit-react-native-foundation 2.3.0 → 2.4.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 (105) hide show
  1. package/lib/commonjs/components/Box/index.js +46 -0
  2. package/lib/commonjs/components/Box/index.js.map +1 -0
  3. package/lib/commonjs/components/ImageWithPlaceholder/index.js +92 -0
  4. package/lib/commonjs/components/ImageWithPlaceholder/index.js.map +1 -0
  5. package/lib/commonjs/components/PressBox/index.js +60 -0
  6. package/lib/commonjs/components/PressBox/index.js.map +1 -0
  7. package/lib/commonjs/index.js +39 -5
  8. package/lib/commonjs/index.js.map +1 -1
  9. package/lib/commonjs/theme/DarkUIKitTheme.js +220 -179
  10. package/lib/commonjs/theme/DarkUIKitTheme.js.map +1 -1
  11. package/lib/commonjs/theme/LightUIKitTheme.js +220 -179
  12. package/lib/commonjs/theme/LightUIKitTheme.js.map +1 -1
  13. package/lib/commonjs/types.js.map +1 -1
  14. package/lib/commonjs/ui/Header/index.js +4 -2
  15. package/lib/commonjs/ui/Header/index.js.map +1 -1
  16. package/lib/commonjs/ui/OpenChannelMessage/Message.admin.js +40 -0
  17. package/lib/commonjs/ui/OpenChannelMessage/Message.admin.js.map +1 -0
  18. package/lib/commonjs/ui/OpenChannelMessage/Message.file.image.js +57 -0
  19. package/lib/commonjs/ui/OpenChannelMessage/Message.file.image.js.map +1 -0
  20. package/lib/commonjs/ui/OpenChannelMessage/Message.file.js +90 -0
  21. package/lib/commonjs/ui/OpenChannelMessage/Message.file.js.map +1 -0
  22. package/lib/commonjs/ui/OpenChannelMessage/Message.file.video.js +134 -0
  23. package/lib/commonjs/ui/OpenChannelMessage/Message.file.video.js.map +1 -0
  24. package/lib/commonjs/ui/OpenChannelMessage/Message.unknown.js +55 -0
  25. package/lib/commonjs/ui/OpenChannelMessage/Message.unknown.js.map +1 -0
  26. package/lib/commonjs/ui/OpenChannelMessage/Message.user.js +83 -0
  27. package/lib/commonjs/ui/OpenChannelMessage/Message.user.js.map +1 -0
  28. package/lib/commonjs/ui/OpenChannelMessage/Message.user.og.js +140 -0
  29. package/lib/commonjs/ui/OpenChannelMessage/Message.user.og.js.map +1 -0
  30. package/lib/commonjs/ui/OpenChannelMessage/MessageContainer.js +136 -0
  31. package/lib/commonjs/ui/OpenChannelMessage/MessageContainer.js.map +1 -0
  32. package/lib/commonjs/ui/OpenChannelMessage/index.js +35 -0
  33. package/lib/commonjs/ui/OpenChannelMessage/index.js.map +1 -0
  34. package/lib/commonjs/ui/OpenChannelPreview/index.js +134 -0
  35. package/lib/commonjs/ui/OpenChannelPreview/index.js.map +1 -0
  36. package/lib/module/components/Box/index.js +33 -0
  37. package/lib/module/components/Box/index.js.map +1 -0
  38. package/lib/module/components/ImageWithPlaceholder/index.js +71 -0
  39. package/lib/module/components/ImageWithPlaceholder/index.js.map +1 -0
  40. package/lib/module/components/PressBox/index.js +45 -0
  41. package/lib/module/components/PressBox/index.js.map +1 -0
  42. package/lib/module/index.js +6 -1
  43. package/lib/module/index.js.map +1 -1
  44. package/lib/module/theme/DarkUIKitTheme.js +220 -179
  45. package/lib/module/theme/DarkUIKitTheme.js.map +1 -1
  46. package/lib/module/theme/LightUIKitTheme.js +220 -179
  47. package/lib/module/theme/LightUIKitTheme.js.map +1 -1
  48. package/lib/module/types.js.map +1 -1
  49. package/lib/module/ui/Header/index.js +4 -2
  50. package/lib/module/ui/Header/index.js.map +1 -1
  51. package/lib/module/ui/OpenChannelMessage/Message.admin.js +27 -0
  52. package/lib/module/ui/OpenChannelMessage/Message.admin.js.map +1 -0
  53. package/lib/module/ui/OpenChannelMessage/Message.file.image.js +41 -0
  54. package/lib/module/ui/OpenChannelMessage/Message.file.image.js.map +1 -0
  55. package/lib/module/ui/OpenChannelMessage/Message.file.js +71 -0
  56. package/lib/module/ui/OpenChannelMessage/Message.file.js.map +1 -0
  57. package/lib/module/ui/OpenChannelMessage/Message.file.video.js +112 -0
  58. package/lib/module/ui/OpenChannelMessage/Message.file.video.js.map +1 -0
  59. package/lib/module/ui/OpenChannelMessage/Message.unknown.js +41 -0
  60. package/lib/module/ui/OpenChannelMessage/Message.unknown.js.map +1 -0
  61. package/lib/module/ui/OpenChannelMessage/Message.user.js +67 -0
  62. package/lib/module/ui/OpenChannelMessage/Message.user.js.map +1 -0
  63. package/lib/module/ui/OpenChannelMessage/Message.user.og.js +121 -0
  64. package/lib/module/ui/OpenChannelMessage/Message.user.og.js.map +1 -0
  65. package/lib/module/ui/OpenChannelMessage/MessageContainer.js +116 -0
  66. package/lib/module/ui/OpenChannelMessage/MessageContainer.js.map +1 -0
  67. package/lib/module/ui/OpenChannelMessage/index.js +18 -0
  68. package/lib/module/ui/OpenChannelMessage/index.js.map +1 -0
  69. package/lib/module/ui/OpenChannelPreview/index.js +117 -0
  70. package/lib/module/ui/OpenChannelPreview/index.js.map +1 -0
  71. package/lib/typescript/src/components/Box/index.d.ts +11 -0
  72. package/lib/typescript/src/components/ImageWithPlaceholder/index.d.ts +11 -0
  73. package/lib/typescript/src/components/PressBox/index.d.ts +16 -0
  74. package/lib/typescript/src/index.d.ts +8 -1
  75. package/lib/typescript/src/types.d.ts +21 -5
  76. package/lib/typescript/src/ui/Header/index.d.ts +1 -0
  77. package/lib/typescript/src/ui/OpenChannelMessage/Message.admin.d.ts +4 -0
  78. package/lib/typescript/src/ui/OpenChannelMessage/Message.file.d.ts +5 -0
  79. package/lib/typescript/src/ui/OpenChannelMessage/Message.file.image.d.ts +4 -0
  80. package/lib/typescript/src/ui/OpenChannelMessage/Message.file.video.d.ts +9 -0
  81. package/lib/typescript/src/ui/OpenChannelMessage/Message.unknown.d.ts +4 -0
  82. package/lib/typescript/src/ui/OpenChannelMessage/Message.user.d.ts +5 -0
  83. package/lib/typescript/src/ui/OpenChannelMessage/Message.user.og.d.ts +5 -0
  84. package/lib/typescript/src/ui/OpenChannelMessage/MessageContainer.d.ts +7 -0
  85. package/lib/typescript/src/ui/OpenChannelMessage/index.d.ts +136 -0
  86. package/lib/typescript/src/ui/OpenChannelPreview/index.d.ts +10 -0
  87. package/package.json +4 -4
  88. package/src/components/Box/index.tsx +65 -0
  89. package/src/components/ImageWithPlaceholder/index.tsx +83 -0
  90. package/src/components/PressBox/index.tsx +53 -0
  91. package/src/index.ts +8 -1
  92. package/src/theme/DarkUIKitTheme.ts +213 -171
  93. package/src/theme/LightUIKitTheme.ts +213 -171
  94. package/src/types.ts +41 -6
  95. package/src/ui/Header/index.tsx +7 -2
  96. package/src/ui/OpenChannelMessage/Message.admin.tsx +24 -0
  97. package/src/ui/OpenChannelMessage/Message.file.image.tsx +34 -0
  98. package/src/ui/OpenChannelMessage/Message.file.tsx +67 -0
  99. package/src/ui/OpenChannelMessage/Message.file.video.tsx +93 -0
  100. package/src/ui/OpenChannelMessage/Message.unknown.tsx +31 -0
  101. package/src/ui/OpenChannelMessage/Message.user.og.tsx +120 -0
  102. package/src/ui/OpenChannelMessage/Message.user.tsx +61 -0
  103. package/src/ui/OpenChannelMessage/MessageContainer.tsx +121 -0
  104. package/src/ui/OpenChannelMessage/index.ts +42 -0
  105. package/src/ui/OpenChannelPreview/index.tsx +97 -0
@@ -0,0 +1,116 @@
1
+ import React from 'react';
2
+ import { SendingStatus } from '@sendbird/chat/message';
3
+ import { getMessageTimeFormat } from '@sendbird/uikit-utils';
4
+ import Box from '../../components/Box';
5
+ import Icon from '../../components/Icon';
6
+ import PressBox from '../../components/PressBox';
7
+ import Text from '../../components/Text';
8
+ import createStyleSheet from '../../styles/createStyleSheet';
9
+ import useUIKitTheme from '../../theme/useUIKitTheme';
10
+ import Avatar from '../Avatar';
11
+ import LoadingSpinner from '../LoadingSpinner';
12
+
13
+ const MessageContainer = _ref => {
14
+ var _props$strings, _props$strings2;
15
+
16
+ let {
17
+ children,
18
+ channel,
19
+ grouped,
20
+ pressed,
21
+ ...props
22
+ } = _ref;
23
+ const {
24
+ colors
25
+ } = useUIKitTheme();
26
+ const color = colors.ui.openChannelMessage.default;
27
+
28
+ const renderSendingStatus = () => {
29
+ if (!('sendingStatus' in props.message)) return null;
30
+
31
+ switch (props.message.sendingStatus) {
32
+ case SendingStatus.PENDING:
33
+ {
34
+ return /*#__PURE__*/React.createElement(SendingStatusContainer, null, /*#__PURE__*/React.createElement(LoadingSpinner, {
35
+ color: colors.primary,
36
+ size: 16
37
+ }));
38
+ }
39
+
40
+ case SendingStatus.FAILED:
41
+ {
42
+ return /*#__PURE__*/React.createElement(SendingStatusContainer, null, /*#__PURE__*/React.createElement(Icon, {
43
+ icon: 'error',
44
+ color: colors.error,
45
+ size: 16
46
+ }));
47
+ }
48
+
49
+ default:
50
+ {
51
+ return null;
52
+ }
53
+ }
54
+ };
55
+
56
+ return /*#__PURE__*/React.createElement(Box, {
57
+ flexDirection: 'row',
58
+ paddingVertical: grouped ? 5 : 6,
59
+ paddingLeft: 12,
60
+ paddingRight: 12,
61
+ backgroundColor: pressed ? color.pressed.background : color.enabled.background
62
+ }, /*#__PURE__*/React.createElement(Box, {
63
+ marginRight: 12
64
+ }, !grouped && 'sender' in props.message ? /*#__PURE__*/React.createElement(PressBox, {
65
+ onPress: props.onPressAvatar
66
+ }, /*#__PURE__*/React.createElement(Avatar, {
67
+ size: styles.avatar.width,
68
+ uri: props.message.sender.profileUrl
69
+ })) : /*#__PURE__*/React.createElement(Box, {
70
+ style: styles.avatar
71
+ })), /*#__PURE__*/React.createElement(Box, {
72
+ flexShrink: 1,
73
+ flex: 1,
74
+ flexDirection: 'column',
75
+ alignItems: 'flex-start'
76
+ }, !grouped && 'sender' in props.message && /*#__PURE__*/React.createElement(Box, {
77
+ flexDirection: 'row',
78
+ alignItems: 'center',
79
+ marginBottom: 2
80
+ }, /*#__PURE__*/React.createElement(Box, {
81
+ marginRight: 4,
82
+ flexShrink: 1
83
+ }, /*#__PURE__*/React.createElement(Text, {
84
+ caption1: true,
85
+ ellipsizeMode: 'middle',
86
+ numberOfLines: 1,
87
+ color: channel.isOperator(props.message.sender.userId) ? color.enabled.textOperator : color.enabled.textSenderName
88
+ }, ((_props$strings = props.strings) === null || _props$strings === void 0 ? void 0 : _props$strings.senderName) ?? props.message.sender.nickname)), /*#__PURE__*/React.createElement(Box, null, /*#__PURE__*/React.createElement(Text, {
89
+ caption4: true,
90
+ color: color.enabled.textTime
91
+ }, ((_props$strings2 = props.strings) === null || _props$strings2 === void 0 ? void 0 : _props$strings2.sentDate) ?? getMessageTimeFormat(new Date(props.message.createdAt))))), /*#__PURE__*/React.createElement(Box, {
92
+ style: styles.message
93
+ }, children), renderSendingStatus()));
94
+ };
95
+
96
+ const SendingStatusContainer = _ref2 => {
97
+ let {
98
+ children
99
+ } = _ref2;
100
+ return /*#__PURE__*/React.createElement(Box, {
101
+ flexDirection: 'row'
102
+ }, /*#__PURE__*/React.createElement(Box, {
103
+ marginTop: 2
104
+ }, children));
105
+ };
106
+
107
+ const styles = createStyleSheet({
108
+ avatar: {
109
+ width: 28
110
+ },
111
+ message: {
112
+ width: '100%'
113
+ }
114
+ });
115
+ export default MessageContainer;
116
+ //# sourceMappingURL=MessageContainer.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["React","SendingStatus","getMessageTimeFormat","Box","Icon","PressBox","Text","createStyleSheet","useUIKitTheme","Avatar","LoadingSpinner","MessageContainer","children","channel","grouped","pressed","props","colors","color","ui","openChannelMessage","default","renderSendingStatus","message","sendingStatus","PENDING","primary","FAILED","error","background","enabled","onPressAvatar","styles","avatar","width","sender","profileUrl","isOperator","userId","textOperator","textSenderName","strings","senderName","nickname","textTime","sentDate","Date","createdAt","SendingStatusContainer"],"sources":["MessageContainer.tsx"],"sourcesContent":["import React from 'react';\n\nimport { SendingStatus } from '@sendbird/chat/message';\nimport type { SendbirdMessage } from '@sendbird/uikit-utils';\nimport { getMessageTimeFormat } from '@sendbird/uikit-utils';\n\nimport Box from '../../components/Box';\nimport Icon from '../../components/Icon';\nimport PressBox from '../../components/PressBox';\nimport Text from '../../components/Text';\nimport createStyleSheet from '../../styles/createStyleSheet';\nimport useUIKitTheme from '../../theme/useUIKitTheme';\nimport Avatar from '../Avatar';\nimport LoadingSpinner from '../LoadingSpinner';\nimport type { OpenChannelMessageProps } from './index';\n\ntype Props = {\n pressed?: boolean;\n};\n\nconst MessageContainer = ({\n children,\n channel,\n grouped,\n pressed,\n ...props\n}: OpenChannelMessageProps<SendbirdMessage, Props>) => {\n const { colors } = useUIKitTheme();\n const color = colors.ui.openChannelMessage.default;\n\n const renderSendingStatus = () => {\n if (!('sendingStatus' in props.message)) return null;\n\n switch (props.message.sendingStatus) {\n case SendingStatus.PENDING: {\n return (\n <SendingStatusContainer>\n <LoadingSpinner color={colors.primary} size={16} />\n </SendingStatusContainer>\n );\n }\n case SendingStatus.FAILED: {\n return (\n <SendingStatusContainer>\n <Icon icon={'error'} color={colors.error} size={16} />\n </SendingStatusContainer>\n );\n }\n default: {\n return null;\n }\n }\n };\n\n return (\n <Box\n flexDirection={'row'}\n paddingVertical={grouped ? 5 : 6}\n paddingLeft={12}\n paddingRight={12}\n backgroundColor={pressed ? color.pressed.background : color.enabled.background}\n >\n <Box marginRight={12}>\n {!grouped && 'sender' in props.message ? (\n <PressBox onPress={props.onPressAvatar}>\n <Avatar size={styles.avatar.width} uri={props.message.sender.profileUrl} />\n </PressBox>\n ) : (\n <Box style={styles.avatar} />\n )}\n </Box>\n <Box flexShrink={1} flex={1} flexDirection={'column'} alignItems={'flex-start'}>\n {!grouped && 'sender' in props.message && (\n <Box flexDirection={'row'} alignItems={'center'} marginBottom={2}>\n <Box marginRight={4} flexShrink={1}>\n <Text\n caption1\n ellipsizeMode={'middle'}\n numberOfLines={1}\n color={\n channel.isOperator(props.message.sender.userId)\n ? color.enabled.textOperator\n : color.enabled.textSenderName\n }\n >\n {props.strings?.senderName ?? props.message.sender.nickname}\n </Text>\n </Box>\n <Box>\n <Text caption4 color={color.enabled.textTime}>\n {props.strings?.sentDate ?? getMessageTimeFormat(new Date(props.message.createdAt))}\n </Text>\n </Box>\n </Box>\n )}\n <Box style={styles.message}>{children}</Box>\n\n {renderSendingStatus()}\n </Box>\n </Box>\n );\n};\n\nconst SendingStatusContainer = ({ children }: { children: React.ReactElement }) => {\n return (\n <Box flexDirection={'row'}>\n <Box marginTop={2}>{children}</Box>\n </Box>\n );\n};\n\nconst styles = createStyleSheet({\n avatar: {\n width: 28,\n },\n message: {\n width: '100%',\n },\n});\n\nexport default MessageContainer;\n"],"mappings":"AAAA,OAAOA,KAAP,MAAkB,OAAlB;AAEA,SAASC,aAAT,QAA8B,wBAA9B;AAEA,SAASC,oBAAT,QAAqC,uBAArC;AAEA,OAAOC,GAAP,MAAgB,sBAAhB;AACA,OAAOC,IAAP,MAAiB,uBAAjB;AACA,OAAOC,QAAP,MAAqB,2BAArB;AACA,OAAOC,IAAP,MAAiB,uBAAjB;AACA,OAAOC,gBAAP,MAA6B,+BAA7B;AACA,OAAOC,aAAP,MAA0B,2BAA1B;AACA,OAAOC,MAAP,MAAmB,WAAnB;AACA,OAAOC,cAAP,MAA2B,mBAA3B;;AAOA,MAAMC,gBAAgB,GAAG,QAM8B;EAAA;;EAAA,IAN7B;IACxBC,QADwB;IAExBC,OAFwB;IAGxBC,OAHwB;IAIxBC,OAJwB;IAKxB,GAAGC;EALqB,CAM6B;EACrD,MAAM;IAAEC;EAAF,IAAaT,aAAa,EAAhC;EACA,MAAMU,KAAK,GAAGD,MAAM,CAACE,EAAP,CAAUC,kBAAV,CAA6BC,OAA3C;;EAEA,MAAMC,mBAAmB,GAAG,MAAM;IAChC,IAAI,EAAE,mBAAmBN,KAAK,CAACO,OAA3B,CAAJ,EAAyC,OAAO,IAAP;;IAEzC,QAAQP,KAAK,CAACO,OAAN,CAAcC,aAAtB;MACE,KAAKvB,aAAa,CAACwB,OAAnB;QAA4B;UAC1B,oBACE,oBAAC,sBAAD,qBACE,oBAAC,cAAD;YAAgB,KAAK,EAAER,MAAM,CAACS,OAA9B;YAAuC,IAAI,EAAE;UAA7C,EADF,CADF;QAKD;;MACD,KAAKzB,aAAa,CAA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ADV;IAEE,aAAa,EAAE,QAFjB;IAGE,aAAa,EAAE,CAHjB;IAIE,KAAK,EACHV,OAAO,CAACwB,UAAR,CAAmBrB,KAAK,CAACO,OAAN,CAAcY,MAAd,CAAqBG,MAAxC,IACIpB,KAAK,CAACY,OAAN,CAAcS,YADlB,GAEIrB,KAAK,CAACY,OAAN,CAAcU;EAPtB,GAUG,mBAAAxB,KAAK,CAACyB,OAAN,kEAAeC,UAAf,KAA6B1B,KAAK,CAACO,OAAN,CAAcY,MAAd,CAAqBQ,QAVrD,CADF,CADF,eAeE,oBAAC,GAAD,qBACE,oBAAC,IAAD;IAAM,QAAQ,MAAd;IAAe,KAAK,EAAEzB,KAAK,CAACY,OAAN,CAAcc;EAApC,GACG,oBAAA5B,KAAK,CAACyB,OAAN,oEAAeI,QAAf,KAA2B3C,oBAAoB,CAAC,IAAI4C,IAAJ,CAAS9B,KAAK,CAACO,OAAN,CAAcwB,SAAvB,CAAD,CADlD,CADF,CAfF,CAFJ,eAwBE,oBAAC,GAAD;IAAK,KAAK,EAAEf,MAAM,CAACT;EAAnB,GAA6BX,QAA7B,CAxBF,EA0BGU,mBAAmB,EA1BtB,CAhBF,CADF;AA+CD,CAjFD;;AAmFA,MAAM0B,sBAAsB,GAAG,SAAoD;EAAA,IAAnD;IAAEpC;EAAF,CAAmD;EACjF,oBACE,oBAAC,GAAD;IAAK,aAAa,EAAE;EAApB,gBACE,oBAAC,GAAD;IAAK,SAAS,EAAE;EAAhB,GAAoBA,QAApB,CADF,CADF;AAKD,CAND;;AAQA,MAAMoB,MAAM,GAAGzB,gBAAgB,CAAC;EAC9B0B,MAAM,EAAE;IACNC,KAAK,EAAE;EADD,CADsB;EAI9BX,OAAO,EAAE;IACPW,KAAK,EAAE;EADA;AAJqB,CAAD,CAA/B;AASA,eAAevB,gBAAf"}
@@ -0,0 +1,18 @@
1
+ import AdminMessage from './Message.admin';
2
+ import FileMessage from './Message.file';
3
+ import ImageFileMessage from './Message.file.image';
4
+ import VideoFileMessage from './Message.file.video';
5
+ import UnknownMessage from './Message.unknown';
6
+ import UserMessage from './Message.user';
7
+ import OpenGraphUserMessage from './Message.user.og';
8
+ const OpenChannelMessage = {
9
+ User: UserMessage,
10
+ OpenGraphUser: OpenGraphUserMessage,
11
+ File: FileMessage,
12
+ ImageFile: ImageFileMessage,
13
+ VideoFile: VideoFileMessage,
14
+ Admin: AdminMessage,
15
+ Unknown: UnknownMessage
16
+ };
17
+ export default OpenChannelMessage;
18
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["AdminMessage","FileMessage","ImageFileMessage","VideoFileMessage","UnknownMessage","UserMessage","OpenGraphUserMessage","OpenChannelMessage","User","OpenGraphUser","File","ImageFile","VideoFile","Admin","Unknown"],"sources":["index.ts"],"sourcesContent":["import type React from 'react';\n\nimport type { SendbirdMessage, SendbirdOpenChannel } from '@sendbird/uikit-utils';\n\nimport AdminMessage from './Message.admin';\nimport FileMessage from './Message.file';\nimport ImageFileMessage from './Message.file.image';\nimport VideoFileMessage from './Message.file.video';\nimport UnknownMessage from './Message.unknown';\nimport UserMessage from './Message.user';\nimport OpenGraphUserMessage from './Message.user.og';\n\nexport type OpenChannelMessageProps<T extends SendbirdMessage, AdditionalProps = unknown> = {\n channel: SendbirdOpenChannel;\n message: T;\n strings?: {\n senderName?: string;\n sentDate?: string;\n edited?: string;\n fileName?: string;\n unknownTitle?: string;\n unknownDescription?: string;\n };\n children?: React.ReactNode;\n grouped?: boolean;\n onPress?: () => void;\n onLongPress?: () => void;\n onPressAvatar?: () => void;\n onPressURL?: () => void;\n} & AdditionalProps;\n\nconst OpenChannelMessage = {\n User: UserMessage,\n OpenGraphUser: OpenGraphUserMessage,\n File: FileMessage,\n ImageFile: ImageFileMessage,\n VideoFile: VideoFileMessage,\n Admin: AdminMessage,\n Unknown: UnknownMessage,\n};\n\nexport default OpenChannelMessage;\n"],"mappings":"AAIA,OAAOA,YAAP,MAAyB,iBAAzB;AACA,OAAOC,WAAP,MAAwB,gBAAxB;AACA,OAAOC,gBAAP,MAA6B,sBAA7B;AACA,OAAOC,gBAAP,MAA6B,sBAA7B;AACA,OAAOC,cAAP,MAA2B,mBAA3B;AACA,OAAOC,WAAP,MAAwB,gBAAxB;AACA,OAAOC,oBAAP,MAAiC,mBAAjC;AAqBA,MAAMC,kBAAkB,GAAG;EACzBC,IAAI,EAAEH,WADmB;EAEzBI,aAAa,EAAEH,oBAFU;EAGzBI,IAAI,EAAET,WAHmB;EAIzBU,SAAS,EAAET,gBAJc;EAKzBU,SAAS,EAAET,gBALc;EAMzBU,KAAK,EAAEb,YANkB;EAOzBc,OAAO,EAAEV;AAPgB,CAA3B;AAUA,eAAeG,kBAAf"}
@@ -0,0 +1,117 @@
1
+ import React from 'react';
2
+ import { conditionChaining, truncatedCount } from '@sendbird/uikit-utils';
3
+ import Box from '../../components/Box';
4
+ import Icon from '../../components/Icon';
5
+ import Image from '../../components/Image';
6
+ import Text from '../../components/Text';
7
+ import createStyleSheet from '../../styles/createStyleSheet';
8
+ import useUIKitTheme from '../../theme/useUIKitTheme';
9
+
10
+ const OpenChannelPreview = _ref => {
11
+ let {
12
+ customCover,
13
+ coverUrl,
14
+ participantsCount = 0,
15
+ title,
16
+ frozen
17
+ } = _ref;
18
+ const {
19
+ colors
20
+ } = useUIKitTheme();
21
+ const color = colors.ui.openChannelPreview.default.none;
22
+ return /*#__PURE__*/React.createElement(Box, {
23
+ backgroundColor: color.background,
24
+ width: '100%',
25
+ height: 62,
26
+ flexDirection: 'row',
27
+ alignItems: 'center',
28
+ paddingHorizontal: 16
29
+ }, /*#__PURE__*/React.createElement(Box, {
30
+ width: styles.channelCover.width,
31
+ height: styles.channelCover.height,
32
+ borderRadius: styles.channelCover.width,
33
+ overflow: 'hidden',
34
+ marginRight: 16
35
+ }, conditionChaining([Boolean(customCover)], [customCover, /*#__PURE__*/React.createElement(Image, {
36
+ resizeMode: 'cover',
37
+ style: [styles.channelCover, {
38
+ backgroundColor: color.coverBackground
39
+ }],
40
+ source: {
41
+ uri: coverUrl
42
+ }
43
+ })])), /*#__PURE__*/React.createElement(Box, {
44
+ flex: 1,
45
+ height: '100%',
46
+ justifyContent: 'center'
47
+ }, /*#__PURE__*/React.createElement(Box, {
48
+ flexDirection: 'row',
49
+ flexShrink: 1,
50
+ marginBottom: 4,
51
+ alignItems: 'center'
52
+ }, /*#__PURE__*/React.createElement(Text, {
53
+ subtitle1: true,
54
+ style: styles.channelInfoTitle,
55
+ numberOfLines: 1,
56
+ color: color.textTitle
57
+ }, title), frozen && /*#__PURE__*/React.createElement(Icon, {
58
+ size: 16,
59
+ icon: 'freeze',
60
+ color: color.frozenIcon,
61
+ containerStyle: styles.marginLeft
62
+ })), /*#__PURE__*/React.createElement(Box, {
63
+ flexDirection: 'row',
64
+ flexShrink: 1,
65
+ alignItems: 'center',
66
+ justifyContent: 'flex-start'
67
+ }, /*#__PURE__*/React.createElement(Box, {
68
+ flexDirection: 'row',
69
+ alignItems: 'center'
70
+ }, /*#__PURE__*/React.createElement(Icon, {
71
+ size: 16,
72
+ icon: 'members',
73
+ color: color.participantsIcon,
74
+ containerStyle: styles.marginRight
75
+ }), /*#__PURE__*/React.createElement(Text, {
76
+ caption2: true,
77
+ color: color.textParticipants
78
+ }, truncatedCount(participantsCount, 999)))), /*#__PURE__*/React.createElement(Separator, {
79
+ color: color.separator
80
+ })));
81
+ };
82
+
83
+ const Separator = _ref2 => {
84
+ let {
85
+ color
86
+ } = _ref2;
87
+ return /*#__PURE__*/React.createElement(Box, {
88
+ style: [styles.separator, {
89
+ backgroundColor: color
90
+ }]
91
+ });
92
+ };
93
+
94
+ const styles = createStyleSheet({
95
+ channelCover: {
96
+ width: 32,
97
+ height: 32
98
+ },
99
+ channelInfoTitle: {
100
+ flexShrink: 1
101
+ },
102
+ marginRight: {
103
+ marginRight: 4
104
+ },
105
+ marginLeft: {
106
+ marginLeft: 4
107
+ },
108
+ separator: {
109
+ position: 'absolute',
110
+ left: 0,
111
+ right: -16,
112
+ bottom: 0,
113
+ height: 1
114
+ }
115
+ });
116
+ export default OpenChannelPreview;
117
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["React","conditionChaining","truncatedCount","Box","Icon","Image","Text","createStyleSheet","useUIKitTheme","OpenChannelPreview","customCover","coverUrl","participantsCount","title","frozen","colors","color","ui","openChannelPreview","default","none","background","styles","channelCover","width","height","Boolean","backgroundColor","coverBackground","uri","channelInfoTitle","textTitle","frozenIcon","marginLeft","participantsIcon","marginRight","textParticipants","separator","Separator","flexShrink","position","left","right","bottom"],"sources":["index.tsx"],"sourcesContent":["import React from 'react';\n\nimport { conditionChaining, truncatedCount } from '@sendbird/uikit-utils';\n\nimport Box from '../../components/Box';\nimport Icon from '../../components/Icon';\nimport Image from '../../components/Image';\nimport Text from '../../components/Text';\nimport createStyleSheet from '../../styles/createStyleSheet';\nimport useUIKitTheme from '../../theme/useUIKitTheme';\n\ntype Props = {\n customCover?: React.ReactElement;\n coverUrl: string;\n title: string;\n participantsCount?: number;\n frozen?: boolean;\n};\nconst OpenChannelPreview = ({ customCover, coverUrl, participantsCount = 0, title, frozen }: Props) => {\n const { colors } = useUIKitTheme();\n const color = colors.ui.openChannelPreview.default.none;\n\n return (\n <Box\n backgroundColor={color.background}\n width={'100%'}\n height={62}\n flexDirection={'row'}\n alignItems={'center'}\n paddingHorizontal={16}\n >\n <Box\n width={styles.channelCover.width}\n height={styles.channelCover.height}\n borderRadius={styles.channelCover.width}\n overflow={'hidden'}\n marginRight={16}\n >\n {conditionChaining(\n [Boolean(customCover)],\n [\n customCover,\n <Image\n resizeMode={'cover'}\n style={[styles.channelCover, { backgroundColor: color.coverBackground }]}\n source={{ uri: coverUrl }}\n />,\n ],\n )}\n </Box>\n <Box flex={1} height={'100%'} justifyContent={'center'}>\n <Box flexDirection={'row'} flexShrink={1} marginBottom={4} alignItems={'center'}>\n <Text subtitle1 style={styles.channelInfoTitle} numberOfLines={1} color={color.textTitle}>\n {title}\n </Text>\n {frozen && <Icon size={16} icon={'freeze'} color={color.frozenIcon} containerStyle={styles.marginLeft} />}\n </Box>\n <Box flexDirection={'row'} flexShrink={1} alignItems={'center'} justifyContent={'flex-start'}>\n <Box flexDirection={'row'} alignItems={'center'}>\n <Icon size={16} icon={'members'} color={color.participantsIcon} containerStyle={styles.marginRight} />\n <Text caption2 color={color.textParticipants}>\n {truncatedCount(participantsCount, 999)}\n </Text>\n </Box>\n </Box>\n <Separator color={color.separator} />\n </Box>\n </Box>\n );\n};\n\nconst Separator = ({ color }: { color: string }) => <Box style={[styles.separator, { backgroundColor: color }]} />;\n\nconst styles = createStyleSheet({\n channelCover: {\n width: 32,\n height: 32,\n },\n channelInfoTitle: {\n flexShrink: 1,\n },\n marginRight: {\n marginRight: 4,\n },\n marginLeft: {\n marginLeft: 4,\n },\n separator: {\n position: 'absolute',\n left: 0,\n right: -16,\n bottom: 0,\n height: 1,\n },\n});\n\nexport default OpenChannelPreview;\n"],"mappings":"AAAA,OAAOA,KAAP,MAAkB,OAAlB;AAEA,SAASC,iBAAT,EAA4BC,cAA5B,QAAkD,uBAAlD;AAEA,OAAOC,GAAP,MAAgB,sBAAhB;AACA,OAAOC,IAAP,MAAiB,uBAAjB;AACA,OAAOC,KAAP,MAAkB,wBAAlB;AACA,OAAOC,IAAP,MAAiB,uBAAjB;AACA,OAAOC,gBAAP,MAA6B,+BAA7B;AACA,OAAOC,aAAP,MAA0B,2BAA1B;;AASA,MAAMC,kBAAkB,GAAG,QAA4E;EAAA,IAA3E;IAAEC,WAAF;IAAeC,QAAf;IAAyBC,iBAAiB,GAAG,CAA7C;IAAgDC,KAAhD;IAAuDC;EAAvD,CAA2E;EACrG,MAAM;IAAEC;EAAF,IAAaP,aAAa,EAAhC;EACA,MAAMQ,KAAK,GAAGD,MAAM,CAACE,EAAP,CAAUC,kBAAV,CAA6BC,OAA7B,CAAqCC,IAAnD;EAEA,oBACE,oBAAC,GAAD;IACE,eAAe,EAAEJ,KA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BAAf"}
@@ -0,0 +1,11 @@
1
+ import { ViewProps, ViewStyle } from 'react-native';
2
+ import type { UIKitColors, UIKitPalette } from '../../types';
3
+ type BaseBoxProps = Pick<ViewStyle, 'flex' | 'flexShrink' | 'flexGrow' | 'flexDirection' | 'alignItems' | 'justifyContent' | 'borderRadius' | 'borderWidth' | 'borderColor' | 'borderBottomColor' | 'borderBottomWidth' | 'margin' | 'marginHorizontal' | 'marginVertical' | 'marginLeft' | 'marginRight' | 'marginTop' | 'marginBottom' | 'padding' | 'paddingHorizontal' | 'paddingVertical' | 'paddingLeft' | 'paddingRight' | 'paddingTop' | 'paddingBottom' | 'overflow' | 'width' | 'height'> & {
4
+ backgroundColor?: string | ((theme: {
5
+ colors: UIKitColors;
6
+ palette: UIKitPalette;
7
+ }) => string);
8
+ };
9
+ type BoxProps = BaseBoxProps & ViewProps;
10
+ declare const Box: ({ style, children, ...props }: BoxProps) => JSX.Element;
11
+ export default Box;
@@ -0,0 +1,11 @@
1
+ import { StyleProp, ViewStyle } from 'react-native';
2
+ type Props = {
3
+ source: number | {
4
+ uri: string;
5
+ };
6
+ width?: number | string;
7
+ height?: number | string;
8
+ style?: StyleProp<ViewStyle>;
9
+ };
10
+ declare const ImageWithPlaceholder: (props: Props) => JSX.Element;
11
+ export default ImageWithPlaceholder;
@@ -0,0 +1,16 @@
1
+ import * as React from 'react';
2
+ import type { GestureResponderEvent, StyleProp, ViewStyle } from 'react-native';
3
+ type PressBoxStateParams = {
4
+ pressed: boolean;
5
+ };
6
+ type Props = {
7
+ onPress?: (event: GestureResponderEvent) => void;
8
+ onLongPress?: (event: GestureResponderEvent) => void;
9
+ delayLongPress?: number;
10
+ activeOpacity?: number;
11
+ style?: StyleProp<ViewStyle> | ((state: PressBoxStateParams) => StyleProp<ViewStyle>);
12
+ children?: React.ReactNode | ((params: PressBoxStateParams) => React.ReactNode);
13
+ };
14
+ export declare const DEFAULT_LONG_PRESS_DELAY = 350;
15
+ declare const PressBox: (props: Props) => JSX.Element;
16
+ export default PressBox;
@@ -1,10 +1,13 @@
1
1
  /** Assets **/
2
2
  export { default as IconAssets } from './assets/icon';
3
3
  /** Component **/
4
+ export { default as Box } from './components/Box';
4
5
  export { default as Divider } from './components/Divider';
5
6
  export { default as Icon } from './components/Icon';
6
7
  export { default as Image } from './components/Image';
8
+ export { default as ImageWithPlaceholder } from './components/ImageWithPlaceholder';
7
9
  export { default as Modal } from './components/Modal';
10
+ export { default as PressBox } from './components/PressBox';
8
11
  export { default as RegexText } from './components/RegexText';
9
12
  export { default as Switch } from './components/Switch';
10
13
  export { default as Text } from './components/Text';
@@ -22,7 +25,11 @@ export { DialogProvider, useActionMenu, useAlert, usePrompt, useBottomSheet } fr
22
25
  export { default as GroupChannelPreview } from './ui/GroupChannelPreview';
23
26
  export { default as Header } from './ui/Header';
24
27
  export { default as LoadingSpinner } from './ui/LoadingSpinner';
25
- export { default as MenuBar, MenuBarProps } from './ui/MenuBar';
28
+ export { default as MenuBar } from './ui/MenuBar';
29
+ export type { MenuBarProps } from './ui/MenuBar';
30
+ export { default as OpenChannelMessage } from './ui/OpenChannelMessage';
31
+ export type { OpenChannelMessageProps } from './ui/OpenChannelMessage';
32
+ export { default as OpenChannelPreview } from './ui/OpenChannelPreview';
26
33
  export { default as OutlinedButton } from './ui/OutlinedButton';
27
34
  export { default as Placeholder } from './ui/Placeholder';
28
35
  export { default as ProfileCard } from './ui/ProfileCard';
@@ -26,7 +26,7 @@ export interface UIKitTheme {
26
26
  colors: UIKitColors;
27
27
  typography: UIKitTypography;
28
28
  }
29
- export type Component = 'Header' | 'Button' | 'Dialog' | 'Input' | 'Badge' | 'Placeholder' | 'Message' | 'DateSeparator' | 'GroupChannelPreview' | 'ProfileCard' | 'Reaction';
29
+ export type Component = 'Header' | 'Button' | 'Dialog' | 'Input' | 'Badge' | 'Placeholder' | 'DateSeparator' | 'GroupChannelMessage' | 'GroupChannelPreview' | 'ProfileCard' | 'Reaction' | 'OpenChannelMessage' | 'OpenChannelPreview' | 'Message';
30
30
  export type GetColorTree<Tree extends {
31
31
  Variant: {
32
32
  [key in Component]: string;
@@ -46,11 +46,15 @@ export type ComponentColorTree = GetColorTree<{
46
46
  Input: 'default' | 'underline';
47
47
  Badge: 'default';
48
48
  Placeholder: 'default';
49
- Message: 'incoming' | 'outgoing';
50
49
  DateSeparator: 'default';
50
+ GroupChannelMessage: 'incoming' | 'outgoing';
51
51
  GroupChannelPreview: 'default';
52
52
  ProfileCard: 'default';
53
53
  Reaction: 'default' | 'rounded';
54
+ OpenChannelMessage: 'default';
55
+ OpenChannelPreview: 'default';
56
+ /** @deprecated **/
57
+ Message: 'incoming' | 'outgoing';
54
58
  };
55
59
  State: {
56
60
  Header: 'none';
@@ -59,11 +63,15 @@ export type ComponentColorTree = GetColorTree<{
59
63
  Input: 'active' | 'disabled';
60
64
  Badge: 'none';
61
65
  Placeholder: 'none';
62
- Message: 'enabled' | 'pressed';
63
66
  DateSeparator: 'none';
67
+ GroupChannelMessage: 'enabled' | 'pressed';
64
68
  GroupChannelPreview: 'none';
65
69
  ProfileCard: 'none';
66
70
  Reaction: 'enabled' | 'selected';
71
+ OpenChannelMessage: 'enabled' | 'pressed';
72
+ OpenChannelPreview: 'none';
73
+ /** @deprecated **/
74
+ Message: 'enabled' | 'pressed';
67
75
  };
68
76
  ColorPart: {
69
77
  Header: 'background' | 'borderBottom';
@@ -72,11 +80,15 @@ export type ComponentColorTree = GetColorTree<{
72
80
  Input: 'text' | 'placeholder' | 'background' | 'highlight';
73
81
  Badge: 'text' | 'background';
74
82
  Placeholder: 'content' | 'highlight';
75
- Message: 'textMsg' | 'textEdited' | 'textSenderName' | 'textTime' | 'background';
76
83
  DateSeparator: 'text' | 'background';
84
+ GroupChannelMessage: 'textMsg' | 'textEdited' | 'textSenderName' | 'textTime' | 'background';
77
85
  GroupChannelPreview: 'textTitle' | 'textTitleCaption' | 'textBody' | 'memberCount' | 'bodyIcon' | 'background' | 'coverBackground' | 'bodyIconBackground' | 'separator';
78
86
  ProfileCard: 'textUsername' | 'textBodyLabel' | 'textBody' | 'background';
79
87
  Reaction: 'background' | 'highlight';
88
+ OpenChannelMessage: 'textMsg' | 'textMsgPostfix' | 'textSenderName' | 'textTime' | 'textOperator' | 'background' | 'bubbleBackground' | 'adminBackground';
89
+ OpenChannelPreview: 'textTitle' | 'textParticipants' | 'frozenIcon' | 'participantsIcon' | 'background' | 'coverBackground' | 'separator';
90
+ /** @deprecated **/
91
+ Message: 'textMsg' | 'textEdited' | 'textSenderName' | 'textTime' | 'background';
80
92
  };
81
93
  }>;
82
94
  export type ComponentColors<T extends Component> = {
@@ -116,11 +128,15 @@ export interface UIKitColors {
116
128
  input: ComponentColors<'Input'>;
117
129
  badge: ComponentColors<'Badge'>;
118
130
  placeholder: ComponentColors<'Placeholder'>;
119
- message: ComponentColors<'Message'>;
120
131
  dateSeparator: ComponentColors<'DateSeparator'>;
132
+ groupChannelMessage: ComponentColors<'GroupChannelMessage'>;
121
133
  groupChannelPreview: ComponentColors<'GroupChannelPreview'>;
122
134
  profileCard: ComponentColors<'ProfileCard'>;
123
135
  reaction: ComponentColors<'Reaction'>;
136
+ openChannelMessage: ComponentColors<'OpenChannelMessage'>;
137
+ openChannelPreview: ComponentColors<'OpenChannelPreview'>;
138
+ /** @deprecated Please use `colors.ui.groupChannelMessage` **/
139
+ message: ComponentColors<'Message'>;
124
140
  };
125
141
  }
126
142
  export type HeaderElement = string | ReactElement | null;
@@ -11,6 +11,7 @@ export type HeaderProps = BaseHeaderProps<{
11
11
  onPressRight?: () => void;
12
12
  }, {
13
13
  clearTitleMargin?: boolean;
14
+ clearStatusBarTopInset?: boolean;
14
15
  statusBarTopInsetAs?: 'padding' | 'margin';
15
16
  }>;
16
17
  declare const Header: ((props: HeaderProps) => JSX.Element) & {
@@ -0,0 +1,4 @@
1
+ import type { SendbirdAdminMessage } from '@sendbird/uikit-utils';
2
+ import type { OpenChannelMessageProps } from './index';
3
+ declare const AdminMessage: (props: OpenChannelMessageProps<SendbirdAdminMessage>) => JSX.Element;
4
+ export default AdminMessage;
@@ -0,0 +1,5 @@
1
+ import { SendbirdFileMessage } from '@sendbird/uikit-utils';
2
+ import type { OpenChannelMessageProps } from './index';
3
+ type Props = {};
4
+ declare const FileMessage: (props: OpenChannelMessageProps<SendbirdFileMessage, Props>) => JSX.Element;
5
+ export default FileMessage;
@@ -0,0 +1,4 @@
1
+ import type { SendbirdFileMessage } from '@sendbird/uikit-utils';
2
+ import type { OpenChannelMessageProps } from './index';
3
+ declare const ImageFileMessage: (props: OpenChannelMessageProps<SendbirdFileMessage>) => JSX.Element;
4
+ export default ImageFileMessage;
@@ -0,0 +1,9 @@
1
+ import type { SendbirdFileMessage } from '@sendbird/uikit-utils';
2
+ import type { OpenChannelMessageProps } from './index';
3
+ type Props = {
4
+ fetchThumbnailFromVideoSource: (uri: string) => Promise<{
5
+ path: string;
6
+ } | null>;
7
+ };
8
+ declare const VideoFileMessage: (props: OpenChannelMessageProps<SendbirdFileMessage, Props>) => JSX.Element;
9
+ export default VideoFileMessage;
@@ -0,0 +1,4 @@
1
+ import type { SendbirdMessage } from '@sendbird/uikit-utils';
2
+ import type { OpenChannelMessageProps } from './index';
3
+ declare const UnknownMessage: (props: OpenChannelMessageProps<SendbirdMessage>) => JSX.Element;
4
+ export default UnknownMessage;
@@ -0,0 +1,5 @@
1
+ import type { SendbirdUserMessage } from '@sendbird/uikit-utils';
2
+ import type { OpenChannelMessageProps } from './index';
3
+ type Props = {};
4
+ declare const UserMessage: (props: OpenChannelMessageProps<SendbirdUserMessage, Props>) => JSX.Element;
5
+ export default UserMessage;
@@ -0,0 +1,5 @@
1
+ import type { SendbirdUserMessage } from '@sendbird/uikit-utils';
2
+ import type { OpenChannelMessageProps } from './index';
3
+ type Props = {};
4
+ declare const OpenGraphUserMessage: (props: OpenChannelMessageProps<SendbirdUserMessage, Props>) => JSX.Element;
5
+ export default OpenGraphUserMessage;
@@ -0,0 +1,7 @@
1
+ import type { SendbirdMessage } from '@sendbird/uikit-utils';
2
+ import type { OpenChannelMessageProps } from './index';
3
+ type Props = {
4
+ pressed?: boolean;
5
+ };
6
+ declare const MessageContainer: ({ children, channel, grouped, pressed, ...props }: OpenChannelMessageProps<SendbirdMessage, Props>) => JSX.Element;
7
+ export default MessageContainer;
@@ -0,0 +1,136 @@
1
+ import type React from 'react';
2
+ import type { SendbirdMessage, SendbirdOpenChannel } from '@sendbird/uikit-utils';
3
+ export type OpenChannelMessageProps<T extends SendbirdMessage, AdditionalProps = unknown> = {
4
+ channel: SendbirdOpenChannel;
5
+ message: T;
6
+ strings?: {
7
+ senderName?: string;
8
+ sentDate?: string;
9
+ edited?: string;
10
+ fileName?: string;
11
+ unknownTitle?: string;
12
+ unknownDescription?: string;
13
+ };
14
+ children?: React.ReactNode;
15
+ grouped?: boolean;
16
+ onPress?: () => void;
17
+ onLongPress?: () => void;
18
+ onPressAvatar?: () => void;
19
+ onPressURL?: () => void;
20
+ } & AdditionalProps;
21
+ declare const OpenChannelMessage: {
22
+ User: (props: {
23
+ channel: SendbirdOpenChannel;
24
+ message: import("@sendbird/chat/message").UserMessage;
25
+ strings?: {
26
+ senderName?: string | undefined;
27
+ sentDate?: string | undefined;
28
+ edited?: string | undefined;
29
+ fileName?: string | undefined;
30
+ unknownTitle?: string | undefined;
31
+ unknownDescription?: string | undefined;
32
+ } | undefined;
33
+ children?: React.ReactNode;
34
+ grouped?: boolean | undefined;
35
+ onPress?: (() => void) | undefined;
36
+ onLongPress?: (() => void) | undefined;
37
+ onPressAvatar?: (() => void) | undefined;
38
+ onPressURL?: (() => void) | undefined;
39
+ }) => JSX.Element;
40
+ OpenGraphUser: (props: {
41
+ channel: SendbirdOpenChannel;
42
+ message: import("@sendbird/chat/message").UserMessage;
43
+ strings?: {
44
+ senderName?: string | undefined;
45
+ sentDate?: string | undefined;
46
+ edited?: string | undefined;
47
+ fileName?: string | undefined;
48
+ unknownTitle?: string | undefined;
49
+ unknownDescription?: string | undefined;
50
+ } | undefined;
51
+ children?: React.ReactNode;
52
+ grouped?: boolean | undefined;
53
+ onPress?: (() => void) | undefined;
54
+ onLongPress?: (() => void) | undefined;
55
+ onPressAvatar?: (() => void) | undefined;
56
+ onPressURL?: (() => void) | undefined;
57
+ }) => JSX.Element;
58
+ File: (props: {
59
+ channel: SendbirdOpenChannel;
60
+ message: import("@sendbird/chat/message").FileMessage;
61
+ strings?: {
62
+ senderName?: string | undefined;
63
+ sentDate?: string | undefined;
64
+ edited?: string | undefined;
65
+ fileName?: string | undefined;
66
+ unknownTitle?: string | undefined;
67
+ unknownDescription?: string | undefined;
68
+ } | undefined;
69
+ children?: React.ReactNode;
70
+ grouped?: boolean | undefined;
71
+ onPress?: (() => void) | undefined;
72
+ onLongPress?: (() => void) | undefined;
73
+ onPressAvatar?: (() => void) | undefined;
74
+ onPressURL?: (() => void) | undefined;
75
+ }) => JSX.Element;
76
+ ImageFile: (props: {
77
+ channel: SendbirdOpenChannel;
78
+ message: import("@sendbird/chat/message").FileMessage;
79
+ strings?: {
80
+ senderName?: string | undefined;
81
+ sentDate?: string | undefined;
82
+ edited?: string | undefined;
83
+ fileName?: string | undefined;
84
+ unknownTitle?: string | undefined;
85
+ unknownDescription?: string | undefined;
86
+ } | undefined;
87
+ children?: React.ReactNode;
88
+ grouped?: boolean | undefined;
89
+ onPress?: (() => void) | undefined;
90
+ onLongPress?: (() => void) | undefined;
91
+ onPressAvatar?: (() => void) | undefined;
92
+ onPressURL?: (() => void) | undefined;
93
+ }) => JSX.Element;
94
+ VideoFile: (props: OpenChannelMessageProps<import("@sendbird/chat/message").FileMessage, {
95
+ fetchThumbnailFromVideoSource: (uri: string) => Promise<{
96
+ path: string;
97
+ } | null>;
98
+ }>) => JSX.Element;
99
+ Admin: (props: {
100
+ channel: SendbirdOpenChannel;
101
+ message: import("@sendbird/chat/message").AdminMessage;
102
+ strings?: {
103
+ senderName?: string | undefined;
104
+ sentDate?: string | undefined;
105
+ edited?: string | undefined;
106
+ fileName?: string | undefined;
107
+ unknownTitle?: string | undefined;
108
+ unknownDescription?: string | undefined;
109
+ } | undefined;
110
+ children?: React.ReactNode;
111
+ grouped?: boolean | undefined;
112
+ onPress?: (() => void) | undefined;
113
+ onLongPress?: (() => void) | undefined;
114
+ onPressAvatar?: (() => void) | undefined;
115
+ onPressURL?: (() => void) | undefined;
116
+ }) => JSX.Element;
117
+ Unknown: (props: {
118
+ channel: SendbirdOpenChannel;
119
+ message: SendbirdMessage;
120
+ strings?: {
121
+ senderName?: string | undefined;
122
+ sentDate?: string | undefined;
123
+ edited?: string | undefined;
124
+ fileName?: string | undefined;
125
+ unknownTitle?: string | undefined;
126
+ unknownDescription?: string | undefined;
127
+ } | undefined;
128
+ children?: React.ReactNode;
129
+ grouped?: boolean | undefined;
130
+ onPress?: (() => void) | undefined;
131
+ onLongPress?: (() => void) | undefined;
132
+ onPressAvatar?: (() => void) | undefined;
133
+ onPressURL?: (() => void) | undefined;
134
+ }) => JSX.Element;
135
+ };
136
+ export default OpenChannelMessage;