import { PropertyValues } from 'lit'; import { PersistStateController } from './controllers/persist-state-controller'; import { ThemeController } from './controllers/theme-controller'; import { AppType, AppTypeGuid } from './types/app.types'; import { QueryController } from './controllers/query-controller'; import { ComponentFeatures } from './contexts/features-context'; import { ConversationFilterProps, UnreadConversationsController, UnreadConversationsProps } from './controllers/unread-conversations-controller'; import { CreateConversationController } from './controllers/create-conversation-controller'; import { MemberIdType } from './types/members.types'; import { WeavyTypeComponent } from './classes/weavy-type-component'; declare global { interface HTMLElementTagNameMap { "wy-messenger": WyMessenger; } } /** * @import { WyAppEventType } from "./types/app.events" * @import { WyUnreadEventType } from "./types/ui.events" */ /** * The Weavy Messenger component renders a full featured chat interface for private messaging and chat rooms. * * It displays a list of all conversations with possibility to pin, star and mark conversations as read. * Each conversation item displays an avatar, the participants or the room name as title, a line with the latest message. * It also indicates if the conversation is read/unread and if anyone in the conversation is typing. * * The list has a search in the top and can open a modal for creating new conversations where the user can search for other people or agents to create private chats or chat rooms. * * When a user clicks a conversation item, the conversation is loaded. * The conversation can show rich messages with markdown formatting including code syntax highlight. * Messages can have uploaded images, attached files and cloud files with full browser preview of 100+ formats. * Polls, video meetings, rich link embeds, tags and mentions can be used in messages. * Users can react with predefined emojis to each message. * * Read receipts indicate which messages that has been sent and read. * The online presence for users is indicated both in the conversation list as well as in the conversation. * * Typing indicators are shown when other users are typing in a conversation. * * New messages are indicated as new when received. * * For chat rooms, the name and avatar for the chat room can be edited. Members can be added or removed from the chat room. * * The editor features markdown preview, including code syntax highlighting. * It has buttons for adding polls, video meetings, images, files and cloud files. * Mentions brings up a user selector. * Drafts are automatically saved for each conversation. * * > Complement this with the [``](./wy-notification-toasts.ts) component to also get realtime _in-app notifications_ or _browser notifications_ when new messages arrive. * * ** Component layout ** * * The layout depends on the width of its container, which has a breakpoint at `768px`. * * - In narrow layouts, the conversation list and chat will be stacked and clicking on a conversation in the list will navigate to the chat. * - In wider layouts, the component has a side-by-side layout with the conversation list on the left hand side and the chat window on the right hand side. * * The component is [block-level](https://developer.mozilla.org/en-US/docs/Glossary/Block-level_content) with pre-defined CSS styling to adapt to flex- and grid-layouts as well as traditional flow-layouts. * It's usually recommended to use a proper flex-layout for the container you are placing the component in for a smooth layout integration. * * The content within the components is per default aligned to the edges of it's own _box_ and designed to not be placed next to a edge or border. * It's recommended to adjust the layout with your default padding. Setting the `--wy-padding-outer` to your default padding will allow the component to still fill the are where it's placed, * but with proper padding within the scrollable area of the component. * If you want to make the component go all the way to the edges without padding or any outermost roundness instead, * set `--wy-padding-outer: 0;` and `--wy-border-radius-outer: 0;` to make the component fit nicely with the edge. * * You can add additional styling using _CSS Custom Properties_ and _CSS Shadow Parts_ and further customization using _slots_. * * **Used sub components:** * * - [``](./components/ui/wy-badge.ts) * - [``](./components/ui/wy-button.ts) * - [``](./components/ui/wy-container.ts) * - [``](./components/wy-conversation.ts) * - [``](./components/wy-conversation-header.ts) * - [``](./components/wy-conversation-list.ts) * - [``](./components/wy-conversation-new.ts) * - [``](./components/wy-context-data.ts) * - [``](./components/wy-empty.ts) * - [``](./components/ui/wy-icon.ts) * * @tagname wy-messenger * @fires {WyActionEventType} wy-action - Emitted when a conversation is created or an action is performed on a conversation. * @fires {WyPreviewOpenEventType} wy-preview-open - Fired when a preview overlay is about to open. * @fires {WyPreviewCloseEventType} wy-preview-close - Fired when a preview overlay is closed. * @fires {WyUnreadEventType} wy-unread - Emitted when the number of unread notifications change. * * @slot header - Header content rendered above the conversation list. * @slot actions - Action buttons for the conversation list toolbar. * @slot conversation-new - Custom content for the new-conversation action. * @csspart wy-messenger-layout - Main messenger layout. * @csspart wy-scroll-y - Scrollable surface used by list and conversation sections. * @csspart wy-messenger-conversation-list - Container for the conversation list. * @csspart wy-messenger-conversation - Container for the active conversation. * @csspart wy-close-conversation - Wrapper around the close button and unread badge. * * @example Standard Messenger * * A messenger placed in a container using a flex layout. * * ```html *
* *
* ``` * * @example Messenger adapting to edges * * Messenger that adapts to fit nicely with the edges of a panel. * * ```html * *
* *
* ``` */ export declare class WyMessenger extends WeavyTypeComponent implements UnreadConversationsProps, ConversationFilterProps { static styles: import('lit').CSSResult[]; /** @internal */ componentFeatures: ComponentFeatures; /** @internal */ protected theme: ThemeController; /** @internal */ protected unreadConversationsController: UnreadConversationsController; /** @internal */ protected createConversationController: CreateConversationController; /** Conversation types included in the messenger list. */ appTypes: AppTypeGuid[]; /** Current unread conversation count. */ get unread(): number; /** * Placeholder text for the message editor. */ placeholder?: string; /** Active conversation id. */ conversationId?: number | null; /** @internal */ protected conversationQuery: QueryController; /** @internal */ protected persistState: PersistStateController; /** @internal */ private conversationListRef; /** @internal */ private conversationNewRef; /** * Creates a new conversation. * * @param members - Optional array of member ids or member uids. */ createConversation(members?: MemberIdType[]): Promise; /** * Opens the select member dialog to let the user select members for creating a conversation. * * @returns Promise resolving to any selected member ids or uids. */ selectMembers(): Promise; protected willUpdate(changedProperties: PropertyValues): Promise; render(): import('../node_modules/lit-html/node/lit-html.js').TemplateResult<1>; } //# sourceMappingURL=wy-messenger.d.ts.map