document-model.js 1.10.0 → 2.0.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.
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "$schema": "https://json-schema.org/draft/2020-12/schema",
3
- "$id": "https://cdn.jsdelivr.net/npm/document-schema.js@1.10.0/schemas/content-document.schema.json",
3
+ "$id": "https://cdn.jsdelivr.net/npm/document-schema.js@2.0.0/schemas/content-document.schema.json",
4
4
  "oneOf": [
5
5
  {
6
6
  "type": "object",
@@ -11,7 +11,7 @@
11
11
  },
12
12
  "formatVersion": {
13
13
  "type": "number",
14
- "const": 1
14
+ "const": 2
15
15
  },
16
16
  "metadata": {
17
17
  "type": "object",
@@ -130,7 +130,7 @@
130
130
  },
131
131
  "formatVersion": {
132
132
  "type": "number",
133
- "const": 1
133
+ "const": 2
134
134
  },
135
135
  "metadata": {
136
136
  "type": "object",
@@ -249,6 +249,9 @@
249
249
  "type": "number",
250
250
  "minimum": 0
251
251
  },
252
+ "paintOrder": {
253
+ "type": "number"
254
+ },
252
255
  "sourcePath": {
253
256
  "type": "string"
254
257
  },
@@ -300,7 +303,7 @@
300
303
  },
301
304
  "formatVersion": {
302
305
  "type": "number",
303
- "const": 1
306
+ "const": 2
304
307
  },
305
308
  "metadata": {
306
309
  "type": "object",
@@ -369,6 +372,10 @@
369
372
  },
370
373
  "value": {
371
374
  "type": "number"
375
+ },
376
+ "exactValue": {
377
+ "type": "string",
378
+ "pattern": "^-?(0|[1-9]\\d*)(\\.\\d+)?$"
372
379
  }
373
380
  },
374
381
  "required": [
@@ -386,6 +393,10 @@
386
393
  },
387
394
  "value": {
388
395
  "type": "number"
396
+ },
397
+ "exactValue": {
398
+ "type": "string",
399
+ "pattern": "^-?(0|[1-9]\\d*)(\\.\\d+)?$"
389
400
  }
390
401
  },
391
402
  "required": [
@@ -406,6 +417,10 @@
406
417
  },
407
418
  "currency": {
408
419
  "type": "string"
420
+ },
421
+ "exactValue": {
422
+ "type": "string",
423
+ "pattern": "^-?(0|[1-9]\\d*)(\\.\\d+)?$"
409
424
  }
410
425
  },
411
426
  "required": [
@@ -465,6 +480,23 @@
465
480
  ],
466
481
  "additionalProperties": false
467
482
  },
483
+ {
484
+ "type": "object",
485
+ "properties": {
486
+ "kind": {
487
+ "type": "string",
488
+ "const": "dateTime"
489
+ },
490
+ "value": {
491
+ "type": "string"
492
+ }
493
+ },
494
+ "required": [
495
+ "kind",
496
+ "value"
497
+ ],
498
+ "additionalProperties": false
499
+ },
468
500
  {
469
501
  "type": "object",
470
502
  "properties": {
@@ -595,6 +627,254 @@
595
627
  "type": "integer",
596
628
  "exclusiveMinimum": 0,
597
629
  "maximum": 9007199254740991
630
+ },
631
+ "background": {
632
+ "type": "object",
633
+ "properties": {
634
+ "r": {
635
+ "type": "number",
636
+ "minimum": 0,
637
+ "maximum": 1
638
+ },
639
+ "g": {
640
+ "type": "number",
641
+ "minimum": 0,
642
+ "maximum": 1
643
+ },
644
+ "b": {
645
+ "type": "number",
646
+ "minimum": 0,
647
+ "maximum": 1
648
+ }
649
+ },
650
+ "required": [
651
+ "r",
652
+ "g",
653
+ "b"
654
+ ],
655
+ "additionalProperties": false
656
+ },
657
+ "borders": {
658
+ "type": "object",
659
+ "properties": {
660
+ "left": {
661
+ "type": "object",
662
+ "properties": {
663
+ "color": {
664
+ "type": "object",
665
+ "properties": {
666
+ "r": {
667
+ "type": "number",
668
+ "minimum": 0,
669
+ "maximum": 1
670
+ },
671
+ "g": {
672
+ "type": "number",
673
+ "minimum": 0,
674
+ "maximum": 1
675
+ },
676
+ "b": {
677
+ "type": "number",
678
+ "minimum": 0,
679
+ "maximum": 1
680
+ }
681
+ },
682
+ "required": [
683
+ "r",
684
+ "g",
685
+ "b"
686
+ ],
687
+ "additionalProperties": false
688
+ },
689
+ "widthPt": {
690
+ "type": "number",
691
+ "exclusiveMinimum": 0
692
+ },
693
+ "style": {
694
+ "type": "string",
695
+ "enum": [
696
+ "solid",
697
+ "dashed",
698
+ "dotted",
699
+ "double"
700
+ ]
701
+ }
702
+ },
703
+ "required": [
704
+ "color",
705
+ "widthPt"
706
+ ],
707
+ "additionalProperties": false
708
+ },
709
+ "right": {
710
+ "type": "object",
711
+ "properties": {
712
+ "color": {
713
+ "type": "object",
714
+ "properties": {
715
+ "r": {
716
+ "type": "number",
717
+ "minimum": 0,
718
+ "maximum": 1
719
+ },
720
+ "g": {
721
+ "type": "number",
722
+ "minimum": 0,
723
+ "maximum": 1
724
+ },
725
+ "b": {
726
+ "type": "number",
727
+ "minimum": 0,
728
+ "maximum": 1
729
+ }
730
+ },
731
+ "required": [
732
+ "r",
733
+ "g",
734
+ "b"
735
+ ],
736
+ "additionalProperties": false
737
+ },
738
+ "widthPt": {
739
+ "type": "number",
740
+ "exclusiveMinimum": 0
741
+ },
742
+ "style": {
743
+ "type": "string",
744
+ "enum": [
745
+ "solid",
746
+ "dashed",
747
+ "dotted",
748
+ "double"
749
+ ]
750
+ }
751
+ },
752
+ "required": [
753
+ "color",
754
+ "widthPt"
755
+ ],
756
+ "additionalProperties": false
757
+ },
758
+ "top": {
759
+ "type": "object",
760
+ "properties": {
761
+ "color": {
762
+ "type": "object",
763
+ "properties": {
764
+ "r": {
765
+ "type": "number",
766
+ "minimum": 0,
767
+ "maximum": 1
768
+ },
769
+ "g": {
770
+ "type": "number",
771
+ "minimum": 0,
772
+ "maximum": 1
773
+ },
774
+ "b": {
775
+ "type": "number",
776
+ "minimum": 0,
777
+ "maximum": 1
778
+ }
779
+ },
780
+ "required": [
781
+ "r",
782
+ "g",
783
+ "b"
784
+ ],
785
+ "additionalProperties": false
786
+ },
787
+ "widthPt": {
788
+ "type": "number",
789
+ "exclusiveMinimum": 0
790
+ },
791
+ "style": {
792
+ "type": "string",
793
+ "enum": [
794
+ "solid",
795
+ "dashed",
796
+ "dotted",
797
+ "double"
798
+ ]
799
+ }
800
+ },
801
+ "required": [
802
+ "color",
803
+ "widthPt"
804
+ ],
805
+ "additionalProperties": false
806
+ },
807
+ "bottom": {
808
+ "type": "object",
809
+ "properties": {
810
+ "color": {
811
+ "type": "object",
812
+ "properties": {
813
+ "r": {
814
+ "type": "number",
815
+ "minimum": 0,
816
+ "maximum": 1
817
+ },
818
+ "g": {
819
+ "type": "number",
820
+ "minimum": 0,
821
+ "maximum": 1
822
+ },
823
+ "b": {
824
+ "type": "number",
825
+ "minimum": 0,
826
+ "maximum": 1
827
+ }
828
+ },
829
+ "required": [
830
+ "r",
831
+ "g",
832
+ "b"
833
+ ],
834
+ "additionalProperties": false
835
+ },
836
+ "widthPt": {
837
+ "type": "number",
838
+ "exclusiveMinimum": 0
839
+ },
840
+ "style": {
841
+ "type": "string",
842
+ "enum": [
843
+ "solid",
844
+ "dashed",
845
+ "dotted",
846
+ "double"
847
+ ]
848
+ }
849
+ },
850
+ "required": [
851
+ "color",
852
+ "widthPt"
853
+ ],
854
+ "additionalProperties": false
855
+ }
856
+ },
857
+ "additionalProperties": false
858
+ },
859
+ "alignment": {
860
+ "type": "string",
861
+ "enum": [
862
+ "left",
863
+ "center",
864
+ "right",
865
+ "justify"
866
+ ]
867
+ },
868
+ "verticalAlignment": {
869
+ "type": "string",
870
+ "enum": [
871
+ "top",
872
+ "middle",
873
+ "bottom"
874
+ ]
875
+ },
876
+ "sourcePath": {
877
+ "type": "string"
598
878
  }
599
879
  },
600
880
  "required": [
@@ -618,15 +898,14 @@
618
898
  },
619
899
  "widthPt": {
620
900
  "type": "number",
621
- "minimum": 0
901
+ "exclusiveMinimum": 0
622
902
  },
623
903
  "hidden": {
624
904
  "type": "boolean"
625
905
  }
626
906
  },
627
907
  "required": [
628
- "index",
629
- "widthPt"
908
+ "index"
630
909
  ],
631
910
  "additionalProperties": false
632
911
  }
@@ -643,15 +922,14 @@
643
922
  },
644
923
  "heightPt": {
645
924
  "type": "number",
646
- "minimum": 0
925
+ "exclusiveMinimum": 0
647
926
  },
648
927
  "hidden": {
649
928
  "type": "boolean"
650
929
  }
651
930
  },
652
931
  "required": [
653
- "index",
654
- "heightPt"
932
+ "index"
655
933
  ],
656
934
  "additionalProperties": false
657
935
  }
@@ -801,7 +1079,7 @@
801
1079
  ],
802
1080
  "additionalProperties": false
803
1081
  },
804
- "scale": {
1082
+ "scalePercent": {
805
1083
  "type": "number",
806
1084
  "exclusiveMinimum": 0
807
1085
  },
@@ -930,7 +1208,7 @@
930
1208
  ]
931
1209
  },
932
1210
  "document": {
933
- "$ref": "https://cdn.jsdelivr.net/npm/document-schema.js@1.10.0/schemas/content-document.schema.json"
1211
+ "$ref": "https://cdn.jsdelivr.net/npm/document-schema.js@2.0.0/schemas/content-document.schema.json"
934
1212
  },
935
1213
  "frame": {
936
1214
  "$ref": "#/$defs/Box"
@@ -974,7 +1252,7 @@
974
1252
  },
975
1253
  "formatVersion": {
976
1254
  "type": "number",
977
- "const": 1
1255
+ "const": 2
978
1256
  },
979
1257
  "metadata": {
980
1258
  "type": "object",
@@ -1093,6 +1371,9 @@
1093
1371
  "type": "number",
1094
1372
  "minimum": 0
1095
1373
  },
1374
+ "paintOrder": {
1375
+ "type": "number"
1376
+ },
1096
1377
  "sourcePath": {
1097
1378
  "type": "string"
1098
1379
  },
@@ -1151,6 +1432,9 @@
1151
1432
  ],
1152
1433
  "additionalProperties": false
1153
1434
  },
1435
+ "rotationDeg": {
1436
+ "type": "number"
1437
+ },
1154
1438
  "fill": {
1155
1439
  "type": "object",
1156
1440
  "properties": {
@@ -1209,6 +1493,15 @@
1209
1493
  "widthPt": {
1210
1494
  "type": "number",
1211
1495
  "exclusiveMinimum": 0
1496
+ },
1497
+ "style": {
1498
+ "type": "string",
1499
+ "enum": [
1500
+ "solid",
1501
+ "dashed",
1502
+ "dotted",
1503
+ "double"
1504
+ ]
1212
1505
  }
1213
1506
  },
1214
1507
  "required": [
@@ -1217,6 +1510,9 @@
1217
1510
  ],
1218
1511
  "additionalProperties": false
1219
1512
  },
1513
+ "paintOrder": {
1514
+ "type": "number"
1515
+ },
1220
1516
  "sourcePath": {
1221
1517
  "type": "string"
1222
1518
  }
@@ -1260,6 +1556,9 @@
1260
1556
  ],
1261
1557
  "additionalProperties": false
1262
1558
  },
1559
+ "rotationDeg": {
1560
+ "type": "number"
1561
+ },
1263
1562
  "fill": {
1264
1563
  "type": "object",
1265
1564
  "properties": {
@@ -1318,6 +1617,15 @@
1318
1617
  "widthPt": {
1319
1618
  "type": "number",
1320
1619
  "exclusiveMinimum": 0
1620
+ },
1621
+ "style": {
1622
+ "type": "string",
1623
+ "enum": [
1624
+ "solid",
1625
+ "dashed",
1626
+ "dotted",
1627
+ "double"
1628
+ ]
1321
1629
  }
1322
1630
  },
1323
1631
  "required": [
@@ -1326,6 +1634,9 @@
1326
1634
  ],
1327
1635
  "additionalProperties": false
1328
1636
  },
1637
+ "paintOrder": {
1638
+ "type": "number"
1639
+ },
1329
1640
  "sourcePath": {
1330
1641
  "type": "string"
1331
1642
  }
@@ -1407,6 +1718,15 @@
1407
1718
  "widthPt": {
1408
1719
  "type": "number",
1409
1720
  "exclusiveMinimum": 0
1721
+ },
1722
+ "style": {
1723
+ "type": "string",
1724
+ "enum": [
1725
+ "solid",
1726
+ "dashed",
1727
+ "dotted",
1728
+ "double"
1729
+ ]
1410
1730
  }
1411
1731
  },
1412
1732
  "required": [
@@ -1415,6 +1735,9 @@
1415
1735
  ],
1416
1736
  "additionalProperties": false
1417
1737
  },
1738
+ "paintOrder": {
1739
+ "type": "number"
1740
+ },
1418
1741
  "sourcePath": {
1419
1742
  "type": "string"
1420
1743
  }
@@ -1460,6 +1783,9 @@
1460
1783
  ],
1461
1784
  "additionalProperties": false
1462
1785
  },
1786
+ "rotationDeg": {
1787
+ "type": "number"
1788
+ },
1463
1789
  "subpaths": {
1464
1790
  "type": "array",
1465
1791
  "items": {
@@ -1659,6 +1985,15 @@
1659
1985
  "widthPt": {
1660
1986
  "type": "number",
1661
1987
  "exclusiveMinimum": 0
1988
+ },
1989
+ "style": {
1990
+ "type": "string",
1991
+ "enum": [
1992
+ "solid",
1993
+ "dashed",
1994
+ "dotted",
1995
+ "double"
1996
+ ]
1662
1997
  }
1663
1998
  },
1664
1999
  "required": [
@@ -1667,6 +2002,9 @@
1667
2002
  ],
1668
2003
  "additionalProperties": false
1669
2004
  },
2005
+ "paintOrder": {
2006
+ "type": "number"
2007
+ },
1670
2008
  "sourcePath": {
1671
2009
  "type": "string"
1672
2010
  }
@@ -1698,6 +2036,77 @@
1698
2036
  "pages"
1699
2037
  ],
1700
2038
  "additionalProperties": false
2039
+ },
2040
+ {
2041
+ "type": "object",
2042
+ "properties": {
2043
+ "kind": {
2044
+ "type": "string",
2045
+ "const": "formula"
2046
+ },
2047
+ "formatVersion": {
2048
+ "type": "number",
2049
+ "const": 2
2050
+ },
2051
+ "metadata": {
2052
+ "type": "object",
2053
+ "properties": {
2054
+ "title": {
2055
+ "type": "string"
2056
+ },
2057
+ "author": {
2058
+ "type": "string"
2059
+ },
2060
+ "subject": {
2061
+ "type": "string"
2062
+ },
2063
+ "keywords": {
2064
+ "type": "array",
2065
+ "items": {
2066
+ "type": "string"
2067
+ }
2068
+ },
2069
+ "creator": {
2070
+ "type": "string"
2071
+ },
2072
+ "producer": {
2073
+ "type": "string"
2074
+ },
2075
+ "createdIso": {
2076
+ "type": "string"
2077
+ },
2078
+ "modifiedIso": {
2079
+ "type": "string"
2080
+ }
2081
+ },
2082
+ "additionalProperties": false
2083
+ },
2084
+ "formula": {
2085
+ "type": "object",
2086
+ "properties": {
2087
+ "mathml": {
2088
+ "type": "array",
2089
+ "items": {
2090
+ "$ref": "#/$defs/MathMlNode"
2091
+ }
2092
+ },
2093
+ "starMath": {
2094
+ "type": "string"
2095
+ }
2096
+ },
2097
+ "required": [
2098
+ "mathml"
2099
+ ],
2100
+ "additionalProperties": false
2101
+ }
2102
+ },
2103
+ "required": [
2104
+ "kind",
2105
+ "formatVersion",
2106
+ "metadata",
2107
+ "formula"
2108
+ ],
2109
+ "additionalProperties": false
1701
2110
  }
1702
2111
  ],
1703
2112
  "$defs": {
@@ -1762,6 +2171,53 @@
1762
2171
  "justify"
1763
2172
  ]
1764
2173
  },
2174
+ "ContentStrokeStyle": {
2175
+ "type": "string",
2176
+ "enum": [
2177
+ "solid",
2178
+ "dashed",
2179
+ "dotted",
2180
+ "double"
2181
+ ]
2182
+ },
2183
+ "ContentBorder": {
2184
+ "type": "object",
2185
+ "properties": {
2186
+ "color": {
2187
+ "$ref": "#/$defs/Color"
2188
+ },
2189
+ "widthPt": {
2190
+ "type": "number",
2191
+ "exclusiveMinimum": 0
2192
+ },
2193
+ "style": {
2194
+ "$ref": "#/$defs/ContentStrokeStyle"
2195
+ }
2196
+ },
2197
+ "required": [
2198
+ "color",
2199
+ "widthPt"
2200
+ ],
2201
+ "additionalProperties": false
2202
+ },
2203
+ "ContentCellBorders": {
2204
+ "type": "object",
2205
+ "properties": {
2206
+ "left": {
2207
+ "$ref": "#/$defs/ContentBorder"
2208
+ },
2209
+ "right": {
2210
+ "$ref": "#/$defs/ContentBorder"
2211
+ },
2212
+ "top": {
2213
+ "$ref": "#/$defs/ContentBorder"
2214
+ },
2215
+ "bottom": {
2216
+ "$ref": "#/$defs/ContentBorder"
2217
+ }
2218
+ },
2219
+ "additionalProperties": false
2220
+ },
1765
2221
  "ContentListMembership": {
1766
2222
  "type": "object",
1767
2223
  "properties": {
@@ -1946,6 +2402,12 @@
1946
2402
  },
1947
2403
  "background": {
1948
2404
  "$ref": "#/$defs/Color"
2405
+ },
2406
+ "borders": {
2407
+ "$ref": "#/$defs/ContentCellBorders"
2408
+ },
2409
+ "sourcePath": {
2410
+ "type": "string"
1949
2411
  }
1950
2412
  },
1951
2413
  "required": [
@@ -2021,7 +2483,7 @@
2021
2483
  ]
2022
2484
  },
2023
2485
  "document": {
2024
- "$ref": "https://cdn.jsdelivr.net/npm/document-schema.js@1.10.0/schemas/content-document.schema.json"
2486
+ "$ref": "https://cdn.jsdelivr.net/npm/document-schema.js@2.0.0/schemas/content-document.schema.json"
2025
2487
  },
2026
2488
  "frame": {
2027
2489
  "$ref": "#/$defs/Box"
@@ -2056,6 +2518,152 @@
2056
2518
  "$ref": "#/$defs/ContentEmbeddedObjectBlock"
2057
2519
  }
2058
2520
  ]
2521
+ },
2522
+ "MathMlAttribute": {
2523
+ "type": "object",
2524
+ "properties": {
2525
+ "name": {
2526
+ "type": "string"
2527
+ },
2528
+ "value": {
2529
+ "type": "string"
2530
+ }
2531
+ },
2532
+ "required": [
2533
+ "name",
2534
+ "value"
2535
+ ],
2536
+ "additionalProperties": false
2537
+ },
2538
+ "MathMlElement": {
2539
+ "type": "object",
2540
+ "properties": {
2541
+ "type": {
2542
+ "type": "string",
2543
+ "const": "element"
2544
+ },
2545
+ "tag": {
2546
+ "type": "string"
2547
+ },
2548
+ "attributes": {
2549
+ "type": "array",
2550
+ "items": {
2551
+ "$ref": "#/$defs/MathMlAttribute"
2552
+ }
2553
+ },
2554
+ "children": {
2555
+ "type": "array",
2556
+ "items": {
2557
+ "$ref": "#/$defs/MathMlNode"
2558
+ }
2559
+ }
2560
+ },
2561
+ "required": [
2562
+ "type",
2563
+ "tag",
2564
+ "attributes",
2565
+ "children"
2566
+ ],
2567
+ "additionalProperties": false
2568
+ },
2569
+ "MathMlNode": {
2570
+ "oneOf": [
2571
+ {
2572
+ "type": "object",
2573
+ "properties": {
2574
+ "type": {
2575
+ "type": "string",
2576
+ "const": "text"
2577
+ },
2578
+ "value": {
2579
+ "type": "string"
2580
+ }
2581
+ },
2582
+ "required": [
2583
+ "type",
2584
+ "value"
2585
+ ],
2586
+ "additionalProperties": false
2587
+ },
2588
+ {
2589
+ "type": "object",
2590
+ "properties": {
2591
+ "type": {
2592
+ "type": "string",
2593
+ "const": "cdata"
2594
+ },
2595
+ "value": {
2596
+ "type": "string"
2597
+ }
2598
+ },
2599
+ "required": [
2600
+ "type",
2601
+ "value"
2602
+ ],
2603
+ "additionalProperties": false
2604
+ },
2605
+ {
2606
+ "type": "object",
2607
+ "properties": {
2608
+ "type": {
2609
+ "type": "string",
2610
+ "const": "comment"
2611
+ },
2612
+ "value": {
2613
+ "type": "string"
2614
+ }
2615
+ },
2616
+ "required": [
2617
+ "type",
2618
+ "value"
2619
+ ],
2620
+ "additionalProperties": false
2621
+ },
2622
+ {
2623
+ "type": "object",
2624
+ "properties": {
2625
+ "type": {
2626
+ "type": "string",
2627
+ "const": "declaration"
2628
+ },
2629
+ "attributes": {
2630
+ "type": "array",
2631
+ "items": {
2632
+ "$ref": "#/$defs/MathMlAttribute"
2633
+ }
2634
+ }
2635
+ },
2636
+ "required": [
2637
+ "type",
2638
+ "attributes"
2639
+ ],
2640
+ "additionalProperties": false
2641
+ },
2642
+ {
2643
+ "type": "object",
2644
+ "properties": {
2645
+ "type": {
2646
+ "type": "string",
2647
+ "const": "pi"
2648
+ },
2649
+ "target": {
2650
+ "type": "string"
2651
+ },
2652
+ "content": {
2653
+ "type": "string"
2654
+ }
2655
+ },
2656
+ "required": [
2657
+ "type",
2658
+ "target",
2659
+ "content"
2660
+ ],
2661
+ "additionalProperties": false
2662
+ },
2663
+ {
2664
+ "$ref": "#/$defs/MathMlElement"
2665
+ }
2666
+ ]
2059
2667
  }
2060
2668
  }
2061
2669
  }