pro-editor-schema 0.1.197 → 0.1.198
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.d.mts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +57 -21
- package/dist/index.mjs +57 -21
- package/package.json +2 -2
package/dist/index.d.mts
CHANGED
|
@@ -28,7 +28,7 @@ type Schema<TRequiredAttributes = readonly AttributeDefinition[], TOptionalAttri
|
|
|
28
28
|
type SchemaCode = ElementSchemaCode | InlineSchemaCode | AtomSchemaCode;
|
|
29
29
|
type ElementSchemaCode = "referenceBibliomixed" | "referenceBibliography" | "bibliodiv" | "degrees" | "email" | "equation" | "fignote" | "figsource" | "firstname" | "footnote" | "footnoteno" | "honorific" | "img" | "informalfigure" | "keyword" | "label1" | "li" | "line" | "lrh" | "math" | "mathphrase" | "merror" | "mfrac" | "mi" | "mmultiscripts" | "mn" | "mo" | "mover" | "mpadded" | "mphantom" | "mprescripts" | "mroot" | "mrow" | "ms" | "mspace" | "msqrt" | "mstyle" | "msub" | "msubsup" | "msup" | "mtable" | "mtd" | "mtext" | "mtr" | "munder" | "munderover" | "olink" | "org" | "orgname" | "para" | "punc" | "rrh" | "source1" | "speaker" | "subtitle1" | "surname" | "tag" | "tblfn" | "tblsource" | "thead" | "title1" | "token" | "tp" | "abstract1" | "affiliation" | "alttext" | "appendix" | "author" | "authorgroup" | "blockquote" | "caption1" | "chapter" | "dialogue" | "epigraph" | "figure1" | "footnoteSection" | "heading" | "imageobject" | "info1" | "keywordset" | "mediaobject" | "ol" | "personname" | "poem" | "sidebar" | "table" | "table1" | "tbody" | "td" | "tgroup" | "tr" | "ul";
|
|
30
30
|
type AtomSchemaCode = "indexterm" | "primary" | "secondary" | "tertiary" | "quaternary" | "bookmark" | "see" | "commentQuerySection" | "comment" | "content" | "query" | "reply" | "deletion" | "emphasis" | "highlightmark" | "i" | "insertion" | "sc" | "strike" | "sub" | "sup" | "u" | "b" | "referenceMark";
|
|
31
|
-
type InlineSchemaCode = "footnote1" | "inlineequation" | "link" | "uri";
|
|
31
|
+
type InlineSchemaCode = "footnote1" | "inlineequation" | "link" | "uri" | "phrase";
|
|
32
32
|
declare const ElementLabel: Record<SchemaCode, string>;
|
|
33
33
|
|
|
34
34
|
declare const SCHEMAS: Record<SchemaCode, Schema>;
|
package/dist/index.d.ts
CHANGED
|
@@ -28,7 +28,7 @@ type Schema<TRequiredAttributes = readonly AttributeDefinition[], TOptionalAttri
|
|
|
28
28
|
type SchemaCode = ElementSchemaCode | InlineSchemaCode | AtomSchemaCode;
|
|
29
29
|
type ElementSchemaCode = "referenceBibliomixed" | "referenceBibliography" | "bibliodiv" | "degrees" | "email" | "equation" | "fignote" | "figsource" | "firstname" | "footnote" | "footnoteno" | "honorific" | "img" | "informalfigure" | "keyword" | "label1" | "li" | "line" | "lrh" | "math" | "mathphrase" | "merror" | "mfrac" | "mi" | "mmultiscripts" | "mn" | "mo" | "mover" | "mpadded" | "mphantom" | "mprescripts" | "mroot" | "mrow" | "ms" | "mspace" | "msqrt" | "mstyle" | "msub" | "msubsup" | "msup" | "mtable" | "mtd" | "mtext" | "mtr" | "munder" | "munderover" | "olink" | "org" | "orgname" | "para" | "punc" | "rrh" | "source1" | "speaker" | "subtitle1" | "surname" | "tag" | "tblfn" | "tblsource" | "thead" | "title1" | "token" | "tp" | "abstract1" | "affiliation" | "alttext" | "appendix" | "author" | "authorgroup" | "blockquote" | "caption1" | "chapter" | "dialogue" | "epigraph" | "figure1" | "footnoteSection" | "heading" | "imageobject" | "info1" | "keywordset" | "mediaobject" | "ol" | "personname" | "poem" | "sidebar" | "table" | "table1" | "tbody" | "td" | "tgroup" | "tr" | "ul";
|
|
30
30
|
type AtomSchemaCode = "indexterm" | "primary" | "secondary" | "tertiary" | "quaternary" | "bookmark" | "see" | "commentQuerySection" | "comment" | "content" | "query" | "reply" | "deletion" | "emphasis" | "highlightmark" | "i" | "insertion" | "sc" | "strike" | "sub" | "sup" | "u" | "b" | "referenceMark";
|
|
31
|
-
type InlineSchemaCode = "footnote1" | "inlineequation" | "link" | "uri";
|
|
31
|
+
type InlineSchemaCode = "footnote1" | "inlineequation" | "link" | "uri" | "phrase";
|
|
32
32
|
declare const ElementLabel: Record<SchemaCode, string>;
|
|
33
33
|
|
|
34
34
|
declare const SCHEMAS: Record<SchemaCode, Schema>;
|
package/dist/index.js
CHANGED
|
@@ -192,13 +192,15 @@ var FOOTNOTE_LINK_TAG = "FOOTNOTE1";
|
|
|
192
192
|
var INLINEEQUATION_TAG = "INLINEEQUATION";
|
|
193
193
|
var LINK_TAG = "LINK1";
|
|
194
194
|
var URI_TAG = "URI";
|
|
195
|
+
var PHRASE_TAG = "PHRASE";
|
|
195
196
|
|
|
196
197
|
// src/schema/shared/allowedInlineChildren.ts
|
|
197
198
|
var INLINE_ELEMENT_TAGS_ALLOWED_CHILDREN = [
|
|
198
199
|
{ tagName: FOOTNOTE_LINK_TAG, required: false },
|
|
199
200
|
{ tagName: INLINEEQUATION_TAG, required: false },
|
|
200
201
|
{ tagName: LINK_TAG, required: false },
|
|
201
|
-
{ tagName: URI_TAG, required: false }
|
|
202
|
+
{ tagName: URI_TAG, required: false },
|
|
203
|
+
{ tagName: PHRASE_TAG, required: false }
|
|
202
204
|
];
|
|
203
205
|
|
|
204
206
|
// src/schema/elementSchemas/atoms/deletion.ts
|
|
@@ -403,9 +405,9 @@ var REPLY_SCHEMA = createSchema({
|
|
|
403
405
|
var INDEX_TERM_ENTRY_REQUIRED_ATTRIBUTES = [
|
|
404
406
|
"data-date",
|
|
405
407
|
"data-user",
|
|
406
|
-
"
|
|
407
|
-
"
|
|
408
|
-
"
|
|
408
|
+
"firstEntry",
|
|
409
|
+
"secondEntry",
|
|
410
|
+
"thirdEntry",
|
|
409
411
|
"entry",
|
|
410
412
|
"linkend",
|
|
411
413
|
...ID_ATTRS
|
|
@@ -418,7 +420,7 @@ var BOOKMARK_INDEX_POSITION_ATTRIBUTE = {
|
|
|
418
420
|
var SEE_REQUIRED_ATTRIBUTES = [
|
|
419
421
|
"linkend",
|
|
420
422
|
"data-user",
|
|
421
|
-
"crossref-
|
|
423
|
+
"crossref-pageNumber",
|
|
422
424
|
{
|
|
423
425
|
name: "role",
|
|
424
426
|
values: ["see", "see-also"],
|
|
@@ -426,10 +428,10 @@ var SEE_REQUIRED_ATTRIBUTES = [
|
|
|
426
428
|
},
|
|
427
429
|
...ID_ATTRS,
|
|
428
430
|
"data-date",
|
|
429
|
-
"crossref-
|
|
430
|
-
"crossref-
|
|
431
|
-
"crossref-
|
|
432
|
-
"crossref-
|
|
431
|
+
"crossref-firstEntry",
|
|
432
|
+
"crossref-secondEntry",
|
|
433
|
+
"crossref-thirdEntry",
|
|
434
|
+
"crossref-fourthEntry"
|
|
433
435
|
];
|
|
434
436
|
|
|
435
437
|
// src/schema/elementSchemas/atoms/indexing/bookmark.ts
|
|
@@ -824,7 +826,10 @@ var LINE_SCHEMA = createSchema({
|
|
|
824
826
|
defaultValue: "add-element"
|
|
825
827
|
}
|
|
826
828
|
],
|
|
827
|
-
allowedChildTagNames: [
|
|
829
|
+
allowedChildTagNames: [
|
|
830
|
+
...ATOM_TAGS_ALLOWED_CHILDREN,
|
|
831
|
+
...INLINE_ELEMENT_TAGS_ALLOWED_CHILDREN
|
|
832
|
+
]
|
|
828
833
|
});
|
|
829
834
|
|
|
830
835
|
// src/schema/elementSchemas/elements/dialogue/speaker.ts
|
|
@@ -1416,7 +1421,10 @@ var KEYWORD_SCHEMA = createSchema({
|
|
|
1416
1421
|
tag: KEYWORD_TAG,
|
|
1417
1422
|
requiredAttributes: [...ID_ATTRS],
|
|
1418
1423
|
optionalAttributes: ["data-pos"],
|
|
1419
|
-
allowedChildTagNames: [
|
|
1424
|
+
allowedChildTagNames: [
|
|
1425
|
+
...ATOM_TAGS_ALLOWED_CHILDREN,
|
|
1426
|
+
{ tagName: PHRASE_TAG, required: false }
|
|
1427
|
+
]
|
|
1420
1428
|
});
|
|
1421
1429
|
|
|
1422
1430
|
// src/schema/elementSchemas/elements/keywords/punc.ts
|
|
@@ -1613,7 +1621,10 @@ var LRH_SCHEMA = createSchema({
|
|
|
1613
1621
|
tag: LRH_TAG,
|
|
1614
1622
|
requiredAttributes: [...ID_ATTRS],
|
|
1615
1623
|
optionalAttributes: [],
|
|
1616
|
-
allowedChildTagNames: [
|
|
1624
|
+
allowedChildTagNames: [
|
|
1625
|
+
...ATOM_TAGS_ALLOWED_CHILDREN,
|
|
1626
|
+
{ tagName: PHRASE_TAG, required: false }
|
|
1627
|
+
]
|
|
1617
1628
|
});
|
|
1618
1629
|
|
|
1619
1630
|
// src/schema/elementSchemas/elements/runningHeads/rrh.ts
|
|
@@ -1623,7 +1634,10 @@ var RRH_SCHEMA = createSchema({
|
|
|
1623
1634
|
tag: RRH_TAG,
|
|
1624
1635
|
requiredAttributes: [...ID_ATTRS],
|
|
1625
1636
|
optionalAttributes: [],
|
|
1626
|
-
allowedChildTagNames: [
|
|
1637
|
+
allowedChildTagNames: [
|
|
1638
|
+
...ATOM_TAGS_ALLOWED_CHILDREN,
|
|
1639
|
+
{ tagName: PHRASE_TAG, required: false }
|
|
1640
|
+
]
|
|
1627
1641
|
});
|
|
1628
1642
|
|
|
1629
1643
|
// src/schema/elementSchemas/elements/source.ts
|
|
@@ -1640,7 +1654,10 @@ var SOURCE_SCHEMA = createSchema({
|
|
|
1640
1654
|
defaultValue: "add-element"
|
|
1641
1655
|
}
|
|
1642
1656
|
],
|
|
1643
|
-
allowedChildTagNames: [
|
|
1657
|
+
allowedChildTagNames: [
|
|
1658
|
+
...ATOM_TAGS_ALLOWED_CHILDREN,
|
|
1659
|
+
...INLINE_ELEMENT_TAGS_ALLOWED_CHILDREN
|
|
1660
|
+
]
|
|
1644
1661
|
});
|
|
1645
1662
|
|
|
1646
1663
|
// src/schema/elementSchemas/elements/subtitle.ts
|
|
@@ -1656,7 +1673,10 @@ var SUBTITLE_SCHEMA = createSchema({
|
|
|
1656
1673
|
defaultValue: "add-element"
|
|
1657
1674
|
}
|
|
1658
1675
|
],
|
|
1659
|
-
allowedChildTagNames: [
|
|
1676
|
+
allowedChildTagNames: [
|
|
1677
|
+
...ATOM_TAGS_ALLOWED_CHILDREN,
|
|
1678
|
+
{ tagName: PHRASE_TAG, required: false }
|
|
1679
|
+
]
|
|
1660
1680
|
});
|
|
1661
1681
|
|
|
1662
1682
|
// src/schema/elementSchemas/elements/table/tp.ts
|
|
@@ -1820,7 +1840,10 @@ var TITLE_SCHEMA = createSchema({
|
|
|
1820
1840
|
defaultValue: "H1"
|
|
1821
1841
|
}
|
|
1822
1842
|
],
|
|
1823
|
-
allowedChildTagNames: [
|
|
1843
|
+
allowedChildTagNames: [
|
|
1844
|
+
...ATOM_TAGS_ALLOWED_CHILDREN,
|
|
1845
|
+
{ tagName: PHRASE_TAG, required: false }
|
|
1846
|
+
]
|
|
1824
1847
|
});
|
|
1825
1848
|
|
|
1826
1849
|
// src/schema/elementSchemas/elements/abstract.ts
|
|
@@ -2312,12 +2335,23 @@ var URI_SCHEMA = createSchema({
|
|
|
2312
2335
|
allowedChildTagNames: [...ATOM_TAGS_ALLOWED_CHILDREN]
|
|
2313
2336
|
});
|
|
2314
2337
|
|
|
2338
|
+
// src/schema/elementSchemas/inlineElements/phrase.ts
|
|
2339
|
+
var PHRASE_SCHEMA = createSchema({
|
|
2340
|
+
code: "phrase",
|
|
2341
|
+
kind: "inline",
|
|
2342
|
+
tag: PHRASE_TAG,
|
|
2343
|
+
requiredAttributes: [...ID_ATTRS, "xml:lang"],
|
|
2344
|
+
optionalAttributes: [],
|
|
2345
|
+
allowedChildTagNames: [...ATOM_TAGS_ALLOWED_CHILDREN]
|
|
2346
|
+
});
|
|
2347
|
+
|
|
2315
2348
|
// src/schema/elementSchemas/inlineElements/index.ts
|
|
2316
2349
|
var INLINE_ELEMENT_SCHEMAS = {
|
|
2317
2350
|
uri: URI_SCHEMA,
|
|
2318
2351
|
footnote1: FOOTNOTE_LINK_SCHEMA,
|
|
2319
2352
|
link: LINK_SCHEMA,
|
|
2320
|
-
inlineequation: INLINEEQUATION_SCHEMA
|
|
2353
|
+
inlineequation: INLINEEQUATION_SCHEMA,
|
|
2354
|
+
phrase: PHRASE_SCHEMA
|
|
2321
2355
|
};
|
|
2322
2356
|
|
|
2323
2357
|
// src/schema/schemas.ts
|
|
@@ -2448,7 +2482,8 @@ var ElementLabel = {
|
|
|
2448
2482
|
footnote1: "Footnote",
|
|
2449
2483
|
inlineequation: "Inline Equation",
|
|
2450
2484
|
link: "Link",
|
|
2451
|
-
uri: "URI"
|
|
2485
|
+
uri: "URI",
|
|
2486
|
+
phrase: "Phrase"
|
|
2452
2487
|
};
|
|
2453
2488
|
|
|
2454
2489
|
// src/schema/shared/ignoredElements.ts
|
|
@@ -2475,7 +2510,8 @@ var IGNORED_ATTRIBUTES = [
|
|
|
2475
2510
|
"translate",
|
|
2476
2511
|
"lang",
|
|
2477
2512
|
"dir",
|
|
2478
|
-
"hidden"
|
|
2513
|
+
"hidden",
|
|
2514
|
+
"data-gramm"
|
|
2479
2515
|
];
|
|
2480
2516
|
var IGNORED_ATTRIBUTES_STARTS_WITH = ["er-", "er_", "drop", "drag"];
|
|
2481
2517
|
|
|
@@ -2526,10 +2562,10 @@ var findSchemaByElement = (element) => {
|
|
|
2526
2562
|
return candidates[0];
|
|
2527
2563
|
};
|
|
2528
2564
|
var isAttributeRestricted = (attr) => typeof attr !== "string";
|
|
2529
|
-
var getAttributeName = (attribute) => typeof attribute === "string" ? attribute
|
|
2565
|
+
var getAttributeName = (attribute) => typeof attribute === "string" ? attribute : attribute.name;
|
|
2530
2566
|
var findAttributeDefinitionByName = (definitions, name) => {
|
|
2531
2567
|
for (const def of definitions) {
|
|
2532
|
-
if (getAttributeName(def) === name
|
|
2568
|
+
if (getAttributeName(def) === name) {
|
|
2533
2569
|
return def;
|
|
2534
2570
|
}
|
|
2535
2571
|
}
|
package/dist/index.mjs
CHANGED
|
@@ -127,13 +127,15 @@ var FOOTNOTE_LINK_TAG = "FOOTNOTE1";
|
|
|
127
127
|
var INLINEEQUATION_TAG = "INLINEEQUATION";
|
|
128
128
|
var LINK_TAG = "LINK1";
|
|
129
129
|
var URI_TAG = "URI";
|
|
130
|
+
var PHRASE_TAG = "PHRASE";
|
|
130
131
|
|
|
131
132
|
// src/schema/shared/allowedInlineChildren.ts
|
|
132
133
|
var INLINE_ELEMENT_TAGS_ALLOWED_CHILDREN = [
|
|
133
134
|
{ tagName: FOOTNOTE_LINK_TAG, required: false },
|
|
134
135
|
{ tagName: INLINEEQUATION_TAG, required: false },
|
|
135
136
|
{ tagName: LINK_TAG, required: false },
|
|
136
|
-
{ tagName: URI_TAG, required: false }
|
|
137
|
+
{ tagName: URI_TAG, required: false },
|
|
138
|
+
{ tagName: PHRASE_TAG, required: false }
|
|
137
139
|
];
|
|
138
140
|
|
|
139
141
|
// src/schema/elementSchemas/atoms/deletion.ts
|
|
@@ -338,9 +340,9 @@ var REPLY_SCHEMA = createSchema({
|
|
|
338
340
|
var INDEX_TERM_ENTRY_REQUIRED_ATTRIBUTES = [
|
|
339
341
|
"data-date",
|
|
340
342
|
"data-user",
|
|
341
|
-
"
|
|
342
|
-
"
|
|
343
|
-
"
|
|
343
|
+
"firstEntry",
|
|
344
|
+
"secondEntry",
|
|
345
|
+
"thirdEntry",
|
|
344
346
|
"entry",
|
|
345
347
|
"linkend",
|
|
346
348
|
...ID_ATTRS
|
|
@@ -353,7 +355,7 @@ var BOOKMARK_INDEX_POSITION_ATTRIBUTE = {
|
|
|
353
355
|
var SEE_REQUIRED_ATTRIBUTES = [
|
|
354
356
|
"linkend",
|
|
355
357
|
"data-user",
|
|
356
|
-
"crossref-
|
|
358
|
+
"crossref-pageNumber",
|
|
357
359
|
{
|
|
358
360
|
name: "role",
|
|
359
361
|
values: ["see", "see-also"],
|
|
@@ -361,10 +363,10 @@ var SEE_REQUIRED_ATTRIBUTES = [
|
|
|
361
363
|
},
|
|
362
364
|
...ID_ATTRS,
|
|
363
365
|
"data-date",
|
|
364
|
-
"crossref-
|
|
365
|
-
"crossref-
|
|
366
|
-
"crossref-
|
|
367
|
-
"crossref-
|
|
366
|
+
"crossref-firstEntry",
|
|
367
|
+
"crossref-secondEntry",
|
|
368
|
+
"crossref-thirdEntry",
|
|
369
|
+
"crossref-fourthEntry"
|
|
368
370
|
];
|
|
369
371
|
|
|
370
372
|
// src/schema/elementSchemas/atoms/indexing/bookmark.ts
|
|
@@ -759,7 +761,10 @@ var LINE_SCHEMA = createSchema({
|
|
|
759
761
|
defaultValue: "add-element"
|
|
760
762
|
}
|
|
761
763
|
],
|
|
762
|
-
allowedChildTagNames: [
|
|
764
|
+
allowedChildTagNames: [
|
|
765
|
+
...ATOM_TAGS_ALLOWED_CHILDREN,
|
|
766
|
+
...INLINE_ELEMENT_TAGS_ALLOWED_CHILDREN
|
|
767
|
+
]
|
|
763
768
|
});
|
|
764
769
|
|
|
765
770
|
// src/schema/elementSchemas/elements/dialogue/speaker.ts
|
|
@@ -1351,7 +1356,10 @@ var KEYWORD_SCHEMA = createSchema({
|
|
|
1351
1356
|
tag: KEYWORD_TAG,
|
|
1352
1357
|
requiredAttributes: [...ID_ATTRS],
|
|
1353
1358
|
optionalAttributes: ["data-pos"],
|
|
1354
|
-
allowedChildTagNames: [
|
|
1359
|
+
allowedChildTagNames: [
|
|
1360
|
+
...ATOM_TAGS_ALLOWED_CHILDREN,
|
|
1361
|
+
{ tagName: PHRASE_TAG, required: false }
|
|
1362
|
+
]
|
|
1355
1363
|
});
|
|
1356
1364
|
|
|
1357
1365
|
// src/schema/elementSchemas/elements/keywords/punc.ts
|
|
@@ -1548,7 +1556,10 @@ var LRH_SCHEMA = createSchema({
|
|
|
1548
1556
|
tag: LRH_TAG,
|
|
1549
1557
|
requiredAttributes: [...ID_ATTRS],
|
|
1550
1558
|
optionalAttributes: [],
|
|
1551
|
-
allowedChildTagNames: [
|
|
1559
|
+
allowedChildTagNames: [
|
|
1560
|
+
...ATOM_TAGS_ALLOWED_CHILDREN,
|
|
1561
|
+
{ tagName: PHRASE_TAG, required: false }
|
|
1562
|
+
]
|
|
1552
1563
|
});
|
|
1553
1564
|
|
|
1554
1565
|
// src/schema/elementSchemas/elements/runningHeads/rrh.ts
|
|
@@ -1558,7 +1569,10 @@ var RRH_SCHEMA = createSchema({
|
|
|
1558
1569
|
tag: RRH_TAG,
|
|
1559
1570
|
requiredAttributes: [...ID_ATTRS],
|
|
1560
1571
|
optionalAttributes: [],
|
|
1561
|
-
allowedChildTagNames: [
|
|
1572
|
+
allowedChildTagNames: [
|
|
1573
|
+
...ATOM_TAGS_ALLOWED_CHILDREN,
|
|
1574
|
+
{ tagName: PHRASE_TAG, required: false }
|
|
1575
|
+
]
|
|
1562
1576
|
});
|
|
1563
1577
|
|
|
1564
1578
|
// src/schema/elementSchemas/elements/source.ts
|
|
@@ -1575,7 +1589,10 @@ var SOURCE_SCHEMA = createSchema({
|
|
|
1575
1589
|
defaultValue: "add-element"
|
|
1576
1590
|
}
|
|
1577
1591
|
],
|
|
1578
|
-
allowedChildTagNames: [
|
|
1592
|
+
allowedChildTagNames: [
|
|
1593
|
+
...ATOM_TAGS_ALLOWED_CHILDREN,
|
|
1594
|
+
...INLINE_ELEMENT_TAGS_ALLOWED_CHILDREN
|
|
1595
|
+
]
|
|
1579
1596
|
});
|
|
1580
1597
|
|
|
1581
1598
|
// src/schema/elementSchemas/elements/subtitle.ts
|
|
@@ -1591,7 +1608,10 @@ var SUBTITLE_SCHEMA = createSchema({
|
|
|
1591
1608
|
defaultValue: "add-element"
|
|
1592
1609
|
}
|
|
1593
1610
|
],
|
|
1594
|
-
allowedChildTagNames: [
|
|
1611
|
+
allowedChildTagNames: [
|
|
1612
|
+
...ATOM_TAGS_ALLOWED_CHILDREN,
|
|
1613
|
+
{ tagName: PHRASE_TAG, required: false }
|
|
1614
|
+
]
|
|
1595
1615
|
});
|
|
1596
1616
|
|
|
1597
1617
|
// src/schema/elementSchemas/elements/table/tp.ts
|
|
@@ -1755,7 +1775,10 @@ var TITLE_SCHEMA = createSchema({
|
|
|
1755
1775
|
defaultValue: "H1"
|
|
1756
1776
|
}
|
|
1757
1777
|
],
|
|
1758
|
-
allowedChildTagNames: [
|
|
1778
|
+
allowedChildTagNames: [
|
|
1779
|
+
...ATOM_TAGS_ALLOWED_CHILDREN,
|
|
1780
|
+
{ tagName: PHRASE_TAG, required: false }
|
|
1781
|
+
]
|
|
1759
1782
|
});
|
|
1760
1783
|
|
|
1761
1784
|
// src/schema/elementSchemas/elements/abstract.ts
|
|
@@ -2247,12 +2270,23 @@ var URI_SCHEMA = createSchema({
|
|
|
2247
2270
|
allowedChildTagNames: [...ATOM_TAGS_ALLOWED_CHILDREN]
|
|
2248
2271
|
});
|
|
2249
2272
|
|
|
2273
|
+
// src/schema/elementSchemas/inlineElements/phrase.ts
|
|
2274
|
+
var PHRASE_SCHEMA = createSchema({
|
|
2275
|
+
code: "phrase",
|
|
2276
|
+
kind: "inline",
|
|
2277
|
+
tag: PHRASE_TAG,
|
|
2278
|
+
requiredAttributes: [...ID_ATTRS, "xml:lang"],
|
|
2279
|
+
optionalAttributes: [],
|
|
2280
|
+
allowedChildTagNames: [...ATOM_TAGS_ALLOWED_CHILDREN]
|
|
2281
|
+
});
|
|
2282
|
+
|
|
2250
2283
|
// src/schema/elementSchemas/inlineElements/index.ts
|
|
2251
2284
|
var INLINE_ELEMENT_SCHEMAS = {
|
|
2252
2285
|
uri: URI_SCHEMA,
|
|
2253
2286
|
footnote1: FOOTNOTE_LINK_SCHEMA,
|
|
2254
2287
|
link: LINK_SCHEMA,
|
|
2255
|
-
inlineequation: INLINEEQUATION_SCHEMA
|
|
2288
|
+
inlineequation: INLINEEQUATION_SCHEMA,
|
|
2289
|
+
phrase: PHRASE_SCHEMA
|
|
2256
2290
|
};
|
|
2257
2291
|
|
|
2258
2292
|
// src/schema/schemas.ts
|
|
@@ -2383,7 +2417,8 @@ var ElementLabel = {
|
|
|
2383
2417
|
footnote1: "Footnote",
|
|
2384
2418
|
inlineequation: "Inline Equation",
|
|
2385
2419
|
link: "Link",
|
|
2386
|
-
uri: "URI"
|
|
2420
|
+
uri: "URI",
|
|
2421
|
+
phrase: "Phrase"
|
|
2387
2422
|
};
|
|
2388
2423
|
|
|
2389
2424
|
// src/schema/shared/ignoredElements.ts
|
|
@@ -2410,7 +2445,8 @@ var IGNORED_ATTRIBUTES = [
|
|
|
2410
2445
|
"translate",
|
|
2411
2446
|
"lang",
|
|
2412
2447
|
"dir",
|
|
2413
|
-
"hidden"
|
|
2448
|
+
"hidden",
|
|
2449
|
+
"data-gramm"
|
|
2414
2450
|
];
|
|
2415
2451
|
var IGNORED_ATTRIBUTES_STARTS_WITH = ["er-", "er_", "drop", "drag"];
|
|
2416
2452
|
|
|
@@ -2461,10 +2497,10 @@ var findSchemaByElement = (element) => {
|
|
|
2461
2497
|
return candidates[0];
|
|
2462
2498
|
};
|
|
2463
2499
|
var isAttributeRestricted = (attr) => typeof attr !== "string";
|
|
2464
|
-
var getAttributeName = (attribute) => typeof attribute === "string" ? attribute
|
|
2500
|
+
var getAttributeName = (attribute) => typeof attribute === "string" ? attribute : attribute.name;
|
|
2465
2501
|
var findAttributeDefinitionByName = (definitions, name) => {
|
|
2466
2502
|
for (const def of definitions) {
|
|
2467
|
-
if (getAttributeName(def) === name
|
|
2503
|
+
if (getAttributeName(def) === name) {
|
|
2468
2504
|
return def;
|
|
2469
2505
|
}
|
|
2470
2506
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pro-editor-schema",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.198",
|
|
4
4
|
"description": "Pro Editor XML schemas",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"module": "dist/index.mjs",
|
|
@@ -28,4 +28,4 @@
|
|
|
28
28
|
"typescript": "^5.0.0",
|
|
29
29
|
"vitest": "^3.2.4"
|
|
30
30
|
}
|
|
31
|
-
}
|
|
31
|
+
}
|