forked from streetwriters/notesnook
-
Notifications
You must be signed in to change notification settings - Fork 0
/
v1.schema.json
385 lines (385 loc) · 13.1 KB
/
v1.schema.json
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
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
{
"$schema": "http://json-schema.org/draft-07/schema#",
"$ref": "#/definitions/ThemeDefinition",
"definitions": {
"ThemeDefinition": {
"type": "object",
"properties": {
"name": {
"type": "string",
"description": "Name of the theme"
},
"id": {
"type": "string",
"description": "ID of the theme. Must be unique across all other themes.",
"pattern": "^[a-z0-9_-]+$"
},
"version": {
"type": "number",
"description": "Version of the theme."
},
"compatibilityVersion": {
"$ref": "#/definitions/ThemeCompatibilityVersion",
"description": "The compatibility version of the theme used by the client to decide whether the theme is compatible with the current app version."
},
"license": {
"type": "string",
"description": "The license under which the theme can be shared, modified etc.",
"examples": [
"GPL-3.0-or-later",
"Apache-2.0",
"BSD-3-Clause",
"MIT",
"MPL-2.0"
]
},
"authors": {
"type": "array",
"items": {
"$ref": "#/definitions/ThemeAuthor"
},
"description": "Author(s) of the theme."
},
"homepage": {
"type": "string",
"description": "Website or homepage of the theme.",
"format": "uri"
},
"description": {
"type": "string",
"description": "A short description of the theme."
},
"colorScheme": {
"type": "string",
"enum": [
"light",
"dark"
],
"description": "Whether the theme has a dark color scheme or light."
},
"tags": {
"type": "array",
"items": {
"type": "string"
},
"description": "Keywords to help categorize the theme & improve search results."
},
"scopes": {
"$ref": "#/definitions/ThemeScopes",
"description": "All the theme scopes."
},
"$schema": {
"type": "string",
"const": "https://raw.githubusercontent.com/streetwriters/notesnook-themes/main/schemas/v1.schema.json"
}
},
"required": [
"name",
"id",
"version",
"compatibilityVersion",
"license",
"authors",
"description",
"colorScheme",
"scopes",
"$schema"
],
"additionalProperties": false,
"title": "Notesnook Theme schema",
"description": "This is a schema for validation of Notesnook themes."
},
"ThemeCompatibilityVersion": {
"type": "number",
"const": 1
},
"ThemeAuthor": {
"type": "object",
"properties": {
"name": {
"type": "string",
"description": "Name of the author."
},
"email": {
"type": "string",
"description": "Contact email of the author."
},
"url": {
"type": "string",
"description": "Website or support page of the author."
}
},
"required": [
"name"
],
"additionalProperties": false
},
"ThemeScopes": {
"type": "object",
"properties": {
"base": {
"$ref": "#/definitions/Variants%3Ctrue%3E",
"description": "Base theme scope is the only scope that must be 100% specified. There are no optional variants or colors in this scope and it acts as a fallback for all the other scopes in case a color or variant is missing in them."
},
"statusBar": {
"$ref": "#/definitions/PartialVariants",
"description": "Scope for the status bar on Desktop & mobile. On mobile, the status bar can be found at the bottom of the side navigation menu which includes the sync status, logged in status etc."
},
"list": {
"$ref": "#/definitions/PartialVariants",
"description": "Scope for the central list view containing your notes, notebooks, tags etc."
},
"editor": {
"$ref": "#/definitions/PartialVariants",
"description": "Scope for everything inside the editor excluding the toolbar which has its own scope."
},
"editorToolbar": {
"$ref": "#/definitions/PartialVariants",
"description": "Scope specific to the Editor Toolbar."
},
"editorSidebar": {
"$ref": "#/definitions/PartialVariants",
"description": "Scope for all the Editor side bars include note properties, attachment previews etc."
},
"dialog": {
"$ref": "#/definitions/PartialVariants",
"description": "Scope for all the dialogs in the app."
},
"navigationMenu": {
"$ref": "#/definitions/PartialVariants",
"description": "Scope for the side navigation menu."
},
"contextMenu": {
"$ref": "#/definitions/PartialVariants",
"description": "Scope for all the context menus in the app. This is desktop/web only since the mobile clients do not have context menus."
},
"sheet": {
"$ref": "#/definitions/PartialVariants",
"description": "Scope for all the bottom sheets shown in the app. This scope only applies on the mobile clients & the mobile version of the web app."
}
},
"required": [
"base"
],
"additionalProperties": false
},
"Variants<true>": {
"type": "object",
"properties": {
"primary": {
"$ref": "#/definitions/PartialOrFullColors%3Ctrue%3E"
},
"secondary": {
"$ref": "#/definitions/PartialOrFullColors%3Ctrue%3E"
},
"disabled": {
"$ref": "#/definitions/PartialOrFullColors%3Ctrue%3E"
},
"selected": {
"$ref": "#/definitions/PartialOrFullColors%3Ctrue%3E"
},
"error": {
"$ref": "#/definitions/PartialOrFullColors%3Ctrue%3E"
},
"success": {
"$ref": "#/definitions/PartialOrFullColors%3Ctrue%3E"
}
},
"required": [
"primary",
"secondary",
"disabled",
"selected",
"error",
"success"
],
"additionalProperties": false
},
"PartialOrFullColors<true>": {
"$ref": "#/definitions/Colors"
},
"Colors": {
"type": "object",
"properties": {
"accent": {
"type": "string",
"description": "Only Hex RGB values are supported. No Alpha. (e.g. #f33ff3)",
"pattern": "^#(?:[0-9a-fA-F]{3}){1,2}$"
},
"accentForeground": {
"type": "string",
"description": "Only Hex RGB values are supported. No Alpha. (e.g. #f33ff3)",
"pattern": "^#(?:[0-9a-fA-F]{3}){1,2}$"
},
"paragraph": {
"type": "string",
"description": "Only Hex RGB values are supported. No Alpha. (e.g. #f33ff3)",
"pattern": "^#(?:[0-9a-fA-F]{3}){1,2}$"
},
"background": {
"type": "string",
"description": "Hex RGB & ARGB values both are supported. (e.g. #dbdbdb99)",
"pattern": "^#(?:(?:[\\da-fA-F]{3}){1,2}|(?:[\\da-fA-F]{4}){1,2})$"
},
"border": {
"type": "string",
"description": "Only Hex RGB values are supported. No Alpha. (e.g. #f33ff3)",
"pattern": "^#(?:[0-9a-fA-F]{3}){1,2}$"
},
"heading": {
"type": "string",
"description": "Only Hex RGB values are supported. No Alpha. (e.g. #f33ff3)",
"pattern": "^#(?:[0-9a-fA-F]{3}){1,2}$"
},
"icon": {
"type": "string",
"description": "Only Hex RGB values are supported. No Alpha. (e.g. #f33ff3)",
"pattern": "^#(?:[0-9a-fA-F]{3}){1,2}$"
},
"separator": {
"type": "string",
"description": "Only Hex RGB values are supported. No Alpha. (e.g. #f33ff3)",
"pattern": "^#(?:[0-9a-fA-F]{3}){1,2}$"
},
"placeholder": {
"type": "string",
"description": "Hex RGB & ARGB values both are supported. (e.g. #dbdbdb99)",
"pattern": "^#(?:(?:[\\da-fA-F]{3}){1,2}|(?:[\\da-fA-F]{4}){1,2})$"
},
"hover": {
"type": "string",
"description": "Hex RGB & ARGB values both are supported. (e.g. #dbdbdb99)",
"pattern": "^#(?:(?:[\\da-fA-F]{3}){1,2}|(?:[\\da-fA-F]{4}){1,2})$"
},
"backdrop": {
"type": "string",
"description": "Hex RGB & ARGB values both are supported. (e.g. #dbdbdb99)",
"pattern": "^#(?:(?:[\\da-fA-F]{3}){1,2}|(?:[\\da-fA-F]{4}){1,2})$"
},
"shade": {
"type": "string",
"description": "Hex RGB & ARGB values both are supported. (e.g. #dbdbdb99)",
"pattern": "^#(?:(?:[\\da-fA-F]{3}){1,2}|(?:[\\da-fA-F]{4}){1,2})$",
"deprecated": true
},
"textSelection": {
"type": "string",
"description": "Hex RGB & ARGB values both are supported. (e.g. #dbdbdb99)",
"pattern": "^#(?:(?:[\\da-fA-F]{3}){1,2}|(?:[\\da-fA-F]{4}){1,2})$",
"deprecated": true
}
},
"required": [
"accent",
"accentForeground",
"paragraph",
"background",
"border",
"heading",
"icon",
"separator",
"placeholder",
"hover",
"backdrop"
],
"additionalProperties": false
},
"PartialVariants": {
"type": "object",
"properties": {
"primary": {
"$ref": "#/definitions/PartialOrFullColors%3Cfalse%3E"
},
"secondary": {
"$ref": "#/definitions/PartialOrFullColors%3Cfalse%3E"
},
"disabled": {
"$ref": "#/definitions/PartialOrFullColors%3Cfalse%3E"
},
"selected": {
"$ref": "#/definitions/PartialOrFullColors%3Cfalse%3E"
},
"error": {
"$ref": "#/definitions/PartialOrFullColors%3Cfalse%3E"
},
"success": {
"$ref": "#/definitions/PartialOrFullColors%3Cfalse%3E"
}
},
"additionalProperties": false
},
"PartialOrFullColors<false>": {
"type": "object",
"properties": {
"accent": {
"type": "string",
"description": "Only Hex RGB values are supported. No Alpha. (e.g. #f33ff3)",
"pattern": "^#(?:[0-9a-fA-F]{3}){1,2}$"
},
"accentForeground": {
"type": "string",
"description": "Only Hex RGB values are supported. No Alpha. (e.g. #f33ff3)",
"pattern": "^#(?:[0-9a-fA-F]{3}){1,2}$"
},
"paragraph": {
"type": "string",
"description": "Only Hex RGB values are supported. No Alpha. (e.g. #f33ff3)",
"pattern": "^#(?:[0-9a-fA-F]{3}){1,2}$"
},
"background": {
"type": "string",
"description": "Hex RGB & ARGB values both are supported. (e.g. #dbdbdb99)",
"pattern": "^#(?:(?:[\\da-fA-F]{3}){1,2}|(?:[\\da-fA-F]{4}){1,2})$"
},
"border": {
"type": "string",
"description": "Only Hex RGB values are supported. No Alpha. (e.g. #f33ff3)",
"pattern": "^#(?:[0-9a-fA-F]{3}){1,2}$"
},
"heading": {
"type": "string",
"description": "Only Hex RGB values are supported. No Alpha. (e.g. #f33ff3)",
"pattern": "^#(?:[0-9a-fA-F]{3}){1,2}$"
},
"icon": {
"type": "string",
"description": "Only Hex RGB values are supported. No Alpha. (e.g. #f33ff3)",
"pattern": "^#(?:[0-9a-fA-F]{3}){1,2}$"
},
"separator": {
"type": "string",
"description": "Only Hex RGB values are supported. No Alpha. (e.g. #f33ff3)",
"pattern": "^#(?:[0-9a-fA-F]{3}){1,2}$"
},
"placeholder": {
"type": "string",
"description": "Hex RGB & ARGB values both are supported. (e.g. #dbdbdb99)",
"pattern": "^#(?:(?:[\\da-fA-F]{3}){1,2}|(?:[\\da-fA-F]{4}){1,2})$"
},
"hover": {
"type": "string",
"description": "Hex RGB & ARGB values both are supported. (e.g. #dbdbdb99)",
"pattern": "^#(?:(?:[\\da-fA-F]{3}){1,2}|(?:[\\da-fA-F]{4}){1,2})$"
},
"backdrop": {
"type": "string",
"description": "Hex RGB & ARGB values both are supported. (e.g. #dbdbdb99)",
"pattern": "^#(?:(?:[\\da-fA-F]{3}){1,2}|(?:[\\da-fA-F]{4}){1,2})$"
},
"shade": {
"type": "string",
"description": "Hex RGB & ARGB values both are supported. (e.g. #dbdbdb99)",
"pattern": "^#(?:(?:[\\da-fA-F]{3}){1,2}|(?:[\\da-fA-F]{4}){1,2})$",
"deprecated": true
},
"textSelection": {
"type": "string",
"description": "Hex RGB & ARGB values both are supported. (e.g. #dbdbdb99)",
"pattern": "^#(?:(?:[\\da-fA-F]{3}){1,2}|(?:[\\da-fA-F]{4}){1,2})$",
"deprecated": true
}
},
"additionalProperties": false
}
}
}