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
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "stream-chat-react-native-core",
|
|
3
3
|
"description": "The official React Native and Expo components for Stream Chat, a service for building chat applications",
|
|
4
|
-
"version": "4.0.0-beta.
|
|
4
|
+
"version": "4.0.0-beta.9",
|
|
5
5
|
"author": {
|
|
6
6
|
"company": "Stream.io Inc",
|
|
7
7
|
"name": "Stream.io Inc"
|
|
@@ -27,8 +27,6 @@
|
|
|
27
27
|
"lint-fix-translations": "prettier --check 'src/i18n/*.json' --write 'src/i18n/*.json' .eslintrc.json ../.prettierrc .babelrc",
|
|
28
28
|
"build-translations": "rm -rf .tmpi18ncache || true && mkdir .tmpi18ncache && yarn run babel --config-file ./babel.i18next-extract.json 'src/**/*.{js,jsx,ts,tsx}' --out-dir '.tmpi18ncache/' && rm -rf .tmpi18ncache && prettier --write 'src/i18n/*.{js,ts,tsx,md,json}' .eslintrc.json ../.prettierrc .babelrc",
|
|
29
29
|
"copy-translations": "echo '\u001b[34mℹ\u001b[0m Copying translation files to \u001b[34mlib/typescript/i18n\u001b[0m' && cp -R -f ./src/i18n ./lib/typescript/i18n && echo '\u001b[32m✓\u001b[0m Done Copying Translations'",
|
|
30
|
-
"docs": "styleguidist build",
|
|
31
|
-
"docs-server": "styleguidist server",
|
|
32
30
|
"eslint": "eslint 'src/**/*.{js,md,ts,jsx,tsx}' --max-warnings 0",
|
|
33
31
|
"lint": "prettier --ignore-path ../.prettierignore --list-different 'src/**/*.{js,ts,tsx,md,json}' .eslintrc.json ../.prettierrc .babelrc && eslint 'src/**/*.{js,ts,tsx,md}' --max-warnings 0 && yarn run validate-translations",
|
|
34
32
|
"lint-fix": "prettier --ignore-path ../.prettierignore --write 'src/**/*.{js,ts,tsx,md,json}' .eslintrc.json ../.prettierrc .babelrc && eslint --fix 'src/**/*.{js,ts,tsx,md}' --max-warnings 0",
|
|
@@ -80,6 +78,7 @@
|
|
|
80
78
|
"path": "0.12.7",
|
|
81
79
|
"react-art": "^17.0.2",
|
|
82
80
|
"react-native-markdown-package": "1.8.1",
|
|
81
|
+
"react-native-url-polyfill": "^1.3.0",
|
|
83
82
|
"stream-chat": "6.0.0"
|
|
84
83
|
},
|
|
85
84
|
"peerDependencies": {
|
|
@@ -138,7 +137,6 @@
|
|
|
138
137
|
"react-native-svg": "12.1.1",
|
|
139
138
|
"react-native-typescript-transformer": "1.2.13",
|
|
140
139
|
"react-native-web": "0.15.0",
|
|
141
|
-
"react-styleguidist": "11.1.6",
|
|
142
140
|
"react-test-renderer": "17.0.2",
|
|
143
141
|
"typescript": "4.4.3",
|
|
144
142
|
"uuid": "8.3.2",
|
|
@@ -97,7 +97,7 @@ describe('buildGallery', () => {
|
|
|
97
97
|
it('thumbnail size should be smaller than the limits set by sizeConfig', () => {
|
|
98
98
|
const bigImage = generateImageAttachment({
|
|
99
99
|
image_url:
|
|
100
|
-
'https://stream-io
|
|
100
|
+
'https://us-east.stream-io-cdn.com/23kn4k2j3n4k2n3k4n23?sig=34k23n4k23nk423&oh=200&ow=300&h=*&w=*&resize=*',
|
|
101
101
|
original_height: 1200,
|
|
102
102
|
original_width: 900,
|
|
103
103
|
});
|
|
@@ -107,13 +107,13 @@ describe('buildGallery', () => {
|
|
|
107
107
|
sizeConfig: defaultSizeConfig,
|
|
108
108
|
});
|
|
109
109
|
const t1 = tg1[0][0];
|
|
110
|
-
expect(t1.url.includes(
|
|
110
|
+
expect(t1.url.includes(`&h=${PixelRatio.getPixelSizeForLayoutSize(t1.height)}`)).toBe(true);
|
|
111
111
|
expect(t1.url.includes(`&w=${PixelRatio.getPixelSizeForLayoutSize(t1.width)}`)).toBe(true);
|
|
112
112
|
expect(t1.url.includes(`&resize=clip`)).toBe(true);
|
|
113
113
|
|
|
114
114
|
const smallImage = generateImageAttachment({
|
|
115
115
|
image_url:
|
|
116
|
-
'https://stream-io
|
|
116
|
+
'https://us-east.stream-io-cdn.com/23kn4k2j3n4k2n3k4n23?sig=34k23n4k23nk423&h=*&w=*&resize=*&oh=200&ow=300',
|
|
117
117
|
original_height: 30,
|
|
118
118
|
original_width: 20,
|
|
119
119
|
});
|
|
@@ -124,7 +124,7 @@ describe('buildGallery', () => {
|
|
|
124
124
|
});
|
|
125
125
|
|
|
126
126
|
const t2 = tg2[0][0];
|
|
127
|
-
expect(t2.url.includes(
|
|
127
|
+
expect(t2.url.includes(`&h=*`)).toBe(true);
|
|
128
128
|
expect(t2.url.includes(`&w=*`)).toBe(true);
|
|
129
129
|
expect(t2.url.includes(`&resize=*`)).toBe(true);
|
|
130
130
|
});
|
|
@@ -50,7 +50,7 @@ export const usePaginatedChannels = <
|
|
|
50
50
|
const [activeQueryType, setActiveQueryType] = useState<QueryType | null>();
|
|
51
51
|
const isMountedRef = useIsMountedRef();
|
|
52
52
|
const filtersRef = useRef<typeof filters | null>(null);
|
|
53
|
-
const sortRef = useRef<typeof
|
|
53
|
+
const sortRef = useRef<typeof sort | null>(null);
|
|
54
54
|
const activeRequestId = useRef<number>(0);
|
|
55
55
|
|
|
56
56
|
const queryChannels: QueryChannels = async (
|
|
@@ -59,14 +59,14 @@ export const usePaginatedChannels = <
|
|
|
59
59
|
): Promise<void> => {
|
|
60
60
|
if (!client || !isMountedRef.current) return;
|
|
61
61
|
|
|
62
|
-
const hasUpdatedData =
|
|
62
|
+
const hasUpdatedData =
|
|
63
|
+
queryType === 'loadChannels' ||
|
|
63
64
|
[
|
|
64
65
|
JSON.stringify(filtersRef.current) !== JSON.stringify(filters),
|
|
65
66
|
JSON.stringify(sortRef.current) !== JSON.stringify(sort),
|
|
66
|
-
|
|
67
|
-
].some(Boolean); // will return true if any element is truthy
|
|
67
|
+
].some(Boolean);
|
|
68
68
|
|
|
69
|
-
const
|
|
69
|
+
const isQueryStale = () => !isMountedRef || activeRequestId.current !== currentRequestId;
|
|
70
70
|
|
|
71
71
|
/**
|
|
72
72
|
* We don't need to make another call to query channels if we don't
|
|
@@ -77,6 +77,7 @@ export const usePaginatedChannels = <
|
|
|
77
77
|
}
|
|
78
78
|
|
|
79
79
|
filtersRef.current = filters;
|
|
80
|
+
sortRef.current = sort;
|
|
80
81
|
isQueryingRef.current = true;
|
|
81
82
|
setError(undefined);
|
|
82
83
|
activeRequestId.current++;
|
|
@@ -94,7 +95,7 @@ export const usePaginatedChannels = <
|
|
|
94
95
|
skipInitialization: activeChannels.current,
|
|
95
96
|
});
|
|
96
97
|
|
|
97
|
-
if (
|
|
98
|
+
if (isQueryStale() || !isMountedRef.current) {
|
|
98
99
|
return;
|
|
99
100
|
}
|
|
100
101
|
|
|
@@ -113,7 +114,7 @@ export const usePaginatedChannels = <
|
|
|
113
114
|
isQueryingRef.current = false;
|
|
114
115
|
await waitSeconds(2);
|
|
115
116
|
|
|
116
|
-
if (
|
|
117
|
+
if (isQueryStale()) {
|
|
117
118
|
return;
|
|
118
119
|
}
|
|
119
120
|
|
|
@@ -18,12 +18,15 @@ import {
|
|
|
18
18
|
TranslationProvider,
|
|
19
19
|
} from '../../contexts/translationContext/TranslationContext';
|
|
20
20
|
import { useStreami18n } from '../../hooks/useStreami18n';
|
|
21
|
+
import init from '../../init';
|
|
21
22
|
|
|
22
23
|
import { SDK } from '../../native';
|
|
23
24
|
import type { DefaultStreamChatGenerics } from '../../types/types';
|
|
24
25
|
import type { Streami18n } from '../../utils/Streami18n';
|
|
25
26
|
import { version } from '../../version.json';
|
|
26
27
|
|
|
28
|
+
init();
|
|
29
|
+
|
|
27
30
|
export type ChatProps<
|
|
28
31
|
StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics,
|
|
29
32
|
> = Pick<ChatContextValue<StreamChatGenerics>, 'client'> & {
|
|
@@ -159,7 +159,6 @@ const MessageOverlayWithContext = <
|
|
|
159
159
|
const wrapMessageInTheme = clientId === message?.user?.id && !!myMessageTheme;
|
|
160
160
|
|
|
161
161
|
const [myMessageThemeString, setMyMessageThemeString] = useState(JSON.stringify(myMessageTheme));
|
|
162
|
-
const [, setReactionListHeight] = useState(0);
|
|
163
162
|
|
|
164
163
|
useEffect(() => {
|
|
165
164
|
if (myMessageTheme) {
|
|
@@ -360,7 +359,6 @@ const MessageOverlayWithContext = <
|
|
|
360
359
|
ownReactionTypes={
|
|
361
360
|
message?.own_reactions?.map((reaction) => reaction.type) || []
|
|
362
361
|
}
|
|
363
|
-
setReactionListHeight={setReactionListHeight}
|
|
364
362
|
showScreen={showScreen}
|
|
365
363
|
/>
|
|
366
364
|
) : null}
|
|
@@ -239,7 +239,6 @@ export type OverlayReactionListPropsWithContext<
|
|
|
239
239
|
y: number;
|
|
240
240
|
}>;
|
|
241
241
|
ownReactionTypes: string[];
|
|
242
|
-
setReactionListHeight: React.Dispatch<React.SetStateAction<number>>;
|
|
243
242
|
showScreen: Animated.SharedValue<number>;
|
|
244
243
|
fill?: FillProps['fill'];
|
|
245
244
|
};
|
|
@@ -255,7 +254,6 @@ const OverlayReactionListWithContext = <
|
|
|
255
254
|
handleReaction,
|
|
256
255
|
messageLayout,
|
|
257
256
|
ownReactionTypes,
|
|
258
|
-
setReactionListHeight,
|
|
259
257
|
showScreen,
|
|
260
258
|
setOverlay,
|
|
261
259
|
supportedReactions = reactionData,
|
|
@@ -356,7 +354,6 @@ const OverlayReactionListWithContext = <
|
|
|
356
354
|
}) => {
|
|
357
355
|
reactionListLayout.value = { height, width: layoutWidth };
|
|
358
356
|
reactionListHeight.value = height;
|
|
359
|
-
setReactionListHeight(height);
|
|
360
357
|
}}
|
|
361
358
|
style={[
|
|
362
359
|
styles.reactionList,
|
|
@@ -641,8 +641,6 @@ export const MessageInputProvider = <
|
|
|
641
641
|
attachments.push({
|
|
642
642
|
fallback: image.file.name,
|
|
643
643
|
image_url: image.url,
|
|
644
|
-
original_height: image.height,
|
|
645
|
-
original_width: image.width,
|
|
646
644
|
type: 'image',
|
|
647
645
|
} as Attachment<StreamChatGenerics>);
|
|
648
646
|
}
|
package/src/init.ts
ADDED
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { PixelRatio } from 'react-native';
|
|
2
|
+
|
|
3
|
+
import { getResizedImageUrl } from '../getResizedImageUrl';
|
|
4
|
+
|
|
5
|
+
describe('getResizedImageUrl', () => {
|
|
6
|
+
it('should return same url if its not cloudfront cdn', () => {
|
|
7
|
+
const testUrl = 'http://foo.com/blah_(wikipedia)#cite-1';
|
|
8
|
+
|
|
9
|
+
const resizedUrl = getResizedImageUrl({ height: 100, url: testUrl, width: 100 });
|
|
10
|
+
expect(resizedUrl).toEqual(testUrl);
|
|
11
|
+
});
|
|
12
|
+
|
|
13
|
+
it('should append given height, width and resize mode to url', () => {
|
|
14
|
+
const testUrl =
|
|
15
|
+
'http://us-east.stream-io-cdn.com/blah?sig=34k23n4k23nk423&oh=300&ow=200&h=*&w=*&resize=*';
|
|
16
|
+
|
|
17
|
+
const testConfigs = [
|
|
18
|
+
{ height: 100, resize: 'scale', width: 100 },
|
|
19
|
+
{ height: 200, resize: 'fill', width: 300 },
|
|
20
|
+
{ height: 1000, resize: 'clip', width: 10 },
|
|
21
|
+
];
|
|
22
|
+
|
|
23
|
+
testConfigs.forEach(({ height, resize, width }) => {
|
|
24
|
+
const resizedUrl = getResizedImageUrl({ height, resize, url: testUrl, width });
|
|
25
|
+
const parsedUrl = new URL(resizedUrl);
|
|
26
|
+
expect(parsedUrl.searchParams.get('h')).toEqual(
|
|
27
|
+
`${PixelRatio.getPixelSizeForLayoutSize(height)}`,
|
|
28
|
+
);
|
|
29
|
+
expect(parsedUrl.searchParams.get('w')).toEqual(
|
|
30
|
+
`${PixelRatio.getPixelSizeForLayoutSize(width)}`,
|
|
31
|
+
);
|
|
32
|
+
expect(parsedUrl.searchParams.get('resize')).toEqual(resize);
|
|
33
|
+
});
|
|
34
|
+
});
|
|
35
|
+
|
|
36
|
+
it('should replace wildcards with given height, width and resize mode within url', () => {
|
|
37
|
+
const testUrl = 'http://us-east.stream-io-cdn.com/blah?oh=300&ow=200&h=*&w=*&resize=*';
|
|
38
|
+
|
|
39
|
+
const testConfigs = [
|
|
40
|
+
{ height: 100, resize: 'scale', width: 100 },
|
|
41
|
+
{ height: 200, resize: 'fill', width: 300 },
|
|
42
|
+
{ height: 1000, resize: 'clip', width: 10 },
|
|
43
|
+
];
|
|
44
|
+
|
|
45
|
+
testConfigs.forEach(({ height, resize, width }) => {
|
|
46
|
+
const resizedUrl = getResizedImageUrl({ height, resize, url: testUrl, width });
|
|
47
|
+
const parsedUrl = new URL(resizedUrl);
|
|
48
|
+
expect(parsedUrl.searchParams.get('h')).toEqual(
|
|
49
|
+
`${PixelRatio.getPixelSizeForLayoutSize(height)}`,
|
|
50
|
+
);
|
|
51
|
+
expect(parsedUrl.searchParams.get('w')).toEqual(
|
|
52
|
+
`${PixelRatio.getPixelSizeForLayoutSize(width)}`,
|
|
53
|
+
);
|
|
54
|
+
expect(parsedUrl.searchParams.get('resize')).toEqual(resize);
|
|
55
|
+
});
|
|
56
|
+
});
|
|
57
|
+
});
|
|
@@ -3,6 +3,7 @@ import { PixelRatio } from 'react-native';
|
|
|
3
3
|
type GetResizedImageUrlParams = {
|
|
4
4
|
url: string;
|
|
5
5
|
height?: string | number;
|
|
6
|
+
resize?: 'clip' | 'crop' | 'fill' | 'scale';
|
|
6
7
|
width?: string | number;
|
|
7
8
|
};
|
|
8
9
|
|
|
@@ -18,26 +19,41 @@ type GetResizedImageUrlParams = {
|
|
|
18
19
|
*
|
|
19
20
|
* @returns {string} Url of the image with given height and width.
|
|
20
21
|
*/
|
|
21
|
-
export function getResizedImageUrl({
|
|
22
|
-
|
|
22
|
+
export function getResizedImageUrl({
|
|
23
|
+
height,
|
|
24
|
+
resize = 'clip',
|
|
25
|
+
url,
|
|
26
|
+
width,
|
|
27
|
+
}: GetResizedImageUrlParams) {
|
|
28
|
+
try {
|
|
29
|
+
const parsedUrl = new URL(url);
|
|
23
30
|
|
|
24
|
-
|
|
31
|
+
const originalHeight = parsedUrl.searchParams.get('oh');
|
|
32
|
+
const originalWidth = parsedUrl.searchParams.get('ow');
|
|
25
33
|
|
|
26
|
-
|
|
34
|
+
// If url is not from new cloudfront CDN (which offers fast image resizing), then return the url as it is.
|
|
35
|
+
// Check for oh and ow parameters in the url, is just to differentiate between old and new CDN.
|
|
36
|
+
// In case of old CDN we don't want to do any kind of resizing.
|
|
37
|
+
const isResizableUrl = url.includes('.stream-io-cdn.com') && originalHeight && originalWidth;
|
|
27
38
|
|
|
28
|
-
|
|
29
|
-
resizedUrl = resizedUrl.replace(
|
|
30
|
-
'h=*',
|
|
31
|
-
`h=${PixelRatio.getPixelSizeForLayoutSize(Number(height))}`,
|
|
32
|
-
);
|
|
33
|
-
}
|
|
39
|
+
if (!isResizableUrl || (!height && !width)) return url;
|
|
34
40
|
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
)
|
|
40
|
-
|
|
41
|
+
if (height) {
|
|
42
|
+
parsedUrl.searchParams.set('h', `${PixelRatio.getPixelSizeForLayoutSize(Number(height))}`);
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
if (width) {
|
|
46
|
+
parsedUrl.searchParams.set('w', `${PixelRatio.getPixelSizeForLayoutSize(Number(width))}`);
|
|
47
|
+
}
|
|
41
48
|
|
|
42
|
-
|
|
49
|
+
parsedUrl.searchParams.set('resize', `${resize}`);
|
|
50
|
+
|
|
51
|
+
return parsedUrl.toString();
|
|
52
|
+
} catch (error) {
|
|
53
|
+
// There is some issue with the url.
|
|
54
|
+
// Simply return the original url, there is no need to break the app for this.
|
|
55
|
+
console.warn(error);
|
|
56
|
+
|
|
57
|
+
return url;
|
|
58
|
+
}
|
|
43
59
|
}
|
package/src/version.json
CHANGED
|
@@ -1,100 +0,0 @@
|
|
|
1
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.styles = exports["default"] = exports.ArgumentsRenderer = void 0;
|
|
7
|
-
|
|
8
|
-
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
9
|
-
|
|
10
|
-
var _react = _interopRequireDefault(require("react"));
|
|
11
|
-
|
|
12
|
-
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
13
|
-
|
|
14
|
-
var _Argument = _interopRequireDefault(require("react-styleguidist/lib/client/rsg-components/Argument"));
|
|
15
|
-
|
|
16
|
-
var _Heading = _interopRequireDefault(require("react-styleguidist/lib/client/rsg-components/Heading"));
|
|
17
|
-
|
|
18
|
-
var _Styled = _interopRequireDefault(require("react-styleguidist/lib/client/rsg-components/Styled"));
|
|
19
|
-
|
|
20
|
-
var _this = this,
|
|
21
|
-
_jsxFileName = "/home/runner/work/stream-chat-react-native/stream-chat-react-native/package/src/styleguideComponents/ArgumentsRenderer.tsx";
|
|
22
|
-
|
|
23
|
-
var styles = function styles(_ref) {
|
|
24
|
-
var space = _ref.space;
|
|
25
|
-
return {
|
|
26
|
-
headingWrapper: {
|
|
27
|
-
marginBottom: space[0]
|
|
28
|
-
},
|
|
29
|
-
root: {
|
|
30
|
-
fontSize: 'inherit',
|
|
31
|
-
marginBottom: space[2]
|
|
32
|
-
}
|
|
33
|
-
};
|
|
34
|
-
};
|
|
35
|
-
|
|
36
|
-
exports.styles = styles;
|
|
37
|
-
|
|
38
|
-
var ArgumentsRenderer = function ArgumentsRenderer(_ref2) {
|
|
39
|
-
var args = _ref2.args,
|
|
40
|
-
classes = _ref2.classes,
|
|
41
|
-
heading = _ref2.heading;
|
|
42
|
-
|
|
43
|
-
if (args.length === 0) {
|
|
44
|
-
return null;
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
return _react["default"].createElement("div", {
|
|
48
|
-
className: classes.root,
|
|
49
|
-
__self: _this,
|
|
50
|
-
__source: {
|
|
51
|
-
fileName: _jsxFileName,
|
|
52
|
-
lineNumber: 35,
|
|
53
|
-
columnNumber: 5
|
|
54
|
-
}
|
|
55
|
-
}, heading && _react["default"].createElement("div", {
|
|
56
|
-
className: classes.headingWrapper,
|
|
57
|
-
__self: _this,
|
|
58
|
-
__source: {
|
|
59
|
-
fileName: _jsxFileName,
|
|
60
|
-
lineNumber: 37,
|
|
61
|
-
columnNumber: 9
|
|
62
|
-
}
|
|
63
|
-
}, _react["default"].createElement(_Heading["default"], {
|
|
64
|
-
level: 5,
|
|
65
|
-
__self: _this,
|
|
66
|
-
__source: {
|
|
67
|
-
fileName: _jsxFileName,
|
|
68
|
-
lineNumber: 38,
|
|
69
|
-
columnNumber: 11
|
|
70
|
-
}
|
|
71
|
-
}, "Arguments")), args.map(function (arg) {
|
|
72
|
-
return _react["default"].createElement(_Argument["default"], (0, _extends2["default"])({
|
|
73
|
-
key: arg.name
|
|
74
|
-
}, arg, {
|
|
75
|
-
block: true,
|
|
76
|
-
__self: _this,
|
|
77
|
-
__source: {
|
|
78
|
-
fileName: _jsxFileName,
|
|
79
|
-
lineNumber: 42,
|
|
80
|
-
columnNumber: 9
|
|
81
|
-
}
|
|
82
|
-
}));
|
|
83
|
-
}));
|
|
84
|
-
};
|
|
85
|
-
|
|
86
|
-
exports.ArgumentsRenderer = ArgumentsRenderer;
|
|
87
|
-
ArgumentsRenderer.propTypes = {
|
|
88
|
-
args: _propTypes["default"].arrayOf(_propTypes["default"].shape({
|
|
89
|
-
description: _propTypes["default"].string,
|
|
90
|
-
name: _propTypes["default"].string.isRequired,
|
|
91
|
-
type: _propTypes["default"].object
|
|
92
|
-
}).isRequired).isRequired,
|
|
93
|
-
classes: _propTypes["default"].objectOf(_propTypes["default"].string.isRequired).isRequired,
|
|
94
|
-
heading: _propTypes["default"].bool
|
|
95
|
-
};
|
|
96
|
-
|
|
97
|
-
var _default = (0, _Styled["default"])(styles)(ArgumentsRenderer);
|
|
98
|
-
|
|
99
|
-
exports["default"] = _default;
|
|
100
|
-
//# sourceMappingURL=ArgumentsRenderer.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["ArgumentsRenderer.tsx"],"names":["styles","space","headingWrapper","marginBottom","root","fontSize","ArgumentsRenderer","args","classes","heading","length","map","arg","name","propTypes","PropTypes","arrayOf","shape","description","string","isRequired","type","object","objectOf","bool"],"mappings":";;;;;;;;;AAAA;;AAEA;;AACA;;AACA;;AACA;;;;;AAGO,IAAMA,MAAM,GAAG,SAATA,MAAS;AAAA,MAAGC,KAAH,QAAGA,KAAH;AAAA,SAA2B;AAC/CC,IAAAA,cAAc,EAAE;AACdC,MAAAA,YAAY,EAAEF,KAAK,CAAC,CAAD;AADL,KAD+B;AAI/CG,IAAAA,IAAI,EAAE;AACJC,MAAAA,QAAQ,EAAE,SADN;AAEJF,MAAAA,YAAY,EAAEF,KAAK,CAAC,CAAD;AAFf;AAJyC,GAA3B;AAAA,CAAf;;;;AAgBA,IAAMK,iBAA0D,GAAG,SAA7DA,iBAA6D,QAIpE;AAAA,MAHJC,IAGI,SAHJA,IAGI;AAAA,MAFJC,OAEI,SAFJA,OAEI;AAAA,MADJC,OACI,SADJA,OACI;;AACJ,MAAIF,IAAI,CAACG,MAAL,KAAgB,CAApB,EAAuB;AACrB,WAAO,IAAP;AACD;;AAED,SACE;AAAK,IAAA,SAAS,EAAEF,OAAO,CAACJ,IAAxB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,KACGK,OAAO,IACN;AAAK,IAAA,SAAS,EAAED,OAAO,CAACN,cAAxB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,KACE,gCAAC,mBAAD;AAAS,IAAA,KAAK,EAAE,CAAhB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,iBADF,CAFJ,EAMGK,IAAI,CAACI,GAAL,CAAS,UAACC,GAAD;AAAA,WACR,gCAAC,oBAAD;AAAU,MAAA,GAAG,EAAEA,GAAG,CAACC;AAAnB,OAA6BD,GAA7B;AAAkC,MAAA,KAAK,MAAvC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,OADQ;AAAA,GAAT,CANH,CADF;AAYD,CArBM;;;AAuBPN,iBAAiB,CAACQ,SAAlB,GAA8B;AAC5BP,EAAAA,IAAI,EAAEQ,sBAAUC,OAAV,CACJD,sBAAUE,KAAV,CAAgB;AACdC,IAAAA,WAAW,EAAEH,sBAAUI,MADT;AAEdN,IAAAA,IAAI,EAAEE,sBAAUI,MAAV,CAAiBC,UAFT;AAGdC,IAAAA,IAAI,EAAEN,sBAAUO;AAHF,GAAhB,EAIGF,UALC,EAMJA,UAP0B;AAQ5BZ,EAAAA,OAAO,EAAEO,sBAAUQ,QAAV,CAAmBR,sBAAUI,MAAV,CAAiBC,UAApC,EAAgDA,UAR7B;AAS5BX,EAAAA,OAAO,EAAEM,sBAAUS;AATS,CAA9B;;eAYe,wBAAuBxB,MAAvB,EAA+BM,iBAA/B,C","sourcesContent":["import React from 'react';\n\nimport PropTypes from 'prop-types';\nimport Argument, { ArgumentProps } from 'react-styleguidist/lib/client/rsg-components/Argument';\nimport Heading from 'react-styleguidist/lib/client/rsg-components/Heading';\nimport Styled, { JssInjectedProps } from 'react-styleguidist/lib/client/rsg-components/Styled';\nimport * as Rsg from 'react-styleguidist/lib/typings';\n\nexport const styles = ({ space }: Rsg.Theme) => ({\n headingWrapper: {\n marginBottom: space[0],\n },\n root: {\n fontSize: 'inherit',\n marginBottom: space[2],\n },\n});\n\ninterface ArgumentsProps extends JssInjectedProps {\n args: ArgumentProps[];\n classes: Record<string, string>;\n heading?: boolean;\n}\n\nexport const ArgumentsRenderer: React.FunctionComponent<ArgumentsProps> = ({\n args,\n classes,\n heading,\n}) => {\n if (args.length === 0) {\n return null;\n }\n\n return (\n <div className={classes.root}>\n {heading && (\n <div className={classes.headingWrapper}>\n <Heading level={5}>Arguments</Heading>\n </div>\n )}\n {args.map((arg) => (\n <Argument key={arg.name} {...arg} block />\n ))}\n </div>\n );\n};\n\nArgumentsRenderer.propTypes = {\n args: PropTypes.arrayOf(\n PropTypes.shape({\n description: PropTypes.string,\n name: PropTypes.string.isRequired,\n type: PropTypes.object,\n }).isRequired,\n ).isRequired,\n classes: PropTypes.objectOf(PropTypes.string.isRequired).isRequired,\n heading: PropTypes.bool,\n};\n\nexport default Styled<ArgumentsProps>(styles)(ArgumentsRenderer);\n"]}
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.BottomSheet = void 0;
|
|
7
|
-
|
|
8
|
-
var _react = _interopRequireDefault(require("react"));
|
|
9
|
-
|
|
10
|
-
var _this = this,
|
|
11
|
-
_jsxFileName = "/home/runner/work/stream-chat-react-native/stream-chat-react-native/package/src/styleguideComponents/BottomSheet.tsx";
|
|
12
|
-
|
|
13
|
-
var BottomSheet = function BottomSheet() {
|
|
14
|
-
return _react["default"].createElement(_react["default"].Fragment, {
|
|
15
|
-
__self: _this,
|
|
16
|
-
__source: {
|
|
17
|
-
fileName: _jsxFileName,
|
|
18
|
-
lineNumber: 3,
|
|
19
|
-
columnNumber: 34
|
|
20
|
-
}
|
|
21
|
-
});
|
|
22
|
-
};
|
|
23
|
-
|
|
24
|
-
exports.BottomSheet = BottomSheet;
|
|
25
|
-
//# sourceMappingURL=BottomSheet.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["BottomSheet.tsx"],"names":["BottomSheet"],"mappings":";;;;;;;AAAA;;;;;AAEO,IAAMA,WAAW,GAAG,SAAdA,WAAc;AAAA,SAAM,gCAAC,iBAAD,CAAO,QAAP;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAAN;AAAA,CAApB","sourcesContent":["import React from 'react';\n\nexport const BottomSheet = () => <React.Fragment />;\n"]}
|
|
@@ -1,87 +0,0 @@
|
|
|
1
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports["default"] = JsDoc;
|
|
7
|
-
exports.getMarkdown = getMarkdown;
|
|
8
|
-
|
|
9
|
-
var _react = _interopRequireDefault(require("react"));
|
|
10
|
-
|
|
11
|
-
var _map = _interopRequireDefault(require("lodash/map"));
|
|
12
|
-
|
|
13
|
-
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
14
|
-
|
|
15
|
-
var _Markdown = _interopRequireDefault(require("react-styleguidist/lib/client/rsg-components/Markdown"));
|
|
16
|
-
|
|
17
|
-
var _jsxFileName = "/home/runner/work/stream-chat-react-native/stream-chat-react-native/package/src/styleguideComponents/JsDoc.tsx";
|
|
18
|
-
|
|
19
|
-
var plural = function plural(array, caption) {
|
|
20
|
-
return array.length === 1 ? caption : caption + "s";
|
|
21
|
-
};
|
|
22
|
-
|
|
23
|
-
var list = function list(array) {
|
|
24
|
-
return array.map(function (item) {
|
|
25
|
-
return item.description;
|
|
26
|
-
}).join(', ');
|
|
27
|
-
};
|
|
28
|
-
|
|
29
|
-
var paragraphs = function paragraphs(array) {
|
|
30
|
-
return array.map(function (item) {
|
|
31
|
-
return item.description;
|
|
32
|
-
}).join('\n\n');
|
|
33
|
-
};
|
|
34
|
-
|
|
35
|
-
var fields = {
|
|
36
|
-
author: function author(value) {
|
|
37
|
-
return plural(value, 'Author') + ": " + list(value);
|
|
38
|
-
},
|
|
39
|
-
"default": function _default(value) {
|
|
40
|
-
return "**Default**: " + value[0]["default"];
|
|
41
|
-
},
|
|
42
|
-
deprecated: function deprecated(value) {
|
|
43
|
-
return "**Deprecated:** " + value[0].description;
|
|
44
|
-
},
|
|
45
|
-
link: function link(value) {
|
|
46
|
-
return paragraphs(value);
|
|
47
|
-
},
|
|
48
|
-
see: function see(value) {
|
|
49
|
-
return paragraphs(value);
|
|
50
|
-
},
|
|
51
|
-
since: function since(value) {
|
|
52
|
-
return "Since: " + value[0].description;
|
|
53
|
-
},
|
|
54
|
-
version: function version(value) {
|
|
55
|
-
return "Version: " + value[0].description;
|
|
56
|
-
}
|
|
57
|
-
};
|
|
58
|
-
|
|
59
|
-
function getMarkdown(props) {
|
|
60
|
-
return (0, _map["default"])(fields, function (format, field) {
|
|
61
|
-
var tag = props[field];
|
|
62
|
-
return tag && format(tag);
|
|
63
|
-
}).filter(Boolean).join('\n\n');
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
function JsDoc(props) {
|
|
67
|
-
var markdown = getMarkdown(props);
|
|
68
|
-
return markdown ? _react["default"].createElement(_Markdown["default"], {
|
|
69
|
-
text: markdown,
|
|
70
|
-
__self: this,
|
|
71
|
-
__source: {
|
|
72
|
-
fileName: _jsxFileName,
|
|
73
|
-
lineNumber: 35,
|
|
74
|
-
columnNumber: 21
|
|
75
|
-
}
|
|
76
|
-
}) : null;
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
JsDoc.propTypes = {
|
|
80
|
-
author: _propTypes["default"].array,
|
|
81
|
-
deprecated: _propTypes["default"].array,
|
|
82
|
-
link: _propTypes["default"].array,
|
|
83
|
-
see: _propTypes["default"].array,
|
|
84
|
-
since: _propTypes["default"].array,
|
|
85
|
-
version: _propTypes["default"].array
|
|
86
|
-
};
|
|
87
|
-
//# sourceMappingURL=JsDoc.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["JsDoc.tsx"],"names":["plural","array","caption","length","list","map","item","description","join","paragraphs","fields","author","value","deprecated","link","see","since","version","getMarkdown","props","format","field","tag","filter","Boolean","JsDoc","markdown","propTypes","PropTypes"],"mappings":";;;;;;;;AAAA;;AAIA;;AACA;;AACA;;;;AAEA,IAAMA,MAAM,GAAG,SAATA,MAAS,CAACC,KAAD,EAAqBC,OAArB;AAAA,SACbD,KAAK,CAACE,MAAN,KAAiB,CAAjB,GAAqBD,OAArB,GAAkCA,OAAlC,MADa;AAAA,CAAf;;AAEA,IAAME,IAAI,GAAG,SAAPA,IAAO,CAACH,KAAD;AAAA,SAAwBA,KAAK,CAACI,GAAN,CAAU,UAACC,IAAD;AAAA,WAAUA,IAAI,CAACC,WAAf;AAAA,GAAV,EAAsCC,IAAtC,CAA2C,IAA3C,CAAxB;AAAA,CAAb;;AACA,IAAMC,UAAU,GAAG,SAAbA,UAAa,CAACR,KAAD;AAAA,SAAwBA,KAAK,CAACI,GAAN,CAAU,UAACC,IAAD;AAAA,WAAUA,IAAI,CAACC,WAAf;AAAA,GAAV,EAAsCC,IAAtC,CAA2C,MAA3C,CAAxB;AAAA,CAAnB;;AAEA,IAAME,MAAM,GAAG;AACbC,EAAAA,MAAM,EAAE,gBAACC,KAAD;AAAA,WAA2BZ,MAAM,CAACY,KAAD,EAAQ,QAAR,CAAjC,UAAuDR,IAAI,CAACQ,KAAD,CAA3D;AAAA,GADK;AAEb,aAAS,kBAACA,KAAD;AAAA,6BAAwCA,KAAK,CAAC,CAAD,CAAL,WAAxC;AAAA,GAFI;AAGbC,EAAAA,UAAU,EAAE,oBAACD,KAAD;AAAA,gCAA2CA,KAAK,CAAC,CAAD,CAAL,CAASL,WAApD;AAAA,GAHC;AAIbO,EAAAA,IAAI,EAAE,cAACF,KAAD;AAAA,WAAwBH,UAAU,CAACG,KAAD,CAAlC;AAAA,GAJO;AAKbG,EAAAA,GAAG,EAAE,aAACH,KAAD;AAAA,WAAwBH,UAAU,CAACG,KAAD,CAAlC;AAAA,GALQ;AAMbI,EAAAA,KAAK,EAAE,eAACJ,KAAD;AAAA,uBAAkCA,KAAK,CAAC,CAAD,CAAL,CAASL,WAA3C;AAAA,GANM;AAObU,EAAAA,OAAO,EAAE,iBAACL,KAAD;AAAA,yBAAoCA,KAAK,CAAC,CAAD,CAAL,CAASL,WAA7C;AAAA;AAPI,CAAf;;AAUO,SAASW,WAAT,CAAqBC,KAArB,EAAsC;AAC3C,SAAO,qBAAIT,MAAJ,EAAY,UAACU,MAAD,EAAyCC,KAAzC,EAAmE;AACpF,QAAMC,GAAG,GAAGH,KAAK,CAACE,KAAD,CAAjB;AACA,WAAOC,GAAG,IAAIF,MAAM,CAACE,GAAD,CAApB;AACD,GAHM,EAIJC,MAJI,CAIGC,OAJH,EAKJhB,IALI,CAKC,MALD,CAAP;AAMD;;AAEc,SAASiB,KAAT,CAAeN,KAAf,EAAgC;AAC7C,MAAMO,QAAQ,GAAGR,WAAW,CAACC,KAAD,CAA5B;AACA,SAAOO,QAAQ,GAAG,gCAAC,oBAAD;AAAU,IAAA,IAAI,EAAEA,QAAhB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAAH,GAAkC,IAAjD;AACD;;AAEDD,KAAK,CAACE,SAAN,GAAkB;AAChBhB,EAAAA,MAAM,EAAEiB,sBAAU3B,KADF;AAEhBY,EAAAA,UAAU,EAAEe,sBAAU3B,KAFN;AAGhBa,EAAAA,IAAI,EAAEc,sBAAU3B,KAHA;AAIhBc,EAAAA,GAAG,EAAEa,sBAAU3B,KAJC;AAKhBe,EAAAA,KAAK,EAAEY,sBAAU3B,KALD;AAMhBgB,EAAAA,OAAO,EAAEW,sBAAU3B;AANH,CAAlB","sourcesContent":["import React from 'react';\n\nimport { TagObject, TagProps } from 'react-docgen';\n\nimport map from 'lodash/map';\nimport PropTypes from 'prop-types';\nimport Markdown from 'react-styleguidist/lib/client/rsg-components/Markdown';\n\nconst plural = (array: TagObject[], caption: string) =>\n array.length === 1 ? caption : `${caption}s`;\nconst list = (array: TagObject[]) => array.map((item) => item.description).join(', ');\nconst paragraphs = (array: TagObject[]) => array.map((item) => item.description).join('\\n\\n');\n\nconst fields = {\n author: (value: TagObject[]) => `${plural(value, 'Author')}: ${list(value)}`,\n default: (value: TagObject[]) => `**Default**: ${value[0].default}`,\n deprecated: (value: TagObject[]) => `**Deprecated:** ${value[0].description}`,\n link: (value: TagObject[]) => paragraphs(value),\n see: (value: TagObject[]) => paragraphs(value),\n since: (value: TagObject[]) => `Since: ${value[0].description}`,\n version: (value: TagObject[]) => `Version: ${value[0].description}`,\n};\n\nexport function getMarkdown(props: TagProps) {\n return map(fields, (format: (value: TagObject[]) => string, field: keyof TagProps) => {\n const tag = props[field];\n return tag && format(tag);\n })\n .filter(Boolean)\n .join('\\n\\n');\n}\n\nexport default function JsDoc(props: TagProps) {\n const markdown = getMarkdown(props);\n return markdown ? <Markdown text={markdown} /> : null;\n}\n\nJsDoc.propTypes = {\n author: PropTypes.array,\n deprecated: PropTypes.array,\n link: PropTypes.array,\n see: PropTypes.array,\n since: PropTypes.array,\n version: PropTypes.array,\n};\n"]}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
Object.defineProperty(exports, "__esModule", {
|
|
2
|
-
value: true
|
|
3
|
-
});
|
|
4
|
-
exports["default"] = void 0;
|
|
5
|
-
|
|
6
|
-
var _default = function _default(_ref) {
|
|
7
|
-
var children = _ref.children;
|
|
8
|
-
return children;
|
|
9
|
-
};
|
|
10
|
-
|
|
11
|
-
exports["default"] = _default;
|
|
12
|
-
//# sourceMappingURL=Markdown.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["Markdown.tsx"],"names":["children"],"mappings":";;;;;eAAe;AAAA,MAAGA,QAAH,QAAGA,QAAH;AAAA,SAAkBA,QAAlB;AAAA,C","sourcesContent":["export default ({ children }) => children;\n"]}
|