@docx-editor.dev/core 2.29.0 → 2.31.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/automation.cjs +1 -1
- package/dist/automation.d.ts +22 -26
- package/dist/automation.js +1 -1
- package/dist/binding.cjs +1 -1
- package/dist/binding.d.ts +47 -40
- package/dist/binding.js +1 -1
- package/dist/bookmark-names-DDuAra_V.d.ts +37 -0
- package/dist/{chrome-print-CAs51cpq.d.ts → chrome-print-BWvaVEhD.d.ts} +577 -243
- package/dist/chunk-243W4WW2.cjs +2 -0
- package/dist/{chunk-G4HOFIKJ.js → chunk-2E2RPEKX.js} +1 -1
- package/dist/chunk-4S24UOPG.js +30 -0
- package/dist/chunk-5JPIEN54.cjs +3 -0
- package/dist/{chunk-7WQ7AAHW.cjs → chunk-5SO5QDMV.cjs} +1 -1
- package/dist/{chunk-UHHYFIDT.cjs → chunk-6IDOVU6L.cjs} +1 -1
- package/dist/chunk-DBOOTED4.cjs +30 -0
- package/dist/chunk-EOTAXOJY.cjs +5 -0
- package/dist/chunk-FDAKJ2SJ.cjs +30 -0
- package/dist/chunk-FNNOJNGY.js +3 -0
- package/dist/chunk-FT33HRZP.js +5 -0
- package/dist/{chunk-W35WTWAO.cjs → chunk-HC6YNKUI.cjs} +1 -1
- package/dist/chunk-HZ66UCIS.js +2 -0
- package/dist/{chunk-MM5QBMTE.cjs → chunk-IBRBNT37.cjs} +1 -1
- package/dist/chunk-IVIN7X43.js +30 -0
- package/dist/chunk-LZY6B6IV.js +4 -0
- package/dist/chunk-MOYYRVFV.cjs +2 -0
- package/dist/{chunk-OMCG63ZF.js → chunk-N6B3BXCL.js} +1 -1
- package/dist/chunk-Q5K2GGNG.js +2 -0
- package/dist/chunk-R2XINWVE.js +7 -0
- package/dist/chunk-SUEXVBPR.js +1 -0
- package/dist/chunk-T2QQHG5C.js +18 -0
- package/dist/{chunk-LSZ6KPKK.js → chunk-VWIJKH4A.js} +1 -1
- package/dist/chunk-WO4V6PNS.cjs +18 -0
- package/dist/chunk-XMJKFURD.cjs +4 -0
- package/dist/{chunk-BY2ACZZ6.cjs → chunk-XSTGE3NI.cjs} +1 -1
- package/dist/chunk-YQWMI6J5.cjs +7 -0
- package/dist/{chunk-RCLZXP3B.js → chunk-ZCJS7D7S.js} +1 -1
- package/dist/collaboration/replication.cjs +1 -1
- package/dist/collaboration/replication.d.ts +4 -5
- package/dist/collaboration/replication.js +1 -1
- package/dist/collaboration.d.ts +3 -4
- package/dist/contracts/document.d.ts +3 -3
- package/dist/contracts/editor.d.ts +8 -9
- package/dist/contracts/interaction.d.ts +2 -2
- package/dist/contracts/modules.d.ts +12 -13
- package/dist/contracts/types.d.ts +2 -2
- package/dist/{custom-node-writes-Bn6uciLb.d.ts → custom-node-writes-TeUvMP13.d.ts} +2 -2
- package/dist/{diagnostic-context-B8M79cfK.d.ts → diagnostic-context-DJ0P1uZE.d.ts} +3 -2
- package/dist/{diagnostic-hints-BeVjfNOv.d.ts → diagnostic-hints-C9JlLz1L.d.ts} +12 -5
- package/dist/{document-protection-CUb55pl_.d.ts → document-protection-C8x3P2J6.d.ts} +1 -1
- package/dist/{editor-CZQZmTIU.d.ts → editor-B2ShlO23.d.ts} +368 -52
- package/dist/{editor-scope-7o9xweiJ.d.ts → editor-scope-C7ke1KJG.d.ts} +57 -4
- package/dist/editor.cjs +1 -1
- package/dist/editor.css +5 -3
- package/dist/editor.d.ts +606 -34
- package/dist/editor.js +1 -1
- package/dist/export.cjs +2 -2
- package/dist/export.d.ts +17 -15
- package/dist/export.js +2 -2
- package/dist/{font-resolver-lSBLirLR.d.ts → font-resolver-CWh40DYp.d.ts} +1 -1
- package/dist/font-shaping-policy-BvpkrfxM.d.ts +7 -0
- package/dist/{headless-document-view-pp3q7wIh.d.ts → headless-document-view-qOpaCF82.d.ts} +2 -2
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +24 -24
- package/dist/index.js +1 -1
- package/dist/{layout-shaping-BD-dF_rn.d.ts → layout-shaping-CWS3j0Xr.d.ts} +3 -2
- package/dist/layout.cjs +1 -1
- package/dist/layout.d.ts +112 -44
- package/dist/layout.js +1 -1
- package/dist/{note-properties-qQUjO1GQ.d.ts → note-properties-QsKh24sM.d.ts} +1 -1
- package/dist/{omml-equation-BUbU0utM.d.ts → omml-equation-BsLAa2lX.d.ts} +38 -8
- package/dist/output.cjs +1 -1
- package/dist/output.d.ts +20 -10
- package/dist/output.js +1 -1
- package/dist/{protocol-DYzzz2ej.d.ts → protocol-COZJUKUY.d.ts} +94 -2
- package/dist/{review-paragraph-order-CN_0l2Cb.d.ts → review-paragraph-order-C_QbCKcH.d.ts} +1 -1
- package/dist/{semantic-cell-selection-eYag3P47.d.ts → semantic-cell-selection-Cub9FDa8.d.ts} +2 -2
- package/dist/{semantic-interaction-kR_QB845.d.ts → semantic-interaction-dApRIYpt.d.ts} +1 -1
- package/dist/{semantic-paint-ZayFF3tD.d.ts → semantic-paint-DLzA8sjP.d.ts} +3 -3
- package/dist/{semantic-record-queries-Bsgth6lv.d.ts → semantic-record-queries-3yp9o11g.d.ts} +1 -1
- package/dist/{semantic-records-DQmumPgL.d.ts → semantic-records-B-akgRch.d.ts} +207 -139
- package/dist/store.cjs +1 -1
- package/dist/store.d.ts +49 -136
- package/dist/store.js +1 -1
- package/dist/{tree-package-store-CovjNARF.d.ts → tree-package-store-B8l8DX3Z.d.ts} +612 -428
- package/dist/{tree-session-contract-CZVAGl51.d.ts → tree-session-contract-DeLRqohz.d.ts} +28 -13
- package/dist/{types-barrel-DuC5QBNC.d.ts → types-barrel-CkF2JbU4.d.ts} +1146 -745
- package/package.json +2 -2
- package/dist/chunk-236O4YQW.js +0 -2
- package/dist/chunk-6JPL6ZAS.cjs +0 -5
- package/dist/chunk-6ZQP4HQ7.js +0 -3
- package/dist/chunk-BCXH4BXB.js +0 -5
- package/dist/chunk-CAJEXXVG.cjs +0 -4
- package/dist/chunk-CPWLFPWC.js +0 -30
- package/dist/chunk-D7ZMDMPX.cjs +0 -3
- package/dist/chunk-DOHF6FA7.cjs +0 -30
- package/dist/chunk-DVX32P2P.js +0 -27
- package/dist/chunk-E4LOMDNL.js +0 -1
- package/dist/chunk-EKLM7NWB.cjs +0 -7
- package/dist/chunk-G3K63G7P.cjs +0 -27
- package/dist/chunk-JLVBDYVQ.cjs +0 -2
- package/dist/chunk-LQX36Z5P.js +0 -7
- package/dist/chunk-OSFOJTHU.cjs +0 -18
- package/dist/chunk-T6K2QYNZ.cjs +0 -2
- package/dist/chunk-TRGAVV2Y.js +0 -4
- package/dist/chunk-U4JZVSOE.js +0 -2
- package/dist/chunk-YQ5G6LC7.js +0 -18
- package/dist/image-resources-tXLQShoC.d.ts +0 -211
|
@@ -1,13 +1,12 @@
|
|
|
1
|
-
import { q as ResolvedRevisionMarkup, a as ReviewDisplayMode } from './semantic-records-
|
|
2
|
-
import { t as DocAnchor, g as ReviewRevisionKind, c as ReviewCommentItem, b as ReviewRevisionItem, d as ReviewCustomItem,
|
|
3
|
-
import { H as HistoryDiagnostic, V as ViewScope, b as HistoryGroup, a as EditorExecOptions, E as EditorScope } from './editor-scope-
|
|
1
|
+
import { q as ResolvedRevisionMarkup, a as ReviewDisplayMode } from './semantic-records-B-akgRch.js';
|
|
2
|
+
import { t as DocAnchor, g as ReviewRevisionKind, c as ReviewCommentItem, b as ReviewRevisionItem, d as ReviewCustomItem, aT as SourceCrop, Y as DrawingKind, a2 as ImageWrapTarget, _ as DrawingPositionInput, Z as DrawingLocks, a1 as ImageResourceState, r as ColorValue, x as ExecErrorCode, a6 as ParagraphFormatCommand, af as SupportedImageMime, al as Watermark, E as ExecResult, an as WatermarkState, n as ContentControlFilter, o as DocRange, k as RunFormatting, p as Revision, a9 as Rect, ae as SelectionPin, ai as Unsubscribe } from './types-barrel-CkF2JbU4.js';
|
|
3
|
+
import { H as HistoryDiagnostic, V as ViewScope, b as HistoryGroup, a as EditorExecOptions, E as EditorScope, c as HistoryGroupOptions } from './editor-scope-C7ke1KJG.js';
|
|
4
|
+
import { C as CollaborationDiagnosticCode, c as CustomNodeDiagnosticCode, D as DiagnosticErrorName, F as FailureStage, B as ByteSizeBucket, b as CountBucket, f as DocumentOpenDiagnosticCode, a as DocumentPartKind, g as DocumentSaveDiagnosticCode, E as EditDiagnosticCode, j as ReviewDiagnosticCode, k as ReviewOperation, R as ReviewChangeKind, i as FormattingChangeKind, h as FontDiagnosticCode, H as HistoryDiagnosticCode, P as PerformanceDiagnosticCode } from './diagnostic-hints-C9JlLz1L.js';
|
|
4
5
|
import { DocEdits, DocQueries, DocQueryResults, ContentControlSummary } from './contracts/document.js';
|
|
5
6
|
import { InteractionOutcome } from './contracts/interaction.js';
|
|
6
|
-
import { a as SemanticSelection, S as SemanticPosition } from './semantic-interaction-
|
|
7
|
-
import {
|
|
8
|
-
import { a as DocumentProtectionState } from './document-protection-CUb55pl_.js';
|
|
7
|
+
import { a as SemanticSelection, S as SemanticPosition } from './semantic-interaction-dApRIYpt.js';
|
|
8
|
+
import { a as DocumentProtectionState } from './document-protection-C8x3P2J6.js';
|
|
9
9
|
import { C as CollaborationStatus } from './failure-NS2lsya4.js';
|
|
10
|
-
import { C as CollaborationDiagnosticCode, c as CustomNodeDiagnosticCode, D as DiagnosticErrorName, F as FailureStage, B as ByteSizeBucket, b as CountBucket, f as DocumentOpenDiagnosticCode, a as DocumentPartKind, E as EditDiagnosticCode, i as ReviewDiagnosticCode, j as ReviewOperation, R as ReviewChangeKind, h as FormattingChangeKind, g as FontDiagnosticCode, H as HistoryDiagnosticCode, P as PerformanceDiagnosticCode } from './diagnostic-hints-BeVjfNOv.js';
|
|
11
10
|
|
|
12
11
|
/**
|
|
13
12
|
* When the review pane opens by itself.
|
|
@@ -50,7 +49,8 @@ type ReviewPaneOverflow = 'float' | 'shrinkPage' | 'scroll';
|
|
|
50
49
|
* - `'balloons'`: the pane lists comments only, except comments that reply to a tracked
|
|
51
50
|
* change: the change's balloon shows those. A tracked change opens in a balloon at its
|
|
52
51
|
* text when the reader clicks it, or when Next Change, Previous Change, or
|
|
53
|
-
* `setActiveReviewItem(key, { announce: true })` reaches it.
|
|
52
|
+
* `setActiveReviewItem(key, { announce: true })` reaches it. A replacement is one balloon.
|
|
53
|
+
* In both settings, Next Change and Previous Change stop on a replacement once.
|
|
54
54
|
*
|
|
55
55
|
* @public
|
|
56
56
|
*/
|
|
@@ -246,6 +246,76 @@ type DocumentOpenDiagnostic = DiagnosticBase & {
|
|
|
246
246
|
/** The role of the part that failed, such as `'header'`. Never its name. */
|
|
247
247
|
readonly part?: DocumentPartKind;
|
|
248
248
|
}));
|
|
249
|
+
/**
|
|
250
|
+
* A `save()` call returned the document, or failed. Reported for each call, by the editor that
|
|
251
|
+
* saved. A save the host does afterwards, such as an upload, is the host's to measure.
|
|
252
|
+
*
|
|
253
|
+
* @public
|
|
254
|
+
*/
|
|
255
|
+
type DocumentSaveDiagnostic = DiagnosticBase & {
|
|
256
|
+
readonly kind: 'document.save';
|
|
257
|
+
} & ({
|
|
258
|
+
readonly outcome: 'saved';
|
|
259
|
+
/** Size of the saved bytes. */
|
|
260
|
+
readonly sizeBucket: ByteSizeBucket;
|
|
261
|
+
/** Milliseconds from the `save()` call to the bytes, pending edits included. */
|
|
262
|
+
readonly durationMs: number;
|
|
263
|
+
} | (DiagnosticFailureDetail & {
|
|
264
|
+
readonly outcome: 'rejected';
|
|
265
|
+
readonly code: DocumentSaveDiagnosticCode;
|
|
266
|
+
/** Milliseconds from the `save()` call to the failure. */
|
|
267
|
+
readonly durationMs: number;
|
|
268
|
+
}));
|
|
269
|
+
/**
|
|
270
|
+
* What an editor did over a window of use or over its whole session. Counts and milliseconds
|
|
271
|
+
* only: no key, position, command argument or text.
|
|
272
|
+
*
|
|
273
|
+
* @public
|
|
274
|
+
*/
|
|
275
|
+
interface SessionActivity {
|
|
276
|
+
/**
|
|
277
|
+
* For `active`, milliseconds from the window's first activity to the summary. For `end`,
|
|
278
|
+
* milliseconds from the editor's creation to its end, idle time included.
|
|
279
|
+
*/
|
|
280
|
+
readonly durationMs: number;
|
|
281
|
+
/**
|
|
282
|
+
* Milliseconds of use: the time between key presses, pointer presses and edits that are at
|
|
283
|
+
* most 30 seconds apart. A longer pause counts as idle.
|
|
284
|
+
*/
|
|
285
|
+
readonly activeMs: number;
|
|
286
|
+
/**
|
|
287
|
+
* Edits from typing, the clipboard, drag and drop, keyboard undo, and other input that changed
|
|
288
|
+
* the document. Each committed change counts once: typing commits about one change per
|
|
289
|
+
* character, and characters typed faster than the editor paints commit together.
|
|
290
|
+
*/
|
|
291
|
+
readonly inputEdits: number;
|
|
292
|
+
/** Editor commands, from `exec(...)` or the toolbar, that changed the document. */
|
|
293
|
+
readonly commandEdits: number;
|
|
294
|
+
/** Editing API batches that changed the document. */
|
|
295
|
+
readonly automationEdits: number;
|
|
296
|
+
}
|
|
297
|
+
/**
|
|
298
|
+
* The lifecycle and activity of one editor instance, without any content.
|
|
299
|
+
*
|
|
300
|
+
* - `start`: the editor was created.
|
|
301
|
+
* - `active`: a summary of one window of use. Sent after a minute of activity, when the page is
|
|
302
|
+
* hidden, and before `end`, if anything happened since the last summary. An idle editor sends
|
|
303
|
+
* none, so `active` is not a heartbeat.
|
|
304
|
+
* - `end`: the editor was destroyed, or the page closed. Carries totals for the whole session.
|
|
305
|
+
*
|
|
306
|
+
* Edits count changes this editor committed. Refused edits are in `edit.rejected`, and edits
|
|
307
|
+
* that collaborators made are not counted. Sum `active` summaries or read `end` totals, not
|
|
308
|
+
* both: the totals include every summary.
|
|
309
|
+
*
|
|
310
|
+
* @public
|
|
311
|
+
*/
|
|
312
|
+
type SessionDiagnostic = DiagnosticBase & {
|
|
313
|
+
readonly kind: 'session';
|
|
314
|
+
} & ({
|
|
315
|
+
readonly phase: 'start';
|
|
316
|
+
} | (SessionActivity & {
|
|
317
|
+
readonly phase: 'active' | 'end';
|
|
318
|
+
}));
|
|
249
319
|
/** Where a refused edit came from. @public */
|
|
250
320
|
type EditRejectionOrigin = 'command' | 'input' | 'automation';
|
|
251
321
|
/** An edit, a command or a tracked change was refused. @public */
|
|
@@ -364,7 +434,11 @@ interface PerformanceDiagnostic extends DiagnosticBase {
|
|
|
364
434
|
* presses were timed and more than one in 20 took over 200 ms.
|
|
365
435
|
*/
|
|
366
436
|
readonly code?: PerformanceDiagnosticCode;
|
|
367
|
-
/**
|
|
437
|
+
/**
|
|
438
|
+
* Milliseconds from the window's first timing to the summary, one minute or less. Idle time
|
|
439
|
+
* inside the window counts, so this is not active editing time. Use the `count` of
|
|
440
|
+
* `interaction` to measure activity.
|
|
441
|
+
*/
|
|
368
442
|
readonly windowMs: number;
|
|
369
443
|
/** Pages in the document at the last paint. */
|
|
370
444
|
readonly pagesBucket?: CountBucket;
|
|
@@ -398,7 +472,7 @@ interface PerformanceDiagnostic extends DiagnosticBase {
|
|
|
398
472
|
*
|
|
399
473
|
* @public
|
|
400
474
|
*/
|
|
401
|
-
type EditorDiagnostic = DocumentOpenDiagnostic | EditRejectedDiagnostic | ReviewSkippedDiagnostic | FontFailedDiagnostic | HistoryDiagnosticEvent | CustomNodeDiagnosticEvent | CollaborationStatusDiagnostic | CollaborationParticipantsDiagnostic | PerformanceDiagnostic;
|
|
475
|
+
type EditorDiagnostic = DocumentOpenDiagnostic | EditRejectedDiagnostic | ReviewSkippedDiagnostic | FontFailedDiagnostic | HistoryDiagnosticEvent | CustomNodeDiagnosticEvent | CollaborationStatusDiagnostic | CollaborationParticipantsDiagnostic | PerformanceDiagnostic | DocumentSaveDiagnostic | SessionDiagnostic;
|
|
402
476
|
/** The `kind` of every {@link EditorDiagnostic}. @public */
|
|
403
477
|
type EditorDiagnosticKind = EditorDiagnostic['kind'];
|
|
404
478
|
|
|
@@ -414,7 +488,11 @@ interface EditorEvents {
|
|
|
414
488
|
revisionMarkupChange: (settings: ResolvedRevisionMarkup) => void;
|
|
415
489
|
/** A document mutation committed, with the ids it touched. */
|
|
416
490
|
change: (change: DocumentChange) => void;
|
|
417
|
-
/**
|
|
491
|
+
/**
|
|
492
|
+
* Observable editor state moved without a document change: the selection or its derived
|
|
493
|
+
* formatting, the armed typing format, the open header or footer, or the collaboration
|
|
494
|
+
* session's status.
|
|
495
|
+
*/
|
|
418
496
|
selectionChange: (snapshot: EditorSnapshot) => void;
|
|
419
497
|
error: (error: EditorError) => void;
|
|
420
498
|
historyDiagnostic: (diagnostic: HistoryDiagnostic) => void;
|
|
@@ -453,7 +531,42 @@ interface EditorEvents {
|
|
|
453
531
|
* ```
|
|
454
532
|
*/
|
|
455
533
|
reviewItemReveal: (event: ReviewItemRevealEvent) => void;
|
|
534
|
+
/**
|
|
535
|
+
* The editor's pages are now in another document: it was attached for the first time, moved
|
|
536
|
+
* into another element or window, detached (`document` is `null`), or found its element
|
|
537
|
+
* moved to another window by the host. Custom chrome that listens on the editor's document
|
|
538
|
+
* or measures its window re-binds here.
|
|
539
|
+
*
|
|
540
|
+
* @example
|
|
541
|
+
* ```ts
|
|
542
|
+
* editor.on('hostChange', ({ document }) => {
|
|
543
|
+
* stopShortcuts?.();
|
|
544
|
+
* stopShortcuts = document ? listenForShortcuts(document) : undefined;
|
|
545
|
+
* });
|
|
546
|
+
* ```
|
|
547
|
+
*/
|
|
548
|
+
hostChange: (event: EditorHostChange) => void;
|
|
549
|
+
}
|
|
550
|
+
/**
|
|
551
|
+
* The payload of the `hostChange` event.
|
|
552
|
+
*
|
|
553
|
+
* @public
|
|
554
|
+
*/
|
|
555
|
+
interface EditorHostChange {
|
|
556
|
+
/** The document the pages are mounted in now, or `null` while the editor is detached. */
|
|
557
|
+
readonly document: EditorHostDocument | null;
|
|
456
558
|
}
|
|
559
|
+
/**
|
|
560
|
+
* The DOM `Document`, wherever DOM types are loaded (every browser host).
|
|
561
|
+
*
|
|
562
|
+
* Read from `globalThis` rather than named, so this contract also compiles in the engine's
|
|
563
|
+
* DOM-free lanes and on servers, where it falls back to `object`.
|
|
564
|
+
*
|
|
565
|
+
* @public
|
|
566
|
+
*/
|
|
567
|
+
type EditorHostDocument = typeof globalThis extends {
|
|
568
|
+
readonly document: infer D;
|
|
569
|
+
} ? D : object;
|
|
457
570
|
/**
|
|
458
571
|
* The payload of the `reviewItemReveal` event.
|
|
459
572
|
*
|
|
@@ -461,17 +574,18 @@ interface EditorEvents {
|
|
|
461
574
|
*/
|
|
462
575
|
interface ReviewItemRevealEvent {
|
|
463
576
|
/**
|
|
464
|
-
* The key of the review item to open, as `getReviewItems(
|
|
465
|
-
* lists it
|
|
466
|
-
*
|
|
577
|
+
* The key of the review item to open, as `getReviewItems({ pairReplacements: false })`
|
|
578
|
+
* lists it, so for a replacement this is the key of its deletion or its insertion. Next
|
|
579
|
+
* Change and Previous Change stop once on a replacement and report its deletion's key,
|
|
580
|
+
* with the pair's key in {@link ReviewItemRevealEvent.pairKey}. `setActiveReviewItem`
|
|
467
581
|
* reports the key it was given, so a call with a pair's key reports that key here and in
|
|
468
582
|
* {@link ReviewItemRevealEvent.pairKey}.
|
|
469
583
|
*/
|
|
470
584
|
readonly key: string;
|
|
471
585
|
/**
|
|
472
|
-
* The key that `getReviewItems(
|
|
473
|
-
*
|
|
474
|
-
* host that
|
|
586
|
+
* The key that `getReviewItems()` gives the replacement this item belongs to, since it
|
|
587
|
+
* pairs replacements by default. Present only when the item is a paired replacement or one
|
|
588
|
+
* half of one. A host that reads the default list opens `pairKey ?? key`.
|
|
475
589
|
*/
|
|
476
590
|
readonly pairKey?: string;
|
|
477
591
|
/**
|
|
@@ -823,7 +937,7 @@ interface EditorReviewHits {
|
|
|
823
937
|
*
|
|
824
938
|
* Filtering revision kinds is how a host hides structural cards it has no UI for,
|
|
825
939
|
* `placement: false` skips the layout pass entirely when only metadata is wanted, and
|
|
826
|
-
* `pairReplacements` lists a typed-over selection as
|
|
940
|
+
* `pairReplacements: false` lists a typed-over selection as its two halves.
|
|
827
941
|
*/
|
|
828
942
|
interface ReviewItemQuery {
|
|
829
943
|
/**
|
|
@@ -836,8 +950,12 @@ interface ReviewItemQuery {
|
|
|
836
950
|
/** When false, skip layout geometry; metadata is unchanged and anchors are null. Default true. */
|
|
837
951
|
readonly placement?: boolean;
|
|
838
952
|
/**
|
|
839
|
-
*
|
|
840
|
-
* `'replace'` item. Default false
|
|
953
|
+
* Whether to list a deletion and the insertion that directly follows it as one
|
|
954
|
+
* `'replace'` item. Default true. Set it to false to list the deletion and the insertion as
|
|
955
|
+
* separate items, for example to accept or reject each half on its own.
|
|
956
|
+
*
|
|
957
|
+
* A host that steps through the list with `setActiveReviewItem` stops once on
|
|
958
|
+
* each replacement with the default, as Next Change does.
|
|
841
959
|
*
|
|
842
960
|
* Two revisions pair when they are next to each other among the queue's revisions, the
|
|
843
961
|
* deletion comes first, both have the same author, nesting level and `readOnly` value, and
|
|
@@ -857,6 +975,43 @@ interface ReviewItemQuery {
|
|
|
857
975
|
readonly pairReplacements?: boolean;
|
|
858
976
|
}
|
|
859
977
|
|
|
978
|
+
/**
|
|
979
|
+
* The refused-open read model, split out of `editor.ts`.
|
|
980
|
+
*
|
|
981
|
+
* Re-exported from `editor.ts`, so consumers keep importing
|
|
982
|
+
* `@docx-editor.dev/core/contracts/editor`.
|
|
983
|
+
*/
|
|
984
|
+
|
|
985
|
+
/**
|
|
986
|
+
* What a person can do about a document that did not open. It groups the open codes so a
|
|
987
|
+
* host can pick a message without listing every code:
|
|
988
|
+
*
|
|
989
|
+
* - `damaged`: the archive or its XML is broken. Saving the file again in a desktop editor
|
|
990
|
+
* can repair it.
|
|
991
|
+
* - `not-docx`: the bytes are not a `.docx` document, or hold no main document.
|
|
992
|
+
* - `too-large`: the file crosses a size, count or depth limit.
|
|
993
|
+
* - `blocked`: the file uses XML features that the editor refuses for security.
|
|
994
|
+
* - `unknown`: any other failure.
|
|
995
|
+
*
|
|
996
|
+
* @public
|
|
997
|
+
*/
|
|
998
|
+
type DocumentOpenFailureReason = 'damaged' | 'not-docx' | 'too-large' | 'blocked' | 'unknown';
|
|
999
|
+
/**
|
|
1000
|
+
* A document the editor refused to open. It carries a stable code only, never the file's
|
|
1001
|
+
* content or name, so a host can show it, log it, or send it with a support request.
|
|
1002
|
+
*
|
|
1003
|
+
* Each refusal is a new object, so a host can compare it by reference to tell a second
|
|
1004
|
+
* refusal of the same file from the first.
|
|
1005
|
+
*
|
|
1006
|
+
* @public
|
|
1007
|
+
*/
|
|
1008
|
+
interface DocumentOpenFailure {
|
|
1009
|
+
/** The stable open code, the same one the `document.open` diagnostic reports. */
|
|
1010
|
+
readonly code: DocumentOpenDiagnosticCode;
|
|
1011
|
+
/** The group of {@link DocumentOpenFailure.code} that picks the message. */
|
|
1012
|
+
readonly reason: DocumentOpenFailureReason;
|
|
1013
|
+
}
|
|
1014
|
+
|
|
860
1015
|
/**
|
|
861
1016
|
* How activating a review item places it in the viewport, and whether it announces the
|
|
862
1017
|
* reveal.
|
|
@@ -972,8 +1127,8 @@ interface ReviewRevisionPlacement extends ReviewItemPlacementBase {
|
|
|
972
1127
|
readonly revisionKind: ReviewRevisionKind;
|
|
973
1128
|
/**
|
|
974
1129
|
* The words a replacement decision removes when {@link revisionKind} is `'replace'`.
|
|
975
|
-
* The built-in reader lists separate deletion and insertion cards
|
|
976
|
-
* {@link ReviewItemQuery.pairReplacements}.
|
|
1130
|
+
* The built-in reader lists separate deletion and insertion cards when the query sets
|
|
1131
|
+
* {@link ReviewItemQuery.pairReplacements} to false.
|
|
977
1132
|
*/
|
|
978
1133
|
readonly replacedText?: string;
|
|
979
1134
|
readonly item: ReviewRevisionItem;
|
|
@@ -1245,7 +1400,8 @@ interface EditorFormatPainterCommands {
|
|
|
1245
1400
|
* direct paragraph properties as well.
|
|
1246
1401
|
*
|
|
1247
1402
|
* Non-mutating: the capture lives on the editor, not in the document, and it survives
|
|
1248
|
-
* until the next capture or
|
|
1403
|
+
* until the next capture, a document load, or `destroy()`, including across a `detach()`
|
|
1404
|
+
* and a later `attach()`.
|
|
1249
1405
|
*/
|
|
1250
1406
|
copyFormatting: Record<never, never>;
|
|
1251
1407
|
/**
|
|
@@ -1376,6 +1532,110 @@ interface SelectedImageState {
|
|
|
1376
1532
|
*/
|
|
1377
1533
|
type ImageContext = SelectedImageState;
|
|
1378
1534
|
|
|
1535
|
+
/**
|
|
1536
|
+
* Which kind of story a bookmark is in: the main text, a header or footer, or a note.
|
|
1537
|
+
*
|
|
1538
|
+
* @public
|
|
1539
|
+
*/
|
|
1540
|
+
type BookmarkStory = 'body' | 'headerFooter' | 'note';
|
|
1541
|
+
/**
|
|
1542
|
+
* Where a bookmark is, finer than {@link BookmarkStory}: the main text, a header, a footer, a
|
|
1543
|
+
* footnote or an endnote.
|
|
1544
|
+
*
|
|
1545
|
+
* @public
|
|
1546
|
+
*/
|
|
1547
|
+
type BookmarkPlace = 'body' | 'header' | 'footer' | 'footnote' | 'endnote';
|
|
1548
|
+
/**
|
|
1549
|
+
* One bookmark, as the `bookmarks` query lists it.
|
|
1550
|
+
*
|
|
1551
|
+
* @public
|
|
1552
|
+
*/
|
|
1553
|
+
interface BookmarkSummary {
|
|
1554
|
+
/** The name as the document writes it. Names compare without case. */
|
|
1555
|
+
readonly name: string;
|
|
1556
|
+
/** Whether the name starts with an underscore. Hidden bookmarks mark application targets. */
|
|
1557
|
+
readonly hidden: boolean;
|
|
1558
|
+
/** The story the bookmark starts in. */
|
|
1559
|
+
readonly story: BookmarkStory;
|
|
1560
|
+
/** The same story, telling a header from a footer and a footnote from an endnote. */
|
|
1561
|
+
readonly place: BookmarkPlace;
|
|
1562
|
+
/**
|
|
1563
|
+
* Position in document order: the main text first, then headers, footers and notes. Sort by
|
|
1564
|
+
* this value to list bookmarks by location.
|
|
1565
|
+
*/
|
|
1566
|
+
readonly order: number;
|
|
1567
|
+
/** Whether the bookmark marks a point rather than a range of text. */
|
|
1568
|
+
readonly empty: boolean;
|
|
1569
|
+
/** Whether the start of the selection is inside the bookmark, edges included. */
|
|
1570
|
+
readonly atSelection: boolean;
|
|
1571
|
+
/**
|
|
1572
|
+
* How many other places carry the same name. Usually 0. Collaborators who add one name while
|
|
1573
|
+
* offline can leave copies; the list, Go To and links use this bookmark, the first in
|
|
1574
|
+
* document order. Adding the name again at this bookmark keeps it and removes the copies.
|
|
1575
|
+
*/
|
|
1576
|
+
readonly duplicates: number;
|
|
1577
|
+
}
|
|
1578
|
+
/**
|
|
1579
|
+
* The bookmark commands an editor accepts.
|
|
1580
|
+
*
|
|
1581
|
+
* @public
|
|
1582
|
+
*/
|
|
1583
|
+
interface EditorBookmarkCommands {
|
|
1584
|
+
/**
|
|
1585
|
+
* Bookmark the selection under `name`, or the caret position when the selection is
|
|
1586
|
+
* collapsed. A bookmark that already has the name, compared without case, moves here, also
|
|
1587
|
+
* from another story, in one undo step. Two collaborators who add one name offline both keep
|
|
1588
|
+
* their bookmark; every replica reads the first in document order until the next write of the
|
|
1589
|
+
* name, which replaces or removes both.
|
|
1590
|
+
* Refused with `invalidArgs` for a name that does not start with a letter, holds a
|
|
1591
|
+
* character other than a letter, a digit or an underscore, or has more than 40 characters.
|
|
1592
|
+
*/
|
|
1593
|
+
insertBookmark: {
|
|
1594
|
+
name: string;
|
|
1595
|
+
};
|
|
1596
|
+
/**
|
|
1597
|
+
* Remove the bookmark with this name, compared without case, and any copies of it in other
|
|
1598
|
+
* places. The text stays.
|
|
1599
|
+
*/
|
|
1600
|
+
deleteBookmark: {
|
|
1601
|
+
name: string;
|
|
1602
|
+
};
|
|
1603
|
+
/**
|
|
1604
|
+
* Keep the bookmark this name means, the first in document order, and remove its copies, in
|
|
1605
|
+
* one undo step. The selection does not move. Collaborators who add one name while offline
|
|
1606
|
+
* can leave copies; `BookmarkSummary.duplicates` counts them. Refused with `notFound` when no
|
|
1607
|
+
* bookmark has the name, and with `unsupported` when it has no copies.
|
|
1608
|
+
*/
|
|
1609
|
+
keepFirstBookmark: {
|
|
1610
|
+
name: string;
|
|
1611
|
+
};
|
|
1612
|
+
/** Select the bookmark's text, or put the caret at a point bookmark, and scroll to it. */
|
|
1613
|
+
goToBookmark: {
|
|
1614
|
+
name: string;
|
|
1615
|
+
};
|
|
1616
|
+
/** Show or hide bracket marks at bookmarks. A view command: the document does not change. */
|
|
1617
|
+
toggleBookmarks: Record<never, never>;
|
|
1618
|
+
/**
|
|
1619
|
+
* Open the host's Go To UI, the Go to tab of `DocxEditor.Navigation`, the request its
|
|
1620
|
+
* shortcut (Ctrl+G, Cmd+Option+G on macOS) sends. Allowed in a read-only document. Refused
|
|
1621
|
+
* with `unsupported` while no host shows one. To jump without UI, run `goToBookmark`.
|
|
1622
|
+
*
|
|
1623
|
+
* `fromShortcut: true` asks as the shortcut does: also refused with `unsupported` when the
|
|
1624
|
+
* Go To UI turned its shortcut off (`GoToChromeHandlers.shortcut`). Chrome that forwards the
|
|
1625
|
+
* chord sends it, and a menu asks `can` with it before it shows the shortcut.
|
|
1626
|
+
*/
|
|
1627
|
+
openGoTo: {
|
|
1628
|
+
readonly fromShortcut?: boolean;
|
|
1629
|
+
};
|
|
1630
|
+
/**
|
|
1631
|
+
* Open the Bookmark dialog the host registered, the same request the Insert menu and
|
|
1632
|
+
* Ctrl/Cmd+Shift+F5 send. Allowed in a read-only document, where Go To still works.
|
|
1633
|
+
* Refused with `unsupported` while no host shows a bookmark dialog, for example when the
|
|
1634
|
+
* `bookmark` popup is `false`.
|
|
1635
|
+
*/
|
|
1636
|
+
openBookmarkDialog: Record<never, never>;
|
|
1637
|
+
}
|
|
1638
|
+
|
|
1379
1639
|
/** Where the caret sits inside a table: its shape and current cell. */
|
|
1380
1640
|
interface TableContext {
|
|
1381
1641
|
readonly rows: number;
|
|
@@ -1608,6 +1868,11 @@ interface Editor extends EditorAnchorNavigation, EditorHighlights, EditorReviewH
|
|
|
1608
1868
|
* Serialize the current document, finalizing pending text form values first.
|
|
1609
1869
|
* Invalid input rejects with `EditorError.code === 'invalidArgs'` and remains editable.
|
|
1610
1870
|
* Validation does not open a dialog. Other write refusals also reject the save.
|
|
1871
|
+
*
|
|
1872
|
+
* The bytes describe the document as it was when you called `save()`. The file is written
|
|
1873
|
+
* in short tasks, so input stays responsive while a long document saves, and edits made
|
|
1874
|
+
* meanwhile belong to the next save. Paragraphs and table rows unchanged since an earlier
|
|
1875
|
+
* save are not written again, so autosave after a small edit stays cheap.
|
|
1611
1876
|
*/
|
|
1612
1877
|
save(): Promise<ArrayBuffer>;
|
|
1613
1878
|
getDocumentHandle(): DocumentHandle;
|
|
@@ -1761,11 +2026,11 @@ interface Editor extends EditorAnchorNavigation, EditorHighlights, EditorReviewH
|
|
|
1761
2026
|
setTableInteractionLabel(resolver: (key: 'table.insertRowBelow' | 'table.insertColumnRight') => string): void;
|
|
1762
2027
|
/** Section page setup — size, orientation and margins — for the page-setup dialog. */
|
|
1763
2028
|
getPageSetup(): PageSetup | null;
|
|
1764
|
-
/**
|
|
1765
|
-
|
|
1766
|
-
|
|
1767
|
-
|
|
1768
|
-
|
|
2029
|
+
/**
|
|
2030
|
+
* The watermark the document shows, read from the first section's headers; null when it
|
|
2031
|
+
* shows none. For a picture watermark's bytes, use `query({ type: 'watermark' })`.
|
|
2032
|
+
*/
|
|
2033
|
+
getWatermark(): WatermarkState | null;
|
|
1769
2034
|
/** Header/footer editing state: which region is being edited, if any. */
|
|
1770
2035
|
getHeaderFooterState(): HeaderFooterState | null;
|
|
1771
2036
|
/** Resolved and authored note properties for the caret section — properties dialog read-model. */
|
|
@@ -1858,8 +2123,25 @@ interface Editor extends EditorAnchorNavigation, EditorHighlights, EditorReviewH
|
|
|
1858
2123
|
* Anchored to the RETAINED range when there is one, so a compose box that took focus does
|
|
1859
2124
|
* not lose the words it is about — that is what retention exists for. Refused on a
|
|
1860
2125
|
* collapsed caret: a comment with no range has nothing to point at, and Word writes none.
|
|
2126
|
+
*
|
|
2127
|
+
* A refused write names its cause, as every review write does: `code: 'locked'` with
|
|
2128
|
+
* `'the document is open for viewing'` in viewing or under read-only protection, and
|
|
2129
|
+
* `code: 'unsupported'` with the external refresh sentence or a collaboration reason token
|
|
2130
|
+
* such as `'collaboration-session-not-ready'` (wait for the session, then retry). Branch on
|
|
2131
|
+
* `diagnosticCodeOfRefusal(result.reason, result.code)`, not on the text.
|
|
2132
|
+
*
|
|
2133
|
+
* Pass `options.historyGroup` to make the comment part of a larger undo step, such as a
|
|
2134
|
+
* review decision that also resolves changes. See {@link HistoryGroupOptions}.
|
|
2135
|
+
*
|
|
2136
|
+
* @example
|
|
2137
|
+
* ```ts
|
|
2138
|
+
* editor.addComment('Counter-proposal: 45 days.', { historyGroup: decision });
|
|
2139
|
+
* editor.addComment('Approved.', 'Legal team', { historyGroup: decision });
|
|
2140
|
+
* ```
|
|
1861
2141
|
*/
|
|
1862
|
-
addComment(text: string,
|
|
2142
|
+
addComment(text: string, options?: HistoryGroupOptions): ExecResult;
|
|
2143
|
+
/** {@link addComment} with an author for this call, overriding the configured author. */
|
|
2144
|
+
addComment(text: string, author?: string, options?: HistoryGroupOptions): ExecResult;
|
|
1863
2145
|
/**
|
|
1864
2146
|
* Where a comment on the current selection would sit, in the same space as
|
|
1865
2147
|
* {@link ReviewItemPlacement.anchorY}, or null when nothing is selected.
|
|
@@ -1895,16 +2177,15 @@ interface Editor extends EditorAnchorNavigation, EditorHighlights, EditorReviewH
|
|
|
1895
2177
|
* caret that merely lands in a change leaves this `null`. Open a balloon or card for the
|
|
1896
2178
|
* activated item, and highlight the caret-active one.
|
|
1897
2179
|
*
|
|
1898
|
-
* Pass the query you read items with, so the key matches theirs
|
|
1899
|
-
*
|
|
1900
|
-
*
|
|
1901
|
-
*
|
|
2180
|
+
* Pass the query you read items with, so the key matches theirs. By default a paired
|
|
2181
|
+
* replacement reports the pair's key; with `pairReplacements: false`, the key of the half
|
|
2182
|
+
* the caret is in. The value changes with the selection, so read it again on
|
|
2183
|
+
* `selectionChange`.
|
|
1902
2184
|
*
|
|
1903
2185
|
* @example
|
|
1904
2186
|
* ```ts
|
|
1905
|
-
* const query = { pairReplacements: true };
|
|
1906
2187
|
* editor.on('selectionChange', () => {
|
|
1907
|
-
* const activated = editor.getActivatedReviewItemKey(
|
|
2188
|
+
* const activated = editor.getActivatedReviewItemKey();
|
|
1908
2189
|
* if (activated !== null) showMyCard(activated);
|
|
1909
2190
|
* });
|
|
1910
2191
|
* ```
|
|
@@ -1931,17 +2212,20 @@ interface Editor extends EditorAnchorNavigation, EditorHighlights, EditorReviewH
|
|
|
1931
2212
|
*
|
|
1932
2213
|
* Refused for a card whose kind the engine cannot resolve structurally, which is why
|
|
1933
2214
|
* `readOnly` is on the item — a surface should not offer the button in the first place.
|
|
2215
|
+
* Other refusals name their cause, as {@link addComment} describes.
|
|
1934
2216
|
*/
|
|
1935
|
-
acceptReviewItem(key: string): ExecResult;
|
|
1936
|
-
|
|
2217
|
+
acceptReviewItem(key: string, options?: HistoryGroupOptions): ExecResult;
|
|
2218
|
+
/** The rejecting half of {@link acceptReviewItem}, with the same rules and options. */
|
|
2219
|
+
rejectReviewItem(key: string, options?: HistoryGroupOptions): ExecResult;
|
|
1937
2220
|
/**
|
|
1938
2221
|
* Resolve or reopen the comment thread behind a review card.
|
|
1939
2222
|
*
|
|
1940
2223
|
* The thread state is written through the same package transaction as every other comment
|
|
1941
2224
|
* mutation, so `commentsExtended.xml`, Undo and save/reopen cannot disagree. Repeating the
|
|
1942
|
-
* state already on the item succeeds without adding an undo entry.
|
|
2225
|
+
* state already on the item succeeds without adding an undo entry. A refusal names its cause,
|
|
2226
|
+
* as {@link addComment} describes.
|
|
1943
2227
|
*/
|
|
1944
|
-
setCommentResolved(key: string, resolved: boolean): ExecResult;
|
|
2228
|
+
setCommentResolved(key: string, resolved: boolean, options?: HistoryGroupOptions): ExecResult;
|
|
1945
2229
|
/**
|
|
1946
2230
|
* Discard the item behind a card: the destructive half of the review verbs.
|
|
1947
2231
|
*
|
|
@@ -1955,9 +2239,10 @@ interface Editor extends EditorAnchorNavigation, EditorHighlights, EditorReviewH
|
|
|
1955
2239
|
* a surface can put one "remove this" affordance on every card instead of branching.
|
|
1956
2240
|
*
|
|
1957
2241
|
* Refused on a custom node's card, which is informational, and on a revision kind the engine
|
|
1958
|
-
* cannot resolve — the same rule {@link rejectReviewItem} follows.
|
|
2242
|
+
* cannot resolve — the same rule {@link rejectReviewItem} follows. Other refusals name their
|
|
2243
|
+
* cause, as {@link addComment} describes, and leave the open card and its draft open.
|
|
1959
2244
|
*/
|
|
1960
|
-
deleteReviewItem(key: string): ExecResult;
|
|
2245
|
+
deleteReviewItem(key: string, options?: HistoryGroupOptions): ExecResult;
|
|
1961
2246
|
/**
|
|
1962
2247
|
* Reply to a review item.
|
|
1963
2248
|
*
|
|
@@ -1968,8 +2253,11 @@ interface Editor extends EditorAnchorNavigation, EditorHighlights, EditorReviewH
|
|
|
1968
2253
|
* The author is AMBIENT — `DocxEditorConfig.author`, the way the rest of the authored commands
|
|
1969
2254
|
* source it — and the argument overrides it for one call. `CT_Comment` makes `@w:author`
|
|
1970
2255
|
* required, so a reply with neither is refused rather than written as an empty attribute.
|
|
2256
|
+
* Other refusals name their cause, as {@link addComment} describes.
|
|
1971
2257
|
*/
|
|
1972
|
-
replyToReviewItem(key: string, text: string,
|
|
2258
|
+
replyToReviewItem(key: string, text: string, options?: HistoryGroupOptions): ExecResult;
|
|
2259
|
+
/** {@link replyToReviewItem} with an author for this call, overriding the configured author. */
|
|
2260
|
+
replyToReviewItem(key: string, text: string, author?: string, options?: HistoryGroupOptions): ExecResult;
|
|
1973
2261
|
setActiveScope(scope: ViewScope): void;
|
|
1974
2262
|
getActiveScope(): ViewScope;
|
|
1975
2263
|
query<K extends keyof EditorQueries>(query: {
|
|
@@ -2093,7 +2381,7 @@ type TrackedChangeFilterMode = 'accept' | 'reject';
|
|
|
2093
2381
|
* selection, view state, chrome modes, header/footer and note editing. An interface rather than a
|
|
2094
2382
|
* closed union so an extension can widen it by declaration merging.
|
|
2095
2383
|
*/
|
|
2096
|
-
interface EditorCommands extends EditorCommandShape<DocEdits>, EditorHeaderFooterCommands, EditorNoteCommands, EditorFormatPainterCommands {
|
|
2384
|
+
interface EditorCommands extends EditorCommandShape<DocEdits>, EditorHeaderFooterCommands, EditorNoteCommands, EditorFormatPainterCommands, EditorBookmarkCommands {
|
|
2097
2385
|
/** Switch how edits are written. A view command: it changes no document state. */
|
|
2098
2386
|
setEditingMode: {
|
|
2099
2387
|
mode: DocumentEditingMode;
|
|
@@ -2112,7 +2400,17 @@ interface EditorCommands extends EditorCommandShape<DocEdits>, EditorHeaderFoote
|
|
|
2112
2400
|
toggleParagraphMarks: Record<never, never>;
|
|
2113
2401
|
/** Word's Protect Document: enforce filling-in-forms protection, or lift the enforced one. */
|
|
2114
2402
|
toggleDocumentProtection: Record<never, never>;
|
|
2115
|
-
/**
|
|
2403
|
+
/**
|
|
2404
|
+
* Navigate tracked changes, including hidden formatting balloons, and wrap at the end.
|
|
2405
|
+
*
|
|
2406
|
+
* A replacement is one stop in every review layout. A replacement is a deletion and the
|
|
2407
|
+
* touching insertion from the same author that took its place. Navigation lands on the
|
|
2408
|
+
* deletion, highlights both halves, and `reviewItemReveal` carries the pair's `pairKey`.
|
|
2409
|
+
*
|
|
2410
|
+
* Navigation steps through the changes {@link Editor.getReviewItems} returns, so a
|
|
2411
|
+
* reviewer or `setTrackedChangesFilter` filter applies. When a filter hides one half of a
|
|
2412
|
+
* replacement, the other half is a stop of its own.
|
|
2413
|
+
*/
|
|
2116
2414
|
navigateReviewChange: {
|
|
2117
2415
|
direction: 'next' | 'previous';
|
|
2118
2416
|
};
|
|
@@ -2320,11 +2618,10 @@ interface EditorCommands extends EditorCommandShape<DocEdits>, EditorHeaderFoote
|
|
|
2320
2618
|
positionTwips: number;
|
|
2321
2619
|
};
|
|
2322
2620
|
/**
|
|
2323
|
-
* Replace one found match with `text
|
|
2324
|
-
* `
|
|
2325
|
-
*
|
|
2326
|
-
*
|
|
2327
|
-
* nothing.
|
|
2621
|
+
* Replace one found match with `text`, addressed by the {@link TextMatch} `findMatches`
|
|
2622
|
+
* returns. An empty `text` deletes it. The selection and scroll position stay put. In
|
|
2623
|
+
* suggesting mode it is a tracked replacement under the editor's author, refused where
|
|
2624
|
+
* `proposeReplacement` would be. The match must be in the open story, not a text box.
|
|
2328
2625
|
*/
|
|
2329
2626
|
replaceMatch: {
|
|
2330
2627
|
match: TextMatch;
|
|
@@ -2431,6 +2728,11 @@ interface EditorCommands extends EditorCommandShape<DocEdits>, EditorHeaderFoote
|
|
|
2431
2728
|
drawingNodeId?: string;
|
|
2432
2729
|
expectedPackageRevision?: number;
|
|
2433
2730
|
};
|
|
2731
|
+
/**
|
|
2732
|
+
* Replace the document watermark in every header the document shows; null removes it. One
|
|
2733
|
+
* undo step. Refuses with `invalidArgs` for an invalid option and `locked` in a protected
|
|
2734
|
+
* document; a refusal writes nothing. See {@link Watermark} for the options and defaults.
|
|
2735
|
+
*/
|
|
2434
2736
|
setWatermark: {
|
|
2435
2737
|
watermark: Watermark | null;
|
|
2436
2738
|
};
|
|
@@ -2540,6 +2842,8 @@ interface EditorQueries extends DocQueries {
|
|
|
2540
2842
|
pos: number;
|
|
2541
2843
|
};
|
|
2542
2844
|
trackedChanges: Record<never, never>;
|
|
2845
|
+
/** Every bookmark in the document, hidden ones included, in document order. */
|
|
2846
|
+
bookmarks: Record<never, never>;
|
|
2543
2847
|
}
|
|
2544
2848
|
/**
|
|
2545
2849
|
* One query, as a discriminated union derived from {@link EditorQueries}.
|
|
@@ -2566,6 +2870,7 @@ interface EditorQueryResults extends DocQueryResults {
|
|
|
2566
2870
|
contentControlAt: ContentControlSummary | null;
|
|
2567
2871
|
isInsideToc: boolean;
|
|
2568
2872
|
trackedChanges: readonly Revision[];
|
|
2873
|
+
bookmarks: readonly BookmarkSummary[];
|
|
2569
2874
|
}
|
|
2570
2875
|
/**
|
|
2571
2876
|
* One occurrence of a search query in the document.
|
|
@@ -2670,6 +2975,13 @@ interface EditorSnapshot {
|
|
|
2670
2975
|
*/
|
|
2671
2976
|
readonly isOpening?: boolean;
|
|
2672
2977
|
readonly parseError: string | null;
|
|
2978
|
+
/**
|
|
2979
|
+
* Why the last supplied document did not open, or `null` while it opens or after it opened.
|
|
2980
|
+
* Unlike {@link EditorSnapshot.parseError}, it holds a stable code and never quotes the
|
|
2981
|
+
* file, so a host can show it to a person. `DocxEditor.OpenFailure` renders it. Optional
|
|
2982
|
+
* and additive: absent means the implementation has not derived it, read as `null`.
|
|
2983
|
+
*/
|
|
2984
|
+
readonly openFailure?: DocumentOpenFailure | null;
|
|
2673
2985
|
/** Whether the loaded document is being edited: a patchable document opened in edit mode. A
|
|
2674
2986
|
* read-only document (tables/SDTs/unpreservable) or `mode: 'view'` reports false. */
|
|
2675
2987
|
readonly editable: boolean;
|
|
@@ -2745,6 +3057,8 @@ interface EditorSnapshot {
|
|
|
2745
3057
|
readonly reviewPane: ResolvedReviewPane;
|
|
2746
3058
|
/** Whether Show/Hide paragraph marks is enabled. */
|
|
2747
3059
|
readonly showParagraphMarks?: boolean;
|
|
3060
|
+
/** Whether bracket marks are shown at bookmarks. */
|
|
3061
|
+
readonly showBookmarks?: boolean;
|
|
2748
3062
|
/** The document's `w:documentProtection`, as the file states it; null with no document. */
|
|
2749
3063
|
readonly documentProtection?: DocumentProtectionState | null;
|
|
2750
3064
|
/** The displayed revision projection. The document and its revision history stay unchanged. */
|
|
@@ -2815,11 +3129,13 @@ interface EditorSnapshot {
|
|
|
2815
3129
|
* An error the engine raised, carrying a machine-readable `code` alongside the message.
|
|
2816
3130
|
*
|
|
2817
3131
|
* `code` is optional because an `Error` from deeper down (a parser, a codec) is surfaced as-is
|
|
2818
|
-
* rather than wrapped in a fabricated code.
|
|
3132
|
+
* rather than wrapped in a fabricated code. The editor's own codes: `invalidTarget` (`attach`
|
|
3133
|
+
* cannot mount there), `unsupported` (a source it refuses to open), and `hostCallback` (a host
|
|
3134
|
+
* callback such as a bookmark mark's `decorate` threw; the editor kept its default behavior).
|
|
2819
3135
|
*/
|
|
2820
3136
|
interface EditorError extends Error {
|
|
2821
3137
|
readonly code?: string;
|
|
2822
3138
|
}
|
|
2823
3139
|
|
|
2824
|
-
export { DIAGNOSTIC_SCHEMA_VERSION as D,
|
|
2825
|
-
export type {
|
|
3140
|
+
export { DIAGNOSTIC_SCHEMA_VERSION as D, EditorFontError as J, DEFAULT_REVIEW_PANE as aY, cropPercentFromCropPermille as b2, cropPercentFromPermille as b3, cropPercentFromSourceCrop as b4, cropPermilleFromCropPercent as b5, cropPermilleFromPercent as b6, resolveReviewPane as b7, reviewPaneListsItem as b8, sourceCropFromCropPercent as b9, validateImageCropPercent as ba };
|
|
3141
|
+
export type { FontFailedDiagnostic as $, AnchorHighlightAnimation as A, BookmarkPlace as B, CanResult as C, EditorDiagnostic as E, EditorCommandShape as F, EditorCommands as G, EditorError as H, EditorEvents as I, EditorFontErrorCode as K, EditorFormatPainterCommands as L, EditorHeaderFooterCommands as M, EditorHighlights as N, EditorHostChange as O, EditorHostDocument as P, EditorNoteCommands as Q, ReviewPaneOptions as R, EditorPosition as S, EditorQueries as T, EditorQuery as U, EditorQueryResults as V, EditorReviewHits as W, EditorSelection as X, EditorSnapshot as Y, FontConfiguration as Z, FontFaceRequest as _, EditorDiagnosticKind as a, ReviewPaneItemFields as a$, FontSource as a0, FontSourceSubstitution as a1, FormatPainterLevel as a2, FormatPainterMode as a3, FormatPainterSurfaceState as a4, FurnitureVariant as a5, HeaderFooterSlotArgs as a6, HeaderFooterState as a7, HighlightHit as a8, HighlightOptions as a9, ScrollPlacement as aA, ScrollToAnchorOptions as aB, SelectedImageState as aC, SessionActivity as aD, SessionDiagnostic as aE, SetReviewChangesAuthorOptions as aF, TableBorderEdgeTarget as aG, TableBorderSpec as aH, TableBorderStyle as aI, TableBorderTarget as aJ, TableCellVerticalAlignment as aK, TableColumnDividerResizeTarget as aL, TableColumnOccurrenceTarget as aM, TableContext as aN, TableRightEdgeResizeTarget as aO, TableRowOccurrenceTarget as aP, TextMatch as aQ, TimingSummary as aR, TrackedChangeFilterMode as aS, TrackedChangePredicate as aT, ZoomFitTarget as aU, ZoomMode as aV, ReviewPaneOverflow as aW, CommentMarkerStyle as aX, ImageCropPermille as aZ, ResolvedReviewPane as a_, HighlightRange as aa, HighlightRect as ab, HighlightResult as ac, HistoryDiagnosticEvent as ad, HyperlinkInfo as ae, ImageContext as af, ImageCropPercent as ag, NoteKind as ah, NotePropertiesSide as ai, NotePropertiesState as aj, PageSetup as ak, PerformanceDiagnostic as al, ResolveReviewChangesOptions as am, ResolvedNoteNumbering as an, ReviewActivationOptions as ao, ReviewChangesAttribution as ap, ReviewCommentPlacement as aq, ReviewCustomPlacement as ar, ReviewItemHit as as, ReviewItemPlacement as at, ReviewItemPlacementBase as au, ReviewItemQuery as av, ReviewItemRevealEvent as aw, ReviewItemRevealSource as ax, ReviewRevisionPlacement as ay, ReviewSkippedDiagnostic as az, EditorCommand as b, ReviewPaneOpening as b0, RevisionDisplay as b1, AnchorHighlightOptions as c, AuthoredNoteNumbering as d, BookmarkStory as e, BookmarkSummary as f, ClearAnchorHighlightOptions as g, CollaborationParticipantsDiagnostic as h, CollaborationStatusDiagnostic as i, CustomNodeDiagnosticEvent as j, DiagnosticBase as k, DiagnosticFailureDetail as l, DocumentChange as m, DocumentEditingMode as n, DocumentHandle as o, DocumentOpenDiagnostic as p, DocumentOpenFailure as q, DocumentOpenFailureReason as r, DocumentSaveDiagnostic as s, DocumentShape as t, DocumentSource as u, EditRejectedDiagnostic as v, EditRejectionOrigin as w, Editor as x, EditorAnchorNavigation as y, EditorBookmarkCommands as z };
|