summaryrefslogtreecommitdiffstats
path: root/browser/components/newtab/content-src/asrouter/templates/CFR/templates/InfoBar.schema.json
blob: ca0c0745bbad781b029c8120ddc40b76c5c211b9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
{
  "$schema": "https://json-schema.org/draft/2019-09/schema",
  "$id": "file:///InfoBar.schema.json",
  "title": "InfoBar",
  "description": "A template with an image, test and buttons.",
  "allOf": [{ "$ref": "file:///FxMSCommon.schema.json#/$defs/Message" }],
  "type": "object",
  "properties": {
    "content": {
      "type": "object",
      "properties": {
        "type": {
          "type": "string",
          "description": "Should the message be global (persisted across tabs) or local (disappear when switching to a different tab).",
          "enum": ["global", "tab"]
        },
        "text": {
          "$ref": "file:///FxMSCommon.schema.json#/$defs/localizableText",
          "description": "The text show in the notification box."
        },
        "priority": {
          "description": "Infobar priority level https://searchfox.org/mozilla-central/rev/3aef835f6cb12e607154d56d68726767172571e4/toolkit/content/widgets/notificationbox.js#387",
          "type": "number",
          "minumum": 0,
          "exclusiveMaximum": 10
        },
        "buttons": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "label": {
                "$ref": "file:///FxMSCommon.schema.json#/$defs/localizableText",
                "description": "The text label of the button."
              },
              "primary": {
                "type": "boolean",
                "description": "Is this the primary button?"
              },
              "accessKey": {
                "type": "string",
                "description": "Keyboard shortcut letter."
              },
              "action": {
                "type": "object",
                "properties": {
                  "type": {
                    "type": "string",
                    "description": "Action dispatched by the button."
                  },
                  "data": {
                    "type": "object"
                  }
                },
                "required": ["type"],
                "additionalProperties": true
              },
              "supportPage": {
                "type": "string",
                "description": "A page title on SUMO to link to"
              }
            },
            "required": ["label", "action"],
            "additionalProperties": true
          }
        }
      },
      "additionalProperties": true,
      "required": ["text", "buttons"]
    },
    "template": {
      "type": "string",
      "const": "infobar"
    }
  },
  "additionalProperties": true,
  "required": ["targeting", "trigger"],
  "$defs": {
    "plainText": {
      "description": "Plain text (no HTML allowed)",
      "type": "string"
    },
    "linkUrl": {
      "description": "Target for links or buttons",
      "type": "string",
      "format": "uri"
    }
  }
}