pro-editor-schema 1.6.12 → 1.6.13-dev.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.
package/dist/index.js CHANGED
@@ -38,10 +38,11 @@ __export(index_exports, {
38
38
  DOCBOOK_ELEMENT_LABELS: () => DOCBOOK_ELEMENT_LABELS,
39
39
  DOCBOOK_ELEMENT_NAMES: () => DOCBOOK_ELEMENT_NAMES,
40
40
  DOCBOOK_SCHEMAS: () => DOCBOOK_SCHEMAS,
41
+ DUMMY_SPAN_SELECTOR: () => DUMMY_SPAN_SELECTOR,
41
42
  ELEMENT_SCHEMAS: () => ELEMENT_SCHEMAS,
42
43
  ELE_ID_ATTRIBUTE: () => ELE_ID_ATTRIBUTE,
43
- ElementLabel: () => ElementLabel,
44
44
  FIGURE_PLACEMENT_ATTRIBUTE: () => FIGURE_PLACEMENT_ATTRIBUTE,
45
+ GROUP_SCHEMAS: () => GROUP_SCHEMAS,
45
46
  ID_ATTRS: () => ID_ATTRS,
46
47
  IGNORED_ATTRIBUTES: () => IGNORED_ATTRIBUTES,
47
48
  IGNORED_ATTRIBUTES_STARTS_WITH: () => IGNORED_ATTRIBUTES_STARTS_WITH,
@@ -90,6 +91,7 @@ __export(index_exports, {
90
91
  getAttributeName: () => getAttributeName,
91
92
  getDocbookSchemaCode: () => getDocbookSchemaCode,
92
93
  getEffectiveChildElements: () => getEffectiveChildElements,
94
+ getElementLabel: () => getElementLabel,
93
95
  getElementLinks: () => getElementLinks,
94
96
  getPossibleWeblinks: () => getPossibleWeblinks,
95
97
  getReferenceFieldElements: () => getReferenceFieldElements,
@@ -107,6 +109,7 @@ __export(index_exports, {
107
109
  validateAttributes: () => validateAttributes,
108
110
  validateConsecutiveFootnoteCues: () => validateConsecutiveFootnoteCues,
109
111
  validateConsecutiveFootnotes: () => validateConsecutiveFootnotes,
112
+ validateDummySpan: () => validateDummySpan,
110
113
  validateElementAgainstSchema: () => validateElementAgainstSchema,
111
114
  validateElementToLinkTo: () => validateElementToLinkTo,
112
115
  validateFootnoteNumber: () => validateFootnoteNumber,
@@ -252,7 +255,7 @@ var INLINE_ELEMENT_CODES_ALLOWED_CHILDREN = [
252
255
  // src/schema/elementSchemas/atoms/deletion.ts
253
256
  var DELETION_SCHEMA = createSchema({
254
257
  code: "deletion",
255
- kind: "atom",
258
+ kind: "trackChanges",
256
259
  tag: SPAN_TAG,
257
260
  matchesElement: (element) => element.classList.contains("del"),
258
261
  requiredAttributes: [...TRACK_CHANGES_ATTRS, ...ID_ATTRS],
@@ -284,7 +287,7 @@ var EMPHASIS_SCHEMA = createSchema({
284
287
  var PREV_FORMAT_ATTRIBUTE = "prev-format";
285
288
  var FORMAT_REMOVAL_SCHEMA = createSchema({
286
289
  code: "formatRemoval",
287
- kind: "atom",
290
+ kind: "trackChanges",
288
291
  tag: SPAN_TAG,
289
292
  matchesElement: (element) => element.hasAttribute(PREV_FORMAT_ATTRIBUTE),
290
293
  requiredAttributes: [PREV_FORMAT_ATTRIBUTE],
@@ -318,7 +321,7 @@ var I_SCHEMA = createSchema({
318
321
  // src/schema/elementSchemas/atoms/insertion.ts
319
322
  var INSERTION_SCHEMA = createSchema({
320
323
  code: "insertion",
321
- kind: "atom",
324
+ kind: "trackChanges",
322
325
  tag: SPAN_TAG,
323
326
  matchesElement: (element) => element.classList.contains("ins"),
324
327
  requiredAttributes: [...TRACK_CHANGES_ATTRS, ...ID_ATTRS],
@@ -338,7 +341,7 @@ var INSERTION_SCHEMA = createSchema({
338
341
  // src/schema/elementSchemas/atoms/lineGroupRemoval.ts
339
342
  var LINE_GROUP_REMOVAL_SCHEMA = createSchema({
340
343
  code: "lineGroupRemoval",
341
- kind: "atom",
344
+ kind: "trackChanges",
342
345
  tag: SPAN_TAG,
343
346
  matchesElement: (element) => element.getAttribute("data-line-group-action") === "removed" && element.getAttribute("data-track-change-wrapper") === "unwrap",
344
347
  requiredAttributes: [
@@ -817,6 +820,7 @@ var BLOCKQUOTE_TAG = "BLOCKQUOTE";
817
820
  var SIDEBAR_TAG = "SIDEBAR";
818
821
  var CHAPTER_TAG = "CHAPTER";
819
822
  var EPIGRAPH_TAG = "EPIGRAPH";
823
+ var EXAMPLE_TAG = "EXAMPLE";
820
824
  var INFO_TAG = "INFO1";
821
825
  var POEM_TAG = "POEM";
822
826
  var REFERENCE_BIBLIOGRAPHY_TAG = "BIBLIOGRAPHY";
@@ -867,7 +871,7 @@ var MUNDEROVER_TAG = "MUNDEROVER";
867
871
  // src/schema/elementSchemas/elements/authors/authorgroup.ts
868
872
  var AUTHORGROUP_SCHEMA = createSchema({
869
873
  code: "authorgroup",
870
- kind: "element",
874
+ kind: "group",
871
875
  tag: AUTHORGROUP_TAG,
872
876
  requiredAttributes: [...ID_ATTRS],
873
877
  optionalAttributes: [],
@@ -880,7 +884,7 @@ var AUTHORGROUP_SCHEMA = createSchema({
880
884
  // src/schema/elementSchemas/elements/authors/author.ts
881
885
  var AUTHOR_SCHEMA = createSchema({
882
886
  code: "author",
883
- kind: "element",
887
+ kind: "group",
884
888
  tag: AUTHOR_TAG,
885
889
  requiredAttributes: [...ID_ATTRS],
886
890
  optionalAttributes: [],
@@ -907,7 +911,7 @@ var OLINK_SCHEMA = createSchema({
907
911
  // src/schema/elementSchemas/elements/authors/personname.ts
908
912
  var PERSONNAME_SCHEMA = createSchema({
909
913
  code: "personname",
910
- kind: "element",
914
+ kind: "group",
911
915
  tag: PERSONNAME_TAG,
912
916
  requiredAttributes: [...ID_ATTRS],
913
917
  optionalAttributes: [],
@@ -971,7 +975,7 @@ var EMAIL_SCHEMA = createSchema({
971
975
  // src/schema/elementSchemas/elements/authors/org.ts
972
976
  var ORG_SCHEMA = createSchema({
973
977
  code: "org",
974
- kind: "element",
978
+ kind: "group",
975
979
  tag: ORG_TAG,
976
980
  requiredAttributes: [...ID_ATTRS],
977
981
  optionalAttributes: [],
@@ -981,7 +985,7 @@ var ORG_SCHEMA = createSchema({
981
985
  // src/schema/elementSchemas/elements/authors/affiliation.ts
982
986
  var AFFILIATION_SCHEMA = createSchema({
983
987
  code: "affiliation",
984
- kind: "element",
988
+ kind: "group",
985
989
  tag: AFFILIATION_TAG,
986
990
  requiredAttributes: [...ID_ATTRS],
987
991
  optionalAttributes: [],
@@ -1024,7 +1028,7 @@ var SPEAKER_SCHEMA = createSchema({
1024
1028
  // src/schema/elementSchemas/elements/dialogue/dialogue.ts
1025
1029
  var DIALOGUE_SCHEMA = createSchema({
1026
1030
  code: "dialogue",
1027
- kind: "element",
1031
+ kind: "group",
1028
1032
  tag: DIALOGUE_TAG,
1029
1033
  requiredAttributes: [...ID_ATTRS],
1030
1034
  optionalAttributes: [...TRACK_CHANGES_ATTRS, "role", "trackmsg"],
@@ -1038,7 +1042,7 @@ var DIALOGUE_SCHEMA = createSchema({
1038
1042
  // src/schema/elementSchemas/elements/equation/equation.ts
1039
1043
  var EQUATION_SCHEMA = createSchema({
1040
1044
  code: "equation",
1041
- kind: "element",
1045
+ kind: "group",
1042
1046
  tag: EQUATION_TAG,
1043
1047
  requiredAttributes: [...ID_ATTRS],
1044
1048
  optionalAttributes: [
@@ -1409,7 +1413,7 @@ var IMG_SCHEMA = createSchema({
1409
1413
  // src/schema/elementSchemas/elements/figure/alttext.ts
1410
1414
  var ALTTEXT_SCHEMA = createSchema({
1411
1415
  code: "alttext",
1412
- kind: "element",
1416
+ kind: "group",
1413
1417
  tag: ALTTEXT_TAG,
1414
1418
  requiredAttributes: [],
1415
1419
  optionalAttributes: [],
@@ -1419,7 +1423,7 @@ var ALTTEXT_SCHEMA = createSchema({
1419
1423
  // src/schema/elementSchemas/elements/figure/imageobject.ts
1420
1424
  var IMAGEOBJECT_SCHEMA = createSchema({
1421
1425
  code: "imageobject",
1422
- kind: "element",
1426
+ kind: "group",
1423
1427
  tag: IMAGEOBJECT_TAG,
1424
1428
  requiredAttributes: [...ID_ATTRS],
1425
1429
  optionalAttributes: [],
@@ -1432,7 +1436,7 @@ var IMAGEOBJECT_SCHEMA = createSchema({
1432
1436
  // src/schema/elementSchemas/elements/figure/mediaobject.ts
1433
1437
  var MEDIAOBJECT_SCHEMA = createSchema({
1434
1438
  code: "mediaobject",
1435
- kind: "element",
1439
+ kind: "group",
1436
1440
  tag: MEDIAOBJECT_TAG,
1437
1441
  requiredAttributes: [...ID_ATTRS],
1438
1442
  optionalAttributes: [...TRACK_CHANGES_ATTRS],
@@ -1442,7 +1446,7 @@ var MEDIAOBJECT_SCHEMA = createSchema({
1442
1446
  // src/schema/elementSchemas/elements/figure/caption1.ts
1443
1447
  var CAPTION_SCHEMA = createSchema({
1444
1448
  code: "caption1",
1445
- kind: "element",
1449
+ kind: "group",
1446
1450
  tag: CAPTION_TAG,
1447
1451
  requiredAttributes: [...ID_ATTRS],
1448
1452
  optionalAttributes: [],
@@ -1478,7 +1482,7 @@ var FIGNOTE_SCHEMA = createSchema({
1478
1482
  // src/schema/elementSchemas/elements/figure/figure.ts
1479
1483
  var FIGURE_SCHEMA = createSchema({
1480
1484
  code: "figure1",
1481
- kind: "element",
1485
+ kind: "group",
1482
1486
  tag: FIGURE_TAG,
1483
1487
  requiredAttributes: [...ID_ATTRS, "xmlid"],
1484
1488
  optionalAttributes: [
@@ -1500,7 +1504,7 @@ var FIGURE_SCHEMA = createSchema({
1500
1504
  // src/schema/elementSchemas/elements/footnote.ts
1501
1505
  var FOOTNOTE_SCHEMA = createSchema({
1502
1506
  code: "footnote",
1503
- kind: "element",
1507
+ kind: "group",
1504
1508
  tag: FOOTNOTE_TAG,
1505
1509
  requiredAttributes: [
1506
1510
  ...ID_ATTRS,
@@ -1533,7 +1537,7 @@ var FOOTNOTE_NUMBER_SCHEMA = createSchema({
1533
1537
  // src/schema/elementSchemas/elements/informalfigure.ts
1534
1538
  var INFORMALFIGURE_SCHEMA = createSchema({
1535
1539
  code: "informalfigure",
1536
- kind: "element",
1540
+ kind: "group",
1537
1541
  tag: INFORMALFIGURE_TAG,
1538
1542
  requiredAttributes: [...ID_ATTRS],
1539
1543
  optionalAttributes: [...TRACK_CHANGES_ATTRS, "data-anchor-id"],
@@ -1546,7 +1550,7 @@ var INFORMALFIGURE_SCHEMA = createSchema({
1546
1550
  // src/schema/elementSchemas/elements/keywords/keywordset.ts
1547
1551
  var KEYWORDSET_SCHEMA = createSchema({
1548
1552
  code: "keywordset",
1549
- kind: "element",
1553
+ kind: "group",
1550
1554
  tag: KEYWORDSET_TAG,
1551
1555
  requiredAttributes: [
1552
1556
  ...ID_ATTRS,
@@ -1610,7 +1614,7 @@ var LABEL_SCHEMA = createSchema({
1610
1614
  // src/schema/elementSchemas/elements/lineGroup.ts
1611
1615
  var LINE_GROUP_SCHEMA = createSchema({
1612
1616
  code: "linegroup",
1613
- kind: "element",
1617
+ kind: "group",
1614
1618
  tag: LINE_GROUP_TAG,
1615
1619
  requiredAttributes: [...ID_ATTRS],
1616
1620
  optionalAttributes: [
@@ -1665,7 +1669,7 @@ var LI_SCHEMA = createSchema({
1665
1669
  // src/schema/elementSchemas/elements/list/ol.ts
1666
1670
  var OL_SCHEMA = createSchema({
1667
1671
  code: "ol",
1668
- kind: "element",
1672
+ kind: "group",
1669
1673
  tag: OL_TAG,
1670
1674
  requiredAttributes: [...ID_ATTRS],
1671
1675
  optionalAttributes: [
@@ -1702,7 +1706,7 @@ var OL_SCHEMA = createSchema({
1702
1706
  // src/schema/elementSchemas/elements/list/ul.ts
1703
1707
  var UL_SCHEMA = createSchema({
1704
1708
  code: "ul",
1705
- kind: "element",
1709
+ kind: "group",
1706
1710
  tag: UL_TAG,
1707
1711
  requiredAttributes: [...ID_ATTRS],
1708
1712
  optionalAttributes: [
@@ -1858,7 +1862,7 @@ var TP_SCHEMA = createSchema({
1858
1862
  // src/schema/elementSchemas/elements/table/td.ts
1859
1863
  var TD_SCHEMA = createSchema({
1860
1864
  code: "td",
1861
- kind: "element",
1865
+ kind: "group",
1862
1866
  tag: TD_TAG,
1863
1867
  requiredAttributes: [...ID_ATTRS],
1864
1868
  optionalAttributes: [
@@ -1876,7 +1880,7 @@ var TD_SCHEMA = createSchema({
1876
1880
  // src/schema/elementSchemas/elements/table/tr.ts
1877
1881
  var TR_SCHEMA = createSchema({
1878
1882
  code: "tr",
1879
- kind: "element",
1883
+ kind: "group",
1880
1884
  tag: TR_TAG,
1881
1885
  requiredAttributes: [],
1882
1886
  optionalAttributes: [...LAYOUT_ATTRIBUTES, ...ID_ATTRS, "width"],
@@ -1886,7 +1890,7 @@ var TR_SCHEMA = createSchema({
1886
1890
  // src/schema/elementSchemas/elements/table/thead.ts
1887
1891
  var THEAD_SCHEMA = createSchema({
1888
1892
  code: "thead",
1889
- kind: "element",
1893
+ kind: "group",
1890
1894
  tag: THEAD_TAG,
1891
1895
  requiredAttributes: [],
1892
1896
  optionalAttributes: [...ID_ATTRS],
@@ -1896,7 +1900,7 @@ var THEAD_SCHEMA = createSchema({
1896
1900
  // src/schema/elementSchemas/elements/table/tbody.ts
1897
1901
  var TBODY_SCHEMA = createSchema({
1898
1902
  code: "tbody",
1899
- kind: "element",
1903
+ kind: "group",
1900
1904
  tag: TBODY_TAG,
1901
1905
  requiredAttributes: [],
1902
1906
  optionalAttributes: [...ID_ATTRS],
@@ -1906,7 +1910,7 @@ var TBODY_SCHEMA = createSchema({
1906
1910
  // src/schema/elementSchemas/elements/table/htmlTable.ts
1907
1911
  var HTML_TABLE_SCHEMA = createSchema({
1908
1912
  code: "table",
1909
- kind: "element",
1913
+ kind: "group",
1910
1914
  tag: HTML_TABLE_TAG,
1911
1915
  requiredAttributes: [],
1912
1916
  optionalAttributes: [...ID_ATTRS],
@@ -1919,7 +1923,7 @@ var HTML_TABLE_SCHEMA = createSchema({
1919
1923
  // src/schema/elementSchemas/elements/table/tgroup.ts
1920
1924
  var TGROUP_SCHEMA = createSchema({
1921
1925
  code: "tgroup",
1922
- kind: "element",
1926
+ kind: "group",
1923
1927
  tag: TGROUP_TAG,
1924
1928
  requiredAttributes: [...ID_ATTRS, "cols"],
1925
1929
  optionalAttributes: [],
@@ -1952,7 +1956,7 @@ var TBLSOURCE_SCHEMA = createSchema({
1952
1956
  // src/schema/elementSchemas/elements/table/table1.ts
1953
1957
  var TABLE_SCHEMA = createSchema({
1954
1958
  code: "table1",
1955
- kind: "element",
1959
+ kind: "group",
1956
1960
  tag: TABLE_TAG,
1957
1961
  requiredAttributes: [
1958
1962
  ...ID_ATTRS,
@@ -1987,7 +1991,7 @@ var HEADING_LEVEL = ["H0", "H1", "H2", "H3", "H4", "H5", "H6"];
1987
1991
  var HEADING_ROLES = [...HEADING_LEVEL, "vignette_group"];
1988
1992
  var HEADING_SCHEMA = createSchema({
1989
1993
  code: "heading",
1990
- kind: "element",
1994
+ kind: "group",
1991
1995
  tag: SECTION_TAG,
1992
1996
  matchesElement: (element) => {
1993
1997
  const role = element.getAttribute("role");
@@ -2013,6 +2017,7 @@ var HEADING_SCHEMA = createSchema({
2013
2017
  { code: "sidebar", required: false },
2014
2018
  { code: "epigraph", required: false },
2015
2019
  { code: "blockquote", required: false },
2020
+ { code: "example", required: false },
2016
2021
  { code: "ul", required: false },
2017
2022
  { code: "ol", required: false },
2018
2023
  { code: "poem", required: false },
@@ -2031,7 +2036,7 @@ var HEADING_SCHEMA = createSchema({
2031
2036
  var BOX_LEVEL = ["box1", "box2", "box3", "box4", "box5"];
2032
2037
  var BOX_SCHEMA = createSchema({
2033
2038
  code: "sidebar",
2034
- kind: "element",
2039
+ kind: "group",
2035
2040
  tag: SIDEBAR_TAG,
2036
2041
  requiredAttributes: [
2037
2042
  ...ID_ATTRS,
@@ -2088,7 +2093,7 @@ var TITLE_SCHEMA = createSchema({
2088
2093
  // src/schema/elementSchemas/elements/abstract.ts
2089
2094
  var ABSTRACT_SCHEMA = createSchema({
2090
2095
  code: "abstract1",
2091
- kind: "element",
2096
+ kind: "group",
2092
2097
  tag: ABSTRACT_TAG,
2093
2098
  requiredAttributes: [
2094
2099
  ...ID_ATTRS,
@@ -2118,7 +2123,7 @@ var ABSTRACT_SCHEMA = createSchema({
2118
2123
  // src/schema/elementSchemas/elements/appendix.ts
2119
2124
  var APPENDIX_SCHEMA = createSchema({
2120
2125
  code: "appendix",
2121
- kind: "element",
2126
+ kind: "group",
2122
2127
  tag: APPENDIX_TAG,
2123
2128
  requiredAttributes: [...ID_ATTRS, "id", "xmlid"],
2124
2129
  optionalAttributes: [...TRACK_CHANGES_ATTRS],
@@ -2133,7 +2138,7 @@ var APPENDIX_SCHEMA = createSchema({
2133
2138
  // src/schema/elementSchemas/elements/blockquote.ts
2134
2139
  var BLOCKQUOTE_SCHEMA = createSchema({
2135
2140
  code: "blockquote",
2136
- kind: "element",
2141
+ kind: "group",
2137
2142
  tag: BLOCKQUOTE_TAG,
2138
2143
  requiredAttributes: [...ID_ATTRS],
2139
2144
  optionalAttributes: [
@@ -2183,6 +2188,7 @@ var CHAPTER_SCHEMA = createSchema({
2183
2188
  { code: "sidebar", required: false },
2184
2189
  { code: "epigraph", required: false },
2185
2190
  { code: "blockquote", required: false },
2191
+ { code: "example", required: false },
2186
2192
  { code: "ul", required: false },
2187
2193
  { code: "ol", required: false },
2188
2194
  { code: "subtitle1", required: false },
@@ -2198,7 +2204,7 @@ var CHAPTER_SCHEMA = createSchema({
2198
2204
  // src/schema/elementSchemas/elements/epigraph.ts
2199
2205
  var EPIGRAPH_SCHEMA = createSchema({
2200
2206
  code: "epigraph",
2201
- kind: "element",
2207
+ kind: "group",
2202
2208
  tag: EPIGRAPH_TAG,
2203
2209
  requiredAttributes: [...ID_ATTRS],
2204
2210
  optionalAttributes: [
@@ -2217,11 +2223,32 @@ var EPIGRAPH_SCHEMA = createSchema({
2217
2223
  ]
2218
2224
  });
2219
2225
 
2226
+ // src/schema/elementSchemas/elements/example.ts
2227
+ var EXAMPLE_SCHEMA = createSchema({
2228
+ code: "example",
2229
+ kind: "element",
2230
+ tag: EXAMPLE_TAG,
2231
+ requiredAttributes: [...ID_ATTRS],
2232
+ optionalAttributes: [
2233
+ ...TRACK_CHANGES_ATTRS,
2234
+ "xmlid",
2235
+ "track-code",
2236
+ "element-change-description"
2237
+ ],
2238
+ defaultChildCode: "para",
2239
+ allowedChildrenCodes: [
2240
+ { code: "para", required: false },
2241
+ { code: "ul", required: false },
2242
+ { code: "ol", required: false },
2243
+ { code: "tag", required: false }
2244
+ ]
2245
+ });
2246
+
2220
2247
  // src/schema/elementSchemas/elements/footnoteSection.ts
2221
2248
  var FOOTNOTE_SECTION_ROLES = ["ch", "bk"];
2222
2249
  var FOOTNOTE_SECTION_SCHEMA = createSchema({
2223
2250
  code: "footnoteSection",
2224
- kind: "element",
2251
+ kind: "group",
2225
2252
  tag: SECTION_TAG,
2226
2253
  matchesElement: (element) => {
2227
2254
  const role = element.getAttribute("role");
@@ -2247,7 +2274,7 @@ var FOOTNOTE_SECTION_SCHEMA = createSchema({
2247
2274
  // src/schema/elementSchemas/elements/info.ts
2248
2275
  var INFO_SCHEMA = createSchema({
2249
2276
  code: "info1",
2250
- kind: "element",
2277
+ kind: "group",
2251
2278
  tag: INFO_TAG,
2252
2279
  requiredAttributes: [...ID_ATTRS],
2253
2280
  optionalAttributes: [],
@@ -2265,7 +2292,7 @@ var INFO_SCHEMA = createSchema({
2265
2292
  // src/schema/elementSchemas/elements/poem.ts
2266
2293
  var POEM_SCHEMA = createSchema({
2267
2294
  code: "poem",
2268
- kind: "element",
2295
+ kind: "group",
2269
2296
  tag: POEM_TAG,
2270
2297
  requiredAttributes: [...ID_ATTRS],
2271
2298
  optionalAttributes: [...TRACK_CHANGES_ATTRS, "role", "trackmsg"],
@@ -2291,7 +2318,7 @@ var MATHPHRASE_SCHEMA = createSchema({
2291
2318
  // src/schema/elementSchemas/elements/reference/bibliography.ts
2292
2319
  var REFERENCE_BIBLIOGRAPHY_SCHEMA = createSchema({
2293
2320
  code: "referenceBibliography",
2294
- kind: "element",
2321
+ kind: "group",
2295
2322
  tag: REFERENCE_BIBLIOGRAPHY_TAG,
2296
2323
  requiredAttributes: [
2297
2324
  ...ID_ATTRS,
@@ -2319,7 +2346,7 @@ var REFERENCE_BIBLIOGRAPHY_SCHEMA = createSchema({
2319
2346
  // src/schema/elementSchemas/elements/reference/bibliodiv.ts
2320
2347
  var BIBLIODIV_SCHEMA = createSchema({
2321
2348
  code: "bibliodiv",
2322
- kind: "element",
2349
+ kind: "group",
2323
2350
  tag: BIBLIODIV_TAG,
2324
2351
  requiredAttributes: [
2325
2352
  ...ID_ATTRS,
@@ -2398,14 +2425,11 @@ var LEGAL_REFERENCE_BIBLIOMISC_ROLE = "legalRef";
2398
2425
 
2399
2426
  // src/schema/elementSchemas/elements/index.ts
2400
2427
  var ELEMENT_SCHEMAS = {
2401
- bibliodiv: BIBLIODIV_SCHEMA,
2402
- referenceBibliography: REFERENCE_BIBLIOGRAPHY_SCHEMA,
2403
2428
  translator: TRANSLATOR_SCHEMA,
2404
2429
  pagenum: PAGENUM_SCHEMA,
2405
2430
  pubId: PUB_ID_SCHEMA,
2406
2431
  para: PARA_SCHEMA,
2407
2432
  title1: TITLE_SCHEMA,
2408
- footnote: FOOTNOTE_SCHEMA,
2409
2433
  footnoteno: FOOTNOTE_NUMBER_SCHEMA,
2410
2434
  olink: OLINK_SCHEMA,
2411
2435
  firstname: FIRSTNAME_SCHEMA,
@@ -2413,13 +2437,9 @@ var ELEMENT_SCHEMAS = {
2413
2437
  honorific: HONORIFIC_SCHEMA,
2414
2438
  orgname: ORGNAME_SCHEMA,
2415
2439
  email: EMAIL_SCHEMA,
2416
- org: ORG_SCHEMA,
2417
2440
  degrees: DEGREES_SCHEMA,
2418
- dialogue: DIALOGUE_SCHEMA,
2419
2441
  line: LINE_SCHEMA,
2420
- linegroup: LINE_GROUP_SCHEMA,
2421
2442
  speaker: SPEAKER_SCHEMA,
2422
- equation: EQUATION_SCHEMA,
2423
2443
  math: MATH_SCHEMA,
2424
2444
  mathphrase: MATHPHRASE_SCHEMA,
2425
2445
  merror: MERROR_SCHEMA,
@@ -2448,27 +2468,40 @@ var ELEMENT_SCHEMAS = {
2448
2468
  munder: MUNDER_SCHEMA,
2449
2469
  munderover: MUNDEROVER_SCHEMA,
2450
2470
  img: IMG_SCHEMA,
2451
- alttext: ALTTEXT_SCHEMA,
2452
- imageobject: IMAGEOBJECT_SCHEMA,
2453
- mediaobject: MEDIAOBJECT_SCHEMA,
2454
- caption1: CAPTION_SCHEMA,
2455
2471
  figsource: FIGSOURCE_SCHEMA,
2456
2472
  fignote: FIGNOTE_SCHEMA,
2457
- figure1: FIGURE_SCHEMA,
2458
- informalfigure: INFORMALFIGURE_SCHEMA,
2459
- keywordset: KEYWORDSET_SCHEMA,
2460
2473
  keyword: KEYWORD_SCHEMA,
2461
2474
  punc: PUNC_SCHEMA,
2462
2475
  label1: LABEL_SCHEMA,
2463
2476
  li: LI_SCHEMA,
2464
- ol: OL_SCHEMA,
2465
- ul: UL_SCHEMA,
2466
2477
  token: TOKEN_SCHEMA,
2467
2478
  tag: TAG_SCHEMA,
2468
2479
  lrh: LRH_SCHEMA,
2469
2480
  rrh: RRH_SCHEMA,
2470
2481
  source1: SOURCE_SCHEMA,
2471
2482
  subtitle1: SUBTITLE_SCHEMA,
2483
+ tp: TP_SCHEMA,
2484
+ tblfn: TBLFN_SCHEMA,
2485
+ tblsource: TBLSOURCE_SCHEMA,
2486
+ chapter: CHAPTER_SCHEMA
2487
+ };
2488
+ var GROUP_SCHEMAS = {
2489
+ bibliodiv: BIBLIODIV_SCHEMA,
2490
+ referenceBibliography: REFERENCE_BIBLIOGRAPHY_SCHEMA,
2491
+ footnote: FOOTNOTE_SCHEMA,
2492
+ org: ORG_SCHEMA,
2493
+ dialogue: DIALOGUE_SCHEMA,
2494
+ linegroup: LINE_GROUP_SCHEMA,
2495
+ equation: EQUATION_SCHEMA,
2496
+ alttext: ALTTEXT_SCHEMA,
2497
+ imageobject: IMAGEOBJECT_SCHEMA,
2498
+ mediaobject: MEDIAOBJECT_SCHEMA,
2499
+ caption1: CAPTION_SCHEMA,
2500
+ figure1: FIGURE_SCHEMA,
2501
+ informalfigure: INFORMALFIGURE_SCHEMA,
2502
+ keywordset: KEYWORDSET_SCHEMA,
2503
+ ol: OL_SCHEMA,
2504
+ ul: UL_SCHEMA,
2472
2505
  table1: TABLE_SCHEMA,
2473
2506
  tgroup: TGROUP_SCHEMA,
2474
2507
  table: HTML_TABLE_SCHEMA,
@@ -2476,15 +2509,12 @@ var ELEMENT_SCHEMAS = {
2476
2509
  tbody: TBODY_SCHEMA,
2477
2510
  tr: TR_SCHEMA,
2478
2511
  td: TD_SCHEMA,
2479
- tp: TP_SCHEMA,
2480
- tblfn: TBLFN_SCHEMA,
2481
- tblsource: TBLSOURCE_SCHEMA,
2482
2512
  heading: HEADING_SCHEMA,
2483
2513
  footnoteSection: FOOTNOTE_SECTION_SCHEMA,
2484
- chapter: CHAPTER_SCHEMA,
2485
2514
  info1: INFO_SCHEMA,
2486
2515
  abstract1: ABSTRACT_SCHEMA,
2487
2516
  epigraph: EPIGRAPH_SCHEMA,
2517
+ example: EXAMPLE_SCHEMA,
2488
2518
  poem: POEM_SCHEMA,
2489
2519
  blockquote: BLOCKQUOTE_SCHEMA,
2490
2520
  sidebar: BOX_SCHEMA,
@@ -2597,7 +2627,13 @@ var PHRASE_SCHEMA = createSchema({
2597
2627
  tag: PHRASE_TAG,
2598
2628
  requiredAttributes: [...ID_ATTRS, "xml:lang"],
2599
2629
  optionalAttributes: [],
2600
- allowedChildrenCodes: [...ATOM_CODES_ALLOWED_CHILDREN]
2630
+ allowedChildrenCodes: [
2631
+ ...ATOM_CODES_ALLOWED_CHILDREN,
2632
+ // DocBook lets a phrase hold footnotes and links, so a language phrase
2633
+ // can span a sentence that carries a footnote call-out or a citation.
2634
+ { code: "footnote1", required: false },
2635
+ { code: "link", required: false }
2636
+ ]
2601
2637
  });
2602
2638
 
2603
2639
  // src/schema/elementSchemas/inlineElements/index.ts
@@ -2940,7 +2976,7 @@ var createDocbookSchema = (name) => {
2940
2976
  );
2941
2977
  return createSchema({
2942
2978
  code: getDocbookSchemaCode(name),
2943
- kind: "element",
2979
+ kind: text ? "element" : "group",
2944
2980
  tag: EDITOR_TAGS[name] ?? name.toUpperCase(),
2945
2981
  requiredAttributes: [],
2946
2982
  optionalAttributes: [
@@ -2971,6 +3007,7 @@ var BIBLIOMIXED_SCHEMA = DOCBOOK_SCHEMAS.referenceBibliomixed;
2971
3007
  var SCHEMAS = {
2972
3008
  ...ATOM_SCHEMAS,
2973
3009
  ...ELEMENT_SCHEMAS,
3010
+ ...GROUP_SCHEMAS,
2974
3011
  ...INLINE_ELEMENT_SCHEMAS,
2975
3012
  ...DOCBOOK_SCHEMAS
2976
3013
  };
@@ -3010,7 +3047,7 @@ var findSchemaByElement = (element) => getSchemasByTag().get(element.tagName.toU
3010
3047
  var isAttributeRestricted = (attr) => typeof attr !== "string";
3011
3048
 
3012
3049
  // src/schema/helpers/isTrackChangesSchema.ts
3013
- var isTrackChangesSchema = (schema) => schema.code === "insertion" || schema.code === "deletion" || schema.code === "lineGroupRemoval" || schema.code === "formatRemoval";
3050
+ var isTrackChangesSchema = (schema) => schema.kind === "trackChanges";
3014
3051
 
3015
3052
  // src/schema/referenceSchemas/referenceTypeSchemas.ts
3016
3053
  var LINK_FIELDS = ["doi", "url"];
@@ -3401,7 +3438,10 @@ var ElementLabel = {
3401
3438
  ...DOCBOOK_ELEMENT_LABELS,
3402
3439
  mark: "Mark",
3403
3440
  referenceBibliomixed: "Reference Bibliomixed",
3404
- referenceBibliography: "Reference Bibliography",
3441
+ referenceBibliography: {
3442
+ default: "Reference Bibliography",
3443
+ chapterend: "Chapter-End Reference Bibliography"
3444
+ },
3405
3445
  bibliodiv: "Bibliodiv",
3406
3446
  bibliomset: "Reference Block",
3407
3447
  editor: "Editor",
@@ -3429,7 +3469,11 @@ var ElementLabel = {
3429
3469
  tertiary: "Tertiary",
3430
3470
  quaternary: "Quaternary",
3431
3471
  bookmark: "Bookmark",
3432
- see: "Cross Reference",
3472
+ see: {
3473
+ default: "Cross Reference",
3474
+ see: "See",
3475
+ "see-also": "See Also"
3476
+ },
3433
3477
  commentQuerySection: "Comment/Query",
3434
3478
  comment: "Comment",
3435
3479
  content: "Content",
@@ -3438,7 +3482,13 @@ var ElementLabel = {
3438
3482
  deletion: "Deletion",
3439
3483
  lineGroupRemoval: "Line Group Removal",
3440
3484
  formatRemoval: "Formatting Removal",
3441
- emphasis: "Emphasis",
3485
+ emphasis: {
3486
+ default: "Emphasis",
3487
+ lowercase: "Lowercase",
3488
+ uppercase: "Uppercase",
3489
+ initialcaps: "Initial Caps",
3490
+ "Non breaking space": "Non-Breaking Space"
3491
+ },
3442
3492
  highlightmark: "Highlightmark",
3443
3493
  i: "Italic",
3444
3494
  insertion: "Insertion",
@@ -3455,7 +3505,11 @@ var ElementLabel = {
3455
3505
  fignote: "Fignote",
3456
3506
  figsource: "Figsource",
3457
3507
  firstname: "Firstname",
3458
- footnote: "Footnote Marker",
3508
+ footnote: {
3509
+ default: "Footnote Marker",
3510
+ "end-ch-note": "Chapter Footnote Marker",
3511
+ "end-bk-note": "Book Footnote Marker"
3512
+ },
3459
3513
  footnoteno: "Footnote Number",
3460
3514
  honorific: "Honorific",
3461
3515
  img: "Image",
@@ -3521,9 +3575,24 @@ var ElementLabel = {
3521
3575
  chapter: "Chapter",
3522
3576
  dialogue: "Dialogue",
3523
3577
  epigraph: "Epigraph",
3524
- figure1: "Figure",
3525
- footnoteSection: "Footnote Section",
3526
- heading: "Heading",
3578
+ example: "Example",
3579
+ figure1: "Inline Figure",
3580
+ footnoteSection: {
3581
+ default: "Footnote Section",
3582
+ ch: "Chapter Footnote Section",
3583
+ bk: "Book Footnote Section"
3584
+ },
3585
+ heading: {
3586
+ default: "Heading",
3587
+ H0: "Heading +1",
3588
+ H1: "Heading 1",
3589
+ H2: "Heading 2",
3590
+ H3: "Heading 3",
3591
+ H4: "Heading 4",
3592
+ H5: "Heading 5",
3593
+ H6: "Heading 6",
3594
+ vignette_group: "Vignette Group"
3595
+ },
3527
3596
  imageobject: "Image Object",
3528
3597
  info1: "Info",
3529
3598
  keywordset: "Keyword FGroup",
@@ -3531,17 +3600,40 @@ var ElementLabel = {
3531
3600
  ol: "Ordered List",
3532
3601
  personname: "Person Name",
3533
3602
  poem: "Poem",
3534
- sidebar: "Box",
3603
+ sidebar: {
3604
+ default: "Box",
3605
+ box1: "Box 1",
3606
+ box2: "Box 2",
3607
+ box3: "Box 3",
3608
+ box4: "Box 4",
3609
+ box5: "Box 5"
3610
+ },
3535
3611
  table: "Table",
3536
- table1: "Table",
3612
+ table1: {
3613
+ default: "Table",
3614
+ inline: "Inline Table",
3615
+ float: "Floating Table"
3616
+ },
3537
3617
  tbody: "Table Body",
3538
3618
  td: "Table Data",
3539
3619
  tgroup: "Table Group",
3540
3620
  tr: "Table Row",
3541
3621
  ul: "Unordered List",
3542
- footnote1: "Footnote",
3622
+ footnote1: {
3623
+ default: "Footnote",
3624
+ "end-ch-note": "Chapter Footnote",
3625
+ "end-bk-note": "Book Footnote"
3626
+ },
3543
3627
  inlineequation: "Inline Equation",
3544
- link: "Link",
3628
+ link: {
3629
+ default: "Link",
3630
+ bibr: "Bibliography Link",
3631
+ table: "Table Link",
3632
+ figure: "Figure Link",
3633
+ equation: "Equation Link",
3634
+ footnote: "Footnote Link",
3635
+ chapter: "Chapter Link"
3636
+ },
3545
3637
  uri: "URI",
3546
3638
  phrase: "Phrase",
3547
3639
  abbreviation: "Abbreviation",
@@ -3549,6 +3641,13 @@ var ElementLabel = {
3549
3641
  em: "Emphasis",
3550
3642
  strong: "Strong"
3551
3643
  };
3644
+ var getElementLabel = (code, role) => {
3645
+ const label = ElementLabel[code];
3646
+ if (typeof label === "string") {
3647
+ return label;
3648
+ }
3649
+ return role && Object.prototype.hasOwnProperty.call(label, role) ? label[role] : label.default;
3650
+ };
3552
3651
 
3553
3652
  // src/schema/shared/dependentsForbiddenElements.ts
3554
3653
  var DEPENDENT_FORBIDDEN_ELEMENTS = [
@@ -3559,6 +3658,7 @@ var DEPENDENT_FORBIDDEN_ELEMENTS = [
3559
3658
  ];
3560
3659
 
3561
3660
  // src/helpers/isIgnoredElement.ts
3661
+ var DUMMY_SPAN_SELECTOR = "span#dummySpan";
3562
3662
  var IGNORED_ELEMENT_SELECTORS = [
3563
3663
  "span.rhlabel",
3564
3664
  "span.printlabel",
@@ -3567,7 +3667,7 @@ var IGNORED_ELEMENT_SELECTORS = [
3567
3667
  "span.ref-drag",
3568
3668
  "span.reference-type-label",
3569
3669
  "span.reference-validation-no-match",
3570
- "span#dummySpan"
3670
+ DUMMY_SPAN_SELECTOR
3571
3671
  ];
3572
3672
  var IGNORED_ELEMENT_SELECTOR = IGNORED_ELEMENT_SELECTORS.join(", ");
3573
3673
  var isIgnoredElement = (element) => element.tagName.toUpperCase() === "SPAN" && element.matches(IGNORED_ELEMENT_SELECTOR);
@@ -3895,8 +3995,14 @@ var validateRequiredChildren = (element, schema, childElements) => {
3895
3995
  );
3896
3996
  if (!hasChild) {
3897
3997
  const requiredChild = findSchemaByCode(allowedChild.code);
3898
- const elementLabel = ElementLabel[requiredChild.code];
3899
- const parentLabel = ElementLabel[schema.code];
3998
+ const elementLabel = getElementLabel(
3999
+ requiredChild.code,
4000
+ element.getAttribute("role")
4001
+ );
4002
+ const parentLabel = getElementLabel(
4003
+ schema.code,
4004
+ element.getAttribute("role")
4005
+ );
3900
4006
  const extraInstruction = getExtraInstruction(schema, requiredChild);
3901
4007
  const description = [
3902
4008
  `Please provide at least one ${elementLabel} in this ${parentLabel}.`,
@@ -3936,15 +4042,16 @@ var validateChildren = (element, schema) => {
3936
4042
  const childElements = getEffectiveChildElements(element, {
3937
4043
  includeDeleted: false
3938
4044
  });
3939
- if (schema.kind === "atom") {
4045
+ if (schema.kind === "atom" || schema.kind === "trackChanges") {
3940
4046
  return errors;
3941
4047
  }
3942
4048
  if (schema.allowsText === false && hasVisibleText(element)) {
4049
+ const label = getElementLabel(schema.code, element.getAttribute("role"));
3943
4050
  addValidationIssue(errors, element, {
3944
- title: `Text not allowed in ${ElementLabel[schema.code]}`,
4051
+ title: `Text not allowed in ${label}`,
3945
4052
  level: "warning",
3946
4053
  kind: "forbidden",
3947
- description: `A ${ElementLabel[schema.code]} holds only elements. Please tag or remove the text inside it.`,
4054
+ description: `A ${label} holds only elements. Please tag or remove the text inside it.`,
3948
4055
  elements: [element]
3949
4056
  });
3950
4057
  }
@@ -4451,7 +4558,10 @@ var isInWrongBibliomset = (field) => {
4451
4558
  const relation = field.closest(BIBLIOMSET)?.getAttribute("relation");
4452
4559
  return relation !== void 0 && !FIELD_BIBLIOMSETS[field.localName]?.some((owner) => owner === relation);
4453
4560
  };
4454
- var isEditorWrapper = (element) => element.tagName.toUpperCase() === "SPAN" || findSchemaByElement(element)?.kind === "atom";
4561
+ var isEditorWrapper = (element) => {
4562
+ const kind = findSchemaByElement(element)?.kind;
4563
+ return element.tagName.toUpperCase() === "SPAN" || kind === "atom" || kind === "trackChanges";
4564
+ };
4455
4565
  var getLiveChildren = (element) => Array.from(element.children).flatMap((child) => {
4456
4566
  if (!isLiveReferenceContent(child)) return [];
4457
4567
  return child.matches(INSERTION) || child.tagName.toUpperCase() === "SPAN" && !findSchemaByElement(child) ? getLiveChildren(child) : [child];
@@ -4843,6 +4953,28 @@ var validateReference = (reference) => {
4843
4953
  );
4844
4954
  };
4845
4955
 
4956
+ // src/validation/validateDummySpan.ts
4957
+ var validateDummySpan = (root) => {
4958
+ const placeholders = [];
4959
+ for (const dummySpan of root.querySelectorAll(DUMMY_SPAN_SELECTOR)) {
4960
+ const parentElement = dummySpan.parentElement;
4961
+ if (parentElement) {
4962
+ placeholders.push(parentElement);
4963
+ continue;
4964
+ }
4965
+ placeholders.push(root);
4966
+ }
4967
+ return placeholders.map(
4968
+ (holder) => createValidationIssue(holder, {
4969
+ title: "Placeholder element found",
4970
+ kind: "forbidden",
4971
+ description: "This element contains an empty placeholder. Type text into the placeholder or delete it.",
4972
+ level: "blocker",
4973
+ elements: [holder]
4974
+ })
4975
+ );
4976
+ };
4977
+
4846
4978
  // src/validation/validateXml.ts
4847
4979
  var ELEMENTS_PER_STEP = 64;
4848
4980
  var DEFAULT_TIME_BUDGET_MS = 8;
@@ -4900,6 +5032,7 @@ function* validateXmlSteps(xml, elementsToLink, linkElements, schemasToValidateA
4900
5032
  const errors = [];
4901
5033
  errors.push(...validateConsecutiveFootnotes(xml));
4902
5034
  errors.push(...validateConsecutiveFootnoteCues(xml));
5035
+ errors.push(...validateDummySpan(xml));
4903
5036
  yield;
4904
5037
  errors.push(...yield* validatePossibleWeblinksSteps(xml));
4905
5038
  yield* validateElements(xml, {
@@ -5033,10 +5166,11 @@ var getAdjacentElement = ({
5033
5166
  DOCBOOK_ELEMENT_LABELS,
5034
5167
  DOCBOOK_ELEMENT_NAMES,
5035
5168
  DOCBOOK_SCHEMAS,
5169
+ DUMMY_SPAN_SELECTOR,
5036
5170
  ELEMENT_SCHEMAS,
5037
5171
  ELE_ID_ATTRIBUTE,
5038
- ElementLabel,
5039
5172
  FIGURE_PLACEMENT_ATTRIBUTE,
5173
+ GROUP_SCHEMAS,
5040
5174
  ID_ATTRS,
5041
5175
  IGNORED_ATTRIBUTES,
5042
5176
  IGNORED_ATTRIBUTES_STARTS_WITH,
@@ -5085,6 +5219,7 @@ var getAdjacentElement = ({
5085
5219
  getAttributeName,
5086
5220
  getDocbookSchemaCode,
5087
5221
  getEffectiveChildElements,
5222
+ getElementLabel,
5088
5223
  getElementLinks,
5089
5224
  getPossibleWeblinks,
5090
5225
  getReferenceFieldElements,
@@ -5102,6 +5237,7 @@ var getAdjacentElement = ({
5102
5237
  validateAttributes,
5103
5238
  validateConsecutiveFootnoteCues,
5104
5239
  validateConsecutiveFootnotes,
5240
+ validateDummySpan,
5105
5241
  validateElementAgainstSchema,
5106
5242
  validateElementToLinkTo,
5107
5243
  validateFootnoteNumber,