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,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';
|
|
@@ -23,6 +23,9 @@ export interface EssentialsHistoryCapability {
|
|
|
23
23
|
export interface EssentialsFormattingCapability {
|
|
24
24
|
selectAll: () => boolean;
|
|
25
25
|
insertFootnote: () => boolean;
|
|
26
|
+
insertText: (text: string, fontFamily?: string | null) => boolean;
|
|
27
|
+
insertEquation: (expression: EditorMathExpression) => boolean;
|
|
28
|
+
updateEquation: (runId: string, expression: EditorMathExpression) => boolean;
|
|
26
29
|
pastePlainText: () => boolean;
|
|
27
30
|
bold: () => boolean;
|
|
28
31
|
italic: () => boolean;
|
|
@@ -84,11 +87,14 @@ export interface EssentialsDocumentStyleDescriptor {
|
|
|
84
87
|
}
|
|
85
88
|
export interface EssentialsDocumentCapability {
|
|
86
89
|
documentStyles: () => EssentialsDocumentStyleDescriptor[];
|
|
90
|
+
newDocument: () => void;
|
|
87
91
|
exportDocx: () => void;
|
|
88
92
|
exportPdf: () => void;
|
|
89
93
|
importDocument: () => void;
|
|
90
94
|
insertImage: () => void;
|
|
91
95
|
insertShape: (preset: string) => void;
|
|
96
|
+
openSymbolDialog: () => void;
|
|
97
|
+
openEquationDialog: () => void;
|
|
92
98
|
}
|
|
93
99
|
export interface EssentialsLinkCapability {
|
|
94
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';
|
|
@@ -21,6 +22,9 @@ export interface EditorDialogsLayerProps {
|
|
|
21
22
|
applyParagraphDialogValues: ComponentProps<typeof ParagraphDialog>["onApply"];
|
|
22
23
|
setParagraphDialogDefault: NonNullable<ComponentProps<typeof ParagraphDialog>["onSetDefault"]>;
|
|
23
24
|
applyTablePropertiesDialogValues: ComponentProps<typeof TablePropertiesDialog>["onApply"];
|
|
25
|
+
confirmNewDocument: () => void;
|
|
26
|
+
insertSymbol: (symbol: string, fontFamily: string) => void;
|
|
27
|
+
applyEquation: (expression: EditorMathExpression, targetRunId?: string) => void;
|
|
24
28
|
closeContextMenu: () => void;
|
|
25
29
|
}
|
|
26
30
|
/**
|
|
@@ -45,6 +45,17 @@ export interface EditorCommandRuntimeDeps {
|
|
|
45
45
|
isOpen: boolean;
|
|
46
46
|
initialCaption: string;
|
|
47
47
|
}) => void;
|
|
48
|
+
setNewDocumentDialog: (state: {
|
|
49
|
+
isOpen: boolean;
|
|
50
|
+
}) => void;
|
|
51
|
+
setSymbolDialog: (state: {
|
|
52
|
+
isOpen: boolean;
|
|
53
|
+
}) => void;
|
|
54
|
+
setEquationDialog: (state: {
|
|
55
|
+
isOpen: boolean;
|
|
56
|
+
initial?: import('../../core/model.js').EditorMathExpression;
|
|
57
|
+
targetRunId?: string;
|
|
58
|
+
}) => void;
|
|
48
59
|
getUiState: () => OasisEditorUiState;
|
|
49
60
|
updateUiState: (patch: OasisEditorUiState) => OasisEditorUiState;
|
|
50
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 &
|
|
@@ -26,6 +26,9 @@ export interface CreateEditorEssentialsPluginOptions {
|
|
|
26
26
|
handleExportDocx: () => Promise<Blob>;
|
|
27
27
|
handleExportPdf: () => Promise<Blob>;
|
|
28
28
|
};
|
|
29
|
+
newDocument: () => void;
|
|
30
|
+
openSymbolDialog: () => void;
|
|
31
|
+
openEquationDialog: () => void;
|
|
29
32
|
importInputRef: () => HTMLInputElement | undefined;
|
|
30
33
|
imageInputRef: () => HTMLInputElement | undefined;
|
|
31
34
|
selectedImageRun: () => SelectedImageRun | null;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export interface NewDocumentActionDeps {
|
|
2
|
+
isDirty: () => boolean;
|
|
3
|
+
resetDocument: () => void;
|
|
4
|
+
requestConfirmation: () => void;
|
|
5
|
+
}
|
|
6
|
+
/** Creates the shared New Document action used by the ribbon, menu and shortcut. */
|
|
7
|
+
export declare function createNewDocumentAction(deps: NewDocumentActionDeps): () => void;
|
|
@@ -2,8 +2,31 @@ 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 {
|
|
8
|
+
newDocumentDialog: Accessor<{
|
|
9
|
+
isOpen: boolean;
|
|
10
|
+
}>;
|
|
11
|
+
setNewDocumentDialog: Setter<{
|
|
12
|
+
isOpen: boolean;
|
|
13
|
+
}>;
|
|
14
|
+
symbolDialog: Accessor<{
|
|
15
|
+
isOpen: boolean;
|
|
16
|
+
}>;
|
|
17
|
+
setSymbolDialog: Setter<{
|
|
18
|
+
isOpen: boolean;
|
|
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
|
+
}>;
|
|
7
30
|
linkDialog: Accessor<{
|
|
8
31
|
isOpen: boolean;
|
|
9
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,8 @@
|
|
|
1
|
+
import { JSX } from 'solid-js';
|
|
2
|
+
|
|
3
|
+
export interface NewDocumentConfirmationDialogProps {
|
|
4
|
+
isOpen: boolean;
|
|
5
|
+
onClose: () => void;
|
|
6
|
+
onConfirm: () => void;
|
|
7
|
+
}
|
|
8
|
+
export declare function NewDocumentConfirmationDialog(props: NewDocumentConfirmationDialogProps): JSX.Element;
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
export declare const OASIS_TOOLBAR_ITEMS: {
|
|
2
|
+
readonly newDocument: "editor-toolbar-new-document";
|
|
3
|
+
readonly importDocument: "editor-toolbar-import-document";
|
|
2
4
|
readonly exportDocx: "editor-toolbar-export-docx";
|
|
3
5
|
readonly exportPdf: "editor-toolbar-export-pdf";
|
|
4
|
-
readonly importDocument: "editor-toolbar-import-document";
|
|
5
6
|
readonly undo: "editor-toolbar-undo";
|
|
6
7
|
readonly redo: "editor-toolbar-redo";
|
|
7
8
|
readonly style: "editor-toolbar-style";
|
|
@@ -18,6 +19,7 @@ export declare const OASIS_TOOLBAR_ITEMS: {
|
|
|
18
19
|
readonly subscript: "editor-toolbar-subscript";
|
|
19
20
|
readonly insertImage: "editor-toolbar-insert-image";
|
|
20
21
|
readonly insertTable: "editor-toolbar-insert-table";
|
|
22
|
+
readonly symbols: "editor-toolbar-symbols";
|
|
21
23
|
readonly link: "editor-toolbar-link";
|
|
22
24
|
readonly unlink: "editor-toolbar-unlink";
|
|
23
25
|
readonly footnote: "editor-toolbar-footnote";
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { Accessor, Setter, JSX } from 'solid-js';
|
|
2
|
-
import { RibbonTabId, ToolbarActionApi } from '../schema/items.js';
|
|
2
|
+
import { RibbonTabId, ToolbarActionApi, ToolbarItem } from '../schema/items.js';
|
|
3
3
|
|
|
4
4
|
export interface RibbonTabsProps {
|
|
5
5
|
activeTab: Accessor<RibbonTabId>;
|
|
6
6
|
setActiveTab: Setter<RibbonTabId>;
|
|
7
7
|
api: ToolbarActionApi;
|
|
8
|
+
items: Accessor<ToolbarItem[]>;
|
|
8
9
|
}
|
|
9
10
|
export declare function RibbonTabs(props: RibbonTabsProps): JSX.Element;
|
|
@@ -30,7 +30,7 @@ export interface RibbonGroupWidth {
|
|
|
30
30
|
* supplied, contextual tabs are omitted (used for static/enumeration contexts).
|
|
31
31
|
*/
|
|
32
32
|
export declare function isRibbonTabVisible(id: RibbonTabId, api?: Pick<ToolbarActionApi, "commands">): boolean;
|
|
33
|
-
export declare function buildRibbonTabDefinitions(t: TranslateFn, api?: Pick<ToolbarActionApi, "commands"
|
|
33
|
+
export declare function buildRibbonTabDefinitions(t: TranslateFn, api?: Pick<ToolbarActionApi, "commands">, items?: ToolbarItem[]): RibbonTabDefinition[];
|
|
34
34
|
export declare const DEFAULT_RIBBON_TAB: RibbonTabId;
|
|
35
35
|
export declare const DEFAULT_RIBBON_GROUP = "general";
|
|
36
36
|
export declare const DEFAULT_RIBBON_ROW: RibbonRow;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { TranslationKey } from '../../../i18n/index.js';
|
|
2
|
+
|
|
3
|
+
export interface SymbolEntry {
|
|
4
|
+
character: string;
|
|
5
|
+
codePoint: string;
|
|
6
|
+
}
|
|
7
|
+
export interface SymbolCategory {
|
|
8
|
+
id: string;
|
|
9
|
+
labelKey: TranslationKey;
|
|
10
|
+
entries: readonly SymbolEntry[];
|
|
11
|
+
}
|
|
12
|
+
export declare const SYMBOL_CATEGORIES: readonly SymbolCategory[];
|
|
13
|
+
export declare const COMMON_SYMBOLS: SymbolEntry[];
|
|
14
|
+
export declare const NUMBER_SYMBOLS: readonly SymbolEntry[];
|
|
15
|
+
export declare const EQUATION_TEMPLATES: readonly SymbolEntry[];
|
|
16
|
+
export declare function getSymbolCategory(id: string): SymbolCategory | undefined;
|
|
@@ -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;
|