stream-chat-react-native-core 4.0.0-beta.6 → 4.0.0-beta.9
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/README.md +1 -1
- package/lib/commonjs/components/ChannelList/hooks/usePaginatedChannels.js +24 -25
- package/lib/commonjs/components/ChannelList/hooks/usePaginatedChannels.js.map +1 -1
- package/lib/commonjs/components/Chat/Chat.js +8 -4
- package/lib/commonjs/components/Chat/Chat.js.map +1 -1
- package/lib/commonjs/components/MessageOverlay/MessageOverlay.js +23 -28
- package/lib/commonjs/components/MessageOverlay/MessageOverlay.js.map +1 -1
- package/lib/commonjs/components/MessageOverlay/OverlayReactionList.js +8 -10
- package/lib/commonjs/components/MessageOverlay/OverlayReactionList.js.map +1 -1
- package/lib/commonjs/contexts/messageInputContext/MessageInputContext.js +2 -4
- package/lib/commonjs/contexts/messageInputContext/MessageInputContext.js.map +1 -1
- package/lib/commonjs/init.js +13 -0
- package/lib/commonjs/init.js.map +1 -0
- package/lib/commonjs/utils/getResizedImageUrl.js +21 -10
- package/lib/commonjs/utils/getResizedImageUrl.js.map +1 -1
- package/lib/commonjs/version.json +1 -1
- package/lib/module/components/ChannelList/hooks/usePaginatedChannels.js +24 -25
- package/lib/module/components/ChannelList/hooks/usePaginatedChannels.js.map +1 -1
- package/lib/module/components/Chat/Chat.js +8 -4
- package/lib/module/components/Chat/Chat.js.map +1 -1
- package/lib/module/components/MessageOverlay/MessageOverlay.js +23 -28
- package/lib/module/components/MessageOverlay/MessageOverlay.js.map +1 -1
- package/lib/module/components/MessageOverlay/OverlayReactionList.js +8 -10
- package/lib/module/components/MessageOverlay/OverlayReactionList.js.map +1 -1
- package/lib/module/contexts/messageInputContext/MessageInputContext.js +2 -4
- package/lib/module/contexts/messageInputContext/MessageInputContext.js.map +1 -1
- package/lib/module/init.js +13 -0
- package/lib/module/init.js.map +1 -0
- package/lib/module/utils/getResizedImageUrl.js +21 -10
- package/lib/module/utils/getResizedImageUrl.js.map +1 -1
- package/lib/module/version.json +1 -1
- package/lib/typescript/components/MessageOverlay/OverlayReactionList.d.ts +0 -1
- package/lib/typescript/init.d.ts +2 -0
- package/lib/typescript/utils/getResizedImageUrl.d.ts +2 -1
- package/package.json +2 -4
- package/src/components/Attachment/__tests__/buildGallery.test.js +4 -4
- package/src/components/ChannelList/hooks/usePaginatedChannels.ts +8 -7
- package/src/components/Chat/Chat.tsx +3 -0
- package/src/components/MessageOverlay/MessageOverlay.tsx +0 -2
- package/src/components/MessageOverlay/OverlayReactionList.tsx +0 -3
- package/src/contexts/messageInputContext/MessageInputContext.tsx +0 -2
- package/src/init.ts +5 -0
- package/src/utils/__tests__/getResizedImageUrl.test.js +57 -0
- package/src/utils/getResizedImageUrl.ts +33 -17
- package/src/version.json +1 -1
- package/lib/commonjs/styleguideComponents/ArgumentsRenderer.js +0 -100
- package/lib/commonjs/styleguideComponents/ArgumentsRenderer.js.map +0 -1
- package/lib/commonjs/styleguideComponents/BottomSheet.js +0 -25
- package/lib/commonjs/styleguideComponents/BottomSheet.js.map +0 -1
- package/lib/commonjs/styleguideComponents/JsDoc.js +0 -87
- package/lib/commonjs/styleguideComponents/JsDoc.js.map +0 -1
- package/lib/commonjs/styleguideComponents/Markdown.js +0 -12
- package/lib/commonjs/styleguideComponents/Markdown.js.map +0 -1
- package/lib/commonjs/styleguideComponents/PathlineRenderer.js +0 -92
- package/lib/commonjs/styleguideComponents/PathlineRenderer.js.map +0 -1
- package/lib/commonjs/styleguideComponents/PropsRenderer.js +0 -267
- package/lib/commonjs/styleguideComponents/PropsRenderer.js.map +0 -1
- package/lib/commonjs/styleguideComponents/Reanimated.js +0 -2
- package/lib/commonjs/styleguideComponents/Reanimated.js.map +0 -1
- package/lib/commonjs/styleguideComponents/Wrapper.js +0 -29
- package/lib/commonjs/styleguideComponents/Wrapper.js.map +0 -1
- package/lib/commonjs/styleguideComponents/register-react-native-web.js +0 -44
- package/lib/commonjs/styleguideComponents/register-react-native-web.js.map +0 -1
- package/lib/commonjs/styleguideComponents/resolveAssetSource.js +0 -11
- package/lib/commonjs/styleguideComponents/resolveAssetSource.js.map +0 -1
- package/lib/module/styleguideComponents/ArgumentsRenderer.js +0 -100
- package/lib/module/styleguideComponents/ArgumentsRenderer.js.map +0 -1
- package/lib/module/styleguideComponents/BottomSheet.js +0 -25
- package/lib/module/styleguideComponents/BottomSheet.js.map +0 -1
- package/lib/module/styleguideComponents/JsDoc.js +0 -87
- package/lib/module/styleguideComponents/JsDoc.js.map +0 -1
- package/lib/module/styleguideComponents/Markdown.js +0 -12
- package/lib/module/styleguideComponents/Markdown.js.map +0 -1
- package/lib/module/styleguideComponents/PathlineRenderer.js +0 -92
- package/lib/module/styleguideComponents/PathlineRenderer.js.map +0 -1
- package/lib/module/styleguideComponents/PropsRenderer.js +0 -267
- package/lib/module/styleguideComponents/PropsRenderer.js.map +0 -1
- package/lib/module/styleguideComponents/Reanimated.js +0 -2
- package/lib/module/styleguideComponents/Reanimated.js.map +0 -1
- package/lib/module/styleguideComponents/Wrapper.js +0 -29
- package/lib/module/styleguideComponents/Wrapper.js.map +0 -1
- package/lib/module/styleguideComponents/register-react-native-web.js +0 -44
- package/lib/module/styleguideComponents/register-react-native-web.js.map +0 -1
- package/lib/module/styleguideComponents/resolveAssetSource.js +0 -11
- package/lib/module/styleguideComponents/resolveAssetSource.js.map +0 -1
- package/src/styleguideComponents/ArgumentsRenderer.tsx +0 -60
- package/src/styleguideComponents/BottomSheet.tsx +0 -3
- package/src/styleguideComponents/JsDoc.tsx +0 -45
- package/src/styleguideComponents/Markdown.tsx +0 -1
- package/src/styleguideComponents/PathlineRenderer.tsx +0 -45
- package/src/styleguideComponents/PropsRenderer.tsx +0 -141
- package/src/styleguideComponents/Reanimated.tsx +0 -0
- package/src/styleguideComponents/Wrapper.tsx +0 -7
- package/src/styleguideComponents/register-react-native-web.js +0 -13
- package/src/styleguideComponents/resolveAssetSource.js +0 -2
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
|
|
3
|
-
import { TagObject, TagProps } from 'react-docgen';
|
|
4
|
-
|
|
5
|
-
import map from 'lodash/map';
|
|
6
|
-
import PropTypes from 'prop-types';
|
|
7
|
-
import Markdown from 'react-styleguidist/lib/client/rsg-components/Markdown';
|
|
8
|
-
|
|
9
|
-
const plural = (array: TagObject[], caption: string) =>
|
|
10
|
-
array.length === 1 ? caption : `${caption}s`;
|
|
11
|
-
const list = (array: TagObject[]) => array.map((item) => item.description).join(', ');
|
|
12
|
-
const paragraphs = (array: TagObject[]) => array.map((item) => item.description).join('\n\n');
|
|
13
|
-
|
|
14
|
-
const fields = {
|
|
15
|
-
author: (value: TagObject[]) => `${plural(value, 'Author')}: ${list(value)}`,
|
|
16
|
-
default: (value: TagObject[]) => `**Default**: ${value[0].default}`,
|
|
17
|
-
deprecated: (value: TagObject[]) => `**Deprecated:** ${value[0].description}`,
|
|
18
|
-
link: (value: TagObject[]) => paragraphs(value),
|
|
19
|
-
see: (value: TagObject[]) => paragraphs(value),
|
|
20
|
-
since: (value: TagObject[]) => `Since: ${value[0].description}`,
|
|
21
|
-
version: (value: TagObject[]) => `Version: ${value[0].description}`,
|
|
22
|
-
};
|
|
23
|
-
|
|
24
|
-
export function getMarkdown(props: TagProps) {
|
|
25
|
-
return map(fields, (format: (value: TagObject[]) => string, field: keyof TagProps) => {
|
|
26
|
-
const tag = props[field];
|
|
27
|
-
return tag && format(tag);
|
|
28
|
-
})
|
|
29
|
-
.filter(Boolean)
|
|
30
|
-
.join('\n\n');
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
export default function JsDoc(props: TagProps) {
|
|
34
|
-
const markdown = getMarkdown(props);
|
|
35
|
-
return markdown ? <Markdown text={markdown} /> : null;
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
JsDoc.propTypes = {
|
|
39
|
-
author: PropTypes.array,
|
|
40
|
-
deprecated: PropTypes.array,
|
|
41
|
-
link: PropTypes.array,
|
|
42
|
-
see: PropTypes.array,
|
|
43
|
-
since: PropTypes.array,
|
|
44
|
-
version: PropTypes.array,
|
|
45
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export default ({ children }) => children;
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
|
|
3
|
-
import copy from 'clipboard-copy';
|
|
4
|
-
import { MdContentCopy } from 'react-icons/md';
|
|
5
|
-
import Link from 'react-styleguidist/lib/client/rsg-components/Link';
|
|
6
|
-
import Styled, { JssInjectedProps } from 'react-styleguidist/lib/client/rsg-components/Styled';
|
|
7
|
-
import ToolbarButton from 'react-styleguidist/lib/client/rsg-components/ToolbarButton';
|
|
8
|
-
import * as Rsg from 'react-styleguidist/lib/typings';
|
|
9
|
-
|
|
10
|
-
export const styles = ({ color, fontFamily, fontSize, space }: Rsg.Theme) => ({
|
|
11
|
-
copyButton: {
|
|
12
|
-
marginLeft: space[0],
|
|
13
|
-
},
|
|
14
|
-
pathline: {
|
|
15
|
-
color: color.light,
|
|
16
|
-
fontFamily: fontFamily.monospace,
|
|
17
|
-
fontSize: fontSize.small,
|
|
18
|
-
wordBreak: 'break-all',
|
|
19
|
-
},
|
|
20
|
-
});
|
|
21
|
-
|
|
22
|
-
export const PathlineRenderer: React.FunctionComponent<JssInjectedProps> = ({
|
|
23
|
-
children,
|
|
24
|
-
classes,
|
|
25
|
-
}) => (
|
|
26
|
-
<div className={classes.pathline}>
|
|
27
|
-
<Link
|
|
28
|
-
href={'https://github.com/GetStream/stream-chat-react-native/blob/master/' + children}
|
|
29
|
-
rel='noopener'
|
|
30
|
-
target='blank'
|
|
31
|
-
>
|
|
32
|
-
{children}
|
|
33
|
-
</Link>
|
|
34
|
-
<ToolbarButton
|
|
35
|
-
className={classes.copyButton}
|
|
36
|
-
onClick={() => children && copy(children.toString())}
|
|
37
|
-
small
|
|
38
|
-
title='Copy to clipboard'
|
|
39
|
-
>
|
|
40
|
-
<MdContentCopy />
|
|
41
|
-
</ToolbarButton>
|
|
42
|
-
</div>
|
|
43
|
-
);
|
|
44
|
-
|
|
45
|
-
export default Styled<JssInjectedProps>(styles)(PathlineRenderer);
|
|
@@ -1,141 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
|
|
3
|
-
import Argument from 'react-styleguidist/lib/client/rsg-components/Argument';
|
|
4
|
-
|
|
5
|
-
import Markdown from 'react-styleguidist/lib/client/rsg-components/Markdown';
|
|
6
|
-
import Name from 'react-styleguidist/lib/client/rsg-components/Name';
|
|
7
|
-
import Para from 'react-styleguidist/lib/client/rsg-components/Para';
|
|
8
|
-
import renderDefault from 'react-styleguidist/lib/client/rsg-components/Props/renderDefault';
|
|
9
|
-
import renderExtra from 'react-styleguidist/lib/client/rsg-components/Props/renderExtra';
|
|
10
|
-
import renderTypeColumn from 'react-styleguidist/lib/client/rsg-components/Props/renderType';
|
|
11
|
-
import { PropDescriptor } from 'react-styleguidist/lib/client/rsg-components/Props/util';
|
|
12
|
-
|
|
13
|
-
import Arguments from './ArgumentsRenderer';
|
|
14
|
-
import JsDoc from './JsDoc';
|
|
15
|
-
|
|
16
|
-
function renderDescription(prop: PropDescriptor) {
|
|
17
|
-
const { description, tags = {} } = prop;
|
|
18
|
-
const extra = renderExtra(prop);
|
|
19
|
-
const args = [...(tags.arg || []), ...(tags.argument || []), ...(tags.param || [])];
|
|
20
|
-
const returnDocumentation = (tags.return && tags.return[0]) || (tags.returns && tags.returns[0]);
|
|
21
|
-
|
|
22
|
-
return (
|
|
23
|
-
<div>
|
|
24
|
-
{description && <Markdown text={description} />}
|
|
25
|
-
{extra && <Para>{extra}</Para>}
|
|
26
|
-
<JsDoc {...tags} />
|
|
27
|
-
{args.length > 0 && <Arguments args={args} heading />}
|
|
28
|
-
{returnDocumentation && <Argument {...{ ...returnDocumentation, name: '' }} returns />}
|
|
29
|
-
</div>
|
|
30
|
-
);
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
function renderName(prop: PropDescriptor) {
|
|
34
|
-
const { name, tags = {} } = prop;
|
|
35
|
-
return <Name deprecated={!!tags.deprecated}>{name}</Name>;
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
export function getRowKey(row: { name: string }) {
|
|
39
|
-
return row.name;
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
export const columns = [
|
|
43
|
-
{
|
|
44
|
-
caption: 'Prop name lol',
|
|
45
|
-
render: renderName,
|
|
46
|
-
},
|
|
47
|
-
{
|
|
48
|
-
caption: 'Type',
|
|
49
|
-
render: renderTypeColumn,
|
|
50
|
-
},
|
|
51
|
-
{
|
|
52
|
-
caption: 'Default',
|
|
53
|
-
render: renderDefault,
|
|
54
|
-
},
|
|
55
|
-
{
|
|
56
|
-
caption: 'Description',
|
|
57
|
-
render: renderDescription,
|
|
58
|
-
},
|
|
59
|
-
];
|
|
60
|
-
|
|
61
|
-
interface PropsProps {
|
|
62
|
-
props: PropDescriptor[];
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
const PropsRenderer: React.FC<PropsProps> = ({ props }) =>
|
|
66
|
-
props.map((r) => {
|
|
67
|
-
const isComponentProp = r.name[0].toUpperCase() === r.name[0];
|
|
68
|
-
const customType = r.tags.overrideType;
|
|
69
|
-
|
|
70
|
-
return (
|
|
71
|
-
<div key={r.name} style={styles.container}>
|
|
72
|
-
<h3>
|
|
73
|
-
<a
|
|
74
|
-
href={`#${r.name}`}
|
|
75
|
-
id={r.name}
|
|
76
|
-
style={{
|
|
77
|
-
backgroundColor: 'rgba(0, 0, 0, 0.06)',
|
|
78
|
-
color: '#1c1e21',
|
|
79
|
-
fontFamily: 'monospace',
|
|
80
|
-
fontSize: 21,
|
|
81
|
-
fontWeight: 700,
|
|
82
|
-
padding: 5,
|
|
83
|
-
paddingLeft: 10,
|
|
84
|
-
paddingRight: 10,
|
|
85
|
-
textDecoration: 'none',
|
|
86
|
-
}}
|
|
87
|
-
>
|
|
88
|
-
{r.name}
|
|
89
|
-
</a>
|
|
90
|
-
</h3>
|
|
91
|
-
{renderDescription(r)}
|
|
92
|
-
|
|
93
|
-
<table style={styles.table}>
|
|
94
|
-
<tr style={styles.tr}>
|
|
95
|
-
<th style={styles.th}>Type</th>
|
|
96
|
-
<th style={styles.th}>Required</th>
|
|
97
|
-
</tr>
|
|
98
|
-
<tr style={styles.tr}>
|
|
99
|
-
<td style={styles.td}>
|
|
100
|
-
{customType
|
|
101
|
-
? customType[0].description
|
|
102
|
-
: isComponentProp
|
|
103
|
-
? 'Component, element'
|
|
104
|
-
: r.type.name}
|
|
105
|
-
</td>
|
|
106
|
-
<td style={styles.td}>No</td>
|
|
107
|
-
</tr>
|
|
108
|
-
</table>
|
|
109
|
-
<hr style={{ marginTop: 20 }} />
|
|
110
|
-
</div>
|
|
111
|
-
);
|
|
112
|
-
});
|
|
113
|
-
|
|
114
|
-
const styles = {
|
|
115
|
-
container: {
|
|
116
|
-
marginTop: 50,
|
|
117
|
-
},
|
|
118
|
-
table: {
|
|
119
|
-
border: '1px solid black',
|
|
120
|
-
borderCollapse: 'collapse',
|
|
121
|
-
width: '100%',
|
|
122
|
-
},
|
|
123
|
-
td: {
|
|
124
|
-
border: '1px solid black',
|
|
125
|
-
borderCollapse: 'collapse',
|
|
126
|
-
padding: 10,
|
|
127
|
-
textAlign: 'center',
|
|
128
|
-
width: '50%',
|
|
129
|
-
},
|
|
130
|
-
th: {
|
|
131
|
-
backgroundColor: 'rgba(0, 0, 0, 0.06)',
|
|
132
|
-
border: '1px solid black',
|
|
133
|
-
borderCollapse: 'collapse',
|
|
134
|
-
padding: 10,
|
|
135
|
-
textAlign: 'center',
|
|
136
|
-
width: '50%',
|
|
137
|
-
},
|
|
138
|
-
tr: {},
|
|
139
|
-
};
|
|
140
|
-
|
|
141
|
-
export default PropsRenderer;
|
|
File without changes
|