doc-schema.js 2.3.5 → 2.4.0
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/content.d.cts +1 -1
- package/dist/content.d.ts +1 -1
- package/dist/font-port.cjs +0 -0
- package/dist/font-port.d.cts +22 -0
- package/dist/font-port.d.ts +22 -0
- package/dist/font-port.js +0 -0
- package/dist/{geometry-CokwQGtJ.d.cts → geometry-rj_ACBLD.d.cts} +5 -1
- package/dist/{geometry-CokwQGtJ.d.ts → geometry-rj_ACBLD.d.ts} +5 -1
- package/dist/geometry.d.cts +2 -2
- package/dist/geometry.d.ts +2 -2
- package/dist/index.cjs +3 -0
- package/dist/index.d.cts +5 -2
- package/dist/index.d.ts +5 -2
- package/dist/index.js +3 -0
- package/dist/layout.d.cts +8 -8
- package/dist/layout.d.ts +8 -8
- package/dist/math-layout.cjs +0 -0
- package/dist/math-layout.d.cts +113 -0
- package/dist/math-layout.d.ts +113 -0
- package/dist/math-layout.js +0 -0
- package/dist/package.d.cts +2 -2
- package/dist/package.d.ts +2 -2
- package/dist/schema-io.cjs +1 -1
- package/dist/schema-io.js +1 -1
- package/dist/style.d.cts +2 -2
- package/dist/style.d.ts +2 -2
- package/dist/text-layout.cjs +0 -0
- package/dist/text-layout.d.cts +47 -0
- package/dist/text-layout.d.ts +47 -0
- package/dist/text-layout.js +0 -0
- package/package.json +1 -1
- package/schemas/content-document.schema.json +3 -3
- package/schemas/document-package.schema.json +3 -3
- package/schemas/layout-document.schema.json +1 -1
package/dist/content.d.cts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { d as MathMlNode } from "./mathml-B1oTCtzc.cjs";
|
|
2
2
|
import { n as Color } from "./color-AELCDH_b.cjs";
|
|
3
|
-
import { t as Box } from "./geometry-
|
|
3
|
+
import { t as Box } from "./geometry-rj_ACBLD.cjs";
|
|
4
4
|
import { z } from "zod";
|
|
5
5
|
//#region src/content.d.ts
|
|
6
6
|
declare const ContentRunSchema: z.ZodObject<{
|
package/dist/content.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { d as MathMlNode } from "./mathml-B1oTCtzc.js";
|
|
2
2
|
import { n as Color } from "./color-AELCDH_b.js";
|
|
3
|
-
import { t as Box } from "./geometry-
|
|
3
|
+
import { t as Box } from "./geometry-rj_ACBLD.js";
|
|
4
4
|
import { z } from "zod";
|
|
5
5
|
//#region src/content.d.ts
|
|
6
6
|
declare const ContentRunSchema: z.ZodObject<{
|
|
File without changes
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
//#region src/font-port.d.ts
|
|
2
|
+
interface ProvidedFont {
|
|
3
|
+
readonly family: string;
|
|
4
|
+
readonly bold: boolean;
|
|
5
|
+
readonly italic: boolean;
|
|
6
|
+
readonly bytes: Uint8Array<ArrayBuffer>;
|
|
7
|
+
}
|
|
8
|
+
interface FontSubstitution {
|
|
9
|
+
readonly requestedFamily: string;
|
|
10
|
+
readonly requestedBold: boolean;
|
|
11
|
+
readonly requestedItalic: boolean;
|
|
12
|
+
readonly reason: 'missing-face' | 'vendored-substitute';
|
|
13
|
+
readonly resolvedFamily: string;
|
|
14
|
+
}
|
|
15
|
+
interface FontRegistryOptions {
|
|
16
|
+
readonly sourceFonts?: readonly ProvidedFont[];
|
|
17
|
+
readonly fonts?: readonly ProvidedFont[];
|
|
18
|
+
readonly substitutes?: 'vendored' | 'none';
|
|
19
|
+
readonly onSubstitution?: (substitution: FontSubstitution) => void;
|
|
20
|
+
}
|
|
21
|
+
//#endregion
|
|
22
|
+
export { FontRegistryOptions, FontSubstitution, ProvidedFont };
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
//#region src/font-port.d.ts
|
|
2
|
+
interface ProvidedFont {
|
|
3
|
+
readonly family: string;
|
|
4
|
+
readonly bold: boolean;
|
|
5
|
+
readonly italic: boolean;
|
|
6
|
+
readonly bytes: Uint8Array<ArrayBuffer>;
|
|
7
|
+
}
|
|
8
|
+
interface FontSubstitution {
|
|
9
|
+
readonly requestedFamily: string;
|
|
10
|
+
readonly requestedBold: boolean;
|
|
11
|
+
readonly requestedItalic: boolean;
|
|
12
|
+
readonly reason: 'missing-face' | 'vendored-substitute';
|
|
13
|
+
readonly resolvedFamily: string;
|
|
14
|
+
}
|
|
15
|
+
interface FontRegistryOptions {
|
|
16
|
+
readonly sourceFonts?: readonly ProvidedFont[];
|
|
17
|
+
readonly fonts?: readonly ProvidedFont[];
|
|
18
|
+
readonly substitutes?: 'vendored' | 'none';
|
|
19
|
+
readonly onSubstitution?: (substitution: FontSubstitution) => void;
|
|
20
|
+
}
|
|
21
|
+
//#endregion
|
|
22
|
+
export { FontRegistryOptions, FontSubstitution, ProvidedFont };
|
|
File without changes
|
|
@@ -7,6 +7,10 @@ declare const BoxSchema: z.ZodObject<{
|
|
|
7
7
|
heightPt: z.ZodNumber;
|
|
8
8
|
}, z.core.$strip>;
|
|
9
9
|
type Box = z.infer<typeof BoxSchema>;
|
|
10
|
+
interface Point {
|
|
11
|
+
readonly x: number;
|
|
12
|
+
readonly y: number;
|
|
13
|
+
}
|
|
10
14
|
declare const PageSizeSchema: z.ZodObject<{
|
|
11
15
|
widthPt: z.ZodNumber;
|
|
12
16
|
heightPt: z.ZodNumber;
|
|
@@ -24,4 +28,4 @@ declare const PAGE_SIZE_A4: PageSize;
|
|
|
24
28
|
declare const SLIDE_SIZE_WIDESCREEN: PageSize;
|
|
25
29
|
declare const SLIDE_SIZE_STANDARD: PageSize;
|
|
26
30
|
//#endregion
|
|
27
|
-
export { PAGE_SIZE_A4 as a, PageSizeSchema as c, MarginsSchema as i,
|
|
31
|
+
export { PAGE_SIZE_A4 as a, PageSizeSchema as c, SLIDE_SIZE_WIDESCREEN as d, MarginsSchema as i, Point as l, BoxSchema as n, PAGE_SIZE_LETTER as o, Margins as r, PageSize as s, Box as t, SLIDE_SIZE_STANDARD as u };
|
|
@@ -7,6 +7,10 @@ declare const BoxSchema: z.ZodObject<{
|
|
|
7
7
|
heightPt: z.ZodNumber;
|
|
8
8
|
}, z.core.$strip>;
|
|
9
9
|
type Box = z.infer<typeof BoxSchema>;
|
|
10
|
+
interface Point {
|
|
11
|
+
readonly x: number;
|
|
12
|
+
readonly y: number;
|
|
13
|
+
}
|
|
10
14
|
declare const PageSizeSchema: z.ZodObject<{
|
|
11
15
|
widthPt: z.ZodNumber;
|
|
12
16
|
heightPt: z.ZodNumber;
|
|
@@ -24,4 +28,4 @@ declare const PAGE_SIZE_A4: PageSize;
|
|
|
24
28
|
declare const SLIDE_SIZE_WIDESCREEN: PageSize;
|
|
25
29
|
declare const SLIDE_SIZE_STANDARD: PageSize;
|
|
26
30
|
//#endregion
|
|
27
|
-
export { PAGE_SIZE_A4 as a, PageSizeSchema as c, MarginsSchema as i,
|
|
31
|
+
export { PAGE_SIZE_A4 as a, PageSizeSchema as c, SLIDE_SIZE_WIDESCREEN as d, MarginsSchema as i, Point as l, BoxSchema as n, PAGE_SIZE_LETTER as o, Margins as r, PageSize as s, Box as t, SLIDE_SIZE_STANDARD as u };
|
package/dist/geometry.d.cts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as PAGE_SIZE_A4, c as PageSizeSchema, i as MarginsSchema, l as
|
|
2
|
-
export { Box, BoxSchema, Margins, MarginsSchema, PAGE_SIZE_A4, PAGE_SIZE_LETTER, PageSize, PageSizeSchema, SLIDE_SIZE_STANDARD, SLIDE_SIZE_WIDESCREEN };
|
|
1
|
+
import { a as PAGE_SIZE_A4, c as PageSizeSchema, d as SLIDE_SIZE_WIDESCREEN, i as MarginsSchema, l as Point, n as BoxSchema, o as PAGE_SIZE_LETTER, r as Margins, s as PageSize, t as Box, u as SLIDE_SIZE_STANDARD } from "./geometry-rj_ACBLD.cjs";
|
|
2
|
+
export { Box, BoxSchema, Margins, MarginsSchema, PAGE_SIZE_A4, PAGE_SIZE_LETTER, PageSize, PageSizeSchema, Point, SLIDE_SIZE_STANDARD, SLIDE_SIZE_WIDESCREEN };
|
package/dist/geometry.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as PAGE_SIZE_A4, c as PageSizeSchema, i as MarginsSchema, l as
|
|
2
|
-
export { Box, BoxSchema, Margins, MarginsSchema, PAGE_SIZE_A4, PAGE_SIZE_LETTER, PageSize, PageSizeSchema, SLIDE_SIZE_STANDARD, SLIDE_SIZE_WIDESCREEN };
|
|
1
|
+
import { a as PAGE_SIZE_A4, c as PageSizeSchema, d as SLIDE_SIZE_WIDESCREEN, i as MarginsSchema, l as Point, n as BoxSchema, o as PAGE_SIZE_LETTER, r as Margins, s as PageSize, t as Box, u as SLIDE_SIZE_STANDARD } from "./geometry-rj_ACBLD.js";
|
|
2
|
+
export { Box, BoxSchema, Margins, MarginsSchema, PAGE_SIZE_A4, PAGE_SIZE_LETTER, PageSize, PageSizeSchema, Point, SLIDE_SIZE_STANDARD, SLIDE_SIZE_WIDESCREEN };
|
package/dist/index.cjs
CHANGED
|
@@ -10,6 +10,9 @@ const require_layout = require("./layout.cjs");
|
|
|
10
10
|
const require_package = require("./package.cjs");
|
|
11
11
|
const require_schema_io = require("./schema-io.cjs");
|
|
12
12
|
const require_content_json_schema_defs = require("./content-json-schema-defs.cjs");
|
|
13
|
+
require("./font-port.cjs");
|
|
14
|
+
require("./text-layout.cjs");
|
|
15
|
+
require("./math-layout.cjs");
|
|
13
16
|
exports.AlignmentSchema = require_style.AlignmentSchema;
|
|
14
17
|
exports.BoxSchema = require_geometry.BoxSchema;
|
|
15
18
|
exports.COLOR_BLACK = require_color.COLOR_BLACK;
|
package/dist/index.d.cts
CHANGED
|
@@ -1,12 +1,15 @@
|
|
|
1
1
|
import { _ as isMathMlNode, a as MathMlComment, c as MathMlDeclarationSchema, d as MathMlNode, f as MathMlNodeSchema, g as MathMlTextSchema, h as MathMlText, i as MathMlCdataSchema, l as MathMlElement, m as MathMlPiSchema, n as MathMlAttributeSchema, o as MathMlCommentSchema, p as MathMlPi, r as MathMlCdata, s as MathMlDeclaration, t as MathMlAttribute, u as MathMlElementSchema } from "./mathml-B1oTCtzc.cjs";
|
|
2
2
|
import { a as rgbHexToColor, i as colorToRgbHex, n as Color, r as ColorSchema, t as COLOR_BLACK } from "./color-AELCDH_b.cjs";
|
|
3
|
-
import { a as PAGE_SIZE_A4, c as PageSizeSchema, i as MarginsSchema, l as
|
|
3
|
+
import { a as PAGE_SIZE_A4, c as PageSizeSchema, d as SLIDE_SIZE_WIDESCREEN, i as MarginsSchema, l as Point, n as BoxSchema, o as PAGE_SIZE_LETTER, r as Margins, s as PageSize, t as Box, u as SLIDE_SIZE_STANDARD } from "./geometry-rj_ACBLD.cjs";
|
|
4
4
|
import { CONTENT_FORMAT_VERSION, ContentBlock, ContentBlockSchema, ContentBorder, ContentBorderSchema, ContentCellBorders, ContentCellBordersSchema, ContentCellValue, ContentCellValueSchema, ContentDocument, ContentDocumentSchema, ContentDrawPage, ContentDrawPageSchema, ContentEmbeddedObject, ContentEmbeddedObjectBlock, ContentEmbeddedObjectBlockSchema, ContentEmbeddedObjectKind, ContentEmbeddedObjectSchema, ContentFormula, ContentFormulaSchema, ContentImageBlock, ContentImageBlockSchema, ContentListMembership, ContentListMembershipSchema, ContentPageBreak, ContentPageBreakSchema, ContentParagraph, ContentParagraphSchema, ContentPathPoint, ContentPathPointSchema, ContentPathSegment, ContentPathSegmentSchema, ContentRun, ContentRunSchema, ContentSection, ContentSectionSchema, ContentShape, ContentShapeSchema, ContentSheet, ContentSheetCell, ContentSheetCellSchema, ContentSheetColumn, ContentSheetColumnSchema, ContentSheetImage, ContentSheetImageSchema, ContentSheetPrintRange, ContentSheetPrintRangeSchema, ContentSheetPrintSettings, ContentSheetPrintSettingsSchema, ContentSheetRepeatRange, ContentSheetRepeatRangeSchema, ContentSheetRow, ContentSheetRowSchema, ContentSheetSchema, ContentSlide, ContentSlideSchema, ContentStroke, ContentStrokeSchema, ContentStrokeStyle, ContentStrokeStyleSchema, ContentSubpath, ContentSubpathSchema, ContentTable, ContentTableCell, ContentTableCellSchema, ContentTableRow, ContentTableRowSchema, ContentTableSchema, ContentVector, ContentVectorSchema, DecimalString, DecimalStringSchema, isContentBlock } from "./content.cjs";
|
|
5
5
|
import { LAYOUT_FORMAT_VERSION, LayoutDocument, LayoutDocumentSchema, LayoutEllipse, LayoutEllipseSchema, LayoutImage, LayoutImageAsset, LayoutImageAssetSchema, LayoutImageSchema, LayoutItem, LayoutItemSchema, LayoutLine, LayoutLineSchema, LayoutLink, LayoutLinkSchema, LayoutPage, LayoutPageSchema, LayoutPath, LayoutPathSchema, LayoutPathSegment, LayoutPathSegmentSchema, LayoutRect, LayoutRectSchema, LayoutSubpath, LayoutSubpathSchema, LayoutText, LayoutTextSchema } from "./layout.cjs";
|
|
6
6
|
import { ContentCodec, LayoutCodec } from "./codec.cjs";
|
|
7
7
|
import { CONTENT_DEFS, CONTENT_DOCUMENT_URI, EMBEDDED_OBJECT_KINDS, MAX_SAFE_INTEGER } from "./content-json-schema-defs.cjs";
|
|
8
|
+
import { FontRegistryOptions, FontSubstitution, ProvidedFont } from "./font-port.cjs";
|
|
8
9
|
import { Alignment, AlignmentSchema, DEFAULT_LAYOUT_FONT, LayoutFont, LayoutFontSchema } from "./style.cjs";
|
|
9
10
|
import { LayoutMetadata, LayoutMetadataSchema } from "./metadata.cjs";
|
|
10
11
|
import { DOCUMENT_PACKAGE_FORMAT_VERSION, DocumentPackage, DocumentPackageSchema } from "./package.cjs";
|
|
11
12
|
import { ContentDocumentJson, DocumentJsonResult, DocumentPackageJson, DocumentSchemaKind, LayoutDocumentJson, SCHEMA_FILE_NAMES, UnrecognizedDocumentSchemaError, contentDocumentWithSchema, documentFromJson, documentPackageWithSchema, documentSchemaKindOf, layoutDocumentWithSchema, schemaUriFor } from "./schema-io.cjs";
|
|
12
|
-
|
|
13
|
+
import { StyledFragment, StyledRun, TextMeasurer, UnderlineMetrics, WrapOptions, WrappedLine } from "./text-layout.cjs";
|
|
14
|
+
import { MathAssembledGlyphs, MathBox, MathColor, MathFontMetrics, MathGlyphMetrics, MathGlyphPlacement, MathGlyphRun, MathLayoutItem, MathRule, MathStretchAxis, MathStretchGlyph, MathStretchResult, MathStroke, PositionedFormula } from "./math-layout.cjs";
|
|
15
|
+
export { Alignment, AlignmentSchema, Box, BoxSchema, COLOR_BLACK, CONTENT_DEFS, CONTENT_DOCUMENT_URI, CONTENT_FORMAT_VERSION, Color, ColorSchema, ContentBlock, ContentBlockSchema, ContentBorder, ContentBorderSchema, ContentCellBorders, ContentCellBordersSchema, ContentCellValue, ContentCellValueSchema, ContentCodec, ContentDocument, ContentDocumentJson, ContentDocumentSchema, ContentDrawPage, ContentDrawPageSchema, ContentEmbeddedObject, ContentEmbeddedObjectBlock, ContentEmbeddedObjectBlockSchema, ContentEmbeddedObjectKind, ContentEmbeddedObjectSchema, ContentFormula, ContentFormulaSchema, ContentImageBlock, ContentImageBlockSchema, ContentListMembership, ContentListMembershipSchema, ContentPageBreak, ContentPageBreakSchema, ContentParagraph, ContentParagraphSchema, ContentPathPoint, ContentPathPointSchema, ContentPathSegment, ContentPathSegmentSchema, ContentRun, ContentRunSchema, ContentSection, ContentSectionSchema, ContentShape, ContentShapeSchema, ContentSheet, ContentSheetCell, ContentSheetCellSchema, ContentSheetColumn, ContentSheetColumnSchema, ContentSheetImage, ContentSheetImageSchema, ContentSheetPrintRange, ContentSheetPrintRangeSchema, ContentSheetPrintSettings, ContentSheetPrintSettingsSchema, ContentSheetRepeatRange, ContentSheetRepeatRangeSchema, ContentSheetRow, ContentSheetRowSchema, ContentSheetSchema, ContentSlide, ContentSlideSchema, ContentStroke, ContentStrokeSchema, ContentStrokeStyle, ContentStrokeStyleSchema, ContentSubpath, ContentSubpathSchema, ContentTable, ContentTableCell, ContentTableCellSchema, ContentTableRow, ContentTableRowSchema, ContentTableSchema, ContentVector, ContentVectorSchema, DEFAULT_LAYOUT_FONT, DOCUMENT_PACKAGE_FORMAT_VERSION, DecimalString, DecimalStringSchema, DocumentJsonResult, DocumentPackage, DocumentPackageJson, DocumentPackageSchema, DocumentSchemaKind, EMBEDDED_OBJECT_KINDS, FontRegistryOptions, FontSubstitution, LAYOUT_FORMAT_VERSION, LayoutCodec, LayoutDocument, LayoutDocumentJson, LayoutDocumentSchema, LayoutEllipse, LayoutEllipseSchema, LayoutFont, LayoutFontSchema, LayoutImage, LayoutImageAsset, LayoutImageAssetSchema, LayoutImageSchema, LayoutItem, LayoutItemSchema, LayoutLine, LayoutLineSchema, LayoutLink, LayoutLinkSchema, LayoutMetadata, LayoutMetadataSchema, LayoutPage, LayoutPageSchema, LayoutPath, LayoutPathSchema, LayoutPathSegment, LayoutPathSegmentSchema, LayoutRect, LayoutRectSchema, LayoutSubpath, LayoutSubpathSchema, LayoutText, LayoutTextSchema, MAX_SAFE_INTEGER, Margins, MarginsSchema, MathAssembledGlyphs, MathBox, MathColor, MathFontMetrics, MathGlyphMetrics, MathGlyphPlacement, MathGlyphRun, MathLayoutItem, MathMlAttribute, MathMlAttributeSchema, MathMlCdata, MathMlCdataSchema, MathMlComment, MathMlCommentSchema, MathMlDeclaration, MathMlDeclarationSchema, MathMlElement, MathMlElementSchema, MathMlNode, MathMlNodeSchema, MathMlPi, MathMlPiSchema, MathMlText, MathMlTextSchema, MathRule, MathStretchAxis, MathStretchGlyph, MathStretchResult, MathStroke, PAGE_SIZE_A4, PAGE_SIZE_LETTER, PageSize, PageSizeSchema, Point, PositionedFormula, ProvidedFont, SCHEMA_FILE_NAMES, SLIDE_SIZE_STANDARD, SLIDE_SIZE_WIDESCREEN, StyledFragment, StyledRun, TextMeasurer, UnderlineMetrics, UnrecognizedDocumentSchemaError, WrapOptions, WrappedLine, colorToRgbHex, contentDocumentWithSchema, documentFromJson, documentPackageWithSchema, documentSchemaKindOf, isContentBlock, isMathMlNode, layoutDocumentWithSchema, rgbHexToColor, schemaUriFor };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,12 +1,15 @@
|
|
|
1
1
|
import { _ as isMathMlNode, a as MathMlComment, c as MathMlDeclarationSchema, d as MathMlNode, f as MathMlNodeSchema, g as MathMlTextSchema, h as MathMlText, i as MathMlCdataSchema, l as MathMlElement, m as MathMlPiSchema, n as MathMlAttributeSchema, o as MathMlCommentSchema, p as MathMlPi, r as MathMlCdata, s as MathMlDeclaration, t as MathMlAttribute, u as MathMlElementSchema } from "./mathml-B1oTCtzc.js";
|
|
2
2
|
import { a as rgbHexToColor, i as colorToRgbHex, n as Color, r as ColorSchema, t as COLOR_BLACK } from "./color-AELCDH_b.js";
|
|
3
|
-
import { a as PAGE_SIZE_A4, c as PageSizeSchema, i as MarginsSchema, l as
|
|
3
|
+
import { a as PAGE_SIZE_A4, c as PageSizeSchema, d as SLIDE_SIZE_WIDESCREEN, i as MarginsSchema, l as Point, n as BoxSchema, o as PAGE_SIZE_LETTER, r as Margins, s as PageSize, t as Box, u as SLIDE_SIZE_STANDARD } from "./geometry-rj_ACBLD.js";
|
|
4
4
|
import { CONTENT_FORMAT_VERSION, ContentBlock, ContentBlockSchema, ContentBorder, ContentBorderSchema, ContentCellBorders, ContentCellBordersSchema, ContentCellValue, ContentCellValueSchema, ContentDocument, ContentDocumentSchema, ContentDrawPage, ContentDrawPageSchema, ContentEmbeddedObject, ContentEmbeddedObjectBlock, ContentEmbeddedObjectBlockSchema, ContentEmbeddedObjectKind, ContentEmbeddedObjectSchema, ContentFormula, ContentFormulaSchema, ContentImageBlock, ContentImageBlockSchema, ContentListMembership, ContentListMembershipSchema, ContentPageBreak, ContentPageBreakSchema, ContentParagraph, ContentParagraphSchema, ContentPathPoint, ContentPathPointSchema, ContentPathSegment, ContentPathSegmentSchema, ContentRun, ContentRunSchema, ContentSection, ContentSectionSchema, ContentShape, ContentShapeSchema, ContentSheet, ContentSheetCell, ContentSheetCellSchema, ContentSheetColumn, ContentSheetColumnSchema, ContentSheetImage, ContentSheetImageSchema, ContentSheetPrintRange, ContentSheetPrintRangeSchema, ContentSheetPrintSettings, ContentSheetPrintSettingsSchema, ContentSheetRepeatRange, ContentSheetRepeatRangeSchema, ContentSheetRow, ContentSheetRowSchema, ContentSheetSchema, ContentSlide, ContentSlideSchema, ContentStroke, ContentStrokeSchema, ContentStrokeStyle, ContentStrokeStyleSchema, ContentSubpath, ContentSubpathSchema, ContentTable, ContentTableCell, ContentTableCellSchema, ContentTableRow, ContentTableRowSchema, ContentTableSchema, ContentVector, ContentVectorSchema, DecimalString, DecimalStringSchema, isContentBlock } from "./content.js";
|
|
5
5
|
import { LAYOUT_FORMAT_VERSION, LayoutDocument, LayoutDocumentSchema, LayoutEllipse, LayoutEllipseSchema, LayoutImage, LayoutImageAsset, LayoutImageAssetSchema, LayoutImageSchema, LayoutItem, LayoutItemSchema, LayoutLine, LayoutLineSchema, LayoutLink, LayoutLinkSchema, LayoutPage, LayoutPageSchema, LayoutPath, LayoutPathSchema, LayoutPathSegment, LayoutPathSegmentSchema, LayoutRect, LayoutRectSchema, LayoutSubpath, LayoutSubpathSchema, LayoutText, LayoutTextSchema } from "./layout.js";
|
|
6
6
|
import { ContentCodec, LayoutCodec } from "./codec.js";
|
|
7
7
|
import { CONTENT_DEFS, CONTENT_DOCUMENT_URI, EMBEDDED_OBJECT_KINDS, MAX_SAFE_INTEGER } from "./content-json-schema-defs.js";
|
|
8
|
+
import { FontRegistryOptions, FontSubstitution, ProvidedFont } from "./font-port.js";
|
|
8
9
|
import { Alignment, AlignmentSchema, DEFAULT_LAYOUT_FONT, LayoutFont, LayoutFontSchema } from "./style.js";
|
|
9
10
|
import { LayoutMetadata, LayoutMetadataSchema } from "./metadata.js";
|
|
10
11
|
import { DOCUMENT_PACKAGE_FORMAT_VERSION, DocumentPackage, DocumentPackageSchema } from "./package.js";
|
|
11
12
|
import { ContentDocumentJson, DocumentJsonResult, DocumentPackageJson, DocumentSchemaKind, LayoutDocumentJson, SCHEMA_FILE_NAMES, UnrecognizedDocumentSchemaError, contentDocumentWithSchema, documentFromJson, documentPackageWithSchema, documentSchemaKindOf, layoutDocumentWithSchema, schemaUriFor } from "./schema-io.js";
|
|
12
|
-
|
|
13
|
+
import { StyledFragment, StyledRun, TextMeasurer, UnderlineMetrics, WrapOptions, WrappedLine } from "./text-layout.js";
|
|
14
|
+
import { MathAssembledGlyphs, MathBox, MathColor, MathFontMetrics, MathGlyphMetrics, MathGlyphPlacement, MathGlyphRun, MathLayoutItem, MathRule, MathStretchAxis, MathStretchGlyph, MathStretchResult, MathStroke, PositionedFormula } from "./math-layout.js";
|
|
15
|
+
export { Alignment, AlignmentSchema, Box, BoxSchema, COLOR_BLACK, CONTENT_DEFS, CONTENT_DOCUMENT_URI, CONTENT_FORMAT_VERSION, Color, ColorSchema, ContentBlock, ContentBlockSchema, ContentBorder, ContentBorderSchema, ContentCellBorders, ContentCellBordersSchema, ContentCellValue, ContentCellValueSchema, ContentCodec, ContentDocument, ContentDocumentJson, ContentDocumentSchema, ContentDrawPage, ContentDrawPageSchema, ContentEmbeddedObject, ContentEmbeddedObjectBlock, ContentEmbeddedObjectBlockSchema, ContentEmbeddedObjectKind, ContentEmbeddedObjectSchema, ContentFormula, ContentFormulaSchema, ContentImageBlock, ContentImageBlockSchema, ContentListMembership, ContentListMembershipSchema, ContentPageBreak, ContentPageBreakSchema, ContentParagraph, ContentParagraphSchema, ContentPathPoint, ContentPathPointSchema, ContentPathSegment, ContentPathSegmentSchema, ContentRun, ContentRunSchema, ContentSection, ContentSectionSchema, ContentShape, ContentShapeSchema, ContentSheet, ContentSheetCell, ContentSheetCellSchema, ContentSheetColumn, ContentSheetColumnSchema, ContentSheetImage, ContentSheetImageSchema, ContentSheetPrintRange, ContentSheetPrintRangeSchema, ContentSheetPrintSettings, ContentSheetPrintSettingsSchema, ContentSheetRepeatRange, ContentSheetRepeatRangeSchema, ContentSheetRow, ContentSheetRowSchema, ContentSheetSchema, ContentSlide, ContentSlideSchema, ContentStroke, ContentStrokeSchema, ContentStrokeStyle, ContentStrokeStyleSchema, ContentSubpath, ContentSubpathSchema, ContentTable, ContentTableCell, ContentTableCellSchema, ContentTableRow, ContentTableRowSchema, ContentTableSchema, ContentVector, ContentVectorSchema, DEFAULT_LAYOUT_FONT, DOCUMENT_PACKAGE_FORMAT_VERSION, DecimalString, DecimalStringSchema, DocumentJsonResult, DocumentPackage, DocumentPackageJson, DocumentPackageSchema, DocumentSchemaKind, EMBEDDED_OBJECT_KINDS, FontRegistryOptions, FontSubstitution, LAYOUT_FORMAT_VERSION, LayoutCodec, LayoutDocument, LayoutDocumentJson, LayoutDocumentSchema, LayoutEllipse, LayoutEllipseSchema, LayoutFont, LayoutFontSchema, LayoutImage, LayoutImageAsset, LayoutImageAssetSchema, LayoutImageSchema, LayoutItem, LayoutItemSchema, LayoutLine, LayoutLineSchema, LayoutLink, LayoutLinkSchema, LayoutMetadata, LayoutMetadataSchema, LayoutPage, LayoutPageSchema, LayoutPath, LayoutPathSchema, LayoutPathSegment, LayoutPathSegmentSchema, LayoutRect, LayoutRectSchema, LayoutSubpath, LayoutSubpathSchema, LayoutText, LayoutTextSchema, MAX_SAFE_INTEGER, Margins, MarginsSchema, MathAssembledGlyphs, MathBox, MathColor, MathFontMetrics, MathGlyphMetrics, MathGlyphPlacement, MathGlyphRun, MathLayoutItem, MathMlAttribute, MathMlAttributeSchema, MathMlCdata, MathMlCdataSchema, MathMlComment, MathMlCommentSchema, MathMlDeclaration, MathMlDeclarationSchema, MathMlElement, MathMlElementSchema, MathMlNode, MathMlNodeSchema, MathMlPi, MathMlPiSchema, MathMlText, MathMlTextSchema, MathRule, MathStretchAxis, MathStretchGlyph, MathStretchResult, MathStroke, PAGE_SIZE_A4, PAGE_SIZE_LETTER, PageSize, PageSizeSchema, Point, PositionedFormula, ProvidedFont, SCHEMA_FILE_NAMES, SLIDE_SIZE_STANDARD, SLIDE_SIZE_WIDESCREEN, StyledFragment, StyledRun, TextMeasurer, UnderlineMetrics, UnrecognizedDocumentSchemaError, WrapOptions, WrappedLine, colorToRgbHex, contentDocumentWithSchema, documentFromJson, documentPackageWithSchema, documentSchemaKindOf, isContentBlock, isMathMlNode, layoutDocumentWithSchema, rgbHexToColor, schemaUriFor };
|
package/dist/index.js
CHANGED
|
@@ -9,4 +9,7 @@ import { LAYOUT_FORMAT_VERSION, LayoutDocumentSchema, LayoutEllipseSchema, Layou
|
|
|
9
9
|
import { DOCUMENT_PACKAGE_FORMAT_VERSION, DocumentPackageSchema } from "./package.js";
|
|
10
10
|
import { SCHEMA_FILE_NAMES, UnrecognizedDocumentSchemaError, contentDocumentWithSchema, documentFromJson, documentPackageWithSchema, documentSchemaKindOf, layoutDocumentWithSchema, schemaUriFor } from "./schema-io.js";
|
|
11
11
|
import { CONTENT_DEFS, CONTENT_DOCUMENT_URI, EMBEDDED_OBJECT_KINDS, MAX_SAFE_INTEGER } from "./content-json-schema-defs.js";
|
|
12
|
+
import "./font-port.js";
|
|
13
|
+
import "./text-layout.js";
|
|
14
|
+
import "./math-layout.js";
|
|
12
15
|
export { AlignmentSchema, BoxSchema, COLOR_BLACK, CONTENT_DEFS, CONTENT_DOCUMENT_URI, CONTENT_FORMAT_VERSION, ColorSchema, ContentBlockSchema, ContentBorderSchema, ContentCellBordersSchema, ContentCellValueSchema, ContentDocumentSchema, ContentDrawPageSchema, ContentEmbeddedObjectBlockSchema, ContentEmbeddedObjectSchema, ContentFormulaSchema, ContentImageBlockSchema, ContentListMembershipSchema, ContentPageBreakSchema, ContentParagraphSchema, ContentPathPointSchema, ContentPathSegmentSchema, ContentRunSchema, ContentSectionSchema, ContentShapeSchema, ContentSheetCellSchema, ContentSheetColumnSchema, ContentSheetImageSchema, ContentSheetPrintRangeSchema, ContentSheetPrintSettingsSchema, ContentSheetRepeatRangeSchema, ContentSheetRowSchema, ContentSheetSchema, ContentSlideSchema, ContentStrokeSchema, ContentStrokeStyleSchema, ContentSubpathSchema, ContentTableCellSchema, ContentTableRowSchema, ContentTableSchema, ContentVectorSchema, DEFAULT_LAYOUT_FONT, DOCUMENT_PACKAGE_FORMAT_VERSION, DecimalStringSchema, DocumentPackageSchema, EMBEDDED_OBJECT_KINDS, LAYOUT_FORMAT_VERSION, LayoutDocumentSchema, LayoutEllipseSchema, LayoutFontSchema, LayoutImageAssetSchema, LayoutImageSchema, LayoutItemSchema, LayoutLineSchema, LayoutLinkSchema, LayoutMetadataSchema, LayoutPageSchema, LayoutPathSchema, LayoutPathSegmentSchema, LayoutRectSchema, LayoutSubpathSchema, LayoutTextSchema, MAX_SAFE_INTEGER, MarginsSchema, MathMlAttributeSchema, MathMlCdataSchema, MathMlCommentSchema, MathMlDeclarationSchema, MathMlElementSchema, MathMlNodeSchema, MathMlPiSchema, MathMlTextSchema, PAGE_SIZE_A4, PAGE_SIZE_LETTER, PageSizeSchema, SCHEMA_FILE_NAMES, SLIDE_SIZE_STANDARD, SLIDE_SIZE_WIDESCREEN, UnrecognizedDocumentSchemaError, colorToRgbHex, contentDocumentWithSchema, documentFromJson, documentPackageWithSchema, documentSchemaKindOf, isContentBlock, isMathMlNode, layoutDocumentWithSchema, rgbHexToColor, schemaUriFor };
|
package/dist/layout.d.cts
CHANGED
|
@@ -9,12 +9,12 @@ declare const LayoutTextSchema: z.ZodObject<{
|
|
|
9
9
|
font: z.ZodObject<{
|
|
10
10
|
family: z.ZodString;
|
|
11
11
|
weight: z.ZodEnum<{
|
|
12
|
-
normal: "normal";
|
|
13
12
|
bold: "bold";
|
|
13
|
+
normal: "normal";
|
|
14
14
|
}>;
|
|
15
15
|
style: z.ZodEnum<{
|
|
16
|
-
normal: "normal";
|
|
17
16
|
italic: "italic";
|
|
17
|
+
normal: "normal";
|
|
18
18
|
}>;
|
|
19
19
|
}, z.core.$strip>;
|
|
20
20
|
sizePt: z.ZodNumber;
|
|
@@ -202,12 +202,12 @@ declare const LayoutItemSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
202
202
|
font: z.ZodObject<{
|
|
203
203
|
family: z.ZodString;
|
|
204
204
|
weight: z.ZodEnum<{
|
|
205
|
-
normal: "normal";
|
|
206
205
|
bold: "bold";
|
|
206
|
+
normal: "normal";
|
|
207
207
|
}>;
|
|
208
208
|
style: z.ZodEnum<{
|
|
209
|
-
normal: "normal";
|
|
210
209
|
italic: "italic";
|
|
210
|
+
normal: "normal";
|
|
211
211
|
}>;
|
|
212
212
|
}, z.core.$strip>;
|
|
213
213
|
sizePt: z.ZodNumber;
|
|
@@ -353,12 +353,12 @@ declare const LayoutPageSchema: z.ZodObject<{
|
|
|
353
353
|
font: z.ZodObject<{
|
|
354
354
|
family: z.ZodString;
|
|
355
355
|
weight: z.ZodEnum<{
|
|
356
|
-
normal: "normal";
|
|
357
356
|
bold: "bold";
|
|
357
|
+
normal: "normal";
|
|
358
358
|
}>;
|
|
359
359
|
style: z.ZodEnum<{
|
|
360
|
-
normal: "normal";
|
|
361
360
|
italic: "italic";
|
|
361
|
+
normal: "normal";
|
|
362
362
|
}>;
|
|
363
363
|
}, z.core.$strip>;
|
|
364
364
|
sizePt: z.ZodNumber;
|
|
@@ -528,12 +528,12 @@ declare const LayoutDocumentSchema: z.ZodObject<{
|
|
|
528
528
|
font: z.ZodObject<{
|
|
529
529
|
family: z.ZodString;
|
|
530
530
|
weight: z.ZodEnum<{
|
|
531
|
-
normal: "normal";
|
|
532
531
|
bold: "bold";
|
|
532
|
+
normal: "normal";
|
|
533
533
|
}>;
|
|
534
534
|
style: z.ZodEnum<{
|
|
535
|
-
normal: "normal";
|
|
536
535
|
italic: "italic";
|
|
536
|
+
normal: "normal";
|
|
537
537
|
}>;
|
|
538
538
|
}, z.core.$strip>;
|
|
539
539
|
sizePt: z.ZodNumber;
|
package/dist/layout.d.ts
CHANGED
|
@@ -9,12 +9,12 @@ declare const LayoutTextSchema: z.ZodObject<{
|
|
|
9
9
|
font: z.ZodObject<{
|
|
10
10
|
family: z.ZodString;
|
|
11
11
|
weight: z.ZodEnum<{
|
|
12
|
-
normal: "normal";
|
|
13
12
|
bold: "bold";
|
|
13
|
+
normal: "normal";
|
|
14
14
|
}>;
|
|
15
15
|
style: z.ZodEnum<{
|
|
16
|
-
normal: "normal";
|
|
17
16
|
italic: "italic";
|
|
17
|
+
normal: "normal";
|
|
18
18
|
}>;
|
|
19
19
|
}, z.core.$strip>;
|
|
20
20
|
sizePt: z.ZodNumber;
|
|
@@ -202,12 +202,12 @@ declare const LayoutItemSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
202
202
|
font: z.ZodObject<{
|
|
203
203
|
family: z.ZodString;
|
|
204
204
|
weight: z.ZodEnum<{
|
|
205
|
-
normal: "normal";
|
|
206
205
|
bold: "bold";
|
|
206
|
+
normal: "normal";
|
|
207
207
|
}>;
|
|
208
208
|
style: z.ZodEnum<{
|
|
209
|
-
normal: "normal";
|
|
210
209
|
italic: "italic";
|
|
210
|
+
normal: "normal";
|
|
211
211
|
}>;
|
|
212
212
|
}, z.core.$strip>;
|
|
213
213
|
sizePt: z.ZodNumber;
|
|
@@ -353,12 +353,12 @@ declare const LayoutPageSchema: z.ZodObject<{
|
|
|
353
353
|
font: z.ZodObject<{
|
|
354
354
|
family: z.ZodString;
|
|
355
355
|
weight: z.ZodEnum<{
|
|
356
|
-
normal: "normal";
|
|
357
356
|
bold: "bold";
|
|
357
|
+
normal: "normal";
|
|
358
358
|
}>;
|
|
359
359
|
style: z.ZodEnum<{
|
|
360
|
-
normal: "normal";
|
|
361
360
|
italic: "italic";
|
|
361
|
+
normal: "normal";
|
|
362
362
|
}>;
|
|
363
363
|
}, z.core.$strip>;
|
|
364
364
|
sizePt: z.ZodNumber;
|
|
@@ -528,12 +528,12 @@ declare const LayoutDocumentSchema: z.ZodObject<{
|
|
|
528
528
|
font: z.ZodObject<{
|
|
529
529
|
family: z.ZodString;
|
|
530
530
|
weight: z.ZodEnum<{
|
|
531
|
-
normal: "normal";
|
|
532
531
|
bold: "bold";
|
|
532
|
+
normal: "normal";
|
|
533
533
|
}>;
|
|
534
534
|
style: z.ZodEnum<{
|
|
535
|
-
normal: "normal";
|
|
536
535
|
italic: "italic";
|
|
536
|
+
normal: "normal";
|
|
537
537
|
}>;
|
|
538
538
|
}, z.core.$strip>;
|
|
539
539
|
sizePt: z.ZodNumber;
|
|
File without changes
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
import { n as Color } from "./color-AELCDH_b.cjs";
|
|
2
|
+
//#region src/math-layout.d.ts
|
|
3
|
+
type MathColor = Color;
|
|
4
|
+
interface MathGlyphRun {
|
|
5
|
+
readonly kind: 'glyphs';
|
|
6
|
+
readonly xPt: number;
|
|
7
|
+
readonly yPt: number;
|
|
8
|
+
readonly text: string;
|
|
9
|
+
readonly sizePt: number;
|
|
10
|
+
readonly color: MathColor;
|
|
11
|
+
}
|
|
12
|
+
interface MathRule {
|
|
13
|
+
readonly kind: 'rule';
|
|
14
|
+
readonly xPt: number;
|
|
15
|
+
readonly yPt: number;
|
|
16
|
+
readonly widthPt: number;
|
|
17
|
+
readonly heightPt: number;
|
|
18
|
+
readonly color: MathColor;
|
|
19
|
+
}
|
|
20
|
+
interface MathStroke {
|
|
21
|
+
readonly kind: 'stroke';
|
|
22
|
+
readonly points: readonly {
|
|
23
|
+
readonly xPt: number;
|
|
24
|
+
readonly yPt: number;
|
|
25
|
+
}[];
|
|
26
|
+
readonly widthPt: number;
|
|
27
|
+
readonly color: MathColor;
|
|
28
|
+
}
|
|
29
|
+
interface MathGlyphPlacement {
|
|
30
|
+
readonly glyphId: number;
|
|
31
|
+
readonly xPt: number;
|
|
32
|
+
readonly yPt: number;
|
|
33
|
+
}
|
|
34
|
+
interface MathAssembledGlyphs {
|
|
35
|
+
readonly kind: 'assembled-glyphs';
|
|
36
|
+
readonly placements: readonly MathGlyphPlacement[];
|
|
37
|
+
readonly text: string;
|
|
38
|
+
readonly sizePt: number;
|
|
39
|
+
readonly color: MathColor;
|
|
40
|
+
}
|
|
41
|
+
type MathLayoutItem = MathGlyphRun | MathRule | MathStroke | MathAssembledGlyphs;
|
|
42
|
+
interface MathBox {
|
|
43
|
+
readonly widthPt: number;
|
|
44
|
+
readonly heightPt: number;
|
|
45
|
+
readonly ascentPt: number;
|
|
46
|
+
readonly descentPt: number;
|
|
47
|
+
readonly items: readonly MathLayoutItem[];
|
|
48
|
+
}
|
|
49
|
+
interface MathGlyphMetrics {
|
|
50
|
+
readonly advanceWidthPt: number;
|
|
51
|
+
readonly italicCorrectionPt: number;
|
|
52
|
+
readonly topAccentXPt?: number;
|
|
53
|
+
readonly inkAscentPt?: number;
|
|
54
|
+
readonly inkDescentPt?: number;
|
|
55
|
+
}
|
|
56
|
+
type MathStretchAxis = 'vertical' | 'horizontal';
|
|
57
|
+
interface MathStretchGlyph {
|
|
58
|
+
readonly glyphId: number;
|
|
59
|
+
readonly offsetPt: number;
|
|
60
|
+
}
|
|
61
|
+
interface MathStretchResult {
|
|
62
|
+
readonly kind: 'base' | 'variant' | 'assembly';
|
|
63
|
+
readonly sizePt: number;
|
|
64
|
+
readonly advanceWidthPt: number;
|
|
65
|
+
readonly inkAscentPt: number;
|
|
66
|
+
readonly inkDescentPt: number;
|
|
67
|
+
readonly placements: readonly MathStretchGlyph[];
|
|
68
|
+
}
|
|
69
|
+
interface MathFontMetrics {
|
|
70
|
+
readonly ascentPerEm: number;
|
|
71
|
+
readonly descentPerEm: number;
|
|
72
|
+
readonly axisHeightPt: number;
|
|
73
|
+
readonly fractionRuleThicknessPt: number;
|
|
74
|
+
readonly fractionNumeratorShiftUpPt: number;
|
|
75
|
+
readonly fractionNumeratorDisplayShiftUpPt: number;
|
|
76
|
+
readonly fractionDenominatorShiftDownPt: number;
|
|
77
|
+
readonly fractionDenominatorDisplayShiftDownPt: number;
|
|
78
|
+
readonly fractionNumeratorGapMinPt: number;
|
|
79
|
+
readonly fractionDenominatorGapMinPt: number;
|
|
80
|
+
readonly radicalRuleThicknessPt: number;
|
|
81
|
+
readonly radicalExtraAscenderPt: number;
|
|
82
|
+
readonly radicalVerticalGapPt: number;
|
|
83
|
+
readonly radicalKernBeforeDegreePt: number;
|
|
84
|
+
readonly radicalKernAfterDegreePt: number;
|
|
85
|
+
readonly radicalDegreeBottomRaisePercent: number;
|
|
86
|
+
readonly subscriptShiftDownPt: number;
|
|
87
|
+
readonly superscriptShiftUpPt: number;
|
|
88
|
+
readonly superscriptShiftUpCrampedPt: number;
|
|
89
|
+
readonly subSuperscriptGapMinPt: number;
|
|
90
|
+
readonly superscriptBaselineDropMaxPt: number;
|
|
91
|
+
readonly subscriptBaselineDropMinPt: number;
|
|
92
|
+
readonly spaceAfterScriptPt: number;
|
|
93
|
+
readonly upperLimitGapMinPt: number;
|
|
94
|
+
readonly upperLimitBaselineRiseMinPt: number;
|
|
95
|
+
readonly lowerLimitGapMinPt: number;
|
|
96
|
+
readonly lowerLimitBaselineDropMinPt: number;
|
|
97
|
+
readonly stackTopShiftUpPt: number;
|
|
98
|
+
readonly stackBottomShiftDownPt: number;
|
|
99
|
+
readonly stackGapMinPt: number;
|
|
100
|
+
readonly scriptPercentScaleDown: number;
|
|
101
|
+
readonly scriptScriptPercentScaleDown: number;
|
|
102
|
+
readonly defaultRuleThicknessPt: number;
|
|
103
|
+
glyph(codePoint: number, sizePt: number): MathGlyphMetrics | undefined;
|
|
104
|
+
stretch(codePoint: number, axis: MathStretchAxis, targetSizePt: number, sizePt: number): MathStretchResult | undefined;
|
|
105
|
+
}
|
|
106
|
+
interface PositionedFormula {
|
|
107
|
+
readonly pageIndex: number;
|
|
108
|
+
readonly xPt: number;
|
|
109
|
+
readonly yPt: number;
|
|
110
|
+
readonly box: MathBox;
|
|
111
|
+
}
|
|
112
|
+
//#endregion
|
|
113
|
+
export { MathAssembledGlyphs, MathBox, MathColor, MathFontMetrics, MathGlyphMetrics, MathGlyphPlacement, MathGlyphRun, MathLayoutItem, MathRule, MathStretchAxis, MathStretchGlyph, MathStretchResult, MathStroke, PositionedFormula };
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
import { n as Color } from "./color-AELCDH_b.js";
|
|
2
|
+
//#region src/math-layout.d.ts
|
|
3
|
+
type MathColor = Color;
|
|
4
|
+
interface MathGlyphRun {
|
|
5
|
+
readonly kind: 'glyphs';
|
|
6
|
+
readonly xPt: number;
|
|
7
|
+
readonly yPt: number;
|
|
8
|
+
readonly text: string;
|
|
9
|
+
readonly sizePt: number;
|
|
10
|
+
readonly color: MathColor;
|
|
11
|
+
}
|
|
12
|
+
interface MathRule {
|
|
13
|
+
readonly kind: 'rule';
|
|
14
|
+
readonly xPt: number;
|
|
15
|
+
readonly yPt: number;
|
|
16
|
+
readonly widthPt: number;
|
|
17
|
+
readonly heightPt: number;
|
|
18
|
+
readonly color: MathColor;
|
|
19
|
+
}
|
|
20
|
+
interface MathStroke {
|
|
21
|
+
readonly kind: 'stroke';
|
|
22
|
+
readonly points: readonly {
|
|
23
|
+
readonly xPt: number;
|
|
24
|
+
readonly yPt: number;
|
|
25
|
+
}[];
|
|
26
|
+
readonly widthPt: number;
|
|
27
|
+
readonly color: MathColor;
|
|
28
|
+
}
|
|
29
|
+
interface MathGlyphPlacement {
|
|
30
|
+
readonly glyphId: number;
|
|
31
|
+
readonly xPt: number;
|
|
32
|
+
readonly yPt: number;
|
|
33
|
+
}
|
|
34
|
+
interface MathAssembledGlyphs {
|
|
35
|
+
readonly kind: 'assembled-glyphs';
|
|
36
|
+
readonly placements: readonly MathGlyphPlacement[];
|
|
37
|
+
readonly text: string;
|
|
38
|
+
readonly sizePt: number;
|
|
39
|
+
readonly color: MathColor;
|
|
40
|
+
}
|
|
41
|
+
type MathLayoutItem = MathGlyphRun | MathRule | MathStroke | MathAssembledGlyphs;
|
|
42
|
+
interface MathBox {
|
|
43
|
+
readonly widthPt: number;
|
|
44
|
+
readonly heightPt: number;
|
|
45
|
+
readonly ascentPt: number;
|
|
46
|
+
readonly descentPt: number;
|
|
47
|
+
readonly items: readonly MathLayoutItem[];
|
|
48
|
+
}
|
|
49
|
+
interface MathGlyphMetrics {
|
|
50
|
+
readonly advanceWidthPt: number;
|
|
51
|
+
readonly italicCorrectionPt: number;
|
|
52
|
+
readonly topAccentXPt?: number;
|
|
53
|
+
readonly inkAscentPt?: number;
|
|
54
|
+
readonly inkDescentPt?: number;
|
|
55
|
+
}
|
|
56
|
+
type MathStretchAxis = 'vertical' | 'horizontal';
|
|
57
|
+
interface MathStretchGlyph {
|
|
58
|
+
readonly glyphId: number;
|
|
59
|
+
readonly offsetPt: number;
|
|
60
|
+
}
|
|
61
|
+
interface MathStretchResult {
|
|
62
|
+
readonly kind: 'base' | 'variant' | 'assembly';
|
|
63
|
+
readonly sizePt: number;
|
|
64
|
+
readonly advanceWidthPt: number;
|
|
65
|
+
readonly inkAscentPt: number;
|
|
66
|
+
readonly inkDescentPt: number;
|
|
67
|
+
readonly placements: readonly MathStretchGlyph[];
|
|
68
|
+
}
|
|
69
|
+
interface MathFontMetrics {
|
|
70
|
+
readonly ascentPerEm: number;
|
|
71
|
+
readonly descentPerEm: number;
|
|
72
|
+
readonly axisHeightPt: number;
|
|
73
|
+
readonly fractionRuleThicknessPt: number;
|
|
74
|
+
readonly fractionNumeratorShiftUpPt: number;
|
|
75
|
+
readonly fractionNumeratorDisplayShiftUpPt: number;
|
|
76
|
+
readonly fractionDenominatorShiftDownPt: number;
|
|
77
|
+
readonly fractionDenominatorDisplayShiftDownPt: number;
|
|
78
|
+
readonly fractionNumeratorGapMinPt: number;
|
|
79
|
+
readonly fractionDenominatorGapMinPt: number;
|
|
80
|
+
readonly radicalRuleThicknessPt: number;
|
|
81
|
+
readonly radicalExtraAscenderPt: number;
|
|
82
|
+
readonly radicalVerticalGapPt: number;
|
|
83
|
+
readonly radicalKernBeforeDegreePt: number;
|
|
84
|
+
readonly radicalKernAfterDegreePt: number;
|
|
85
|
+
readonly radicalDegreeBottomRaisePercent: number;
|
|
86
|
+
readonly subscriptShiftDownPt: number;
|
|
87
|
+
readonly superscriptShiftUpPt: number;
|
|
88
|
+
readonly superscriptShiftUpCrampedPt: number;
|
|
89
|
+
readonly subSuperscriptGapMinPt: number;
|
|
90
|
+
readonly superscriptBaselineDropMaxPt: number;
|
|
91
|
+
readonly subscriptBaselineDropMinPt: number;
|
|
92
|
+
readonly spaceAfterScriptPt: number;
|
|
93
|
+
readonly upperLimitGapMinPt: number;
|
|
94
|
+
readonly upperLimitBaselineRiseMinPt: number;
|
|
95
|
+
readonly lowerLimitGapMinPt: number;
|
|
96
|
+
readonly lowerLimitBaselineDropMinPt: number;
|
|
97
|
+
readonly stackTopShiftUpPt: number;
|
|
98
|
+
readonly stackBottomShiftDownPt: number;
|
|
99
|
+
readonly stackGapMinPt: number;
|
|
100
|
+
readonly scriptPercentScaleDown: number;
|
|
101
|
+
readonly scriptScriptPercentScaleDown: number;
|
|
102
|
+
readonly defaultRuleThicknessPt: number;
|
|
103
|
+
glyph(codePoint: number, sizePt: number): MathGlyphMetrics | undefined;
|
|
104
|
+
stretch(codePoint: number, axis: MathStretchAxis, targetSizePt: number, sizePt: number): MathStretchResult | undefined;
|
|
105
|
+
}
|
|
106
|
+
interface PositionedFormula {
|
|
107
|
+
readonly pageIndex: number;
|
|
108
|
+
readonly xPt: number;
|
|
109
|
+
readonly yPt: number;
|
|
110
|
+
readonly box: MathBox;
|
|
111
|
+
}
|
|
112
|
+
//#endregion
|
|
113
|
+
export { MathAssembledGlyphs, MathBox, MathColor, MathFontMetrics, MathGlyphMetrics, MathGlyphPlacement, MathGlyphRun, MathLayoutItem, MathRule, MathStretchAxis, MathStretchGlyph, MathStretchResult, MathStroke, PositionedFormula };
|
|
File without changes
|
package/dist/package.d.cts
CHANGED
|
@@ -515,12 +515,12 @@ declare const DocumentPackageSchema: z.ZodObject<{
|
|
|
515
515
|
font: z.ZodObject<{
|
|
516
516
|
family: z.ZodString;
|
|
517
517
|
weight: z.ZodEnum<{
|
|
518
|
-
normal: "normal";
|
|
519
518
|
bold: "bold";
|
|
519
|
+
normal: "normal";
|
|
520
520
|
}>;
|
|
521
521
|
style: z.ZodEnum<{
|
|
522
|
-
normal: "normal";
|
|
523
522
|
italic: "italic";
|
|
523
|
+
normal: "normal";
|
|
524
524
|
}>;
|
|
525
525
|
}, z.core.$strip>;
|
|
526
526
|
sizePt: z.ZodNumber;
|
package/dist/package.d.ts
CHANGED
|
@@ -515,12 +515,12 @@ declare const DocumentPackageSchema: z.ZodObject<{
|
|
|
515
515
|
font: z.ZodObject<{
|
|
516
516
|
family: z.ZodString;
|
|
517
517
|
weight: z.ZodEnum<{
|
|
518
|
-
normal: "normal";
|
|
519
518
|
bold: "bold";
|
|
519
|
+
normal: "normal";
|
|
520
520
|
}>;
|
|
521
521
|
style: z.ZodEnum<{
|
|
522
|
-
normal: "normal";
|
|
523
522
|
italic: "italic";
|
|
523
|
+
normal: "normal";
|
|
524
524
|
}>;
|
|
525
525
|
}, z.core.$strip>;
|
|
526
526
|
sizePt: z.ZodNumber;
|
package/dist/schema-io.cjs
CHANGED
|
@@ -9,7 +9,7 @@ const SCHEMA_FILE_NAMES = {
|
|
|
9
9
|
LayoutDocument: "layout-document.schema.json"
|
|
10
10
|
};
|
|
11
11
|
function schemaUriFor(kind) {
|
|
12
|
-
return `https://cdn.jsdelivr.net/npm/document-schema.js@2.
|
|
12
|
+
return `https://cdn.jsdelivr.net/npm/document-schema.js@2.4.0/schemas/${SCHEMA_FILE_NAMES[kind]}`;
|
|
13
13
|
}
|
|
14
14
|
const SCHEMA_URI_PATTERN = /^https:\/\/cdn\.jsdelivr\.net\/npm\/document-schema\.js@[^/]+\/schemas\/(document-package|content-document|layout-document)\.schema\.json$/;
|
|
15
15
|
function kindForFileStem(stem) {
|
package/dist/schema-io.js
CHANGED
|
@@ -8,7 +8,7 @@ const SCHEMA_FILE_NAMES = {
|
|
|
8
8
|
LayoutDocument: "layout-document.schema.json"
|
|
9
9
|
};
|
|
10
10
|
function schemaUriFor(kind) {
|
|
11
|
-
return `https://cdn.jsdelivr.net/npm/document-schema.js@2.
|
|
11
|
+
return `https://cdn.jsdelivr.net/npm/document-schema.js@2.4.0/schemas/${SCHEMA_FILE_NAMES[kind]}`;
|
|
12
12
|
}
|
|
13
13
|
const SCHEMA_URI_PATTERN = /^https:\/\/cdn\.jsdelivr\.net\/npm\/document-schema\.js@[^/]+\/schemas\/(document-package|content-document|layout-document)\.schema\.json$/;
|
|
14
14
|
function kindForFileStem(stem) {
|
package/dist/style.d.cts
CHANGED
|
@@ -10,12 +10,12 @@ type Alignment = z.infer<typeof AlignmentSchema>;
|
|
|
10
10
|
declare const LayoutFontSchema: z.ZodObject<{
|
|
11
11
|
family: z.ZodString;
|
|
12
12
|
weight: z.ZodEnum<{
|
|
13
|
-
normal: "normal";
|
|
14
13
|
bold: "bold";
|
|
14
|
+
normal: "normal";
|
|
15
15
|
}>;
|
|
16
16
|
style: z.ZodEnum<{
|
|
17
|
-
normal: "normal";
|
|
18
17
|
italic: "italic";
|
|
18
|
+
normal: "normal";
|
|
19
19
|
}>;
|
|
20
20
|
}, z.core.$strip>;
|
|
21
21
|
type LayoutFont = z.infer<typeof LayoutFontSchema>;
|
package/dist/style.d.ts
CHANGED
|
@@ -10,12 +10,12 @@ type Alignment = z.infer<typeof AlignmentSchema>;
|
|
|
10
10
|
declare const LayoutFontSchema: z.ZodObject<{
|
|
11
11
|
family: z.ZodString;
|
|
12
12
|
weight: z.ZodEnum<{
|
|
13
|
-
normal: "normal";
|
|
14
13
|
bold: "bold";
|
|
14
|
+
normal: "normal";
|
|
15
15
|
}>;
|
|
16
16
|
style: z.ZodEnum<{
|
|
17
|
-
normal: "normal";
|
|
18
17
|
italic: "italic";
|
|
18
|
+
normal: "normal";
|
|
19
19
|
}>;
|
|
20
20
|
}, z.core.$strip>;
|
|
21
21
|
type LayoutFont = z.infer<typeof LayoutFontSchema>;
|
|
File without changes
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { n as Color } from "./color-AELCDH_b.cjs";
|
|
2
|
+
import { LayoutFont } from "./style.cjs";
|
|
3
|
+
//#region src/text-layout.d.ts
|
|
4
|
+
interface UnderlineMetrics {
|
|
5
|
+
readonly offsetPt: number;
|
|
6
|
+
readonly thicknessPt: number;
|
|
7
|
+
}
|
|
8
|
+
interface TextMeasurer {
|
|
9
|
+
widthOfTextAtSize(text: string, font: LayoutFont, sizePt: number): number;
|
|
10
|
+
lineHeightAtSize(font: LayoutFont, sizePt: number): number;
|
|
11
|
+
ascenderAtSize(font: LayoutFont, sizePt: number): number;
|
|
12
|
+
descenderAtSize(font: LayoutFont, sizePt: number): number;
|
|
13
|
+
underlineAtSize(font: LayoutFont, sizePt: number): UnderlineMetrics;
|
|
14
|
+
horizontalScaleFor(font: LayoutFont): number;
|
|
15
|
+
}
|
|
16
|
+
interface StyledRun {
|
|
17
|
+
readonly text: string;
|
|
18
|
+
readonly font: LayoutFont;
|
|
19
|
+
readonly sizePt: number;
|
|
20
|
+
readonly color: Color;
|
|
21
|
+
readonly underline?: boolean;
|
|
22
|
+
readonly hyperlink?: string;
|
|
23
|
+
readonly sourcePath?: string;
|
|
24
|
+
}
|
|
25
|
+
interface StyledFragment {
|
|
26
|
+
readonly text: string;
|
|
27
|
+
readonly font: LayoutFont;
|
|
28
|
+
readonly sizePt: number;
|
|
29
|
+
readonly color: Color;
|
|
30
|
+
readonly underline?: boolean;
|
|
31
|
+
readonly hyperlink?: string;
|
|
32
|
+
readonly sourcePath?: string;
|
|
33
|
+
}
|
|
34
|
+
interface WrappedLine {
|
|
35
|
+
readonly fragments: readonly (StyledFragment & {
|
|
36
|
+
readonly xOffsetPt: number;
|
|
37
|
+
})[];
|
|
38
|
+
readonly widthPt: number;
|
|
39
|
+
readonly maxSizePt: number;
|
|
40
|
+
readonly ascentPt: number;
|
|
41
|
+
readonly descentPt: number;
|
|
42
|
+
}
|
|
43
|
+
interface WrapOptions {
|
|
44
|
+
readonly breakLongWords?: boolean;
|
|
45
|
+
}
|
|
46
|
+
//#endregion
|
|
47
|
+
export { StyledFragment, StyledRun, TextMeasurer, UnderlineMetrics, WrapOptions, WrappedLine };
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { n as Color } from "./color-AELCDH_b.js";
|
|
2
|
+
import { LayoutFont } from "./style.js";
|
|
3
|
+
//#region src/text-layout.d.ts
|
|
4
|
+
interface UnderlineMetrics {
|
|
5
|
+
readonly offsetPt: number;
|
|
6
|
+
readonly thicknessPt: number;
|
|
7
|
+
}
|
|
8
|
+
interface TextMeasurer {
|
|
9
|
+
widthOfTextAtSize(text: string, font: LayoutFont, sizePt: number): number;
|
|
10
|
+
lineHeightAtSize(font: LayoutFont, sizePt: number): number;
|
|
11
|
+
ascenderAtSize(font: LayoutFont, sizePt: number): number;
|
|
12
|
+
descenderAtSize(font: LayoutFont, sizePt: number): number;
|
|
13
|
+
underlineAtSize(font: LayoutFont, sizePt: number): UnderlineMetrics;
|
|
14
|
+
horizontalScaleFor(font: LayoutFont): number;
|
|
15
|
+
}
|
|
16
|
+
interface StyledRun {
|
|
17
|
+
readonly text: string;
|
|
18
|
+
readonly font: LayoutFont;
|
|
19
|
+
readonly sizePt: number;
|
|
20
|
+
readonly color: Color;
|
|
21
|
+
readonly underline?: boolean;
|
|
22
|
+
readonly hyperlink?: string;
|
|
23
|
+
readonly sourcePath?: string;
|
|
24
|
+
}
|
|
25
|
+
interface StyledFragment {
|
|
26
|
+
readonly text: string;
|
|
27
|
+
readonly font: LayoutFont;
|
|
28
|
+
readonly sizePt: number;
|
|
29
|
+
readonly color: Color;
|
|
30
|
+
readonly underline?: boolean;
|
|
31
|
+
readonly hyperlink?: string;
|
|
32
|
+
readonly sourcePath?: string;
|
|
33
|
+
}
|
|
34
|
+
interface WrappedLine {
|
|
35
|
+
readonly fragments: readonly (StyledFragment & {
|
|
36
|
+
readonly xOffsetPt: number;
|
|
37
|
+
})[];
|
|
38
|
+
readonly widthPt: number;
|
|
39
|
+
readonly maxSizePt: number;
|
|
40
|
+
readonly ascentPt: number;
|
|
41
|
+
readonly descentPt: number;
|
|
42
|
+
}
|
|
43
|
+
interface WrapOptions {
|
|
44
|
+
readonly breakLongWords?: boolean;
|
|
45
|
+
}
|
|
46
|
+
//#endregion
|
|
47
|
+
export { StyledFragment, StyledRun, TextMeasurer, UnderlineMetrics, WrapOptions, WrappedLine };
|
|
File without changes
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "doc-schema.js",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.4.0",
|
|
4
4
|
"description": "The canonical, format-agnostic content and layout schemas shared by ooxml.js, odf.js, and documents.js -- pure Zod schemas, no behaviour.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"repository": {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
-
"$id": "https://cdn.jsdelivr.net/npm/document-schema.js@2.
|
|
3
|
+
"$id": "https://cdn.jsdelivr.net/npm/document-schema.js@2.4.0/schemas/content-document.schema.json",
|
|
4
4
|
"oneOf": [
|
|
5
5
|
{
|
|
6
6
|
"type": "object",
|
|
@@ -1208,7 +1208,7 @@
|
|
|
1208
1208
|
]
|
|
1209
1209
|
},
|
|
1210
1210
|
"document": {
|
|
1211
|
-
"$ref": "https://cdn.jsdelivr.net/npm/document-schema.js@2.
|
|
1211
|
+
"$ref": "https://cdn.jsdelivr.net/npm/document-schema.js@2.4.0/schemas/content-document.schema.json"
|
|
1212
1212
|
},
|
|
1213
1213
|
"frame": {
|
|
1214
1214
|
"$ref": "#/$defs/Box"
|
|
@@ -2499,7 +2499,7 @@
|
|
|
2499
2499
|
]
|
|
2500
2500
|
},
|
|
2501
2501
|
"document": {
|
|
2502
|
-
"$ref": "https://cdn.jsdelivr.net/npm/document-schema.js@2.
|
|
2502
|
+
"$ref": "https://cdn.jsdelivr.net/npm/document-schema.js@2.4.0/schemas/content-document.schema.json"
|
|
2503
2503
|
},
|
|
2504
2504
|
"frame": {
|
|
2505
2505
|
"$ref": "#/$defs/Box"
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
-
"$id": "https://cdn.jsdelivr.net/npm/document-schema.js@2.
|
|
3
|
+
"$id": "https://cdn.jsdelivr.net/npm/document-schema.js@2.4.0/schemas/document-package.schema.json",
|
|
4
4
|
"type": "object",
|
|
5
5
|
"properties": {
|
|
6
6
|
"formatVersion": {
|
|
@@ -8,10 +8,10 @@
|
|
|
8
8
|
"const": 1
|
|
9
9
|
},
|
|
10
10
|
"content": {
|
|
11
|
-
"$ref": "https://cdn.jsdelivr.net/npm/document-schema.js@2.
|
|
11
|
+
"$ref": "https://cdn.jsdelivr.net/npm/document-schema.js@2.4.0/schemas/content-document.schema.json"
|
|
12
12
|
},
|
|
13
13
|
"layout": {
|
|
14
|
-
"$ref": "https://cdn.jsdelivr.net/npm/document-schema.js@2.
|
|
14
|
+
"$ref": "https://cdn.jsdelivr.net/npm/document-schema.js@2.4.0/schemas/layout-document.schema.json"
|
|
15
15
|
}
|
|
16
16
|
},
|
|
17
17
|
"required": [
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
-
"$id": "https://cdn.jsdelivr.net/npm/document-schema.js@2.
|
|
3
|
+
"$id": "https://cdn.jsdelivr.net/npm/document-schema.js@2.4.0/schemas/layout-document.schema.json",
|
|
4
4
|
"type": "object",
|
|
5
5
|
"properties": {
|
|
6
6
|
"formatVersion": {
|