@manuscripts/transform 3.0.31-LEAN-4218.0 → 3.0.31
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/cjs/jats/exporter/jats-exporter.js +1 -0
- package/dist/cjs/jats/exporter/labels.js +0 -1
- package/dist/cjs/jats/importer/jats-dom-parser.js +1 -1
- package/dist/cjs/jats/importer/jats-transformations.js +1 -1
- package/dist/cjs/schema/index.js +1 -0
- package/dist/cjs/schema/migration/migration-scripts/3.0.22.js +21 -0
- package/dist/cjs/schema/migration/migration-scripts/index.js +2 -0
- package/dist/cjs/schema/nodes/embed.js +0 -1
- package/dist/cjs/schema/nodes/table.js +1 -1
- package/dist/cjs/schema/nodes/text.js +5 -1
- package/dist/cjs/transformer/node-names.js +1 -1
- package/dist/cjs/version.js +1 -1
- package/dist/es/jats/exporter/jats-exporter.js +1 -0
- package/dist/es/jats/exporter/labels.js +0 -1
- package/dist/es/jats/importer/jats-dom-parser.js +1 -1
- package/dist/es/jats/importer/jats-transformations.js +1 -1
- package/dist/es/schema/index.js +2 -1
- package/dist/es/schema/migration/migration-scripts/3.0.22.js +19 -0
- package/dist/es/schema/migration/migration-scripts/index.js +2 -0
- package/dist/es/schema/nodes/embed.js +0 -1
- package/dist/es/schema/nodes/table.js +1 -1
- package/dist/es/schema/nodes/text.js +4 -0
- package/dist/es/transformer/node-names.js +1 -1
- package/dist/es/version.js +1 -1
- package/dist/types/schema/migration/migration-scripts/3.0.22.d.ts +8 -0
- package/dist/types/schema/migration/migration-scripts/index.d.ts +2 -1
- package/dist/types/schema/nodes/text.d.ts +1 -0
- package/dist/types/schema/types.d.ts +1 -1
- package/dist/types/version.d.ts +1 -1
- package/package.json +1 -1
|
@@ -578,6 +578,7 @@ class JATSExporter {
|
|
|
578
578
|
author_notes: () => '',
|
|
579
579
|
corresp: () => '',
|
|
580
580
|
title: () => '',
|
|
581
|
+
text_block: (node) => nodes.paragraph(node),
|
|
581
582
|
affiliations: () => '',
|
|
582
583
|
contributors: () => '',
|
|
583
584
|
table_element_footer: (node) => node.childCount == 0
|
|
@@ -24,7 +24,6 @@ const labelledNodeTypes = [
|
|
|
24
24
|
schema_1.schema.nodes.equation_element,
|
|
25
25
|
schema_1.schema.nodes.listing_element,
|
|
26
26
|
schema_1.schema.nodes.box_element,
|
|
27
|
-
schema_1.schema.nodes.embed,
|
|
28
27
|
];
|
|
29
28
|
const excludedTypes = [schema_1.schema.nodes.graphical_abstract_section];
|
|
30
29
|
const chooseLabel = (nodeType) => {
|
|
@@ -26,7 +26,7 @@ const createSectionGroup = (type, createElement) => {
|
|
|
26
26
|
return sec;
|
|
27
27
|
};
|
|
28
28
|
const addMissingCaptions = (doc, createElement) => {
|
|
29
|
-
const elements = doc.querySelectorAll('fig, table-wrap
|
|
29
|
+
const elements = doc.querySelectorAll('fig, table-wrap');
|
|
30
30
|
for (const element of elements) {
|
|
31
31
|
let caption = element.querySelector('caption');
|
|
32
32
|
if (!caption) {
|
package/dist/cjs/schema/index.js
CHANGED
|
@@ -231,6 +231,7 @@ exports.schema = new prosemirror_model_1.Schema({
|
|
|
231
231
|
table_colgroup: table_col_1.tableColGroup,
|
|
232
232
|
table_header: table_1.tableHeader,
|
|
233
233
|
text: text_1.text,
|
|
234
|
+
text_block: text_1.textBlock,
|
|
234
235
|
affiliation: affiliation_1.affiliation,
|
|
235
236
|
contributor: contributor_1.contributor,
|
|
236
237
|
table_element_footer: table_element_footer_1.tableElementFooter,
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
class Migration3021 {
|
|
4
|
+
constructor() {
|
|
5
|
+
this.fromVersion = '3.0.21';
|
|
6
|
+
this.toVersion = '3.0.22';
|
|
7
|
+
}
|
|
8
|
+
migrateNode(node) {
|
|
9
|
+
if (node.type === 'table_header' || node.type === 'table_cell') {
|
|
10
|
+
return Object.assign(Object.assign({}, node), { content: [
|
|
11
|
+
{
|
|
12
|
+
type: 'text_block',
|
|
13
|
+
attrs: {},
|
|
14
|
+
content: node.content,
|
|
15
|
+
},
|
|
16
|
+
] });
|
|
17
|
+
}
|
|
18
|
+
return node;
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
exports.default = Migration3021;
|
|
@@ -22,12 +22,14 @@ const _1_2_5_1 = __importDefault(require("./1.2.5"));
|
|
|
22
22
|
const _2_3_22_1 = __importDefault(require("./2.3.22"));
|
|
23
23
|
const _3_0_12_1 = require("./3.0.12");
|
|
24
24
|
const _3_0_21_1 = __importDefault(require("./3.0.21"));
|
|
25
|
+
const _3_0_22_1 = __importDefault(require("./3.0.22"));
|
|
25
26
|
const _3_0_30_1 = __importDefault(require("./3.0.30"));
|
|
26
27
|
const migrations = [
|
|
27
28
|
new _1_2_5_1.default(),
|
|
28
29
|
new _2_3_22_1.default(),
|
|
29
30
|
new _3_0_12_1.Migration3012(),
|
|
30
31
|
new _3_0_21_1.default(),
|
|
32
|
+
new _3_0_22_1.default(),
|
|
31
33
|
new _3_0_30_1.default(),
|
|
32
34
|
];
|
|
33
35
|
exports.default = migrations;
|
|
@@ -37,7 +37,7 @@ function createCellAttribute(attributeName, defaultValue = null, customGetFromDO
|
|
|
37
37
|
};
|
|
38
38
|
}
|
|
39
39
|
const tableOptions = {
|
|
40
|
-
cellContent: '
|
|
40
|
+
cellContent: 'text_block+',
|
|
41
41
|
cellAttributes: {
|
|
42
42
|
placeholder: createCellAttribute('data-placeholder-text', 'Data', (dom) => dom.getAttribute('data-placeholder-text') || ''),
|
|
43
43
|
valign: createCellAttribute('valign'),
|
|
@@ -15,7 +15,11 @@
|
|
|
15
15
|
* limitations under the License.
|
|
16
16
|
*/
|
|
17
17
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
-
exports.text = void 0;
|
|
18
|
+
exports.textBlock = exports.text = void 0;
|
|
19
|
+
const paragraph_1 = require("./paragraph");
|
|
19
20
|
exports.text = {
|
|
20
21
|
group: 'inline',
|
|
21
22
|
};
|
|
23
|
+
exports.textBlock = Object.assign(Object.assign({}, paragraph_1.paragraph), { attrs: {
|
|
24
|
+
dataTracked: { default: null },
|
|
25
|
+
}, group: 'block' });
|
|
@@ -37,7 +37,6 @@ exports.nodeNames = new Map([
|
|
|
37
37
|
[schema_1.schema.nodes.table_header, 'Table Header'],
|
|
38
38
|
[schema_1.schema.nodes.general_table_footnote, 'General Table note'],
|
|
39
39
|
[schema_1.schema.nodes.table_element_footer, 'Table Footer'],
|
|
40
|
-
[schema_1.schema.nodes.embed, 'Media'],
|
|
41
40
|
[schema_1.schema.nodes.equation, 'Equation'],
|
|
42
41
|
[schema_1.schema.nodes.inline_equation, 'Inline Equation'],
|
|
43
42
|
[schema_1.schema.nodes.inline_footnote, 'Footnote Reference'],
|
|
@@ -48,6 +47,7 @@ exports.nodeNames = new Map([
|
|
|
48
47
|
[schema_1.schema.nodes.list_item, 'List Item'],
|
|
49
48
|
[schema_1.schema.nodes.manuscript, 'Manuscript'],
|
|
50
49
|
[schema_1.schema.nodes.paragraph, 'Paragraph'],
|
|
50
|
+
[schema_1.schema.nodes.text_block, 'Paragraph'],
|
|
51
51
|
[schema_1.schema.nodes.section, 'Section'],
|
|
52
52
|
[schema_1.schema.nodes.section_title, 'Section Title'],
|
|
53
53
|
[schema_1.schema.nodes.section_title_plain, 'Section Title'],
|
package/dist/cjs/version.js
CHANGED
|
@@ -570,6 +570,7 @@ export class JATSExporter {
|
|
|
570
570
|
author_notes: () => '',
|
|
571
571
|
corresp: () => '',
|
|
572
572
|
title: () => '',
|
|
573
|
+
text_block: (node) => nodes.paragraph(node),
|
|
573
574
|
affiliations: () => '',
|
|
574
575
|
contributors: () => '',
|
|
575
576
|
table_element_footer: (node) => node.childCount == 0
|
|
@@ -23,7 +23,7 @@ const createSectionGroup = (type, createElement) => {
|
|
|
23
23
|
return sec;
|
|
24
24
|
};
|
|
25
25
|
export const addMissingCaptions = (doc, createElement) => {
|
|
26
|
-
const elements = doc.querySelectorAll('fig, table-wrap
|
|
26
|
+
const elements = doc.querySelectorAll('fig, table-wrap');
|
|
27
27
|
for (const element of elements) {
|
|
28
28
|
let caption = element.querySelector('caption');
|
|
29
29
|
if (!caption) {
|
package/dist/es/schema/index.js
CHANGED
|
@@ -78,7 +78,7 @@ import { table, tableCell, tableHeader, tableRow } from './nodes/table';
|
|
|
78
78
|
import { tableCol, tableColGroup } from './nodes/table_col';
|
|
79
79
|
import { tableElement } from './nodes/table_element';
|
|
80
80
|
import { tableElementFooter } from './nodes/table_element_footer';
|
|
81
|
-
import { text } from './nodes/text';
|
|
81
|
+
import { text, textBlock } from './nodes/text';
|
|
82
82
|
import { title } from './nodes/title';
|
|
83
83
|
export * from './groups';
|
|
84
84
|
export * from './nodes/affiliation';
|
|
@@ -214,6 +214,7 @@ export const schema = new Schema({
|
|
|
214
214
|
table_colgroup: tableColGroup,
|
|
215
215
|
table_header: tableHeader,
|
|
216
216
|
text,
|
|
217
|
+
text_block: textBlock,
|
|
217
218
|
affiliation,
|
|
218
219
|
contributor: contributor,
|
|
219
220
|
table_element_footer: tableElementFooter,
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
class Migration3021 {
|
|
2
|
+
constructor() {
|
|
3
|
+
this.fromVersion = '3.0.21';
|
|
4
|
+
this.toVersion = '3.0.22';
|
|
5
|
+
}
|
|
6
|
+
migrateNode(node) {
|
|
7
|
+
if (node.type === 'table_header' || node.type === 'table_cell') {
|
|
8
|
+
return Object.assign(Object.assign({}, node), { content: [
|
|
9
|
+
{
|
|
10
|
+
type: 'text_block',
|
|
11
|
+
attrs: {},
|
|
12
|
+
content: node.content,
|
|
13
|
+
},
|
|
14
|
+
] });
|
|
15
|
+
}
|
|
16
|
+
return node;
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
export default Migration3021;
|
|
@@ -17,12 +17,14 @@ import Migration125 from './1.2.5';
|
|
|
17
17
|
import Migration2322 from './2.3.22';
|
|
18
18
|
import { Migration3012 } from './3.0.12';
|
|
19
19
|
import Migration3021 from './3.0.21';
|
|
20
|
+
import Migration3022 from './3.0.22';
|
|
20
21
|
import Migration3030 from './3.0.30';
|
|
21
22
|
const migrations = [
|
|
22
23
|
new Migration125(),
|
|
23
24
|
new Migration2322(),
|
|
24
25
|
new Migration3012(),
|
|
25
26
|
new Migration3021(),
|
|
27
|
+
new Migration3022(),
|
|
26
28
|
new Migration3030(),
|
|
27
29
|
];
|
|
28
30
|
export default migrations;
|
|
@@ -34,7 +34,7 @@ function createCellAttribute(attributeName, defaultValue = null, customGetFromDO
|
|
|
34
34
|
};
|
|
35
35
|
}
|
|
36
36
|
const tableOptions = {
|
|
37
|
-
cellContent: '
|
|
37
|
+
cellContent: 'text_block+',
|
|
38
38
|
cellAttributes: {
|
|
39
39
|
placeholder: createCellAttribute('data-placeholder-text', 'Data', (dom) => dom.getAttribute('data-placeholder-text') || ''),
|
|
40
40
|
valign: createCellAttribute('valign'),
|
|
@@ -13,6 +13,10 @@
|
|
|
13
13
|
* See the License for the specific language governing permissions and
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
|
+
import { paragraph } from './paragraph';
|
|
16
17
|
export const text = {
|
|
17
18
|
group: 'inline',
|
|
18
19
|
};
|
|
20
|
+
export const textBlock = Object.assign(Object.assign({}, paragraph), { attrs: {
|
|
21
|
+
dataTracked: { default: null },
|
|
22
|
+
}, group: 'block' });
|
|
@@ -34,7 +34,6 @@ export const nodeNames = new Map([
|
|
|
34
34
|
[schema.nodes.table_header, 'Table Header'],
|
|
35
35
|
[schema.nodes.general_table_footnote, 'General Table note'],
|
|
36
36
|
[schema.nodes.table_element_footer, 'Table Footer'],
|
|
37
|
-
[schema.nodes.embed, 'Media'],
|
|
38
37
|
[schema.nodes.equation, 'Equation'],
|
|
39
38
|
[schema.nodes.inline_equation, 'Inline Equation'],
|
|
40
39
|
[schema.nodes.inline_footnote, 'Footnote Reference'],
|
|
@@ -45,6 +44,7 @@ export const nodeNames = new Map([
|
|
|
45
44
|
[schema.nodes.list_item, 'List Item'],
|
|
46
45
|
[schema.nodes.manuscript, 'Manuscript'],
|
|
47
46
|
[schema.nodes.paragraph, 'Paragraph'],
|
|
47
|
+
[schema.nodes.text_block, 'Paragraph'],
|
|
48
48
|
[schema.nodes.section, 'Section'],
|
|
49
49
|
[schema.nodes.section_title, 'Section Title'],
|
|
50
50
|
[schema.nodes.section_title_plain, 'Section Title'],
|
package/dist/es/version.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const VERSION = "3.0.31
|
|
1
|
+
export const VERSION = "3.0.31";
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { JSONNode } from '../migrate';
|
|
2
|
+
import { MigrationScript } from '../migration-script';
|
|
3
|
+
declare class Migration3021 implements MigrationScript {
|
|
4
|
+
fromVersion: string;
|
|
5
|
+
toVersion: string;
|
|
6
|
+
migrateNode(node: JSONNode): JSONNode;
|
|
7
|
+
}
|
|
8
|
+
export default Migration3021;
|
|
@@ -17,6 +17,7 @@ import Migration125 from './1.2.5';
|
|
|
17
17
|
import Migration2322 from './2.3.22';
|
|
18
18
|
import { Migration3012 } from './3.0.12';
|
|
19
19
|
import Migration3021 from './3.0.21';
|
|
20
|
+
import Migration3022 from './3.0.22';
|
|
20
21
|
import Migration3030 from './3.0.30';
|
|
21
|
-
declare const migrations: (Migration125 | Migration2322 | Migration3012 | Migration3021 | Migration3030)[];
|
|
22
|
+
declare const migrations: (Migration125 | Migration2322 | Migration3012 | Migration3021 | Migration3022 | Migration3030)[];
|
|
22
23
|
export default migrations;
|
|
@@ -17,7 +17,7 @@ import { Fragment, Mark as ProsemirrorMark, MarkType, Node as ProsemirrorNode, N
|
|
|
17
17
|
import { EditorState, NodeSelection, Plugin, TextSelection, Transaction } from 'prosemirror-state';
|
|
18
18
|
import { EditorView, NodeView } from 'prosemirror-view';
|
|
19
19
|
export type Marks = 'bold' | 'code' | 'italic' | 'smallcaps' | 'strikethrough' | 'styled' | 'subscript' | 'superscript' | 'underline' | 'tracked_insert' | 'tracked_delete';
|
|
20
|
-
export type Nodes = 'attribution' | 'bibliography_item' | 'bibliography_element' | 'bibliography_section' | 'blockquote_element' | 'list' | 'caption' | 'caption_title' | 'comment' | 'comments' | 'citation' | 'cross_reference' | 'doc' | 'equation' | 'equation_element' | 'figcaption' | 'figure' | 'graphical_abstract_section' | 'figure_element' | 'footnote' | 'footnotes_element' | 'footnotes_section' | 'hard_break' | 'highlight_marker' | 'inline_equation' | 'inline_footnote' | 'keyword' | 'keywords_element' | 'keyword_group' | 'keywords' | 'link' | 'list_item' | 'listing' | 'listing_element' | 'manuscript' | 'abstracts' | 'body' | 'backmatter' | 'missing_figure' | 'paragraph' | 'placeholder' | 'placeholder_element' | 'pullquote_element' | 'section' | 'section_label' | 'section_title' | 'section_title_plain' | 'table' | 'table_cell' | 'table_element' | 'table_row' | 'table_colgroup' | 'table_col' | 'table_header' | 'text' | 'affiliation' | 'contributor' | 'table_element_footer' | 'title' | 'affiliations' | 'contributors' | 'supplements' | 'supplement' | 'author_notes' | 'corresp' | 'general_table_footnote' | 'box_element' | 'awards' | 'award' | 'embed' | 'image_element';
|
|
20
|
+
export type Nodes = 'attribution' | 'bibliography_item' | 'bibliography_element' | 'bibliography_section' | 'blockquote_element' | 'list' | 'caption' | 'caption_title' | 'comment' | 'comments' | 'citation' | 'cross_reference' | 'doc' | 'equation' | 'equation_element' | 'figcaption' | 'figure' | 'graphical_abstract_section' | 'figure_element' | 'footnote' | 'footnotes_element' | 'footnotes_section' | 'hard_break' | 'highlight_marker' | 'inline_equation' | 'inline_footnote' | 'keyword' | 'keywords_element' | 'keyword_group' | 'keywords' | 'link' | 'list_item' | 'listing' | 'listing_element' | 'manuscript' | 'abstracts' | 'body' | 'backmatter' | 'missing_figure' | 'paragraph' | 'placeholder' | 'placeholder_element' | 'pullquote_element' | 'section' | 'section_label' | 'section_title' | 'section_title_plain' | 'table' | 'table_cell' | 'table_element' | 'table_row' | 'table_colgroup' | 'table_col' | 'table_header' | 'text' | 'text_block' | 'affiliation' | 'contributor' | 'table_element_footer' | 'title' | 'affiliations' | 'contributors' | 'supplements' | 'supplement' | 'author_notes' | 'corresp' | 'general_table_footnote' | 'box_element' | 'awards' | 'award' | 'embed' | 'image_element';
|
|
21
21
|
export type ManuscriptSchema = Schema<Nodes, Marks>;
|
|
22
22
|
export type ManuscriptEditorState = EditorState;
|
|
23
23
|
export type ManuscriptEditorView = EditorView;
|
package/dist/types/version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const VERSION = "3.0.31
|
|
1
|
+
export declare const VERSION = "3.0.31";
|
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": "3.0.31
|
|
4
|
+
"version": "3.0.31",
|
|
5
5
|
"repository": "github:Atypon-OpenSource/manuscripts-transform",
|
|
6
6
|
"license": "Apache-2.0",
|
|
7
7
|
"main": "dist/cjs",
|