@eigenpal/docx-editor-core/prosemirror/commands/formatting
Text Formatting Commands — thin re-exports from extension system
Toggle marks, set marks, clear formatting, hyperlinks. All implementations live in extensions/marks/; this file re-exports for backward compatibility.
Functions (16)
createRemoveMarkCommandfunctionSource ↗
Create a command that removes a mark from the selection
declare function createRemoveMarkCommand(markType: MarkType): Command;createSetMarkCommandfunctionSource ↗
Create a command that sets a mark on the selection
declare function createSetMarkCommand(markType: MarkType, attrs?: Record<string, unknown>): Command;findHyperlinkRangeAtfunctionSource ↗
Resolve the hyperlink mark + contiguous range that surrounds the current cursor. Used by edit/remove popup actions in both adapters.
Resolution order for the mark itself: 1. $from.marks() — the normal active-marks lookup 2. $from.nodeAfter/nodeBefore marks — boundary positions don't report active marks via marks() 3. (optional) text-node search by fallbackHref — last resort when the popup knows the href but the cursor sits at a gap
The returned range walks the parent block grouping consecutive text nodes that share the same href, and returns whichever range contains the cursor.
declare function findHyperlinkRangeAt(state: EditorState, fallbackHref?: string): {
mark: Mark;
start: number;
end: number;
} | null;getHyperlinkAttrsfunctionSource ↗
declare function getHyperlinkAttrs(state: EditorState): {
href: string;
tooltip?: string;
} | null;getMarkAttrfunctionSource ↗
Get the current value of a mark attribute
declare function getMarkAttr(state: EditorState, markType: MarkType, attr: string): unknown | null;getSelectedTextfunctionSource ↗
declare function getSelectedText(state: EditorState): string;insertHyperlinkfunctionSource ↗
declare function insertHyperlink(text: string, href: string, tooltip?: string): Command;isHyperlinkActivefunctionSource ↗
declare function isHyperlinkActive(state: EditorState): boolean;isMarkActivefunctionSource ↗
Check if a mark is active in the current selection
declare function isMarkActive(state: EditorState, markType: MarkType, attrs?: Record<string, unknown>): boolean;setFontFamilyfunctionSource ↗
declare function setFontFamily(fontName: string): Command;setFontSizefunctionSource ↗
declare function setFontSize(size: number): Command;setHighlightfunctionSource ↗
declare function setHighlight(color: string): Command;setHyperlinkfunctionSource ↗
declare function setHyperlink(href: string, tooltip?: string): Command;setTextColorfunctionSource ↗
declare function setTextColor(attrs: TextColorAttrs): Command;setUnderlineStylefunctionSource ↗
declare function setUnderlineStyle(style: string, color?: TextColorAttrs): Command;textFormattingToMarksfunctionSource ↗
Text Formatting Commands — thin re-exports from extension system
Toggle marks, set marks, clear formatting, hyperlinks. All implementations live in extensions/marks/; this file re-exports for backward compatibility.
declare function textFormattingToMarks(formatting: TextFormatting): Mark[];Variables (12)
clearFontFamilyconstSource ↗
clearFontFamily: CommandclearFontSizeconstSource ↗
clearFontSize: CommandclearFormattingconstSource ↗
Clear all text formatting (remove all marks)
clearFormatting: CommandclearHighlightconstSource ↗
clearHighlight: CommandclearTextColorconstSource ↗
clearTextColor: CommandremoveHyperlinkconstSource ↗
removeHyperlink: CommandtoggleBoldconstSource ↗
toggleBold: CommandtoggleItalicconstSource ↗
toggleItalic: CommandtoggleStrikeconstSource ↗
toggleStrike: CommandtoggleSubscriptconstSource ↗
toggleSubscript: CommandtoggleSuperscriptconstSource ↗
toggleSuperscript: CommandtoggleUnderlineconstSource ↗
toggleUnderline: Command