oasis-editor 0.0.108 → 0.0.110
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-DkiTrFZ6.js → OasisEditorApp-D3M38bHd.js} +35 -44
- package/dist/assets/{importDocxWorker-thqRCD9m.js → importDocxWorker-DyYGjoXG.js} +1 -1
- package/dist/core/color.d.ts +15 -0
- package/dist/core/units.d.ts +15 -0
- package/dist/export/docx/text/constants.d.ts +1 -3
- package/dist/export/pdf/units.d.ts +2 -1
- package/dist/i18n/locales/en.d.ts +10 -0
- package/dist/i18n/locales/pt-BR.d.ts +10 -0
- package/dist/import/docx/runs/units.d.ts +2 -4
- package/dist/import/docx/units.d.ts +2 -2
- package/dist/{index-DzBLUs91.js → index-DezzFA4l.js} +1745 -1054
- package/dist/oasis-editor.css +1 -1
- package/dist/oasis-editor.js +50 -50
- package/dist/oasis-editor.umd.cjs +4 -4
- package/dist/ui/canvas/canvasInlineReaders.d.ts +23 -0
- package/dist/ui/components/Toolbar/ShapeGallery.d.ts +11 -0
- package/dist/ui/components/Toolbar/recentShapes.d.ts +8 -0
- package/dist/ui/components/Toolbar/shapeCatalog.d.ts +23 -0
- package/dist/ui/components/Toolbar/shapePreview.d.ts +16 -0
- package/dist/ui/textMeasurement/constants.d.ts +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/** Strips an optional leading `#` and surrounding whitespace. */
|
|
2
|
+
export declare function stripHashPrefix(color: string): string;
|
|
3
|
+
/**
|
|
4
|
+
* Validates a `#RRGGBB` (or `RRGGBB`) hex color and returns its uppercase
|
|
5
|
+
* 6-digit body without the leading `#`. Returns `null` when the input is not a
|
|
6
|
+
* valid 6-digit hex color.
|
|
7
|
+
*/
|
|
8
|
+
export declare function normalizeHex6(color: string | null | undefined): string | null;
|
|
9
|
+
/**
|
|
10
|
+
* Parses a `#RRGGBB` (or `RRGGBB`) hex color into 0–255 integer RGB channels.
|
|
11
|
+
* Returns `null` when the input is not a valid 6-digit hex color.
|
|
12
|
+
*/
|
|
13
|
+
export declare function parseHexColorToRgb255(color: string | null | undefined): [number, number, number] | null;
|
|
14
|
+
/** Formats 0–255 integer RGB channels as a lowercase `#rrggbb` string. */
|
|
15
|
+
export declare function rgb255ToHex(r: number, g: number, b: number): string;
|
package/dist/core/units.d.ts
CHANGED
|
@@ -16,3 +16,18 @@ export declare const EMU_PER_PT = 12700;
|
|
|
16
16
|
export declare const TWIPS_PER_INCH = 1440;
|
|
17
17
|
/** Twentieths of a point ("twips") per typographic point. */
|
|
18
18
|
export declare const TWIPS_PER_POINT = 20;
|
|
19
|
+
/**
|
|
20
|
+
* OOXML thousandths-of-a-percent denominator (`100000` == 100%). Used by both
|
|
21
|
+
* the DOCX import and export paths to convert alpha/position percentages.
|
|
22
|
+
*/
|
|
23
|
+
export declare const OOXML_PERCENT_DENOMINATOR = 100000;
|
|
24
|
+
/** OOXML angle units (60000ths of a degree). */
|
|
25
|
+
export declare const OOXML_ROTATION_UNITS = 60000;
|
|
26
|
+
/**
|
|
27
|
+
* Default document font size in CSS pixels: 11pt (the Calibri default used by
|
|
28
|
+
* Word) expressed as `11 * 96 / 72 ≈ 14.6667`. Single source of truth for the
|
|
29
|
+
* value that was previously redefined across the core, layout, canvas, import,
|
|
30
|
+
* export and testing layers (audit #1). Kept as the historical rounded literal
|
|
31
|
+
* `14.6667` so layout measurements remain byte-identical.
|
|
32
|
+
*/
|
|
33
|
+
export declare const DEFAULT_FONT_SIZE_PX = 14.6667;
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
export { EMU_PER_PX, EMU_PER_PT } from '../../../core/units.js';
|
|
1
|
+
export { EMU_PER_PX, EMU_PER_PT, OOXML_PERCENT_DENOMINATOR, OOXML_ROTATION_UNITS, } from '../../../core/units.js';
|
|
2
2
|
export declare const DOCX_HIGHLIGHT_COLORS: Record<string, [number, number, number]>;
|
|
3
3
|
export declare const DOCX_HIGHLIGHT_HEX_ALIASES: Record<string, string>;
|
|
4
|
-
export declare const OOXML_PERCENT_DENOMINATOR = 100000;
|
|
5
|
-
export declare const OOXML_ROTATION_UNITS = 60000;
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { EditorTextStyle } from '../../core/model.js';
|
|
2
|
+
import { DEFAULT_FONT_SIZE_PX } from '../../core/units.js';
|
|
2
3
|
|
|
3
4
|
/** Points per pixel (72 / 96). Named PX_TO_PT for historical call sites. */
|
|
4
5
|
export declare const PX_TO_PT: number;
|
|
5
|
-
export
|
|
6
|
+
export { DEFAULT_FONT_SIZE_PX };
|
|
6
7
|
export declare function pxToPt(value: number): number;
|
|
7
8
|
export declare function ptToPx(value: number): number;
|
|
8
9
|
export declare function textStyleToFontSizePt(style: Required<EditorTextStyle>): number;
|
|
@@ -14,6 +14,16 @@ export declare const en: {
|
|
|
14
14
|
"toolbar.shape.triangle": string;
|
|
15
15
|
"toolbar.shape.rtTriangle": string;
|
|
16
16
|
"toolbar.shape.diamond": string;
|
|
17
|
+
"toolbar.shapes.recentlyUsed": string;
|
|
18
|
+
"toolbar.shapes.lines": string;
|
|
19
|
+
"toolbar.shapes.rectangles": string;
|
|
20
|
+
"toolbar.shapes.basicShapes": string;
|
|
21
|
+
"toolbar.shapes.blockArrows": string;
|
|
22
|
+
"toolbar.shapes.equation": string;
|
|
23
|
+
"toolbar.shapes.flowchart": string;
|
|
24
|
+
"toolbar.shapes.starsAndBanners": string;
|
|
25
|
+
"toolbar.shapes.callouts": string;
|
|
26
|
+
"locale.id": string;
|
|
17
27
|
"toolbar.table": string;
|
|
18
28
|
"toolbar.pageNumber": string;
|
|
19
29
|
"toolbar.totalPages": string;
|
|
@@ -14,6 +14,16 @@ export declare const ptBR: {
|
|
|
14
14
|
"toolbar.shape.triangle": string;
|
|
15
15
|
"toolbar.shape.rtTriangle": string;
|
|
16
16
|
"toolbar.shape.diamond": string;
|
|
17
|
+
"toolbar.shapes.recentlyUsed": string;
|
|
18
|
+
"toolbar.shapes.lines": string;
|
|
19
|
+
"toolbar.shapes.rectangles": string;
|
|
20
|
+
"toolbar.shapes.basicShapes": string;
|
|
21
|
+
"toolbar.shapes.blockArrows": string;
|
|
22
|
+
"toolbar.shapes.equation": string;
|
|
23
|
+
"toolbar.shapes.flowchart": string;
|
|
24
|
+
"toolbar.shapes.starsAndBanners": string;
|
|
25
|
+
"toolbar.shapes.callouts": string;
|
|
26
|
+
"locale.id": string;
|
|
17
27
|
"toolbar.table": string;
|
|
18
28
|
"toolbar.pageNumber": string;
|
|
19
29
|
"toolbar.totalPages": string;
|
|
@@ -1,8 +1,6 @@
|
|
|
1
|
-
import { EMU_PER_PX, EMU_PER_PT, PX_PER_INCH, PX_PER_POINT } from '../../../core/units.js';
|
|
1
|
+
import { EMU_PER_PX, EMU_PER_PT, PX_PER_INCH, PX_PER_POINT, OOXML_PERCENT_DENOMINATOR, OOXML_ROTATION_UNITS } from '../../../core/units.js';
|
|
2
2
|
|
|
3
|
-
export { EMU_PER_PX, EMU_PER_PT, PX_PER_INCH, PX_PER_POINT };
|
|
4
|
-
export declare const OOXML_PERCENT_DENOMINATOR = 100000;
|
|
5
|
-
export declare const OOXML_ROTATION_UNITS = 60000;
|
|
3
|
+
export { EMU_PER_PX, EMU_PER_PT, PX_PER_INCH, PX_PER_POINT, OOXML_PERCENT_DENOMINATOR, OOXML_ROTATION_UNITS, };
|
|
6
4
|
export declare const VML_FRACTION_DENOMINATOR = 65536;
|
|
7
5
|
export declare function emuToPx(value: string | null | undefined): number | undefined;
|
|
8
6
|
export declare function parseOptionalInt(value: string | null | undefined): number | undefined;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { TWIPS_PER_INCH, PX_PER_INCH } from '../../core/units.js';
|
|
1
|
+
import { TWIPS_PER_INCH, PX_PER_INCH, EMU_PER_PT, OOXML_PERCENT_DENOMINATOR, OOXML_ROTATION_UNITS } from '../../core/units.js';
|
|
2
2
|
|
|
3
|
-
export { TWIPS_PER_INCH, PX_PER_INCH };
|
|
3
|
+
export { TWIPS_PER_INCH, PX_PER_INCH, EMU_PER_PT, OOXML_PERCENT_DENOMINATOR, OOXML_ROTATION_UNITS, };
|
|
4
4
|
export declare const PAGE_BREAK_MARKER = "\f";
|
|
5
5
|
export declare const DOCX_IMPLICIT_SINGLE_LINE_HEIGHT = 1.1;
|
|
6
6
|
export declare function twipsToPx(value: string | null | undefined, fallback: number): number;
|