import { PropertyValueMap } from 'lit'; import { ReactableType } from '../types/reactions.types'; import { MemberDetailType } from '../types/members.types'; import { MeetingType } from '../types/meetings.types'; import { FileType } from '../types/files.types'; import { EmbedType } from '../types/embeds.types'; import { PollOptionType } from '../types/polls.types'; import { WeavySubAppComponent } from '../classes/weavy-sub-app-component'; import { AppType } from '../types/app.types'; import { ShadowPartsController } from '../controllers/shadow-parts-controller'; import { UserOrAgentType } from '../types/users.types'; declare global { interface HTMLElementTagNameMap { "wy-message": WyMessage; } } /** * Displays a single message in a conversation. * * **Used sub components:** * * - [``](./ui/wy-avatar.ts) * - [``](./ui/wy-item.ts) * - [``](./ui/wy-icon.ts) * - [``](./ui/wy-button.ts) * - [``](./ui/wy-dropdown.ts) * - [``](./ui/wy-skeleton.ts) * - [``](./wy-attachment.ts) * - [``](./wy-annotation.ts) * - [``](./wy-annotation.ts) * - [``](./wy-embed.ts) * - [``](./ui/wy-image-grid.ts) * - [``](./wy-meeting-card.ts) * - [``](./wy-poll.ts) * - [``](./wy-reactions.ts) * - [``](./wy-preview.ts) * * @csspart wy-message - Root message container. * @csspart wy-message-me - Modifier for messages from the current user. * @csspart wy-message-agent - Modifier for agent messages. * @csspart wy-highlight - Modifier used when a message is highlighted. * @csspart wy-message-author - Author/avatar area. * @csspart wy-message-content - Content wrapper. * @csspart wy-message-meta - Meta area (name/time). * @csspart wy-message-bubble - Message bubble. * @csspart wy-message-bubble-emoji - Bubble modifier for emoji-only messages. * @csspart wy-message-bubble-section - Sections inside the bubble (images, attachments, annotations). * @csspart wy-message-blocked - Modifier for a message whose blocked author's content is held back. * @csspart wy-message-report - The report flag in the meta row. * @csspart wy-message-report-reported - Modifier once the reader has reported it, carrying no action of its own. * @csspart wy-content - HTML/text content area. * @csspart wy-content-emoji - Content modifier for emoji-only content. * @csspart wy-message-seenby - Seen-by avatars area. * @csspart wy-annotations - Wrapper for annotation buttons (from wy-annotation-list). * @csspart wy-annotation - Annotation button (from wy-annotation). * @csspart wy-annotation-icon - Icon inside an annotation button. * @csspart wy-annotation-text - Text inside an annotation button. * * @fires {PollVoteEventType} vote - Emitted when a poll option is voted. * @fires {WyActionEventType} wy-action - Emitted when an entity action is triggered. * @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. */ export declare class WyMessage extends WeavySubAppComponent { #private; static styles: import('lit').CSSResult[]; protected exportParts: ShadowPartsController; /** * App context owning the message. */ conversation?: AppType; /** * Unique identifier for the rendered message. */ messageId: number; /** * The author of the message. */ author: UserOrAgentType; /** * True when the message was authored by the current user. */ get me(): boolean; /** * Render the message using private-conversation layout. */ isPrivateChat: boolean; /** * True when the viewer has blocked the author of this message. * * Passed in rather than read from `author.is_blocked`, because a message author never carries that flag -- authors * are mapped minimally, and the same payload is broadcast over realtime after being mapped once in the sender's * request, so caller-relative fields are left out of it. wy-conversation answers from the viewer's own block list * and, where the app has one, its member list. */ authorIsBlocked: boolean; /** * ISO timestamp when the message was created. */ createdAt: string; /** * HTML formatted message content. */ html: string; /** * Plain-text message content. */ text: string; /** * Annotation files attached to the message. */ annotations?: FileType[]; /** * Attachment files associated with the message. */ attachments?: FileType[]; /** * Meeting information attached to the message. */ meeting?: MeetingType; /** * Poll options available on the message. */ pollOptions: PollOptionType[] | undefined; /** * Embed metadata attached to the message. */ embed?: EmbedType; /** * Reactions applied to the message. */ reactions?: ReactableType[]; /** * Members who have seen the message. */ seenBy: MemberDetailType[]; /** * Highlight the message bubble when true. */ highlight: boolean; /** * Whether the authenticated user has already reported this message. * * Kept visible rather than hidden once set: the flag is the only record the reporter ever sees, since weavy stores no * report history and exposes no read API. Hosts that would rather reporting be fire-and-forget can hide it with * `::part(wy-message-report-reported)` -- shown by default, opt out per integration. */ reported: boolean; /** * When the authenticated user reported this message, used for the title on the report flag. */ reportedAt?: string; /** * Whether the content of a blocked author's message has been revealed by the reader. * * Per message and not persisted -- revealing one message says nothing about the next one, and the block itself is * unchanged either way. * * @internal */ private revealBlocked; /** * Preview instance used for annotation files. * @internal */ private previewAnnotationsRef; /** * Preview instance used for attachment files. * @internal */ private previewAttachmentsRef; /** * DOM reference used to scroll highlighted messages into view. * @internal */ private highlightRef; /** * Confirm and report the message for moderation. * * Uses the native confirm rather than an in-app dialog: reporting cannot be undone and there is no report to look up * afterwards, so the interruption is the point. * * @internal */ private confirmReport; /** * Emit a `vote` event for the specified poll option. * * @internal * @param optionId - Identifier of the selected poll option. * @returns {boolean} True if the event was not canceled. */ private dispatchVote; protected willUpdate(changedProperties: PropertyValueMap): void; render(): import('../../node_modules/lit-html/node/lit-html.js').TemplateResult<1>; protected updated(changedProperties: PropertyValueMap): void; } //# sourceMappingURL=wy-message.d.ts.map