`](./ui/wy-button.ts)
*
* @csspart wy-editor-message-inputs - Container for the editor inputs and add menu
* @csspart wy-editor-message-text - Wrapper for the editor text area
*/
@customElement("wy-editor-message")
@localized()
export class WyEditorMessage extends WyEditorMsg {
static override styles = [...WyEditorMsg.styles, messageEditorCss];
constructor() {
super();
this.editorType = "messages";
this.editorClass = "wy-editor-message";
}
/**
* Render content that appears above the message editor.
*
* By default returns the same lists section used by the base editor.
*
* @internal
*/
protected override renderTopSlot(): (TemplateResult | typeof nothing)[] | TemplateResult | typeof nothing {
return [this.renderLists()];
}
/**
* Render the primary middle slot containing the add-menu, editor and send button.
*
* Overrides the base implementation to provide message-specific controls and layout.
*
* @internal
*/
protected override renderMiddleSlot() {
return html`
${this.componentFeatures?.allowsAnyFeature(
Feature.Attachments,
Feature.CloudFiles,
Feature.Polls,
Feature.Meetings,
Feature.ZoomMeetings,
Feature.GoogleMeet,
Feature.MicrosoftTeams,
)
? html`
${this.componentFeatures?.allowsFeature(Feature.Attachments)
? html`
this.openFileInput()} title=${msg("From device")}>
${msg("From device")}
e.stopPropagation()}
@change=${(e: Event) =>
this.handleUploadFiles(
Array.from((e.target as HTMLInputElement).files || []),
e.target as HTMLInputElement,
)}
multiple
hidden
tabindex="-1"
/>
`
: nothing}
${this.componentFeatures?.allowsFeature(Feature.CloudFiles)
? html`
this.openCloudFiles()} title=${msg("From cloud")}>
${msg("From cloud")}
`
: nothing}
${this.componentFeatures?.allowsFeature(Feature.Polls)
? html`
this.togglePolls()} title=${msg("Poll")}>
${msg("Poll")}
`
: nothing}
${this.componentFeatures?.allowsAnyFeature(Feature.Meetings, Feature.ZoomMeetings)
? html`
this.handleMeetingClick("zoom")} title=${msg("Zoom meeting")}>
${msg("Zoom meeting")}
`
: nothing}
${this.componentFeatures?.allowsAnyFeature(Feature.Meetings, Feature.GoogleMeet)
? html`
this.handleMeetingClick("google")} title=${msg("Google Meet")}>
${msg("Google Meet")}
`
: nothing}
${this.componentFeatures?.allowsAnyFeature(Feature.Meetings, Feature.MicrosoftTeams)
? html`
this.handleMeetingClick("microsoft")}
title=${msg("Microsoft Teams")}
>
${msg("Microsoft Teams")}
`
: nothing}
`
: nothing}
${this.renderEditor()}
this.submit()}"
?disabled=${this.disabled}
>
`;
}
/**
* Render the bottom slot for message editor with no content.
*
* @internal
*/
protected override renderBottomSlot(): (TemplateResult | typeof nothing)[] | TemplateResult | typeof nothing {
return nothing;
}
}