@manuscripts/body-editor 1.6.4 → 1.6.5

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.
@@ -5,7 +5,13 @@ const transform_1 = require("@manuscripts/transform");
5
5
  function findHighlightMarkers(doc) {
6
6
  const markers = [];
7
7
  let current;
8
+ const commentIds = [];
8
9
  doc.descendants((node, pos) => {
10
+ if (node.type.name === transform_1.schema.nodes.comments.name) {
11
+ node.content.forEach(({ attrs }) => {
12
+ commentIds.push(attrs.id);
13
+ });
14
+ }
9
15
  if ((0, transform_1.isHighlightMarkerNode)(node)) {
10
16
  const { position, tid, id } = node.attrs;
11
17
  if (position === 'start') {
@@ -21,6 +27,6 @@ function findHighlightMarkers(doc) {
21
27
  }
22
28
  }
23
29
  });
24
- return markers;
30
+ return markers.filter((marker) => commentIds.includes(marker.id));
25
31
  }
26
32
  exports.findHighlightMarkers = findHighlightMarkers;
@@ -1,8 +1,14 @@
1
- import { isHighlightMarkerNode } from '@manuscripts/transform';
1
+ import { isHighlightMarkerNode, schema } from '@manuscripts/transform';
2
2
  export function findHighlightMarkers(doc) {
3
3
  const markers = [];
4
4
  let current;
5
+ const commentIds = [];
5
6
  doc.descendants((node, pos) => {
7
+ if (node.type.name === schema.nodes.comments.name) {
8
+ node.content.forEach(({ attrs }) => {
9
+ commentIds.push(attrs.id);
10
+ });
11
+ }
6
12
  if (isHighlightMarkerNode(node)) {
7
13
  const { position, tid, id } = node.attrs;
8
14
  if (position === 'start') {
@@ -18,5 +24,5 @@ export function findHighlightMarkers(doc) {
18
24
  }
19
25
  }
20
26
  });
21
- return markers;
27
+ return markers.filter((marker) => commentIds.includes(marker.id));
22
28
  }
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": "1.6.4",
4
+ "version": "1.6.5",
5
5
  "repository": "github:Atypon-OpenSource/manuscripts-body-editor",
6
6
  "license": "Apache-2.0",
7
7
  "main": "dist/cjs",
@@ -128,4 +128,4 @@
128
128
  "resolutions": {
129
129
  "@types/react": "^17.0.2"
130
130
  }
131
- }
131
+ }
package/styles/Editor.css CHANGED
@@ -962,3 +962,7 @@
962
962
  line-height: 1.43;
963
963
  padding-left: 65px;
964
964
  }
965
+ div[style*="background-color: rgba(249, 2, 2, 0.53)"] {
966
+ background-color: #ffe08b !important;
967
+ }
968
+