sceyt-chat-react-uikit 1.9.0 → 1.9.1-beta.10

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.
@@ -99,6 +99,7 @@ export declare const DraftMessageTitle: import("styled-components").StyledCompon
99
99
  }, never>;
100
100
  export declare const DraftMessageText: import("styled-components").StyledComponent<"span", any, {
101
101
  color: string;
102
+ flex: boolean;
102
103
  }, never>;
103
104
  export declare const LastMessageAuthor: import("styled-components").StyledComponent<"div", any, {
104
105
  color: string;
@@ -0,0 +1,10 @@
1
+ /// <reference types="react" />
2
+ /**
3
+ * Animate only layout moves caused by a change in channel order.
4
+ * Rows must be direct children of the list, carry `data-channel-row-id`, and the
5
+ * list must be their offset parent (positioned) so offsetTop shares the list's
6
+ * scroll coordinates.
7
+ */
8
+ export declare const useChannelReorderAnimation: (channels: {
9
+ id: string;
10
+ }[]) => import("react").MutableRefObject<HTMLDivElement | null>;
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- import { IAttachment, IChannel, ICustomAvatarColors, IMember, IMessage, IUser } from '../../types';
2
+ import { IAttachment, IChannel, IContact, ICustomAvatarColors, IMember, IMessage, IUser } from '../../types';
3
3
  import { InviteLinkOptions } from '../../helpers/channelHalper';
4
4
  export interface IProgress {
5
5
  loaded: number;
@@ -84,6 +84,7 @@ export interface IChatClientProps {
84
84
  updateMembersEvent?: (channelId: string, updatedMembers: IMember[], members: IMember[]) => IMember[];
85
85
  } | null;
86
86
  showOwnMessageForward?: boolean;
87
+ contacts?: IContact[] | null;
87
88
  }
88
- declare const SceytChatContainer: ({ client, theme, themeMode, avatarColors, children, showOnlyContactUsers, handleNewMessages, sendAttachmentsAsSeparateMessages, membersDisplayTextByChannelTypesMap, defaultRolesByChannelTypesMap, channelTypeFilter, logoSrc, CustomUploader, showNotifications, hideUserPresence, openChatOnUserInteraction, autoSelectFirstChannel, logLevel, memberCount, disableFrowardMentionsCount, chatMinWidth, baseUrlForInviteMembers, useInviteLink, inviteLinkOptions, embeddedJoinGroupPopup, onUpdateChannel, disappearingSettings, customLoadMembersFunctions, showOwnMessageForward }: IChatClientProps) => React.JSX.Element;
89
+ declare const SceytChatContainer: ({ client, theme, themeMode, avatarColors, children, showOnlyContactUsers, handleNewMessages, sendAttachmentsAsSeparateMessages, membersDisplayTextByChannelTypesMap, defaultRolesByChannelTypesMap, channelTypeFilter, logoSrc, CustomUploader, showNotifications, hideUserPresence, openChatOnUserInteraction, autoSelectFirstChannel, logLevel, memberCount, disableFrowardMentionsCount, chatMinWidth, baseUrlForInviteMembers, useInviteLink, inviteLinkOptions, embeddedJoinGroupPopup, onUpdateChannel, disappearingSettings, customLoadMembersFunctions, showOwnMessageForward, contacts }: IChatClientProps) => React.JSX.Element;
89
90
  export default SceytChatContainer;
@@ -28,6 +28,7 @@ declare type TimelineItem = {
28
28
  export interface UseChatControllerParams {
29
29
  messages: IMessage[];
30
30
  channel: IChannel;
31
+ openAtLatest?: boolean;
31
32
  hasPrevMessages: boolean;
32
33
  hasNextMessages: boolean;
33
34
  loadingPrevMessages: number | null;
@@ -49,7 +50,7 @@ export interface UseChatControllerParams {
49
50
  tabIsActive?: boolean;
50
51
  }
51
52
  export declare const formatMessageDateLabel: (message: IMessage) => string;
52
- export declare function useChatController({ messages, channel, hasPrevMessages, hasNextMessages, loadingPrevMessages, loadingNextMessages, connectionStatus, scrollToNewMessage, scrollToMentionedMessage, showScrollToNewMessageButton, unreadScrollTo, unreadMessageId, visibleMessagesMap, selectedMessagesMap, allowEditDeleteIncomingMessage, tabIsActive, dispatch }: UseChatControllerParams): {
53
+ export declare function useChatController({ messages, channel, openAtLatest, hasPrevMessages, hasNextMessages, loadingPrevMessages, loadingNextMessages, connectionStatus, scrollToNewMessage, scrollToMentionedMessage, showScrollToNewMessageButton, unreadScrollTo, unreadMessageId, visibleMessagesMap, selectedMessagesMap, allowEditDeleteIncomingMessage, tabIsActive, dispatch }: UseChatControllerParams): {
53
54
  scrollRef: import("react").MutableRefObject<HTMLDivElement | null>;
54
55
  setLastVisibleMessageId: (message: IMessage) => void;
55
56
  handleScrollToRepliedMessage: (itemId: string, smooth?: boolean) => Promise<void>;
@@ -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;
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
2
  import { IChatClientProps } from '../ChatContainer';
3
- declare const SceytChat: ({ client, theme, themeMode, avatarColors, children, showOnlyContactUsers, logoSrc, CustomUploader, handleNewMessages, sendAttachmentsAsSeparateMessages, membersDisplayTextByChannelTypesMap, channelTypeFilter, defaultRolesByChannelTypesMap, hideUserPresence, showNotifications, openChatOnUserInteraction, autoSelectFirstChannel, memberCount, disableFrowardMentionsCount, chatMinWidth, embeddedJoinGroupPopup, onUpdateChannel }: IChatClientProps) => React.JSX.Element;
3
+ declare const SceytChat: ({ client, theme, themeMode, avatarColors, children, showOnlyContactUsers, logoSrc, CustomUploader, handleNewMessages, sendAttachmentsAsSeparateMessages, membersDisplayTextByChannelTypesMap, channelTypeFilter, defaultRolesByChannelTypesMap, hideUserPresence, showNotifications, openChatOnUserInteraction, autoSelectFirstChannel, memberCount, disableFrowardMentionsCount, chatMinWidth, embeddedJoinGroupPopup, onUpdateChannel, contacts }: IChatClientProps) => React.JSX.Element;
4
4
  export default SceytChat;
5
5
  export declare const Container: import("styled-components").StyledComponent<"div", any, {}, never>;
@@ -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;
@@ -8,19 +8,15 @@ export declare class MentionTypeaheadOption extends MenuOption {
8
8
  avatarUrl?: string;
9
9
  constructor(name: string, id: string, presence?: any, avatarUrl?: string);
10
10
  }
11
- export default function MentionsPlugin({ contactsMap, userId, getFromContacts, setMentionMember, setMentionsIsOpen, members, channelId }: {
11
+ export default function MentionsPlugin({ contactsMap, userId, getFromContacts, setMentionMember, members, channelId }: {
12
12
  contactsMap: IContactsMap;
13
13
  userId: string;
14
14
  getFromContacts?: boolean;
15
15
  setMentionMember: (member: any) => void;
16
- setMentionsIsOpen: (state: boolean) => void;
17
16
  members: IMember[];
18
17
  channelId?: string;
19
18
  }): JSX.Element | null;
20
- export declare const MentionsContainerWrapper: import("styled-components").StyledComponent<"div", any, {
21
- mentionsIsOpen?: boolean | undefined;
22
- ref?: any;
23
- }, never>;
19
+ export declare const MentionsContainerWrapper: import("styled-components").StyledComponent<"div", any, {}, never>;
24
20
  export declare const MemberItem: import("styled-components").StyledComponent<"li", any, {
25
21
  isActiveItem?: boolean | undefined;
26
22
  activeBackgroundColor: string;
@@ -0,0 +1,8 @@
1
+ declare type DraftMentionSegment = {
2
+ text: string;
3
+ mentionId?: string;
4
+ mentionedUser?: any;
5
+ };
6
+ /** Splits a serialized draft into plain text and mention ranges for editor restoration. */
7
+ export declare const getDraftMentionSegments: (text: string, bodyAttributes?: any[], mentionedUsers?: any[]) => DraftMentionSegment[];
8
+ export {};