@manuscripts/transform 1.3.0 → 1.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.
@@ -19,6 +19,7 @@ exports.commentList = void 0;
19
19
  exports.commentList = {
20
20
  content: 'comment*',
21
21
  attrs: {
22
- id: { default: '' },
22
+ id: { default: 'COMMENT_LIST' },
23
23
  },
24
+ toDOM: () => ['section', 0],
24
25
  };
@@ -17,7 +17,7 @@
17
17
  Object.defineProperty(exports, "__esModule", { value: true });
18
18
  exports.manuscript = void 0;
19
19
  exports.manuscript = {
20
- content: '(section | sections)+ comment_list*',
20
+ content: '(section | sections)+ comment_list',
21
21
  attrs: {
22
22
  id: { default: '' },
23
23
  },
@@ -571,12 +571,10 @@ class Decoder {
571
571
  }));
572
572
  }
573
573
  const contents = rootSectionNodes;
574
- if (this.comments.size) {
575
- const comments = schema_1.schema.nodes.comment_list.createAndFill({
576
- id: (0, id_1.generateNodeID)(schema_1.schema.nodes.comment_list),
577
- }, [...this.comments.values()]);
578
- contents.push(comments);
579
- }
574
+ const comments = schema_1.schema.nodes.comment_list.createAndFill({}, [
575
+ ...this.comments.values(),
576
+ ]);
577
+ contents.push(comments);
580
578
  return schema_1.schema.nodes.manuscript.create({
581
579
  id: manuscriptID || this.getManuscriptID(),
582
580
  }, contents);
@@ -16,6 +16,7 @@
16
16
  export const commentList = {
17
17
  content: 'comment*',
18
18
  attrs: {
19
- id: { default: '' },
19
+ id: { default: 'COMMENT_LIST' },
20
20
  },
21
+ toDOM: () => ['section', 0],
21
22
  };
@@ -14,7 +14,7 @@
14
14
  * limitations under the License.
15
15
  */
16
16
  export const manuscript = {
17
- content: '(section | sections)+ comment_list*',
17
+ content: '(section | sections)+ comment_list',
18
18
  attrs: {
19
19
  id: { default: '' },
20
20
  },
@@ -561,12 +561,10 @@ export class Decoder {
561
561
  }));
562
562
  }
563
563
  const contents = rootSectionNodes;
564
- if (this.comments.size) {
565
- const comments = schema.nodes.comment_list.createAndFill({
566
- id: generateNodeID(schema.nodes.comment_list),
567
- }, [...this.comments.values()]);
568
- contents.push(comments);
569
- }
564
+ const comments = schema.nodes.comment_list.createAndFill({}, [
565
+ ...this.comments.values(),
566
+ ]);
567
+ contents.push(comments);
570
568
  return schema.nodes.manuscript.create({
571
569
  id: manuscriptID || this.getManuscriptID(),
572
570
  }, contents);
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.3.0",
4
+ "version": "1.3.1",
5
5
  "repository": "github:Atypon-OpenSource/manuscripts-transform",
6
6
  "license": "Apache-2.0",
7
7
  "main": "dist/cjs",