oasis-editor 0.0.226 → 0.0.228
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/OasisEditorApp-CpKYMW3z.js +1 -0
- package/dist/app/controllers/EditorCommandsController.d.ts +6 -1
- package/dist/app/services/FindReplaceService.d.ts +6 -18
- package/dist/assets/{importDocxWorker-D9et8X0W.js → importDocxWorker-dPLECw5a.js} +197 -181
- package/dist/core/commands/builtinCommands.d.ts +1 -1
- package/dist/core/commands/dropCap.d.ts +23 -0
- package/dist/core/commands/fieldDate.d.ts +6 -0
- package/dist/core/commands/findReplace.d.ts +25 -0
- package/dist/core/commands/floatingAlignCommands.d.ts +98 -0
- package/dist/core/commands/floatingReorderCommands.d.ts +17 -0
- package/dist/core/commands/headerFooter.d.ts +17 -0
- package/dist/core/commands/horizontalLine.d.ts +3 -0
- package/dist/core/commands/hyphenation.d.ts +27 -0
- package/dist/core/commands/image.d.ts +45 -0
- package/dist/core/commands/noteOptions.d.ts +22 -0
- package/dist/core/commands/outlineStep.d.ts +13 -0
- package/dist/core/commands/pageSetup.d.ts +41 -1
- package/dist/core/commands/paragraphAdjustRightInd.d.ts +8 -0
- package/dist/core/commands/paragraphAlign.d.ts +10 -0
- package/dist/core/commands/paragraphAutoSpaceDE.d.ts +8 -0
- package/dist/core/commands/paragraphAutoSpaceDN.d.ts +8 -0
- package/dist/core/commands/paragraphBidi.d.ts +7 -0
- package/dist/core/commands/paragraphContextualSpacing.d.ts +7 -0
- package/dist/core/commands/paragraphKeepLinesTogether.d.ts +7 -0
- package/dist/core/commands/paragraphKeepWithNext.d.ts +7 -0
- package/dist/core/commands/paragraphKinsoku.d.ts +8 -0
- package/dist/core/commands/paragraphLineRule.d.ts +10 -0
- package/dist/core/commands/paragraphListLevel.d.ts +8 -0
- package/dist/core/commands/paragraphMirrorIndents.d.ts +7 -0
- package/dist/core/commands/paragraphMove.d.ts +8 -0
- package/dist/core/commands/paragraphOutlineLevel.d.ts +11 -0
- package/dist/core/commands/paragraphOverflowPunct.d.ts +8 -0
- package/dist/core/commands/paragraphPageBreakBefore.d.ts +7 -0
- package/dist/core/commands/paragraphReset.d.ts +9 -0
- package/dist/core/commands/paragraphSort.d.ts +7 -0
- package/dist/core/commands/paragraphSuppressAutoHyphens.d.ts +7 -0
- package/dist/core/commands/paragraphSuppressLineNumbers.d.ts +7 -0
- package/dist/core/commands/paragraphTabs.d.ts +28 -0
- package/dist/core/commands/paragraphTextDirection.d.ts +9 -0
- package/dist/core/commands/paragraphTopLinePunct.d.ts +7 -0
- package/dist/core/commands/paragraphWidowControl.d.ts +8 -0
- package/dist/core/commands/paragraphWordWrap.d.ts +8 -0
- package/dist/core/commands/publicCommandTypes.d.ts +190 -3
- package/dist/core/commands/selectUnit.d.ts +43 -0
- package/dist/core/commands/shape.d.ts +4 -0
- package/dist/core/commands/shapeFillCommands.d.ts +31 -0
- package/dist/core/commands/specialChar.d.ts +18 -0
- package/dist/core/commands/table/tableAlignmentCommands.d.ts +10 -0
- package/dist/core/commands/table/tableAutoFitCommands.d.ts +16 -0
- package/dist/core/commands/table/tableCellFitTextCommands.d.ts +7 -0
- package/dist/core/commands/table/tableCellMarginsCommands.d.ts +20 -0
- package/dist/core/commands/table/tableCellNoWrapCommands.d.ts +7 -0
- package/dist/core/commands/table/tableCellSpacingCommands.d.ts +9 -0
- package/dist/core/commands/table/tableColumnCommands.d.ts +10 -0
- package/dist/core/commands/table/tableDeleteCellsCommands.d.ts +16 -0
- package/dist/core/commands/table/tableDeleteCommands.d.ts +11 -0
- package/dist/core/commands/table/tableFormulaCommands.d.ts +34 -0
- package/dist/core/commands/table/tableIndentCommands.d.ts +9 -0
- package/dist/core/commands/table/tableRepeatHeaderCommands.d.ts +15 -0
- package/dist/core/commands/table/tableRowBreakAcrossPagesCommands.d.ts +9 -0
- package/dist/core/commands/table/tableRowCommands.d.ts +2 -0
- package/dist/core/commands/table/tableRowHeightCommands.d.ts +21 -0
- package/dist/core/commands/table/tableSelectionCommands.d.ts +18 -0
- package/dist/core/commands/table/tableSortCommands.d.ts +16 -0
- package/dist/core/commands/table/tableSplitCommands.d.ts +16 -0
- package/dist/core/commands/table/tableStyleCommands.d.ts +9 -0
- package/dist/core/commands/table.d.ts +16 -0
- package/dist/core/commands/text.d.ts +1 -1
- package/dist/core/commands/textBoxBodyCommands.d.ts +43 -0
- package/dist/core/commands/textFormatting.d.ts +15 -0
- package/dist/core/commands/zoneBlocks.d.ts +10 -0
- package/dist/core/engine.d.ts +3 -0
- package/dist/core/model/types/primitives.d.ts +10 -0
- package/dist/core/textStyle/textStyleKeys.d.ts +3 -3
- package/dist/core/transactionMergeKeys.d.ts +35 -0
- package/dist/defaultToolbar-Em7_omZA.js +1 -0
- package/dist/export/docx/docxTypes.d.ts +1 -0
- package/dist/i18n/locales/en.d.ts +18 -0
- package/dist/i18n/locales/pt-BR.d.ts +18 -0
- package/dist/layoutProjection/floatingObjects.d.ts +3 -0
- package/dist/oasis-editor.js +1 -1
- package/dist/oasis-editor.umd.cjs +1 -1
- package/dist/plugins/internal/essentialsCapabilities.d.ts +314 -2
- package/dist/plugins/internal/essentialsCommandBuilders.d.ts +2 -0
- package/dist/plugins/internal/essentialsCommandGroups/table.d.ts +3 -2
- package/dist/ui/app/createAppCommandsController.d.ts +12 -2
- package/dist/ui/app/createEditorCommandRuntime.d.ts +11 -1
- package/dist/ui/app/essentials/types.d.ts +2 -0
- package/dist/ui/components/Toolbar/marginPresets.d.ts +5 -9
- package/dist/ui/toolbarStyleState.d.ts +22 -3
- package/package.json +1 -1
- package/dist/OasisEditorApp-CjSBBmts.js +0 -1
- package/dist/defaultToolbar-NDF0Ecan.js +0 -1
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const OASIS_BUILTIN_COMMANDS: readonly ["selectAll", "insertFootnote", "insertText", "insertEquation", "updateEquation", "insertTableOfContents", "updateTableOfContents", "pastePlainText", "paste", "pasteAsPlainText", "pasteMergeFormatting", "formatPainter", "formatPainterContinuous", "cancelFormatPainter", "bold", "italic", "underline", "strike", "superscript", "subscript", "link", "unlink", "alignLeft", "alignCenter", "alignRight", "alignJustify", "orderedList", "bulletList", "find", "replace", "toggleTrackChanges", "acceptRevisions", "rejectRevisions", "acceptAllRevisions", "rejectAllRevisions", "nextRevision", "previousRevision", "nextComment", "previousComment", "newComment", "replyComment", "editComment", "toggleCommentsPanel", "resolveComment", "reopenComment", "deleteComment", "toggleShowMargins", "toggleShowParagraphMarks", "togglePreciseFonts", "undo", "redo", "pageBreak", "lineBreak", "columnBreak", "splitBlock", "setFontFamily", "setFontSize", "increaseFontSize", "decreaseFontSize", "changeTextCase", "clearFormatting", "setColor", "setHighlight", "setTextShading", "setStyleId", "setCharacterStyleId", "setUnderlineStyle", "documentStyles", "print", "copy", "cut", "newDocument", "exportDocx", "exportPdf", "importDocument", "insertHtml", "insertImage", "editImageAlt", "insertImageCaption", "imageContext", "imageWidthCm", "imageHeightCm", "imageCrop", "imageCropAspect", "imageCropShape", "imageCropFill", "imageCropFit", "imageCropReset", "imageBorder", "outdent", "indent", "togglePageBreakBefore", "toggleKeepWithNext", "setSpacingAfter", "setSpacingBefore", "setIndentLeft", "setIndentRight", "setIndentFirstLine", "setIndentHanging", "setSpecialIndent", "setParagraphShading", "applyParagraphBorders", "setLineHeight", "setListFormat", "setListStartAt", "toggleOrientation", "setOrientation", "sectionBreakNextPage", "sectionBreakContinuous", "sectionBreakEvenPage", "sectionBreakOddPage", "sectionBreakNextColumn", "setPageMargins", "setSectionPageNumbering", "setPaperSize", "setPaperSizePreset", "setColumns", "setColumnsPreset", "editHeader", "editFooter", "editFirstPageHeader", "editEvenPageHeader", "editFirstPageFooter", "editEvenPageFooter", "insertPageNumber", "insertPageNumberXOfY", "placePageNumberTop", "placePageNumberBottom", "insertBookmark", "removeBookmark", "insertDateField", "insertCrossReference", "exitHeaderFooter", "applyDocumentTheme", "setDocumentColorScheme", "setDocumentFontScheme", "setDocumentParagraphSpacing", "setDocumentEffects", "setDocumentPageColor", "setDocumentWatermark", "setDocumentPageBorder", "setDocumentDesignDefault", "tableContext", "tableMerge", "tableSplit", "tableInsertColumnBefore", "tableInsertColumnAfter", "tableDeleteColumn", "tableInsertRowBefore", "tableInsertRowAfter", "tableDeleteRow", "tableCellShading", "tableCellBorders", "tableCellNoBorders", "tableApplyBorderPreset", "toggleTableDrawBorders", "toggleTableGridlines", "tableWidth100", "tableAlignLeft", "tableAlignCenter", "tableAlignRight", "tableSetCellVerticalAlign", "tableSetCellTextDirection", "tableToText", "textToTable", "tableSetCellWidth", "tableToggleHeaderRow", "tableToggleTotalRow", "tableToggleBandedRows", "tableToggleFirstColumn", "tableToggleLastColumn", "tableToggleBandedColumns", "setTableStyle", "tableToggleAutoFit", "tableDistributeColumns", "tableDistributeRows", "insertTable", "insertShape", "openSymbolDialog", "openEquationDialog"];
|
|
1
|
+
export declare const OASIS_BUILTIN_COMMANDS: readonly ["selectAll", "selectWord", "selectSentence", "selectParagraph", "selectCollapse", "selectText", "selectRange", "insertFootnote", "insertText", "insertEquation", "updateEquation", "insertTableOfContents", "updateTableOfContents", "pastePlainText", "paste", "pasteAsPlainText", "pasteMergeFormatting", "formatPainter", "formatPainterContinuous", "cancelFormatPainter", "bold", "italic", "underline", "doubleUnderline", "wordUnderline", "strike", "doubleStrike", "smallCaps", "allCaps", "hidden", "noProof", "webHidden", "specVanish", "contextualAlternates", "characterBorder", "shadow", "emboss", "engrave", "outline", "superscript", "subscript", "link", "unlink", "alignLeft", "alignCenter", "alignRight", "alignJustify", "orderedList", "bulletList", "find", "replace", "replaceAll", "toggleTrackChanges", "acceptRevisions", "rejectRevisions", "acceptAllRevisions", "rejectAllRevisions", "nextRevision", "previousRevision", "nextComment", "previousComment", "newComment", "replyComment", "editComment", "toggleCommentsPanel", "resolveComment", "reopenComment", "deleteComment", "toggleShowMargins", "toggleShowParagraphMarks", "togglePreciseFonts", "undo", "redo", "pageBreak", "lineBreak", "columnBreak", "splitBlock", "insertNonBreakingSpace", "insertNonBreakingHyphen", "insertOptionalHyphen", "insertEmDash", "insertEllipsis", "insertCopyright", "insertRegistered", "insertTrademark", "setFontFamily", "setFontSize", "increaseFontSize", "decreaseFontSize", "growFont1", "shrinkFont1", "changeTextCase", "clearFormatting", "setColor", "setHighlight", "setTextShading", "setStyleId", "setCharacterStyleId", "setUnderlineStyle", "setUnderlineColor", "setCharacterScale", "setCharacterSpacing", "setRunSnapToGrid", "setFitText", "setBaselineShift", "setEmphasisMark", "setTextEffect", "setKerning", "setLigatures", "setNumberSpacing", "setNumberForm", "setStylisticSet", "documentStyles", "print", "copy", "cut", "newDocument", "exportDocx", "exportPdf", "importDocument", "insertHtml", "insertImage", "editImageAlt", "insertImageCaption", "imageContext", "imageWidthCm", "imageHeightCm", "imageCrop", "imageCropAspect", "imageCropShape", "imageCropFill", "imageCropFit", "imageCropReset", "imageFlip", "imageRotate", "imageBorder", "imageTransparency", "resetImage", "outdent", "indent", "moveParagraphsUp", "moveParagraphsDown", "togglePageBreakBefore", "toggleKeepWithNext", "toggleKeepLinesTogether", "toggleWidowControl", "toggleParagraphBidi", "setParagraphBidi", "setParagraphAlign", "sortParagraphs", "promote", "demote", "resetParagraphFormatting", "setParagraphTabStops", "setOutlineLevel", "setSpacingAfter", "setSpacingBefore", "setContextualSpacing", "setMirrorIndents", "setLineRule", "setTextDirection", "setSuppressAutoHyphens", "setSuppressLineNumbers", "setKinsoku", "setOverflowPunct", "setWordWrap", "setAutoSpaceDE", "setAutoSpaceDN", "setAdjustRightInd", "setTopLinePunct", "setPageBreakBefore", "setKeepWithNext", "setKeepLinesTogether", "setWidowControl", "setIndentLeft", "setIndentRight", "setIndentFirstLine", "setIndentHanging", "setSpecialIndent", "setParagraphShading", "applyParagraphBorders", "applyHorizontalLine", "setDropCap", "setLineHeight", "setListFormat", "setListStartAt", "setListLevel", "toggleOrientation", "setOrientation", "sectionBreakNextPage", "sectionBreakContinuous", "sectionBreakEvenPage", "sectionBreakOddPage", "sectionBreakNextColumn", "setPageMargins", "setMarginsPreset", "setSectionPageNumbering", "setPaperSize", "setPaperSizePreset", "setColumns", "setColumnsPreset", "setSectionVerticalAlign", "setSectionStart", "setSectionBidi", "setHyphenation", "editHeader", "editFooter", "editFirstPageHeader", "editEvenPageHeader", "editFirstPageFooter", "editEvenPageFooter", "insertPageNumber", "insertPageNumberXOfY", "placePageNumberTop", "placePageNumberBottom", "insertBookmark", "removeBookmark", "insertDateField", "insertDateTime", "insertCrossReference", "setNoteOptions", "exitHeaderFooter", "setDifferentFirstPage", "setDifferentOddEven", "applyDocumentTheme", "setDocumentColorScheme", "setDocumentFontScheme", "setDocumentParagraphSpacing", "setDocumentEffects", "setDocumentPageColor", "setDocumentWatermark", "setDocumentPageBorder", "setDocumentDesignDefault", "tableContext", "tableMerge", "tableSplit", "tableInsertColumnBefore", "tableInsertColumnAfter", "tableDeleteColumn", "tableDeleteCells", "tableInsertRowBefore", "tableInsertRowAfter", "tableDeleteRow", "tableCellShading", "tableCellBorders", "tableCellNoBorders", "tableApplyBorderPreset", "toggleTableDrawBorders", "toggleTableGridlines", "tableWidth100", "tableAlignLeft", "tableAlignCenter", "tableAlignRight", "tableSetCellVerticalAlign", "tableSetCellTextDirection", "tableToText", "textToTable", "tableSplitAtRow", "tableSortAscending", "tableSortDescending", "tableDelete", "tableRepeatHeaderRows", "tableSetCellMargins", "tableSetCellSpacing", "tableSetTableIndent", "tableSetAlignment", "tableFormula", "tableSelectCell", "tableSelectRow", "tableSelectColumn", "tableSelectTable", "tableSetRowHeight", "tableSetBreakAcrossPages", "tableSetHeaderRow", "tableSetColumnWidth", "tableSetTableWidth", "tableSetCellWidth", "tableSetCellNoWrap", "tableSetCellFitText", "tableToggleHeaderRow", "tableToggleTotalRow", "tableToggleBandedRows", "tableToggleFirstColumn", "tableToggleLastColumn", "tableToggleBandedColumns", "setTableStyle", "tableToggleAutoFit", "tableAutoFit", "tableDistributeColumns", "tableDistributeRows", "insertTable", "insertShape", "setShapeFill", "setShapeOutline", "setShapeOutlineWidth", "alignFloatingObject", "reorderFloatingObject", "nudgeFloatingObject", "setFloatingFixedPosition", "setFloatingRotation", "setFloatingWrapPreset", "setFloatingWrapText", "setFloatingPositionPreset", "setShapePreset", "setTextBoxTextDirection", "setTextBoxVerticalAlign", "editTextBoxAlt", "rotateTextBox", "textBoxWidthCm", "textBoxHeightCm", "openSymbolDialog", "openEquationDialog", "tableProperties"];
|
|
2
2
|
export type OasisBuiltinCommand = (typeof OASIS_BUILTIN_COMMANDS)[number];
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { EditorState } from '../model.js';
|
|
2
|
+
/** Drop cap options WordCraft's `insert.dropCap` accepts. */
|
|
3
|
+
export interface DropCapPayload {
|
|
4
|
+
/** Cap letter(s); defaults to the paragraph's first character. */
|
|
5
|
+
text?: string;
|
|
6
|
+
/** Number of body lines the cap spans (default 3, clamped 1-10). */
|
|
7
|
+
lines?: number;
|
|
8
|
+
/** `w:framePr/@dropCap`: "drop" (in text) or "margin" (in the margin). */
|
|
9
|
+
type?: "drop" | "margin";
|
|
10
|
+
/** The cap letter's font family, when given. */
|
|
11
|
+
font?: string;
|
|
12
|
+
}
|
|
13
|
+
/** Whether any of the selected paragraphs carries a drop cap. */
|
|
14
|
+
export declare function hasDropCap(state: EditorState): boolean;
|
|
15
|
+
/**
|
|
16
|
+
* Set a drop cap on every paragraph the selection touches (WordCraft
|
|
17
|
+
* `insert.dropCap`), and clear it when `lines` is 0, `type` is "none", or the
|
|
18
|
+
* payload explicitly requests removal. Applies the descriptor via the
|
|
19
|
+
* paragraph write-back pipeline, preserving the selection.
|
|
20
|
+
*/
|
|
21
|
+
export declare function setDropCap(state: EditorState, options: Omit<DropCapPayload, "type"> & {
|
|
22
|
+
type?: "drop" | "margin" | "none";
|
|
23
|
+
}): EditorState;
|
|
@@ -9,5 +9,11 @@ export interface InsertDateFieldOptions {
|
|
|
9
9
|
/** Insert a DATE field at the caret with a resolved, cached result. */
|
|
10
10
|
export declare function insertDateField(state: EditorState, options?: InsertDateFieldOptions): EditorState;
|
|
11
11
|
export declare function isDateFieldRun(run: EditorTextRun): boolean;
|
|
12
|
+
/**
|
|
13
|
+
* Insert the current date as plain text (WordCraft's `insert.dateTime` with
|
|
14
|
+
* `update: false`): the date is typed like ordinary text and does not update,
|
|
15
|
+
* unlike a DATE field. A no-op (same state) when the formatted result is empty.
|
|
16
|
+
*/
|
|
17
|
+
export declare function insertDateTimeText(state: EditorState, dateFormat?: string, value?: Date): EditorState;
|
|
12
18
|
/** Whether the active zone is a header or footer (recall DATE fields in them). */
|
|
13
19
|
export declare function isInHeaderOrFooter(state: EditorState): boolean;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { EditorDocument, EditorPosition, EditorState } from '../model.js';
|
|
2
|
+
/** Describes a single match found by the find service. */
|
|
3
|
+
export interface FindReplaceMatch {
|
|
4
|
+
anchor: EditorPosition;
|
|
5
|
+
focus: EditorPosition;
|
|
6
|
+
paragraphIndex: number;
|
|
7
|
+
}
|
|
8
|
+
/** Options that control how find searches operate. */
|
|
9
|
+
export interface FindOptions {
|
|
10
|
+
matchCase?: boolean;
|
|
11
|
+
wholeWord?: boolean;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Searches a document for the given term and returns all matches, in document
|
|
15
|
+
* order. The term is matched literally (regex metacharacters are escaped);
|
|
16
|
+
* `matchCase` and `wholeWord` narrow the search.
|
|
17
|
+
*/
|
|
18
|
+
export declare function findMatchesInDocument(doc: EditorDocument, searchTerm: string, options?: FindOptions): FindReplaceMatch[];
|
|
19
|
+
/**
|
|
20
|
+
* Replace every occurrence of `searchTerm` with `replaceTerm` across the whole
|
|
21
|
+
* document, in a single state transition. Matches are applied from the end of
|
|
22
|
+
* the document backwards so earlier offsets remain valid as text is inserted.
|
|
23
|
+
* Returns the same state when there is nothing to replace.
|
|
24
|
+
*/
|
|
25
|
+
export declare function replaceAllInDocument(state: EditorState, searchTerm: string, replaceTerm: string, options?: FindOptions): EditorState;
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
import { EditorState } from '../model.js';
|
|
2
|
+
import { WrapPreset } from './floatingLayout.js';
|
|
3
|
+
/** The horizontal alignment presets WordCraft's `arrange.align` accepts. */
|
|
4
|
+
export type FloatingObjectAlign = "left" | "center" | "right";
|
|
5
|
+
/**
|
|
6
|
+
* True when a floating object (image or text box) is selected. Inline objects
|
|
7
|
+
* become floatable on align (Word pulls them square-wrapped), so simply having
|
|
8
|
+
* an image/text box selected is enough.
|
|
9
|
+
*/
|
|
10
|
+
export declare function canAlignSelectedFloatingObject(state: EditorState): boolean;
|
|
11
|
+
/**
|
|
12
|
+
* True when a floating object (image or text box) is selected and can be
|
|
13
|
+
* nudged. Inline objects are implicitly floated on nudge (Word turns them
|
|
14
|
+
* square-wrapped and moves them relative to the paragraph).
|
|
15
|
+
*/
|
|
16
|
+
export declare function canNudgeSelectedFloatingObject(state: EditorState): boolean;
|
|
17
|
+
/**
|
|
18
|
+
* Word's "Nudge" (WordCraft `arrange.nudge`): moves the selected image/text box
|
|
19
|
+
* by a pixel delta, shifting the floating horizontal/vertical anchor offsets.
|
|
20
|
+
* Any horizontal alignment is cleared so the offset is honoured (matching
|
|
21
|
+
* WordCraft's unalign). An inline object is floated (square wrap) as part of
|
|
22
|
+
* the move. A no-op when no image/text box is selected.
|
|
23
|
+
*/
|
|
24
|
+
export declare function nudgeSelectedFloatingObject(state: EditorState, dxPx: number, dyPx: number): EditorState;
|
|
25
|
+
/**
|
|
26
|
+
* Word's "Position"/"Align" for a floating object: pins the selected image or
|
|
27
|
+
* text box horizontally to the left/center/right of the margin by setting the
|
|
28
|
+
* horizontal anchor's alignment. An inline object is floated ("square" wrap)
|
|
29
|
+
* as part of the alignment. A no-op when no image/text box is selected.
|
|
30
|
+
*/
|
|
31
|
+
export declare function alignSelectedFloatingObject(state: EditorState, align: FloatingObjectAlign): EditorState;
|
|
32
|
+
/**
|
|
33
|
+
* True when a floating object (image or text box) is selected and can be
|
|
34
|
+
* pinned to the page / moved with text.
|
|
35
|
+
*/
|
|
36
|
+
export declare function canSetSelectedFloatingFixedPosition(state: EditorState): boolean;
|
|
37
|
+
/** True when the selected floating object is pinned to the page. */
|
|
38
|
+
export declare function isSelectedFloatingFixedPosition(state: EditorState): boolean;
|
|
39
|
+
/**
|
|
40
|
+
* Word's "Move with text" / "Fix position on page" (WordCraft
|
|
41
|
+
* `arrange.moveWithText`): sets whether the selected image/text box moves with
|
|
42
|
+
* the text (anchored to the paragraph) or is pinned to the page. Only applies
|
|
43
|
+
* to floating objects; a no-op when none is selected.
|
|
44
|
+
*/
|
|
45
|
+
export declare function setSelectedFloatingFixedPosition(state: EditorState, fixed: boolean): EditorState;
|
|
46
|
+
/**
|
|
47
|
+
* True when a floating object (image or text box) is selected and its text
|
|
48
|
+
* wrapping can be changed.
|
|
49
|
+
*/
|
|
50
|
+
export declare function canSetSelectedFloatingWrap(state: EditorState): boolean;
|
|
51
|
+
/** The current wrap preset of the selected floating object, or `null`. */
|
|
52
|
+
export declare function getSelectedFloatingWrapPreset(state: EditorState): WrapPreset | null;
|
|
53
|
+
/**
|
|
54
|
+
* Word's "Wrap Text" (WordCraft `arrange.wrap`): sets the text-wrapping preset
|
|
55
|
+
* of the selected image or text box (inline/square/tight/through/topAndBottom/
|
|
56
|
+
* behind/front). A no-op when no object is selected.
|
|
57
|
+
*/
|
|
58
|
+
export declare function setSelectedFloatingWrapPreset(state: EditorState, preset: WrapPreset): EditorState;
|
|
59
|
+
/**
|
|
60
|
+
* True when a floating object (image or text box) is selected and can be given
|
|
61
|
+
* an exact rotation.
|
|
62
|
+
*/
|
|
63
|
+
export declare function canSetSelectedFloatingRotation(state: EditorState): boolean;
|
|
64
|
+
/**
|
|
65
|
+
* WordCraft's `arrange.rotation`: sets the exact angle (degrees, clockwise) of
|
|
66
|
+
* the selected image or text box, normalised to 0–360. A no-op when no
|
|
67
|
+
* floating object is selected.
|
|
68
|
+
*/
|
|
69
|
+
export declare function setSelectedFloatingRotation(state: EditorState, degrees: number): EditorState;
|
|
70
|
+
/** The position presets WordCraft's `arrange.position` accepts. */
|
|
71
|
+
export type FloatingPositionPreset = "topLeft" | "topCenter" | "topRight" | "middleLeft" | "middleCenter" | "middleRight" | "bottomLeft" | "bottomCenter" | "bottomRight";
|
|
72
|
+
/**
|
|
73
|
+
* True when a floating object (image or text box) is selected and can be moved
|
|
74
|
+
* to one of the preset page positions.
|
|
75
|
+
*/
|
|
76
|
+
export declare function canSetSelectedFloatingPositionPreset(state: EditorState): boolean;
|
|
77
|
+
/**
|
|
78
|
+
* WordCraft's `arrange.position`: moves the selected image or text box to one
|
|
79
|
+
* of the nine preset positions (topLeft…bottomRight) of the page margin area,
|
|
80
|
+
* promoting an inline object to a square-wrapped floating object. Sets both
|
|
81
|
+
* anchors relative to the margin with the preset's alignment and zero offset.
|
|
82
|
+
* A no-op when no object is selected.
|
|
83
|
+
*/
|
|
84
|
+
export declare function setSelectedFloatingPositionPreset(state: EditorState, preset: FloatingPositionPreset): EditorState;
|
|
85
|
+
/** The side(s) a Square/Tight/Through floating object's text may flow on,
|
|
86
|
+
* matching WordCraft's `arrange.wrapText` and OOXML `@wrapText`. */
|
|
87
|
+
export type FloatingWrapSide = "bothSides" | "left" | "right" | "largest";
|
|
88
|
+
/** True when a floating object (image or text box) is selected. */
|
|
89
|
+
export declare function canSetSelectedFloatingWrapText(state: EditorState): boolean;
|
|
90
|
+
/** The current wrap side of the selected floating object (defaults to
|
|
91
|
+
* `bothSides`), or `null` when none selected. */
|
|
92
|
+
export declare function getSelectedFloatingWrapText(state: EditorState): FloatingWrapSide | null;
|
|
93
|
+
/**
|
|
94
|
+
* WordCraft's `arrange.wrapText`: sets which side(s) of the selected Square,
|
|
95
|
+
* Tight or Through wrapped object text flows on (`bothSides` clears it). A
|
|
96
|
+
* no-op when no floating object is selected.
|
|
97
|
+
*/
|
|
98
|
+
export declare function setSelectedFloatingWrapText(state: EditorState, side: FloatingWrapSide): EditorState;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { EditorState } from '../model.js';
|
|
2
|
+
/** Word's Layering moves, matching WordCraft's `arrange.bringForward`. */
|
|
3
|
+
export type ZOrderMove = "front" | "back";
|
|
4
|
+
/**
|
|
5
|
+
* True when a floating object (image or text box) is selected. Layering only
|
|
6
|
+
* applies to floating objects (an inline object already sits in the text
|
|
7
|
+
* layer), but Word activates the controls for any selected picture/text box.
|
|
8
|
+
*/
|
|
9
|
+
export declare function canReorderSelectedFloatingObject(state: EditorState): boolean;
|
|
10
|
+
/**
|
|
11
|
+
* Word's "Bring Forward"/"Send Backward" (WordCraft `arrange.bringForward` /
|
|
12
|
+
* `arrange.sendBackward`): moves the selected image or text box to the front
|
|
13
|
+
* of, or behind, the text layer by toggling the floating `behindDoc` flag. An
|
|
14
|
+
* inline object is floated ("front") as part of the move. A no-op when no
|
|
15
|
+
* image/text box is selected.
|
|
16
|
+
*/
|
|
17
|
+
export declare function reorderSelectedFloatingObject(state: EditorState, move: ZOrderMove): EditorState;
|
|
@@ -22,6 +22,23 @@ export declare function clearHeaderFooterStory(state: EditorState, side: HeaderF
|
|
|
22
22
|
export declare function editHeaderFooter(state: EditorState, side: HeaderFooterSide, kind?: HeaderFooterStoryKind): EditorState;
|
|
23
23
|
/** Return the caret to the start of the section's main body. */
|
|
24
24
|
export declare function exitHeaderFooter(state: EditorState): EditorState;
|
|
25
|
+
/** Whether the active section uses a different first-page header/footer. */
|
|
26
|
+
export declare function getHasDifferentFirstPage(state: EditorState): boolean;
|
|
27
|
+
/**
|
|
28
|
+
* Enable or disable the active section's different-first-page header/footer
|
|
29
|
+
* (`w:titlePg`). Enabling seeds empty first-page header and footer stories
|
|
30
|
+
* (existing content is never overwritten); disabling clears them. The toggle is
|
|
31
|
+
* a no-op when the flag already matches.
|
|
32
|
+
*/
|
|
33
|
+
export declare function setHasDifferentFirstPage(state: EditorState, on: boolean): EditorState;
|
|
34
|
+
/** Whether the active section uses even/odd (different odd & even) pages. */
|
|
35
|
+
export declare function getHasDifferentOddEven(state: EditorState): boolean;
|
|
36
|
+
/**
|
|
37
|
+
* Enable or disable the active section's different odd & even pages
|
|
38
|
+
* (`w:evenAndOddHeaders`). Enabling seeds empty even-page header and footer
|
|
39
|
+
* stories; disabling clears them. A no-op when the flag already matches.
|
|
40
|
+
*/
|
|
41
|
+
export declare function setHasDifferentOddEven(state: EditorState, on: boolean): EditorState;
|
|
25
42
|
/**
|
|
26
43
|
* Insert a page-number field (PAGE) at the active caret, inside the header,
|
|
27
44
|
* footer or main body. Placeholder text is resolved during layout projection.
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { EditorState } from '../model.js';
|
|
2
|
+
/** The hyphenation options WordCraft's `layout.hyphenation` accepts. */
|
|
3
|
+
export interface HyphenationSettingsInput {
|
|
4
|
+
/** `w:autoHyphenation` — master switch (toggles when omitted by the caller). */
|
|
5
|
+
value?: boolean;
|
|
6
|
+
/** `w:hyphenationZone` — min trailing gap (points) before hyphenating. */
|
|
7
|
+
zone?: number;
|
|
8
|
+
/** `w:doNotHyphenateCaps` — hyphenate words in capitals. */
|
|
9
|
+
caps?: boolean;
|
|
10
|
+
/** `w:consecutiveHyphenLimit` — max consecutive hyphenated lines (0 = none). */
|
|
11
|
+
limit?: number;
|
|
12
|
+
}
|
|
13
|
+
/** Read the document's automatic hyphenation master switch. */
|
|
14
|
+
export declare function isAutoHyphenationEnabled(state: EditorState): boolean;
|
|
15
|
+
/** Read the document's hyphenation options (`undefined` fields are unset). */
|
|
16
|
+
export declare function getHyphenationSettings(state: EditorState): {
|
|
17
|
+
value: boolean;
|
|
18
|
+
zone?: number;
|
|
19
|
+
caps?: boolean;
|
|
20
|
+
limit?: number;
|
|
21
|
+
};
|
|
22
|
+
/**
|
|
23
|
+
* Update the document's hyphenation settings. `value` (autoHyphenation) toggles
|
|
24
|
+
* when omitted; `zone`, `caps` and `limit` are applied only when given, leaving
|
|
25
|
+
* the rest of the document settings untouched.
|
|
26
|
+
*/
|
|
27
|
+
export declare function setHyphenationSettings(state: EditorState, input: HyphenationSettingsInput): EditorState;
|
|
@@ -71,6 +71,51 @@ export interface ImageBorderPatch {
|
|
|
71
71
|
/** Merges `patch` onto the selected image's outline. `color: null` clears it. */
|
|
72
72
|
export declare function setSelectedImageBorder(state: EditorState, patch: ImageBorderPatch): EditorState;
|
|
73
73
|
export declare function rotateSelectedImage(state: EditorState, rotation: number): EditorState;
|
|
74
|
+
/** Current rotation (degrees) of the selected image, or `0`. */
|
|
75
|
+
export declare function getSelectedImageRotation(state: EditorState): number;
|
|
76
|
+
/** True when an image is selected and can be rotated. */
|
|
77
|
+
export declare function canRotateSelectedImage(state: EditorState): boolean;
|
|
78
|
+
/**
|
|
79
|
+
* Word's Rotate Left/Right: rotates the selected image by a fixed step. Left
|
|
80
|
+
* turns counter-clockwise by `stepDegrees`, right clockwise (using the same
|
|
81
|
+
* counter-clockwise-positive convention as the interactive rotate session). A
|
|
82
|
+
* no-op when no image is selected.
|
|
83
|
+
*/
|
|
84
|
+
export declare function rotateSelectedImageByStep(state: EditorState, direction: "left" | "right", stepDegrees?: number): EditorState;
|
|
85
|
+
/** The flip state of the selected image (`null` when none is selected). */
|
|
86
|
+
export declare function getSelectedImageFlip(state: EditorState): {
|
|
87
|
+
flipH: boolean;
|
|
88
|
+
flipV: boolean;
|
|
89
|
+
} | null;
|
|
90
|
+
/** True when an image is selected and can be flipped. */
|
|
91
|
+
export declare function canFlipSelectedImage(state: EditorState): boolean;
|
|
92
|
+
/**
|
|
93
|
+
* Word's Flip Horizontal/Vertical: mirrors the selected image about its
|
|
94
|
+
* vertical or horizontal axis. Repeated flips toggle the mirror state. A no-op
|
|
95
|
+
* when no image is selected.
|
|
96
|
+
*/
|
|
97
|
+
export declare function flipSelectedImage(state: EditorState, axis: "horizontal" | "vertical"): EditorState;
|
|
98
|
+
/** The transparency (0..1) of the selected image, `null` when none selected. */
|
|
99
|
+
export declare function getSelectedImageTransparency(state: EditorState): number | null;
|
|
100
|
+
/** True when an image is selected and its transparency can be changed. */
|
|
101
|
+
export declare function canSetSelectedImageTransparency(state: EditorState): boolean;
|
|
102
|
+
/**
|
|
103
|
+
* WordCraft's `picture.transparency`: sets the selected image's transparency
|
|
104
|
+
* (0..1). A value at/below zero removes the transparency entirely and a value
|
|
105
|
+
* clamped to 1 makes the picture fully transparent. A no-op when no image is
|
|
106
|
+
* selected.
|
|
107
|
+
*/
|
|
108
|
+
export declare function setSelectedImageTransparency(state: EditorState, transparency: number): EditorState;
|
|
109
|
+
/** True when an image is selected and can be reset to its original picture. */
|
|
110
|
+
export declare function canResetSelectedImage(state: EditorState): boolean;
|
|
111
|
+
/**
|
|
112
|
+
* WordCraft's `picture.reset` (Word's Reset Picture): restores the selected
|
|
113
|
+
* picture to its original state, discarding every adjustment — source crop,
|
|
114
|
+
* fit/fill mode, picture mask, transparency, border and rotation/flip — while
|
|
115
|
+
* keeping its box size and floating position, exactly as Word keeps the frame.
|
|
116
|
+
* A no-op when no image is selected.
|
|
117
|
+
*/
|
|
118
|
+
export declare function resetSelectedImage(state: EditorState): EditorState;
|
|
74
119
|
export declare function getSelectedImageWrapPreset(state: EditorState): WrapPreset | null;
|
|
75
120
|
export declare function isSelectedImageFixedPosition(state: EditorState): boolean;
|
|
76
121
|
export declare function setSelectedImageWrapPreset(state: EditorState, preset: WrapPreset): EditorState;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { EditorFootnoteNumberFormat, EditorFootnoteRestart, EditorFootnoteSettings, EditorState } from '../model.js';
|
|
2
|
+
/** Which note collection the command targets. */
|
|
3
|
+
export type NoteOptionsKind = "footnote" | "endnote";
|
|
4
|
+
/** The options WordCraft's `references.noteOptions` accepts. */
|
|
5
|
+
export interface NoteOptionsInput {
|
|
6
|
+
/** The note collection to update ("footnote" or "endnote"). */
|
|
7
|
+
kind: NoteOptionsKind;
|
|
8
|
+
/** `w:footnotePr/w:numFmt` — the number format. */
|
|
9
|
+
numberFormat?: EditorFootnoteNumberFormat | null;
|
|
10
|
+
/** `w:footnotePr/w:numStart` — the first number (min 1). */
|
|
11
|
+
startAt?: number | null;
|
|
12
|
+
/** `w:footnotePr/w:numRestart` — when numbering restarts. */
|
|
13
|
+
restart?: EditorFootnoteRestart | null;
|
|
14
|
+
}
|
|
15
|
+
/** Read the current options for a note collection. */
|
|
16
|
+
export declare function getNoteOptions(state: EditorState, kind: NoteOptionsKind): EditorFootnoteSettings;
|
|
17
|
+
/**
|
|
18
|
+
* Update the document-wide footnote or endnote options. Each field is applied
|
|
19
|
+
* only when given; `null` unsets it. Returns the same state when the settings
|
|
20
|
+
* do not change.
|
|
21
|
+
*/
|
|
22
|
+
export declare function setNoteOptions(state: EditorState, input: NoteOptionsInput): EditorState;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { EditorState } from '../model.js';
|
|
2
|
+
/** The top heading level (WordCraft's `ensure_heading_style` "Heading1"). */
|
|
3
|
+
export declare const MIN_HEADING_LEVEL = 1;
|
|
4
|
+
/** The bottom heading level. */
|
|
5
|
+
export declare const MAX_HEADING_LEVEL = 9;
|
|
6
|
+
/** The deepest list level WordCraft allows when demoting (level+1 min 8). */
|
|
7
|
+
export declare const MAX_LIST_LEVEL = 8;
|
|
8
|
+
/**
|
|
9
|
+
* Promote (`promote: true`) or demote (`promote: false`) the outline step of
|
|
10
|
+
* every paragraph the selection touches, mirroring WordCraft's `outline_step`.
|
|
11
|
+
* A no-op (returns the same state) when nothing can be changed.
|
|
12
|
+
*/
|
|
13
|
+
export declare function stepOutlineLevel(state: EditorState, promote: boolean): EditorState;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { EditorColumnsSettings, EditorState } from '../model.js';
|
|
1
|
+
import { EditorColumnsSettings, EditorSectionVerticalAlign, EditorState } from '../model.js';
|
|
2
2
|
/** Convert a physical dimension in points to the editor's px unit (×96/72). */
|
|
3
3
|
export declare function pointsToPx(points: number): number;
|
|
4
4
|
/** Default gap between columns (0.5"), matching Word's default `w:cols` space. */
|
|
@@ -61,3 +61,43 @@ export declare function getActivePaperSize(state: EditorState): {
|
|
|
61
61
|
widthPt: number;
|
|
62
62
|
heightPt: number;
|
|
63
63
|
} | undefined;
|
|
64
|
+
/** A named page-margin preset (values mirror Word's built-ins, in cm). */
|
|
65
|
+
export interface MarginPreset {
|
|
66
|
+
/** Machine id, e.g. "normal" / "narrow" / "moderate" / "wide" / "mirrored". */
|
|
67
|
+
id: string;
|
|
68
|
+
top: number;
|
|
69
|
+
bottom: number;
|
|
70
|
+
left: number;
|
|
71
|
+
right: number;
|
|
72
|
+
}
|
|
73
|
+
/**
|
|
74
|
+
* Word's built-in page-margin presets, in centimetres. The "Normal" preset is
|
|
75
|
+
* localised (pt-BR uses the ABNT 2.5/2.5/3/3 cm values rather than 1 inch).
|
|
76
|
+
*/
|
|
77
|
+
export declare const MARGIN_PRESETS: readonly MarginPreset[];
|
|
78
|
+
/** Look up a named margin preset by id, or undefined. */
|
|
79
|
+
export declare function getMarginPreset(id: string): MarginPreset | undefined;
|
|
80
|
+
/**
|
|
81
|
+
* Apply a named page-margin preset to the active section. The four sided
|
|
82
|
+
* margins are set from the preset's centimetre values (converted to the px
|
|
83
|
+
* unit the editor stores); header / footer / gutter are left untouched.
|
|
84
|
+
* Returns the same state when there's no section or unknown preset id.
|
|
85
|
+
*/
|
|
86
|
+
export declare function setSectionMarginsPreset(state: EditorState, presetId: string): EditorState;
|
|
87
|
+
/** Read the active section's vertical justification (`w:vAlign`). */
|
|
88
|
+
export declare function getSectionVerticalAlign(state: EditorState): EditorSectionVerticalAlign | undefined;
|
|
89
|
+
/**
|
|
90
|
+
* Set the active section's vertical justification of page contents
|
|
91
|
+
* (`w:vAlign`: `top` | `center` | `both` | `bottom`). `top` is the Word
|
|
92
|
+
* default and is stored as `undefined`; passing `null` or `"top"` clears the
|
|
93
|
+
* field. Returns the same state when there's no section.
|
|
94
|
+
*/
|
|
95
|
+
export declare function setSectionVerticalAlign(state: EditorState, align: EditorSectionVerticalAlign | null | undefined): EditorState;
|
|
96
|
+
/** Read the active section's right-to-left layout flag (`w:bidi`). */
|
|
97
|
+
export declare function getSectionBidi(state: EditorState): boolean | undefined;
|
|
98
|
+
/**
|
|
99
|
+
* Set the active section's right-to-left layout flag (`w:bidi`, WordCraft's
|
|
100
|
+
* `layout.sectionRtl`). `false`/`null`/`undefined` clears the flag. Returns the
|
|
101
|
+
* same state when there's no section.
|
|
102
|
+
*/
|
|
103
|
+
export declare function setSectionBidi(state: EditorState, enabled: boolean | null | undefined): EditorState;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { EditorState } from '../model.js';
|
|
2
|
+
/**
|
|
3
|
+
* Set the adjust-right-indent flag (`adjustRightInd`) of every selected
|
|
4
|
+
* paragraph. Pass `true`/`false` to store the state explicitly, or `null` to
|
|
5
|
+
* clear the key (defaults to on and is omitted on export). Returns the same
|
|
6
|
+
* state when nothing changes.
|
|
7
|
+
*/
|
|
8
|
+
export declare function setParagraphAdjustRightInd(state: EditorState, value: boolean | null): EditorState;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { EditorState } from '../model.js';
|
|
2
|
+
/** Word's paragraph alignment values (w:jc/@w:val). */
|
|
3
|
+
export type EditorParagraphAlign = "left" | "center" | "right" | "justify";
|
|
4
|
+
/**
|
|
5
|
+
* Set the alignment (`align`) of every selected paragraph. Pass a
|
|
6
|
+
* `left|center|right|justify` value to store it, or `null` to clear the key
|
|
7
|
+
* (returning to the paragraph's style default). Returns the same state when
|
|
8
|
+
* nothing changes.
|
|
9
|
+
*/
|
|
10
|
+
export declare function setParagraphAlign(state: EditorState, value: EditorParagraphAlign | null): EditorState;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { EditorState } from '../model.js';
|
|
2
|
+
/**
|
|
3
|
+
* Set the auto-space-DE flag (`autoSpaceDE`) of every selected paragraph. Pass
|
|
4
|
+
* `true`/`false` to store the state explicitly, or `null` to clear the key
|
|
5
|
+
* (defaults to on and is omitted on export). Returns the same state when
|
|
6
|
+
* nothing changes.
|
|
7
|
+
*/
|
|
8
|
+
export declare function setParagraphAutoSpaceDE(state: EditorState, value: boolean | null): EditorState;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { EditorState } from '../model.js';
|
|
2
|
+
/**
|
|
3
|
+
* Set the auto-space-DN flag (`autoSpaceDN`) of every selected paragraph. Pass
|
|
4
|
+
* `true`/`false` to store the state explicitly, or `null` to clear the key
|
|
5
|
+
* (defaults to on and is omitted on export). Returns the same state when
|
|
6
|
+
* nothing changes.
|
|
7
|
+
*/
|
|
8
|
+
export declare function setParagraphAutoSpaceDN(state: EditorState, value: boolean | null): EditorState;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { EditorState } from '../model.js';
|
|
2
|
+
/**
|
|
3
|
+
* Set the bidi flag (`bidi`) of every selected paragraph. Pass `true`/`false`
|
|
4
|
+
* to store the state explicitly, or `null` to clear the key (default off).
|
|
5
|
+
* Returns the same state when nothing changes.
|
|
6
|
+
*/
|
|
7
|
+
export declare function setParagraphBidi(state: EditorState, value: boolean | null): EditorState;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { EditorState } from '../model.js';
|
|
2
|
+
/**
|
|
3
|
+
* Set the contextual-spacing flag (`contextualSpacing`) of every selected
|
|
4
|
+
* paragraph. Pass `true`/`false` to store the state explicitly, or `null` to
|
|
5
|
+
* clear the key (default off). Returns the same state when nothing changes.
|
|
6
|
+
*/
|
|
7
|
+
export declare function setParagraphContextualSpacing(state: EditorState, value: boolean | null): EditorState;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { EditorState } from '../model.js';
|
|
2
|
+
/**
|
|
3
|
+
* Set the keep-lines-together flag (`keepLinesTogether`) of every selected
|
|
4
|
+
* paragraph. Pass `true`/`false` to store the state explicitly, or `null` to
|
|
5
|
+
* clear the key (default off). Returns the same state when nothing changes.
|
|
6
|
+
*/
|
|
7
|
+
export declare function setParagraphKeepLinesTogether(state: EditorState, value: boolean | null): EditorState;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { EditorState } from '../model.js';
|
|
2
|
+
/**
|
|
3
|
+
* Set the keep-with-next flag (`keepWithNext`) of every selected paragraph.
|
|
4
|
+
* Pass `true`/`false` to store the state explicitly, or `null` to clear the
|
|
5
|
+
* key (default off). Returns the same state when nothing changes.
|
|
6
|
+
*/
|
|
7
|
+
export declare function setParagraphKeepWithNext(state: EditorState, value: boolean | null): EditorState;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { EditorState } from '../model.js';
|
|
2
|
+
/**
|
|
3
|
+
* Set the kinsoku flag (`kinsoku`) of every selected paragraph. Pass
|
|
4
|
+
* `true`/`false` to store the state explicitly, or `null` to clear the key
|
|
5
|
+
* (defaults to on and is omitted on export). Returns the same state when
|
|
6
|
+
* nothing changes.
|
|
7
|
+
*/
|
|
8
|
+
export declare function setParagraphKinsoku(state: EditorState, value: boolean | null): EditorState;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { EditorState } from '../model.js';
|
|
2
|
+
/** Valid `w:lineRule` values. */
|
|
3
|
+
export type ParagraphLineRule = "auto" | "exact" | "atLeast";
|
|
4
|
+
/**
|
|
5
|
+
* Set the line rule (`lineRule`) of every selected paragraph. Pass `"auto"`,
|
|
6
|
+
* `"exact"` or `"atLeast"` to store it, or `null` to clear the key (defaults
|
|
7
|
+
* to `auto` and is omitted on export). Returns the same state when nothing
|
|
8
|
+
* changes.
|
|
9
|
+
*/
|
|
10
|
+
export declare function setParagraphLineRule(state: EditorState, rule: ParagraphLineRule | null): EditorState;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { EditorState } from '../model.js';
|
|
2
|
+
/** The highest list level (`w:lvl` is 0–8). */
|
|
3
|
+
export declare const MAX_LIST_LEVEL = 8;
|
|
4
|
+
/**
|
|
5
|
+
* Set the explicit list level of every selected list paragraph (`level`
|
|
6
|
+
* 0–8). Returns the same state when nothing changes.
|
|
7
|
+
*/
|
|
8
|
+
export declare function setParagraphListLevel(state: EditorState, level: number): EditorState;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { EditorState } from '../model.js';
|
|
2
|
+
/**
|
|
3
|
+
* Set the mirror-indents flag (`mirrorIndents`) of every selected paragraph.
|
|
4
|
+
* Pass `true`/`false` to store the state explicitly, or `null` to clear the
|
|
5
|
+
* key (default off). Returns the same state when nothing changes.
|
|
6
|
+
*/
|
|
7
|
+
export declare function setParagraphMirrorIndents(state: EditorState, value: boolean | null): EditorState;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { EditorState } from '../model.js';
|
|
2
|
+
/** True when the selection can move paragraphs in the given direction. */
|
|
3
|
+
export declare function canMoveSelectedParagraphs(state: EditorState, direction: "up" | "down"): boolean;
|
|
4
|
+
/**
|
|
5
|
+
* Move the contiguous run of selected paragraphs one step up or down.
|
|
6
|
+
* A no-op (returns the same state) when the move is refused.
|
|
7
|
+
*/
|
|
8
|
+
export declare function moveSelectedParagraphs(state: EditorState, direction: "up" | "down"): EditorState;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { EditorState } from '../model.js';
|
|
2
|
+
/** The lowest outline level (Heading 1 in OOXML, `w:outlineLvl` 0). */
|
|
3
|
+
export declare const MIN_OUTLINE_LEVEL = 0;
|
|
4
|
+
/** The highest outline level (Heading 9 in OOXML, `w:outlineLvl` 8). */
|
|
5
|
+
export declare const MAX_OUTLINE_LEVEL = 8;
|
|
6
|
+
/**
|
|
7
|
+
* Set the outline level of every selected paragraph (`level` 0–8, mirroring
|
|
8
|
+
* OOXML) or return it to body text (`null` / `undefined`). Returns the same
|
|
9
|
+
* state when nothing changes.
|
|
10
|
+
*/
|
|
11
|
+
export declare function setParagraphOutlineLevel(state: EditorState, level: number | null | undefined): EditorState;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { EditorState } from '../model.js';
|
|
2
|
+
/**
|
|
3
|
+
* Set the overflow-punctuation flag (`overflowPunct`) of every selected
|
|
4
|
+
* paragraph. Pass `true`/`false` to store the state explicitly, or `null` to
|
|
5
|
+
* clear the key (defaults to on and is omitted on export). Returns the same
|
|
6
|
+
* state when nothing changes.
|
|
7
|
+
*/
|
|
8
|
+
export declare function setParagraphOverflowPunct(state: EditorState, value: boolean | null): EditorState;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { EditorState } from '../model.js';
|
|
2
|
+
/**
|
|
3
|
+
* Set the page-break-before flag (`pageBreakBefore`) of every selected
|
|
4
|
+
* paragraph. Pass `true`/`false` to store the state explicitly, or `null` to
|
|
5
|
+
* clear the key (default off). Returns the same state when nothing changes.
|
|
6
|
+
*/
|
|
7
|
+
export declare function setParagraphPageBreakBefore(state: EditorState, value: boolean | null): EditorState;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { EditorParagraphStyle, EditorState } from '../model.js';
|
|
2
|
+
/** The direct paragraph-formatting keys `para.reset` removes. */
|
|
3
|
+
export declare const RESET_PARAGRAPH_KEYS: readonly (keyof EditorParagraphStyle)[];
|
|
4
|
+
/**
|
|
5
|
+
* Remove all direct paragraph formatting from the selected paragraphs, keeping
|
|
6
|
+
* their named style reference (`styleId`), list, and drop cap. Returns the same
|
|
7
|
+
* state when there is nothing to reset.
|
|
8
|
+
*/
|
|
9
|
+
export declare function resetParagraphFormatting(state: EditorState): EditorState;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { EditorState } from '../model.js';
|
|
2
|
+
/**
|
|
3
|
+
* Sort the contiguous run of selected paragraphs by their text.
|
|
4
|
+
* A no-op (returns the same state) when the sort is refused, or when the run
|
|
5
|
+
* has fewer than two paragraphs (nothing to reorder).
|
|
6
|
+
*/
|
|
7
|
+
export declare function sortSelectedParagraphs(state: EditorState, descending: boolean): EditorState;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { EditorState } from '../model.js';
|
|
2
|
+
/**
|
|
3
|
+
* Set the suppress-auto-hyphens flag (`suppressAutoHyphens`) of every selected
|
|
4
|
+
* paragraph. Pass `true`/`false` to store the state explicitly, or `null` to
|
|
5
|
+
* clear the key (default off). Returns the same state when nothing changes.
|
|
6
|
+
*/
|
|
7
|
+
export declare function setParagraphSuppressAutoHyphens(state: EditorState, value: boolean | null): EditorState;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { EditorState } from '../model.js';
|
|
2
|
+
/**
|
|
3
|
+
* Set the suppress-line-numbers flag (`suppressLineNumbers`) of every selected
|
|
4
|
+
* paragraph. Pass `true`/`false` to store the state explicitly, or `null` to
|
|
5
|
+
* clear the key (default off). Returns the same state when nothing changes.
|
|
6
|
+
*/
|
|
7
|
+
export declare function setParagraphSuppressLineNumbers(state: EditorState, value: boolean | null): EditorState;
|