Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion examples/vite/src/stream-imports-layout.scss
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
@use 'stream-chat-react/dist/scss/v2/MessageList/VirtualizedMessageList-layout';
// @use 'stream-chat-react/dist/scss/v2/MessageReactions/MessageReactions-layout';
@use 'stream-chat-react/dist/scss/v2/MessageReactions/MessageReactionsSelector-layout';
@use 'stream-chat-react/dist/scss/v2/Modal/Modal-layout';
//@use 'stream-chat-react/dist/scss/v2/Modal/Modal-layout';
@use 'stream-chat-react/dist/scss/v2/Notification/MessageNotification-layout';
@use 'stream-chat-react/dist/scss/v2/Notification/NotificationList-layout';
@use 'stream-chat-react/dist/scss/v2/Notification/Notification-layout';
Expand Down
4 changes: 1 addition & 3 deletions examples/vite/src/stream-imports-theme.scss
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
@use 'stream-chat-react/dist/scss/v2/palette-variables';
//@use 'stream-chat-react/dist/scss/v2/global-theme-variables';

@use 'stream-chat-react/dist/scss/v2/vendor/react-image-gallery';

@use 'stream-chat-react/dist/scss/v2/common/CTAButton/CTAButton-theme';
@use 'stream-chat-react/dist/scss/v2/common/CircleFAButton/CircleFAButton-theme';
//@use 'stream-chat-react/dist/scss/v2/Avatar/Avatar-theme';
Expand Down Expand Up @@ -30,7 +28,7 @@
@use 'stream-chat-react/dist/scss/v2/MessageList/VirtualizedMessageList-theme';
// @use 'stream-chat-react/dist/scss/v2/MessageReactions/MessageReactions-theme';
@use 'stream-chat-react/dist/scss/v2/MessageReactions/MessageReactionsSelector-theme';
@use 'stream-chat-react/dist/scss/v2/Modal/Modal-theme';
//@use 'stream-chat-react/dist/scss/v2/Modal/Modal-theme';
@use 'stream-chat-react/dist/scss/v2/Notification/MessageNotification-theme';
@use 'stream-chat-react/dist/scss/v2/Notification/NotificationList-theme';
@use 'stream-chat-react/dist/scss/v2/Notification/Notification-theme';
Expand Down
6 changes: 2 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,6 @@
"nanoid": "^3.3.4",
"react-dropzone": "^14.2.3",
"react-fast-compare": "^3.2.2",
"react-image-gallery": "1.2.12",
"react-markdown": "^9.0.3",
"react-player": "2.10.1",
"react-textarea-autosize": "^8.3.0",
Expand All @@ -120,7 +119,7 @@
"emoji-mart": "^5.4.0",
"react": "^19.0.0 || ^18.0.0 || ^17.0.0",
"react-dom": "^19.0.0 || ^18.0.0 || ^17.0.0",
"stream-chat": "^9.31.0"
"stream-chat": "^9.32.0"
},
"peerDependenciesMeta": {
"@breezystack/lamejs": {
Expand Down Expand Up @@ -180,7 +179,6 @@
"@types/moment": "^2.13.0",
"@types/react": "^19.0.7",
"@types/react-dom": "^19.0.3",
"@types/react-image-gallery": "^1.2.4",
"@types/textarea-caret": "3.0.0",
"@types/use-sync-external-store": "^0.0.6",
"@types/uuid": "^8.3.0",
Expand Down Expand Up @@ -215,7 +213,7 @@
"react-dom": "^19.0.0",
"sass": "^1.97.2",
"semantic-release": "^25.0.2",
"stream-chat": "^9.31.0",
"stream-chat": "^9.32.0",
"ts-jest": "^29.2.5",
"typescript": "^5.4.5",
"typescript-eslint": "^8.17.0",
Expand Down
23 changes: 12 additions & 11 deletions src/components/Attachment/Attachment.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import React, { useMemo } from 'react';
import type { SharedLocationResponse, Attachment as StreamAttachment } from 'stream-chat';
import {
isAudioAttachment,
isFileAttachment,
Expand All @@ -17,25 +18,25 @@ import {
MediaContainer,
UnsupportedAttachmentContainer,
} from './AttachmentContainer';
import type { GroupedRenderedAttachment } from './utils';
import { SUPPORTED_VIDEO_FORMATS } from './utils';
import { defaultAttachmentActionsDefaultFocus } from './AttachmentActions';

import type { ReactPlayerProps } from 'react-player';
import type { SharedLocationResponse, Attachment as StreamAttachment } from 'stream-chat';
import type {
AttachmentActionsDefaultFocusByType,
AttachmentActionsProps,
} from './AttachmentActions';
import { defaultAttachmentActionsDefaultFocus } from './AttachmentActions';
import type { AudioProps } from './Audio';
import type { VoiceRecordingProps } from './VoiceRecording';
import type { CardProps } from './LinkPreview/Card';
import type { FileAttachmentProps } from './FileAttachment';
import type { GalleryProps, ImageProps } from '../Gallery';
import type { GalleryItem } from '../Gallery';
import type { UnsupportedAttachmentProps } from './UnsupportedAttachment';
import type { ActionHandlerReturnType } from '../Message/hooks/useActionHandler';
import type { GroupedRenderedAttachment } from './utils';
import type { GeolocationProps } from './Geolocation';
import type { GiphyAttachmentProps } from './Giphy';
import type { VideoPlayerProps } from '../VideoPlayer';
import type { ModalGalleryProps } from './ModalGallery';
import type { ImageProps } from './Image';

export const ATTACHMENT_GROUPS_ORDER = [
'media',
Expand All @@ -61,8 +62,8 @@ export type AttachmentProps = {
Card?: React.ComponentType<CardProps>;
/** Custom UI component for displaying a file type attachment, defaults to and accepts same props as: [File](https://github.com/GetStream/stream-chat-react/blob/master/src/components/Attachment/FileAttachment.tsx) */
File?: React.ComponentType<FileAttachmentProps>;
/** Custom UI component for displaying a gallery of image type attachments, defaults to and accepts same props as: [Gallery](https://github.com/GetStream/stream-chat-react/blob/master/src/components/Gallery/Gallery.tsx) */
Gallery?: React.ComponentType<GalleryProps>;
/** Custom UI component for displaying a gallery of image type attachments, defaults to and accepts same props as: [ModalGallery](https://github.com/GetStream/stream-chat-react/blob/master/src/components/Gallery/ModalGallery.tsx) */
ModalGallery?: React.ComponentType<ModalGalleryProps>;
Geolocation?: React.ComponentType<GeolocationProps>;
/** Custom UI component for displaying a Giphy image, defaults to and accepts same props as: [Giphy](https://github.com/GetStream/stream-chat-react/blob/master/src/components/Attachment/Giphy.tsx) */
Giphy?: React.ComponentType<GiphyAttachmentProps>;
Expand All @@ -71,7 +72,7 @@ export type AttachmentProps = {
/** Optional flag to signal that an attachment is a displayed as a part of a quoted message */
isQuoted?: boolean;
/** Custom UI component for displaying a media type attachment, defaults to `ReactPlayer` from 'react-player' */
Media?: React.ComponentType<ReactPlayerProps>;
Media?: React.ComponentType<VideoPlayerProps>;
/** Custom UI component for displaying unsupported attachment types, defaults to NullComponent */
UnsupportedAttachment?: React.ComponentType<UnsupportedAttachmentProps>;
/** Custom UI component for displaying an audio recording attachment, defaults to and accepts same props as: [VoiceRecording](https://github.com/GetStream/stream-chat-react/blob/master/src/components/Attachment/VoiceRecording.tsx) */
Expand Down Expand Up @@ -113,7 +114,7 @@ const renderGroupedAttachments = ({
attachments,
...rest
}: AttachmentProps): GroupedRenderedAttachment => {
const mediaAttachments: StreamAttachment[] = [];
const mediaAttachments: GalleryItem[] = [];
const containers = attachments.reduce<GroupedRenderedAttachment>(
(typeMap, attachment) => {
if (isSharedLocationResponse(attachment)) {
Expand Down Expand Up @@ -144,7 +145,7 @@ const renderGroupedAttachments = ({
isImageAttachment(attachment) ||
isVideoAttachment(attachment, SUPPORTED_VIDEO_FORMATS)
) {
mediaAttachments.push(attachment);
mediaAttachments.push(attachment as GalleryItem);
} else if (
isAudioAttachment(attachment) ||
isVoiceRecordingAttachment(attachment) ||
Expand Down
Loading
Loading