New

docx-editor 1.x has shipped. Vue support, i18n, agents. Read the migration guide →

API Referencev1.3.2

@eigenpal/docx-editor-core/prosemirror/imageCommit

Functions(4)

Floating drag commit: rewrite the anchor's margin-relative `position` offsets (in EMU) so the image lands at the drop point while staying floating. Returns `pmPos` to re-select, or null on no-op / failure.

declare function commitImageFloatMove(view: EditorView, pmPos: number, hOffsetEmu: number, vOffsetEmu: number): number | null;

Inline drag commit: move the image node to `dropPos` via a delete + insert pair. Returns the PM position to re-select, or null when the drop is a no-op (same slot) or fails.

declare function commitImageInlineMove(view: EditorView, pmPos: number, dropPos: number): number | null;

Resize commit: set the image node's `width`/`height`. Returns `pmPos` to re-select, or null if the position no longer holds an image.

declare function commitImageResize(view: EditorView, pmPos: number, newWidth: number, newHeight: number): number | null;

True when the image is floating (anchored) rather than inline.

declare function isFloatingImage(node: Node): boolean;