@docx-editor.dev/editor-api 2.37.0 → 2.38.0-canary.20261113032851.sha-e2cbc55
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/OFFICE_JS_GUIDE.md +17 -0
- package/dist/browser.d.mts +2 -2
- package/dist/browser.d.ts +2 -2
- package/dist/browser.js +1 -1
- package/dist/browser.mjs +1 -1
- package/dist/index.d.mts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +1 -1
- package/dist/index.mjs +1 -1
- package/dist/{server-C1OvVPMX.d.mts → server-zgZ01-wQ.d.mts} +92 -2
- package/dist/{server-C1OvVPMX.d.ts → server-zgZ01-wQ.d.ts} +92 -2
- package/docs/highlight-ranges.md +161 -0
- package/docs/tracked-replacement.md +64 -5
- package/package.json +2 -2
package/OFFICE_JS_GUIDE.md
CHANGED
|
@@ -720,3 +720,20 @@ Only `CompareTargetCurrent` is supported. `CompareTargetNew`, `CompareTargetSele
|
|
|
720
720
|
Without `authorName`, the revisions carry the revised document's last author, then its creator, then `Comparison`. To count the main-body result, load `document.revisions` with `'items'` after the compare's `context.sync()`.
|
|
721
721
|
|
|
722
722
|
A refused compare writes nothing. Handle `error.code` first. If `debugInfo.innerError` exists, its `code` names the cause: `edit.review-module-required`, `edit.resource-limit`, `edit.invalid-argument`, `edit.protected-content`, or `edit.unsupported-content`. Do not retry the same pair; report the cause instead.
|
|
723
|
+
|
|
724
|
+
## Replace the whole document
|
|
725
|
+
|
|
726
|
+
To install a document that a template engine or a server tool produced, call `document.body.insertFileFromBase64(base64File, 'Replace')`. The file replaces the whole document as one edit. A browser editor undoes it in one step, and a collaboration session, including a server agent's, shares it as an ordinary edit. Run the call alone in its sync.
|
|
727
|
+
|
|
728
|
+
```ts
|
|
729
|
+
await runtime.run(async (context) => {
|
|
730
|
+
const range = context.document.body.insertFileFromBase64(renderedBase64, 'Replace');
|
|
731
|
+
range.load('text');
|
|
732
|
+
await context.sync();
|
|
733
|
+
return range.text;
|
|
734
|
+
});
|
|
735
|
+
```
|
|
736
|
+
|
|
737
|
+
Only `Replace` on the main body is supported. `Start`, `End`, and other stories refuse with `NotSupported`; ranges, paragraphs, and content controls have no `insertFileFromBase64`. So does `TrackMineOnly`, because the replacement records no tracked changes; never turn tracking off to make it pass. A document that holds a locked or data-bound content control refuses with `NotImplemented` (`edit.protected-content`). Invalid base64 and unreadable packages refuse with `InvalidArgument`.
|
|
738
|
+
|
|
739
|
+
Proxies you held before the sync can name content that is gone. Re-read the document after the replacement instead of replaying earlier edits.
|
package/dist/browser.d.mts
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-
|
|
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
|
|
23
|
+
import { R as RevisionTextView, D as DocxEditorRuntime, C as CreateServerOptions, a as DocxEditorServerRuntime, b as CreateCollaborativeOptions } from './server-zgZ01-wQ.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 ShapeFill, aD as ShapeFillType, aE as ShapeType, aF as Style, aG as StyleCollection, aH as StyleType, aI as Table, aJ as TableCell, aK as TableCellCollection, aL as TableCollection, aM as TableRow, aN as TableRowCollection, aO as TrackedObjects, aP as UnderlineType, aQ as VerticalAlignment, aR as getReviewItemRange, aS as getReviewItemRangeOrNullObject, aT as getReviewItemRevisions, aU as isDocxEditorError } from './server-zgZ01-wQ.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-
|
|
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
|
|
23
|
+
import { R as RevisionTextView, D as DocxEditorRuntime, C as CreateServerOptions, a as DocxEditorServerRuntime, b as CreateCollaborativeOptions } from './server-zgZ01-wQ.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 ShapeFill, aD as ShapeFillType, aE as ShapeType, aF as Style, aG as StyleCollection, aH as StyleType, aI as Table, aJ as TableCell, aK as TableCellCollection, aL as TableCollection, aM as TableRow, aN as TableRowCollection, aO as TrackedObjects, aP as UnderlineType, aQ as VerticalAlignment, aR as getReviewItemRange, aS as getReviewItemRangeOrNullObject, aT as getReviewItemRevisions, aU as isDocxEditorError } from './server-zgZ01-wQ.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';
|