oasis-editor 0.0.135 → 0.0.136
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-207_qEC4.js → OasisEditorApp-DPrjPRTW.js} +650 -1005
- package/dist/app/controllers/documentIO/DocumentImporter.d.ts +3 -1
- package/dist/app/controllers/documentIO/importProgress.d.ts +1 -1
- package/dist/app/controllers/useEditorDocumentIO.d.ts +3 -1
- package/dist/core/commands/builtinCommands.d.ts +1 -1
- package/dist/core/commands/publicCommandTypes.d.ts +4 -0
- package/dist/core/commands/table/tableCellStyleCommands.d.ts +7 -0
- package/dist/core/smallCaps.d.ts +7 -0
- package/dist/core/tableStyleResolver.d.ts +5 -0
- package/dist/export/pdf/fonts/PdfFontRegistry.d.ts +1 -0
- package/dist/export/pdf/fonts/officeFontAssets.d.ts +2 -0
- package/dist/i18n/locales/en.d.ts +4 -2
- package/dist/i18n/locales/pt-BR.d.ts +4 -2
- package/dist/{index-CaKZARyM.js → index-Cbwb1bgI.js} +3165 -1540
- package/dist/oasis-editor.css +1 -1
- package/dist/oasis-editor.js +49 -49
- package/dist/oasis-editor.umd.cjs +4 -4
- package/dist/plugins/internal/essentialsCapabilities.d.ts +13 -0
- package/dist/text/fonts/FontMetricsProvider.d.ts +1 -1
- package/dist/text/fonts/core/types.d.ts +1 -1
- package/dist/text/fonts/decoders/WoffDecoder.d.ts +8 -0
- package/dist/text/fonts/preciseFontMetrics.d.ts +9 -0
- package/dist/text/fonts/remoteWebFonts.d.ts +16 -0
- package/dist/ui/OasisEditorAppProps.d.ts +4 -0
- package/dist/ui/OasisEditorEditorProps.d.ts +1 -0
- package/dist/ui/app/buildEditorViewProps.d.ts +1 -0
- package/dist/ui/app/documentFontPreparation.d.ts +23 -0
- package/dist/ui/canvas/canvasFontResolution.d.ts +2 -2
- package/dist/ui/canvas/paragraph/canvasTextEffects.d.ts +1 -0
- package/dist/ui/components/Toolbar/TableBordersMenu.d.ts +6 -0
- package/dist/ui/components/Toolbar/TableStyleGallery.d.ts +9 -0
- package/dist/ui/components/Toolbar/TableStyleOptions.d.ts +6 -0
- package/dist/ui/components/Toolbar/presets/defaultToolbar/buttonSpecs.d.ts +1 -0
- package/dist/ui/components/Toolbar/schema/items.d.ts +8 -0
- package/dist/ui/editorUiTypes.d.ts +1 -0
- package/dist/ui/textMeasurement/fontMetrics.d.ts +3 -2
- package/package.json +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { EditorState } from '../../../core/model.js';
|
|
1
|
+
import { EditorState, getDocumentParagraphs } from '../../../core/model.js';
|
|
2
2
|
import { EditorLogger } from '../../../utils/logger.js';
|
|
3
3
|
import { ImportProgressPhase } from './importProgress.js';
|
|
4
4
|
|
|
@@ -7,6 +7,8 @@ export interface DocumentImporterDeps {
|
|
|
7
7
|
stabilizeLayoutAfterImport: () => Promise<void>;
|
|
8
8
|
resetEditorChromeState: () => void;
|
|
9
9
|
focusInput: () => void;
|
|
10
|
+
requestLocalFontAccess: () => Promise<boolean>;
|
|
11
|
+
prepareDocumentFonts: (document: Parameters<typeof getDocumentParagraphs>[0]) => Promise<void>;
|
|
10
12
|
setImportPhase: (phase: ImportProgressPhase, subProgress?: number) => void;
|
|
11
13
|
clearImportProgressSoon: () => void;
|
|
12
14
|
now: () => number;
|
|
@@ -6,7 +6,7 @@ import { ImportStage } from '../../../import/DocumentFormatImporter.js';
|
|
|
6
6
|
* reference the phase type without importing the hook (which imports the
|
|
7
7
|
* importer), avoiding a cycle.
|
|
8
8
|
*/
|
|
9
|
-
export type ImportProgressPhase = "reading-file" | ImportStage | "applying-editor-state" | "stabilizing-layout" | "done" | "error";
|
|
9
|
+
export type ImportProgressPhase = "reading-file" | ImportStage | "preparing-fonts" | "applying-editor-state" | "stabilizing-layout" | "done" | "error";
|
|
10
10
|
export interface ImportProgressState {
|
|
11
11
|
phase: ImportProgressPhase;
|
|
12
12
|
progress: number;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { MergeKey } from '../../core/transactionMergeKeys.js';
|
|
2
|
-
import { EditorState, EditorPosition } from '../../core/model.js';
|
|
2
|
+
import { EditorState, EditorPosition, EditorDocument } from '../../core/model.js';
|
|
3
3
|
import { EditorLogger } from '../../utils/logger.js';
|
|
4
4
|
import { ImportProgressState } from './documentIO/importProgress.js';
|
|
5
5
|
|
|
@@ -15,6 +15,8 @@ export interface UseEditorDocumentIOProps {
|
|
|
15
15
|
stabilizeLayoutAfterImport: () => Promise<void>;
|
|
16
16
|
resetEditorChromeState: () => void;
|
|
17
17
|
focusInput: () => void;
|
|
18
|
+
requestLocalFontAccess: () => Promise<boolean>;
|
|
19
|
+
prepareDocumentFonts: (document: EditorDocument) => Promise<void>;
|
|
18
20
|
logger: EditorLogger;
|
|
19
21
|
}
|
|
20
22
|
export declare function createEditorDocumentIO(deps: UseEditorDocumentIOProps): ReturnType<typeof createEditorDocumentIOImpl>;
|
|
@@ -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", "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", "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"];
|
|
2
2
|
export type OasisBuiltinCommand = (typeof OASIS_BUILTIN_COMMANDS)[number];
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { CommandRef } from './CommandRef.js';
|
|
2
2
|
import { EditorPageMargins } from '../model.js';
|
|
3
3
|
import { TextCaseMode } from './text.js';
|
|
4
|
+
import { TableBorderPreset } from './table.js';
|
|
4
5
|
|
|
5
6
|
export interface InsertTablePayload {
|
|
6
7
|
rows: number;
|
|
@@ -105,6 +106,9 @@ export interface OasisCommandPayloads {
|
|
|
105
106
|
tableCellShading: string | null;
|
|
106
107
|
tableCellBorders: undefined;
|
|
107
108
|
tableCellNoBorders: undefined;
|
|
109
|
+
tableApplyBorderPreset: TableBorderPreset;
|
|
110
|
+
toggleTableDrawBorders: undefined;
|
|
111
|
+
toggleTableGridlines: undefined;
|
|
108
112
|
tableWidth100: undefined;
|
|
109
113
|
tableAlignLeft: undefined;
|
|
110
114
|
tableAlignCenter: undefined;
|
|
@@ -1,5 +1,12 @@
|
|
|
1
1
|
import { EditorBorderStyle, EditorState, EditorTableCellStyle } from '../../model.js';
|
|
2
2
|
|
|
3
|
+
export type TableBorderPreset = "bottom" | "top" | "left" | "right" | "none" | "all" | "outside" | "inside" | "insideHorizontal" | "insideVertical" | "diagonalDown" | "diagonalUp";
|
|
4
|
+
/** Word's default border: black, solid, one half point. */
|
|
5
|
+
export declare const DEFAULT_TABLE_BORDER: EditorBorderStyle;
|
|
3
6
|
export declare function setTableCellStyleValue<K extends keyof EditorTableCellStyle>(state: EditorState, key: K, value: EditorTableCellStyle[K] | null): EditorState;
|
|
4
7
|
export declare function setTableCellWidth(state: EditorState, width: number | string | null): EditorState;
|
|
5
8
|
export declare function setTableCellBorders(state: EditorState, border: EditorBorderStyle | null): EditorState;
|
|
9
|
+
/** Apply a ribbon Borders preset to the selected cells. The cell-style command
|
|
10
|
+
* already resolves rectangular table selections (including merged cells) and
|
|
11
|
+
* keeps property revisions intact. */
|
|
12
|
+
export declare function applyTableBorderPreset(state: EditorState, preset: TableBorderPreset, border?: EditorBorderStyle): EditorState;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/** True when Word small-caps formatting must uppercase and reduce this glyph. */
|
|
2
|
+
export declare function isLowercaseSmallCapsChar(char: string): boolean;
|
|
3
|
+
/** Applies the display-only casing used by w:caps and w:smallCaps. */
|
|
4
|
+
export declare function resolveRenderedTextChar(char: string, styles: {
|
|
5
|
+
allCaps?: boolean;
|
|
6
|
+
smallCaps?: boolean;
|
|
7
|
+
} | undefined): string;
|
|
@@ -11,6 +11,11 @@ export interface ResolvedTableCellFormatting {
|
|
|
11
11
|
}
|
|
12
12
|
export declare function resolveEffectiveTableStyle(table: EditorTableNode, styles?: Record<string, EditorNamedStyle>): EditorTableStyle;
|
|
13
13
|
export declare function resolveTableParagraphInheritance(tableStyle: EditorParagraphStyle | undefined, paragraphStyleId: string | undefined, styles: Record<string, EditorNamedStyle> | undefined): EditorParagraphStyle | undefined;
|
|
14
|
+
export declare function resolveNamedTableStyle(styleId: string | undefined, styles: Record<string, EditorNamedStyle> | undefined, seen?: Set<string>): {
|
|
15
|
+
tableStyle: EditorTableStyle;
|
|
16
|
+
paragraphStyle?: EditorParagraphStyle;
|
|
17
|
+
textStyle?: EditorTextStyle;
|
|
18
|
+
};
|
|
14
19
|
export declare function resolveEffectiveTableCellFormatting(options: {
|
|
15
20
|
table: EditorTableNode;
|
|
16
21
|
rowIndex: number;
|
|
@@ -24,5 +24,6 @@ export declare class PdfFontRegistry {
|
|
|
24
24
|
resolveFontFace(options: PdfFontResolveOptions): PdfRegisteredFontFace;
|
|
25
25
|
getPdfFontResources(): OasisPdfFontResource[];
|
|
26
26
|
loadBundledUnicodeFaces(options?: PdfBundledFontLoadOptions): Promise<void>;
|
|
27
|
+
loadRemoteWebFontFaces(options?: PdfBundledFontLoadOptions): Promise<void>;
|
|
27
28
|
private registerOfficeCompatibleFaces;
|
|
28
29
|
}
|
|
@@ -13,6 +13,8 @@ export declare const ROBOTO_FONT_FILES: FontFaceFiles;
|
|
|
13
13
|
export declare const OFFICE_COMPAT_FONT_FAMILIES: OfficeFontFamilyDef[];
|
|
14
14
|
export declare function normalizeFamily(fontFamily: string | null | undefined): string;
|
|
15
15
|
export declare function resolveMetricCompatibleFamily(fontFamily: string | null | undefined): string;
|
|
16
|
+
/** True when a family already has an embedded browser/layout face. */
|
|
17
|
+
export declare function isBundledMetricFontFamily(fontFamily: string | null | undefined): boolean;
|
|
16
18
|
/** Maps a bold/italic combination to the corresponding {@link FontFaceFiles} key. */
|
|
17
19
|
export declare function faceStyleKey(bold: boolean, italic: boolean): keyof FontFaceFiles;
|
|
18
20
|
/**
|
|
@@ -494,8 +494,10 @@ export declare const en: {
|
|
|
494
494
|
"status.error": string;
|
|
495
495
|
"import.overlay.title": string;
|
|
496
496
|
"import.phase.reading-file": string;
|
|
497
|
-
"import.phase.opening
|
|
498
|
-
"import.phase.parsing
|
|
497
|
+
"import.phase.opening": string;
|
|
498
|
+
"import.phase.parsing": string;
|
|
499
|
+
"import.phase.finishing": string;
|
|
500
|
+
"import.phase.preparing-fonts": string;
|
|
499
501
|
"import.phase.applying-editor-state": string;
|
|
500
502
|
"import.phase.stabilizing-layout": string;
|
|
501
503
|
"import.phase.done": string;
|
|
@@ -494,8 +494,10 @@ export declare const ptBR: {
|
|
|
494
494
|
"status.error": string;
|
|
495
495
|
"import.overlay.title": string;
|
|
496
496
|
"import.phase.reading-file": string;
|
|
497
|
-
"import.phase.opening
|
|
498
|
-
"import.phase.parsing
|
|
497
|
+
"import.phase.opening": string;
|
|
498
|
+
"import.phase.parsing": string;
|
|
499
|
+
"import.phase.finishing": string;
|
|
500
|
+
"import.phase.preparing-fonts": string;
|
|
499
501
|
"import.phase.applying-editor-state": string;
|
|
500
502
|
"import.phase.stabilizing-layout": string;
|
|
501
503
|
"import.phase.done": string;
|