@manuscripts/transform 1.4.6-LEAN-2852-0 → 1.4.6

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.
@@ -607,27 +607,6 @@ const nodes = [
607
607
  node: 'caption_title',
608
608
  context: 'figcaption/',
609
609
  },
610
- {
611
- tag: 'article-title',
612
- node: 'title',
613
- context: 'front/',
614
- getContent: (node, schema) => {
615
- const element = node;
616
- const content = [];
617
- const title = element.querySelector('article-title');
618
- if (title) {
619
- const articleTitle = schema.nodes.title.create();
620
- const titleText = title.textContent;
621
- if (titleText !== null) {
622
- const trimmedText = titleText.trim();
623
- const trimmedTitleNode = document.createElement('article-title');
624
- trimmedTitleNode.textContent = trimmedText;
625
- content.push(exports.jatsBodyDOMParser.parse(trimmedTitleNode, { topNode: articleTitle }));
626
- }
627
- }
628
- return prosemirror_model_1.Fragment.from(content);
629
- },
630
- },
631
610
  {
632
611
  tag: 'tr',
633
612
  node: 'table_row',
@@ -609,7 +609,6 @@ class JATSExporter {
609
609
  bibliography_item: () => '',
610
610
  comment_list: () => '',
611
611
  keywords_group: () => '',
612
- title: () => '',
613
612
  bibliography_section: (node) => [
614
613
  'ref-list',
615
614
  { id: normalizeID(node.attrs.id) },
@@ -85,7 +85,6 @@ const table_element_1 = require("./nodes/table_element");
85
85
  const table_element_footer_1 = require("./nodes/table_element_footer");
86
86
  const table_row_1 = require("./nodes/table_row");
87
87
  const text_1 = require("./nodes/text");
88
- const title_1 = require("./nodes/title");
89
88
  const toc_element_1 = require("./nodes/toc_element");
90
89
  const toc_section_1 = require("./nodes/toc_section");
91
90
  __exportStar(require("./groups"), exports);
@@ -143,7 +142,6 @@ __exportStar(require("./nodes/meta_section"), exports);
143
142
  __exportStar(require("./nodes/contributor_list"), exports);
144
143
  __exportStar(require("./nodes/contributor"), exports);
145
144
  __exportStar(require("./nodes/table_element_footer"), exports);
146
- __exportStar(require("./nodes/title"), exports);
147
145
  exports.schema = new prosemirror_model_1.Schema({
148
146
  marks: {
149
147
  bold: marks_1.bold,
@@ -220,6 +218,5 @@ exports.schema = new prosemirror_model_1.Schema({
220
218
  contributor_list: contributor_list_1.contributorList,
221
219
  contributor: contributor_1.contributor,
222
220
  table_element_footer: table_element_footer_1.tableElementFooter,
223
- title: title_1.title,
224
221
  },
225
222
  });
@@ -593,12 +593,6 @@ class Decoder {
593
593
  ORCIDIdentifier: model.ORCIDIdentifier,
594
594
  });
595
595
  },
596
- [json_schema_1.ObjectTypes.Title]: (data) => {
597
- const model = data;
598
- return this.parseContents(model.contents || '<div></div>', undefined, this.getComments(model), {
599
- topNode: schema_1.schema.nodes.title.create(),
600
- });
601
- },
602
596
  };
603
597
  this.decode = (model) => {
604
598
  if (!this.creators[model.objectType]) {
@@ -524,9 +524,6 @@ const encoders = {
524
524
  isCorresponding: node.attrs.isCorresponding,
525
525
  ORCIDIdentifier: node.attrs.ORCIDIdentifier,
526
526
  }),
527
- title: (node) => ({
528
- contents: node.attrs.contents,
529
- }),
530
527
  };
531
528
  const modelData = (node, parent, path, priority) => {
532
529
  const encoder = encoders[node.type.name];
@@ -601,27 +601,6 @@ const nodes = [
601
601
  node: 'caption_title',
602
602
  context: 'figcaption/',
603
603
  },
604
- {
605
- tag: 'article-title',
606
- node: 'title',
607
- context: 'front/',
608
- getContent: (node, schema) => {
609
- const element = node;
610
- const content = [];
611
- const title = element.querySelector('article-title');
612
- if (title) {
613
- const articleTitle = schema.nodes.title.create();
614
- const titleText = title.textContent;
615
- if (titleText !== null) {
616
- const trimmedText = titleText.trim();
617
- const trimmedTitleNode = document.createElement('article-title');
618
- trimmedTitleNode.textContent = trimmedText;
619
- content.push(jatsBodyDOMParser.parse(trimmedTitleNode, { topNode: articleTitle }));
620
- }
621
- }
622
- return Fragment.from(content);
623
- },
624
- },
625
604
  {
626
605
  tag: 'tr',
627
606
  node: 'table_row',
@@ -602,7 +602,6 @@ export class JATSExporter {
602
602
  bibliography_item: () => '',
603
603
  comment_list: () => '',
604
604
  keywords_group: () => '',
605
- title: () => '',
606
605
  bibliography_section: (node) => [
607
606
  'ref-list',
608
607
  { id: normalizeID(node.attrs.id) },
@@ -68,7 +68,6 @@ import { tableElement } from './nodes/table_element';
68
68
  import { tableElementFooter } from './nodes/table_element_footer';
69
69
  import { tableCell, tableRow } from './nodes/table_row';
70
70
  import { text } from './nodes/text';
71
- import { title } from './nodes/title';
72
71
  import { tocElement } from './nodes/toc_element';
73
72
  import { tocSection } from './nodes/toc_section';
74
73
  export * from './groups';
@@ -126,7 +125,6 @@ export * from './nodes/meta_section';
126
125
  export * from './nodes/contributor_list';
127
126
  export * from './nodes/contributor';
128
127
  export * from './nodes/table_element_footer';
129
- export * from './nodes/title';
130
128
  export const schema = new Schema({
131
129
  marks: {
132
130
  bold,
@@ -203,6 +201,5 @@ export const schema = new Schema({
203
201
  contributor_list: contributorList,
204
202
  contributor: contributor,
205
203
  table_element_footer: tableElementFooter,
206
- title: title,
207
204
  },
208
205
  });
@@ -583,12 +583,6 @@ export class Decoder {
583
583
  ORCIDIdentifier: model.ORCIDIdentifier,
584
584
  });
585
585
  },
586
- [ObjectTypes.Title]: (data) => {
587
- const model = data;
588
- return this.parseContents(model.contents || '<div></div>', undefined, this.getComments(model), {
589
- topNode: schema.nodes.title.create(),
590
- });
591
- },
592
586
  };
593
587
  this.decode = (model) => {
594
588
  if (!this.creators[model.objectType]) {
@@ -516,9 +516,6 @@ const encoders = {
516
516
  isCorresponding: node.attrs.isCorresponding,
517
517
  ORCIDIdentifier: node.attrs.ORCIDIdentifier,
518
518
  }),
519
- title: (node) => ({
520
- contents: node.attrs.contents,
521
- }),
522
519
  };
523
520
  const modelData = (node, parent, path, priority) => {
524
521
  const encoder = encoders[node.type.name];
@@ -70,5 +70,4 @@ export * from './nodes/meta_section';
70
70
  export * from './nodes/contributor_list';
71
71
  export * from './nodes/contributor';
72
72
  export * from './nodes/table_element_footer';
73
- export * from './nodes/title';
74
73
  export declare const schema: Schema<Nodes, Marks>;
@@ -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' | 'bullet_list' | 'caption' | 'caption_title' | 'comment' | 'comment_list' | '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' | 'keywords_group' | 'keywords_section' | 'link' | 'list_item' | 'listing' | 'listing_element' | 'manuscript' | 'missing_figure' | 'ordered_list' | 'paragraph' | 'placeholder' | 'placeholder_element' | 'pullquote_element' | 'section' | 'section_label' | 'section_title' | 'section_title_plain' | 'table' | 'table_body' | 'table_cell' | 'table_element' | 'table_row' | 'table_colgroup' | 'table_col' | 'text' | 'toc_element' | 'toc_section' | 'affiliation' | 'meta_section' | 'affiliation_list' | 'contributor_list' | 'contributor' | 'table_element_footer' | 'title';
20
+ export type Nodes = 'attribution' | 'bibliography_item' | 'bibliography_element' | 'bibliography_section' | 'blockquote_element' | 'bullet_list' | 'caption' | 'caption_title' | 'comment' | 'comment_list' | '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' | 'keywords_group' | 'keywords_section' | 'link' | 'list_item' | 'listing' | 'listing_element' | 'manuscript' | 'missing_figure' | 'ordered_list' | 'paragraph' | 'placeholder' | 'placeholder_element' | 'pullquote_element' | 'section' | 'section_label' | 'section_title' | 'section_title_plain' | 'table' | 'table_body' | 'table_cell' | 'table_element' | 'table_row' | 'table_colgroup' | 'table_col' | 'text' | 'toc_element' | 'toc_section' | 'affiliation' | 'meta_section' | 'affiliation_list' | 'contributor_list' | 'contributor' | 'table_element_footer';
21
21
  export type ManuscriptSchema = Schema<Nodes, Marks>;
22
22
  export type ManuscriptEditorState = EditorState;
23
23
  export type ManuscriptEditorView = EditorView;
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": "1.4.6-LEAN-2852-0",
4
+ "version": "1.4.6",
5
5
  "repository": "github:Atypon-OpenSource/manuscripts-transform",
6
6
  "license": "Apache-2.0",
7
7
  "main": "dist/cjs",
@@ -29,7 +29,7 @@
29
29
  "version": "yarn build"
30
30
  },
31
31
  "dependencies": {
32
- "@manuscripts/json-schema": "2.2.0-LEAN-2852-0",
32
+ "@manuscripts/json-schema": "^2.2.0",
33
33
  "debug": "^4.3.4",
34
34
  "jszip": "^3.10.1",
35
35
  "mathjax-full": "^3.2.2",
@@ -82,4 +82,4 @@
82
82
  "prosemirror-state": "^1.4.2",
83
83
  "prosemirror-view": "^1.29.1"
84
84
  }
85
- }
85
+ }
@@ -1,29 +0,0 @@
1
- "use strict";
2
- /*!
3
- * © 2019 Atypon Systems LLC
4
- *
5
- * Licensed under the Apache License, Version 2.0 (the "License");
6
- * you may not use this file except in compliance with the License.
7
- * You may obtain a copy of the License at
8
- *
9
- * http://www.apache.org/licenses/LICENSE-2.0
10
- *
11
- * Unless required by applicable law or agreed to in writing, software
12
- * distributed under the License is distributed on an "AS IS" BASIS,
13
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
- * See the License for the specific language governing permissions and
15
- * limitations under the License.
16
- */
17
- Object.defineProperty(exports, "__esModule", { value: true });
18
- exports.title = void 0;
19
- exports.title = {
20
- content: 'text*',
21
- marks: 'italic smallcaps subscript superscript',
22
- attrs: {
23
- id: { default: '' },
24
- dataTracked: { default: null },
25
- },
26
- group: 'block element',
27
- parseDOM: [{ tag: 'div' }],
28
- toDOM: () => ['div', 0],
29
- };
@@ -1,26 +0,0 @@
1
- /*!
2
- * © 2019 Atypon Systems LLC
3
- *
4
- * Licensed under the Apache License, Version 2.0 (the "License");
5
- * you may not use this file except in compliance with the License.
6
- * You may obtain a copy of the License at
7
- *
8
- * http://www.apache.org/licenses/LICENSE-2.0
9
- *
10
- * Unless required by applicable law or agreed to in writing, software
11
- * distributed under the License is distributed on an "AS IS" BASIS,
12
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
- * See the License for the specific language governing permissions and
14
- * limitations under the License.
15
- */
16
- export const title = {
17
- content: 'text*',
18
- marks: 'italic smallcaps subscript superscript',
19
- attrs: {
20
- id: { default: '' },
21
- dataTracked: { default: null },
22
- },
23
- group: 'block element',
24
- parseDOM: [{ tag: 'div' }],
25
- toDOM: () => ['div', 0],
26
- };
@@ -1,25 +0,0 @@
1
- /*!
2
- * © 2019 Atypon Systems LLC
3
- *
4
- * Licensed under the Apache License, Version 2.0 (the "License");
5
- * you may not use this file except in compliance with the License.
6
- * You may obtain a copy of the License at
7
- *
8
- * http://www.apache.org/licenses/LICENSE-2.0
9
- *
10
- * Unless required by applicable law or agreed to in writing, software
11
- * distributed under the License is distributed on an "AS IS" BASIS,
12
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
- * See the License for the specific language governing permissions and
14
- * limitations under the License.
15
- */
16
- import { NodeSpec } from 'prosemirror-model';
17
- import { ManuscriptNode } from '../types';
18
- interface Attrs {
19
- id: string;
20
- }
21
- export interface TitleNode extends ManuscriptNode {
22
- attrs: Attrs;
23
- }
24
- export declare const title: NodeSpec;
25
- export {};