@manuscripts/transform 2.3.1-LEAN-2746.0 → 2.3.1

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.
@@ -36,67 +36,4 @@ exports.bibliographyItem = {
36
36
  },
37
37
  selectable: false,
38
38
  group: 'block',
39
- parseDOM: [
40
- {
41
- tag: 'div.csl-entry',
42
- getAttrs: (p) => {
43
- const dom = p;
44
- return {
45
- id: dom.getAttribute('id'),
46
- type: dom.getAttribute('data-type'),
47
- author: dom.getAttribute('data-author') || undefined,
48
- issued: dom.getAttribute('data-issued') || undefined,
49
- containerTitle: dom.getAttribute('data-container-title') || undefined,
50
- doi: dom.getAttribute('data-doi') || undefined,
51
- volume: dom.getAttribute('data-volume') || undefined,
52
- issue: dom.getAttribute('data-issue') || undefined,
53
- supplement: dom.getAttribute('data-supplement') || undefined,
54
- page: dom.getAttribute('data-page') || undefined,
55
- title: dom.getAttribute('data-title') || undefined,
56
- literal: dom.getAttribute('data-literal') || undefined,
57
- };
58
- },
59
- },
60
- ],
61
- toDOM: (node) => {
62
- const bibliographyItemNode = node;
63
- const attrs = {};
64
- attrs.class = 'csl-entry';
65
- const { id, type, author, issued, containerTitle, doi, volume, issue, supplement, page, title, literal, } = bibliographyItemNode.attrs;
66
- attrs.id = id;
67
- if (type) {
68
- attrs['data-type'] = type;
69
- }
70
- if (author) {
71
- attrs['data-author'] = author.join(',');
72
- }
73
- if (issued) {
74
- attrs['data-issued'] = issued;
75
- }
76
- if (containerTitle) {
77
- attrs['data-container-title'] = containerTitle;
78
- }
79
- if (doi) {
80
- attrs['data-doi'] = doi;
81
- }
82
- if (volume) {
83
- attrs['data-volume'] = volume;
84
- }
85
- if (issue) {
86
- attrs['data-issue'] = issue;
87
- }
88
- if (supplement) {
89
- attrs['data-supplement'] = supplement;
90
- }
91
- if (page) {
92
- attrs['data-page'] = page;
93
- }
94
- if (title) {
95
- attrs['data-title'] = title;
96
- }
97
- if (literal) {
98
- attrs['data-literal'] = literal;
99
- }
100
- return ['div', attrs, 0];
101
- },
102
39
  };
@@ -19,7 +19,7 @@ exports.tableElementFooter = void 0;
19
19
  exports.tableElementFooter = {
20
20
  attrs: {
21
21
  id: { default: '' },
22
- dataTracked: { default: null }
22
+ dataTracked: { default: null },
23
23
  },
24
24
  content: '(paragraph | footnotes_element)*',
25
25
  group: 'block element',
@@ -17,7 +17,8 @@
17
17
  Object.defineProperty(exports, "__esModule", { value: true });
18
18
  exports.title = void 0;
19
19
  exports.title = {
20
- content: 'inline*',
20
+ content: 'text*',
21
+ marks: 'italic smallcaps subscript superscript tracked_insert tracked_delete',
21
22
  attrs: {
22
23
  id: { default: '' },
23
24
  dataTracked: { default: null },
@@ -169,9 +169,7 @@ class Decoder {
169
169
  this.creators = {
170
170
  [json_schema_1.ObjectTypes.Titles]: (data) => {
171
171
  const model = data;
172
- const comments = this.createCommentNodes(model);
173
- comments.forEach((c) => this.comments.set(c.attrs.id, c));
174
- return this.parseContents(model.title, 'div', this.getComments(model), {
172
+ return this.parseContents(model.title, 'div', undefined, {
175
173
  topNode: schema_1.schema.nodes.title.create({
176
174
  id: model._id,
177
175
  }),
@@ -33,67 +33,4 @@ export const bibliographyItem = {
33
33
  },
34
34
  selectable: false,
35
35
  group: 'block',
36
- parseDOM: [
37
- {
38
- tag: 'div.csl-entry',
39
- getAttrs: (p) => {
40
- const dom = p;
41
- return {
42
- id: dom.getAttribute('id'),
43
- type: dom.getAttribute('data-type'),
44
- author: dom.getAttribute('data-author') || undefined,
45
- issued: dom.getAttribute('data-issued') || undefined,
46
- containerTitle: dom.getAttribute('data-container-title') || undefined,
47
- doi: dom.getAttribute('data-doi') || undefined,
48
- volume: dom.getAttribute('data-volume') || undefined,
49
- issue: dom.getAttribute('data-issue') || undefined,
50
- supplement: dom.getAttribute('data-supplement') || undefined,
51
- page: dom.getAttribute('data-page') || undefined,
52
- title: dom.getAttribute('data-title') || undefined,
53
- literal: dom.getAttribute('data-literal') || undefined,
54
- };
55
- },
56
- },
57
- ],
58
- toDOM: (node) => {
59
- const bibliographyItemNode = node;
60
- const attrs = {};
61
- attrs.class = 'csl-entry';
62
- const { id, type, author, issued, containerTitle, doi, volume, issue, supplement, page, title, literal, } = bibliographyItemNode.attrs;
63
- attrs.id = id;
64
- if (type) {
65
- attrs['data-type'] = type;
66
- }
67
- if (author) {
68
- attrs['data-author'] = author.join(',');
69
- }
70
- if (issued) {
71
- attrs['data-issued'] = issued;
72
- }
73
- if (containerTitle) {
74
- attrs['data-container-title'] = containerTitle;
75
- }
76
- if (doi) {
77
- attrs['data-doi'] = doi;
78
- }
79
- if (volume) {
80
- attrs['data-volume'] = volume;
81
- }
82
- if (issue) {
83
- attrs['data-issue'] = issue;
84
- }
85
- if (supplement) {
86
- attrs['data-supplement'] = supplement;
87
- }
88
- if (page) {
89
- attrs['data-page'] = page;
90
- }
91
- if (title) {
92
- attrs['data-title'] = title;
93
- }
94
- if (literal) {
95
- attrs['data-literal'] = literal;
96
- }
97
- return ['div', attrs, 0];
98
- },
99
36
  };
@@ -16,7 +16,7 @@
16
16
  export const tableElementFooter = {
17
17
  attrs: {
18
18
  id: { default: '' },
19
- dataTracked: { default: null }
19
+ dataTracked: { default: null },
20
20
  },
21
21
  content: '(paragraph | footnotes_element)*',
22
22
  group: 'block element',
@@ -14,7 +14,8 @@
14
14
  * limitations under the License.
15
15
  */
16
16
  export const title = {
17
- content: 'inline*',
17
+ content: 'text*',
18
+ marks: 'italic smallcaps subscript superscript tracked_insert tracked_delete',
18
19
  attrs: {
19
20
  id: { default: '' },
20
21
  dataTracked: { default: null },
@@ -160,9 +160,7 @@ export class Decoder {
160
160
  this.creators = {
161
161
  [ObjectTypes.Titles]: (data) => {
162
162
  const model = data;
163
- const comments = this.createCommentNodes(model);
164
- comments.forEach((c) => this.comments.set(c.attrs.id, c));
165
- return this.parseContents(model.title, 'div', this.getComments(model), {
163
+ return this.parseContents(model.title, 'div', undefined, {
166
164
  topNode: schema.nodes.title.create({
167
165
  id: model._id,
168
166
  }),
@@ -13,13 +13,14 @@
13
13
  * See the License for the specific language governing permissions and
14
14
  * limitations under the License.
15
15
  */
16
+ import { BibliographicDate, BibliographicName } from '@manuscripts/json-schema';
16
17
  import { NodeSpec } from 'prosemirror-model';
17
18
  import { ManuscriptNode } from '../types';
18
19
  interface Attrs {
19
20
  id: string;
20
21
  type: string;
21
- author?: string[];
22
- issued?: string;
22
+ author?: BibliographicName[];
23
+ issued?: BibliographicDate;
23
24
  containerTitle?: string;
24
25
  doi?: string;
25
26
  volume?: string;
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": "2.3.1-LEAN-2746.0",
4
+ "version": "2.3.1",
5
5
  "repository": "github:Atypon-OpenSource/manuscripts-transform",
6
6
  "license": "Apache-2.0",
7
7
  "main": "dist/cjs",