@sendbird/uikit-react-native-foundation 3.0.4 → 3.1.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 (86) hide show
  1. package/lib/commonjs/components/Icon/index.js +12 -0
  2. package/lib/commonjs/components/Icon/index.js.map +1 -1
  3. package/lib/commonjs/components/VideoThumbnail/index.js +108 -0
  4. package/lib/commonjs/components/VideoThumbnail/index.js.map +1 -0
  5. package/lib/commonjs/index.js +7 -0
  6. package/lib/commonjs/index.js.map +1 -1
  7. package/lib/commonjs/theme/DarkUIKitTheme.js +2 -1
  8. package/lib/commonjs/theme/DarkUIKitTheme.js.map +1 -1
  9. package/lib/commonjs/theme/LightUIKitTheme.js +2 -1
  10. package/lib/commonjs/theme/LightUIKitTheme.js.map +1 -1
  11. package/lib/commonjs/types.js.map +1 -1
  12. package/lib/commonjs/ui/BottomSheet/index.js +1 -0
  13. package/lib/commonjs/ui/BottomSheet/index.js.map +1 -1
  14. package/lib/commonjs/ui/Dialog/DialogSheet.js +4 -3
  15. package/lib/commonjs/ui/Dialog/DialogSheet.js.map +1 -1
  16. package/lib/commonjs/ui/GroupChannelMessage/Message.file.js +6 -9
  17. package/lib/commonjs/ui/GroupChannelMessage/Message.file.js.map +1 -1
  18. package/lib/commonjs/ui/GroupChannelMessage/Message.file.video.js +9 -71
  19. package/lib/commonjs/ui/GroupChannelMessage/Message.file.video.js.map +1 -1
  20. package/lib/commonjs/ui/GroupChannelMessage/MessageContainer.js +7 -5
  21. package/lib/commonjs/ui/GroupChannelMessage/MessageContainer.js.map +1 -1
  22. package/lib/commonjs/ui/GroupChannelMessage/MessageOpenGraph.js +2 -2
  23. package/lib/commonjs/ui/GroupChannelMessage/MessageOpenGraph.js.map +1 -1
  24. package/lib/commonjs/ui/GroupChannelMessage/index.js.map +1 -1
  25. package/lib/commonjs/ui/OpenChannelMessage/Message.file.js +2 -8
  26. package/lib/commonjs/ui/OpenChannelMessage/Message.file.js.map +1 -1
  27. package/lib/commonjs/ui/OpenChannelMessage/Message.file.video.js +10 -77
  28. package/lib/commonjs/ui/OpenChannelMessage/Message.file.video.js.map +1 -1
  29. package/lib/commonjs/ui/OpenChannelMessage/Message.user.og.js +1 -1
  30. package/lib/commonjs/ui/OpenChannelMessage/Message.user.og.js.map +1 -1
  31. package/lib/module/components/Icon/index.js +12 -0
  32. package/lib/module/components/Icon/index.js.map +1 -1
  33. package/lib/module/components/VideoThumbnail/index.js +98 -0
  34. package/lib/module/components/VideoThumbnail/index.js.map +1 -0
  35. package/lib/module/index.js +1 -0
  36. package/lib/module/index.js.map +1 -1
  37. package/lib/module/theme/DarkUIKitTheme.js +2 -1
  38. package/lib/module/theme/DarkUIKitTheme.js.map +1 -1
  39. package/lib/module/theme/LightUIKitTheme.js +2 -1
  40. package/lib/module/theme/LightUIKitTheme.js.map +1 -1
  41. package/lib/module/types.js.map +1 -1
  42. package/lib/module/ui/BottomSheet/index.js +1 -0
  43. package/lib/module/ui/BottomSheet/index.js.map +1 -1
  44. package/lib/module/ui/Dialog/DialogSheet.js +4 -3
  45. package/lib/module/ui/Dialog/DialogSheet.js.map +1 -1
  46. package/lib/module/ui/GroupChannelMessage/Message.file.js +7 -10
  47. package/lib/module/ui/GroupChannelMessage/Message.file.js.map +1 -1
  48. package/lib/module/ui/GroupChannelMessage/Message.file.video.js +9 -69
  49. package/lib/module/ui/GroupChannelMessage/Message.file.video.js.map +1 -1
  50. package/lib/module/ui/GroupChannelMessage/MessageContainer.js +7 -5
  51. package/lib/module/ui/GroupChannelMessage/MessageContainer.js.map +1 -1
  52. package/lib/module/ui/GroupChannelMessage/MessageOpenGraph.js +2 -2
  53. package/lib/module/ui/GroupChannelMessage/MessageOpenGraph.js.map +1 -1
  54. package/lib/module/ui/GroupChannelMessage/index.js.map +1 -1
  55. package/lib/module/ui/OpenChannelMessage/Message.file.js +2 -8
  56. package/lib/module/ui/OpenChannelMessage/Message.file.js.map +1 -1
  57. package/lib/module/ui/OpenChannelMessage/Message.file.video.js +10 -75
  58. package/lib/module/ui/OpenChannelMessage/Message.file.video.js.map +1 -1
  59. package/lib/module/ui/OpenChannelMessage/Message.user.og.js +1 -1
  60. package/lib/module/ui/OpenChannelMessage/Message.user.og.js.map +1 -1
  61. package/lib/typescript/src/components/Icon/index.d.ts +5 -0
  62. package/lib/typescript/src/components/VideoThumbnail/index.d.ts +11 -0
  63. package/lib/typescript/src/index.d.ts +1 -0
  64. package/lib/typescript/src/types.d.ts +1 -1
  65. package/lib/typescript/src/ui/BottomSheet/index.d.ts +1 -0
  66. package/lib/typescript/src/ui/Dialog/DialogSheet.d.ts +2 -1
  67. package/lib/typescript/src/ui/GroupChannelMessage/MessageContainer.d.ts +2 -2
  68. package/lib/typescript/src/ui/GroupChannelMessage/MessageOpenGraph.d.ts +1 -1
  69. package/lib/typescript/src/ui/GroupChannelMessage/index.d.ts +8 -0
  70. package/package.json +3 -3
  71. package/src/components/Icon/index.tsx +11 -7
  72. package/src/components/VideoThumbnail/index.tsx +100 -0
  73. package/src/index.ts +1 -0
  74. package/src/theme/DarkUIKitTheme.ts +1 -0
  75. package/src/theme/LightUIKitTheme.ts +1 -0
  76. package/src/types.ts +1 -1
  77. package/src/ui/BottomSheet/index.tsx +2 -0
  78. package/src/ui/Dialog/DialogSheet.tsx +6 -3
  79. package/src/ui/GroupChannelMessage/Message.file.tsx +4 -6
  80. package/src/ui/GroupChannelMessage/Message.file.video.tsx +10 -58
  81. package/src/ui/GroupChannelMessage/MessageContainer.tsx +18 -13
  82. package/src/ui/GroupChannelMessage/MessageOpenGraph.tsx +3 -3
  83. package/src/ui/GroupChannelMessage/index.ts +1 -0
  84. package/src/ui/OpenChannelMessage/Message.file.tsx +1 -3
  85. package/src/ui/OpenChannelMessage/Message.file.video.tsx +10 -53
  86. package/src/ui/OpenChannelMessage/Message.user.og.tsx +1 -1
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- import { getFileExtension, getFileType } from '@sendbird/uikit-utils';
2
+ import { getFileExtension, getFileType, truncate } from '@sendbird/uikit-utils';
3
3
  import Box from '../../components/Box';
4
4
  import Icon from '../../components/Icon';
5
5
  import PressBox from '../../components/PressBox';
@@ -7,12 +7,6 @@ import Text from '../../components/Text';
7
7
  import createStyleSheet from '../../styles/createStyleSheet';
8
8
  import useUIKitTheme from '../../theme/useUIKitTheme';
9
9
  import MessageContainer from './MessageContainer';
10
- const iconMapper = {
11
- audio: 'file-audio',
12
- image: 'photo',
13
- video: 'play',
14
- file: 'file-document'
15
- };
16
10
  const FileMessage = props => {
17
11
  const {
18
12
  variant = 'incoming'
@@ -35,8 +29,8 @@ const FileMessage = props => {
35
29
  style: styles.container
36
30
  }, /*#__PURE__*/React.createElement(Box, {
37
31
  style: styles.bubble
38
- }, /*#__PURE__*/React.createElement(Icon, {
39
- icon: iconMapper[fileType],
32
+ }, /*#__PURE__*/React.createElement(Icon.File, {
33
+ fileType: fileType,
40
34
  size: 24,
41
35
  containerStyle: {
42
36
  backgroundColor: colors.background,
@@ -50,7 +44,10 @@ const FileMessage = props => {
50
44
  numberOfLines: 1,
51
45
  color: pressed ? color.pressed.textMsg : color.enabled.textMsg,
52
46
  style: styles.name
53
- }, ((_props$strings = props.strings) === null || _props$strings === void 0 ? void 0 : _props$strings.fileName) || props.message.name)), props.children);
47
+ }, truncate(((_props$strings = props.strings) === null || _props$strings === void 0 ? void 0 : _props$strings.fileName) || props.message.name, {
48
+ mode: 'mid',
49
+ maxLen: 20
50
+ }))), props.children);
54
51
  }));
55
52
  };
56
53
  const styles = createStyleSheet({
@@ -1 +1 @@
1
- {"version":3,"names":["React","getFileExtension","getFileType","Box","Icon","PressBox","Text","createStyleSheet","useUIKitTheme","MessageContainer","iconMapper","audio","image","video","file","FileMessage","props","variant","colors","fileType","message","type","name","color","ui","groupChannelMessage","createElement","onPress","onLongPress","_ref","_props$strings","pressed","backgroundColor","background","enabled","style","styles","container","bubble","icon","size","containerStyle","padding","borderRadius","marginRight","body3","ellipsizeMode","numberOfLines","textMsg","strings","fileName","children","overflow","flexDirection","alignItems","paddingHorizontal","paddingVertical","flexShrink"],"sources":["Message.file.tsx"],"sourcesContent":["import React from 'react';\n\nimport { SendbirdFileMessage, getFileExtension, getFileType } 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 MessageContainer from './MessageContainer';\nimport type { GroupChannelMessageProps } from './index';\n\nconst iconMapper = { audio: 'file-audio', image: 'photo', video: 'play', file: 'file-document' } as const;\n\ntype Props = GroupChannelMessageProps<SendbirdFileMessage>;\n\nconst FileMessage = (props: Props) => {\n const { variant = 'incoming' } = props;\n const { colors } = useUIKitTheme();\n\n const fileType = getFileType(props.message.type || getFileExtension(props.message.name));\n const color = colors.ui.groupChannelMessage[variant];\n\n return (\n <MessageContainer {...props}>\n <PressBox onPress={props.onPress} onLongPress={props.onLongPress}>\n {({ pressed }) => (\n <Box backgroundColor={pressed ? color.pressed.background : color.enabled.background} style={styles.container}>\n <Box style={styles.bubble}>\n <Icon\n icon={iconMapper[fileType]}\n size={24}\n containerStyle={{ backgroundColor: colors.background, padding: 2, borderRadius: 8, marginRight: 8 }}\n />\n <Text\n body3\n ellipsizeMode={'middle'}\n numberOfLines={1}\n color={pressed ? color.pressed.textMsg : color.enabled.textMsg}\n style={styles.name}\n >\n {props.strings?.fileName || props.message.name}\n </Text>\n </Box>\n {props.children}\n </Box>\n )}\n </PressBox>\n </MessageContainer>\n );\n};\n\nconst styles = createStyleSheet({\n container: {\n overflow: 'hidden',\n borderRadius: 16,\n },\n bubble: {\n flexDirection: 'row',\n alignItems: 'center',\n paddingHorizontal: 12,\n paddingVertical: 6,\n },\n name: {\n flexShrink: 1,\n },\n});\n\nexport default FileMessage;\n"],"mappings":"AAAA,OAAOA,KAAK,MAAM,OAAO;AAEzB,SAA8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,gBAC3GrC,KAAA,CAAA0B,aAAA,CAACvB,GAAG;MAACgC,KAAK,EAAEC,MAAM,CAACE;IAAO,gBACxBtC,KAAA,CAAA0B,aAAA,CAACtB,IAAI;MACHmC,IAAI,EAAE7B,UAAU,CAACS,QAAQ,CAAE;MAC3BqB,IAAI,EAAE,EAAG;MACTC,cAAc,EAAE;QAAET,eAAe,EAAEd,MAAM,CAACe,UAAU;QAAES,OAAO,EAAE,CAAC;QAAEC,YAAY,EAAE,CAAC;QAAEC,WAAW,EAAE;MAAE;IAAE,EACpG,eACF5C,KAAA,CAAA0B,aAAA,CAACpB,IAAI;MACHuC,KAAK;MACLC,aAAa,EAAE,QAAS;MACxBC,aAAa,EAAE,CAAE;MACjBxB,KAAK,EAAEQ,OAAO,GAAGR,KAAK,CAACQ,OAAO,CAACiB,OAAO,GAAGzB,KAAK,CAACW,OAAO,CAACc,OAAQ;MAC/Db,KAAK,EAAEC,MAAM,CAACd;IAAK,GAElB,EAAAQ,cAAA,GAAAd,KAAK,CAACiC,OAAO,cAAAnB,cAAA,uBAAbA,cAAA,CAAeoB,QAAQ,KAAIlC,KAAK,CAACI,OAAO,CAACE,IAAI,CACzC,CACH,EACLN,KAAK,CAACmC,QAAQ,CACX;EAAA,CACP,CACQ,CACM;AAEvB,CAAC;AAED,MAAMf,MAAM,GAAG7B,gBAAgB,CAAC;EAC9B8B,SAAS,EAAE;IACTe,QAAQ,EAAE,QAAQ;IAClBT,YAAY,EAAE;EAChB,CAAC;EACDL,MAAM,EAAE;IACNe,aAAa,EAAE,KAAK;IACpBC,UAAU,EAAE,QAAQ;IACpBC,iBAAiB,EAAE,EAAE;IACrBC,eAAe,EAAE;EACnB,CAAC;EACDlC,IAAI,EAAE;IACJmC,UAAU,EAAE;EACd;AACF,CAAC,CAAC;AAEF,eAAe1C,WAAW"}
1
+ {"version":3,"names":["React","getFileExtension","getFileType","truncate","Box","Icon","PressBox","Text","createStyleSheet","useUIKitTheme","MessageContainer","FileMessage","props","variant","colors","fileType","message","type","name","color","ui","groupChannelMessage","createElement","onPress","onLongPress","_ref","_props$strings","pressed","backgroundColor","background","enabled","style","styles","container","bubble","File","size","containerStyle","padding","borderRadius","marginRight","body3","ellipsizeMode","numberOfLines","textMsg","strings","fileName","mode","maxLen","children","overflow","flexDirection","alignItems","paddingHorizontal","paddingVertical","flexShrink"],"sources":["Message.file.tsx"],"sourcesContent":["import React from 'react';\n\nimport { SendbirdFileMessage, getFileExtension, getFileType, truncate } 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 MessageContainer from './MessageContainer';\nimport type { GroupChannelMessageProps } from './index';\n\ntype Props = GroupChannelMessageProps<SendbirdFileMessage>;\n\nconst FileMessage = (props: Props) => {\n const { variant = 'incoming' } = props;\n const { colors } = useUIKitTheme();\n\n const fileType = getFileType(props.message.type || getFileExtension(props.message.name));\n const color = colors.ui.groupChannelMessage[variant];\n\n return (\n <MessageContainer {...props}>\n <PressBox onPress={props.onPress} onLongPress={props.onLongPress}>\n {({ pressed }) => (\n <Box backgroundColor={pressed ? color.pressed.background : color.enabled.background} style={styles.container}>\n <Box style={styles.bubble}>\n <Icon.File\n fileType={fileType}\n size={24}\n containerStyle={{ backgroundColor: colors.background, padding: 2, borderRadius: 8, marginRight: 8 }}\n />\n <Text\n body3\n ellipsizeMode={'middle'}\n numberOfLines={1}\n color={pressed ? color.pressed.textMsg : color.enabled.textMsg}\n style={styles.name}\n >\n {truncate(props.strings?.fileName || props.message.name, { mode: 'mid', maxLen: 20 })}\n </Text>\n </Box>\n {props.children}\n </Box>\n )}\n </PressBox>\n </MessageContainer>\n );\n};\n\nconst styles = createStyleSheet({\n container: {\n overflow: 'hidden',\n borderRadius: 16,\n },\n bubble: {\n flexDirection: 'row',\n alignItems: 'center',\n paddingHorizontal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1
- import React, { useEffect, useRef, useState } from 'react';
2
- import { StyleSheet } from 'react-native';
1
+ import React from 'react';
3
2
  import { getAvailableUriFromFileMessage } from '@sendbird/uikit-utils';
4
3
  import Box from '../../components/Box';
5
- import Icon from '../../components/Icon';
6
- import ImageWithPlaceholder from '../../components/ImageWithPlaceholder';
7
4
  import PressBox from '../../components/PressBox';
5
+ import { VideoThumbnail } from '../../components/VideoThumbnail';
8
6
  import createStyleSheet from '../../styles/createStyleSheet';
9
7
  import useUIKitTheme from '../../theme/useUIKitTheme';
10
8
  import MessageContainer from './MessageContainer';
@@ -15,79 +13,21 @@ const VideoFileMessage = props => {
15
13
  variant = 'incoming'
16
14
  } = props;
17
15
  const {
18
- colors,
19
- palette,
20
- select
16
+ colors
21
17
  } = useUIKitTheme();
22
18
  const uri = getAvailableUriFromFileMessage(props.message);
23
- const {
24
- thumbnail,
25
- loading
26
- } = useRetry(() => props.fetchThumbnailFromVideoSource(uri));
27
19
  return /*#__PURE__*/React.createElement(MessageContainer, props, /*#__PURE__*/React.createElement(Box, {
28
20
  style: styles.container,
29
21
  backgroundColor: colors.ui.groupChannelMessage[variant].enabled.background
30
22
  }, /*#__PURE__*/React.createElement(PressBox, {
31
23
  activeOpacity: 0.8,
32
24
  onPress: onPress,
33
- onLongPress: onLongPress,
34
- style: styles.image
35
- }, loading ? /*#__PURE__*/React.createElement(Box, {
36
- style: StyleSheet.absoluteFill,
37
- backgroundColor: select({
38
- dark: palette.background400,
39
- light: palette.background100
40
- })
41
- }) : /*#__PURE__*/React.createElement(ImageWithPlaceholder, {
42
- source: {
43
- uri: thumbnail ?? 'invalid-image'
44
- },
45
- style: StyleSheet.absoluteFill
46
- }), (loading || thumbnail !== null) && /*#__PURE__*/React.createElement(Box, {
47
- style: StyleSheet.absoluteFill,
48
- alignItems: 'center',
49
- justifyContent: 'center'
50
- }, /*#__PURE__*/React.createElement(Icon, {
51
- icon: 'play',
52
- size: 28,
53
- color: palette.onBackgroundLight02,
54
- containerStyle: [styles.playIcon, {
55
- backgroundColor: palette.onBackgroundDark01
56
- }]
57
- }))), props.children));
58
- };
59
- const useRetry = function (fetch) {
60
- let retryCount = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 5;
61
- const [state, setState] = useState({
62
- thumbnail: null,
63
- loading: true
64
- });
65
- const retryCountRef = useRef(0);
66
- const retryTimeoutRef = useRef();
67
- const fetchThumbnail = useRef(fetch);
68
- fetchThumbnail.current = fetch;
69
- useEffect(() => {
70
- if (!state.thumbnail) {
71
- const reloadReservation = () => {
72
- if (retryCountRef.current < retryCount) {
73
- retryTimeoutRef.current = setTimeout(() => {
74
- retryCountRef.current++;
75
- reloadReservation();
76
- fetchThumbnail.current().then(result => {
77
- setState({
78
- loading: false,
79
- thumbnail: (result === null || result === void 0 ? void 0 : result.path) ?? null
80
- });
81
- });
82
- }, retryCountRef.current * 5000);
83
- }
84
- };
85
- return reloadReservation();
86
- } else {
87
- return clearTimeout(retryTimeoutRef.current);
88
- }
89
- }, [state.thumbnail]);
90
- return state;
25
+ onLongPress: onLongPress
26
+ }, /*#__PURE__*/React.createElement(VideoThumbnail, {
27
+ style: styles.image,
28
+ videoSource: uri,
29
+ fetchThumbnailFromVideoSource: props.fetchThumbnailFromVideoSource
30
+ })), props.children));
91
31
  };
92
32
  const styles = createStyleSheet({
93
33
  container: {
@@ -1 +1 @@
1
- {"version":3,"names":["React","useEffect","useRef","useState","StyleSheet","getAvailableUriFromFileMessage","Box","Icon","ImageWithPlaceholder","PressBox","createStyleSheet","useUIKitTheme","MessageContainer","VideoFileMessage","props","onPress","onLongPress","variant","colors","palette","select","uri","message","thumbnail","loading","useRetry","fetchThumbnailFromVideoSource","createElement","style","styles","container","backgroundColor","ui","groupChannelMessage","enabled","background","activeOpacity","image","absoluteFill","dark","background400","light","background100","source","alignItems","justifyContent","icon","size","color","onBackgroundLight02","containerStyle","playIcon","onBackgroundDark01","children","fetch","retryCount","arguments","length","undefined","state","setState","retryCountRef","retryTimeoutRef","fetchThumbnail","current","reloadReservation","setTimeout","then","result","path","clearTimeout","borderRadius","overflow","maxWidth","width","height","padding"],"sources":["Message.file.video.tsx"],"sourcesContent":["import React, { useEffect, useRef, useState } from 'react';\nimport { StyleSheet } from 'react-native';\n\nimport type { SendbirdFileMessage } from '@sendbird/uikit-utils';\nimport { getAvailableUriFromFileMessage } from '@sendbird/uikit-utils';\n\nimport Box from '../../components/Box';\nimport Icon from '../../components/Icon';\nimport ImageWithPlaceholder from '../../components/ImageWithPlaceholder';\nimport PressBox from '../../components/PressBox';\nimport createStyleSheet from '../../styles/createStyleSheet';\nimport useUIKitTheme from '../../theme/useUIKitTheme';\nimport MessageContainer from './MessageContainer';\nimport type { GroupChannelMessageProps } from './index';\n\ntype Props = GroupChannelMessageProps<\n SendbirdFileMessage,\n {\n fetchThumbnailFromVideoSource: (uri: string) => Promise<{ path: string } | null>;\n }\n>;\n\nconst VideoFileMessage = (props: Props) => {\n const { onPress, onLongPress, variant = 'incoming' } = props;\n\n const { colors, palette, select } = useUIKitTheme();\n const uri = getAvailableUriFromFileMessage(props.message);\n const { thumbnail, loading } = useRetry(() => props.fetchThumbnailFromVideoSource(uri));\n\n return (\n <MessageContainer {...props}>\n <Box style={styles.container} backgroundColor={colors.ui.groupChannelMessage[variant].enabled.background}>\n <PressBox activeOpacity={0.8} onPress={onPress} onLongPress={onLongPress} style={styles.image}>\n {loading ? (\n <Box\n style={StyleSheet.absoluteFill}\n backgroundColor={select({ dark: palette.background400, light: palette.background100 })}\n />\n ) : (\n <ImageWithPlaceholder source={{ uri: thumbnail ?? 'invalid-image' }} style={StyleSheet.absoluteFill} />\n )}\n\n {(loading || thumbnail !== null) && (\n <Box style={StyleSheet.absoluteFill} alignItems={'center'} justifyContent={'center'}>\n <Icon\n icon={'play'}\n size={28}\n color={palette.onBackgroundLight02}\n containerStyle={[styles.playIcon, { backgroundColor: palette.onBackgroundDark01 }]}\n />\n </Box>\n )}\n </PressBox>\n {props.children}\n </Box>\n </MessageContainer>\n );\n};\n\nconst useRetry = (fetch: () => Promise<{ path: string } | null>, retryCount = 5) => {\n const [state, setState] = useState({ thumbnail: null as null | string, loading: true });\n const retryCountRef = useRef(0);\n const retryTimeoutRef = useRef<NodeJS.Timeout>();\n const fetchThumbnail = useRef(fetch);\n fetchThumbnail.current = fetch;\n\n useEffect(() => {\n if (!state.thumbnail) {\n const reloadReservation = () => {\n if (retryCountRef.current < retryCount) {\n retryTimeoutRef.current = setTimeout(() => {\n retryCountRef.current++;\n reloadReservation();\n fetchThumbnail.current().then((result) => {\n setState({ loading: false, thumbnail: result?.path ?? null });\n });\n }, retryCountRef.current * 5000);\n }\n };\n\n return reloadReservation();\n } else {\n return clearTimeout(retryTimeoutRef.current);\n }\n }, [state.thumbnail]);\n\n return state;\n};\nconst styles = createStyleSheet({\n container: {\n borderRadius: 16,\n overflow: 'hidden',\n },\n image: {\n maxWidth: 240,\n width: 240,\n height: 160,\n borderRadius: 16,\n overflow: 'hidden',\n },\n playIcon: {\n padding: 10,\n borderRadius: 50,\n },\n});\nexport default VideoFileMessage;\n"],"mappings":"AAAA,OAAOA,KAAK,IAAIC,SAAS,EAAEC,MAAM,EAAEC,QAAQ,QAAQ,OAAO;AAC1D,SAASC,UAAU,QAAQ,cAAc;AAGzC,SAASC,8BAA8B,QAAQ,uBAAuB;AAEtE,OAAOC,GAAG,MAAM,sBAAsB;AACtC,OAAOC,IAAI,MAAM,uBAAuB;AACxC,OAAOC,oBAAoB,MAAM,uCAAuC;AACxE,OAAOC,QAAQ,MAAM,2BAA2B;AAChD,OAAOC,gBAAgB,MAAM,+BAA+B;AAC5D,OAAOC,aAAa,MAAM,2BAA2B;AACrD,OAAOC,gBAAgB,MAAM,oBAAoB;AAUjD,MAAMC,gBAAgB,GAAIC,KAAY,IAAK;EACzC,MAAM;IAAEC,OAAO;IAAEC,WAAW;IAAEC,OAAO,GAAG;EAAW,CAAC,GAAGH,KAAK;EAE5D,MAAM;IAAEI,MAAM;IAAEC,OAAO;IAAEC;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C;UACJ,CAAC,EAAER,aAAa,CAACG,OAAO,GAAG,IAAI,CAAC;QAClC;MACF,CAAC;MAED,OAAOC,iBAAiB,EAAE;IAC5B,CAAC,MAAM;MACL,OAAOK,YAAY,CAACR,eAAe,CAACE,OAAO,CAAC;IAC9C;EACF,CAAC,EAAE,CAACL,KAAK,CAACpC,SAAS,CAAC,CAAC;EAErB,OAAOoC,KAAK;AACd,CAAC;AACD,MAAM9B,MAAM,GAAGnB,gBAAgB,CAAC;EAC9BoB,SAAS,EAAE;IACTyC,YAAY,EAAE,EAAE;IAChBC,QAAQ,EAAE;EACZ,CAAC;EACDnC,KAAK,EAAE;IACLoC,QAAQ,EAAE,GAAG;IACbC,KAAK,EAAE,GAAG;IACVC,MAAM,EAAE,GAAG;IACXJ,YAAY,EAAE,EAAE;IAChBC,QAAQ,EAAE;EACZ,CAAC;EACDrB,QAAQ,EAAE;IACRyB,OAAO,EAAE,EAAE;IACXL,YAAY,EAAE;EAChB;AACF,CAAC,CAAC;AACF,eAAe1D,gBAAgB"}
1
+ {"version":3,"names":["React","getAvailableUriFromFileMessage","Box","PressBox","VideoThumbnail","createStyleSheet","useUIKitTheme","MessageContainer","VideoFileMessage","props","onPress","onLongPress","variant","colors","uri","message","createElement","style","styles","container","backgroundColor","ui","groupChannelMessage","enabled","background","activeOpacity","image","videoSource","fetchThumbnailFromVideoSource","children","borderRadius","overflow","maxWidth","width","height","playIcon","padding"],"sources":["Message.file.video.tsx"],"sourcesContent":["import React from 'react';\n\nimport type { SendbirdFileMessage } from '@sendbird/uikit-utils';\nimport { getAvailableUriFromFileMessage } from '@sendbird/uikit-utils';\n\nimport Box from '../../components/Box';\nimport PressBox from '../../components/PressBox';\nimport { VideoThumbnail } from '../../components/VideoThumbnail';\nimport createStyleSheet from '../../styles/createStyleSheet';\nimport useUIKitTheme from '../../theme/useUIKitTheme';\nimport MessageContainer from './MessageContainer';\nimport type { GroupChannelMessageProps } from './index';\n\ntype Props = GroupChannelMessageProps<\n SendbirdFileMessage,\n { fetchThumbnailFromVideoSource: (uri: string) => Promise<{ path: string } | null> }\n>;\n\nconst VideoFileMessage = (props: Props) => {\n const { onPress, onLongPress, variant = 'incoming' } = props;\n\n const { colors } = useUIKitTheme();\n const uri = getAvailableUriFromFileMessage(props.message);\n\n return (\n <MessageContainer {...props}>\n <Box style={styles.container} backgroundColor={colors.ui.groupChannelMessage[variant].enabled.background}>\n <PressBox activeOpacity={0.8} onPress={onPress} onLongPress={onLongPress}>\n <VideoThumbnail\n style={styles.image}\n videoSource={uri}\n fetchThumbnailFromVideoSource={props.fetchThumbnailFromVideoSource}\n />\n </PressBox>\n {props.children}\n </Box>\n </MessageContainer>\n );\n};\n\nconst styles = createStyleSheet({\n container: {\n borderRadius: 16,\n overflow: 'hidden',\n },\n image: {\n maxWidth: 240,\n width: 240,\n height: 160,\n borderRadius: 16,\n overflow: 'hidden',\n },\n playIcon: {\n padding: 10,\n borderRadius: 50,\n },\n});\nexport default VideoFileMessage;\n"],"mappings":"AAAA,OAAOA,KAAK,MAAM,OAAO;AAGzB,SAASC,8BAA8B,QAAQ,uBAAuB;AAEtE,OAAOC,GAAG,MAAM,sBAAsB;AACtC,OAAOC,QAAQ,MAAM,2BAA2B;AAChD,SAASC,cAAc,QAAQ,iCAAiC;AAChE,OAAOC,gBAAgB,MAAM,+BAA+B;AAC5D,OAAOC,aAAa,MAAM,2BAA2B;AACrD,OAAOC,gBAAgB,MAAM,oBAAoB;AAQjD,MAAMC,gBAAgB,GAAIC,KAAY,IAAK;EACzC,MAAM;IAAEC,OAAO;IAAEC,WAAW;IAAEC,OAAO,GAAG;EAAW,CAAC,GAAGH,KAAK;EAE5D,MAAM;IAAEI;EAAO,CAAC,GAAGP,aAAa,EAAE;EAClC,MAAMQ,GAAG,GAAGb,8BAA8B,CAACQ,KAAK,CAACM,OAAO,CAAC;EAEzD,oBACEf,KAAA,CAAAgB,aAAA,CAACT,gBAAgB,EAAKE,KAAK,eACzBT,KAAA,CAAAgB,aAAA,CAACd,GAAG;IAACe,KAAK,EAAEC,MAAM,CAACC,SAAU;IAACC,eAAe,EAAEP,MAAM,CAACQ,EAAE,CAACC,mBAAmB,CAACV,OAAO,CAAC,CAACW,OAAO,CAACC;EAAW,gBACvGxB,KAAA,CAAAgB,aAAA,CAACb,QAAQ;IAACsB,aAAa,EAAE,GAAI;IAACf,OAAO,EAAEA,OAAQ;IAACC,WAAW,EAAEA;EAAY,gBACvEX,KAAA,CAAAgB,aAAA,CAACZ,cAAc;IACba,KAAK,EAAEC,MAAM,CAACQ,KAAM;IACpBC,WAAW,EAAEb,GAAI;IACjBc,6BAA6B,EAAEnB,KAAK,CAACmB;EAA8B,EACnE,CACO,EACVnB,KAAK,CAACoB,QAAQ,CACX,CACW;AAEvB,CAAC;AAED,MAAMX,MAAM,GAAGb,gBAAgB,CAAC;EAC9Bc,SAAS,EAAE;IACTW,YAAY,EAAE,EAAE;IAChBC,QAAQ,EAAE;EACZ,CAAC;EACDL,KAAK,EAAE;IACLM,QAAQ,EAAE,GAAG;IACbC,KAAK,EAAE,GAAG;IACVC,MAAM,EAAE,GAAG;IACXJ,YAAY,EAAE,EAAE;IAChBC,QAAQ,EAAE;EACZ,CAAC;EACDI,QAAQ,EAAE;IACRC,OAAO,EAAE,EAAE;IACXN,YAAY,EAAE;EAChB;AACF,CAAC,CAAC;AACF,eAAetB,gBAAgB"}
@@ -21,7 +21,8 @@ MessageContainer.Incoming = function MessageContainerIncoming(_ref) {
21
21
  groupedWithPrev,
22
22
  message,
23
23
  onPressAvatar,
24
- strings
24
+ strings,
25
+ parentMessage
25
26
  } = _ref;
26
27
  const {
27
28
  colors
@@ -41,7 +42,7 @@ MessageContainer.Incoming = function MessageContainerIncoming(_ref) {
41
42
  uri: (_message$sender = message.sender) === null || _message$sender === void 0 ? void 0 : _message$sender.profileUrl
42
43
  }))), /*#__PURE__*/React.createElement(Box, {
43
44
  flexShrink: 1
44
- }, !groupedWithPrev && /*#__PURE__*/React.createElement(Box, {
45
+ }, parentMessage, !groupedWithPrev && !message.parentMessage && /*#__PURE__*/React.createElement(Box, {
45
46
  marginLeft: 12,
46
47
  marginBottom: 4
47
48
  }, (message.isFileMessage() || message.isUserMessage()) && /*#__PURE__*/React.createElement(Text, {
@@ -66,13 +67,14 @@ MessageContainer.Outgoing = function MessageContainerOutgoing(_ref2) {
66
67
  message,
67
68
  groupedWithNext,
68
69
  strings,
69
- sendingStatus
70
+ sendingStatus,
71
+ parentMessage
70
72
  } = _ref2;
71
73
  const {
72
74
  colors
73
75
  } = useUIKitTheme();
74
76
  const color = colors.ui.groupChannelMessage.outgoing;
75
- return /*#__PURE__*/React.createElement(Box, {
77
+ return /*#__PURE__*/React.createElement(Box, null, parentMessage, /*#__PURE__*/React.createElement(Box, {
76
78
  flexDirection: 'row',
77
79
  justifyContent: 'flex-end',
78
80
  alignItems: 'flex-end'
@@ -89,7 +91,7 @@ MessageContainer.Outgoing = function MessageContainerOutgoing(_ref2) {
89
91
  color: color.enabled.textTime
90
92
  }, (strings === null || strings === void 0 ? void 0 : strings.sentDate) ?? getMessageTimeFormat(new Date(message.createdAt))))), /*#__PURE__*/React.createElement(Box, {
91
93
  style: styles.bubble
92
- }, children));
94
+ }, children)));
93
95
  };
94
96
  const styles = createStyleSheet({
95
97
  bubble: {
@@ -1 +1 @@
1
- {"version":3,"names":["React","Pressable","getMessageTimeFormat","Box","Text","createStyleSheet","useUIKitTheme","Avatar","MessageContainer","props","variant","createElement","Incoming","Outgoing","MessageContainerIncoming","_ref","_message$sender","children","groupedWithNext","groupedWithPrev","message","onPressAvatar","strings","colors","color","ui","groupChannelMessage","incoming","flexDirection","justifyContent","alignItems","width","marginRight","isFileMessage","isUserMessage","onPress","size","uri","sender","profileUrl","flexShrink","marginLeft","marginBottom","caption1","enabled","textSenderName","numberOfLines","senderName","nickname","style","styles","bubble","caption4","textTime","sentDate","Date","createdAt","MessageContainerOutgoing","_ref2","sendingStatus","outgoing","maxWidth","overflow"],"sources":["MessageContainer.tsx"],"sourcesContent":["import React from 'react';\nimport { Pressable } from 'react-native';\n\nimport type { SendbirdMessage } from '@sendbird/uikit-utils';\nimport { getMessageTimeFormat } from '@sendbird/uikit-utils';\n\nimport Box from '../../components/Box';\nimport Text from '../../components/Text';\nimport createStyleSheet from '../../styles/createStyleSheet';\nimport useUIKitTheme from '../../theme/useUIKitTheme';\nimport Avatar from '../Avatar';\nimport type { GroupChannelMessageProps } from './index';\n\ntype Props = GroupChannelMessageProps<SendbirdMessage>;\n\nconst MessageContainer = (props: Props) => {\n if (props.variant === 'incoming') {\n return <MessageContainer.Incoming {...props} />;\n } else {\n return <MessageContainer.Outgoing {...props} />;\n }\n};\n\nMessageContainer.Incoming = function MessageContainerIncoming({\n children,\n groupedWithNext,\n groupedWithPrev,\n message,\n onPressAvatar,\n strings,\n}: Props) {\n const { colors } = useUIKitTheme();\n const color = colors.ui.groupChannelMessage.incoming;\n\n return (\n <Box flexDirection={'row'} justifyContent={'flex-start'} alignItems={'flex-end'}>\n <Box width={26} marginRight={12}>\n {(message.isFileMessage() || message.isUserMessage()) && !groupedWithNext && (\n <Pressable onPress={onPressAvatar}>\n <Avatar size={26} uri={message.sender?.profileUrl} />\n </Pressable>\n )}\n </Box>\n <Box flexShrink={1}>\n {!groupedWithPrev && (\n <Box marginLeft={12} marginBottom={4}>\n {(message.isFileMessage() || message.isUserMessage()) && (\n <Text caption1 color={color.enabled.textSenderName} numberOfLines={1}>\n {strings?.senderName ?? message.sender.nickname}\n </Text>\n )}\n </Box>\n )}\n\n <Box flexDirection={'row'} alignItems={'flex-end'}>\n <Box style={styles.bubble}>{children}</Box>\n {!groupedWithNext && (\n <Box marginLeft={4}>\n <Text caption4 color={color.enabled.textTime}>\n {strings?.sentDate ?? getMessageTimeFormat(new Date(message.createdAt))}\n </Text>\n </Box>\n )}\n </Box>\n </Box>\n </Box>\n );\n};\n\nMessageContainer.Outgoing = function MessageContainerOutgoing({\n children,\n message,\n groupedWithNext,\n strings,\n sendingStatus,\n}: Props) {\n const { colors } = useUIKitTheme();\n const color = colors.ui.groupChannelMessage.outgoing;\n\n return (\n <Box flexDirection={'row'} justifyContent={'flex-end'} alignItems={'flex-end'}>\n <Box flexDirection={'row'} alignItems={'flex-end'} justifyContent={'center'}>\n {sendingStatus && <Box marginRight={4}>{sendingStatus}</Box>}\n\n {!groupedWithNext && (\n <Box marginRight={4}>\n <Text caption4 color={color.enabled.textTime}>\n {strings?.sentDate ?? getMessageTimeFormat(new Date(message.createdAt))}\n </Text>\n </Box>\n )}\n </Box>\n <Box style={styles.bubble}>{children}</Box>\n </Box>\n );\n};\n\nconst styles = createStyleSheet({\n bubble: {\n maxWidth: 240,\n overflow: 'hidden',\n flexShrink: 1,\n },\n});\n\nexport default MessageContainer;\n"],"mappings":"AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,SAAS,QAAQ,cAAc;AAGxC,SAASC,oBAAoB,QAAQ,uBAAuB;AAE5D,OAAOC,GAAG,MAAM,sBAAsB;AACtC,OAAOC,IAAI,MAAM,uBAAuB;AACxC,OAAOC,gBAAgB,MAAM,+BAA+B;AAC5D,OAAOC,aAAa,MAAM,2BAA2B;AACrD,OAAOC,MAAM,MAAM,WAAW;AAK9B,MAAMC,gBAAgB,GAAIC,KAAY,IAAK;EACzC,IAAIA,KAAK,CAACC,OAAO,KAAK,UAAU,EAAE;IAChC,oBAAOV,KAAA,CAAAW,aAAA,CAACH,gBAAgB,CAACI,QAAQ,EAAKH,KAAK,CAAI;EACjD,CAAC,MAAM;IACL,oBAAOT,KAAA,CAAAW,aAAA,CAACH,gBAAgB,CAACK,QAAQ,EAAKJ,KAAK,CAAI;EACjD;AACF,CAAC;AAEDD,gBAAgB,CAACI,QAAQ,GAAG,SAASE,wBAAwBA,CAAAC,IAAA,EAOnD;EAAA,IAAAC,eAAA;EAAA,IAPoD;IAC5DC,QAAQ;IACRC,eAAe;IACfC,eAAe;IACfC,OAAO;IACPC,aAAa;IACbC;EACK,CAAC,GAAAP,IAAA;E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W,aAAA,CAACP,IAAI;IAACgD,QAAQ;IAAC5B,KAAK,EAAEA,KAAK,CAACoB,OAAO,CAACS;EAAS,GAC1C,CAAA/B,OAAO,aAAPA,OAAO,uBAAPA,OAAO,CAAEgC,QAAQ,KAAIpD,oBAAoB,CAAC,IAAIqD,IAAI,CAACnC,OAAO,CAACoC,SAAS,CAAC,CAAC,CAClE,CAEV,CACG,eACNxD,KAAA,CAAAW,aAAA,CAACR,GAAG;IAAC8C,KAAK,EAAEC,MAAM,CAACC;EAAO,GAAElC,QAAQ,CAAO,CACvC;AAEV,CAAC;AAED,MAAMiC,MAAM,GAAG7C,gBAAgB,CAAC;EAC9B8C,MAAM,EAAE;IACNU,QAAQ,EAAE,GAAG;IACbC,QAAQ,EAAE,QAAQ;IAClBtB,UAAU,EAAE;EACd;AACF,CAAC,CAAC;AAEF,eAAehC,gBAAgB"}
1
+ {"version":3,"names":["React","Pressable","getMessageTimeFormat","Box","Text","createStyleSheet","useUIKitTheme","Avatar","MessageContainer","props","variant","createElement","Incoming","Outgoing","MessageContainerIncoming","_ref","_message$sender","children","groupedWithNext","groupedWithPrev","message","onPressAvatar","strings","parentMessage","colors","color","ui","groupChannelMessage","incoming","flexDirection","justifyContent","alignItems","width","marginRight","isFileMessage","isUserMessage","onPress","size","uri","sender","profileUrl","flexShrink","marginLeft","marginBottom","caption1","enabled","textSenderName","numberOfLines","senderName","nickname","style","styles","bubble","caption4","textTime","sentDate","Date","createdAt","MessageContainerOutgoing","_ref2","sendingStatus","outgoing","maxWidth","overflow"],"sources":["MessageContainer.tsx"],"sourcesContent":["import React from 'react';\nimport { Pressable } from 'react-native';\n\nimport type { SendbirdMessage } from '@sendbird/uikit-utils';\nimport { getMessageTimeFormat } from '@sendbird/uikit-utils';\n\nimport Box from '../../components/Box';\nimport Text from '../../components/Text';\nimport createStyleSheet from '../../styles/createStyleSheet';\nimport useUIKitTheme from '../../theme/useUIKitTheme';\nimport Avatar from '../Avatar';\nimport type { GroupChannelMessageProps } from './index';\n\ntype Props = GroupChannelMessageProps<SendbirdMessage>;\n\nconst MessageContainer = (props: Props) => {\n if (props.variant === 'incoming') {\n return <MessageContainer.Incoming {...props} />;\n } else {\n return <MessageContainer.Outgoing {...props} />;\n }\n};\n\nMessageContainer.Incoming = function MessageContainerIncoming({\n children,\n groupedWithNext,\n groupedWithPrev,\n message,\n onPressAvatar,\n strings,\n parentMessage,\n}: Props) {\n const { colors } = useUIKitTheme();\n const color = colors.ui.groupChannelMessage.incoming;\n\n return (\n <Box flexDirection={'row'} justifyContent={'flex-start'} alignItems={'flex-end'}>\n <Box width={26} marginRight={12}>\n {(message.isFileMessage() || message.isUserMessage()) && !groupedWithNext && (\n <Pressable onPress={onPressAvatar}>\n <Avatar size={26} uri={message.sender?.profileUrl} />\n </Pressable>\n )}\n </Box>\n <Box flexShrink={1}>\n {parentMessage}\n {!groupedWithPrev && !message.parentMessage && (\n <Box marginLeft={12} marginBottom={4}>\n {(message.isFileMessage() || message.isUserMessage()) && (\n <Text caption1 color={color.enabled.textSenderName} numberOfLines={1}>\n {strings?.senderName ?? message.sender.nickname}\n </Text>\n )}\n </Box>\n )}\n\n <Box flexDirection={'row'} alignItems={'flex-end'}>\n <Box style={styles.bubble}>{children}</Box>\n {!groupedWithNext && (\n <Box marginLeft={4}>\n <Text caption4 color={color.enabled.textTime}>\n {strings?.sentDate ?? getMessageTimeFormat(new Date(message.createdAt))}\n </Text>\n </Box>\n )}\n </Box>\n </Box>\n </Box>\n );\n};\n\nMessageContainer.Outgoing = function MessageContainerOutgoing({\n children,\n message,\n groupedWithNext,\n strings,\n sendingStatus,\n parentMessage,\n}: Props) {\n const { colors } = useUIKitTheme();\n const color = colors.ui.groupChannelMessage.outgoing;\n\n return (\n <Box>\n {parentMessage}\n <Box flexDirection={'row'} justifyContent={'flex-end'} alignItems={'flex-end'}>\n <Box flexDirection={'row'} alignItems={'flex-end'} justifyContent={'center'}>\n {sendingStatus && <Box marginRight={4}>{sendingStatus}</Box>}\n {!groupedWithNext && (\n <Box marginRight={4}>\n <Text caption4 color={color.enabled.textTime}>\n {strings?.sentDate ?? getMessageTimeFormat(new Date(message.createdAt))}\n </Text>\n </Box>\n )}\n </Box>\n <Box style={styles.bubble}>{children}</Box>\n </Box>\n </Box>\n );\n};\n\nconst styles = createStyleSheet({\n bubble: {\n maxWidth: 240,\n overflow: 'hidden',\n flexShrink: 1,\n },\n});\n\nexport default MessageContainer;\n"],"mappings":"AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,SAAS,QAAQ,cAAc;AAGxC,SAASC,oBAAoB,QAAQ,uBAAuB;AAE5D,OAAOC,GAAG,MAAM,sBAAsB;AACtC,OAAOC,IAAI,MAAM,uBAAuB;AACxC,OAAOC,gBAAgB,MAAM,+BAA+B;AAC5D,OAAOC,aAAa,MAAM,2BAA2B;AACrD,OAAOC,MAAM,MAAM,WAAW;AAK9B,MAAMC,gBAAgB,GAAIC,KAAY,IAAK;EACzC,IAAIA,KAAK,CAACC,OAAO,KAAK,UAAU,EAAE;IAChC,oBAAOV,KAAA,CAAAW,aAAA,CAACH,gBAAgB,CAACI,QAAQ,EAAKH,KAAK,CAAI;EACjD,CAAC,MAAM;IACL,oBAAOT,KAAA,CAAAW,aAAA,CAACH,gBAAgB,CAACK,QAAQ,EAAKJ,KAAK,CAAI;EACjD;AACF,CAAC;AAEDD,gBAAgB,CAACI,QAAQ,GAAG,SAASE,wBAAwBA,CAAAC,IAAA,EAQnD;EAAA,IAAAC,eAAA;EAAA,IARoD;IAC5DC,QAAQ;IACRC,eAAe;IACfC,eAAe;IACfC,OAAO;IACPC,aAAa;IACbC,OAAO;IACPC;EACK,CAAC,GAAAR,IAAA;EACN,MAAM;IAAES;EAAO,CAAC,GAAGlB,aAAa,EAAE;EAClC,MAAMmB,KAAK,GAAGD,MAAM,CAACE,EAAE,CAACC,mBAAmB,CAACC,QAAQ;EAEpD,oBACE5B,KAAA,CAAAW,aAAA,CAACR,GAAG;IAAC0B,aAAa,EA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AAO,CAACS;EAAS,GAC1C,CAAAhC,OAAO,aAAPA,OAAO,uBAAPA,OAAO,CAAEiC,QAAQ,KAAIrD,oBAAoB,CAAC,IAAIsD,IAAI,CAACpC,OAAO,CAACqC,SAAS,CAAC,CAAC,CAClE,CAEV,CACG,eACNzD,KAAA,CAAAW,aAAA,CAACR,GAAG;IAAC+C,KAAK,EAAEC,MAAM,CAACC;EAAO,GAAEnC,QAAQ,CAAO,CACvC,CACF;AAEV,CAAC;AAED,MAAMkC,MAAM,GAAG9C,gBAAgB,CAAC;EAC9B+C,MAAM,EAAE;IACNU,QAAQ,EAAE,GAAG;IACbC,QAAQ,EAAE,QAAQ;IAClBtB,UAAU,EAAE;EACd;AACF,CAAC,CAAC;AAEF,eAAejC,gBAAgB"}
@@ -28,7 +28,7 @@ const MessageOpenGraph = _ref => {
28
28
  } = _ref2;
29
29
  return /*#__PURE__*/React.createElement(Box, {
30
30
  backgroundColor: pressed ? color.pressed.background : color.enabled.background
31
- }, Boolean(ogMetaData.defaultImage) && /*#__PURE__*/React.createElement(ImageWithPlaceholder, {
31
+ }, !!ogMetaData.defaultImage && /*#__PURE__*/React.createElement(ImageWithPlaceholder, {
32
32
  style: styles.ogImage,
33
33
  source: {
34
34
  uri: ogMetaData.defaultImage.url
@@ -44,7 +44,7 @@ const MessageOpenGraph = _ref => {
44
44
  body2: true,
45
45
  color: colors.onBackground01,
46
46
  style: styles.ogTitle
47
- }, ogMetaData.title), Boolean(ogMetaData.description) && /*#__PURE__*/React.createElement(Text, {
47
+ }, ogMetaData.title), !!ogMetaData.description && /*#__PURE__*/React.createElement(Text, {
48
48
  numberOfLines: 1,
49
49
  caption2: true,
50
50
  color: colors.onBackground01,
@@ -1 +1 @@
1
- {"version":3,"names":["React","Box","ImageWithPlaceholder","PressBox","Text","createStyleSheet","useUIKitTheme","MessageOpenGraph","_ref","onPressURL","onLongPress","ogMetaData","variant","palette","select","colors","color","ui","groupChannelMessage","createElement","activeOpacity","onPress","url","_ref2","pressed","backgroundColor","background","enabled","Boolean","defaultImage","style","styles","ogImage","source","uri","ogContainer","dark","background400","light","background100","numberOfLines","body2","onBackground01","ogTitle","title","description","caption2","ogDesc","onBackground02","overflow","paddingHorizontal","paddingTop","paddingBottom","maxWidth","width","height","ogUrl","marginBottom","lineHeight"],"sources":["MessageOpenGraph.tsx"],"sourcesContent":["import React from 'react';\n\nimport type { SendbirdUserMessage } from '@sendbird/uikit-utils';\n\nimport Box from '../../components/Box';\nimport ImageWithPlaceholder from '../../components/ImageWithPlaceholder';\nimport PressBox from '../../components/PressBox';\nimport Text from '../../components/Text';\nimport createStyleSheet from '../../styles/createStyleSheet';\nimport useUIKitTheme from '../../theme/useUIKitTheme';\n\nconst MessageOpenGraph = ({\n onPressURL,\n onLongPress,\n ogMetaData,\n variant,\n}: {\n ogMetaData: Required<SendbirdUserMessage>['ogMetaData'];\n variant: 'outgoing' | 'incoming';\n onPressURL?: (url: string) => void;\n onLongPress?: () => void;\n}) => {\n const { palette, select, colors } = useUIKitTheme();\n const color = colors.ui.groupChannelMessage[variant];\n\n return (\n <PressBox\n activeOpacity={0.85}\n onPress={() => typeof ogMetaData?.url === 'string' && onPressURL?.(ogMetaData.url)}\n onLongPress={onLongPress}\n >\n {({ pressed }) => (\n <Box backgroundColor={pressed ? color.pressed.background : color.enabled.background}>\n {Boolean(ogMetaData.defaultImage) && (\n <ImageWithPlaceholder style={styles.ogImage} source={{ uri: ogMetaData.defaultImage.url }} />\n )}\n\n <Box\n style={styles.ogContainer}\n backgroundColor={select({ dark: palette.background400, light: palette.background100 })}\n >\n <Text numberOfLines={3} body2 color={colors.onBackground01} style={styles.ogTitle}>\n {ogMetaData.title}\n </Text>\n {Boolean(ogMetaData.description) && (\n <Text numberOfLines={1} caption2 color={colors.onBackground01} style={styles.ogDesc}>\n {ogMetaData.description}\n </Text>\n )}\n <Text numberOfLines={1} caption2 color={colors.onBackground02}>\n {ogMetaData.url}\n </Text>\n </Box>\n </Box>\n )}\n </PressBox>\n );\n};\n\nconst styles = createStyleSheet({\n ogContainer: {\n overflow: 'hidden',\n paddingHorizontal: 12,\n paddingTop: 8,\n paddingBottom: 12,\n },\n ogImage: {\n maxWidth: 240,\n width: 240,\n height: 136,\n },\n ogUrl: {\n marginBottom: 4,\n },\n ogTitle: {\n marginBottom: 4,\n },\n ogDesc: {\n lineHeight: 14,\n marginBottom: 8,\n },\n});\n\nexport default MessageOpenGraph;\n"],"mappings":"AAAA,OAAOA,KAAK,MAAM,OAAO;AAIzB,OAAOC,GAAG,MAAM,sBAAsB;AACtC,OAAOC,oBAAoB,MAAM,uCAAuC;AACxE,OAAOC,QAAQ,MAAM,2BAA2B;AAChD,OAAOC,IAAI,MAAM,uBAAuB;AACxC,OAAOC,gBAAgB,MAAM,+BAA+B;AAC5D,OAAOC,aAAa,MAAM,2BAA2B;AAErD,MAAMC,gBAAgB,GAAGC,IAAA,IAUnB;EAAA,IAVoB;IACxBC,UAAU;IACVC,WAAW;IACXC,UAAU;IACVC;EAMF,CAAC,GAAAJ,IAAA;EACC,MAAM;IAAEK,OAAO;IAAEC,MAAM;IAAEC;EAAO,CAAC,GAAGT,aAAa,EAAE;EACnD,MAAMU,KAAK,GAAGD,MAAM,CAACE,EAAE,CAACC,mBAAmB,CAACN,OAAO,CAAC;EAEpD,oBACEZ,KAAA,CAAAmB,aAAA,CAAChB,QAAQ;IACPiB,aAAa,EAAE,IAAK;IACpBC,OAAO,EAAEA,CAAA,KAAM,QAAOV,UAAU,aAAVA,UAAU,uBAAVA,UAAU,CAAEW,GAAG,MAAK,QAAQ,KAAIb,UAAU,aAAVA,UAAU,uBAAVA,UAAU,CAAGE,UAAU,CAACW,GAAG,CAAC,CAAC;IACnFZ,WAAW,EAAEA;EAAY,GAExBa,KAAA;IAAA,IAAC;MAAEC;IAAQ,CAAC,GAAAD,KAAA;IAAA,oBACXvB,KAAA,CAAAmB,aAAA,CAAClB,GAAG;MAACwB,eAAe,EAAED,OAAO,GAAGR,KAAK,CAACQ,OA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UAAU,EAAE,CAAC;IACbC,aAAa,EAAE;EACjB,CAAC;EACDpB,OAAO,EAAE;IACPqB,QAAQ,EAAE,GAAG;IACbC,KAAK,EAAE,GAAG;IACVC,MAAM,EAAE;EACV,CAAC;EACDC,KAAK,EAAE;IACLC,YAAY,EAAE;EAChB,CAAC;EACDd,OAAO,EAAE;IACPc,YAAY,EAAE;EAChB,CAAC;EACDV,MAAM,EAAE;IACNW,UAAU,EAAE,EAAE;IACdD,YAAY,EAAE;EAChB;AACF,CAAC,CAAC;AAEF,eAAelD,gBAAgB"}
1
+ {"version":3,"names":["React","Box","ImageWithPlaceholder","PressBox","Text","createStyleSheet","useUIKitTheme","MessageOpenGraph","_ref","onPressURL","onLongPress","ogMetaData","variant","palette","select","colors","color","ui","groupChannelMessage","createElement","activeOpacity","onPress","url","_ref2","pressed","backgroundColor","background","enabled","defaultImage","style","styles","ogImage","source","uri","ogContainer","dark","background400","light","background100","numberOfLines","body2","onBackground01","ogTitle","title","description","caption2","ogDesc","onBackground02","overflow","paddingHorizontal","paddingTop","paddingBottom","maxWidth","width","height","ogUrl","marginBottom","lineHeight"],"sources":["MessageOpenGraph.tsx"],"sourcesContent":["import React from 'react';\n\nimport type { SendbirdUserMessage } from '@sendbird/uikit-utils';\n\nimport Box from '../../components/Box';\nimport ImageWithPlaceholder from '../../components/ImageWithPlaceholder';\nimport PressBox from '../../components/PressBox';\nimport Text from '../../components/Text';\nimport createStyleSheet from '../../styles/createStyleSheet';\nimport useUIKitTheme from '../../theme/useUIKitTheme';\n\nconst MessageOpenGraph = ({\n onPressURL,\n onLongPress,\n ogMetaData,\n variant,\n}: {\n ogMetaData: NonNullable<SendbirdUserMessage['ogMetaData']>;\n variant: 'outgoing' | 'incoming';\n onPressURL?: (url: string) => void;\n onLongPress?: () => void;\n}) => {\n const { palette, select, colors } = useUIKitTheme();\n const color = colors.ui.groupChannelMessage[variant];\n\n return (\n <PressBox\n activeOpacity={0.85}\n onPress={() => typeof ogMetaData?.url === 'string' && onPressURL?.(ogMetaData.url)}\n onLongPress={onLongPress}\n >\n {({ pressed }) => (\n <Box backgroundColor={pressed ? color.pressed.background : color.enabled.background}>\n {!!ogMetaData.defaultImage && (\n <ImageWithPlaceholder style={styles.ogImage} source={{ uri: ogMetaData.defaultImage.url }} />\n )}\n\n <Box\n style={styles.ogContainer}\n backgroundColor={select({ dark: palette.background400, light: palette.background100 })}\n >\n <Text numberOfLines={3} body2 color={colors.onBackground01} style={styles.ogTitle}>\n {ogMetaData.title}\n </Text>\n {!!ogMetaData.description && (\n <Text numberOfLines={1} caption2 color={colors.onBackground01} style={styles.ogDesc}>\n {ogMetaData.description}\n </Text>\n )}\n <Text numberOfLines={1} caption2 color={colors.onBackground02}>\n {ogMetaData.url}\n </Text>\n </Box>\n </Box>\n )}\n </PressBox>\n );\n};\n\nconst styles = createStyleSheet({\n ogContainer: {\n overflow: 'hidden',\n paddingHorizontal: 12,\n paddingTop: 8,\n paddingBottom: 12,\n },\n ogImage: {\n maxWidth: 240,\n width: 240,\n height: 136,\n },\n ogUrl: {\n marginBottom: 4,\n },\n ogTitle: {\n marginBottom: 4,\n },\n ogDesc: {\n lineHeight: 14,\n marginBottom: 8,\n },\n});\n\nexport default MessageOpenGraph;\n"],"mappings":"AAAA,OAAOA,KAAK,MAAM,OAAO;AAIzB,OAAOC,GAAG,MAAM,sBAAsB;AACtC,OAAOC,oBAAoB,MAAM,uCAAuC;AACxE,OAAOC,QAAQ,MAAM,2BAA2B;AAChD,OAAOC,IAAI,MAAM,uBAAuB;AACxC,OAAOC,gBAAgB,MAAM,+BAA+B;AAC5D,OAAOC,aAAa,MAAM,2BAA2B;AAErD,MAAMC,gBAAgB,GAAGC,IAAA,IAUnB;EAAA,IAVoB;IACxBC,UAAU;IACVC,WAAW;IACXC,UAAU;IACVC;EAMF,CAAC,GAAAJ,IAAA;EACC,MAAM;IAAEK,OAAO;IAAEC,MAAM;IAAEC;EAAO,CAAC,GAAGT,aAAa,EAAE;EACnD,MAAM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A,CAACf,IAAI;MAACmC,aAAa,EAAE,CAAE;MAACM,QAAQ;MAAC7B,KAAK,EAAED,MAAM,CAAC0B,cAAe;MAACZ,KAAK,EAAEC,MAAM,CAACgB;IAAO,GACjFnC,UAAU,CAACiC,WAAW,CAE1B,eACD5C,KAAA,CAAAmB,aAAA,CAACf,IAAI;MAACmC,aAAa,EAAE,CAAE;MAACM,QAAQ;MAAC7B,KAAK,EAAED,MAAM,CAACgC;IAAe,GAC3DpC,UAAU,CAACW,GAAG,CACV,CACH,CACF;EAAA,CACP,CACQ;AAEf,CAAC;AAED,MAAMQ,MAAM,GAAGzB,gBAAgB,CAAC;EAC9B6B,WAAW,EAAE;IACXc,QAAQ,EAAE,QAAQ;IAClBC,iBAAiB,EAAE,EAAE;IACrBC,UAAU,EAAE,CAAC;IACbC,aAAa,EAAE;EACjB,CAAC;EACDpB,OAAO,EAAE;IACPqB,QAAQ,EAAE,GAAG;IACbC,KAAK,EAAE,GAAG;IACVC,MAAM,EAAE;EACV,CAAC;EACDC,KAAK,EAAE;IACLC,YAAY,EAAE;EAChB,CAAC;EACDd,OAAO,EAAE;IACPc,YAAY,EAAE;EAChB,CAAC;EACDV,MAAM,EAAE;IACNW,UAAU,EAAE,EAAE;IACdD,YAAY,EAAE;EAChB;AACF,CAAC,CAAC;AAEF,eAAejD,gBAAgB"}
@@ -1 +1 @@
1
- {"version":3,"names":["AdminMessage","FileMessage","ImageFileMessage","VideoFileMessage","UnknownMessage","UserMessage","OpenGraphUser","GroupChannelMessage","User","File","ImageFile","VideoFile","Admin","Unknown"],"sources":["index.ts"],"sourcesContent":["import type React from 'react';\n\nimport type { SendbirdGroupChannel, SendbirdMessage, SendbirdUser } 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 OpenGraphUser from './Message.user.og';\n\nexport type GroupChannelMessageProps<T extends SendbirdMessage, AdditionalProps = unknown> = {\n channel: SendbirdGroupChannel;\n message: T;\n variant?: 'outgoing' | 'incoming';\n strings?: {\n senderName?: string;\n sentDate?: string;\n edited?: string;\n fileName?: string;\n unknownTitle?: string;\n unknownDescription?: string;\n };\n\n children?: React.ReactNode;\n sendingStatus?: React.ReactNode;\n\n groupedWithPrev: boolean;\n groupedWithNext: boolean;\n onPress?: () => void;\n onLongPress?: () => void;\n onPressAvatar?: () => void;\n onPressURL?: (url: string) => void;\n onPressMentionedUser?: (mentionedUser?: SendbirdUser) => void;\n} & AdditionalProps;\n\nconst GroupChannelMessage = {\n User: UserMessage,\n OpenGraphUser: OpenGraphUser,\n File: FileMessage,\n ImageFile: ImageFileMessage,\n VideoFile: VideoFileMessage,\n Admin: AdminMessage,\n Unknown: UnknownMessage,\n};\n\nexport default GroupChannelMessage;\n"],"mappings":"AAIA,OAAOA,YAAY,MAAM,iBAAiB;AAC1C,OAAOC,WAAW,MAAM,gBAAgB;AACxC,OAAOC,gBAAgB,MAAM,sBAAsB;AACnD,OAAOC,gBAAgB,MAAM,sBAAsB;AACnD,OAAOC,cAAc,MAAM,mBAAmB;AAC9C,OAAOC,WAAW,MAAM,gBAAgB;AACxC,OAAOC,aAAa,MAAM,mBAAmB;AA2B7C,MAAMC,mBAAmB,GAAG;EAC1BC,IAAI,EAAEH,WAAW;EACjBC,aAAa,EAAEA,aAAa;EAC5BG,IAAI,EAAER,WAAW;EACjBS,SAAS,EAAER,gBAAgB;EAC3BS,SAAS,EAAER,gBAAgB;EAC3BS,KAAK,EAAEZ,YAAY;EACnBa,OAAO,EAAET;AACX,CAAC;AAED,eAAeG,mBAAmB"}
1
+ {"version":3,"names":["AdminMessage","FileMessage","ImageFileMessage","VideoFileMessage","UnknownMessage","UserMessage","OpenGraphUser","GroupChannelMessage","User","File","ImageFile","VideoFile","Admin","Unknown"],"sources":["index.ts"],"sourcesContent":["import type React from 'react';\n\nimport type { SendbirdGroupChannel, SendbirdMessage, SendbirdUser } 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 OpenGraphUser from './Message.user.og';\n\nexport type GroupChannelMessageProps<T extends SendbirdMessage, AdditionalProps = unknown> = {\n channel: SendbirdGroupChannel;\n message: T;\n variant?: 'outgoing' | 'incoming';\n strings?: {\n senderName?: string;\n sentDate?: string;\n edited?: string;\n fileName?: string;\n unknownTitle?: string;\n unknownDescription?: string;\n };\n\n children?: React.ReactNode;\n sendingStatus?: React.ReactNode;\n parentMessage?: React.ReactNode;\n\n groupedWithPrev: boolean;\n groupedWithNext: boolean;\n onPress?: () => void;\n onLongPress?: () => void;\n onPressAvatar?: () => void;\n onPressURL?: (url: string) => void;\n onPressMentionedUser?: (mentionedUser?: SendbirdUser) => void;\n} & AdditionalProps;\n\nconst GroupChannelMessage = {\n User: UserMessage,\n OpenGraphUser: OpenGraphUser,\n File: FileMessage,\n ImageFile: ImageFileMessage,\n VideoFile: VideoFileMessage,\n Admin: AdminMessage,\n Unknown: UnknownMessage,\n};\n\nexport default GroupChannelMessage;\n"],"mappings":"AAIA,OAAOA,YAAY,MAAM,iBAAiB;AAC1C,OAAOC,WAAW,MAAM,gBAAgB;AACxC,OAAOC,gBAAgB,MAAM,sBAAsB;AACnD,OAAOC,gBAAgB,MAAM,sBAAsB;AACnD,OAAOC,cAAc,MAAM,mBAAmB;AAC9C,OAAOC,WAAW,MAAM,gBAAgB;AACxC,OAAOC,aAAa,MAAM,mBAAmB;AA4B7C,MAAMC,mBAAmB,GAAG;EAC1BC,IAAI,EAAEH,WAAW;EACjBC,aAAa,EAAEA,aAAa;EAC5BG,IAAI,EAAER,WAAW;EACjBS,SAAS,EAAER,gBAAgB;EAC3BS,SAAS,EAAER,gBAAgB;EAC3BS,KAAK,EAAEZ,YAAY;EACnBa,OAAO,EAAET;AACX,CAAC;AAED,eAAeG,mBAAmB"}
@@ -7,12 +7,6 @@ import Text from '../../components/Text';
7
7
  import createStyleSheet from '../../styles/createStyleSheet';
8
8
  import useUIKitTheme from '../../theme/useUIKitTheme';
9
9
  import MessageContainer from './MessageContainer';
10
- const iconMapper = {
11
- audio: 'file-audio',
12
- image: 'photo',
13
- video: 'play',
14
- file: 'file-document'
15
- };
16
10
  const FileMessage = props => {
17
11
  const {
18
12
  colors
@@ -47,8 +41,8 @@ const FileMessage = props => {
47
41
  borderRadius: 8,
48
42
  alignItems: 'flex-start',
49
43
  backgroundColor: colors.background
50
- }, /*#__PURE__*/React.createElement(Icon, {
51
- icon: iconMapper[type],
44
+ }, /*#__PURE__*/React.createElement(Icon.File, {
45
+ fileType: type,
52
46
  size: 32
53
47
  })), /*#__PURE__*/React.createElement(Text, {
54
48
  body3: true,
@@ -1 +1 @@
1
- {"version":3,"names":["React","getFileTypeFromMessage","Box","Icon","PressBox","Text","createStyleSheet","useUIKitTheme","MessageContainer","iconMapper","audio","image","video","file","FileMessage","props","colors","onPress","onLongPress","rest","type","message","color","ui","openChannelMessage","default","createElement","_ref","_props$strings","pressed","padding","borderRadius","flexDirection","alignItems","justifyContent","style","backgroundColor","bubbleBackground","enabled","marginRight","background","icon","size","body3","numberOfLines","ellipsizeMode","textMsg","styles","fileName","strings","name","flexShrink"],"sources":["Message.file.tsx"],"sourcesContent":["import React from 'react';\n\nimport { SendbirdFileMessage, getFileTypeFromMessage } 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 MessageContainer from './MessageContainer';\nimport type { OpenChannelMessageProps } from './index';\n\nconst iconMapper = { audio: 'file-audio', image: 'photo', video: 'play', file: 'file-document' } as const;\n\ntype Props = {};\nconst FileMessage = (props: OpenChannelMessageProps<SendbirdFileMessage, Props>) => {\n const { colors } = useUIKitTheme();\n const { onPress, onLongPress, ...rest } = props;\n const type = getFileTypeFromMessage(props.message);\n const color = colors.ui.openChannelMessage.default;\n\n return (\n <MessageContainer {...rest}>\n <PressBox onPress={onPress} onLongPress={onLongPress}>\n {({ pressed }) => {\n return (\n <Box\n padding={8}\n borderRadius={8}\n flexDirection={'row'}\n alignItems={'center'}\n justifyContent={'flex-start'}\n style={{ backgroundColor: pressed ? color.pressed.bubbleBackground : color.enabled.bubbleBackground }}\n >\n <Box\n padding={4}\n marginRight={8}\n borderRadius={8}\n alignItems={'flex-start'}\n backgroundColor={colors.background}\n >\n <Icon icon={iconMapper[type]} size={32} />\n </Box>\n <Text\n body3\n numberOfLines={1}\n ellipsizeMode={'middle'}\n color={color.enabled.textMsg}\n style={styles.fileName}\n >\n {props.strings?.fileName || props.message.name}\n </Text>\n </Box>\n );\n }}\n </PressBox>\n </MessageContainer>\n );\n};\n\nconst styles = createStyleSheet({\n fileName: {\n flexShrink: 1,\n },\n});\nexport default FileMessage;\n"],"mappings":"AAAA,OAAOA,KAAK,MAAM,OAAO;AAEzB,SAA8BC,sBAAsB,QAAQ,uBAAuB;AAEnF,OAAOC,GAAG,MAAM,sBAAsB;AACtC,OAAOC,IAAI,MAAM,uBAAuB;AACxC,OAAOC,QAAQ,MAAM,2BAA2B;AAChD,OAAOC,IAAI,MAAM,uBAAuB;AACxC,OAAOC,gBAAgB,MAAM,+BAA+B;AAC5D,OAAOC,aAAa,MAAM,2BAA2B;AACrD,OAAOC,gBAAgB,MAAM,oBAAoB;AAGjD,MAAMC,UAAU,GAAG;EAAEC,KAAK,EAAE,YAAY;EAAEC,KAAK,EAAE,OAAO;EAAEC,KAAK,EAAE,MAAM;EAAEC,IAAI,EAAE;AAAgB,CAAU;AAGzG,MAAMC,WAAW,GAAIC,KAA0D,IAAK;EAClF,MAAM;IAAEC;EAAO,CAAC,GAAGT,aAAa,EAAE;EA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Q;MAC7BX,KAAK,EAAEY,MAAM,CAACC;IAAS,GAEtB,EAAApB,cAAA,GAAAb,KAAK,CAACkC,OAAO,cAAArB,cAAA,uBAAbA,cAAA,CAAeoB,QAAQ,KAAIjC,KAAK,CAACM,OAAO,CAAC6B,IAAI,CACzC,CACH;EAEV,CAAC,CACQ,CACM;AAEvB,CAAC;AAED,MAAMH,MAAM,GAAGzC,gBAAgB,CAAC;EAC9B0C,QAAQ,EAAE;IACRG,UAAU,EAAE;EACd;AACF,CAAC,CAAC;AACF,eAAerC,WAAW"}
1
+ {"version":3,"names":["React","getFileTypeFromMessage","Box","Icon","PressBox","Text","createStyleSheet","useUIKitTheme","MessageContainer","FileMessage","props","colors","onPress","onLongPress","rest","type","message","color","ui","openChannelMessage","default","createElement","_ref","_props$strings","pressed","padding","borderRadius","flexDirection","alignItems","justifyContent","style","backgroundColor","bubbleBackground","enabled","marginRight","background","File","fileType","size","body3","numberOfLines","ellipsizeMode","textMsg","styles","fileName","strings","name","flexShrink"],"sources":["Message.file.tsx"],"sourcesContent":["import React from 'react';\n\nimport { SendbirdFileMessage, getFileTypeFromMessage } 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 MessageContainer from './MessageContainer';\nimport type { OpenChannelMessageProps } from './index';\n\ntype Props = {};\nconst FileMessage = (props: OpenChannelMessageProps<SendbirdFileMessage, Props>) => {\n const { colors } = useUIKitTheme();\n const { onPress, onLongPress, ...rest } = props;\n const type = getFileTypeFromMessage(props.message);\n const color = colors.ui.openChannelMessage.default;\n\n return (\n <MessageContainer {...rest}>\n <PressBox onPress={onPress} onLongPress={onLongPress}>\n {({ pressed }) => {\n return (\n <Box\n padding={8}\n borderRadius={8}\n flexDirection={'row'}\n alignItems={'center'}\n justifyContent={'flex-start'}\n style={{ backgroundColor: pressed ? color.pressed.bubbleBackground : color.enabled.bubbleBackground }}\n >\n <Box\n padding={4}\n marginRight={8}\n borderRadius={8}\n alignItems={'flex-start'}\n backgroundColor={colors.background}\n >\n <Icon.File fileType={type} size={32} />\n </Box>\n <Text\n body3\n numberOfLines={1}\n ellipsizeMode={'middle'}\n color={color.enabled.textMsg}\n style={styles.fileName}\n >\n {props.strings?.fileName || props.message.name}\n </Text>\n </Box>\n );\n }}\n </PressBox>\n </MessageContainer>\n );\n};\n\nconst styles = createStyleSheet({\n fileName: {\n flexShrink: 1,\n },\n});\nexport default FileMessage;\n"],"mappings":"AAAA,OAAOA,KAAK,MAAM,OAAO;AAEzB,SAA8BC,sBAAsB,QAAQ,uBAAuB;AAEnF,OAAOC,GAAG,MAAM,sBAAsB;AACtC,OAAOC,IAAI,MAAM,uBAAuB;AACxC,OAAOC,QAAQ,MAAM,2BAA2B;AAChD,OAAOC,IAAI,MAAM,uBAAuB;AACxC,OAAOC,gBAAgB,MAAM,+BAA+B;AAC5D,OAAOC,aAAa,MAAM,2BAA2B;AACrD,OAAOC,gBAAgB,MAAM,oBAAoB;AAIjD,MAAMC,WAAW,GAAIC,KAA0D,IAAK;EAClF,MAAM;IAAEC;EAAO,CAAC,GAAGJ,aAAa,EAAE;EAClC,MAAM;IAAEK,OAAO;IAAEC,WAAW;IAAE,GAAGC;EAAK,CAAC,GAAGJ,KAAK;EAC/C,MAAMK,IAAI,GAAGd,sBAAsB,CAACS,KAAK,CAACM,OAAO,CAAC;EAClD,MAAMC,KAAK,GAAGN,MAAM,CAACO,EAAE,CAACC,kBAAkB,CAACC,OAAO;EAElD,oBACEpB,KAAA,CAAAqB,aAAA,CAACb,gBAAgB,EAAKM,IAAI,eACxBd,KAAA,CAAAqB,aAAA,CAACjB,QAAQ;IAACQ,OAAO,EAAEA,OAAQ;IAACC,WAAW,EAAEA;EAAY,GAClDS,IAAA,IAAiB;IAAA,IAAAC,cAAA;IAAA,IAAhB;MAAEC;IAAQ,CAAC,GAAAF,IAAA;IACX,oBACEtB,KAAA,CAAAqB,aAAA,CAACnB,GAAG;MACFuB,OAAO,EAAE,CAAE;MACXC,YAAY,EAAE,CAAE;MAChBC,aAAa,EAAE,KAAM;MACrBC,UAAU,EAAE,QAAS;MACrBC,cAAc,EAAE,YAAa;MAC7BC,KAAK,EAAE;QAAEC,eAAe,EAAEP,OAAO,GAAGP,KAAK,CAACO,OAAO,CAACQ,gBAAgB,GAAGf,KAAK,CAACgB,OAAO,CAACD;MAAiB;IAAE,gBAEtGhC,KAAA,CAAAqB,aAAA,CAACnB,GAAG;MACFuB,OAAO,EAAE,CAAE;MACXS,WAAW,EAAE,CAAE;MACfR,YAAY,EAAE,CAAE;MAChBE,UAAU,EAAE,YAAa;MACzBG,eAAe,EAAEpB,MAAM,CAACwB;IAAW,gBAEnCnC,KAAA,CAAAqB,aAAA,CAAClB,IAAI,CAACiC,IAAI;MAACC,QAAQ,EAAEtB,IAAK;MAACuB,IAAI,EAAE;IAAG,EAAG,CACnC,eACNtC,KAAA,CAAAqB,aAAA,CAAChB,IAAI;MACHkC,KAAK;MACLC,aAAa,EAAE,CAAE;MACjBC,aAAa,EAAE,QAAS;MACxBxB,KAAK,EAAEA,KAAK,CAACgB,OAAO,CAACS,OAAQ;MAC7BZ,KAAK,EAAEa,MAAM,CAACC;IAAS,GAEtB,EAAArB,cAAA,GAAAb,KAAK,CAACmC,OAAO,cAAAtB,cAAA,uBAAbA,cAAA,CAAeqB,QAAQ,KAAIlC,KAAK,CAACM,OAAO,CAAC8B,IAAI,CACzC,CACH;EAEV,CAAC,CACQ,CACM;AAEvB,CAAC;AAED,MAAMH,MAAM,GAAGrC,gBAAgB,CAAC;EAC9BsC,QAAQ,EAAE;IACRG,UAAU,EAAE;EACd;AACF,CAAC,CAAC;AACF,eAAetC,WAAW"}
@@ -1,98 +1,33 @@
1
- import React, { useEffect, useRef, useState } from 'react';
1
+ import React from 'react';
2
2
  import { getAvailableUriFromFileMessage } from '@sendbird/uikit-utils';
3
- import Box from '../../components/Box';
4
- import Icon from '../../components/Icon';
5
- import ImageWithPlaceholder from '../../components/ImageWithPlaceholder';
6
3
  import PressBox from '../../components/PressBox';
4
+ import { VideoThumbnail } from '../../components/VideoThumbnail';
7
5
  import createStyleSheet from '../../styles/createStyleSheet';
8
- import useUIKitTheme from '../../theme/useUIKitTheme';
9
6
  import MessageContainer from './MessageContainer';
10
7
  const VideoFileMessage = props => {
11
- const {
12
- colors,
13
- palette
14
- } = useUIKitTheme();
15
8
  const {
16
9
  onPress,
17
10
  onLongPress,
18
11
  ...rest
19
12
  } = props;
20
13
  const uri = getAvailableUriFromFileMessage(props.message);
21
- const {
22
- thumbnail,
23
- loading
24
- } = useRetry(() => props.fetchThumbnailFromVideoSource(uri));
25
14
  return /*#__PURE__*/React.createElement(MessageContainer, rest, /*#__PURE__*/React.createElement(PressBox, {
26
15
  style: styles.container,
27
16
  activeOpacity: 0.8,
28
17
  onPress: onPress,
29
18
  onLongPress: onLongPress
30
- }, /*#__PURE__*/React.createElement(Box, {
31
- borderRadius: 8,
32
- overflow: 'hidden',
33
- style: styles.container
34
- }, loading ? /*#__PURE__*/React.createElement(Box, {
35
- backgroundColor: colors.onBackground04,
36
- style: {
37
- width: '100%',
38
- height: '100%'
39
- }
40
- }) : /*#__PURE__*/React.createElement(ImageWithPlaceholder, {
41
- source: {
42
- uri: thumbnail ?? 'invalid-image'
43
- },
44
- width: '100%',
45
- height: '100%'
46
- }), (loading || thumbnail !== null) && /*#__PURE__*/React.createElement(Box, {
47
- style: styles.iconContainer,
48
- alignItems: 'center',
49
- justifyContent: 'center'
50
- }, /*#__PURE__*/React.createElement(Icon, {
51
- icon: 'play',
52
- size: 28,
53
- color: palette.onBackgroundLight02,
54
- containerStyle: [styles.playIcon, {
55
- backgroundColor: palette.onBackgroundDark01
56
- }]
57
- })))));
58
- };
59
- const useRetry = function (fetch) {
60
- let retryCount = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 5;
61
- const [state, setState] = useState({
62
- thumbnail: null,
63
- loading: true
64
- });
65
- const retryCountRef = useRef(0);
66
- const retryTimeoutRef = useRef();
67
- const fetchThumbnail = useRef(fetch);
68
- fetchThumbnail.current = fetch;
69
- useEffect(() => {
70
- if (!state.thumbnail) {
71
- const reloadReservation = () => {
72
- if (retryCountRef.current < retryCount) {
73
- retryTimeoutRef.current = setTimeout(() => {
74
- retryCountRef.current++;
75
- reloadReservation();
76
- fetchThumbnail.current().then(result => {
77
- setState({
78
- loading: false,
79
- thumbnail: (result === null || result === void 0 ? void 0 : result.path) ?? null
80
- });
81
- });
82
- }, retryCountRef.current * 5000);
83
- }
84
- };
85
- return reloadReservation();
86
- } else {
87
- return clearTimeout(retryTimeoutRef.current);
88
- }
89
- }, [state.thumbnail]);
90
- return state;
19
+ }, /*#__PURE__*/React.createElement(VideoThumbnail, {
20
+ style: styles.container,
21
+ videoSource: uri,
22
+ fetchThumbnailFromVideoSource: props.fetchThumbnailFromVideoSource
23
+ })));
91
24
  };
92
25
  const styles = createStyleSheet({
93
26
  container: {
94
27
  maxWidth: 296,
95
- height: 196
28
+ height: 196,
29
+ borderRadius: 8,
30
+ overflow: 'hidden'
96
31
  },
97
32
  iconContainer: {
98
33
  position: 'absolute',
@@ -1 +1 @@
1
- {"version":3,"names":["React","useEffect","useRef","useState","getAvailableUriFromFileMessage","Box","Icon","ImageWithPlaceholder","PressBox","createStyleSheet","useUIKitTheme","MessageContainer","VideoFileMessage","props","colors","palette","onPress","onLongPress","rest","uri","message","thumbnail","loading","useRetry","fetchThumbnailFromVideoSource","createElement","style","styles","container","activeOpacity","borderRadius","overflow","backgroundColor","onBackground04","width","height","source","iconContainer","alignItems","justifyContent","icon","size","color","onBackgroundLight02","containerStyle","playIcon","onBackgroundDark01","fetch","retryCount","arguments","length","undefined","state","setState","retryCountRef","retryTimeoutRef","fetchThumbnail","current","reloadReservation","setTimeout","then","result","path","clearTimeout","maxWidth","position","padding"],"sources":["Message.file.video.tsx"],"sourcesContent":["import React, { useEffect, useRef, useState } from 'react';\n\nimport type { SendbirdFileMessage } from '@sendbird/uikit-utils';\nimport { getAvailableUriFromFileMessage } from '@sendbird/uikit-utils';\n\nimport Box from '../../components/Box';\nimport Icon from '../../components/Icon';\nimport ImageWithPlaceholder from '../../components/ImageWithPlaceholder';\nimport PressBox from '../../components/PressBox';\nimport createStyleSheet from '../../styles/createStyleSheet';\nimport useUIKitTheme from '../../theme/useUIKitTheme';\nimport MessageContainer from './MessageContainer';\nimport type { OpenChannelMessageProps } from './index';\n\ntype Props = {\n fetchThumbnailFromVideoSource: (uri: string) => Promise<{ path: string } | null>;\n};\nconst VideoFileMessage = (props: OpenChannelMessageProps<SendbirdFileMessage, Props>) => {\n const { colors, palette } = useUIKitTheme();\n const { onPress, onLongPress, ...rest } = props;\n const uri = getAvailableUriFromFileMessage(props.message);\n const { thumbnail, loading } = useRetry(() => props.fetchThumbnailFromVideoSource(uri));\n\n return (\n <MessageContainer {...rest}>\n <PressBox style={styles.container} activeOpacity={0.8} onPress={onPress} onLongPress={onLongPress}>\n <Box borderRadius={8} overflow={'hidden'} style={styles.container}>\n {loading ? (\n <Box backgroundColor={colors.onBackground04} style={{ width: '100%', height: '100%' }} />\n ) : (\n <ImageWithPlaceholder source={{ uri: thumbnail ?? 'invalid-image' }} width={'100%'} height={'100%'} />\n )}\n\n {(loading || thumbnail !== null) && (\n <Box style={styles.iconContainer} alignItems={'center'} justifyContent={'center'}>\n <Icon\n icon={'play'}\n size={28}\n color={palette.onBackgroundLight02}\n containerStyle={[styles.playIcon, { backgroundColor: palette.onBackgroundDark01 }]}\n />\n </Box>\n )}\n </Box>\n </PressBox>\n </MessageContainer>\n );\n};\nconst useRetry = (fetch: () => Promise<{ path: string } | null>, retryCount = 5) => {\n const [state, setState] = useState({ thumbnail: null as null | string, loading: true });\n const retryCountRef = useRef(0);\n const retryTimeoutRef = useRef<NodeJS.Timeout>();\n const fetchThumbnail = useRef(fetch);\n fetchThumbnail.current = fetch;\n\n useEffect(() => {\n if (!state.thumbnail) {\n const reloadReservation = () => {\n if (retryCountRef.current < retryCount) {\n retryTimeoutRef.current = setTimeout(() => {\n retryCountRef.current++;\n reloadReservation();\n fetchThumbnail.current().then((result) => {\n setState({ loading: false, thumbnail: result?.path ?? null });\n });\n }, retryCountRef.current * 5000);\n }\n };\n\n return reloadReservation();\n } else {\n return clearTimeout(retryTimeoutRef.current);\n }\n }, [state.thumbnail]);\n\n return state;\n};\nconst styles = createStyleSheet({\n container: {\n maxWidth: 296,\n height: 196,\n },\n iconContainer: {\n position: 'absolute',\n width: '100%',\n height: '100%',\n },\n playIcon: {\n padding: 10,\n borderRadius: 50,\n },\n});\nexport default VideoFileMessage;\n"],"mappings":"AAAA,OAAOA,KAAK,IAAIC,SAAS,EAAEC,MAAM,EAAEC,QAAQ,QAAQ,OAAO;AAG1D,SAASC,8BAA8B,QAAQ,uBAAuB;AAEtE,OAAOC,GAAG,MAAM,sBAAsB;AACtC,OAAOC,IAAI,MAAM,uBAAuB;AACxC,OAAOC,oBAAoB,MAAM,uCAAuC;AACxE,OAAOC,QAAQ,MAAM,2BAA2B;AAChD,OAAOC,gBAAgB,MAAM,+BAA+B;AAC5D,OAAOC,aAAa,MAAM,2BAA2B;AACrD,OAAOC,gBAAgB,MAAM,oBAAoB;AAMjD,MAAMC,gBAAgB,GAAIC,KAA0D,IAAK;EACvF,MAAM;IAAEC,MAAM;IAAEC;EAAQ,CAAC,GAAGL,aAAa,EAAE;EAC3C,MAAM;IAAEM,OAAO;IAAEC,WAAW;IAAE,GAAGC;EAAK,CAAC,GAAGL,KAAK;EAC/C,MAAMM,GAAG,GAAGf,8BAA8B,CAACS,KAAK,CAACO,OAAO,CAAC;EACzD,MAAM;IAAEC,SAAS;IAAEC;EAAQ,CAAC,GAAGC,QAAQ,CAAC,MAAMV,KAAK,CAACW,6BAA6B,CAACL,GAAG,CAAC,CAAC;EAEvF,oBACEnB,KAAA,CAAAyB,aAAA,CAACd,gBAAgB,EAA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Aa,EAAE;IACb4B,QAAQ,EAAE,UAAU;IACpB/B,KAAK,EAAE,MAAM;IACbC,MAAM,EAAE;EACV,CAAC;EACDU,QAAQ,EAAE;IACRqB,OAAO,EAAE,EAAE;IACXpC,YAAY,EAAE;EAChB;AACF,CAAC,CAAC;AACF,eAAelB,gBAAgB"}
1
+ {"version":3,"names":["React","getAvailableUriFromFileMessage","PressBox","VideoThumbnail","createStyleSheet","MessageContainer","VideoFileMessage","props","onPress","onLongPress","rest","uri","message","createElement","style","styles","container","activeOpacity","videoSource","fetchThumbnailFromVideoSource","maxWidth","height","borderRadius","overflow","iconContainer","position","width","playIcon","padding"],"sources":["Message.file.video.tsx"],"sourcesContent":["import React from 'react';\n\nimport type { SendbirdFileMessage } from '@sendbird/uikit-utils';\nimport { getAvailableUriFromFileMessage } from '@sendbird/uikit-utils';\n\nimport PressBox from '../../components/PressBox';\nimport { VideoThumbnail } from '../../components/VideoThumbnail';\nimport createStyleSheet from '../../styles/createStyleSheet';\nimport MessageContainer from './MessageContainer';\nimport type { OpenChannelMessageProps } from './index';\n\ntype Props = {\n fetchThumbnailFromVideoSource: (uri: string) => Promise<{ path: string } | null>;\n};\n\nconst VideoFileMessage = (props: OpenChannelMessageProps<SendbirdFileMessage, Props>) => {\n const { onPress, onLongPress, ...rest } = props;\n const uri = getAvailableUriFromFileMessage(props.message);\n\n return (\n <MessageContainer {...rest}>\n <PressBox style={styles.container} activeOpacity={0.8} onPress={onPress} onLongPress={onLongPress}>\n <VideoThumbnail\n style={styles.container}\n videoSource={uri}\n fetchThumbnailFromVideoSource={props.fetchThumbnailFromVideoSource}\n />\n </PressBox>\n </MessageContainer>\n );\n};\n\nconst styles = createStyleSheet({\n container: {\n maxWidth: 296,\n height: 196,\n borderRadius: 8,\n overflow: 'hidden',\n },\n iconContainer: {\n position: 'absolute',\n width: '100%',\n height: '100%',\n },\n playIcon: {\n padding: 10,\n borderRadius: 50,\n },\n});\nexport default VideoFileMessage;\n"],"mappings":"AAAA,O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  color: colors.onBackground01
93
- }, props.message.ogMetaData.description), Boolean(props.message.ogMetaData.defaultImage) && /*#__PURE__*/React.createElement(ImageWithPlaceholder, {
93
+ }, props.message.ogMetaData.description), !!props.message.ogMetaData.defaultImage && /*#__PURE__*/React.createElement(ImageWithPlaceholder, {
94
94
  style: styles.ogImage,
95
95
  source: {
96
96
  uri: props.message.ogMetaData.defaultImage.url