rtf-codec 1.1.1 → 2.0.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 CHANGED
@@ -141,21 +141,21 @@ Two places where the two models genuinely differ in shape, rather than merely in
141
141
 
142
142
  Each of these is reported through a diagnostic rather than dropped silently — see [Diagnostics](#diagnostics).
143
143
 
144
- | Construct | Why |
145
- | -------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
146
- | Headers, footers, footnotes, endnotes, annotations | `ContentDocument`'s flat form has no page-furniture or note position for them. A footnote's real home is `document-schema.js`'s tree-only `definitions` table, which a codec producing the flat form cannot reach. |
147
- | Content controls | **RTF 1.9.1 specifies none.** It predates OOXML's `w:sdt`: its "Custom XML Tags" (`\xmlopen`/`\xmlclose`) are a bare namespace/name tag with no type, lock, alias or value, and `\*\datastore` is an opaque blob whose "format ... is unknown to RTF" by the spec's own words. |
148
- | Form fields (`\*\formfield`, with a `FORMTEXT`/`FORMCHECKBOX`/`FORMDROPDOWN` instruction) | RTF's own nearest analogue to a content control, and a real `contentControl` mapping -- `ooxml.js` maps docx's legacy `w:ffData` twin onto exactly that kind. Not mapped yet: it needs the field machinery to hand the control its instruction and cached result. |
149
- | East Asian DBCS code pages (932, 936, 949, 950, 1361) | Each needs a ~20k-entry table and its own lead-byte state machine. A document declaring one decodes through cp1252 and says so. |
150
- | Code page 42 (`SYMBOL_CHARSET`) | Not an encoding: its bytes are glyph indices into whichever symbol font the run names, so there is no correct Unicode for them without that font's own cmap. |
151
- | Metafile and bitmap pictures (`\wmetafileN`, `\emfblip`, `\dibitmapN`, `\wbitmapN`, `\macpict`) | `ContentImageBlock` carries PNG and JPEG only. |
152
- | A picture with no stated size | `ContentImageBlock` requires a positive width and height, and deriving them from the payload would need an image decoder this package deliberately does not carry. |
153
- | Nested tables (`\nestcell`/`\nestrow`) | Read as ordinary cell content; the inner table's own structure is not reconstructed. |
154
- | Embedded objects (`\object`), drawing objects (`\do`, `\shp`) | Dropped. Writing one would need the OLE container this package does not build. |
155
- | Superscript/subscript (`\super`, `\sub`, `\upN`, `\dnN`), character scaling, kerning, background colour | **A schema gap, not an RTF one.** `ContentRun` carries no vertical-alignment field at all -- `epub-codec` reports the identical gap for its own `<sub>`/`<sup>`, and `ooxml.js`'s docx reader has no `w:vertAlign` handling either. Closing it is a change to `document-schema.js` and every codec that would then carry it, not to this one. |
156
- | Right-to-left text (`\rtlch`, `\ltrch`, `\rtlpar`, `\rtlrow`, `\rtldoc`) | The same shape of gap: no `ContentDocument` field carries text direction, at any of the four scopes RTF states it at. |
157
- | Cell vertical alignment (`\clvertalt`/`\clvertalc`/`\clvertalb`), diagonal cell borders (`\cldglu`/`\cldgll`), `\clshdngN` | `ContentTableCell` carries per-side borders and one background colour and nothing else -- a diagonal rule is not a side, and a shading percentage is a pattern rather than a colour. |
158
- | A bookmark whose two halves straddle a table cell wall | `document-schema.js` ratifies this as a drop rather than a shape to repair: each block list is its own bracket scope, and pairing across two of them would need the marker ids its contract deliberately refuses. |
144
+ | Construct | Why |
145
+ | -------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
146
+ | Headers, footers, footnotes, endnotes, annotations | `ContentDocument`'s flat form has no page-furniture or note position for them. A footnote's real home is `document-schema.js`'s tree-only `definitions` table, which a codec producing the flat form cannot reach. |
147
+ | Content controls | **RTF 1.9.1 specifies none.** It predates OOXML's `w:sdt`: its "Custom XML Tags" (`\xmlopen`/`\xmlclose`) are a bare namespace/name tag with no type, lock, alias or value, and `\*\datastore` is an opaque blob whose "format ... is unknown to RTF" by the spec's own words. |
148
+ | Form fields (`\*\formfield`, with a `FORMTEXT`/`FORMCHECKBOX`/`FORMDROPDOWN` instruction) | RTF's own nearest analogue to a content control, and a real `contentControl` mapping -- `ooxml.js` maps docx's legacy `w:ffData` twin onto exactly that kind. Not mapped yet: it needs the field machinery to hand the control its instruction and cached result. |
149
+ | East Asian DBCS code pages (932, 936, 949, 950, 1361) | Each needs a ~20k-entry table and its own lead-byte state machine. A document declaring one decodes through cp1252 and says so. |
150
+ | Code page 42 (`SYMBOL_CHARSET`) | Not an encoding: its bytes are glyph indices into whichever symbol font the run names, so there is no correct Unicode for them without that font's own cmap. |
151
+ | Metafile and bitmap pictures (`\wmetafileN`, `\emfblip`, `\dibitmapN`, `\wbitmapN`, `\macpict`) | `ContentImageBlock` carries PNG and JPEG only. |
152
+ | A picture with no stated size | `ContentImageBlock` requires a positive width and height, and deriving them from the payload would need an image decoder this package deliberately does not carry. |
153
+ | Nested tables (`\nestcell`/`\nestrow`) | Read as ordinary cell content; the inner table's own structure is not reconstructed. |
154
+ | Embedded objects (`\object`), drawing objects (`\do`, `\shp`) | Dropped. Writing one would need the OLE container this package does not build. |
155
+ | Superscript/subscript (`\super`, `\sub`, `\upN`, `\dnN`), character scaling, kerning, background colour | **A schema gap, not an RTF one.** `ContentRun` carries no vertical-alignment field at all -- `epub-codec` reports the identical gap for its own `<sub>`/`<sup>`, and `ooxml.js`'s docx reader has no `w:vertAlign` handling either. Closing it is a change to `document-schema.js` and every codec that would then carry it, not to this one. |
156
+ | Right-to-left text (`\rtlch`, `\ltrch`, `\rtlpar`, `\rtlrow`, `\rtldoc`) | The same shape of gap: no `ContentDocument` field carries text direction, at any of the four scopes RTF states it at. |
157
+ | Cell vertical alignment (`\clvertalt`/`\clvertalc`/`\clvertalb`), diagonal cell borders (`\cldglu`/`\cldgll`), `\clshdngN` | `ContentTableCell.borders` has no diagonal member, so a diagonal rule is not a side; `\clshdngN`'s own shading percentage names a genuine two-colour pattern fill, which `document-schema.js`'s `ContentCellFill` can now express (ExaDev/documents.js#951) but this package does not yet resolve either `\clcbpatN`'s own foreground colour or `\clshdngN`'s percentage into one -- `\clcbpatN`'s background colour alone still reads and writes as a `'solid'` fill. |
158
+ | A bookmark whose two halves straddle a table cell wall | `document-schema.js` ratifies this as a drop rather than a shape to repair: each block list is its own bracket scope, and pairing across two of them would need the marker ids its contract deliberately refuses. |
159
159
 
160
160
  ## Diagnostics
161
161
 
package/dist/codec.d.cts CHANGED
@@ -20,6 +20,14 @@ declare const rtfCodec: z.ZodCodec<z.ZodCustom<Uint8Array<ArrayBuffer>, Uint8Arr
20
20
  level: z.ZodNumber;
21
21
  checked: z.ZodOptional<z.ZodBoolean>;
22
22
  itemId: z.ZodOptional<z.ZodString>;
23
+ format: z.ZodOptional<z.ZodEnum<{
24
+ bullet: "bullet";
25
+ decimal: "decimal";
26
+ lowerLetter: "lowerLetter";
27
+ upperLetter: "upperLetter";
28
+ lowerRoman: "lowerRoman";
29
+ upperRoman: "upperRoman";
30
+ }>>;
23
31
  }, z.core.$strip>>;
24
32
  spacingBeforePt: z.ZodOptional<z.ZodNumber>;
25
33
  spacingAfterPt: z.ZodOptional<z.ZodNumber>;
@@ -126,7 +134,19 @@ declare const rtfCodec: z.ZodCodec<z.ZodCustom<Uint8Array<ArrayBuffer>, Uint8Arr
126
134
  producer: z.ZodOptional<z.ZodString>;
127
135
  createdIso: z.ZodOptional<z.ZodString>;
128
136
  modifiedIso: z.ZodOptional<z.ZodString>;
137
+ lastPrintedIso: z.ZodOptional<z.ZodString>;
129
138
  language: z.ZodOptional<z.ZodString>;
139
+ direction: z.ZodOptional<z.ZodEnum<{
140
+ ltr: "ltr";
141
+ rtl: "rtl";
142
+ }>>;
143
+ publisher: z.ZodOptional<z.ZodString>;
144
+ contributor: z.ZodOptional<z.ZodString>;
145
+ rights: z.ZodOptional<z.ZodString>;
146
+ identifier: z.ZodOptional<z.ZodString>;
147
+ comments: z.ZodOptional<z.ZodString>;
148
+ company: z.ZodOptional<z.ZodString>;
149
+ manager: z.ZodOptional<z.ZodString>;
130
150
  }, z.core.$strip>;
131
151
  kind: z.ZodLiteral<"wordprocessing">;
132
152
  }, z.core.$strip>, z.ZodObject<{
@@ -148,6 +168,14 @@ declare const rtfCodec: z.ZodCodec<z.ZodCustom<Uint8Array<ArrayBuffer>, Uint8Arr
148
168
  level: z.ZodNumber;
149
169
  checked: z.ZodOptional<z.ZodBoolean>;
150
170
  itemId: z.ZodOptional<z.ZodString>;
171
+ format: z.ZodOptional<z.ZodEnum<{
172
+ bullet: "bullet";
173
+ decimal: "decimal";
174
+ lowerLetter: "lowerLetter";
175
+ upperLetter: "upperLetter";
176
+ lowerRoman: "lowerRoman";
177
+ upperRoman: "upperRoman";
178
+ }>>;
151
179
  }, z.core.$strip>>;
152
180
  spacingBeforePt: z.ZodOptional<z.ZodNumber>;
153
181
  spacingAfterPt: z.ZodOptional<z.ZodNumber>;
@@ -254,7 +282,19 @@ declare const rtfCodec: z.ZodCodec<z.ZodCustom<Uint8Array<ArrayBuffer>, Uint8Arr
254
282
  producer: z.ZodOptional<z.ZodString>;
255
283
  createdIso: z.ZodOptional<z.ZodString>;
256
284
  modifiedIso: z.ZodOptional<z.ZodString>;
285
+ lastPrintedIso: z.ZodOptional<z.ZodString>;
257
286
  language: z.ZodOptional<z.ZodString>;
287
+ direction: z.ZodOptional<z.ZodEnum<{
288
+ ltr: "ltr";
289
+ rtl: "rtl";
290
+ }>>;
291
+ publisher: z.ZodOptional<z.ZodString>;
292
+ contributor: z.ZodOptional<z.ZodString>;
293
+ rights: z.ZodOptional<z.ZodString>;
294
+ identifier: z.ZodOptional<z.ZodString>;
295
+ comments: z.ZodOptional<z.ZodString>;
296
+ company: z.ZodOptional<z.ZodString>;
297
+ manager: z.ZodOptional<z.ZodString>;
258
298
  }, z.core.$strip>;
259
299
  kind: z.ZodLiteral<"presentation">;
260
300
  }, z.core.$strip>, z.ZodObject<{
@@ -276,6 +316,14 @@ declare const rtfCodec: z.ZodCodec<z.ZodCustom<Uint8Array<ArrayBuffer>, Uint8Arr
276
316
  level: z.ZodNumber;
277
317
  checked: z.ZodOptional<z.ZodBoolean>;
278
318
  itemId: z.ZodOptional<z.ZodString>;
319
+ format: z.ZodOptional<z.ZodEnum<{
320
+ bullet: "bullet";
321
+ decimal: "decimal";
322
+ lowerLetter: "lowerLetter";
323
+ upperLetter: "upperLetter";
324
+ lowerRoman: "lowerRoman";
325
+ upperRoman: "upperRoman";
326
+ }>>;
279
327
  }, z.core.$strip>>;
280
328
  spacingBeforePt: z.ZodOptional<z.ZodNumber>;
281
329
  spacingAfterPt: z.ZodOptional<z.ZodNumber>;
@@ -382,7 +430,19 @@ declare const rtfCodec: z.ZodCodec<z.ZodCustom<Uint8Array<ArrayBuffer>, Uint8Arr
382
430
  producer: z.ZodOptional<z.ZodString>;
383
431
  createdIso: z.ZodOptional<z.ZodString>;
384
432
  modifiedIso: z.ZodOptional<z.ZodString>;
433
+ lastPrintedIso: z.ZodOptional<z.ZodString>;
385
434
  language: z.ZodOptional<z.ZodString>;
435
+ direction: z.ZodOptional<z.ZodEnum<{
436
+ ltr: "ltr";
437
+ rtl: "rtl";
438
+ }>>;
439
+ publisher: z.ZodOptional<z.ZodString>;
440
+ contributor: z.ZodOptional<z.ZodString>;
441
+ rights: z.ZodOptional<z.ZodString>;
442
+ identifier: z.ZodOptional<z.ZodString>;
443
+ comments: z.ZodOptional<z.ZodString>;
444
+ company: z.ZodOptional<z.ZodString>;
445
+ manager: z.ZodOptional<z.ZodString>;
386
446
  }, z.core.$strip>;
387
447
  kind: z.ZodLiteral<"spreadsheet">;
388
448
  }, z.core.$strip>, z.ZodObject<{
@@ -404,6 +464,14 @@ declare const rtfCodec: z.ZodCodec<z.ZodCustom<Uint8Array<ArrayBuffer>, Uint8Arr
404
464
  level: z.ZodNumber;
405
465
  checked: z.ZodOptional<z.ZodBoolean>;
406
466
  itemId: z.ZodOptional<z.ZodString>;
467
+ format: z.ZodOptional<z.ZodEnum<{
468
+ bullet: "bullet";
469
+ decimal: "decimal";
470
+ lowerLetter: "lowerLetter";
471
+ upperLetter: "upperLetter";
472
+ lowerRoman: "lowerRoman";
473
+ upperRoman: "upperRoman";
474
+ }>>;
407
475
  }, z.core.$strip>>;
408
476
  spacingBeforePt: z.ZodOptional<z.ZodNumber>;
409
477
  spacingAfterPt: z.ZodOptional<z.ZodNumber>;
@@ -510,12 +578,24 @@ declare const rtfCodec: z.ZodCodec<z.ZodCustom<Uint8Array<ArrayBuffer>, Uint8Arr
510
578
  producer: z.ZodOptional<z.ZodString>;
511
579
  createdIso: z.ZodOptional<z.ZodString>;
512
580
  modifiedIso: z.ZodOptional<z.ZodString>;
581
+ lastPrintedIso: z.ZodOptional<z.ZodString>;
513
582
  language: z.ZodOptional<z.ZodString>;
583
+ direction: z.ZodOptional<z.ZodEnum<{
584
+ ltr: "ltr";
585
+ rtl: "rtl";
586
+ }>>;
587
+ publisher: z.ZodOptional<z.ZodString>;
588
+ contributor: z.ZodOptional<z.ZodString>;
589
+ rights: z.ZodOptional<z.ZodString>;
590
+ identifier: z.ZodOptional<z.ZodString>;
591
+ comments: z.ZodOptional<z.ZodString>;
592
+ company: z.ZodOptional<z.ZodString>;
593
+ manager: z.ZodOptional<z.ZodString>;
514
594
  }, z.core.$strip>;
515
595
  kind: z.ZodLiteral<"drawing">;
516
596
  }, z.core.$strip>, z.ZodObject<{
517
597
  children: z.ZodArray<z.ZodObject<{
518
- mathml: z.ZodArray<z.ZodCustom<import("document-schema.js").MathMlNode, import("document-schema.js").MathMlNode>>;
598
+ mathml: z.ZodArray<z.ZodType<import("document-schema.js").MathMlNode, import("document-schema.js").MathMlNode, z.core.$ZodTypeInternals<import("document-schema.js").MathMlNode, import("document-schema.js").MathMlNode>>>;
519
599
  starMath: z.ZodOptional<z.ZodString>;
520
600
  presentation: z.ZodOptional<z.ZodObject<{
521
601
  latex: z.ZodString;
@@ -563,6 +643,14 @@ declare const rtfCodec: z.ZodCodec<z.ZodCustom<Uint8Array<ArrayBuffer>, Uint8Arr
563
643
  level: z.ZodNumber;
564
644
  checked: z.ZodOptional<z.ZodBoolean>;
565
645
  itemId: z.ZodOptional<z.ZodString>;
646
+ format: z.ZodOptional<z.ZodEnum<{
647
+ bullet: "bullet";
648
+ decimal: "decimal";
649
+ lowerLetter: "lowerLetter";
650
+ upperLetter: "upperLetter";
651
+ lowerRoman: "lowerRoman";
652
+ upperRoman: "upperRoman";
653
+ }>>;
566
654
  }, z.core.$strip>>;
567
655
  spacingBeforePt: z.ZodOptional<z.ZodNumber>;
568
656
  spacingAfterPt: z.ZodOptional<z.ZodNumber>;
@@ -669,7 +757,19 @@ declare const rtfCodec: z.ZodCodec<z.ZodCustom<Uint8Array<ArrayBuffer>, Uint8Arr
669
757
  producer: z.ZodOptional<z.ZodString>;
670
758
  createdIso: z.ZodOptional<z.ZodString>;
671
759
  modifiedIso: z.ZodOptional<z.ZodString>;
760
+ lastPrintedIso: z.ZodOptional<z.ZodString>;
672
761
  language: z.ZodOptional<z.ZodString>;
762
+ direction: z.ZodOptional<z.ZodEnum<{
763
+ ltr: "ltr";
764
+ rtl: "rtl";
765
+ }>>;
766
+ publisher: z.ZodOptional<z.ZodString>;
767
+ contributor: z.ZodOptional<z.ZodString>;
768
+ rights: z.ZodOptional<z.ZodString>;
769
+ identifier: z.ZodOptional<z.ZodString>;
770
+ comments: z.ZodOptional<z.ZodString>;
771
+ company: z.ZodOptional<z.ZodString>;
772
+ manager: z.ZodOptional<z.ZodString>;
673
773
  }, z.core.$strip>;
674
774
  kind: z.ZodLiteral<"formula">;
675
775
  }, z.core.$strip>], "kind">>;
@@ -765,7 +865,19 @@ declare const rtfContentCodec: z.ZodCodec<z.ZodCustom<Uint8Array<ArrayBuffer>, U
765
865
  producer: z.ZodOptional<z.ZodString>;
766
866
  createdIso: z.ZodOptional<z.ZodString>;
767
867
  modifiedIso: z.ZodOptional<z.ZodString>;
868
+ lastPrintedIso: z.ZodOptional<z.ZodString>;
768
869
  language: z.ZodOptional<z.ZodString>;
870
+ direction: z.ZodOptional<z.ZodEnum<{
871
+ ltr: "ltr";
872
+ rtl: "rtl";
873
+ }>>;
874
+ publisher: z.ZodOptional<z.ZodString>;
875
+ contributor: z.ZodOptional<z.ZodString>;
876
+ rights: z.ZodOptional<z.ZodString>;
877
+ identifier: z.ZodOptional<z.ZodString>;
878
+ comments: z.ZodOptional<z.ZodString>;
879
+ company: z.ZodOptional<z.ZodString>;
880
+ manager: z.ZodOptional<z.ZodString>;
769
881
  }, z.core.$strip>;
770
882
  }, z.core.$strip>, z.ZodObject<{
771
883
  slides: z.ZodArray<z.ZodObject<{
@@ -892,7 +1004,19 @@ declare const rtfContentCodec: z.ZodCodec<z.ZodCustom<Uint8Array<ArrayBuffer>, U
892
1004
  producer: z.ZodOptional<z.ZodString>;
893
1005
  createdIso: z.ZodOptional<z.ZodString>;
894
1006
  modifiedIso: z.ZodOptional<z.ZodString>;
1007
+ lastPrintedIso: z.ZodOptional<z.ZodString>;
895
1008
  language: z.ZodOptional<z.ZodString>;
1009
+ direction: z.ZodOptional<z.ZodEnum<{
1010
+ ltr: "ltr";
1011
+ rtl: "rtl";
1012
+ }>>;
1013
+ publisher: z.ZodOptional<z.ZodString>;
1014
+ contributor: z.ZodOptional<z.ZodString>;
1015
+ rights: z.ZodOptional<z.ZodString>;
1016
+ identifier: z.ZodOptional<z.ZodString>;
1017
+ comments: z.ZodOptional<z.ZodString>;
1018
+ company: z.ZodOptional<z.ZodString>;
1019
+ manager: z.ZodOptional<z.ZodString>;
896
1020
  }, z.core.$strip>;
897
1021
  }, z.core.$strip>, z.ZodObject<{
898
1022
  sheets: z.ZodArray<z.ZodObject<{
@@ -951,6 +1075,14 @@ declare const rtfContentCodec: z.ZodCodec<z.ZodCustom<Uint8Array<ArrayBuffer>, U
951
1075
  b: z.ZodNumber;
952
1076
  }, z.core.$strip>>;
953
1077
  hyperlink: z.ZodOptional<z.ZodString>;
1078
+ verticalAlign: z.ZodOptional<z.ZodEnum<{
1079
+ superscript: "superscript";
1080
+ subscript: "subscript";
1081
+ }>>;
1082
+ direction: z.ZodOptional<z.ZodEnum<{
1083
+ ltr: "ltr";
1084
+ rtl: "rtl";
1085
+ }>>;
954
1086
  sourcePath: z.ZodOptional<z.ZodString>;
955
1087
  source: z.ZodOptional<z.ZodObject<{
956
1088
  format: z.ZodEnum<{
@@ -981,11 +1113,80 @@ declare const rtfContentCodec: z.ZodCodec<z.ZodCustom<Uint8Array<ArrayBuffer>, U
981
1113
  }, z.core.$strip>>>;
982
1114
  colSpan: z.ZodOptional<z.ZodNumber>;
983
1115
  rowSpan: z.ZodOptional<z.ZodNumber>;
984
- background: z.ZodOptional<z.ZodObject<{
985
- r: z.ZodNumber;
986
- g: z.ZodNumber;
987
- b: z.ZodNumber;
988
- }, z.core.$strip>>;
1116
+ background: z.ZodOptional<z.ZodDiscriminatedUnion<[z.ZodObject<{
1117
+ kind: z.ZodLiteral<"solid">;
1118
+ color: z.ZodObject<{
1119
+ r: z.ZodNumber;
1120
+ g: z.ZodNumber;
1121
+ b: z.ZodNumber;
1122
+ }, z.core.$strip>;
1123
+ }, z.core.$strip>, z.ZodObject<{
1124
+ kind: z.ZodLiteral<"pattern">;
1125
+ patternType: z.ZodEnum<{
1126
+ percent5: "percent5";
1127
+ percent10: "percent10";
1128
+ percent12: "percent12";
1129
+ percent15: "percent15";
1130
+ percent20: "percent20";
1131
+ percent25: "percent25";
1132
+ percent30: "percent30";
1133
+ percent35: "percent35";
1134
+ percent37: "percent37";
1135
+ percent40: "percent40";
1136
+ percent45: "percent45";
1137
+ percent50: "percent50";
1138
+ percent55: "percent55";
1139
+ percent60: "percent60";
1140
+ percent62: "percent62";
1141
+ percent65: "percent65";
1142
+ percent70: "percent70";
1143
+ percent75: "percent75";
1144
+ percent80: "percent80";
1145
+ percent85: "percent85";
1146
+ percent87: "percent87";
1147
+ percent90: "percent90";
1148
+ percent95: "percent95";
1149
+ horizontalStripe: "horizontalStripe";
1150
+ verticalStripe: "verticalStripe";
1151
+ diagonalStripe: "diagonalStripe";
1152
+ reverseDiagonalStripe: "reverseDiagonalStripe";
1153
+ horizontalCross: "horizontalCross";
1154
+ diagonalCross: "diagonalCross";
1155
+ thinHorizontalStripe: "thinHorizontalStripe";
1156
+ thinVerticalStripe: "thinVerticalStripe";
1157
+ thinDiagonalStripe: "thinDiagonalStripe";
1158
+ thinReverseDiagonalStripe: "thinReverseDiagonalStripe";
1159
+ thinHorizontalCross: "thinHorizontalCross";
1160
+ thinDiagonalCross: "thinDiagonalCross";
1161
+ mediumGray: "mediumGray";
1162
+ darkGray: "darkGray";
1163
+ lightGray: "lightGray";
1164
+ darkHorizontal: "darkHorizontal";
1165
+ darkVertical: "darkVertical";
1166
+ darkDown: "darkDown";
1167
+ darkUp: "darkUp";
1168
+ darkGrid: "darkGrid";
1169
+ darkTrellis: "darkTrellis";
1170
+ lightHorizontal: "lightHorizontal";
1171
+ lightVertical: "lightVertical";
1172
+ lightDown: "lightDown";
1173
+ lightUp: "lightUp";
1174
+ lightGrid: "lightGrid";
1175
+ lightTrellis: "lightTrellis";
1176
+ gray125: "gray125";
1177
+ gray0625: "gray0625";
1178
+ }>;
1179
+ foregroundColor: z.ZodOptional<z.ZodObject<{
1180
+ r: z.ZodNumber;
1181
+ g: z.ZodNumber;
1182
+ b: z.ZodNumber;
1183
+ }, z.core.$strip>>;
1184
+ backgroundColor: z.ZodOptional<z.ZodObject<{
1185
+ r: z.ZodNumber;
1186
+ g: z.ZodNumber;
1187
+ b: z.ZodNumber;
1188
+ }, z.core.$strip>>;
1189
+ }, z.core.$strip>], "kind">>;
989
1190
  borders: z.ZodOptional<z.ZodObject<{
990
1191
  left: z.ZodOptional<z.ZodObject<{
991
1192
  color: z.ZodObject<{
@@ -1043,6 +1244,34 @@ declare const rtfContentCodec: z.ZodCodec<z.ZodCustom<Uint8Array<ArrayBuffer>, U
1043
1244
  double: "double";
1044
1245
  }>>;
1045
1246
  }, z.core.$strip>>;
1247
+ diagonalUp: z.ZodOptional<z.ZodObject<{
1248
+ color: z.ZodObject<{
1249
+ r: z.ZodNumber;
1250
+ g: z.ZodNumber;
1251
+ b: z.ZodNumber;
1252
+ }, z.core.$strip>;
1253
+ widthPt: z.ZodNumber;
1254
+ style: z.ZodOptional<z.ZodEnum<{
1255
+ solid: "solid";
1256
+ dashed: "dashed";
1257
+ dotted: "dotted";
1258
+ double: "double";
1259
+ }>>;
1260
+ }, z.core.$strip>>;
1261
+ diagonalDown: z.ZodOptional<z.ZodObject<{
1262
+ color: z.ZodObject<{
1263
+ r: z.ZodNumber;
1264
+ g: z.ZodNumber;
1265
+ b: z.ZodNumber;
1266
+ }, z.core.$strip>;
1267
+ widthPt: z.ZodNumber;
1268
+ style: z.ZodOptional<z.ZodEnum<{
1269
+ solid: "solid";
1270
+ dashed: "dashed";
1271
+ dotted: "dotted";
1272
+ double: "double";
1273
+ }>>;
1274
+ }, z.core.$strip>>;
1046
1275
  }, z.core.$strip>>;
1047
1276
  alignment: z.ZodOptional<z.ZodEnum<{
1048
1277
  left: "left";
@@ -1107,6 +1336,8 @@ declare const rtfContentCodec: z.ZodCodec<z.ZodCustom<Uint8Array<ArrayBuffer>, U
1107
1336
  format: z.ZodEnum<{
1108
1337
  png: "png";
1109
1338
  jpeg: "jpeg";
1339
+ svg: "svg";
1340
+ gif: "gif";
1110
1341
  }>;
1111
1342
  base64: z.ZodString;
1112
1343
  widthPt: z.ZodNumber;
@@ -1194,12 +1425,12 @@ declare const rtfContentCodec: z.ZodCodec<z.ZodCustom<Uint8Array<ArrayBuffer>, U
1194
1425
  endColumn: z.ZodNumber;
1195
1426
  }, z.core.$strip>>;
1196
1427
  type: z.ZodEnum<{
1197
- list: "list";
1198
1428
  date: "date";
1199
1429
  custom: "custom";
1430
+ decimal: "decimal";
1431
+ list: "list";
1200
1432
  time: "time";
1201
1433
  whole: "whole";
1202
- decimal: "decimal";
1203
1434
  textLength: "textLength";
1204
1435
  }>;
1205
1436
  operator: z.ZodOptional<z.ZodEnum<{
@@ -1870,7 +2101,19 @@ declare const rtfContentCodec: z.ZodCodec<z.ZodCustom<Uint8Array<ArrayBuffer>, U
1870
2101
  producer: z.ZodOptional<z.ZodString>;
1871
2102
  createdIso: z.ZodOptional<z.ZodString>;
1872
2103
  modifiedIso: z.ZodOptional<z.ZodString>;
2104
+ lastPrintedIso: z.ZodOptional<z.ZodString>;
1873
2105
  language: z.ZodOptional<z.ZodString>;
2106
+ direction: z.ZodOptional<z.ZodEnum<{
2107
+ ltr: "ltr";
2108
+ rtl: "rtl";
2109
+ }>>;
2110
+ publisher: z.ZodOptional<z.ZodString>;
2111
+ contributor: z.ZodOptional<z.ZodString>;
2112
+ rights: z.ZodOptional<z.ZodString>;
2113
+ identifier: z.ZodOptional<z.ZodString>;
2114
+ comments: z.ZodOptional<z.ZodString>;
2115
+ company: z.ZodOptional<z.ZodString>;
2116
+ manager: z.ZodOptional<z.ZodString>;
1874
2117
  }, z.core.$strip>;
1875
2118
  }, z.core.$strip>, z.ZodObject<{
1876
2119
  pages: z.ZodArray<z.ZodObject<{
@@ -2249,11 +2492,23 @@ declare const rtfContentCodec: z.ZodCodec<z.ZodCustom<Uint8Array<ArrayBuffer>, U
2249
2492
  producer: z.ZodOptional<z.ZodString>;
2250
2493
  createdIso: z.ZodOptional<z.ZodString>;
2251
2494
  modifiedIso: z.ZodOptional<z.ZodString>;
2495
+ lastPrintedIso: z.ZodOptional<z.ZodString>;
2252
2496
  language: z.ZodOptional<z.ZodString>;
2497
+ direction: z.ZodOptional<z.ZodEnum<{
2498
+ ltr: "ltr";
2499
+ rtl: "rtl";
2500
+ }>>;
2501
+ publisher: z.ZodOptional<z.ZodString>;
2502
+ contributor: z.ZodOptional<z.ZodString>;
2503
+ rights: z.ZodOptional<z.ZodString>;
2504
+ identifier: z.ZodOptional<z.ZodString>;
2505
+ comments: z.ZodOptional<z.ZodString>;
2506
+ company: z.ZodOptional<z.ZodString>;
2507
+ manager: z.ZodOptional<z.ZodString>;
2253
2508
  }, z.core.$strip>;
2254
2509
  }, z.core.$strip>, z.ZodObject<{
2255
2510
  formula: z.ZodObject<{
2256
- mathml: z.ZodArray<z.ZodCustom<import("document-schema.js").MathMlNode, import("document-schema.js").MathMlNode>>;
2511
+ mathml: z.ZodArray<z.ZodType<import("document-schema.js").MathMlNode, import("document-schema.js").MathMlNode, z.core.$ZodTypeInternals<import("document-schema.js").MathMlNode, import("document-schema.js").MathMlNode>>>;
2257
2512
  starMath: z.ZodOptional<z.ZodString>;
2258
2513
  presentation: z.ZodOptional<z.ZodObject<{
2259
2514
  latex: z.ZodString;
@@ -2337,7 +2592,19 @@ declare const rtfContentCodec: z.ZodCodec<z.ZodCustom<Uint8Array<ArrayBuffer>, U
2337
2592
  producer: z.ZodOptional<z.ZodString>;
2338
2593
  createdIso: z.ZodOptional<z.ZodString>;
2339
2594
  modifiedIso: z.ZodOptional<z.ZodString>;
2595
+ lastPrintedIso: z.ZodOptional<z.ZodString>;
2340
2596
  language: z.ZodOptional<z.ZodString>;
2597
+ direction: z.ZodOptional<z.ZodEnum<{
2598
+ ltr: "ltr";
2599
+ rtl: "rtl";
2600
+ }>>;
2601
+ publisher: z.ZodOptional<z.ZodString>;
2602
+ contributor: z.ZodOptional<z.ZodString>;
2603
+ rights: z.ZodOptional<z.ZodString>;
2604
+ identifier: z.ZodOptional<z.ZodString>;
2605
+ comments: z.ZodOptional<z.ZodString>;
2606
+ company: z.ZodOptional<z.ZodString>;
2607
+ manager: z.ZodOptional<z.ZodString>;
2341
2608
  }, z.core.$strip>;
2342
2609
  }, z.core.$strip>], "kind">>;
2343
2610
  //#endregion
package/dist/codec.d.ts CHANGED
@@ -20,6 +20,14 @@ declare const rtfCodec: z.ZodCodec<z.ZodCustom<Uint8Array<ArrayBuffer>, Uint8Arr
20
20
  level: z.ZodNumber;
21
21
  checked: z.ZodOptional<z.ZodBoolean>;
22
22
  itemId: z.ZodOptional<z.ZodString>;
23
+ format: z.ZodOptional<z.ZodEnum<{
24
+ bullet: "bullet";
25
+ decimal: "decimal";
26
+ lowerLetter: "lowerLetter";
27
+ upperLetter: "upperLetter";
28
+ lowerRoman: "lowerRoman";
29
+ upperRoman: "upperRoman";
30
+ }>>;
23
31
  }, z.core.$strip>>;
24
32
  spacingBeforePt: z.ZodOptional<z.ZodNumber>;
25
33
  spacingAfterPt: z.ZodOptional<z.ZodNumber>;
@@ -126,7 +134,19 @@ declare const rtfCodec: z.ZodCodec<z.ZodCustom<Uint8Array<ArrayBuffer>, Uint8Arr
126
134
  producer: z.ZodOptional<z.ZodString>;
127
135
  createdIso: z.ZodOptional<z.ZodString>;
128
136
  modifiedIso: z.ZodOptional<z.ZodString>;
137
+ lastPrintedIso: z.ZodOptional<z.ZodString>;
129
138
  language: z.ZodOptional<z.ZodString>;
139
+ direction: z.ZodOptional<z.ZodEnum<{
140
+ ltr: "ltr";
141
+ rtl: "rtl";
142
+ }>>;
143
+ publisher: z.ZodOptional<z.ZodString>;
144
+ contributor: z.ZodOptional<z.ZodString>;
145
+ rights: z.ZodOptional<z.ZodString>;
146
+ identifier: z.ZodOptional<z.ZodString>;
147
+ comments: z.ZodOptional<z.ZodString>;
148
+ company: z.ZodOptional<z.ZodString>;
149
+ manager: z.ZodOptional<z.ZodString>;
130
150
  }, z.core.$strip>;
131
151
  kind: z.ZodLiteral<"wordprocessing">;
132
152
  }, z.core.$strip>, z.ZodObject<{
@@ -148,6 +168,14 @@ declare const rtfCodec: z.ZodCodec<z.ZodCustom<Uint8Array<ArrayBuffer>, Uint8Arr
148
168
  level: z.ZodNumber;
149
169
  checked: z.ZodOptional<z.ZodBoolean>;
150
170
  itemId: z.ZodOptional<z.ZodString>;
171
+ format: z.ZodOptional<z.ZodEnum<{
172
+ bullet: "bullet";
173
+ decimal: "decimal";
174
+ lowerLetter: "lowerLetter";
175
+ upperLetter: "upperLetter";
176
+ lowerRoman: "lowerRoman";
177
+ upperRoman: "upperRoman";
178
+ }>>;
151
179
  }, z.core.$strip>>;
152
180
  spacingBeforePt: z.ZodOptional<z.ZodNumber>;
153
181
  spacingAfterPt: z.ZodOptional<z.ZodNumber>;
@@ -254,7 +282,19 @@ declare const rtfCodec: z.ZodCodec<z.ZodCustom<Uint8Array<ArrayBuffer>, Uint8Arr
254
282
  producer: z.ZodOptional<z.ZodString>;
255
283
  createdIso: z.ZodOptional<z.ZodString>;
256
284
  modifiedIso: z.ZodOptional<z.ZodString>;
285
+ lastPrintedIso: z.ZodOptional<z.ZodString>;
257
286
  language: z.ZodOptional<z.ZodString>;
287
+ direction: z.ZodOptional<z.ZodEnum<{
288
+ ltr: "ltr";
289
+ rtl: "rtl";
290
+ }>>;
291
+ publisher: z.ZodOptional<z.ZodString>;
292
+ contributor: z.ZodOptional<z.ZodString>;
293
+ rights: z.ZodOptional<z.ZodString>;
294
+ identifier: z.ZodOptional<z.ZodString>;
295
+ comments: z.ZodOptional<z.ZodString>;
296
+ company: z.ZodOptional<z.ZodString>;
297
+ manager: z.ZodOptional<z.ZodString>;
258
298
  }, z.core.$strip>;
259
299
  kind: z.ZodLiteral<"presentation">;
260
300
  }, z.core.$strip>, z.ZodObject<{
@@ -276,6 +316,14 @@ declare const rtfCodec: z.ZodCodec<z.ZodCustom<Uint8Array<ArrayBuffer>, Uint8Arr
276
316
  level: z.ZodNumber;
277
317
  checked: z.ZodOptional<z.ZodBoolean>;
278
318
  itemId: z.ZodOptional<z.ZodString>;
319
+ format: z.ZodOptional<z.ZodEnum<{
320
+ bullet: "bullet";
321
+ decimal: "decimal";
322
+ lowerLetter: "lowerLetter";
323
+ upperLetter: "upperLetter";
324
+ lowerRoman: "lowerRoman";
325
+ upperRoman: "upperRoman";
326
+ }>>;
279
327
  }, z.core.$strip>>;
280
328
  spacingBeforePt: z.ZodOptional<z.ZodNumber>;
281
329
  spacingAfterPt: z.ZodOptional<z.ZodNumber>;
@@ -382,7 +430,19 @@ declare const rtfCodec: z.ZodCodec<z.ZodCustom<Uint8Array<ArrayBuffer>, Uint8Arr
382
430
  producer: z.ZodOptional<z.ZodString>;
383
431
  createdIso: z.ZodOptional<z.ZodString>;
384
432
  modifiedIso: z.ZodOptional<z.ZodString>;
433
+ lastPrintedIso: z.ZodOptional<z.ZodString>;
385
434
  language: z.ZodOptional<z.ZodString>;
435
+ direction: z.ZodOptional<z.ZodEnum<{
436
+ ltr: "ltr";
437
+ rtl: "rtl";
438
+ }>>;
439
+ publisher: z.ZodOptional<z.ZodString>;
440
+ contributor: z.ZodOptional<z.ZodString>;
441
+ rights: z.ZodOptional<z.ZodString>;
442
+ identifier: z.ZodOptional<z.ZodString>;
443
+ comments: z.ZodOptional<z.ZodString>;
444
+ company: z.ZodOptional<z.ZodString>;
445
+ manager: z.ZodOptional<z.ZodString>;
386
446
  }, z.core.$strip>;
387
447
  kind: z.ZodLiteral<"spreadsheet">;
388
448
  }, z.core.$strip>, z.ZodObject<{
@@ -404,6 +464,14 @@ declare const rtfCodec: z.ZodCodec<z.ZodCustom<Uint8Array<ArrayBuffer>, Uint8Arr
404
464
  level: z.ZodNumber;
405
465
  checked: z.ZodOptional<z.ZodBoolean>;
406
466
  itemId: z.ZodOptional<z.ZodString>;
467
+ format: z.ZodOptional<z.ZodEnum<{
468
+ bullet: "bullet";
469
+ decimal: "decimal";
470
+ lowerLetter: "lowerLetter";
471
+ upperLetter: "upperLetter";
472
+ lowerRoman: "lowerRoman";
473
+ upperRoman: "upperRoman";
474
+ }>>;
407
475
  }, z.core.$strip>>;
408
476
  spacingBeforePt: z.ZodOptional<z.ZodNumber>;
409
477
  spacingAfterPt: z.ZodOptional<z.ZodNumber>;
@@ -510,12 +578,24 @@ declare const rtfCodec: z.ZodCodec<z.ZodCustom<Uint8Array<ArrayBuffer>, Uint8Arr
510
578
  producer: z.ZodOptional<z.ZodString>;
511
579
  createdIso: z.ZodOptional<z.ZodString>;
512
580
  modifiedIso: z.ZodOptional<z.ZodString>;
581
+ lastPrintedIso: z.ZodOptional<z.ZodString>;
513
582
  language: z.ZodOptional<z.ZodString>;
583
+ direction: z.ZodOptional<z.ZodEnum<{
584
+ ltr: "ltr";
585
+ rtl: "rtl";
586
+ }>>;
587
+ publisher: z.ZodOptional<z.ZodString>;
588
+ contributor: z.ZodOptional<z.ZodString>;
589
+ rights: z.ZodOptional<z.ZodString>;
590
+ identifier: z.ZodOptional<z.ZodString>;
591
+ comments: z.ZodOptional<z.ZodString>;
592
+ company: z.ZodOptional<z.ZodString>;
593
+ manager: z.ZodOptional<z.ZodString>;
514
594
  }, z.core.$strip>;
515
595
  kind: z.ZodLiteral<"drawing">;
516
596
  }, z.core.$strip>, z.ZodObject<{
517
597
  children: z.ZodArray<z.ZodObject<{
518
- mathml: z.ZodArray<z.ZodCustom<import("document-schema.js").MathMlNode, import("document-schema.js").MathMlNode>>;
598
+ mathml: z.ZodArray<z.ZodType<import("document-schema.js").MathMlNode, import("document-schema.js").MathMlNode, z.core.$ZodTypeInternals<import("document-schema.js").MathMlNode, import("document-schema.js").MathMlNode>>>;
519
599
  starMath: z.ZodOptional<z.ZodString>;
520
600
  presentation: z.ZodOptional<z.ZodObject<{
521
601
  latex: z.ZodString;
@@ -563,6 +643,14 @@ declare const rtfCodec: z.ZodCodec<z.ZodCustom<Uint8Array<ArrayBuffer>, Uint8Arr
563
643
  level: z.ZodNumber;
564
644
  checked: z.ZodOptional<z.ZodBoolean>;
565
645
  itemId: z.ZodOptional<z.ZodString>;
646
+ format: z.ZodOptional<z.ZodEnum<{
647
+ bullet: "bullet";
648
+ decimal: "decimal";
649
+ lowerLetter: "lowerLetter";
650
+ upperLetter: "upperLetter";
651
+ lowerRoman: "lowerRoman";
652
+ upperRoman: "upperRoman";
653
+ }>>;
566
654
  }, z.core.$strip>>;
567
655
  spacingBeforePt: z.ZodOptional<z.ZodNumber>;
568
656
  spacingAfterPt: z.ZodOptional<z.ZodNumber>;
@@ -669,7 +757,19 @@ declare const rtfCodec: z.ZodCodec<z.ZodCustom<Uint8Array<ArrayBuffer>, Uint8Arr
669
757
  producer: z.ZodOptional<z.ZodString>;
670
758
  createdIso: z.ZodOptional<z.ZodString>;
671
759
  modifiedIso: z.ZodOptional<z.ZodString>;
760
+ lastPrintedIso: z.ZodOptional<z.ZodString>;
672
761
  language: z.ZodOptional<z.ZodString>;
762
+ direction: z.ZodOptional<z.ZodEnum<{
763
+ ltr: "ltr";
764
+ rtl: "rtl";
765
+ }>>;
766
+ publisher: z.ZodOptional<z.ZodString>;
767
+ contributor: z.ZodOptional<z.ZodString>;
768
+ rights: z.ZodOptional<z.ZodString>;
769
+ identifier: z.ZodOptional<z.ZodString>;
770
+ comments: z.ZodOptional<z.ZodString>;
771
+ company: z.ZodOptional<z.ZodString>;
772
+ manager: z.ZodOptional<z.ZodString>;
673
773
  }, z.core.$strip>;
674
774
  kind: z.ZodLiteral<"formula">;
675
775
  }, z.core.$strip>], "kind">>;
@@ -765,7 +865,19 @@ declare const rtfContentCodec: z.ZodCodec<z.ZodCustom<Uint8Array<ArrayBuffer>, U
765
865
  producer: z.ZodOptional<z.ZodString>;
766
866
  createdIso: z.ZodOptional<z.ZodString>;
767
867
  modifiedIso: z.ZodOptional<z.ZodString>;
868
+ lastPrintedIso: z.ZodOptional<z.ZodString>;
768
869
  language: z.ZodOptional<z.ZodString>;
870
+ direction: z.ZodOptional<z.ZodEnum<{
871
+ ltr: "ltr";
872
+ rtl: "rtl";
873
+ }>>;
874
+ publisher: z.ZodOptional<z.ZodString>;
875
+ contributor: z.ZodOptional<z.ZodString>;
876
+ rights: z.ZodOptional<z.ZodString>;
877
+ identifier: z.ZodOptional<z.ZodString>;
878
+ comments: z.ZodOptional<z.ZodString>;
879
+ company: z.ZodOptional<z.ZodString>;
880
+ manager: z.ZodOptional<z.ZodString>;
769
881
  }, z.core.$strip>;
770
882
  }, z.core.$strip>, z.ZodObject<{
771
883
  slides: z.ZodArray<z.ZodObject<{
@@ -892,7 +1004,19 @@ declare const rtfContentCodec: z.ZodCodec<z.ZodCustom<Uint8Array<ArrayBuffer>, U
892
1004
  producer: z.ZodOptional<z.ZodString>;
893
1005
  createdIso: z.ZodOptional<z.ZodString>;
894
1006
  modifiedIso: z.ZodOptional<z.ZodString>;
1007
+ lastPrintedIso: z.ZodOptional<z.ZodString>;
895
1008
  language: z.ZodOptional<z.ZodString>;
1009
+ direction: z.ZodOptional<z.ZodEnum<{
1010
+ ltr: "ltr";
1011
+ rtl: "rtl";
1012
+ }>>;
1013
+ publisher: z.ZodOptional<z.ZodString>;
1014
+ contributor: z.ZodOptional<z.ZodString>;
1015
+ rights: z.ZodOptional<z.ZodString>;
1016
+ identifier: z.ZodOptional<z.ZodString>;
1017
+ comments: z.ZodOptional<z.ZodString>;
1018
+ company: z.ZodOptional<z.ZodString>;
1019
+ manager: z.ZodOptional<z.ZodString>;
896
1020
  }, z.core.$strip>;
897
1021
  }, z.core.$strip>, z.ZodObject<{
898
1022
  sheets: z.ZodArray<z.ZodObject<{
@@ -951,6 +1075,14 @@ declare const rtfContentCodec: z.ZodCodec<z.ZodCustom<Uint8Array<ArrayBuffer>, U
951
1075
  b: z.ZodNumber;
952
1076
  }, z.core.$strip>>;
953
1077
  hyperlink: z.ZodOptional<z.ZodString>;
1078
+ verticalAlign: z.ZodOptional<z.ZodEnum<{
1079
+ superscript: "superscript";
1080
+ subscript: "subscript";
1081
+ }>>;
1082
+ direction: z.ZodOptional<z.ZodEnum<{
1083
+ ltr: "ltr";
1084
+ rtl: "rtl";
1085
+ }>>;
954
1086
  sourcePath: z.ZodOptional<z.ZodString>;
955
1087
  source: z.ZodOptional<z.ZodObject<{
956
1088
  format: z.ZodEnum<{
@@ -981,11 +1113,80 @@ declare const rtfContentCodec: z.ZodCodec<z.ZodCustom<Uint8Array<ArrayBuffer>, U
981
1113
  }, z.core.$strip>>>;
982
1114
  colSpan: z.ZodOptional<z.ZodNumber>;
983
1115
  rowSpan: z.ZodOptional<z.ZodNumber>;
984
- background: z.ZodOptional<z.ZodObject<{
985
- r: z.ZodNumber;
986
- g: z.ZodNumber;
987
- b: z.ZodNumber;
988
- }, z.core.$strip>>;
1116
+ background: z.ZodOptional<z.ZodDiscriminatedUnion<[z.ZodObject<{
1117
+ kind: z.ZodLiteral<"solid">;
1118
+ color: z.ZodObject<{
1119
+ r: z.ZodNumber;
1120
+ g: z.ZodNumber;
1121
+ b: z.ZodNumber;
1122
+ }, z.core.$strip>;
1123
+ }, z.core.$strip>, z.ZodObject<{
1124
+ kind: z.ZodLiteral<"pattern">;
1125
+ patternType: z.ZodEnum<{
1126
+ percent5: "percent5";
1127
+ percent10: "percent10";
1128
+ percent12: "percent12";
1129
+ percent15: "percent15";
1130
+ percent20: "percent20";
1131
+ percent25: "percent25";
1132
+ percent30: "percent30";
1133
+ percent35: "percent35";
1134
+ percent37: "percent37";
1135
+ percent40: "percent40";
1136
+ percent45: "percent45";
1137
+ percent50: "percent50";
1138
+ percent55: "percent55";
1139
+ percent60: "percent60";
1140
+ percent62: "percent62";
1141
+ percent65: "percent65";
1142
+ percent70: "percent70";
1143
+ percent75: "percent75";
1144
+ percent80: "percent80";
1145
+ percent85: "percent85";
1146
+ percent87: "percent87";
1147
+ percent90: "percent90";
1148
+ percent95: "percent95";
1149
+ horizontalStripe: "horizontalStripe";
1150
+ verticalStripe: "verticalStripe";
1151
+ diagonalStripe: "diagonalStripe";
1152
+ reverseDiagonalStripe: "reverseDiagonalStripe";
1153
+ horizontalCross: "horizontalCross";
1154
+ diagonalCross: "diagonalCross";
1155
+ thinHorizontalStripe: "thinHorizontalStripe";
1156
+ thinVerticalStripe: "thinVerticalStripe";
1157
+ thinDiagonalStripe: "thinDiagonalStripe";
1158
+ thinReverseDiagonalStripe: "thinReverseDiagonalStripe";
1159
+ thinHorizontalCross: "thinHorizontalCross";
1160
+ thinDiagonalCross: "thinDiagonalCross";
1161
+ mediumGray: "mediumGray";
1162
+ darkGray: "darkGray";
1163
+ lightGray: "lightGray";
1164
+ darkHorizontal: "darkHorizontal";
1165
+ darkVertical: "darkVertical";
1166
+ darkDown: "darkDown";
1167
+ darkUp: "darkUp";
1168
+ darkGrid: "darkGrid";
1169
+ darkTrellis: "darkTrellis";
1170
+ lightHorizontal: "lightHorizontal";
1171
+ lightVertical: "lightVertical";
1172
+ lightDown: "lightDown";
1173
+ lightUp: "lightUp";
1174
+ lightGrid: "lightGrid";
1175
+ lightTrellis: "lightTrellis";
1176
+ gray125: "gray125";
1177
+ gray0625: "gray0625";
1178
+ }>;
1179
+ foregroundColor: z.ZodOptional<z.ZodObject<{
1180
+ r: z.ZodNumber;
1181
+ g: z.ZodNumber;
1182
+ b: z.ZodNumber;
1183
+ }, z.core.$strip>>;
1184
+ backgroundColor: z.ZodOptional<z.ZodObject<{
1185
+ r: z.ZodNumber;
1186
+ g: z.ZodNumber;
1187
+ b: z.ZodNumber;
1188
+ }, z.core.$strip>>;
1189
+ }, z.core.$strip>], "kind">>;
989
1190
  borders: z.ZodOptional<z.ZodObject<{
990
1191
  left: z.ZodOptional<z.ZodObject<{
991
1192
  color: z.ZodObject<{
@@ -1043,6 +1244,34 @@ declare const rtfContentCodec: z.ZodCodec<z.ZodCustom<Uint8Array<ArrayBuffer>, U
1043
1244
  double: "double";
1044
1245
  }>>;
1045
1246
  }, z.core.$strip>>;
1247
+ diagonalUp: z.ZodOptional<z.ZodObject<{
1248
+ color: z.ZodObject<{
1249
+ r: z.ZodNumber;
1250
+ g: z.ZodNumber;
1251
+ b: z.ZodNumber;
1252
+ }, z.core.$strip>;
1253
+ widthPt: z.ZodNumber;
1254
+ style: z.ZodOptional<z.ZodEnum<{
1255
+ solid: "solid";
1256
+ dashed: "dashed";
1257
+ dotted: "dotted";
1258
+ double: "double";
1259
+ }>>;
1260
+ }, z.core.$strip>>;
1261
+ diagonalDown: z.ZodOptional<z.ZodObject<{
1262
+ color: z.ZodObject<{
1263
+ r: z.ZodNumber;
1264
+ g: z.ZodNumber;
1265
+ b: z.ZodNumber;
1266
+ }, z.core.$strip>;
1267
+ widthPt: z.ZodNumber;
1268
+ style: z.ZodOptional<z.ZodEnum<{
1269
+ solid: "solid";
1270
+ dashed: "dashed";
1271
+ dotted: "dotted";
1272
+ double: "double";
1273
+ }>>;
1274
+ }, z.core.$strip>>;
1046
1275
  }, z.core.$strip>>;
1047
1276
  alignment: z.ZodOptional<z.ZodEnum<{
1048
1277
  left: "left";
@@ -1107,6 +1336,8 @@ declare const rtfContentCodec: z.ZodCodec<z.ZodCustom<Uint8Array<ArrayBuffer>, U
1107
1336
  format: z.ZodEnum<{
1108
1337
  png: "png";
1109
1338
  jpeg: "jpeg";
1339
+ svg: "svg";
1340
+ gif: "gif";
1110
1341
  }>;
1111
1342
  base64: z.ZodString;
1112
1343
  widthPt: z.ZodNumber;
@@ -1194,12 +1425,12 @@ declare const rtfContentCodec: z.ZodCodec<z.ZodCustom<Uint8Array<ArrayBuffer>, U
1194
1425
  endColumn: z.ZodNumber;
1195
1426
  }, z.core.$strip>>;
1196
1427
  type: z.ZodEnum<{
1197
- list: "list";
1198
1428
  date: "date";
1199
1429
  custom: "custom";
1430
+ decimal: "decimal";
1431
+ list: "list";
1200
1432
  time: "time";
1201
1433
  whole: "whole";
1202
- decimal: "decimal";
1203
1434
  textLength: "textLength";
1204
1435
  }>;
1205
1436
  operator: z.ZodOptional<z.ZodEnum<{
@@ -1870,7 +2101,19 @@ declare const rtfContentCodec: z.ZodCodec<z.ZodCustom<Uint8Array<ArrayBuffer>, U
1870
2101
  producer: z.ZodOptional<z.ZodString>;
1871
2102
  createdIso: z.ZodOptional<z.ZodString>;
1872
2103
  modifiedIso: z.ZodOptional<z.ZodString>;
2104
+ lastPrintedIso: z.ZodOptional<z.ZodString>;
1873
2105
  language: z.ZodOptional<z.ZodString>;
2106
+ direction: z.ZodOptional<z.ZodEnum<{
2107
+ ltr: "ltr";
2108
+ rtl: "rtl";
2109
+ }>>;
2110
+ publisher: z.ZodOptional<z.ZodString>;
2111
+ contributor: z.ZodOptional<z.ZodString>;
2112
+ rights: z.ZodOptional<z.ZodString>;
2113
+ identifier: z.ZodOptional<z.ZodString>;
2114
+ comments: z.ZodOptional<z.ZodString>;
2115
+ company: z.ZodOptional<z.ZodString>;
2116
+ manager: z.ZodOptional<z.ZodString>;
1874
2117
  }, z.core.$strip>;
1875
2118
  }, z.core.$strip>, z.ZodObject<{
1876
2119
  pages: z.ZodArray<z.ZodObject<{
@@ -2249,11 +2492,23 @@ declare const rtfContentCodec: z.ZodCodec<z.ZodCustom<Uint8Array<ArrayBuffer>, U
2249
2492
  producer: z.ZodOptional<z.ZodString>;
2250
2493
  createdIso: z.ZodOptional<z.ZodString>;
2251
2494
  modifiedIso: z.ZodOptional<z.ZodString>;
2495
+ lastPrintedIso: z.ZodOptional<z.ZodString>;
2252
2496
  language: z.ZodOptional<z.ZodString>;
2497
+ direction: z.ZodOptional<z.ZodEnum<{
2498
+ ltr: "ltr";
2499
+ rtl: "rtl";
2500
+ }>>;
2501
+ publisher: z.ZodOptional<z.ZodString>;
2502
+ contributor: z.ZodOptional<z.ZodString>;
2503
+ rights: z.ZodOptional<z.ZodString>;
2504
+ identifier: z.ZodOptional<z.ZodString>;
2505
+ comments: z.ZodOptional<z.ZodString>;
2506
+ company: z.ZodOptional<z.ZodString>;
2507
+ manager: z.ZodOptional<z.ZodString>;
2253
2508
  }, z.core.$strip>;
2254
2509
  }, z.core.$strip>, z.ZodObject<{
2255
2510
  formula: z.ZodObject<{
2256
- mathml: z.ZodArray<z.ZodCustom<import("document-schema.js").MathMlNode, import("document-schema.js").MathMlNode>>;
2511
+ mathml: z.ZodArray<z.ZodType<import("document-schema.js").MathMlNode, import("document-schema.js").MathMlNode, z.core.$ZodTypeInternals<import("document-schema.js").MathMlNode, import("document-schema.js").MathMlNode>>>;
2257
2512
  starMath: z.ZodOptional<z.ZodString>;
2258
2513
  presentation: z.ZodOptional<z.ZodObject<{
2259
2514
  latex: z.ZodString;
@@ -2337,7 +2592,19 @@ declare const rtfContentCodec: z.ZodCodec<z.ZodCustom<Uint8Array<ArrayBuffer>, U
2337
2592
  producer: z.ZodOptional<z.ZodString>;
2338
2593
  createdIso: z.ZodOptional<z.ZodString>;
2339
2594
  modifiedIso: z.ZodOptional<z.ZodString>;
2595
+ lastPrintedIso: z.ZodOptional<z.ZodString>;
2340
2596
  language: z.ZodOptional<z.ZodString>;
2597
+ direction: z.ZodOptional<z.ZodEnum<{
2598
+ ltr: "ltr";
2599
+ rtl: "rtl";
2600
+ }>>;
2601
+ publisher: z.ZodOptional<z.ZodString>;
2602
+ contributor: z.ZodOptional<z.ZodString>;
2603
+ rights: z.ZodOptional<z.ZodString>;
2604
+ identifier: z.ZodOptional<z.ZodString>;
2605
+ comments: z.ZodOptional<z.ZodString>;
2606
+ company: z.ZodOptional<z.ZodString>;
2607
+ manager: z.ZodOptional<z.ZodString>;
2341
2608
  }, z.core.$strip>;
2342
2609
  }, z.core.$strip>], "kind">>;
2343
2610
  //#endregion
package/dist/read.cjs CHANGED
@@ -513,12 +513,15 @@ var ContentBuilder = class {
513
513
  rowSpan += 1;
514
514
  }
515
515
  const borders = this.resolveBorders(definition);
516
- const background = definition?.backgroundIndex === void 0 ? void 0 : this.header.colors[definition.backgroundIndex];
516
+ const backgroundColor = definition?.backgroundIndex === void 0 ? void 0 : this.header.colors[definition.backgroundIndex];
517
517
  return {
518
518
  blocks: cell.blocks,
519
519
  ...colSpan > 1 ? { colSpan } : {},
520
520
  ...rowSpan > 1 ? { rowSpan } : {},
521
- ...background === void 0 ? {} : { background },
521
+ ...backgroundColor === void 0 ? {} : { background: {
522
+ kind: "solid",
523
+ color: backgroundColor
524
+ } },
522
525
  ...borders === void 0 ? {} : { borders }
523
526
  };
524
527
  }) }));
@@ -641,7 +644,7 @@ function buildPicture(picture, sink) {
641
644
  sink({
642
645
  code: require_diagnostics.RtfDiagnosticCodes.UNSUPPORTED_PICTURE_FORMAT,
643
646
  severity: "warning",
644
- message: `a \\pict destination declared ${picture.unsupportedFormat ?? "no"} picture format; ContentImageBlock carries PNG and JPEG only, so this picture is dropped`
647
+ message: `a \\pict destination declared ${picture.unsupportedFormat ?? "no"} picture format; this reader recognises only \\pngblip and \\jpegblip, so this picture is dropped`
645
648
  });
646
649
  return;
647
650
  }
package/dist/read.js CHANGED
@@ -512,12 +512,15 @@ var ContentBuilder = class {
512
512
  rowSpan += 1;
513
513
  }
514
514
  const borders = this.resolveBorders(definition);
515
- const background = definition?.backgroundIndex === void 0 ? void 0 : this.header.colors[definition.backgroundIndex];
515
+ const backgroundColor = definition?.backgroundIndex === void 0 ? void 0 : this.header.colors[definition.backgroundIndex];
516
516
  return {
517
517
  blocks: cell.blocks,
518
518
  ...colSpan > 1 ? { colSpan } : {},
519
519
  ...rowSpan > 1 ? { rowSpan } : {},
520
- ...background === void 0 ? {} : { background },
520
+ ...backgroundColor === void 0 ? {} : { background: {
521
+ kind: "solid",
522
+ color: backgroundColor
523
+ } },
521
524
  ...borders === void 0 ? {} : { borders }
522
525
  };
523
526
  }) }));
@@ -640,7 +643,7 @@ function buildPicture(picture, sink) {
640
643
  sink({
641
644
  code: RtfDiagnosticCodes.UNSUPPORTED_PICTURE_FORMAT,
642
645
  severity: "warning",
643
- message: `a \\pict destination declared ${picture.unsupportedFormat ?? "no"} picture format; ContentImageBlock carries PNG and JPEG only, so this picture is dropped`
646
+ message: `a \\pict destination declared ${picture.unsupportedFormat ?? "no"} picture format; this reader recognises only \\pngblip and \\jpegblip, so this picture is dropped`
644
647
  });
645
648
  return;
646
649
  }
package/dist/write.cjs CHANGED
@@ -73,7 +73,7 @@ function collectTables(document) {
73
73
  return;
74
74
  }
75
75
  if (block.kind === "table") for (const row of block.rows) for (const cell of row.cells) {
76
- noteColor(cell.background);
76
+ noteColor(cell.background === void 0 ? void 0 : (0, document_schema_js.resolveCellFillColor)(cell.background));
77
77
  for (const side of CELL_BORDER_ORDER) noteColor(cell.borders?.[side]?.color);
78
78
  for (const inner of cell.blocks) noteBlock(inner);
79
79
  }
@@ -459,8 +459,9 @@ var RtfWriter = class {
459
459
  const border = borders[side];
460
460
  if (border !== void 0) out += require_cell_format.borderControlWords(side, border, colorIndexOf(border.color, this.tables.colors));
461
461
  }
462
- if (cell.background !== void 0) {
463
- const index = colorIndexOf(cell.background, this.tables.colors);
462
+ const cellBackgroundColor = cell.background === void 0 ? void 0 : (0, document_schema_js.resolveCellFillColor)(cell.background);
463
+ if (cellBackgroundColor !== void 0) {
464
+ const index = colorIndexOf(cellBackgroundColor, this.tables.colors);
464
465
  if (index !== void 0) out += `\\clcbpat${String(index)}`;
465
466
  }
466
467
  return `${out}\\cellx${String(rightTwips)}`;
@@ -477,6 +478,14 @@ var RtfWriter = class {
477
478
  }
478
479
  }
479
480
  writeImageParagraph(base64, image) {
481
+ if (image.format === "svg" || image.format === "gif") {
482
+ this.sink({
483
+ code: require_diagnostics.RtfDiagnosticCodes.UNSUPPORTED_PICTURE_FORMAT,
484
+ severity: "warning",
485
+ message: `an image block in ${image.format} format cannot be written: RTF's \\pict destination has no picture-type keyword for it, so the image is dropped rather than mislabelled as a format it is not`
486
+ });
487
+ return;
488
+ }
480
489
  const bytes = require_base64.base64ToBytes(base64);
481
490
  if (bytes === void 0 || bytes.length === 0) {
482
491
  this.sink({
package/dist/write.js CHANGED
@@ -4,7 +4,7 @@ import { pointsToHalfPoints, pointsToTwips } from "./units.js";
4
4
  import { borderControlWords } from "./cell-format.js";
5
5
  import { bookmarkResidueControlWords, dttmFromIso, isBookmarkAnchor } from "./constructs.js";
6
6
  import { parseRtfListNumId } from "./list-id.js";
7
- import { clampHeadingLevel, colorToRgbHex, flattenTree } from "document-schema.js";
7
+ import { clampHeadingLevel, colorToRgbHex, flattenTree, resolveCellFillColor } from "document-schema.js";
8
8
  //#region src/write.ts
9
9
  const LEVEL_NUMBER_FORMAT_BULLET = 23;
10
10
  const LEVEL_NUMBER_FORMAT_ARABIC = 0;
@@ -72,7 +72,7 @@ function collectTables(document) {
72
72
  return;
73
73
  }
74
74
  if (block.kind === "table") for (const row of block.rows) for (const cell of row.cells) {
75
- noteColor(cell.background);
75
+ noteColor(cell.background === void 0 ? void 0 : resolveCellFillColor(cell.background));
76
76
  for (const side of CELL_BORDER_ORDER) noteColor(cell.borders?.[side]?.color);
77
77
  for (const inner of cell.blocks) noteBlock(inner);
78
78
  }
@@ -458,8 +458,9 @@ var RtfWriter = class {
458
458
  const border = borders[side];
459
459
  if (border !== void 0) out += borderControlWords(side, border, colorIndexOf(border.color, this.tables.colors));
460
460
  }
461
- if (cell.background !== void 0) {
462
- const index = colorIndexOf(cell.background, this.tables.colors);
461
+ const cellBackgroundColor = cell.background === void 0 ? void 0 : resolveCellFillColor(cell.background);
462
+ if (cellBackgroundColor !== void 0) {
463
+ const index = colorIndexOf(cellBackgroundColor, this.tables.colors);
463
464
  if (index !== void 0) out += `\\clcbpat${String(index)}`;
464
465
  }
465
466
  return `${out}\\cellx${String(rightTwips)}`;
@@ -476,6 +477,14 @@ var RtfWriter = class {
476
477
  }
477
478
  }
478
479
  writeImageParagraph(base64, image) {
480
+ if (image.format === "svg" || image.format === "gif") {
481
+ this.sink({
482
+ code: RtfDiagnosticCodes.UNSUPPORTED_PICTURE_FORMAT,
483
+ severity: "warning",
484
+ message: `an image block in ${image.format} format cannot be written: RTF's \\pict destination has no picture-type keyword for it, so the image is dropped rather than mislabelled as a format it is not`
485
+ });
486
+ return;
487
+ }
479
488
  const bytes = base64ToBytes(base64);
480
489
  if (bytes === void 0 || bytes.length === 0) {
481
490
  this.sink({
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "rtf-codec",
3
- "version": "1.1.1",
3
+ "version": "2.0.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": {
@@ -78,7 +78,7 @@
78
78
  "license": "MIT",
79
79
  "packageManager": "pnpm@11.6.0",
80
80
  "dependencies": {
81
- "document-schema.js": "^5.5.1",
81
+ "document-schema.js": "^6.0.0",
82
82
  "zod": "^4.4.3"
83
83
  },
84
84
  "devDependencies": {