@manuscripts/transform 4.3.37 → 4.3.39
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 +3 -3
- package/dist/cjs/jats/exporter/jats-exporter.js +6 -2
- package/dist/cjs/jats/importer/jats-dom-parser.js +1 -0
- package/dist/cjs/schema/migration/migration-scripts/4.3.35.js +21 -0
- package/dist/cjs/schema/migration/migration-scripts/index.js +2 -0
- package/dist/cjs/schema/nodes/blockquote_element.js +1 -1
- package/dist/cjs/schema/nodes/contributor.js +1 -0
- package/dist/cjs/schema/nodes/pullquote_element.js +1 -1
- package/dist/cjs/version.js +1 -1
- package/dist/es/jats/exporter/jats-exporter.js +6 -2
- package/dist/es/jats/importer/jats-dom-parser.js +1 -0
- package/dist/es/schema/migration/migration-scripts/4.3.35.js +19 -0
- package/dist/es/schema/migration/migration-scripts/index.js +2 -0
- package/dist/es/schema/nodes/blockquote_element.js +1 -1
- package/dist/es/schema/nodes/contributor.js +1 -0
- package/dist/es/schema/nodes/pullquote_element.js +1 -1
- package/dist/es/version.js +1 -1
- package/dist/types/schema/migration/migration-scripts/4.3.35.d.ts +8 -0
- package/dist/types/schema/migration/migration-scripts/index.d.ts +2 -1
- package/dist/types/schema/nodes/contributor.d.ts +1 -0
- package/dist/types/version.d.ts +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -6,9 +6,9 @@ It provides a way to import/export [Manuscript JSON Schema](https://gitlab.com/m
|
|
|
6
6
|
|
|
7
7
|
# Components
|
|
8
8
|
|
|
9
|
-
**Decoder**: converts Manuscript JSON Schema to ProseMirror Model.
|
|
9
|
+
**Decoder**: converts Manuscript JSON Schema to ProseMirror Model.
|
|
10
10
|
|
|
11
|
-
**Encoder**: converts ProseMirror Model to Manuscript JSON Schema.
|
|
11
|
+
**Encoder**: converts ProseMirror Model to Manuscript JSON Schema.
|
|
12
12
|
|
|
13
13
|
**ManuscriptNode**: a Manuscript definition of a ProseMirror Node which hold a ProseMirror fragment containing zero or more child nodes, for example a section node or a figure node.
|
|
14
14
|
|
|
@@ -18,7 +18,7 @@ It provides a way to import/export [Manuscript JSON Schema](https://gitlab.com/m
|
|
|
18
18
|
|
|
19
19
|
**JATSExporter**: converts Manuscript JSON Schema to JATS XML via ProseMirror Model.
|
|
20
20
|
|
|
21
|
-
**JATSImporter** converts JATS XML to Manuscript JSON Schema via ProseMirror Model.
|
|
21
|
+
**JATSImporter** converts JATS XML to Manuscript JSON Schema via ProseMirror Model.
|
|
22
22
|
|
|
23
23
|
# Usage
|
|
24
24
|
|
|
@@ -1014,9 +1014,13 @@ class JATSExporter {
|
|
|
1014
1014
|
this.appendElement($contrib, 'role', contributor.attrs.role);
|
|
1015
1015
|
}
|
|
1016
1016
|
if (contributor.attrs.ORCID) {
|
|
1017
|
-
|
|
1017
|
+
const contribIdAttrs = {
|
|
1018
1018
|
'contrib-id-type': 'orcid',
|
|
1019
|
-
}
|
|
1019
|
+
};
|
|
1020
|
+
if (contributor.attrs.isAuthenticated) {
|
|
1021
|
+
contribIdAttrs['authenticated'] = 'true';
|
|
1022
|
+
}
|
|
1023
|
+
this.appendElement($contrib, 'contrib-id', contributor.attrs.ORCID, contribIdAttrs);
|
|
1020
1024
|
}
|
|
1021
1025
|
const $name = this.buildContributorName(contributor);
|
|
1022
1026
|
$contrib.appendChild($name);
|
|
@@ -409,6 +409,7 @@ class JATSDOMParser {
|
|
|
409
409
|
suffix: (0, utils_1.getTrimmedTextContent)(element, 'suffix'),
|
|
410
410
|
degrees: Array.from(element.querySelectorAll('degrees')).map((degree) => (0, utils_1.getTrimmedTextContent)(degree)) || [],
|
|
411
411
|
ORCID: (0, utils_1.getTrimmedTextContent)(element, 'contrib-id[contrib-id-type="orcid"]'),
|
|
412
|
+
isAuthenticated: !!element.querySelector('contrib-id[contrib-id-type="orcid"][authenticated="true"]'),
|
|
412
413
|
creditRoles: (0, utils_1.getCreditRole)(element),
|
|
413
414
|
priority: this.parsePriority(element.getAttribute('priority')),
|
|
414
415
|
email: (0, utils_1.getTrimmedTextContent)(element, 'email') || '',
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
class Migration4335 {
|
|
4
|
+
constructor() {
|
|
5
|
+
this.fromVersion = '4.3.34';
|
|
6
|
+
this.toVersion = '4.3.35';
|
|
7
|
+
}
|
|
8
|
+
migrateNode(node) {
|
|
9
|
+
if (node.type === 'pullquote_element' ||
|
|
10
|
+
node.type === 'blockquote_element') {
|
|
11
|
+
return {
|
|
12
|
+
...node,
|
|
13
|
+
content: (node.content ?? []).map((child) => child.type === 'paragraph'
|
|
14
|
+
? { ...child, type: 'text_block' }
|
|
15
|
+
: child),
|
|
16
|
+
};
|
|
17
|
+
}
|
|
18
|
+
return node;
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
exports.default = Migration4335;
|
|
@@ -31,6 +31,7 @@ const _4_2_13_1 = __importDefault(require("./4.2.13"));
|
|
|
31
31
|
const _4_2_15_1 = __importDefault(require("./4.2.15"));
|
|
32
32
|
const _4_3_23_1 = __importDefault(require("./4.3.23"));
|
|
33
33
|
const _4_3_34_1 = __importDefault(require("./4.3.34"));
|
|
34
|
+
const _4_3_35_1 = __importDefault(require("./4.3.35"));
|
|
34
35
|
const migrations = [
|
|
35
36
|
new _1_2_5_1.default(),
|
|
36
37
|
new _2_3_22_1.default(),
|
|
@@ -45,5 +46,6 @@ const migrations = [
|
|
|
45
46
|
new _4_2_15_1.default(),
|
|
46
47
|
new _4_3_23_1.default(),
|
|
47
48
|
new _4_3_34_1.default(),
|
|
49
|
+
new _4_3_35_1.default(),
|
|
48
50
|
];
|
|
49
51
|
exports.default = migrations;
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
18
|
exports.isBlockquoteElement = exports.blockquoteElement = void 0;
|
|
19
19
|
exports.blockquoteElement = {
|
|
20
|
-
content: '
|
|
20
|
+
content: 'text_block+ attribution',
|
|
21
21
|
attrs: {
|
|
22
22
|
id: { default: '' },
|
|
23
23
|
placeholder: { default: '' },
|
|
@@ -17,6 +17,7 @@ exports.contributor = {
|
|
|
17
17
|
degrees: { default: [] },
|
|
18
18
|
email: { default: undefined },
|
|
19
19
|
ORCID: { default: undefined },
|
|
20
|
+
isAuthenticated: { default: false },
|
|
20
21
|
isCorresponding: { default: false },
|
|
21
22
|
isJointContributor: { default: false },
|
|
22
23
|
priority: { default: undefined },
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
18
|
exports.isPullquoteElement = exports.pullquoteElement = void 0;
|
|
19
19
|
exports.pullquoteElement = {
|
|
20
|
-
content: 'quote_image?
|
|
20
|
+
content: 'quote_image? text_block+ attribution',
|
|
21
21
|
attrs: {
|
|
22
22
|
id: { default: '' },
|
|
23
23
|
placeholder: { default: '' },
|
package/dist/cjs/version.js
CHANGED
|
@@ -974,9 +974,13 @@ export class JATSExporter {
|
|
|
974
974
|
this.appendElement($contrib, 'role', contributor.attrs.role);
|
|
975
975
|
}
|
|
976
976
|
if (contributor.attrs.ORCID) {
|
|
977
|
-
|
|
977
|
+
const contribIdAttrs = {
|
|
978
978
|
'contrib-id-type': 'orcid',
|
|
979
|
-
}
|
|
979
|
+
};
|
|
980
|
+
if (contributor.attrs.isAuthenticated) {
|
|
981
|
+
contribIdAttrs['authenticated'] = 'true';
|
|
982
|
+
}
|
|
983
|
+
this.appendElement($contrib, 'contrib-id', contributor.attrs.ORCID, contribIdAttrs);
|
|
980
984
|
}
|
|
981
985
|
const $name = this.buildContributorName(contributor);
|
|
982
986
|
$contrib.appendChild($name);
|
|
@@ -406,6 +406,7 @@ export class JATSDOMParser {
|
|
|
406
406
|
suffix: getTrimmedTextContent(element, 'suffix'),
|
|
407
407
|
degrees: Array.from(element.querySelectorAll('degrees')).map((degree) => getTrimmedTextContent(degree)) || [],
|
|
408
408
|
ORCID: getTrimmedTextContent(element, 'contrib-id[contrib-id-type="orcid"]'),
|
|
409
|
+
isAuthenticated: !!element.querySelector('contrib-id[contrib-id-type="orcid"][authenticated="true"]'),
|
|
409
410
|
creditRoles: getCreditRole(element),
|
|
410
411
|
priority: this.parsePriority(element.getAttribute('priority')),
|
|
411
412
|
email: getTrimmedTextContent(element, 'email') || '',
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
class Migration4335 {
|
|
2
|
+
constructor() {
|
|
3
|
+
this.fromVersion = '4.3.34';
|
|
4
|
+
this.toVersion = '4.3.35';
|
|
5
|
+
}
|
|
6
|
+
migrateNode(node) {
|
|
7
|
+
if (node.type === 'pullquote_element' ||
|
|
8
|
+
node.type === 'blockquote_element') {
|
|
9
|
+
return {
|
|
10
|
+
...node,
|
|
11
|
+
content: (node.content ?? []).map((child) => child.type === 'paragraph'
|
|
12
|
+
? { ...child, type: 'text_block' }
|
|
13
|
+
: child),
|
|
14
|
+
};
|
|
15
|
+
}
|
|
16
|
+
return node;
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
export default Migration4335;
|
|
@@ -26,6 +26,7 @@ import Migration4213 from './4.2.13';
|
|
|
26
26
|
import Migration4215 from './4.2.15';
|
|
27
27
|
import Migration4323 from './4.3.23';
|
|
28
28
|
import Migration4334 from './4.3.34';
|
|
29
|
+
import Migration4335 from './4.3.35';
|
|
29
30
|
const migrations = [
|
|
30
31
|
new Migration125(),
|
|
31
32
|
new Migration2322(),
|
|
@@ -40,5 +41,6 @@ const migrations = [
|
|
|
40
41
|
new Migration4215(),
|
|
41
42
|
new Migration4323(),
|
|
42
43
|
new Migration4334(),
|
|
44
|
+
new Migration4335(),
|
|
43
45
|
];
|
|
44
46
|
export default migrations;
|
|
@@ -14,6 +14,7 @@ export const contributor = {
|
|
|
14
14
|
degrees: { default: [] },
|
|
15
15
|
email: { default: undefined },
|
|
16
16
|
ORCID: { default: undefined },
|
|
17
|
+
isAuthenticated: { default: false },
|
|
17
18
|
isCorresponding: { default: false },
|
|
18
19
|
isJointContributor: { default: false },
|
|
19
20
|
priority: { default: undefined },
|
package/dist/es/version.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const VERSION = "4.3.
|
|
1
|
+
export const VERSION = "4.3.39";
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { JSONProsemirrorNode } from '../../../types';
|
|
2
|
+
import { MigrationScript } from '../migration-script';
|
|
3
|
+
declare class Migration4335 implements MigrationScript {
|
|
4
|
+
fromVersion: string;
|
|
5
|
+
toVersion: string;
|
|
6
|
+
migrateNode(node: JSONProsemirrorNode): JSONProsemirrorNode;
|
|
7
|
+
}
|
|
8
|
+
export default Migration4335;
|
|
@@ -26,5 +26,6 @@ import Migration4213 from './4.2.13';
|
|
|
26
26
|
import Migration4215 from './4.2.15';
|
|
27
27
|
import Migration4323 from './4.3.23';
|
|
28
28
|
import Migration4334 from './4.3.34';
|
|
29
|
-
|
|
29
|
+
import Migration4335 from './4.3.35';
|
|
30
|
+
declare const migrations: (Migration125 | Migration2322 | Migration3012 | Migration3021 | Migration3030 | Migration3031 | Migration3041 | Migration3055 | Migration3056 | Migration4213 | Migration4215 | Migration4323 | Migration4334 | Migration4335)[];
|
|
30
31
|
export default migrations;
|
package/dist/types/version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const VERSION = "4.3.
|
|
1
|
+
export declare const VERSION = "4.3.39";
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@manuscripts/transform",
|
|
3
3
|
"description": "ProseMirror transformer for Manuscripts applications",
|
|
4
|
-
"version": "4.3.
|
|
4
|
+
"version": "4.3.39",
|
|
5
5
|
"repository": "github:Atypon-OpenSource/manuscripts-transform",
|
|
6
6
|
"license": "Apache-2.0",
|
|
7
7
|
"main": "dist/cjs",
|