oasis-editor 0.0.149 → 0.0.150
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-CmqlSXEk.js → OasisEditorApp-CZNfjaj2.js} +360 -35
- package/dist/app/controllers/EditorCommandsController.d.ts +4 -0
- package/dist/app/controllers/createCropSession.d.ts +1 -0
- package/dist/app/controllers/useEditorImageOperations.d.ts +3 -0
- package/dist/assets/{importDocxWorker-CpQR2fwx.js → importDocxWorker-Ddoy1WwF.js} +1 -1
- package/dist/core/commands/builtinCommands.d.ts +1 -1
- package/dist/core/commands/image.d.ts +16 -1
- package/dist/core/commands/publicCommandTypes.d.ts +4 -0
- package/dist/core/model/index.d.ts +1 -1
- package/dist/core/model/types/primitives.d.ts +16 -0
- package/dist/export/docx/docxTypes.d.ts +3 -1
- package/dist/export/pdf/OasisPdfWriter.d.ts +2 -1
- package/dist/export/pdf/writer/PdfContentStream.d.ts +3 -1
- package/dist/i18n/locales/en.d.ts +8 -0
- package/dist/i18n/locales/pt-BR.d.ts +8 -0
- package/dist/{index-B7V7kbjr.js → index-DgN6KXYw.js} +547 -227
- package/dist/index.d.ts +1 -1
- package/dist/oasis-editor.css +1 -1
- package/dist/oasis-editor.js +1 -1
- package/dist/oasis-editor.umd.cjs +4 -4
- package/dist/plugins/internal/essentialsCapabilities.d.ts +10 -0
- package/dist/ui/OasisEditorEditorProps.d.ts +3 -0
- package/dist/ui/app/buildEditorViewProps.d.ts +1 -0
- package/dist/ui/app/createAppCommandsController.d.ts +8 -0
- package/dist/ui/app/createEditorCommandRuntime.d.ts +4 -0
- package/dist/ui/app/createEditorInteractionRuntime.d.ts +3 -0
- package/dist/ui/cropGeometry.d.ts +4 -3
- package/dist/ui/overlays/ImageCropPreviewOverlay.d.ts +16 -0
- package/package.json +1 -1
|
@@ -1,2 +1,2 @@
|
|
|
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"];
|
|
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", "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", "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,4 +1,4 @@
|
|
|
1
|
-
import { EditorPosition, EditorState, EditorImageRunData, EditorImageBorder, EditorImageCrop, EditorLineDash } from '../model.js';
|
|
1
|
+
import { EditorPosition, EditorState, EditorImageRunData, EditorImageBorder, EditorImageCrop, EditorImageCropShape, EditorLineDash } from '../model.js';
|
|
2
2
|
import { SelectedObjectRun } from './selectedObjectRun.js';
|
|
3
3
|
import { WrapPreset } from './floatingLayout.js';
|
|
4
4
|
|
|
@@ -42,6 +42,21 @@ export type ImageCropAspectMode = number | "reset";
|
|
|
42
42
|
export declare function computeImageAspectCrop(image: EditorImageRunData, mode: ImageCropAspectMode): ImageCropUpdate;
|
|
43
43
|
/** Applies an aspect-ratio crop preset to the selected image. */
|
|
44
44
|
export declare function applySelectedImageCropAspect(state: EditorState, mode: ImageCropAspectMode): EditorState;
|
|
45
|
+
/** Returns the selected picture's clipping geometry, or `null`. */
|
|
46
|
+
export declare function getSelectedImageCropShape(state: EditorState): EditorImageCropShape | null;
|
|
47
|
+
/** Applies/removes a DrawingML preset geometry used as a picture mask. */
|
|
48
|
+
export declare function setSelectedImageCropShape(state: EditorState, preset: string | null): EditorState;
|
|
49
|
+
/**
|
|
50
|
+
* Computes a centred source crop that covers the existing display frame. The
|
|
51
|
+
* frame dimensions are unchanged, matching Word's Fill command.
|
|
52
|
+
*/
|
|
53
|
+
export declare function computeImageFillCrop(image: EditorImageRunData): EditorImageCrop;
|
|
54
|
+
/** Applies Word's Fill behaviour while keeping the picture frame stable. */
|
|
55
|
+
export declare function applySelectedImageCropFill(state: EditorState): EditorState;
|
|
56
|
+
/** Shows the complete source image inside the frame (Word's Adjust command). */
|
|
57
|
+
export declare function applySelectedImageCropFit(state: EditorState): EditorState;
|
|
58
|
+
/** Removes crop, fit/fill state and picture mask, restoring a plain picture. */
|
|
59
|
+
export declare function resetSelectedImageCrop(state: EditorState): EditorState;
|
|
45
60
|
/** Outline of the selected image (`pic:spPr/a:ln`), or `null`. */
|
|
46
61
|
export declare function getSelectedImageBorder(state: EditorState): EditorImageBorder | null;
|
|
47
62
|
/**
|
|
@@ -93,6 +93,10 @@ export interface OasisCommandPayloads {
|
|
|
93
93
|
imageHeightCm: number | string | null;
|
|
94
94
|
imageCrop: undefined;
|
|
95
95
|
imageCropAspect: string;
|
|
96
|
+
imageCropShape: string;
|
|
97
|
+
imageCropFill: undefined;
|
|
98
|
+
imageCropFit: undefined;
|
|
99
|
+
imageCropReset: undefined;
|
|
96
100
|
outdent: undefined;
|
|
97
101
|
indent: undefined;
|
|
98
102
|
togglePageBreakBefore: undefined;
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
* statements that pointed there continue to work via the barrel
|
|
7
7
|
* re-export in `src/core/model.ts`.
|
|
8
8
|
*/
|
|
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';
|
|
9
|
+
export type { EditorUnderlineStyle, EditorLigatures, EditorNumberSpacing, EditorNumberForm, EditorTextLanguage, EditorBorderStyle, EditorEmphasisMark, EditorTabStop, EditorParagraphListStyle, EditorImageCrop, EditorImageCropShape, EditorImageCropFit, 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
12
|
export type { EditorMathNode, EditorMathText, EditorMathFraction, EditorMathRadical, EditorMathScript, EditorMathDelimiter, EditorMathAccent, EditorMathNary, EditorMathLimit, EditorMathMatrix, EditorMathBox, EditorMathGroup, EditorMathRaw, EditorMathStyle, EditorMathExpression, } from './types/math.js';
|
|
@@ -109,6 +109,17 @@ export interface EditorImageCrop {
|
|
|
109
109
|
right?: number;
|
|
110
110
|
bottom?: number;
|
|
111
111
|
}
|
|
112
|
+
/**
|
|
113
|
+
* DrawingML preset geometry used to clip a picture. `rawXml` keeps imported
|
|
114
|
+
* geometries that the renderer does not understand lossless on export.
|
|
115
|
+
*/
|
|
116
|
+
export interface EditorImageCropShape {
|
|
117
|
+
preset: string;
|
|
118
|
+
adjustments?: Record<string, number>;
|
|
119
|
+
rawXml?: string;
|
|
120
|
+
}
|
|
121
|
+
/** How the source image is fitted into the displayed crop frame. */
|
|
122
|
+
export type EditorImageCropFit = "fill" | "fit";
|
|
112
123
|
export type EditorImageFillMode = "stretch" | "tile";
|
|
113
124
|
/**
|
|
114
125
|
* Preset dash patterns for an outline, mapped from DrawingML `a:prstDash/@val`.
|
|
@@ -159,9 +170,14 @@ export interface EditorImageRunData {
|
|
|
159
170
|
src: string;
|
|
160
171
|
width: number;
|
|
161
172
|
height: number;
|
|
173
|
+
/** Intrinsic source dimensions, when available. */
|
|
174
|
+
intrinsicWidth?: number;
|
|
175
|
+
intrinsicHeight?: number;
|
|
162
176
|
alt?: string;
|
|
163
177
|
linkedSrc?: string;
|
|
164
178
|
crop?: EditorImageCrop;
|
|
179
|
+
cropFit?: EditorImageCropFit;
|
|
180
|
+
cropShape?: EditorImageCropShape;
|
|
165
181
|
fillMode?: EditorImageFillMode;
|
|
166
182
|
border?: EditorImageBorder;
|
|
167
183
|
rotation?: number;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { EditorBlockNode, EditorImageBorder, EditorImageCrop, EditorImageFillMode, EditorImageFloatingLayout, EditorParagraphListStyle, EditorWrapPolygonPoint } from '../../core/model.js';
|
|
1
|
+
import { EditorBlockNode, EditorImageBorder, EditorImageCrop, EditorImageCropShape, EditorImageCropFit, EditorImageFillMode, EditorImageFloatingLayout, EditorParagraphListStyle, EditorWrapPolygonPoint } from '../../core/model.js';
|
|
2
2
|
import { EditorListOoxmlNumberingMetadata } from '../../ooxml/word/numberingMetadata.js';
|
|
3
3
|
import { BookmarkEventsByParagraph } from './bookmarksXml.js';
|
|
4
4
|
import { CommentEventsByParagraph } from './commentsXml.js';
|
|
@@ -37,6 +37,8 @@ export interface DocContext {
|
|
|
37
37
|
cy: number;
|
|
38
38
|
alt?: string;
|
|
39
39
|
crop?: EditorImageCrop;
|
|
40
|
+
cropShape?: EditorImageCropShape;
|
|
41
|
+
cropFit?: EditorImageCropFit;
|
|
40
42
|
fillMode?: EditorImageFillMode;
|
|
41
43
|
border?: EditorImageBorder;
|
|
42
44
|
rotation?: number;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { OasisPdfAxialGradient, OasisPdfLinkAnnotation, OasisPdfNamedDestination, OasisPdfOutlineItem, OasisPdfDocumentInfo, OasisPdfFontResource, OasisPdfImageOptions, OasisPdfImageResource, OasisPdfLineOptions, OasisPdfPageSize, OasisPdfPathOptions, OasisPdfRectOptions, OasisPdfTextOptions } from './writer/pdfTypes.js';
|
|
1
|
+
import { OasisPdfAxialGradient, OasisPdfLinkAnnotation, OasisPdfNamedDestination, OasisPdfOutlineItem, OasisPdfDocumentInfo, OasisPdfFontResource, OasisPdfImageOptions, OasisPdfImageResource, OasisPdfLineOptions, OasisPdfPageSize, OasisPdfPathOptions, OasisPdfPathSegment, OasisPdfRectOptions, OasisPdfTextOptions } from './writer/pdfTypes.js';
|
|
2
2
|
|
|
3
3
|
export type { OasisPdfPageSize, OasisPdfPage, OasisPdfRectOptions, OasisPdfLineOptions, OasisPdfPathSegment, OasisPdfPathOptions, OasisPdfTextOptions, OasisPdfImageResource, OasisPdfImageOptions, OasisPdfFontResource, OasisPdfBase14FontResource, OasisPdfUnicodeFontResource, OasisPdfLinkAnnotation, OasisPdfAnnotation, OasisPdfNamedDestination, OasisPdfOutlineItem, OasisPdfDocumentInfo, } from './writer/pdfTypes.js';
|
|
4
4
|
export declare class OasisPdfWriter {
|
|
@@ -21,6 +21,7 @@ export declare class OasisPdfWriter {
|
|
|
21
21
|
restoreGraphicsState(pageIndex: number): void;
|
|
22
22
|
rotateAbout(pageIndex: number, centerX: number, centerY: number, degrees: number): void;
|
|
23
23
|
clipRect(pageIndex: number, x: number, y: number, width: number, height: number): void;
|
|
24
|
+
clipPath(pageIndex: number, segments: OasisPdfPathSegment[]): void;
|
|
24
25
|
drawText(pageIndex: number, options: OasisPdfTextOptions): void;
|
|
25
26
|
/**
|
|
26
27
|
* Registers an axial (linear) gradient on a page for use as a glyph fill, and
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { OasisPdfAxialGradient, OasisPdfImageOptions, OasisPdfLineOptions, OasisPdfPage, OasisPdfPathOptions, OasisPdfRectOptions, OasisPdfTextOptions } from './pdfTypes.js';
|
|
1
|
+
import { OasisPdfAxialGradient, OasisPdfImageOptions, OasisPdfLineOptions, OasisPdfPage, OasisPdfPathOptions, OasisPdfPathSegment, OasisPdfRectOptions, OasisPdfTextOptions } from './pdfTypes.js';
|
|
2
2
|
import { PdfFontTable } from './PdfFontTable.js';
|
|
3
3
|
import { PdfImageTable } from './PdfImageTable.js';
|
|
4
4
|
import { PdfShadingTable } from './PdfShadingTable.js';
|
|
@@ -22,6 +22,8 @@ export declare class PdfContentStream {
|
|
|
22
22
|
restoreGraphicsState(): void;
|
|
23
23
|
rotateAbout(centerX: number, centerY: number, degrees: number): void;
|
|
24
24
|
clipRect(x: number, y: number, width: number, height: number): void;
|
|
25
|
+
/** Intersects the current clip with an arbitrary top-left-origin path. */
|
|
26
|
+
clipPath(segments: OasisPdfPathSegment[]): void;
|
|
25
27
|
drawText(options: OasisPdfTextOptions): void;
|
|
26
28
|
private textSetupCommands;
|
|
27
29
|
private emitTextBlock;
|
|
@@ -408,6 +408,7 @@ export declare const en: {
|
|
|
408
408
|
"ribbon.group.paragraph": string;
|
|
409
409
|
"ribbon.group.styles": string;
|
|
410
410
|
"ribbon.group.illustrations": string;
|
|
411
|
+
"ribbon.group.symbols": string;
|
|
411
412
|
"ribbon.group.tables": string;
|
|
412
413
|
"ribbon.group.links": string;
|
|
413
414
|
"ribbon.group.footnotes": string;
|
|
@@ -426,10 +427,17 @@ export declare const en: {
|
|
|
426
427
|
"ribbon.group.size": string;
|
|
427
428
|
"ribbon.group.imageStyles": string;
|
|
428
429
|
"image.crop": string;
|
|
430
|
+
"image.cropToShape": string;
|
|
431
|
+
"image.cropAspectRatio": string;
|
|
432
|
+
"image.cropFill": string;
|
|
433
|
+
"image.cropFit": string;
|
|
429
434
|
"image.height": string;
|
|
430
435
|
"image.width": string;
|
|
431
436
|
"image.cropReset": string;
|
|
432
437
|
"image.cropRatio.square": string;
|
|
438
|
+
"image.cropRatio.squareGroup": string;
|
|
439
|
+
"image.cropRatio.portrait": string;
|
|
440
|
+
"image.cropRatio.landscape": string;
|
|
433
441
|
"image.cropRatio.16x9": string;
|
|
434
442
|
"image.cropRatio.4x3": string;
|
|
435
443
|
"image.cropRatio.3x2": string;
|
|
@@ -408,6 +408,7 @@ export declare const ptBR: {
|
|
|
408
408
|
"ribbon.group.paragraph": string;
|
|
409
409
|
"ribbon.group.styles": string;
|
|
410
410
|
"ribbon.group.illustrations": string;
|
|
411
|
+
"ribbon.group.symbols": string;
|
|
411
412
|
"ribbon.group.tables": string;
|
|
412
413
|
"ribbon.group.links": string;
|
|
413
414
|
"ribbon.group.footnotes": string;
|
|
@@ -426,10 +427,17 @@ export declare const ptBR: {
|
|
|
426
427
|
"ribbon.group.size": string;
|
|
427
428
|
"ribbon.group.imageStyles": string;
|
|
428
429
|
"image.crop": string;
|
|
430
|
+
"image.cropToShape": string;
|
|
431
|
+
"image.cropAspectRatio": string;
|
|
432
|
+
"image.cropFill": string;
|
|
433
|
+
"image.cropFit": string;
|
|
429
434
|
"image.height": string;
|
|
430
435
|
"image.width": string;
|
|
431
436
|
"image.cropReset": string;
|
|
432
437
|
"image.cropRatio.square": string;
|
|
438
|
+
"image.cropRatio.squareGroup": string;
|
|
439
|
+
"image.cropRatio.portrait": string;
|
|
440
|
+
"image.cropRatio.landscape": string;
|
|
433
441
|
"image.cropRatio.16x9": string;
|
|
434
442
|
"image.cropRatio.4x3": string;
|
|
435
443
|
"image.cropRatio.3x2": string;
|