summaryrefslogtreecommitdiffstats
path: root/browser/components/newtab/content-src/asrouter/templates/EOYSnippet/EOYSnippet.schema.json
blob: d9b67280679a5b86e1b3db90772133fe01e1a370 (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
171
{
  "title": "EOYSnippet",
  "description": "Fundraising Snippet",
  "version": "1.1.0",
  "type": "object",
  "definitions": {
    "plainText": {
      "description": "Plain text (no HTML allowed)",
      "type": "string"
    },
    "richText": {
      "description": "Text with HTML subset allowed: i, b, u, strong, em, br",
      "type": "string"
    },
    "link_url": {
      "description": "Target for links or buttons",
      "type": "string",
      "format": "uri"
    }
  },
  "properties": {
    "donation_form_url": {
      "type": "string",
      "description": "Url to the donation form."
    },
    "currency_code": {
      "type": "string",
      "description": "The code for the currency. Examle gbp, cad, usd.",
      "default": "usd"
    },
    "locale": {
      "type": "string",
      "description": "String for the locale code.",
      "default": "en-US"
    },
    "text": {
      "allOf": [
        { "$ref": "#/definitions/richText" },
        {
          "description": "Main body text of snippet. HTML subset allowed: i, b, u, strong, em, br"
        }
      ]
    },
    "text_color": {
      "type": "string",
      "description": "Modify the text message color"
    },
    "background_color": {
      "type": "string",
      "description": "Snippet background color."
    },
    "highlight_color": {
      "type": "string",
      "description": "Paragraph em highlight color."
    },
    "donation_amount_first": {
      "type": "number",
      "description": "First button amount."
    },
    "donation_amount_second": {
      "type": "number",
      "description": "Second button amount."
    },
    "donation_amount_third": {
      "type": "number",
      "description": "Third button amount."
    },
    "donation_amount_fourth": {
      "type": "number",
      "description": "Fourth button amount."
    },
    "selected_button": {
      "type": "string",
      "description": "Default donation_amount_second. Donation amount button that's selected by default.",
      "default": "donation_amount_second"
    },
    "icon": {
      "type": "string",
      "description": "Snippet icon. 64x64px. SVG or PNG preferred."
    },
    "icon_dark_theme": {
      "type": "string",
      "description": "Snippet icon. Dark theme variant. 64x64px. SVG or PNG preferred."
    },
    "icon_alt_text": {
      "type": "string",
      "description": "Alt text for accessibility",
      "default": ""
    },
    "title": {
      "allOf": [
        { "$ref": "#/definitions/plainText" },
        { "description": "Snippet title displayed before snippet text" }
      ]
    },
    "title_icon": {
      "type": "string",
      "description": "Small icon that shows up before the title / text. 16x16px. SVG or PNG preferred. Grayscale."
    },
    "title_icon_dark_theme": {
      "type": "string",
      "description": "Small icon that shows up before the title / text. Dark theme variant. 16x16px. SVG or PNG preferred. Grayscale."
    },
    "button_label": {
      "allOf": [
        { "$ref": "#/definitions/plainText" },
        {
          "description": "Text for a button next to main snippet text that links to button_url. Requires button_url."
        }
      ]
    },
    "button_color": {
      "type": "string",
      "description": "The text color of the button. Valid CSS color."
    },
    "button_background_color": {
      "type": "string",
      "description": "The background color of the button. Valid CSS color."
    },
    "block_button_text": {
      "type": "string",
      "description": "Tooltip text used for dismiss button."
    },
    "monthly_checkbox_label_text": {
      "type": "string",
      "description": "Label text for monthly checkbox.",
      "default": "Make my donation monthly"
    },
    "test": {
      "type": "string",
      "description": "Different styles for the snippet. Options are bold and takeover."
    },
    "do_not_autoblock": {
      "type": "boolean",
      "description": "Used to prevent blocking the snippet after the CTA (link or button) has been clicked"
    },
    "links": {
      "additionalProperties": {
        "url": {
          "allOf": [
            { "$ref": "#/definitions/link_url" },
            { "description": "The url where the link points to." }
          ]
        },
        "metric": {
          "type": "string",
          "description": "Custom event name sent with telemetry event."
        },
        "args": {
          "type": "string",
          "description": "Additional parameters for link action, example which specific menu the button should open"
        }
      }
    }
  },
  "additionalProperties": false,
  "required": [
    "text",
    "donation_form_url",
    "donation_amount_first",
    "donation_amount_second",
    "donation_amount_third",
    "donation_amount_fourth",
    "button_label",
    "currency_code"
  ],
  "dependencies": {
    "button_color": ["button_label"],
    "button_background_color": ["button_label"]
  }
}