pro-editor-schema 1.6.13 → 1.6.14-dev.1

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.mjs CHANGED
@@ -129,7 +129,7 @@ var INLINE_ELEMENT_CODES_ALLOWED_CHILDREN = [
129
129
  // src/schema/elementSchemas/atoms/deletion.ts
130
130
  var DELETION_SCHEMA = createSchema({
131
131
  code: "deletion",
132
- kind: "atom",
132
+ kind: "trackChanges",
133
133
  tag: SPAN_TAG,
134
134
  matchesElement: (element) => element.classList.contains("del"),
135
135
  requiredAttributes: [...TRACK_CHANGES_ATTRS, ...ID_ATTRS],
@@ -161,7 +161,7 @@ var EMPHASIS_SCHEMA = createSchema({
161
161
  var PREV_FORMAT_ATTRIBUTE = "prev-format";
162
162
  var FORMAT_REMOVAL_SCHEMA = createSchema({
163
163
  code: "formatRemoval",
164
- kind: "atom",
164
+ kind: "trackChanges",
165
165
  tag: SPAN_TAG,
166
166
  matchesElement: (element) => element.hasAttribute(PREV_FORMAT_ATTRIBUTE),
167
167
  requiredAttributes: [PREV_FORMAT_ATTRIBUTE],
@@ -195,7 +195,7 @@ var I_SCHEMA = createSchema({
195
195
  // src/schema/elementSchemas/atoms/insertion.ts
196
196
  var INSERTION_SCHEMA = createSchema({
197
197
  code: "insertion",
198
- kind: "atom",
198
+ kind: "trackChanges",
199
199
  tag: SPAN_TAG,
200
200
  matchesElement: (element) => element.classList.contains("ins"),
201
201
  requiredAttributes: [...TRACK_CHANGES_ATTRS, ...ID_ATTRS],
@@ -215,7 +215,7 @@ var INSERTION_SCHEMA = createSchema({
215
215
  // src/schema/elementSchemas/atoms/lineGroupRemoval.ts
216
216
  var LINE_GROUP_REMOVAL_SCHEMA = createSchema({
217
217
  code: "lineGroupRemoval",
218
- kind: "atom",
218
+ kind: "trackChanges",
219
219
  tag: SPAN_TAG,
220
220
  matchesElement: (element) => element.getAttribute("data-line-group-action") === "removed" && element.getAttribute("data-track-change-wrapper") === "unwrap",
221
221
  requiredAttributes: [
@@ -694,6 +694,7 @@ var BLOCKQUOTE_TAG = "BLOCKQUOTE";
694
694
  var SIDEBAR_TAG = "SIDEBAR";
695
695
  var CHAPTER_TAG = "CHAPTER";
696
696
  var EPIGRAPH_TAG = "EPIGRAPH";
697
+ var EXAMPLE_TAG = "EXAMPLE";
697
698
  var INFO_TAG = "INFO1";
698
699
  var POEM_TAG = "POEM";
699
700
  var REFERENCE_BIBLIOGRAPHY_TAG = "BIBLIOGRAPHY";
@@ -744,7 +745,7 @@ var MUNDEROVER_TAG = "MUNDEROVER";
744
745
  // src/schema/elementSchemas/elements/authors/authorgroup.ts
745
746
  var AUTHORGROUP_SCHEMA = createSchema({
746
747
  code: "authorgroup",
747
- kind: "element",
748
+ kind: "group",
748
749
  tag: AUTHORGROUP_TAG,
749
750
  requiredAttributes: [...ID_ATTRS],
750
751
  optionalAttributes: [],
@@ -757,7 +758,7 @@ var AUTHORGROUP_SCHEMA = createSchema({
757
758
  // src/schema/elementSchemas/elements/authors/author.ts
758
759
  var AUTHOR_SCHEMA = createSchema({
759
760
  code: "author",
760
- kind: "element",
761
+ kind: "group",
761
762
  tag: AUTHOR_TAG,
762
763
  requiredAttributes: [...ID_ATTRS],
763
764
  optionalAttributes: [],
@@ -784,7 +785,7 @@ var OLINK_SCHEMA = createSchema({
784
785
  // src/schema/elementSchemas/elements/authors/personname.ts
785
786
  var PERSONNAME_SCHEMA = createSchema({
786
787
  code: "personname",
787
- kind: "element",
788
+ kind: "group",
788
789
  tag: PERSONNAME_TAG,
789
790
  requiredAttributes: [...ID_ATTRS],
790
791
  optionalAttributes: [],
@@ -848,7 +849,7 @@ var EMAIL_SCHEMA = createSchema({
848
849
  // src/schema/elementSchemas/elements/authors/org.ts
849
850
  var ORG_SCHEMA = createSchema({
850
851
  code: "org",
851
- kind: "element",
852
+ kind: "group",
852
853
  tag: ORG_TAG,
853
854
  requiredAttributes: [...ID_ATTRS],
854
855
  optionalAttributes: [],
@@ -858,7 +859,7 @@ var ORG_SCHEMA = createSchema({
858
859
  // src/schema/elementSchemas/elements/authors/affiliation.ts
859
860
  var AFFILIATION_SCHEMA = createSchema({
860
861
  code: "affiliation",
861
- kind: "element",
862
+ kind: "group",
862
863
  tag: AFFILIATION_TAG,
863
864
  requiredAttributes: [...ID_ATTRS],
864
865
  optionalAttributes: [],
@@ -884,7 +885,11 @@ var LINE_SCHEMA = createSchema({
884
885
  optionalAttributes: ["role"],
885
886
  allowedChildrenCodes: [
886
887
  ...ATOM_CODES_ALLOWED_CHILDREN,
887
- ...INLINE_ELEMENT_CODES_ALLOWED_CHILDREN
888
+ ...INLINE_ELEMENT_CODES_ALLOWED_CHILDREN,
889
+ // Typesetting accepts a fixed or floating figure anchored inside a poem
890
+ // or dialogue line, so it stays where the author placed it.
891
+ { code: "informalfigure", required: false },
892
+ { code: "figure1", required: false }
888
893
  ]
889
894
  });
890
895
 
@@ -901,7 +906,7 @@ var SPEAKER_SCHEMA = createSchema({
901
906
  // src/schema/elementSchemas/elements/dialogue/dialogue.ts
902
907
  var DIALOGUE_SCHEMA = createSchema({
903
908
  code: "dialogue",
904
- kind: "element",
909
+ kind: "group",
905
910
  tag: DIALOGUE_TAG,
906
911
  requiredAttributes: [...ID_ATTRS],
907
912
  optionalAttributes: [...TRACK_CHANGES_ATTRS, "role", "trackmsg"],
@@ -915,7 +920,7 @@ var DIALOGUE_SCHEMA = createSchema({
915
920
  // src/schema/elementSchemas/elements/equation/equation.ts
916
921
  var EQUATION_SCHEMA = createSchema({
917
922
  code: "equation",
918
- kind: "element",
923
+ kind: "group",
919
924
  tag: EQUATION_TAG,
920
925
  requiredAttributes: [...ID_ATTRS],
921
926
  optionalAttributes: [
@@ -1286,7 +1291,7 @@ var IMG_SCHEMA = createSchema({
1286
1291
  // src/schema/elementSchemas/elements/figure/alttext.ts
1287
1292
  var ALTTEXT_SCHEMA = createSchema({
1288
1293
  code: "alttext",
1289
- kind: "element",
1294
+ kind: "group",
1290
1295
  tag: ALTTEXT_TAG,
1291
1296
  requiredAttributes: [],
1292
1297
  optionalAttributes: [],
@@ -1296,7 +1301,7 @@ var ALTTEXT_SCHEMA = createSchema({
1296
1301
  // src/schema/elementSchemas/elements/figure/imageobject.ts
1297
1302
  var IMAGEOBJECT_SCHEMA = createSchema({
1298
1303
  code: "imageobject",
1299
- kind: "element",
1304
+ kind: "group",
1300
1305
  tag: IMAGEOBJECT_TAG,
1301
1306
  requiredAttributes: [...ID_ATTRS],
1302
1307
  optionalAttributes: [],
@@ -1309,7 +1314,7 @@ var IMAGEOBJECT_SCHEMA = createSchema({
1309
1314
  // src/schema/elementSchemas/elements/figure/mediaobject.ts
1310
1315
  var MEDIAOBJECT_SCHEMA = createSchema({
1311
1316
  code: "mediaobject",
1312
- kind: "element",
1317
+ kind: "group",
1313
1318
  tag: MEDIAOBJECT_TAG,
1314
1319
  requiredAttributes: [...ID_ATTRS],
1315
1320
  optionalAttributes: [...TRACK_CHANGES_ATTRS],
@@ -1319,7 +1324,7 @@ var MEDIAOBJECT_SCHEMA = createSchema({
1319
1324
  // src/schema/elementSchemas/elements/figure/caption1.ts
1320
1325
  var CAPTION_SCHEMA = createSchema({
1321
1326
  code: "caption1",
1322
- kind: "element",
1327
+ kind: "group",
1323
1328
  tag: CAPTION_TAG,
1324
1329
  requiredAttributes: [...ID_ATTRS],
1325
1330
  optionalAttributes: [],
@@ -1355,7 +1360,7 @@ var FIGNOTE_SCHEMA = createSchema({
1355
1360
  // src/schema/elementSchemas/elements/figure/figure.ts
1356
1361
  var FIGURE_SCHEMA = createSchema({
1357
1362
  code: "figure1",
1358
- kind: "element",
1363
+ kind: "group",
1359
1364
  tag: FIGURE_TAG,
1360
1365
  requiredAttributes: [...ID_ATTRS, "xmlid"],
1361
1366
  optionalAttributes: [
@@ -1368,6 +1373,8 @@ var FIGURE_SCHEMA = createSchema({
1368
1373
  allowedChildrenCodes: [
1369
1374
  { code: "mediaobject", required: false },
1370
1375
  { code: "label1", required: false },
1376
+ // The editor separates the label from the caption with <punc type="caption-seperator">.
1377
+ { code: "punc", required: false },
1371
1378
  { code: "caption1", required: false },
1372
1379
  { code: "figsource", required: false },
1373
1380
  { code: "fignote", required: false }
@@ -1377,7 +1384,7 @@ var FIGURE_SCHEMA = createSchema({
1377
1384
  // src/schema/elementSchemas/elements/footnote.ts
1378
1385
  var FOOTNOTE_SCHEMA = createSchema({
1379
1386
  code: "footnote",
1380
- kind: "element",
1387
+ kind: "group",
1381
1388
  tag: FOOTNOTE_TAG,
1382
1389
  requiredAttributes: [
1383
1390
  ...ID_ATTRS,
@@ -1410,7 +1417,7 @@ var FOOTNOTE_NUMBER_SCHEMA = createSchema({
1410
1417
  // src/schema/elementSchemas/elements/informalfigure.ts
1411
1418
  var INFORMALFIGURE_SCHEMA = createSchema({
1412
1419
  code: "informalfigure",
1413
- kind: "element",
1420
+ kind: "group",
1414
1421
  tag: INFORMALFIGURE_TAG,
1415
1422
  requiredAttributes: [...ID_ATTRS],
1416
1423
  optionalAttributes: [...TRACK_CHANGES_ATTRS, "data-anchor-id"],
@@ -1423,7 +1430,7 @@ var INFORMALFIGURE_SCHEMA = createSchema({
1423
1430
  // src/schema/elementSchemas/elements/keywords/keywordset.ts
1424
1431
  var KEYWORDSET_SCHEMA = createSchema({
1425
1432
  code: "keywordset",
1426
- kind: "element",
1433
+ kind: "group",
1427
1434
  tag: KEYWORDSET_TAG,
1428
1435
  requiredAttributes: [
1429
1436
  ...ID_ATTRS,
@@ -1487,7 +1494,7 @@ var LABEL_SCHEMA = createSchema({
1487
1494
  // src/schema/elementSchemas/elements/lineGroup.ts
1488
1495
  var LINE_GROUP_SCHEMA = createSchema({
1489
1496
  code: "linegroup",
1490
- kind: "element",
1497
+ kind: "group",
1491
1498
  tag: LINE_GROUP_TAG,
1492
1499
  requiredAttributes: [...ID_ATTRS],
1493
1500
  optionalAttributes: [
@@ -1542,7 +1549,7 @@ var LI_SCHEMA = createSchema({
1542
1549
  // src/schema/elementSchemas/elements/list/ol.ts
1543
1550
  var OL_SCHEMA = createSchema({
1544
1551
  code: "ol",
1545
- kind: "element",
1552
+ kind: "group",
1546
1553
  tag: OL_TAG,
1547
1554
  requiredAttributes: [...ID_ATTRS],
1548
1555
  optionalAttributes: [
@@ -1579,7 +1586,7 @@ var OL_SCHEMA = createSchema({
1579
1586
  // src/schema/elementSchemas/elements/list/ul.ts
1580
1587
  var UL_SCHEMA = createSchema({
1581
1588
  code: "ul",
1582
- kind: "element",
1589
+ kind: "group",
1583
1590
  tag: UL_TAG,
1584
1591
  requiredAttributes: [...ID_ATTRS],
1585
1592
  optionalAttributes: [
@@ -1735,7 +1742,7 @@ var TP_SCHEMA = createSchema({
1735
1742
  // src/schema/elementSchemas/elements/table/td.ts
1736
1743
  var TD_SCHEMA = createSchema({
1737
1744
  code: "td",
1738
- kind: "element",
1745
+ kind: "group",
1739
1746
  tag: TD_TAG,
1740
1747
  requiredAttributes: [...ID_ATTRS],
1741
1748
  optionalAttributes: [
@@ -1753,7 +1760,7 @@ var TD_SCHEMA = createSchema({
1753
1760
  // src/schema/elementSchemas/elements/table/tr.ts
1754
1761
  var TR_SCHEMA = createSchema({
1755
1762
  code: "tr",
1756
- kind: "element",
1763
+ kind: "group",
1757
1764
  tag: TR_TAG,
1758
1765
  requiredAttributes: [],
1759
1766
  optionalAttributes: [...LAYOUT_ATTRIBUTES, ...ID_ATTRS, "width"],
@@ -1763,7 +1770,7 @@ var TR_SCHEMA = createSchema({
1763
1770
  // src/schema/elementSchemas/elements/table/thead.ts
1764
1771
  var THEAD_SCHEMA = createSchema({
1765
1772
  code: "thead",
1766
- kind: "element",
1773
+ kind: "group",
1767
1774
  tag: THEAD_TAG,
1768
1775
  requiredAttributes: [],
1769
1776
  optionalAttributes: [...ID_ATTRS],
@@ -1773,7 +1780,7 @@ var THEAD_SCHEMA = createSchema({
1773
1780
  // src/schema/elementSchemas/elements/table/tbody.ts
1774
1781
  var TBODY_SCHEMA = createSchema({
1775
1782
  code: "tbody",
1776
- kind: "element",
1783
+ kind: "group",
1777
1784
  tag: TBODY_TAG,
1778
1785
  requiredAttributes: [],
1779
1786
  optionalAttributes: [...ID_ATTRS],
@@ -1783,7 +1790,7 @@ var TBODY_SCHEMA = createSchema({
1783
1790
  // src/schema/elementSchemas/elements/table/htmlTable.ts
1784
1791
  var HTML_TABLE_SCHEMA = createSchema({
1785
1792
  code: "table",
1786
- kind: "element",
1793
+ kind: "group",
1787
1794
  tag: HTML_TABLE_TAG,
1788
1795
  requiredAttributes: [],
1789
1796
  optionalAttributes: [...ID_ATTRS],
@@ -1796,7 +1803,7 @@ var HTML_TABLE_SCHEMA = createSchema({
1796
1803
  // src/schema/elementSchemas/elements/table/tgroup.ts
1797
1804
  var TGROUP_SCHEMA = createSchema({
1798
1805
  code: "tgroup",
1799
- kind: "element",
1806
+ kind: "group",
1800
1807
  tag: TGROUP_TAG,
1801
1808
  requiredAttributes: [...ID_ATTRS, "cols"],
1802
1809
  optionalAttributes: [],
@@ -1829,7 +1836,7 @@ var TBLSOURCE_SCHEMA = createSchema({
1829
1836
  // src/schema/elementSchemas/elements/table/table1.ts
1830
1837
  var TABLE_SCHEMA = createSchema({
1831
1838
  code: "table1",
1832
- kind: "element",
1839
+ kind: "group",
1833
1840
  tag: TABLE_TAG,
1834
1841
  requiredAttributes: [
1835
1842
  ...ID_ATTRS,
@@ -1864,7 +1871,7 @@ var HEADING_LEVEL = ["H0", "H1", "H2", "H3", "H4", "H5", "H6"];
1864
1871
  var HEADING_ROLES = [...HEADING_LEVEL, "vignette_group"];
1865
1872
  var HEADING_SCHEMA = createSchema({
1866
1873
  code: "heading",
1867
- kind: "element",
1874
+ kind: "group",
1868
1875
  tag: SECTION_TAG,
1869
1876
  matchesElement: (element) => {
1870
1877
  const role = element.getAttribute("role");
@@ -1890,6 +1897,7 @@ var HEADING_SCHEMA = createSchema({
1890
1897
  { code: "sidebar", required: false },
1891
1898
  { code: "epigraph", required: false },
1892
1899
  { code: "blockquote", required: false },
1900
+ { code: "example", required: false },
1893
1901
  { code: "ul", required: false },
1894
1902
  { code: "ol", required: false },
1895
1903
  { code: "poem", required: false },
@@ -1908,7 +1916,7 @@ var HEADING_SCHEMA = createSchema({
1908
1916
  var BOX_LEVEL = ["box1", "box2", "box3", "box4", "box5"];
1909
1917
  var BOX_SCHEMA = createSchema({
1910
1918
  code: "sidebar",
1911
- kind: "element",
1919
+ kind: "group",
1912
1920
  tag: SIDEBAR_TAG,
1913
1921
  requiredAttributes: [
1914
1922
  ...ID_ATTRS,
@@ -1965,7 +1973,7 @@ var TITLE_SCHEMA = createSchema({
1965
1973
  // src/schema/elementSchemas/elements/abstract.ts
1966
1974
  var ABSTRACT_SCHEMA = createSchema({
1967
1975
  code: "abstract1",
1968
- kind: "element",
1976
+ kind: "group",
1969
1977
  tag: ABSTRACT_TAG,
1970
1978
  requiredAttributes: [
1971
1979
  ...ID_ATTRS,
@@ -1995,7 +2003,7 @@ var ABSTRACT_SCHEMA = createSchema({
1995
2003
  // src/schema/elementSchemas/elements/appendix.ts
1996
2004
  var APPENDIX_SCHEMA = createSchema({
1997
2005
  code: "appendix",
1998
- kind: "element",
2006
+ kind: "group",
1999
2007
  tag: APPENDIX_TAG,
2000
2008
  requiredAttributes: [...ID_ATTRS, "id", "xmlid"],
2001
2009
  optionalAttributes: [...TRACK_CHANGES_ATTRS],
@@ -2010,7 +2018,7 @@ var APPENDIX_SCHEMA = createSchema({
2010
2018
  // src/schema/elementSchemas/elements/blockquote.ts
2011
2019
  var BLOCKQUOTE_SCHEMA = createSchema({
2012
2020
  code: "blockquote",
2013
- kind: "element",
2021
+ kind: "group",
2014
2022
  tag: BLOCKQUOTE_TAG,
2015
2023
  requiredAttributes: [...ID_ATTRS],
2016
2024
  optionalAttributes: [
@@ -2060,6 +2068,7 @@ var CHAPTER_SCHEMA = createSchema({
2060
2068
  { code: "sidebar", required: false },
2061
2069
  { code: "epigraph", required: false },
2062
2070
  { code: "blockquote", required: false },
2071
+ { code: "example", required: false },
2063
2072
  { code: "ul", required: false },
2064
2073
  { code: "ol", required: false },
2065
2074
  { code: "subtitle1", required: false },
@@ -2075,7 +2084,7 @@ var CHAPTER_SCHEMA = createSchema({
2075
2084
  // src/schema/elementSchemas/elements/epigraph.ts
2076
2085
  var EPIGRAPH_SCHEMA = createSchema({
2077
2086
  code: "epigraph",
2078
- kind: "element",
2087
+ kind: "group",
2079
2088
  tag: EPIGRAPH_TAG,
2080
2089
  requiredAttributes: [...ID_ATTRS],
2081
2090
  optionalAttributes: [
@@ -2094,11 +2103,32 @@ var EPIGRAPH_SCHEMA = createSchema({
2094
2103
  ]
2095
2104
  });
2096
2105
 
2106
+ // src/schema/elementSchemas/elements/example.ts
2107
+ var EXAMPLE_SCHEMA = createSchema({
2108
+ code: "example",
2109
+ kind: "element",
2110
+ tag: EXAMPLE_TAG,
2111
+ requiredAttributes: [...ID_ATTRS],
2112
+ optionalAttributes: [
2113
+ ...TRACK_CHANGES_ATTRS,
2114
+ "xmlid",
2115
+ "track-code",
2116
+ "element-change-description"
2117
+ ],
2118
+ defaultChildCode: "para",
2119
+ allowedChildrenCodes: [
2120
+ { code: "para", required: false },
2121
+ { code: "ul", required: false },
2122
+ { code: "ol", required: false },
2123
+ { code: "tag", required: false }
2124
+ ]
2125
+ });
2126
+
2097
2127
  // src/schema/elementSchemas/elements/footnoteSection.ts
2098
2128
  var FOOTNOTE_SECTION_ROLES = ["ch", "bk"];
2099
2129
  var FOOTNOTE_SECTION_SCHEMA = createSchema({
2100
2130
  code: "footnoteSection",
2101
- kind: "element",
2131
+ kind: "group",
2102
2132
  tag: SECTION_TAG,
2103
2133
  matchesElement: (element) => {
2104
2134
  const role = element.getAttribute("role");
@@ -2124,7 +2154,7 @@ var FOOTNOTE_SECTION_SCHEMA = createSchema({
2124
2154
  // src/schema/elementSchemas/elements/info.ts
2125
2155
  var INFO_SCHEMA = createSchema({
2126
2156
  code: "info1",
2127
- kind: "element",
2157
+ kind: "group",
2128
2158
  tag: INFO_TAG,
2129
2159
  requiredAttributes: [...ID_ATTRS],
2130
2160
  optionalAttributes: [],
@@ -2142,7 +2172,7 @@ var INFO_SCHEMA = createSchema({
2142
2172
  // src/schema/elementSchemas/elements/poem.ts
2143
2173
  var POEM_SCHEMA = createSchema({
2144
2174
  code: "poem",
2145
- kind: "element",
2175
+ kind: "group",
2146
2176
  tag: POEM_TAG,
2147
2177
  requiredAttributes: [...ID_ATTRS],
2148
2178
  optionalAttributes: [...TRACK_CHANGES_ATTRS, "role", "trackmsg"],
@@ -2168,7 +2198,7 @@ var MATHPHRASE_SCHEMA = createSchema({
2168
2198
  // src/schema/elementSchemas/elements/reference/bibliography.ts
2169
2199
  var REFERENCE_BIBLIOGRAPHY_SCHEMA = createSchema({
2170
2200
  code: "referenceBibliography",
2171
- kind: "element",
2201
+ kind: "group",
2172
2202
  tag: REFERENCE_BIBLIOGRAPHY_TAG,
2173
2203
  requiredAttributes: [
2174
2204
  ...ID_ATTRS,
@@ -2196,7 +2226,7 @@ var REFERENCE_BIBLIOGRAPHY_SCHEMA = createSchema({
2196
2226
  // src/schema/elementSchemas/elements/reference/bibliodiv.ts
2197
2227
  var BIBLIODIV_SCHEMA = createSchema({
2198
2228
  code: "bibliodiv",
2199
- kind: "element",
2229
+ kind: "group",
2200
2230
  tag: BIBLIODIV_TAG,
2201
2231
  requiredAttributes: [
2202
2232
  ...ID_ATTRS,
@@ -2275,14 +2305,11 @@ var LEGAL_REFERENCE_BIBLIOMISC_ROLE = "legalRef";
2275
2305
 
2276
2306
  // src/schema/elementSchemas/elements/index.ts
2277
2307
  var ELEMENT_SCHEMAS = {
2278
- bibliodiv: BIBLIODIV_SCHEMA,
2279
- referenceBibliography: REFERENCE_BIBLIOGRAPHY_SCHEMA,
2280
2308
  translator: TRANSLATOR_SCHEMA,
2281
2309
  pagenum: PAGENUM_SCHEMA,
2282
2310
  pubId: PUB_ID_SCHEMA,
2283
2311
  para: PARA_SCHEMA,
2284
2312
  title1: TITLE_SCHEMA,
2285
- footnote: FOOTNOTE_SCHEMA,
2286
2313
  footnoteno: FOOTNOTE_NUMBER_SCHEMA,
2287
2314
  olink: OLINK_SCHEMA,
2288
2315
  firstname: FIRSTNAME_SCHEMA,
@@ -2290,13 +2317,9 @@ var ELEMENT_SCHEMAS = {
2290
2317
  honorific: HONORIFIC_SCHEMA,
2291
2318
  orgname: ORGNAME_SCHEMA,
2292
2319
  email: EMAIL_SCHEMA,
2293
- org: ORG_SCHEMA,
2294
2320
  degrees: DEGREES_SCHEMA,
2295
- dialogue: DIALOGUE_SCHEMA,
2296
2321
  line: LINE_SCHEMA,
2297
- linegroup: LINE_GROUP_SCHEMA,
2298
2322
  speaker: SPEAKER_SCHEMA,
2299
- equation: EQUATION_SCHEMA,
2300
2323
  math: MATH_SCHEMA,
2301
2324
  mathphrase: MATHPHRASE_SCHEMA,
2302
2325
  merror: MERROR_SCHEMA,
@@ -2325,27 +2348,40 @@ var ELEMENT_SCHEMAS = {
2325
2348
  munder: MUNDER_SCHEMA,
2326
2349
  munderover: MUNDEROVER_SCHEMA,
2327
2350
  img: IMG_SCHEMA,
2328
- alttext: ALTTEXT_SCHEMA,
2329
- imageobject: IMAGEOBJECT_SCHEMA,
2330
- mediaobject: MEDIAOBJECT_SCHEMA,
2331
- caption1: CAPTION_SCHEMA,
2332
2351
  figsource: FIGSOURCE_SCHEMA,
2333
2352
  fignote: FIGNOTE_SCHEMA,
2334
- figure1: FIGURE_SCHEMA,
2335
- informalfigure: INFORMALFIGURE_SCHEMA,
2336
- keywordset: KEYWORDSET_SCHEMA,
2337
2353
  keyword: KEYWORD_SCHEMA,
2338
2354
  punc: PUNC_SCHEMA,
2339
2355
  label1: LABEL_SCHEMA,
2340
2356
  li: LI_SCHEMA,
2341
- ol: OL_SCHEMA,
2342
- ul: UL_SCHEMA,
2343
2357
  token: TOKEN_SCHEMA,
2344
2358
  tag: TAG_SCHEMA,
2345
2359
  lrh: LRH_SCHEMA,
2346
2360
  rrh: RRH_SCHEMA,
2347
2361
  source1: SOURCE_SCHEMA,
2348
2362
  subtitle1: SUBTITLE_SCHEMA,
2363
+ tp: TP_SCHEMA,
2364
+ tblfn: TBLFN_SCHEMA,
2365
+ tblsource: TBLSOURCE_SCHEMA,
2366
+ chapter: CHAPTER_SCHEMA
2367
+ };
2368
+ var GROUP_SCHEMAS = {
2369
+ bibliodiv: BIBLIODIV_SCHEMA,
2370
+ referenceBibliography: REFERENCE_BIBLIOGRAPHY_SCHEMA,
2371
+ footnote: FOOTNOTE_SCHEMA,
2372
+ org: ORG_SCHEMA,
2373
+ dialogue: DIALOGUE_SCHEMA,
2374
+ linegroup: LINE_GROUP_SCHEMA,
2375
+ equation: EQUATION_SCHEMA,
2376
+ alttext: ALTTEXT_SCHEMA,
2377
+ imageobject: IMAGEOBJECT_SCHEMA,
2378
+ mediaobject: MEDIAOBJECT_SCHEMA,
2379
+ caption1: CAPTION_SCHEMA,
2380
+ figure1: FIGURE_SCHEMA,
2381
+ informalfigure: INFORMALFIGURE_SCHEMA,
2382
+ keywordset: KEYWORDSET_SCHEMA,
2383
+ ol: OL_SCHEMA,
2384
+ ul: UL_SCHEMA,
2349
2385
  table1: TABLE_SCHEMA,
2350
2386
  tgroup: TGROUP_SCHEMA,
2351
2387
  table: HTML_TABLE_SCHEMA,
@@ -2353,15 +2389,12 @@ var ELEMENT_SCHEMAS = {
2353
2389
  tbody: TBODY_SCHEMA,
2354
2390
  tr: TR_SCHEMA,
2355
2391
  td: TD_SCHEMA,
2356
- tp: TP_SCHEMA,
2357
- tblfn: TBLFN_SCHEMA,
2358
- tblsource: TBLSOURCE_SCHEMA,
2359
2392
  heading: HEADING_SCHEMA,
2360
2393
  footnoteSection: FOOTNOTE_SECTION_SCHEMA,
2361
- chapter: CHAPTER_SCHEMA,
2362
2394
  info1: INFO_SCHEMA,
2363
2395
  abstract1: ABSTRACT_SCHEMA,
2364
2396
  epigraph: EPIGRAPH_SCHEMA,
2397
+ example: EXAMPLE_SCHEMA,
2365
2398
  poem: POEM_SCHEMA,
2366
2399
  blockquote: BLOCKQUOTE_SCHEMA,
2367
2400
  sidebar: BOX_SCHEMA,
@@ -2474,7 +2507,13 @@ var PHRASE_SCHEMA = createSchema({
2474
2507
  tag: PHRASE_TAG,
2475
2508
  requiredAttributes: [...ID_ATTRS, "xml:lang"],
2476
2509
  optionalAttributes: [],
2477
- allowedChildrenCodes: [...ATOM_CODES_ALLOWED_CHILDREN]
2510
+ allowedChildrenCodes: [
2511
+ ...ATOM_CODES_ALLOWED_CHILDREN,
2512
+ // DocBook lets a phrase hold footnotes and links, so a language phrase
2513
+ // can span a sentence that carries a footnote call-out or a citation.
2514
+ { code: "footnote1", required: false },
2515
+ { code: "link", required: false }
2516
+ ]
2478
2517
  });
2479
2518
 
2480
2519
  // src/schema/elementSchemas/inlineElements/index.ts
@@ -2817,7 +2856,7 @@ var createDocbookSchema = (name) => {
2817
2856
  );
2818
2857
  return createSchema({
2819
2858
  code: getDocbookSchemaCode(name),
2820
- kind: "element",
2859
+ kind: text ? "element" : "group",
2821
2860
  tag: EDITOR_TAGS[name] ?? name.toUpperCase(),
2822
2861
  requiredAttributes: [],
2823
2862
  optionalAttributes: [
@@ -2848,6 +2887,7 @@ var BIBLIOMIXED_SCHEMA = DOCBOOK_SCHEMAS.referenceBibliomixed;
2848
2887
  var SCHEMAS = {
2849
2888
  ...ATOM_SCHEMAS,
2850
2889
  ...ELEMENT_SCHEMAS,
2890
+ ...GROUP_SCHEMAS,
2851
2891
  ...INLINE_ELEMENT_SCHEMAS,
2852
2892
  ...DOCBOOK_SCHEMAS
2853
2893
  };
@@ -2887,7 +2927,7 @@ var findSchemaByElement = (element) => getSchemasByTag().get(element.tagName.toU
2887
2927
  var isAttributeRestricted = (attr) => typeof attr !== "string";
2888
2928
 
2889
2929
  // src/schema/helpers/isTrackChangesSchema.ts
2890
- var isTrackChangesSchema = (schema) => schema.code === "insertion" || schema.code === "deletion" || schema.code === "lineGroupRemoval" || schema.code === "formatRemoval";
2930
+ var isTrackChangesSchema = (schema) => schema.kind === "trackChanges";
2891
2931
 
2892
2932
  // src/schema/referenceSchemas/referenceTypeSchemas.ts
2893
2933
  var LINK_FIELDS = ["doi", "url"];
@@ -3278,7 +3318,10 @@ var ElementLabel = {
3278
3318
  ...DOCBOOK_ELEMENT_LABELS,
3279
3319
  mark: "Mark",
3280
3320
  referenceBibliomixed: "Reference Bibliomixed",
3281
- referenceBibliography: "Reference Bibliography",
3321
+ referenceBibliography: {
3322
+ default: "Reference Bibliography",
3323
+ chapterend: "Chapter-End Reference Bibliography"
3324
+ },
3282
3325
  bibliodiv: "Bibliodiv",
3283
3326
  bibliomset: "Reference Block",
3284
3327
  editor: "Editor",
@@ -3306,7 +3349,11 @@ var ElementLabel = {
3306
3349
  tertiary: "Tertiary",
3307
3350
  quaternary: "Quaternary",
3308
3351
  bookmark: "Bookmark",
3309
- see: "Cross Reference",
3352
+ see: {
3353
+ default: "Cross Reference",
3354
+ see: "See",
3355
+ "see-also": "See Also"
3356
+ },
3310
3357
  commentQuerySection: "Comment/Query",
3311
3358
  comment: "Comment",
3312
3359
  content: "Content",
@@ -3315,7 +3362,13 @@ var ElementLabel = {
3315
3362
  deletion: "Deletion",
3316
3363
  lineGroupRemoval: "Line Group Removal",
3317
3364
  formatRemoval: "Formatting Removal",
3318
- emphasis: "Emphasis",
3365
+ emphasis: {
3366
+ default: "Emphasis",
3367
+ lowercase: "Lowercase",
3368
+ uppercase: "Uppercase",
3369
+ initialcaps: "Initial Caps",
3370
+ "Non breaking space": "Non-Breaking Space"
3371
+ },
3319
3372
  highlightmark: "Highlightmark",
3320
3373
  i: "Italic",
3321
3374
  insertion: "Insertion",
@@ -3332,11 +3385,15 @@ var ElementLabel = {
3332
3385
  fignote: "Fignote",
3333
3386
  figsource: "Figsource",
3334
3387
  firstname: "Firstname",
3335
- footnote: "Footnote Marker",
3388
+ footnote: {
3389
+ default: "Footnote Marker",
3390
+ "end-ch-note": "Chapter Footnote Marker",
3391
+ "end-bk-note": "Book Footnote Marker"
3392
+ },
3336
3393
  footnoteno: "Footnote Number",
3337
3394
  honorific: "Honorific",
3338
3395
  img: "Image",
3339
- informalfigure: "Floating Figure",
3396
+ informalfigure: "Inline Figure",
3340
3397
  keyword: "Keyword",
3341
3398
  label1: "Label",
3342
3399
  li: "List Item",
@@ -3398,9 +3455,24 @@ var ElementLabel = {
3398
3455
  chapter: "Chapter",
3399
3456
  dialogue: "Dialogue",
3400
3457
  epigraph: "Epigraph",
3401
- figure1: "Figure",
3402
- footnoteSection: "Footnote Section",
3403
- heading: "Heading",
3458
+ example: "Example",
3459
+ figure1: "Display Figure",
3460
+ footnoteSection: {
3461
+ default: "Footnote Section",
3462
+ ch: "Chapter Footnote Section",
3463
+ bk: "Book Footnote Section"
3464
+ },
3465
+ heading: {
3466
+ default: "Heading",
3467
+ H0: "Heading +1",
3468
+ H1: "Heading 1",
3469
+ H2: "Heading 2",
3470
+ H3: "Heading 3",
3471
+ H4: "Heading 4",
3472
+ H5: "Heading 5",
3473
+ H6: "Heading 6",
3474
+ vignette_group: "Vignette Group"
3475
+ },
3404
3476
  imageobject: "Image Object",
3405
3477
  info1: "Info",
3406
3478
  keywordset: "Keyword FGroup",
@@ -3408,17 +3480,40 @@ var ElementLabel = {
3408
3480
  ol: "Ordered List",
3409
3481
  personname: "Person Name",
3410
3482
  poem: "Poem",
3411
- sidebar: "Box",
3483
+ sidebar: {
3484
+ default: "Box",
3485
+ box1: "Box 1",
3486
+ box2: "Box 2",
3487
+ box3: "Box 3",
3488
+ box4: "Box 4",
3489
+ box5: "Box 5"
3490
+ },
3412
3491
  table: "Table",
3413
- table1: "Table",
3492
+ table1: {
3493
+ default: "Table",
3494
+ inline: "Inline Table",
3495
+ float: "Floating Table"
3496
+ },
3414
3497
  tbody: "Table Body",
3415
3498
  td: "Table Data",
3416
3499
  tgroup: "Table Group",
3417
3500
  tr: "Table Row",
3418
3501
  ul: "Unordered List",
3419
- footnote1: "Footnote",
3502
+ footnote1: {
3503
+ default: "Footnote",
3504
+ "end-ch-note": "Chapter Footnote",
3505
+ "end-bk-note": "Book Footnote"
3506
+ },
3420
3507
  inlineequation: "Inline Equation",
3421
- link: "Link",
3508
+ link: {
3509
+ default: "Link",
3510
+ bibr: "Bibliography Link",
3511
+ table: "Table Link",
3512
+ figure: "Figure Link",
3513
+ equation: "Equation Link",
3514
+ footnote: "Footnote Link",
3515
+ chapter: "Chapter Link"
3516
+ },
3422
3517
  uri: "URI",
3423
3518
  phrase: "Phrase",
3424
3519
  abbreviation: "Abbreviation",
@@ -3426,6 +3521,13 @@ var ElementLabel = {
3426
3521
  em: "Emphasis",
3427
3522
  strong: "Strong"
3428
3523
  };
3524
+ var getElementLabel = (code, role) => {
3525
+ const label = ElementLabel[code];
3526
+ if (typeof label === "string") {
3527
+ return label;
3528
+ }
3529
+ return role && Object.prototype.hasOwnProperty.call(label, role) ? label[role] : label.default;
3530
+ };
3429
3531
 
3430
3532
  // src/schema/shared/dependentsForbiddenElements.ts
3431
3533
  var DEPENDENT_FORBIDDEN_ELEMENTS = [
@@ -3436,6 +3538,7 @@ var DEPENDENT_FORBIDDEN_ELEMENTS = [
3436
3538
  ];
3437
3539
 
3438
3540
  // src/helpers/isIgnoredElement.ts
3541
+ var DUMMY_SPAN_SELECTOR = "span#dummySpan";
3439
3542
  var IGNORED_ELEMENT_SELECTORS = [
3440
3543
  "span.rhlabel",
3441
3544
  "span.printlabel",
@@ -3444,7 +3547,7 @@ var IGNORED_ELEMENT_SELECTORS = [
3444
3547
  "span.ref-drag",
3445
3548
  "span.reference-type-label",
3446
3549
  "span.reference-validation-no-match",
3447
- "span#dummySpan"
3550
+ DUMMY_SPAN_SELECTOR
3448
3551
  ];
3449
3552
  var IGNORED_ELEMENT_SELECTOR = IGNORED_ELEMENT_SELECTORS.join(", ");
3450
3553
  var isIgnoredElement = (element) => element.tagName.toUpperCase() === "SPAN" && element.matches(IGNORED_ELEMENT_SELECTOR);
@@ -3772,8 +3875,14 @@ var validateRequiredChildren = (element, schema, childElements) => {
3772
3875
  );
3773
3876
  if (!hasChild) {
3774
3877
  const requiredChild = findSchemaByCode(allowedChild.code);
3775
- const elementLabel = ElementLabel[requiredChild.code];
3776
- const parentLabel = ElementLabel[schema.code];
3878
+ const elementLabel = getElementLabel(
3879
+ requiredChild.code,
3880
+ element.getAttribute("role")
3881
+ );
3882
+ const parentLabel = getElementLabel(
3883
+ schema.code,
3884
+ element.getAttribute("role")
3885
+ );
3777
3886
  const extraInstruction = getExtraInstruction(schema, requiredChild);
3778
3887
  const description = [
3779
3888
  `Please provide at least one ${elementLabel} in this ${parentLabel}.`,
@@ -3813,15 +3922,16 @@ var validateChildren = (element, schema) => {
3813
3922
  const childElements = getEffectiveChildElements(element, {
3814
3923
  includeDeleted: false
3815
3924
  });
3816
- if (schema.kind === "atom") {
3925
+ if (schema.kind === "atom" || schema.kind === "trackChanges") {
3817
3926
  return errors;
3818
3927
  }
3819
3928
  if (schema.allowsText === false && hasVisibleText(element)) {
3929
+ const label = getElementLabel(schema.code, element.getAttribute("role"));
3820
3930
  addValidationIssue(errors, element, {
3821
- title: `Text not allowed in ${ElementLabel[schema.code]}`,
3931
+ title: `Text not allowed in ${label}`,
3822
3932
  level: "warning",
3823
3933
  kind: "forbidden",
3824
- description: `A ${ElementLabel[schema.code]} holds only elements. Please tag or remove the text inside it.`,
3934
+ description: `A ${label} holds only elements. Please tag or remove the text inside it.`,
3825
3935
  elements: [element]
3826
3936
  });
3827
3937
  }
@@ -4328,7 +4438,10 @@ var isInWrongBibliomset = (field) => {
4328
4438
  const relation = field.closest(BIBLIOMSET)?.getAttribute("relation");
4329
4439
  return relation !== void 0 && !FIELD_BIBLIOMSETS[field.localName]?.some((owner) => owner === relation);
4330
4440
  };
4331
- var isEditorWrapper = (element) => element.tagName.toUpperCase() === "SPAN" || findSchemaByElement(element)?.kind === "atom";
4441
+ var isEditorWrapper = (element) => {
4442
+ const kind = findSchemaByElement(element)?.kind;
4443
+ return element.tagName.toUpperCase() === "SPAN" || kind === "atom" || kind === "trackChanges";
4444
+ };
4332
4445
  var getLiveChildren = (element) => Array.from(element.children).flatMap((child) => {
4333
4446
  if (!isLiveReferenceContent(child)) return [];
4334
4447
  return child.matches(INSERTION) || child.tagName.toUpperCase() === "SPAN" && !findSchemaByElement(child) ? getLiveChildren(child) : [child];
@@ -4866,6 +4979,25 @@ var validateReference = (reference) => {
4866
4979
  );
4867
4980
  };
4868
4981
 
4982
+ // src/validation/validateDummySpan.ts
4983
+ var validateDummySpan = (root) => {
4984
+ const placeholders = [];
4985
+ for (const dummySpan of root.querySelectorAll(DUMMY_SPAN_SELECTOR)) {
4986
+ const parentElement = dummySpan.parentElement ?? root;
4987
+ if (parentElement && isDeletedElement(parentElement)) continue;
4988
+ placeholders.push(parentElement);
4989
+ }
4990
+ return placeholders.map(
4991
+ (holder) => createValidationIssue(holder, {
4992
+ title: "Placeholder element found",
4993
+ kind: "placeholder",
4994
+ description: "This element contains an empty placeholder. Type text into the placeholder or delete it.",
4995
+ level: "blocker",
4996
+ elements: [holder]
4997
+ })
4998
+ );
4999
+ };
5000
+
4869
5001
  // src/validation/validateXml.ts
4870
5002
  var ELEMENTS_PER_STEP = 64;
4871
5003
  var DEFAULT_TIME_BUDGET_MS = 8;
@@ -4923,6 +5055,7 @@ function* validateXmlSteps(xml, elementsToLink, linkElements, schemasToValidateA
4923
5055
  const errors = [];
4924
5056
  errors.push(...validateConsecutiveFootnotes(xml));
4925
5057
  errors.push(...validateConsecutiveFootnoteCues(xml));
5058
+ errors.push(...validateDummySpan(xml));
4926
5059
  yield;
4927
5060
  errors.push(...yield* validatePossibleWeblinksSteps(xml));
4928
5061
  yield* validateElements(xml, {
@@ -5055,10 +5188,11 @@ export {
5055
5188
  DOCBOOK_ELEMENT_LABELS,
5056
5189
  DOCBOOK_ELEMENT_NAMES,
5057
5190
  DOCBOOK_SCHEMAS,
5191
+ DUMMY_SPAN_SELECTOR,
5058
5192
  ELEMENT_SCHEMAS,
5059
5193
  ELE_ID_ATTRIBUTE,
5060
- ElementLabel,
5061
5194
  FIGURE_PLACEMENT_ATTRIBUTE,
5195
+ GROUP_SCHEMAS,
5062
5196
  ID_ATTRS,
5063
5197
  IGNORED_ATTRIBUTES,
5064
5198
  IGNORED_ATTRIBUTES_STARTS_WITH,
@@ -5107,6 +5241,7 @@ export {
5107
5241
  getAttributeName,
5108
5242
  getDocbookSchemaCode,
5109
5243
  getEffectiveChildElements,
5244
+ getElementLabel,
5110
5245
  getElementLinks,
5111
5246
  getPossibleWeblinks,
5112
5247
  getReferenceFieldElements,
@@ -5124,6 +5259,7 @@ export {
5124
5259
  validateAttributes,
5125
5260
  validateConsecutiveFootnoteCues,
5126
5261
  validateConsecutiveFootnotes,
5262
+ validateDummySpan,
5127
5263
  validateElementAgainstSchema,
5128
5264
  validateElementToLinkTo,
5129
5265
  validateFootnoteNumber,