document-schema 1.5.2 → 1.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,742 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://raw.githubusercontent.com/ExaDev/document-schema.js/0089fb3ebeaa24b412e4ef580e9240084deb276b/schemas/layout-document.schema.json",
4
+ "type": "object",
5
+ "properties": {
6
+ "formatVersion": {
7
+ "type": "number",
8
+ "const": 1
9
+ },
10
+ "metadata": {
11
+ "type": "object",
12
+ "properties": {
13
+ "title": {
14
+ "type": "string"
15
+ },
16
+ "author": {
17
+ "type": "string"
18
+ },
19
+ "subject": {
20
+ "type": "string"
21
+ },
22
+ "keywords": {
23
+ "type": "array",
24
+ "items": {
25
+ "type": "string"
26
+ }
27
+ },
28
+ "creator": {
29
+ "type": "string"
30
+ },
31
+ "producer": {
32
+ "type": "string"
33
+ },
34
+ "createdIso": {
35
+ "type": "string"
36
+ },
37
+ "modifiedIso": {
38
+ "type": "string"
39
+ }
40
+ },
41
+ "additionalProperties": false
42
+ },
43
+ "pages": {
44
+ "type": "array",
45
+ "items": {
46
+ "type": "object",
47
+ "properties": {
48
+ "widthPt": {
49
+ "type": "number",
50
+ "exclusiveMinimum": 0
51
+ },
52
+ "heightPt": {
53
+ "type": "number",
54
+ "exclusiveMinimum": 0
55
+ },
56
+ "items": {
57
+ "type": "array",
58
+ "items": {
59
+ "oneOf": [
60
+ {
61
+ "type": "object",
62
+ "properties": {
63
+ "kind": {
64
+ "type": "string",
65
+ "const": "text"
66
+ },
67
+ "text": {
68
+ "type": "string"
69
+ },
70
+ "xPt": {
71
+ "type": "number"
72
+ },
73
+ "yPt": {
74
+ "type": "number"
75
+ },
76
+ "font": {
77
+ "type": "object",
78
+ "properties": {
79
+ "family": {
80
+ "type": "string"
81
+ },
82
+ "weight": {
83
+ "type": "string",
84
+ "enum": [
85
+ "normal",
86
+ "bold"
87
+ ]
88
+ },
89
+ "style": {
90
+ "type": "string",
91
+ "enum": [
92
+ "normal",
93
+ "italic"
94
+ ]
95
+ }
96
+ },
97
+ "required": [
98
+ "family",
99
+ "weight",
100
+ "style"
101
+ ],
102
+ "additionalProperties": false
103
+ },
104
+ "sizePt": {
105
+ "type": "number",
106
+ "exclusiveMinimum": 0
107
+ },
108
+ "color": {
109
+ "type": "object",
110
+ "properties": {
111
+ "r": {
112
+ "type": "number",
113
+ "minimum": 0,
114
+ "maximum": 1
115
+ },
116
+ "g": {
117
+ "type": "number",
118
+ "minimum": 0,
119
+ "maximum": 1
120
+ },
121
+ "b": {
122
+ "type": "number",
123
+ "minimum": 0,
124
+ "maximum": 1
125
+ }
126
+ },
127
+ "required": [
128
+ "r",
129
+ "g",
130
+ "b"
131
+ ],
132
+ "additionalProperties": false
133
+ },
134
+ "widthPt": {
135
+ "type": "number",
136
+ "minimum": 0
137
+ },
138
+ "rotationDeg": {
139
+ "type": "number"
140
+ },
141
+ "underline": {
142
+ "type": "boolean"
143
+ },
144
+ "sourcePath": {
145
+ "type": "string"
146
+ }
147
+ },
148
+ "required": [
149
+ "kind",
150
+ "text",
151
+ "xPt",
152
+ "yPt",
153
+ "font",
154
+ "sizePt",
155
+ "color"
156
+ ],
157
+ "additionalProperties": false
158
+ },
159
+ {
160
+ "type": "object",
161
+ "properties": {
162
+ "kind": {
163
+ "type": "string",
164
+ "const": "image"
165
+ },
166
+ "imageId": {
167
+ "type": "string"
168
+ },
169
+ "xPt": {
170
+ "type": "number"
171
+ },
172
+ "yPt": {
173
+ "type": "number"
174
+ },
175
+ "widthPt": {
176
+ "type": "number",
177
+ "exclusiveMinimum": 0
178
+ },
179
+ "heightPt": {
180
+ "type": "number",
181
+ "exclusiveMinimum": 0
182
+ },
183
+ "rotationDeg": {
184
+ "type": "number"
185
+ },
186
+ "sourcePath": {
187
+ "type": "string"
188
+ }
189
+ },
190
+ "required": [
191
+ "kind",
192
+ "imageId",
193
+ "xPt",
194
+ "yPt",
195
+ "widthPt",
196
+ "heightPt"
197
+ ],
198
+ "additionalProperties": false
199
+ },
200
+ {
201
+ "type": "object",
202
+ "properties": {
203
+ "kind": {
204
+ "type": "string",
205
+ "const": "rect"
206
+ },
207
+ "xPt": {
208
+ "type": "number"
209
+ },
210
+ "yPt": {
211
+ "type": "number"
212
+ },
213
+ "widthPt": {
214
+ "type": "number",
215
+ "minimum": 0
216
+ },
217
+ "heightPt": {
218
+ "type": "number",
219
+ "minimum": 0
220
+ },
221
+ "fill": {
222
+ "type": "object",
223
+ "properties": {
224
+ "r": {
225
+ "type": "number",
226
+ "minimum": 0,
227
+ "maximum": 1
228
+ },
229
+ "g": {
230
+ "type": "number",
231
+ "minimum": 0,
232
+ "maximum": 1
233
+ },
234
+ "b": {
235
+ "type": "number",
236
+ "minimum": 0,
237
+ "maximum": 1
238
+ }
239
+ },
240
+ "required": [
241
+ "r",
242
+ "g",
243
+ "b"
244
+ ],
245
+ "additionalProperties": false
246
+ },
247
+ "stroke": {
248
+ "type": "object",
249
+ "properties": {
250
+ "color": {
251
+ "type": "object",
252
+ "properties": {
253
+ "r": {
254
+ "type": "number",
255
+ "minimum": 0,
256
+ "maximum": 1
257
+ },
258
+ "g": {
259
+ "type": "number",
260
+ "minimum": 0,
261
+ "maximum": 1
262
+ },
263
+ "b": {
264
+ "type": "number",
265
+ "minimum": 0,
266
+ "maximum": 1
267
+ }
268
+ },
269
+ "required": [
270
+ "r",
271
+ "g",
272
+ "b"
273
+ ],
274
+ "additionalProperties": false
275
+ },
276
+ "widthPt": {
277
+ "type": "number",
278
+ "exclusiveMinimum": 0
279
+ }
280
+ },
281
+ "required": [
282
+ "color",
283
+ "widthPt"
284
+ ],
285
+ "additionalProperties": false
286
+ },
287
+ "sourcePath": {
288
+ "type": "string"
289
+ }
290
+ },
291
+ "required": [
292
+ "kind",
293
+ "xPt",
294
+ "yPt",
295
+ "widthPt",
296
+ "heightPt"
297
+ ],
298
+ "additionalProperties": false
299
+ },
300
+ {
301
+ "type": "object",
302
+ "properties": {
303
+ "kind": {
304
+ "type": "string",
305
+ "const": "line"
306
+ },
307
+ "x1Pt": {
308
+ "type": "number"
309
+ },
310
+ "y1Pt": {
311
+ "type": "number"
312
+ },
313
+ "x2Pt": {
314
+ "type": "number"
315
+ },
316
+ "y2Pt": {
317
+ "type": "number"
318
+ },
319
+ "color": {
320
+ "type": "object",
321
+ "properties": {
322
+ "r": {
323
+ "type": "number",
324
+ "minimum": 0,
325
+ "maximum": 1
326
+ },
327
+ "g": {
328
+ "type": "number",
329
+ "minimum": 0,
330
+ "maximum": 1
331
+ },
332
+ "b": {
333
+ "type": "number",
334
+ "minimum": 0,
335
+ "maximum": 1
336
+ }
337
+ },
338
+ "required": [
339
+ "r",
340
+ "g",
341
+ "b"
342
+ ],
343
+ "additionalProperties": false
344
+ },
345
+ "widthPt": {
346
+ "type": "number",
347
+ "exclusiveMinimum": 0
348
+ },
349
+ "sourcePath": {
350
+ "type": "string"
351
+ }
352
+ },
353
+ "required": [
354
+ "kind",
355
+ "x1Pt",
356
+ "y1Pt",
357
+ "x2Pt",
358
+ "y2Pt",
359
+ "color",
360
+ "widthPt"
361
+ ],
362
+ "additionalProperties": false
363
+ },
364
+ {
365
+ "type": "object",
366
+ "properties": {
367
+ "kind": {
368
+ "type": "string",
369
+ "const": "ellipse"
370
+ },
371
+ "xPt": {
372
+ "type": "number"
373
+ },
374
+ "yPt": {
375
+ "type": "number"
376
+ },
377
+ "widthPt": {
378
+ "type": "number",
379
+ "exclusiveMinimum": 0
380
+ },
381
+ "heightPt": {
382
+ "type": "number",
383
+ "exclusiveMinimum": 0
384
+ },
385
+ "fill": {
386
+ "type": "object",
387
+ "properties": {
388
+ "r": {
389
+ "type": "number",
390
+ "minimum": 0,
391
+ "maximum": 1
392
+ },
393
+ "g": {
394
+ "type": "number",
395
+ "minimum": 0,
396
+ "maximum": 1
397
+ },
398
+ "b": {
399
+ "type": "number",
400
+ "minimum": 0,
401
+ "maximum": 1
402
+ }
403
+ },
404
+ "required": [
405
+ "r",
406
+ "g",
407
+ "b"
408
+ ],
409
+ "additionalProperties": false
410
+ },
411
+ "stroke": {
412
+ "type": "object",
413
+ "properties": {
414
+ "color": {
415
+ "type": "object",
416
+ "properties": {
417
+ "r": {
418
+ "type": "number",
419
+ "minimum": 0,
420
+ "maximum": 1
421
+ },
422
+ "g": {
423
+ "type": "number",
424
+ "minimum": 0,
425
+ "maximum": 1
426
+ },
427
+ "b": {
428
+ "type": "number",
429
+ "minimum": 0,
430
+ "maximum": 1
431
+ }
432
+ },
433
+ "required": [
434
+ "r",
435
+ "g",
436
+ "b"
437
+ ],
438
+ "additionalProperties": false
439
+ },
440
+ "widthPt": {
441
+ "type": "number",
442
+ "exclusiveMinimum": 0
443
+ }
444
+ },
445
+ "required": [
446
+ "color",
447
+ "widthPt"
448
+ ],
449
+ "additionalProperties": false
450
+ },
451
+ "sourcePath": {
452
+ "type": "string"
453
+ }
454
+ },
455
+ "required": [
456
+ "kind",
457
+ "xPt",
458
+ "yPt",
459
+ "widthPt",
460
+ "heightPt"
461
+ ],
462
+ "additionalProperties": false
463
+ },
464
+ {
465
+ "type": "object",
466
+ "properties": {
467
+ "kind": {
468
+ "type": "string",
469
+ "const": "path"
470
+ },
471
+ "subpaths": {
472
+ "type": "array",
473
+ "items": {
474
+ "type": "object",
475
+ "properties": {
476
+ "startXPt": {
477
+ "type": "number"
478
+ },
479
+ "startYPt": {
480
+ "type": "number"
481
+ },
482
+ "segments": {
483
+ "type": "array",
484
+ "items": {
485
+ "oneOf": [
486
+ {
487
+ "type": "object",
488
+ "properties": {
489
+ "kind": {
490
+ "type": "string",
491
+ "const": "line"
492
+ },
493
+ "xPt": {
494
+ "type": "number"
495
+ },
496
+ "yPt": {
497
+ "type": "number"
498
+ }
499
+ },
500
+ "required": [
501
+ "kind",
502
+ "xPt",
503
+ "yPt"
504
+ ],
505
+ "additionalProperties": false
506
+ },
507
+ {
508
+ "type": "object",
509
+ "properties": {
510
+ "kind": {
511
+ "type": "string",
512
+ "const": "cubic"
513
+ },
514
+ "c1xPt": {
515
+ "type": "number"
516
+ },
517
+ "c1yPt": {
518
+ "type": "number"
519
+ },
520
+ "c2xPt": {
521
+ "type": "number"
522
+ },
523
+ "c2yPt": {
524
+ "type": "number"
525
+ },
526
+ "xPt": {
527
+ "type": "number"
528
+ },
529
+ "yPt": {
530
+ "type": "number"
531
+ }
532
+ },
533
+ "required": [
534
+ "kind",
535
+ "c1xPt",
536
+ "c1yPt",
537
+ "c2xPt",
538
+ "c2yPt",
539
+ "xPt",
540
+ "yPt"
541
+ ],
542
+ "additionalProperties": false
543
+ }
544
+ ]
545
+ }
546
+ },
547
+ "closed": {
548
+ "type": "boolean"
549
+ }
550
+ },
551
+ "required": [
552
+ "startXPt",
553
+ "startYPt",
554
+ "segments",
555
+ "closed"
556
+ ],
557
+ "additionalProperties": false
558
+ }
559
+ },
560
+ "fill": {
561
+ "type": "object",
562
+ "properties": {
563
+ "r": {
564
+ "type": "number",
565
+ "minimum": 0,
566
+ "maximum": 1
567
+ },
568
+ "g": {
569
+ "type": "number",
570
+ "minimum": 0,
571
+ "maximum": 1
572
+ },
573
+ "b": {
574
+ "type": "number",
575
+ "minimum": 0,
576
+ "maximum": 1
577
+ }
578
+ },
579
+ "required": [
580
+ "r",
581
+ "g",
582
+ "b"
583
+ ],
584
+ "additionalProperties": false
585
+ },
586
+ "fillRule": {
587
+ "type": "string",
588
+ "enum": [
589
+ "nonzero",
590
+ "evenodd"
591
+ ]
592
+ },
593
+ "stroke": {
594
+ "type": "object",
595
+ "properties": {
596
+ "color": {
597
+ "type": "object",
598
+ "properties": {
599
+ "r": {
600
+ "type": "number",
601
+ "minimum": 0,
602
+ "maximum": 1
603
+ },
604
+ "g": {
605
+ "type": "number",
606
+ "minimum": 0,
607
+ "maximum": 1
608
+ },
609
+ "b": {
610
+ "type": "number",
611
+ "minimum": 0,
612
+ "maximum": 1
613
+ }
614
+ },
615
+ "required": [
616
+ "r",
617
+ "g",
618
+ "b"
619
+ ],
620
+ "additionalProperties": false
621
+ },
622
+ "widthPt": {
623
+ "type": "number",
624
+ "exclusiveMinimum": 0
625
+ }
626
+ },
627
+ "required": [
628
+ "color",
629
+ "widthPt"
630
+ ],
631
+ "additionalProperties": false
632
+ },
633
+ "sourcePath": {
634
+ "type": "string"
635
+ }
636
+ },
637
+ "required": [
638
+ "kind",
639
+ "subpaths"
640
+ ],
641
+ "additionalProperties": false
642
+ },
643
+ {
644
+ "type": "object",
645
+ "properties": {
646
+ "kind": {
647
+ "type": "string",
648
+ "const": "link"
649
+ },
650
+ "uri": {
651
+ "type": "string"
652
+ },
653
+ "xPt": {
654
+ "type": "number"
655
+ },
656
+ "yPt": {
657
+ "type": "number"
658
+ },
659
+ "widthPt": {
660
+ "type": "number",
661
+ "minimum": 0
662
+ },
663
+ "heightPt": {
664
+ "type": "number",
665
+ "minimum": 0
666
+ },
667
+ "sourcePath": {
668
+ "type": "string"
669
+ }
670
+ },
671
+ "required": [
672
+ "kind",
673
+ "uri",
674
+ "xPt",
675
+ "yPt",
676
+ "widthPt",
677
+ "heightPt"
678
+ ],
679
+ "additionalProperties": false
680
+ }
681
+ ]
682
+ }
683
+ },
684
+ "notes": {
685
+ "type": "string"
686
+ }
687
+ },
688
+ "required": [
689
+ "widthPt",
690
+ "heightPt",
691
+ "items"
692
+ ],
693
+ "additionalProperties": false
694
+ }
695
+ },
696
+ "images": {
697
+ "type": "object",
698
+ "propertyNames": {
699
+ "type": "string"
700
+ },
701
+ "additionalProperties": {
702
+ "type": "object",
703
+ "properties": {
704
+ "format": {
705
+ "type": "string",
706
+ "enum": [
707
+ "png",
708
+ "jpeg"
709
+ ]
710
+ },
711
+ "base64": {
712
+ "type": "string"
713
+ },
714
+ "widthPx": {
715
+ "type": "integer",
716
+ "exclusiveMinimum": 0,
717
+ "maximum": 9007199254740991
718
+ },
719
+ "heightPx": {
720
+ "type": "integer",
721
+ "exclusiveMinimum": 0,
722
+ "maximum": 9007199254740991
723
+ }
724
+ },
725
+ "required": [
726
+ "format",
727
+ "base64",
728
+ "widthPx",
729
+ "heightPx"
730
+ ],
731
+ "additionalProperties": false
732
+ }
733
+ }
734
+ },
735
+ "required": [
736
+ "formatVersion",
737
+ "metadata",
738
+ "pages",
739
+ "images"
740
+ ],
741
+ "additionalProperties": false
742
+ }