rtf-codec 4.1.4 → 4.2.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 +1 -1
- package/dist/codec.d.cts +10 -0
- package/dist/codec.d.ts +10 -0
- package/package.json +6 -4
package/README.md
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
> A hand-written, dependency-minimal Rich Text Format codec: reads RTF into the shared [document-schema.js](../document-schema.js/README.md) content pivot, and writes deterministic, 7-bit-ASCII RTF back out. Built against Microsoft's own [RTF Specification, version 1.9.1](#the-specification) and [Zod 4](https://zod.dev), with no third-party RTF library.
|
|
6
6
|
|
|
7
|
-
**Status: under active development.** The read and write paths described below are implemented and tested,
|
|
7
|
+
**Status: under active development.** The read and write paths described below are implemented and tested, including against a real-producer corpus: `pnpm test:corpus` runs the gitignored `test/corpus/` suite against LibreOffice-produced RTF (flat-ODT sources spanning runs, colour, headings, lists, tables, and alignment, converted through Writer's own RTF filter by `scripts/generate-corpus.mjs`) -- the corpus validated the reader cleanly across all eight fixtures with no defects found. [Scope](#scope) states exactly what is handled and what is not; nothing in this README describes work that is planned rather than done.
|
|
8
8
|
|
|
9
9
|
Every construct that remains unhandled is either a gap in `document-schema.js` rather than in this codec (superscript/subscript and text direction have no field to land in), or something RTF itself does not specify at all beyond its own form-field vocabulary (a docx-style rich-text SDT has no RTF spelling of any kind) — see [Deliberately not handled](#deliberately-not-handled), which says which of the two each row is.
|
|
10
10
|
|
package/dist/codec.d.cts
CHANGED
|
@@ -798,6 +798,16 @@ declare const rtfContentCodec: z.ZodCodec<z.ZodCustom<Uint8Array<ArrayBuffer>, U
|
|
|
798
798
|
evenPage: "evenPage";
|
|
799
799
|
oddPage: "oddPage";
|
|
800
800
|
}>>;
|
|
801
|
+
headers: z.ZodOptional<z.ZodObject<{
|
|
802
|
+
default: z.ZodOptional<z.ZodLazy<z.ZodArray<z.ZodType<import("document-schema.js").ContentBlock, import("document-schema.js").ContentBlock, z.core.$ZodTypeInternals<import("document-schema.js").ContentBlock, import("document-schema.js").ContentBlock>>>>>;
|
|
803
|
+
even: z.ZodOptional<z.ZodLazy<z.ZodArray<z.ZodType<import("document-schema.js").ContentBlock, import("document-schema.js").ContentBlock, z.core.$ZodTypeInternals<import("document-schema.js").ContentBlock, import("document-schema.js").ContentBlock>>>>>;
|
|
804
|
+
first: z.ZodOptional<z.ZodLazy<z.ZodArray<z.ZodType<import("document-schema.js").ContentBlock, import("document-schema.js").ContentBlock, z.core.$ZodTypeInternals<import("document-schema.js").ContentBlock, import("document-schema.js").ContentBlock>>>>>;
|
|
805
|
+
}, z.core.$strip>>;
|
|
806
|
+
footers: z.ZodOptional<z.ZodObject<{
|
|
807
|
+
default: z.ZodOptional<z.ZodLazy<z.ZodArray<z.ZodType<import("document-schema.js").ContentBlock, import("document-schema.js").ContentBlock, z.core.$ZodTypeInternals<import("document-schema.js").ContentBlock, import("document-schema.js").ContentBlock>>>>>;
|
|
808
|
+
even: z.ZodOptional<z.ZodLazy<z.ZodArray<z.ZodType<import("document-schema.js").ContentBlock, import("document-schema.js").ContentBlock, z.core.$ZodTypeInternals<import("document-schema.js").ContentBlock, import("document-schema.js").ContentBlock>>>>>;
|
|
809
|
+
first: z.ZodOptional<z.ZodLazy<z.ZodArray<z.ZodType<import("document-schema.js").ContentBlock, import("document-schema.js").ContentBlock, z.core.$ZodTypeInternals<import("document-schema.js").ContentBlock, import("document-schema.js").ContentBlock>>>>>;
|
|
810
|
+
}, z.core.$strip>>;
|
|
801
811
|
source: z.ZodOptional<z.ZodObject<{
|
|
802
812
|
format: z.ZodEnum<{
|
|
803
813
|
docx: "docx";
|
package/dist/codec.d.ts
CHANGED
|
@@ -798,6 +798,16 @@ declare const rtfContentCodec: z.ZodCodec<z.ZodCustom<Uint8Array<ArrayBuffer>, U
|
|
|
798
798
|
evenPage: "evenPage";
|
|
799
799
|
oddPage: "oddPage";
|
|
800
800
|
}>>;
|
|
801
|
+
headers: z.ZodOptional<z.ZodObject<{
|
|
802
|
+
default: z.ZodOptional<z.ZodLazy<z.ZodArray<z.ZodType<import("document-schema.js").ContentBlock, import("document-schema.js").ContentBlock, z.core.$ZodTypeInternals<import("document-schema.js").ContentBlock, import("document-schema.js").ContentBlock>>>>>;
|
|
803
|
+
even: z.ZodOptional<z.ZodLazy<z.ZodArray<z.ZodType<import("document-schema.js").ContentBlock, import("document-schema.js").ContentBlock, z.core.$ZodTypeInternals<import("document-schema.js").ContentBlock, import("document-schema.js").ContentBlock>>>>>;
|
|
804
|
+
first: z.ZodOptional<z.ZodLazy<z.ZodArray<z.ZodType<import("document-schema.js").ContentBlock, import("document-schema.js").ContentBlock, z.core.$ZodTypeInternals<import("document-schema.js").ContentBlock, import("document-schema.js").ContentBlock>>>>>;
|
|
805
|
+
}, z.core.$strip>>;
|
|
806
|
+
footers: z.ZodOptional<z.ZodObject<{
|
|
807
|
+
default: z.ZodOptional<z.ZodLazy<z.ZodArray<z.ZodType<import("document-schema.js").ContentBlock, import("document-schema.js").ContentBlock, z.core.$ZodTypeInternals<import("document-schema.js").ContentBlock, import("document-schema.js").ContentBlock>>>>>;
|
|
808
|
+
even: z.ZodOptional<z.ZodLazy<z.ZodArray<z.ZodType<import("document-schema.js").ContentBlock, import("document-schema.js").ContentBlock, z.core.$ZodTypeInternals<import("document-schema.js").ContentBlock, import("document-schema.js").ContentBlock>>>>>;
|
|
809
|
+
first: z.ZodOptional<z.ZodLazy<z.ZodArray<z.ZodType<import("document-schema.js").ContentBlock, import("document-schema.js").ContentBlock, z.core.$ZodTypeInternals<import("document-schema.js").ContentBlock, import("document-schema.js").ContentBlock>>>>>;
|
|
810
|
+
}, z.core.$strip>>;
|
|
801
811
|
source: z.ZodOptional<z.ZodObject<{
|
|
802
812
|
format: z.ZodEnum<{
|
|
803
813
|
docx: "docx";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "rtf-codec",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.2.0",
|
|
4
4
|
"description": "Hand-written Rich Text Format (RTF 1.9.1) reader and writer against the shared document-schema.js content pivot.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"repository": {
|
|
@@ -67,7 +67,9 @@
|
|
|
67
67
|
"test:smoke": "turbo run _test:smoke",
|
|
68
68
|
"_test:smoke": "vitest run --project smoke",
|
|
69
69
|
"prepare": "husky",
|
|
70
|
-
"release": "semantic-release"
|
|
70
|
+
"release": "semantic-release",
|
|
71
|
+
"test:corpus": "turbo run _test:corpus",
|
|
72
|
+
"_test:corpus": "vitest run --project corpus"
|
|
71
73
|
},
|
|
72
74
|
"keywords": [
|
|
73
75
|
"rtf",
|
|
@@ -80,8 +82,8 @@
|
|
|
80
82
|
"license": "MIT",
|
|
81
83
|
"packageManager": "pnpm@11.6.0",
|
|
82
84
|
"dependencies": {
|
|
83
|
-
"archive-codec": "1.10.
|
|
84
|
-
"document-schema.js": "7.
|
|
85
|
+
"archive-codec": "1.10.2",
|
|
86
|
+
"document-schema.js": "7.6.0",
|
|
85
87
|
"zod": "4.4.3"
|
|
86
88
|
},
|
|
87
89
|
"devDependencies": {
|