pro-editor-schema 0.1.17 → 0.1.181

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.
package/dist/index.d.mts CHANGED
@@ -20,8 +20,8 @@ type Schema<TRequiredAttributes = readonly AttributeDefinition[], TOptionalAttri
20
20
  allowedChildTagNames: ReadonlySet<AllowedChildren>;
21
21
  };
22
22
  type SchemaCode = ElementSchemaCode | InlineSchemaCode | AtomSchemaCode;
23
- type ElementSchemaCode = "degrees" | "email" | "equation" | "fignote" | "figsource" | "firstname" | "footnote" | "footnoteno" | "honorific" | "img" | "informalfigure" | "keyword" | "label1" | "li" | "line" | "lrh" | "olink" | "org" | "orgname" | "para" | "punc" | "rrh" | "source1" | "speaker" | "subtitle1" | "surname" | "tag" | "tblfn" | "tblsource" | "thead" | "title1" | "token" | "tp" | "abstract1" | "affiliation" | "alttext" | "appendix" | "author" | "authorgroup" | "blockquote" | "caption1" | "chapter" | "dialogue" | "epigraph" | "figure1" | "footnoteSection" | "heading" | "imageobject" | "info1" | "keywordset" | "mediaobject" | "ol" | "personname" | "poem" | "sidebar" | "table" | "table1" | "tbody" | "td" | "tgroup" | "tr" | "ul";
24
- type AtomSchemaCode = "b" | "commentQuerySection" | "comment" | "content" | "query" | "reply" | "deletion" | "emphasis" | "highlightmark" | "i" | "insertion" | "sc" | "strike" | "sub" | "sup" | "u";
23
+ type ElementSchemaCode = "degrees" | "email" | "equation" | "fignote" | "figsource" | "firstname" | "footnote" | "footnoteno" | "honorific" | "img" | "informalfigure" | "keyword" | "label1" | "li" | "line" | "lrh" | "math" | "mathphrase" | "merror" | "mfrac" | "mi" | "mmultiscripts" | "mn" | "mo" | "mover" | "mpadded" | "mphantom" | "mprescripts" | "mroot" | "mrow" | "ms" | "mspace" | "msqrt" | "mstyle" | "msub" | "msubsup" | "msup" | "mtable" | "mtd" | "mtext" | "mtr" | "munder" | "munderover" | "olink" | "org" | "orgname" | "para" | "punc" | "rrh" | "source1" | "speaker" | "subtitle1" | "surname" | "tag" | "tblfn" | "tblsource" | "thead" | "title1" | "token" | "tp" | "abstract1" | "affiliation" | "alttext" | "appendix" | "author" | "authorgroup" | "blockquote" | "caption1" | "chapter" | "dialogue" | "epigraph" | "figure1" | "footnoteSection" | "heading" | "imageobject" | "info1" | "keywordset" | "mediaobject" | "ol" | "personname" | "poem" | "sidebar" | "table" | "table1" | "tbody" | "td" | "tgroup" | "tr" | "ul";
24
+ type AtomSchemaCode = "indexterm" | "primary" | "secondary" | "tertiary" | "quaternary" | "bookmark" | "see" | "commentQuerySection" | "comment" | "content" | "query" | "reply" | "deletion" | "emphasis" | "highlightmark" | "i" | "insertion" | "sc" | "strike" | "sub" | "sup" | "u" | "b";
25
25
  type InlineSchemaCode = "footnote1" | "inlineequation" | "link" | "uri";
26
26
 
27
27
  declare const SCHEMAS: Record<SchemaCode, Schema>;
package/dist/index.d.ts CHANGED
@@ -20,8 +20,8 @@ type Schema<TRequiredAttributes = readonly AttributeDefinition[], TOptionalAttri
20
20
  allowedChildTagNames: ReadonlySet<AllowedChildren>;
21
21
  };
22
22
  type SchemaCode = ElementSchemaCode | InlineSchemaCode | AtomSchemaCode;
23
- type ElementSchemaCode = "degrees" | "email" | "equation" | "fignote" | "figsource" | "firstname" | "footnote" | "footnoteno" | "honorific" | "img" | "informalfigure" | "keyword" | "label1" | "li" | "line" | "lrh" | "olink" | "org" | "orgname" | "para" | "punc" | "rrh" | "source1" | "speaker" | "subtitle1" | "surname" | "tag" | "tblfn" | "tblsource" | "thead" | "title1" | "token" | "tp" | "abstract1" | "affiliation" | "alttext" | "appendix" | "author" | "authorgroup" | "blockquote" | "caption1" | "chapter" | "dialogue" | "epigraph" | "figure1" | "footnoteSection" | "heading" | "imageobject" | "info1" | "keywordset" | "mediaobject" | "ol" | "personname" | "poem" | "sidebar" | "table" | "table1" | "tbody" | "td" | "tgroup" | "tr" | "ul";
24
- type AtomSchemaCode = "b" | "commentQuerySection" | "comment" | "content" | "query" | "reply" | "deletion" | "emphasis" | "highlightmark" | "i" | "insertion" | "sc" | "strike" | "sub" | "sup" | "u";
23
+ type ElementSchemaCode = "degrees" | "email" | "equation" | "fignote" | "figsource" | "firstname" | "footnote" | "footnoteno" | "honorific" | "img" | "informalfigure" | "keyword" | "label1" | "li" | "line" | "lrh" | "math" | "mathphrase" | "merror" | "mfrac" | "mi" | "mmultiscripts" | "mn" | "mo" | "mover" | "mpadded" | "mphantom" | "mprescripts" | "mroot" | "mrow" | "ms" | "mspace" | "msqrt" | "mstyle" | "msub" | "msubsup" | "msup" | "mtable" | "mtd" | "mtext" | "mtr" | "munder" | "munderover" | "olink" | "org" | "orgname" | "para" | "punc" | "rrh" | "source1" | "speaker" | "subtitle1" | "surname" | "tag" | "tblfn" | "tblsource" | "thead" | "title1" | "token" | "tp" | "abstract1" | "affiliation" | "alttext" | "appendix" | "author" | "authorgroup" | "blockquote" | "caption1" | "chapter" | "dialogue" | "epigraph" | "figure1" | "footnoteSection" | "heading" | "imageobject" | "info1" | "keywordset" | "mediaobject" | "ol" | "personname" | "poem" | "sidebar" | "table" | "table1" | "tbody" | "td" | "tgroup" | "tr" | "ul";
24
+ type AtomSchemaCode = "indexterm" | "primary" | "secondary" | "tertiary" | "quaternary" | "bookmark" | "see" | "commentQuerySection" | "comment" | "content" | "query" | "reply" | "deletion" | "emphasis" | "highlightmark" | "i" | "insertion" | "sc" | "strike" | "sub" | "sup" | "u" | "b";
25
25
  type InlineSchemaCode = "footnote1" | "inlineequation" | "link" | "uri";
26
26
 
27
27
  declare const SCHEMAS: Record<SchemaCode, Schema>;
package/dist/index.js CHANGED
@@ -140,9 +140,17 @@ var COMMENT_TAG = "COMMENT";
140
140
  var QUERY_TAG = "QUERY";
141
141
  var CONTENT_TAG = "CONTENT";
142
142
  var REPLY_TAG = "REPLY";
143
+ var INDEXTERM_TAG = "INDEXTERM";
144
+ var PRIMARY_TAG = "PRIMARY";
145
+ var SECONDARY_TAG = "SECONDARY";
146
+ var TERTIARY_TAG = "TERTIARY";
147
+ var QUATERNARY_TAG = "QUATERNARY";
148
+ var BOOKMARK_TAG = "BOOKMARK";
149
+ var SEE_TAG = "SEE";
143
150
 
144
151
  // src/schema/shared/allowedAtomsChildren.ts
145
152
  var ATOM_TAGS_ALLOWED_CHILDREN = [
153
+ { tagName: INDEXTERM_TAG, required: false },
146
154
  { tagName: B_TAG, required: false },
147
155
  { tagName: I_TAG, required: false },
148
156
  { tagName: U_TAG, required: false },
@@ -389,8 +397,152 @@ var REPLY_SCHEMA = createSchema({
389
397
  allowedChildTagNames: [{ tagName: CONTENT_TAG, required: true }]
390
398
  });
391
399
 
400
+ // src/schema/elementSchemas/atoms/indexing/indexTermAttributes.ts
401
+ var INDEX_TERM_ENTRY_REQUIRED_ATTRIBUTES = [
402
+ "data-date",
403
+ "data-user",
404
+ "firstEntry",
405
+ "secondEntry",
406
+ "thirdEntry",
407
+ "entry",
408
+ STORE_ATTRIBUTE,
409
+ "linkend"
410
+ ];
411
+ var BOOKMARK_INDEX_POSITION_ATTRIBUTE = {
412
+ name: "index-position",
413
+ values: ["start", "end"],
414
+ defaultValue: ""
415
+ };
416
+ var SEE_REQUIRED_ATTRIBUTES = [
417
+ "linkend",
418
+ "data-user",
419
+ "crossref-pageNumber",
420
+ {
421
+ name: "role",
422
+ values: ["see", "see-also"],
423
+ defaultValue: ""
424
+ },
425
+ STORE_ATTRIBUTE,
426
+ "data-date",
427
+ "crossref-firstEntry",
428
+ "crossref-secondEntry",
429
+ "crossref-thirdEntry",
430
+ "crossref-fourthEntry"
431
+ ];
432
+
433
+ // src/schema/elementSchemas/atoms/indexing/bookmark.ts
434
+ var BOOKMARK_SCHEMA = createSchema({
435
+ code: "bookmark",
436
+ kind: "atom",
437
+ tag: BOOKMARK_TAG,
438
+ requiredAttributes: [
439
+ ...INDEX_TERM_ENTRY_REQUIRED_ATTRIBUTES,
440
+ BOOKMARK_INDEX_POSITION_ATTRIBUTE
441
+ ],
442
+ optionalAttributes: [],
443
+ allowedChildTagNames: [
444
+ {
445
+ tagName: SEE_TAG,
446
+ required: false
447
+ }
448
+ ]
449
+ });
450
+
451
+ // src/schema/elementSchemas/atoms/indexing/indexterm.ts
452
+ var INDEXTERM_SCHEMA = createSchema({
453
+ code: "indexterm",
454
+ kind: "atom",
455
+ tag: INDEXTERM_TAG,
456
+ requiredAttributes: [
457
+ "linkend",
458
+ {
459
+ name: "index-level",
460
+ values: ["PRIMARY", "SECONDARY", "TERTIARY", "QUATERNARY"],
461
+ defaultValue: "PRIMARY"
462
+ },
463
+ STORE_ATTRIBUTE
464
+ ],
465
+ optionalAttributes: [],
466
+ allowedChildTagNames: [
467
+ { tagName: PRIMARY_TAG, required: false },
468
+ { tagName: SECONDARY_TAG, required: false },
469
+ { tagName: TERTIARY_TAG, required: false },
470
+ { tagName: QUATERNARY_TAG, required: false },
471
+ { tagName: BOOKMARK_TAG, required: false }
472
+ ]
473
+ });
474
+
475
+ // src/schema/elementSchemas/atoms/indexing/primary.ts
476
+ var PRIMARY_SCHEMA = createSchema({
477
+ code: "primary",
478
+ kind: "atom",
479
+ tag: PRIMARY_TAG,
480
+ requiredAttributes: [...INDEX_TERM_ENTRY_REQUIRED_ATTRIBUTES],
481
+ optionalAttributes: [],
482
+ allowedChildTagNames: [
483
+ ...ATOM_TAGS_ALLOWED_CHILDREN,
484
+ { tagName: SEE_TAG, required: false }
485
+ ]
486
+ });
487
+
488
+ // src/schema/elementSchemas/atoms/indexing/quaternary.ts
489
+ var QUATERNARY_SCHEMA = createSchema({
490
+ code: "quaternary",
491
+ kind: "atom",
492
+ tag: QUATERNARY_TAG,
493
+ requiredAttributes: [...INDEX_TERM_ENTRY_REQUIRED_ATTRIBUTES],
494
+ optionalAttributes: [],
495
+ allowedChildTagNames: [
496
+ ...ATOM_TAGS_ALLOWED_CHILDREN,
497
+ { tagName: SEE_TAG, required: false }
498
+ ]
499
+ });
500
+
501
+ // src/schema/elementSchemas/atoms/indexing/secondary.ts
502
+ var SECONDARY_SCHEMA = createSchema({
503
+ code: "secondary",
504
+ kind: "atom",
505
+ tag: SECONDARY_TAG,
506
+ requiredAttributes: [...INDEX_TERM_ENTRY_REQUIRED_ATTRIBUTES],
507
+ optionalAttributes: [],
508
+ allowedChildTagNames: [
509
+ ...ATOM_TAGS_ALLOWED_CHILDREN,
510
+ { tagName: SEE_TAG, required: false }
511
+ ]
512
+ });
513
+
514
+ // src/schema/elementSchemas/atoms/indexing/see.ts
515
+ var SEE_SCHEMA = createSchema({
516
+ code: "see",
517
+ kind: "atom",
518
+ tag: SEE_TAG,
519
+ requiredAttributes: [...SEE_REQUIRED_ATTRIBUTES],
520
+ optionalAttributes: [],
521
+ allowedChildTagNames: []
522
+ });
523
+
524
+ // src/schema/elementSchemas/atoms/indexing/tertiary.ts
525
+ var TERTIARY_SCHEMA = createSchema({
526
+ code: "tertiary",
527
+ kind: "atom",
528
+ tag: TERTIARY_TAG,
529
+ requiredAttributes: [...INDEX_TERM_ENTRY_REQUIRED_ATTRIBUTES],
530
+ optionalAttributes: [],
531
+ allowedChildTagNames: [
532
+ ...ATOM_TAGS_ALLOWED_CHILDREN,
533
+ { tagName: SEE_TAG, required: false }
534
+ ]
535
+ });
536
+
392
537
  // src/schema/elementSchemas/atoms/index.ts
393
538
  var ATOM_SCHEMAS = {
539
+ indexterm: INDEXTERM_SCHEMA,
540
+ primary: PRIMARY_SCHEMA,
541
+ secondary: SECONDARY_SCHEMA,
542
+ tertiary: TERTIARY_SCHEMA,
543
+ quaternary: QUATERNARY_SCHEMA,
544
+ bookmark: BOOKMARK_SCHEMA,
545
+ see: SEE_SCHEMA,
394
546
  b: B_SCHEMA,
395
547
  i: I_SCHEMA,
396
548
  u: U_SCHEMA,
@@ -471,6 +623,33 @@ var CHAPTER_TAG = "CHAPTER";
471
623
  var EPIGRAPH_TAG = "EPIGRAPH";
472
624
  var INFO_TAG = "INFO1";
473
625
  var POEM_TAG = "POEM";
626
+ var MATHPHRASE_TAG = "MATHPHRASE";
627
+ var MATH_TAG = "MATH";
628
+ var MERROR_TAG = "MERROR";
629
+ var MFRAC_TAG = "MFRAC";
630
+ var MI_TAG = "MI";
631
+ var MMULTISCRIPTS_TAG = "MMULTISCRIPTS";
632
+ var MN_TAG = "MN";
633
+ var MO_TAG = "MO";
634
+ var MOVER_TAG = "MOVER";
635
+ var MPADDED_TAG = "MPADDED";
636
+ var MPHANTOM_TAG = "MPHANTOM";
637
+ var MPRESCRIPTS_TAG = "MPRESCRIPTS";
638
+ var MROOT_TAG = "MROOT";
639
+ var MROW_TAG = "MROW";
640
+ var MS_TAG = "MS";
641
+ var MSPACE_TAG = "MSPACE";
642
+ var MSQRT_TAG = "MSQRT";
643
+ var MSTYLE_TAG = "MSTYLE";
644
+ var MSUB_TAG = "MSUB";
645
+ var MSUBSUP_TAG = "MSUBSUP";
646
+ var MSUP_TAG = "MSUP";
647
+ var MTABLE_TAG = "MTABLE";
648
+ var MTD_TAG = "MTD";
649
+ var MTEXT_TAG = "MTEXT";
650
+ var MTR_TAG = "MTR";
651
+ var MUNDER_TAG = "MUNDER";
652
+ var MUNDEROVER_TAG = "MUNDEROVER";
474
653
 
475
654
  // src/schema/elementSchemas/elements/authors/authorgroup.ts
476
655
  var AUTHORGROUP_SCHEMA = createSchema({
@@ -658,16 +837,362 @@ var DIALOGUE_SCHEMA = createSchema({
658
837
  ]
659
838
  });
660
839
 
661
- // src/schema/elementSchemas/elements/equation.ts
840
+ // src/schema/elementSchemas/elements/equation/equation.ts
662
841
  var EQUATION_SCHEMA = createSchema({
663
842
  code: "equation",
664
843
  kind: "element",
665
844
  tag: EQUATION_TAG,
845
+ requiredAttributes: [...ID_ATTRS],
846
+ optionalAttributes: [
847
+ ...TRACK_CHANGES_ATTRS,
848
+ {
849
+ name: "eqn-data",
850
+ values: ["new", "updated"],
851
+ defaultValue: "new"
852
+ },
853
+ {
854
+ name: "element-status",
855
+ values: ["added", "changed"],
856
+ defaultValue: "added"
857
+ }
858
+ ],
859
+ allowedChildTagNames: [{ tagName: MATHPHRASE_TAG, required: true }]
860
+ });
861
+
862
+ // src/schema/shared/allowedMathChildren.ts
863
+ var MATH_PRESENTATION_TAGS_ALLOWED_CHILDREN = [
864
+ { tagName: MERROR_TAG, required: false },
865
+ { tagName: MFRAC_TAG, required: false },
866
+ { tagName: MI_TAG, required: false },
867
+ { tagName: MMULTISCRIPTS_TAG, required: false },
868
+ { tagName: MN_TAG, required: false },
869
+ { tagName: MO_TAG, required: false },
870
+ { tagName: MOVER_TAG, required: false },
871
+ { tagName: MPADDED_TAG, required: false },
872
+ { tagName: MPHANTOM_TAG, required: false },
873
+ { tagName: MPRESCRIPTS_TAG, required: false },
874
+ { tagName: MROOT_TAG, required: false },
875
+ { tagName: MROW_TAG, required: false },
876
+ { tagName: MS_TAG, required: false },
877
+ { tagName: MSPACE_TAG, required: false },
878
+ { tagName: MSQRT_TAG, required: false },
879
+ { tagName: MSTYLE_TAG, required: false },
880
+ { tagName: MSUB_TAG, required: false },
881
+ { tagName: MSUBSUP_TAG, required: false },
882
+ { tagName: MSUP_TAG, required: false },
883
+ { tagName: MTABLE_TAG, required: false },
884
+ { tagName: MTD_TAG, required: false },
885
+ { tagName: MTEXT_TAG, required: false },
886
+ { tagName: MTR_TAG, required: false },
887
+ { tagName: MUNDER_TAG, required: false },
888
+ { tagName: MUNDEROVER_TAG, required: false }
889
+ ];
890
+
891
+ // src/schema/elementSchemas/elements/equation/math.ts
892
+ var MATH_SCHEMA = createSchema({
893
+ code: "math",
894
+ kind: "element",
895
+ tag: MATH_TAG,
896
+ requiredAttributes: [],
897
+ optionalAttributes: ["xmlns"],
898
+ allowedChildTagNames: [...MATH_PRESENTATION_TAGS_ALLOWED_CHILDREN]
899
+ });
900
+
901
+ // src/schema/elementSchemas/elements/equation/merror.ts
902
+ var MERROR_SCHEMA = createSchema({
903
+ code: "merror",
904
+ kind: "element",
905
+ tag: MERROR_TAG,
906
+ requiredAttributes: [],
907
+ optionalAttributes: [],
908
+ allowedChildTagNames: [...MATH_PRESENTATION_TAGS_ALLOWED_CHILDREN]
909
+ });
910
+
911
+ // src/schema/elementSchemas/elements/equation/mfrac.ts
912
+ var MFRAC_SCHEMA = createSchema({
913
+ code: "mfrac",
914
+ kind: "element",
915
+ tag: MFRAC_TAG,
916
+ requiredAttributes: [],
917
+ optionalAttributes: ["denomalign", "linethickness", "numalign"],
918
+ allowedChildTagNames: [...MATH_PRESENTATION_TAGS_ALLOWED_CHILDREN]
919
+ });
920
+
921
+ // src/schema/elementSchemas/elements/equation/mi.ts
922
+ var MI_SCHEMA = createSchema({
923
+ code: "mi",
924
+ kind: "element",
925
+ tag: MI_TAG,
926
+ requiredAttributes: [],
927
+ optionalAttributes: ["mathvariant"],
928
+ allowedChildTagNames: []
929
+ });
930
+
931
+ // src/schema/elementSchemas/elements/equation/mmultiscripts.ts
932
+ var MMULTISCRIPTS_SCHEMA = createSchema({
933
+ code: "mmultiscripts",
934
+ kind: "element",
935
+ tag: MMULTISCRIPTS_TAG,
936
+ requiredAttributes: [],
937
+ optionalAttributes: ["subscriptshift", "superscriptshift"],
938
+ allowedChildTagNames: [...MATH_PRESENTATION_TAGS_ALLOWED_CHILDREN]
939
+ });
940
+
941
+ // src/schema/elementSchemas/elements/equation/mn.ts
942
+ var MN_SCHEMA = createSchema({
943
+ code: "mn",
944
+ kind: "element",
945
+ tag: MN_TAG,
666
946
  requiredAttributes: [],
667
947
  optionalAttributes: [],
668
948
  allowedChildTagNames: []
669
949
  });
670
950
 
951
+ // src/schema/elementSchemas/elements/equation/mo.ts
952
+ var MO_SCHEMA = createSchema({
953
+ code: "mo",
954
+ kind: "element",
955
+ tag: MO_TAG,
956
+ requiredAttributes: [],
957
+ optionalAttributes: [
958
+ "accent",
959
+ "fence",
960
+ "form",
961
+ "largeop",
962
+ "lspace",
963
+ "maxsize",
964
+ "minsize",
965
+ "movablelimits",
966
+ "rspace",
967
+ "separator",
968
+ "stretchy",
969
+ "symmetric"
970
+ ],
971
+ allowedChildTagNames: []
972
+ });
973
+
974
+ // src/schema/elementSchemas/elements/equation/mover.ts
975
+ var MOVER_SCHEMA = createSchema({
976
+ code: "mover",
977
+ kind: "element",
978
+ tag: MOVER_TAG,
979
+ requiredAttributes: [],
980
+ optionalAttributes: ["accent"],
981
+ allowedChildTagNames: [...MATH_PRESENTATION_TAGS_ALLOWED_CHILDREN]
982
+ });
983
+
984
+ // src/schema/elementSchemas/elements/equation/mpadded.ts
985
+ var MPADDED_SCHEMA = createSchema({
986
+ code: "mpadded",
987
+ kind: "element",
988
+ tag: MPADDED_TAG,
989
+ requiredAttributes: [],
990
+ optionalAttributes: [
991
+ "depth",
992
+ "height",
993
+ "lspace",
994
+ "voffset",
995
+ "width"
996
+ ],
997
+ allowedChildTagNames: [...MATH_PRESENTATION_TAGS_ALLOWED_CHILDREN]
998
+ });
999
+
1000
+ // src/schema/elementSchemas/elements/equation/mphantom.ts
1001
+ var MPHANTOM_SCHEMA = createSchema({
1002
+ code: "mphantom",
1003
+ kind: "element",
1004
+ tag: MPHANTOM_TAG,
1005
+ requiredAttributes: [],
1006
+ optionalAttributes: [],
1007
+ allowedChildTagNames: [...MATH_PRESENTATION_TAGS_ALLOWED_CHILDREN]
1008
+ });
1009
+
1010
+ // src/schema/elementSchemas/elements/equation/mprescripts.ts
1011
+ var MPRESCRIPTS_SCHEMA = createSchema({
1012
+ code: "mprescripts",
1013
+ kind: "element",
1014
+ tag: MPRESCRIPTS_TAG,
1015
+ requiredAttributes: [],
1016
+ optionalAttributes: [],
1017
+ allowedChildTagNames: []
1018
+ });
1019
+
1020
+ // src/schema/elementSchemas/elements/equation/mroot.ts
1021
+ var MROOT_SCHEMA = createSchema({
1022
+ code: "mroot",
1023
+ kind: "element",
1024
+ tag: MROOT_TAG,
1025
+ requiredAttributes: [],
1026
+ optionalAttributes: [],
1027
+ allowedChildTagNames: [...MATH_PRESENTATION_TAGS_ALLOWED_CHILDREN]
1028
+ });
1029
+
1030
+ // src/schema/elementSchemas/elements/equation/mrow.ts
1031
+ var MROW_SCHEMA = createSchema({
1032
+ code: "mrow",
1033
+ kind: "element",
1034
+ tag: MROW_TAG,
1035
+ requiredAttributes: [],
1036
+ optionalAttributes: [],
1037
+ allowedChildTagNames: [...MATH_PRESENTATION_TAGS_ALLOWED_CHILDREN]
1038
+ });
1039
+
1040
+ // src/schema/elementSchemas/elements/equation/ms.ts
1041
+ var MS_SCHEMA = createSchema({
1042
+ code: "ms",
1043
+ kind: "element",
1044
+ tag: MS_TAG,
1045
+ requiredAttributes: [],
1046
+ optionalAttributes: ["lquote", "rquote"],
1047
+ allowedChildTagNames: []
1048
+ });
1049
+
1050
+ // src/schema/elementSchemas/elements/equation/mspace.ts
1051
+ var MSPACE_SCHEMA = createSchema({
1052
+ code: "mspace",
1053
+ kind: "element",
1054
+ tag: MSPACE_TAG,
1055
+ requiredAttributes: [],
1056
+ optionalAttributes: ["depth", "height", "width"],
1057
+ allowedChildTagNames: []
1058
+ });
1059
+
1060
+ // src/schema/elementSchemas/elements/equation/msqrt.ts
1061
+ var MSQRT_SCHEMA = createSchema({
1062
+ code: "msqrt",
1063
+ kind: "element",
1064
+ tag: MSQRT_TAG,
1065
+ requiredAttributes: [],
1066
+ optionalAttributes: [],
1067
+ allowedChildTagNames: [...MATH_PRESENTATION_TAGS_ALLOWED_CHILDREN]
1068
+ });
1069
+
1070
+ // src/schema/elementSchemas/elements/equation/mstyle.ts
1071
+ var MSTYLE_SCHEMA = createSchema({
1072
+ code: "mstyle",
1073
+ kind: "element",
1074
+ tag: MSTYLE_TAG,
1075
+ requiredAttributes: [],
1076
+ optionalAttributes: [
1077
+ "displaystyle",
1078
+ "mathbackground",
1079
+ "mathcolor",
1080
+ "mathsize",
1081
+ "scriptlevel",
1082
+ "scriptminsize",
1083
+ "scriptsizemultiplier"
1084
+ ],
1085
+ allowedChildTagNames: [...MATH_PRESENTATION_TAGS_ALLOWED_CHILDREN]
1086
+ });
1087
+
1088
+ // src/schema/elementSchemas/elements/equation/msub.ts
1089
+ var MSUB_SCHEMA = createSchema({
1090
+ code: "msub",
1091
+ kind: "element",
1092
+ tag: MSUB_TAG,
1093
+ requiredAttributes: [],
1094
+ optionalAttributes: ["subscriptshift"],
1095
+ allowedChildTagNames: [...MATH_PRESENTATION_TAGS_ALLOWED_CHILDREN]
1096
+ });
1097
+
1098
+ // src/schema/elementSchemas/elements/equation/msubsup.ts
1099
+ var MSUBSUP_SCHEMA = createSchema({
1100
+ code: "msubsup",
1101
+ kind: "element",
1102
+ tag: MSUBSUP_TAG,
1103
+ requiredAttributes: [],
1104
+ optionalAttributes: ["subscriptshift", "superscriptshift"],
1105
+ allowedChildTagNames: [...MATH_PRESENTATION_TAGS_ALLOWED_CHILDREN]
1106
+ });
1107
+
1108
+ // src/schema/elementSchemas/elements/equation/msup.ts
1109
+ var MSUP_SCHEMA = createSchema({
1110
+ code: "msup",
1111
+ kind: "element",
1112
+ tag: MSUP_TAG,
1113
+ requiredAttributes: [],
1114
+ optionalAttributes: ["superscriptshift"],
1115
+ allowedChildTagNames: [...MATH_PRESENTATION_TAGS_ALLOWED_CHILDREN]
1116
+ });
1117
+
1118
+ // src/schema/elementSchemas/elements/equation/mtable.ts
1119
+ var MTABLE_SCHEMA = createSchema({
1120
+ code: "mtable",
1121
+ kind: "element",
1122
+ tag: MTABLE_TAG,
1123
+ requiredAttributes: [],
1124
+ optionalAttributes: [
1125
+ "align",
1126
+ "columnalign",
1127
+ "columnlines",
1128
+ "columnspacing",
1129
+ "displaystyle",
1130
+ "equalcolumns",
1131
+ "equalrows",
1132
+ "frame",
1133
+ "rowalign",
1134
+ "rowlines",
1135
+ "rowspacing",
1136
+ "width"
1137
+ ],
1138
+ allowedChildTagNames: [{ tagName: MTR_TAG, required: false }]
1139
+ });
1140
+
1141
+ // src/schema/elementSchemas/elements/equation/mtd.ts
1142
+ var MTD_SCHEMA = createSchema({
1143
+ code: "mtd",
1144
+ kind: "element",
1145
+ tag: MTD_TAG,
1146
+ requiredAttributes: [],
1147
+ optionalAttributes: [
1148
+ "columnalign",
1149
+ "columnspan",
1150
+ "rowalign",
1151
+ "rowspan"
1152
+ ],
1153
+ allowedChildTagNames: [...MATH_PRESENTATION_TAGS_ALLOWED_CHILDREN]
1154
+ });
1155
+
1156
+ // src/schema/elementSchemas/elements/equation/mtext.ts
1157
+ var MTEXT_SCHEMA = createSchema({
1158
+ code: "mtext",
1159
+ kind: "element",
1160
+ tag: MTEXT_TAG,
1161
+ requiredAttributes: [],
1162
+ optionalAttributes: ["mathvariant"],
1163
+ allowedChildTagNames: []
1164
+ });
1165
+
1166
+ // src/schema/elementSchemas/elements/equation/mtr.ts
1167
+ var MTR_SCHEMA = createSchema({
1168
+ code: "mtr",
1169
+ kind: "element",
1170
+ tag: MTR_TAG,
1171
+ requiredAttributes: [],
1172
+ optionalAttributes: ["columnalign", "rowalign"],
1173
+ allowedChildTagNames: [{ tagName: MTD_TAG, required: false }]
1174
+ });
1175
+
1176
+ // src/schema/elementSchemas/elements/equation/munder.ts
1177
+ var MUNDER_SCHEMA = createSchema({
1178
+ code: "munder",
1179
+ kind: "element",
1180
+ tag: MUNDER_TAG,
1181
+ requiredAttributes: [],
1182
+ optionalAttributes: ["accentunder"],
1183
+ allowedChildTagNames: [...MATH_PRESENTATION_TAGS_ALLOWED_CHILDREN]
1184
+ });
1185
+
1186
+ // src/schema/elementSchemas/elements/equation/munderover.ts
1187
+ var MUNDEROVER_SCHEMA = createSchema({
1188
+ code: "munderover",
1189
+ kind: "element",
1190
+ tag: MUNDEROVER_TAG,
1191
+ requiredAttributes: [],
1192
+ optionalAttributes: ["accent", "accentunder"],
1193
+ allowedChildTagNames: [...MATH_PRESENTATION_TAGS_ALLOWED_CHILDREN]
1194
+ });
1195
+
671
1196
  // src/schema/elementSchemas/elements/figure/img.ts
672
1197
  var IMG_SCHEMA = createSchema({
673
1198
  code: "img",
@@ -1488,6 +2013,19 @@ var POEM_SCHEMA = createSchema({
1488
2013
  ]
1489
2014
  });
1490
2015
 
2016
+ // src/schema/elementSchemas/elements/equation/mathphrase.ts
2017
+ var MATHPHRASE_SCHEMA = createSchema({
2018
+ code: "mathphrase",
2019
+ kind: "element",
2020
+ tag: MATHPHRASE_TAG,
2021
+ requiredAttributes: [ELE_ID_ATTRIBUTE],
2022
+ optionalAttributes: [],
2023
+ allowedChildTagNames: [
2024
+ { tagName: MATH_TAG, required: true },
2025
+ { tagName: SPAN_TAG, required: false }
2026
+ ]
2027
+ });
2028
+
1491
2029
  // src/schema/elementSchemas/elements/index.ts
1492
2030
  var ELEMENT_SCHEMAS = {
1493
2031
  para: PARA_SCHEMA,
@@ -1506,6 +2044,33 @@ var ELEMENT_SCHEMAS = {
1506
2044
  line: LINE_SCHEMA,
1507
2045
  speaker: SPEAKER_SCHEMA,
1508
2046
  equation: EQUATION_SCHEMA,
2047
+ math: MATH_SCHEMA,
2048
+ mathphrase: MATHPHRASE_SCHEMA,
2049
+ merror: MERROR_SCHEMA,
2050
+ mfrac: MFRAC_SCHEMA,
2051
+ mi: MI_SCHEMA,
2052
+ mmultiscripts: MMULTISCRIPTS_SCHEMA,
2053
+ mn: MN_SCHEMA,
2054
+ mo: MO_SCHEMA,
2055
+ mover: MOVER_SCHEMA,
2056
+ mpadded: MPADDED_SCHEMA,
2057
+ mphantom: MPHANTOM_SCHEMA,
2058
+ mprescripts: MPRESCRIPTS_SCHEMA,
2059
+ mroot: MROOT_SCHEMA,
2060
+ mrow: MROW_SCHEMA,
2061
+ ms: MS_SCHEMA,
2062
+ mspace: MSPACE_SCHEMA,
2063
+ msqrt: MSQRT_SCHEMA,
2064
+ mstyle: MSTYLE_SCHEMA,
2065
+ msub: MSUB_SCHEMA,
2066
+ msubsup: MSUBSUP_SCHEMA,
2067
+ msup: MSUP_SCHEMA,
2068
+ mtable: MTABLE_SCHEMA,
2069
+ mtd: MTD_SCHEMA,
2070
+ mtext: MTEXT_SCHEMA,
2071
+ mtr: MTR_SCHEMA,
2072
+ munder: MUNDER_SCHEMA,
2073
+ munderover: MUNDEROVER_SCHEMA,
1509
2074
  img: IMG_SCHEMA,
1510
2075
  alttext: ALTTEXT_SCHEMA,
1511
2076
  imageobject: IMAGEOBJECT_SCHEMA,
@@ -1571,8 +2136,20 @@ var INLINEEQUATION_SCHEMA = createSchema({
1571
2136
  kind: "inline",
1572
2137
  tag: INLINEEQUATION_TAG,
1573
2138
  requiredAttributes: [...ID_ATTRS],
1574
- optionalAttributes: ["linkend"],
1575
- allowedChildTagNames: []
2139
+ optionalAttributes: [
2140
+ ...TRACK_CHANGES_ATTRS,
2141
+ {
2142
+ name: "eqn-data",
2143
+ values: ["new", "updated"],
2144
+ defaultValue: "new"
2145
+ },
2146
+ {
2147
+ name: "element-status",
2148
+ values: ["added", "changed"],
2149
+ defaultValue: "added"
2150
+ }
2151
+ ],
2152
+ allowedChildTagNames: [{ tagName: MATHPHRASE_TAG, required: true }]
1576
2153
  });
1577
2154
 
1578
2155
  // src/schema/elementSchemas/inlineElements/link.ts
@@ -1653,20 +2230,21 @@ var isIgnoredAttribute = (attribute) => IGNORED_ATTRIBUTES.includes(attribute) |
1653
2230
  var isIgnoredElement = (element) => IGNORED_ELEMENT_SELECTORS.some((selector) => element.matches(selector));
1654
2231
  var findSchemaByCode = (code) => SCHEMAS[code];
1655
2232
  var findSchemaByElement = (element) => {
2233
+ const tagName = element.tagName.toUpperCase();
1656
2234
  const isInsertion = element.classList.contains("ins");
1657
2235
  const isDeletion = element.classList.contains("del");
1658
2236
  const isQueryComment = element.classList.contains("cmtQurySection");
1659
2237
  const role = element.getAttribute("role");
1660
- if (isQueryComment) {
2238
+ if (isQueryComment && tagName === SPAN_TAG) {
1661
2239
  return findSchemaByCode("commentQuerySection");
1662
2240
  }
1663
- if (isInsertion) {
2241
+ if (isInsertion && tagName === SPAN_TAG) {
1664
2242
  return findSchemaByCode("insertion");
1665
2243
  }
1666
- if (isDeletion) {
2244
+ if (isDeletion && tagName === SPAN_TAG) {
1667
2245
  return findSchemaByCode("deletion");
1668
2246
  }
1669
- if (role) {
2247
+ if (role && tagName === SECTION_TAG) {
1670
2248
  if (role.startsWith("H")) {
1671
2249
  return findSchemaByCode("heading");
1672
2250
  }
package/dist/index.mjs CHANGED
@@ -77,9 +77,17 @@ var COMMENT_TAG = "COMMENT";
77
77
  var QUERY_TAG = "QUERY";
78
78
  var CONTENT_TAG = "CONTENT";
79
79
  var REPLY_TAG = "REPLY";
80
+ var INDEXTERM_TAG = "INDEXTERM";
81
+ var PRIMARY_TAG = "PRIMARY";
82
+ var SECONDARY_TAG = "SECONDARY";
83
+ var TERTIARY_TAG = "TERTIARY";
84
+ var QUATERNARY_TAG = "QUATERNARY";
85
+ var BOOKMARK_TAG = "BOOKMARK";
86
+ var SEE_TAG = "SEE";
80
87
 
81
88
  // src/schema/shared/allowedAtomsChildren.ts
82
89
  var ATOM_TAGS_ALLOWED_CHILDREN = [
90
+ { tagName: INDEXTERM_TAG, required: false },
83
91
  { tagName: B_TAG, required: false },
84
92
  { tagName: I_TAG, required: false },
85
93
  { tagName: U_TAG, required: false },
@@ -326,8 +334,152 @@ var REPLY_SCHEMA = createSchema({
326
334
  allowedChildTagNames: [{ tagName: CONTENT_TAG, required: true }]
327
335
  });
328
336
 
337
+ // src/schema/elementSchemas/atoms/indexing/indexTermAttributes.ts
338
+ var INDEX_TERM_ENTRY_REQUIRED_ATTRIBUTES = [
339
+ "data-date",
340
+ "data-user",
341
+ "firstEntry",
342
+ "secondEntry",
343
+ "thirdEntry",
344
+ "entry",
345
+ STORE_ATTRIBUTE,
346
+ "linkend"
347
+ ];
348
+ var BOOKMARK_INDEX_POSITION_ATTRIBUTE = {
349
+ name: "index-position",
350
+ values: ["start", "end"],
351
+ defaultValue: ""
352
+ };
353
+ var SEE_REQUIRED_ATTRIBUTES = [
354
+ "linkend",
355
+ "data-user",
356
+ "crossref-pageNumber",
357
+ {
358
+ name: "role",
359
+ values: ["see", "see-also"],
360
+ defaultValue: ""
361
+ },
362
+ STORE_ATTRIBUTE,
363
+ "data-date",
364
+ "crossref-firstEntry",
365
+ "crossref-secondEntry",
366
+ "crossref-thirdEntry",
367
+ "crossref-fourthEntry"
368
+ ];
369
+
370
+ // src/schema/elementSchemas/atoms/indexing/bookmark.ts
371
+ var BOOKMARK_SCHEMA = createSchema({
372
+ code: "bookmark",
373
+ kind: "atom",
374
+ tag: BOOKMARK_TAG,
375
+ requiredAttributes: [
376
+ ...INDEX_TERM_ENTRY_REQUIRED_ATTRIBUTES,
377
+ BOOKMARK_INDEX_POSITION_ATTRIBUTE
378
+ ],
379
+ optionalAttributes: [],
380
+ allowedChildTagNames: [
381
+ {
382
+ tagName: SEE_TAG,
383
+ required: false
384
+ }
385
+ ]
386
+ });
387
+
388
+ // src/schema/elementSchemas/atoms/indexing/indexterm.ts
389
+ var INDEXTERM_SCHEMA = createSchema({
390
+ code: "indexterm",
391
+ kind: "atom",
392
+ tag: INDEXTERM_TAG,
393
+ requiredAttributes: [
394
+ "linkend",
395
+ {
396
+ name: "index-level",
397
+ values: ["PRIMARY", "SECONDARY", "TERTIARY", "QUATERNARY"],
398
+ defaultValue: "PRIMARY"
399
+ },
400
+ STORE_ATTRIBUTE
401
+ ],
402
+ optionalAttributes: [],
403
+ allowedChildTagNames: [
404
+ { tagName: PRIMARY_TAG, required: false },
405
+ { tagName: SECONDARY_TAG, required: false },
406
+ { tagName: TERTIARY_TAG, required: false },
407
+ { tagName: QUATERNARY_TAG, required: false },
408
+ { tagName: BOOKMARK_TAG, required: false }
409
+ ]
410
+ });
411
+
412
+ // src/schema/elementSchemas/atoms/indexing/primary.ts
413
+ var PRIMARY_SCHEMA = createSchema({
414
+ code: "primary",
415
+ kind: "atom",
416
+ tag: PRIMARY_TAG,
417
+ requiredAttributes: [...INDEX_TERM_ENTRY_REQUIRED_ATTRIBUTES],
418
+ optionalAttributes: [],
419
+ allowedChildTagNames: [
420
+ ...ATOM_TAGS_ALLOWED_CHILDREN,
421
+ { tagName: SEE_TAG, required: false }
422
+ ]
423
+ });
424
+
425
+ // src/schema/elementSchemas/atoms/indexing/quaternary.ts
426
+ var QUATERNARY_SCHEMA = createSchema({
427
+ code: "quaternary",
428
+ kind: "atom",
429
+ tag: QUATERNARY_TAG,
430
+ requiredAttributes: [...INDEX_TERM_ENTRY_REQUIRED_ATTRIBUTES],
431
+ optionalAttributes: [],
432
+ allowedChildTagNames: [
433
+ ...ATOM_TAGS_ALLOWED_CHILDREN,
434
+ { tagName: SEE_TAG, required: false }
435
+ ]
436
+ });
437
+
438
+ // src/schema/elementSchemas/atoms/indexing/secondary.ts
439
+ var SECONDARY_SCHEMA = createSchema({
440
+ code: "secondary",
441
+ kind: "atom",
442
+ tag: SECONDARY_TAG,
443
+ requiredAttributes: [...INDEX_TERM_ENTRY_REQUIRED_ATTRIBUTES],
444
+ optionalAttributes: [],
445
+ allowedChildTagNames: [
446
+ ...ATOM_TAGS_ALLOWED_CHILDREN,
447
+ { tagName: SEE_TAG, required: false }
448
+ ]
449
+ });
450
+
451
+ // src/schema/elementSchemas/atoms/indexing/see.ts
452
+ var SEE_SCHEMA = createSchema({
453
+ code: "see",
454
+ kind: "atom",
455
+ tag: SEE_TAG,
456
+ requiredAttributes: [...SEE_REQUIRED_ATTRIBUTES],
457
+ optionalAttributes: [],
458
+ allowedChildTagNames: []
459
+ });
460
+
461
+ // src/schema/elementSchemas/atoms/indexing/tertiary.ts
462
+ var TERTIARY_SCHEMA = createSchema({
463
+ code: "tertiary",
464
+ kind: "atom",
465
+ tag: TERTIARY_TAG,
466
+ requiredAttributes: [...INDEX_TERM_ENTRY_REQUIRED_ATTRIBUTES],
467
+ optionalAttributes: [],
468
+ allowedChildTagNames: [
469
+ ...ATOM_TAGS_ALLOWED_CHILDREN,
470
+ { tagName: SEE_TAG, required: false }
471
+ ]
472
+ });
473
+
329
474
  // src/schema/elementSchemas/atoms/index.ts
330
475
  var ATOM_SCHEMAS = {
476
+ indexterm: INDEXTERM_SCHEMA,
477
+ primary: PRIMARY_SCHEMA,
478
+ secondary: SECONDARY_SCHEMA,
479
+ tertiary: TERTIARY_SCHEMA,
480
+ quaternary: QUATERNARY_SCHEMA,
481
+ bookmark: BOOKMARK_SCHEMA,
482
+ see: SEE_SCHEMA,
331
483
  b: B_SCHEMA,
332
484
  i: I_SCHEMA,
333
485
  u: U_SCHEMA,
@@ -408,6 +560,33 @@ var CHAPTER_TAG = "CHAPTER";
408
560
  var EPIGRAPH_TAG = "EPIGRAPH";
409
561
  var INFO_TAG = "INFO1";
410
562
  var POEM_TAG = "POEM";
563
+ var MATHPHRASE_TAG = "MATHPHRASE";
564
+ var MATH_TAG = "MATH";
565
+ var MERROR_TAG = "MERROR";
566
+ var MFRAC_TAG = "MFRAC";
567
+ var MI_TAG = "MI";
568
+ var MMULTISCRIPTS_TAG = "MMULTISCRIPTS";
569
+ var MN_TAG = "MN";
570
+ var MO_TAG = "MO";
571
+ var MOVER_TAG = "MOVER";
572
+ var MPADDED_TAG = "MPADDED";
573
+ var MPHANTOM_TAG = "MPHANTOM";
574
+ var MPRESCRIPTS_TAG = "MPRESCRIPTS";
575
+ var MROOT_TAG = "MROOT";
576
+ var MROW_TAG = "MROW";
577
+ var MS_TAG = "MS";
578
+ var MSPACE_TAG = "MSPACE";
579
+ var MSQRT_TAG = "MSQRT";
580
+ var MSTYLE_TAG = "MSTYLE";
581
+ var MSUB_TAG = "MSUB";
582
+ var MSUBSUP_TAG = "MSUBSUP";
583
+ var MSUP_TAG = "MSUP";
584
+ var MTABLE_TAG = "MTABLE";
585
+ var MTD_TAG = "MTD";
586
+ var MTEXT_TAG = "MTEXT";
587
+ var MTR_TAG = "MTR";
588
+ var MUNDER_TAG = "MUNDER";
589
+ var MUNDEROVER_TAG = "MUNDEROVER";
411
590
 
412
591
  // src/schema/elementSchemas/elements/authors/authorgroup.ts
413
592
  var AUTHORGROUP_SCHEMA = createSchema({
@@ -595,16 +774,362 @@ var DIALOGUE_SCHEMA = createSchema({
595
774
  ]
596
775
  });
597
776
 
598
- // src/schema/elementSchemas/elements/equation.ts
777
+ // src/schema/elementSchemas/elements/equation/equation.ts
599
778
  var EQUATION_SCHEMA = createSchema({
600
779
  code: "equation",
601
780
  kind: "element",
602
781
  tag: EQUATION_TAG,
782
+ requiredAttributes: [...ID_ATTRS],
783
+ optionalAttributes: [
784
+ ...TRACK_CHANGES_ATTRS,
785
+ {
786
+ name: "eqn-data",
787
+ values: ["new", "updated"],
788
+ defaultValue: "new"
789
+ },
790
+ {
791
+ name: "element-status",
792
+ values: ["added", "changed"],
793
+ defaultValue: "added"
794
+ }
795
+ ],
796
+ allowedChildTagNames: [{ tagName: MATHPHRASE_TAG, required: true }]
797
+ });
798
+
799
+ // src/schema/shared/allowedMathChildren.ts
800
+ var MATH_PRESENTATION_TAGS_ALLOWED_CHILDREN = [
801
+ { tagName: MERROR_TAG, required: false },
802
+ { tagName: MFRAC_TAG, required: false },
803
+ { tagName: MI_TAG, required: false },
804
+ { tagName: MMULTISCRIPTS_TAG, required: false },
805
+ { tagName: MN_TAG, required: false },
806
+ { tagName: MO_TAG, required: false },
807
+ { tagName: MOVER_TAG, required: false },
808
+ { tagName: MPADDED_TAG, required: false },
809
+ { tagName: MPHANTOM_TAG, required: false },
810
+ { tagName: MPRESCRIPTS_TAG, required: false },
811
+ { tagName: MROOT_TAG, required: false },
812
+ { tagName: MROW_TAG, required: false },
813
+ { tagName: MS_TAG, required: false },
814
+ { tagName: MSPACE_TAG, required: false },
815
+ { tagName: MSQRT_TAG, required: false },
816
+ { tagName: MSTYLE_TAG, required: false },
817
+ { tagName: MSUB_TAG, required: false },
818
+ { tagName: MSUBSUP_TAG, required: false },
819
+ { tagName: MSUP_TAG, required: false },
820
+ { tagName: MTABLE_TAG, required: false },
821
+ { tagName: MTD_TAG, required: false },
822
+ { tagName: MTEXT_TAG, required: false },
823
+ { tagName: MTR_TAG, required: false },
824
+ { tagName: MUNDER_TAG, required: false },
825
+ { tagName: MUNDEROVER_TAG, required: false }
826
+ ];
827
+
828
+ // src/schema/elementSchemas/elements/equation/math.ts
829
+ var MATH_SCHEMA = createSchema({
830
+ code: "math",
831
+ kind: "element",
832
+ tag: MATH_TAG,
833
+ requiredAttributes: [],
834
+ optionalAttributes: ["xmlns"],
835
+ allowedChildTagNames: [...MATH_PRESENTATION_TAGS_ALLOWED_CHILDREN]
836
+ });
837
+
838
+ // src/schema/elementSchemas/elements/equation/merror.ts
839
+ var MERROR_SCHEMA = createSchema({
840
+ code: "merror",
841
+ kind: "element",
842
+ tag: MERROR_TAG,
843
+ requiredAttributes: [],
844
+ optionalAttributes: [],
845
+ allowedChildTagNames: [...MATH_PRESENTATION_TAGS_ALLOWED_CHILDREN]
846
+ });
847
+
848
+ // src/schema/elementSchemas/elements/equation/mfrac.ts
849
+ var MFRAC_SCHEMA = createSchema({
850
+ code: "mfrac",
851
+ kind: "element",
852
+ tag: MFRAC_TAG,
853
+ requiredAttributes: [],
854
+ optionalAttributes: ["denomalign", "linethickness", "numalign"],
855
+ allowedChildTagNames: [...MATH_PRESENTATION_TAGS_ALLOWED_CHILDREN]
856
+ });
857
+
858
+ // src/schema/elementSchemas/elements/equation/mi.ts
859
+ var MI_SCHEMA = createSchema({
860
+ code: "mi",
861
+ kind: "element",
862
+ tag: MI_TAG,
863
+ requiredAttributes: [],
864
+ optionalAttributes: ["mathvariant"],
865
+ allowedChildTagNames: []
866
+ });
867
+
868
+ // src/schema/elementSchemas/elements/equation/mmultiscripts.ts
869
+ var MMULTISCRIPTS_SCHEMA = createSchema({
870
+ code: "mmultiscripts",
871
+ kind: "element",
872
+ tag: MMULTISCRIPTS_TAG,
873
+ requiredAttributes: [],
874
+ optionalAttributes: ["subscriptshift", "superscriptshift"],
875
+ allowedChildTagNames: [...MATH_PRESENTATION_TAGS_ALLOWED_CHILDREN]
876
+ });
877
+
878
+ // src/schema/elementSchemas/elements/equation/mn.ts
879
+ var MN_SCHEMA = createSchema({
880
+ code: "mn",
881
+ kind: "element",
882
+ tag: MN_TAG,
603
883
  requiredAttributes: [],
604
884
  optionalAttributes: [],
605
885
  allowedChildTagNames: []
606
886
  });
607
887
 
888
+ // src/schema/elementSchemas/elements/equation/mo.ts
889
+ var MO_SCHEMA = createSchema({
890
+ code: "mo",
891
+ kind: "element",
892
+ tag: MO_TAG,
893
+ requiredAttributes: [],
894
+ optionalAttributes: [
895
+ "accent",
896
+ "fence",
897
+ "form",
898
+ "largeop",
899
+ "lspace",
900
+ "maxsize",
901
+ "minsize",
902
+ "movablelimits",
903
+ "rspace",
904
+ "separator",
905
+ "stretchy",
906
+ "symmetric"
907
+ ],
908
+ allowedChildTagNames: []
909
+ });
910
+
911
+ // src/schema/elementSchemas/elements/equation/mover.ts
912
+ var MOVER_SCHEMA = createSchema({
913
+ code: "mover",
914
+ kind: "element",
915
+ tag: MOVER_TAG,
916
+ requiredAttributes: [],
917
+ optionalAttributes: ["accent"],
918
+ allowedChildTagNames: [...MATH_PRESENTATION_TAGS_ALLOWED_CHILDREN]
919
+ });
920
+
921
+ // src/schema/elementSchemas/elements/equation/mpadded.ts
922
+ var MPADDED_SCHEMA = createSchema({
923
+ code: "mpadded",
924
+ kind: "element",
925
+ tag: MPADDED_TAG,
926
+ requiredAttributes: [],
927
+ optionalAttributes: [
928
+ "depth",
929
+ "height",
930
+ "lspace",
931
+ "voffset",
932
+ "width"
933
+ ],
934
+ allowedChildTagNames: [...MATH_PRESENTATION_TAGS_ALLOWED_CHILDREN]
935
+ });
936
+
937
+ // src/schema/elementSchemas/elements/equation/mphantom.ts
938
+ var MPHANTOM_SCHEMA = createSchema({
939
+ code: "mphantom",
940
+ kind: "element",
941
+ tag: MPHANTOM_TAG,
942
+ requiredAttributes: [],
943
+ optionalAttributes: [],
944
+ allowedChildTagNames: [...MATH_PRESENTATION_TAGS_ALLOWED_CHILDREN]
945
+ });
946
+
947
+ // src/schema/elementSchemas/elements/equation/mprescripts.ts
948
+ var MPRESCRIPTS_SCHEMA = createSchema({
949
+ code: "mprescripts",
950
+ kind: "element",
951
+ tag: MPRESCRIPTS_TAG,
952
+ requiredAttributes: [],
953
+ optionalAttributes: [],
954
+ allowedChildTagNames: []
955
+ });
956
+
957
+ // src/schema/elementSchemas/elements/equation/mroot.ts
958
+ var MROOT_SCHEMA = createSchema({
959
+ code: "mroot",
960
+ kind: "element",
961
+ tag: MROOT_TAG,
962
+ requiredAttributes: [],
963
+ optionalAttributes: [],
964
+ allowedChildTagNames: [...MATH_PRESENTATION_TAGS_ALLOWED_CHILDREN]
965
+ });
966
+
967
+ // src/schema/elementSchemas/elements/equation/mrow.ts
968
+ var MROW_SCHEMA = createSchema({
969
+ code: "mrow",
970
+ kind: "element",
971
+ tag: MROW_TAG,
972
+ requiredAttributes: [],
973
+ optionalAttributes: [],
974
+ allowedChildTagNames: [...MATH_PRESENTATION_TAGS_ALLOWED_CHILDREN]
975
+ });
976
+
977
+ // src/schema/elementSchemas/elements/equation/ms.ts
978
+ var MS_SCHEMA = createSchema({
979
+ code: "ms",
980
+ kind: "element",
981
+ tag: MS_TAG,
982
+ requiredAttributes: [],
983
+ optionalAttributes: ["lquote", "rquote"],
984
+ allowedChildTagNames: []
985
+ });
986
+
987
+ // src/schema/elementSchemas/elements/equation/mspace.ts
988
+ var MSPACE_SCHEMA = createSchema({
989
+ code: "mspace",
990
+ kind: "element",
991
+ tag: MSPACE_TAG,
992
+ requiredAttributes: [],
993
+ optionalAttributes: ["depth", "height", "width"],
994
+ allowedChildTagNames: []
995
+ });
996
+
997
+ // src/schema/elementSchemas/elements/equation/msqrt.ts
998
+ var MSQRT_SCHEMA = createSchema({
999
+ code: "msqrt",
1000
+ kind: "element",
1001
+ tag: MSQRT_TAG,
1002
+ requiredAttributes: [],
1003
+ optionalAttributes: [],
1004
+ allowedChildTagNames: [...MATH_PRESENTATION_TAGS_ALLOWED_CHILDREN]
1005
+ });
1006
+
1007
+ // src/schema/elementSchemas/elements/equation/mstyle.ts
1008
+ var MSTYLE_SCHEMA = createSchema({
1009
+ code: "mstyle",
1010
+ kind: "element",
1011
+ tag: MSTYLE_TAG,
1012
+ requiredAttributes: [],
1013
+ optionalAttributes: [
1014
+ "displaystyle",
1015
+ "mathbackground",
1016
+ "mathcolor",
1017
+ "mathsize",
1018
+ "scriptlevel",
1019
+ "scriptminsize",
1020
+ "scriptsizemultiplier"
1021
+ ],
1022
+ allowedChildTagNames: [...MATH_PRESENTATION_TAGS_ALLOWED_CHILDREN]
1023
+ });
1024
+
1025
+ // src/schema/elementSchemas/elements/equation/msub.ts
1026
+ var MSUB_SCHEMA = createSchema({
1027
+ code: "msub",
1028
+ kind: "element",
1029
+ tag: MSUB_TAG,
1030
+ requiredAttributes: [],
1031
+ optionalAttributes: ["subscriptshift"],
1032
+ allowedChildTagNames: [...MATH_PRESENTATION_TAGS_ALLOWED_CHILDREN]
1033
+ });
1034
+
1035
+ // src/schema/elementSchemas/elements/equation/msubsup.ts
1036
+ var MSUBSUP_SCHEMA = createSchema({
1037
+ code: "msubsup",
1038
+ kind: "element",
1039
+ tag: MSUBSUP_TAG,
1040
+ requiredAttributes: [],
1041
+ optionalAttributes: ["subscriptshift", "superscriptshift"],
1042
+ allowedChildTagNames: [...MATH_PRESENTATION_TAGS_ALLOWED_CHILDREN]
1043
+ });
1044
+
1045
+ // src/schema/elementSchemas/elements/equation/msup.ts
1046
+ var MSUP_SCHEMA = createSchema({
1047
+ code: "msup",
1048
+ kind: "element",
1049
+ tag: MSUP_TAG,
1050
+ requiredAttributes: [],
1051
+ optionalAttributes: ["superscriptshift"],
1052
+ allowedChildTagNames: [...MATH_PRESENTATION_TAGS_ALLOWED_CHILDREN]
1053
+ });
1054
+
1055
+ // src/schema/elementSchemas/elements/equation/mtable.ts
1056
+ var MTABLE_SCHEMA = createSchema({
1057
+ code: "mtable",
1058
+ kind: "element",
1059
+ tag: MTABLE_TAG,
1060
+ requiredAttributes: [],
1061
+ optionalAttributes: [
1062
+ "align",
1063
+ "columnalign",
1064
+ "columnlines",
1065
+ "columnspacing",
1066
+ "displaystyle",
1067
+ "equalcolumns",
1068
+ "equalrows",
1069
+ "frame",
1070
+ "rowalign",
1071
+ "rowlines",
1072
+ "rowspacing",
1073
+ "width"
1074
+ ],
1075
+ allowedChildTagNames: [{ tagName: MTR_TAG, required: false }]
1076
+ });
1077
+
1078
+ // src/schema/elementSchemas/elements/equation/mtd.ts
1079
+ var MTD_SCHEMA = createSchema({
1080
+ code: "mtd",
1081
+ kind: "element",
1082
+ tag: MTD_TAG,
1083
+ requiredAttributes: [],
1084
+ optionalAttributes: [
1085
+ "columnalign",
1086
+ "columnspan",
1087
+ "rowalign",
1088
+ "rowspan"
1089
+ ],
1090
+ allowedChildTagNames: [...MATH_PRESENTATION_TAGS_ALLOWED_CHILDREN]
1091
+ });
1092
+
1093
+ // src/schema/elementSchemas/elements/equation/mtext.ts
1094
+ var MTEXT_SCHEMA = createSchema({
1095
+ code: "mtext",
1096
+ kind: "element",
1097
+ tag: MTEXT_TAG,
1098
+ requiredAttributes: [],
1099
+ optionalAttributes: ["mathvariant"],
1100
+ allowedChildTagNames: []
1101
+ });
1102
+
1103
+ // src/schema/elementSchemas/elements/equation/mtr.ts
1104
+ var MTR_SCHEMA = createSchema({
1105
+ code: "mtr",
1106
+ kind: "element",
1107
+ tag: MTR_TAG,
1108
+ requiredAttributes: [],
1109
+ optionalAttributes: ["columnalign", "rowalign"],
1110
+ allowedChildTagNames: [{ tagName: MTD_TAG, required: false }]
1111
+ });
1112
+
1113
+ // src/schema/elementSchemas/elements/equation/munder.ts
1114
+ var MUNDER_SCHEMA = createSchema({
1115
+ code: "munder",
1116
+ kind: "element",
1117
+ tag: MUNDER_TAG,
1118
+ requiredAttributes: [],
1119
+ optionalAttributes: ["accentunder"],
1120
+ allowedChildTagNames: [...MATH_PRESENTATION_TAGS_ALLOWED_CHILDREN]
1121
+ });
1122
+
1123
+ // src/schema/elementSchemas/elements/equation/munderover.ts
1124
+ var MUNDEROVER_SCHEMA = createSchema({
1125
+ code: "munderover",
1126
+ kind: "element",
1127
+ tag: MUNDEROVER_TAG,
1128
+ requiredAttributes: [],
1129
+ optionalAttributes: ["accent", "accentunder"],
1130
+ allowedChildTagNames: [...MATH_PRESENTATION_TAGS_ALLOWED_CHILDREN]
1131
+ });
1132
+
608
1133
  // src/schema/elementSchemas/elements/figure/img.ts
609
1134
  var IMG_SCHEMA = createSchema({
610
1135
  code: "img",
@@ -1425,6 +1950,19 @@ var POEM_SCHEMA = createSchema({
1425
1950
  ]
1426
1951
  });
1427
1952
 
1953
+ // src/schema/elementSchemas/elements/equation/mathphrase.ts
1954
+ var MATHPHRASE_SCHEMA = createSchema({
1955
+ code: "mathphrase",
1956
+ kind: "element",
1957
+ tag: MATHPHRASE_TAG,
1958
+ requiredAttributes: [ELE_ID_ATTRIBUTE],
1959
+ optionalAttributes: [],
1960
+ allowedChildTagNames: [
1961
+ { tagName: MATH_TAG, required: true },
1962
+ { tagName: SPAN_TAG, required: false }
1963
+ ]
1964
+ });
1965
+
1428
1966
  // src/schema/elementSchemas/elements/index.ts
1429
1967
  var ELEMENT_SCHEMAS = {
1430
1968
  para: PARA_SCHEMA,
@@ -1443,6 +1981,33 @@ var ELEMENT_SCHEMAS = {
1443
1981
  line: LINE_SCHEMA,
1444
1982
  speaker: SPEAKER_SCHEMA,
1445
1983
  equation: EQUATION_SCHEMA,
1984
+ math: MATH_SCHEMA,
1985
+ mathphrase: MATHPHRASE_SCHEMA,
1986
+ merror: MERROR_SCHEMA,
1987
+ mfrac: MFRAC_SCHEMA,
1988
+ mi: MI_SCHEMA,
1989
+ mmultiscripts: MMULTISCRIPTS_SCHEMA,
1990
+ mn: MN_SCHEMA,
1991
+ mo: MO_SCHEMA,
1992
+ mover: MOVER_SCHEMA,
1993
+ mpadded: MPADDED_SCHEMA,
1994
+ mphantom: MPHANTOM_SCHEMA,
1995
+ mprescripts: MPRESCRIPTS_SCHEMA,
1996
+ mroot: MROOT_SCHEMA,
1997
+ mrow: MROW_SCHEMA,
1998
+ ms: MS_SCHEMA,
1999
+ mspace: MSPACE_SCHEMA,
2000
+ msqrt: MSQRT_SCHEMA,
2001
+ mstyle: MSTYLE_SCHEMA,
2002
+ msub: MSUB_SCHEMA,
2003
+ msubsup: MSUBSUP_SCHEMA,
2004
+ msup: MSUP_SCHEMA,
2005
+ mtable: MTABLE_SCHEMA,
2006
+ mtd: MTD_SCHEMA,
2007
+ mtext: MTEXT_SCHEMA,
2008
+ mtr: MTR_SCHEMA,
2009
+ munder: MUNDER_SCHEMA,
2010
+ munderover: MUNDEROVER_SCHEMA,
1446
2011
  img: IMG_SCHEMA,
1447
2012
  alttext: ALTTEXT_SCHEMA,
1448
2013
  imageobject: IMAGEOBJECT_SCHEMA,
@@ -1508,8 +2073,20 @@ var INLINEEQUATION_SCHEMA = createSchema({
1508
2073
  kind: "inline",
1509
2074
  tag: INLINEEQUATION_TAG,
1510
2075
  requiredAttributes: [...ID_ATTRS],
1511
- optionalAttributes: ["linkend"],
1512
- allowedChildTagNames: []
2076
+ optionalAttributes: [
2077
+ ...TRACK_CHANGES_ATTRS,
2078
+ {
2079
+ name: "eqn-data",
2080
+ values: ["new", "updated"],
2081
+ defaultValue: "new"
2082
+ },
2083
+ {
2084
+ name: "element-status",
2085
+ values: ["added", "changed"],
2086
+ defaultValue: "added"
2087
+ }
2088
+ ],
2089
+ allowedChildTagNames: [{ tagName: MATHPHRASE_TAG, required: true }]
1513
2090
  });
1514
2091
 
1515
2092
  // src/schema/elementSchemas/inlineElements/link.ts
@@ -1590,20 +2167,21 @@ var isIgnoredAttribute = (attribute) => IGNORED_ATTRIBUTES.includes(attribute) |
1590
2167
  var isIgnoredElement = (element) => IGNORED_ELEMENT_SELECTORS.some((selector) => element.matches(selector));
1591
2168
  var findSchemaByCode = (code) => SCHEMAS[code];
1592
2169
  var findSchemaByElement = (element) => {
2170
+ const tagName = element.tagName.toUpperCase();
1593
2171
  const isInsertion = element.classList.contains("ins");
1594
2172
  const isDeletion = element.classList.contains("del");
1595
2173
  const isQueryComment = element.classList.contains("cmtQurySection");
1596
2174
  const role = element.getAttribute("role");
1597
- if (isQueryComment) {
2175
+ if (isQueryComment && tagName === SPAN_TAG) {
1598
2176
  return findSchemaByCode("commentQuerySection");
1599
2177
  }
1600
- if (isInsertion) {
2178
+ if (isInsertion && tagName === SPAN_TAG) {
1601
2179
  return findSchemaByCode("insertion");
1602
2180
  }
1603
- if (isDeletion) {
2181
+ if (isDeletion && tagName === SPAN_TAG) {
1604
2182
  return findSchemaByCode("deletion");
1605
2183
  }
1606
- if (role) {
2184
+ if (role && tagName === SECTION_TAG) {
1607
2185
  if (role.startsWith("H")) {
1608
2186
  return findSchemaByCode("heading");
1609
2187
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pro-editor-schema",
3
- "version": "0.1.17",
3
+ "version": "0.1.181",
4
4
  "description": "Pro Editor XML schemas",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",