document-content-model 4.3.2 → 7.6.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/README.md +274 -95
- package/dist/border-weight.cjs +26 -0
- package/dist/border-weight.d.cts +12 -0
- package/dist/border-weight.d.ts +12 -0
- package/dist/border-weight.js +23 -0
- package/dist/codec.d.cts +1 -1
- package/dist/codec.d.ts +1 -1
- package/dist/{construct-ETSlnMle.d.cts → construct-GVdTKrE7.d.cts} +242 -2
- package/dist/{construct-ETSlnMle.d.ts → construct-GVdTKrE7.d.ts} +242 -2
- package/dist/construct.cjs +13 -6
- package/dist/construct.d.cts +1 -1
- package/dist/construct.d.ts +1 -1
- package/dist/construct.js +13 -6
- package/dist/content-BCOxY0Eb.d.ts +10273 -0
- package/dist/content-BzkhrS6P.d.cts +10273 -0
- package/dist/content-json-schema-defs.cjs +1056 -189
- package/dist/content-json-schema-defs.js +1056 -189
- package/dist/content.cjs +514 -36
- package/dist/content.d.cts +2 -2
- package/dist/content.d.ts +2 -2
- package/dist/content.js +488 -37
- package/dist/decompose.cjs +7 -17
- package/dist/decompose.d.cts +5 -5
- package/dist/decompose.d.ts +5 -5
- package/dist/decompose.js +7 -17
- package/dist/definitions.cjs +5 -1
- package/dist/definitions.d.cts +37 -1
- package/dist/definitions.d.ts +37 -1
- package/dist/definitions.js +5 -1
- package/dist/factor-styles.cjs +14 -8
- package/dist/factor-styles.d.cts +6 -6
- package/dist/factor-styles.d.ts +6 -6
- package/dist/factor-styles.js +15 -9
- package/dist/flatten.cjs +5 -5
- package/dist/flatten.d.cts +4 -4
- package/dist/flatten.d.ts +4 -4
- package/dist/flatten.js +5 -5
- package/dist/font-port.d.cts +2 -2
- package/dist/font-port.d.ts +2 -2
- package/dist/index.cjs +54 -14
- package/dist/index.d.cts +14 -12
- package/dist/index.d.ts +14 -12
- package/dist/index.js +12 -10
- package/dist/{math-BlG8Tjk-.d.cts → math-BScHxedi.d.cts} +97 -14
- package/dist/{math-BlG8Tjk-.d.ts → math-BScHxedi.d.ts} +97 -14
- package/dist/math-layout.d.cts +6 -6
- package/dist/math-layout.d.ts +6 -6
- package/dist/math.cjs +32 -6
- package/dist/math.d.cts +2 -2
- package/dist/math.d.ts +2 -2
- package/dist/math.js +29 -7
- package/dist/{mathml-B1oTCtzc.d.cts → mathml-Czqc1mdZ.d.cts} +3 -3
- package/dist/{mathml-B1oTCtzc.d.ts → mathml-Czqc1mdZ.d.ts} +3 -3
- package/dist/mathml.cjs +9 -2
- package/dist/mathml.d.cts +1 -1
- package/dist/mathml.d.ts +1 -1
- package/dist/mathml.js +9 -2
- package/dist/metadata.cjs +12 -1
- package/dist/metadata.d.cts +13 -0
- package/dist/metadata.d.ts +13 -0
- package/dist/metadata.js +12 -1
- package/dist/package-node-C4mh1hLY.d.ts +1989 -0
- package/dist/package-node-RQMDBzwd.d.cts +1989 -0
- package/dist/package-node.cjs +21 -21
- package/dist/package-node.d.cts +2 -2
- package/dist/package-node.d.ts +2 -2
- package/dist/package-node.js +14 -14
- package/dist/package.cjs +5 -3
- package/dist/package.d.cts +253 -8
- package/dist/package.d.ts +253 -8
- package/dist/package.js +5 -3
- package/dist/schema-io.cjs +21 -11
- package/dist/schema-io.d.cts +13 -9
- package/dist/schema-io.d.ts +13 -9
- package/dist/schema-io.js +21 -12
- package/dist/source-Bas5ol6f.d.cts +43 -0
- package/dist/source-Bas5ol6f.d.ts +43 -0
- package/dist/source.cjs +27 -0
- package/dist/source.d.cts +2 -0
- package/dist/source.d.ts +2 -0
- package/dist/source.js +25 -0
- package/dist/style-D06NwxAJ.d.cts +29 -0
- package/dist/style-D06NwxAJ.d.ts +29 -0
- package/dist/style.cjs +2 -0
- package/dist/style.d.cts +2 -24
- package/dist/style.d.ts +2 -24
- package/dist/style.js +2 -1
- package/dist/text-layout.d.cts +1 -1
- package/dist/text-layout.d.ts +1 -1
- package/package.json +28 -29
- package/schemas/content-document.schema.json +6623 -1694
- package/schemas/{document-package.schema.json → document-tree.schema.json} +1826 -143
- package/dist/content-BLwxI5ba.d.cts +0 -2481
- package/dist/content-BdzcBsxm.d.ts +0 -2481
- package/dist/package-node-C-ewnL0v.d.cts +0 -459
- package/dist/package-node-D3scv-Cl.d.ts +0 -459
package/dist/schema-io.js
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { ContentDocumentSchema } from "./content.js";
|
|
2
|
-
import {
|
|
2
|
+
import { DocumentTreeSchema } from "./package.js";
|
|
3
3
|
//#region src/schema-io.ts
|
|
4
4
|
const SCHEMA_FILE_NAMES = {
|
|
5
|
-
|
|
5
|
+
DocumentTree: "document-tree.schema.json",
|
|
6
6
|
ContentDocument: "content-document.schema.json"
|
|
7
7
|
};
|
|
8
8
|
function schemaUriFor(kind) {
|
|
9
|
-
return `https://cdn.jsdelivr.net/npm/document-schema.js@
|
|
9
|
+
return `https://cdn.jsdelivr.net/npm/document-schema.js@7.6.0/schemas/${SCHEMA_FILE_NAMES[kind]}`;
|
|
10
10
|
}
|
|
11
|
-
const SCHEMA_URI_PATTERN = /^https:\/\/cdn\.jsdelivr\.net\/npm\/document-schema\.js@([^/]+)\/schemas\/(document-package|content-document|layout-document)\.schema\.json$/;
|
|
11
|
+
const SCHEMA_URI_PATTERN = /^https:\/\/cdn\.jsdelivr\.net\/npm\/document-schema\.js@([^/]+)\/schemas\/(document-tree|document-package|content-document|layout-document)\.schema\.json$/;
|
|
12
12
|
function parseSchemaUri(uri) {
|
|
13
13
|
const match = SCHEMA_URI_PATTERN.exec(uri);
|
|
14
14
|
if (match === null) return void 0;
|
|
@@ -22,7 +22,7 @@ function parseSchemaUri(uri) {
|
|
|
22
22
|
}
|
|
23
23
|
function kindForFileStem(stem) {
|
|
24
24
|
switch (stem) {
|
|
25
|
-
case "document-
|
|
25
|
+
case "document-tree": return "DocumentTree";
|
|
26
26
|
case "content-document": return "ContentDocument";
|
|
27
27
|
default: return;
|
|
28
28
|
}
|
|
@@ -42,9 +42,9 @@ function documentSchemaKindOf(value) {
|
|
|
42
42
|
if (parts === void 0) return void 0;
|
|
43
43
|
return kindForFileStem(parts.stem);
|
|
44
44
|
}
|
|
45
|
-
function
|
|
45
|
+
function documentTreeWithSchema(value) {
|
|
46
46
|
return {
|
|
47
|
-
$schema: schemaUriFor("
|
|
47
|
+
$schema: schemaUriFor("DocumentTree"),
|
|
48
48
|
...value
|
|
49
49
|
};
|
|
50
50
|
}
|
|
@@ -70,6 +70,14 @@ var LayoutSchemaDemotedError = class extends Error {
|
|
|
70
70
|
this.schema = schema;
|
|
71
71
|
}
|
|
72
72
|
};
|
|
73
|
+
var DocumentPackageRenamedError = class extends Error {
|
|
74
|
+
schema;
|
|
75
|
+
constructor(schema) {
|
|
76
|
+
super(`documentFromJson: this value is a document-package dump (${schema}), and DocumentPackage was renamed to DocumentTree in document-schema.js 5.0.0 (ExaDev/documents.js#661). Read it with a document-schema.js 4.x release, or re-dump it with a 5.x release.`);
|
|
77
|
+
this.name = "DocumentPackageRenamedError";
|
|
78
|
+
this.schema = schema;
|
|
79
|
+
}
|
|
80
|
+
};
|
|
73
81
|
var SchemaVersionMismatchError = class extends Error {
|
|
74
82
|
schema;
|
|
75
83
|
dumpVersion;
|
|
@@ -78,7 +86,7 @@ var SchemaVersionMismatchError = class extends Error {
|
|
|
78
86
|
const dumpMajor = majorVersionOf(dumpVersion);
|
|
79
87
|
const installedMajor = majorVersionOf(installedVersion);
|
|
80
88
|
const isOlder = dumpMajor !== void 0 && installedMajor !== void 0 && dumpMajor < installedMajor;
|
|
81
|
-
super(`documentFromJson: this dump's $schema pins document-schema.js@${dumpVersion}, but the installed release is @${installedVersion}, and a dump only parses under the major that wrote it.` + (isOlder ? ` Dumps from before 4.0.0 carry the retired formatVersion field and (for packages) the flat { formatVersion, content, pages } shape, replaced in 4.0.0 by the tree-form
|
|
89
|
+
super(`documentFromJson: this dump's $schema pins document-schema.js@${dumpVersion}, but the installed release is @${installedVersion}, and a dump only parses under the major that wrote it.` + (isOlder ? ` Dumps from before 4.0.0 carry the retired formatVersion field and (for packages) the flat { formatVersion, content, pages } shape, replaced in 4.0.0 by the tree-form DocumentTree (ExaDev/document-schema.js#20, named DocumentPackage before ExaDev/documents.js#661's 5.0.0 rename). Re-dump the value with a release matching its own major, or parse it with the release that produced it.` : ` Upgrade document-schema.js to read it.`));
|
|
82
90
|
this.name = "SchemaVersionMismatchError";
|
|
83
91
|
this.schema = schema;
|
|
84
92
|
this.dumpVersion = dumpVersion;
|
|
@@ -90,13 +98,14 @@ function documentFromJson(value) {
|
|
|
90
98
|
const parts = parseSchemaUri(value.$schema);
|
|
91
99
|
if (parts === void 0) throw new UnrecognizedDocumentSchemaError(value.$schema);
|
|
92
100
|
if (parts.stem === "layout-document") throw new LayoutSchemaDemotedError(value.$schema);
|
|
101
|
+
if (parts.stem === "document-package") throw new DocumentPackageRenamedError(value.$schema);
|
|
93
102
|
const kind = kindForFileStem(parts.stem);
|
|
94
103
|
if (kind === void 0) throw new UnrecognizedDocumentSchemaError(value.$schema);
|
|
95
|
-
if (majorVersionOf(parts.version) !== majorVersionOf("
|
|
104
|
+
if (majorVersionOf(parts.version) !== majorVersionOf("7.6.0")) throw new SchemaVersionMismatchError(value.$schema, parts.version, "7.6.0");
|
|
96
105
|
switch (kind) {
|
|
97
|
-
case "
|
|
106
|
+
case "DocumentTree": return {
|
|
98
107
|
kind,
|
|
99
|
-
value:
|
|
108
|
+
value: DocumentTreeSchema.parse(value)
|
|
100
109
|
};
|
|
101
110
|
case "ContentDocument": return {
|
|
102
111
|
kind,
|
|
@@ -105,4 +114,4 @@ function documentFromJson(value) {
|
|
|
105
114
|
}
|
|
106
115
|
}
|
|
107
116
|
//#endregion
|
|
108
|
-
export { LayoutSchemaDemotedError, SCHEMA_FILE_NAMES, SchemaVersionMismatchError, UnrecognizedDocumentSchemaError, contentDocumentWithSchema, documentFromJson,
|
|
117
|
+
export { DocumentPackageRenamedError, LayoutSchemaDemotedError, SCHEMA_FILE_NAMES, SchemaVersionMismatchError, UnrecognizedDocumentSchemaError, contentDocumentWithSchema, documentFromJson, documentSchemaKindOf, documentTreeWithSchema, schemaUriFor };
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
//#region src/source.d.ts
|
|
3
|
+
declare const SourceFormatSchema: z.ZodEnum<{
|
|
4
|
+
docx: "docx";
|
|
5
|
+
pptx: "pptx";
|
|
6
|
+
xlsx: "xlsx";
|
|
7
|
+
odt: "odt";
|
|
8
|
+
ods: "ods";
|
|
9
|
+
odp: "odp";
|
|
10
|
+
odg: "odg";
|
|
11
|
+
odm: "odm";
|
|
12
|
+
odb: "odb";
|
|
13
|
+
odf: "odf";
|
|
14
|
+
markdown: "markdown";
|
|
15
|
+
pdf: "pdf";
|
|
16
|
+
epub: "epub";
|
|
17
|
+
rtf: "rtf";
|
|
18
|
+
wpd: "wpd";
|
|
19
|
+
}>;
|
|
20
|
+
type SourceFormat = z.infer<typeof SourceFormatSchema>;
|
|
21
|
+
declare const SourceResidueSchema: z.ZodObject<{
|
|
22
|
+
format: z.ZodEnum<{
|
|
23
|
+
docx: "docx";
|
|
24
|
+
pptx: "pptx";
|
|
25
|
+
xlsx: "xlsx";
|
|
26
|
+
odt: "odt";
|
|
27
|
+
ods: "ods";
|
|
28
|
+
odp: "odp";
|
|
29
|
+
odg: "odg";
|
|
30
|
+
odm: "odm";
|
|
31
|
+
odb: "odb";
|
|
32
|
+
odf: "odf";
|
|
33
|
+
markdown: "markdown";
|
|
34
|
+
pdf: "pdf";
|
|
35
|
+
epub: "epub";
|
|
36
|
+
rtf: "rtf";
|
|
37
|
+
wpd: "wpd";
|
|
38
|
+
}>;
|
|
39
|
+
xml: z.ZodString;
|
|
40
|
+
}, z.core.$strict>;
|
|
41
|
+
type SourceResidue = z.infer<typeof SourceResidueSchema>;
|
|
42
|
+
//#endregion
|
|
43
|
+
export { SourceResidueSchema as i, SourceFormatSchema as n, SourceResidue as r, SourceFormat as t };
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
//#region src/source.d.ts
|
|
3
|
+
declare const SourceFormatSchema: z.ZodEnum<{
|
|
4
|
+
docx: "docx";
|
|
5
|
+
pptx: "pptx";
|
|
6
|
+
xlsx: "xlsx";
|
|
7
|
+
odt: "odt";
|
|
8
|
+
ods: "ods";
|
|
9
|
+
odp: "odp";
|
|
10
|
+
odg: "odg";
|
|
11
|
+
odm: "odm";
|
|
12
|
+
odb: "odb";
|
|
13
|
+
odf: "odf";
|
|
14
|
+
markdown: "markdown";
|
|
15
|
+
pdf: "pdf";
|
|
16
|
+
epub: "epub";
|
|
17
|
+
rtf: "rtf";
|
|
18
|
+
wpd: "wpd";
|
|
19
|
+
}>;
|
|
20
|
+
type SourceFormat = z.infer<typeof SourceFormatSchema>;
|
|
21
|
+
declare const SourceResidueSchema: z.ZodObject<{
|
|
22
|
+
format: z.ZodEnum<{
|
|
23
|
+
docx: "docx";
|
|
24
|
+
pptx: "pptx";
|
|
25
|
+
xlsx: "xlsx";
|
|
26
|
+
odt: "odt";
|
|
27
|
+
ods: "ods";
|
|
28
|
+
odp: "odp";
|
|
29
|
+
odg: "odg";
|
|
30
|
+
odm: "odm";
|
|
31
|
+
odb: "odb";
|
|
32
|
+
odf: "odf";
|
|
33
|
+
markdown: "markdown";
|
|
34
|
+
pdf: "pdf";
|
|
35
|
+
epub: "epub";
|
|
36
|
+
rtf: "rtf";
|
|
37
|
+
wpd: "wpd";
|
|
38
|
+
}>;
|
|
39
|
+
xml: z.ZodString;
|
|
40
|
+
}, z.core.$strict>;
|
|
41
|
+
type SourceResidue = z.infer<typeof SourceResidueSchema>;
|
|
42
|
+
//#endregion
|
|
43
|
+
export { SourceResidueSchema as i, SourceFormatSchema as n, SourceResidue as r, SourceFormat as t };
|
package/dist/source.cjs
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
+
let zod = require("zod");
|
|
3
|
+
//#region src/source.ts
|
|
4
|
+
const SourceFormatSchema = zod.z.enum([
|
|
5
|
+
"docx",
|
|
6
|
+
"pptx",
|
|
7
|
+
"xlsx",
|
|
8
|
+
"odt",
|
|
9
|
+
"ods",
|
|
10
|
+
"odp",
|
|
11
|
+
"odg",
|
|
12
|
+
"odm",
|
|
13
|
+
"odb",
|
|
14
|
+
"odf",
|
|
15
|
+
"markdown",
|
|
16
|
+
"pdf",
|
|
17
|
+
"epub",
|
|
18
|
+
"rtf",
|
|
19
|
+
"wpd"
|
|
20
|
+
]);
|
|
21
|
+
const SourceResidueSchema = zod.z.strictObject({
|
|
22
|
+
format: SourceFormatSchema,
|
|
23
|
+
xml: zod.z.string()
|
|
24
|
+
});
|
|
25
|
+
//#endregion
|
|
26
|
+
exports.SourceFormatSchema = SourceFormatSchema;
|
|
27
|
+
exports.SourceResidueSchema = SourceResidueSchema;
|
package/dist/source.d.ts
ADDED
package/dist/source.js
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
//#region src/source.ts
|
|
3
|
+
const SourceFormatSchema = z.enum([
|
|
4
|
+
"docx",
|
|
5
|
+
"pptx",
|
|
6
|
+
"xlsx",
|
|
7
|
+
"odt",
|
|
8
|
+
"ods",
|
|
9
|
+
"odp",
|
|
10
|
+
"odg",
|
|
11
|
+
"odm",
|
|
12
|
+
"odb",
|
|
13
|
+
"odf",
|
|
14
|
+
"markdown",
|
|
15
|
+
"pdf",
|
|
16
|
+
"epub",
|
|
17
|
+
"rtf",
|
|
18
|
+
"wpd"
|
|
19
|
+
]);
|
|
20
|
+
const SourceResidueSchema = z.strictObject({
|
|
21
|
+
format: SourceFormatSchema,
|
|
22
|
+
xml: z.string()
|
|
23
|
+
});
|
|
24
|
+
//#endregion
|
|
25
|
+
export { SourceFormatSchema, SourceResidueSchema };
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
//#region src/style.d.ts
|
|
3
|
+
declare const AlignmentSchema: z.ZodEnum<{
|
|
4
|
+
left: "left";
|
|
5
|
+
center: "center";
|
|
6
|
+
right: "right";
|
|
7
|
+
justify: "justify";
|
|
8
|
+
}>;
|
|
9
|
+
type Alignment = z.infer<typeof AlignmentSchema>;
|
|
10
|
+
declare const TextDirectionSchema: z.ZodEnum<{
|
|
11
|
+
ltr: "ltr";
|
|
12
|
+
rtl: "rtl";
|
|
13
|
+
}>;
|
|
14
|
+
type TextDirection = z.infer<typeof TextDirectionSchema>;
|
|
15
|
+
declare const LayoutFontSchema: z.ZodObject<{
|
|
16
|
+
family: z.ZodString;
|
|
17
|
+
weight: z.ZodEnum<{
|
|
18
|
+
bold: "bold";
|
|
19
|
+
normal: "normal";
|
|
20
|
+
}>;
|
|
21
|
+
style: z.ZodEnum<{
|
|
22
|
+
italic: "italic";
|
|
23
|
+
normal: "normal";
|
|
24
|
+
}>;
|
|
25
|
+
}, z.core.$strip>;
|
|
26
|
+
type LayoutFont = z.infer<typeof LayoutFontSchema>;
|
|
27
|
+
declare const DEFAULT_LAYOUT_FONT: LayoutFont;
|
|
28
|
+
//#endregion
|
|
29
|
+
export { LayoutFontSchema as a, LayoutFont as i, AlignmentSchema as n, TextDirection as o, DEFAULT_LAYOUT_FONT as r, TextDirectionSchema as s, Alignment as t };
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
//#region src/style.d.ts
|
|
3
|
+
declare const AlignmentSchema: z.ZodEnum<{
|
|
4
|
+
left: "left";
|
|
5
|
+
center: "center";
|
|
6
|
+
right: "right";
|
|
7
|
+
justify: "justify";
|
|
8
|
+
}>;
|
|
9
|
+
type Alignment = z.infer<typeof AlignmentSchema>;
|
|
10
|
+
declare const TextDirectionSchema: z.ZodEnum<{
|
|
11
|
+
ltr: "ltr";
|
|
12
|
+
rtl: "rtl";
|
|
13
|
+
}>;
|
|
14
|
+
type TextDirection = z.infer<typeof TextDirectionSchema>;
|
|
15
|
+
declare const LayoutFontSchema: z.ZodObject<{
|
|
16
|
+
family: z.ZodString;
|
|
17
|
+
weight: z.ZodEnum<{
|
|
18
|
+
bold: "bold";
|
|
19
|
+
normal: "normal";
|
|
20
|
+
}>;
|
|
21
|
+
style: z.ZodEnum<{
|
|
22
|
+
italic: "italic";
|
|
23
|
+
normal: "normal";
|
|
24
|
+
}>;
|
|
25
|
+
}, z.core.$strip>;
|
|
26
|
+
type LayoutFont = z.infer<typeof LayoutFontSchema>;
|
|
27
|
+
declare const DEFAULT_LAYOUT_FONT: LayoutFont;
|
|
28
|
+
//#endregion
|
|
29
|
+
export { LayoutFontSchema as a, LayoutFont as i, AlignmentSchema as n, TextDirection as o, DEFAULT_LAYOUT_FONT as r, TextDirectionSchema as s, Alignment as t };
|
package/dist/style.cjs
CHANGED
|
@@ -7,6 +7,7 @@ const AlignmentSchema = zod.z.enum([
|
|
|
7
7
|
"right",
|
|
8
8
|
"justify"
|
|
9
9
|
]);
|
|
10
|
+
const TextDirectionSchema = zod.z.enum(["ltr", "rtl"]);
|
|
10
11
|
const LayoutFontSchema = zod.z.object({
|
|
11
12
|
family: zod.z.string(),
|
|
12
13
|
weight: zod.z.enum(["normal", "bold"]),
|
|
@@ -21,3 +22,4 @@ const DEFAULT_LAYOUT_FONT = {
|
|
|
21
22
|
exports.AlignmentSchema = AlignmentSchema;
|
|
22
23
|
exports.DEFAULT_LAYOUT_FONT = DEFAULT_LAYOUT_FONT;
|
|
23
24
|
exports.LayoutFontSchema = LayoutFontSchema;
|
|
25
|
+
exports.TextDirectionSchema = TextDirectionSchema;
|
package/dist/style.d.cts
CHANGED
|
@@ -1,24 +1,2 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
declare const AlignmentSchema: z.ZodEnum<{
|
|
4
|
-
left: "left";
|
|
5
|
-
center: "center";
|
|
6
|
-
right: "right";
|
|
7
|
-
justify: "justify";
|
|
8
|
-
}>;
|
|
9
|
-
type Alignment = z.infer<typeof AlignmentSchema>;
|
|
10
|
-
declare const LayoutFontSchema: z.ZodObject<{
|
|
11
|
-
family: z.ZodString;
|
|
12
|
-
weight: z.ZodEnum<{
|
|
13
|
-
bold: "bold";
|
|
14
|
-
normal: "normal";
|
|
15
|
-
}>;
|
|
16
|
-
style: z.ZodEnum<{
|
|
17
|
-
italic: "italic";
|
|
18
|
-
normal: "normal";
|
|
19
|
-
}>;
|
|
20
|
-
}, z.core.$strip>;
|
|
21
|
-
type LayoutFont = z.infer<typeof LayoutFontSchema>;
|
|
22
|
-
declare const DEFAULT_LAYOUT_FONT: LayoutFont;
|
|
23
|
-
//#endregion
|
|
24
|
-
export { Alignment, AlignmentSchema, DEFAULT_LAYOUT_FONT, LayoutFont, LayoutFontSchema };
|
|
1
|
+
import { a as LayoutFontSchema, i as LayoutFont, n as AlignmentSchema, o as TextDirection, r as DEFAULT_LAYOUT_FONT, s as TextDirectionSchema, t as Alignment } from "./style-D06NwxAJ.cjs";
|
|
2
|
+
export { Alignment, AlignmentSchema, DEFAULT_LAYOUT_FONT, LayoutFont, LayoutFontSchema, TextDirection, TextDirectionSchema };
|
package/dist/style.d.ts
CHANGED
|
@@ -1,24 +1,2 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
declare const AlignmentSchema: z.ZodEnum<{
|
|
4
|
-
left: "left";
|
|
5
|
-
center: "center";
|
|
6
|
-
right: "right";
|
|
7
|
-
justify: "justify";
|
|
8
|
-
}>;
|
|
9
|
-
type Alignment = z.infer<typeof AlignmentSchema>;
|
|
10
|
-
declare const LayoutFontSchema: z.ZodObject<{
|
|
11
|
-
family: z.ZodString;
|
|
12
|
-
weight: z.ZodEnum<{
|
|
13
|
-
bold: "bold";
|
|
14
|
-
normal: "normal";
|
|
15
|
-
}>;
|
|
16
|
-
style: z.ZodEnum<{
|
|
17
|
-
italic: "italic";
|
|
18
|
-
normal: "normal";
|
|
19
|
-
}>;
|
|
20
|
-
}, z.core.$strip>;
|
|
21
|
-
type LayoutFont = z.infer<typeof LayoutFontSchema>;
|
|
22
|
-
declare const DEFAULT_LAYOUT_FONT: LayoutFont;
|
|
23
|
-
//#endregion
|
|
24
|
-
export { Alignment, AlignmentSchema, DEFAULT_LAYOUT_FONT, LayoutFont, LayoutFontSchema };
|
|
1
|
+
import { a as LayoutFontSchema, i as LayoutFont, n as AlignmentSchema, o as TextDirection, r as DEFAULT_LAYOUT_FONT, s as TextDirectionSchema, t as Alignment } from "./style-D06NwxAJ.js";
|
|
2
|
+
export { Alignment, AlignmentSchema, DEFAULT_LAYOUT_FONT, LayoutFont, LayoutFontSchema, TextDirection, TextDirectionSchema };
|
package/dist/style.js
CHANGED
|
@@ -6,6 +6,7 @@ const AlignmentSchema = z.enum([
|
|
|
6
6
|
"right",
|
|
7
7
|
"justify"
|
|
8
8
|
]);
|
|
9
|
+
const TextDirectionSchema = z.enum(["ltr", "rtl"]);
|
|
9
10
|
const LayoutFontSchema = z.object({
|
|
10
11
|
family: z.string(),
|
|
11
12
|
weight: z.enum(["normal", "bold"]),
|
|
@@ -17,4 +18,4 @@ const DEFAULT_LAYOUT_FONT = {
|
|
|
17
18
|
style: "normal"
|
|
18
19
|
};
|
|
19
20
|
//#endregion
|
|
20
|
-
export { AlignmentSchema, DEFAULT_LAYOUT_FONT, LayoutFontSchema };
|
|
21
|
+
export { AlignmentSchema, DEFAULT_LAYOUT_FONT, LayoutFontSchema, TextDirectionSchema };
|
package/dist/text-layout.d.cts
CHANGED
package/dist/text-layout.d.ts
CHANGED
package/package.json
CHANGED
|
@@ -1,15 +1,16 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "document-content-model",
|
|
3
|
-
"version": "
|
|
4
|
-
"description": "The canonical, format-agnostic content and document-
|
|
3
|
+
"version": "7.6.0",
|
|
4
|
+
"description": "The canonical, format-agnostic content and document-tree schemas shared by ooxml.js, odf.js, documents.js, pdf-codec, and markdown-codec, plus the structural transform between them -- no format-specific or I/O behaviour.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"repository": {
|
|
7
7
|
"type": "git",
|
|
8
|
-
"url": "git+https://github.com/ExaDev/
|
|
8
|
+
"url": "git+https://github.com/ExaDev/documents.js.git",
|
|
9
|
+
"directory": "packages/document-schema.js"
|
|
9
10
|
},
|
|
10
|
-
"homepage": "https://github.com/ExaDev/document-schema.js
|
|
11
|
+
"homepage": "https://github.com/ExaDev/documents.js/tree/main/packages/document-schema.js",
|
|
11
12
|
"bugs": {
|
|
12
|
-
"url": "https://github.com/ExaDev/
|
|
13
|
+
"url": "https://github.com/ExaDev/documents.js/issues"
|
|
13
14
|
},
|
|
14
15
|
"exports": {
|
|
15
16
|
".": {
|
|
@@ -60,39 +61,35 @@
|
|
|
60
61
|
],
|
|
61
62
|
"license": "MIT",
|
|
62
63
|
"dependencies": {
|
|
63
|
-
"zod": "
|
|
64
|
+
"zod": "4.4.3"
|
|
64
65
|
},
|
|
65
66
|
"devDependencies": {
|
|
66
|
-
"@arethetypeswrong/cli": "
|
|
67
|
-
"@cloudflare/vitest-pool-workers": "
|
|
68
|
-
"@
|
|
69
|
-
"@
|
|
70
|
-
"@
|
|
71
|
-
"@
|
|
72
|
-
"@
|
|
73
|
-
"
|
|
74
|
-
"
|
|
75
|
-
"
|
|
76
|
-
"
|
|
77
|
-
"
|
|
78
|
-
"
|
|
79
|
-
"
|
|
80
|
-
"
|
|
81
|
-
"
|
|
82
|
-
"tsdown": "^0.22.13",
|
|
83
|
-
"turbo": "^2.10.8",
|
|
84
|
-
"typescript": "^6.0.3",
|
|
85
|
-
"typescript-eslint": "^8.65.0",
|
|
86
|
-
"vitest": "^4.1.10"
|
|
67
|
+
"@arethetypeswrong/cli": "0.18.5",
|
|
68
|
+
"@cloudflare/vitest-pool-workers": "0.21.2",
|
|
69
|
+
"@stryker-mutator/core": "10.0.0",
|
|
70
|
+
"@stryker-mutator/typescript-checker": "10.0.0",
|
|
71
|
+
"@stryker-mutator/vitest-runner": "10.0.0",
|
|
72
|
+
"@types/node": "26.2.0",
|
|
73
|
+
"@vitest/coverage-v8": "4.1.11",
|
|
74
|
+
"eslint": "10.8.1",
|
|
75
|
+
"husky": "9.1.7",
|
|
76
|
+
"jiti": "2.7.0",
|
|
77
|
+
"publint": "0.3.22",
|
|
78
|
+
"semantic-release": "25.0.9",
|
|
79
|
+
"tsdown": "0.22.14",
|
|
80
|
+
"turbo": "2.10.8",
|
|
81
|
+
"typescript": "6.0.3",
|
|
82
|
+
"vitest": "4.1.11"
|
|
87
83
|
},
|
|
88
84
|
"scripts": {
|
|
89
85
|
"build": "turbo run _build",
|
|
90
86
|
"_build": "tsdown && node scripts/generate-json-schemas.mjs",
|
|
91
87
|
"lint": "turbo run _lint",
|
|
92
88
|
"_lint": "eslint . --fix --cache --max-warnings 0",
|
|
93
|
-
"typecheck": "turbo run _typecheck _typecheck:node",
|
|
89
|
+
"typecheck": "turbo run _typecheck _typecheck:node _typecheck:attw",
|
|
94
90
|
"_typecheck": "tsc -p tsconfig.json",
|
|
95
91
|
"_typecheck:node": "tsc -p tsconfig.node.json",
|
|
92
|
+
"_typecheck:attw": "attw --pack",
|
|
96
93
|
"test": "turbo run _test",
|
|
97
94
|
"_test": "vitest run --project unit",
|
|
98
95
|
"test:workers": "turbo run _test:workers",
|
|
@@ -100,8 +97,10 @@
|
|
|
100
97
|
"test:watch": "vitest --project unit",
|
|
101
98
|
"test:coverage": "turbo run _test:coverage",
|
|
102
99
|
"_test:coverage": "vitest run --project unit --coverage",
|
|
100
|
+
"test:mutation": "turbo run _test:mutation",
|
|
101
|
+
"_test:mutation": "stryker run stryker.config.mjs",
|
|
103
102
|
"test:smoke": "turbo run _test:smoke",
|
|
104
|
-
"_test:smoke": "
|
|
103
|
+
"_test:smoke": "vitest run --project smoke",
|
|
105
104
|
"release": "semantic-release"
|
|
106
105
|
}
|
|
107
106
|
}
|