pro-editor-schema 0.1.198 → 0.1.199

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.mjs CHANGED
@@ -5,9 +5,8 @@ var createSchema = ({
5
5
  tag,
6
6
  requiredAttributes,
7
7
  optionalAttributes,
8
- defaultChildTagName,
9
- allowedChildTagNames,
10
- forbiddenElements
8
+ defaultChildCode,
9
+ allowedChildrenCodes
11
10
  }) => {
12
11
  return {
13
12
  code,
@@ -15,9 +14,8 @@ var createSchema = ({
15
14
  tag,
16
15
  requiredAttributes,
17
16
  optionalAttributes,
18
- defaultChildTagName,
19
- allowedChildTagNames: new Set(allowedChildTagNames),
20
- forbiddenElements: new Set(forbiddenElements)
17
+ defaultChildCode,
18
+ allowedChildrenCodes: new Set(allowedChildrenCodes)
21
19
  };
22
20
  };
23
21
 
@@ -60,6 +58,26 @@ var ELE_ID_ATTRIBUTE = "ele-id";
60
58
  var STORE_ATTRIBUTE = "store";
61
59
  var ID_ATTRS = [STORE_ATTRIBUTE, ELE_ID_ATTRIBUTE];
62
60
 
61
+ // src/schema/shared/allowedAtomsChildren.ts
62
+ var ATOM_CODES_ALLOWED_CHILDREN = [
63
+ { code: "indexterm", required: false },
64
+ { code: "b", required: false },
65
+ { code: "i", required: false },
66
+ { code: "u", required: false },
67
+ { code: "sc", required: false },
68
+ { code: "emphasis", required: false },
69
+ { code: "strike", required: false },
70
+ { code: "sub", required: false },
71
+ { code: "sup", required: false },
72
+ { code: "highlightmark", required: false },
73
+ { code: "insertion", required: false },
74
+ { code: "deletion", required: false },
75
+ { code: "commentQuerySection", required: false },
76
+ { code: "comment", required: false },
77
+ { code: "query", required: false },
78
+ { code: "referenceMark", required: false }
79
+ ];
80
+
63
81
  // src/schema/elementSchemas/atoms/atomTags.ts
64
82
  var B_TAG = "B";
65
83
  var I_TAG = "I";
@@ -84,24 +102,6 @@ var BOOKMARK_TAG = "BOOKMARK";
84
102
  var SEE_TAG = "SEE";
85
103
  var REFERENCE_MARK_TAG = "REFERENCE";
86
104
 
87
- // src/schema/shared/allowedAtomsChildren.ts
88
- var ATOM_TAGS_ALLOWED_CHILDREN = [
89
- { tagName: INDEXTERM_TAG, required: false },
90
- { tagName: B_TAG, required: false },
91
- { tagName: I_TAG, required: false },
92
- { tagName: U_TAG, required: false },
93
- { tagName: SC_TAG, required: false },
94
- { tagName: EMPHASIS_TAG, required: false },
95
- { tagName: STRIKE_TAG, required: false },
96
- { tagName: SUB_TAG, required: false },
97
- { tagName: SUP_TAG, required: false },
98
- { tagName: HIGHLIGHTMARK_TAG, required: false },
99
- { tagName: SPAN_TAG, required: false },
100
- { tagName: COMMENT_TAG, required: false },
101
- { tagName: QUERY_TAG, required: false },
102
- { tagName: REFERENCE_MARK_TAG, required: false }
103
- ];
104
-
105
105
  // src/schema/elementSchemas/atoms/b.ts
106
106
  var B_SCHEMA = createSchema({
107
107
  code: "b",
@@ -109,7 +109,7 @@ var B_SCHEMA = createSchema({
109
109
  tag: B_TAG,
110
110
  requiredAttributes: [...ID_ATTRS],
111
111
  optionalAttributes: [...TRACK_CHANGES_ATTRS],
112
- allowedChildTagNames: [...ATOM_TAGS_ALLOWED_CHILDREN]
112
+ allowedChildrenCodes: [...ATOM_CODES_ALLOWED_CHILDREN]
113
113
  });
114
114
 
115
115
  // src/schema/elementSchemas/atoms/commentQuerySection.ts
@@ -119,23 +119,16 @@ var COMMENT_QUERY_SECTION_SCHEMA = createSchema({
119
119
  code: "commentQuerySection",
120
120
  requiredAttributes: [...ID_ATTRS, "id"],
121
121
  optionalAttributes: [...TRACK_CHANGES_ATTRS, "title"],
122
- allowedChildTagNames: [...ATOM_TAGS_ALLOWED_CHILDREN]
122
+ allowedChildrenCodes: [...ATOM_CODES_ALLOWED_CHILDREN]
123
123
  });
124
124
 
125
- // src/schema/elementSchemas/inlineElements/inlineElementsTags.ts
126
- var FOOTNOTE_LINK_TAG = "FOOTNOTE1";
127
- var INLINEEQUATION_TAG = "INLINEEQUATION";
128
- var LINK_TAG = "LINK1";
129
- var URI_TAG = "URI";
130
- var PHRASE_TAG = "PHRASE";
131
-
132
125
  // src/schema/shared/allowedInlineChildren.ts
133
- var INLINE_ELEMENT_TAGS_ALLOWED_CHILDREN = [
134
- { tagName: FOOTNOTE_LINK_TAG, required: false },
135
- { tagName: INLINEEQUATION_TAG, required: false },
136
- { tagName: LINK_TAG, required: false },
137
- { tagName: URI_TAG, required: false },
138
- { tagName: PHRASE_TAG, required: false }
126
+ var INLINE_ELEMENT_CODES_ALLOWED_CHILDREN = [
127
+ { code: "footnote1", required: false },
128
+ { code: "inlineequation", required: false },
129
+ { code: "link", required: false },
130
+ { code: "uri", required: false },
131
+ { code: "phrase", required: false }
139
132
  ];
140
133
 
141
134
  // src/schema/elementSchemas/atoms/deletion.ts
@@ -145,9 +138,9 @@ var DELETION_SCHEMA = createSchema({
145
138
  tag: SPAN_TAG,
146
139
  requiredAttributes: [...TRACK_CHANGES_ATTRS, ...ID_ATTRS],
147
140
  optionalAttributes: [],
148
- allowedChildTagNames: [
149
- ...ATOM_TAGS_ALLOWED_CHILDREN,
150
- ...INLINE_ELEMENT_TAGS_ALLOWED_CHILDREN
141
+ allowedChildrenCodes: [
142
+ ...ATOM_CODES_ALLOWED_CHILDREN,
143
+ ...INLINE_ELEMENT_CODES_ALLOWED_CHILDREN
151
144
  ]
152
145
  });
153
146
 
@@ -165,7 +158,7 @@ var EMPHASIS_SCHEMA = createSchema({
165
158
  defaultValue: "lowercase"
166
159
  }
167
160
  ],
168
- allowedChildTagNames: [...ATOM_TAGS_ALLOWED_CHILDREN]
161
+ allowedChildrenCodes: [...ATOM_CODES_ALLOWED_CHILDREN]
169
162
  });
170
163
 
171
164
  // src/schema/elementSchemas/atoms/highlightmark.ts
@@ -175,7 +168,7 @@ var HIGHLIGHTMARK_SCHEMA = createSchema({
175
168
  tag: HIGHLIGHTMARK_TAG,
176
169
  requiredAttributes: [...ID_ATTRS],
177
170
  optionalAttributes: [...TRACK_CHANGES_ATTRS],
178
- allowedChildTagNames: [...ATOM_TAGS_ALLOWED_CHILDREN]
171
+ allowedChildrenCodes: [...ATOM_CODES_ALLOWED_CHILDREN]
179
172
  });
180
173
 
181
174
  // src/schema/elementSchemas/atoms/i.ts
@@ -185,7 +178,7 @@ var I_SCHEMA = createSchema({
185
178
  tag: I_TAG,
186
179
  requiredAttributes: [...ID_ATTRS],
187
180
  optionalAttributes: [...TRACK_CHANGES_ATTRS],
188
- allowedChildTagNames: [...ATOM_TAGS_ALLOWED_CHILDREN]
181
+ allowedChildrenCodes: [...ATOM_CODES_ALLOWED_CHILDREN]
189
182
  });
190
183
 
191
184
  // src/schema/elementSchemas/atoms/insertion.ts
@@ -195,9 +188,9 @@ var INSERTION_SCHEMA = createSchema({
195
188
  tag: SPAN_TAG,
196
189
  requiredAttributes: [...TRACK_CHANGES_ATTRS, ...ID_ATTRS],
197
190
  optionalAttributes: [],
198
- allowedChildTagNames: [
199
- ...ATOM_TAGS_ALLOWED_CHILDREN,
200
- ...INLINE_ELEMENT_TAGS_ALLOWED_CHILDREN
191
+ allowedChildrenCodes: [
192
+ ...ATOM_CODES_ALLOWED_CHILDREN,
193
+ ...INLINE_ELEMENT_CODES_ALLOWED_CHILDREN
201
194
  ]
202
195
  });
203
196
 
@@ -208,7 +201,7 @@ var SC_SCHEMA = createSchema({
208
201
  tag: SC_TAG,
209
202
  requiredAttributes: [...ID_ATTRS],
210
203
  optionalAttributes: [...TRACK_CHANGES_ATTRS],
211
- allowedChildTagNames: [...ATOM_TAGS_ALLOWED_CHILDREN]
204
+ allowedChildrenCodes: [...ATOM_CODES_ALLOWED_CHILDREN]
212
205
  });
213
206
 
214
207
  // src/schema/elementSchemas/atoms/strike.ts
@@ -218,7 +211,7 @@ var STRIKE_SCHEMA = createSchema({
218
211
  tag: STRIKE_TAG,
219
212
  requiredAttributes: [...ID_ATTRS],
220
213
  optionalAttributes: [...TRACK_CHANGES_ATTRS],
221
- allowedChildTagNames: [...ATOM_TAGS_ALLOWED_CHILDREN]
214
+ allowedChildrenCodes: [...ATOM_CODES_ALLOWED_CHILDREN]
222
215
  });
223
216
 
224
217
  // src/schema/elementSchemas/atoms/sub.ts
@@ -228,7 +221,7 @@ var SUB_SCHEMA = createSchema({
228
221
  tag: SUB_TAG,
229
222
  requiredAttributes: [...ID_ATTRS],
230
223
  optionalAttributes: [...TRACK_CHANGES_ATTRS],
231
- allowedChildTagNames: [...ATOM_TAGS_ALLOWED_CHILDREN]
224
+ allowedChildrenCodes: [...ATOM_CODES_ALLOWED_CHILDREN]
232
225
  });
233
226
 
234
227
  // src/schema/elementSchemas/atoms/sup.ts
@@ -238,7 +231,7 @@ var SUP_SCHEMA = createSchema({
238
231
  tag: SUP_TAG,
239
232
  requiredAttributes: [...ID_ATTRS],
240
233
  optionalAttributes: [...TRACK_CHANGES_ATTRS],
241
- allowedChildTagNames: [...ATOM_TAGS_ALLOWED_CHILDREN]
234
+ allowedChildrenCodes: [...ATOM_CODES_ALLOWED_CHILDREN]
242
235
  });
243
236
 
244
237
  // src/schema/elementSchemas/atoms/u.ts
@@ -248,7 +241,7 @@ var U_SCHEMA = createSchema({
248
241
  tag: U_TAG,
249
242
  requiredAttributes: [...ID_ATTRS],
250
243
  optionalAttributes: [...TRACK_CHANGES_ATTRS],
251
- allowedChildTagNames: [...ATOM_TAGS_ALLOWED_CHILDREN]
244
+ allowedChildrenCodes: [...ATOM_CODES_ALLOWED_CHILDREN]
252
245
  });
253
246
 
254
247
  // src/schema/elementSchemas/atoms/content.ts
@@ -258,15 +251,15 @@ var CONTENT_SCHEMA = createSchema({
258
251
  tag: CONTENT_TAG,
259
252
  requiredAttributes: [...ID_ATTRS],
260
253
  optionalAttributes: [],
261
- allowedChildTagNames: [
262
- { tagName: B_TAG, required: false },
263
- { tagName: I_TAG, required: false },
264
- { tagName: U_TAG, required: false },
265
- { tagName: SC_TAG, required: false },
266
- { tagName: EMPHASIS_TAG, required: false },
267
- { tagName: STRIKE_TAG, required: false },
268
- { tagName: SUB_TAG, required: false },
269
- { tagName: SUP_TAG, required: false }
254
+ allowedChildrenCodes: [
255
+ { code: "b", required: false },
256
+ { code: "i", required: false },
257
+ { code: "u", required: false },
258
+ { code: "sc", required: false },
259
+ { code: "emphasis", required: false },
260
+ { code: "strike", required: false },
261
+ { code: "sub", required: false },
262
+ { code: "sup", required: false }
270
263
  ]
271
264
  });
272
265
 
@@ -287,9 +280,9 @@ var COMMENT_SCHEMA = createSchema({
287
280
  "markuser",
288
281
  "marktime"
289
282
  ],
290
- allowedChildTagNames: [
291
- { tagName: CONTENT_TAG, required: true },
292
- { tagName: REPLY_TAG, required: false }
283
+ allowedChildrenCodes: [
284
+ { code: "content", required: true },
285
+ { code: "reply", required: false }
293
286
  ]
294
287
  });
295
288
 
@@ -310,9 +303,9 @@ var QUERY_SCHEMA = createSchema({
310
303
  "markuser",
311
304
  "marktime"
312
305
  ],
313
- allowedChildTagNames: [
314
- { tagName: CONTENT_TAG, required: true },
315
- { tagName: REPLY_TAG, required: false }
306
+ allowedChildrenCodes: [
307
+ { code: "content", required: true },
308
+ { code: "reply", required: false }
316
309
  ]
317
310
  });
318
311
 
@@ -333,16 +326,16 @@ var REPLY_SCHEMA = createSchema({
333
326
  "markuser",
334
327
  "marktime"
335
328
  ],
336
- allowedChildTagNames: [{ tagName: CONTENT_TAG, required: true }]
329
+ allowedChildrenCodes: [{ code: "content", required: true }]
337
330
  });
338
331
 
339
332
  // src/schema/elementSchemas/atoms/indexing/indexTermAttributes.ts
340
333
  var INDEX_TERM_ENTRY_REQUIRED_ATTRIBUTES = [
341
334
  "data-date",
342
335
  "data-user",
343
- "firstEntry",
344
- "secondEntry",
345
- "thirdEntry",
336
+ "firstentry",
337
+ "secondentry",
338
+ "thirdentry",
346
339
  "entry",
347
340
  "linkend",
348
341
  ...ID_ATTRS
@@ -355,7 +348,7 @@ var BOOKMARK_INDEX_POSITION_ATTRIBUTE = {
355
348
  var SEE_REQUIRED_ATTRIBUTES = [
356
349
  "linkend",
357
350
  "data-user",
358
- "crossref-pageNumber",
351
+ "crossref-pagenumber",
359
352
  {
360
353
  name: "role",
361
354
  values: ["see", "see-also"],
@@ -363,10 +356,10 @@ var SEE_REQUIRED_ATTRIBUTES = [
363
356
  },
364
357
  ...ID_ATTRS,
365
358
  "data-date",
366
- "crossref-firstEntry",
367
- "crossref-secondEntry",
368
- "crossref-thirdEntry",
369
- "crossref-fourthEntry"
359
+ "crossref-firstentry",
360
+ "crossref-secondentry",
361
+ "crossref-thirdentry",
362
+ "crossref-fourthentry"
370
363
  ];
371
364
 
372
365
  // src/schema/elementSchemas/atoms/indexing/bookmark.ts
@@ -379,12 +372,7 @@ var BOOKMARK_SCHEMA = createSchema({
379
372
  BOOKMARK_INDEX_POSITION_ATTRIBUTE
380
373
  ],
381
374
  optionalAttributes: [],
382
- allowedChildTagNames: [
383
- {
384
- tagName: SEE_TAG,
385
- required: false
386
- }
387
- ]
375
+ allowedChildrenCodes: [{ code: "see", required: false }]
388
376
  });
389
377
 
390
378
  // src/schema/elementSchemas/atoms/indexing/indexterm.ts
@@ -402,12 +390,12 @@ var INDEXTERM_SCHEMA = createSchema({
402
390
  ...ID_ATTRS
403
391
  ],
404
392
  optionalAttributes: [],
405
- allowedChildTagNames: [
406
- { tagName: PRIMARY_TAG, required: false },
407
- { tagName: SECONDARY_TAG, required: false },
408
- { tagName: TERTIARY_TAG, required: false },
409
- { tagName: QUATERNARY_TAG, required: false },
410
- { tagName: BOOKMARK_TAG, required: false }
393
+ allowedChildrenCodes: [
394
+ { code: "primary", required: false },
395
+ { code: "secondary", required: false },
396
+ { code: "tertiary", required: false },
397
+ { code: "quaternary", required: false },
398
+ { code: "bookmark", required: false }
411
399
  ]
412
400
  });
413
401
 
@@ -418,9 +406,9 @@ var PRIMARY_SCHEMA = createSchema({
418
406
  tag: PRIMARY_TAG,
419
407
  requiredAttributes: [...INDEX_TERM_ENTRY_REQUIRED_ATTRIBUTES],
420
408
  optionalAttributes: [],
421
- allowedChildTagNames: [
422
- ...ATOM_TAGS_ALLOWED_CHILDREN,
423
- { tagName: SEE_TAG, required: false }
409
+ allowedChildrenCodes: [
410
+ ...ATOM_CODES_ALLOWED_CHILDREN,
411
+ { code: "see", required: false }
424
412
  ]
425
413
  });
426
414
 
@@ -431,9 +419,9 @@ var QUATERNARY_SCHEMA = createSchema({
431
419
  tag: QUATERNARY_TAG,
432
420
  requiredAttributes: [...INDEX_TERM_ENTRY_REQUIRED_ATTRIBUTES],
433
421
  optionalAttributes: [],
434
- allowedChildTagNames: [
435
- ...ATOM_TAGS_ALLOWED_CHILDREN,
436
- { tagName: SEE_TAG, required: false }
422
+ allowedChildrenCodes: [
423
+ ...ATOM_CODES_ALLOWED_CHILDREN,
424
+ { code: "see", required: false }
437
425
  ]
438
426
  });
439
427
 
@@ -444,9 +432,9 @@ var SECONDARY_SCHEMA = createSchema({
444
432
  tag: SECONDARY_TAG,
445
433
  requiredAttributes: [...INDEX_TERM_ENTRY_REQUIRED_ATTRIBUTES],
446
434
  optionalAttributes: [],
447
- allowedChildTagNames: [
448
- ...ATOM_TAGS_ALLOWED_CHILDREN,
449
- { tagName: SEE_TAG, required: false }
435
+ allowedChildrenCodes: [
436
+ ...ATOM_CODES_ALLOWED_CHILDREN,
437
+ { code: "see", required: false }
450
438
  ]
451
439
  });
452
440
 
@@ -457,7 +445,7 @@ var SEE_SCHEMA = createSchema({
457
445
  tag: SEE_TAG,
458
446
  requiredAttributes: [...SEE_REQUIRED_ATTRIBUTES],
459
447
  optionalAttributes: [],
460
- allowedChildTagNames: []
448
+ allowedChildrenCodes: []
461
449
  });
462
450
 
463
451
  // src/schema/elementSchemas/atoms/indexing/tertiary.ts
@@ -467,9 +455,9 @@ var TERTIARY_SCHEMA = createSchema({
467
455
  tag: TERTIARY_TAG,
468
456
  requiredAttributes: [...INDEX_TERM_ENTRY_REQUIRED_ATTRIBUTES],
469
457
  optionalAttributes: [],
470
- allowedChildTagNames: [
471
- ...ATOM_TAGS_ALLOWED_CHILDREN,
472
- { tagName: SEE_TAG, required: false }
458
+ allowedChildrenCodes: [
459
+ ...ATOM_CODES_ALLOWED_CHILDREN,
460
+ { code: "see", required: false }
473
461
  ]
474
462
  });
475
463
 
@@ -490,7 +478,7 @@ var REFERENCE_MARK_SCHEMA = createSchema({
490
478
  }
491
479
  ],
492
480
  optionalAttributes: [],
493
- allowedChildTagNames: [...ATOM_TAGS_ALLOWED_CHILDREN]
481
+ allowedChildrenCodes: [...ATOM_CODES_ALLOWED_CHILDREN]
494
482
  });
495
483
 
496
484
  // src/schema/elementSchemas/atoms/index.ts
@@ -621,9 +609,9 @@ var AUTHORGROUP_SCHEMA = createSchema({
621
609
  tag: AUTHORGROUP_TAG,
622
610
  requiredAttributes: [...ID_ATTRS],
623
611
  optionalAttributes: [],
624
- allowedChildTagNames: [
625
- { tagName: AUTHOR_TAG, required: false },
626
- { tagName: PUNC_TAG, required: false }
612
+ allowedChildrenCodes: [
613
+ { code: "author", required: false },
614
+ { code: "punc", required: false }
627
615
  ]
628
616
  });
629
617
 
@@ -634,13 +622,13 @@ var AUTHOR_SCHEMA = createSchema({
634
622
  tag: AUTHOR_TAG,
635
623
  requiredAttributes: [...ID_ATTRS],
636
624
  optionalAttributes: [],
637
- allowedChildTagNames: [
638
- { tagName: PERSONNAME_TAG, required: true },
639
- { tagName: OLINK_TAG, required: true },
640
- { tagName: AFFILIATION_TAG, required: false },
641
- { tagName: DEGREES_TAG, required: false },
642
- { tagName: PUNC_TAG, required: false },
643
- { tagName: EMAIL_TAG, required: false }
625
+ allowedChildrenCodes: [
626
+ { code: "personname", required: true },
627
+ { code: "olink", required: true },
628
+ { code: "affiliation", required: false },
629
+ { code: "degrees", required: false },
630
+ { code: "punc", required: false },
631
+ { code: "email", required: false }
644
632
  ]
645
633
  });
646
634
 
@@ -651,7 +639,7 @@ var OLINK_SCHEMA = createSchema({
651
639
  tag: OLINK_TAG,
652
640
  requiredAttributes: [...ID_ATTRS],
653
641
  optionalAttributes: [],
654
- allowedChildTagNames: []
642
+ allowedChildrenCodes: []
655
643
  });
656
644
 
657
645
  // src/schema/elementSchemas/elements/authors/personname.ts
@@ -661,10 +649,10 @@ var PERSONNAME_SCHEMA = createSchema({
661
649
  tag: PERSONNAME_TAG,
662
650
  requiredAttributes: [...ID_ATTRS],
663
651
  optionalAttributes: [],
664
- allowedChildTagNames: [
665
- { tagName: FIRSTNAME_TAG, required: true },
666
- { tagName: SURNAME_TAG, required: true },
667
- { tagName: HONORIFIC_TAG, required: false }
652
+ allowedChildrenCodes: [
653
+ { code: "firstname", required: true },
654
+ { code: "surname", required: true },
655
+ { code: "honorific", required: false }
668
656
  ]
669
657
  });
670
658
 
@@ -675,7 +663,7 @@ var FIRSTNAME_SCHEMA = createSchema({
675
663
  tag: FIRSTNAME_TAG,
676
664
  requiredAttributes: [...ID_ATTRS],
677
665
  optionalAttributes: [],
678
- allowedChildTagNames: [...ATOM_TAGS_ALLOWED_CHILDREN]
666
+ allowedChildrenCodes: [...ATOM_CODES_ALLOWED_CHILDREN]
679
667
  });
680
668
 
681
669
  // src/schema/elementSchemas/elements/authors/surname.ts
@@ -685,7 +673,7 @@ var SURNAME_SCHEMA = createSchema({
685
673
  tag: SURNAME_TAG,
686
674
  requiredAttributes: [...ID_ATTRS],
687
675
  optionalAttributes: [],
688
- allowedChildTagNames: [...ATOM_TAGS_ALLOWED_CHILDREN]
676
+ allowedChildrenCodes: [...ATOM_CODES_ALLOWED_CHILDREN]
689
677
  });
690
678
 
691
679
  // src/schema/elementSchemas/elements/authors/honorific.ts
@@ -695,7 +683,7 @@ var HONORIFIC_SCHEMA = createSchema({
695
683
  tag: HONORIFIC_TAG,
696
684
  requiredAttributes: [...ID_ATTRS],
697
685
  optionalAttributes: [],
698
- allowedChildTagNames: []
686
+ allowedChildrenCodes: []
699
687
  });
700
688
 
701
689
  // src/schema/elementSchemas/elements/authors/orgname.ts
@@ -705,7 +693,7 @@ var ORGNAME_SCHEMA = createSchema({
705
693
  tag: ORGNAME_TAG,
706
694
  requiredAttributes: [...ID_ATTRS],
707
695
  optionalAttributes: [],
708
- allowedChildTagNames: []
696
+ allowedChildrenCodes: []
709
697
  });
710
698
 
711
699
  // src/schema/elementSchemas/elements/authors/email.ts
@@ -715,7 +703,7 @@ var EMAIL_SCHEMA = createSchema({
715
703
  tag: EMAIL_TAG,
716
704
  requiredAttributes: [...ID_ATTRS],
717
705
  optionalAttributes: [],
718
- allowedChildTagNames: [...ATOM_TAGS_ALLOWED_CHILDREN]
706
+ allowedChildrenCodes: [...ATOM_CODES_ALLOWED_CHILDREN]
719
707
  });
720
708
 
721
709
  // src/schema/elementSchemas/elements/authors/org.ts
@@ -725,7 +713,7 @@ var ORG_SCHEMA = createSchema({
725
713
  tag: ORG_TAG,
726
714
  requiredAttributes: [...ID_ATTRS],
727
715
  optionalAttributes: [],
728
- allowedChildTagNames: [{ tagName: ORGNAME_TAG, required: false }]
716
+ allowedChildrenCodes: [{ code: "orgname", required: false }]
729
717
  });
730
718
 
731
719
  // src/schema/elementSchemas/elements/authors/affiliation.ts
@@ -735,7 +723,7 @@ var AFFILIATION_SCHEMA = createSchema({
735
723
  tag: AFFILIATION_TAG,
736
724
  requiredAttributes: [...ID_ATTRS],
737
725
  optionalAttributes: [],
738
- allowedChildTagNames: [{ tagName: ORG_TAG, required: false }]
726
+ allowedChildrenCodes: [{ code: "org", required: false }]
739
727
  });
740
728
 
741
729
  // src/schema/elementSchemas/elements/degrees.ts
@@ -745,7 +733,7 @@ var DEGREES_SCHEMA = createSchema({
745
733
  tag: DEGREES_TAG,
746
734
  requiredAttributes: [...ID_ATTRS],
747
735
  optionalAttributes: [],
748
- allowedChildTagNames: []
736
+ allowedChildrenCodes: []
749
737
  });
750
738
 
751
739
  // src/schema/elementSchemas/elements/dialogue/line.ts
@@ -761,9 +749,9 @@ var LINE_SCHEMA = createSchema({
761
749
  defaultValue: "add-element"
762
750
  }
763
751
  ],
764
- allowedChildTagNames: [
765
- ...ATOM_TAGS_ALLOWED_CHILDREN,
766
- ...INLINE_ELEMENT_TAGS_ALLOWED_CHILDREN
752
+ allowedChildrenCodes: [
753
+ ...ATOM_CODES_ALLOWED_CHILDREN,
754
+ ...INLINE_ELEMENT_CODES_ALLOWED_CHILDREN
767
755
  ]
768
756
  });
769
757
 
@@ -780,7 +768,7 @@ var SPEAKER_SCHEMA = createSchema({
780
768
  defaultValue: "add-element"
781
769
  }
782
770
  ],
783
- allowedChildTagNames: [...ATOM_TAGS_ALLOWED_CHILDREN]
771
+ allowedChildrenCodes: [...ATOM_CODES_ALLOWED_CHILDREN]
784
772
  });
785
773
 
786
774
  // src/schema/elementSchemas/elements/dialogue/dialogue.ts
@@ -797,9 +785,9 @@ var DIALOGUE_SCHEMA = createSchema({
797
785
  defaultValue: "add-element"
798
786
  }
799
787
  ],
800
- allowedChildTagNames: [
801
- { tagName: LINE_TAG, required: false },
802
- { tagName: SPEAKER_TAG, required: true }
788
+ allowedChildrenCodes: [
789
+ { code: "line", required: false },
790
+ { code: "speaker", required: true }
803
791
  ]
804
792
  });
805
793
 
@@ -822,47 +810,39 @@ var EQUATION_SCHEMA = createSchema({
822
810
  defaultValue: "added"
823
811
  }
824
812
  ],
825
- allowedChildTagNames: [
826
- { tagName: MATHPHRASE_TAG, required: true },
827
- {
828
- tagName: CAPTION_TAG,
829
- required: false
830
- }
831
- ],
832
- forbiddenElements: [
833
- { code: QUERY_SCHEMA.code, resolveTo: "skip" },
834
- { code: COMMENT_SCHEMA.code, resolveTo: "skip" },
835
- { code: COMMENT_QUERY_SECTION_SCHEMA.code, resolveTo: "skip" }
813
+ allowedChildrenCodes: [
814
+ { code: "mathphrase", required: true },
815
+ { code: "caption1", required: false }
836
816
  ]
837
817
  });
838
818
 
839
819
  // src/schema/shared/allowedMathChildren.ts
840
- var MATH_PRESENTATION_TAGS_ALLOWED_CHILDREN = [
841
- { tagName: MERROR_TAG, required: false },
842
- { tagName: MFRAC_TAG, required: false },
843
- { tagName: MI_TAG, required: false },
844
- { tagName: MMULTISCRIPTS_TAG, required: false },
845
- { tagName: MN_TAG, required: false },
846
- { tagName: MO_TAG, required: false },
847
- { tagName: MOVER_TAG, required: false },
848
- { tagName: MPADDED_TAG, required: false },
849
- { tagName: MPHANTOM_TAG, required: false },
850
- { tagName: MPRESCRIPTS_TAG, required: false },
851
- { tagName: MROOT_TAG, required: false },
852
- { tagName: MROW_TAG, required: false },
853
- { tagName: MS_TAG, required: false },
854
- { tagName: MSPACE_TAG, required: false },
855
- { tagName: MSQRT_TAG, required: false },
856
- { tagName: MSTYLE_TAG, required: false },
857
- { tagName: MSUB_TAG, required: false },
858
- { tagName: MSUBSUP_TAG, required: false },
859
- { tagName: MSUP_TAG, required: false },
860
- { tagName: MTABLE_TAG, required: false },
861
- { tagName: MTD_TAG, required: false },
862
- { tagName: MTEXT_TAG, required: false },
863
- { tagName: MTR_TAG, required: false },
864
- { tagName: MUNDER_TAG, required: false },
865
- { tagName: MUNDEROVER_TAG, required: false }
820
+ var MATH_PRESENTATION_CODES_ALLOWED_CHILDREN = [
821
+ { code: "merror", required: false },
822
+ { code: "mfrac", required: false },
823
+ { code: "mi", required: false },
824
+ { code: "mmultiscripts", required: false },
825
+ { code: "mn", required: false },
826
+ { code: "mo", required: false },
827
+ { code: "mover", required: false },
828
+ { code: "mpadded", required: false },
829
+ { code: "mphantom", required: false },
830
+ { code: "mprescripts", required: false },
831
+ { code: "mroot", required: false },
832
+ { code: "mrow", required: false },
833
+ { code: "ms", required: false },
834
+ { code: "mspace", required: false },
835
+ { code: "msqrt", required: false },
836
+ { code: "mstyle", required: false },
837
+ { code: "msub", required: false },
838
+ { code: "msubsup", required: false },
839
+ { code: "msup", required: false },
840
+ { code: "mtable", required: false },
841
+ { code: "mtd", required: false },
842
+ { code: "mtext", required: false },
843
+ { code: "mtr", required: false },
844
+ { code: "munder", required: false },
845
+ { code: "munderover", required: false }
866
846
  ];
867
847
 
868
848
  // src/schema/elementSchemas/elements/equation/math.ts
@@ -872,8 +852,8 @@ var MATH_SCHEMA = createSchema({
872
852
  tag: MATH_TAG,
873
853
  requiredAttributes: [],
874
854
  optionalAttributes: ["xmlns", "display"],
875
- defaultChildTagName: MI_TAG,
876
- allowedChildTagNames: [...MATH_PRESENTATION_TAGS_ALLOWED_CHILDREN]
855
+ defaultChildCode: "mi",
856
+ allowedChildrenCodes: [...MATH_PRESENTATION_CODES_ALLOWED_CHILDREN]
877
857
  });
878
858
 
879
859
  // src/schema/elementSchemas/elements/equation/merror.ts
@@ -883,7 +863,7 @@ var MERROR_SCHEMA = createSchema({
883
863
  tag: MERROR_TAG,
884
864
  requiredAttributes: [],
885
865
  optionalAttributes: [],
886
- allowedChildTagNames: [...MATH_PRESENTATION_TAGS_ALLOWED_CHILDREN]
866
+ allowedChildrenCodes: [...MATH_PRESENTATION_CODES_ALLOWED_CHILDREN]
887
867
  });
888
868
 
889
869
  // src/schema/elementSchemas/elements/equation/mfrac.ts
@@ -893,7 +873,7 @@ var MFRAC_SCHEMA = createSchema({
893
873
  tag: MFRAC_TAG,
894
874
  requiredAttributes: [],
895
875
  optionalAttributes: ["denomalign", "linethickness", "numalign"],
896
- allowedChildTagNames: [...MATH_PRESENTATION_TAGS_ALLOWED_CHILDREN]
876
+ allowedChildrenCodes: [...MATH_PRESENTATION_CODES_ALLOWED_CHILDREN]
897
877
  });
898
878
 
899
879
  // src/schema/elementSchemas/elements/equation/mi.ts
@@ -903,7 +883,7 @@ var MI_SCHEMA = createSchema({
903
883
  tag: MI_TAG,
904
884
  requiredAttributes: [],
905
885
  optionalAttributes: ["mathvariant"],
906
- allowedChildTagNames: []
886
+ allowedChildrenCodes: []
907
887
  });
908
888
 
909
889
  // src/schema/elementSchemas/elements/equation/mmultiscripts.ts
@@ -913,7 +893,7 @@ var MMULTISCRIPTS_SCHEMA = createSchema({
913
893
  tag: MMULTISCRIPTS_TAG,
914
894
  requiredAttributes: [],
915
895
  optionalAttributes: ["subscriptshift", "superscriptshift"],
916
- allowedChildTagNames: [...MATH_PRESENTATION_TAGS_ALLOWED_CHILDREN]
896
+ allowedChildrenCodes: [...MATH_PRESENTATION_CODES_ALLOWED_CHILDREN]
917
897
  });
918
898
 
919
899
  // src/schema/elementSchemas/elements/equation/mn.ts
@@ -923,7 +903,7 @@ var MN_SCHEMA = createSchema({
923
903
  tag: MN_TAG,
924
904
  requiredAttributes: [],
925
905
  optionalAttributes: [],
926
- allowedChildTagNames: []
906
+ allowedChildrenCodes: []
927
907
  });
928
908
 
929
909
  // src/schema/elementSchemas/elements/equation/mo.ts
@@ -946,7 +926,7 @@ var MO_SCHEMA = createSchema({
946
926
  "stretchy",
947
927
  "symmetric"
948
928
  ],
949
- allowedChildTagNames: []
929
+ allowedChildrenCodes: []
950
930
  });
951
931
 
952
932
  // src/schema/elementSchemas/elements/equation/mover.ts
@@ -956,7 +936,7 @@ var MOVER_SCHEMA = createSchema({
956
936
  tag: MOVER_TAG,
957
937
  requiredAttributes: [],
958
938
  optionalAttributes: ["accent"],
959
- allowedChildTagNames: [...MATH_PRESENTATION_TAGS_ALLOWED_CHILDREN]
939
+ allowedChildrenCodes: [...MATH_PRESENTATION_CODES_ALLOWED_CHILDREN]
960
940
  });
961
941
 
962
942
  // src/schema/elementSchemas/elements/equation/mpadded.ts
@@ -965,14 +945,8 @@ var MPADDED_SCHEMA = createSchema({
965
945
  kind: "element",
966
946
  tag: MPADDED_TAG,
967
947
  requiredAttributes: [],
968
- optionalAttributes: [
969
- "depth",
970
- "height",
971
- "lspace",
972
- "voffset",
973
- "width"
974
- ],
975
- allowedChildTagNames: [...MATH_PRESENTATION_TAGS_ALLOWED_CHILDREN]
948
+ optionalAttributes: ["depth", "height", "lspace", "voffset", "width"],
949
+ allowedChildrenCodes: [...MATH_PRESENTATION_CODES_ALLOWED_CHILDREN]
976
950
  });
977
951
 
978
952
  // src/schema/elementSchemas/elements/equation/mphantom.ts
@@ -982,7 +956,7 @@ var MPHANTOM_SCHEMA = createSchema({
982
956
  tag: MPHANTOM_TAG,
983
957
  requiredAttributes: [],
984
958
  optionalAttributes: [],
985
- allowedChildTagNames: [...MATH_PRESENTATION_TAGS_ALLOWED_CHILDREN]
959
+ allowedChildrenCodes: [...MATH_PRESENTATION_CODES_ALLOWED_CHILDREN]
986
960
  });
987
961
 
988
962
  // src/schema/elementSchemas/elements/equation/mprescripts.ts
@@ -992,7 +966,7 @@ var MPRESCRIPTS_SCHEMA = createSchema({
992
966
  tag: MPRESCRIPTS_TAG,
993
967
  requiredAttributes: [],
994
968
  optionalAttributes: [],
995
- allowedChildTagNames: []
969
+ allowedChildrenCodes: []
996
970
  });
997
971
 
998
972
  // src/schema/elementSchemas/elements/equation/mroot.ts
@@ -1002,7 +976,7 @@ var MROOT_SCHEMA = createSchema({
1002
976
  tag: MROOT_TAG,
1003
977
  requiredAttributes: [],
1004
978
  optionalAttributes: [],
1005
- allowedChildTagNames: [...MATH_PRESENTATION_TAGS_ALLOWED_CHILDREN]
979
+ allowedChildrenCodes: [...MATH_PRESENTATION_CODES_ALLOWED_CHILDREN]
1006
980
  });
1007
981
 
1008
982
  // src/schema/elementSchemas/elements/equation/mrow.ts
@@ -1012,7 +986,7 @@ var MROW_SCHEMA = createSchema({
1012
986
  tag: MROW_TAG,
1013
987
  requiredAttributes: [],
1014
988
  optionalAttributes: [],
1015
- allowedChildTagNames: [...MATH_PRESENTATION_TAGS_ALLOWED_CHILDREN]
989
+ allowedChildrenCodes: [...MATH_PRESENTATION_CODES_ALLOWED_CHILDREN]
1016
990
  });
1017
991
 
1018
992
  // src/schema/elementSchemas/elements/equation/ms.ts
@@ -1022,7 +996,7 @@ var MS_SCHEMA = createSchema({
1022
996
  tag: MS_TAG,
1023
997
  requiredAttributes: [],
1024
998
  optionalAttributes: ["lquote", "rquote"],
1025
- allowedChildTagNames: []
999
+ allowedChildrenCodes: []
1026
1000
  });
1027
1001
 
1028
1002
  // src/schema/elementSchemas/elements/equation/mspace.ts
@@ -1032,7 +1006,7 @@ var MSPACE_SCHEMA = createSchema({
1032
1006
  tag: MSPACE_TAG,
1033
1007
  requiredAttributes: [],
1034
1008
  optionalAttributes: ["depth", "height", "width"],
1035
- allowedChildTagNames: []
1009
+ allowedChildrenCodes: []
1036
1010
  });
1037
1011
 
1038
1012
  // src/schema/elementSchemas/elements/equation/msqrt.ts
@@ -1042,7 +1016,7 @@ var MSQRT_SCHEMA = createSchema({
1042
1016
  tag: MSQRT_TAG,
1043
1017
  requiredAttributes: [],
1044
1018
  optionalAttributes: [],
1045
- allowedChildTagNames: [...MATH_PRESENTATION_TAGS_ALLOWED_CHILDREN]
1019
+ allowedChildrenCodes: [...MATH_PRESENTATION_CODES_ALLOWED_CHILDREN]
1046
1020
  });
1047
1021
 
1048
1022
  // src/schema/elementSchemas/elements/equation/mstyle.ts
@@ -1060,7 +1034,7 @@ var MSTYLE_SCHEMA = createSchema({
1060
1034
  "scriptminsize",
1061
1035
  "scriptsizemultiplier"
1062
1036
  ],
1063
- allowedChildTagNames: [...MATH_PRESENTATION_TAGS_ALLOWED_CHILDREN]
1037
+ allowedChildrenCodes: [...MATH_PRESENTATION_CODES_ALLOWED_CHILDREN]
1064
1038
  });
1065
1039
 
1066
1040
  // src/schema/elementSchemas/elements/equation/msub.ts
@@ -1070,7 +1044,7 @@ var MSUB_SCHEMA = createSchema({
1070
1044
  tag: MSUB_TAG,
1071
1045
  requiredAttributes: [],
1072
1046
  optionalAttributes: ["subscriptshift"],
1073
- allowedChildTagNames: [...MATH_PRESENTATION_TAGS_ALLOWED_CHILDREN]
1047
+ allowedChildrenCodes: [...MATH_PRESENTATION_CODES_ALLOWED_CHILDREN]
1074
1048
  });
1075
1049
 
1076
1050
  // src/schema/elementSchemas/elements/equation/msubsup.ts
@@ -1080,7 +1054,7 @@ var MSUBSUP_SCHEMA = createSchema({
1080
1054
  tag: MSUBSUP_TAG,
1081
1055
  requiredAttributes: [],
1082
1056
  optionalAttributes: ["subscriptshift", "superscriptshift"],
1083
- allowedChildTagNames: [...MATH_PRESENTATION_TAGS_ALLOWED_CHILDREN]
1057
+ allowedChildrenCodes: [...MATH_PRESENTATION_CODES_ALLOWED_CHILDREN]
1084
1058
  });
1085
1059
 
1086
1060
  // src/schema/elementSchemas/elements/equation/msup.ts
@@ -1090,7 +1064,7 @@ var MSUP_SCHEMA = createSchema({
1090
1064
  tag: MSUP_TAG,
1091
1065
  requiredAttributes: [],
1092
1066
  optionalAttributes: ["superscriptshift"],
1093
- allowedChildTagNames: [...MATH_PRESENTATION_TAGS_ALLOWED_CHILDREN]
1067
+ allowedChildrenCodes: [...MATH_PRESENTATION_CODES_ALLOWED_CHILDREN]
1094
1068
  });
1095
1069
 
1096
1070
  // src/schema/elementSchemas/elements/equation/mtable.ts
@@ -1113,7 +1087,7 @@ var MTABLE_SCHEMA = createSchema({
1113
1087
  "rowspacing",
1114
1088
  "width"
1115
1089
  ],
1116
- allowedChildTagNames: [{ tagName: MTR_TAG, required: false }]
1090
+ allowedChildrenCodes: [{ code: "mtr", required: false }]
1117
1091
  });
1118
1092
 
1119
1093
  // src/schema/elementSchemas/elements/equation/mtd.ts
@@ -1122,13 +1096,8 @@ var MTD_SCHEMA = createSchema({
1122
1096
  kind: "element",
1123
1097
  tag: MTD_TAG,
1124
1098
  requiredAttributes: [],
1125
- optionalAttributes: [
1126
- "columnalign",
1127
- "columnspan",
1128
- "rowalign",
1129
- "rowspan"
1130
- ],
1131
- allowedChildTagNames: [...MATH_PRESENTATION_TAGS_ALLOWED_CHILDREN]
1099
+ optionalAttributes: ["columnalign", "columnspan", "rowalign", "rowspan"],
1100
+ allowedChildrenCodes: [...MATH_PRESENTATION_CODES_ALLOWED_CHILDREN]
1132
1101
  });
1133
1102
 
1134
1103
  // src/schema/elementSchemas/elements/equation/mtext.ts
@@ -1138,7 +1107,7 @@ var MTEXT_SCHEMA = createSchema({
1138
1107
  tag: MTEXT_TAG,
1139
1108
  requiredAttributes: [],
1140
1109
  optionalAttributes: ["mathvariant"],
1141
- allowedChildTagNames: []
1110
+ allowedChildrenCodes: []
1142
1111
  });
1143
1112
 
1144
1113
  // src/schema/elementSchemas/elements/equation/mtr.ts
@@ -1148,7 +1117,7 @@ var MTR_SCHEMA = createSchema({
1148
1117
  tag: MTR_TAG,
1149
1118
  requiredAttributes: [],
1150
1119
  optionalAttributes: ["columnalign", "rowalign"],
1151
- allowedChildTagNames: [{ tagName: MTD_TAG, required: false }]
1120
+ allowedChildrenCodes: [{ code: "mtd", required: false }]
1152
1121
  });
1153
1122
 
1154
1123
  // src/schema/elementSchemas/elements/equation/munder.ts
@@ -1158,7 +1127,7 @@ var MUNDER_SCHEMA = createSchema({
1158
1127
  tag: MUNDER_TAG,
1159
1128
  requiredAttributes: [],
1160
1129
  optionalAttributes: ["accentunder"],
1161
- allowedChildTagNames: [...MATH_PRESENTATION_TAGS_ALLOWED_CHILDREN]
1130
+ allowedChildrenCodes: [...MATH_PRESENTATION_CODES_ALLOWED_CHILDREN]
1162
1131
  });
1163
1132
 
1164
1133
  // src/schema/elementSchemas/elements/equation/munderover.ts
@@ -1168,7 +1137,7 @@ var MUNDEROVER_SCHEMA = createSchema({
1168
1137
  tag: MUNDEROVER_TAG,
1169
1138
  requiredAttributes: [],
1170
1139
  optionalAttributes: ["accent", "accentunder"],
1171
- allowedChildTagNames: [...MATH_PRESENTATION_TAGS_ALLOWED_CHILDREN]
1140
+ allowedChildrenCodes: [...MATH_PRESENTATION_CODES_ALLOWED_CHILDREN]
1172
1141
  });
1173
1142
 
1174
1143
  // src/schema/elementSchemas/elements/figure/img.ts
@@ -1189,7 +1158,7 @@ var IMG_SCHEMA = createSchema({
1189
1158
  defaultValue: "inline-graphics"
1190
1159
  }
1191
1160
  ],
1192
- allowedChildTagNames: []
1161
+ allowedChildrenCodes: []
1193
1162
  });
1194
1163
 
1195
1164
  // src/schema/elementSchemas/elements/figure/alttext.ts
@@ -1199,7 +1168,7 @@ var ALTTEXT_SCHEMA = createSchema({
1199
1168
  tag: ALTTEXT_TAG,
1200
1169
  requiredAttributes: [],
1201
1170
  optionalAttributes: [],
1202
- allowedChildTagNames: [{ tagName: CONTENT_TAG, required: false }]
1171
+ allowedChildrenCodes: [{ code: "content", required: false }]
1203
1172
  });
1204
1173
 
1205
1174
  // src/schema/elementSchemas/elements/figure/imageobject.ts
@@ -1209,9 +1178,9 @@ var IMAGEOBJECT_SCHEMA = createSchema({
1209
1178
  tag: IMAGEOBJECT_TAG,
1210
1179
  requiredAttributes: [...ID_ATTRS],
1211
1180
  optionalAttributes: [],
1212
- allowedChildTagNames: [
1213
- { tagName: IMG_TAG, required: false },
1214
- { tagName: ALTTEXT_TAG, required: false }
1181
+ allowedChildrenCodes: [
1182
+ { code: "img", required: false },
1183
+ { code: "alttext", required: false }
1215
1184
  ]
1216
1185
  });
1217
1186
 
@@ -1222,7 +1191,7 @@ var MEDIAOBJECT_SCHEMA = createSchema({
1222
1191
  tag: MEDIAOBJECT_TAG,
1223
1192
  requiredAttributes: [...ID_ATTRS],
1224
1193
  optionalAttributes: [...TRACK_CHANGES_ATTRS],
1225
- allowedChildTagNames: [{ tagName: IMAGEOBJECT_TAG, required: false }]
1194
+ allowedChildrenCodes: [{ code: "imageobject", required: false }]
1226
1195
  });
1227
1196
 
1228
1197
  // src/schema/elementSchemas/elements/figure/caption1.ts
@@ -1232,7 +1201,7 @@ var CAPTION_SCHEMA = createSchema({
1232
1201
  tag: CAPTION_TAG,
1233
1202
  requiredAttributes: [...ID_ATTRS],
1234
1203
  optionalAttributes: [],
1235
- allowedChildTagNames: [{ tagName: PARA_TAG, required: false }]
1204
+ allowedChildrenCodes: [{ code: "para", required: false }]
1236
1205
  });
1237
1206
 
1238
1207
  // src/schema/elementSchemas/elements/figure/figsource.ts
@@ -1242,9 +1211,9 @@ var FIGSOURCE_SCHEMA = createSchema({
1242
1211
  tag: FIGSOURCE_TAG,
1243
1212
  requiredAttributes: [...ID_ATTRS],
1244
1213
  optionalAttributes: [],
1245
- allowedChildTagNames: [
1246
- ...ATOM_TAGS_ALLOWED_CHILDREN,
1247
- ...INLINE_ELEMENT_TAGS_ALLOWED_CHILDREN
1214
+ allowedChildrenCodes: [
1215
+ ...ATOM_CODES_ALLOWED_CHILDREN,
1216
+ ...INLINE_ELEMENT_CODES_ALLOWED_CHILDREN
1248
1217
  ]
1249
1218
  });
1250
1219
 
@@ -1255,9 +1224,9 @@ var FIGNOTE_SCHEMA = createSchema({
1255
1224
  tag: FIGNOTE_TAG,
1256
1225
  requiredAttributes: [...ID_ATTRS],
1257
1226
  optionalAttributes: [],
1258
- allowedChildTagNames: [
1259
- ...ATOM_TAGS_ALLOWED_CHILDREN,
1260
- ...INLINE_ELEMENT_TAGS_ALLOWED_CHILDREN
1227
+ allowedChildrenCodes: [
1228
+ ...ATOM_CODES_ALLOWED_CHILDREN,
1229
+ ...INLINE_ELEMENT_CODES_ALLOWED_CHILDREN
1261
1230
  ]
1262
1231
  });
1263
1232
 
@@ -1274,12 +1243,12 @@ var FIGURE_SCHEMA = createSchema({
1274
1243
  "linkend_fig",
1275
1244
  "data-anchor-id"
1276
1245
  ],
1277
- allowedChildTagNames: [
1278
- { tagName: MEDIAOBJECT_TAG, required: false },
1279
- { tagName: LABEL_TAG, required: false },
1280
- { tagName: CAPTION_TAG, required: false },
1281
- { tagName: FIGSOURCE_TAG, required: false },
1282
- { tagName: FIGNOTE_TAG, required: false }
1246
+ allowedChildrenCodes: [
1247
+ { code: "mediaobject", required: false },
1248
+ { code: "label1", required: false },
1249
+ { code: "caption1", required: false },
1250
+ { code: "figsource", required: false },
1251
+ { code: "fignote", required: false }
1283
1252
  ]
1284
1253
  });
1285
1254
 
@@ -1299,9 +1268,9 @@ var FOOTNOTE_SCHEMA = createSchema({
1299
1268
  }
1300
1269
  ],
1301
1270
  optionalAttributes: [...TRACK_CHANGES_ATTRS],
1302
- allowedChildTagNames: [
1303
- { tagName: FOOTNOTE_NUMBER_TAG, required: false },
1304
- { tagName: PARA_TAG, required: false }
1271
+ allowedChildrenCodes: [
1272
+ { code: "footnoteno", required: false },
1273
+ { code: "para", required: false }
1305
1274
  ]
1306
1275
  });
1307
1276
 
@@ -1312,7 +1281,7 @@ var FOOTNOTE_NUMBER_SCHEMA = createSchema({
1312
1281
  tag: FOOTNOTE_NUMBER_TAG,
1313
1282
  requiredAttributes: [...ID_ATTRS],
1314
1283
  optionalAttributes: [...TRACK_CHANGES_ATTRS],
1315
- allowedChildTagNames: []
1284
+ allowedChildrenCodes: []
1316
1285
  });
1317
1286
 
1318
1287
  // src/schema/elementSchemas/elements/informalfigure.ts
@@ -1322,9 +1291,9 @@ var INFORMALFIGURE_SCHEMA = createSchema({
1322
1291
  tag: INFORMALFIGURE_TAG,
1323
1292
  requiredAttributes: [...ID_ATTRS],
1324
1293
  optionalAttributes: [...TRACK_CHANGES_ATTRS, "data-anchor-id"],
1325
- allowedChildTagNames: [
1326
- { tagName: MEDIAOBJECT_TAG, required: false },
1327
- { tagName: TAG_TAG, required: false }
1294
+ allowedChildrenCodes: [
1295
+ { code: "mediaobject", required: false },
1296
+ { code: "tag", required: false }
1328
1297
  ]
1329
1298
  });
1330
1299
 
@@ -1342,10 +1311,10 @@ var KEYWORDSET_SCHEMA = createSchema({
1342
1311
  }
1343
1312
  ],
1344
1313
  optionalAttributes: [],
1345
- allowedChildTagNames: [
1346
- { tagName: KEYWORD_TAG, required: false },
1347
- { tagName: TITLE_TAG, required: false },
1348
- { tagName: PUNC_TAG, required: false }
1314
+ allowedChildrenCodes: [
1315
+ { code: "keyword", required: false },
1316
+ { code: "title1", required: false },
1317
+ { code: "punc", required: false }
1349
1318
  ]
1350
1319
  });
1351
1320
 
@@ -1356,9 +1325,9 @@ var KEYWORD_SCHEMA = createSchema({
1356
1325
  tag: KEYWORD_TAG,
1357
1326
  requiredAttributes: [...ID_ATTRS],
1358
1327
  optionalAttributes: ["data-pos"],
1359
- allowedChildTagNames: [
1360
- ...ATOM_TAGS_ALLOWED_CHILDREN,
1361
- { tagName: PHRASE_TAG, required: false }
1328
+ allowedChildrenCodes: [
1329
+ ...ATOM_CODES_ALLOWED_CHILDREN,
1330
+ { code: "phrase", required: false }
1362
1331
  ]
1363
1332
  });
1364
1333
 
@@ -1369,7 +1338,7 @@ var PUNC_SCHEMA = createSchema({
1369
1338
  tag: PUNC_TAG,
1370
1339
  requiredAttributes: [...ID_ATTRS],
1371
1340
  optionalAttributes: ["data-role"],
1372
- allowedChildTagNames: [...ATOM_TAGS_ALLOWED_CHILDREN]
1341
+ allowedChildrenCodes: [...ATOM_CODES_ALLOWED_CHILDREN]
1373
1342
  });
1374
1343
 
1375
1344
  // src/schema/elementSchemas/elements/label.ts
@@ -1386,12 +1355,9 @@ var LABEL_SCHEMA = createSchema({
1386
1355
  defaultValue: "false"
1387
1356
  }
1388
1357
  ],
1389
- allowedChildTagNames: [
1390
- ...ATOM_TAGS_ALLOWED_CHILDREN,
1391
- {
1392
- tagName: LINK_TAG,
1393
- required: false
1394
- }
1358
+ allowedChildrenCodes: [
1359
+ ...ATOM_CODES_ALLOWED_CHILDREN,
1360
+ { code: "link", required: false }
1395
1361
  ]
1396
1362
  });
1397
1363
 
@@ -1402,7 +1368,7 @@ var TOKEN_SCHEMA = createSchema({
1402
1368
  tag: TOKEN_TAG,
1403
1369
  requiredAttributes: [...ID_ATTRS],
1404
1370
  optionalAttributes: [],
1405
- allowedChildTagNames: []
1371
+ allowedChildrenCodes: []
1406
1372
  });
1407
1373
 
1408
1374
  // src/schema/elementSchemas/elements/list/li.ts
@@ -1426,11 +1392,11 @@ var LI_SCHEMA = createSchema({
1426
1392
  defaultValue: "add-element"
1427
1393
  }
1428
1394
  ],
1429
- allowedChildTagNames: [
1430
- { tagName: PARA_TAG, required: false },
1431
- { tagName: TAG_TAG, required: false },
1432
- { tagName: UL_TAG, required: false },
1433
- { tagName: OL_TAG, required: false }
1395
+ allowedChildrenCodes: [
1396
+ { code: "para", required: false },
1397
+ { code: "tag", required: false },
1398
+ { code: "ul", required: false },
1399
+ { code: "ol", required: false }
1434
1400
  ]
1435
1401
  });
1436
1402
 
@@ -1468,7 +1434,7 @@ var OL_SCHEMA = createSchema({
1468
1434
  defaultValue: "disc"
1469
1435
  }
1470
1436
  ],
1471
- allowedChildTagNames: [{ tagName: LI_TAG, required: false }]
1437
+ allowedChildrenCodes: [{ code: "li", required: false }]
1472
1438
  });
1473
1439
 
1474
1440
  // src/schema/elementSchemas/elements/list/ul.ts
@@ -1509,7 +1475,7 @@ var UL_SCHEMA = createSchema({
1509
1475
  defaultValue: "disc"
1510
1476
  }
1511
1477
  ],
1512
- allowedChildTagNames: [{ tagName: LI_TAG, required: false }]
1478
+ allowedChildrenCodes: [{ code: "li", required: false }]
1513
1479
  });
1514
1480
 
1515
1481
  // src/schema/elementSchemas/elements/para.ts
@@ -1525,17 +1491,17 @@ var PARA_SCHEMA = createSchema({
1525
1491
  "role",
1526
1492
  "data-pos"
1527
1493
  ],
1528
- allowedChildTagNames: [
1529
- ...ATOM_TAGS_ALLOWED_CHILDREN,
1530
- ...INLINE_ELEMENT_TAGS_ALLOWED_CHILDREN,
1531
- { tagName: SIDEBAR_TAG, required: false },
1532
- { tagName: TAG_TAG, required: false },
1533
- { tagName: TABLE_TAG, required: false },
1534
- { tagName: SOURCE_TAG, required: false },
1535
- { tagName: INFORMALFIGURE_TAG, required: false },
1536
- { tagName: FIGURE_TAG, required: false },
1537
- { tagName: TOKEN_TAG, required: false },
1538
- { tagName: BIBLIOMIXED_TAG, required: false }
1494
+ allowedChildrenCodes: [
1495
+ ...ATOM_CODES_ALLOWED_CHILDREN,
1496
+ ...INLINE_ELEMENT_CODES_ALLOWED_CHILDREN,
1497
+ { code: "sidebar", required: false },
1498
+ { code: "tag", required: false },
1499
+ { code: "table1", required: false },
1500
+ { code: "source1", required: false },
1501
+ { code: "informalfigure", required: false },
1502
+ { code: "figure1", required: false },
1503
+ { code: "token", required: false },
1504
+ { code: "referenceBibliomixed", required: false }
1539
1505
  ]
1540
1506
  });
1541
1507
 
@@ -1546,7 +1512,7 @@ var TAG_SCHEMA = createSchema({
1546
1512
  tag: TAG_TAG,
1547
1513
  requiredAttributes: [...ID_ATTRS, "data-id"],
1548
1514
  optionalAttributes: [],
1549
- allowedChildTagNames: []
1515
+ allowedChildrenCodes: []
1550
1516
  });
1551
1517
 
1552
1518
  // src/schema/elementSchemas/elements/runningHeads/lrh.ts
@@ -1556,9 +1522,9 @@ var LRH_SCHEMA = createSchema({
1556
1522
  tag: LRH_TAG,
1557
1523
  requiredAttributes: [...ID_ATTRS],
1558
1524
  optionalAttributes: [],
1559
- allowedChildTagNames: [
1560
- ...ATOM_TAGS_ALLOWED_CHILDREN,
1561
- { tagName: PHRASE_TAG, required: false }
1525
+ allowedChildrenCodes: [
1526
+ ...ATOM_CODES_ALLOWED_CHILDREN,
1527
+ { code: "phrase", required: false }
1562
1528
  ]
1563
1529
  });
1564
1530
 
@@ -1569,9 +1535,10 @@ var RRH_SCHEMA = createSchema({
1569
1535
  tag: RRH_TAG,
1570
1536
  requiredAttributes: [...ID_ATTRS],
1571
1537
  optionalAttributes: [],
1572
- allowedChildTagNames: [
1573
- ...ATOM_TAGS_ALLOWED_CHILDREN,
1574
- { tagName: PHRASE_TAG, required: false }
1538
+ defaultChildCode: "rrh",
1539
+ allowedChildrenCodes: [
1540
+ ...ATOM_CODES_ALLOWED_CHILDREN,
1541
+ { code: "phrase", required: false }
1575
1542
  ]
1576
1543
  });
1577
1544
 
@@ -1589,9 +1556,9 @@ var SOURCE_SCHEMA = createSchema({
1589
1556
  defaultValue: "add-element"
1590
1557
  }
1591
1558
  ],
1592
- allowedChildTagNames: [
1593
- ...ATOM_TAGS_ALLOWED_CHILDREN,
1594
- ...INLINE_ELEMENT_TAGS_ALLOWED_CHILDREN
1559
+ allowedChildrenCodes: [
1560
+ ...ATOM_CODES_ALLOWED_CHILDREN,
1561
+ ...INLINE_ELEMENT_CODES_ALLOWED_CHILDREN
1595
1562
  ]
1596
1563
  });
1597
1564
 
@@ -1608,9 +1575,9 @@ var SUBTITLE_SCHEMA = createSchema({
1608
1575
  defaultValue: "add-element"
1609
1576
  }
1610
1577
  ],
1611
- allowedChildTagNames: [
1612
- ...ATOM_TAGS_ALLOWED_CHILDREN,
1613
- { tagName: PHRASE_TAG, required: false }
1578
+ allowedChildrenCodes: [
1579
+ ...ATOM_CODES_ALLOWED_CHILDREN,
1580
+ { code: "phrase", required: false }
1614
1581
  ]
1615
1582
  });
1616
1583
 
@@ -1621,9 +1588,9 @@ var TP_SCHEMA = createSchema({
1621
1588
  tag: TP_TAG,
1622
1589
  requiredAttributes: [],
1623
1590
  optionalAttributes: [...ID_ATTRS],
1624
- allowedChildTagNames: [
1625
- ...ATOM_TAGS_ALLOWED_CHILDREN,
1626
- ...INLINE_ELEMENT_TAGS_ALLOWED_CHILDREN
1591
+ allowedChildrenCodes: [
1592
+ ...ATOM_CODES_ALLOWED_CHILDREN,
1593
+ ...INLINE_ELEMENT_CODES_ALLOWED_CHILDREN
1627
1594
  ]
1628
1595
  });
1629
1596
 
@@ -1638,10 +1605,10 @@ var TD_SCHEMA = createSchema({
1638
1605
  LAYOUT_CELL_WIDTH_ATTRIBUTE,
1639
1606
  "width"
1640
1607
  ],
1641
- allowedChildTagNames: [
1642
- { tagName: TP_TAG, required: false },
1643
- { tagName: UL_TAG, required: false },
1644
- { tagName: OL_TAG, required: false }
1608
+ allowedChildrenCodes: [
1609
+ { code: "tp", required: false },
1610
+ { code: "ul", required: false },
1611
+ { code: "ol", required: false }
1645
1612
  ]
1646
1613
  });
1647
1614
 
@@ -1652,7 +1619,7 @@ var TR_SCHEMA = createSchema({
1652
1619
  tag: TR_TAG,
1653
1620
  requiredAttributes: [],
1654
1621
  optionalAttributes: [...LAYOUT_ATTRIBUTES, ...ID_ATTRS, "width"],
1655
- allowedChildTagNames: [{ tagName: TD_TAG, required: true }]
1622
+ allowedChildrenCodes: [{ code: "td", required: true }]
1656
1623
  });
1657
1624
 
1658
1625
  // src/schema/elementSchemas/elements/table/thead.ts
@@ -1662,7 +1629,7 @@ var THEAD_SCHEMA = createSchema({
1662
1629
  tag: THEAD_TAG,
1663
1630
  requiredAttributes: [],
1664
1631
  optionalAttributes: [...ID_ATTRS],
1665
- allowedChildTagNames: [{ tagName: TR_TAG, required: true }]
1632
+ allowedChildrenCodes: [{ code: "tr", required: true }]
1666
1633
  });
1667
1634
 
1668
1635
  // src/schema/elementSchemas/elements/table/tbody.ts
@@ -1672,7 +1639,7 @@ var TBODY_SCHEMA = createSchema({
1672
1639
  tag: TBODY_TAG,
1673
1640
  requiredAttributes: [],
1674
1641
  optionalAttributes: [...ID_ATTRS],
1675
- allowedChildTagNames: [{ tagName: TR_TAG, required: true }]
1642
+ allowedChildrenCodes: [{ code: "tr", required: true }]
1676
1643
  });
1677
1644
 
1678
1645
  // src/schema/elementSchemas/elements/table/htmlTable.ts
@@ -1682,9 +1649,10 @@ var HTML_TABLE_SCHEMA = createSchema({
1682
1649
  tag: HTML_TABLE_TAG,
1683
1650
  requiredAttributes: [],
1684
1651
  optionalAttributes: [...ID_ATTRS],
1685
- allowedChildTagNames: [
1686
- { tagName: THEAD_TAG, required: false },
1687
- { tagName: TBODY_TAG, required: true }
1652
+ defaultChildCode: "table",
1653
+ allowedChildrenCodes: [
1654
+ { code: "thead", required: false },
1655
+ { code: "tbody", required: true }
1688
1656
  ]
1689
1657
  });
1690
1658
 
@@ -1695,7 +1663,7 @@ var TGROUP_SCHEMA = createSchema({
1695
1663
  tag: TGROUP_TAG,
1696
1664
  requiredAttributes: [...ID_ATTRS, "cols"],
1697
1665
  optionalAttributes: [],
1698
- allowedChildTagNames: [{ tagName: HTML_TABLE_TAG, required: true }]
1666
+ allowedChildrenCodes: [{ code: "table", required: true }]
1699
1667
  });
1700
1668
 
1701
1669
  // src/schema/elementSchemas/elements/table/tblfn.ts
@@ -1705,9 +1673,9 @@ var TBLFN_SCHEMA = createSchema({
1705
1673
  tag: TBLFN_TAG,
1706
1674
  requiredAttributes: [...ID_ATTRS],
1707
1675
  optionalAttributes: [],
1708
- allowedChildTagNames: [
1709
- ...ATOM_TAGS_ALLOWED_CHILDREN,
1710
- ...INLINE_ELEMENT_TAGS_ALLOWED_CHILDREN
1676
+ allowedChildrenCodes: [
1677
+ ...ATOM_CODES_ALLOWED_CHILDREN,
1678
+ ...INLINE_ELEMENT_CODES_ALLOWED_CHILDREN
1711
1679
  ]
1712
1680
  });
1713
1681
 
@@ -1718,7 +1686,7 @@ var TBLSOURCE_SCHEMA = createSchema({
1718
1686
  tag: TBLSOURCE_TAG,
1719
1687
  requiredAttributes: [],
1720
1688
  optionalAttributes: [],
1721
- allowedChildTagNames: [...ATOM_TAGS_ALLOWED_CHILDREN]
1689
+ allowedChildrenCodes: [...ATOM_CODES_ALLOWED_CHILDREN]
1722
1690
  });
1723
1691
 
1724
1692
  // src/schema/elementSchemas/elements/table/table1.ts
@@ -1745,12 +1713,12 @@ var TABLE_SCHEMA = createSchema({
1745
1713
  "orient",
1746
1714
  "xmlid"
1747
1715
  ],
1748
- allowedChildTagNames: [
1749
- { tagName: LABEL_TAG, required: false },
1750
- { tagName: TGROUP_TAG, required: true },
1751
- { tagName: TITLE_TAG, required: false },
1752
- { tagName: TBLFN_TAG, required: false },
1753
- { tagName: TBLSOURCE_TAG, required: false }
1716
+ allowedChildrenCodes: [
1717
+ { code: "label1", required: false },
1718
+ { code: "tgroup", required: true },
1719
+ { code: "title1", required: false },
1720
+ { code: "tblfn", required: false },
1721
+ { code: "tblsource", required: false }
1754
1722
  ]
1755
1723
  });
1756
1724
 
@@ -1775,9 +1743,9 @@ var TITLE_SCHEMA = createSchema({
1775
1743
  defaultValue: "H1"
1776
1744
  }
1777
1745
  ],
1778
- allowedChildTagNames: [
1779
- ...ATOM_TAGS_ALLOWED_CHILDREN,
1780
- { tagName: PHRASE_TAG, required: false }
1746
+ allowedChildrenCodes: [
1747
+ ...ATOM_CODES_ALLOWED_CHILDREN,
1748
+ { code: "phrase", required: false }
1781
1749
  ]
1782
1750
  });
1783
1751
 
@@ -1802,12 +1770,12 @@ var ABSTRACT_SCHEMA = createSchema({
1802
1770
  defaultValue: "blurb"
1803
1771
  }
1804
1772
  ],
1805
- defaultChildTagName: PARA_TAG,
1806
- allowedChildTagNames: [
1807
- { tagName: PARA_TAG, required: false },
1808
- { tagName: TITLE_TAG, required: false },
1809
- { tagName: UL_TAG, required: false },
1810
- { tagName: OL_TAG, required: false }
1773
+ defaultChildCode: "para",
1774
+ allowedChildrenCodes: [
1775
+ { code: "para", required: false },
1776
+ { code: "title1", required: false },
1777
+ { code: "ul", required: false },
1778
+ { code: "ol", required: false }
1811
1779
  ]
1812
1780
  });
1813
1781
 
@@ -1818,11 +1786,11 @@ var APPENDIX_SCHEMA = createSchema({
1818
1786
  tag: APPENDIX_TAG,
1819
1787
  requiredAttributes: [...ID_ATTRS, "id", "xmlid"],
1820
1788
  optionalAttributes: [...TRACK_CHANGES_ATTRS],
1821
- defaultChildTagName: PARA_TAG,
1822
- allowedChildTagNames: [
1823
- { tagName: PARA_TAG, required: false },
1824
- { tagName: TITLE_TAG, required: false },
1825
- { tagName: LABEL_TAG, required: false }
1789
+ defaultChildCode: "para",
1790
+ allowedChildrenCodes: [
1791
+ { code: "para", required: false },
1792
+ { code: "title1", required: false },
1793
+ { code: "label1", required: false }
1826
1794
  ]
1827
1795
  });
1828
1796
 
@@ -1843,13 +1811,13 @@ var BLOCKQUOTE_SCHEMA = createSchema({
1843
1811
  defaultValue: "add-element"
1844
1812
  }
1845
1813
  ],
1846
- defaultChildTagName: PARA_TAG,
1847
- allowedChildTagNames: [
1848
- { tagName: PARA_TAG, required: false },
1849
- { tagName: UL_TAG, required: false },
1850
- { tagName: OL_TAG, required: false },
1851
- { tagName: SIDEBAR_TAG, required: false },
1852
- { tagName: SOURCE_TAG, required: false }
1814
+ defaultChildCode: "para",
1815
+ allowedChildrenCodes: [
1816
+ { code: "para", required: false },
1817
+ { code: "ul", required: false },
1818
+ { code: "ol", required: false },
1819
+ { code: "sidebar", required: false },
1820
+ { code: "source1", required: false }
1853
1821
  ]
1854
1822
  });
1855
1823
 
@@ -1875,10 +1843,10 @@ var BOX_SCHEMA = createSchema({
1875
1843
  defaultValue: "add-element"
1876
1844
  }
1877
1845
  ],
1878
- defaultChildTagName: PARA_TAG,
1879
- allowedChildTagNames: [
1880
- { tagName: PARA_TAG, required: false },
1881
- { tagName: TITLE_TAG, required: false }
1846
+ defaultChildCode: "para",
1847
+ allowedChildrenCodes: [
1848
+ { code: "para", required: false },
1849
+ { code: "title1", required: false }
1882
1850
  ]
1883
1851
  });
1884
1852
 
@@ -1895,26 +1863,27 @@ var CHAPTER_SCHEMA = createSchema({
1895
1863
  "data-paragraph-numbering-elements",
1896
1864
  "data-paragraph-numbering-chapters"
1897
1865
  ],
1898
- defaultChildTagName: PARA_TAG,
1899
- allowedChildTagNames: [
1900
- { tagName: LRH_TAG, required: false },
1901
- { tagName: RRH_TAG, required: false },
1902
- { tagName: INFO_TAG, required: false },
1903
- { tagName: SECTION_TAG, required: false },
1904
- { tagName: PARA_TAG, required: false },
1905
- { tagName: TITLE_TAG, required: false },
1906
- { tagName: SIDEBAR_TAG, required: false },
1907
- { tagName: EPIGRAPH_TAG, required: false },
1908
- { tagName: BLOCKQUOTE_TAG, required: false },
1909
- { tagName: UL_TAG, required: false },
1910
- { tagName: OL_TAG, required: false },
1911
- { tagName: SUBTITLE_TAG, required: false },
1912
- { tagName: POEM_TAG, required: false },
1913
- { tagName: DIALOGUE_TAG, required: false },
1914
- { tagName: APPENDIX_TAG, required: false },
1915
- { tagName: TABLE_TAG, required: false },
1916
- { tagName: FIGURE_TAG, required: false },
1917
- { tagName: REFERENCE_BIBLIOGRAPHY_TAG, required: false }
1866
+ defaultChildCode: "para",
1867
+ allowedChildrenCodes: [
1868
+ { code: "lrh", required: false },
1869
+ { code: "rrh", required: false },
1870
+ { code: "info1", required: false },
1871
+ { code: "heading", required: false },
1872
+ { code: "footnoteSection", required: false },
1873
+ { code: "para", required: false },
1874
+ { code: "title1", required: false },
1875
+ { code: "sidebar", required: false },
1876
+ { code: "epigraph", required: false },
1877
+ { code: "blockquote", required: false },
1878
+ { code: "ul", required: false },
1879
+ { code: "ol", required: false },
1880
+ { code: "subtitle1", required: false },
1881
+ { code: "poem", required: false },
1882
+ { code: "dialogue", required: false },
1883
+ { code: "appendix", required: false },
1884
+ { code: "table1", required: false },
1885
+ { code: "figure1", required: false },
1886
+ { code: "referenceBibliography", required: false }
1918
1887
  ]
1919
1888
  });
1920
1889
 
@@ -1933,8 +1902,8 @@ var EPIGRAPH_SCHEMA = createSchema({
1933
1902
  defaultValue: "add-element"
1934
1903
  }
1935
1904
  ],
1936
- defaultChildTagName: PARA_TAG,
1937
- allowedChildTagNames: [{ tagName: PARA_TAG, required: false }]
1905
+ defaultChildCode: "para",
1906
+ allowedChildrenCodes: [{ code: "para", required: false }]
1938
1907
  });
1939
1908
 
1940
1909
  // src/schema/elementSchemas/elements/footnoteSection.ts
@@ -1951,10 +1920,10 @@ var FOOTNOTE_SECTION_SCHEMA = createSchema({
1951
1920
  }
1952
1921
  ],
1953
1922
  optionalAttributes: [...TRACK_CHANGES_ATTRS],
1954
- defaultChildTagName: PARA_TAG,
1955
- allowedChildTagNames: [
1956
- { tagName: FOOTNOTE_TAG, required: true },
1957
- { tagName: TITLE_TAG, required: true }
1923
+ defaultChildCode: "para",
1924
+ allowedChildrenCodes: [
1925
+ { code: "footnote", required: true },
1926
+ { code: "title1", required: true }
1958
1927
  ]
1959
1928
  });
1960
1929
 
@@ -1973,25 +1942,26 @@ var HEADING_SCHEMA = createSchema({
1973
1942
  }
1974
1943
  ],
1975
1944
  optionalAttributes: [...TRACK_CHANGES_ATTRS],
1976
- defaultChildTagName: PARA_TAG,
1977
- allowedChildTagNames: [
1978
- { tagName: TITLE_TAG, required: false },
1979
- { tagName: LABEL_TAG, required: false },
1980
- { tagName: PARA_TAG, required: false },
1981
- { tagName: SUBTITLE_TAG, required: false },
1982
- { tagName: SIDEBAR_TAG, required: false },
1983
- { tagName: EPIGRAPH_TAG, required: false },
1984
- { tagName: BLOCKQUOTE_TAG, required: false },
1985
- { tagName: UL_TAG, required: false },
1986
- { tagName: OL_TAG, required: false },
1987
- { tagName: POEM_TAG, required: false },
1988
- { tagName: DIALOGUE_TAG, required: false },
1989
- { tagName: APPENDIX_TAG, required: false },
1990
- { tagName: TABLE_TAG, required: false },
1991
- { tagName: FIGURE_TAG, required: false },
1992
- { tagName: SECTION_TAG, required: false },
1993
- { tagName: INFO_TAG, required: false },
1994
- { tagName: EQUATION_TAG, required: false }
1945
+ defaultChildCode: "para",
1946
+ allowedChildrenCodes: [
1947
+ { code: "title1", required: false },
1948
+ { code: "label1", required: false },
1949
+ { code: "para", required: false },
1950
+ { code: "subtitle1", required: false },
1951
+ { code: "sidebar", required: false },
1952
+ { code: "epigraph", required: false },
1953
+ { code: "blockquote", required: false },
1954
+ { code: "ul", required: false },
1955
+ { code: "ol", required: false },
1956
+ { code: "poem", required: false },
1957
+ { code: "dialogue", required: false },
1958
+ { code: "appendix", required: false },
1959
+ { code: "table1", required: false },
1960
+ { code: "figure1", required: false },
1961
+ { code: "heading", required: false },
1962
+ { code: "footnoteSection", required: false },
1963
+ { code: "info1", required: false },
1964
+ { code: "equation", required: false }
1995
1965
  ]
1996
1966
  });
1997
1967
 
@@ -2002,14 +1972,14 @@ var INFO_SCHEMA = createSchema({
2002
1972
  tag: INFO_TAG,
2003
1973
  requiredAttributes: [...ID_ATTRS],
2004
1974
  optionalAttributes: [],
2005
- defaultChildTagName: SUBTITLE_TAG,
2006
- allowedChildTagNames: [
2007
- { tagName: LABEL_TAG, required: true },
2008
- { tagName: TITLE_TAG, required: true },
2009
- { tagName: SUBTITLE_TAG, required: false },
2010
- { tagName: ABSTRACT_TAG, required: false },
2011
- { tagName: KEYWORDSET_TAG, required: false },
2012
- { tagName: AUTHORGROUP_TAG, required: false }
1975
+ defaultChildCode: "subtitle1",
1976
+ allowedChildrenCodes: [
1977
+ { code: "label1", required: true },
1978
+ { code: "title1", required: true },
1979
+ { code: "subtitle1", required: false },
1980
+ { code: "abstract1", required: false },
1981
+ { code: "keywordset", required: false },
1982
+ { code: "authorgroup", required: false }
2013
1983
  ]
2014
1984
  });
2015
1985
 
@@ -2020,10 +1990,10 @@ var POEM_SCHEMA = createSchema({
2020
1990
  tag: POEM_TAG,
2021
1991
  requiredAttributes: [...ID_ATTRS],
2022
1992
  optionalAttributes: [...TRACK_CHANGES_ATTRS, "role"],
2023
- defaultChildTagName: LINE_TAG,
2024
- allowedChildTagNames: [
2025
- { tagName: LINE_TAG, required: true },
2026
- { tagName: SOURCE_TAG, required: false }
1993
+ defaultChildCode: "line",
1994
+ allowedChildrenCodes: [
1995
+ { code: "line", required: true },
1996
+ { code: "source1", required: false }
2027
1997
  ]
2028
1998
  });
2029
1999
 
@@ -2034,10 +2004,14 @@ var MATHPHRASE_SCHEMA = createSchema({
2034
2004
  tag: MATHPHRASE_TAG,
2035
2005
  requiredAttributes: [ELE_ID_ATTRIBUTE],
2036
2006
  optionalAttributes: [],
2037
- allowedChildTagNames: [
2038
- { tagName: MATH_TAG, required: true },
2007
+ allowedChildrenCodes: [
2008
+ { code: MATH_SCHEMA.code, required: true },
2009
+ {
2010
+ code: INSERTION_SCHEMA.code,
2011
+ required: false
2012
+ },
2039
2013
  {
2040
- tagName: SPAN_TAG,
2014
+ code: DELETION_SCHEMA.code,
2041
2015
  required: false
2042
2016
  }
2043
2017
  ]
@@ -2057,11 +2031,11 @@ var BIBLIODIV_SCHEMA = createSchema({
2057
2031
  }
2058
2032
  ],
2059
2033
  optionalAttributes: [],
2060
- allowedChildTagNames: [
2061
- { tagName: BIBLIODIV_TAG, required: false },
2062
- { tagName: BIBLIOMIXED_TAG, required: false },
2063
- { tagName: PARA_TAG, required: false },
2064
- { tagName: TITLE_TAG, required: false }
2034
+ allowedChildrenCodes: [
2035
+ { code: "bibliodiv", required: false },
2036
+ { code: "referenceBibliomixed", required: false },
2037
+ { code: "para", required: false },
2038
+ { code: "title1", required: false }
2065
2039
  ]
2066
2040
  });
2067
2041
 
@@ -2085,11 +2059,11 @@ var REFERENCE_BIBLIOGRAPHY_SCHEMA = createSchema({
2085
2059
  }
2086
2060
  ],
2087
2061
  optionalAttributes: [],
2088
- allowedChildTagNames: [
2089
- { tagName: BIBLIODIV_TAG, required: false },
2090
- { tagName: BIBLIOMIXED_TAG, required: false },
2091
- { tagName: PARA_TAG, required: false },
2092
- { tagName: TITLE_TAG, required: false }
2062
+ allowedChildrenCodes: [
2063
+ { code: "bibliodiv", required: false },
2064
+ { code: "referenceBibliomixed", required: false },
2065
+ { code: "para", required: false },
2066
+ { code: "title1", required: false }
2093
2067
  ]
2094
2068
  });
2095
2069
 
@@ -2104,7 +2078,7 @@ var BIBLIOMIXED_SCHEMA = createSchema({
2104
2078
  TRACK_CHANGES_ATTR_DATA_USERID,
2105
2079
  TRACK_CHANGES_ATTR_DATA_DATE
2106
2080
  ],
2107
- allowedChildTagNames: []
2081
+ allowedChildrenCodes: []
2108
2082
  });
2109
2083
 
2110
2084
  // src/schema/elementSchemas/elements/index.ts
@@ -2203,6 +2177,13 @@ var ELEMENT_SCHEMAS = {
2203
2177
  affiliation: AFFILIATION_SCHEMA
2204
2178
  };
2205
2179
 
2180
+ // src/schema/elementSchemas/inlineElements/inlineElementsTags.ts
2181
+ var FOOTNOTE_LINK_TAG = "FOOTNOTE1";
2182
+ var INLINEEQUATION_TAG = "INLINEEQUATION";
2183
+ var LINK_TAG = "LINK1";
2184
+ var URI_TAG = "URI";
2185
+ var PHRASE_TAG = "PHRASE";
2186
+
2206
2187
  // src/schema/elementSchemas/inlineElements/footnoteLink.ts
2207
2188
  var FOOTNOTE_LINK_SCHEMA = createSchema({
2208
2189
  code: "footnote1",
@@ -2210,8 +2191,8 @@ var FOOTNOTE_LINK_SCHEMA = createSchema({
2210
2191
  tag: FOOTNOTE_LINK_TAG,
2211
2192
  requiredAttributes: [...ID_ATTRS],
2212
2193
  optionalAttributes: ["linkend"],
2213
- defaultChildTagName: SUP_TAG,
2214
- allowedChildTagNames: [{ tagName: SUP_TAG, required: true }]
2194
+ defaultChildCode: "sup",
2195
+ allowedChildrenCodes: [{ code: "sup", required: true }]
2215
2196
  });
2216
2197
 
2217
2198
  // src/schema/elementSchemas/inlineElements/inlineequation.ts
@@ -2233,12 +2214,7 @@ var INLINEEQUATION_SCHEMA = createSchema({
2233
2214
  defaultValue: "added"
2234
2215
  }
2235
2216
  ],
2236
- allowedChildTagNames: [{ tagName: MATHPHRASE_TAG, required: true }],
2237
- forbiddenElements: [
2238
- { code: QUERY_SCHEMA.code, resolveTo: "skip" },
2239
- { code: COMMENT_SCHEMA.code, resolveTo: "skip" },
2240
- { code: COMMENT_QUERY_SECTION_SCHEMA.code, resolveTo: "skip" }
2241
- ]
2217
+ allowedChildrenCodes: [{ code: "mathphrase", required: true }]
2242
2218
  });
2243
2219
 
2244
2220
  // src/schema/elementSchemas/inlineElements/link.ts
@@ -2257,7 +2233,7 @@ var LINK_SCHEMA = createSchema({
2257
2233
  }
2258
2234
  ],
2259
2235
  optionalAttributes: [],
2260
- allowedChildTagNames: [...ATOM_TAGS_ALLOWED_CHILDREN]
2236
+ allowedChildrenCodes: [...ATOM_CODES_ALLOWED_CHILDREN]
2261
2237
  });
2262
2238
 
2263
2239
  // src/schema/elementSchemas/inlineElements/uri.ts
@@ -2267,7 +2243,7 @@ var URI_SCHEMA = createSchema({
2267
2243
  tag: URI_TAG,
2268
2244
  requiredAttributes: [...ID_ATTRS],
2269
2245
  optionalAttributes: ["linkend"],
2270
- allowedChildTagNames: [...ATOM_TAGS_ALLOWED_CHILDREN]
2246
+ allowedChildrenCodes: [...ATOM_CODES_ALLOWED_CHILDREN]
2271
2247
  });
2272
2248
 
2273
2249
  // src/schema/elementSchemas/inlineElements/phrase.ts
@@ -2277,7 +2253,7 @@ var PHRASE_SCHEMA = createSchema({
2277
2253
  tag: PHRASE_TAG,
2278
2254
  requiredAttributes: [...ID_ATTRS, "xml:lang"],
2279
2255
  optionalAttributes: [],
2280
- allowedChildTagNames: [...ATOM_TAGS_ALLOWED_CHILDREN]
2256
+ allowedChildrenCodes: [...ATOM_CODES_ALLOWED_CHILDREN]
2281
2257
  });
2282
2258
 
2283
2259
  // src/schema/elementSchemas/inlineElements/index.ts
@@ -2429,6 +2405,9 @@ var IGNORED_ELEMENT_SELECTORS = [
2429
2405
  "span.missLink",
2430
2406
  "span.ref-drag"
2431
2407
  ];
2408
+ var IGNORED_VALIDATION_ELEMENT_SELECTORS = [
2409
+ "referenceBibliomixed"
2410
+ ];
2432
2411
 
2433
2412
  // src/schema/shared/ignoredAttributes.ts
2434
2413
  var IGNORED_ATTRIBUTES = [
@@ -2455,13 +2434,8 @@ var isIgnoredAttribute = (attribute) => IGNORED_ATTRIBUTES.includes(attribute) |
2455
2434
  (startsWith) => attribute.startsWith(startsWith)
2456
2435
  );
2457
2436
  var isIgnoredElement = (element) => IGNORED_ELEMENT_SELECTORS.some((selector) => element.matches(selector));
2437
+ var isIgnoredValidation = (code) => IGNORED_VALIDATION_ELEMENT_SELECTORS.includes(code);
2458
2438
  var findSchemaByCode = (code) => SCHEMAS[code];
2459
- var findSchemaByTagName = (tagName) => {
2460
- const candidates = Object.values(SCHEMAS).filter(
2461
- (schema) => schema.tag === tagName.toUpperCase()
2462
- );
2463
- return candidates;
2464
- };
2465
2439
  var findSchemaByElement = (element) => {
2466
2440
  const tagName = element.tagName.toUpperCase();
2467
2441
  const isInsertion = element.classList.contains("ins");
@@ -2493,14 +2467,12 @@ var findSchemaByElement = (element) => {
2493
2467
  return findSchemaByCode("footnoteSection");
2494
2468
  }
2495
2469
  }
2496
- const candidates = findSchemaByTagName(element.tagName.toUpperCase());
2497
- return candidates[0];
2498
2470
  };
2499
2471
  var isAttributeRestricted = (attr) => typeof attr !== "string";
2500
- var getAttributeName = (attribute) => typeof attribute === "string" ? attribute : attribute.name;
2472
+ var getAttributeName = (attribute) => typeof attribute === "string" ? attribute.toLowerCase() : attribute.name.toLowerCase();
2501
2473
  var findAttributeDefinitionByName = (definitions, name) => {
2502
2474
  for (const def of definitions) {
2503
- if (getAttributeName(def) === name) {
2475
+ if (getAttributeName(def) === name.toLowerCase()) {
2504
2476
  return def;
2505
2477
  }
2506
2478
  }
@@ -2732,7 +2704,7 @@ var validateAttributes = (element, schema) => {
2732
2704
  };
2733
2705
 
2734
2706
  // src/validation/validateChildren.ts
2735
- var validateElementAgainstSchema = (element, schema, inheritedForbiddenScope) => {
2707
+ var validateElementAgainstSchema = (element, schema) => {
2736
2708
  const errors = [];
2737
2709
  if (element.tagName.toUpperCase() !== schema.tag) {
2738
2710
  addValidationIssue(errors, {
@@ -2744,20 +2716,19 @@ var validateElementAgainstSchema = (element, schema, inheritedForbiddenScope) =>
2744
2716
  });
2745
2717
  }
2746
2718
  errors.push(...validateAttributes(element, schema));
2747
- errors.push(...validateChildren(element, schema, inheritedForbiddenScope));
2719
+ errors.push(...validateChildren(element, schema));
2748
2720
  return errors;
2749
2721
  };
2750
- var validateChildren = (element, schema, inheritedForbiddenScope) => {
2722
+ var validateChildren = (element, schema) => {
2751
2723
  const errors = [];
2752
2724
  const childElements = [...element.children].filter(
2753
2725
  (child) => !isIgnoredElement(child)
2754
2726
  );
2755
- const allowedChildren = [...schema.allowedChildTagNames];
2727
+ const allowedChildren = [...schema.allowedChildrenCodes];
2756
2728
  if (schema.kind === "atom") {
2757
2729
  return errors;
2758
2730
  }
2759
2731
  for (const child of childElements) {
2760
- const childTag = child.tagName.toUpperCase();
2761
2732
  const childSchema = findSchemaByElement(child);
2762
2733
  if (!childSchema) {
2763
2734
  addValidationIssue(errors, {
@@ -2769,25 +2740,8 @@ var validateChildren = (element, schema, inheritedForbiddenScope) => {
2769
2740
  });
2770
2741
  continue;
2771
2742
  }
2772
- const forbiddenScope = [
2773
- ...inheritedForbiddenScope || [],
2774
- ...childSchema.forbiddenElements || []
2775
- ];
2776
- const forbiddenChild = forbiddenScope.find(
2777
- (element2) => element2.code === childSchema.code
2778
- );
2779
- if (forbiddenChild) {
2780
- addValidationIssue(errors, {
2781
- store: getStore(child),
2782
- title: `Forbidden element ${child.tagName}`,
2783
- level: "blocker",
2784
- kind: "forbidden",
2785
- description: `The element ${ElementLabel[childSchema.code]} is not permitted within ${ElementLabel[schema.code]} content. Please delete the element or move it to a different location.`
2786
- });
2787
- continue;
2788
- }
2789
2743
  const allowedChild = allowedChildren.find(
2790
- (candidate) => candidate.tagName === childTag
2744
+ (candidate) => candidate.code === childSchema.code
2791
2745
  );
2792
2746
  if (!allowedChild) {
2793
2747
  addValidationIssue(errors, {
@@ -2799,32 +2753,28 @@ var validateChildren = (element, schema, inheritedForbiddenScope) => {
2799
2753
  });
2800
2754
  continue;
2801
2755
  }
2802
- errors.push(
2803
- ...validateElementAgainstSchema(
2804
- child,
2805
- childSchema,
2806
- new Set(forbiddenScope)
2807
- )
2808
- );
2756
+ errors.push(...validateElementAgainstSchema(child, childSchema));
2809
2757
  }
2810
2758
  for (const allowedChild of allowedChildren) {
2811
2759
  if (!allowedChild.required) {
2812
2760
  continue;
2813
2761
  }
2814
- const hasChild = childElements.some(
2815
- (child) => child.tagName.toUpperCase() === allowedChild.tagName
2816
- );
2762
+ const hasChild = childElements.some((child) => {
2763
+ const childSchema = findSchemaByElement(child);
2764
+ return childSchema?.code === allowedChild.code;
2765
+ });
2817
2766
  if (!hasChild) {
2767
+ const requiredChildLabel = ElementLabel[allowedChild.code];
2818
2768
  addValidationIssue(errors, {
2819
2769
  store: getStore(element),
2820
- title: `Missing required child element ${allowedChild.tagName}`,
2770
+ title: `Missing required child element ${requiredChildLabel}`,
2821
2771
  level: "warning",
2822
2772
  kind: "missing",
2823
- description: `The child element ${allowedChild.tagName} is required but not present.`
2773
+ description: `The child element ${requiredChildLabel} is required but not present.`
2824
2774
  });
2825
2775
  }
2826
2776
  }
2827
- if (schema.allowedChildTagNames.size === 0 && childElements.length > 0) {
2777
+ if (schema.allowedChildrenCodes.size === 0 && childElements.length > 0) {
2828
2778
  addValidationIssue(errors, {
2829
2779
  store: getStore(element),
2830
2780
  title: "Atom element cannot contain child elements",
@@ -2883,13 +2833,7 @@ var validateElement = (element, root, elementsToLink, linkElements, schemasToVal
2883
2833
  const schema = findSchemaByElement(element);
2884
2834
  if (schema) {
2885
2835
  if (schemasToValidateAgainst.includes(schema.code)) {
2886
- errors.push(
2887
- ...validateElementAgainstSchema(
2888
- element,
2889
- schema,
2890
- schema.forbiddenElements
2891
- )
2892
- );
2836
+ errors.push(...validateElementAgainstSchema(element, schema));
2893
2837
  }
2894
2838
  const role = element.getAttribute("role") || "";
2895
2839
  const linkableRoles = getLinkableRoles();
@@ -2898,11 +2842,13 @@ var validateElement = (element, root, elementsToLink, linkElements, schemasToVal
2898
2842
  }
2899
2843
  if (schema.tag === BIBLIOMIXED_SCHEMA.tag) {
2900
2844
  errors.push(...validateReferenceCited(element, linkElements));
2901
- return errors;
2902
2845
  }
2903
2846
  if (schema.tag === FOOTNOTE_SCHEMA.tag) {
2904
2847
  errors.push(...validateFootnoteCue(element, root));
2905
2848
  }
2849
+ if (isIgnoredValidation(schema.code)) {
2850
+ return [];
2851
+ }
2906
2852
  }
2907
2853
  for (const child of Array.from(element.children)) {
2908
2854
  errors.push(
@@ -2945,6 +2891,7 @@ export {
2945
2891
  IGNORED_ATTRIBUTES,
2946
2892
  IGNORED_ATTRIBUTES_STARTS_WITH,
2947
2893
  IGNORED_ELEMENT_SELECTORS,
2894
+ IGNORED_VALIDATION_ELEMENT_SELECTORS,
2948
2895
  INDENT_TYPE_ATTRIBUTE,
2949
2896
  INLINE_ELEMENT_SCHEMAS,
2950
2897
  LAYOUT_ATTRIBUTES,
@@ -2969,10 +2916,10 @@ export {
2969
2916
  findAttributeDefinitionByName,
2970
2917
  findSchemaByCode,
2971
2918
  findSchemaByElement,
2972
- findSchemaByTagName,
2973
2919
  getAttributeName,
2974
2920
  isAttributeRestricted,
2975
2921
  isIgnoredAttribute,
2976
2922
  isIgnoredElement,
2923
+ isIgnoredValidation,
2977
2924
  validateXml
2978
2925
  };