@docx-editor.dev/core 2.26.0 → 2.28.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 +30 -13
- package/dist/automation.js +1 -1
- package/dist/binding.cjs +1 -1
- package/dist/binding.d.ts +20 -9
- package/dist/binding.js +1 -1
- package/dist/chunk-2GO5T2JU.cjs +1 -0
- package/dist/chunk-2RC2EPND.js +3 -0
- package/dist/chunk-4GBTELJV.cjs +28 -0
- package/dist/chunk-4R3TEXMN.js +18 -0
- package/dist/chunk-5CSUYANV.js +1 -0
- package/dist/chunk-6APGXLBB.cjs +3 -0
- package/dist/chunk-6AWEKBLB.cjs +1 -0
- package/dist/chunk-6EYYL7FL.js +1 -0
- package/dist/chunk-E7BQA6UP.js +2 -0
- package/dist/chunk-EO4C5QJW.cjs +2 -0
- package/dist/chunk-ETTO6GK3.js +1 -0
- package/dist/chunk-FIJZIQXA.cjs +18 -0
- package/dist/chunk-FRXAOVTB.js +28 -0
- package/dist/chunk-J6BVWIDB.js +2 -0
- package/dist/chunk-JGNVNT2A.cjs +2 -0
- package/dist/chunk-K5U2PLDP.cjs +2 -0
- package/dist/chunk-KKIJG3C6.js +2 -0
- package/dist/chunk-LWDSDCMO.js +27 -0
- package/dist/chunk-NBCVVZOM.cjs +1 -0
- package/dist/chunk-O2AL2HSJ.cjs +1 -0
- package/dist/{chunk-AJCCS53D.js → chunk-O5INAWZQ.js} +1 -1
- package/dist/chunk-QMLCVPCD.cjs +1 -0
- package/dist/chunk-RCHS4ZEH.cjs +27 -0
- package/dist/chunk-SRPILEWV.cjs +5 -0
- package/dist/chunk-TSLBZ26X.js +1 -0
- package/dist/chunk-VDNNLG6X.js +2 -0
- package/dist/chunk-VHAVHCQY.js +7 -0
- package/dist/chunk-VX43VBAX.cjs +7 -0
- package/dist/chunk-Z6WBFXJU.js +5 -0
- package/dist/chunk-ZUHOMK52.cjs +2 -0
- package/dist/collaboration/replication.cjs +1 -1
- package/dist/collaboration/replication.d.ts +50 -5
- package/dist/collaboration/replication.js +1 -1
- package/dist/collaboration.cjs +1 -1
- package/dist/collaboration.d.ts +98 -6
- package/dist/collaboration.js +1 -1
- package/dist/contracts/document.d.ts +17 -2
- package/dist/contracts/editor.d.ts +19 -9
- package/dist/contracts/interaction.d.ts +29 -0
- package/dist/contracts/modules.cjs +1 -1
- package/dist/contracts/modules.d.ts +29 -16
- package/dist/contracts/modules.js +1 -1
- package/dist/contracts/types.d.ts +10 -1
- package/dist/{custom-node-writes-Cy9imOjA.d.ts → custom-node-writes-cvL5rhcD.d.ts} +2 -2
- package/dist/{document-protection-Bp19Ad4I.d.ts → document-protection-BAGVGqaP.d.ts} +1 -1
- package/dist/{editor-DYUlyKmb.d.ts → editor-Ci7IZGmG.d.ts} +410 -163
- package/dist/editor.cjs +1 -1
- package/dist/editor.css +5 -5
- package/dist/editor.d.ts +417 -31
- package/dist/editor.js +1 -1
- package/dist/export.cjs +2 -2
- package/dist/export.d.ts +37 -15
- package/dist/export.js +2 -2
- package/dist/failure-NS2lsya4.d.ts +115 -0
- package/dist/{font-resolver-u_nE0PI1.d.ts → font-resolver-BVQB14qT.d.ts} +1 -1
- package/dist/{headless-document-view-R9bzzepb.d.ts → headless-document-view-qH331moE.d.ts} +2 -2
- package/dist/{image-resources-DfagDguq.d.ts → image-resources-BN-hUgCn.d.ts} +9 -9
- package/dist/{index-Docw8Dcb.d.ts → index-Bsg7oIKP.d.ts} +270 -115
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +46 -18
- package/dist/index.js +1 -1
- package/dist/{layout-shaping-DWitwY73.d.ts → layout-shaping-BEyuiQOk.d.ts} +1 -1
- package/dist/layout.cjs +1 -1
- package/dist/layout.d.ts +177 -249
- package/dist/layout.js +1 -1
- package/dist/{note-properties-CmfvOJsi.d.ts → note-properties-4Y9o6Gyk.d.ts} +1 -1
- package/dist/{omml-equation-CZ6IG2ja.d.ts → omml-equation-CuzBL5DD.d.ts} +1 -1
- package/dist/output.cjs +1 -1
- package/dist/output.d.ts +18 -7
- package/dist/output.js +1 -1
- package/dist/{protocol-DniKeDb8.d.ts → protocol-Bqk4Izjc.d.ts} +48 -7
- package/dist/review-pane-D9jm8DcY.d.ts +128 -0
- package/dist/{review-paragraph-order-Dc8Q6tfM.d.ts → review-paragraph-order-DT-n6ouC.d.ts} +5 -2
- package/dist/{revision-projection-DfWxdBqA.d.ts → revision-projection-DZ4kKVev.d.ts} +74 -3
- package/dist/{semantic-cell-selection-Dy_BmmpL.d.ts → semantic-cell-selection-D9D1KSXq.d.ts} +8 -6
- package/dist/{semantic-interaction-CvFAj0GR.d.ts → semantic-interaction-CIC-PooQ.d.ts} +25 -34
- package/dist/{semantic-paint-Bk9wIXdZ.d.ts → semantic-paint-BME37OMv.d.ts} +57 -5
- package/dist/semantic-record-queries-CBlZqZNa.d.ts +177 -0
- package/dist/{semantic-records-COqi8pjP.d.ts → semantic-records-4B3WwFAi.d.ts} +84 -42
- package/dist/store.cjs +1 -1
- package/dist/store.d.ts +165 -137
- package/dist/store.js +1 -1
- package/dist/{tree-package-fragment-YPyYC1aD.d.ts → tree-package-fragment-BeeKxDw8.d.ts} +77 -57
- package/dist/{tree-session-contract-AeY2v0x9.d.ts → tree-session-contract-CVbmlMlq.d.ts} +7 -5
- package/dist/{types-barrel-BO73JqHG.d.ts → types-barrel-D3xCgQX6.d.ts} +595 -471
- package/package.json +3 -3
- package/dist/chunk-2BK4G4ZN.js +0 -2
- package/dist/chunk-2SJX44PC.cjs +0 -2
- package/dist/chunk-5BIASAN3.js +0 -1
- package/dist/chunk-6SEIXJTX.js +0 -1
- package/dist/chunk-73PG6L2X.js +0 -1
- package/dist/chunk-7RJSH72J.cjs +0 -5
- package/dist/chunk-AGKIHLWQ.cjs +0 -1
- package/dist/chunk-AN6WM4X4.js +0 -2
- package/dist/chunk-ANZ44KQT.cjs +0 -12
- package/dist/chunk-CYT3OQFZ.cjs +0 -1
- package/dist/chunk-DDGGSBAN.js +0 -12
- package/dist/chunk-EEAV3WIN.js +0 -3
- package/dist/chunk-ELQFXMJ5.cjs +0 -1
- package/dist/chunk-EYK4K2J6.js +0 -1
- package/dist/chunk-JNTETUNZ.cjs +0 -1
- package/dist/chunk-L6V3IJ3S.js +0 -5
- package/dist/chunk-LWCI65EL.js +0 -1
- package/dist/chunk-LZDI4P6I.cjs +0 -1
- package/dist/chunk-NS22DVWT.cjs +0 -2
- package/dist/chunk-QIE3YTU4.cjs +0 -2
- package/dist/chunk-QVBFPAGO.js +0 -5
- package/dist/chunk-RCCOLZEQ.js +0 -2
- package/dist/chunk-SUN62YU6.cjs +0 -5
- package/dist/chunk-TKQH7BNE.cjs +0 -1
- package/dist/chunk-TKR2MXX4.cjs +0 -3
- package/dist/chunk-UJL2GDIM.cjs +0 -25
- package/dist/chunk-WQTADNHK.cjs +0 -27
- package/dist/chunk-XSHXBJ2J.js +0 -25
- package/dist/chunk-YXZEBTDF.js +0 -27
- package/dist/failure-BIPVQbRm.d.ts +0 -65
|
@@ -1,20 +1,21 @@
|
|
|
1
|
-
import { W as TreeDocOp,
|
|
2
|
-
import {
|
|
3
|
-
import './
|
|
1
|
+
import { W as TreeDocOp, co as TextFormFieldRange, cn as TextFormFieldOptions, au as Unsubscribe, E as ExecResult, ao as DrawingPositionInput, aM as DrawingTransform, A as ParagraphTabStop, y as IndentFormatting, z as ParagraphFlags, aB as ParagraphDisagreements, aj as DrawingTreeDocOp, at as SelectionPin, Q as OoxmlPackage, g as ReviewRevisionKind, an as ImageWrapTarget } from './types-barrel-D3xCgQX6.js';
|
|
2
|
+
import { k as FieldResultsMode, I as InsertImageInput, S as StoryScope, A as ApplyImagePropertiesInput, i as ImageIntentResult } from './tree-package-fragment-BeeKxDw8.js';
|
|
3
|
+
import { a as ImageDecodePort, S as SupportedImageMime } from './image-resources-BN-hUgCn.js';
|
|
4
|
+
import './document-protection-BAGVGqaP.js';
|
|
4
5
|
import { EditorModule, ReviewModuleContribution } from './contracts/modules.js';
|
|
5
|
-
import { D as DocumentSource, a as FontConfiguration, Z as ZoomMode, E as EditorFontError,
|
|
6
|
-
import {
|
|
7
|
-
import { S as SemanticPosition, a as SemanticSelection, N as NavigationCommand } from './semantic-interaction-
|
|
8
|
-
import { e as FontConfigurationFragment, g as FontResolver, i as MarkedFontResolver, f as FontResolutionRequest } from './font-resolver-
|
|
6
|
+
import { D as DocumentSource, a as FontConfiguration, Z as ZoomMode, E as EditorFontError, i as Editor, e as EditorCommand, C as CanResult, p as SelectedImageState, z as FormatPainterSurfaceState, g as ScrollPlacement, r as TrackedChangePredicate, q as TrackedChangeFilterMode, F as FontFaceRequest, b as FontSource, I as ImageContext, B as TableBorderEdgeTarget, G as TableBorderSpec, J as TableBorderStyle, K as TableContext } from './editor-Ci7IZGmG.js';
|
|
7
|
+
import { e as RevisionMarkupOptions, a as ReviewDisplayMode, i as RevisionMarkupChromeHandlers, d as ResolvedRevisionMarkup } from './revision-projection-DZ4kKVev.js';
|
|
8
|
+
import { S as SemanticPosition, a as SemanticSelection, N as NavigationCommand } from './semantic-interaction-CIC-PooQ.js';
|
|
9
|
+
import { e as FontConfigurationFragment, g as FontResolver, i as MarkedFontResolver, f as FontResolutionRequest } from './font-resolver-BVQB14qT.js';
|
|
10
|
+
import { R as ReviewPaneOptions } from './review-pane-D9jm8DcY.js';
|
|
9
11
|
import { EditorCollaborationSession, CollaborationRemoteSelection, CollaborationModuleContribution } from './collaboration.js';
|
|
10
|
-
import {
|
|
11
|
-
import { b as ResolvedFootnoteProperties, R as ResolvedEndnoteProperties, A as AuthoredNoteProperties } from './note-properties-
|
|
12
|
-
import { S as SemanticLayout, T as TextMeasurer, C as ContentControlBoundaryRecord } from './semantic-records-
|
|
13
|
-
import { B as BookmarkIndex } from './custom-node-writes-
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import { C as CollaborationStatus } from './failure-BIPVQbRm.js';
|
|
12
|
+
import { d as RevisionStyles, R as ReviewAuthorInfo, c as RevisionAuthorStyle, F as FieldShadingMode, f as DrawingPaintStrings } from './semantic-paint-BME37OMv.js';
|
|
13
|
+
import { b as ResolvedFootnoteProperties, R as ResolvedEndnoteProperties, A as AuthoredNoteProperties } from './note-properties-4Y9o6Gyk.js';
|
|
14
|
+
import { S as SemanticLayout, T as TextMeasurer, C as ContentControlBoundaryRecord } from './semantic-records-4B3WwFAi.js';
|
|
15
|
+
import { B as BookmarkIndex } from './custom-node-writes-cvL5rhcD.js';
|
|
16
|
+
import { C as CellSelection, S as SectionProperties } from './semantic-cell-selection-D9D1KSXq.js';
|
|
17
|
+
import { T as TreeDocxSessionView, a as TreeApplyResult } from './tree-session-contract-CVbmlMlq.js';
|
|
18
|
+
import { C as CollaborationStatus } from './failure-NS2lsya4.js';
|
|
18
19
|
import { V as ViewScope, b as EditorExecOptions } from './editor-scope-OHPwVQ5l.js';
|
|
19
20
|
import './contracts/document.js';
|
|
20
21
|
import './contracts/interaction.js';
|
|
@@ -140,6 +141,31 @@ interface TextFormFieldChromeHandlers {
|
|
|
140
141
|
readonly onRequest?: (session: TextFormFieldDialogSession) => void;
|
|
141
142
|
}
|
|
142
143
|
|
|
144
|
+
/**
|
|
145
|
+
* Receives the element that shows the loading indicator on the first page, while a large
|
|
146
|
+
* document lays out its remaining pages.
|
|
147
|
+
*
|
|
148
|
+
* @example
|
|
149
|
+
* ```ts
|
|
150
|
+
* editor.setOpeningIndicatorHost({
|
|
151
|
+
* publish(element) {
|
|
152
|
+
* // Render your indicator into `element`, or remove it when `element` is null.
|
|
153
|
+
* },
|
|
154
|
+
* });
|
|
155
|
+
* ```
|
|
156
|
+
*
|
|
157
|
+
* @public
|
|
158
|
+
*/
|
|
159
|
+
interface OpeningIndicatorHost {
|
|
160
|
+
/**
|
|
161
|
+
* Called with the indicator element when the first pages show, and with `null` when the
|
|
162
|
+
* remaining pages are laid out or the open is abandoned. The element is empty while a host
|
|
163
|
+
* is set: render the host's content into it. It is centered on the first page, at most 30%
|
|
164
|
+
* of the window height below the page top, and scrolls with the document.
|
|
165
|
+
*/
|
|
166
|
+
publish(element: HTMLElement | null): void;
|
|
167
|
+
}
|
|
168
|
+
|
|
143
169
|
/**
|
|
144
170
|
* A hyperlink as the surface reports it: its identity, where it sits, and the SANITIZED
|
|
145
171
|
* target. `href: null` is an inert link — a refused scheme or a dangling relationship — which
|
|
@@ -368,6 +394,27 @@ interface DocxEditorConfig {
|
|
|
368
394
|
* the proposed view still marks surviving insertions.
|
|
369
395
|
*/
|
|
370
396
|
revisionStyles?: RevisionStyles;
|
|
397
|
+
/** Initial local revision presentation and tracking preferences. */
|
|
398
|
+
revisionMarkup?: RevisionMarkupOptions;
|
|
399
|
+
/** Initial review projection. Markup modes require a review module. */
|
|
400
|
+
reviewDisplayMode?: ReviewDisplayMode;
|
|
401
|
+
/**
|
|
402
|
+
* How the reader edits saved field results.
|
|
403
|
+
*
|
|
404
|
+
* - `'atomic'` (the DEFAULT) — every field is one unit: typing beside a field lands before
|
|
405
|
+
* or after it, and Backspace removes it whole.
|
|
406
|
+
* - `'editable'` — fields that show their saved result (DATE, TIME, MERGEFIELD, HYPERLINK
|
|
407
|
+
* display text, QUOTE, FILENAME, FILLIN, SEQ, and the save, print, and creation dates)
|
|
408
|
+
* accept typing, deletion, and selection inside the result. Fields the engine computes
|
|
409
|
+
* live (PAGE, NUMPAGES, REF, PAGEREF, DOCPROPERTY, and others) stay one unit.
|
|
410
|
+
*
|
|
411
|
+
* Editable results must be unnested. Simple fields inside complex field results are not
|
|
412
|
+
* supported in editable mode.
|
|
413
|
+
*
|
|
414
|
+
* Fixed for the instance. `'editable'` with a collaboration module throws a `TypeError`:
|
|
415
|
+
* shared paragraph text keeps every field one unit.
|
|
416
|
+
*/
|
|
417
|
+
fieldResults?: FieldResultsMode;
|
|
371
418
|
/** Override raster decode for insert/replace image commands; defaults to browser/headless. */
|
|
372
419
|
imageDecodePort?: ImageDecodePort;
|
|
373
420
|
/**
|
|
@@ -444,6 +491,12 @@ interface DocxEditorInstance extends Editor {
|
|
|
444
491
|
* command needs.
|
|
445
492
|
*/
|
|
446
493
|
setHyperlinkChrome(handlers: HyperlinkChromeHandlers): Unsubscribe;
|
|
494
|
+
/**
|
|
495
|
+
* Register local revision settings chrome. Disposal cancels its active sessions.
|
|
496
|
+
* Manual renderers take priority over fallback renderers. Pass null to use native chrome
|
|
497
|
+
* until disposal restores the previous registration.
|
|
498
|
+
*/
|
|
499
|
+
setRevisionMarkupChrome(handlers: RevisionMarkupChromeHandlers | null, options?: PopupChromeRegistrationOptions): Unsubscribe;
|
|
447
500
|
/** Register Field Options chrome. Disposal closes sessions owned by this registration. */
|
|
448
501
|
setTextFormFieldChrome(handlers: TextFormFieldChromeHandlers, options?: PopupChromeRegistrationOptions): Unsubscribe;
|
|
449
502
|
/** Register typed content-control widget chrome. */
|
|
@@ -462,6 +515,25 @@ interface DocxEditorInstance extends Editor {
|
|
|
462
515
|
* mount, and it survives a document reload the way the hyperlink chrome does.
|
|
463
516
|
*/
|
|
464
517
|
setRemoteCaretLabelHost(host: RemoteCaretLabelHost | null): void;
|
|
518
|
+
/**
|
|
519
|
+
* Render the host's own loading indicator on the first page while a large document lays out
|
|
520
|
+
* its remaining pages, or restore the packaged spinner with `null`. The engine keeps owning
|
|
521
|
+
* the element and its place on the page; the host owns its content.
|
|
522
|
+
*
|
|
523
|
+
* Instance-only, like `setRemoteCaretLabelHost`, and tolerated at any time: a host set
|
|
524
|
+
* before the open applies when the first pages show. `DocxEditor.Loading` with `overlay`
|
|
525
|
+
* registers one for you, so set this only when you build your own loading screen.
|
|
526
|
+
*
|
|
527
|
+
* @example
|
|
528
|
+
* ```ts
|
|
529
|
+
* editor.setOpeningIndicatorHost({
|
|
530
|
+
* publish(element) {
|
|
531
|
+
* element?.replaceChildren(document.createTextNode('Opening…'));
|
|
532
|
+
* },
|
|
533
|
+
* });
|
|
534
|
+
* ```
|
|
535
|
+
*/
|
|
536
|
+
setOpeningIndicatorHost(host: OpeningIndicatorHost | null): void;
|
|
465
537
|
/**
|
|
466
538
|
* Monotonic version of the observable editor state. Bumps whenever anything
|
|
467
539
|
* `snapshot()` reports could have moved — a committed change, a selection move, zoom,
|
|
@@ -602,6 +674,30 @@ interface DocxEditorInstance extends Editor {
|
|
|
602
674
|
* of calling it. Call it directly from headless and non-React hosts.
|
|
603
675
|
*/
|
|
604
676
|
setRevisionStyles(styles: RevisionStyles): void;
|
|
677
|
+
/** Merge local preferences and emit revisionMarkupChange after a change.
|
|
678
|
+
* Invalid settings throw TypeError without changing the previous settings.
|
|
679
|
+
*/
|
|
680
|
+
setRevisionMarkup(options: RevisionMarkupOptions): void;
|
|
681
|
+
/**
|
|
682
|
+
* Change the review pane settings: every field of `ReviewPaneOptions`, such as when the
|
|
683
|
+
* pane opens by itself and what it does when its card column does not fit. An omitted
|
|
684
|
+
* field keeps its value. Read the settings in force
|
|
685
|
+
* from `snapshot().reviewPane`. They stay in force across `load()` and are never saved into
|
|
686
|
+
* the document. This sets how the pane behaves; to open or close the pane itself, use
|
|
687
|
+
* `useReview().setPaneOpen` or the `toggleReviewPane` command.
|
|
688
|
+
*
|
|
689
|
+
* Returns `changed: false` on success, like every view-only call, because `changed` answers
|
|
690
|
+
* for the document; to detect a settings change, compare the `snapshot().reviewPane`
|
|
691
|
+
* reference, which changes only when a setting changes. Refused with `unsupported` when no review module is registered, and
|
|
692
|
+
* with `invalidArgs` for an unknown field or value. A refusal changes nothing.
|
|
693
|
+
*
|
|
694
|
+
* @example
|
|
695
|
+
* ```ts
|
|
696
|
+
* const result = editor.setReviewPaneOptions({ opening: 'manual', overflow: 'shrinkPage' });
|
|
697
|
+
* if (!result.ok) console.warn(result.reason);
|
|
698
|
+
* ```
|
|
699
|
+
*/
|
|
700
|
+
setReviewPaneOptions(options: ReviewPaneOptions): ExecResult;
|
|
605
701
|
/**
|
|
606
702
|
* Mount into `el`. If the instance holds pending document bytes (created without a
|
|
607
703
|
* container, or previously detached), they mount now — under the shaped measurer when
|
|
@@ -621,6 +717,37 @@ interface DocxEditorInstance extends Editor {
|
|
|
621
717
|
detach(): void;
|
|
622
718
|
}
|
|
623
719
|
|
|
720
|
+
/** Which of the eight resize handles a drag started from, by compass direction. */
|
|
721
|
+
type ImageResizeHandle = 'n' | 'ne' | 'e' | 'se' | 's' | 'sw' | 'w' | 'nw';
|
|
722
|
+
/** EMUs per point. DrawingML stores extents in EMU; layout works in points. */
|
|
723
|
+
declare const EMU_PER_POINT = 12700;
|
|
724
|
+
/** Points to EMU, rounded — EMUs are integral in the file. */
|
|
725
|
+
declare function pointsToEmu(points: number): number;
|
|
726
|
+
/** EMU to points. Unrounded, so overlay geometry keeps sub-point precision during a drag. */
|
|
727
|
+
declare function emuToOverlayPoints(emu: number): number;
|
|
728
|
+
/**
|
|
729
|
+
* The extent a resize drag produces, in EMU.
|
|
730
|
+
*
|
|
731
|
+
* Computed from the drag's START extent rather than the previous frame's, so a drag that reverses
|
|
732
|
+
* direction lands exactly where it began instead of accumulating rounding error.
|
|
733
|
+
*
|
|
734
|
+
* `preserveAspect` behaves the way Word's handles do: a corner handle scales by whichever axis
|
|
735
|
+
* moved further, while an edge handle drives the other axis from the original ratio. Both axes
|
|
736
|
+
* are floored at one point, so a drag past the opposite edge cannot invert the image.
|
|
737
|
+
*/
|
|
738
|
+
declare function computeResizedImageExtentEmu(startWidthEmu: number, startHeightEmu: number, handle: ImageResizeHandle, deltaWidthPt: number, deltaHeightPt: number, preserveAspect: boolean): {
|
|
739
|
+
readonly cx: number;
|
|
740
|
+
readonly cy: number;
|
|
741
|
+
};
|
|
742
|
+
/**
|
|
743
|
+
* The position a move drag produces, preserving the anchoring the file already used.
|
|
744
|
+
*
|
|
745
|
+
* A `frame`-mode position keeps its `relativeToH`/`relativeToV` bases and only shifts the offsets
|
|
746
|
+
* it actually had — writing an offset the file omitted would re-anchor the drawing to a different
|
|
747
|
+
* reference and move it somewhere the drag never pointed.
|
|
748
|
+
*/
|
|
749
|
+
declare function computeMovedImagePosition(start: DrawingPositionInput, deltaXPt: number, deltaYPt: number): DrawingPositionInput;
|
|
750
|
+
|
|
624
751
|
type ImageMutationPreconditions = Readonly<{
|
|
625
752
|
mountGeneration: number;
|
|
626
753
|
packageRevision: number;
|
|
@@ -660,14 +787,10 @@ declare function canExecuteImageCommand(command: Extract<EditorCommand, {
|
|
|
660
787
|
declare function executeImageCommand(editor: DocxEditorInstance, command: Extract<EditorCommand, {
|
|
661
788
|
type: 'insertImage' | 'replaceImage';
|
|
662
789
|
}>): Promise<ExecResult>;
|
|
663
|
-
/** Which of the eight resize handles a drag started from, by compass direction. */
|
|
664
|
-
type ImageResizeHandle = 'n' | 'ne' | 'e' | 'se' | 's' | 'sw' | 'w' | 'nw';
|
|
665
790
|
/** How far one arrow-key press nudges a selected image, in points. */
|
|
666
791
|
declare const IMAGE_OVERLAY_NUDGE_PT = 1;
|
|
667
792
|
/** How far Shift+arrow nudges a selected image, in points. */
|
|
668
793
|
declare const IMAGE_OVERLAY_NUDGE_SHIFT_PT = 10;
|
|
669
|
-
/** EMUs per point. DrawingML stores extents in EMU; layout works in points. */
|
|
670
|
-
declare const EMU_PER_POINT = 12700;
|
|
671
794
|
/**
|
|
672
795
|
* One in-flight image drag: where it started, and everything needed to decide at commit time
|
|
673
796
|
* whether the document still describes what the gesture was planned against.
|
|
@@ -747,32 +870,6 @@ interface SelectedDrawingOverlayTarget {
|
|
|
747
870
|
* claim an object the user did not single out.
|
|
748
871
|
*/
|
|
749
872
|
declare function selectedDrawingOverlayTargetOf(surface: PaginatedSurface | null): SelectedDrawingOverlayTarget | null;
|
|
750
|
-
/** Points to EMU, rounded — EMUs are integral in the file. */
|
|
751
|
-
declare function pointsToEmu(points: number): number;
|
|
752
|
-
/** EMU to points. Unrounded, so overlay geometry keeps sub-point precision during a drag. */
|
|
753
|
-
declare function emuToOverlayPoints(emu: number): number;
|
|
754
|
-
/**
|
|
755
|
-
* The extent a resize drag produces, in EMU.
|
|
756
|
-
*
|
|
757
|
-
* Computed from the drag's START extent rather than the previous frame's, so a drag that reverses
|
|
758
|
-
* direction lands exactly where it began instead of accumulating rounding error.
|
|
759
|
-
*
|
|
760
|
-
* `preserveAspect` behaves the way Word's handles do: a corner handle scales by whichever axis
|
|
761
|
-
* moved further, while an edge handle drives the other axis from the original ratio. Both axes
|
|
762
|
-
* are floored at one point, so a drag past the opposite edge cannot invert the image.
|
|
763
|
-
*/
|
|
764
|
-
declare function computeResizedImageExtentEmu(startWidthEmu: number, startHeightEmu: number, handle: ImageResizeHandle, deltaWidthPt: number, deltaHeightPt: number, preserveAspect: boolean): {
|
|
765
|
-
readonly cx: number;
|
|
766
|
-
readonly cy: number;
|
|
767
|
-
};
|
|
768
|
-
/**
|
|
769
|
-
* The position a move drag produces, preserving the anchoring the file already used.
|
|
770
|
-
*
|
|
771
|
-
* A `frame`-mode position keeps its `relativeToH`/`relativeToV` bases and only shifts the offsets
|
|
772
|
-
* it actually had — writing an offset the file omitted would re-anchor the drawing to a different
|
|
773
|
-
* reference and move it somewhere the drag never pointed.
|
|
774
|
-
*/
|
|
775
|
-
declare function computeMovedImagePosition(start: DrawingPositionInput, deltaXPt: number, deltaYPt: number): DrawingPositionInput;
|
|
776
873
|
/**
|
|
777
874
|
* Whether a drag's commit should be refused because the document moved under it — the refusal to
|
|
778
875
|
* return, or null when the commit is still valid.
|
|
@@ -1020,7 +1117,7 @@ interface ParagraphPropertyEdit {
|
|
|
1020
1117
|
* `commentReference` naming a comment it never received. Naming the write lets each be admitted
|
|
1021
1118
|
* only once a two-replica test proves it arrives whole.
|
|
1022
1119
|
*/
|
|
1023
|
-
type ReviewWriteIntent = 'revision-resolve' | 'comment-add' | 'comment-reply' | 'comment-resolve' | 'comment-delete' | 'package-scoped';
|
|
1120
|
+
type ReviewWriteIntent = 'revision-resolve' | 'revision-attribution' | 'comment-add' | 'comment-reply' | 'comment-resolve' | 'comment-delete' | 'package-scoped';
|
|
1024
1121
|
|
|
1025
1122
|
/**
|
|
1026
1123
|
* Everything an overlay needs to paint over one rendered frame of the surface.
|
|
@@ -1214,6 +1311,13 @@ interface PaginatedSurfaceOptions {
|
|
|
1214
1311
|
* authority.
|
|
1215
1312
|
*/
|
|
1216
1313
|
readonly collaborationModel?: CollaborationModuleContribution;
|
|
1314
|
+
/**
|
|
1315
|
+
* How saved field results are edited. `atomic` (the default) keeps every field one unit.
|
|
1316
|
+
* `editable` lets the reader type, delete, and select inside the saved result of a DATE,
|
|
1317
|
+
* MERGEFIELD, HYPERLINK, or similar field. Results must be unnested; simple fields inside
|
|
1318
|
+
* complex field results are not supported. Refused with a {@link collaborationModel}.
|
|
1319
|
+
*/
|
|
1320
|
+
readonly fieldResults?: FieldResultsMode;
|
|
1217
1321
|
readonly measurer?: TextMeasurer;
|
|
1218
1322
|
/** Ambient author for tracked edits. Required before suggesting can write anything. */
|
|
1219
1323
|
readonly author?: string;
|
|
@@ -1265,6 +1369,7 @@ interface PaginatedSurfaceOptions {
|
|
|
1265
1369
|
* revision markup paints, whatever the {@link revisionDisplayMode} leaves visible.
|
|
1266
1370
|
*/
|
|
1267
1371
|
readonly revisionStyles?: RevisionStyles;
|
|
1372
|
+
readonly revisionMarkup?: ResolvedRevisionMarkup;
|
|
1268
1373
|
/**
|
|
1269
1374
|
* The review module's derivation hooks for this surface's session. Absent,
|
|
1270
1375
|
* `session.reviewItems()` is the typed empty queue and every review affordance
|
|
@@ -1401,7 +1506,7 @@ interface RevealOptions {
|
|
|
1401
1506
|
* centred when it has to move, so the reader lands looking AT the thing rather than at
|
|
1402
1507
|
* the bottom line of the window. Default `'start'`.
|
|
1403
1508
|
*/
|
|
1404
|
-
readonly block?:
|
|
1509
|
+
readonly block?: ScrollPlacement;
|
|
1405
1510
|
/** Padding above the target, in CSS pixels. Default 24. */
|
|
1406
1511
|
readonly offsetPx?: number;
|
|
1407
1512
|
readonly behavior?: ScrollBehavior;
|
|
@@ -1589,6 +1694,25 @@ interface PaginatedSurface {
|
|
|
1589
1694
|
* where there is no list to demote).
|
|
1590
1695
|
*/
|
|
1591
1696
|
adjustIndent(direction: 'increase' | 'decrease'): boolean;
|
|
1697
|
+
/**
|
|
1698
|
+
* Tab (`increase`) or Shift+Tab (`decrease`) over a selection outside a list: change the
|
|
1699
|
+
* indent and keep the text.
|
|
1700
|
+
*
|
|
1701
|
+
* A selection over two or more paragraphs, or a cell rectangle, steps the left indent of
|
|
1702
|
+
* each paragraph. A selection in one paragraph that starts at the paragraph start, whole or
|
|
1703
|
+
* partial, works on the first line: Tab sets a first-line indent of one default tab stop
|
|
1704
|
+
* (`w:defaultTabStop`), or steps the left indent when the first line already has that
|
|
1705
|
+
* indent or more, or a hanging indent. Shift+Tab clears a first-line indent that the
|
|
1706
|
+
* paragraph states itself, so a style value applies again, and otherwise steps the left
|
|
1707
|
+
* indent back. A paragraph the selection reaches only at its start is not touched by this
|
|
1708
|
+
* rule, unless it is the empty last paragraph of the story.
|
|
1709
|
+
*
|
|
1710
|
+
* Answers true when the selection takes this rule, also when the write is refused or
|
|
1711
|
+
* changes nothing, so the text is never replaced. Answers false for a caret and for a
|
|
1712
|
+
* selection in one paragraph that starts inside the text; there Tab types a tab character
|
|
1713
|
+
* and Shift+Tab steps the left indent.
|
|
1714
|
+
*/
|
|
1715
|
+
indentWithTab(direction: 'increase' | 'decrease'): boolean;
|
|
1592
1716
|
/**
|
|
1593
1717
|
* Set indent to exact values on every paragraph the selection touches — what a ruler
|
|
1594
1718
|
* drag and an indent spinner both need, where {@link adjustIndent} only steps.
|
|
@@ -1910,6 +2034,8 @@ interface PaginatedSurface {
|
|
|
1910
2034
|
setEditingMode(mode: SurfaceEditingMode): void;
|
|
1911
2035
|
/** Set the ambient author after buffered text commits under the previous author. */
|
|
1912
2036
|
setAuthor(author: string | undefined): void;
|
|
2037
|
+
/** The ambient author tracked edits and review writes record, or undefined. */
|
|
2038
|
+
author(): string | undefined;
|
|
1913
2039
|
/** Replace localized drawing labels and repaint materialized pages. */
|
|
1914
2040
|
setDrawingStrings(strings: DrawingPaintStrings): void;
|
|
1915
2041
|
/** Update shared form-control labels without replacing open dialogs. */
|
|
@@ -1940,6 +2066,7 @@ interface PaginatedSurface {
|
|
|
1940
2066
|
* Replace how tracked changes are coloured, live. Paint-level: the pages repaint without
|
|
1941
2067
|
* remeasuring a line, and the caret, selection and undo history stay where they are.
|
|
1942
2068
|
*/
|
|
2069
|
+
setRevisionMarkup(settings: ResolvedRevisionMarkup): void;
|
|
1943
2070
|
setRevisionStyles(colors: RevisionStyles | undefined): void;
|
|
1944
2071
|
/** Toggle paragraph-end furniture without layout or document changes. */
|
|
1945
2072
|
setShowParagraphMarks(show: boolean): void;
|
|
@@ -2048,7 +2175,8 @@ interface PaginatedSurface {
|
|
|
2048
2175
|
*/
|
|
2049
2176
|
overlayCoordinates(): SurfaceOverlayCoordinates;
|
|
2050
2177
|
/**
|
|
2051
|
-
* The comment
|
|
2178
|
+
* The comment, tracked change or carded custom node the caret is in, as the painted bands
|
|
2179
|
+
* report it. A custom node without `reviewCard` is never the answer: it has no card.
|
|
2052
2180
|
*
|
|
2053
2181
|
* ONE source for "which item is open". The band under the text and the card beside it are
|
|
2054
2182
|
* two views of the same answer, and deriving it twice let them disagree — the card closed
|
|
@@ -2401,6 +2529,68 @@ type CustomFontsResolver = MarkedFontResolver<(request: FontResolutionRequest) =
|
|
|
2401
2529
|
*/
|
|
2402
2530
|
declare function customFonts(options: CustomFontsOptions): CustomFontsResolver;
|
|
2403
2531
|
|
|
2532
|
+
/**
|
|
2533
|
+
* A row that runs one chrome slot.
|
|
2534
|
+
*
|
|
2535
|
+
* @public
|
|
2536
|
+
*/
|
|
2537
|
+
interface ChromeMenuItemEntry {
|
|
2538
|
+
readonly kind: 'item';
|
|
2539
|
+
readonly slot: ChromeSlotId;
|
|
2540
|
+
/**
|
|
2541
|
+
* Plain-label override for this row.
|
|
2542
|
+
*
|
|
2543
|
+
* A slot's own `labelKey` is a TOOLTIP key, and several of them fold the shortcut into
|
|
2544
|
+
* the text (`formattingBar.boldShortcut` is "Bold (Ctrl+B)"). A menu puts the shortcut
|
|
2545
|
+
* in its own right-hand column, so the row needs the bare noun. Both keys already exist
|
|
2546
|
+
* in the catalogue — this points at the plain one rather than minting a duplicate.
|
|
2547
|
+
*/
|
|
2548
|
+
readonly labelKey?: string;
|
|
2549
|
+
/** i18n key of the shortcut shown right-aligned on the row (`toolbar.saveShortcut`). */
|
|
2550
|
+
readonly shortcutKey?: string;
|
|
2551
|
+
/**
|
|
2552
|
+
* The row opens a size PICKER instead of firing on click — Word's insert-table grid.
|
|
2553
|
+
* The slot still owns the label, the icon and the enabled state; only the dispatch
|
|
2554
|
+
* differs, and the picked size is what the host sends.
|
|
2555
|
+
*/
|
|
2556
|
+
readonly picker?: 'tableGrid';
|
|
2557
|
+
}
|
|
2558
|
+
/**
|
|
2559
|
+
* A row that opens a nested panel of rows (Insert › Break).
|
|
2560
|
+
*
|
|
2561
|
+
* It carries its own label and icon rather than a slot, because a submenu PARENT has no
|
|
2562
|
+
* command: clicking it opens the panel. Giving it a slot would mint a public id for a
|
|
2563
|
+
* control that can never be enabled, and `toolbarCommandState` would have to invent an
|
|
2564
|
+
* answer about it.
|
|
2565
|
+
*
|
|
2566
|
+
* @public
|
|
2567
|
+
*/
|
|
2568
|
+
interface ChromeMenuSubmenuEntry {
|
|
2569
|
+
readonly kind: 'submenu';
|
|
2570
|
+
readonly labelKey: string;
|
|
2571
|
+
readonly paths: readonly string[] | null;
|
|
2572
|
+
readonly items: readonly ChromeMenuEntry[];
|
|
2573
|
+
}
|
|
2574
|
+
/** A horizontal rule between groups of rows. @public */
|
|
2575
|
+
interface ChromeMenuSeparatorEntry {
|
|
2576
|
+
readonly kind: 'separator';
|
|
2577
|
+
}
|
|
2578
|
+
/** One row of a chrome menu. @public */
|
|
2579
|
+
type ChromeMenuEntry = ChromeMenuItemEntry | ChromeMenuSubmenuEntry | ChromeMenuSeparatorEntry;
|
|
2580
|
+
/**
|
|
2581
|
+
* Every menu id, as a literal union. Stable public API; renaming one is a breaking change,
|
|
2582
|
+
* exactly like a group or slot id.
|
|
2583
|
+
*
|
|
2584
|
+
* @public
|
|
2585
|
+
*/
|
|
2586
|
+
type ChromeMenuId = 'file' | 'format' | 'insert' | 'review' | 'help';
|
|
2587
|
+
/** One menu of the menu bar. @public */
|
|
2588
|
+
interface ChromeMenu {
|
|
2589
|
+
readonly id: ChromeMenuId;
|
|
2590
|
+
readonly labelKey: string;
|
|
2591
|
+
readonly entries: readonly ChromeMenuEntry[];
|
|
2592
|
+
}
|
|
2593
|
+
|
|
2404
2594
|
/**
|
|
2405
2595
|
* HOW a control reaches the engine — never WHETHER it is enabled.
|
|
2406
2596
|
*
|
|
@@ -2792,6 +2982,15 @@ declare const CHROME_GROUPS: readonly [{
|
|
|
2792
2982
|
readonly id: 'review';
|
|
2793
2983
|
readonly labelKey: 'formattingBar.commentsAndChanges';
|
|
2794
2984
|
readonly controls: readonly [{
|
|
2985
|
+
readonly id: 'revisionMarkup';
|
|
2986
|
+
readonly shape: 'icon';
|
|
2987
|
+
readonly labelKey: 'revisionMarkup.title';
|
|
2988
|
+
readonly defaultToolbar: false;
|
|
2989
|
+
readonly paths: readonly string[];
|
|
2990
|
+
readonly state: {
|
|
2991
|
+
readonly kind: 'command';
|
|
2992
|
+
};
|
|
2993
|
+
}, {
|
|
2795
2994
|
readonly id: 'simpleMarkup';
|
|
2796
2995
|
readonly shape: 'icon';
|
|
2797
2996
|
readonly labelKey: 'review.simpleMarkup';
|
|
@@ -2889,6 +3088,15 @@ declare const CHROME_GROUPS: readonly [{
|
|
|
2889
3088
|
readonly state: {
|
|
2890
3089
|
readonly kind: 'command';
|
|
2891
3090
|
};
|
|
3091
|
+
}, {
|
|
3092
|
+
readonly id: 'addComment';
|
|
3093
|
+
readonly shape: 'icon';
|
|
3094
|
+
readonly labelKey: 'formattingBar.addComment';
|
|
3095
|
+
readonly defaultToolbar: false;
|
|
3096
|
+
readonly paths: readonly string[];
|
|
3097
|
+
readonly state: {
|
|
3098
|
+
readonly kind: 'command';
|
|
3099
|
+
};
|
|
2892
3100
|
}, {
|
|
2893
3101
|
readonly id: 'authors';
|
|
2894
3102
|
readonly shape: 'dropdown';
|
|
@@ -3188,7 +3396,7 @@ type ChromeGroupId = 'history' | 'zoom' | 'styles' | 'font' | 'text' | 'script'
|
|
|
3188
3396
|
*
|
|
3189
3397
|
* @public
|
|
3190
3398
|
*/
|
|
3191
|
-
type ChromeSlotId = 'history.undo' | 'history.redo' | 'zoom.level' | 'styles.style' | 'font.family' | 'font.size' | 'text.bold' | 'text.italic' | 'text.underline' | 'text.strike' | 'text.color' | 'text.highlight' | 'text.link' | 'script.super' | 'script.sub' | 'alignment.left' | 'alignment.center' | 'alignment.right' | 'alignment.justify' | 'direction.ltr' | 'direction.rtl' | 'list.bullet' | 'list.numbered' | 'list.outdent' | 'list.indent' | 'list.lineSpacing' | 'format.painter' | 'format.clear' | 'review.comments' | 'review.paragraphMarks' | 'review.protectDocument' | 'review.simpleMarkup' | 'review.allMarkup' | 'review.noMarkup' | 'review.original' | 'review.previousChange' | 'review.nextChange' | 'review.acceptAllChanges' | 'review.rejectAllChanges' | 'review.authors' | 'review.editingMode' | 'contentControl.showAll' | 'contentControl.formFill' | 'contentControl.inspector' | 'contentControl.remove' | 'image.insert' | 'image.properties' | 'image.wrap' | 'image.altText' | 'table.insert' | 'table.borderTarget' | 'table.borderColor' | 'table.borderStyle' | 'table.borderWidth' | 'table.cellFill' | 'file.open' | 'file.save' | 'file.exportMarkdown' | 'file.exportPdf' | 'file.print' | 'paragraph.dialog' | 'file.pageSetup' | 'insert.textBox' | 'insert.footnote' | 'insert.endnote' | 'insert.pageNumber' | 'insert.totalPages' | 'insert.sectionPages' | 'insert.pageXofY' | 'insert.pageBreak' | 'insert.sectionBreakNextPage' | 'insert.sectionBreakContinuous' | 'insert.toc';
|
|
3399
|
+
type ChromeSlotId = 'history.undo' | 'history.redo' | 'zoom.level' | 'styles.style' | 'font.family' | 'font.size' | 'text.bold' | 'text.italic' | 'text.underline' | 'text.strike' | 'text.color' | 'text.highlight' | 'text.link' | 'script.super' | 'script.sub' | 'alignment.left' | 'alignment.center' | 'alignment.right' | 'alignment.justify' | 'direction.ltr' | 'direction.rtl' | 'list.bullet' | 'list.numbered' | 'list.outdent' | 'list.indent' | 'list.lineSpacing' | 'format.painter' | 'format.clear' | 'review.revisionMarkup' | 'review.comments' | 'review.addComment' | 'review.paragraphMarks' | 'review.protectDocument' | 'review.simpleMarkup' | 'review.allMarkup' | 'review.noMarkup' | 'review.original' | 'review.previousChange' | 'review.nextChange' | 'review.acceptAllChanges' | 'review.rejectAllChanges' | 'review.authors' | 'review.editingMode' | 'contentControl.showAll' | 'contentControl.formFill' | 'contentControl.inspector' | 'contentControl.remove' | 'image.insert' | 'image.properties' | 'image.wrap' | 'image.altText' | 'table.insert' | 'table.borderTarget' | 'table.borderColor' | 'table.borderStyle' | 'table.borderWidth' | 'table.cellFill' | 'file.open' | 'file.save' | 'file.exportMarkdown' | 'file.exportPdf' | 'file.print' | 'paragraph.dialog' | 'file.pageSetup' | 'insert.textBox' | 'insert.footnote' | 'insert.endnote' | 'insert.pageNumber' | 'insert.totalPages' | 'insert.sectionPages' | 'insert.pageXofY' | 'insert.pageBreak' | 'insert.sectionBreakNextPage' | 'insert.sectionBreakContinuous' | 'insert.toc';
|
|
3192
3400
|
/**
|
|
3193
3401
|
* Every control id in the chrome, as a literal union. Unique WITHIN a group, not
|
|
3194
3402
|
* globally (`image.insert` / `table.insert`) — key consumers on {@link ChromeSlotId}.
|
|
@@ -3227,67 +3435,7 @@ declare function defaultChromeGroups(): readonly ChromeGroup[];
|
|
|
3227
3435
|
* @public
|
|
3228
3436
|
*/
|
|
3229
3437
|
declare function formattingBarChromeGroups(image: ImageContext | null): readonly ChromeGroup[];
|
|
3230
|
-
|
|
3231
|
-
* A row that runs one chrome slot.
|
|
3232
|
-
*
|
|
3233
|
-
* @public
|
|
3234
|
-
*/
|
|
3235
|
-
interface ChromeMenuItemEntry {
|
|
3236
|
-
readonly kind: 'item';
|
|
3237
|
-
readonly slot: ChromeSlotId;
|
|
3238
|
-
/**
|
|
3239
|
-
* Plain-label override for this row.
|
|
3240
|
-
*
|
|
3241
|
-
* A slot's own `labelKey` is a TOOLTIP key, and several of them fold the shortcut into
|
|
3242
|
-
* the text (`formattingBar.boldShortcut` is "Bold (Ctrl+B)"). A menu puts the shortcut
|
|
3243
|
-
* in its own right-hand column, so the row needs the bare noun. Both keys already exist
|
|
3244
|
-
* in the catalogue — this points at the plain one rather than minting a duplicate.
|
|
3245
|
-
*/
|
|
3246
|
-
readonly labelKey?: string;
|
|
3247
|
-
/** i18n key of the shortcut shown right-aligned on the row (`toolbar.saveShortcut`). */
|
|
3248
|
-
readonly shortcutKey?: string;
|
|
3249
|
-
/**
|
|
3250
|
-
* The row opens a size PICKER instead of firing on click — Word's insert-table grid.
|
|
3251
|
-
* The slot still owns the label, the icon and the enabled state; only the dispatch
|
|
3252
|
-
* differs, and the picked size is what the host sends.
|
|
3253
|
-
*/
|
|
3254
|
-
readonly picker?: 'tableGrid';
|
|
3255
|
-
}
|
|
3256
|
-
/**
|
|
3257
|
-
* A row that opens a nested panel of rows (Insert › Break).
|
|
3258
|
-
*
|
|
3259
|
-
* It carries its own label and icon rather than a slot, because a submenu PARENT has no
|
|
3260
|
-
* command: clicking it opens the panel. Giving it a slot would mint a public id for a
|
|
3261
|
-
* control that can never be enabled, and `toolbarCommandState` would have to invent an
|
|
3262
|
-
* answer about it.
|
|
3263
|
-
*
|
|
3264
|
-
* @public
|
|
3265
|
-
*/
|
|
3266
|
-
interface ChromeMenuSubmenuEntry {
|
|
3267
|
-
readonly kind: 'submenu';
|
|
3268
|
-
readonly labelKey: string;
|
|
3269
|
-
readonly paths: readonly string[] | null;
|
|
3270
|
-
readonly items: readonly ChromeMenuEntry[];
|
|
3271
|
-
}
|
|
3272
|
-
/** A horizontal rule between groups of rows. @public */
|
|
3273
|
-
interface ChromeMenuSeparatorEntry {
|
|
3274
|
-
readonly kind: 'separator';
|
|
3275
|
-
}
|
|
3276
|
-
/** One row of a chrome menu. @public */
|
|
3277
|
-
type ChromeMenuEntry = ChromeMenuItemEntry | ChromeMenuSubmenuEntry | ChromeMenuSeparatorEntry;
|
|
3278
|
-
/**
|
|
3279
|
-
* Every menu id, as a literal union. Stable public API; renaming one is a breaking change,
|
|
3280
|
-
* exactly like a group or slot id.
|
|
3281
|
-
*
|
|
3282
|
-
* @public
|
|
3283
|
-
*/
|
|
3284
|
-
type ChromeMenuId = 'file' | 'format' | 'insert' | 'review' | 'help';
|
|
3285
|
-
/** One menu of the menu bar. @public */
|
|
3286
|
-
interface ChromeMenu {
|
|
3287
|
-
readonly id: ChromeMenuId;
|
|
3288
|
-
readonly labelKey: string;
|
|
3289
|
-
readonly entries: readonly ChromeMenuEntry[];
|
|
3290
|
-
}
|
|
3438
|
+
|
|
3291
3439
|
/**
|
|
3292
3440
|
* The menu bar the chrome shows above the toolbar, in bar order: File, Format, Insert, Review,
|
|
3293
3441
|
* Help.
|
|
@@ -3619,6 +3767,13 @@ declare function bindHistoryGroup(editor: Editor, element: HTMLElement, config:
|
|
|
3619
3767
|
|
|
3620
3768
|
/** File menu conversion formats. @public */
|
|
3621
3769
|
type ChromeExportFormat = 'markdown' | 'pdf';
|
|
3770
|
+
/** Viewer settings captured before PDF conversion. @public */
|
|
3771
|
+
interface ChromeExportView {
|
|
3772
|
+
readonly displayMode: ReviewDisplayMode;
|
|
3773
|
+
readonly revisionMarkup: ResolvedRevisionMarkup;
|
|
3774
|
+
/** Stable session slots, including gaps left by removed authors. */
|
|
3775
|
+
readonly revisionAuthorSlots?: Readonly<Record<string, number>>;
|
|
3776
|
+
}
|
|
3622
3777
|
/**
|
|
3623
3778
|
* Conversion handlers for File > Export. Install the corresponding converter package.
|
|
3624
3779
|
* Use `exportMarkdown` for Markdown. PDF requires `exportPdf` on a Node.js server.
|
|
@@ -3631,7 +3786,7 @@ interface ChromeExportHandlers {
|
|
|
3631
3786
|
readonly markdown: string;
|
|
3632
3787
|
}>;
|
|
3633
3788
|
/** Returns PDF bytes from `@docx-editor.dev/docx-to-pdf` on Node.js. */
|
|
3634
|
-
readonly pdf?: (source: Uint8Array) => Promise<{
|
|
3789
|
+
readonly pdf?: (source: Uint8Array, view?: ChromeExportView) => Promise<{
|
|
3635
3790
|
readonly bytes: Uint8Array;
|
|
3636
3791
|
}>;
|
|
3637
3792
|
}
|
|
@@ -3652,7 +3807,7 @@ declare class ChromeExportError extends Error {
|
|
|
3652
3807
|
* Missing handlers fail before saving. Conversion never changes the editor document.
|
|
3653
3808
|
* @public
|
|
3654
3809
|
*/
|
|
3655
|
-
declare function runChromeExport(editor: Pick<Editor, 'save'
|
|
3810
|
+
declare function runChromeExport(editor: Pick<Editor, 'save'> & Partial<Pick<DocxEditorInstance, 'snapshot' | 'getReviewAuthors'>>, format: ChromeExportFormat, handlers?: ChromeExportHandlers): Promise<ChromeExportResult>;
|
|
3656
3811
|
|
|
3657
3812
|
/** Why the browser could not print the converted PDF. @public */
|
|
3658
3813
|
type ChromePrintErrorCode = 'pdf-viewer-unavailable' | 'pdf-load-failed' | 'print-refused' | 'print-ended';
|
|
@@ -3708,7 +3863,7 @@ interface ChromePrintJob {
|
|
|
3708
3863
|
* pass an element inside that dialog.
|
|
3709
3864
|
* @public
|
|
3710
3865
|
*/
|
|
3711
|
-
declare function runChromePrint(editor: Pick<Editor, 'save'
|
|
3866
|
+
declare function runChromePrint(editor: Pick<Editor, 'save'> & Partial<Pick<Editor, 'snapshot'>>, handlers?: ChromeExportHandlers, container?: Document | Element): Promise<ChromePrintJob>;
|
|
3712
3867
|
|
|
3713
|
-
export { CHROME_GROUPS as C, DEFAULT_TABLE_CHROME_DRAFT as
|
|
3714
|
-
export type {
|
|
3868
|
+
export { IMAGE_OVERLAY_NUDGE_SHIFT_PT as $, CHROME_GROUPS as C, DEFAULT_TABLE_CHROME_DRAFT as F, EMU_PER_POINT as I, IMAGE_OVERLAY_NUDGE_PT as _, createFontSource as a$, applyTableChromePick as aJ, bindHistoryGroup as aK, blankDocumentBytes as aL, canExecuteImageCommand as aM, captureImageMutationPreconditions as aN, chromeControlCount as aO, chromeMenuSlots as aP, chromeProbeForSlot as aQ, chromeSlotId as aR, chromeSlotIsToggle as aS, commandExecOptions as aT, commandForSlot as aU, commandForSlotValue as aV, commandForTableChromeSlotValue as aW, computeImageResizeResult as aX, computeMovedImagePosition as aY, computeResizedImageExtentEmu as aZ, createDocxEditor as a_, TABLE_BORDER_STYLE_OPTIONS as ar, TABLE_BORDER_TARGET_OPTIONS as as, TABLE_BORDER_WIDTH_OPTIONS as at, TABLE_CHROME_SLOT_IDS as au, CHROME_MENUS as b, createImageOverlayScrollPort as b0, cssPixelsToLayoutPoints as b1, customFonts as b2, defaultChromeGroups as b3, defaultTableLabel as b4, emuToOverlayPoints as b5, equationAtPosition as b6, executeImageCommand as b7, finalizeImageOverlayInteraction as b8, formattingBarChromeGroups as b9, isChromePrintShortcut as ba, isStaleImageInteractionCommit as bb, isTableChromeSlot as bc, layoutPointsToCssPixels as bd, loadFonts as be, overlayFrameToSheetCssPixels as bf, overlayHostOrigin as bg, pointsToEmu as bh, probeTableChromeCommand as bi, resizePreservesAspect as bj, runChromeExport as bk, runChromePrint as bl, runSave as bm, runTableChromeCommand as bn, runTableCommand as bo, runToolbarCommand as bp, selectedDrawingOverlayTargetOf as bq, selectedImageStateOf as br, surfacePaintScale as bs, tableChromeIconPaths as bt, tableChromeLabelKeyForTarget as bu, tableChromeToolbarState as bv, tableChromeVisible as bw, tableCommandToolbarState as bx, toolbarCommandState as by, toolbarCommandStates as bz, CHROME_UNAVAILABLE_KEY as c, ChromeExportError as g, ChromePrintError as t };
|
|
3869
|
+
export type { AnchorFrameOrigin as A, CustomFontsOptions as B, DocxEditorInstance as D, CustomFontsResolver as E, DocxEditorConfig as G, DrawingSelectionIntent as H, EditorCommandExecute as J, EquationActivation as K, EquationChromeHandlers as L, EquationOps as M, FinalizedImageOverlayInteraction as N, OpenPaginatedResult as O, PaginatedSurfaceOptions as P, FontLoadFailure as Q, FontLoadFailureReason as R, FontMeasurementState as S, TableCommandPlan as T, FontUrlSource as U, HistoryGroupBinding as V, HistoryGroupBindingOptions as W, HyperlinkActivation as X, HyperlinkChromeHandlers as Y, HyperlinkOps as Z, PaginatedSurface as a, ImageInteractionSession as a0, ImageOverlayScrollPort as a1, ImageResizeHandle as a2, ImageResizeResult as a3, InvalidTextFormFieldChromeHandlers as a4, InvalidTextFormFieldSession as a5, LoadFontsRequest as a6, LoadFontsResult as a7, OpeningIndicatorHost as a8, OverlayFrameRect as a9, TableChromePick as aA, TableChromeSlotId as aB, TableInteractionLabelKey as aC, TextFormFieldChromeHandlers as aD, TextFormFieldDialogSession as aE, ToolbarCommandState as aF, ToolbarSlotValue as aG, ToolbarValueMap as aH, ToolbarValueSlot as aI, PaginatedSurfaceState as aa, ParagraphPropertyEdit as ab, PopupChromeRegistrationOptions as ac, RemoteCaretLabelAnchor as ad, RemoteCaretLabelHost as ae, ReviewWriteIntent as af, RunTableChromeCommandResult as ag, SectionAnchor as ah, SectionBreakInsertType as ai, SelectedDrawingOverlayTarget as aj, SurfaceEquation as ak, SurfaceFormatting as al, SurfaceHyperlink as am, SurfaceInsertImageInput as an, SurfaceNavigation as ao, SurfaceOverlayCoordinates as ap, SurfaceParagraphFormat as aq, TableBorderStyleOption as av, TableBorderTargetOption as aw, TableBorderTargetValue as ax, TableBorderWidthOption as ay, TableChromeDraft as az, ChromeControl as d, ChromeControlId as e, ChromeControlState as f, ChromeExportFormat as h, ChromeExportHandlers as i, ChromeExportResult as j, ChromeExportView as k, ChromeGroup as l, ChromeGroupId as m, ChromeMenu as n, ChromeMenuEntry as o, ChromeMenuId as p, ChromeMenuItemEntry as q, ChromeMenuSeparatorEntry as r, ChromeMenuSubmenuEntry as s, ChromePrintErrorCode as u, ChromePrintJob as v, ChromePrintOptions as w, ChromeSlotId as x, ContentControlWidgetChromeHandlers as y, ContentControlWidgetSession as z };
|
package/dist/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';var
|
|
1
|
+
'use strict';var chunkRCHS4ZEH_cjs=require('./chunk-RCHS4ZEH.cjs');require('./chunk-NBCVVZOM.cjs'),require('./chunk-EO4C5QJW.cjs');var chunkK5U2PLDP_cjs=require('./chunk-K5U2PLDP.cjs');require('./chunk-6APGXLBB.cjs'),require('./chunk-VX43VBAX.cjs'),require('./chunk-6AWEKBLB.cjs'),require('./chunk-4GBTELJV.cjs'),require('./chunk-SRPILEWV.cjs'),require('./chunk-QMLCVPCD.cjs'),require('./chunk-ZUHOMK52.cjs'),require('./chunk-O2AL2HSJ.cjs'),require('./chunk-JGNVNT2A.cjs'),require('./chunk-BTQKU64Q.cjs'),require('./chunk-2GO5T2JU.cjs'),require('./chunk-FIJZIQXA.cjs'),require('./chunk-UKVVUHZL.cjs');Object.defineProperty(exports,"CHROME_GROUPS",{enumerable:true,get:function(){return chunkRCHS4ZEH_cjs.Ta}});Object.defineProperty(exports,"CHROME_MENUS",{enumerable:true,get:function(){return chunkRCHS4ZEH_cjs.Xa}});Object.defineProperty(exports,"ChromeExportError",{enumerable:true,get:function(){return chunkRCHS4ZEH_cjs.nc}});Object.defineProperty(exports,"ChromePrintError",{enumerable:true,get:function(){return chunkRCHS4ZEH_cjs.pc}});Object.defineProperty(exports,"bindHistoryGroup",{enumerable:true,get:function(){return chunkRCHS4ZEH_cjs.dc}});Object.defineProperty(exports,"blankDocumentBytes",{enumerable:true,get:function(){return chunkRCHS4ZEH_cjs.g}});Object.defineProperty(exports,"chromeMenuSlots",{enumerable:true,get:function(){return chunkRCHS4ZEH_cjs.Ya}});Object.defineProperty(exports,"commandForSlot",{enumerable:true,get:function(){return chunkRCHS4ZEH_cjs.ma}});Object.defineProperty(exports,"commandForSlotValue",{enumerable:true,get:function(){return chunkRCHS4ZEH_cjs.oa}});Object.defineProperty(exports,"createDocxEditor",{enumerable:true,get:function(){return chunkRCHS4ZEH_cjs.Bb}});Object.defineProperty(exports,"createFontSource",{enumerable:true,get:function(){return chunkRCHS4ZEH_cjs.l}});Object.defineProperty(exports,"customFonts",{enumerable:true,get:function(){return chunkRCHS4ZEH_cjs.m}});Object.defineProperty(exports,"isChromePrintShortcut",{enumerable:true,get:function(){return chunkRCHS4ZEH_cjs.qc}});Object.defineProperty(exports,"loadFonts",{enumerable:true,get:function(){return chunkRCHS4ZEH_cjs.k}});Object.defineProperty(exports,"runChromeExport",{enumerable:true,get:function(){return chunkRCHS4ZEH_cjs.oc}});Object.defineProperty(exports,"runChromePrint",{enumerable:true,get:function(){return chunkRCHS4ZEH_cjs.rc}});Object.defineProperty(exports,"runToolbarCommand",{enumerable:true,get:function(){return chunkRCHS4ZEH_cjs.ua}});Object.defineProperty(exports,"toolbarCommandState",{enumerable:true,get:function(){return chunkRCHS4ZEH_cjs.qa}});Object.defineProperty(exports,"DEFAULT_FONT",{enumerable:true,get:function(){return chunkK5U2PLDP_cjs.d}});Object.defineProperty(exports,"FONT_RESOLVER_BRAND",{enumerable:true,get:function(){return chunkK5U2PLDP_cjs.i}});Object.defineProperty(exports,"FONT_RESOLVER_MARK_KEY",{enumerable:true,get:function(){return chunkK5U2PLDP_cjs.h}});Object.defineProperty(exports,"WORD_DEFAULT_FONT",{enumerable:true,get:function(){return chunkK5U2PLDP_cjs.e}});Object.defineProperty(exports,"composeFontConfiguration",{enumerable:true,get:function(){return chunkK5U2PLDP_cjs.f}});Object.defineProperty(exports,"composeFontOrigins",{enumerable:true,get:function(){return chunkK5U2PLDP_cjs.n}});Object.defineProperty(exports,"defineFontResolver",{enumerable:true,get:function(){return chunkK5U2PLDP_cjs.j}});Object.defineProperty(exports,"isFontResolver",{enumerable:true,get:function(){return chunkK5U2PLDP_cjs.k}});
|