summaryrefslogtreecommitdiffstats
path: root/browser/components/newtab/content-src/asrouter/templates/OnboardingMessage/Spotlight.schema.json
blob: bb79e46f7f9566b4b91d6414ec97da2cf681251b (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
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
{
  "$schema": "https://json-schema.org/draft/2019-09/schema",
  "$id": "file:///Spotlight.schema.json",
  "title": "Spotlight",
  "description": "A template with an image, title, content and two buttons.",
  "allOf": [
    { "$ref": "file:///FxMSCommon.schema.json#/$defs/Message" }
  ],
  "type": "object",
  "properties": {
    "content": {
      "type": "object",
      "properties": {
        "template": {
          "type": "string",
          "description": "Specify the layout template for the Spotlight",
          "enum": ["logo-and-content", "multistage"]
        },
        "backdrop": {
          "type": "string",
          "description": "Background css behind modal content"
        },
        "logoImageURL": {
          "type": "string",
          "format": "uri",
          "description": "(Deprecated by logo.imageURL)"
        },
        "logo": {
          "type": "object",
          "properties": {
            "imageURL": {
              "type": "string",
              "description": "URL for image to use with the content"
            },
            "imageId": {
              "type": "string",
              "description": "The ID for a remotely hosted image"
            },
            "size": {
              "type": "string",
              "description": "The logo size."
            }
          },
          "additionalProperties": true
        },
        "body": {
          "type": "object",
          "properties": {
            "title": {
              "type": "object",
              "properties": {
                "label": {
                  "$ref": "file:///FxMSCommon.schema.json#/$defs/localizableText",
                  "description": "The title shown in the Spotlight message"
                }
              },
              "required": ["label"]
            },
            "text": {
              "type": "object",
              "properties": {
                "label": {
                  "$ref": "file:///FxMSCommon.schema.json#/$defs/localizableText",
                  "description": "The content shown in the Spotlight message"
                }
              },
              "required": ["label"]
            },
            "primary": {
              "type": "object",
              "properties": {
                "label": {
                  "$ref": "file:///FxMSCommon.schema.json#/$defs/localizableText",
                  "description": "The label for the primary button"
                },
                "action": {
                  "type": "object",
                  "properties": {
                    "type": {
                      "type": "string",
                      "description": "Action dispatched by the button."
                    },
                    "data": {
                      "type": "object"
                    }
                  },
                  "required": ["type"],
                  "additionalProperties": true
                }
              },
              "required": ["label", "action"]
            },
            "secondary": {
              "type": "object",
              "properties": {
                "label": {
                  "$ref": "file:///FxMSCommon.schema.json#/$defs/localizableText",
                  "description": "The label for the secondary button"
                }
              },
              "required": ["label", "action"]
            }
          },
          "additionalProperties": true,
          "required": ["title", "text", "primary", "secondary"]
        },
        "extra": {
          "type": "object",
          "properties": {
            "expanded": {
              "type": "object",
              "properties": {
                "label": {
                  "$ref": "file:///FxMSCommon.schema.json#/$defs/localizableText",
                  "description": "The label for the secondary button"
                }
              },
              "required": ["label"]
            }
          },
          "additionalProperties": true
        },
        "screens": {
          "type": "array",
          "description": "Collection of individual screen content"
        },
        "transitions": {
          "type": "boolean",
          "description": "Show transitions within and between screens"
        },
        "disableHistoryUpdates": {
          "type": "boolean",
          "description": "Don't alter the browser session's history stack - used with messaging surfaces like Feature Callouts"
        },
        "startScreen": {
          "type": "integer",
          "description": "Index of first screen to show from message, defaulting to 0"
        }
      },
      "additionalProperties": true,
      "if": {
        "properties": {
          "logoImageURL": { "type": "null" }
        }
      },
      "then": {
        "properties": {
          "logo": {
            "oneOf": [
              {
                "required": ["imageURL"]
              },
              {
                "required": ["imageId"]
              }
            ]
          }
        }
      },
      "required": ["template"]
    },
    "template": {
      "type": "string",
      "description": "Specify whether the surface is shown as a Spotlight modal or an in-surface Feature Callout dialog",
      "enum": ["spotlight", "feature_callout"]
    }
  },
  "additionalProperties": true,
  "required": ["targeting"]
}