oasis-editor 0.0.219 → 0.0.221
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-BJpbWbOf.js → OasisEditorApp-CXBTtJuR.js} +1 -1
- package/dist/app/controllers/EditorCommandsController.d.ts +2 -2
- package/dist/assets/{importDocxWorker-BIjCzhM3.js → importDocxWorker-VC9O6KEc.js} +1282 -1269
- package/dist/core/commands/block.d.ts +2 -2
- package/dist/core/commands/builtinCommands.d.ts +1 -1
- package/dist/core/commands/crossReference.d.ts +27 -0
- package/dist/core/commands/publicCommandTypes.d.ts +7 -0
- package/dist/core/model/types/primitives.d.ts +7 -1
- package/dist/{defaultToolbar-B7lLZb5m.js → defaultToolbar-CdsYjowV.js} +1 -1
- package/dist/import/docx/runs/types.d.ts +4 -0
- package/dist/oasis-editor.js +1 -1
- package/dist/oasis-editor.umd.cjs +1 -1
- package/dist/plugins/internal/essentialsCapabilities.d.ts +15 -0
- package/dist/ui/app/createAppCommandsController.d.ts +2 -2
- package/dist/ui/app/createEditorCommandRuntime.d.ts +1 -1
- package/package.json +1 -1
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { EditorParagraphStyle, EditorPosition, EditorState, EditorSection, EditorTabStop, EditorPageSettings } from '../model.js';
|
|
1
|
+
import { EditorParagraphStyle, EditorPosition, EditorState, EditorSection, EditorTabStop, EditorPageSettings, EditorSectionBreakType } from '../model.js';
|
|
2
2
|
import { ValueParagraphStyleKey } from '../textStyle/textStyleKeys.js';
|
|
3
3
|
export declare function moveBlockToPosition(state: EditorState, blockId: string, targetPosition: EditorPosition): EditorState;
|
|
4
4
|
export declare function splitBlockAtSelection(state: EditorState): EditorState;
|
|
5
5
|
export declare function insertPageBreakAtSelection(state: EditorState): EditorState;
|
|
6
|
-
export declare function insertSectionBreakAtSelection(state: EditorState, breakType:
|
|
6
|
+
export declare function insertSectionBreakAtSelection(state: EditorState, breakType: EditorSectionBreakType): EditorState;
|
|
7
7
|
export declare function updateSectionSettings(state: EditorState, sectionIndex: number, settings: Omit<Partial<EditorSection>, "pageSettings"> & {
|
|
8
8
|
pageSettings?: Partial<EditorPageSettings>;
|
|
9
9
|
}): EditorState;
|
|
@@ -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", "setSectionPageNumbering", "setPaperSize", "setPaperSizePreset", "setColumns", "setColumnsPreset", "editHeader", "editFooter", "insertPageNumber", "insertPageNumberXOfY", "placePageNumberTop", "placePageNumberBottom", "insertBookmark", "removeBookmark", "insertDateField", "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", "sectionBreakEvenPage", "sectionBreakOddPage", "sectionBreakNextColumn", "setPageMargins", "setSectionPageNumbering", "setPaperSize", "setPaperSizePreset", "setColumns", "setColumnsPreset", "editHeader", "editFooter", "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", "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];
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { EditorBookmark, EditorState, EditorTextRun } from '../model.js';
|
|
2
|
+
export type CrossReferenceType = "REF" | "PAGEREF";
|
|
3
|
+
export interface InsertCrossReferenceOptions {
|
|
4
|
+
/** Which derived value to reference. Default `REF`. */
|
|
5
|
+
type?: CrossReferenceType;
|
|
6
|
+
/** The target bookmark's Word name. Required; a no-op when unknown. */
|
|
7
|
+
bookmark: string;
|
|
8
|
+
}
|
|
9
|
+
/** Resolve a bookmark by its Word name, or undefined. */
|
|
10
|
+
export declare function findBookmarkByName(state: EditorState, name: string): EditorBookmark | undefined;
|
|
11
|
+
/**
|
|
12
|
+
* Resolve the text a REF field should display for a bookmark: the flattened
|
|
13
|
+
* text of the bookmarked range (from the start paragraph offset to the end
|
|
14
|
+
* paragraph offset, or the whole start paragraph when the bookmark is
|
|
15
|
+
* zero-width). Falls back to "Error" style placeholder when the target
|
|
16
|
+
* bookmark cannot be located — mirroring a broken cross-reference.
|
|
17
|
+
*/
|
|
18
|
+
export declare function resolveBookmarkReferenceText(state: EditorState, bookmark: EditorBookmark): string;
|
|
19
|
+
/**
|
|
20
|
+
* Insert a cross-reference field at the caret (any zone). When the target
|
|
21
|
+
* bookmark is missing this is a no-op (returns the same state), so a broken
|
|
22
|
+
* reference is never silently authored. The field caches a "1" placeholder as
|
|
23
|
+
* its displayed result, resolved by layout for PAGEREF and by bookmarked text
|
|
24
|
+
* for REF refresh.
|
|
25
|
+
*/
|
|
26
|
+
export declare function insertCrossReference(state: EditorState, options: InsertCrossReferenceOptions): EditorState;
|
|
27
|
+
export declare function isCrossReferenceFieldRun(run: EditorTextRun): boolean;
|
|
@@ -139,6 +139,9 @@ export interface OasisCommandPayloads {
|
|
|
139
139
|
setOrientation: "portrait" | "landscape";
|
|
140
140
|
sectionBreakNextPage: undefined;
|
|
141
141
|
sectionBreakContinuous: undefined;
|
|
142
|
+
sectionBreakEvenPage: undefined;
|
|
143
|
+
sectionBreakOddPage: undefined;
|
|
144
|
+
sectionBreakNextColumn: undefined;
|
|
142
145
|
setPageMargins: SetPageMarginsPayload;
|
|
143
146
|
setSectionPageNumbering: {
|
|
144
147
|
start?: number;
|
|
@@ -164,6 +167,10 @@ export interface OasisCommandPayloads {
|
|
|
164
167
|
insertBookmark: string | undefined;
|
|
165
168
|
removeBookmark: string;
|
|
166
169
|
insertDateField: undefined;
|
|
170
|
+
insertCrossReference: {
|
|
171
|
+
type?: "REF" | "PAGEREF";
|
|
172
|
+
bookmark: string;
|
|
173
|
+
};
|
|
167
174
|
exitHeaderFooter: undefined;
|
|
168
175
|
applyDocumentTheme: DesignThemeId;
|
|
169
176
|
setDocumentColorScheme: string;
|
|
@@ -191,13 +191,19 @@ export interface EditorImageRunData {
|
|
|
191
191
|
/** `\*` number-format switch for PAGE/NUMPAGES fields (WordCraft NUMBER_FORMATS). */
|
|
192
192
|
export type PageNumberFormat = "decimal" | "roman" | "ROMAN" | "alphabetic" | "ALPHABETIC" | "Ordinal";
|
|
193
193
|
/** Field types the editor can author/evaluate for display. */
|
|
194
|
-
export type EditorFieldType = "PAGE" | "NUMPAGES" | "DATE";
|
|
194
|
+
export type EditorFieldType = "PAGE" | "NUMPAGES" | "DATE" | "REF" | "PAGEREF";
|
|
195
195
|
export interface EditorFieldData {
|
|
196
196
|
type: EditorFieldType;
|
|
197
197
|
/** Page-number `\*` format switch. Absent ⇒ decimal. */
|
|
198
198
|
format?: PageNumberFormat;
|
|
199
199
|
/** `\@` picture for DATE fields (e.g. "M/d/yyyy"). Absent ⇒ default. */
|
|
200
200
|
dateFormat?: string;
|
|
201
|
+
/**
|
|
202
|
+
* Bookmark name a REF / PAGEREF cross-reference targets. The wordbookmark
|
|
203
|
+
* name is the link/cross-reference target (e.g. `_Ref12345` or a user
|
|
204
|
+
* bookmark). Absent for PAGE/NUMPAGES/DATE.
|
|
205
|
+
*/
|
|
206
|
+
bookmark?: string;
|
|
201
207
|
}
|
|
202
208
|
/**
|
|
203
209
|
* A preserved complex-field control character (`w:fldChar`). Carried on a
|