sceyt-chat-react-uikit 1.9.0-beta.9 → 1.9.1-beta.1
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/components/ChannelList/index.d.ts +2 -0
- package/components/Message/Message.types.d.ts +1 -0
- package/components/Message/MessageReactions/index.d.ts +1 -0
- package/components/Messages/MessageList/index.d.ts +7 -0
- package/components/Messages/PinnedMessagesBanner.d.ts +9 -1
- package/components/Messages/PinnedMessagesList.d.ts +2 -1
- package/components/Messages/SystemMessage/index.d.ts +5 -1
- package/components/Messages/index.d.ts +7 -0
- package/components/SendMessageInput/FormatMessagePlugin/index.d.ts +22 -0
- package/components/SendMessageInput/MentionNode/index.d.ts +5 -0
- package/components/SendMessageInput/draftOwnership.d.ts +24 -0
- package/components/SendMessageInput/sendMessageUtils.d.ts +1 -0
- package/index.js +1242 -909
- package/index.modern.js +1242 -909
- package/package.json +1 -1
|
@@ -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
|
}
|
|
@@ -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;
|
|
@@ -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;
|
|
@@ -1,7 +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;
|
|
5
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;
|
|
6
14
|
}) => React.JSX.Element | null;
|
|
7
15
|
export default PinnedMessagesBanner;
|
|
@@ -10,10 +10,11 @@ declare type ScrollContainerComponent = React.ComponentType<any>;
|
|
|
10
10
|
declare type MessagesContainerComponent = React.ComponentType<{
|
|
11
11
|
children?: React.ReactNode;
|
|
12
12
|
}>;
|
|
13
|
-
declare const PinnedMessagesList: ({ channelId, onClose, closeRequested, renderMessage, ScrollContainer, MessagesContainer }: {
|
|
13
|
+
declare const PinnedMessagesList: ({ channelId, onClose, closeRequested, selectionIsActive, renderMessage, ScrollContainer, MessagesContainer }: {
|
|
14
14
|
channelId: string;
|
|
15
15
|
onClose: () => void;
|
|
16
16
|
closeRequested?: boolean | undefined;
|
|
17
|
+
selectionIsActive?: boolean | undefined;
|
|
17
18
|
renderMessage: RenderPinnedMessage;
|
|
18
19
|
ScrollContainer: ScrollContainerComponent;
|
|
19
20
|
MessagesContainer: MessagesContainerComponent;
|
|
@@ -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';
|
|
@@ -1,5 +1,26 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { IMessage, IMember } from '../../../types';
|
|
3
|
+
interface SerializedEditorChild {
|
|
4
|
+
type: string;
|
|
5
|
+
text: string;
|
|
6
|
+
format: number;
|
|
7
|
+
mentionName?: string;
|
|
8
|
+
mentionText?: string;
|
|
9
|
+
metadata?: string;
|
|
10
|
+
}
|
|
11
|
+
interface OffsetRange {
|
|
12
|
+
start: number;
|
|
13
|
+
end: number;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Converts Lexical's display text into the wire format used by message
|
|
17
|
+
* attributes. A mention is only converted to its ID token while its text has
|
|
18
|
+
* not been changed by the user. Once edited, it becomes ordinary text.
|
|
19
|
+
*/
|
|
20
|
+
export declare function serializeFormattedMessage(messageText: string, children: SerializedEditorChild[], offsetList: OffsetRange[]): {
|
|
21
|
+
messageText: string;
|
|
22
|
+
bodyAttributes: any[];
|
|
23
|
+
};
|
|
3
24
|
export default function FormatMessagePlugin({ editorState, setMessageBodyAttributes, setMessageText, setMentionedMember, messageToEdit, activeChannelMembers, contactsMap, getFromContacts }: {
|
|
4
25
|
editorState: any;
|
|
5
26
|
setMessageBodyAttributes: (data: any) => void;
|
|
@@ -10,3 +31,4 @@ export default function FormatMessagePlugin({ editorState, setMessageBodyAttribu
|
|
|
10
31
|
contactsMap: any;
|
|
11
32
|
getFromContacts: boolean;
|
|
12
33
|
}): JSX.Element | null;
|
|
34
|
+
export {};
|
|
@@ -2,7 +2,10 @@ import type { Spread, DOMConversionMap, DOMExportOutput, EditorConfig, LexicalNo
|
|
|
2
2
|
import { TextNode } from 'lexical';
|
|
3
3
|
export declare type SerializedMentionNode = Spread<{
|
|
4
4
|
mentionName: string;
|
|
5
|
+
/** The label inserted into the editor, used to detect later text edits. */
|
|
6
|
+
mentionText?: string;
|
|
5
7
|
}, SerializedTextNode>;
|
|
8
|
+
export declare function isMentionTextUnchanged(originalText: string | null | undefined, currentText: string): boolean;
|
|
6
9
|
export declare class MentionNode extends TextNode {
|
|
7
10
|
__mention: any;
|
|
8
11
|
mentionId: string;
|
|
@@ -12,6 +15,8 @@ export declare class MentionNode extends TextNode {
|
|
|
12
15
|
constructor(mention: any, text?: string, key?: NodeKey);
|
|
13
16
|
exportJSON(): SerializedMentionNode;
|
|
14
17
|
createDOM(config: EditorConfig): HTMLElement;
|
|
18
|
+
updateDOM(prevNode: MentionNode, dom: HTMLElement, config: EditorConfig): boolean;
|
|
19
|
+
private isUnchangedMention;
|
|
15
20
|
exportDOM(): DOMExportOutput;
|
|
16
21
|
static importDOM(): DOMConversionMap | null;
|
|
17
22
|
isTextEntity(): true;
|
|
@@ -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;
|