stream-chat-react-native-core 9.0.0-beta.7 → 9.0.0-beta.8
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/commonjs/components/Attachment/VideoThumbnail.js +2 -2
- package/lib/commonjs/components/Attachment/VideoThumbnail.js.map +1 -1
- package/lib/commonjs/components/AttachmentPicker/components/AttachmentMediaPicker/AttachmentMediaPicker.js +5 -8
- package/lib/commonjs/components/AttachmentPicker/components/AttachmentMediaPicker/AttachmentMediaPicker.js.map +1 -1
- package/lib/commonjs/components/AttachmentPicker/components/AttachmentMediaPicker/AttachmentPickerItem.js +2 -2
- package/lib/commonjs/components/AttachmentPicker/components/AttachmentMediaPicker/AttachmentPickerItem.js.map +1 -1
- package/lib/commonjs/components/AttachmentPicker/components/AttachmentMediaPicker/shared.js +9 -0
- package/lib/commonjs/components/AttachmentPicker/components/AttachmentMediaPicker/shared.js.map +1 -0
- package/lib/commonjs/components/AttachmentPicker/components/AttachmentPickerContent.js +10 -78
- package/lib/commonjs/components/AttachmentPicker/components/AttachmentPickerContent.js.map +1 -1
- package/lib/commonjs/components/AttachmentPicker/components/AttachmentPickerGenericContent.js +83 -0
- package/lib/commonjs/components/AttachmentPicker/components/AttachmentPickerGenericContent.js.map +1 -0
- package/lib/commonjs/components/Channel/Channel.js +2 -1
- package/lib/commonjs/components/Channel/Channel.js.map +1 -1
- package/lib/commonjs/components/ImageGallery/components/ImageGalleryFooter.js +2 -2
- package/lib/commonjs/components/ImageGallery/components/ImageGalleryFooter.js.map +1 -1
- package/lib/commonjs/components/ImageGallery/components/ImageGalleryHeader.js +2 -2
- package/lib/commonjs/components/ImageGallery/components/ImageGalleryHeader.js.map +1 -1
- package/lib/commonjs/components/ImageGallery/components/ImageGrid.js +4 -4
- package/lib/commonjs/components/ImageGallery/components/ImageGrid.js.map +1 -1
- package/lib/commonjs/components/ImageGallery/components/types.js +4 -0
- package/lib/commonjs/components/ImageGallery/components/types.js.map +1 -0
- package/lib/commonjs/components/ImageGallery/hooks/useImageGalleryVideoPlayer.js +2 -2
- package/lib/commonjs/components/ImageGallery/hooks/useImageGalleryVideoPlayer.js.map +1 -1
- package/lib/commonjs/components/MessageMenu/EmojiPickerList.js +5 -5
- package/lib/commonjs/components/MessageMenu/EmojiPickerList.js.map +1 -1
- package/lib/commonjs/components/MessageMenu/MessageReactionPicker.js +1 -8
- package/lib/commonjs/components/MessageMenu/MessageReactionPicker.js.map +1 -1
- package/lib/commonjs/components/MessageMenu/utils/toUnicodeScalarString.js +12 -0
- package/lib/commonjs/components/MessageMenu/utils/toUnicodeScalarString.js.map +1 -0
- package/lib/commonjs/components/index.js +33 -0
- package/lib/commonjs/components/index.js.map +1 -1
- package/lib/commonjs/components/ui/SpeedSettingsButton.js +3 -3
- package/lib/commonjs/components/ui/SpeedSettingsButton.js.map +1 -1
- package/lib/commonjs/components/ui/VideoPlayIndicator.js +3 -3
- package/lib/commonjs/components/ui/VideoPlayIndicator.js.map +1 -1
- package/lib/commonjs/contexts/imageGalleryContext/ImageGalleryContext.js +15 -12
- package/lib/commonjs/contexts/imageGalleryContext/ImageGalleryContext.js.map +1 -1
- package/lib/commonjs/contexts/imageGalleryContext/ImageGalleryContextBase.js +18 -0
- package/lib/commonjs/contexts/imageGalleryContext/ImageGalleryContextBase.js.map +1 -0
- package/lib/commonjs/hooks/messagePreview/useMessagePreviewText.js +2 -2
- package/lib/commonjs/hooks/messagePreview/useMessagePreviewText.js.map +1 -1
- package/lib/commonjs/hooks/useAttachmentPickerState.js +2 -2
- package/lib/commonjs/hooks/useAttachmentPickerState.js.map +1 -1
- package/lib/commonjs/version.json +1 -1
- package/lib/module/components/Attachment/VideoThumbnail.js +2 -2
- package/lib/module/components/Attachment/VideoThumbnail.js.map +1 -1
- package/lib/module/components/AttachmentPicker/components/AttachmentMediaPicker/AttachmentMediaPicker.js +5 -8
- package/lib/module/components/AttachmentPicker/components/AttachmentMediaPicker/AttachmentMediaPicker.js.map +1 -1
- package/lib/module/components/AttachmentPicker/components/AttachmentMediaPicker/AttachmentPickerItem.js +2 -2
- package/lib/module/components/AttachmentPicker/components/AttachmentMediaPicker/AttachmentPickerItem.js.map +1 -1
- package/lib/module/components/AttachmentPicker/components/AttachmentMediaPicker/shared.js +9 -0
- package/lib/module/components/AttachmentPicker/components/AttachmentMediaPicker/shared.js.map +1 -0
- package/lib/module/components/AttachmentPicker/components/AttachmentPickerContent.js +10 -78
- package/lib/module/components/AttachmentPicker/components/AttachmentPickerContent.js.map +1 -1
- package/lib/module/components/AttachmentPicker/components/AttachmentPickerGenericContent.js +83 -0
- package/lib/module/components/AttachmentPicker/components/AttachmentPickerGenericContent.js.map +1 -0
- package/lib/module/components/Channel/Channel.js +2 -1
- package/lib/module/components/Channel/Channel.js.map +1 -1
- package/lib/module/components/ImageGallery/components/ImageGalleryFooter.js +2 -2
- package/lib/module/components/ImageGallery/components/ImageGalleryFooter.js.map +1 -1
- package/lib/module/components/ImageGallery/components/ImageGalleryHeader.js +2 -2
- package/lib/module/components/ImageGallery/components/ImageGalleryHeader.js.map +1 -1
- package/lib/module/components/ImageGallery/components/ImageGrid.js +4 -4
- package/lib/module/components/ImageGallery/components/ImageGrid.js.map +1 -1
- package/lib/module/components/ImageGallery/components/types.js +4 -0
- package/lib/module/components/ImageGallery/components/types.js.map +1 -0
- package/lib/module/components/ImageGallery/hooks/useImageGalleryVideoPlayer.js +2 -2
- package/lib/module/components/ImageGallery/hooks/useImageGalleryVideoPlayer.js.map +1 -1
- package/lib/module/components/MessageMenu/EmojiPickerList.js +5 -5
- package/lib/module/components/MessageMenu/EmojiPickerList.js.map +1 -1
- package/lib/module/components/MessageMenu/MessageReactionPicker.js +1 -8
- package/lib/module/components/MessageMenu/MessageReactionPicker.js.map +1 -1
- package/lib/module/components/MessageMenu/utils/toUnicodeScalarString.js +12 -0
- package/lib/module/components/MessageMenu/utils/toUnicodeScalarString.js.map +1 -0
- package/lib/module/components/index.js +33 -0
- package/lib/module/components/index.js.map +1 -1
- package/lib/module/components/ui/SpeedSettingsButton.js +3 -3
- package/lib/module/components/ui/SpeedSettingsButton.js.map +1 -1
- package/lib/module/components/ui/VideoPlayIndicator.js +3 -3
- package/lib/module/components/ui/VideoPlayIndicator.js.map +1 -1
- package/lib/module/contexts/imageGalleryContext/ImageGalleryContext.js +15 -12
- package/lib/module/contexts/imageGalleryContext/ImageGalleryContext.js.map +1 -1
- package/lib/module/contexts/imageGalleryContext/ImageGalleryContextBase.js +18 -0
- package/lib/module/contexts/imageGalleryContext/ImageGalleryContextBase.js.map +1 -0
- package/lib/module/hooks/messagePreview/useMessagePreviewText.js +2 -2
- package/lib/module/hooks/messagePreview/useMessagePreviewText.js.map +1 -1
- package/lib/module/hooks/useAttachmentPickerState.js +2 -2
- package/lib/module/hooks/useAttachmentPickerState.js.map +1 -1
- package/lib/module/version.json +1 -1
- package/lib/typescript/components/AttachmentPicker/components/AttachmentMediaPicker/AttachmentMediaPicker.d.ts +1 -8
- package/lib/typescript/components/AttachmentPicker/components/AttachmentMediaPicker/AttachmentMediaPicker.d.ts.map +1 -1
- package/lib/typescript/components/AttachmentPicker/components/AttachmentMediaPicker/AttachmentPickerItem.d.ts +1 -1
- package/lib/typescript/components/AttachmentPicker/components/AttachmentMediaPicker/AttachmentPickerItem.d.ts.map +1 -1
- package/lib/typescript/components/AttachmentPicker/components/AttachmentMediaPicker/shared.d.ts +8 -0
- package/lib/typescript/components/AttachmentPicker/components/AttachmentMediaPicker/shared.d.ts.map +1 -0
- package/lib/typescript/components/AttachmentPicker/components/AttachmentPickerContent.d.ts +2 -10
- package/lib/typescript/components/AttachmentPicker/components/AttachmentPickerContent.d.ts.map +1 -1
- package/lib/typescript/components/AttachmentPicker/components/AttachmentPickerGenericContent.d.ts +13 -0
- package/lib/typescript/components/AttachmentPicker/components/AttachmentPickerGenericContent.d.ts.map +1 -0
- package/lib/typescript/components/Channel/Channel.d.ts.map +1 -1
- package/lib/typescript/components/ImageGallery/components/ImageGalleryFooter.d.ts +1 -11
- package/lib/typescript/components/ImageGallery/components/ImageGalleryFooter.d.ts.map +1 -1
- package/lib/typescript/components/ImageGallery/components/ImageGalleryHeader.d.ts +1 -5
- package/lib/typescript/components/ImageGallery/components/ImageGalleryHeader.d.ts.map +1 -1
- package/lib/typescript/components/ImageGallery/components/ImageGalleryVideoControl.d.ts +1 -1
- package/lib/typescript/components/ImageGallery/components/ImageGalleryVideoControl.d.ts.map +1 -1
- package/lib/typescript/components/ImageGallery/components/ImageGrid.d.ts +1 -4
- package/lib/typescript/components/ImageGallery/components/ImageGrid.d.ts.map +1 -1
- package/lib/typescript/components/ImageGallery/components/types.d.ts +21 -0
- package/lib/typescript/components/ImageGallery/components/types.d.ts.map +1 -0
- package/lib/typescript/components/MessageMenu/MessageReactionPicker.d.ts +0 -1
- package/lib/typescript/components/MessageMenu/MessageReactionPicker.d.ts.map +1 -1
- package/lib/typescript/components/MessageMenu/utils/toUnicodeScalarString.d.ts +2 -0
- package/lib/typescript/components/MessageMenu/utils/toUnicodeScalarString.d.ts.map +1 -0
- package/lib/typescript/components/index.d.ts +3 -0
- package/lib/typescript/components/index.d.ts.map +1 -1
- package/lib/typescript/contexts/imageGalleryContext/ImageGalleryContext.d.ts +3 -22
- package/lib/typescript/contexts/imageGalleryContext/ImageGalleryContext.d.ts.map +1 -1
- package/lib/typescript/contexts/imageGalleryContext/ImageGalleryContextBase.d.ts +19 -0
- package/lib/typescript/contexts/imageGalleryContext/ImageGalleryContextBase.d.ts.map +1 -0
- package/package.json +1 -1
- package/src/components/Attachment/VideoThumbnail.tsx +1 -1
- package/src/components/AttachmentPicker/components/AttachmentMediaPicker/AttachmentMediaPicker.tsx +3 -12
- package/src/components/AttachmentPicker/components/AttachmentMediaPicker/AttachmentPickerItem.tsx +1 -1
- package/src/components/AttachmentPicker/components/AttachmentMediaPicker/shared.ts +10 -0
- package/src/components/AttachmentPicker/components/AttachmentPickerContent.tsx +8 -84
- package/src/components/AttachmentPicker/components/AttachmentPickerGenericContent.tsx +90 -0
- package/src/components/Channel/Channel.tsx +2 -4
- package/src/components/ImageGallery/components/ImageGalleryFooter.tsx +4 -24
- package/src/components/ImageGallery/components/ImageGalleryHeader.tsx +4 -12
- package/src/components/ImageGallery/components/ImageGalleryVideoControl.tsx +1 -1
- package/src/components/ImageGallery/components/ImageGrid.tsx +4 -7
- package/src/components/ImageGallery/components/types.ts +25 -0
- package/src/components/ImageGallery/hooks/useImageGalleryVideoPlayer.ts +1 -1
- package/src/components/MessageMenu/EmojiPickerList.tsx +2 -2
- package/src/components/MessageMenu/MessageReactionPicker.tsx +0 -8
- package/src/components/MessageMenu/utils/toUnicodeScalarString.ts +5 -0
- package/src/components/index.ts +3 -0
- package/src/components/ui/SpeedSettingsButton.tsx +1 -1
- package/src/components/ui/VideoPlayIndicator.tsx +1 -1
- package/src/contexts/imageGalleryContext/ImageGalleryContext.tsx +9 -44
- package/src/contexts/imageGalleryContext/ImageGalleryContextBase.tsx +44 -0
- package/src/hooks/messagePreview/useMessagePreviewText.tsx +1 -1
- package/src/hooks/useAttachmentPickerState.ts +1 -1
- package/src/version.json +1 -1
|
@@ -215,13 +215,11 @@ import { emojis } from '../MessageMenu/emojis';
|
|
|
215
215
|
import { MessageActionList as MessageActionListDefault } from '../MessageMenu/MessageActionList';
|
|
216
216
|
import { MessageActionListItem as MessageActionListItemDefault } from '../MessageMenu/MessageActionListItem';
|
|
217
217
|
import { MessageMenu as MessageMenuDefault } from '../MessageMenu/MessageMenu';
|
|
218
|
-
import {
|
|
219
|
-
MessageReactionPicker as MessageReactionPickerDefault,
|
|
220
|
-
toUnicodeScalarString,
|
|
221
|
-
} from '../MessageMenu/MessageReactionPicker';
|
|
218
|
+
import { MessageReactionPicker as MessageReactionPickerDefault } from '../MessageMenu/MessageReactionPicker';
|
|
222
219
|
import { MessageUserReactions as MessageUserReactionsDefault } from '../MessageMenu/MessageUserReactions';
|
|
223
220
|
import { MessageUserReactionsAvatar as MessageUserReactionsAvatarDefault } from '../MessageMenu/MessageUserReactionsAvatar';
|
|
224
221
|
import { MessageUserReactionsItem as MessageUserReactionsItemDefault } from '../MessageMenu/MessageUserReactionsItem';
|
|
222
|
+
import { toUnicodeScalarString } from '../MessageMenu/utils/toUnicodeScalarString';
|
|
225
223
|
import { Reply as ReplyDefault } from '../Reply/Reply';
|
|
226
224
|
|
|
227
225
|
export type MarkReadFunctionOptions = {
|
|
@@ -1,16 +1,10 @@
|
|
|
1
1
|
import React, { useMemo, useRef, useState } from 'react';
|
|
2
2
|
import { ActivityIndicator, StyleSheet, Text, View, ViewStyle } from 'react-native';
|
|
3
|
-
import Animated, {
|
|
4
|
-
Extrapolation,
|
|
5
|
-
interpolate,
|
|
6
|
-
SharedValue,
|
|
7
|
-
useAnimatedStyle,
|
|
8
|
-
} from 'react-native-reanimated';
|
|
3
|
+
import Animated, { Extrapolation, interpolate, useAnimatedStyle } from 'react-native-reanimated';
|
|
9
4
|
|
|
10
|
-
import {
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
} from '../../../contexts/imageGalleryContext/ImageGalleryContext';
|
|
5
|
+
import type { ImageGalleryFooterProps, ImageGalleryVideoControlProps } from './types';
|
|
6
|
+
|
|
7
|
+
import { useImageGalleryContext } from '../../../contexts/imageGalleryContext/ImageGalleryContextBase';
|
|
14
8
|
import { useTheme } from '../../../contexts/themeContext/ThemeContext';
|
|
15
9
|
import { useTranslationContext } from '../../../contexts/translationContext/TranslationContext';
|
|
16
10
|
import { useStateStore } from '../../../hooks/useStateStore';
|
|
@@ -38,24 +32,10 @@ export type ImageGalleryFooterCustomComponent = ({
|
|
|
38
32
|
shareMenuOpen: boolean;
|
|
39
33
|
}) => React.ReactElement | null;
|
|
40
34
|
|
|
41
|
-
export type ImageGalleryVideoControlProps = {
|
|
42
|
-
attachmentId: string;
|
|
43
|
-
};
|
|
44
|
-
|
|
45
35
|
export type ImageGalleryVideoControlComponent = ({
|
|
46
36
|
attachmentId,
|
|
47
37
|
}: ImageGalleryVideoControlProps) => React.ReactElement | null;
|
|
48
38
|
|
|
49
|
-
export type ImageGalleryFooterProps = Pick<
|
|
50
|
-
ImageGalleryProviderProps,
|
|
51
|
-
'ImageGalleryVideoControls'
|
|
52
|
-
> & {
|
|
53
|
-
accessibilityLabel: string;
|
|
54
|
-
opacity: SharedValue<number>;
|
|
55
|
-
openGridView: () => void;
|
|
56
|
-
visible: SharedValue<number>;
|
|
57
|
-
};
|
|
58
|
-
|
|
59
39
|
const imageGallerySelector = (state: ImageGalleryState) => ({
|
|
60
40
|
asset: state.assets[state.currentIndex],
|
|
61
41
|
currentIndex: state.currentIndex,
|
|
@@ -2,14 +2,11 @@ import React, { useEffect, useMemo, useState } from 'react';
|
|
|
2
2
|
|
|
3
3
|
import { StyleSheet, Text, View, ViewStyle } from 'react-native';
|
|
4
4
|
|
|
5
|
-
import Animated, {
|
|
6
|
-
Extrapolation,
|
|
7
|
-
interpolate,
|
|
8
|
-
SharedValue,
|
|
9
|
-
useAnimatedStyle,
|
|
10
|
-
} from 'react-native-reanimated';
|
|
5
|
+
import Animated, { Extrapolation, interpolate, useAnimatedStyle } from 'react-native-reanimated';
|
|
11
6
|
|
|
12
|
-
import {
|
|
7
|
+
import type { ImageGalleryHeaderProps } from './types';
|
|
8
|
+
|
|
9
|
+
import { useImageGalleryContext } from '../../../contexts/imageGalleryContext/ImageGalleryContextBase';
|
|
13
10
|
import { useOverlayContext } from '../../../contexts/overlayContext/OverlayContext';
|
|
14
11
|
import { useTheme } from '../../../contexts/themeContext/ThemeContext';
|
|
15
12
|
import { useTranslationContext } from '../../../contexts/translationContext/TranslationContext';
|
|
@@ -26,11 +23,6 @@ const ReanimatedSafeAreaView = Animated.createAnimatedComponent
|
|
|
26
23
|
? Animated.createAnimatedComponent(SafeAreaView)
|
|
27
24
|
: SafeAreaView;
|
|
28
25
|
|
|
29
|
-
export type ImageGalleryHeaderProps = {
|
|
30
|
-
opacity: SharedValue<number>;
|
|
31
|
-
visible: SharedValue<number>;
|
|
32
|
-
};
|
|
33
|
-
|
|
34
26
|
const imageGallerySelector = (state: ImageGalleryState) => ({
|
|
35
27
|
asset: state.assets[state.currentIndex],
|
|
36
28
|
});
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React, { useCallback, useMemo } from 'react';
|
|
2
2
|
import { StyleSheet, Text, View } from 'react-native';
|
|
3
3
|
|
|
4
|
-
import { ImageGalleryVideoControlProps } from './
|
|
4
|
+
import type { ImageGalleryVideoControlProps } from './types';
|
|
5
5
|
|
|
6
6
|
import { useTheme } from '../../../contexts/themeContext/ThemeContext';
|
|
7
7
|
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import React, { useMemo } from 'react';
|
|
2
2
|
import { Image, Pressable, StyleSheet, View } from 'react-native';
|
|
3
3
|
|
|
4
|
+
import type { ImageGalleryGridProps } from './types';
|
|
5
|
+
|
|
4
6
|
import { VideoThumbnail } from '../../../components/Attachment/VideoThumbnail';
|
|
5
|
-
import { useImageGalleryContext } from '../../../contexts/imageGalleryContext/
|
|
7
|
+
import { useImageGalleryContext } from '../../../contexts/imageGalleryContext/ImageGalleryContextBase';
|
|
6
8
|
import { useTheme } from '../../../contexts/themeContext/ThemeContext';
|
|
7
9
|
import { useStateStore } from '../../../hooks/useStateStore';
|
|
8
10
|
import { useViewport } from '../../../hooks/useViewport';
|
|
@@ -11,7 +13,7 @@ import type {
|
|
|
11
13
|
ImageGalleryState,
|
|
12
14
|
} from '../../../state-store/image-gallery-state-store';
|
|
13
15
|
import { FileTypes } from '../../../types/types';
|
|
14
|
-
import { StreamBottomSheetModalFlatList } from '../../UIComponents';
|
|
16
|
+
import { StreamBottomSheetModalFlatList } from '../../UIComponents/StreamBottomSheetModalFlatList';
|
|
15
17
|
|
|
16
18
|
export type ImageGalleryGridImageComponent = ({
|
|
17
19
|
item,
|
|
@@ -51,11 +53,6 @@ const GridImage = ({ item }: { item: GridImageItem }) => {
|
|
|
51
53
|
|
|
52
54
|
const renderItem = ({ item }: { item: GridImageItem }) => <GridImage item={item} />;
|
|
53
55
|
|
|
54
|
-
export type ImageGalleryGridProps = {
|
|
55
|
-
closeGridView: () => void;
|
|
56
|
-
numberOfImageGalleryGridColumns?: number;
|
|
57
|
-
};
|
|
58
|
-
|
|
59
56
|
const imageGallerySelector = (state: ImageGalleryState) => ({
|
|
60
57
|
assets: state.assets,
|
|
61
58
|
});
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import type React from 'react';
|
|
2
|
+
|
|
3
|
+
import type { SharedValue } from 'react-native-reanimated';
|
|
4
|
+
|
|
5
|
+
export type ImageGalleryVideoControlProps = {
|
|
6
|
+
attachmentId: string;
|
|
7
|
+
};
|
|
8
|
+
|
|
9
|
+
export type ImageGalleryHeaderProps = {
|
|
10
|
+
opacity: SharedValue<number>;
|
|
11
|
+
visible: SharedValue<number>;
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
export type ImageGalleryFooterProps = {
|
|
15
|
+
accessibilityLabel: string;
|
|
16
|
+
ImageGalleryVideoControls?: React.ComponentType<ImageGalleryVideoControlProps>;
|
|
17
|
+
opacity: SharedValue<number>;
|
|
18
|
+
openGridView: () => void;
|
|
19
|
+
visible: SharedValue<number>;
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
export type ImageGalleryGridProps = {
|
|
23
|
+
closeGridView: () => void;
|
|
24
|
+
numberOfImageGalleryGridColumns?: number;
|
|
25
|
+
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { useMemo } from 'react';
|
|
2
2
|
|
|
3
|
-
import { useImageGalleryContext } from '../../../contexts/imageGalleryContext/
|
|
3
|
+
import { useImageGalleryContext } from '../../../contexts/imageGalleryContext/ImageGalleryContextBase';
|
|
4
4
|
import { VideoPlayerOptions } from '../../../state-store/video-player';
|
|
5
5
|
|
|
6
6
|
export type UseImageGalleryVideoPlayerProps = VideoPlayerOptions;
|
|
@@ -5,9 +5,9 @@ import { Pressable } from 'react-native-gesture-handler';
|
|
|
5
5
|
import { emojis } from './emojis';
|
|
6
6
|
|
|
7
7
|
import { useHasOwnReaction } from './hooks/useHasOwnReaction';
|
|
8
|
-
import { toUnicodeScalarString } from './
|
|
8
|
+
import { toUnicodeScalarString } from './utils/toUnicodeScalarString';
|
|
9
9
|
|
|
10
|
-
import { useTheme } from '../../contexts';
|
|
10
|
+
import { useTheme } from '../../contexts/themeContext/ThemeContext';
|
|
11
11
|
import { useStableCallback } from '../../hooks';
|
|
12
12
|
import { primitives } from '../../theme';
|
|
13
13
|
import { StreamBottomSheetModalFlatList } from '../UIComponents';
|
|
@@ -133,14 +133,6 @@ export const EmojiViewerButton = ({
|
|
|
133
133
|
);
|
|
134
134
|
};
|
|
135
135
|
|
|
136
|
-
// TODO: V9: Move this to utils and also clean it up a bit.
|
|
137
|
-
// This was done quickly and in a bit of a hurry.
|
|
138
|
-
export const toUnicodeScalarString = (emoji: string): string => {
|
|
139
|
-
const out: number[] = [];
|
|
140
|
-
for (const ch of emoji) out.push(ch.codePointAt(0)!);
|
|
141
|
-
return out.map((cp) => `U+${cp.toString(16).toUpperCase().padStart(4, '0')}`).join('-');
|
|
142
|
-
};
|
|
143
|
-
|
|
144
136
|
/**
|
|
145
137
|
* MessageReactionPicker - A high level component which implements all the logic required for a message overlay reaction list
|
|
146
138
|
*/
|
package/src/components/index.ts
CHANGED
|
@@ -13,6 +13,7 @@ export * from './Attachment/utils/buildGallery/buildGallery';
|
|
|
13
13
|
export * from './AttachmentPicker/AttachmentPicker';
|
|
14
14
|
export * from './AttachmentPicker/components/AttachmentPickerContent';
|
|
15
15
|
export * from './AttachmentPicker/components/AttachmentMediaPicker';
|
|
16
|
+
export * from './AttachmentPicker/components/AttachmentMediaPicker/shared';
|
|
16
17
|
export * from './AttachmentPicker/components/AttachmentPickerSelectionBar';
|
|
17
18
|
export * from './AttachmentPicker/components/AttachmentTypePickerButton';
|
|
18
19
|
export * from './AttachmentPicker/components/ImageOverlaySelectedComponent';
|
|
@@ -68,6 +69,7 @@ export * from './ImageGallery/components/ImageGalleryFooter';
|
|
|
68
69
|
export * from './ImageGallery/components/ImageGalleryHeader';
|
|
69
70
|
export * from './ImageGallery/components/ImageGrid';
|
|
70
71
|
export * from './ImageGallery/components/ImageGalleryVideoControl';
|
|
72
|
+
export * from './ImageGallery/components/types';
|
|
71
73
|
export * from './ImageGallery/hooks/useImageGalleryVideoPlayer';
|
|
72
74
|
|
|
73
75
|
export * from './Indicators/EmptyStateIndicator';
|
|
@@ -165,6 +167,7 @@ export * from './MessageMenu/MessageMenu';
|
|
|
165
167
|
export * from './MessageMenu/MessageUserReactions';
|
|
166
168
|
export * from './MessageMenu/MessageUserReactionsAvatar';
|
|
167
169
|
export * from './MessageMenu/MessageReactionPicker';
|
|
170
|
+
export * from './MessageMenu/utils/toUnicodeScalarString';
|
|
168
171
|
export * from './MessageMenu/hooks/useFetchReactions';
|
|
169
172
|
|
|
170
173
|
export * from './ProgressControl/ProgressControl';
|
|
@@ -2,7 +2,7 @@ import React, { useMemo } from 'react';
|
|
|
2
2
|
|
|
3
3
|
import { Pressable, StyleProp, StyleSheet, Text, ViewStyle } from 'react-native';
|
|
4
4
|
|
|
5
|
-
import { useTheme } from '../../contexts';
|
|
5
|
+
import { useTheme } from '../../contexts/themeContext/ThemeContext';
|
|
6
6
|
import { primitives } from '../../theme';
|
|
7
7
|
|
|
8
8
|
export type SpeedSettingsButtonProps = {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React, { useMemo } from 'react';
|
|
2
2
|
import { StyleSheet, View } from 'react-native';
|
|
3
3
|
|
|
4
|
-
import { useTheme } from '../../contexts';
|
|
4
|
+
import { useTheme } from '../../contexts/themeContext/ThemeContext';
|
|
5
5
|
import { Play } from '../../icons/Play';
|
|
6
6
|
import { primitives } from '../../theme';
|
|
7
7
|
|
|
@@ -1,42 +1,17 @@
|
|
|
1
|
-
import React, { PropsWithChildren,
|
|
2
|
-
|
|
3
|
-
import { Attachment } from 'stream-chat';
|
|
1
|
+
import React, { PropsWithChildren, useEffect, useMemo, useState } from 'react';
|
|
4
2
|
|
|
5
3
|
import {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
4
|
+
ImageGalleryContext,
|
|
5
|
+
type ImageGalleryContextValue,
|
|
6
|
+
type ImageGalleryProviderProps,
|
|
7
|
+
useImageGalleryContext,
|
|
8
|
+
} from './ImageGalleryContextBase';
|
|
9
|
+
|
|
9
10
|
import { ImageGalleryFooter as ImageGalleryFooterDefault } from '../../components/ImageGallery/components/ImageGalleryFooter';
|
|
10
|
-
import { ImageGalleryHeaderProps } from '../../components/ImageGallery/components/ImageGalleryHeader';
|
|
11
11
|
import { ImageGalleryHeader as ImageGalleryHeaderDefault } from '../../components/ImageGallery/components/ImageGalleryHeader';
|
|
12
12
|
import { ImageGalleryVideoControl as ImageGalleryVideoControlDefault } from '../../components/ImageGallery/components/ImageGalleryVideoControl';
|
|
13
|
-
import { ImageGalleryGridProps } from '../../components/ImageGallery/components/ImageGrid';
|
|
14
13
|
import { ImageGalleryGrid as ImageGalleryGridDefault } from '../../components/ImageGallery/components/ImageGrid';
|
|
15
14
|
import { ImageGalleryStateStore } from '../../state-store/image-gallery-state-store';
|
|
16
|
-
import { DEFAULT_BASE_CONTEXT_VALUE } from '../utils/defaultBaseContextValue';
|
|
17
|
-
|
|
18
|
-
import { isTestEnvironment } from '../utils/isTestEnvironment';
|
|
19
|
-
|
|
20
|
-
export type ImageGalleryProviderProps = {
|
|
21
|
-
autoPlayVideo?: boolean;
|
|
22
|
-
/**
|
|
23
|
-
* The giphy version to render - check the keys of the [Image Object](https://developers.giphy.com/docs/api/schema#image-object) for possible values. Uses 'fixed_height' by default
|
|
24
|
-
* */
|
|
25
|
-
giphyVersion?: keyof NonNullable<Attachment['giphy']>;
|
|
26
|
-
numberOfImageGalleryGridColumns?: number;
|
|
27
|
-
ImageGalleryHeader?: React.ComponentType<ImageGalleryHeaderProps>;
|
|
28
|
-
ImageGalleryFooter?: React.ComponentType<ImageGalleryFooterProps>;
|
|
29
|
-
ImageGalleryVideoControls?: React.ComponentType<ImageGalleryVideoControlProps>;
|
|
30
|
-
ImageGalleryGrid?: React.ComponentType<ImageGalleryGridProps>;
|
|
31
|
-
};
|
|
32
|
-
|
|
33
|
-
export type ImageGalleryContextValue = ImageGalleryProviderProps & {
|
|
34
|
-
imageGalleryStateStore: ImageGalleryStateStore;
|
|
35
|
-
};
|
|
36
|
-
|
|
37
|
-
export const ImageGalleryContext = React.createContext(
|
|
38
|
-
DEFAULT_BASE_CONTEXT_VALUE as ImageGalleryContextValue,
|
|
39
|
-
);
|
|
40
15
|
|
|
41
16
|
export const ImageGalleryProvider = ({
|
|
42
17
|
children,
|
|
@@ -72,15 +47,5 @@ export const ImageGalleryProvider = ({
|
|
|
72
47
|
</ImageGalleryContext.Provider>
|
|
73
48
|
);
|
|
74
49
|
};
|
|
75
|
-
|
|
76
|
-
export
|
|
77
|
-
const contextValue = useContext(ImageGalleryContext) as unknown as ImageGalleryContextValue;
|
|
78
|
-
|
|
79
|
-
if (contextValue === DEFAULT_BASE_CONTEXT_VALUE && !isTestEnvironment()) {
|
|
80
|
-
throw new Error(
|
|
81
|
-
'The useImageGalleryContext hook was called outside the ImageGalleryContext Provider. Make sure you have configured OverlayProvider component correctly - https://getstream.io/chat/docs/sdk/reactnative/basics/hello_stream_chat/#overlay-provider',
|
|
82
|
-
);
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
return contextValue as ImageGalleryContextValue;
|
|
86
|
-
};
|
|
50
|
+
export { ImageGalleryContext, useImageGalleryContext };
|
|
51
|
+
export type { ImageGalleryContextValue, ImageGalleryProviderProps };
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import React, { useContext } from 'react';
|
|
2
|
+
|
|
3
|
+
import type { Attachment } from 'stream-chat';
|
|
4
|
+
|
|
5
|
+
import type {
|
|
6
|
+
ImageGalleryFooterProps,
|
|
7
|
+
ImageGalleryGridProps,
|
|
8
|
+
ImageGalleryHeaderProps,
|
|
9
|
+
ImageGalleryVideoControlProps,
|
|
10
|
+
} from '../../components/ImageGallery/components/types';
|
|
11
|
+
import { ImageGalleryStateStore } from '../../state-store/image-gallery-state-store';
|
|
12
|
+
import { DEFAULT_BASE_CONTEXT_VALUE } from '../utils/defaultBaseContextValue';
|
|
13
|
+
|
|
14
|
+
import { isTestEnvironment } from '../utils/isTestEnvironment';
|
|
15
|
+
|
|
16
|
+
export type ImageGalleryProviderProps = {
|
|
17
|
+
autoPlayVideo?: boolean;
|
|
18
|
+
giphyVersion?: keyof NonNullable<Attachment['giphy']>;
|
|
19
|
+
numberOfImageGalleryGridColumns?: number;
|
|
20
|
+
ImageGalleryHeader?: React.ComponentType<ImageGalleryHeaderProps>;
|
|
21
|
+
ImageGalleryFooter?: React.ComponentType<ImageGalleryFooterProps>;
|
|
22
|
+
ImageGalleryVideoControls?: React.ComponentType<ImageGalleryVideoControlProps>;
|
|
23
|
+
ImageGalleryGrid?: React.ComponentType<ImageGalleryGridProps>;
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
export type ImageGalleryContextValue = ImageGalleryProviderProps & {
|
|
27
|
+
imageGalleryStateStore: ImageGalleryStateStore;
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
export const ImageGalleryContext = React.createContext(
|
|
31
|
+
DEFAULT_BASE_CONTEXT_VALUE as ImageGalleryContextValue,
|
|
32
|
+
);
|
|
33
|
+
|
|
34
|
+
export const useImageGalleryContext = () => {
|
|
35
|
+
const contextValue = useContext(ImageGalleryContext) as unknown as ImageGalleryContextValue;
|
|
36
|
+
|
|
37
|
+
if (contextValue === DEFAULT_BASE_CONTEXT_VALUE && !isTestEnvironment()) {
|
|
38
|
+
throw new Error(
|
|
39
|
+
'The useImageGalleryContext hook was called outside the ImageGalleryContext Provider. Make sure you have configured OverlayProvider component correctly - https://getstream.io/chat/docs/sdk/reactnative/basics/hello_stream_chat/#overlay-provider',
|
|
40
|
+
);
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
return contextValue as ImageGalleryContextValue;
|
|
44
|
+
};
|
|
@@ -10,7 +10,7 @@ import {
|
|
|
10
10
|
import { useGroupedAttachments } from './useGroupedAttachments';
|
|
11
11
|
|
|
12
12
|
import { useChatContext } from '../../contexts/chatContext/ChatContext';
|
|
13
|
-
import { useStateStore } from '../../hooks';
|
|
13
|
+
import { useStateStore } from '../../hooks/useStateStore';
|
|
14
14
|
|
|
15
15
|
const selector = (nextValue: PollState) => ({
|
|
16
16
|
name: nextValue.name,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { useStateStore } from './useStateStore';
|
|
2
2
|
|
|
3
|
-
import { useAttachmentPickerContext } from '../contexts';
|
|
3
|
+
import { useAttachmentPickerContext } from '../contexts/attachmentPickerContext/AttachmentPickerContext';
|
|
4
4
|
import { AttachmentPickerState } from '../state-store/attachment-picker-store';
|
|
5
5
|
|
|
6
6
|
const selector = (nextState: AttachmentPickerState) => ({
|
package/src/version.json
CHANGED