summaryrefslogtreecommitdiffstats
path: root/browser/components/newtab/content-src/asrouter/templates/PBNewtab/NewtabPromoMessage.schema.json
blob: 3719419428b6c48578281483e398b92e2f1499e6 (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
{
  "$schema": "https://json-schema.org/draft/2019-09/schema",
  "$id": "file:///NewtabPromoMessage.schema.json",
  "title": "PBNewtabPromoMessage",
  "description": "Message shown on the private browsing newtab page.",
  "allOf": [{ "$ref": "file:///FxMSCommon.schema.json#/$defs/Message" }],
  "type": "object",
  "properties": {
    "content": {
      "type": "object",
      "properties": {
        "hideDefault": {
          "type": "boolean",
          "description": "Should we hide the default promo after the experiment promo is dismissed."
        },
        "infoEnabled": {
          "type": "boolean",
          "description": "Should we show the info section."
        },
        "infoIcon": {
          "type": "string",
          "description": "Icon shown in the left side of the info section. Default is the private browsing icon."
        },
        "infoTitle": {
          "type": "string",
          "description": "Is the title in the info section enabled."
        },
        "infoTitleEnabled": {
          "type": "boolean",
          "description": "Is the title in the info section enabled."
        },
        "infoBody": {
          "type": "string",
          "description": "Text content in the info section."
        },
        "infoLinkText": {
          "type": "string",
          "description": "Text for the link in the info section."
        },
        "infoLinkUrl": {
          "type": "string",
          "description": "URL for the info section link.",
          "format": "moz-url-format"
        },
        "promoEnabled": {
          "type": "boolean",
          "description": "Should we show the promo section."
        },
        "promoType": {
          "type": "string",
          "description": "Promo type used to determine if promo should show to a given user",
          "enum": ["FOCUS", "VPN", "PIN", "COOKIE_BANNERS", "OTHER"]
        },
        "promoSectionStyle": {
          "type": "string",
          "description": "Sets the position of the promo section. Possible values are: top, below-search, bottom. Default bottom.",
          "enum": ["top", "below-search", "bottom"]
        },
        "promoTitle": {
          "type": "string",
          "description": "The text content of the promo section."
        },
        "promoTitleEnabled": {
          "type": "boolean",
          "description": "Should we show text content in the promo section."
        },
        "promoLinkText": {
          "type": "string",
          "description": "The text of the link in the promo box."
        },
        "promoHeader": {
          "type": "string",
          "description": "The title of the promo section."
        },
        "promoButton": {
          "type": "object",
          "properties": {
            "action": {
              "type": "object",
              "properties": {
                "type": {
                  "type": "string",
                  "description": "Action dispatched by the button."
                },
                "data": {
                  "type": "object"
                }
              },
              "required": ["type"],
              "additionalProperties": true
            }
          },
          "required": ["action"]
        },
        "promoLinkType": {
          "type": "string",
          "description": "Type of promo link type. Possible values: link, button. Default is link.",
          "enum": ["link", "button"]
        },
        "promoImageLarge": {
          "type": "string",
          "description": "URL for image used on the left side of the promo box, larger, showcases some feature. Default off.",
          "format": "uri"
        },
        "promoImageSmall": {
          "type": "string",
          "description": "URL for image used on the right side of the promo box, smaller, usually a logo. Default off.",
          "format": "uri"
        }
      },
      "additionalProperties": true,
      "allOf": [
        {
          "if": {
            "properties": {
              "promoEnabled": { "const": true }
            },
            "required": ["promoEnabled"]
          },
          "then": {
            "required": ["promoButton"]
          }
        },
        {
          "if": {
            "properties": {
              "infoEnabled": { "const": true }
            },
            "required": ["infoEnabled"]
          },
          "then": {
            "required": ["infoLinkText"],
            "if": {
              "properties": {
                "infoTitleEnabled": { "const": true }
              },
              "required": ["infoTitleEnabled"]
            },
            "then": {
              "required": ["infoTitle"]
            }
          }
        }
      ]
    },
    "template": {
      "type": "string",
      "const": "pb_newtab"
    }
  },
  "additionalProperties": true,
  "required": ["targeting"]
}