@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.
- package/dist/cjs/lib/comments.js +5 -1
- package/dist/cjs/plugins/comments.js +10 -8
- package/dist/cjs/versions.js +1 -1
- package/dist/es/lib/comments.js +3 -0
- package/dist/es/plugins/comments.js +11 -9
- package/dist/es/versions.js +1 -1
- package/dist/types/lib/comments.d.ts +1 -0
- package/dist/types/versions.d.ts +1 -1
- package/package.json +2 -2
package/dist/cjs/lib/comments.js
CHANGED
|
@@ -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 (!
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
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) {
|
package/dist/cjs/versions.js
CHANGED
package/dist/es/lib/comments.js
CHANGED
|
@@ -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
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
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) {
|
package/dist/es/versions.js
CHANGED
|
@@ -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;
|
package/dist/types/versions.d.ts
CHANGED
|
@@ -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.
|
|
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",
|