tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

commit 35362df915a1b7c7cbca9ff65d73f473e548d2ae
parent 42a0e13bf50e7874b86bb6942a176c8f59aef447
Author: mark <mkennedy@mozilla.com>
Date:   Mon,  3 Nov 2025 22:40:48 +0000

Bug 1991104 - Update and consolidate message-related types in moz-message-bar r=mstriemer

Differential Revision: https://phabricator.services.mozilla.com/D268134

Diffstat:
Mtoolkit/content/widgets/moz-message-bar/moz-message-bar.mjs | 44++++++++++++++++++++++++++++++++++++++------
1 file changed, 38 insertions(+), 6 deletions(-)

diff --git a/toolkit/content/widgets/moz-message-bar/moz-message-bar.mjs b/toolkit/content/widgets/moz-message-bar/moz-message-bar.mjs @@ -9,6 +9,10 @@ import "chrome://global/content/elements/moz-button.mjs"; window.MozXULElement?.insertFTLIfNeeded("toolkit/global/mozMessageBar.ftl"); +/** + * @typedef {"info" | "warning" | "success" | "error"} MozMessageBarType + */ + const messageTypeToIconData = { info: { iconSrc: "chrome://global/skin/icons/info-filled.svg", @@ -37,12 +41,6 @@ const messageTypeToIconData = { * important information to users. * * @tagname moz-message-bar - * @property {string} type - The type of the displayed message. - * @property {string} heading - The heading of the message. - * @property {string} message - The message text. - * @property {boolean} dismissable - Whether or not the element is dismissable. - * @property {string} messageL10nId - l10n ID for the message. - * @property {string} messageL10nArgs - Any args needed for the message l10n ID. * @fires message-bar:close * Custom event indicating that message bar was closed. * @fires message-bar:user-dismissed @@ -69,8 +67,42 @@ export default class MozMessageBar extends MozLitElement { constructor() { super(); + + /** + * The type of the displayed message. + * @type {MozMessageBarType} + */ this.type = "info"; + + /** + * Whether or not the element is dismissable. + * @type {boolean} + */ this.dismissable = false; + + /** + * The message text. + * @type {string | undefined} + */ + this.message = undefined; + + /** + * l10n ID for the message. + * @type {string | undefined} + */ + this.messageL10nId = undefined; + + /** + * Any args needed for the message l10n ID. + * @type {Record<string, string> | undefined} + */ + this.messageL10nArgs = undefined; + + /** + * The heading of the message. + * @type {string | undefined} + */ + this.heading = undefined; } onActionSlotchange() {