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.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: [],
@@ -1007,7 +1011,11 @@ var LINE_SCHEMA = createSchema({
1007
1011
  optionalAttributes: ["role"],
1008
1012
  allowedChildrenCodes: [
1009
1013
  ...ATOM_CODES_ALLOWED_CHILDREN,
1010
- ...INLINE_ELEMENT_CODES_ALLOWED_CHILDREN
1014
+ ...INLINE_ELEMENT_CODES_ALLOWED_CHILDREN,
1015
+ // Typesetting accepts a fixed or floating figure anchored inside a poem
1016
+ // or dialogue line, so it stays where the author placed it.
1017
+ { code: "informalfigure", required: false },
1018
+ { code: "figure1", required: false }
1011
1019
  ]
1012
1020
  });
1013
1021
 
@@ -1024,7 +1032,7 @@ var SPEAKER_SCHEMA = createSchema({
1024
1032
  // src/schema/elementSchemas/elements/dialogue/dialogue.ts
1025
1033
  var DIALOGUE_SCHEMA = createSchema({
1026
1034
  code: "dialogue",
1027
- kind: "element",
1035
+ kind: "group",
1028
1036
  tag: DIALOGUE_TAG,
1029
1037
  requiredAttributes: [...ID_ATTRS],
1030
1038
  optionalAttributes: [...TRACK_CHANGES_ATTRS, "role", "trackmsg"],
@@ -1038,7 +1046,7 @@ var DIALOGUE_SCHEMA = createSchema({
1038
1046
  // src/schema/elementSchemas/elements/equation/equation.ts
1039
1047
  var EQUATION_SCHEMA = createSchema({
1040
1048
  code: "equation",
1041
- kind: "element",
1049
+ kind: "group",
1042
1050
  tag: EQUATION_TAG,
1043
1051
  requiredAttributes: [...ID_ATTRS],
1044
1052
  optionalAttributes: [
@@ -1409,7 +1417,7 @@ var IMG_SCHEMA = createSchema({
1409
1417
  // src/schema/elementSchemas/elements/figure/alttext.ts
1410
1418
  var ALTTEXT_SCHEMA = createSchema({
1411
1419
  code: "alttext",
1412
- kind: "element",
1420
+ kind: "group",
1413
1421
  tag: ALTTEXT_TAG,
1414
1422
  requiredAttributes: [],
1415
1423
  optionalAttributes: [],
@@ -1419,7 +1427,7 @@ var ALTTEXT_SCHEMA = createSchema({
1419
1427
  // src/schema/elementSchemas/elements/figure/imageobject.ts
1420
1428
  var IMAGEOBJECT_SCHEMA = createSchema({
1421
1429
  code: "imageobject",
1422
- kind: "element",
1430
+ kind: "group",
1423
1431
  tag: IMAGEOBJECT_TAG,
1424
1432
  requiredAttributes: [...ID_ATTRS],
1425
1433
  optionalAttributes: [],
@@ -1432,7 +1440,7 @@ var IMAGEOBJECT_SCHEMA = createSchema({
1432
1440
  // src/schema/elementSchemas/elements/figure/mediaobject.ts
1433
1441
  var MEDIAOBJECT_SCHEMA = createSchema({
1434
1442
  code: "mediaobject",
1435
- kind: "element",
1443
+ kind: "group",
1436
1444
  tag: MEDIAOBJECT_TAG,
1437
1445
  requiredAttributes: [...ID_ATTRS],
1438
1446
  optionalAttributes: [...TRACK_CHANGES_ATTRS],
@@ -1442,7 +1450,7 @@ var MEDIAOBJECT_SCHEMA = createSchema({
1442
1450
  // src/schema/elementSchemas/elements/figure/caption1.ts
1443
1451
  var CAPTION_SCHEMA = createSchema({
1444
1452
  code: "caption1",
1445
- kind: "element",
1453
+ kind: "group",
1446
1454
  tag: CAPTION_TAG,
1447
1455
  requiredAttributes: [...ID_ATTRS],
1448
1456
  optionalAttributes: [],
@@ -1478,7 +1486,7 @@ var FIGNOTE_SCHEMA = createSchema({
1478
1486
  // src/schema/elementSchemas/elements/figure/figure.ts
1479
1487
  var FIGURE_SCHEMA = createSchema({
1480
1488
  code: "figure1",
1481
- kind: "element",
1489
+ kind: "group",
1482
1490
  tag: FIGURE_TAG,
1483
1491
  requiredAttributes: [...ID_ATTRS, "xmlid"],
1484
1492
  optionalAttributes: [
@@ -1491,6 +1499,8 @@ var FIGURE_SCHEMA = createSchema({
1491
1499
  allowedChildrenCodes: [
1492
1500
  { code: "mediaobject", required: false },
1493
1501
  { code: "label1", required: false },
1502
+ // The editor separates the label from the caption with <punc type="caption-seperator">.
1503
+ { code: "punc", required: false },
1494
1504
  { code: "caption1", required: false },
1495
1505
  { code: "figsource", required: false },
1496
1506
  { code: "fignote", required: false }
@@ -1500,7 +1510,7 @@ var FIGURE_SCHEMA = createSchema({
1500
1510
  // src/schema/elementSchemas/elements/footnote.ts
1501
1511
  var FOOTNOTE_SCHEMA = createSchema({
1502
1512
  code: "footnote",
1503
- kind: "element",
1513
+ kind: "group",
1504
1514
  tag: FOOTNOTE_TAG,
1505
1515
  requiredAttributes: [
1506
1516
  ...ID_ATTRS,
@@ -1533,7 +1543,7 @@ var FOOTNOTE_NUMBER_SCHEMA = createSchema({
1533
1543
  // src/schema/elementSchemas/elements/informalfigure.ts
1534
1544
  var INFORMALFIGURE_SCHEMA = createSchema({
1535
1545
  code: "informalfigure",
1536
- kind: "element",
1546
+ kind: "group",
1537
1547
  tag: INFORMALFIGURE_TAG,
1538
1548
  requiredAttributes: [...ID_ATTRS],
1539
1549
  optionalAttributes: [...TRACK_CHANGES_ATTRS, "data-anchor-id"],
@@ -1546,7 +1556,7 @@ var INFORMALFIGURE_SCHEMA = createSchema({
1546
1556
  // src/schema/elementSchemas/elements/keywords/keywordset.ts
1547
1557
  var KEYWORDSET_SCHEMA = createSchema({
1548
1558
  code: "keywordset",
1549
- kind: "element",
1559
+ kind: "group",
1550
1560
  tag: KEYWORDSET_TAG,
1551
1561
  requiredAttributes: [
1552
1562
  ...ID_ATTRS,
@@ -1610,7 +1620,7 @@ var LABEL_SCHEMA = createSchema({
1610
1620
  // src/schema/elementSchemas/elements/lineGroup.ts
1611
1621
  var LINE_GROUP_SCHEMA = createSchema({
1612
1622
  code: "linegroup",
1613
- kind: "element",
1623
+ kind: "group",
1614
1624
  tag: LINE_GROUP_TAG,
1615
1625
  requiredAttributes: [...ID_ATTRS],
1616
1626
  optionalAttributes: [
@@ -1665,7 +1675,7 @@ var LI_SCHEMA = createSchema({
1665
1675
  // src/schema/elementSchemas/elements/list/ol.ts
1666
1676
  var OL_SCHEMA = createSchema({
1667
1677
  code: "ol",
1668
- kind: "element",
1678
+ kind: "group",
1669
1679
  tag: OL_TAG,
1670
1680
  requiredAttributes: [...ID_ATTRS],
1671
1681
  optionalAttributes: [
@@ -1702,7 +1712,7 @@ var OL_SCHEMA = createSchema({
1702
1712
  // src/schema/elementSchemas/elements/list/ul.ts
1703
1713
  var UL_SCHEMA = createSchema({
1704
1714
  code: "ul",
1705
- kind: "element",
1715
+ kind: "group",
1706
1716
  tag: UL_TAG,
1707
1717
  requiredAttributes: [...ID_ATTRS],
1708
1718
  optionalAttributes: [
@@ -1858,7 +1868,7 @@ var TP_SCHEMA = createSchema({
1858
1868
  // src/schema/elementSchemas/elements/table/td.ts
1859
1869
  var TD_SCHEMA = createSchema({
1860
1870
  code: "td",
1861
- kind: "element",
1871
+ kind: "group",
1862
1872
  tag: TD_TAG,
1863
1873
  requiredAttributes: [...ID_ATTRS],
1864
1874
  optionalAttributes: [
@@ -1876,7 +1886,7 @@ var TD_SCHEMA = createSchema({
1876
1886
  // src/schema/elementSchemas/elements/table/tr.ts
1877
1887
  var TR_SCHEMA = createSchema({
1878
1888
  code: "tr",
1879
- kind: "element",
1889
+ kind: "group",
1880
1890
  tag: TR_TAG,
1881
1891
  requiredAttributes: [],
1882
1892
  optionalAttributes: [...LAYOUT_ATTRIBUTES, ...ID_ATTRS, "width"],
@@ -1886,7 +1896,7 @@ var TR_SCHEMA = createSchema({
1886
1896
  // src/schema/elementSchemas/elements/table/thead.ts
1887
1897
  var THEAD_SCHEMA = createSchema({
1888
1898
  code: "thead",
1889
- kind: "element",
1899
+ kind: "group",
1890
1900
  tag: THEAD_TAG,
1891
1901
  requiredAttributes: [],
1892
1902
  optionalAttributes: [...ID_ATTRS],
@@ -1896,7 +1906,7 @@ var THEAD_SCHEMA = createSchema({
1896
1906
  // src/schema/elementSchemas/elements/table/tbody.ts
1897
1907
  var TBODY_SCHEMA = createSchema({
1898
1908
  code: "tbody",
1899
- kind: "element",
1909
+ kind: "group",
1900
1910
  tag: TBODY_TAG,
1901
1911
  requiredAttributes: [],
1902
1912
  optionalAttributes: [...ID_ATTRS],
@@ -1906,7 +1916,7 @@ var TBODY_SCHEMA = createSchema({
1906
1916
  // src/schema/elementSchemas/elements/table/htmlTable.ts
1907
1917
  var HTML_TABLE_SCHEMA = createSchema({
1908
1918
  code: "table",
1909
- kind: "element",
1919
+ kind: "group",
1910
1920
  tag: HTML_TABLE_TAG,
1911
1921
  requiredAttributes: [],
1912
1922
  optionalAttributes: [...ID_ATTRS],
@@ -1919,7 +1929,7 @@ var HTML_TABLE_SCHEMA = createSchema({
1919
1929
  // src/schema/elementSchemas/elements/table/tgroup.ts
1920
1930
  var TGROUP_SCHEMA = createSchema({
1921
1931
  code: "tgroup",
1922
- kind: "element",
1932
+ kind: "group",
1923
1933
  tag: TGROUP_TAG,
1924
1934
  requiredAttributes: [...ID_ATTRS, "cols"],
1925
1935
  optionalAttributes: [],
@@ -1952,7 +1962,7 @@ var TBLSOURCE_SCHEMA = createSchema({
1952
1962
  // src/schema/elementSchemas/elements/table/table1.ts
1953
1963
  var TABLE_SCHEMA = createSchema({
1954
1964
  code: "table1",
1955
- kind: "element",
1965
+ kind: "group",
1956
1966
  tag: TABLE_TAG,
1957
1967
  requiredAttributes: [
1958
1968
  ...ID_ATTRS,
@@ -1987,7 +1997,7 @@ var HEADING_LEVEL = ["H0", "H1", "H2", "H3", "H4", "H5", "H6"];
1987
1997
  var HEADING_ROLES = [...HEADING_LEVEL, "vignette_group"];
1988
1998
  var HEADING_SCHEMA = createSchema({
1989
1999
  code: "heading",
1990
- kind: "element",
2000
+ kind: "group",
1991
2001
  tag: SECTION_TAG,
1992
2002
  matchesElement: (element) => {
1993
2003
  const role = element.getAttribute("role");
@@ -2013,6 +2023,7 @@ var HEADING_SCHEMA = createSchema({
2013
2023
  { code: "sidebar", required: false },
2014
2024
  { code: "epigraph", required: false },
2015
2025
  { code: "blockquote", required: false },
2026
+ { code: "example", required: false },
2016
2027
  { code: "ul", required: false },
2017
2028
  { code: "ol", required: false },
2018
2029
  { code: "poem", required: false },
@@ -2031,7 +2042,7 @@ var HEADING_SCHEMA = createSchema({
2031
2042
  var BOX_LEVEL = ["box1", "box2", "box3", "box4", "box5"];
2032
2043
  var BOX_SCHEMA = createSchema({
2033
2044
  code: "sidebar",
2034
- kind: "element",
2045
+ kind: "group",
2035
2046
  tag: SIDEBAR_TAG,
2036
2047
  requiredAttributes: [
2037
2048
  ...ID_ATTRS,
@@ -2088,7 +2099,7 @@ var TITLE_SCHEMA = createSchema({
2088
2099
  // src/schema/elementSchemas/elements/abstract.ts
2089
2100
  var ABSTRACT_SCHEMA = createSchema({
2090
2101
  code: "abstract1",
2091
- kind: "element",
2102
+ kind: "group",
2092
2103
  tag: ABSTRACT_TAG,
2093
2104
  requiredAttributes: [
2094
2105
  ...ID_ATTRS,
@@ -2118,7 +2129,7 @@ var ABSTRACT_SCHEMA = createSchema({
2118
2129
  // src/schema/elementSchemas/elements/appendix.ts
2119
2130
  var APPENDIX_SCHEMA = createSchema({
2120
2131
  code: "appendix",
2121
- kind: "element",
2132
+ kind: "group",
2122
2133
  tag: APPENDIX_TAG,
2123
2134
  requiredAttributes: [...ID_ATTRS, "id", "xmlid"],
2124
2135
  optionalAttributes: [...TRACK_CHANGES_ATTRS],
@@ -2133,7 +2144,7 @@ var APPENDIX_SCHEMA = createSchema({
2133
2144
  // src/schema/elementSchemas/elements/blockquote.ts
2134
2145
  var BLOCKQUOTE_SCHEMA = createSchema({
2135
2146
  code: "blockquote",
2136
- kind: "element",
2147
+ kind: "group",
2137
2148
  tag: BLOCKQUOTE_TAG,
2138
2149
  requiredAttributes: [...ID_ATTRS],
2139
2150
  optionalAttributes: [
@@ -2183,6 +2194,7 @@ var CHAPTER_SCHEMA = createSchema({
2183
2194
  { code: "sidebar", required: false },
2184
2195
  { code: "epigraph", required: false },
2185
2196
  { code: "blockquote", required: false },
2197
+ { code: "example", required: false },
2186
2198
  { code: "ul", required: false },
2187
2199
  { code: "ol", required: false },
2188
2200
  { code: "subtitle1", required: false },
@@ -2198,7 +2210,7 @@ var CHAPTER_SCHEMA = createSchema({
2198
2210
  // src/schema/elementSchemas/elements/epigraph.ts
2199
2211
  var EPIGRAPH_SCHEMA = createSchema({
2200
2212
  code: "epigraph",
2201
- kind: "element",
2213
+ kind: "group",
2202
2214
  tag: EPIGRAPH_TAG,
2203
2215
  requiredAttributes: [...ID_ATTRS],
2204
2216
  optionalAttributes: [
@@ -2217,11 +2229,32 @@ var EPIGRAPH_SCHEMA = createSchema({
2217
2229
  ]
2218
2230
  });
2219
2231
 
2232
+ // src/schema/elementSchemas/elements/example.ts
2233
+ var EXAMPLE_SCHEMA = createSchema({
2234
+ code: "example",
2235
+ kind: "element",
2236
+ tag: EXAMPLE_TAG,
2237
+ requiredAttributes: [...ID_ATTRS],
2238
+ optionalAttributes: [
2239
+ ...TRACK_CHANGES_ATTRS,
2240
+ "xmlid",
2241
+ "track-code",
2242
+ "element-change-description"
2243
+ ],
2244
+ defaultChildCode: "para",
2245
+ allowedChildrenCodes: [
2246
+ { code: "para", required: false },
2247
+ { code: "ul", required: false },
2248
+ { code: "ol", required: false },
2249
+ { code: "tag", required: false }
2250
+ ]
2251
+ });
2252
+
2220
2253
  // src/schema/elementSchemas/elements/footnoteSection.ts
2221
2254
  var FOOTNOTE_SECTION_ROLES = ["ch", "bk"];
2222
2255
  var FOOTNOTE_SECTION_SCHEMA = createSchema({
2223
2256
  code: "footnoteSection",
2224
- kind: "element",
2257
+ kind: "group",
2225
2258
  tag: SECTION_TAG,
2226
2259
  matchesElement: (element) => {
2227
2260
  const role = element.getAttribute("role");
@@ -2247,7 +2280,7 @@ var FOOTNOTE_SECTION_SCHEMA = createSchema({
2247
2280
  // src/schema/elementSchemas/elements/info.ts
2248
2281
  var INFO_SCHEMA = createSchema({
2249
2282
  code: "info1",
2250
- kind: "element",
2283
+ kind: "group",
2251
2284
  tag: INFO_TAG,
2252
2285
  requiredAttributes: [...ID_ATTRS],
2253
2286
  optionalAttributes: [],
@@ -2265,7 +2298,7 @@ var INFO_SCHEMA = createSchema({
2265
2298
  // src/schema/elementSchemas/elements/poem.ts
2266
2299
  var POEM_SCHEMA = createSchema({
2267
2300
  code: "poem",
2268
- kind: "element",
2301
+ kind: "group",
2269
2302
  tag: POEM_TAG,
2270
2303
  requiredAttributes: [...ID_ATTRS],
2271
2304
  optionalAttributes: [...TRACK_CHANGES_ATTRS, "role", "trackmsg"],
@@ -2291,7 +2324,7 @@ var MATHPHRASE_SCHEMA = createSchema({
2291
2324
  // src/schema/elementSchemas/elements/reference/bibliography.ts
2292
2325
  var REFERENCE_BIBLIOGRAPHY_SCHEMA = createSchema({
2293
2326
  code: "referenceBibliography",
2294
- kind: "element",
2327
+ kind: "group",
2295
2328
  tag: REFERENCE_BIBLIOGRAPHY_TAG,
2296
2329
  requiredAttributes: [
2297
2330
  ...ID_ATTRS,
@@ -2319,7 +2352,7 @@ var REFERENCE_BIBLIOGRAPHY_SCHEMA = createSchema({
2319
2352
  // src/schema/elementSchemas/elements/reference/bibliodiv.ts
2320
2353
  var BIBLIODIV_SCHEMA = createSchema({
2321
2354
  code: "bibliodiv",
2322
- kind: "element",
2355
+ kind: "group",
2323
2356
  tag: BIBLIODIV_TAG,
2324
2357
  requiredAttributes: [
2325
2358
  ...ID_ATTRS,
@@ -2398,14 +2431,11 @@ var LEGAL_REFERENCE_BIBLIOMISC_ROLE = "legalRef";
2398
2431
 
2399
2432
  // src/schema/elementSchemas/elements/index.ts
2400
2433
  var ELEMENT_SCHEMAS = {
2401
- bibliodiv: BIBLIODIV_SCHEMA,
2402
- referenceBibliography: REFERENCE_BIBLIOGRAPHY_SCHEMA,
2403
2434
  translator: TRANSLATOR_SCHEMA,
2404
2435
  pagenum: PAGENUM_SCHEMA,
2405
2436
  pubId: PUB_ID_SCHEMA,
2406
2437
  para: PARA_SCHEMA,
2407
2438
  title1: TITLE_SCHEMA,
2408
- footnote: FOOTNOTE_SCHEMA,
2409
2439
  footnoteno: FOOTNOTE_NUMBER_SCHEMA,
2410
2440
  olink: OLINK_SCHEMA,
2411
2441
  firstname: FIRSTNAME_SCHEMA,
@@ -2413,13 +2443,9 @@ var ELEMENT_SCHEMAS = {
2413
2443
  honorific: HONORIFIC_SCHEMA,
2414
2444
  orgname: ORGNAME_SCHEMA,
2415
2445
  email: EMAIL_SCHEMA,
2416
- org: ORG_SCHEMA,
2417
2446
  degrees: DEGREES_SCHEMA,
2418
- dialogue: DIALOGUE_SCHEMA,
2419
2447
  line: LINE_SCHEMA,
2420
- linegroup: LINE_GROUP_SCHEMA,
2421
2448
  speaker: SPEAKER_SCHEMA,
2422
- equation: EQUATION_SCHEMA,
2423
2449
  math: MATH_SCHEMA,
2424
2450
  mathphrase: MATHPHRASE_SCHEMA,
2425
2451
  merror: MERROR_SCHEMA,
@@ -2448,27 +2474,40 @@ var ELEMENT_SCHEMAS = {
2448
2474
  munder: MUNDER_SCHEMA,
2449
2475
  munderover: MUNDEROVER_SCHEMA,
2450
2476
  img: IMG_SCHEMA,
2451
- alttext: ALTTEXT_SCHEMA,
2452
- imageobject: IMAGEOBJECT_SCHEMA,
2453
- mediaobject: MEDIAOBJECT_SCHEMA,
2454
- caption1: CAPTION_SCHEMA,
2455
2477
  figsource: FIGSOURCE_SCHEMA,
2456
2478
  fignote: FIGNOTE_SCHEMA,
2457
- figure1: FIGURE_SCHEMA,
2458
- informalfigure: INFORMALFIGURE_SCHEMA,
2459
- keywordset: KEYWORDSET_SCHEMA,
2460
2479
  keyword: KEYWORD_SCHEMA,
2461
2480
  punc: PUNC_SCHEMA,
2462
2481
  label1: LABEL_SCHEMA,
2463
2482
  li: LI_SCHEMA,
2464
- ol: OL_SCHEMA,
2465
- ul: UL_SCHEMA,
2466
2483
  token: TOKEN_SCHEMA,
2467
2484
  tag: TAG_SCHEMA,
2468
2485
  lrh: LRH_SCHEMA,
2469
2486
  rrh: RRH_SCHEMA,
2470
2487
  source1: SOURCE_SCHEMA,
2471
2488
  subtitle1: SUBTITLE_SCHEMA,
2489
+ tp: TP_SCHEMA,
2490
+ tblfn: TBLFN_SCHEMA,
2491
+ tblsource: TBLSOURCE_SCHEMA,
2492
+ chapter: CHAPTER_SCHEMA
2493
+ };
2494
+ var GROUP_SCHEMAS = {
2495
+ bibliodiv: BIBLIODIV_SCHEMA,
2496
+ referenceBibliography: REFERENCE_BIBLIOGRAPHY_SCHEMA,
2497
+ footnote: FOOTNOTE_SCHEMA,
2498
+ org: ORG_SCHEMA,
2499
+ dialogue: DIALOGUE_SCHEMA,
2500
+ linegroup: LINE_GROUP_SCHEMA,
2501
+ equation: EQUATION_SCHEMA,
2502
+ alttext: ALTTEXT_SCHEMA,
2503
+ imageobject: IMAGEOBJECT_SCHEMA,
2504
+ mediaobject: MEDIAOBJECT_SCHEMA,
2505
+ caption1: CAPTION_SCHEMA,
2506
+ figure1: FIGURE_SCHEMA,
2507
+ informalfigure: INFORMALFIGURE_SCHEMA,
2508
+ keywordset: KEYWORDSET_SCHEMA,
2509
+ ol: OL_SCHEMA,
2510
+ ul: UL_SCHEMA,
2472
2511
  table1: TABLE_SCHEMA,
2473
2512
  tgroup: TGROUP_SCHEMA,
2474
2513
  table: HTML_TABLE_SCHEMA,
@@ -2476,15 +2515,12 @@ var ELEMENT_SCHEMAS = {
2476
2515
  tbody: TBODY_SCHEMA,
2477
2516
  tr: TR_SCHEMA,
2478
2517
  td: TD_SCHEMA,
2479
- tp: TP_SCHEMA,
2480
- tblfn: TBLFN_SCHEMA,
2481
- tblsource: TBLSOURCE_SCHEMA,
2482
2518
  heading: HEADING_SCHEMA,
2483
2519
  footnoteSection: FOOTNOTE_SECTION_SCHEMA,
2484
- chapter: CHAPTER_SCHEMA,
2485
2520
  info1: INFO_SCHEMA,
2486
2521
  abstract1: ABSTRACT_SCHEMA,
2487
2522
  epigraph: EPIGRAPH_SCHEMA,
2523
+ example: EXAMPLE_SCHEMA,
2488
2524
  poem: POEM_SCHEMA,
2489
2525
  blockquote: BLOCKQUOTE_SCHEMA,
2490
2526
  sidebar: BOX_SCHEMA,
@@ -2597,7 +2633,13 @@ var PHRASE_SCHEMA = createSchema({
2597
2633
  tag: PHRASE_TAG,
2598
2634
  requiredAttributes: [...ID_ATTRS, "xml:lang"],
2599
2635
  optionalAttributes: [],
2600
- allowedChildrenCodes: [...ATOM_CODES_ALLOWED_CHILDREN]
2636
+ allowedChildrenCodes: [
2637
+ ...ATOM_CODES_ALLOWED_CHILDREN,
2638
+ // DocBook lets a phrase hold footnotes and links, so a language phrase
2639
+ // can span a sentence that carries a footnote call-out or a citation.
2640
+ { code: "footnote1", required: false },
2641
+ { code: "link", required: false }
2642
+ ]
2601
2643
  });
2602
2644
 
2603
2645
  // src/schema/elementSchemas/inlineElements/index.ts
@@ -2940,7 +2982,7 @@ var createDocbookSchema = (name) => {
2940
2982
  );
2941
2983
  return createSchema({
2942
2984
  code: getDocbookSchemaCode(name),
2943
- kind: "element",
2985
+ kind: text ? "element" : "group",
2944
2986
  tag: EDITOR_TAGS[name] ?? name.toUpperCase(),
2945
2987
  requiredAttributes: [],
2946
2988
  optionalAttributes: [
@@ -2971,6 +3013,7 @@ var BIBLIOMIXED_SCHEMA = DOCBOOK_SCHEMAS.referenceBibliomixed;
2971
3013
  var SCHEMAS = {
2972
3014
  ...ATOM_SCHEMAS,
2973
3015
  ...ELEMENT_SCHEMAS,
3016
+ ...GROUP_SCHEMAS,
2974
3017
  ...INLINE_ELEMENT_SCHEMAS,
2975
3018
  ...DOCBOOK_SCHEMAS
2976
3019
  };
@@ -3010,7 +3053,7 @@ var findSchemaByElement = (element) => getSchemasByTag().get(element.tagName.toU
3010
3053
  var isAttributeRestricted = (attr) => typeof attr !== "string";
3011
3054
 
3012
3055
  // src/schema/helpers/isTrackChangesSchema.ts
3013
- var isTrackChangesSchema = (schema) => schema.code === "insertion" || schema.code === "deletion" || schema.code === "lineGroupRemoval" || schema.code === "formatRemoval";
3056
+ var isTrackChangesSchema = (schema) => schema.kind === "trackChanges";
3014
3057
 
3015
3058
  // src/schema/referenceSchemas/referenceTypeSchemas.ts
3016
3059
  var LINK_FIELDS = ["doi", "url"];
@@ -3401,7 +3444,10 @@ var ElementLabel = {
3401
3444
  ...DOCBOOK_ELEMENT_LABELS,
3402
3445
  mark: "Mark",
3403
3446
  referenceBibliomixed: "Reference Bibliomixed",
3404
- referenceBibliography: "Reference Bibliography",
3447
+ referenceBibliography: {
3448
+ default: "Reference Bibliography",
3449
+ chapterend: "Chapter-End Reference Bibliography"
3450
+ },
3405
3451
  bibliodiv: "Bibliodiv",
3406
3452
  bibliomset: "Reference Block",
3407
3453
  editor: "Editor",
@@ -3429,7 +3475,11 @@ var ElementLabel = {
3429
3475
  tertiary: "Tertiary",
3430
3476
  quaternary: "Quaternary",
3431
3477
  bookmark: "Bookmark",
3432
- see: "Cross Reference",
3478
+ see: {
3479
+ default: "Cross Reference",
3480
+ see: "See",
3481
+ "see-also": "See Also"
3482
+ },
3433
3483
  commentQuerySection: "Comment/Query",
3434
3484
  comment: "Comment",
3435
3485
  content: "Content",
@@ -3438,7 +3488,13 @@ var ElementLabel = {
3438
3488
  deletion: "Deletion",
3439
3489
  lineGroupRemoval: "Line Group Removal",
3440
3490
  formatRemoval: "Formatting Removal",
3441
- emphasis: "Emphasis",
3491
+ emphasis: {
3492
+ default: "Emphasis",
3493
+ lowercase: "Lowercase",
3494
+ uppercase: "Uppercase",
3495
+ initialcaps: "Initial Caps",
3496
+ "Non breaking space": "Non-Breaking Space"
3497
+ },
3442
3498
  highlightmark: "Highlightmark",
3443
3499
  i: "Italic",
3444
3500
  insertion: "Insertion",
@@ -3455,11 +3511,15 @@ var ElementLabel = {
3455
3511
  fignote: "Fignote",
3456
3512
  figsource: "Figsource",
3457
3513
  firstname: "Firstname",
3458
- footnote: "Footnote Marker",
3514
+ footnote: {
3515
+ default: "Footnote Marker",
3516
+ "end-ch-note": "Chapter Footnote Marker",
3517
+ "end-bk-note": "Book Footnote Marker"
3518
+ },
3459
3519
  footnoteno: "Footnote Number",
3460
3520
  honorific: "Honorific",
3461
3521
  img: "Image",
3462
- informalfigure: "Floating Figure",
3522
+ informalfigure: "Inline Figure",
3463
3523
  keyword: "Keyword",
3464
3524
  label1: "Label",
3465
3525
  li: "List Item",
@@ -3521,9 +3581,24 @@ var ElementLabel = {
3521
3581
  chapter: "Chapter",
3522
3582
  dialogue: "Dialogue",
3523
3583
  epigraph: "Epigraph",
3524
- figure1: "Figure",
3525
- footnoteSection: "Footnote Section",
3526
- heading: "Heading",
3584
+ example: "Example",
3585
+ figure1: "Display Figure",
3586
+ footnoteSection: {
3587
+ default: "Footnote Section",
3588
+ ch: "Chapter Footnote Section",
3589
+ bk: "Book Footnote Section"
3590
+ },
3591
+ heading: {
3592
+ default: "Heading",
3593
+ H0: "Heading +1",
3594
+ H1: "Heading 1",
3595
+ H2: "Heading 2",
3596
+ H3: "Heading 3",
3597
+ H4: "Heading 4",
3598
+ H5: "Heading 5",
3599
+ H6: "Heading 6",
3600
+ vignette_group: "Vignette Group"
3601
+ },
3527
3602
  imageobject: "Image Object",
3528
3603
  info1: "Info",
3529
3604
  keywordset: "Keyword FGroup",
@@ -3531,17 +3606,40 @@ var ElementLabel = {
3531
3606
  ol: "Ordered List",
3532
3607
  personname: "Person Name",
3533
3608
  poem: "Poem",
3534
- sidebar: "Box",
3609
+ sidebar: {
3610
+ default: "Box",
3611
+ box1: "Box 1",
3612
+ box2: "Box 2",
3613
+ box3: "Box 3",
3614
+ box4: "Box 4",
3615
+ box5: "Box 5"
3616
+ },
3535
3617
  table: "Table",
3536
- table1: "Table",
3618
+ table1: {
3619
+ default: "Table",
3620
+ inline: "Inline Table",
3621
+ float: "Floating Table"
3622
+ },
3537
3623
  tbody: "Table Body",
3538
3624
  td: "Table Data",
3539
3625
  tgroup: "Table Group",
3540
3626
  tr: "Table Row",
3541
3627
  ul: "Unordered List",
3542
- footnote1: "Footnote",
3628
+ footnote1: {
3629
+ default: "Footnote",
3630
+ "end-ch-note": "Chapter Footnote",
3631
+ "end-bk-note": "Book Footnote"
3632
+ },
3543
3633
  inlineequation: "Inline Equation",
3544
- link: "Link",
3634
+ link: {
3635
+ default: "Link",
3636
+ bibr: "Bibliography Link",
3637
+ table: "Table Link",
3638
+ figure: "Figure Link",
3639
+ equation: "Equation Link",
3640
+ footnote: "Footnote Link",
3641
+ chapter: "Chapter Link"
3642
+ },
3545
3643
  uri: "URI",
3546
3644
  phrase: "Phrase",
3547
3645
  abbreviation: "Abbreviation",
@@ -3549,6 +3647,13 @@ var ElementLabel = {
3549
3647
  em: "Emphasis",
3550
3648
  strong: "Strong"
3551
3649
  };
3650
+ var getElementLabel = (code, role) => {
3651
+ const label = ElementLabel[code];
3652
+ if (typeof label === "string") {
3653
+ return label;
3654
+ }
3655
+ return role && Object.prototype.hasOwnProperty.call(label, role) ? label[role] : label.default;
3656
+ };
3552
3657
 
3553
3658
  // src/schema/shared/dependentsForbiddenElements.ts
3554
3659
  var DEPENDENT_FORBIDDEN_ELEMENTS = [
@@ -3559,6 +3664,7 @@ var DEPENDENT_FORBIDDEN_ELEMENTS = [
3559
3664
  ];
3560
3665
 
3561
3666
  // src/helpers/isIgnoredElement.ts
3667
+ var DUMMY_SPAN_SELECTOR = "span#dummySpan";
3562
3668
  var IGNORED_ELEMENT_SELECTORS = [
3563
3669
  "span.rhlabel",
3564
3670
  "span.printlabel",
@@ -3567,7 +3673,7 @@ var IGNORED_ELEMENT_SELECTORS = [
3567
3673
  "span.ref-drag",
3568
3674
  "span.reference-type-label",
3569
3675
  "span.reference-validation-no-match",
3570
- "span#dummySpan"
3676
+ DUMMY_SPAN_SELECTOR
3571
3677
  ];
3572
3678
  var IGNORED_ELEMENT_SELECTOR = IGNORED_ELEMENT_SELECTORS.join(", ");
3573
3679
  var isIgnoredElement = (element) => element.tagName.toUpperCase() === "SPAN" && element.matches(IGNORED_ELEMENT_SELECTOR);
@@ -3895,8 +4001,14 @@ var validateRequiredChildren = (element, schema, childElements) => {
3895
4001
  );
3896
4002
  if (!hasChild) {
3897
4003
  const requiredChild = findSchemaByCode(allowedChild.code);
3898
- const elementLabel = ElementLabel[requiredChild.code];
3899
- const parentLabel = ElementLabel[schema.code];
4004
+ const elementLabel = getElementLabel(
4005
+ requiredChild.code,
4006
+ element.getAttribute("role")
4007
+ );
4008
+ const parentLabel = getElementLabel(
4009
+ schema.code,
4010
+ element.getAttribute("role")
4011
+ );
3900
4012
  const extraInstruction = getExtraInstruction(schema, requiredChild);
3901
4013
  const description = [
3902
4014
  `Please provide at least one ${elementLabel} in this ${parentLabel}.`,
@@ -3936,15 +4048,16 @@ var validateChildren = (element, schema) => {
3936
4048
  const childElements = getEffectiveChildElements(element, {
3937
4049
  includeDeleted: false
3938
4050
  });
3939
- if (schema.kind === "atom") {
4051
+ if (schema.kind === "atom" || schema.kind === "trackChanges") {
3940
4052
  return errors;
3941
4053
  }
3942
4054
  if (schema.allowsText === false && hasVisibleText(element)) {
4055
+ const label = getElementLabel(schema.code, element.getAttribute("role"));
3943
4056
  addValidationIssue(errors, element, {
3944
- title: `Text not allowed in ${ElementLabel[schema.code]}`,
4057
+ title: `Text not allowed in ${label}`,
3945
4058
  level: "warning",
3946
4059
  kind: "forbidden",
3947
- description: `A ${ElementLabel[schema.code]} holds only elements. Please tag or remove the text inside it.`,
4060
+ description: `A ${label} holds only elements. Please tag or remove the text inside it.`,
3948
4061
  elements: [element]
3949
4062
  });
3950
4063
  }
@@ -4451,7 +4564,10 @@ var isInWrongBibliomset = (field) => {
4451
4564
  const relation = field.closest(BIBLIOMSET)?.getAttribute("relation");
4452
4565
  return relation !== void 0 && !FIELD_BIBLIOMSETS[field.localName]?.some((owner) => owner === relation);
4453
4566
  };
4454
- var isEditorWrapper = (element) => element.tagName.toUpperCase() === "SPAN" || findSchemaByElement(element)?.kind === "atom";
4567
+ var isEditorWrapper = (element) => {
4568
+ const kind = findSchemaByElement(element)?.kind;
4569
+ return element.tagName.toUpperCase() === "SPAN" || kind === "atom" || kind === "trackChanges";
4570
+ };
4455
4571
  var getLiveChildren = (element) => Array.from(element.children).flatMap((child) => {
4456
4572
  if (!isLiveReferenceContent(child)) return [];
4457
4573
  return child.matches(INSERTION) || child.tagName.toUpperCase() === "SPAN" && !findSchemaByElement(child) ? getLiveChildren(child) : [child];
@@ -4989,6 +5105,25 @@ var validateReference = (reference) => {
4989
5105
  );
4990
5106
  };
4991
5107
 
5108
+ // src/validation/validateDummySpan.ts
5109
+ var validateDummySpan = (root) => {
5110
+ const placeholders = [];
5111
+ for (const dummySpan of root.querySelectorAll(DUMMY_SPAN_SELECTOR)) {
5112
+ const parentElement = dummySpan.parentElement ?? root;
5113
+ if (parentElement && isDeletedElement(parentElement)) continue;
5114
+ placeholders.push(parentElement);
5115
+ }
5116
+ return placeholders.map(
5117
+ (holder) => createValidationIssue(holder, {
5118
+ title: "Placeholder element found",
5119
+ kind: "placeholder",
5120
+ description: "This element contains an empty placeholder. Type text into the placeholder or delete it.",
5121
+ level: "blocker",
5122
+ elements: [holder]
5123
+ })
5124
+ );
5125
+ };
5126
+
4992
5127
  // src/validation/validateXml.ts
4993
5128
  var ELEMENTS_PER_STEP = 64;
4994
5129
  var DEFAULT_TIME_BUDGET_MS = 8;
@@ -5046,6 +5181,7 @@ function* validateXmlSteps(xml, elementsToLink, linkElements, schemasToValidateA
5046
5181
  const errors = [];
5047
5182
  errors.push(...validateConsecutiveFootnotes(xml));
5048
5183
  errors.push(...validateConsecutiveFootnoteCues(xml));
5184
+ errors.push(...validateDummySpan(xml));
5049
5185
  yield;
5050
5186
  errors.push(...yield* validatePossibleWeblinksSteps(xml));
5051
5187
  yield* validateElements(xml, {
@@ -5179,10 +5315,11 @@ var getAdjacentElement = ({
5179
5315
  DOCBOOK_ELEMENT_LABELS,
5180
5316
  DOCBOOK_ELEMENT_NAMES,
5181
5317
  DOCBOOK_SCHEMAS,
5318
+ DUMMY_SPAN_SELECTOR,
5182
5319
  ELEMENT_SCHEMAS,
5183
5320
  ELE_ID_ATTRIBUTE,
5184
- ElementLabel,
5185
5321
  FIGURE_PLACEMENT_ATTRIBUTE,
5322
+ GROUP_SCHEMAS,
5186
5323
  ID_ATTRS,
5187
5324
  IGNORED_ATTRIBUTES,
5188
5325
  IGNORED_ATTRIBUTES_STARTS_WITH,
@@ -5231,6 +5368,7 @@ var getAdjacentElement = ({
5231
5368
  getAttributeName,
5232
5369
  getDocbookSchemaCode,
5233
5370
  getEffectiveChildElements,
5371
+ getElementLabel,
5234
5372
  getElementLinks,
5235
5373
  getPossibleWeblinks,
5236
5374
  getReferenceFieldElements,
@@ -5248,6 +5386,7 @@ var getAdjacentElement = ({
5248
5386
  validateAttributes,
5249
5387
  validateConsecutiveFootnoteCues,
5250
5388
  validateConsecutiveFootnotes,
5389
+ validateDummySpan,
5251
5390
  validateElementAgainstSchema,
5252
5391
  validateElementToLinkTo,
5253
5392
  validateFootnoteNumber,