@docx-editor.dev/core 2.30.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 +16 -25
- package/dist/automation.js +1 -1
- package/dist/binding.cjs +1 -1
- package/dist/binding.d.ts +15 -16
- package/dist/binding.js +1 -1
- package/dist/bookmark-names-DDuAra_V.d.ts +37 -0
- package/dist/{chrome-print-BM3Js-6X.d.ts → chrome-print-BWvaVEhD.d.ts} +318 -33
- package/dist/chunk-243W4WW2.cjs +2 -0
- package/dist/{chunk-RJCQGJR7.js → chunk-2E2RPEKX.js} +1 -1
- package/dist/chunk-4S24UOPG.js +30 -0
- package/dist/chunk-5JPIEN54.cjs +3 -0
- package/dist/{chunk-KJRTNY2Q.cjs → chunk-5SO5QDMV.cjs} +1 -1
- package/dist/{chunk-WF7JZ755.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-HYASLE2G.cjs → chunk-HC6YNKUI.cjs} +1 -1
- package/dist/chunk-HZ66UCIS.js +2 -0
- package/dist/{chunk-5RRAZMBU.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-YZGUBCHP.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-T32MGBJS.js → chunk-VWIJKH4A.js} +1 -1
- package/dist/chunk-WO4V6PNS.cjs +18 -0
- package/dist/chunk-XMJKFURD.cjs +4 -0
- package/dist/{chunk-FLBEJC6X.cjs → chunk-XSTGE3NI.cjs} +1 -1
- package/dist/chunk-YQWMI6J5.cjs +7 -0
- package/dist/{chunk-WPDD2Y32.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-0v0Kgw1T.d.ts → custom-node-writes-TeUvMP13.d.ts} +2 -2
- package/dist/{diagnostic-context-CcAO4q1s.d.ts → diagnostic-context-DJ0P1uZE.d.ts} +3 -2
- package/dist/{diagnostic-hints-2Bke6H_w.d.ts → diagnostic-hints-C9JlLz1L.d.ts} +1 -1
- package/dist/{document-protection-8eyMWIJ0.d.ts → document-protection-C8x3P2J6.d.ts} +1 -1
- package/dist/{editor-DaEJd2so.d.ts → editor-B2ShlO23.d.ts} +292 -50
- 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 +602 -31
- package/dist/editor.js +1 -1
- package/dist/export.cjs +2 -2
- package/dist/export.d.ts +13 -14
- package/dist/export.js +2 -2
- package/dist/{font-resolver-CL9BVKZo.d.ts → font-resolver-CWh40DYp.d.ts} +1 -1
- package/dist/{headless-document-view-DZQN8Bnx.d.ts → headless-document-view-qOpaCF82.d.ts} +2 -2
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +22 -23
- package/dist/index.js +1 -1
- package/dist/{layout-shaping-cEnVrhWg.d.ts → layout-shaping-CWS3j0Xr.d.ts} +1 -1
- package/dist/layout.cjs +1 -1
- package/dist/layout.d.ts +87 -22
- package/dist/layout.js +1 -1
- package/dist/{note-properties-9FH8zAeG.d.ts → note-properties-QsKh24sM.d.ts} +1 -1
- package/dist/{omml-equation-DP2WpUbK.d.ts → omml-equation-BsLAa2lX.d.ts} +27 -9
- package/dist/output.cjs +1 -1
- package/dist/output.d.ts +20 -10
- package/dist/output.js +1 -1
- package/dist/{protocol-CZ1uUlPO.d.ts → protocol-COZJUKUY.d.ts} +94 -2
- package/dist/{review-paragraph-order-CqVelc5A.d.ts → review-paragraph-order-C_QbCKcH.d.ts} +1 -1
- package/dist/{semantic-cell-selection-Dr9yxFZt.d.ts → semantic-cell-selection-Cub9FDa8.d.ts} +2 -2
- package/dist/{semantic-interaction-Dc3pf3hr.d.ts → semantic-interaction-dApRIYpt.d.ts} +1 -1
- package/dist/{semantic-paint-Bz3FBAoH.d.ts → semantic-paint-DLzA8sjP.d.ts} +3 -3
- package/dist/{semantic-record-queries-Bx0pl6kL.d.ts → semantic-record-queries-3yp9o11g.d.ts} +1 -1
- package/dist/{semantic-records-CjcF26ZL.d.ts → semantic-records-B-akgRch.d.ts} +130 -87
- package/dist/store.cjs +1 -1
- package/dist/store.d.ts +48 -22
- package/dist/store.js +1 -1
- package/dist/{tree-package-store-DKhdEVym.d.ts → tree-package-store-B8l8DX3Z.d.ts} +675 -645
- package/dist/{tree-session-contract-CwnTEVLF.d.ts → tree-session-contract-DeLRqohz.d.ts} +26 -13
- package/dist/{types-barrel-CA0xB8kH.d.ts → types-barrel-CkF2JbU4.d.ts} +1146 -745
- package/package.json +2 -2
- package/dist/chunk-2PV5L5NJ.js +0 -5
- package/dist/chunk-5OTS2EJ7.js +0 -7
- package/dist/chunk-5P4223J4.cjs +0 -27
- package/dist/chunk-5SPITS5F.js +0 -18
- package/dist/chunk-7ATNKARV.js +0 -2
- package/dist/chunk-BGCUTKWE.cjs +0 -5
- package/dist/chunk-EBCXSH2W.js +0 -3
- package/dist/chunk-ERECKTIR.cjs +0 -2
- package/dist/chunk-JC47NRJC.cjs +0 -3
- package/dist/chunk-NKPUH3QJ.js +0 -1
- package/dist/chunk-PF5NJWS3.js +0 -2
- package/dist/chunk-PWTRJSES.cjs +0 -18
- package/dist/chunk-QFKGI242.cjs +0 -30
- package/dist/chunk-RPPV4S6T.cjs +0 -4
- package/dist/chunk-UM26GH5B.js +0 -30
- package/dist/chunk-VRCZBFLH.js +0 -27
- package/dist/chunk-WK5X2MMA.cjs +0 -7
- package/dist/chunk-YBMWBXST.cjs +0 -2
- package/dist/chunk-ZOS2PM4A.js +0 -4
- package/dist/image-resources-Bipz8toD.d.ts +0 -211
package/dist/editor.d.ts
CHANGED
|
@@ -9,41 +9,42 @@
|
|
|
9
9
|
* @packageDocumentation
|
|
10
10
|
* @public
|
|
11
11
|
*/
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
export {
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
export { a as TreeApplyResult } from './tree-session-contract-CwnTEVLF.js';
|
|
12
|
+
import { O as OoxmlPart, aU as TreeDocColorValue, r as ColorValue, _ as DrawingPositionInput, A as ParagraphTabStop, al as Watermark } from './types-barrel-CkF2JbU4.js';
|
|
13
|
+
export { aV as DEFAULT_IMAGE_RESOURCE_LIMITS, aW as IMAGE_WRAP_TARGETS, aE as ImageDecodePort, aD as ImageResourceLimits, a2 as ImageWrapTarget, z as ParagraphFlags, aa as RenderableImageMime, R as ReviewModelInput, af as SupportedImageMime, aX as TEXT_FORM_FORMATS, ak as VectorImageMime, aY as resolveImageResourceLimits, aZ as resolveSvgIntrinsicSize, a_ as sniffImageMime, a$ as validateRasterHeader } from './types-barrel-CkF2JbU4.js';
|
|
14
|
+
export { C as ContentLockPolicy, F as FieldResultsMode } from './tree-package-store-B8l8DX3Z.js';
|
|
15
|
+
import { T as TreeDocxSessionView, f as DocumentThemeColorEntry } from './tree-session-contract-DeLRqohz.js';
|
|
16
|
+
export { a as TreeApplyResult } from './tree-session-contract-DeLRqohz.js';
|
|
18
17
|
export { CollectReviewItems, EditorModule, EditorModuleRegistry, ReviewModuleContribution, RevisionMarkupDialog, RevisionMarkupDialogHost, resolveEditorModules } from './contracts/modules.js';
|
|
19
18
|
import { F as FontShapingOptions } from './font-shaping-policy-BvpkrfxM.js';
|
|
20
|
-
import {
|
|
21
|
-
export {
|
|
22
|
-
import { L as LayoutShapingInstrumentation, a as LayoutShapingOptions } from './layout-shaping-
|
|
23
|
-
export { d as disposeLayoutShaping } from './layout-shaping-
|
|
24
|
-
export { C as ComposeFontOriginsOptions, D as DEFAULT_FONT, F as FONT_RESOLVER_BRAND, a as FONT_RESOLVER_MARK_KEY, b as FontConfigurationBase, c as FontConfigurationFragment, d as FontOrigin, e as FontOriginFailure, f as FontResolutionRequest, g as FontResolver, h as FontResolverMark, m as MAX_RESOLVER_FAMILIES, M as MarkedFontResolver, W as WORD_DEFAULT_FONT, i as composeFontConfiguration, j as composeFontOrigins, k as defineFontResolver, l as isFontResolver } from './font-resolver-
|
|
25
|
-
import {
|
|
26
|
-
export {
|
|
27
|
-
import { a as AutomationCapabilities, b as AutomationHost } from './protocol-
|
|
28
|
-
import {
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
export {
|
|
19
|
+
import { Z as FontConfiguration, J as EditorFontError, Y as EditorSnapshot, x as Editor, b as EditorCommand, C as CanResult, aV as ZoomMode, aW as ReviewPaneOverflow, g as ClearAnchorHighlightOptions, c as AnchorHighlightOptions, aB as ScrollToAnchorOptions, aA as ScrollPlacement, A as AnchorHighlightAnimation, aa as HighlightRange, ac as HighlightResult, a9 as HighlightOptions, aQ as TextMatch, f as BookmarkSummary, B as BookmarkPlace } from './editor-B2ShlO23.js';
|
|
20
|
+
export { aX as CommentMarkerStyle, aY as DEFAULT_REVIEW_PANE, a8 as HighlightHit, ab as HighlightRect, af as ImageContext, ag as ImageCropPercent, aZ as ImageCropPermille, a_ as ResolvedReviewPane, as as ReviewItemHit, a$ as ReviewPaneItemFields, b0 as ReviewPaneOpening, R as ReviewPaneOptions, b1 as RevisionDisplay, aC as SelectedImageState, aS as TrackedChangeFilterMode, aT as TrackedChangePredicate, b2 as cropPercentFromCropPermille, b3 as cropPercentFromPermille, b4 as cropPercentFromSourceCrop, b5 as cropPermilleFromCropPercent, b6 as cropPermilleFromPercent, b7 as resolveReviewPane, b8 as reviewPaneListsItem, b9 as sourceCropFromCropPercent, ba as validateImageCropPercent } from './editor-B2ShlO23.js';
|
|
21
|
+
import { L as LayoutShapingInstrumentation, a as LayoutShapingOptions } from './layout-shaping-CWS3j0Xr.js';
|
|
22
|
+
export { d as disposeLayoutShaping } from './layout-shaping-CWS3j0Xr.js';
|
|
23
|
+
export { C as ComposeFontOriginsOptions, D as DEFAULT_FONT, F as FONT_RESOLVER_BRAND, a as FONT_RESOLVER_MARK_KEY, b as FontConfigurationBase, c as FontConfigurationFragment, d as FontOrigin, e as FontOriginFailure, f as FontResolutionRequest, g as FontResolver, h as FontResolverMark, m as MAX_RESOLVER_FAMILIES, M as MarkedFontResolver, W as WORD_DEFAULT_FONT, i as composeFontConfiguration, j as composeFontOrigins, k as defineFontResolver, l as isFontResolver } from './font-resolver-CWh40DYp.js';
|
|
24
|
+
import { _ as PaginatedSurfaceOptions, $ as OpenPaginatedResult, a0 as PaginatedSurface, a1 as TableCommandPlan, u as DocxEditorInstance, a2 as SurfaceFormatting } from './chrome-print-BWvaVEhD.js';
|
|
25
|
+
export { a3 as AnchorFrameOrigin, a4 as AttachOptions, a5 as BookmarkChromeHandlers, B as BookmarkMarkInfo, a as BookmarkMarkOptions, a6 as BookmarkMarkOptionsSource, C as CHROME_GROUPS, b as CHROME_MENUS, a7 as CHROME_UNAVAILABLE_KEY, a8 as ChromeControl, a9 as ChromeControlId, aa as ChromeControlState, c as ChromeExportError, d as ChromeExportFormat, e as ChromeExportHandlers, f as ChromeExportResult, ab as ChromeExportView, ac as ChromeGroup, ad as ChromeGroupId, g as ChromeMenu, h as ChromeMenuEntry, i as ChromeMenuId, j as ChromeMenuItemEntry, k as ChromeMenuSeparatorEntry, l as ChromeMenuSubmenuEntry, m as ChromePrintError, n as ChromePrintErrorCode, o as ChromePrintJob, p as ChromePrintOptions, q as ChromeSlotId, r as CommentDraftChromeHandlers, ae as ContentControlWidgetChromeHandlers, af as ContentControlWidgetSession, s as CustomFontsOptions, t as CustomFontsResolver, ag as DEFAULT_TABLE_CHROME_DRAFT, D as DocxEditorConfig, ah as DrawingSelectionIntent, ai as EMU_PER_POINT, aj as EditorCommandExecute, ak as EquationActivation, al as EquationChromeHandlers, am as EquationOps, an as FinalizedImageOverlayInteraction, F as FontLoadFailure, v as FontLoadFailureReason, w as FontMeasurementState, x as FontUrlSource, G as GoToChromeHandlers, H as HistoryGroupBinding, y as HistoryGroupBindingOptions, z as HyperlinkActivation, A as HyperlinkChromeHandlers, ao as HyperlinkOps, ap as IMAGE_OVERLAY_NUDGE_PT, aq as IMAGE_OVERLAY_NUDGE_SHIFT_PT, ar as ImageInteractionSession, as as ImageOverlayScrollPort, at as ImageResizeHandle, au as ImageResizeResult, av as InvalidTextFormFieldChromeHandlers, aw as InvalidTextFormFieldSession, L as LoadFontsRequest, E as LoadFontsResult, I as LockedControlNavigation, ax as OpeningIndicatorHost, ay as OverlayFrameRect, az as PaginatedSurfaceState, aA as ParagraphPropertyEdit, aB as PopupChromeRegistrationOptions, aC as RemoteCaretLabelAnchor, aD as RemoteCaretLabelHost, aE as ReviewWriteIntent, aF as RunTableChromeCommandResult, aG as SectionAnchor, aH as SectionBreakInsertType, aI as SelectedDrawingOverlayTarget, aJ as SurfaceEquation, S as SurfaceHyperlink, aK as SurfaceInsertImageInput, aL as SurfaceNavigation, aM as SurfaceOverlayCoordinates, aN as SurfaceParagraphFormat, aO as TABLE_BORDER_STYLE_OPTIONS, aP as TABLE_BORDER_TARGET_OPTIONS, aQ as TABLE_BORDER_WIDTH_OPTIONS, aR as TABLE_CHROME_SLOT_IDS, aS as TableBorderStyleOption, aT as TableBorderTargetOption, aU as TableBorderTargetValue, aV as TableBorderWidthOption, aW as TableChromeDraft, aX as TableChromePick, aY as TableChromeSlotId, aZ as TableInteractionLabelKey, a_ as TextFormFieldChromeHandlers, a$ as TextFormFieldDialogSession, T as ToolbarCommandState, b0 as ToolbarSlotValue, b1 as ToolbarValueMap, b2 as ToolbarValueSlot, b3 as applyTableChromePick, J as bindHistoryGroup, K as blankDocumentBytes, b4 as canExecuteImageCommand, b5 as captureImageMutationPreconditions, b6 as chromeControlCount, M as chromeMenuSlots, b7 as chromeProbeForSlot, b8 as chromeSlotId, b9 as chromeSlotIsToggle, ba as commandExecOptions, N as commandForSlot, O as commandForSlotValue, bb as commandForTableChromeSlotValue, bc as computeImageResizeResult, bd as computeMovedImagePosition, be as computeResizedImageExtentEmu, P as createDocxEditor, Q as createFontSource, bf as createImageOverlayScrollPort, bg as cssPixelsToLayoutPoints, R as customFonts, bh as defaultChromeGroups, bi as defaultTableLabel, bj as emuToOverlayPoints, bk as equationAtPosition, bl as executeImageCommand, bm as finalizeImageOverlayInteraction, bn as formattingBarChromeGroups, U as isChromePrintShortcut, bo as isStaleImageInteractionCommit, bp as isTableChromeSlot, bq as layoutPointsToCssPixels, V as loadFonts, br as overlayFrameToSheetCssPixels, bs as overlayHostOrigin, bt as pointsToEmu, bu as probeTableChromeCommand, bv as resizePreservesAspect, W as runChromeExport, X as runChromePrint, bw as runSave, bx as runTableChromeCommand, by as runTableCommand, Y as runToolbarCommand, bz as selectedDrawingOverlayTargetOf, bA as selectedImageStateOf, bB as surfacePaintScale, bC as tableChromeIconPaths, bD as tableChromeLabelKeyForTarget, bE as tableChromeToolbarState, bF as tableChromeVisible, bG as tableCommandToolbarState, Z as toolbarCommandState, bH as toolbarCommandStates } from './chrome-print-BWvaVEhD.js';
|
|
26
|
+
import { a as AutomationCapabilities, b as AutomationHost, d as AutomationBatchRequest, e as AutomationBatchResponse } from './protocol-COZJUKUY.js';
|
|
27
|
+
import { b as HistoryGroup } from './editor-scope-C7ke1KJG.js';
|
|
28
|
+
export { c as HistoryGroupOptions } from './editor-scope-C7ke1KJG.js';
|
|
29
|
+
import { E as EditDiagnosticCode } from './diagnostic-hints-C9JlLz1L.js';
|
|
30
|
+
import { S as SemanticLayout, T as TextMeasurer } from './semantic-records-B-akgRch.js';
|
|
31
|
+
export { D as DEFAULT_REVISION_MARKUP, w as REVISION_MARKUP_COLORS, q as ResolvedRevisionMarkup, a as ReviewDisplayMode, x as RevisionChangedLinesMark, y as RevisionDeletionMark, z as RevisionMarkupChromeHandlers, E as RevisionMarkupColor, R as RevisionMarkupDialogSession, G as RevisionMarkupMark, J as RevisionMarkupNamedColor, t as RevisionMarkupOptions, K as RevisionMarkupStyle, M as RevisionMarkupTextStyle, O as SectionProperties, Q as resolveRevisionMarkup } from './semantic-records-B-akgRch.js';
|
|
32
|
+
export { N as NavigationCommand, S as SemanticPosition, a as SemanticSelection } from './semantic-interaction-dApRIYpt.js';
|
|
33
|
+
export { F as FieldShadingMode, R as ReviewAuthorInfo, b as RevisionAuthorAssignments, c as RevisionAuthorStyle, d as RevisionStyles } from './semantic-paint-DLzA8sjP.js';
|
|
34
|
+
import { B as BookmarkNameProblem } from './bookmark-names-DDuAra_V.js';
|
|
33
35
|
export { CollaborationModuleContribution } from './collaboration.js';
|
|
34
|
-
import './
|
|
35
|
-
import './
|
|
36
|
-
import './headless-document-view-DZQN8Bnx.js';
|
|
36
|
+
import './custom-node-writes-TeUvMP13.js';
|
|
37
|
+
import './headless-document-view-qOpaCF82.js';
|
|
37
38
|
import 'prosemirror-model';
|
|
38
39
|
import './collaboration/replication.js';
|
|
39
|
-
import './omml-equation-
|
|
40
|
+
import './omml-equation-BsLAa2lX.js';
|
|
41
|
+
import './failure-NS2lsya4.js';
|
|
40
42
|
import './contracts/document.js';
|
|
41
43
|
import './contracts/interaction.js';
|
|
42
|
-
import './document-protection-
|
|
43
|
-
import './
|
|
44
|
-
import './
|
|
45
|
-
import './semantic-
|
|
46
|
-
import './semantic-record-queries-Bx0pl6kL.js';
|
|
44
|
+
import './document-protection-C8x3P2J6.js';
|
|
45
|
+
import './note-properties-QsKh24sM.js';
|
|
46
|
+
import './semantic-cell-selection-Cub9FDa8.js';
|
|
47
|
+
import './semantic-record-queries-3yp9o11g.js';
|
|
47
48
|
|
|
48
49
|
declare function toEditorFontError(error: unknown): EditorFontError;
|
|
49
50
|
declare function createLayoutShaping(configuration: FontConfiguration, instrumentation?: LayoutShapingInstrumentation, execution?: FontShapingOptions): Promise<LayoutShapingOptions>;
|
|
@@ -89,6 +90,299 @@ declare function clipboardPasteLandsContent(transfer: DataTransfer | null | unde
|
|
|
89
90
|
*/
|
|
90
91
|
declare function clipboardDropLandsText(transfer: DataTransfer | null | undefined): boolean;
|
|
91
92
|
|
|
93
|
+
/** Options for {@link openEditorWindow}. @public */
|
|
94
|
+
interface OpenEditorWindowOptions {
|
|
95
|
+
/**
|
|
96
|
+
* A same-origin page to open. Defaults to `about:blank`, which needs no file on your server.
|
|
97
|
+
* A served page (an empty HTML file) gives the window a real URL and lets it load its own
|
|
98
|
+
* scripts or fonts first.
|
|
99
|
+
*/
|
|
100
|
+
readonly url?: string;
|
|
101
|
+
/**
|
|
102
|
+
* The window name passed to `window.open`. Defaults to `docx-editor`. Windows opened with
|
|
103
|
+
* the same name are one browser window, so give each editor its own name.
|
|
104
|
+
*/
|
|
105
|
+
readonly name?: string;
|
|
106
|
+
/** The `window.open` features. Defaults to `popup,width=1000,height=900`. */
|
|
107
|
+
readonly features?: string;
|
|
108
|
+
/** The pop-out's title. */
|
|
109
|
+
readonly title?: string;
|
|
110
|
+
/**
|
|
111
|
+
* Copy the opener's stylesheets, and keep copying the ones it adds later. Defaults to `true`.
|
|
112
|
+
* Pass `false` to style the window yourself, or a function that copies and returns a stop.
|
|
113
|
+
*/
|
|
114
|
+
readonly styles?: boolean | ((from: Document, to: Document) => () => void);
|
|
115
|
+
}
|
|
116
|
+
/** A pop-out window opened by {@link openEditorWindow}. @public */
|
|
117
|
+
interface EditorWindow {
|
|
118
|
+
/** The pop-out window. */
|
|
119
|
+
readonly window: Window;
|
|
120
|
+
/** The mount point: attach the editor, or render the editor panel, here. */
|
|
121
|
+
readonly element: HTMLElement;
|
|
122
|
+
/**
|
|
123
|
+
* Run `listener` once when the window goes away: the user closed it, or you called
|
|
124
|
+
* `close()`. It runs while the window's document still exists, so move the editor back
|
|
125
|
+
* from here. Returns a function that removes the listener.
|
|
126
|
+
*/
|
|
127
|
+
onClose(listener: () => void): () => void;
|
|
128
|
+
/** Close the window. Runs the `onClose` listeners first. */
|
|
129
|
+
close(): void;
|
|
130
|
+
}
|
|
131
|
+
/**
|
|
132
|
+
* Open a pop-out window ready for the editor: same origin, styled like this page, with an
|
|
133
|
+
* empty mount point that fills it.
|
|
134
|
+
*
|
|
135
|
+
* Resolves to `null` when the browser blocks the window, so call it from a user gesture such
|
|
136
|
+
* as a button click. The React `DocxEditor.Window` and Vue `DocxEditorWindow` components use
|
|
137
|
+
* it; call it directly when you mount the editor without an adapter.
|
|
138
|
+
*
|
|
139
|
+
* @example
|
|
140
|
+
* ```ts
|
|
141
|
+
* const popup = await openEditorWindow({ title: 'Contract' });
|
|
142
|
+
* if (popup) {
|
|
143
|
+
* editor.attach(popup.element);
|
|
144
|
+
* popup.onClose(() => editor.attach(homeElement));
|
|
145
|
+
* }
|
|
146
|
+
* ```
|
|
147
|
+
*
|
|
148
|
+
* @public
|
|
149
|
+
*/
|
|
150
|
+
declare function openEditorWindow(options?: OpenEditorWindowOptions): Promise<EditorWindow | null>;
|
|
151
|
+
/**
|
|
152
|
+
* Copy every stylesheet of `from` into `to`, and keep copying the ones `from` adds later.
|
|
153
|
+
*
|
|
154
|
+
* Covers `<link rel="stylesheet">` and `<style>` elements added, changed or removed at any
|
|
155
|
+
* time; rules inserted into a same-origin `<style>` through the CSSOM (CSS-in-JS libraries in
|
|
156
|
+
* production), checked every 250 ms on the pop-out's own clock while it is open; constructed
|
|
157
|
+
* `adoptedStyleSheets`, checked the same way; and the theme attributes on `<html>` such as `class` and `data-theme`. Rules
|
|
158
|
+
* inserted into a `<link>` sheet, or any sheet of another origin, are not copied. Returns a
|
|
159
|
+
* function that stops the mirroring.
|
|
160
|
+
*
|
|
161
|
+
* @example
|
|
162
|
+
* ```ts
|
|
163
|
+
* const stop = copyEditorStyles(document, popup.document);
|
|
164
|
+
* // Later, when the pop-out closes:
|
|
165
|
+
* stop();
|
|
166
|
+
* ```
|
|
167
|
+
*
|
|
168
|
+
* @public
|
|
169
|
+
*/
|
|
170
|
+
declare function copyEditorStyles(from: Document, to: Document): () => void;
|
|
171
|
+
|
|
172
|
+
/** The window type of a realm: its own timers, observers and constructors. */
|
|
173
|
+
type HostWindow = Window & typeof globalThis;
|
|
174
|
+
/**
|
|
175
|
+
* The document that owns `node`, or the script's own document when `node` is absent.
|
|
176
|
+
* Without a DOM (server rendering) and without a node, this is `undefined` despite its type:
|
|
177
|
+
* call it from effects and event handlers, not during render.
|
|
178
|
+
*
|
|
179
|
+
* Use it to add document-level listeners (`selectionchange`, `pointerup`, `keydown`) and to
|
|
180
|
+
* read `activeElement` for an editor that may live in another window.
|
|
181
|
+
*
|
|
182
|
+
* @example
|
|
183
|
+
* ```ts
|
|
184
|
+
* const doc = hostDocumentOf(menuElement);
|
|
185
|
+
* doc.addEventListener('pointerdown', onOutsidePress, true);
|
|
186
|
+
* ```
|
|
187
|
+
*
|
|
188
|
+
* @public
|
|
189
|
+
*/
|
|
190
|
+
declare function hostDocumentOf(node: Node | null | undefined): Document;
|
|
191
|
+
/**
|
|
192
|
+
* The window that owns `node`: its timers, animation frames, observers and viewport size.
|
|
193
|
+
*
|
|
194
|
+
* Falls back to the script's own window when the node's document has no window (an inert
|
|
195
|
+
* document from `DOMParser`, or a window that closed), and to `globalThis` without a DOM.
|
|
196
|
+
*
|
|
197
|
+
* @example
|
|
198
|
+
* ```ts
|
|
199
|
+
* const win = hostWindowOf(anchorElement);
|
|
200
|
+
* const handle = win.setTimeout(close, 300);
|
|
201
|
+
* const maxX = win.innerWidth - menuWidth;
|
|
202
|
+
* ```
|
|
203
|
+
*
|
|
204
|
+
* @public
|
|
205
|
+
*/
|
|
206
|
+
declare function hostWindowOf(node: Node | null | undefined): HostWindow;
|
|
207
|
+
/**
|
|
208
|
+
* The element `editor` is mounted in, or `null` while it is detached or headless.
|
|
209
|
+
*
|
|
210
|
+
* Use it to tell which editor an event belongs to when several share a window.
|
|
211
|
+
*
|
|
212
|
+
* @example
|
|
213
|
+
* ```ts
|
|
214
|
+
* const mine = editorHostElement(editor)?.contains(event.target as Node) ?? false;
|
|
215
|
+
* ```
|
|
216
|
+
*
|
|
217
|
+
* @public
|
|
218
|
+
*/
|
|
219
|
+
declare function editorHostElement(editor: Editor): Element | null;
|
|
220
|
+
/**
|
|
221
|
+
* The document `editor` is mounted in: a pop-out window's or an iframe's when it is
|
|
222
|
+
* attached there. While the editor is detached, the script's own document.
|
|
223
|
+
*
|
|
224
|
+
* Use it in custom chrome that is not inside the editor's own DOM, such as a toolbar
|
|
225
|
+
* popover, to add document listeners and to read focus.
|
|
226
|
+
*
|
|
227
|
+
* @example
|
|
228
|
+
* ```ts
|
|
229
|
+
* const doc = editorHostDocument(editor);
|
|
230
|
+
* doc.addEventListener('keydown', onShortcut);
|
|
231
|
+
* ```
|
|
232
|
+
*
|
|
233
|
+
* @public
|
|
234
|
+
*/
|
|
235
|
+
declare function editorHostDocument(editor: Editor): Document;
|
|
236
|
+
/**
|
|
237
|
+
* The window `editor` is mounted in: its timers, frames, viewport size and clipboard.
|
|
238
|
+
* While the editor is detached, the script's own window.
|
|
239
|
+
*
|
|
240
|
+
* @example
|
|
241
|
+
* ```ts
|
|
242
|
+
* const win = editorHostWindow(editor);
|
|
243
|
+
* await win.navigator.clipboard.writeText(text);
|
|
244
|
+
* ```
|
|
245
|
+
*
|
|
246
|
+
* @public
|
|
247
|
+
*/
|
|
248
|
+
declare function editorHostWindow(editor: Editor): HostWindow;
|
|
249
|
+
/**
|
|
250
|
+
* Whether `value` is a DOM element of any window. Use it instead of `instanceof Element`,
|
|
251
|
+
* which is false for an element of a pop-out window or an iframe.
|
|
252
|
+
*
|
|
253
|
+
* @example
|
|
254
|
+
* ```ts
|
|
255
|
+
* if (isElementNode(event.target)) event.target.closest('[data-docx-hf]');
|
|
256
|
+
* ```
|
|
257
|
+
*
|
|
258
|
+
* @public
|
|
259
|
+
*/
|
|
260
|
+
declare function isElementNode(value: unknown): value is Element;
|
|
261
|
+
/**
|
|
262
|
+
* Whether `value` is an HTML (not SVG or MathML) element of any window.
|
|
263
|
+
*
|
|
264
|
+
* @example
|
|
265
|
+
* ```ts
|
|
266
|
+
* if (isHTMLElementNode(event.target)) event.target.focus();
|
|
267
|
+
* ```
|
|
268
|
+
*
|
|
269
|
+
* @public
|
|
270
|
+
*/
|
|
271
|
+
declare function isHTMLElementNode(value: unknown): value is HTMLElement;
|
|
272
|
+
/**
|
|
273
|
+
* Whether `value` is a DOM text node of any window.
|
|
274
|
+
*
|
|
275
|
+
* @example
|
|
276
|
+
* ```ts
|
|
277
|
+
* const anchor = selection.anchorNode;
|
|
278
|
+
* const element = isTextNode(anchor) ? anchor.parentElement : anchor;
|
|
279
|
+
* ```
|
|
280
|
+
*
|
|
281
|
+
* @public
|
|
282
|
+
*/
|
|
283
|
+
declare function isTextNode(value: unknown): value is Text;
|
|
284
|
+
/**
|
|
285
|
+
* Whether `value` is a DOM node of any window.
|
|
286
|
+
*
|
|
287
|
+
* @example
|
|
288
|
+
* ```ts
|
|
289
|
+
* if (isDomNode(event.target) && panel.contains(event.target)) return;
|
|
290
|
+
* ```
|
|
291
|
+
*
|
|
292
|
+
* @public
|
|
293
|
+
*/
|
|
294
|
+
declare function isDomNode(value: unknown): value is Node;
|
|
295
|
+
/**
|
|
296
|
+
* Timers that run on the window `node` belongs to, resolved at each call.
|
|
297
|
+
*
|
|
298
|
+
* A handle is cleared on the window that issued it, so a timer set before the editor moved
|
|
299
|
+
* to another window is still cancelled after the move. Handles are this object's own numbers:
|
|
300
|
+
* two windows count their native handles independently, so a native number alone could name
|
|
301
|
+
* a timer in either one. Clear them with this object, never with the global `clearTimeout`.
|
|
302
|
+
*
|
|
303
|
+
* @public
|
|
304
|
+
*/
|
|
305
|
+
interface HostTimers {
|
|
306
|
+
setTimeout(run: () => void, delay?: number): number;
|
|
307
|
+
clearTimeout(handle: number | null | undefined): void;
|
|
308
|
+
requestAnimationFrame(run: (time: number) => void): number;
|
|
309
|
+
cancelAnimationFrame(handle: number | null | undefined): void;
|
|
310
|
+
/**
|
|
311
|
+
* Move pending work to the window the node lives in now. Every other call does this first;
|
|
312
|
+
* call it yourself where you only check whether something is pending. A hidden opener runs
|
|
313
|
+
* no frames and fires no `pagehide`, so work left there would wait until it is shown again.
|
|
314
|
+
*/
|
|
315
|
+
migrate(): void;
|
|
316
|
+
}
|
|
317
|
+
/**
|
|
318
|
+
* {@link HostTimers} bound to whatever window `node()` lives in when each call runs.
|
|
319
|
+
*
|
|
320
|
+
* Use it for debounces and frames in chrome that can end up in a pop-out window: the opener's
|
|
321
|
+
* timers are throttled while it is hidden, and a pop-out's never run once it closes.
|
|
322
|
+
*
|
|
323
|
+
* @example
|
|
324
|
+
* ```ts
|
|
325
|
+
* const timers = hostTimers(() => panelElement);
|
|
326
|
+
* let pending: number | null = null;
|
|
327
|
+
* function schedule() {
|
|
328
|
+
* timers.clearTimeout(pending);
|
|
329
|
+
* pending = timers.setTimeout(refresh, 150);
|
|
330
|
+
* }
|
|
331
|
+
* ```
|
|
332
|
+
*
|
|
333
|
+
* @public
|
|
334
|
+
*
|
|
335
|
+
* A window that goes away (a pop-out the user closes) never runs what is pending in it, and a
|
|
336
|
+
* dropped commit, notification or search is worse than a late one. So each window with pending
|
|
337
|
+
* work is watched for `pagehide`, and its pending timers and frames move to the window the node
|
|
338
|
+
* lives in by then, or to the script's own window.
|
|
339
|
+
*/
|
|
340
|
+
declare function hostTimers(node: () => Node | null | undefined): HostTimers;
|
|
341
|
+
/**
|
|
342
|
+
* Whether `event` is a keyboard event, from any window.
|
|
343
|
+
*
|
|
344
|
+
* @example
|
|
345
|
+
* ```ts
|
|
346
|
+
* if (isKeyboardEvent(event) && event.key === 'Escape') close();
|
|
347
|
+
* ```
|
|
348
|
+
*
|
|
349
|
+
* @public
|
|
350
|
+
*/
|
|
351
|
+
declare function isKeyboardEvent(event: Event): event is KeyboardEvent;
|
|
352
|
+
/**
|
|
353
|
+
* Whether `event` is a pointer event, from any window.
|
|
354
|
+
*
|
|
355
|
+
* @example
|
|
356
|
+
* ```ts
|
|
357
|
+
* if (isPointerEvent(event) && event.button !== 0) return;
|
|
358
|
+
* ```
|
|
359
|
+
*
|
|
360
|
+
* @public
|
|
361
|
+
*/
|
|
362
|
+
declare function isPointerEvent(event: Event): event is PointerEvent;
|
|
363
|
+
/**
|
|
364
|
+
* Whether `event` is a mouse (or pointer) event, from any window.
|
|
365
|
+
*
|
|
366
|
+
* @example
|
|
367
|
+
* ```ts
|
|
368
|
+
* const point = isMouseEvent(event) ? { x: event.clientX, y: event.clientY } : null;
|
|
369
|
+
* ```
|
|
370
|
+
*
|
|
371
|
+
* @public
|
|
372
|
+
*/
|
|
373
|
+
declare function isMouseEvent(event: Event): event is MouseEvent;
|
|
374
|
+
/**
|
|
375
|
+
* Whether `event` is an `input` or `beforeinput` event, from any window.
|
|
376
|
+
*
|
|
377
|
+
* @example
|
|
378
|
+
* ```ts
|
|
379
|
+
* if (isInputEvent(event) && event.inputType === 'insertText') track(event.data);
|
|
380
|
+
* ```
|
|
381
|
+
*
|
|
382
|
+
* @public
|
|
383
|
+
*/
|
|
384
|
+
declare function isInputEvent(event: Event): event is InputEvent;
|
|
385
|
+
|
|
92
386
|
/**
|
|
93
387
|
* Mount a paginated surface over DOCX bytes.
|
|
94
388
|
*
|
|
@@ -512,6 +806,13 @@ declare function readAvailableWidth(bar: HTMLElement, style: CSSStyleDeclaration
|
|
|
512
806
|
* @internal
|
|
513
807
|
*/
|
|
514
808
|
declare function chordLetter(event: KeyboardEvent): string;
|
|
809
|
+
/**
|
|
810
|
+
* The Go To chord: Ctrl+G, or Cmd+Option+G on Apple platforms. F5 is not used: browsers
|
|
811
|
+
* reload on it. Cmd+G alone is left to the browser's find-next on macOS.
|
|
812
|
+
*
|
|
813
|
+
* @public
|
|
814
|
+
*/
|
|
815
|
+
declare function isGoToChord(event: KeyboardEvent, apple?: boolean): boolean;
|
|
515
816
|
|
|
516
817
|
/** Planner-backed can/plan pair — production gate for table commands. Task 9 maps chrome slots. */
|
|
517
818
|
declare function tableCommandState(command: EditorCommand, surface: PaginatedSurface): {
|
|
@@ -519,6 +820,32 @@ declare function tableCommandState(command: EditorCommand, surface: PaginatedSur
|
|
|
519
820
|
readonly plan: TableCommandPlan;
|
|
520
821
|
};
|
|
521
822
|
|
|
823
|
+
/**
|
|
824
|
+
* One automation run inside a history group: every batch it executes is a frame of the
|
|
825
|
+
* group, and the run settles once into one outcome on the handle.
|
|
826
|
+
*
|
|
827
|
+
* @internal
|
|
828
|
+
*/
|
|
829
|
+
interface HistoryGroupRun {
|
|
830
|
+
/** Execute one batch; `null`, executing nothing, once the group is no longer open. */
|
|
831
|
+
execute(request: AutomationBatchRequest): AutomationBatchResponse | null;
|
|
832
|
+
/** Settle the run's outcome on the handle. Safe to call more than once. */
|
|
833
|
+
finish(): void;
|
|
834
|
+
}
|
|
835
|
+
/**
|
|
836
|
+
* An automation host over a live editor.
|
|
837
|
+
*
|
|
838
|
+
* @public
|
|
839
|
+
*/
|
|
840
|
+
interface BrowserAutomationHost extends AutomationHost {
|
|
841
|
+
/**
|
|
842
|
+
* Begin one run inside `group`, or `null` when `group` is not an open handle from this
|
|
843
|
+
* editor. Used by the browser runtime's `run({ historyToken }, callback)`.
|
|
844
|
+
*
|
|
845
|
+
* @internal
|
|
846
|
+
*/
|
|
847
|
+
beginHistoryGroupRun(group: HistoryGroup): HistoryGroupRun | null;
|
|
848
|
+
}
|
|
522
849
|
/**
|
|
523
850
|
* What a browser host can do.
|
|
524
851
|
*
|
|
@@ -538,7 +865,63 @@ declare const BROWSER_AUTOMATION_CAPABILITIES: AutomationCapabilities;
|
|
|
538
865
|
* return `transaction-refused`. For autosaving from change callbacks, use the asynchronous
|
|
539
866
|
* `editor.save()`, which waits for the active edit to finish.
|
|
540
867
|
*/
|
|
541
|
-
declare function createBrowserAutomationHost(editor: DocxEditorInstance):
|
|
868
|
+
declare function createBrowserAutomationHost(editor: DocxEditorInstance): BrowserAutomationHost;
|
|
869
|
+
|
|
870
|
+
/**
|
|
871
|
+
* Why a preview could not begin.
|
|
872
|
+
*
|
|
873
|
+
* - `no-document`: the editor is detached, still opening, or holds no document.
|
|
874
|
+
* - `viewing`: the editor is open for viewing, so a commit could never write.
|
|
875
|
+
* - `blocked`: an external refresh is replacing the document.
|
|
876
|
+
* - `composing`: an input method composition is in progress in the editor.
|
|
877
|
+
* - `preview-active`: another preview is already open on this editor.
|
|
878
|
+
*
|
|
879
|
+
* @internal
|
|
880
|
+
*/
|
|
881
|
+
type EditorPreviewRefusal = 'no-document' | 'viewing' | 'blocked' | 'composing' | 'preview-active';
|
|
882
|
+
/**
|
|
883
|
+
* One open preview over a live editor.
|
|
884
|
+
*
|
|
885
|
+
* @internal
|
|
886
|
+
*/
|
|
887
|
+
interface EditorPreviewFork {
|
|
888
|
+
/** Defer host event listeners until a synchronous commit finishes. */
|
|
889
|
+
deferEvents<T>(run: () => T): T;
|
|
890
|
+
/** An automation host over the fork. Its writes never reach the live editor. */
|
|
891
|
+
readonly host: AutomationHost;
|
|
892
|
+
/**
|
|
893
|
+
* Paint the fork over the live pages and refuse live writes from now on. False when it
|
|
894
|
+
* cannot mount; nothing changes then.
|
|
895
|
+
*/
|
|
896
|
+
show(): boolean;
|
|
897
|
+
/** Whether the fork is painted now. */
|
|
898
|
+
readonly shown: boolean;
|
|
899
|
+
/** Bring the first body paragraph the fork changed into view. False when there is none. */
|
|
900
|
+
reveal(): boolean;
|
|
901
|
+
/** Whether the preview has ended. Final. */
|
|
902
|
+
readonly ended: boolean;
|
|
903
|
+
/** Restore the live pages and lift the write guard. Idempotent. */
|
|
904
|
+
end(): void;
|
|
905
|
+
/** Told once when the preview ends, by `end()` or because the editor remounted. */
|
|
906
|
+
onEnd(listener: () => void): () => void;
|
|
907
|
+
}
|
|
908
|
+
/** Whether a preview is painted over `editor`, so its writes are refused. @internal */
|
|
909
|
+
declare function editorPreviewActive(editor: object): boolean;
|
|
910
|
+
/**
|
|
911
|
+
* Open a preview over `editor`'s current document.
|
|
912
|
+
*
|
|
913
|
+
* Flushes buffered typing first, so the fork starts from the revision the caller compares
|
|
914
|
+
* against at commit. Writes nothing and refuses nothing on the live editor until `show()`.
|
|
915
|
+
*
|
|
916
|
+
* @internal
|
|
917
|
+
*/
|
|
918
|
+
declare function beginEditorPreview(editor: DocxEditorInstance): {
|
|
919
|
+
readonly ok: true;
|
|
920
|
+
readonly fork: EditorPreviewFork;
|
|
921
|
+
} | {
|
|
922
|
+
readonly ok: false;
|
|
923
|
+
readonly reason: EditorPreviewRefusal;
|
|
924
|
+
};
|
|
542
925
|
|
|
543
926
|
/**
|
|
544
927
|
* The facade's anonymous diagnostics: builds each {@link EditorDiagnostic} from codes and
|
|
@@ -608,6 +991,23 @@ declare function lowerColorValueForFill(color: ColorValue, themeColors: readonly
|
|
|
608
991
|
/** Resolve any public colour to a CSS `#RRGGBB` string for chrome display. */
|
|
609
992
|
declare function resolveColorValueToCss(color: ColorValue | undefined | null, themeColors: readonly DocumentThemeColorEntry[], defaultHex?: string): string;
|
|
610
993
|
|
|
994
|
+
/** The keys that undo and redo, shared by the text surface and every overlay that takes focus. */
|
|
995
|
+
/** Modifier and key state of one keydown, as both DOM and framework key events carry it. */
|
|
996
|
+
interface HistoryShortcutKeys {
|
|
997
|
+
readonly key: string;
|
|
998
|
+
readonly metaKey: boolean;
|
|
999
|
+
readonly ctrlKey: boolean;
|
|
1000
|
+
readonly shiftKey: boolean;
|
|
1001
|
+
}
|
|
1002
|
+
/**
|
|
1003
|
+
* Which history step a keydown asks for, or `null` for any other key.
|
|
1004
|
+
*
|
|
1005
|
+
* Ctrl+Y is the Windows redo; Ctrl/Cmd+Shift+Z is the macOS one. Both are accepted on every
|
|
1006
|
+
* platform. Focused chrome, such as the picture selection overlay, calls this so history keys
|
|
1007
|
+
* reach the editor instead of stopping at the control that holds focus.
|
|
1008
|
+
*/
|
|
1009
|
+
declare function historyShortcutOf(event: HistoryShortcutKeys): 'undo' | 'redo' | null;
|
|
1010
|
+
|
|
611
1011
|
interface SurfaceExtent {
|
|
612
1012
|
readonly width: number;
|
|
613
1013
|
readonly height: number;
|
|
@@ -1139,6 +1539,56 @@ declare function createContentControlListNavigation(locale?: string): ContentCon
|
|
|
1139
1539
|
/** The `accept` list of the engine's picker: what `replaceImage` takes. */
|
|
1140
1540
|
declare const CONTENT_CONTROL_PICTURE_ACCEPT = "image/png,image/jpeg,image/gif,image/bmp,image/webp";
|
|
1141
1541
|
|
|
1542
|
+
/** The multiples the line-spacing menu offers, in lines. @public */
|
|
1543
|
+
declare const LINE_SPACING_PRESETS: readonly number[];
|
|
1544
|
+
/** The line spacing a menu row stands for: lines for `multiple`, points otherwise. @public */
|
|
1545
|
+
type LineSpacingMenuValue = NonNullable<SurfaceFormatting['lineSpacing']>;
|
|
1546
|
+
/** One row of the line-spacing menu. @public */
|
|
1547
|
+
interface LineSpacingMenuRow {
|
|
1548
|
+
/** The spacing the row stands for. */
|
|
1549
|
+
readonly spacing: LineSpacingMenuValue;
|
|
1550
|
+
/**
|
|
1551
|
+
* What picking the row executes, or null for the selected row: it already holds, and
|
|
1552
|
+
* its value is the read rounded to two decimals, so writing it back would quietly move
|
|
1553
|
+
* an authored `w:line="253"` to 252. Picking a null row only closes the menu.
|
|
1554
|
+
*/
|
|
1555
|
+
readonly command: Extract<EditorCommand, {
|
|
1556
|
+
type: 'setLineSpacing';
|
|
1557
|
+
}> | null;
|
|
1558
|
+
/**
|
|
1559
|
+
* The number as the row shows it: one decimal for a multiple unless it needs two (`1.0`,
|
|
1560
|
+
* `1.15`), and the point value for `exact` and `atLeast`.
|
|
1561
|
+
*/
|
|
1562
|
+
readonly text: string;
|
|
1563
|
+
/**
|
|
1564
|
+
* The i18n key whose `{value}` placeholder takes `text`, or null when `text` is the
|
|
1565
|
+
* whole label (a multiple).
|
|
1566
|
+
*/
|
|
1567
|
+
readonly labelKey: 'lineSpacing.exactlyPoints' | 'lineSpacing.atLeastPoints' | null;
|
|
1568
|
+
/** Whether this is the spacing in force across the whole selection. */
|
|
1569
|
+
readonly selected: boolean;
|
|
1570
|
+
/** False for the extra row that shows a current spacing no preset matches. */
|
|
1571
|
+
readonly preset: boolean;
|
|
1572
|
+
}
|
|
1573
|
+
/**
|
|
1574
|
+
* The line-spacing menu rows for the spacing in force.
|
|
1575
|
+
*
|
|
1576
|
+
* A current multiple that is not a preset joins the list in order, ticked; a current
|
|
1577
|
+
* `exact` or `atLeast` leads the list as its own ticked row. A selection whose paragraphs
|
|
1578
|
+
* disagree (`current` null) ticks nothing, because no one row is true of all of it.
|
|
1579
|
+
* @public
|
|
1580
|
+
*/
|
|
1581
|
+
declare function lineSpacingMenuRows(current: SurfaceFormatting['lineSpacing']): readonly LineSpacingMenuRow[];
|
|
1582
|
+
/**
|
|
1583
|
+
* A row's visible label, with its number in `locale`'s format (`1,5` in German).
|
|
1584
|
+
*
|
|
1585
|
+
* `label` resolves an i18n key without interpolation, as a toolbar's host translation
|
|
1586
|
+
* does, so the `{value}` placeholder is filled here. Without a `locale` the number reads
|
|
1587
|
+
* as `text` does.
|
|
1588
|
+
* @public
|
|
1589
|
+
*/
|
|
1590
|
+
declare function lineSpacingMenuRowLabel(row: LineSpacingMenuRow, label: (key: string) => string, locale?: string): string;
|
|
1591
|
+
|
|
1142
1592
|
/** A processor location in the returned document's body, including table paragraphs. @public */
|
|
1143
1593
|
interface RefreshLocation {
|
|
1144
1594
|
/** OOXML w14:paraId: eight hexadecimal digits, 00000001 through 7FFFFFFF. Case-insensitive. Use this or paragraphIndex, not both. */
|
|
@@ -1412,5 +1862,126 @@ interface DocumentSearch {
|
|
|
1412
1862
|
*/
|
|
1413
1863
|
declare function createDocumentSearch(editor: Editor): DocumentSearch;
|
|
1414
1864
|
|
|
1415
|
-
|
|
1416
|
-
|
|
1865
|
+
/** The font a text watermark uses when its options name none. @public */
|
|
1866
|
+
declare const DEFAULT_WATERMARK_FONT = "Calibri";
|
|
1867
|
+
/** A width and a height in points. @public */
|
|
1868
|
+
interface WatermarkSize {
|
|
1869
|
+
readonly width: number;
|
|
1870
|
+
readonly height: number;
|
|
1871
|
+
}
|
|
1872
|
+
/**
|
|
1873
|
+
* The shape box, in points, that `setWatermark` writes for `watermark` on a page whose text
|
|
1874
|
+
* area (page size less margins) is `area`. The box is centered on the text area, and a
|
|
1875
|
+
* diagonal text box turns 45 degrees counterclockwise about its center. Null when the
|
|
1876
|
+
* options name no text and no readable picture. Pass a measurer for the exact text
|
|
1877
|
+
* advance; without one the advance is an estimate.
|
|
1878
|
+
*
|
|
1879
|
+
* @example
|
|
1880
|
+
* ```ts
|
|
1881
|
+
* const box = watermarkShapeBox({ text: 'DRAFT' }, { width: 468, height: 648 });
|
|
1882
|
+
* ```
|
|
1883
|
+
* @public
|
|
1884
|
+
*/
|
|
1885
|
+
declare function watermarkShapeBox(watermark: Watermark, area: WatermarkSize, measurer?: TextMeasurer): WatermarkSize | null;
|
|
1886
|
+
|
|
1887
|
+
/**
|
|
1888
|
+
* How the Bookmark dialog orders its list: by name, or by where each bookmark is.
|
|
1889
|
+
*
|
|
1890
|
+
* @public
|
|
1891
|
+
*/
|
|
1892
|
+
type BookmarkSortOrder = 'name' | 'location';
|
|
1893
|
+
/**
|
|
1894
|
+
* The bookmarks the dialog lists. Hidden bookmarks show only when asked for. Names sort
|
|
1895
|
+
* without case and with numbers in order, and location sorts by document order.
|
|
1896
|
+
*
|
|
1897
|
+
* @public
|
|
1898
|
+
*/
|
|
1899
|
+
declare function bookmarkDialogRows(bookmarks: readonly BookmarkSummary[], options: {
|
|
1900
|
+
readonly sortBy: BookmarkSortOrder;
|
|
1901
|
+
readonly showHidden: boolean;
|
|
1902
|
+
}): readonly BookmarkSummary[];
|
|
1903
|
+
/**
|
|
1904
|
+
* The bookmarks a Go To name box offers for what was typed: those whose name contains it,
|
|
1905
|
+
* compared without case, in the dialog's order. Names that start with it come first. An empty
|
|
1906
|
+
* query offers every row. Sorted by location, the rows are in the order
|
|
1907
|
+
* {@link goToBookmarkGroups} shows them: by place first, so moving through the list follows
|
|
1908
|
+
* the screen.
|
|
1909
|
+
*
|
|
1910
|
+
* @public
|
|
1911
|
+
*/
|
|
1912
|
+
declare function goToBookmarkRows(bookmarks: readonly BookmarkSummary[], options: {
|
|
1913
|
+
readonly query: string;
|
|
1914
|
+
readonly sortBy: BookmarkSortOrder;
|
|
1915
|
+
readonly showHidden: boolean;
|
|
1916
|
+
}): readonly BookmarkSummary[];
|
|
1917
|
+
/**
|
|
1918
|
+
* The bookmark a Go To name box means: the one whose name equals what was typed, compared
|
|
1919
|
+
* without case, hidden or not; else the first row offered. Null when there is none.
|
|
1920
|
+
*
|
|
1921
|
+
* @public
|
|
1922
|
+
*/
|
|
1923
|
+
declare function goToBookmarkTarget(bookmarks: readonly BookmarkSummary[], query: string, offered: readonly BookmarkSummary[]): BookmarkSummary | null;
|
|
1924
|
+
/**
|
|
1925
|
+
* Where the typed text sits in a bookmark name, compared without case, for showing the match.
|
|
1926
|
+
* Null when the text is empty or the name does not contain it.
|
|
1927
|
+
*
|
|
1928
|
+
* @public
|
|
1929
|
+
*/
|
|
1930
|
+
declare function goToBookmarkMatch(name: string, query: string): {
|
|
1931
|
+
readonly start: number;
|
|
1932
|
+
readonly end: number;
|
|
1933
|
+
} | null;
|
|
1934
|
+
/**
|
|
1935
|
+
* One section of a Go To list sorted by location: the rows of one place, each with its index
|
|
1936
|
+
* in the full list.
|
|
1937
|
+
*
|
|
1938
|
+
* @public
|
|
1939
|
+
*/
|
|
1940
|
+
interface GoToBookmarkGroup {
|
|
1941
|
+
/** The place every row of the section is in. */
|
|
1942
|
+
readonly place: BookmarkPlace;
|
|
1943
|
+
/** The section's rows, each with its index in the full list (the one the highlight uses). */
|
|
1944
|
+
readonly rows: readonly {
|
|
1945
|
+
readonly row: BookmarkSummary;
|
|
1946
|
+
readonly index: number;
|
|
1947
|
+
}[];
|
|
1948
|
+
}
|
|
1949
|
+
/**
|
|
1950
|
+
* The rows of a Go To list grouped by place: the main text, then headers, footers, footnotes
|
|
1951
|
+
* and endnotes. Places with no row are left out. Rows keep their order within a place.
|
|
1952
|
+
*
|
|
1953
|
+
* @public
|
|
1954
|
+
*/
|
|
1955
|
+
declare function goToBookmarkGroups(rows: readonly BookmarkSummary[]): readonly GoToBookmarkGroup[];
|
|
1956
|
+
/**
|
|
1957
|
+
* The name the dialog starts with: the visible bookmark the selection is in, or an empty name.
|
|
1958
|
+
*
|
|
1959
|
+
* @public
|
|
1960
|
+
*/
|
|
1961
|
+
declare function bookmarkDialogInitialName(bookmarks: readonly BookmarkSummary[]): string;
|
|
1962
|
+
/**
|
|
1963
|
+
* What the typed name allows in the Bookmark dialog.
|
|
1964
|
+
*
|
|
1965
|
+
* @public
|
|
1966
|
+
*/
|
|
1967
|
+
interface BookmarkDialogNameState {
|
|
1968
|
+
/** Why Add cannot use the name, or null when it can. Hidden names cannot be added. */
|
|
1969
|
+
readonly problem: BookmarkNameProblem | null;
|
|
1970
|
+
/** The bookmark the name already belongs to, compared without case, or null. */
|
|
1971
|
+
readonly existing: BookmarkSummary | null;
|
|
1972
|
+
/** Add bookmarks the selection under the name; an existing bookmark moves. */
|
|
1973
|
+
readonly canAdd: boolean;
|
|
1974
|
+
/** Delete and Go To act on an existing bookmark. */
|
|
1975
|
+
readonly canDelete: boolean;
|
|
1976
|
+
readonly canGoTo: boolean;
|
|
1977
|
+
}
|
|
1978
|
+
/**
|
|
1979
|
+
* Evaluate the name typed in the Bookmark dialog against the document's bookmarks.
|
|
1980
|
+
* `writable` is whether the document accepts edits; Go To works either way.
|
|
1981
|
+
*
|
|
1982
|
+
* @public
|
|
1983
|
+
*/
|
|
1984
|
+
declare function bookmarkDialogNameState(bookmarks: readonly BookmarkSummary[], name: string, writable: boolean): BookmarkDialogNameState;
|
|
1985
|
+
|
|
1986
|
+
export { AUTO_ZOOM_MODE, AnchorHighlightAnimation, AnchorHighlightOptions, BROWSER_AUTOMATION_CAPABILITIES, CONTENT_CONTROL_PICTURE_ACCEPT, ClearAnchorHighlightOptions, DEFAULT_WATERMARK_FONT, DRAWING_REL_FROM_H, DRAWING_REL_FROM_V, DocumentRefreshError, DocxEditorInstance, DrawingPositionInput, FIT_WIDTH_ZOOM_MODE, FontShapingOptions, HIGHLIGHT_REFRESH_MS, HighlightOptions, HighlightRange, HighlightResult, HistoryGroup, LINE_SPACING_PRESETS, LOADING_SNAPSHOT, NO_MIXED_FIELDS, OpenPaginatedResult, PX_PER_CM, PX_PER_INCH, PaginatedSurface, PaginatedSurfaceOptions, ParagraphTabStop, REVIEW_MARKERS_GUTTER_PX, ReviewPaneOverflow, SEARCH_DEBOUNCE_MS, SEARCH_HIGHLIGHT_PRIORITY, SEARCH_HIGHLIGHT_SET, SEARCH_MATCH_LIMIT, SNAP_TWIPS_CM, SNAP_TWIPS_INCH, ScrollPlacement, ScrollToAnchorOptions, SurfaceFormatting, TAB_ALIGNMENT_LABELS, TOOLBAR_COLLAPSE_ORDER, TOOLBAR_OVERFLOW_HYSTERESIS, TOOLBAR_PANEL_EDGE_MARGIN, TOOLBAR_PINNED_GROUPS, TWIPS_PER_CM, TWIPS_PER_INCH, TextMatch, TextMeasurer, TreeDocxSessionView, ZOOM_MAX, ZOOM_MIN, alignmentAfterDirectionChange, applyThemeShade, applyThemeTint, arrangeToolbarGroups, barRoomWidth, beginEditorPreview, bookmarkDialogInitialName, bookmarkDialogNameState, bookmarkDialogRows, calendarDateForKey, calendarDateFromText, calendarDateText, calendarMonth, calendarMonthNames, calendarMonthTitle, calendarWeekdays, changedFields, chordLetter, clipboardDropLandsText, clipboardPasteLandsContent, collapseOrder, collapsibleGroupCost, contentControlPopupKeyDown, contentControlPopupOpener, controlsOverflow, copyEditorStyles, createBrowserAutomationHost, createContentControlListNavigation, createDocumentRefresh, createDocumentSearch, createLayoutShaping, dragIndent, editorCommandKey, editorHostDocument, editorHostElement, editorHostWindow, editorInstanceScope, editorPreviewActive, firstDayOfWeek, formatInches, generateRulerTicks, goToBookmarkGroups, goToBookmarkMatch, goToBookmarkRows, goToBookmarkTarget, handlePosition, hasOpenNestedPopup, historyShortcutOf, hostDocumentOf, hostTimers, hostWindowOf, inchesToTwips, isDomNode, isElementNode, isGoToChord, isHTMLElementNode, isInputEvent, isKeyboardEvent, isMouseEvent, isPointerEvent, isTextNode, isoDateOf, lineSpacingMenuRowLabel, lineSpacingMenuRows, listenForPopupEscape, listenForPopupFocusLeave, lowerColorValueForBorder, lowerColorValueForFill, mixedFieldsOf, mountPaginatedSurface, observeContentControlPopup, openEditorWindow, parseIsoDate, partOfNodeId, positionContentControlPopup, positionInputFromPropertiesCommand, propertiesCommandHasPositionFields, readAvailableWidth, readColumnGap, readInlineMargins, reportAutomationException, reportAutomationRefusal, resolveColorValueToCss, resolveThemeColorHex, resolveZoomMode, reviewPaneEntitledZoom, rulerPageBox, sameOverflow, sameTabStops, sameZoomMode, seedFields, separatorLeadingCost, shiftMonth, signedFirstLineOf, snapTwips, specialOf, surfaceExtent, tableCommandState, toEditorFontError, toolbarGroupPriority, toolbarOverflowGroups, toolbarPanelPlacement, toolbarPopupLeft, trailingGapCost, trapTabWithin, twipsToInches, validateDrawingPositionInput, validateSetImagePositionCommand, validateThemeModifier, watchHighlights, watermarkShapeBox, withTabStop };
|
|
1987
|
+
export type { BarRoomInput, BookmarkDialogNameState, BookmarkSortOrder, BrowserAutomationHost, CalendarDay, CalendarMonth, CalendarMonthOptions, ClearRefreshHighlightsOptions, ColorLowerResult, ContentControlListNavigation, DocumentRefresh, DocumentRefreshState, DocumentSearch, DocumentSearchFindOptions, DocumentSearchHighlight, DocumentSearchNavigateOptions, DocumentSearchOptions, DocumentSearchState, EditorPreviewFork, EditorPreviewRefusal, EditorWindow, GoToBookmarkGroup, HighlightSource, HighlightWatch, HistoryGroupRun, HistoryShortcutKeys, HostTimers, HostWindow, LineSpacingMenuRow, LineSpacingMenuValue, NavigateToChangeOptions, OpenEditorWindowOptions, ParagraphDialogFields, ParagraphDialogMixed, ParagraphFlagKey, ParagraphFlagState, ParagraphFormatRead, ParagraphFormatUpdate, PopupEscapeOptions, PopupFocusLeaveOptions, RefreshChange, RefreshChangeInput, RefreshFailureCode, RefreshHighlightAnimation, RefreshHighlightOptions, RefreshLocation, RefreshResult, RefreshSubmission, RefreshUpdate, RulerDragOptions, RulerIndent, RulerIndentHandle, RulerPageMetrics, RulerTick, RulerUnit, SpecialIndent, SurfaceExtent, TabAlignment, TabLeaderName, ToolbarFitInput, ToolbarHostGroupPlacement, ToolbarPanelPlacement, WatchHighlightsOptions, WatermarkSize };
|