@tellescope/chat 1.4.28 → 1.4.29
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/cjs/chat.js +1 -1
- package/lib/cjs/chat.js.map +1 -1
- package/lib/cjs/components.d.ts.map +1 -1
- package/lib/cjs/components.js +1 -1
- package/lib/cjs/components.js.map +1 -1
- package/lib/cjs/components.native.d.ts.map +1 -1
- package/lib/cjs/components.native.js +7 -2
- package/lib/cjs/components.native.js.map +1 -1
- package/lib/esm/chat.js +1 -1
- package/lib/esm/chat.js.map +1 -1
- package/lib/esm/components.d.ts.map +1 -1
- package/lib/esm/components.js +1 -1
- package/lib/esm/components.js.map +1 -1
- package/lib/esm/components.native.d.ts +1 -1
- package/lib/esm/components.native.d.ts.map +1 -1
- package/lib/esm/components.native.js +7 -2
- package/lib/esm/components.native.js.map +1 -1
- package/lib/tsconfig.tsbuildinfo +1 -1
- package/package.json +2 -2
- package/src/chat.tsx +1 -1
- package/src/components.native.tsx +11 -2
- package/src/components.tsx +9 -12
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tellescope/chat",
|
|
3
|
-
"version": "1.4.
|
|
3
|
+
"version": "1.4.29",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "./lib/cjs/index.js",
|
|
6
6
|
"module": "./lib/esm/index.js",
|
|
@@ -51,7 +51,7 @@
|
|
|
51
51
|
"react": "^16.8.0 || ^17.0.0 || ^18.0.0",
|
|
52
52
|
"react-dom": "^16.8.0 || ^17.0.0 || ^18.0.0"
|
|
53
53
|
},
|
|
54
|
-
"gitHead": "
|
|
54
|
+
"gitHead": "e4d1df7168884e6b1f3155fd738fcf8b02673c44",
|
|
55
55
|
"publishConfig": {
|
|
56
56
|
"access": "public"
|
|
57
57
|
}
|
package/src/chat.tsx
CHANGED
|
@@ -191,7 +191,7 @@ export const Message = ({
|
|
|
191
191
|
{attachments}
|
|
192
192
|
</Typography>
|
|
193
193
|
) : (
|
|
194
|
-
<Flex style={{ ...textBGStyle }}>
|
|
194
|
+
<Flex style={{ ...textBGStyle }} alignItems="center">
|
|
195
195
|
<Typography component="div" style={{ ...textStyle }}>
|
|
196
196
|
{message.html
|
|
197
197
|
? <HTMLMessage html={message.html} />
|
|
@@ -18,10 +18,19 @@ import { HTMLMessageProps } from './components';
|
|
|
18
18
|
import { remove_script_tags } from '@tellescope/utilities';
|
|
19
19
|
import RenderHtml from 'react-native-render-html';
|
|
20
20
|
|
|
21
|
-
export const HTMLMessage = ({ html } : HTMLMessageProps) => {
|
|
21
|
+
export const HTMLMessage = ({ html: htmlUnprocessed } : HTMLMessageProps) => {
|
|
22
|
+
const html = (
|
|
23
|
+
htmlUnprocessed.endsWith('<br/>')
|
|
24
|
+
? htmlUnprocessed.substring(0, htmlUnprocessed.length - 5)
|
|
25
|
+
: htmlUnprocessed
|
|
26
|
+
)
|
|
27
|
+
|
|
22
28
|
const { width } = useWindowDimensions();
|
|
23
29
|
return (
|
|
24
|
-
<RenderHtml
|
|
30
|
+
<RenderHtml
|
|
31
|
+
baseStyle={{
|
|
32
|
+
paddingTop: 4, // causes better fit into both 1-line and multiline chat bubbles
|
|
33
|
+
}}
|
|
25
34
|
contentWidth={width}
|
|
26
35
|
source={{
|
|
27
36
|
html: (
|
package/src/components.tsx
CHANGED
|
@@ -13,18 +13,15 @@ import { Checkbox, TextField, FormControlLabel, Grid } from "@mui/material";
|
|
|
13
13
|
export interface HTMLMessageProps {
|
|
14
14
|
html: string,
|
|
15
15
|
}
|
|
16
|
-
export const HTMLMessage = ({ html } : HTMLMessageProps) =>
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
)
|
|
27
|
-
}
|
|
16
|
+
export const HTMLMessage = ({ html } : HTMLMessageProps) => (
|
|
17
|
+
<div style={{ padding: 2 }}
|
|
18
|
+
dangerouslySetInnerHTML={{
|
|
19
|
+
__html: remove_script_tags(
|
|
20
|
+
html.replace(/<a/g, '<a style="color: white;"')
|
|
21
|
+
),
|
|
22
|
+
}}
|
|
23
|
+
/>
|
|
24
|
+
)
|
|
28
25
|
|
|
29
26
|
interface SendMessage_T {
|
|
30
27
|
roomId: string,
|