pro-editor-schema 1.6.9 → 1.6.10
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/README.md +2 -1
- package/dist/index.d.mts +3 -1
- package/dist/index.d.ts +3 -1
- package/dist/index.js +18 -1
- package/dist/index.mjs +18 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -170,6 +170,7 @@ Examples:
|
|
|
170
170
|
- `SPAN` with class `ins` → `insertion`
|
|
171
171
|
- `SPAN` with class `del` → `deletion`
|
|
172
172
|
- `SPAN` with class `cmtQurySection` → `commentQuerySection`
|
|
173
|
+
- `SPAN` with a `prev-format` attribute → `formatRemoval`
|
|
173
174
|
- `SECTION1` with `role="H1"` → `heading`
|
|
174
175
|
- `SECTION1` with `role="ch"` or a `FOOTNOTE` child → `footnoteSection`
|
|
175
176
|
|
|
@@ -347,4 +348,4 @@ Helpers:
|
|
|
347
348
|
- Tag matching is done in uppercase in schema definitions and validation.
|
|
348
349
|
- Some schema codes represent block/group-like structures while still being typed as `kind: "element"` in the current model.
|
|
349
350
|
- Ignored attributes and ignored UI helper elements live in `src/helpers` and are excluded from strict validation by design.
|
|
350
|
-
- Track-changes atoms (`insertion`, `deletion`, `lineGroupRemoval`) are unwrapped when validating required children.
|
|
351
|
+
- Track-changes atoms (`insertion`, `deletion`, `lineGroupRemoval`, `formatRemoval`) are unwrapped when validating required children.
|
package/dist/index.d.mts
CHANGED
|
@@ -932,7 +932,7 @@ type Schema<TRequiredAttributes = readonly AttributeDefinition[], TOptionalAttri
|
|
|
932
932
|
};
|
|
933
933
|
type SchemaCode = DocbookSchemaCode | ElementSchemaCode | InlineSchemaCode | AtomSchemaCode;
|
|
934
934
|
type ElementSchemaCode = "referenceBibliography" | "bibliodiv" | "translator" | "pagenum" | "pubId" | "degrees" | "email" | "equation" | "fignote" | "figsource" | "firstname" | "footnote" | "footnoteno" | "honorific" | "img" | "informalfigure" | "keyword" | "label1" | "li" | "line" | "linegroup" | "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";
|
|
935
|
-
type AtomSchemaCode = "mark" | "indexterm" | "primary" | "secondary" | "tertiary" | "quaternary" | "bookmark" | "see" | "commentQuerySection" | "comment" | "content" | "query" | "reply" | "deletion" | "lineGroupRemoval" | "emphasis" | "highlightmark" | "i" | "insertion" | "sc" | "strike" | "sub" | "sup" | "u" | "b" | "referenceMark" | "abbreviation" | "delimiter" | "em" | "strong";
|
|
935
|
+
type AtomSchemaCode = "mark" | "indexterm" | "primary" | "secondary" | "tertiary" | "quaternary" | "bookmark" | "see" | "commentQuerySection" | "comment" | "content" | "query" | "reply" | "deletion" | "lineGroupRemoval" | "formatRemoval" | "emphasis" | "highlightmark" | "i" | "insertion" | "sc" | "strike" | "sub" | "sup" | "u" | "b" | "referenceMark" | "abbreviation" | "delimiter" | "em" | "strong";
|
|
936
936
|
type InlineSchemaCode = "footnote1" | "inlineequation" | "link" | "uri" | "phrase";
|
|
937
937
|
|
|
938
938
|
declare const SCHEMAS: {
|
|
@@ -1445,6 +1445,7 @@ declare const SCHEMAS: {
|
|
|
1445
1445
|
readonly values: readonly ["unwrap"];
|
|
1446
1446
|
readonly defaultValue: "unwrap";
|
|
1447
1447
|
}], readonly ["store", "ele-id", "data-date"]>;
|
|
1448
|
+
formatRemoval: Schema<readonly ["prev-format"], readonly ["data-username", "data-userid", "data-time", "data-date", "store", "ele-id"]>;
|
|
1448
1449
|
content: Schema<readonly ["store", "ele-id"], readonly []>;
|
|
1449
1450
|
comment: Schema<readonly ["store", "ele-id", "id"], readonly ["data-username", "data-userid", "data-time", "data-date", {
|
|
1450
1451
|
readonly name: "status";
|
|
@@ -2056,6 +2057,7 @@ declare const ATOM_SCHEMAS: {
|
|
|
2056
2057
|
readonly values: readonly ["unwrap"];
|
|
2057
2058
|
readonly defaultValue: "unwrap";
|
|
2058
2059
|
}], readonly ["store", "ele-id", "data-date"]>;
|
|
2060
|
+
formatRemoval: Schema<readonly ["prev-format"], readonly ["data-username", "data-userid", "data-time", "data-date", "store", "ele-id"]>;
|
|
2059
2061
|
content: Schema<readonly ["store", "ele-id"], readonly []>;
|
|
2060
2062
|
comment: Schema<readonly ["store", "ele-id", "id"], readonly ["data-username", "data-userid", "data-time", "data-date", {
|
|
2061
2063
|
readonly name: "status";
|
package/dist/index.d.ts
CHANGED
|
@@ -932,7 +932,7 @@ type Schema<TRequiredAttributes = readonly AttributeDefinition[], TOptionalAttri
|
|
|
932
932
|
};
|
|
933
933
|
type SchemaCode = DocbookSchemaCode | ElementSchemaCode | InlineSchemaCode | AtomSchemaCode;
|
|
934
934
|
type ElementSchemaCode = "referenceBibliography" | "bibliodiv" | "translator" | "pagenum" | "pubId" | "degrees" | "email" | "equation" | "fignote" | "figsource" | "firstname" | "footnote" | "footnoteno" | "honorific" | "img" | "informalfigure" | "keyword" | "label1" | "li" | "line" | "linegroup" | "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";
|
|
935
|
-
type AtomSchemaCode = "mark" | "indexterm" | "primary" | "secondary" | "tertiary" | "quaternary" | "bookmark" | "see" | "commentQuerySection" | "comment" | "content" | "query" | "reply" | "deletion" | "lineGroupRemoval" | "emphasis" | "highlightmark" | "i" | "insertion" | "sc" | "strike" | "sub" | "sup" | "u" | "b" | "referenceMark" | "abbreviation" | "delimiter" | "em" | "strong";
|
|
935
|
+
type AtomSchemaCode = "mark" | "indexterm" | "primary" | "secondary" | "tertiary" | "quaternary" | "bookmark" | "see" | "commentQuerySection" | "comment" | "content" | "query" | "reply" | "deletion" | "lineGroupRemoval" | "formatRemoval" | "emphasis" | "highlightmark" | "i" | "insertion" | "sc" | "strike" | "sub" | "sup" | "u" | "b" | "referenceMark" | "abbreviation" | "delimiter" | "em" | "strong";
|
|
936
936
|
type InlineSchemaCode = "footnote1" | "inlineequation" | "link" | "uri" | "phrase";
|
|
937
937
|
|
|
938
938
|
declare const SCHEMAS: {
|
|
@@ -1445,6 +1445,7 @@ declare const SCHEMAS: {
|
|
|
1445
1445
|
readonly values: readonly ["unwrap"];
|
|
1446
1446
|
readonly defaultValue: "unwrap";
|
|
1447
1447
|
}], readonly ["store", "ele-id", "data-date"]>;
|
|
1448
|
+
formatRemoval: Schema<readonly ["prev-format"], readonly ["data-username", "data-userid", "data-time", "data-date", "store", "ele-id"]>;
|
|
1448
1449
|
content: Schema<readonly ["store", "ele-id"], readonly []>;
|
|
1449
1450
|
comment: Schema<readonly ["store", "ele-id", "id"], readonly ["data-username", "data-userid", "data-time", "data-date", {
|
|
1450
1451
|
readonly name: "status";
|
|
@@ -2056,6 +2057,7 @@ declare const ATOM_SCHEMAS: {
|
|
|
2056
2057
|
readonly values: readonly ["unwrap"];
|
|
2057
2058
|
readonly defaultValue: "unwrap";
|
|
2058
2059
|
}], readonly ["store", "ele-id", "data-date"]>;
|
|
2060
|
+
formatRemoval: Schema<readonly ["prev-format"], readonly ["data-username", "data-userid", "data-time", "data-date", "store", "ele-id"]>;
|
|
2059
2061
|
content: Schema<readonly ["store", "ele-id"], readonly []>;
|
|
2060
2062
|
comment: Schema<readonly ["store", "ele-id", "id"], readonly ["data-username", "data-userid", "data-time", "data-date", {
|
|
2061
2063
|
readonly name: "status";
|
package/dist/index.js
CHANGED
|
@@ -280,6 +280,21 @@ var EMPHASIS_SCHEMA = createSchema({
|
|
|
280
280
|
allowedChildrenCodes: [...ATOM_CODES_ALLOWED_CHILDREN]
|
|
281
281
|
});
|
|
282
282
|
|
|
283
|
+
// src/schema/elementSchemas/atoms/formatRemoval.ts
|
|
284
|
+
var PREV_FORMAT_ATTRIBUTE = "prev-format";
|
|
285
|
+
var FORMAT_REMOVAL_SCHEMA = createSchema({
|
|
286
|
+
code: "formatRemoval",
|
|
287
|
+
kind: "atom",
|
|
288
|
+
tag: SPAN_TAG,
|
|
289
|
+
matchesElement: (element) => element.hasAttribute(PREV_FORMAT_ATTRIBUTE),
|
|
290
|
+
requiredAttributes: [PREV_FORMAT_ATTRIBUTE],
|
|
291
|
+
optionalAttributes: [...TRACK_CHANGES_ATTRS, ...ID_ATTRS],
|
|
292
|
+
allowedChildrenCodes: [
|
|
293
|
+
...ATOM_CODES_ALLOWED_CHILDREN,
|
|
294
|
+
...INLINE_ELEMENT_CODES_ALLOWED_CHILDREN
|
|
295
|
+
]
|
|
296
|
+
});
|
|
297
|
+
|
|
283
298
|
// src/schema/elementSchemas/atoms/highlightmark.ts
|
|
284
299
|
var HIGHLIGHTMARK_SCHEMA = createSchema({
|
|
285
300
|
code: "highlightmark",
|
|
@@ -729,6 +744,7 @@ var ATOM_SCHEMAS = {
|
|
|
729
744
|
insertion: INSERTION_SCHEMA,
|
|
730
745
|
deletion: DELETION_SCHEMA,
|
|
731
746
|
lineGroupRemoval: LINE_GROUP_REMOVAL_SCHEMA,
|
|
747
|
+
formatRemoval: FORMAT_REMOVAL_SCHEMA,
|
|
732
748
|
content: CONTENT_SCHEMA,
|
|
733
749
|
comment: COMMENT_SCHEMA,
|
|
734
750
|
query: QUERY_SCHEMA,
|
|
@@ -2992,7 +3008,7 @@ var findSchemaByElement = (element) => getSchemasByTag().get(element.tagName.toU
|
|
|
2992
3008
|
var isAttributeRestricted = (attr) => typeof attr !== "string";
|
|
2993
3009
|
|
|
2994
3010
|
// src/schema/helpers/isTrackChangesSchema.ts
|
|
2995
|
-
var isTrackChangesSchema = (schema) => schema.code === "insertion" || schema.code === "deletion" || schema.code === "lineGroupRemoval";
|
|
3011
|
+
var isTrackChangesSchema = (schema) => schema.code === "insertion" || schema.code === "deletion" || schema.code === "lineGroupRemoval" || schema.code === "formatRemoval";
|
|
2996
3012
|
|
|
2997
3013
|
// src/schema/referenceSchemas/referenceTypeSchemas.ts
|
|
2998
3014
|
var LINK_FIELDS = ["doi", "url"];
|
|
@@ -3419,6 +3435,7 @@ var ElementLabel = {
|
|
|
3419
3435
|
reply: "Reply",
|
|
3420
3436
|
deletion: "Deletion",
|
|
3421
3437
|
lineGroupRemoval: "Line Group Removal",
|
|
3438
|
+
formatRemoval: "Formatting Removal",
|
|
3422
3439
|
emphasis: "Emphasis",
|
|
3423
3440
|
highlightmark: "Highlightmark",
|
|
3424
3441
|
i: "Italic",
|
package/dist/index.mjs
CHANGED
|
@@ -157,6 +157,21 @@ var EMPHASIS_SCHEMA = createSchema({
|
|
|
157
157
|
allowedChildrenCodes: [...ATOM_CODES_ALLOWED_CHILDREN]
|
|
158
158
|
});
|
|
159
159
|
|
|
160
|
+
// src/schema/elementSchemas/atoms/formatRemoval.ts
|
|
161
|
+
var PREV_FORMAT_ATTRIBUTE = "prev-format";
|
|
162
|
+
var FORMAT_REMOVAL_SCHEMA = createSchema({
|
|
163
|
+
code: "formatRemoval",
|
|
164
|
+
kind: "atom",
|
|
165
|
+
tag: SPAN_TAG,
|
|
166
|
+
matchesElement: (element) => element.hasAttribute(PREV_FORMAT_ATTRIBUTE),
|
|
167
|
+
requiredAttributes: [PREV_FORMAT_ATTRIBUTE],
|
|
168
|
+
optionalAttributes: [...TRACK_CHANGES_ATTRS, ...ID_ATTRS],
|
|
169
|
+
allowedChildrenCodes: [
|
|
170
|
+
...ATOM_CODES_ALLOWED_CHILDREN,
|
|
171
|
+
...INLINE_ELEMENT_CODES_ALLOWED_CHILDREN
|
|
172
|
+
]
|
|
173
|
+
});
|
|
174
|
+
|
|
160
175
|
// src/schema/elementSchemas/atoms/highlightmark.ts
|
|
161
176
|
var HIGHLIGHTMARK_SCHEMA = createSchema({
|
|
162
177
|
code: "highlightmark",
|
|
@@ -606,6 +621,7 @@ var ATOM_SCHEMAS = {
|
|
|
606
621
|
insertion: INSERTION_SCHEMA,
|
|
607
622
|
deletion: DELETION_SCHEMA,
|
|
608
623
|
lineGroupRemoval: LINE_GROUP_REMOVAL_SCHEMA,
|
|
624
|
+
formatRemoval: FORMAT_REMOVAL_SCHEMA,
|
|
609
625
|
content: CONTENT_SCHEMA,
|
|
610
626
|
comment: COMMENT_SCHEMA,
|
|
611
627
|
query: QUERY_SCHEMA,
|
|
@@ -2869,7 +2885,7 @@ var findSchemaByElement = (element) => getSchemasByTag().get(element.tagName.toU
|
|
|
2869
2885
|
var isAttributeRestricted = (attr) => typeof attr !== "string";
|
|
2870
2886
|
|
|
2871
2887
|
// src/schema/helpers/isTrackChangesSchema.ts
|
|
2872
|
-
var isTrackChangesSchema = (schema) => schema.code === "insertion" || schema.code === "deletion" || schema.code === "lineGroupRemoval";
|
|
2888
|
+
var isTrackChangesSchema = (schema) => schema.code === "insertion" || schema.code === "deletion" || schema.code === "lineGroupRemoval" || schema.code === "formatRemoval";
|
|
2873
2889
|
|
|
2874
2890
|
// src/schema/referenceSchemas/referenceTypeSchemas.ts
|
|
2875
2891
|
var LINK_FIELDS = ["doi", "url"];
|
|
@@ -3296,6 +3312,7 @@ var ElementLabel = {
|
|
|
3296
3312
|
reply: "Reply",
|
|
3297
3313
|
deletion: "Deletion",
|
|
3298
3314
|
lineGroupRemoval: "Line Group Removal",
|
|
3315
|
+
formatRemoval: "Formatting Removal",
|
|
3299
3316
|
emphasis: "Emphasis",
|
|
3300
3317
|
highlightmark: "Highlightmark",
|
|
3301
3318
|
i: "Italic",
|