diff --git a/src/components/chat/chat.ts b/src/components/chat/chat.ts index ca1356a4d..5aead824a 100644 --- a/src/components/chat/chat.ts +++ b/src/components/chat/chat.ts @@ -30,6 +30,7 @@ import { all } from './themes/themes.js'; import type { ChatRenderContext, ChatTemplateRenderer, + IgcChatDraftMessage, IgcChatMessage, IgcChatMessageAttachment, IgcChatMessageReaction, @@ -113,6 +114,8 @@ const Slots = setSlots( 'typing-indicator' ); +/* blazorIndirectRender */ +/* blazorSupportsVisualChildren */ /** * A chat UI component for displaying messages, attachments, and input interaction. * @@ -260,6 +263,8 @@ export default class IgcChatComponent extends EventEmitterMixin< this._userInputContext.setValue(this._state, true); } + /* blazorCollectionName: MessagesCollection */ + /* blazorTreatAsCollection */ /** * The list of chat messages currently displayed. * Use this property to set or update the message history. @@ -278,10 +283,7 @@ export default class IgcChatComponent extends EventEmitterMixin< * Includes the draft text and any attachments. */ @property({ attribute: false }) - public set draftMessage(value: { - text: string; - attachments?: IgcChatMessageAttachment[]; - }) { + public set draftMessage(value: IgcChatDraftMessage) { if (this._state && value) { this._state.inputValue = value.text; this._state.inputAttachments = value.attachments || []; @@ -289,10 +291,7 @@ export default class IgcChatComponent extends EventEmitterMixin< } } - public get draftMessage(): { - text: string; - attachments?: IgcChatMessageAttachment[]; - } { + public get draftMessage(): IgcChatDraftMessage { return { text: this._state.inputValue, attachments: this._state.inputAttachments, @@ -312,6 +311,7 @@ export default class IgcChatComponent extends EventEmitterMixin< return this._state.options; } + /* blazorSuppress */ /** * The resource strings of the chat. */ @@ -322,6 +322,7 @@ export default class IgcChatComponent extends EventEmitterMixin< this._i18nController.resourceStrings = value; } + /* blazorSuppress */ public get resourceStrings(): IgcChatResourceStrings & IChatResourceStrings { return this._i18nController.resourceStrings; } diff --git a/src/components/chat/message-attachments.ts b/src/components/chat/message-attachments.ts index 8b8fc39f2..53f0af357 100644 --- a/src/components/chat/message-attachments.ts +++ b/src/components/chat/message-attachments.ts @@ -52,6 +52,7 @@ type DefaultAttachmentRenderers = { * @csspart image-attachment - Part for the image element inside an image attachment. * * @fires igcAttachmentClick - Fired when an attachment header is toggled (clicked). + * @hidden @internal */ export default class IgcMessageAttachmentsComponent extends LitElement { public static readonly tagName = 'igc-message-attachments'; diff --git a/src/components/chat/types.ts b/src/components/chat/types.ts index 73b083d4e..f3e58425d 100644 --- a/src/components/chat/types.ts +++ b/src/components/chat/types.ts @@ -1,5 +1,6 @@ import type IgcChatComponent from './chat.js'; +/* jsonAPIPlainObject */ /** * Represents a single chat message in the conversation. */ @@ -36,6 +37,7 @@ export interface IgcChatMessage { reactions?: string[]; } +/* jsonAPIPlainObject */ /** * Represents an attachment associated with a chat message. */ @@ -56,11 +58,13 @@ export interface IgcChatMessageAttachment { */ url?: string; + /* blazorSuppress */ /** * The actual File object, if the attachment was provided locally (e.g. via upload). */ file?: File; + /* blazorAlternateName: attachmentType */ /** * The MIME type or a custom type identifier for the attachment (e.g. "image/png", "pdf", "audio"). */ @@ -72,10 +76,11 @@ export interface IgcChatMessageAttachment { thumbnail?: string; } +/* jsonAPIPlainObject */ /** * Configuration options for customizing the behavior and appearance of the chat component. */ -export type IgcChatOptions = { +export interface IgcChatOptions { /** * The ID of the current user. Used to differentiate between incoming and outgoing messages. */ @@ -153,8 +158,24 @@ export type IgcChatOptions = { * An object containing a collection of custom renderers for different parts of the chat UI. */ renderers?: ChatRenderers; -}; +} + +/* jsonAPIPlainObject */ +/** + * Represents a draft message that is being composed by the user, including the text and any attachments. + */ +export interface IgcChatDraftMessage { + /** + * The textual content of the draft message. + */ + text: string; + /** + * An array of attachments associated with the draft message. + */ + attachments?: IgcChatMessageAttachment[]; +} +/* jsonAPIPlainObject */ /** * Represents a user's reaction to a specific chat message. */ @@ -169,6 +190,7 @@ export interface IgcChatMessageReaction { reaction: string; } +/* blazorSuppress */ /** * A collection of optional rendering functions that allow for custom UI rendering. * Each property is a function that takes a context object and returns a template result. @@ -251,6 +273,7 @@ export type ChatTemplateRenderer = (ctx: T) => unknown; */ export type ChatSuggestionsPosition = 'below-input' | 'below-messages'; +/* jsonAPIPlainObject */ /** * The base context object passed to custom renderer functions, containing the chat component instance. */ @@ -261,6 +284,7 @@ export interface ChatRenderContext { instance: IgcChatComponent; } +/* jsonAPIPlainObject */ /** * The context object for renderers that deal with the chat input area. * It extends the base context with input-specific properties. @@ -276,6 +300,7 @@ export interface ChatInputRenderContext extends ChatRenderContext { value: string; } +/* jsonAPIPlainObject */ /** * The context object for renderers that deal with a specific chat message. * It extends the base context with the message data. @@ -287,6 +312,7 @@ export interface ChatMessageRenderContext extends ChatRenderContext { message: IgcChatMessage; } +/* jsonAPIPlainObject */ /** * The context object for renderers that deal with a specific attachment within a message. * It extends the message context with the attachment data.