document-schema.js 2.2.3 → 2.3.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/codec.cjs +0 -0
- package/dist/codec.d.cts +13 -0
- package/dist/codec.d.ts +13 -0
- package/dist/codec.js +0 -0
- package/dist/content.d.cts +1 -1
- package/dist/content.d.ts +1 -1
- package/dist/index.cjs +1 -0
- package/dist/index.d.cts +5 -4
- package/dist/index.d.ts +5 -4
- package/dist/index.js +1 -0
- package/dist/layout.d.cts +8 -8
- package/dist/layout.d.ts +8 -8
- 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/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/codec.cjs
ADDED
|
File without changes
|
package/dist/codec.d.cts
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { ContentDocument } from "./content.cjs";
|
|
2
|
+
import { LayoutDocument } from "./layout.cjs";
|
|
3
|
+
//#region src/codec.d.ts
|
|
4
|
+
interface ContentCodec<TOptions = unknown> {
|
|
5
|
+
read(bytes: Uint8Array, options?: TOptions): ContentDocument;
|
|
6
|
+
write?(content: ContentDocument, options?: TOptions): Uint8Array;
|
|
7
|
+
}
|
|
8
|
+
interface LayoutCodec<TOptions = unknown> {
|
|
9
|
+
read(bytes: Uint8Array, options?: TOptions): LayoutDocument;
|
|
10
|
+
write(layout: LayoutDocument, options?: TOptions): Uint8Array;
|
|
11
|
+
}
|
|
12
|
+
//#endregion
|
|
13
|
+
export { ContentCodec, LayoutCodec };
|
package/dist/codec.d.ts
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { ContentDocument } from "./content.js";
|
|
2
|
+
import { LayoutDocument } from "./layout.js";
|
|
3
|
+
//#region src/codec.d.ts
|
|
4
|
+
interface ContentCodec<TOptions = unknown> {
|
|
5
|
+
read(bytes: Uint8Array, options?: TOptions): ContentDocument;
|
|
6
|
+
write?(content: ContentDocument, options?: TOptions): Uint8Array;
|
|
7
|
+
}
|
|
8
|
+
interface LayoutCodec<TOptions = unknown> {
|
|
9
|
+
read(bytes: Uint8Array, options?: TOptions): LayoutDocument;
|
|
10
|
+
write(layout: LayoutDocument, options?: TOptions): Uint8Array;
|
|
11
|
+
}
|
|
12
|
+
//#endregion
|
|
13
|
+
export { ContentCodec, LayoutCodec };
|
package/dist/codec.js
ADDED
|
File without changes
|
package/dist/content.d.cts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { n as Color } from "./color-AELCDH_b.cjs";
|
|
2
1
|
import { d as MathMlNode } from "./mathml-B1oTCtzc.cjs";
|
|
2
|
+
import { n as Color } from "./color-AELCDH_b.cjs";
|
|
3
3
|
import { t as Box } from "./geometry-CokwQGtJ.cjs";
|
|
4
4
|
import { z } from "zod";
|
|
5
5
|
//#region src/content.d.ts
|
package/dist/content.d.ts
CHANGED
package/dist/index.cjs
CHANGED
package/dist/index.d.cts
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
|
-
import { a as rgbHexToColor, i as colorToRgbHex, n as Color, r as ColorSchema, t as COLOR_BLACK } from "./color-AELCDH_b.cjs";
|
|
2
|
-
import { CONTENT_DEFS, CONTENT_DOCUMENT_URI, EMBEDDED_OBJECT_KINDS, MAX_SAFE_INTEGER } from "./content-json-schema-defs.cjs";
|
|
3
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
|
+
import { a as rgbHexToColor, i as colorToRgbHex, n as Color, r as ColorSchema, t as COLOR_BLACK } from "./color-AELCDH_b.cjs";
|
|
4
3
|
import { a as PAGE_SIZE_A4, c as PageSizeSchema, i as MarginsSchema, l as SLIDE_SIZE_STANDARD, n as BoxSchema, o as PAGE_SIZE_LETTER, r as Margins, s as PageSize, t as Box, u as SLIDE_SIZE_WIDESCREEN } from "./geometry-CokwQGtJ.cjs";
|
|
5
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
|
+
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
|
+
import { ContentCodec, LayoutCodec } from "./codec.cjs";
|
|
7
|
+
import { CONTENT_DEFS, CONTENT_DOCUMENT_URI, EMBEDDED_OBJECT_KINDS, MAX_SAFE_INTEGER } from "./content-json-schema-defs.cjs";
|
|
6
8
|
import { Alignment, AlignmentSchema, DEFAULT_LAYOUT_FONT, LayoutFont, LayoutFontSchema } from "./style.cjs";
|
|
7
9
|
import { LayoutMetadata, LayoutMetadataSchema } from "./metadata.cjs";
|
|
8
|
-
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";
|
|
9
10
|
import { DOCUMENT_PACKAGE_FORMAT_VERSION, DocumentPackage, DocumentPackageSchema } from "./package.cjs";
|
|
10
11
|
import { ContentDocumentJson, DocumentJsonResult, DocumentPackageJson, DocumentSchemaKind, LayoutDocumentJson, SCHEMA_FILE_NAMES, UnrecognizedDocumentSchemaError, contentDocumentWithSchema, documentFromJson, documentPackageWithSchema, documentSchemaKindOf, layoutDocumentWithSchema, schemaUriFor } from "./schema-io.cjs";
|
|
11
|
-
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, 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, LAYOUT_FORMAT_VERSION, 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, MathMlAttribute, MathMlAttributeSchema, MathMlCdata, MathMlCdataSchema, MathMlComment, MathMlCommentSchema, MathMlDeclaration, MathMlDeclarationSchema, MathMlElement, MathMlElementSchema, MathMlNode, MathMlNodeSchema, MathMlPi, MathMlPiSchema, MathMlText, MathMlTextSchema, PAGE_SIZE_A4, PAGE_SIZE_LETTER, PageSize, PageSizeSchema, SCHEMA_FILE_NAMES, SLIDE_SIZE_STANDARD, SLIDE_SIZE_WIDESCREEN, UnrecognizedDocumentSchemaError, colorToRgbHex, contentDocumentWithSchema, documentFromJson, documentPackageWithSchema, documentSchemaKindOf, isContentBlock, isMathMlNode, layoutDocumentWithSchema, rgbHexToColor, schemaUriFor };
|
|
12
|
+
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, 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, MathMlAttribute, MathMlAttributeSchema, MathMlCdata, MathMlCdataSchema, MathMlComment, MathMlCommentSchema, MathMlDeclaration, MathMlDeclarationSchema, MathMlElement, MathMlElementSchema, MathMlNode, MathMlNodeSchema, MathMlPi, MathMlPiSchema, MathMlText, MathMlTextSchema, PAGE_SIZE_A4, PAGE_SIZE_LETTER, PageSize, PageSizeSchema, SCHEMA_FILE_NAMES, SLIDE_SIZE_STANDARD, SLIDE_SIZE_WIDESCREEN, UnrecognizedDocumentSchemaError, colorToRgbHex, contentDocumentWithSchema, documentFromJson, documentPackageWithSchema, documentSchemaKindOf, isContentBlock, isMathMlNode, layoutDocumentWithSchema, rgbHexToColor, schemaUriFor };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
|
-
import { a as rgbHexToColor, i as colorToRgbHex, n as Color, r as ColorSchema, t as COLOR_BLACK } from "./color-AELCDH_b.js";
|
|
2
|
-
import { CONTENT_DEFS, CONTENT_DOCUMENT_URI, EMBEDDED_OBJECT_KINDS, MAX_SAFE_INTEGER } from "./content-json-schema-defs.js";
|
|
3
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
|
+
import { a as rgbHexToColor, i as colorToRgbHex, n as Color, r as ColorSchema, t as COLOR_BLACK } from "./color-AELCDH_b.js";
|
|
4
3
|
import { a as PAGE_SIZE_A4, c as PageSizeSchema, i as MarginsSchema, l as SLIDE_SIZE_STANDARD, n as BoxSchema, o as PAGE_SIZE_LETTER, r as Margins, s as PageSize, t as Box, u as SLIDE_SIZE_WIDESCREEN } from "./geometry-CokwQGtJ.js";
|
|
5
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
|
+
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
|
+
import { ContentCodec, LayoutCodec } from "./codec.js";
|
|
7
|
+
import { CONTENT_DEFS, CONTENT_DOCUMENT_URI, EMBEDDED_OBJECT_KINDS, MAX_SAFE_INTEGER } from "./content-json-schema-defs.js";
|
|
6
8
|
import { Alignment, AlignmentSchema, DEFAULT_LAYOUT_FONT, LayoutFont, LayoutFontSchema } from "./style.js";
|
|
7
9
|
import { LayoutMetadata, LayoutMetadataSchema } from "./metadata.js";
|
|
8
|
-
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";
|
|
9
10
|
import { DOCUMENT_PACKAGE_FORMAT_VERSION, DocumentPackage, DocumentPackageSchema } from "./package.js";
|
|
10
11
|
import { ContentDocumentJson, DocumentJsonResult, DocumentPackageJson, DocumentSchemaKind, LayoutDocumentJson, SCHEMA_FILE_NAMES, UnrecognizedDocumentSchemaError, contentDocumentWithSchema, documentFromJson, documentPackageWithSchema, documentSchemaKindOf, layoutDocumentWithSchema, schemaUriFor } from "./schema-io.js";
|
|
11
|
-
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, 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, LAYOUT_FORMAT_VERSION, 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, MathMlAttribute, MathMlAttributeSchema, MathMlCdata, MathMlCdataSchema, MathMlComment, MathMlCommentSchema, MathMlDeclaration, MathMlDeclarationSchema, MathMlElement, MathMlElementSchema, MathMlNode, MathMlNodeSchema, MathMlPi, MathMlPiSchema, MathMlText, MathMlTextSchema, PAGE_SIZE_A4, PAGE_SIZE_LETTER, PageSize, PageSizeSchema, SCHEMA_FILE_NAMES, SLIDE_SIZE_STANDARD, SLIDE_SIZE_WIDESCREEN, UnrecognizedDocumentSchemaError, colorToRgbHex, contentDocumentWithSchema, documentFromJson, documentPackageWithSchema, documentSchemaKindOf, isContentBlock, isMathMlNode, layoutDocumentWithSchema, rgbHexToColor, schemaUriFor };
|
|
12
|
+
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, 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, MathMlAttribute, MathMlAttributeSchema, MathMlCdata, MathMlCdataSchema, MathMlComment, MathMlCommentSchema, MathMlDeclaration, MathMlDeclarationSchema, MathMlElement, MathMlElementSchema, MathMlNode, MathMlNodeSchema, MathMlPi, MathMlPiSchema, MathMlText, MathMlTextSchema, PAGE_SIZE_A4, PAGE_SIZE_LETTER, PageSize, PageSizeSchema, SCHEMA_FILE_NAMES, SLIDE_SIZE_STANDARD, SLIDE_SIZE_WIDESCREEN, UnrecognizedDocumentSchemaError, colorToRgbHex, contentDocumentWithSchema, documentFromJson, documentPackageWithSchema, documentSchemaKindOf, isContentBlock, isMathMlNode, layoutDocumentWithSchema, rgbHexToColor, schemaUriFor };
|
package/dist/index.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import "./codec.js";
|
|
1
2
|
import { COLOR_BLACK, ColorSchema, colorToRgbHex, rgbHexToColor } from "./color.js";
|
|
2
3
|
import { BoxSchema, MarginsSchema, PAGE_SIZE_A4, PAGE_SIZE_LETTER, PageSizeSchema, SLIDE_SIZE_STANDARD, SLIDE_SIZE_WIDESCREEN } from "./geometry.js";
|
|
3
4
|
import { MathMlAttributeSchema, MathMlCdataSchema, MathMlCommentSchema, MathMlDeclarationSchema, MathMlElementSchema, MathMlNodeSchema, MathMlPiSchema, MathMlTextSchema, isMathMlNode } from "./mathml.js";
|
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
|
-
bold: "bold";
|
|
13
12
|
normal: "normal";
|
|
13
|
+
bold: "bold";
|
|
14
14
|
}>;
|
|
15
15
|
style: z.ZodEnum<{
|
|
16
|
-
italic: "italic";
|
|
17
16
|
normal: "normal";
|
|
17
|
+
italic: "italic";
|
|
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
|
-
bold: "bold";
|
|
206
205
|
normal: "normal";
|
|
206
|
+
bold: "bold";
|
|
207
207
|
}>;
|
|
208
208
|
style: z.ZodEnum<{
|
|
209
|
-
italic: "italic";
|
|
210
209
|
normal: "normal";
|
|
210
|
+
italic: "italic";
|
|
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
|
-
bold: "bold";
|
|
357
356
|
normal: "normal";
|
|
357
|
+
bold: "bold";
|
|
358
358
|
}>;
|
|
359
359
|
style: z.ZodEnum<{
|
|
360
|
-
italic: "italic";
|
|
361
360
|
normal: "normal";
|
|
361
|
+
italic: "italic";
|
|
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
|
-
bold: "bold";
|
|
532
531
|
normal: "normal";
|
|
532
|
+
bold: "bold";
|
|
533
533
|
}>;
|
|
534
534
|
style: z.ZodEnum<{
|
|
535
|
-
italic: "italic";
|
|
536
535
|
normal: "normal";
|
|
536
|
+
italic: "italic";
|
|
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
|
-
bold: "bold";
|
|
13
12
|
normal: "normal";
|
|
13
|
+
bold: "bold";
|
|
14
14
|
}>;
|
|
15
15
|
style: z.ZodEnum<{
|
|
16
|
-
italic: "italic";
|
|
17
16
|
normal: "normal";
|
|
17
|
+
italic: "italic";
|
|
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
|
-
bold: "bold";
|
|
206
205
|
normal: "normal";
|
|
206
|
+
bold: "bold";
|
|
207
207
|
}>;
|
|
208
208
|
style: z.ZodEnum<{
|
|
209
|
-
italic: "italic";
|
|
210
209
|
normal: "normal";
|
|
210
|
+
italic: "italic";
|
|
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
|
-
bold: "bold";
|
|
357
356
|
normal: "normal";
|
|
357
|
+
bold: "bold";
|
|
358
358
|
}>;
|
|
359
359
|
style: z.ZodEnum<{
|
|
360
|
-
italic: "italic";
|
|
361
360
|
normal: "normal";
|
|
361
|
+
italic: "italic";
|
|
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
|
-
bold: "bold";
|
|
532
531
|
normal: "normal";
|
|
532
|
+
bold: "bold";
|
|
533
533
|
}>;
|
|
534
534
|
style: z.ZodEnum<{
|
|
535
|
-
italic: "italic";
|
|
536
535
|
normal: "normal";
|
|
536
|
+
italic: "italic";
|
|
537
537
|
}>;
|
|
538
538
|
}, z.core.$strip>;
|
|
539
539
|
sizePt: z.ZodNumber;
|
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
|
-
bold: "bold";
|
|
519
518
|
normal: "normal";
|
|
519
|
+
bold: "bold";
|
|
520
520
|
}>;
|
|
521
521
|
style: z.ZodEnum<{
|
|
522
|
-
italic: "italic";
|
|
523
522
|
normal: "normal";
|
|
523
|
+
italic: "italic";
|
|
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
|
-
bold: "bold";
|
|
519
518
|
normal: "normal";
|
|
519
|
+
bold: "bold";
|
|
520
520
|
}>;
|
|
521
521
|
style: z.ZodEnum<{
|
|
522
|
-
italic: "italic";
|
|
523
522
|
normal: "normal";
|
|
523
|
+
italic: "italic";
|
|
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.3.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.3.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
|
-
bold: "bold";
|
|
14
13
|
normal: "normal";
|
|
14
|
+
bold: "bold";
|
|
15
15
|
}>;
|
|
16
16
|
style: z.ZodEnum<{
|
|
17
|
-
italic: "italic";
|
|
18
17
|
normal: "normal";
|
|
18
|
+
italic: "italic";
|
|
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
|
-
bold: "bold";
|
|
14
13
|
normal: "normal";
|
|
14
|
+
bold: "bold";
|
|
15
15
|
}>;
|
|
16
16
|
style: z.ZodEnum<{
|
|
17
|
-
italic: "italic";
|
|
18
17
|
normal: "normal";
|
|
18
|
+
italic: "italic";
|
|
19
19
|
}>;
|
|
20
20
|
}, z.core.$strip>;
|
|
21
21
|
type LayoutFont = z.infer<typeof LayoutFontSchema>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "document-schema.js",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.3.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.3.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.3.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.3.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.3.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.3.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.3.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.3.0/schemas/layout-document.schema.json",
|
|
4
4
|
"type": "object",
|
|
5
5
|
"properties": {
|
|
6
6
|
"formatVersion": {
|