@eigenpal/docx-editor-react 1.4.0 → 1.5.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/index.d.ts CHANGED
@@ -108,6 +108,28 @@ interface PagedEditorRef {
108
108
  * No-op if the layout isn't ready yet or pageNumber is out of range.
109
109
  */
110
110
  scrollToPage(pageNumber: number): void;
111
+ /**
112
+ * Scroll to the comment identified by `commentId` and select its range so
113
+ * the selection overlay highlights it. Resolves the id → PM range via the
114
+ * live comment marks; returns `false` (not a throw, not a silent no-op)
115
+ * when the id no longer resolves so the caller can surface a "location no
116
+ * longer exists" affordance.
117
+ */
118
+ scrollToCommentId(commentId: number): boolean;
119
+ /**
120
+ * Scroll to the tracked change identified by `revisionId` and select its
121
+ * range so the selection overlay highlights it. Resolves the id → PM range
122
+ * via the live tracked-change marks; returns `false` when the id no longer
123
+ * resolves (the change was accepted/rejected/deleted).
124
+ */
125
+ scrollToChangeId(revisionId: number): boolean;
126
+ /**
127
+ * Select the PM position range `[from, to]` so the selection overlay
128
+ * highlights it, and scroll its start into view. No-op for a malformed
129
+ * range or a `from` past the document end; `to` is clamped to the document
130
+ * size (raw caller positions, so out-of-range must not throw).
131
+ */
132
+ highlightRange(from: number, to: number): void;
111
133
  /**
112
134
  * Look up the persistent hidden HF PM EditorView for a given HeaderFooter
113
135
  * instance. Returns null when none is mounted (no document, or `hf` is not
@@ -360,6 +382,36 @@ interface DocxEditorRef {
360
382
  * @example ref.current?.scrollToPosition(42)
361
383
  */
362
384
  scrollToPosition: (pmPos: number) => void;
385
+ /**
386
+ * Scroll the paginated view to the comment with the given id and select its
387
+ * anchored range so the selection overlay highlights it. Resolves the id
388
+ * against the live comment marks at call time.
389
+ * @returns `false` when the id no longer resolves (the comment was deleted
390
+ * or its anchored text removed between render and click), so the caller
391
+ * can surface a "location no longer exists" affordance rather than
392
+ * silently no-op'ing.
393
+ * @example ref.current?.scrollToCommentId(3)
394
+ */
395
+ scrollToCommentId: (commentId: number) => boolean;
396
+ /**
397
+ * Scroll the paginated view to the tracked change with the given Word
398
+ * revision `w:id` and select its range so the selection overlay highlights
399
+ * it. Resolves the id against the live tracked-change marks at call time
400
+ * (matching coalesced revisions the way the changes sidebar does).
401
+ * @returns `false` when the id no longer resolves (the change was
402
+ * accepted, rejected, or deleted between render and click).
403
+ * @example ref.current?.scrollToChangeId(42)
404
+ */
405
+ scrollToChangeId: (revisionId: number) => boolean;
406
+ /**
407
+ * Select the ProseMirror position range `[from, to]` so the selection
408
+ * overlay highlights it, and scroll its start into view. The selection
409
+ * persists until it next changes (there is no auto-clearing flash). No-op
410
+ * for a malformed range or a `from` past the document end; `to` is clamped
411
+ * to the document size.
412
+ * @example ref.current?.highlightRange(10, 24)
413
+ */
414
+ highlightRange: (from: number, to: number) => void;
363
415
  /** Open print preview */
364
416
  openPrintPreview: () => void;
365
417
  /** Print the document directly */