document-content-model 7.13.0 → 7.14.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 +3 -3
- package/dist/codec.d.cts +1 -1
- package/dist/codec.d.ts +1 -1
- package/dist/{content-GHj_31uQ.d.ts → content-Cj_IC0ge.d.ts} +127 -124
- package/dist/{content-zNNPbwYY.d.cts → content-DZDor2Ct.d.cts} +127 -124
- package/dist/content-json-schema-defs.cjs +2 -1
- package/dist/content-json-schema-defs.js +2 -1
- package/dist/content.cjs +3 -2
- package/dist/content.d.cts +1 -1
- package/dist/content.d.ts +1 -1
- package/dist/content.js +3 -2
- package/dist/decompose.d.cts +2 -2
- package/dist/decompose.d.ts +2 -2
- package/dist/definitions.d.cts +4 -4
- package/dist/definitions.d.ts +4 -4
- package/dist/factor-styles.d.cts +1 -1
- package/dist/factor-styles.d.ts +1 -1
- package/dist/flatten.d.cts +1 -1
- package/dist/flatten.d.ts +1 -1
- package/dist/index.d.cts +3 -3
- package/dist/index.d.ts +3 -3
- package/dist/{package-node-DaPwHzsg.d.cts → package-node-DBtKtaqn.d.cts} +39 -39
- package/dist/{package-node-CIZQ2_C1.d.ts → package-node-SBZNVEGu.d.ts} +39 -39
- 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/dist/{style-BGMcYrD2.d.cts → style-D06NwxAJ.d.cts} +1 -1
- package/dist/{style-BGMcYrD2.d.ts → style-D06NwxAJ.d.ts} +1 -1
- package/dist/style.d.cts +1 -1
- package/dist/style.d.ts +1 -1
- package/dist/table-grid.cjs +1 -1
- package/dist/table-grid.d.cts +5 -3
- package/dist/table-grid.d.ts +5 -3
- package/dist/table-grid.js +1 -1
- package/dist/text-layout.d.cts +1 -1
- package/dist/text-layout.d.ts +1 -1
- package/package.json +2 -2
- package/schemas/content-document.schema.json +19 -16
- package/schemas/document-tree.schema.json +6 -3
package/README.md
CHANGED
|
@@ -61,7 +61,7 @@ Two format-agnostic helpers live here because they operate on the content model
|
|
|
61
61
|
```ts
|
|
62
62
|
import { ContentDocumentSchema, DocumentTreeSchema } from "document-schema.js";
|
|
63
63
|
|
|
64
|
-
// The codec-exchange form: what every format's reader produces and every writer consumes
|
|
64
|
+
// The codec-exchange form: what every format's reader produces and every writer consumes — always flat,
|
|
65
65
|
// always fully materialised (no styles table, no refs), never versioned (that lives on the serialised artefact).
|
|
66
66
|
const content = ContentDocumentSchema.parse(
|
|
67
67
|
someWordprocessingOrPresentationValue,
|
|
@@ -133,7 +133,7 @@ import {
|
|
|
133
133
|
} from "document-schema.js";
|
|
134
134
|
|
|
135
135
|
// The one call a construction site makes: decompose the flat content into the tree, splice the envelope
|
|
136
|
-
// onto the root, and mint a styles table over the result. `pages` is optional
|
|
136
|
+
// onto the root, and mint a styles table over the result. `pages` is optional — pass it once a layout
|
|
137
137
|
// pass has produced each rendered page's own size.
|
|
138
138
|
const pkg = assembleTree(content, pages);
|
|
139
139
|
|
|
@@ -397,7 +397,7 @@ import { ColorSchema } from "document-schema.js/color";
|
|
|
397
397
|
```ts
|
|
398
398
|
import type { ContentCodec } from "document-schema.js";
|
|
399
399
|
|
|
400
|
-
declare const docxCodec: ContentCodec; // read(bytes) -> ContentDocument; write(content) -> bytes
|
|
400
|
+
declare const docxCodec: ContentCodec; // read(bytes) -> ContentDocument; write(content) -> bytes — write is optional
|
|
401
401
|
```
|
|
402
402
|
|
|
403
403
|
`ContentCodec.write` is optional (`odf` has a reader but no builder — recovering MathML from glyphs is OCR-adjacent), and the interface is generic over its own `TOptions`. There is no `LayoutCodec` any more: it modelled the one format that produces layout cheaply on read — PDF — and the whole `LayoutDocument` family it described moved to pdf-codec in 4.0.0 (see [pdf-codec#65](https://github.com/ExaDev/pdf-codec/issues/65)).
|
package/dist/codec.d.cts
CHANGED
package/dist/codec.d.ts
CHANGED