oasis-editor 0.0.212 → 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.
- package/dist/{OasisEditorApp-xxFJk4Dn.js → OasisEditorApp-F11O2dC0.js} +1 -1
- package/dist/assets/{importDocxWorker-BacVrzqW.js → importDocxWorker-CttqoLlH.js} +1047 -1010
- package/dist/core/commands/builtinCommands.d.ts +1 -1
- package/dist/core/commands/pageNumber.d.ts +30 -3
- package/dist/core/commands/publicCommandTypes.d.ts +2 -0
- package/dist/core/format/pageNumberFormat.d.ts +11 -0
- package/dist/core/model/index.d.ts +1 -1
- package/dist/core/model/types/primitives.d.ts +4 -0
- package/dist/{defaultToolbar-Q0saW9l5.js → defaultToolbar-CCLAYtj2.js} +1 -1
- package/dist/export/docx/text/fieldRunXml.d.ts +2 -2
- package/dist/i18n/locales/en.d.ts +2 -0
- package/dist/i18n/locales/pt-BR.d.ts +2 -0
- package/dist/import/docx/runs/types.d.ts +2 -1
- package/dist/oasis-editor.js +1 -1
- package/dist/oasis-editor.umd.cjs +1 -1
- package/dist/plugins/internal/essentialsCapabilities.d.ts +4 -0
- package/package.json +1 -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", "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,13 +1,40 @@
|
|
|
1
|
-
import { EditorState, EditorTextRun } from '../model.js';
|
|
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
|
/**
|
|
6
20
|
* Insert a page-number field at the caret in the active zone (header, footer
|
|
7
21
|
* or body). `"page"` inserts a bare `PAGE` field; `"xOfY"` inserts the
|
|
8
22
|
* `Page <PAGE> of <NUMPAGES>` combination Word and WordCraft use for
|
|
9
|
-
* "Page X of Y" footers.
|
|
23
|
+
* "Page X of Y" footers. `format` selects the `\*` number format applied to
|
|
24
|
+
* the field runs (default decimal).
|
|
10
25
|
*/
|
|
11
|
-
export declare function insertPageNumberField(state: EditorState, kind?: PageNumberFieldKind): EditorState;
|
|
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;
|
|
12
39
|
/** Exported for tests: whether the active zone is a header or footer. */
|
|
13
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;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { PageNumberFormat } from '../model.js';
|
|
2
|
+
export declare const PAGE_NUMBER_FORMATS: ReadonlyArray<{
|
|
3
|
+
id: PageNumberFormat;
|
|
4
|
+
label: string;
|
|
5
|
+
}>;
|
|
6
|
+
/** The `\*` switch emitted for a format. Absent for decimal. */
|
|
7
|
+
export declare function pageNumberFormatToSwitch(format: PageNumberFormat | undefined): string | undefined;
|
|
8
|
+
/** Recover a format from a `\*` switch value (case-sensitive), if recognized. */
|
|
9
|
+
export declare function pageNumberFormatFromSwitch(switchValue: string | undefined): PageNumberFormat | undefined;
|
|
10
|
+
/** Convert a page number to its displayed form under the given format. */
|
|
11
|
+
export declare function formatPageNumber(value: number, format: PageNumberFormat | undefined): string;
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
* statements that pointed there continue to work via the barrel
|
|
7
7
|
* re-export in `src/core/model.ts`.
|
|
8
8
|
*/
|
|
9
|
-
export type { EditorUnderlineStyle, EditorLigatures, EditorNumberSpacing, EditorNumberForm, EditorTextLanguage, EditorBorderStyle, EditorEmphasisMark, EditorTabStop, EditorParagraphListStyle, EditorImageCrop, EditorImageCropShape, EditorImageCropFit, EditorImageFillMode, EditorLineDash, EditorImageBorder, EditorImageFloatingPosition, EditorImageFloatingLayout, EditorImageRunData, EditorWrapPolygonPoint, EditorFieldData, EditorFieldChar, EditorFootnoteReferenceData, EditorEndnoteReferenceData, EditorRevision, EditorRevisionMetadata, EditorMoveRangeMarker, EditorNumberingRevision, EditorStructuralRevision, EditorPropertyRevision, EditorAsset, EditorFootnoteNumberFormat, EditorFootnoteRestart, EditorDocxWidthValue, EditorTableLayout, EditorTableRowHeightRule, EditorGradientStop, EditorTextFill, EditorTextOutline, EditorTextShadow, EditorGlow, EditorReflection, } from './types/primitives.js';
|
|
9
|
+
export type { EditorUnderlineStyle, EditorLigatures, EditorNumberSpacing, EditorNumberForm, EditorTextLanguage, EditorBorderStyle, EditorEmphasisMark, EditorTabStop, EditorParagraphListStyle, EditorImageCrop, EditorImageCropShape, EditorImageCropFit, EditorImageFillMode, EditorLineDash, EditorImageBorder, EditorImageFloatingPosition, EditorImageFloatingLayout, EditorImageRunData, EditorWrapPolygonPoint, EditorFieldData, EditorFieldChar, EditorFootnoteReferenceData, EditorEndnoteReferenceData, PageNumberFormat, EditorRevision, EditorRevisionMetadata, EditorMoveRangeMarker, EditorNumberingRevision, EditorStructuralRevision, EditorPropertyRevision, EditorAsset, EditorFootnoteNumberFormat, EditorFootnoteRestart, EditorDocxWidthValue, EditorTableLayout, EditorTableRowHeightRule, EditorGradientStop, EditorTextFill, EditorTextOutline, EditorTextShadow, EditorGlow, EditorReflection, } from './types/primitives.js';
|
|
10
10
|
export type { EditorTextStyle, EditorParagraphStyle, EditorTableStyle, EditorTableFloatingLayout, EditorTableConditionalFormat, EditorConditionalRowStyle, EditorTableConditionalType, EditorTableConditionalFlags, EditorTableCellStyle, EditorNamedStyle, } from './types/styles.js';
|
|
11
11
|
export type { EditorRunBase, EditorTextRun, EditorTextBoxShape, EditorTextBoxBody, EditorTextBoxData, EditorDropCap, EditorSdtBlockWrapper, EditorSdtPr, EditorSdtSubtype, EditorSdtListItem, EditorSdtDataBinding, EditorParagraphNode, EditorTableCellNode, EditorTableRowStyle, EditorTableRowNode, EditorTableNode, EditorBlockNode, } from './types/nodes.js';
|
|
12
12
|
export type { EditorMathNode, EditorMathText, EditorMathFraction, EditorMathRadical, EditorMathScript, EditorMathDelimiter, EditorMathAccent, EditorMathNary, EditorMathLimit, EditorMathMatrix, EditorMathBox, EditorMathGroup, EditorMathRaw, EditorMathStyle, EditorMathExpression, } from './types/math.js';
|
|
@@ -188,8 +188,12 @@ export interface EditorImageRunData {
|
|
|
188
188
|
* alpha or round-tripped from OOXML <wp:wrapPolygon>. Absent ⇒ rectangular. */
|
|
189
189
|
wrapPolygon?: EditorWrapPolygonPoint[];
|
|
190
190
|
}
|
|
191
|
+
/** `\*` number-format switch for PAGE/NUMPAGES fields (WordCraft NUMBER_FORMATS). */
|
|
192
|
+
export type PageNumberFormat = "decimal" | "roman" | "ROMAN" | "alphabetic" | "ALPHABETIC" | "Ordinal";
|
|
191
193
|
export interface EditorFieldData {
|
|
192
194
|
type: "PAGE" | "NUMPAGES";
|
|
195
|
+
/** Page-number `\*` format switch. Absent ⇒ decimal. */
|
|
196
|
+
format?: PageNumberFormat;
|
|
193
197
|
}
|
|
194
198
|
/**
|
|
195
199
|
* A preserved complex-field control character (`w:fldChar`). Carried on a
|