document-content-model 4.2.0 → 4.3.1
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 +30 -4
- package/dist/canonicalise.cjs +20 -0
- package/dist/canonicalise.d.cts +5 -0
- package/dist/canonicalise.d.ts +5 -0
- package/dist/canonicalise.js +18 -0
- package/dist/codec.d.cts +1 -1
- package/dist/codec.d.ts +1 -1
- package/dist/{construct-ETSlnMle.d.cts → construct-CdQuI9f5.d.cts} +3 -3
- package/dist/{construct-ETSlnMle.d.ts → construct-CdQuI9f5.d.ts} +3 -3
- package/dist/construct.d.cts +1 -1
- package/dist/construct.d.ts +1 -1
- package/dist/{content-BLwxI5ba.d.cts → content-BmqzegMG.d.cts} +8 -8
- package/dist/{content-BdzcBsxm.d.ts → content-CIwPb_yh.d.ts} +8 -8
- package/dist/content.d.cts +1 -1
- package/dist/content.d.ts +1 -1
- package/dist/decompose.cjs +186 -0
- package/dist/decompose.d.cts +18 -0
- package/dist/decompose.d.ts +18 -0
- package/dist/decompose.js +177 -0
- package/dist/definitions.d.cts +1 -1
- package/dist/definitions.d.ts +1 -1
- package/dist/factor-styles.cjs +435 -0
- package/dist/factor-styles.d.cts +9 -0
- package/dist/factor-styles.d.ts +9 -0
- package/dist/factor-styles.js +432 -0
- package/dist/flatten.cjs +154 -0
- package/dist/flatten.d.cts +6 -0
- package/dist/flatten.d.ts +6 -0
- package/dist/flatten.js +153 -0
- package/dist/index.cjs +8 -0
- package/dist/index.d.cts +9 -6
- package/dist/index.d.ts +9 -6
- package/dist/index.js +4 -1
- package/dist/{math-BlG8Tjk-.d.cts → math-B7gZJeND.d.cts} +3 -3
- package/dist/{math-BlG8Tjk-.d.ts → math-B7gZJeND.d.ts} +3 -3
- package/dist/math.d.cts +1 -1
- package/dist/math.d.ts +1 -1
- package/dist/{package-node-CmNXOetG.d.ts → package-node-C7RiYhyk.d.ts} +7 -7
- package/dist/{package-node-CtvgL_ON.d.cts → package-node-a9CyRaD3.d.cts} +7 -7
- package/dist/package-node.d.cts +1 -1
- package/dist/package-node.d.ts +1 -1
- package/dist/package.d.cts +7 -7
- package/dist/package.d.ts +7 -7
- package/dist/schema-io.cjs +2 -2
- package/dist/schema-io.d.cts +1 -1
- package/dist/schema-io.d.ts +1 -1
- package/dist/schema-io.js +2 -2
- package/package.json +3 -3
- package/schemas/content-document.schema.json +3 -3
- package/schemas/document-package.schema.json +3 -3
package/dist/package.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { d as MathMlNode } from "./mathml-B1oTCtzc.js";
|
|
2
|
-
import { s as MathExpression } from "./math-
|
|
3
|
-
import { B as SheetGroupNode, O as SectionGroupNode, W as SlideGroupNode, i as DrawPageGroupNode } from "./package-node-
|
|
2
|
+
import { s as MathExpression } from "./math-B7gZJeND.js";
|
|
3
|
+
import { B as SheetGroupNode, O as SectionGroupNode, W as SlideGroupNode, i as DrawPageGroupNode } from "./package-node-C7RiYhyk.js";
|
|
4
4
|
import { z } from "zod";
|
|
5
5
|
//#region src/package.d.ts
|
|
6
6
|
declare const DocumentPackageSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
@@ -67,9 +67,9 @@ declare const DocumentPackageSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
67
67
|
symbol: z.ZodString;
|
|
68
68
|
name: z.ZodOptional<z.ZodString>;
|
|
69
69
|
dimension: z.ZodRecord<z.ZodEnum<{
|
|
70
|
+
time: "time";
|
|
70
71
|
length: "length";
|
|
71
72
|
mass: "mass";
|
|
72
|
-
time: "time";
|
|
73
73
|
electricCurrent: "electricCurrent";
|
|
74
74
|
thermodynamicTemperature: "thermodynamicTemperature";
|
|
75
75
|
amountOfSubstance: "amountOfSubstance";
|
|
@@ -171,9 +171,9 @@ declare const DocumentPackageSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
171
171
|
symbol: z.ZodString;
|
|
172
172
|
name: z.ZodOptional<z.ZodString>;
|
|
173
173
|
dimension: z.ZodRecord<z.ZodEnum<{
|
|
174
|
+
time: "time";
|
|
174
175
|
length: "length";
|
|
175
176
|
mass: "mass";
|
|
176
|
-
time: "time";
|
|
177
177
|
electricCurrent: "electricCurrent";
|
|
178
178
|
thermodynamicTemperature: "thermodynamicTemperature";
|
|
179
179
|
amountOfSubstance: "amountOfSubstance";
|
|
@@ -275,9 +275,9 @@ declare const DocumentPackageSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
275
275
|
symbol: z.ZodString;
|
|
276
276
|
name: z.ZodOptional<z.ZodString>;
|
|
277
277
|
dimension: z.ZodRecord<z.ZodEnum<{
|
|
278
|
+
time: "time";
|
|
278
279
|
length: "length";
|
|
279
280
|
mass: "mass";
|
|
280
|
-
time: "time";
|
|
281
281
|
electricCurrent: "electricCurrent";
|
|
282
282
|
thermodynamicTemperature: "thermodynamicTemperature";
|
|
283
283
|
amountOfSubstance: "amountOfSubstance";
|
|
@@ -379,9 +379,9 @@ declare const DocumentPackageSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
379
379
|
symbol: z.ZodString;
|
|
380
380
|
name: z.ZodOptional<z.ZodString>;
|
|
381
381
|
dimension: z.ZodRecord<z.ZodEnum<{
|
|
382
|
+
time: "time";
|
|
382
383
|
length: "length";
|
|
383
384
|
mass: "mass";
|
|
384
|
-
time: "time";
|
|
385
385
|
electricCurrent: "electricCurrent";
|
|
386
386
|
thermodynamicTemperature: "thermodynamicTemperature";
|
|
387
387
|
amountOfSubstance: "amountOfSubstance";
|
|
@@ -495,9 +495,9 @@ declare const DocumentPackageSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
495
495
|
symbol: z.ZodString;
|
|
496
496
|
name: z.ZodOptional<z.ZodString>;
|
|
497
497
|
dimension: z.ZodRecord<z.ZodEnum<{
|
|
498
|
+
time: "time";
|
|
498
499
|
length: "length";
|
|
499
500
|
mass: "mass";
|
|
500
|
-
time: "time";
|
|
501
501
|
electricCurrent: "electricCurrent";
|
|
502
502
|
thermodynamicTemperature: "thermodynamicTemperature";
|
|
503
503
|
amountOfSubstance: "amountOfSubstance";
|
package/dist/schema-io.cjs
CHANGED
|
@@ -7,7 +7,7 @@ const SCHEMA_FILE_NAMES = {
|
|
|
7
7
|
ContentDocument: "content-document.schema.json"
|
|
8
8
|
};
|
|
9
9
|
function schemaUriFor(kind) {
|
|
10
|
-
return `https://cdn.jsdelivr.net/npm/document-schema.js@4.
|
|
10
|
+
return `https://cdn.jsdelivr.net/npm/document-schema.js@4.3.1/schemas/${SCHEMA_FILE_NAMES[kind]}`;
|
|
11
11
|
}
|
|
12
12
|
const SCHEMA_URI_PATTERN = /^https:\/\/cdn\.jsdelivr\.net\/npm\/document-schema\.js@([^/]+)\/schemas\/(document-package|content-document|layout-document)\.schema\.json$/;
|
|
13
13
|
function parseSchemaUri(uri) {
|
|
@@ -93,7 +93,7 @@ function documentFromJson(value) {
|
|
|
93
93
|
if (parts.stem === "layout-document") throw new LayoutSchemaDemotedError(value.$schema);
|
|
94
94
|
const kind = kindForFileStem(parts.stem);
|
|
95
95
|
if (kind === void 0) throw new UnrecognizedDocumentSchemaError(value.$schema);
|
|
96
|
-
if (majorVersionOf(parts.version) !== majorVersionOf("4.
|
|
96
|
+
if (majorVersionOf(parts.version) !== majorVersionOf("4.3.1")) throw new SchemaVersionMismatchError(value.$schema, parts.version, "4.3.1");
|
|
97
97
|
switch (kind) {
|
|
98
98
|
case "DocumentPackage": return {
|
|
99
99
|
kind,
|
package/dist/schema-io.d.cts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { m as ContentDocument } from "./content-
|
|
1
|
+
import { m as ContentDocument } from "./content-BmqzegMG.cjs";
|
|
2
2
|
import { DocumentPackage } from "./package.cjs";
|
|
3
3
|
//#region src/schema-io.d.ts
|
|
4
4
|
type DocumentSchemaKind = 'DocumentPackage' | 'ContentDocument';
|
package/dist/schema-io.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { m as ContentDocument } from "./content-
|
|
1
|
+
import { m as ContentDocument } from "./content-CIwPb_yh.js";
|
|
2
2
|
import { DocumentPackage } from "./package.js";
|
|
3
3
|
//#region src/schema-io.d.ts
|
|
4
4
|
type DocumentSchemaKind = 'DocumentPackage' | 'ContentDocument';
|
package/dist/schema-io.js
CHANGED
|
@@ -6,7 +6,7 @@ const SCHEMA_FILE_NAMES = {
|
|
|
6
6
|
ContentDocument: "content-document.schema.json"
|
|
7
7
|
};
|
|
8
8
|
function schemaUriFor(kind) {
|
|
9
|
-
return `https://cdn.jsdelivr.net/npm/document-schema.js@4.
|
|
9
|
+
return `https://cdn.jsdelivr.net/npm/document-schema.js@4.3.1/schemas/${SCHEMA_FILE_NAMES[kind]}`;
|
|
10
10
|
}
|
|
11
11
|
const SCHEMA_URI_PATTERN = /^https:\/\/cdn\.jsdelivr\.net\/npm\/document-schema\.js@([^/]+)\/schemas\/(document-package|content-document|layout-document)\.schema\.json$/;
|
|
12
12
|
function parseSchemaUri(uri) {
|
|
@@ -92,7 +92,7 @@ function documentFromJson(value) {
|
|
|
92
92
|
if (parts.stem === "layout-document") throw new LayoutSchemaDemotedError(value.$schema);
|
|
93
93
|
const kind = kindForFileStem(parts.stem);
|
|
94
94
|
if (kind === void 0) throw new UnrecognizedDocumentSchemaError(value.$schema);
|
|
95
|
-
if (majorVersionOf(parts.version) !== majorVersionOf("4.
|
|
95
|
+
if (majorVersionOf(parts.version) !== majorVersionOf("4.3.1")) throw new SchemaVersionMismatchError(value.$schema, parts.version, "4.3.1");
|
|
96
96
|
switch (kind) {
|
|
97
97
|
case "DocumentPackage": return {
|
|
98
98
|
kind,
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "document-content-model",
|
|
3
|
-
"version": "4.
|
|
4
|
-
"description": "The canonical, format-agnostic content and document-package schemas shared by ooxml.js, odf.js, documents.js, pdf-codec, and markdown-codec
|
|
3
|
+
"version": "4.3.1",
|
|
4
|
+
"description": "The canonical, format-agnostic content and document-package 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",
|
|
@@ -64,7 +64,7 @@
|
|
|
64
64
|
},
|
|
65
65
|
"devDependencies": {
|
|
66
66
|
"@arethetypeswrong/cli": "^0.18.5",
|
|
67
|
-
"@cloudflare/vitest-pool-workers": "^0.
|
|
67
|
+
"@cloudflare/vitest-pool-workers": "^0.21.2",
|
|
68
68
|
"@commitlint/cli": "^21.2.1",
|
|
69
69
|
"@commitlint/config-conventional": "^21.2.0",
|
|
70
70
|
"@eslint/js": "^10.0.1",
|
|
@@ -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@4.
|
|
3
|
+
"$id": "https://cdn.jsdelivr.net/npm/document-schema.js@4.3.1/schemas/content-document.schema.json",
|
|
4
4
|
"oneOf": [
|
|
5
5
|
{
|
|
6
6
|
"type": "object",
|
|
@@ -2857,7 +2857,7 @@
|
|
|
2857
2857
|
]
|
|
2858
2858
|
},
|
|
2859
2859
|
"document": {
|
|
2860
|
-
"$ref": "https://cdn.jsdelivr.net/npm/document-schema.js@4.
|
|
2860
|
+
"$ref": "https://cdn.jsdelivr.net/npm/document-schema.js@4.3.1/schemas/content-document.schema.json"
|
|
2861
2861
|
},
|
|
2862
2862
|
"frame": {
|
|
2863
2863
|
"$ref": "#/$defs/Box"
|
|
@@ -4132,7 +4132,7 @@
|
|
|
4132
4132
|
]
|
|
4133
4133
|
},
|
|
4134
4134
|
"document": {
|
|
4135
|
-
"$ref": "https://cdn.jsdelivr.net/npm/document-schema.js@4.
|
|
4135
|
+
"$ref": "https://cdn.jsdelivr.net/npm/document-schema.js@4.3.1/schemas/content-document.schema.json"
|
|
4136
4136
|
},
|
|
4137
4137
|
"frame": {
|
|
4138
4138
|
"$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@4.
|
|
3
|
+
"$id": "https://cdn.jsdelivr.net/npm/document-schema.js@4.3.1/schemas/document-package.schema.json",
|
|
4
4
|
"oneOf": [
|
|
5
5
|
{
|
|
6
6
|
"type": "object",
|
|
@@ -1066,7 +1066,7 @@
|
|
|
1066
1066
|
]
|
|
1067
1067
|
},
|
|
1068
1068
|
"document": {
|
|
1069
|
-
"$ref": "https://cdn.jsdelivr.net/npm/document-schema.js@4.
|
|
1069
|
+
"$ref": "https://cdn.jsdelivr.net/npm/document-schema.js@4.3.1/schemas/content-document.schema.json"
|
|
1070
1070
|
},
|
|
1071
1071
|
"frame": {
|
|
1072
1072
|
"$ref": "#/$defs/Box"
|
|
@@ -2341,7 +2341,7 @@
|
|
|
2341
2341
|
]
|
|
2342
2342
|
},
|
|
2343
2343
|
"document": {
|
|
2344
|
-
"$ref": "https://cdn.jsdelivr.net/npm/document-schema.js@4.
|
|
2344
|
+
"$ref": "https://cdn.jsdelivr.net/npm/document-schema.js@4.3.1/schemas/content-document.schema.json"
|
|
2345
2345
|
},
|
|
2346
2346
|
"frame": {
|
|
2347
2347
|
"$ref": "#/$defs/Box"
|