pro-editor-schema 1.6.11 → 1.6.12-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.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,
@@ -2940,7 +2970,7 @@ var createDocbookSchema = (name) => {
2940
2970
  );
2941
2971
  return createSchema({
2942
2972
  code: getDocbookSchemaCode(name),
2943
- kind: "element",
2973
+ kind: text ? "element" : "group",
2944
2974
  tag: EDITOR_TAGS[name] ?? name.toUpperCase(),
2945
2975
  requiredAttributes: [],
2946
2976
  optionalAttributes: [
@@ -2971,6 +3001,7 @@ var BIBLIOMIXED_SCHEMA = DOCBOOK_SCHEMAS.referenceBibliomixed;
2971
3001
  var SCHEMAS = {
2972
3002
  ...ATOM_SCHEMAS,
2973
3003
  ...ELEMENT_SCHEMAS,
3004
+ ...GROUP_SCHEMAS,
2974
3005
  ...INLINE_ELEMENT_SCHEMAS,
2975
3006
  ...DOCBOOK_SCHEMAS
2976
3007
  };
@@ -3010,7 +3041,7 @@ var findSchemaByElement = (element) => getSchemasByTag().get(element.tagName.toU
3010
3041
  var isAttributeRestricted = (attr) => typeof attr !== "string";
3011
3042
 
3012
3043
  // src/schema/helpers/isTrackChangesSchema.ts
3013
- var isTrackChangesSchema = (schema) => schema.code === "insertion" || schema.code === "deletion" || schema.code === "lineGroupRemoval" || schema.code === "formatRemoval";
3044
+ var isTrackChangesSchema = (schema) => schema.kind === "trackChanges";
3014
3045
 
3015
3046
  // src/schema/referenceSchemas/referenceTypeSchemas.ts
3016
3047
  var LINK_FIELDS = ["doi", "url"];
@@ -3401,7 +3432,10 @@ var ElementLabel = {
3401
3432
  ...DOCBOOK_ELEMENT_LABELS,
3402
3433
  mark: "Mark",
3403
3434
  referenceBibliomixed: "Reference Bibliomixed",
3404
- referenceBibliography: "Reference Bibliography",
3435
+ referenceBibliography: {
3436
+ default: "Reference Bibliography",
3437
+ chapterend: "Chapter-End Reference Bibliography"
3438
+ },
3405
3439
  bibliodiv: "Bibliodiv",
3406
3440
  bibliomset: "Reference Block",
3407
3441
  editor: "Editor",
@@ -3429,7 +3463,11 @@ var ElementLabel = {
3429
3463
  tertiary: "Tertiary",
3430
3464
  quaternary: "Quaternary",
3431
3465
  bookmark: "Bookmark",
3432
- see: "Cross Reference",
3466
+ see: {
3467
+ default: "Cross Reference",
3468
+ see: "See",
3469
+ "see-also": "See Also"
3470
+ },
3433
3471
  commentQuerySection: "Comment/Query",
3434
3472
  comment: "Comment",
3435
3473
  content: "Content",
@@ -3438,7 +3476,13 @@ var ElementLabel = {
3438
3476
  deletion: "Deletion",
3439
3477
  lineGroupRemoval: "Line Group Removal",
3440
3478
  formatRemoval: "Formatting Removal",
3441
- emphasis: "Emphasis",
3479
+ emphasis: {
3480
+ default: "Emphasis",
3481
+ lowercase: "Lowercase",
3482
+ uppercase: "Uppercase",
3483
+ initialcaps: "Initial Caps",
3484
+ "Non breaking space": "Non-Breaking Space"
3485
+ },
3442
3486
  highlightmark: "Highlightmark",
3443
3487
  i: "Italic",
3444
3488
  insertion: "Insertion",
@@ -3455,7 +3499,11 @@ var ElementLabel = {
3455
3499
  fignote: "Fignote",
3456
3500
  figsource: "Figsource",
3457
3501
  firstname: "Firstname",
3458
- footnote: "Footnote Marker",
3502
+ footnote: {
3503
+ default: "Footnote Marker",
3504
+ "end-ch-note": "Chapter Footnote Marker",
3505
+ "end-bk-note": "Book Footnote Marker"
3506
+ },
3459
3507
  footnoteno: "Footnote Number",
3460
3508
  honorific: "Honorific",
3461
3509
  img: "Image",
@@ -3521,9 +3569,24 @@ var ElementLabel = {
3521
3569
  chapter: "Chapter",
3522
3570
  dialogue: "Dialogue",
3523
3571
  epigraph: "Epigraph",
3524
- figure1: "Figure",
3525
- footnoteSection: "Footnote Section",
3526
- heading: "Heading",
3572
+ example: "Example",
3573
+ figure1: "Inline Figure",
3574
+ footnoteSection: {
3575
+ default: "Footnote Section",
3576
+ ch: "Chapter Footnote Section",
3577
+ bk: "Book Footnote Section"
3578
+ },
3579
+ heading: {
3580
+ default: "Heading",
3581
+ H0: "Heading +1",
3582
+ H1: "Heading 1",
3583
+ H2: "Heading 2",
3584
+ H3: "Heading 3",
3585
+ H4: "Heading 4",
3586
+ H5: "Heading 5",
3587
+ H6: "Heading 6",
3588
+ vignette_group: "Vignette Group"
3589
+ },
3527
3590
  imageobject: "Image Object",
3528
3591
  info1: "Info",
3529
3592
  keywordset: "Keyword FGroup",
@@ -3531,17 +3594,40 @@ var ElementLabel = {
3531
3594
  ol: "Ordered List",
3532
3595
  personname: "Person Name",
3533
3596
  poem: "Poem",
3534
- sidebar: "Box",
3597
+ sidebar: {
3598
+ default: "Box",
3599
+ box1: "Box 1",
3600
+ box2: "Box 2",
3601
+ box3: "Box 3",
3602
+ box4: "Box 4",
3603
+ box5: "Box 5"
3604
+ },
3535
3605
  table: "Table",
3536
- table1: "Table",
3606
+ table1: {
3607
+ default: "Table",
3608
+ inline: "Inline Table",
3609
+ float: "Floating Table"
3610
+ },
3537
3611
  tbody: "Table Body",
3538
3612
  td: "Table Data",
3539
3613
  tgroup: "Table Group",
3540
3614
  tr: "Table Row",
3541
3615
  ul: "Unordered List",
3542
- footnote1: "Footnote",
3616
+ footnote1: {
3617
+ default: "Footnote",
3618
+ "end-ch-note": "Chapter Footnote",
3619
+ "end-bk-note": "Book Footnote"
3620
+ },
3543
3621
  inlineequation: "Inline Equation",
3544
- link: "Link",
3622
+ link: {
3623
+ default: "Link",
3624
+ bibr: "Bibliography Link",
3625
+ table: "Table Link",
3626
+ figure: "Figure Link",
3627
+ equation: "Equation Link",
3628
+ footnote: "Footnote Link",
3629
+ chapter: "Chapter Link"
3630
+ },
3545
3631
  uri: "URI",
3546
3632
  phrase: "Phrase",
3547
3633
  abbreviation: "Abbreviation",
@@ -3549,6 +3635,13 @@ var ElementLabel = {
3549
3635
  em: "Emphasis",
3550
3636
  strong: "Strong"
3551
3637
  };
3638
+ var getElementLabel = (code, role) => {
3639
+ const label = ElementLabel[code];
3640
+ if (typeof label === "string") {
3641
+ return label;
3642
+ }
3643
+ return role && Object.prototype.hasOwnProperty.call(label, role) ? label[role] : label.default;
3644
+ };
3552
3645
 
3553
3646
  // src/schema/shared/dependentsForbiddenElements.ts
3554
3647
  var DEPENDENT_FORBIDDEN_ELEMENTS = [
@@ -3559,6 +3652,7 @@ var DEPENDENT_FORBIDDEN_ELEMENTS = [
3559
3652
  ];
3560
3653
 
3561
3654
  // src/helpers/isIgnoredElement.ts
3655
+ var DUMMY_SPAN_SELECTOR = "span#dummySpan";
3562
3656
  var IGNORED_ELEMENT_SELECTORS = [
3563
3657
  "span.rhlabel",
3564
3658
  "span.printlabel",
@@ -3566,7 +3660,7 @@ var IGNORED_ELEMENT_SELECTORS = [
3566
3660
  "span.missLink",
3567
3661
  "span.ref-drag",
3568
3662
  "span.reference-type-label",
3569
- "span#dummySpan"
3663
+ DUMMY_SPAN_SELECTOR
3570
3664
  ];
3571
3665
  var IGNORED_ELEMENT_SELECTOR = IGNORED_ELEMENT_SELECTORS.join(", ");
3572
3666
  var isIgnoredElement = (element) => element.tagName.toUpperCase() === "SPAN" && element.matches(IGNORED_ELEMENT_SELECTOR);
@@ -3894,8 +3988,14 @@ var validateRequiredChildren = (element, schema, childElements) => {
3894
3988
  );
3895
3989
  if (!hasChild) {
3896
3990
  const requiredChild = findSchemaByCode(allowedChild.code);
3897
- const elementLabel = ElementLabel[requiredChild.code];
3898
- const parentLabel = ElementLabel[schema.code];
3991
+ const elementLabel = getElementLabel(
3992
+ requiredChild.code,
3993
+ element.getAttribute("role")
3994
+ );
3995
+ const parentLabel = getElementLabel(
3996
+ schema.code,
3997
+ element.getAttribute("role")
3998
+ );
3899
3999
  const extraInstruction = getExtraInstruction(schema, requiredChild);
3900
4000
  const description = [
3901
4001
  `Please provide at least one ${elementLabel} in this ${parentLabel}.`,
@@ -3935,15 +4035,16 @@ var validateChildren = (element, schema) => {
3935
4035
  const childElements = getEffectiveChildElements(element, {
3936
4036
  includeDeleted: false
3937
4037
  });
3938
- if (schema.kind === "atom") {
4038
+ if (schema.kind === "atom" || schema.kind === "trackChanges") {
3939
4039
  return errors;
3940
4040
  }
3941
4041
  if (schema.allowsText === false && hasVisibleText(element)) {
4042
+ const label = getElementLabel(schema.code, element.getAttribute("role"));
3942
4043
  addValidationIssue(errors, element, {
3943
- title: `Text not allowed in ${ElementLabel[schema.code]}`,
4044
+ title: `Text not allowed in ${label}`,
3944
4045
  level: "warning",
3945
4046
  kind: "forbidden",
3946
- description: `A ${ElementLabel[schema.code]} holds only elements. Please tag or remove the text inside it.`,
4047
+ description: `A ${label} holds only elements. Please tag or remove the text inside it.`,
3947
4048
  elements: [element]
3948
4049
  });
3949
4050
  }
@@ -4450,7 +4551,10 @@ var isInWrongBibliomset = (field) => {
4450
4551
  const relation = field.closest(BIBLIOMSET)?.getAttribute("relation");
4451
4552
  return relation !== void 0 && !FIELD_BIBLIOMSETS[field.localName]?.some((owner) => owner === relation);
4452
4553
  };
4453
- var isEditorWrapper = (element) => findSchemaByElement(element)?.kind === "atom";
4554
+ var isEditorWrapper = (element) => {
4555
+ const kind = findSchemaByElement(element)?.kind;
4556
+ return kind === "atom" || kind === "trackChanges";
4557
+ };
4454
4558
  var getLiveChildren = (element) => Array.from(element.children).flatMap((child) => {
4455
4559
  if (!isLiveReferenceContent(child)) return [];
4456
4560
  return child.matches(INSERTION) ? getLiveChildren(child) : [child];
@@ -4838,6 +4942,28 @@ var validateReference = (reference) => {
4838
4942
  );
4839
4943
  };
4840
4944
 
4945
+ // src/validation/validateDummySpan.ts
4946
+ var validateDummySpan = (root) => {
4947
+ const placeholders = [];
4948
+ for (const dummySpan of root.querySelectorAll(DUMMY_SPAN_SELECTOR)) {
4949
+ const parentElement = dummySpan.parentElement;
4950
+ if (parentElement) {
4951
+ placeholders.push(parentElement);
4952
+ continue;
4953
+ }
4954
+ placeholders.push(root);
4955
+ }
4956
+ return placeholders.map(
4957
+ (holder) => createValidationIssue(holder, {
4958
+ title: "Placeholder element found",
4959
+ kind: "forbidden",
4960
+ description: "This element contains an empty placeholder. Type text into the placeholder or delete it.",
4961
+ level: "blocker",
4962
+ elements: [holder]
4963
+ })
4964
+ );
4965
+ };
4966
+
4841
4967
  // src/validation/validateXml.ts
4842
4968
  var ELEMENTS_PER_STEP = 64;
4843
4969
  var DEFAULT_TIME_BUDGET_MS = 8;
@@ -4895,6 +5021,7 @@ function* validateXmlSteps(xml, elementsToLink, linkElements, schemasToValidateA
4895
5021
  const errors = [];
4896
5022
  errors.push(...validateConsecutiveFootnotes(xml));
4897
5023
  errors.push(...validateConsecutiveFootnoteCues(xml));
5024
+ errors.push(...validateDummySpan(xml));
4898
5025
  yield;
4899
5026
  errors.push(...yield* validatePossibleWeblinksSteps(xml));
4900
5027
  yield* validateElements(xml, {
@@ -5028,10 +5155,11 @@ var getAdjacentElement = ({
5028
5155
  DOCBOOK_ELEMENT_LABELS,
5029
5156
  DOCBOOK_ELEMENT_NAMES,
5030
5157
  DOCBOOK_SCHEMAS,
5158
+ DUMMY_SPAN_SELECTOR,
5031
5159
  ELEMENT_SCHEMAS,
5032
5160
  ELE_ID_ATTRIBUTE,
5033
- ElementLabel,
5034
5161
  FIGURE_PLACEMENT_ATTRIBUTE,
5162
+ GROUP_SCHEMAS,
5035
5163
  ID_ATTRS,
5036
5164
  IGNORED_ATTRIBUTES,
5037
5165
  IGNORED_ATTRIBUTES_STARTS_WITH,
@@ -5080,6 +5208,7 @@ var getAdjacentElement = ({
5080
5208
  getAttributeName,
5081
5209
  getDocbookSchemaCode,
5082
5210
  getEffectiveChildElements,
5211
+ getElementLabel,
5083
5212
  getElementLinks,
5084
5213
  getPossibleWeblinks,
5085
5214
  getReferenceFieldElements,
@@ -5097,6 +5226,7 @@ var getAdjacentElement = ({
5097
5226
  validateAttributes,
5098
5227
  validateConsecutiveFootnoteCues,
5099
5228
  validateConsecutiveFootnotes,
5229
+ validateDummySpan,
5100
5230
  validateElementAgainstSchema,
5101
5231
  validateElementToLinkTo,
5102
5232
  validateFootnoteNumber,