@docx-editor.dev/core 2.4.1 → 2.6.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/THIRD_PARTY_NOTICES.md +39 -1
- package/dist/automation.cjs +1 -1
- package/dist/automation.js +1 -1
- package/dist/binding.cjs +1 -1
- package/dist/binding.d.cts +8 -8
- package/dist/binding.d.ts +8 -8
- package/dist/binding.js +1 -1
- package/dist/chunk-4GQXAXTZ.js +5 -0
- package/dist/chunk-DGUHCJPF.cjs +18 -0
- package/dist/chunk-DY3QVCWC.cjs +10 -0
- package/dist/chunk-E7BXJ4BF.js +1 -0
- package/dist/chunk-F7Z6PWAZ.cjs +2 -0
- package/dist/chunk-IJ4V3LGV.cjs +2 -0
- package/dist/chunk-JEMP5YI5.cjs +15 -0
- package/dist/{chunk-YMIMLEX4.cjs → chunk-JZXK4DKV.cjs} +1 -1
- package/dist/chunk-NIGGABAA.js +15 -0
- package/dist/chunk-OPKOTVQQ.js +18 -0
- package/dist/{chunk-GOEBQ26R.js → chunk-PSZH2VXP.js} +1 -1
- package/dist/chunk-R75OLPL6.js +10 -0
- package/dist/chunk-SFMAIFEN.cjs +2 -0
- package/dist/chunk-SKWYEZCO.cjs +5 -0
- package/dist/chunk-SMRD66T5.js +2 -0
- package/dist/chunk-UVIUNAQ6.js +2 -0
- package/dist/chunk-WAVN7MAT.js +2 -0
- package/dist/chunk-WU7PUTVA.js +2 -0
- package/dist/{chunk-OHJQ7GPZ.cjs → chunk-YMYCPY5Y.cjs} +1 -1
- package/dist/contracts/editor.cjs +1 -1
- package/dist/contracts/editor.d.cts +8 -8
- package/dist/contracts/editor.d.ts +8 -8
- package/dist/contracts/editor.js +1 -1
- package/dist/contracts/interaction.d.cts +7 -7
- package/dist/contracts/interaction.d.ts +7 -7
- package/dist/contracts/modules.d.cts +4 -4
- package/dist/contracts/modules.d.ts +4 -4
- package/dist/contracts/types.d.cts +3 -1
- package/dist/contracts/types.d.ts +3 -1
- package/dist/{custom-node-writes-C5YRoPcc.d.cts → custom-node-writes-D9G3GKQ7.d.cts} +18 -3
- package/dist/{custom-node-writes-BkMgMXxs.d.ts → custom-node-writes-tJw8U9MO.d.ts} +18 -3
- package/dist/dist-YFULGVS3.js +2 -0
- package/dist/{editor-DYvC9CZs.d.cts → editor-BZEJL3vv.d.cts} +50 -19
- package/dist/{editor-D1qHfzOt.d.ts → editor-D2zOJztO.d.ts} +50 -19
- package/dist/editor.cjs +1 -1
- package/dist/editor.css +407 -38
- package/dist/editor.d.cts +38 -22
- package/dist/editor.d.ts +38 -22
- package/dist/editor.js +1 -1
- package/dist/harfbuzz.wasm +0 -0
- package/dist/{image-resources-DXvPZvXD.d.cts → image-resources-BaHz4QAd.d.cts} +1 -1
- package/dist/{image-resources-BG9DLyW7.d.ts → image-resources-Cl5_cNi9.d.ts} +1 -1
- package/dist/{index-DpY3WZuP.d.ts → index-D8L8WrNF.d.ts} +178 -23
- package/dist/{index-Bb-QAg_f.d.cts → index-_xF7n_z0.d.cts} +178 -23
- package/dist/index.cjs +1 -1
- package/dist/index.d.cts +16 -16
- package/dist/index.d.ts +16 -16
- package/dist/index.js +1 -1
- package/dist/layout.cjs +1 -1
- package/dist/layout.d.cts +159 -47
- package/dist/layout.d.ts +159 -47
- package/dist/layout.js +1 -1
- package/dist/node-module-shim-TTKTT66I.js +1 -0
- package/dist/output.cjs +1 -1
- package/dist/output.d.cts +20 -6
- package/dist/output.d.ts +20 -6
- package/dist/output.js +1 -1
- package/dist/{review-reads-CxgN62yp.d.cts → review-reads-Dr0CpW6u.d.cts} +25 -1
- package/dist/{review-reads-CQmU9Lcl.d.ts → review-reads-HDvoQXK2.d.ts} +25 -1
- package/dist/{review-support-DgXTIYBW.d.ts → review-support-D4ZBdUXa.d.ts} +46 -2
- package/dist/{review-support-BJ-YjGmD.d.cts → review-support-T-riLz4Y.d.cts} +46 -2
- package/dist/{revision-projection-DHAkcD_L.d.ts → revision-projection-UKqvPa4-.d.ts} +53 -2
- package/dist/{revision-projection-72ZApe-g.d.cts → revision-projection-WzlQGBJx.d.cts} +53 -2
- package/dist/{semantic-cell-selection-DZtyMXkH.d.ts → semantic-cell-selection-B5vfPz4Q.d.ts} +7 -4
- package/dist/{semantic-cell-selection--ezfezTe.d.cts → semantic-cell-selection-BTQFpN0S.d.cts} +7 -4
- package/dist/{semantic-interaction-DrgbgKg6.d.ts → semantic-interaction-CDNEU_Tx.d.cts} +2 -30
- package/dist/{semantic-interaction-2yxdv7q0.d.cts → semantic-interaction-lvpzZRpA.d.ts} +2 -30
- package/dist/{semantic-paint-BedBxkyY.d.ts → semantic-paint-BBPL3u5w.d.ts} +111 -3
- package/dist/{semantic-paint-BYjE0Xbl.d.cts → semantic-paint-IjbL-4CT.d.cts} +111 -3
- package/dist/{semantic-records-CR5hTqMK.d.ts → semantic-records-CdQvpUj1.d.ts} +106 -8
- package/dist/{semantic-records-DSD8WENa.d.cts → semantic-records-DEOs3_tE.d.cts} +106 -8
- package/dist/{shaped-measurer-CBOTJTV_.d.cts → shaped-measurer-C2SJAjV0.d.cts} +1 -1
- package/dist/{shaped-measurer-BL8g4AcW.d.ts → shaped-measurer-l4o5ITJ0.d.ts} +1 -1
- package/dist/store.cjs +1 -1
- package/dist/store.d.cts +38 -15
- package/dist/store.d.ts +38 -15
- package/dist/store.js +1 -1
- package/dist/{tree-op-types-EZXbR8bW.d.cts → tree-op-types-CUCwPWjT.d.cts} +1 -1
- package/dist/{tree-op-types-8a6xyRCN.d.ts → tree-op-types-D0fTNBVW.d.ts} +1 -1
- package/dist/{tree-session-SucW0znF.d.ts → tree-session-CH1oA75f.d.ts} +64 -42
- package/dist/{tree-session-DrMm8Cj2.d.cts → tree-session-b7bggR-S.d.cts} +64 -42
- package/dist/{tree-store-UYrGKF_Q.d.cts → tree-store-BqgeCa1Q.d.cts} +29 -2
- package/dist/{tree-store-BoM6eXaL.d.ts → tree-store-CIKASRHk.d.ts} +29 -2
- package/licenses/HarfBuzz-COPYING.txt +42 -0
- package/package.json +6 -4
- package/dist/chunk-33F6TRXO.js +0 -2
- package/dist/chunk-4WWEDTTE.js +0 -2
- package/dist/chunk-BS554B6D.cjs +0 -2
- package/dist/chunk-DQ5HGUWG.cjs +0 -12
- package/dist/chunk-EQO762XH.cjs +0 -10
- package/dist/chunk-F6WNPYOM.js +0 -2
- package/dist/chunk-FL4GWK76.js +0 -12
- package/dist/chunk-GWG5IVVX.cjs +0 -5
- package/dist/chunk-IZIL6BAW.cjs +0 -12
- package/dist/chunk-LIJPSHRA.js +0 -5
- package/dist/chunk-MHDO6HLI.cjs +0 -2
- package/dist/chunk-SG7OH2EK.js +0 -12
- package/dist/chunk-TCX3PVWR.js +0 -10
- package/dist/chunk-YTYKNA6X.cjs +0 -2
- package/dist/chunk-ZACHY6OS.js +0 -1
package/dist/editor.d.cts
CHANGED
|
@@ -1,31 +1,32 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
import {
|
|
5
|
-
export {
|
|
1
|
+
export { D as DEFAULT_IMAGE_RESOURCE_LIMITS, b as ImageDecodePort, c as ImageResourceLimits, R as RenderableImageMime, S as SupportedImageMime, a as VectorImageMime, r as resolveImageResourceLimits, d as resolveSvgIntrinsicSize, s as sniffImageMime, v as validateRasterHeader } from './image-resources-BaHz4QAd.cjs';
|
|
2
|
+
import { i as TreeDocColorValue, d as DrawingPositionInput } from './tree-op-types-CUCwPWjT.cjs';
|
|
3
|
+
export { j as IMAGE_WRAP_TARGETS, b as ImageWrapTarget } from './tree-op-types-CUCwPWjT.cjs';
|
|
4
|
+
import { g as DocumentThemeColorEntry } from './tree-session-b7bggR-S.cjs';
|
|
5
|
+
export { a as TreeApplyResult, c as TreeDocxSessionView } from './tree-session-b7bggR-S.cjs';
|
|
6
|
+
import { F as FontConfiguration, E as EditorFontError, a as EditorSnapshot, b as EditorCommand, C as CanResult, Z as ZoomMode } from './editor-BZEJL3vv.cjs';
|
|
7
|
+
export { I as ImageContext, c as ImageCropPercent, d as ImageCropPermille, S as SelectedImageState, e as cropPercentFromCropPermille, f as cropPercentFromPermille, g as cropPercentFromSourceCrop, h as cropPermilleFromCropPercent, i as cropPermilleFromPercent, s as sourceCropFromCropPercent, v as validateImageCropPercent } from './editor-BZEJL3vv.cjs';
|
|
8
|
+
import { L as LayoutShapingOptions } from './shaped-measurer-C2SJAjV0.cjs';
|
|
9
|
+
import { P as PaginatedSurfaceOptions, O as OpenPaginatedResult, a as PaginatedSurface, T as TableCommandPlan, D as DocxEditorInstance } from './index-_xF7n_z0.cjs';
|
|
10
|
+
export { A as AnchorFrameOrigin, C as CHROME_GROUPS, b as CHROME_MENUS, c as CHROME_UNAVAILABLE_KEY, d as ChromeControl, e as ChromeControlId, f as ChromeControlState, g as ChromeGroup, h as ChromeGroupId, i as ChromeMenu, j as ChromeMenuEntry, k as ChromeMenuId, l as ChromeMenuItemEntry, m as ChromeMenuSeparatorEntry, n as ChromeMenuSubmenuEntry, o as ChromeSlotId, p as DEFAULT_TABLE_CHROME_DRAFT, q as DocxEditorConfig, E as EMU_PER_POINT, F as FinalizedImageOverlayInteraction, r as FontConfigurationBase, s as FontConfigurationFragment, t as FontLoadFailure, u as FontLoadFailureReason, v as FontMeasurementState, w as FontResolutionRequest, x as FontResolver, y as FontUrlSource, H as HyperlinkActivation, z as HyperlinkChromeHandlers, B as HyperlinkOps, I as IMAGE_OVERLAY_NUDGE_PT, G as IMAGE_OVERLAY_NUDGE_SHIFT_PT, J as ImageInteractionSession, K as ImageOverlayScrollPort, L as ImageResizeHandle, M as ImageResizeResult, N as LoadFontsRequest, Q as LoadFontsResult, R as MAX_RESOLVER_FAMILIES, S as OverlayFrameRect, U as PaginatedSurfaceState, V as RunTableChromeCommandResult, W as SelectedDrawingOverlayTarget, X as SurfaceFormatting, Y as SurfaceHyperlink, Z as SurfaceNavigation, _ as SurfaceOverlayCoordinates, $ as TABLE_BORDER_STYLE_OPTIONS, a0 as TABLE_BORDER_TARGET_OPTIONS, a1 as TABLE_BORDER_WIDTH_OPTIONS, a2 as TABLE_CHROME_SLOT_IDS, a3 as TableBorderStyleOption, a4 as TableBorderTargetOption, a5 as TableBorderTargetValue, a6 as TableBorderWidthOption, a7 as TableChromeDraft, a8 as TableChromePick, a9 as TableChromeSlotId, aa as TableInteractionLabelKey, ab as ToolbarCommandState, ac as WORD_DEFAULT_FONT, ad as applyTableChromePick, ae as blankDocumentBytes, af as canExecuteImageCommand, ag as captureImageMutationPreconditions, ah as chromeControlCount, ai as chromeMenuSlots, aj as chromeProbeForSlot, ak as chromeSlotId, al as commandForSlot, am as commandForSlotValue, an as commandForTableChromeSlotValue, ao as composeFontConfiguration, ap as computeImageResizeResult, aq as computeMovedImagePosition, ar as computeResizedImageExtentEmu, as as createDocxEditor, at as createFontSource, au as createImageOverlayScrollPort, av as cssPixelsToLayoutPoints, aw as defaultChromeGroups, ax as defaultTableLabel, ay as emuToOverlayPoints, az as executeImageCommand, aA as finalizeImageOverlayInteraction, aB as formattingBarChromeGroups, aC as isStaleImageInteractionCommit, aD as isTableChromeSlot, aE as layoutPointsToCssPixels, aF as loadFonts, aG as overlayFrameToSheetCssPixels, aH as pointsToEmu, aI as probeTableChromeCommand, aJ as resizePreservesAspect, aK as runSave, aL as runTableChromeCommand, aM as runTableCommand, aN as runToolbarCommand, aO as selectedDrawingOverlayTargetOf, aP as selectedImageStateOf, aQ as surfacePaintScale, aR as tableChromeIconPaths, aS as tableChromeLabelKeyForTarget, aT as tableChromeToolbarState, aU as tableChromeVisible, aV as tableCommandToolbarState, aW as toolbarCommandState, aX as toolbarCommandStates } from './index-_xF7n_z0.cjs';
|
|
6
11
|
import { A as AutomationCapabilities, a as AutomationHost } from './protocol-CD7slqvl.cjs';
|
|
7
12
|
export { CollectReviewItems, EditorModule, EditorModuleRegistry, ReviewModuleContribution, resolveEditorModules } from './contracts/modules.cjs';
|
|
8
13
|
import { ColorValue } from './contracts/types.cjs';
|
|
9
|
-
import {
|
|
10
|
-
export {
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
export {
|
|
14
|
-
export {
|
|
15
|
-
export { S as SectionProperties } from './semantic-cell-selection--ezfezTe.cjs';
|
|
16
|
-
export { R as ReviewModelInput } from './review-support-BJ-YjGmD.cjs';
|
|
17
|
-
export { N as NavigationCommand, S as SemanticPosition, a as SemanticSelection } from './semantic-interaction-2yxdv7q0.cjs';
|
|
18
|
-
export { F as FieldShadingMode } from './semantic-paint-BYjE0Xbl.cjs';
|
|
19
|
-
import './contracts/document.cjs';
|
|
20
|
-
import './revision-projection-72ZApe-g.cjs';
|
|
21
|
-
import './ooxml-tree-BU0e3DVi.cjs';
|
|
22
|
-
import './review-reads-CxgN62yp.cjs';
|
|
14
|
+
import { S as SemanticLayout } from './semantic-records-DEOs3_tE.cjs';
|
|
15
|
+
export { T as TextMeasurer } from './semantic-records-DEOs3_tE.cjs';
|
|
16
|
+
export { S as SectionProperties } from './semantic-cell-selection-BTQFpN0S.cjs';
|
|
17
|
+
export { R as ReviewModelInput } from './review-support-T-riLz4Y.cjs';
|
|
18
|
+
export { N as NavigationCommand, S as SemanticPosition, a as SemanticSelection } from './semantic-interaction-CDNEU_Tx.cjs';
|
|
19
|
+
export { F as FieldShadingMode, R as ReviewAuthorInfo, a as RevisionAuthorAssignments, b as RevisionAuthorStyle, c as RevisionStyles } from './semantic-paint-IjbL-4CT.cjs';
|
|
23
20
|
import './ooxml-package-CR5us6ad.cjs';
|
|
24
|
-
import './
|
|
21
|
+
import './ooxml-tree-BU0e3DVi.cjs';
|
|
22
|
+
import './custom-node-writes-D9G3GKQ7.cjs';
|
|
25
23
|
import './hf-references-CgEOSw3i.cjs';
|
|
26
24
|
import './note-nodes-C6DLxlvj.cjs';
|
|
27
|
-
import './tree-store-
|
|
25
|
+
import './tree-store-BqgeCa1Q.cjs';
|
|
28
26
|
import 'prosemirror-model';
|
|
27
|
+
import './contracts/document.cjs';
|
|
28
|
+
import './revision-projection-WzlQGBJx.cjs';
|
|
29
|
+
import './review-reads-Dr0CpW6u.cjs';
|
|
29
30
|
|
|
30
31
|
interface LayoutShapingInstrumentation {
|
|
31
32
|
readonly onFontByteCopy?: () => void;
|
|
@@ -50,6 +51,14 @@ declare function createLayoutShaping(configuration: FontConfiguration, instrumen
|
|
|
50
51
|
*/
|
|
51
52
|
declare function disposeLayoutShaping(shaping: LayoutShapingOptions): void;
|
|
52
53
|
|
|
54
|
+
/**
|
|
55
|
+
* What `snapshot()` reports before an editor exists: loading, not editable, nothing
|
|
56
|
+
* selected, nothing undoable — never invented state.
|
|
57
|
+
*
|
|
58
|
+
* @public
|
|
59
|
+
*/
|
|
60
|
+
declare const LOADING_SNAPSHOT: EditorSnapshot;
|
|
61
|
+
|
|
53
62
|
/** The engine paints at 96 px per inch (twips / 15, 1440 twips per inch). */
|
|
54
63
|
declare const PX_PER_INCH = 96;
|
|
55
64
|
/** Painted pixels per centimetre, derived from {@link PX_PER_INCH}. */
|
|
@@ -149,6 +158,13 @@ declare function dragIndent(handle: RulerIndentHandle, positionTwips: number, in
|
|
|
149
158
|
*/
|
|
150
159
|
declare function mountPaginatedSurface(container: HTMLElement, bytes: Uint8Array, options?: PaginatedSurfaceOptions): OpenPaginatedResult;
|
|
151
160
|
|
|
161
|
+
/**
|
|
162
|
+
* Stable value identity for a command, including nested payloads.
|
|
163
|
+
*
|
|
164
|
+
* @internal
|
|
165
|
+
*/
|
|
166
|
+
declare function editorCommandKey(command: EditorCommand): string;
|
|
167
|
+
|
|
152
168
|
/** Planner-backed can/plan pair — production gate for table commands. Task 9 maps chrome slots. */
|
|
153
169
|
declare function tableCommandState(command: EditorCommand, surface: PaginatedSurface): {
|
|
154
170
|
readonly can: CanResult;
|
|
@@ -308,4 +324,4 @@ declare function validateSetImagePositionCommand(command: {
|
|
|
308
324
|
readonly relativeToV?: string;
|
|
309
325
|
}, mode: 'frame' | 'simple'): boolean;
|
|
310
326
|
|
|
311
|
-
export { AUTO_ZOOM_MODE, BROWSER_AUTOMATION_CAPABILITIES, type ColorLowerResult, DRAWING_REL_FROM_H, DRAWING_REL_FROM_V, DocxEditorInstance, DrawingPositionInput, FIT_WIDTH_ZOOM_MODE, OpenPaginatedResult, PX_PER_CM, PX_PER_INCH, PaginatedSurface, PaginatedSurfaceOptions, type RulerDragOptions, type RulerIndent, type RulerIndentHandle, type RulerPageMetrics, type RulerTick, type RulerUnit, SNAP_TWIPS_CM, SNAP_TWIPS_INCH, type SurfaceExtent, TWIPS_PER_CM, TWIPS_PER_INCH, ZOOM_MAX, ZOOM_MIN, applyThemeShade, applyThemeTint, createBrowserAutomationHost, createLayoutShaping, disposeLayoutShaping, dragIndent, generateRulerTicks, handlePosition, lowerColorValueForBorder, lowerColorValueForFill, mountPaginatedSurface, positionInputFromPropertiesCommand, propertiesCommandHasPositionFields, resolveColorValueToCss, resolveThemeColorHex, resolveZoomMode, rulerPageBox, sameZoomMode, snapTwips, surfaceExtent, tableCommandState, toEditorFontError, validateDrawingPositionInput, validateSetImagePositionCommand, validateThemeModifier };
|
|
327
|
+
export { AUTO_ZOOM_MODE, BROWSER_AUTOMATION_CAPABILITIES, type ColorLowerResult, DRAWING_REL_FROM_H, DRAWING_REL_FROM_V, DocxEditorInstance, DrawingPositionInput, FIT_WIDTH_ZOOM_MODE, LOADING_SNAPSHOT, OpenPaginatedResult, PX_PER_CM, PX_PER_INCH, PaginatedSurface, PaginatedSurfaceOptions, type RulerDragOptions, type RulerIndent, type RulerIndentHandle, type RulerPageMetrics, type RulerTick, type RulerUnit, SNAP_TWIPS_CM, SNAP_TWIPS_INCH, type SurfaceExtent, TWIPS_PER_CM, TWIPS_PER_INCH, ZOOM_MAX, ZOOM_MIN, applyThemeShade, applyThemeTint, createBrowserAutomationHost, createLayoutShaping, disposeLayoutShaping, dragIndent, editorCommandKey, generateRulerTicks, handlePosition, lowerColorValueForBorder, lowerColorValueForFill, mountPaginatedSurface, positionInputFromPropertiesCommand, propertiesCommandHasPositionFields, resolveColorValueToCss, resolveThemeColorHex, resolveZoomMode, rulerPageBox, sameZoomMode, snapTwips, surfaceExtent, tableCommandState, toEditorFontError, validateDrawingPositionInput, validateSetImagePositionCommand, validateThemeModifier };
|
package/dist/editor.d.ts
CHANGED
|
@@ -1,31 +1,32 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
import {
|
|
5
|
-
export {
|
|
1
|
+
export { D as DEFAULT_IMAGE_RESOURCE_LIMITS, b as ImageDecodePort, c as ImageResourceLimits, R as RenderableImageMime, S as SupportedImageMime, a as VectorImageMime, r as resolveImageResourceLimits, d as resolveSvgIntrinsicSize, s as sniffImageMime, v as validateRasterHeader } from './image-resources-Cl5_cNi9.js';
|
|
2
|
+
import { i as TreeDocColorValue, d as DrawingPositionInput } from './tree-op-types-D0fTNBVW.js';
|
|
3
|
+
export { j as IMAGE_WRAP_TARGETS, b as ImageWrapTarget } from './tree-op-types-D0fTNBVW.js';
|
|
4
|
+
import { g as DocumentThemeColorEntry } from './tree-session-CH1oA75f.js';
|
|
5
|
+
export { a as TreeApplyResult, c as TreeDocxSessionView } from './tree-session-CH1oA75f.js';
|
|
6
|
+
import { F as FontConfiguration, E as EditorFontError, a as EditorSnapshot, b as EditorCommand, C as CanResult, Z as ZoomMode } from './editor-D2zOJztO.js';
|
|
7
|
+
export { I as ImageContext, c as ImageCropPercent, d as ImageCropPermille, S as SelectedImageState, e as cropPercentFromCropPermille, f as cropPercentFromPermille, g as cropPercentFromSourceCrop, h as cropPermilleFromCropPercent, i as cropPermilleFromPercent, s as sourceCropFromCropPercent, v as validateImageCropPercent } from './editor-D2zOJztO.js';
|
|
8
|
+
import { L as LayoutShapingOptions } from './shaped-measurer-l4o5ITJ0.js';
|
|
9
|
+
import { P as PaginatedSurfaceOptions, O as OpenPaginatedResult, a as PaginatedSurface, T as TableCommandPlan, D as DocxEditorInstance } from './index-D8L8WrNF.js';
|
|
10
|
+
export { A as AnchorFrameOrigin, C as CHROME_GROUPS, b as CHROME_MENUS, c as CHROME_UNAVAILABLE_KEY, d as ChromeControl, e as ChromeControlId, f as ChromeControlState, g as ChromeGroup, h as ChromeGroupId, i as ChromeMenu, j as ChromeMenuEntry, k as ChromeMenuId, l as ChromeMenuItemEntry, m as ChromeMenuSeparatorEntry, n as ChromeMenuSubmenuEntry, o as ChromeSlotId, p as DEFAULT_TABLE_CHROME_DRAFT, q as DocxEditorConfig, E as EMU_PER_POINT, F as FinalizedImageOverlayInteraction, r as FontConfigurationBase, s as FontConfigurationFragment, t as FontLoadFailure, u as FontLoadFailureReason, v as FontMeasurementState, w as FontResolutionRequest, x as FontResolver, y as FontUrlSource, H as HyperlinkActivation, z as HyperlinkChromeHandlers, B as HyperlinkOps, I as IMAGE_OVERLAY_NUDGE_PT, G as IMAGE_OVERLAY_NUDGE_SHIFT_PT, J as ImageInteractionSession, K as ImageOverlayScrollPort, L as ImageResizeHandle, M as ImageResizeResult, N as LoadFontsRequest, Q as LoadFontsResult, R as MAX_RESOLVER_FAMILIES, S as OverlayFrameRect, U as PaginatedSurfaceState, V as RunTableChromeCommandResult, W as SelectedDrawingOverlayTarget, X as SurfaceFormatting, Y as SurfaceHyperlink, Z as SurfaceNavigation, _ as SurfaceOverlayCoordinates, $ as TABLE_BORDER_STYLE_OPTIONS, a0 as TABLE_BORDER_TARGET_OPTIONS, a1 as TABLE_BORDER_WIDTH_OPTIONS, a2 as TABLE_CHROME_SLOT_IDS, a3 as TableBorderStyleOption, a4 as TableBorderTargetOption, a5 as TableBorderTargetValue, a6 as TableBorderWidthOption, a7 as TableChromeDraft, a8 as TableChromePick, a9 as TableChromeSlotId, aa as TableInteractionLabelKey, ab as ToolbarCommandState, ac as WORD_DEFAULT_FONT, ad as applyTableChromePick, ae as blankDocumentBytes, af as canExecuteImageCommand, ag as captureImageMutationPreconditions, ah as chromeControlCount, ai as chromeMenuSlots, aj as chromeProbeForSlot, ak as chromeSlotId, al as commandForSlot, am as commandForSlotValue, an as commandForTableChromeSlotValue, ao as composeFontConfiguration, ap as computeImageResizeResult, aq as computeMovedImagePosition, ar as computeResizedImageExtentEmu, as as createDocxEditor, at as createFontSource, au as createImageOverlayScrollPort, av as cssPixelsToLayoutPoints, aw as defaultChromeGroups, ax as defaultTableLabel, ay as emuToOverlayPoints, az as executeImageCommand, aA as finalizeImageOverlayInteraction, aB as formattingBarChromeGroups, aC as isStaleImageInteractionCommit, aD as isTableChromeSlot, aE as layoutPointsToCssPixels, aF as loadFonts, aG as overlayFrameToSheetCssPixels, aH as pointsToEmu, aI as probeTableChromeCommand, aJ as resizePreservesAspect, aK as runSave, aL as runTableChromeCommand, aM as runTableCommand, aN as runToolbarCommand, aO as selectedDrawingOverlayTargetOf, aP as selectedImageStateOf, aQ as surfacePaintScale, aR as tableChromeIconPaths, aS as tableChromeLabelKeyForTarget, aT as tableChromeToolbarState, aU as tableChromeVisible, aV as tableCommandToolbarState, aW as toolbarCommandState, aX as toolbarCommandStates } from './index-D8L8WrNF.js';
|
|
6
11
|
import { A as AutomationCapabilities, a as AutomationHost } from './protocol-DsbfgBwA.js';
|
|
7
12
|
export { CollectReviewItems, EditorModule, EditorModuleRegistry, ReviewModuleContribution, resolveEditorModules } from './contracts/modules.js';
|
|
8
13
|
import { ColorValue } from './contracts/types.js';
|
|
9
|
-
import {
|
|
10
|
-
export {
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
export {
|
|
14
|
-
export {
|
|
15
|
-
export { S as SectionProperties } from './semantic-cell-selection-DZtyMXkH.js';
|
|
16
|
-
export { R as ReviewModelInput } from './review-support-DgXTIYBW.js';
|
|
17
|
-
export { N as NavigationCommand, S as SemanticPosition, a as SemanticSelection } from './semantic-interaction-DrgbgKg6.js';
|
|
18
|
-
export { F as FieldShadingMode } from './semantic-paint-BedBxkyY.js';
|
|
19
|
-
import './contracts/document.js';
|
|
20
|
-
import './revision-projection-DHAkcD_L.js';
|
|
21
|
-
import './ooxml-tree-BU0e3DVi.js';
|
|
22
|
-
import './review-reads-CQmU9Lcl.js';
|
|
14
|
+
import { S as SemanticLayout } from './semantic-records-CdQvpUj1.js';
|
|
15
|
+
export { T as TextMeasurer } from './semantic-records-CdQvpUj1.js';
|
|
16
|
+
export { S as SectionProperties } from './semantic-cell-selection-B5vfPz4Q.js';
|
|
17
|
+
export { R as ReviewModelInput } from './review-support-D4ZBdUXa.js';
|
|
18
|
+
export { N as NavigationCommand, S as SemanticPosition, a as SemanticSelection } from './semantic-interaction-lvpzZRpA.js';
|
|
19
|
+
export { F as FieldShadingMode, R as ReviewAuthorInfo, a as RevisionAuthorAssignments, b as RevisionAuthorStyle, c as RevisionStyles } from './semantic-paint-BBPL3u5w.js';
|
|
23
20
|
import './ooxml-package-D_CtywTW.js';
|
|
24
|
-
import './
|
|
21
|
+
import './ooxml-tree-BU0e3DVi.js';
|
|
22
|
+
import './custom-node-writes-tJw8U9MO.js';
|
|
25
23
|
import './hf-references-BdjsQNE_.js';
|
|
26
24
|
import './note-nodes-BPSTVDMr.js';
|
|
27
|
-
import './tree-store-
|
|
25
|
+
import './tree-store-CIKASRHk.js';
|
|
28
26
|
import 'prosemirror-model';
|
|
27
|
+
import './contracts/document.js';
|
|
28
|
+
import './revision-projection-UKqvPa4-.js';
|
|
29
|
+
import './review-reads-HDvoQXK2.js';
|
|
29
30
|
|
|
30
31
|
interface LayoutShapingInstrumentation {
|
|
31
32
|
readonly onFontByteCopy?: () => void;
|
|
@@ -50,6 +51,14 @@ declare function createLayoutShaping(configuration: FontConfiguration, instrumen
|
|
|
50
51
|
*/
|
|
51
52
|
declare function disposeLayoutShaping(shaping: LayoutShapingOptions): void;
|
|
52
53
|
|
|
54
|
+
/**
|
|
55
|
+
* What `snapshot()` reports before an editor exists: loading, not editable, nothing
|
|
56
|
+
* selected, nothing undoable — never invented state.
|
|
57
|
+
*
|
|
58
|
+
* @public
|
|
59
|
+
*/
|
|
60
|
+
declare const LOADING_SNAPSHOT: EditorSnapshot;
|
|
61
|
+
|
|
53
62
|
/** The engine paints at 96 px per inch (twips / 15, 1440 twips per inch). */
|
|
54
63
|
declare const PX_PER_INCH = 96;
|
|
55
64
|
/** Painted pixels per centimetre, derived from {@link PX_PER_INCH}. */
|
|
@@ -149,6 +158,13 @@ declare function dragIndent(handle: RulerIndentHandle, positionTwips: number, in
|
|
|
149
158
|
*/
|
|
150
159
|
declare function mountPaginatedSurface(container: HTMLElement, bytes: Uint8Array, options?: PaginatedSurfaceOptions): OpenPaginatedResult;
|
|
151
160
|
|
|
161
|
+
/**
|
|
162
|
+
* Stable value identity for a command, including nested payloads.
|
|
163
|
+
*
|
|
164
|
+
* @internal
|
|
165
|
+
*/
|
|
166
|
+
declare function editorCommandKey(command: EditorCommand): string;
|
|
167
|
+
|
|
152
168
|
/** Planner-backed can/plan pair — production gate for table commands. Task 9 maps chrome slots. */
|
|
153
169
|
declare function tableCommandState(command: EditorCommand, surface: PaginatedSurface): {
|
|
154
170
|
readonly can: CanResult;
|
|
@@ -308,4 +324,4 @@ declare function validateSetImagePositionCommand(command: {
|
|
|
308
324
|
readonly relativeToV?: string;
|
|
309
325
|
}, mode: 'frame' | 'simple'): boolean;
|
|
310
326
|
|
|
311
|
-
export { AUTO_ZOOM_MODE, BROWSER_AUTOMATION_CAPABILITIES, type ColorLowerResult, DRAWING_REL_FROM_H, DRAWING_REL_FROM_V, DocxEditorInstance, DrawingPositionInput, FIT_WIDTH_ZOOM_MODE, OpenPaginatedResult, PX_PER_CM, PX_PER_INCH, PaginatedSurface, PaginatedSurfaceOptions, type RulerDragOptions, type RulerIndent, type RulerIndentHandle, type RulerPageMetrics, type RulerTick, type RulerUnit, SNAP_TWIPS_CM, SNAP_TWIPS_INCH, type SurfaceExtent, TWIPS_PER_CM, TWIPS_PER_INCH, ZOOM_MAX, ZOOM_MIN, applyThemeShade, applyThemeTint, createBrowserAutomationHost, createLayoutShaping, disposeLayoutShaping, dragIndent, generateRulerTicks, handlePosition, lowerColorValueForBorder, lowerColorValueForFill, mountPaginatedSurface, positionInputFromPropertiesCommand, propertiesCommandHasPositionFields, resolveColorValueToCss, resolveThemeColorHex, resolveZoomMode, rulerPageBox, sameZoomMode, snapTwips, surfaceExtent, tableCommandState, toEditorFontError, validateDrawingPositionInput, validateSetImagePositionCommand, validateThemeModifier };
|
|
327
|
+
export { AUTO_ZOOM_MODE, BROWSER_AUTOMATION_CAPABILITIES, type ColorLowerResult, DRAWING_REL_FROM_H, DRAWING_REL_FROM_V, DocxEditorInstance, DrawingPositionInput, FIT_WIDTH_ZOOM_MODE, LOADING_SNAPSHOT, OpenPaginatedResult, PX_PER_CM, PX_PER_INCH, PaginatedSurface, PaginatedSurfaceOptions, type RulerDragOptions, type RulerIndent, type RulerIndentHandle, type RulerPageMetrics, type RulerTick, type RulerUnit, SNAP_TWIPS_CM, SNAP_TWIPS_INCH, type SurfaceExtent, TWIPS_PER_CM, TWIPS_PER_INCH, ZOOM_MAX, ZOOM_MIN, applyThemeShade, applyThemeTint, createBrowserAutomationHost, createLayoutShaping, disposeLayoutShaping, dragIndent, editorCommandKey, generateRulerTicks, handlePosition, lowerColorValueForBorder, lowerColorValueForFill, mountPaginatedSurface, positionInputFromPropertiesCommand, propertiesCommandHasPositionFields, resolveColorValueToCss, resolveThemeColorHex, resolveZoomMode, rulerPageBox, sameZoomMode, snapTwips, surfaceExtent, tableCommandState, toEditorFontError, validateDrawingPositionInput, validateSetImagePositionCommand, validateThemeModifier };
|
package/dist/editor.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export{
|
|
1
|
+
export{Ga as AUTO_ZOOM_MODE,La as BROWSER_AUTOMATION_CAPABILITIES,ua as CHROME_GROUPS,ya as CHROME_MENUS,Ba as CHROME_UNAVAILABLE_KEY,X as DEFAULT_TABLE_CHROME_DRAFT,P as EMU_PER_POINT,Ha as FIT_WIDTH_ZOOM_MODE,N as IMAGE_OVERLAY_NUDGE_PT,O as IMAGE_OVERLAY_NUDGE_SHIFT_PT,d as LOADING_SNAPSHOT,e as MAX_RESOLVER_FAMILIES,l as PX_PER_CM,k as PX_PER_INCH,r as SNAP_TWIPS_CM,q as SNAP_TWIPS_INCH,ba as TABLE_BORDER_STYLE_OPTIONS,aa as TABLE_BORDER_TARGET_OPTIONS,ca as TABLE_BORDER_WIDTH_OPTIONS,Y as TABLE_CHROME_SLOT_IDS,p as TWIPS_PER_CM,o as TWIPS_PER_INCH,f as WORD_DEFAULT_FONT,Fa as ZOOM_MAX,Ea as ZOOM_MIN,da as applyTableChromePick,x as applyThemeShade,w as applyThemeTint,h as blankDocumentBytes,L as canExecuteImageCommand,K as captureImageMutationPreconditions,Aa as chromeControlCount,za as chromeMenuSlots,ha as chromeProbeForSlot,va as chromeSlotId,ia as commandForSlot,ka as commandForSlotValue,ja as commandForTableChromeSlotValue,g as composeFontConfiguration,Sa as computeImageResizeResult,U as computeMovedImagePosition,T as computeResizedImageExtentEmu,Ma as createBrowserAutomationHost,Ka as createDocxEditor,j as createFontSource,Ta as createImageOverlayScrollPort,b as createLayoutShaping,H as cropPercentFromCropPermille,F as cropPercentFromPermille,C as cropPercentFromSourceCrop,G as cropPermilleFromCropPercent,E as cropPermilleFromPercent,Pa as cssPixelsToLayoutPoints,wa as defaultChromeGroups,Z as defaultTableLabel,c as disposeLayoutShaping,u as dragIndent,ta as editorCommandKey,S as emuToOverlayPoints,M as executeImageCommand,Ua as finalizeImageOverlayInteraction,xa as formattingBarChromeGroups,m as generateRulerTicks,s as handlePosition,V as isStaleImageInteractionCommit,_ as isTableChromeSlot,Oa as layoutPointsToCssPixels,i as loadFonts,z as lowerColorValueForBorder,A as lowerColorValueForFill,Da as mountPaginatedSurface,Qa as overlayFrameToSheetCssPixels,R as pointsToEmu,ea as probeTableChromeCommand,Ra as resizePreservesAspect,B as resolveColorValueToCss,y as resolveThemeColorHex,Ia as resolveZoomMode,n as rulerPageBox,qa as runSave,oa as runTableChromeCommand,sa as runTableCommand,pa as runToolbarCommand,Ja as sameZoomMode,Q as selectedDrawingOverlayTargetOf,J as selectedImageStateOf,t as snapTwips,D as sourceCropFromCropPercent,Ca as surfaceExtent,Na as surfacePaintScale,ga as tableChromeIconPaths,fa as tableChromeLabelKeyForTarget,la as tableChromeToolbarState,$ as tableChromeVisible,W as tableCommandState,ra as tableCommandToolbarState,a as toEditorFontError,ma as toolbarCommandState,na as toolbarCommandStates,I as validateImageCropPercent,v as validateThemeModifier}from'./chunk-NIGGABAA.js';import'./chunk-WAVN7MAT.js';import'./chunk-OPKOTVQQ.js';import'./chunk-WU7PUTVA.js';import'./chunk-E7BXJ4BF.js';import'./chunk-4GQXAXTZ.js';import'./chunk-UVIUNAQ6.js';import'./chunk-SMRD66T5.js';export{E as DEFAULT_IMAGE_RESOURCE_LIMITS,vf as DRAWING_REL_FROM_H,wf as DRAWING_REL_FROM_V,Xa as IMAGE_WRAP_TARGETS,yf as positionInputFromPropertiesCommand,xf as propertiesCommandHasPositionFields,F as resolveImageResourceLimits,ob as resolveSvgIntrinsicSize,kb as sniffImageMime,uf as validateDrawingPositionInput,pb as validateRasterHeader,zf as validateSetImagePositionCommand}from'./chunk-R75OLPL6.js';import'./chunk-PSZH2VXP.js';export{a as resolveEditorModules}from'./chunk-GQQOL4PV.js';
|
|
Binary file
|
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import
|
|
4
|
-
import { R as RevisionDisplayMode } from './revision-projection-DHAkcD_L.js';
|
|
5
|
-
import './review-support-DgXTIYBW.js';
|
|
6
|
-
import { a as SemanticSelection, S as SemanticPosition, N as NavigationCommand } from './semantic-interaction-DrgbgKg6.js';
|
|
7
|
-
import { R as ResolvedFootnoteProperties, a as ResolvedEndnoteProperties, A as AuthoredNoteProperties, l as ReviewRevisionKind } from './review-reads-CQmU9Lcl.js';
|
|
8
|
-
import { S as SemanticLayout, C as ContentControlBoundaryRecord, T as TextMeasurer } from './semantic-records-CR5hTqMK.js';
|
|
9
|
-
import { S as StoryScope, A as ApplyImagePropertiesInput, d as ImageIntentResult, c as InsertImageInput, B as BookmarkIndex } from './custom-node-writes-BkMgMXxs.js';
|
|
10
|
-
import { C as CellSelection, S as SectionProperties } from './semantic-cell-selection-DZtyMXkH.js';
|
|
1
|
+
import { T as TreeDocOp, d as DrawingPositionInput, l as DrawingTransform, h as DrawingTreeDocOp } from './tree-op-types-D0fTNBVW.js';
|
|
2
|
+
import { b as ImageDecodePort, S as SupportedImageMime } from './image-resources-Cl5_cNi9.js';
|
|
3
|
+
import './review-support-D4ZBdUXa.js';
|
|
11
4
|
import { EditorModule, ReviewModuleContribution } from './contracts/modules.js';
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
5
|
+
import { j as FontSource, k as FontSourceSubstitution, F as FontConfiguration, l as FontFaceRequest, I as ImageContext, D as DocumentSource, Z as ZoomMode, E as EditorFontError, m as Editor, b as EditorCommand, C as CanResult, S as SelectedImageState, V as ViewScope, T as TableBorderEdgeTarget, n as TableBorderSpec, o as TableBorderStyle, p as TableContext } from './editor-D2zOJztO.js';
|
|
6
|
+
import { R as RevisionDisplayMode } from './revision-projection-UKqvPa4-.js';
|
|
7
|
+
import { a as SemanticSelection, S as SemanticPosition, N as NavigationCommand } from './semantic-interaction-lvpzZRpA.js';
|
|
8
|
+
import { R as ResolvedFootnoteProperties, a as ResolvedEndnoteProperties, A as AuthoredNoteProperties, l as ReviewRevisionKind } from './review-reads-HDvoQXK2.js';
|
|
9
|
+
import { S as SemanticLayout, C as ContentControlBoundaryRecord, T as TextMeasurer } from './semantic-records-CdQvpUj1.js';
|
|
10
|
+
import { S as StoryScope, A as ApplyImagePropertiesInput, d as ImageIntentResult, c as InsertImageInput, B as BookmarkIndex } from './custom-node-writes-tJw8U9MO.js';
|
|
11
|
+
import { C as CellSelection, S as SectionProperties } from './semantic-cell-selection-B5vfPz4Q.js';
|
|
12
|
+
import { c as RevisionStyles, R as ReviewAuthorInfo, b as RevisionAuthorStyle, F as FieldShadingMode, d as DrawingPaintStrings } from './semantic-paint-BBPL3u5w.js';
|
|
13
|
+
import { Unsubscribe, ExecResult, IndentFormatting, SelectionPin } from './contracts/types.js';
|
|
14
|
+
import { c as TreeDocxSessionView, a as TreeApplyResult } from './tree-session-CH1oA75f.js';
|
|
15
15
|
import './contracts/document.js';
|
|
16
16
|
|
|
17
17
|
/**
|
|
@@ -1004,6 +1004,14 @@ interface HyperlinkOps {
|
|
|
1004
1004
|
linksInCaretParagraph(): SurfaceHyperlink[];
|
|
1005
1005
|
/** The link the caret sits in, or null. */
|
|
1006
1006
|
linkAtCaret(): SurfaceHyperlink | null;
|
|
1007
|
+
/**
|
|
1008
|
+
* The FIELD link whose painted atom the caret sits on, or null.
|
|
1009
|
+
*
|
|
1010
|
+
* Separate from {@link linkAtCaret} on purpose: a `HYPERLINK` field is not a tree node, so
|
|
1011
|
+
* the typed lane never returns one, and link-create must not mistake a field atom for an
|
|
1012
|
+
* editable link. Resolved from the layout projection, boundary-inclusive.
|
|
1013
|
+
*/
|
|
1014
|
+
fieldLinkAtCaret(): SurfaceHyperlink | null;
|
|
1007
1015
|
/** The link with this node id, or null. */
|
|
1008
1016
|
linkById(linkId: string): SurfaceHyperlink | null;
|
|
1009
1017
|
/**
|
|
@@ -1079,9 +1087,10 @@ interface DocxEditorConfig {
|
|
|
1079
1087
|
*/
|
|
1080
1088
|
container?: HTMLElement;
|
|
1081
1089
|
/**
|
|
1082
|
-
* A document to load at construction
|
|
1083
|
-
* be re-opened (the handle is identity, not
|
|
1084
|
-
* `error` event rather than silently loading
|
|
1090
|
+
* A document to load at construction: DOCX bytes, or `'blank'` for Word's blank
|
|
1091
|
+
* template. A `DocumentHandle` cannot be re-opened (the handle is identity, not
|
|
1092
|
+
* content), so passing one emits a typed `error` event rather than silently loading
|
|
1093
|
+
* nothing. Omitting this mounts NO document, which is not the same as an empty one.
|
|
1085
1094
|
*/
|
|
1086
1095
|
document?: DocumentSource;
|
|
1087
1096
|
/**
|
|
@@ -1111,8 +1120,39 @@ interface DocxEditorConfig {
|
|
|
1111
1120
|
* reason. See {@link EditorModule}.
|
|
1112
1121
|
*/
|
|
1113
1122
|
modules?: readonly EditorModule[];
|
|
1114
|
-
/**
|
|
1115
|
-
|
|
1123
|
+
/**
|
|
1124
|
+
* The mode the editor opens in — one prop, matching the toolbar's three-state pill.
|
|
1125
|
+
*
|
|
1126
|
+
* - `'edit'` — opens in editing, even when the document's `w:trackRevisions` asks for
|
|
1127
|
+
* tracked changes; the reader still moves between modes from the toolbar.
|
|
1128
|
+
* - `'suggesting'` — opens in suggesting. It needs what suggesting always needs — a
|
|
1129
|
+
* review module and an {@link DocxEditorConfig.author} — and falls back to editing
|
|
1130
|
+
* with the reason published when either is missing.
|
|
1131
|
+
* - `'view'` — read-only: every mutating command through the facade is refused, and
|
|
1132
|
+
* the toolbar cannot leave viewing.
|
|
1133
|
+
* - Omitted — the DOCUMENT decides: a package carrying `w:trackRevisions` opens in
|
|
1134
|
+
* suggesting, everything else in editing.
|
|
1135
|
+
*/
|
|
1136
|
+
mode?: 'edit' | 'view' | 'suggesting';
|
|
1137
|
+
/**
|
|
1138
|
+
* How painted tracked changes are coloured. Presentation only — nothing is serialised.
|
|
1139
|
+
*
|
|
1140
|
+
* - `'author'` (the DEFAULT) — every change takes its author's colour from the
|
|
1141
|
+
* `--doc-review-author-N` ramp, by order of first appearance, as Word does. Restyle a
|
|
1142
|
+
* slot under `.docx-editor` to change the ramp.
|
|
1143
|
+
* - `'kind'` — insertions green, deletions red, so "added" and "removed" are what a
|
|
1144
|
+
* glance tells apart, whoever proposed them.
|
|
1145
|
+
* - {@link RevisionAuthorAssignments} — style the named authors; `others` decides
|
|
1146
|
+
* whether the rest take the ramp (the default) or the kind colours.
|
|
1147
|
+
*
|
|
1148
|
+
* The opening value. In React this is authored declaratively — `DocxEditor.ColorByChangeType`
|
|
1149
|
+
* and `DocxEditor.AuthorStyle` compose and apply it, seeding this config for the first
|
|
1150
|
+
* paint — so React hosts never pass it by hand; it is the entry for headless hosts. Read
|
|
1151
|
+
* the document's resolved roster with `getReviewAuthors`. Applies wherever revision
|
|
1152
|
+
* markup paints: the full all-markup view needs a review module registered; without one
|
|
1153
|
+
* the proposed view still marks surviving insertions.
|
|
1154
|
+
*/
|
|
1155
|
+
revisionStyles?: RevisionStyles;
|
|
1116
1156
|
/** Override raster decode for insert/replace image commands; defaults to browser/headless. */
|
|
1117
1157
|
imageDecodePort?: ImageDecodePort;
|
|
1118
1158
|
/**
|
|
@@ -1202,6 +1242,58 @@ interface DocxEditorInstance extends Editor {
|
|
|
1202
1242
|
* `stateVersion()`.
|
|
1203
1243
|
*/
|
|
1204
1244
|
fontMeasurement(): FontMeasurementState;
|
|
1245
|
+
/**
|
|
1246
|
+
* Every author the review surface DRAWS, in Word's slot order, with the colour the review
|
|
1247
|
+
* chrome draws them in. The discovery surface a legend or colour picker builds on —
|
|
1248
|
+
* authors depend on the loaded file, so they cannot be known at configuration time.
|
|
1249
|
+
*
|
|
1250
|
+
* The colour is the author's, not the document's: under `'kind'` the painted text goes to
|
|
1251
|
+
* the insertion/deletion colours while the cards keep these accents, so a legend built
|
|
1252
|
+
* from this describes the rail rather than the page.
|
|
1253
|
+
*
|
|
1254
|
+
* BOTH HALVES OF REVIEW. Authors of tracked changes come first, numbered by where their
|
|
1255
|
+
* first change appears; authors who only commented follow. One person therefore draws in
|
|
1256
|
+
* one colour across their comments and their edits, which is what a reader assumes the
|
|
1257
|
+
* moment they learn the pairing on either. The order puts commenters last so that adding
|
|
1258
|
+
* a comment can never renumber a tracked change the painter has already drawn.
|
|
1259
|
+
*
|
|
1260
|
+
* Read of the rendered projection, not of the package: a resolved view hides the
|
|
1261
|
+
* revisions it has resolved away, so an author whose only change is hidden there is
|
|
1262
|
+
* listed only if they also commented. Empty while detached. Reference-stable between
|
|
1263
|
+
* changes, so it is safe as a dependency; changes bump `stateVersion()`.
|
|
1264
|
+
*/
|
|
1265
|
+
getReviewAuthors(): readonly ReviewAuthorInfo[];
|
|
1266
|
+
/**
|
|
1267
|
+
* The configured author used when a comment or reply omits an explicit author.
|
|
1268
|
+
*
|
|
1269
|
+
* @internal Review compose chrome uses this to draw an unfinished comment in the same
|
|
1270
|
+
* author colour it will receive after commit.
|
|
1271
|
+
*/
|
|
1272
|
+
getConfiguredAuthor(): string | null;
|
|
1273
|
+
/**
|
|
1274
|
+
* The style declared for one author, whether or not the SURFACE has published them yet —
|
|
1275
|
+
* so review chrome can draw a card the rail is holding before the roster catches up.
|
|
1276
|
+
*
|
|
1277
|
+
* {@link DocxEditorInstance.getReviewAuthors} answers for every author of a tracked
|
|
1278
|
+
* change or a comment, so this is a narrow fallback rather than the way to reach a
|
|
1279
|
+
* commenter.
|
|
1280
|
+
*
|
|
1281
|
+
* @internal The seam `@docx-editor.dev/pro`'s review rail resolves those authors
|
|
1282
|
+
* through. A consumer reads `useReviewAuthor` (pro) or `useReviewAuthors` (react)
|
|
1283
|
+
* instead; nothing here answers a question those two do not.
|
|
1284
|
+
*/
|
|
1285
|
+
getReviewAuthorStyle(author: string): RevisionAuthorStyle | undefined;
|
|
1286
|
+
/**
|
|
1287
|
+
* Replace how tracked changes are coloured, live. Paint-level: pages repaint without a
|
|
1288
|
+
* layout pass, and the caret, selection and undo history stay where they are. Pass
|
|
1289
|
+
* `'author'` to restore the default, or `'kind'` to opt out to the green/red
|
|
1290
|
+
* rendering. Survives a document reload.
|
|
1291
|
+
*
|
|
1292
|
+
* The imperative PRIMITIVE beneath React's declarative lane: `DocxEditor.ColorByChangeType`
|
|
1293
|
+
* and `DocxEditor.AuthorStyle` drive this seam, and React hosts declare those instead
|
|
1294
|
+
* of calling it. Call it directly from headless and non-React hosts.
|
|
1295
|
+
*/
|
|
1296
|
+
setRevisionStyles(styles: RevisionStyles): void;
|
|
1205
1297
|
/**
|
|
1206
1298
|
* Mount into `el`. If the instance holds pending document bytes (created without a
|
|
1207
1299
|
* container, or previously detached), they mount now — under the shaped measurer when
|
|
@@ -1594,6 +1686,13 @@ interface PaginatedSurfaceOptions {
|
|
|
1594
1686
|
* without remeasuring a single line.
|
|
1595
1687
|
*/
|
|
1596
1688
|
readonly fieldShading?: FieldShadingMode;
|
|
1689
|
+
/**
|
|
1690
|
+
* How tracked changes are coloured: by AUTHOR (the default), by kind, or by author with
|
|
1691
|
+
* host-pinned colours. A paint-level option like {@link fieldShading}: it changes no
|
|
1692
|
+
* geometry, so switching it repaints without remeasuring a line. Applies wherever
|
|
1693
|
+
* revision markup paints, whatever the {@link revisionDisplayMode} leaves visible.
|
|
1694
|
+
*/
|
|
1695
|
+
readonly revisionStyles?: RevisionStyles;
|
|
1597
1696
|
/**
|
|
1598
1697
|
* The review module's derivation hooks for this surface's session. Absent,
|
|
1599
1698
|
* `session.reviewItems()` is the typed empty queue and every review affordance
|
|
@@ -1811,10 +1910,10 @@ interface ContentControlSurfaceState {
|
|
|
1811
1910
|
* `session` to apply ops directly bypasses the layout invalidation and the caret bookkeeping.
|
|
1812
1911
|
*/
|
|
1813
1912
|
interface PaginatedSurface {
|
|
1814
|
-
readonly session:
|
|
1913
|
+
readonly session: TreeDocxSessionView;
|
|
1815
1914
|
storyScope(): StoryScope;
|
|
1816
1915
|
imageDecodePort(): ImageDecodePort;
|
|
1817
|
-
applyDrawingOps(ops: readonly DrawingTreeDocOp[]):
|
|
1916
|
+
applyDrawingOps(ops: readonly DrawingTreeDocOp[]): TreeApplyResult;
|
|
1818
1917
|
applyImageProperties(input: ApplyImagePropertiesInput): ImageIntentResult;
|
|
1819
1918
|
deleteImage(drawingNodeId: string): ImageIntentResult;
|
|
1820
1919
|
insertImage(input: Omit<InsertImageInput, 'decodePort'>): Promise<ImageIntentResult>;
|
|
@@ -1827,6 +1926,21 @@ interface PaginatedSurface {
|
|
|
1827
1926
|
/** One-based page at the caret, or at the centre of the mounted viewport. */
|
|
1828
1927
|
currentPage(mode?: 'viewport' | 'caret'): number;
|
|
1829
1928
|
type(text: string): void;
|
|
1929
|
+
/**
|
|
1930
|
+
* Queue plain typed text for a batched commit at the caret.
|
|
1931
|
+
*
|
|
1932
|
+
* The DOM input lane's entry: keystrokes arriving in a burst append here and land
|
|
1933
|
+
* through ONE `type()` call — one transaction, one undo step, one layout flush —
|
|
1934
|
+
* when the input queue drains. Every surface-level mutation, selection or scope
|
|
1935
|
+
* move, geometry read, composition start and teardown flushes the buffer first.
|
|
1936
|
+
* Code reading `session` directly (its text or its bytes) sits BELOW the buffer
|
|
1937
|
+
* and must call {@link flushPendingInput} first, as the facade's save/detach
|
|
1938
|
+
* paths do. `type()` itself stays synchronous; automation and commands should
|
|
1939
|
+
* keep calling it directly.
|
|
1940
|
+
*/
|
|
1941
|
+
enqueueType(text: string): void;
|
|
1942
|
+
/** Land any queued typed text now, as its own transaction. No-op when empty. */
|
|
1943
|
+
flushPendingInput(): void;
|
|
1830
1944
|
/**
|
|
1831
1945
|
* Insert text whose newlines are PARAGRAPH BOUNDARIES, in one commit.
|
|
1832
1946
|
*
|
|
@@ -2096,9 +2210,9 @@ interface PaginatedSurface {
|
|
|
2096
2210
|
* which is what lets a host close its panel on "the user clicked somewhere else" without
|
|
2097
2211
|
* every adapter reimplementing that comparison.
|
|
2098
2212
|
*/
|
|
2099
|
-
retainSelection():
|
|
2100
|
-
/** Drop
|
|
2101
|
-
releaseSelection(): void;
|
|
2213
|
+
retainSelection(): SelectionPin;
|
|
2214
|
+
/** Drop one owned pin. Another owner's pin remains visible. */
|
|
2215
|
+
releaseSelection(pin: SelectionPin): void;
|
|
2102
2216
|
/** The pinned range, or null once it was released or escaped. */
|
|
2103
2217
|
retainedSelection(): SemanticSelection | null;
|
|
2104
2218
|
/**
|
|
@@ -2110,6 +2224,17 @@ interface PaginatedSurface {
|
|
|
2110
2224
|
*/
|
|
2111
2225
|
editingMode(): SurfaceEditingMode;
|
|
2112
2226
|
setEditingMode(mode: SurfaceEditingMode): void;
|
|
2227
|
+
/**
|
|
2228
|
+
* Every author with a revision in the CURRENT layout, mapped to Word's colour slot by
|
|
2229
|
+
* order of first appearance. One map instance per layout, so a caller can key caches on
|
|
2230
|
+
* its identity.
|
|
2231
|
+
*/
|
|
2232
|
+
revisionAuthors(): ReadonlyMap<string, number>;
|
|
2233
|
+
/**
|
|
2234
|
+
* Replace how tracked changes are coloured, live. Paint-level: the pages repaint without
|
|
2235
|
+
* remeasuring a line, and the caret, selection and undo history stay where they are.
|
|
2236
|
+
*/
|
|
2237
|
+
setRevisionStyles(colors: RevisionStyles | undefined): void;
|
|
2113
2238
|
/**
|
|
2114
2239
|
* Commit ops that came from automation, through the gate a keystroke goes through.
|
|
2115
2240
|
*
|
|
@@ -2168,6 +2293,36 @@ interface PaginatedSurface {
|
|
|
2168
2293
|
* while the text stayed highlighted.
|
|
2169
2294
|
*/
|
|
2170
2295
|
activeReviewKey(): string | null;
|
|
2296
|
+
/**
|
|
2297
|
+
* Open THIS item, named by key, for as long as `selection` stays the live one.
|
|
2298
|
+
*
|
|
2299
|
+
* Without it the caret is the only evidence of which card is open, and a caret cannot name a
|
|
2300
|
+
* card when two cards cover exactly the same characters: `w:ins` wrapping `w:del` — content
|
|
2301
|
+
* one reviewer added and another struck — gives the insertion and the deletion one identical
|
|
2302
|
+
* range, and every click on either card classified back to whichever the queue happened to
|
|
2303
|
+
* list first. The reader clicked "Deleted" and watched "Added" light up.
|
|
2304
|
+
*
|
|
2305
|
+
* A key, not a position, because the position is precisely what is ambiguous. It holds only
|
|
2306
|
+
* while the selection matches; a pointer or keyboard move hands the answer back to the caret,
|
|
2307
|
+
* which is what lets the reader step out of a card by clicking away from it.
|
|
2308
|
+
*
|
|
2309
|
+
* `selection` is what activation wants installed, and it is installed HERE rather than by a
|
|
2310
|
+
* `setSelection` of the caller's own so that the pin is up before anything is published. The
|
|
2311
|
+
* other order repainted the bands and reported state while the caret was still the only
|
|
2312
|
+
* evidence, so a host saw the wrong twin active for one frame and then a correction. Omit it
|
|
2313
|
+
* to pin against the live selection, which is what a header or note scope has already set.
|
|
2314
|
+
*/
|
|
2315
|
+
activateReview(key: string, selection?: SemanticSelection): void;
|
|
2316
|
+
/**
|
|
2317
|
+
* The key {@link activateReview} pinned, or null once its selection is no longer live.
|
|
2318
|
+
*
|
|
2319
|
+
* Exists so nothing outside the surface keeps its own copy of "the selection came from
|
|
2320
|
+
* opening a card". `selectionPlacement` needs that fact to stay quiet about offering a
|
|
2321
|
+
* comment on text the reader only selected by opening a card over it, and the copy it used to
|
|
2322
|
+
* keep was set on one of activation's three branches, so a header card offered to comment on
|
|
2323
|
+
* itself.
|
|
2324
|
+
*/
|
|
2325
|
+
activatedReviewKey(): string | null;
|
|
2171
2326
|
/**
|
|
2172
2327
|
* Close the open item until the caret next moves.
|
|
2173
2328
|
*
|