@beyondwork/docx-react-component 1.0.26-rc → 1.0.26-rc2
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/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@beyondwork/docx-react-component",
|
|
3
3
|
"publisher": "beyondwork",
|
|
4
|
-
"version": "1.0.
|
|
4
|
+
"version": "1.0.26rc2",
|
|
5
5
|
"description": "Embeddable React Word (docx) editor with review, comments, tracked changes, and round-trip OOXML fidelity.",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"sideEffects": [
|
|
@@ -4,7 +4,6 @@ import {
|
|
|
4
4
|
getAnchorRange,
|
|
5
5
|
mapReviewAnchor,
|
|
6
6
|
mappingTouchesAnchorContent,
|
|
7
|
-
rangeStaysWithinSingleParagraph,
|
|
8
7
|
type ReviewAnchor,
|
|
9
8
|
} from "../../core/selection/review-anchors.ts";
|
|
10
9
|
import type { TransactionMapping } from "../../core/selection/mapping.ts";
|
|
@@ -28,7 +27,7 @@ export function remapCommentThreads(
|
|
|
28
27
|
const comments = Object.fromEntries(
|
|
29
28
|
Object.entries(options.comments).map(([commentId, comment]) => [
|
|
30
29
|
commentId,
|
|
31
|
-
remapCommentThread(comment, options.mapping
|
|
30
|
+
remapCommentThread(comment, options.mapping),
|
|
32
31
|
]),
|
|
33
32
|
);
|
|
34
33
|
const detachedCommentIds = Object.values(comments)
|
|
@@ -45,14 +44,13 @@ export function remapCommentThreads(
|
|
|
45
44
|
export function remapCommentThread(
|
|
46
45
|
comment: CommentThreadRecord,
|
|
47
46
|
mapping: TransactionMapping,
|
|
48
|
-
nextContent: unknown,
|
|
49
47
|
): CommentThreadRecord {
|
|
50
48
|
if (comment.anchor.kind === "detached") {
|
|
51
49
|
return comment;
|
|
52
50
|
}
|
|
53
51
|
|
|
54
52
|
const mappedAnchor = mapReviewAnchor(comment.anchor, mapping);
|
|
55
|
-
const anchor = normalizeCommentAnchor(comment.anchor, mappedAnchor, mapping
|
|
53
|
+
const anchor = normalizeCommentAnchor(comment.anchor, mappedAnchor, mapping);
|
|
56
54
|
|
|
57
55
|
return {
|
|
58
56
|
...comment,
|
|
@@ -64,7 +62,6 @@ function normalizeCommentAnchor(
|
|
|
64
62
|
previousAnchor: ReviewAnchor,
|
|
65
63
|
mappedAnchor: ReviewAnchor,
|
|
66
64
|
mapping: TransactionMapping,
|
|
67
|
-
nextContent: unknown,
|
|
68
65
|
): ReviewAnchor {
|
|
69
66
|
if (mappedAnchor.kind === "detached") {
|
|
70
67
|
return mappedAnchor;
|
|
@@ -83,13 +80,6 @@ function normalizeCommentAnchor(
|
|
|
83
80
|
return detachReviewAnchor(previousRange, detachReason(mapping));
|
|
84
81
|
}
|
|
85
82
|
|
|
86
|
-
if (
|
|
87
|
-
mappedAnchor.kind === "range" &&
|
|
88
|
-
!rangeStaysWithinSingleParagraph(nextContent, mappedAnchor.range)
|
|
89
|
-
) {
|
|
90
|
-
return detachReviewAnchor(previousRange, "invalidatedByStructureChange");
|
|
91
|
-
}
|
|
92
|
-
|
|
93
83
|
return mappedAnchor;
|
|
94
84
|
}
|
|
95
85
|
|