{
  "$schema": "https://json-schema.org/draft/2019-09/schema",
  "$id": "file:///MenuMessage.schema.json",
  "title": "MenuMessage",
  "description": "A template for messages that appear within our menus.",
  "allOf": [
    {
      "$ref": "file:///FxMSCommon.schema.json#/$defs/Message"
    }
  ],
  "type": "object",
  "properties": {
    "content": {
      "type": "object",
      "properties": {
        "messageType": {
          "type": "string",
          "description": "The subtype of the message. 'fxa_cta' is used for Firefox Accounts messaging and is only visible when signed out, unless 'allowWhenSignedIn' property is provided. It replaces the fxa menu item when displayed. 'default_cta' is used for general messages, regardless of sign in state and only visible within the App Menu.",
          "enum": ["fxa_cta", "default_cta"]
        },
        "primaryText": {
          "$ref": "file:///FxMSCommon.schema.json#/$defs/localizableText",
          "description": "The primary text for the message, which offers the value proposition to the user."
        },
        "secondaryText": {
          "$ref": "file:///FxMSCommon.schema.json#/$defs/localizableText",
          "description": "The secondary text for the message, which offers more detail on the value proposition to the user. Not displayed when layout is 'simple'."
        },
        "closeAction": {
          "type": "object",
          "properties": {
            "type": {
              "type": "string",
              "description": "Action dispatched by the button."
            },
            "data": {
              "type": "object"
            }
          },
          "required": ["type"],
          "additionalProperties": true,
          "description": "The action to take upon clicking the close button."
        },
        "primaryAction": {
          "type": "object",
          "properties": {
            "type": {
              "type": "string",
              "description": "Action dispatched by the button."
            },
            "data": {
              "type": "object"
            }
          },
          "required": ["type"],
          "additionalProperties": true,
          "description": "The action to take upon clicking the primary action button."
        },
        "primaryActionText": {
          "$ref": "file:///FxMSCommon.schema.json#/$defs/localizableText",
          "description": "The label for the primary action."
        },
        "primaryButtonSize": {
          "type": "string",
          "enum": ["default", "small"],
          "description": "The size of the primary button, default is 'default'."
        },
        "imageURL": {
          "type": "string",
          "description": "URL for image to use with the content."
        },
        "rtlImageURL": {
          "type": "string",
          "description": "URL for RTL images that have directionally dependent assets and cannot be flipped using 'directionalImage'."
        },
        "imageWidth": {
          "type": "number",
          "description": "The image width in pixels. Default is 120px."
        },
        "directionalImage": {
          "type": "boolean",
          "description": "If true, the illustration has a left/right orientation and should be horizontally mirrored in RTL contexts. Defaults to false."
        },
        "logoURL": {
          "type": "string",
          "description": "URL for logo to use with the content."
        },
        "logoWidth": {
          "type": "number",
          "description": "The logo width in pixels. Default is 18px."
        },
        "imageVerticalTopOffset": {
          "type": "number",
          "description": "The margin-block-start value to apply to the image in pixels."
        },
        "imageVerticalBottomOffset": {
          "type": "number",
          "description": "The margin-block-end value to apply to the image in pixels, used in 'row' layouts."
        },
        "containerVerticalBottomOffset": {
          "type": "number",
          "description": "The container's margin-block-end value in pixels. Used to visually offset the image in 'row' layouts when 'imageVerticalBottomOffset' is applied."
        },
        "containerPaddingBottom": {
          "type": "number",
          "description": "The container's padding-block-end value in pixels."
        },
        "layout": {
          "type": "string",
          "description": "The layout of the message content and illustration. Row displays the image inline to the right of the text, column displays the image above the text. Simple layout only displays primary text and primary button on one row. Split displays the illustration in one column and a stacked content column, use 'imagePosition' to swap which side the illustration sits on.",
          "enum": ["row", "column", "simple", "split"]
        },
        "imagePosition": {
          "type": "string",
          "description": "Position of the illustration. For split layout, 'start' or 'end' selects which inline side the illustration sits on (defaults to 'end'). For both split and column layout, 'bottom' renders the illustration at the bottom of the card.",
          "enum": ["start", "end", "bottom"]
        },
        "allowWhenSignedIn": {
          "type": "boolean",
          "description": "If true, the message will be shown even when the user is signed in. For 'fxa_cta' messages. Defaults to 'false'."
        }
      }
    },
    "template": {
      "type": "string",
      "const": "menu_message"
    },
    "testingTriggerContext": {
      "type": "string",
      "enum": ["app_menu", "pxi_menu"]
    }
  },
  "additionalProperties": true
}
