oasis-editor 0.0.148 → 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-B1b1iJOQ.js → OasisEditorApp-CmqlSXEk.js} +302 -45
- 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 +7 -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 +5 -0
- package/dist/i18n/locales/pt-BR.d.ts +5 -0
- package/dist/import/docx/math.d.ts +5 -0
- package/dist/import/docx/runs/types.d.ts +2 -1
- package/dist/{index-CpZO1PF4.js → index-B7V7kbjr.js} +1860 -1285
- 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 +4 -1
- package/dist/ui/app/EditorDialogsLayer.d.ts +2 -0
- package/dist/ui/app/createEditorCommandRuntime.d.ts +5 -0
- package/dist/ui/app/createEditorInteractionRuntime.d.ts +1 -0
- package/dist/ui/app/essentials/types.d.ts +1 -0
- package/dist/ui/app/useEditorDialogs.d.ts +11 -0
- package/dist/ui/app/useEditorInteractionWiring.d.ts +1 -0
- package/dist/ui/components/Dialogs/EquationDialog.d.ts +10 -0
- package/dist/ui/math/mathPainter.d.ts +10 -0
- package/package.json +1 -1
- package/dist/assets/importDocxWorker-BLm3QMHu.js +0 -12
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { EditorImageBorder, EditorPageMargins } from '../../core/model.js';
|
|
1
|
+
import { EditorImageBorder, EditorPageMargins, EditorMathExpression } from '../../core/model.js';
|
|
2
2
|
import { ImageBorderPatch } from '../../core/commands/image.js';
|
|
3
3
|
import { TextCaseMode } from '../../core/commands/text.js';
|
|
4
4
|
import { ToolbarStyleState } from '../../ui/toolbarStyleState.js';
|
|
@@ -24,6 +24,8 @@ export interface EssentialsFormattingCapability {
|
|
|
24
24
|
selectAll: () => boolean;
|
|
25
25
|
insertFootnote: () => boolean;
|
|
26
26
|
insertText: (text: string, fontFamily?: string | null) => boolean;
|
|
27
|
+
insertEquation: (expression: EditorMathExpression) => boolean;
|
|
28
|
+
updateEquation: (runId: string, expression: EditorMathExpression) => boolean;
|
|
27
29
|
pastePlainText: () => boolean;
|
|
28
30
|
bold: () => boolean;
|
|
29
31
|
italic: () => boolean;
|
|
@@ -92,6 +94,7 @@ export interface EssentialsDocumentCapability {
|
|
|
92
94
|
insertImage: () => void;
|
|
93
95
|
insertShape: (preset: string) => void;
|
|
94
96
|
openSymbolDialog: () => void;
|
|
97
|
+
openEquationDialog: () => void;
|
|
95
98
|
}
|
|
96
99
|
export interface EssentialsLinkCapability {
|
|
97
100
|
prompt: () => void;
|
|
@@ -2,6 +2,7 @@ import { ComponentProps, JSX } from 'solid-js';
|
|
|
2
2
|
import { FontDialog } from '../components/Dialogs/FontDialog.js';
|
|
3
3
|
import { ParagraphDialog } from '../components/Dialogs/ParagraphDialog.js';
|
|
4
4
|
import { TablePropertiesDialog } from '../components/Dialogs/TablePropertiesDialog.js';
|
|
5
|
+
import { EditorMathExpression } from '../../core/model.js';
|
|
5
6
|
import { FindReplaceDialog } from '../components/FindReplace/FindReplaceDialog.js';
|
|
6
7
|
import { ContextMenu } from '../components/ContextMenu/ContextMenu.js';
|
|
7
8
|
import { createEditorDialogs } from './useEditorDialogs.js';
|
|
@@ -23,6 +24,7 @@ export interface EditorDialogsLayerProps {
|
|
|
23
24
|
applyTablePropertiesDialogValues: ComponentProps<typeof TablePropertiesDialog>["onApply"];
|
|
24
25
|
confirmNewDocument: () => void;
|
|
25
26
|
insertSymbol: (symbol: string, fontFamily: string) => void;
|
|
27
|
+
applyEquation: (expression: EditorMathExpression, targetRunId?: string) => void;
|
|
26
28
|
closeContextMenu: () => void;
|
|
27
29
|
}
|
|
28
30
|
/**
|
|
@@ -51,6 +51,11 @@ export interface EditorCommandRuntimeDeps {
|
|
|
51
51
|
setSymbolDialog: (state: {
|
|
52
52
|
isOpen: boolean;
|
|
53
53
|
}) => void;
|
|
54
|
+
setEquationDialog: (state: {
|
|
55
|
+
isOpen: boolean;
|
|
56
|
+
initial?: import('../../core/model.js').EditorMathExpression;
|
|
57
|
+
targetRunId?: string;
|
|
58
|
+
}) => void;
|
|
54
59
|
getUiState: () => OasisEditorUiState;
|
|
55
60
|
updateUiState: (patch: OasisEditorUiState) => OasisEditorUiState;
|
|
56
61
|
zoom: {
|
|
@@ -33,6 +33,7 @@ export interface EditorInteractionRuntimeDeps {
|
|
|
33
33
|
measuredParagraphLayouts: DocRuntime["measuredParagraphLayouts"];
|
|
34
34
|
documentLayout: DocRuntime["documentLayout"];
|
|
35
35
|
canvasSnapshotProvider: DocRuntime["canvasSnapshotProvider"];
|
|
36
|
+
openEquationDialog: (initial?: import('../../core/model.js').EditorMathExpression, targetRunId?: string) => void;
|
|
36
37
|
}
|
|
37
38
|
/**
|
|
38
39
|
* Phase B of the editor runtime: selection queries, the hit resolver, find &
|
|
@@ -28,6 +28,7 @@ export interface CreateEditorEssentialsPluginOptions {
|
|
|
28
28
|
};
|
|
29
29
|
newDocument: () => void;
|
|
30
30
|
openSymbolDialog: () => void;
|
|
31
|
+
openEquationDialog: () => void;
|
|
31
32
|
importInputRef: () => HTMLInputElement | undefined;
|
|
32
33
|
imageInputRef: () => HTMLInputElement | undefined;
|
|
33
34
|
selectedImageRun: () => SelectedImageRun | null;
|
|
@@ -2,6 +2,7 @@ import { Accessor, Setter } from 'solid-js';
|
|
|
2
2
|
import { FontDialogInitialValues } from '../components/Dialogs/FontDialog.js';
|
|
3
3
|
import { ParagraphDialogInitialValues } from '../components/Dialogs/ParagraphDialog.js';
|
|
4
4
|
import { TablePropertiesDialogInitialValues } from '../components/Dialogs/TablePropertiesDialog.js';
|
|
5
|
+
import { EditorMathExpression } from '../../core/model.js';
|
|
5
6
|
|
|
6
7
|
export interface EditorDialogsState {
|
|
7
8
|
newDocumentDialog: Accessor<{
|
|
@@ -16,6 +17,16 @@ export interface EditorDialogsState {
|
|
|
16
17
|
setSymbolDialog: Setter<{
|
|
17
18
|
isOpen: boolean;
|
|
18
19
|
}>;
|
|
20
|
+
equationDialog: Accessor<{
|
|
21
|
+
isOpen: boolean;
|
|
22
|
+
initial?: EditorMathExpression;
|
|
23
|
+
targetRunId?: string;
|
|
24
|
+
}>;
|
|
25
|
+
setEquationDialog: Setter<{
|
|
26
|
+
isOpen: boolean;
|
|
27
|
+
initial?: EditorMathExpression;
|
|
28
|
+
targetRunId?: string;
|
|
29
|
+
}>;
|
|
19
30
|
linkDialog: Accessor<{
|
|
20
31
|
isOpen: boolean;
|
|
21
32
|
initialHref: string;
|
|
@@ -50,6 +50,7 @@ export interface EditorInteractionWiringContext {
|
|
|
50
50
|
getForcePlainTextPaste: () => boolean;
|
|
51
51
|
setForcePlainTextPaste: (value: boolean) => void;
|
|
52
52
|
insertImageFromFile: ClipboardParams["insertImageFromFile"];
|
|
53
|
+
openEquationDialog: (initial?: import('../../core/model.js').EditorMathExpression, targetRunId?: string) => void;
|
|
53
54
|
}
|
|
54
55
|
export interface EditorInteractionWiring {
|
|
55
56
|
tableResize: ReturnType<typeof createEditorTableResize>;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { JSX } from 'solid-js';
|
|
2
|
+
import { EditorMathExpression } from '../../../core/model.js';
|
|
3
|
+
|
|
4
|
+
export interface EquationDialogProps {
|
|
5
|
+
isOpen: boolean;
|
|
6
|
+
initial?: EditorMathExpression;
|
|
7
|
+
onClose: () => void;
|
|
8
|
+
onApply: (expression: EditorMathExpression) => void;
|
|
9
|
+
}
|
|
10
|
+
export declare function EquationDialog(props: EquationDialogProps): JSX.Element;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { EditorMathExpression, EditorMathNode } from '../../core/model.js';
|
|
2
|
+
|
|
3
|
+
export declare function mathDisplayText(expression: EditorMathExpression): string;
|
|
4
|
+
export interface MathMeasure {
|
|
5
|
+
width: number;
|
|
6
|
+
height: number;
|
|
7
|
+
}
|
|
8
|
+
export declare function measureMathExpression(expression: EditorMathExpression, fontSize: number): MathMeasure;
|
|
9
|
+
export declare function drawMathExpression(ctx: CanvasRenderingContext2D, expression: EditorMathExpression, x: number, baseline: number, fontSize: number, color: string): void;
|
|
10
|
+
export declare function mathNodeText(node: EditorMathNode): string;
|