@manuscripts/body-editor 2.5.0 → 2.5.2-LEAN-3894.0

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.
@@ -1,8 +1,12 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.createCommentMarker = exports.getCommentRange = exports.getCommentKey = exports.isNodeComment = void 0;
3
+ exports.createCommentMarker = exports.getCommentRange = exports.getCommentKey = exports.isReply = exports.isNodeComment = void 0;
4
4
  const isNodeComment = (c) => !c.range;
5
5
  exports.isNodeComment = isNodeComment;
6
+ const isReply = (comment) => {
7
+ return comment.node.attrs.target.includes('MPCommentAnnotation');
8
+ };
9
+ exports.isReply = isReply;
6
10
  const getCommentKey = (comment, range, target) => {
7
11
  if (!range) {
8
12
  return target.attrs.id;
@@ -133,14 +133,16 @@ const buildPluginState = (doc, selection) => {
133
133
  })
134
134
  .forEach((c) => {
135
135
  allComments.push(c);
136
- if (!c.range) {
137
- nodeComments.push(c);
138
- }
139
- else if (c.range.size) {
140
- highlightComments.push(c);
141
- }
142
- else {
143
- pointComments.push(c);
136
+ if (!(0, comments_1.isReply)(c)) {
137
+ if (!c.range) {
138
+ nodeComments.push(c);
139
+ }
140
+ else if (c.range.size) {
141
+ highlightComments.push(c);
142
+ }
143
+ else {
144
+ pointComments.push(c);
145
+ }
144
146
  }
145
147
  });
146
148
  for (const comment of highlightComments) {
@@ -1,5 +1,5 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.MATHJAX_VERSION = exports.VERSION = void 0;
4
- exports.VERSION = '2.5.0';
4
+ exports.VERSION = '2.5.2-LEAN-3894.0';
5
5
  exports.MATHJAX_VERSION = '3.2.2';
@@ -1,4 +1,7 @@
1
1
  export const isNodeComment = (c) => !c.range;
2
+ export const isReply = (comment) => {
3
+ return comment.node.attrs.target.includes('MPCommentAnnotation');
4
+ };
2
5
  export const getCommentKey = (comment, range, target) => {
3
6
  if (!range) {
4
7
  return target.attrs.id;
@@ -2,7 +2,7 @@ import { schema, } from '@manuscripts/transform';
2
2
  import { Plugin, PluginKey } from 'prosemirror-state';
3
3
  import { findChildrenByType } from 'prosemirror-utils';
4
4
  import { Decoration, DecorationSet } from 'prosemirror-view';
5
- import { createCommentMarker, getCommentKey, } from '../lib/comments';
5
+ import { createCommentMarker, getCommentKey, isReply, } from '../lib/comments';
6
6
  export const commentsKey = new PluginKey('comments');
7
7
  const COMMENT_SELECTION = 'comment-selection';
8
8
  const EMPTY_SELECTION = {};
@@ -128,14 +128,16 @@ const buildPluginState = (doc, selection) => {
128
128
  })
129
129
  .forEach((c) => {
130
130
  allComments.push(c);
131
- if (!c.range) {
132
- nodeComments.push(c);
133
- }
134
- else if (c.range.size) {
135
- highlightComments.push(c);
136
- }
137
- else {
138
- pointComments.push(c);
131
+ if (!isReply(c)) {
132
+ if (!c.range) {
133
+ nodeComments.push(c);
134
+ }
135
+ else if (c.range.size) {
136
+ highlightComments.push(c);
137
+ }
138
+ else {
139
+ pointComments.push(c);
140
+ }
139
141
  }
140
142
  });
141
143
  for (const comment of highlightComments) {
@@ -1,2 +1,2 @@
1
- export const VERSION = '2.5.0';
1
+ export const VERSION = '2.5.2-LEAN-3894.0';
2
2
  export const MATHJAX_VERSION = '3.2.2';
@@ -27,6 +27,7 @@ export type CommentSelection = {
27
27
  isNew: boolean;
28
28
  };
29
29
  export declare const isNodeComment: (c: any) => c is NodeComment;
30
+ export declare const isReply: (comment: Comment) => boolean;
30
31
  export declare const getCommentKey: (comment: CommentAttrs, range: CommentRange | undefined, target: ManuscriptNode) => CommentKey;
31
32
  export declare const getCommentRange: (comment: CommentAttrs) => {
32
33
  pos: number;
@@ -1,2 +1,2 @@
1
- export declare const VERSION = "2.5.0";
1
+ export declare const VERSION = "2.5.2-LEAN-3894.0";
2
2
  export declare const MATHJAX_VERSION = "3.2.2";
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@manuscripts/body-editor",
3
3
  "description": "Prosemirror components for editing and viewing manuscripts",
4
- "version": "2.5.0",
4
+ "version": "2.5.2-LEAN-3894.0",
5
5
  "repository": "github:Atypon-OpenSource/manuscripts-body-editor",
6
6
  "license": "Apache-2.0",
7
7
  "main": "dist/cjs",
@@ -34,7 +34,7 @@
34
34
  "@manuscripts/library": "1.3.11",
35
35
  "@manuscripts/style-guide": "2.0.21",
36
36
  "@manuscripts/track-changes-plugin": "1.8.0",
37
- "@manuscripts/transform": "3.0.8",
37
+ "@manuscripts/transform": "3.0.9",
38
38
  "@popperjs/core": "^2.11.8",
39
39
  "astrocite-eutils": "^0.16.4",
40
40
  "codemirror": "^5.58.1",