@beyondwork/docx-react-component 1.0.10 → 1.0.11
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.11",
|
|
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": [
|
package/src/api/public-types.ts
CHANGED
|
@@ -509,6 +509,7 @@ export interface WordReviewEditorRef {
|
|
|
509
509
|
getComments(): CommentSidebarSnapshot;
|
|
510
510
|
getTrackedChanges(): TrackedChangesSnapshot;
|
|
511
511
|
scrollToRevision(revisionId: string): void;
|
|
512
|
+
scrollToComment(commentId: string): void;
|
|
512
513
|
}
|
|
513
514
|
|
|
514
515
|
export interface WordReviewEditorProps {
|
|
@@ -124,6 +124,16 @@ export function __createWordReviewEditorRefBridge(
|
|
|
124
124
|
selection: toRuntimeSelectionSnapshot(createSelectionFromAnchor(revision.anchor)),
|
|
125
125
|
});
|
|
126
126
|
},
|
|
127
|
+
scrollToComment: (commentId: string) => {
|
|
128
|
+
const comment = runtime.getRenderSnapshot().comments.threads.find(
|
|
129
|
+
(t) => t.commentId === commentId,
|
|
130
|
+
);
|
|
131
|
+
if (!comment || comment.anchor.kind === "detached") return;
|
|
132
|
+
runtime.dispatch({
|
|
133
|
+
type: "selection.set",
|
|
134
|
+
selection: toRuntimeSelectionSnapshot(createSelectionFromAnchor(comment.anchor)),
|
|
135
|
+
});
|
|
136
|
+
},
|
|
127
137
|
};
|
|
128
138
|
}
|
|
129
139
|
|
|
@@ -520,6 +530,16 @@ export const WordReviewEditor = forwardRef<WordReviewEditorRef, WordReviewEditor
|
|
|
520
530
|
selection: toRuntimeSelectionSnapshot(createSelectionFromAnchor(revision.anchor)),
|
|
521
531
|
});
|
|
522
532
|
},
|
|
533
|
+
scrollToComment: (commentId: string) => {
|
|
534
|
+
const comment = activeRuntime.getRenderSnapshot().comments.threads.find(
|
|
535
|
+
(t) => t.commentId === commentId,
|
|
536
|
+
);
|
|
537
|
+
if (!comment || comment.anchor.kind === "detached") return;
|
|
538
|
+
activeRuntime.dispatch({
|
|
539
|
+
type: "selection.set",
|
|
540
|
+
selection: toRuntimeSelectionSnapshot(createSelectionFromAnchor(comment.anchor)),
|
|
541
|
+
});
|
|
542
|
+
},
|
|
523
543
|
}),
|
|
524
544
|
[activeRuntime, currentUser.userId, documentId, runtime],
|
|
525
545
|
);
|