@docx-editor.dev/editor-api 2.36.0 → 2.37.0-canary.20261111032756.sha-9eef508

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.
@@ -523,6 +523,25 @@ await runtime.run(async (context) => {
523
523
  });
524
524
  ```
525
525
 
526
+ ## Edit comment content
527
+
528
+ Set `Comment.content` or `CommentReply.content`, then call `context.sync()`. The runtime author must exactly match the stored author name. These names are host metadata, not authenticated identities. Load `content` before reading it, including after a write.
529
+
530
+ ```ts
531
+ await runtime.run(async (context) => {
532
+ const comment = context.document.comments.getFirst();
533
+ comment.load('content');
534
+ await context.sync();
535
+ const replacement = reviseComment(comment.content);
536
+ comment.content = replacement;
537
+ comment.load('content');
538
+ await context.sync();
539
+ console.log(comment.content);
540
+ });
541
+ ```
542
+
543
+ Batch independent comment and reply content edits in one sync. Keep other mutations in a separate sync. Main-body comments support plain-text replacement; empty text and unsupported body structures refuse. A replacement removes body formatting and preserves author, date, anchors, replies, and resolved state. Browser edits require the review module and an editable document. On `StaleDocument`, read the current content and reconsider the replacement. Never replay an old draft without checking it.
544
+
526
545
  ## Review changes in a range
527
546
 
528
547
  Use `range.revisions` to reach the tracked changes inside a search result, a comment range, or any other range. The collection lists the changes the range overlaps in its own story, including a nested change or another author's change beside it. A partly covered change is listed whole, and a replacement lists its deletion and insertion separately. Load the members and decide on each one:
@@ -20,8 +20,8 @@
20
20
  * @packageDocumentation
21
21
  * @public
22
22
  */
23
- import { R as RevisionTextView, D as DocxEditorRuntime, C as CreateServerOptions, a as DocxEditorServerRuntime, b as CreateCollaborativeOptions } from './server-DO3Pw05F.mjs';
24
- export { A as Alignment, B as BesideLocation, c as Body, d as BodyInsertParagraphLocation, e as BodyInsertTextLocation, f as Bookmark, g as BookmarkCollection, h as BreakType, i as ChangeTrackingMode, j as ChangeTrackingVersion, k as ClientObject, l as ClientResult, m as Comment, n as CommentCollection, o as CommentReply, p as CommentReplyCollection, q as CommitPreviewOptions, r as CompareTarget, s as ContentControl, t as ContentControlCollection, u as ContentControlLockState, v as ContentControlSubtype, w as ContentControlType, x as ContentControlValue, y as Document, z as DocumentCapabilities, E as DocumentCompareOptions, F as DocumentLimits, G as DocumentPreview, H as DocumentPreviewStatus, I as DocumentProperties, J as DocumentXmlLimits, K as DocumentZipLimits, L as DocxEditorDebugInfo, M as DocxEditorError, N as DocxEditorErrorCode, O as DocxEditorErrorInit, P as DocxEditorInnerError, Q as EditorModule, S as Field, T as FieldCollection, U as FieldType, V as FieldTypeLiteral, W as Font, X as HeaderFooterType, Y as InlinePicture, Z as InlinePictureCollection, _ as InsertLocation, $ as List, a0 as ListBullet, a1 as ListCollection, a2 as ListItem, a3 as ListNumbering, a4 as LoadOption, a5 as LoadQueryOptions, a6 as NoteItem, a7 as NoteItemCollection, a8 as NoteItemType, a9 as PageOrientation, aa as PageSetup, ab as Paragraph, ac as ParagraphAlignment, ad as ParagraphCollection, ae as ParagraphInsertTextLocation, af as ParagraphReadingOrder, ag as PreviewCallback, ah as Range, ai as RangeCollection, aj as RangeInsertTextLocation, ak as RangeLocation, al as RemoveDocInfoType, am as RequestContext, an as Revision, ao as RevisionAuthorOptions, ap as RevisionAuthorSelection, aq as RevisionCollection, ar as RevisionType, as as RunCallback, at as RunOptions, au as RuntimeDiagnostic, av as SearchOptions, aw as Section, ax as SectionCollection, ay as SelectionMode, az as ServerPaginationOptions, aA as Shape, aB as ShapeCollection, aC as ShapeType, aD as Style, aE as StyleCollection, aF as StyleType, aG as Table, aH as TableCell, aI as TableCellCollection, aJ as TableCollection, aK as TableRow, aL as TableRowCollection, aM as TrackedObjects, aN as UnderlineType, aO as VerticalAlignment, aP as getReviewItemRange, aQ as getReviewItemRangeOrNullObject, aR as getReviewItemRevisions, aS as isDocxEditorError } from './server-DO3Pw05F.mjs';
23
+ import { R as RevisionTextView, D as DocxEditorRuntime, C as CreateServerOptions, a as DocxEditorServerRuntime, b as CreateCollaborativeOptions } from './server-C1OvVPMX.mjs';
24
+ export { A as Alignment, B as BesideLocation, c as Body, d as BodyInsertParagraphLocation, e as BodyInsertTextLocation, f as Bookmark, g as BookmarkCollection, h as BreakType, i as ChangeTrackingMode, j as ChangeTrackingVersion, k as ClientObject, l as ClientResult, m as Comment, n as CommentCollection, o as CommentReply, p as CommentReplyCollection, q as CommitPreviewOptions, r as CompareTarget, s as ContentControl, t as ContentControlCollection, u as ContentControlLockState, v as ContentControlSubtype, w as ContentControlType, x as ContentControlValue, y as Document, z as DocumentCapabilities, E as DocumentCompareOptions, F as DocumentLimits, G as DocumentPreview, H as DocumentPreviewStatus, I as DocumentProperties, J as DocumentXmlLimits, K as DocumentZipLimits, L as DocxEditorDebugInfo, M as DocxEditorError, N as DocxEditorErrorCode, O as DocxEditorErrorInit, P as DocxEditorInnerError, Q as EditorModule, S as Field, T as FieldCollection, U as FieldType, V as FieldTypeLiteral, W as Font, X as HeaderFooterType, Y as InlinePicture, Z as InlinePictureCollection, _ as InsertLocation, $ as List, a0 as ListBullet, a1 as ListCollection, a2 as ListItem, a3 as ListNumbering, a4 as LoadOption, a5 as LoadQueryOptions, a6 as NoteItem, a7 as NoteItemCollection, a8 as NoteItemType, a9 as PageOrientation, aa as PageSetup, ab as Paragraph, ac as ParagraphAlignment, ad as ParagraphCollection, ae as ParagraphInsertTextLocation, af as ParagraphReadingOrder, ag as PreviewCallback, ah as Range, ai as RangeCollection, aj as RangeInsertTextLocation, ak as RangeLocation, al as RemoveDocInfoType, am as RequestContext, an as Revision, ao as RevisionAuthorOptions, ap as RevisionAuthorSelection, aq as RevisionCollection, ar as RevisionType, as as RunCallback, at as RunOptions, au as RuntimeDiagnostic, av as SearchOptions, aw as Section, ax as SectionCollection, ay as SelectionMode, az as ServerPaginationOptions, aA as Shape, aB as ShapeCollection, aC as ShapeType, aD as Style, aE as StyleCollection, aF as StyleType, aG as Table, aH as TableCell, aI as TableCellCollection, aJ as TableCollection, aK as TableRow, aL as TableRowCollection, aM as TrackedObjects, aN as UnderlineType, aO as VerticalAlignment, aP as getReviewItemRange, aQ as getReviewItemRangeOrNullObject, aR as getReviewItemRevisions, aS as isDocxEditorError } from './server-C1OvVPMX.mjs';
25
25
  import { EditorCollaborationSession } from '@docx-editor.dev/core/collaboration';
26
26
  export { HistoryGroup, HistoryGroupOutcome, RevisionAuthorEntry, RevisionAuthorResult, RevisionAuthorSkipReason, RevisionBatchEntry, RevisionBatchResult, RevisionBatchSkipReason } from '@docx-editor.dev/core/automation';
27
27
  import { DocxEditorInstance } from '@docx-editor.dev/core/editor';
package/dist/browser.d.ts CHANGED
@@ -20,8 +20,8 @@
20
20
  * @packageDocumentation
21
21
  * @public
22
22
  */
23
- import { R as RevisionTextView, D as DocxEditorRuntime, C as CreateServerOptions, a as DocxEditorServerRuntime, b as CreateCollaborativeOptions } from './server-DO3Pw05F.js';
24
- export { A as Alignment, B as BesideLocation, c as Body, d as BodyInsertParagraphLocation, e as BodyInsertTextLocation, f as Bookmark, g as BookmarkCollection, h as BreakType, i as ChangeTrackingMode, j as ChangeTrackingVersion, k as ClientObject, l as ClientResult, m as Comment, n as CommentCollection, o as CommentReply, p as CommentReplyCollection, q as CommitPreviewOptions, r as CompareTarget, s as ContentControl, t as ContentControlCollection, u as ContentControlLockState, v as ContentControlSubtype, w as ContentControlType, x as ContentControlValue, y as Document, z as DocumentCapabilities, E as DocumentCompareOptions, F as DocumentLimits, G as DocumentPreview, H as DocumentPreviewStatus, I as DocumentProperties, J as DocumentXmlLimits, K as DocumentZipLimits, L as DocxEditorDebugInfo, M as DocxEditorError, N as DocxEditorErrorCode, O as DocxEditorErrorInit, P as DocxEditorInnerError, Q as EditorModule, S as Field, T as FieldCollection, U as FieldType, V as FieldTypeLiteral, W as Font, X as HeaderFooterType, Y as InlinePicture, Z as InlinePictureCollection, _ as InsertLocation, $ as List, a0 as ListBullet, a1 as ListCollection, a2 as ListItem, a3 as ListNumbering, a4 as LoadOption, a5 as LoadQueryOptions, a6 as NoteItem, a7 as NoteItemCollection, a8 as NoteItemType, a9 as PageOrientation, aa as PageSetup, ab as Paragraph, ac as ParagraphAlignment, ad as ParagraphCollection, ae as ParagraphInsertTextLocation, af as ParagraphReadingOrder, ag as PreviewCallback, ah as Range, ai as RangeCollection, aj as RangeInsertTextLocation, ak as RangeLocation, al as RemoveDocInfoType, am as RequestContext, an as Revision, ao as RevisionAuthorOptions, ap as RevisionAuthorSelection, aq as RevisionCollection, ar as RevisionType, as as RunCallback, at as RunOptions, au as RuntimeDiagnostic, av as SearchOptions, aw as Section, ax as SectionCollection, ay as SelectionMode, az as ServerPaginationOptions, aA as Shape, aB as ShapeCollection, aC as ShapeType, aD as Style, aE as StyleCollection, aF as StyleType, aG as Table, aH as TableCell, aI as TableCellCollection, aJ as TableCollection, aK as TableRow, aL as TableRowCollection, aM as TrackedObjects, aN as UnderlineType, aO as VerticalAlignment, aP as getReviewItemRange, aQ as getReviewItemRangeOrNullObject, aR as getReviewItemRevisions, aS as isDocxEditorError } from './server-DO3Pw05F.js';
23
+ import { R as RevisionTextView, D as DocxEditorRuntime, C as CreateServerOptions, a as DocxEditorServerRuntime, b as CreateCollaborativeOptions } from './server-C1OvVPMX.js';
24
+ export { A as Alignment, B as BesideLocation, c as Body, d as BodyInsertParagraphLocation, e as BodyInsertTextLocation, f as Bookmark, g as BookmarkCollection, h as BreakType, i as ChangeTrackingMode, j as ChangeTrackingVersion, k as ClientObject, l as ClientResult, m as Comment, n as CommentCollection, o as CommentReply, p as CommentReplyCollection, q as CommitPreviewOptions, r as CompareTarget, s as ContentControl, t as ContentControlCollection, u as ContentControlLockState, v as ContentControlSubtype, w as ContentControlType, x as ContentControlValue, y as Document, z as DocumentCapabilities, E as DocumentCompareOptions, F as DocumentLimits, G as DocumentPreview, H as DocumentPreviewStatus, I as DocumentProperties, J as DocumentXmlLimits, K as DocumentZipLimits, L as DocxEditorDebugInfo, M as DocxEditorError, N as DocxEditorErrorCode, O as DocxEditorErrorInit, P as DocxEditorInnerError, Q as EditorModule, S as Field, T as FieldCollection, U as FieldType, V as FieldTypeLiteral, W as Font, X as HeaderFooterType, Y as InlinePicture, Z as InlinePictureCollection, _ as InsertLocation, $ as List, a0 as ListBullet, a1 as ListCollection, a2 as ListItem, a3 as ListNumbering, a4 as LoadOption, a5 as LoadQueryOptions, a6 as NoteItem, a7 as NoteItemCollection, a8 as NoteItemType, a9 as PageOrientation, aa as PageSetup, ab as Paragraph, ac as ParagraphAlignment, ad as ParagraphCollection, ae as ParagraphInsertTextLocation, af as ParagraphReadingOrder, ag as PreviewCallback, ah as Range, ai as RangeCollection, aj as RangeInsertTextLocation, ak as RangeLocation, al as RemoveDocInfoType, am as RequestContext, an as Revision, ao as RevisionAuthorOptions, ap as RevisionAuthorSelection, aq as RevisionCollection, ar as RevisionType, as as RunCallback, at as RunOptions, au as RuntimeDiagnostic, av as SearchOptions, aw as Section, ax as SectionCollection, ay as SelectionMode, az as ServerPaginationOptions, aA as Shape, aB as ShapeCollection, aC as ShapeType, aD as Style, aE as StyleCollection, aF as StyleType, aG as Table, aH as TableCell, aI as TableCellCollection, aJ as TableCollection, aK as TableRow, aL as TableRowCollection, aM as TrackedObjects, aN as UnderlineType, aO as VerticalAlignment, aP as getReviewItemRange, aQ as getReviewItemRangeOrNullObject, aR as getReviewItemRevisions, aS as isDocxEditorError } from './server-C1OvVPMX.js';
25
25
  import { EditorCollaborationSession } from '@docx-editor.dev/core/collaboration';
26
26
  export { HistoryGroup, HistoryGroupOutcome, RevisionAuthorEntry, RevisionAuthorResult, RevisionAuthorSkipReason, RevisionBatchEntry, RevisionBatchResult, RevisionBatchSkipReason } from '@docx-editor.dev/core/automation';
27
27
  import { DocxEditorInstance } from '@docx-editor.dev/core/editor';