sceyt-chat-react-uikit 1.9.0-beta.8 → 1.9.0
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/assets/svg/chevron_right_circle.svg +3 -0
- package/components/ChannelList/index.d.ts +2 -0
- package/components/Message/Message.types.d.ts +3 -0
- package/components/Message/MessageReactions/index.d.ts +1 -0
- package/components/Message/index.d.ts +1 -1
- package/components/Messages/MessageList/index.d.ts +10 -0
- package/components/Messages/MessageList/useChatController.d.ts +1 -0
- package/components/Messages/PinnedMessagesBanner.d.ts +10 -1
- package/components/Messages/PinnedMessagesList.d.ts +21 -0
- package/components/Messages/SystemMessage/index.d.ts +5 -1
- package/components/Messages/index.d.ts +7 -0
- package/components/SendMessageInput/draftOwnership.d.ts +24 -0
- package/components/SendMessageInput/sendMessageUtils.d.ts +1 -0
- package/index.js +10808 -9832
- package/index.modern.js +10808 -9832
- package/package.json +1 -1
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
+
<path fill-rule="evenodd" clip-rule="evenodd" d="M3.125 10C3.125 6.20304 6.20304 3.125 10 3.125C13.797 3.125 16.875 6.20304 16.875 10C16.875 13.797 13.797 16.875 10 16.875C6.20304 16.875 3.125 13.797 3.125 10ZM10 1.25C5.16751 1.25 1.25 5.16751 1.25 10C1.25 14.8325 5.16751 18.75 10 18.75C14.8325 18.75 18.75 14.8325 18.75 10C18.75 5.16751 14.8325 1.25 10 1.25ZM9.91291 6.52283C9.5468 6.15672 8.95321 6.15672 8.58709 6.52283C8.22097 6.88895 8.22097 7.48254 8.58709 7.84866L10.7384 9.99994L8.58709 12.1512C8.22097 12.5173 8.22097 13.1109 8.58709 13.477C8.95321 13.8432 9.5468 13.8432 9.91291 13.477L12.7271 10.6629C12.9029 10.487 13.0017 10.2486 13.0017 9.99994C13.0017 9.7513 12.9029 9.51284 12.7271 9.33703L9.91291 6.52283Z" fill="#818C99"/>
|
|
3
|
+
</svg>
|
|
@@ -32,6 +32,8 @@ interface IChannelListProps {
|
|
|
32
32
|
searchInputBorderRadius?: string;
|
|
33
33
|
searchChannelsPadding?: string;
|
|
34
34
|
getSelectedChannel?: (channel: IChannel) => void;
|
|
35
|
+
/** Called whenever the raw channel-search input changes, including clear. */
|
|
36
|
+
onSearchValueChange?: (value: string) => void;
|
|
35
37
|
filter?: {
|
|
36
38
|
channelType?: string;
|
|
37
39
|
};
|
|
@@ -74,6 +74,7 @@ interface ICustomMessageItem {
|
|
|
74
74
|
isThreadMessage?: boolean;
|
|
75
75
|
handleOpenUserProfile: (user: IUser) => void;
|
|
76
76
|
unsupportedMessage: boolean;
|
|
77
|
+
isPinnedMessagesList?: boolean;
|
|
77
78
|
onInviteLinkClick?: (key: string) => void;
|
|
78
79
|
ifLatestAndHasNotPreview: boolean;
|
|
79
80
|
}
|
|
@@ -90,6 +91,8 @@ export interface IMessageProps {
|
|
|
90
91
|
queueReadMarker?: (channelId: string, messageId?: string) => void;
|
|
91
92
|
queueDeliveredMarker?: (channelId: string, messageId?: string) => void;
|
|
92
93
|
disableAutoReadTracking?: boolean;
|
|
94
|
+
/** The message is rendered inside the pinned-messages overlay, not #scrollableDiv. */
|
|
95
|
+
isPinnedMessagesList?: boolean;
|
|
93
96
|
handleScrollToRepliedMessage: (msgId: string) => void;
|
|
94
97
|
handleMediaItemClick?: (attachment: IAttachment) => void;
|
|
95
98
|
unreadMessageId: string;
|
|
@@ -31,6 +31,7 @@ interface MessageReactionsProps {
|
|
|
31
31
|
reactionsContainerPadding?: string;
|
|
32
32
|
reactionsDetailsPopupBorderRadius?: string;
|
|
33
33
|
reactionsDetailsPopupHeaderItemsStyle?: 'bubbles' | 'inline';
|
|
34
|
+
popupZIndex?: number;
|
|
34
35
|
onToggleReactionsPopup: () => void;
|
|
35
36
|
onReactionAddDelete: (selectedEmoji: string) => void;
|
|
36
37
|
onOpenUserProfile: (user?: any) => void;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { IMessageProps } from './Message.types';
|
|
3
|
-
declare const _default: React.MemoExoticComponent<({ message, channel, MessageActionsMenu, CustomMessageItem, handleScrollToRepliedMessage, handleMediaItemClick, stopScrolling, isPendingMessage, prevMessage, nextMessage, setLastVisibleMessageId, queueReadMarker, queueDeliveredMarker, disableAutoReadTracking, isUnreadMessage, nextMessageStartsUnreadSection, unreadMessageId, isThreadMessage, fontFamily, ownMessageOnRightSide, messageWidthPercent, showSenderNameOnDirectChannel, showSenderNameOnGroupChannel, showSenderNameOnOwnMessages, messageStatusAndTimePosition, messageStatusDisplayingType, outgoingMessageStyles, incomingMessageStyles, ownRepliedMessageBackground, incomingRepliedMessageBackground, showOwnAvatar, showMessageStatus, showMessageTimeAndStatusOnlyOnHover, showMessageTime, showMessageStatusForEachMessage, showMessageTimeForEachMessage, hoverBackground, messageReaction, editMessage, copyMessage, replyMessage, replyMessageInThread, deleteMessage, selectMessage, showInfoMessage, allowEditDeleteIncomingMessage, forwardMessage, reportMessage, reactionIcon, editIcon, copyIcon, replyIcon, replyInThreadIcon, forwardIcon, deleteIcon, selectIcon, starIcon, staredIcon, reportIcon, retractVoteIcon, endVoteIcon, reactionIconOrder, openFrequentlyUsedReactions, editIconOrder, copyIconOrder, replyIconOrder, replyInThreadIconOrder, forwardIconOrder, deleteIconOrder, selectIconOrder, starIconOrder, reportIconOrder, infoIconOrder, reactionIconTooltipText, editIconTooltipText, copyIconTooltipText, replyIconTooltipText, replyInThreadIconTooltipText, forwardIconTooltipText, deleteIconTooltipText, selectIconTooltipText, starIconTooltipText, reportIconTooltipText, infoIconTooltipText, messageActionIconsColor, messageStatusSize, messageStatusColor, messageReadStatusColor, messageStateFontSize, messageStateColor, messageTimeFontSize, messageTimeColor, messageStatusAndTimeLineHeight, fileAttachmentsIcon, reactionsDisplayCount, showEachReactionCount, showTotalReactionCount, reactionItemBorder, reactionItemBorderRadius, reactionItemBackground, reactionItemPadding, reactionItemMargin, reactionsFontSize, reactionsContainerBoxShadow, reactionsContainerBorder, reactionsContainerBorderRadius, reactionsContainerBackground, reactionsContainerPadding, reactionsContainerTopPosition, reactionsDetailsPopupBorderRadius, reactionsDetailsPopupHeaderItemsStyle, fileAttachmentsBoxWidth, fileAttachmentsBoxBorder, fileAttachmentsTitleColor, fileAttachmentsSizeColor, imageAttachmentMaxWidth, imageAttachmentMaxHeight, videoAttachmentMaxWidth, videoAttachmentMaxHeight, emojisCategoryIconsPosition, emojisContainerBorderRadius, fixEmojiCategoriesTitleOnTop, sameUserMessageSpacing, differentUserMessageSpacing, selectedMessagesMap, contactsMap, openedMessageMenuId, tabIsActive, tabIsActiveRef, connectionStatus, messageTextFontSize, messageTextLineHeight, messageTimeColorOnAttachment, shouldOpenUserProfileForMention, ogMetadataProps, showInfoMessageProps, collapsedLinesLimit, createChatOnAvatarTap, ifLatestAndHasNotPreview }: IMessageProps) => React.JSX.Element>;
|
|
3
|
+
declare const _default: React.MemoExoticComponent<({ message, channel, MessageActionsMenu, CustomMessageItem, handleScrollToRepliedMessage, handleMediaItemClick, stopScrolling, isPendingMessage, prevMessage, nextMessage, setLastVisibleMessageId, queueReadMarker, queueDeliveredMarker, disableAutoReadTracking, isUnreadMessage, nextMessageStartsUnreadSection, unreadMessageId, isThreadMessage, fontFamily, ownMessageOnRightSide, messageWidthPercent, showSenderNameOnDirectChannel, showSenderNameOnGroupChannel, showSenderNameOnOwnMessages, messageStatusAndTimePosition, messageStatusDisplayingType, outgoingMessageStyles, incomingMessageStyles, ownRepliedMessageBackground, incomingRepliedMessageBackground, showOwnAvatar, showMessageStatus, showMessageTimeAndStatusOnlyOnHover, showMessageTime, showMessageStatusForEachMessage, showMessageTimeForEachMessage, hoverBackground, messageReaction, editMessage, copyMessage, replyMessage, replyMessageInThread, deleteMessage, selectMessage, showInfoMessage, allowEditDeleteIncomingMessage, forwardMessage, reportMessage, reactionIcon, editIcon, copyIcon, replyIcon, replyInThreadIcon, forwardIcon, deleteIcon, selectIcon, starIcon, staredIcon, reportIcon, retractVoteIcon, endVoteIcon, reactionIconOrder, openFrequentlyUsedReactions, editIconOrder, copyIconOrder, replyIconOrder, replyInThreadIconOrder, forwardIconOrder, deleteIconOrder, selectIconOrder, starIconOrder, reportIconOrder, infoIconOrder, reactionIconTooltipText, editIconTooltipText, copyIconTooltipText, replyIconTooltipText, replyInThreadIconTooltipText, forwardIconTooltipText, deleteIconTooltipText, selectIconTooltipText, starIconTooltipText, reportIconTooltipText, infoIconTooltipText, messageActionIconsColor, messageStatusSize, messageStatusColor, messageReadStatusColor, messageStateFontSize, messageStateColor, messageTimeFontSize, messageTimeColor, messageStatusAndTimeLineHeight, fileAttachmentsIcon, reactionsDisplayCount, showEachReactionCount, showTotalReactionCount, reactionItemBorder, reactionItemBorderRadius, reactionItemBackground, reactionItemPadding, reactionItemMargin, reactionsFontSize, reactionsContainerBoxShadow, reactionsContainerBorder, reactionsContainerBorderRadius, reactionsContainerBackground, reactionsContainerPadding, reactionsContainerTopPosition, reactionsDetailsPopupBorderRadius, reactionsDetailsPopupHeaderItemsStyle, fileAttachmentsBoxWidth, fileAttachmentsBoxBorder, fileAttachmentsTitleColor, fileAttachmentsSizeColor, imageAttachmentMaxWidth, imageAttachmentMaxHeight, videoAttachmentMaxWidth, videoAttachmentMaxHeight, emojisCategoryIconsPosition, emojisContainerBorderRadius, fixEmojiCategoriesTitleOnTop, sameUserMessageSpacing, differentUserMessageSpacing, selectedMessagesMap, contactsMap, openedMessageMenuId, tabIsActive, tabIsActiveRef, connectionStatus, messageTextFontSize, messageTextLineHeight, messageTimeColorOnAttachment, shouldOpenUserProfileForMention, ogMetadataProps, showInfoMessageProps, collapsedLinesLimit, createChatOnAvatarTap, ifLatestAndHasNotPreview, isPinnedMessagesList }: IMessageProps) => React.JSX.Element>;
|
|
4
4
|
export default _default;
|
|
@@ -106,6 +106,13 @@ interface MessagesProps {
|
|
|
106
106
|
endVoteIcon?: JSX.Element;
|
|
107
107
|
/** Replaces the default pin icon in the pinned-messages banner. */
|
|
108
108
|
pinnedMessageIcon?: JSX.Element;
|
|
109
|
+
/**
|
|
110
|
+
* Replaces the compact pinned-message preview for app-specific message
|
|
111
|
+
* types. Return null or undefined to use the UIKit preview.
|
|
112
|
+
*/
|
|
113
|
+
renderPinnedMessagePreview?: (message: IMessage, context: {
|
|
114
|
+
placement: 'banner' | 'system';
|
|
115
|
+
}) => React.ReactNode | null | undefined;
|
|
109
116
|
messageStatusSize?: string;
|
|
110
117
|
messageStatusColor?: string;
|
|
111
118
|
messageReadStatusColor?: string;
|
|
@@ -224,6 +231,9 @@ export declare const Container: import("styled-components").StyledComponent<"div
|
|
|
224
231
|
backgroundColor?: string | undefined;
|
|
225
232
|
thumbColor: string;
|
|
226
233
|
}, never>;
|
|
234
|
+
export declare const MessagesBox: import("styled-components").StyledComponent<"div", any, {
|
|
235
|
+
$isJumping?: boolean | undefined;
|
|
236
|
+
}, never>;
|
|
227
237
|
export declare const DragAndDropContainer: import("styled-components").StyledComponent<"div", any, {
|
|
228
238
|
topOffset?: number | undefined;
|
|
229
239
|
height?: number | undefined;
|
|
@@ -48,6 +48,7 @@ export interface UseChatControllerParams {
|
|
|
48
48
|
dispatch: (...args: any[]) => void;
|
|
49
49
|
tabIsActive?: boolean;
|
|
50
50
|
}
|
|
51
|
+
export declare const formatMessageDateLabel: (message: IMessage) => string;
|
|
51
52
|
export declare function useChatController({ messages, channel, hasPrevMessages, hasNextMessages, loadingPrevMessages, loadingNextMessages, connectionStatus, scrollToNewMessage, scrollToMentionedMessage, showScrollToNewMessageButton, unreadScrollTo, unreadMessageId, visibleMessagesMap, selectedMessagesMap, allowEditDeleteIncomingMessage, tabIsActive, dispatch }: UseChatControllerParams): {
|
|
52
53
|
scrollRef: import("react").MutableRefObject<HTMLDivElement | null>;
|
|
53
54
|
setLastVisibleMessageId: (message: IMessage) => void;
|
|
@@ -1,6 +1,15 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
|
|
2
|
+
import { IMessage } from '../../types';
|
|
3
|
+
declare const PinnedMessagesBanner: ({ channelId, pinIcon, onOpenList, renderPinnedMessagePreview }: {
|
|
3
4
|
channelId: string;
|
|
4
5
|
pinIcon?: JSX.Element | undefined;
|
|
6
|
+
onOpenList?: (() => void) | undefined;
|
|
7
|
+
/**
|
|
8
|
+
* Lets an integrator replace the compact preview for app-specific message
|
|
9
|
+
* types. Return null or undefined to keep the UIKit preview.
|
|
10
|
+
*/
|
|
11
|
+
renderPinnedMessagePreview?: ((message: IMessage, context: {
|
|
12
|
+
placement: 'banner' | 'system';
|
|
13
|
+
}) => React.ReactNode | null | undefined) | undefined;
|
|
5
14
|
}) => React.JSX.Element | null;
|
|
6
15
|
export default PinnedMessagesBanner;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { IMessage } from '../../types';
|
|
3
|
+
declare type RenderPinnedMessage = (args: {
|
|
4
|
+
message: IMessage;
|
|
5
|
+
prevMessage: IMessage | null;
|
|
6
|
+
nextMessage: IMessage | null;
|
|
7
|
+
index: number;
|
|
8
|
+
}) => React.ReactNode;
|
|
9
|
+
declare type ScrollContainerComponent = React.ComponentType<any>;
|
|
10
|
+
declare type MessagesContainerComponent = React.ComponentType<{
|
|
11
|
+
children?: React.ReactNode;
|
|
12
|
+
}>;
|
|
13
|
+
declare const PinnedMessagesList: ({ channelId, onClose, closeRequested, renderMessage, ScrollContainer, MessagesContainer }: {
|
|
14
|
+
channelId: string;
|
|
15
|
+
onClose: () => void;
|
|
16
|
+
closeRequested?: boolean | undefined;
|
|
17
|
+
renderMessage: RenderPinnedMessage;
|
|
18
|
+
ScrollContainer: ScrollContainerComponent;
|
|
19
|
+
MessagesContainer: MessagesContainerComponent;
|
|
20
|
+
}) => React.JSX.Element;
|
|
21
|
+
export default PinnedMessagesList;
|
|
@@ -14,8 +14,12 @@ interface ISystemMessageProps {
|
|
|
14
14
|
backgroundColor?: string;
|
|
15
15
|
borderRadius?: string;
|
|
16
16
|
setLastVisibleMessageId?: (message: IMessage) => void;
|
|
17
|
+
/** Replaces a PM source-message preview for app-specific message types. */
|
|
18
|
+
renderPinnedMessagePreview?: (message: IMessage, context: {
|
|
19
|
+
placement: 'banner' | 'system';
|
|
20
|
+
}) => React.ReactNode | null | undefined;
|
|
17
21
|
}
|
|
18
|
-
declare const _default: React.MemoExoticComponent<({ message, nextMessage, channel, differentUserMessageSpacing, fontSize, textColor, border, backgroundColor, borderRadius, contactsMap, setLastVisibleMessageId }: ISystemMessageProps) => React.JSX.Element>;
|
|
22
|
+
declare const _default: React.MemoExoticComponent<({ message, nextMessage, channel, differentUserMessageSpacing, fontSize, textColor, border, backgroundColor, borderRadius, contactsMap, setLastVisibleMessageId, renderPinnedMessagePreview }: ISystemMessageProps) => React.JSX.Element>;
|
|
19
23
|
export default _default;
|
|
20
24
|
export declare const Container: import("styled-components").StyledComponent<"div", any, {
|
|
21
25
|
topOffset?: number | undefined;
|
|
@@ -99,6 +99,13 @@ interface MessagesProps {
|
|
|
99
99
|
endVoteIcon?: JSX.Element;
|
|
100
100
|
/** Replaces the default pin icon in the pinned-messages banner. */
|
|
101
101
|
pinnedMessageIcon?: JSX.Element;
|
|
102
|
+
/**
|
|
103
|
+
* Replaces the compact pinned-message preview for app-specific message
|
|
104
|
+
* types. Return null or undefined to use the UIKit preview.
|
|
105
|
+
*/
|
|
106
|
+
renderPinnedMessagePreview?: (message: IMessage, context: {
|
|
107
|
+
placement: 'banner' | 'system';
|
|
108
|
+
}) => React.ReactNode | null | undefined;
|
|
102
109
|
openFrequentlyUsedReactions?: boolean;
|
|
103
110
|
fixEmojiCategoriesTitleOnTop?: boolean;
|
|
104
111
|
emojisCategoryIconsPosition?: 'top' | 'bottom';
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
export declare type ComposerDraft = {
|
|
2
|
+
text: string;
|
|
3
|
+
mentionedUsers: any[];
|
|
4
|
+
messageForReply: any;
|
|
5
|
+
editorState: any;
|
|
6
|
+
bodyAttributes: any;
|
|
7
|
+
attachments: any[];
|
|
8
|
+
viewOnce: boolean;
|
|
9
|
+
};
|
|
10
|
+
export declare type DraftHandoff = {
|
|
11
|
+
channelId: string;
|
|
12
|
+
draft: ComposerDraft;
|
|
13
|
+
persist: boolean;
|
|
14
|
+
};
|
|
15
|
+
declare type ComposerState = ComposerDraft & {
|
|
16
|
+
channelId: string;
|
|
17
|
+
nextChannelId: string;
|
|
18
|
+
};
|
|
19
|
+
/**
|
|
20
|
+
* Returns the only draft write allowed while the active chat changes. The
|
|
21
|
+
* composer values belong to `channelId`, never to `nextChannelId`.
|
|
22
|
+
*/
|
|
23
|
+
export declare const getDraftHandoff: ({ channelId, nextChannelId, text, mentionedUsers, messageForReply, editorState, bodyAttributes, attachments, viewOnce }: ComposerState) => DraftHandoff | null;
|
|
24
|
+
export {};
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
export declare const hasSendableTextOrPoll: (messageText: string, isPoll: boolean) => boolean;
|
|
2
2
|
export declare const DEFAULT_MEDIA_EXTENSIONS: string[];
|
|
3
3
|
export declare const isDefaultSupportedMediaMimeType: (mimeType: string) => boolean;
|
|
4
|
+
export declare const getClipboardFiles: (clipboardData: Pick<DataTransfer, 'files' | 'items'>) => File[];
|
|
4
5
|
declare type MediaAttachmentValidationOptions = {
|
|
5
6
|
allowedExtensions?: string[];
|
|
6
7
|
sizeLimitKb?: number;
|