oasis-editor 0.0.147 → 0.0.149
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-DM9mi2EU.js → OasisEditorApp-CmqlSXEk.js} +875 -168
- package/dist/app/controllers/useEditorSurfaceEvents.d.ts +1 -0
- package/dist/assets/importDocxWorker-CpQR2fwx.js +12 -0
- package/dist/core/commands/builtinCommands.d.ts +1 -1
- package/dist/core/commands/publicCommandTypes.d.ts +15 -1
- package/dist/core/commands/text.d.ts +1 -1
- package/dist/core/commands/textEditing.d.ts +3 -1
- package/dist/core/document/clone.d.ts +2 -1
- package/dist/core/math/linear.d.ts +5 -0
- package/dist/core/model/index.d.ts +3 -1
- package/dist/core/model/runKind.d.ts +3 -0
- package/dist/core/model/types/layout.d.ts +2 -0
- package/dist/core/model/types/math.d.ts +95 -0
- package/dist/core/model/types/nodes.d.ts +4 -0
- package/dist/export/docx/text/mathXml.d.ts +3 -0
- package/dist/i18n/locales/en.d.ts +31 -0
- package/dist/i18n/locales/pt-BR.d.ts +31 -0
- package/dist/import/docx/math.d.ts +5 -0
- package/dist/import/docx/runs/types.d.ts +2 -1
- package/dist/{index-CXKg4TC3.js → index-B7V7kbjr.js} +2800 -1691
- package/dist/index.d.ts +1 -0
- package/dist/oasis-editor.css +1 -1
- package/dist/oasis-editor.js +79 -79
- package/dist/oasis-editor.umd.cjs +4 -4
- package/dist/plugins/internal/essentialsCapabilities.d.ts +7 -1
- package/dist/ui/app/EditorDialogsLayer.d.ts +4 -0
- package/dist/ui/app/createEditorCommandRuntime.d.ts +11 -0
- package/dist/ui/app/createEditorInteractionRuntime.d.ts +1 -0
- package/dist/ui/app/essentials/types.d.ts +3 -0
- package/dist/ui/app/newDocumentAction.d.ts +7 -0
- package/dist/ui/app/useEditorDialogs.d.ts +23 -0
- package/dist/ui/app/useEditorInteractionWiring.d.ts +1 -0
- package/dist/ui/components/Dialogs/EquationDialog.d.ts +10 -0
- package/dist/ui/components/Dialogs/NewDocumentConfirmationDialog.d.ts +8 -0
- package/dist/ui/components/Dialogs/SymbolDialog.d.ts +8 -0
- package/dist/ui/components/Toolbar/SymbolMenu.d.ts +6 -0
- package/dist/ui/components/Toolbar/presets/builtinToolbarIds.d.ts +3 -1
- package/dist/ui/components/Toolbar/primitives/Menu.d.ts +1 -0
- package/dist/ui/components/Toolbar/recentSymbols.d.ts +4 -0
- package/dist/ui/components/Toolbar/ribbon/RibbonTabs.d.ts +2 -1
- package/dist/ui/components/Toolbar/ribbon/ribbonModel.d.ts +1 -1
- package/dist/ui/components/Toolbar/symbolCatalog.d.ts +16 -0
- package/dist/ui/math/mathPainter.d.ts +10 -0
- package/package.json +1 -1
- package/dist/assets/importDocxWorker-BLm3QMHu.js +0 -12
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const OASIS_BUILTIN_COMMANDS: readonly ["selectAll", "insertFootnote", "insertTableOfContents", "updateTableOfContents", "pastePlainText", "bold", "italic", "underline", "strike", "superscript", "subscript", "link", "unlink", "alignLeft", "alignCenter", "alignRight", "alignJustify", "orderedList", "bulletList", "find", "replace", "toggleTrackChanges", "acceptRevisions", "rejectRevisions", "toggleShowMargins", "toggleShowParagraphMarks", "togglePreciseFonts", "undo", "redo", "pageBreak", "lineBreak", "splitBlock", "setFontFamily", "setFontSize", "increaseFontSize", "decreaseFontSize", "changeTextCase", "clearFormatting", "setColor", "setHighlight", "setTextShading", "setStyleId", "setCharacterStyleId", "setUnderlineStyle", "documentStyles", "print", "copy", "exportDocx", "exportPdf", "importDocument", "insertImage", "editImageAlt", "insertImageCaption", "imageContext", "imageWidthCm", "imageHeightCm", "imageCrop", "imageCropAspect", "imageBorder", "outdent", "indent", "togglePageBreakBefore", "toggleKeepWithNext", "setSpacingAfter", "setSpacingBefore", "setIndentLeft", "setIndentRight", "setIndentFirstLine", "setIndentHanging", "setSpecialIndent", "setParagraphShading", "applyParagraphBorders", "setLineHeight", "setListFormat", "setListStartAt", "toggleOrientation", "setOrientation", "sectionBreakNextPage", "sectionBreakContinuous", "setPageMargins", "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"];
|
|
1
|
+
export declare const OASIS_BUILTIN_COMMANDS: readonly ["selectAll", "insertFootnote", "insertText", "insertEquation", "updateEquation", "insertTableOfContents", "updateTableOfContents", "pastePlainText", "bold", "italic", "underline", "strike", "superscript", "subscript", "link", "unlink", "alignLeft", "alignCenter", "alignRight", "alignJustify", "orderedList", "bulletList", "find", "replace", "toggleTrackChanges", "acceptRevisions", "rejectRevisions", "toggleShowMargins", "toggleShowParagraphMarks", "togglePreciseFonts", "undo", "redo", "pageBreak", "lineBreak", "splitBlock", "setFontFamily", "setFontSize", "increaseFontSize", "decreaseFontSize", "changeTextCase", "clearFormatting", "setColor", "setHighlight", "setTextShading", "setStyleId", "setCharacterStyleId", "setUnderlineStyle", "documentStyles", "print", "copy", "newDocument", "exportDocx", "exportPdf", "importDocument", "insertImage", "editImageAlt", "insertImageCaption", "imageContext", "imageWidthCm", "imageHeightCm", "imageCrop", "imageCropAspect", "imageBorder", "outdent", "indent", "togglePageBreakBefore", "toggleKeepWithNext", "setSpacingAfter", "setSpacingBefore", "setIndentLeft", "setIndentRight", "setIndentFirstLine", "setIndentHanging", "setSpecialIndent", "setParagraphShading", "applyParagraphBorders", "setLineHeight", "setListFormat", "setListStartAt", "toggleOrientation", "setOrientation", "sectionBreakNextPage", "sectionBreakContinuous", "setPageMargins", "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,5 @@
|
|
|
1
1
|
import { CommandRef } from './CommandRef.js';
|
|
2
|
-
import { EditorPageMargins } from '../model.js';
|
|
2
|
+
import { EditorPageMargins, EditorMathExpression } from '../model.js';
|
|
3
3
|
import { TextCaseMode } from './text.js';
|
|
4
4
|
import { TableBorderPreset } from './table.js';
|
|
5
5
|
|
|
@@ -20,6 +20,11 @@ export interface SetSpecialIndentPayload {
|
|
|
20
20
|
kind: "none" | "firstLine" | "hanging";
|
|
21
21
|
value?: number | null;
|
|
22
22
|
}
|
|
23
|
+
/** Payload for inserting text with an optional character font override. */
|
|
24
|
+
export interface InsertTextPayload {
|
|
25
|
+
text: string;
|
|
26
|
+
fontFamily?: string | null;
|
|
27
|
+
}
|
|
23
28
|
/**
|
|
24
29
|
* Maps every built-in command name to its expected payload type.
|
|
25
30
|
* Commands with `undefined` payload accept no arguments.
|
|
@@ -27,6 +32,12 @@ export interface SetSpecialIndentPayload {
|
|
|
27
32
|
export interface OasisCommandPayloads {
|
|
28
33
|
selectAll: undefined;
|
|
29
34
|
insertFootnote: undefined;
|
|
35
|
+
insertText: string | InsertTextPayload;
|
|
36
|
+
insertEquation: EditorMathExpression;
|
|
37
|
+
updateEquation: {
|
|
38
|
+
runId: string;
|
|
39
|
+
expression: EditorMathExpression;
|
|
40
|
+
};
|
|
30
41
|
pastePlainText: undefined;
|
|
31
42
|
bold: undefined;
|
|
32
43
|
italic: undefined;
|
|
@@ -70,6 +81,7 @@ export interface OasisCommandPayloads {
|
|
|
70
81
|
documentStyles: undefined;
|
|
71
82
|
print: undefined;
|
|
72
83
|
copy: undefined;
|
|
84
|
+
newDocument: undefined;
|
|
73
85
|
exportDocx: undefined;
|
|
74
86
|
exportPdf: undefined;
|
|
75
87
|
importDocument: undefined;
|
|
@@ -133,6 +145,8 @@ export interface OasisCommandPayloads {
|
|
|
133
145
|
tableDistributeColumns: undefined;
|
|
134
146
|
tableDistributeRows: undefined;
|
|
135
147
|
insertTable: InsertTablePayload;
|
|
148
|
+
openSymbolDialog: undefined;
|
|
149
|
+
openEquationDialog: undefined;
|
|
136
150
|
}
|
|
137
151
|
/** Maps commands to their typed return values. Commands not listed return `unknown`. */
|
|
138
152
|
export interface OasisCommandResults {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { moveOrCopySelectionToPosition, insertTextAtSelection, insertPlainTextAtSelection, } from './textEditing.js';
|
|
1
|
+
export { moveOrCopySelectionToPosition, insertTextAtSelection, insertPlainTextAtSelection, insertMathAtSelection, updateMathRun, } from './textEditing.js';
|
|
2
2
|
export { deleteBackward, deleteForward } from './textDeletion.js';
|
|
3
3
|
export { toggleTextStyle, clearSelectedTextFormatting, setTextStyleValue, } from './textFormatting.js';
|
|
4
4
|
export { type TextCaseMode, transformSelectedText, changeSelectedTextCase, } from './textCase.js';
|
|
@@ -1,7 +1,9 @@
|
|
|
1
|
-
import { EditorPosition, EditorState, EditorTextStyle } from '../model.js';
|
|
1
|
+
import { EditorPosition, EditorState, EditorTextStyle, EditorMathExpression } from '../model.js';
|
|
2
2
|
|
|
3
3
|
export declare function moveOrCopySelectionToPosition(state: EditorState, targetPosition: EditorPosition, options?: {
|
|
4
4
|
copy?: boolean;
|
|
5
5
|
}): EditorState;
|
|
6
6
|
export declare function insertTextAtSelection(state: EditorState, text: string, styleOverride?: EditorTextStyle): EditorState;
|
|
7
|
+
export declare function insertMathAtSelection(state: EditorState, expression: EditorMathExpression): EditorState;
|
|
8
|
+
export declare function updateMathRun(state: EditorState, runId: string, expression: EditorMathExpression): EditorState;
|
|
7
9
|
export declare function insertPlainTextAtSelection(state: EditorState, text: string, styleOverride?: EditorTextStyle): EditorState;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import { EditorBlockNode, EditorParagraphListStyle, EditorParagraphNode, EditorTextBoxData, EditorTextRun } from '../model.js';
|
|
1
|
+
import { EditorBlockNode, EditorParagraphListStyle, EditorParagraphNode, EditorTextBoxData, EditorTextRun, EditorMathExpression } from '../model.js';
|
|
2
2
|
|
|
3
3
|
export declare function cloneTextBox(textBox: EditorTextBoxData): EditorTextBoxData;
|
|
4
|
+
export declare function cloneMathExpression(expression: EditorMathExpression): EditorMathExpression;
|
|
4
5
|
export declare function cloneRun(run: EditorTextRun): EditorTextRun;
|
|
5
6
|
export declare function cloneParagraph(paragraph: EditorParagraphNode): EditorParagraphNode;
|
|
6
7
|
export declare function cloneParagraphList(list?: EditorParagraphListStyle): EditorParagraphListStyle | undefined;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { EditorMathExpression, EditorMathNode } from '../model.js';
|
|
2
|
+
|
|
3
|
+
export declare function parseLinearMath(linear: string): EditorMathExpression;
|
|
4
|
+
export declare function serializeLinearMathNodes(nodes: EditorMathNode[]): string;
|
|
5
|
+
export declare function serializeLinearMath(expression: EditorMathExpression): string;
|
|
@@ -9,8 +9,10 @@
|
|
|
9
9
|
export type { EditorUnderlineStyle, EditorLigatures, EditorNumberSpacing, EditorNumberForm, EditorTextLanguage, EditorBorderStyle, EditorEmphasisMark, EditorTabStop, EditorParagraphListStyle, EditorImageCrop, EditorImageFillMode, EditorLineDash, EditorImageBorder, EditorImageFloatingPosition, EditorImageFloatingLayout, EditorImageRunData, EditorWrapPolygonPoint, EditorFieldData, EditorFieldChar, EditorFootnoteReferenceData, EditorEndnoteReferenceData, EditorRevision, EditorRevisionMetadata, 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
|
+
export type { EditorMathNode, EditorMathText, EditorMathFraction, EditorMathRadical, EditorMathScript, EditorMathDelimiter, EditorMathAccent, EditorMathNary, EditorMathLimit, EditorMathMatrix, EditorMathBox, EditorMathGroup, EditorMathRaw, EditorMathStyle, EditorMathExpression, } from './types/math.js';
|
|
13
|
+
export { EMPTY_EDITOR_MATH_EXPRESSION, MATH_OBJECT_REPLACEMENT, } from './types/math.js';
|
|
12
14
|
export type { RunKind, RunOfKind, RunVisitor } from './runKind.js';
|
|
13
|
-
export { getRunKind, isInlineObjectRun, visitRun, getRunImage, getRunTextBox, getRunField, getRunFieldChar, getRunFieldInstruction, getRunFootnoteReference, getRunEndnoteReference, getRunSym, } from './runKind.js';
|
|
15
|
+
export { getRunKind, isInlineObjectRun, visitRun, getRunImage, getRunTextBox, getRunField, getRunFieldChar, getRunFieldInstruction, getRunFootnoteReference, getRunEndnoteReference, getRunSym, getRunMath, } from './runKind.js';
|
|
14
16
|
export type { EditorFootnote } from './types/documentFootnotes.js';
|
|
15
17
|
export type { EditorEndnote } from './types/documentEndnotes.js';
|
|
16
18
|
export type { EditorBookmark, EditorBookmarkAnchor, EditorBookmarks, } from './types/documentBookmarks.js';
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { EditorTextBoxData, EditorTextRun } from './types/nodes.js';
|
|
2
|
+
import { EditorMathExpression } from './types/math.js';
|
|
2
3
|
import { EditorFieldChar, EditorFieldData, EditorImageRunData, EditorFootnoteReferenceData, EditorEndnoteReferenceData } from './types/primitives.js';
|
|
3
4
|
|
|
4
5
|
/**
|
|
@@ -26,6 +27,7 @@ export declare function getRunSym(run: EditorTextRun): {
|
|
|
26
27
|
font: string;
|
|
27
28
|
char: string;
|
|
28
29
|
} | undefined;
|
|
30
|
+
export declare function getRunMath(run: EditorTextRun): EditorMathExpression | undefined;
|
|
29
31
|
export interface RunVisitor<R> {
|
|
30
32
|
text(run: RunOfKind<"text">): R;
|
|
31
33
|
image(run: RunOfKind<"image">): R;
|
|
@@ -36,6 +38,7 @@ export interface RunVisitor<R> {
|
|
|
36
38
|
footnoteReference(run: RunOfKind<"footnoteReference">): R;
|
|
37
39
|
endnoteReference(run: RunOfKind<"endnoteReference">): R;
|
|
38
40
|
sym(run: RunOfKind<"sym">): R;
|
|
41
|
+
math?(run: RunOfKind<"math">): R;
|
|
39
42
|
}
|
|
40
43
|
/**
|
|
41
44
|
* Exhaustive dispatch over a run's kind, narrowing the run to the matching union
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { EditorBlockNode, EditorTextBoxData } from './nodes.js';
|
|
2
|
+
import { EditorMathExpression } from './math.js';
|
|
2
3
|
import { EditorPageSettings } from './document.js';
|
|
3
4
|
import { EditorRevision, EditorImageRunData } from './primitives.js';
|
|
4
5
|
import { EditorTextStyle } from './styles.js';
|
|
@@ -24,6 +25,7 @@ export interface EditorLayoutFragment {
|
|
|
24
25
|
styles?: EditorTextStyle;
|
|
25
26
|
image?: EditorImageRunData;
|
|
26
27
|
textBox?: EditorTextBoxData;
|
|
28
|
+
math?: EditorMathExpression;
|
|
27
29
|
revision?: EditorRevision;
|
|
28
30
|
chars: EditorLayoutFragmentChar[];
|
|
29
31
|
}
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Structured Office Math Markup Language (OMML) data used by the editor.
|
|
3
|
+
*
|
|
4
|
+
* Math expressions are deliberately independent from the document tree. A
|
|
5
|
+
* paragraph stores one expression as an inline object; the expression itself
|
|
6
|
+
* is edited as this small, serialisable AST.
|
|
7
|
+
*/
|
|
8
|
+
export type EditorMathNode = EditorMathText | EditorMathFraction | EditorMathRadical | EditorMathScript | EditorMathDelimiter | EditorMathAccent | EditorMathNary | EditorMathLimit | EditorMathMatrix | EditorMathBox | EditorMathGroup | EditorMathRaw;
|
|
9
|
+
export interface EditorMathText {
|
|
10
|
+
kind: "text";
|
|
11
|
+
value: string;
|
|
12
|
+
style?: EditorMathStyle;
|
|
13
|
+
}
|
|
14
|
+
export interface EditorMathFraction {
|
|
15
|
+
kind: "fraction";
|
|
16
|
+
numerator: EditorMathNode[];
|
|
17
|
+
denominator: EditorMathNode[];
|
|
18
|
+
bar?: boolean;
|
|
19
|
+
}
|
|
20
|
+
export interface EditorMathRadical {
|
|
21
|
+
kind: "radical";
|
|
22
|
+
radicand: EditorMathNode[];
|
|
23
|
+
degree?: EditorMathNode[];
|
|
24
|
+
}
|
|
25
|
+
export interface EditorMathScript {
|
|
26
|
+
kind: "script";
|
|
27
|
+
base: EditorMathNode[];
|
|
28
|
+
subscript?: EditorMathNode[];
|
|
29
|
+
superscript?: EditorMathNode[];
|
|
30
|
+
}
|
|
31
|
+
export interface EditorMathDelimiter {
|
|
32
|
+
kind: "delimiter";
|
|
33
|
+
children: EditorMathNode[][];
|
|
34
|
+
begin?: string;
|
|
35
|
+
end?: string;
|
|
36
|
+
separator?: string;
|
|
37
|
+
grow?: boolean;
|
|
38
|
+
}
|
|
39
|
+
export interface EditorMathAccent {
|
|
40
|
+
kind: "accent";
|
|
41
|
+
accent: string;
|
|
42
|
+
children: EditorMathNode[];
|
|
43
|
+
}
|
|
44
|
+
export interface EditorMathNary {
|
|
45
|
+
kind: "nary";
|
|
46
|
+
operator: string;
|
|
47
|
+
children: EditorMathNode[];
|
|
48
|
+
subscript?: EditorMathNode[];
|
|
49
|
+
superscript?: EditorMathNode[];
|
|
50
|
+
grow?: boolean;
|
|
51
|
+
}
|
|
52
|
+
export interface EditorMathLimit {
|
|
53
|
+
kind: "limit";
|
|
54
|
+
operator: "low" | "upper";
|
|
55
|
+
base: EditorMathNode[];
|
|
56
|
+
limit: EditorMathNode[];
|
|
57
|
+
}
|
|
58
|
+
export interface EditorMathMatrix {
|
|
59
|
+
kind: "matrix";
|
|
60
|
+
rows: EditorMathNode[][][];
|
|
61
|
+
rowGap?: number;
|
|
62
|
+
columnGap?: number;
|
|
63
|
+
}
|
|
64
|
+
export interface EditorMathBox {
|
|
65
|
+
kind: "box";
|
|
66
|
+
children: EditorMathNode[];
|
|
67
|
+
border?: boolean;
|
|
68
|
+
hidden?: boolean;
|
|
69
|
+
}
|
|
70
|
+
export interface EditorMathGroup {
|
|
71
|
+
kind: "group";
|
|
72
|
+
children: EditorMathNode[];
|
|
73
|
+
}
|
|
74
|
+
/** Unknown OMML is retained so importing and re-exporting remains lossless. */
|
|
75
|
+
export interface EditorMathRaw {
|
|
76
|
+
kind: "raw";
|
|
77
|
+
xml: string;
|
|
78
|
+
fallbackText?: string;
|
|
79
|
+
}
|
|
80
|
+
export interface EditorMathStyle {
|
|
81
|
+
fontFamily?: string;
|
|
82
|
+
bold?: boolean;
|
|
83
|
+
italic?: boolean;
|
|
84
|
+
normalText?: boolean;
|
|
85
|
+
script?: "roman" | "script" | "fraktur" | "double-struck";
|
|
86
|
+
}
|
|
87
|
+
export interface EditorMathExpression {
|
|
88
|
+
version: 1;
|
|
89
|
+
children: EditorMathNode[];
|
|
90
|
+
display?: boolean;
|
|
91
|
+
/** Original OMML for diagnostics and exact round-trip of untouched data. */
|
|
92
|
+
sourceXml?: string;
|
|
93
|
+
}
|
|
94
|
+
export declare const EMPTY_EDITOR_MATH_EXPRESSION: EditorMathExpression;
|
|
95
|
+
export declare const MATH_OBJECT_REPLACEMENT = "\uFFFC";
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { EditorDocxWidthValue, EditorEndnoteReferenceData, EditorFieldChar, EditorFieldData, EditorFootnoteReferenceData, EditorImageFloatingLayout, EditorImageRunData, EditorParagraphListStyle, EditorRevision, EditorPropertyRevision, EditorStructuralRevision, EditorTableRowHeightRule } from './primitives.js';
|
|
2
|
+
import { EditorMathExpression } from './math.js';
|
|
2
3
|
import { EditorParagraphStyle, EditorTableCellStyle, EditorTableStyle, EditorTableConditionalFlags, EditorTextStyle } from './styles.js';
|
|
3
4
|
|
|
4
5
|
/**
|
|
@@ -127,6 +128,9 @@ export type EditorTextRun = (EditorRunBase & {
|
|
|
127
128
|
font: string;
|
|
128
129
|
char: string;
|
|
129
130
|
};
|
|
131
|
+
}) | (EditorRunBase & {
|
|
132
|
+
kind: "math";
|
|
133
|
+
math: EditorMathExpression;
|
|
130
134
|
});
|
|
131
135
|
/**
|
|
132
136
|
* A drop cap (Word's `w:framePr/@dropCap`): a large initial letter sunk into
|
|
@@ -2,10 +2,13 @@ export declare const en: {
|
|
|
2
2
|
"toolbar.file": string;
|
|
3
3
|
"toolbar.export": string;
|
|
4
4
|
"toolbar.import": string;
|
|
5
|
+
"toolbar.newDocument": string;
|
|
6
|
+
"toolbar.importDocx": string;
|
|
5
7
|
"toolbar.undo": string;
|
|
6
8
|
"toolbar.redo": string;
|
|
7
9
|
"toolbar.insert": string;
|
|
8
10
|
"toolbar.image": string;
|
|
11
|
+
"toolbar.symbols": string;
|
|
9
12
|
"toolbar.imageCaption": string;
|
|
10
13
|
"toolbar.shapes": string;
|
|
11
14
|
"toolbar.shape.rect": string;
|
|
@@ -63,6 +66,17 @@ export declare const en: {
|
|
|
63
66
|
"toolbar.formatUpperRoman": string;
|
|
64
67
|
"toolbar.formatBullet": string;
|
|
65
68
|
"toolbar.moreTools": string;
|
|
69
|
+
"symbols.menu.equation": string;
|
|
70
|
+
"symbols.menu.symbol": string;
|
|
71
|
+
"symbols.menu.number": string;
|
|
72
|
+
"symbols.more": string;
|
|
73
|
+
"symbols.category.all": string;
|
|
74
|
+
"symbols.category.common": string;
|
|
75
|
+
"symbols.category.math": string;
|
|
76
|
+
"symbols.category.arrows": string;
|
|
77
|
+
"symbols.category.currency": string;
|
|
78
|
+
"symbols.category.greek": string;
|
|
79
|
+
"symbols.category.numbers": string;
|
|
66
80
|
"toolbar.style": string;
|
|
67
81
|
"toolbar.fontFamily": string;
|
|
68
82
|
"toolbar.font": string;
|
|
@@ -324,10 +338,27 @@ export declare const en: {
|
|
|
324
338
|
"layoutOptions.fixPosition": string;
|
|
325
339
|
"layoutOptions.behindHint": string;
|
|
326
340
|
"generic.close": string;
|
|
341
|
+
"generic.back": string;
|
|
327
342
|
"generic.cancel": string;
|
|
328
343
|
"generic.save": string;
|
|
329
344
|
"generic.apply": string;
|
|
330
345
|
"generic.ok": string;
|
|
346
|
+
"dialog.symbol.title": string;
|
|
347
|
+
"dialog.symbol.insert": string;
|
|
348
|
+
"dialog.symbol.font": string;
|
|
349
|
+
"dialog.symbol.subset": string;
|
|
350
|
+
"dialog.symbol.preview": string;
|
|
351
|
+
"dialog.symbol.recent": string;
|
|
352
|
+
"dialog.symbol.code": string;
|
|
353
|
+
"dialog.symbol.doubleClickHelp": string;
|
|
354
|
+
"dialog.equation.title": string;
|
|
355
|
+
"dialog.equation.insert": string;
|
|
356
|
+
"dialog.equation.structures": string;
|
|
357
|
+
"dialog.equation.linear": string;
|
|
358
|
+
"dialog.equation.empty": string;
|
|
359
|
+
"dialog.newDocument.title": string;
|
|
360
|
+
"dialog.newDocument.message": string;
|
|
361
|
+
"dialog.newDocument.discard": string;
|
|
331
362
|
"title.untitled": string;
|
|
332
363
|
"dialog.imageAlt.title": string;
|
|
333
364
|
"dialog.imageAlt.label": string;
|
|
@@ -2,10 +2,13 @@ export declare const ptBR: {
|
|
|
2
2
|
"toolbar.file": string;
|
|
3
3
|
"toolbar.export": string;
|
|
4
4
|
"toolbar.import": string;
|
|
5
|
+
"toolbar.newDocument": string;
|
|
6
|
+
"toolbar.importDocx": string;
|
|
5
7
|
"toolbar.undo": string;
|
|
6
8
|
"toolbar.redo": string;
|
|
7
9
|
"toolbar.insert": string;
|
|
8
10
|
"toolbar.image": string;
|
|
11
|
+
"toolbar.symbols": string;
|
|
9
12
|
"toolbar.imageCaption": string;
|
|
10
13
|
"toolbar.shapes": string;
|
|
11
14
|
"toolbar.shape.rect": string;
|
|
@@ -63,6 +66,17 @@ export declare const ptBR: {
|
|
|
63
66
|
"toolbar.formatUpperRoman": string;
|
|
64
67
|
"toolbar.formatBullet": string;
|
|
65
68
|
"toolbar.moreTools": string;
|
|
69
|
+
"symbols.menu.equation": string;
|
|
70
|
+
"symbols.menu.symbol": string;
|
|
71
|
+
"symbols.menu.number": string;
|
|
72
|
+
"symbols.more": string;
|
|
73
|
+
"symbols.category.all": string;
|
|
74
|
+
"symbols.category.common": string;
|
|
75
|
+
"symbols.category.math": string;
|
|
76
|
+
"symbols.category.arrows": string;
|
|
77
|
+
"symbols.category.currency": string;
|
|
78
|
+
"symbols.category.greek": string;
|
|
79
|
+
"symbols.category.numbers": string;
|
|
66
80
|
"toolbar.style": string;
|
|
67
81
|
"toolbar.fontFamily": string;
|
|
68
82
|
"toolbar.font": string;
|
|
@@ -324,10 +338,27 @@ export declare const ptBR: {
|
|
|
324
338
|
"layoutOptions.fixPosition": string;
|
|
325
339
|
"layoutOptions.behindHint": string;
|
|
326
340
|
"generic.close": string;
|
|
341
|
+
"generic.back": string;
|
|
327
342
|
"generic.cancel": string;
|
|
328
343
|
"generic.save": string;
|
|
329
344
|
"generic.apply": string;
|
|
330
345
|
"generic.ok": string;
|
|
346
|
+
"dialog.symbol.title": string;
|
|
347
|
+
"dialog.symbol.insert": string;
|
|
348
|
+
"dialog.symbol.font": string;
|
|
349
|
+
"dialog.symbol.subset": string;
|
|
350
|
+
"dialog.symbol.preview": string;
|
|
351
|
+
"dialog.symbol.recent": string;
|
|
352
|
+
"dialog.symbol.code": string;
|
|
353
|
+
"dialog.symbol.doubleClickHelp": string;
|
|
354
|
+
"dialog.equation.title": string;
|
|
355
|
+
"dialog.equation.insert": string;
|
|
356
|
+
"dialog.equation.structures": string;
|
|
357
|
+
"dialog.equation.linear": string;
|
|
358
|
+
"dialog.equation.empty": string;
|
|
359
|
+
"dialog.newDocument.title": string;
|
|
360
|
+
"dialog.newDocument.message": string;
|
|
361
|
+
"dialog.newDocument.discard": string;
|
|
331
362
|
"title.untitled": string;
|
|
332
363
|
"dialog.imageAlt.title": string;
|
|
333
364
|
"dialog.imageAlt.label": string;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { Element as XmlElement } from '@xmldom/xmldom';
|
|
2
|
+
import { EditorMathExpression } from '../../core/model.js';
|
|
3
|
+
|
|
4
|
+
export declare const MATH_NS = "http://schemas.openxmlformats.org/officeDocument/2006/math";
|
|
5
|
+
export declare function parseMathExpression(element: XmlElement): EditorMathExpression;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Element as XmlElement } from '@xmldom/xmldom';
|
|
2
|
-
import { EditorBlockNode, EditorTextStyle, EditorImageRunData, EditorTextBoxData } from '../../../core/model.js';
|
|
2
|
+
import { EditorBlockNode, EditorTextStyle, EditorImageRunData, EditorTextBoxData, EditorMathExpression } from '../../../core/model.js';
|
|
3
3
|
|
|
4
4
|
export type ParseNestedBlocks = (container: XmlElement) => Promise<EditorBlockNode[]>;
|
|
5
5
|
/**
|
|
@@ -53,4 +53,5 @@ export interface ImportedRun {
|
|
|
53
53
|
font: string;
|
|
54
54
|
char: string;
|
|
55
55
|
};
|
|
56
|
+
math?: EditorMathExpression;
|
|
56
57
|
}
|