document-content-model 1.5.2 → 1.5.3
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 +2 -2
- package/dist/index.d.cts +12 -12
- package/dist/index.d.ts +12 -12
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -10,7 +10,7 @@ Both `ooxml.js` and `documents.js` independently arrived at the same content voc
|
|
|
10
10
|
|
|
11
11
|
It contains only [Zod](https://zod.dev) schemas, their inferred types, and a handful of trivial schema-attached helpers (hex-colour conversion, a recursive structural type guard for the mutually-recursive table/block/embedded-object types). There is no XML, ZIP, PDF, or other binary handling here, and no `zod` dependency other than `zod` itself.
|
|
12
12
|
|
|
13
|
-
The GitHub repository is [`ExaDev/document-schema.js`](https://github.com/ExaDev/document-schema.js), matching the published npm package name
|
|
13
|
+
The GitHub repository is [`ExaDev/document-schema.js`](https://github.com/ExaDev/document-schema.js), matching the published npm package name.
|
|
14
14
|
|
|
15
15
|
## Usage
|
|
16
16
|
|
|
@@ -29,7 +29,7 @@ const pkg = DocumentPackageSchema.parse({ formatVersion: 1, content, layout });
|
|
|
29
29
|
- [documents.js](https://github.com/ExaDev/documents.js) — the primary consumer of both `ContentDocument` and `LayoutDocument`, which it converts between via its layout engines and its `pdf-codec` dependency, and of `DocumentPackage` as the `onDocument` side-channel value its conversion functions hand back.
|
|
30
30
|
- [pdf-codec](https://github.com/ExaDev/pdf-codec) — the hand-written PDF codec extracted from `documents.js`: `readPdf`/`writePdf` and its own `pdfCodec` z.codec() pair operate entirely in terms of this package's `LayoutDocument` (plus the item kinds it's built from -- `LayoutItem`/`LayoutText`/`LayoutImage`/`LayoutRect`/`LayoutEllipse`/`LayoutLink`/`LayoutPath`/`LayoutSubpath`/`LayoutPathSegment`/`LayoutPage`/`LayoutImageAsset`/`LayoutMetadata`), `Color`/`LayoutFont` (aliased `LayoutColor`/`LayoutFont` at its own call sites), and `LAYOUT_FORMAT_VERSION`/`COLOR_BLACK`/`LayoutDocumentSchema` -- it never redeclares any of these itself, unlike its own `MathBox`/`PositionedFormula` mirror of `documents.js`'s MathML types (a deliberate, narrower exception -- see pdf-codec's own README).
|
|
31
31
|
|
|
32
|
-
None of these four packages depend on each other for this vocabulary — each depends on `document-schema.js`
|
|
32
|
+
None of these four packages depend on each other for this vocabulary — each depends on `document-schema.js` directly, which is the whole point: one schema, not four independently-maintained, drift-prone copies.
|
|
33
33
|
|
|
34
34
|
## License
|
|
35
35
|
|
package/dist/index.d.cts
CHANGED
|
@@ -46,12 +46,12 @@ type Alignment = z.infer<typeof AlignmentSchema>;
|
|
|
46
46
|
declare const LayoutFontSchema: z.ZodObject<{
|
|
47
47
|
family: z.ZodString;
|
|
48
48
|
weight: z.ZodEnum<{
|
|
49
|
-
bold: "bold";
|
|
50
49
|
normal: "normal";
|
|
50
|
+
bold: "bold";
|
|
51
51
|
}>;
|
|
52
52
|
style: z.ZodEnum<{
|
|
53
|
-
italic: "italic";
|
|
54
53
|
normal: "normal";
|
|
54
|
+
italic: "italic";
|
|
55
55
|
}>;
|
|
56
56
|
}, z.core.$strip>;
|
|
57
57
|
type LayoutFont = z.infer<typeof LayoutFontSchema>;
|
|
@@ -1264,12 +1264,12 @@ declare const LayoutTextSchema: z.ZodObject<{
|
|
|
1264
1264
|
font: z.ZodObject<{
|
|
1265
1265
|
family: z.ZodString;
|
|
1266
1266
|
weight: z.ZodEnum<{
|
|
1267
|
-
bold: "bold";
|
|
1268
1267
|
normal: "normal";
|
|
1268
|
+
bold: "bold";
|
|
1269
1269
|
}>;
|
|
1270
1270
|
style: z.ZodEnum<{
|
|
1271
|
-
italic: "italic";
|
|
1272
1271
|
normal: "normal";
|
|
1272
|
+
italic: "italic";
|
|
1273
1273
|
}>;
|
|
1274
1274
|
}, z.core.$strip>;
|
|
1275
1275
|
sizePt: z.ZodNumber;
|
|
@@ -1445,12 +1445,12 @@ declare const LayoutItemSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
1445
1445
|
font: z.ZodObject<{
|
|
1446
1446
|
family: z.ZodString;
|
|
1447
1447
|
weight: z.ZodEnum<{
|
|
1448
|
-
bold: "bold";
|
|
1449
1448
|
normal: "normal";
|
|
1449
|
+
bold: "bold";
|
|
1450
1450
|
}>;
|
|
1451
1451
|
style: z.ZodEnum<{
|
|
1452
|
-
italic: "italic";
|
|
1453
1452
|
normal: "normal";
|
|
1453
|
+
italic: "italic";
|
|
1454
1454
|
}>;
|
|
1455
1455
|
}, z.core.$strip>;
|
|
1456
1456
|
sizePt: z.ZodNumber;
|
|
@@ -1584,12 +1584,12 @@ declare const LayoutPageSchema: z.ZodObject<{
|
|
|
1584
1584
|
font: z.ZodObject<{
|
|
1585
1585
|
family: z.ZodString;
|
|
1586
1586
|
weight: z.ZodEnum<{
|
|
1587
|
-
bold: "bold";
|
|
1588
1587
|
normal: "normal";
|
|
1588
|
+
bold: "bold";
|
|
1589
1589
|
}>;
|
|
1590
1590
|
style: z.ZodEnum<{
|
|
1591
|
-
italic: "italic";
|
|
1592
1591
|
normal: "normal";
|
|
1592
|
+
italic: "italic";
|
|
1593
1593
|
}>;
|
|
1594
1594
|
}, z.core.$strip>;
|
|
1595
1595
|
sizePt: z.ZodNumber;
|
|
@@ -1747,12 +1747,12 @@ declare const LayoutDocumentSchema: z.ZodObject<{
|
|
|
1747
1747
|
font: z.ZodObject<{
|
|
1748
1748
|
family: z.ZodString;
|
|
1749
1749
|
weight: z.ZodEnum<{
|
|
1750
|
-
bold: "bold";
|
|
1751
1750
|
normal: "normal";
|
|
1751
|
+
bold: "bold";
|
|
1752
1752
|
}>;
|
|
1753
1753
|
style: z.ZodEnum<{
|
|
1754
|
-
italic: "italic";
|
|
1755
1754
|
normal: "normal";
|
|
1755
|
+
italic: "italic";
|
|
1756
1756
|
}>;
|
|
1757
1757
|
}, z.core.$strip>;
|
|
1758
1758
|
sizePt: z.ZodNumber;
|
|
@@ -2271,12 +2271,12 @@ declare const DocumentPackageSchema: z.ZodObject<{
|
|
|
2271
2271
|
font: z.ZodObject<{
|
|
2272
2272
|
family: z.ZodString;
|
|
2273
2273
|
weight: z.ZodEnum<{
|
|
2274
|
-
bold: "bold";
|
|
2275
2274
|
normal: "normal";
|
|
2275
|
+
bold: "bold";
|
|
2276
2276
|
}>;
|
|
2277
2277
|
style: z.ZodEnum<{
|
|
2278
|
-
italic: "italic";
|
|
2279
2278
|
normal: "normal";
|
|
2279
|
+
italic: "italic";
|
|
2280
2280
|
}>;
|
|
2281
2281
|
}, z.core.$strip>;
|
|
2282
2282
|
sizePt: z.ZodNumber;
|
package/dist/index.d.ts
CHANGED
|
@@ -46,12 +46,12 @@ type Alignment = z.infer<typeof AlignmentSchema>;
|
|
|
46
46
|
declare const LayoutFontSchema: z.ZodObject<{
|
|
47
47
|
family: z.ZodString;
|
|
48
48
|
weight: z.ZodEnum<{
|
|
49
|
-
bold: "bold";
|
|
50
49
|
normal: "normal";
|
|
50
|
+
bold: "bold";
|
|
51
51
|
}>;
|
|
52
52
|
style: z.ZodEnum<{
|
|
53
|
-
italic: "italic";
|
|
54
53
|
normal: "normal";
|
|
54
|
+
italic: "italic";
|
|
55
55
|
}>;
|
|
56
56
|
}, z.core.$strip>;
|
|
57
57
|
type LayoutFont = z.infer<typeof LayoutFontSchema>;
|
|
@@ -1264,12 +1264,12 @@ declare const LayoutTextSchema: z.ZodObject<{
|
|
|
1264
1264
|
font: z.ZodObject<{
|
|
1265
1265
|
family: z.ZodString;
|
|
1266
1266
|
weight: z.ZodEnum<{
|
|
1267
|
-
bold: "bold";
|
|
1268
1267
|
normal: "normal";
|
|
1268
|
+
bold: "bold";
|
|
1269
1269
|
}>;
|
|
1270
1270
|
style: z.ZodEnum<{
|
|
1271
|
-
italic: "italic";
|
|
1272
1271
|
normal: "normal";
|
|
1272
|
+
italic: "italic";
|
|
1273
1273
|
}>;
|
|
1274
1274
|
}, z.core.$strip>;
|
|
1275
1275
|
sizePt: z.ZodNumber;
|
|
@@ -1445,12 +1445,12 @@ declare const LayoutItemSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
1445
1445
|
font: z.ZodObject<{
|
|
1446
1446
|
family: z.ZodString;
|
|
1447
1447
|
weight: z.ZodEnum<{
|
|
1448
|
-
bold: "bold";
|
|
1449
1448
|
normal: "normal";
|
|
1449
|
+
bold: "bold";
|
|
1450
1450
|
}>;
|
|
1451
1451
|
style: z.ZodEnum<{
|
|
1452
|
-
italic: "italic";
|
|
1453
1452
|
normal: "normal";
|
|
1453
|
+
italic: "italic";
|
|
1454
1454
|
}>;
|
|
1455
1455
|
}, z.core.$strip>;
|
|
1456
1456
|
sizePt: z.ZodNumber;
|
|
@@ -1584,12 +1584,12 @@ declare const LayoutPageSchema: z.ZodObject<{
|
|
|
1584
1584
|
font: z.ZodObject<{
|
|
1585
1585
|
family: z.ZodString;
|
|
1586
1586
|
weight: z.ZodEnum<{
|
|
1587
|
-
bold: "bold";
|
|
1588
1587
|
normal: "normal";
|
|
1588
|
+
bold: "bold";
|
|
1589
1589
|
}>;
|
|
1590
1590
|
style: z.ZodEnum<{
|
|
1591
|
-
italic: "italic";
|
|
1592
1591
|
normal: "normal";
|
|
1592
|
+
italic: "italic";
|
|
1593
1593
|
}>;
|
|
1594
1594
|
}, z.core.$strip>;
|
|
1595
1595
|
sizePt: z.ZodNumber;
|
|
@@ -1747,12 +1747,12 @@ declare const LayoutDocumentSchema: z.ZodObject<{
|
|
|
1747
1747
|
font: z.ZodObject<{
|
|
1748
1748
|
family: z.ZodString;
|
|
1749
1749
|
weight: z.ZodEnum<{
|
|
1750
|
-
bold: "bold";
|
|
1751
1750
|
normal: "normal";
|
|
1751
|
+
bold: "bold";
|
|
1752
1752
|
}>;
|
|
1753
1753
|
style: z.ZodEnum<{
|
|
1754
|
-
italic: "italic";
|
|
1755
1754
|
normal: "normal";
|
|
1755
|
+
italic: "italic";
|
|
1756
1756
|
}>;
|
|
1757
1757
|
}, z.core.$strip>;
|
|
1758
1758
|
sizePt: z.ZodNumber;
|
|
@@ -2271,12 +2271,12 @@ declare const DocumentPackageSchema: z.ZodObject<{
|
|
|
2271
2271
|
font: z.ZodObject<{
|
|
2272
2272
|
family: z.ZodString;
|
|
2273
2273
|
weight: z.ZodEnum<{
|
|
2274
|
-
bold: "bold";
|
|
2275
2274
|
normal: "normal";
|
|
2275
|
+
bold: "bold";
|
|
2276
2276
|
}>;
|
|
2277
2277
|
style: z.ZodEnum<{
|
|
2278
|
-
italic: "italic";
|
|
2279
2278
|
normal: "normal";
|
|
2279
|
+
italic: "italic";
|
|
2280
2280
|
}>;
|
|
2281
2281
|
}, z.core.$strip>;
|
|
2282
2282
|
sizePt: z.ZodNumber;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "document-content-model",
|
|
3
|
-
"version": "1.5.
|
|
3
|
+
"version": "1.5.3",
|
|
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": {
|