oasis-editor 0.0.213 → 0.0.214

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.
@@ -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", "nextRevision", "previousRevision", "nextComment", "previousComment", "newComment", "replyComment", "editComment", "toggleCommentsPanel", "resolveComment", "reopenComment", "deleteComment", "toggleShowMargins", "toggleShowParagraphMarks", "togglePreciseFonts", "undo", "redo", "pageBreak", "lineBreak", "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", "setPageMargins", "editHeader", "editFooter", "insertPageNumber", "insertPageNumberXOfY", "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", "tableSetCellWidth", "tableToggleHeaderRow", "tableToggleTotalRow", "tableToggleBandedRows", "tableToggleFirstColumn", "tableToggleLastColumn", "tableToggleBandedColumns", "setTableStyle", "tableToggleAutoFit", "tableDistributeColumns", "tableDistributeRows", "insertTable", "insertShape", "openSymbolDialog", "openEquationDialog"];
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", "nextRevision", "previousRevision", "nextComment", "previousComment", "newComment", "replyComment", "editComment", "toggleCommentsPanel", "resolveComment", "reopenComment", "deleteComment", "toggleShowMargins", "toggleShowParagraphMarks", "togglePreciseFonts", "undo", "redo", "pageBreak", "lineBreak", "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", "setPageMargins", "editHeader", "editFooter", "insertPageNumber", "insertPageNumberXOfY", "placePageNumberTop", "placePageNumberBottom", "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", "tableSetCellWidth", "tableToggleHeaderRow", "tableToggleTotalRow", "tableToggleBandedRows", "tableToggleFirstColumn", "tableToggleLastColumn", "tableToggleBandedColumns", "setTableStyle", "tableToggleAutoFit", "tableDistributeColumns", "tableDistributeRows", "insertTable", "insertShape", "openSymbolDialog", "openEquationDialog"];
2
2
  export type OasisBuiltinCommand = (typeof OASIS_BUILTIN_COMMANDS)[number];
@@ -1,5 +1,19 @@
1
1
  import { EditorState, EditorTextRun, PageNumberFormat } from '../model.js';
2
2
  export type PageNumberFieldKind = "page" | "xOfY";
3
+ export type PageNumberPlacement = "current" | "top" | "bottom";
4
+ export type PageNumberAlign = "left" | "center" | "right" | "justify";
5
+ export interface PageNumberPlacementOptions {
6
+ /** Field shape: bare PAGE or the Page X of Y combination. Default `page`. */
7
+ kind?: PageNumberFieldKind;
8
+ /** `\*` number format applied to the field runs. Default decimal. */
9
+ format?: PageNumberFormat;
10
+ /**
11
+ * Paragraph alignment of the placed page number. Only meaningful for
12
+ * `top`/`bottom` (the story paragraph's alignment); WordCraft defaults the
13
+ * placement to `center`. Ignored for `current` (caret insertion).
14
+ */
15
+ align?: PageNumberAlign;
16
+ }
3
17
  /** True for a run that is a PAGE or NUMPAGES field. */
4
18
  export declare function isPageNumberFieldRun(run: EditorTextRun): boolean;
5
19
  /**
@@ -10,5 +24,17 @@ export declare function isPageNumberFieldRun(run: EditorTextRun): boolean;
10
24
  * the field runs (default decimal).
11
25
  */
12
26
  export declare function insertPageNumberField(state: EditorState, kind?: PageNumberFieldKind, format?: PageNumberFormat): EditorState;
27
+ /**
28
+ * Place a page number at the requested position.
29
+ *
30
+ * - `current` inserts the field at the active caret (header, footer or body),
31
+ * reusing {@link insertPageNumberField}.
32
+ * - `top`/`bottom` replace the active section's default header/footer story
33
+ * with a single aligned paragraph containing the field runs, and move the
34
+ * caret into that story (active zone set) — mirroring WordCraft's
35
+ * `position` handling, which rewrites the story to a styled, aligned
36
+ * paragraph.
37
+ */
38
+ export declare function placePageNumber(state: EditorState, position: PageNumberPlacement, options?: PageNumberPlacementOptions): EditorState;
13
39
  /** Exported for tests: whether the active zone is a header or footer. */
14
40
  export declare function isInHeaderOrFooter(state: EditorState): boolean;
@@ -143,6 +143,8 @@ export interface OasisCommandPayloads {
143
143
  editFooter: undefined;
144
144
  insertPageNumber: undefined;
145
145
  insertPageNumberXOfY: undefined;
146
+ placePageNumberTop: undefined;
147
+ placePageNumberBottom: undefined;
146
148
  exitHeaderFooter: undefined;
147
149
  applyDocumentTheme: DesignThemeId;
148
150
  setDocumentColorScheme: string;