document-content-model 7.6.1 → 7.7.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.
Files changed (43) hide show
  1. package/dist/codec.d.cts +1 -1
  2. package/dist/codec.d.ts +1 -1
  3. package/dist/{content-PPcQWl8e.d.ts → content-BIM8bWWt.d.ts} +169 -23
  4. package/dist/{content-JIKLIrji.d.cts → content-DpsxyPMw.d.cts} +169 -23
  5. package/dist/content-json-schema-defs.cjs +32 -0
  6. package/dist/content-json-schema-defs.js +32 -0
  7. package/dist/content.cjs +37 -11
  8. package/dist/content.d.cts +2 -2
  9. package/dist/content.d.ts +2 -2
  10. package/dist/content.js +33 -12
  11. package/dist/decompose.d.cts +2 -2
  12. package/dist/decompose.d.ts +2 -2
  13. package/dist/definitions.cjs +1 -10
  14. package/dist/definitions.d.cts +1 -1
  15. package/dist/definitions.d.ts +1 -1
  16. package/dist/definitions.js +2 -11
  17. package/dist/factor-styles.cjs +1 -0
  18. package/dist/factor-styles.d.cts +1 -1
  19. package/dist/factor-styles.d.ts +1 -1
  20. package/dist/factor-styles.js +1 -0
  21. package/dist/flatten.cjs +1 -0
  22. package/dist/flatten.d.cts +1 -1
  23. package/dist/flatten.d.ts +1 -1
  24. package/dist/flatten.js +1 -0
  25. package/dist/index.cjs +5 -0
  26. package/dist/index.d.cts +3 -3
  27. package/dist/index.d.ts +3 -3
  28. package/dist/index.js +2 -2
  29. package/dist/{package-node-B4CHgiVQ.d.ts → package-node-B8LBrCCD.d.ts} +40 -27
  30. package/dist/{package-node-duDMdOvH.d.cts → package-node-CENJl5PH.d.cts} +40 -27
  31. package/dist/package-node.d.cts +1 -1
  32. package/dist/package-node.d.ts +1 -1
  33. package/dist/package.cjs +1 -0
  34. package/dist/package.d.cts +6 -1
  35. package/dist/package.d.ts +6 -1
  36. package/dist/package.js +2 -1
  37. package/dist/schema-io.cjs +2 -2
  38. package/dist/schema-io.d.cts +1 -1
  39. package/dist/schema-io.d.ts +1 -1
  40. package/dist/schema-io.js +2 -2
  41. package/package.json +1 -1
  42. package/schemas/content-document.schema.json +171 -13
  43. package/schemas/document-tree.schema.json +87 -3
@@ -9,8 +9,20 @@ import { z } from "zod";
9
9
  type FusedNode<T> = T & {
10
10
  frames?: LayoutFrame[];
11
11
  };
12
- declare const ContentRunSchema: z.ZodObject<{
13
- text: z.ZodString;
12
+ declare const RUN_FONT_PROPERTY_SHAPE: {
13
+ readonly bold: z.ZodOptional<z.ZodBoolean>;
14
+ readonly italic: z.ZodOptional<z.ZodBoolean>;
15
+ readonly underline: z.ZodOptional<z.ZodBoolean>;
16
+ readonly strike: z.ZodOptional<z.ZodBoolean>;
17
+ readonly fontFamily: z.ZodOptional<z.ZodString>;
18
+ readonly sizePt: z.ZodOptional<z.ZodNumber>;
19
+ readonly color: z.ZodOptional<z.ZodObject<{
20
+ r: z.ZodNumber;
21
+ g: z.ZodNumber;
22
+ b: z.ZodNumber;
23
+ }, z.core.$strip>>;
24
+ };
25
+ declare const ContentFontSchema: z.ZodObject<{
14
26
  bold: z.ZodOptional<z.ZodBoolean>;
15
27
  italic: z.ZodOptional<z.ZodBoolean>;
16
28
  underline: z.ZodOptional<z.ZodBoolean>;
@@ -22,6 +34,9 @@ declare const ContentRunSchema: z.ZodObject<{
22
34
  g: z.ZodNumber;
23
35
  b: z.ZodNumber;
24
36
  }, z.core.$strip>>;
37
+ }, z.core.$strip>;
38
+ type ContentFont = z.infer<typeof ContentFontSchema>;
39
+ declare const ContentRunSchema: z.ZodObject<{
25
40
  hyperlink: z.ZodOptional<z.ZodString>;
26
41
  verticalAlign: z.ZodOptional<z.ZodEnum<{
27
42
  superscript: "superscript";
@@ -59,6 +74,18 @@ declare const ContentRunSchema: z.ZodObject<{
59
74
  widthPt: z.ZodNumber;
60
75
  heightPt: z.ZodNumber;
61
76
  }, z.core.$strip>>>;
77
+ bold: z.ZodOptional<z.ZodBoolean>;
78
+ italic: z.ZodOptional<z.ZodBoolean>;
79
+ underline: z.ZodOptional<z.ZodBoolean>;
80
+ strike: z.ZodOptional<z.ZodBoolean>;
81
+ fontFamily: z.ZodOptional<z.ZodString>;
82
+ sizePt: z.ZodOptional<z.ZodNumber>;
83
+ color: z.ZodOptional<z.ZodObject<{
84
+ r: z.ZodNumber;
85
+ g: z.ZodNumber;
86
+ b: z.ZodNumber;
87
+ }, z.core.$strip>>;
88
+ text: z.ZodString;
62
89
  }, z.core.$strip>;
63
90
  type ContentRun = z.infer<typeof ContentRunSchema>;
64
91
  declare const ContentListMembershipSchema: z.ZodObject<{
@@ -355,18 +382,6 @@ type ContentParagraphBorders = z.infer<typeof ContentParagraphBordersSchema>;
355
382
  declare const ContentParagraphSchema: z.ZodObject<{
356
383
  kind: z.ZodLiteral<"paragraph">;
357
384
  runs: z.ZodArray<z.ZodObject<{
358
- text: z.ZodString;
359
- bold: z.ZodOptional<z.ZodBoolean>;
360
- italic: z.ZodOptional<z.ZodBoolean>;
361
- underline: z.ZodOptional<z.ZodBoolean>;
362
- strike: z.ZodOptional<z.ZodBoolean>;
363
- fontFamily: z.ZodOptional<z.ZodString>;
364
- sizePt: z.ZodOptional<z.ZodNumber>;
365
- color: z.ZodOptional<z.ZodObject<{
366
- r: z.ZodNumber;
367
- g: z.ZodNumber;
368
- b: z.ZodNumber;
369
- }, z.core.$strip>>;
370
385
  hyperlink: z.ZodOptional<z.ZodString>;
371
386
  verticalAlign: z.ZodOptional<z.ZodEnum<{
372
387
  superscript: "superscript";
@@ -404,6 +419,18 @@ declare const ContentParagraphSchema: z.ZodObject<{
404
419
  widthPt: z.ZodNumber;
405
420
  heightPt: z.ZodNumber;
406
421
  }, z.core.$strip>>>;
422
+ bold: z.ZodOptional<z.ZodBoolean>;
423
+ italic: z.ZodOptional<z.ZodBoolean>;
424
+ underline: z.ZodOptional<z.ZodBoolean>;
425
+ strike: z.ZodOptional<z.ZodBoolean>;
426
+ fontFamily: z.ZodOptional<z.ZodString>;
427
+ sizePt: z.ZodOptional<z.ZodNumber>;
428
+ color: z.ZodOptional<z.ZodObject<{
429
+ r: z.ZodNumber;
430
+ g: z.ZodNumber;
431
+ b: z.ZodNumber;
432
+ }, z.core.$strip>>;
433
+ text: z.ZodString;
407
434
  }, z.core.$strip>>;
408
435
  constructs: z.ZodOptional<z.ZodArray<z.ZodObject<{
409
436
  descriptor: z.ZodDiscriminatedUnion<[z.ZodObject<{
@@ -883,6 +910,17 @@ declare const ContentFloatPositionSchema: z.ZodObject<{
883
910
  }, z.core.$strict>]>;
884
911
  }, z.core.$strip>;
885
912
  type ContentFloatPosition = z.infer<typeof ContentFloatPositionSchema>;
913
+ declare const IMAGE_FORMATS: readonly ["png", "jpeg", "svg", "gif"];
914
+ type ImageFormat = (typeof IMAGE_FORMATS)[number];
915
+ declare const ContentImageOriginalSchema: z.ZodObject<{
916
+ filter: z.ZodEnum<{
917
+ jbig2: "jbig2";
918
+ jpeg2000: "jpeg2000";
919
+ }>;
920
+ base64: z.ZodString;
921
+ jbig2GlobalsBase64: z.ZodOptional<z.ZodString>;
922
+ }, z.core.$strip>;
923
+ type ContentImageOriginal = z.infer<typeof ContentImageOriginalSchema>;
886
924
  declare const ContentImageBlockSchema: z.ZodObject<{
887
925
  kind: z.ZodLiteral<"image">;
888
926
  format: z.ZodEnum<{
@@ -895,6 +933,14 @@ declare const ContentImageBlockSchema: z.ZodObject<{
895
933
  widthPt: z.ZodNumber;
896
934
  heightPt: z.ZodNumber;
897
935
  altText: z.ZodOptional<z.ZodString>;
936
+ original: z.ZodOptional<z.ZodObject<{
937
+ filter: z.ZodEnum<{
938
+ jbig2: "jbig2";
939
+ jpeg2000: "jpeg2000";
940
+ }>;
941
+ base64: z.ZodString;
942
+ jbig2GlobalsBase64: z.ZodOptional<z.ZodString>;
943
+ }, z.core.$strip>>;
898
944
  floatPosition: z.ZodOptional<z.ZodObject<{
899
945
  horizontal: z.ZodUnion<readonly [z.ZodObject<{
900
946
  relativeTo: z.ZodEnum<{
@@ -1608,8 +1654,7 @@ declare const ContentEmbeddedObjectBlockSchema: z.ZodObject<{
1608
1654
  formula: z.ZodOptional<z.ZodString>;
1609
1655
  displayText: z.ZodString;
1610
1656
  numberFormatCode: z.ZodOptional<z.ZodString>;
1611
- runs: z.ZodOptional<z.ZodArray<z.ZodObject<{
1612
- text: z.ZodString;
1657
+ font: z.ZodOptional<z.ZodObject<{
1613
1658
  bold: z.ZodOptional<z.ZodBoolean>;
1614
1659
  italic: z.ZodOptional<z.ZodBoolean>;
1615
1660
  underline: z.ZodOptional<z.ZodBoolean>;
@@ -1621,6 +1666,8 @@ declare const ContentEmbeddedObjectBlockSchema: z.ZodObject<{
1621
1666
  g: z.ZodNumber;
1622
1667
  b: z.ZodNumber;
1623
1668
  }, z.core.$strip>>;
1669
+ }, z.core.$strip>>;
1670
+ runs: z.ZodOptional<z.ZodArray<z.ZodObject<{
1624
1671
  hyperlink: z.ZodOptional<z.ZodString>;
1625
1672
  verticalAlign: z.ZodOptional<z.ZodEnum<{
1626
1673
  superscript: "superscript";
@@ -1658,6 +1705,18 @@ declare const ContentEmbeddedObjectBlockSchema: z.ZodObject<{
1658
1705
  widthPt: z.ZodNumber;
1659
1706
  heightPt: z.ZodNumber;
1660
1707
  }, z.core.$strip>>>;
1708
+ bold: z.ZodOptional<z.ZodBoolean>;
1709
+ italic: z.ZodOptional<z.ZodBoolean>;
1710
+ underline: z.ZodOptional<z.ZodBoolean>;
1711
+ strike: z.ZodOptional<z.ZodBoolean>;
1712
+ fontFamily: z.ZodOptional<z.ZodString>;
1713
+ sizePt: z.ZodOptional<z.ZodNumber>;
1714
+ color: z.ZodOptional<z.ZodObject<{
1715
+ r: z.ZodNumber;
1716
+ g: z.ZodNumber;
1717
+ b: z.ZodNumber;
1718
+ }, z.core.$strip>>;
1719
+ text: z.ZodString;
1661
1720
  }, z.core.$strip>>>;
1662
1721
  colSpan: z.ZodOptional<z.ZodNumber>;
1663
1722
  rowSpan: z.ZodOptional<z.ZodNumber>;
@@ -1892,6 +1951,14 @@ declare const ContentEmbeddedObjectBlockSchema: z.ZodObject<{
1892
1951
  widthPt: z.ZodNumber;
1893
1952
  heightPt: z.ZodNumber;
1894
1953
  altText: z.ZodOptional<z.ZodString>;
1954
+ original: z.ZodOptional<z.ZodObject<{
1955
+ filter: z.ZodEnum<{
1956
+ jbig2: "jbig2";
1957
+ jpeg2000: "jpeg2000";
1958
+ }>;
1959
+ base64: z.ZodString;
1960
+ jbig2GlobalsBase64: z.ZodOptional<z.ZodString>;
1961
+ }, z.core.$strip>>;
1895
1962
  floatPosition: z.ZodOptional<z.ZodObject<{
1896
1963
  horizontal: z.ZodUnion<readonly [z.ZodObject<{
1897
1964
  relativeTo: z.ZodEnum<{
@@ -2706,6 +2773,11 @@ declare const ContentEmbeddedObjectBlockSchema: z.ZodObject<{
2706
2773
  xml: z.ZodString;
2707
2774
  }, z.core.$strict>>;
2708
2775
  }, z.core.$strip>>;
2776
+ names: z.ZodOptional<z.ZodArray<z.ZodObject<{
2777
+ name: z.ZodString;
2778
+ refersTo: z.ZodString;
2779
+ scopeSheetIndex: z.ZodOptional<z.ZodNumber>;
2780
+ }, z.core.$strip>>>;
2709
2781
  symbolTable: z.ZodOptional<z.ZodObject<{
2710
2782
  symbols: z.ZodArray<z.ZodObject<{
2711
2783
  glyph: z.ZodString;
@@ -4619,8 +4691,7 @@ declare const ContentSheetCellSchema: z.ZodObject<{
4619
4691
  formula: z.ZodOptional<z.ZodString>;
4620
4692
  displayText: z.ZodString;
4621
4693
  numberFormatCode: z.ZodOptional<z.ZodString>;
4622
- runs: z.ZodOptional<z.ZodArray<z.ZodObject<{
4623
- text: z.ZodString;
4694
+ font: z.ZodOptional<z.ZodObject<{
4624
4695
  bold: z.ZodOptional<z.ZodBoolean>;
4625
4696
  italic: z.ZodOptional<z.ZodBoolean>;
4626
4697
  underline: z.ZodOptional<z.ZodBoolean>;
@@ -4632,6 +4703,8 @@ declare const ContentSheetCellSchema: z.ZodObject<{
4632
4703
  g: z.ZodNumber;
4633
4704
  b: z.ZodNumber;
4634
4705
  }, z.core.$strip>>;
4706
+ }, z.core.$strip>>;
4707
+ runs: z.ZodOptional<z.ZodArray<z.ZodObject<{
4635
4708
  hyperlink: z.ZodOptional<z.ZodString>;
4636
4709
  verticalAlign: z.ZodOptional<z.ZodEnum<{
4637
4710
  superscript: "superscript";
@@ -4669,6 +4742,18 @@ declare const ContentSheetCellSchema: z.ZodObject<{
4669
4742
  widthPt: z.ZodNumber;
4670
4743
  heightPt: z.ZodNumber;
4671
4744
  }, z.core.$strip>>>;
4745
+ bold: z.ZodOptional<z.ZodBoolean>;
4746
+ italic: z.ZodOptional<z.ZodBoolean>;
4747
+ underline: z.ZodOptional<z.ZodBoolean>;
4748
+ strike: z.ZodOptional<z.ZodBoolean>;
4749
+ fontFamily: z.ZodOptional<z.ZodString>;
4750
+ sizePt: z.ZodOptional<z.ZodNumber>;
4751
+ color: z.ZodOptional<z.ZodObject<{
4752
+ r: z.ZodNumber;
4753
+ g: z.ZodNumber;
4754
+ b: z.ZodNumber;
4755
+ }, z.core.$strip>>;
4756
+ text: z.ZodString;
4672
4757
  }, z.core.$strip>>>;
4673
4758
  colSpan: z.ZodOptional<z.ZodNumber>;
4674
4759
  rowSpan: z.ZodOptional<z.ZodNumber>;
@@ -5665,6 +5750,14 @@ declare const ContentSheetImageSchema: z.ZodObject<{
5665
5750
  widthPt: z.ZodNumber;
5666
5751
  heightPt: z.ZodNumber;
5667
5752
  altText: z.ZodOptional<z.ZodString>;
5753
+ original: z.ZodOptional<z.ZodObject<{
5754
+ filter: z.ZodEnum<{
5755
+ jbig2: "jbig2";
5756
+ jpeg2000: "jpeg2000";
5757
+ }>;
5758
+ base64: z.ZodString;
5759
+ jbig2GlobalsBase64: z.ZodOptional<z.ZodString>;
5760
+ }, z.core.$strip>>;
5668
5761
  floatPosition: z.ZodOptional<z.ZodObject<{
5669
5762
  horizontal: z.ZodUnion<readonly [z.ZodObject<{
5670
5763
  relativeTo: z.ZodEnum<{
@@ -5829,8 +5922,7 @@ declare const ContentSheetSchema: z.ZodObject<{
5829
5922
  formula: z.ZodOptional<z.ZodString>;
5830
5923
  displayText: z.ZodString;
5831
5924
  numberFormatCode: z.ZodOptional<z.ZodString>;
5832
- runs: z.ZodOptional<z.ZodArray<z.ZodObject<{
5833
- text: z.ZodString;
5925
+ font: z.ZodOptional<z.ZodObject<{
5834
5926
  bold: z.ZodOptional<z.ZodBoolean>;
5835
5927
  italic: z.ZodOptional<z.ZodBoolean>;
5836
5928
  underline: z.ZodOptional<z.ZodBoolean>;
@@ -5842,6 +5934,8 @@ declare const ContentSheetSchema: z.ZodObject<{
5842
5934
  g: z.ZodNumber;
5843
5935
  b: z.ZodNumber;
5844
5936
  }, z.core.$strip>>;
5937
+ }, z.core.$strip>>;
5938
+ runs: z.ZodOptional<z.ZodArray<z.ZodObject<{
5845
5939
  hyperlink: z.ZodOptional<z.ZodString>;
5846
5940
  verticalAlign: z.ZodOptional<z.ZodEnum<{
5847
5941
  superscript: "superscript";
@@ -5879,6 +5973,18 @@ declare const ContentSheetSchema: z.ZodObject<{
5879
5973
  widthPt: z.ZodNumber;
5880
5974
  heightPt: z.ZodNumber;
5881
5975
  }, z.core.$strip>>>;
5976
+ bold: z.ZodOptional<z.ZodBoolean>;
5977
+ italic: z.ZodOptional<z.ZodBoolean>;
5978
+ underline: z.ZodOptional<z.ZodBoolean>;
5979
+ strike: z.ZodOptional<z.ZodBoolean>;
5980
+ fontFamily: z.ZodOptional<z.ZodString>;
5981
+ sizePt: z.ZodOptional<z.ZodNumber>;
5982
+ color: z.ZodOptional<z.ZodObject<{
5983
+ r: z.ZodNumber;
5984
+ g: z.ZodNumber;
5985
+ b: z.ZodNumber;
5986
+ }, z.core.$strip>>;
5987
+ text: z.ZodString;
5882
5988
  }, z.core.$strip>>>;
5883
5989
  colSpan: z.ZodOptional<z.ZodNumber>;
5884
5990
  rowSpan: z.ZodOptional<z.ZodNumber>;
@@ -6113,6 +6219,14 @@ declare const ContentSheetSchema: z.ZodObject<{
6113
6219
  widthPt: z.ZodNumber;
6114
6220
  heightPt: z.ZodNumber;
6115
6221
  altText: z.ZodOptional<z.ZodString>;
6222
+ original: z.ZodOptional<z.ZodObject<{
6223
+ filter: z.ZodEnum<{
6224
+ jbig2: "jbig2";
6225
+ jpeg2000: "jpeg2000";
6226
+ }>;
6227
+ base64: z.ZodString;
6228
+ jbig2GlobalsBase64: z.ZodOptional<z.ZodString>;
6229
+ }, z.core.$strip>>;
6116
6230
  floatPosition: z.ZodOptional<z.ZodObject<{
6117
6231
  horizontal: z.ZodUnion<readonly [z.ZodObject<{
6118
6232
  relativeTo: z.ZodEnum<{
@@ -8133,6 +8247,12 @@ declare const contentDocumentSharedFields: {
8133
8247
  }, z.core.$strip>>>;
8134
8248
  }, z.core.$strip>>;
8135
8249
  };
8250
+ declare const ContentDefinedNameSchema: z.ZodObject<{
8251
+ name: z.ZodString;
8252
+ refersTo: z.ZodString;
8253
+ scopeSheetIndex: z.ZodOptional<z.ZodNumber>;
8254
+ }, z.core.$strip>;
8255
+ type ContentDefinedName = z.infer<typeof ContentDefinedNameSchema>;
8136
8256
  declare const ContentDocumentSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
8137
8257
  sections: z.ZodArray<z.ZodObject<{
8138
8258
  pageSize: z.ZodObject<{
@@ -8434,8 +8554,7 @@ declare const ContentDocumentSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
8434
8554
  formula: z.ZodOptional<z.ZodString>;
8435
8555
  displayText: z.ZodString;
8436
8556
  numberFormatCode: z.ZodOptional<z.ZodString>;
8437
- runs: z.ZodOptional<z.ZodArray<z.ZodObject<{
8438
- text: z.ZodString;
8557
+ font: z.ZodOptional<z.ZodObject<{
8439
8558
  bold: z.ZodOptional<z.ZodBoolean>;
8440
8559
  italic: z.ZodOptional<z.ZodBoolean>;
8441
8560
  underline: z.ZodOptional<z.ZodBoolean>;
@@ -8447,6 +8566,8 @@ declare const ContentDocumentSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
8447
8566
  g: z.ZodNumber;
8448
8567
  b: z.ZodNumber;
8449
8568
  }, z.core.$strip>>;
8569
+ }, z.core.$strip>>;
8570
+ runs: z.ZodOptional<z.ZodArray<z.ZodObject<{
8450
8571
  hyperlink: z.ZodOptional<z.ZodString>;
8451
8572
  verticalAlign: z.ZodOptional<z.ZodEnum<{
8452
8573
  superscript: "superscript";
@@ -8484,6 +8605,18 @@ declare const ContentDocumentSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
8484
8605
  widthPt: z.ZodNumber;
8485
8606
  heightPt: z.ZodNumber;
8486
8607
  }, z.core.$strip>>>;
8608
+ bold: z.ZodOptional<z.ZodBoolean>;
8609
+ italic: z.ZodOptional<z.ZodBoolean>;
8610
+ underline: z.ZodOptional<z.ZodBoolean>;
8611
+ strike: z.ZodOptional<z.ZodBoolean>;
8612
+ fontFamily: z.ZodOptional<z.ZodString>;
8613
+ sizePt: z.ZodOptional<z.ZodNumber>;
8614
+ color: z.ZodOptional<z.ZodObject<{
8615
+ r: z.ZodNumber;
8616
+ g: z.ZodNumber;
8617
+ b: z.ZodNumber;
8618
+ }, z.core.$strip>>;
8619
+ text: z.ZodString;
8487
8620
  }, z.core.$strip>>>;
8488
8621
  colSpan: z.ZodOptional<z.ZodNumber>;
8489
8622
  rowSpan: z.ZodOptional<z.ZodNumber>;
@@ -8718,6 +8851,14 @@ declare const ContentDocumentSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
8718
8851
  widthPt: z.ZodNumber;
8719
8852
  heightPt: z.ZodNumber;
8720
8853
  altText: z.ZodOptional<z.ZodString>;
8854
+ original: z.ZodOptional<z.ZodObject<{
8855
+ filter: z.ZodEnum<{
8856
+ jbig2: "jbig2";
8857
+ jpeg2000: "jpeg2000";
8858
+ }>;
8859
+ base64: z.ZodString;
8860
+ jbig2GlobalsBase64: z.ZodOptional<z.ZodString>;
8861
+ }, z.core.$strip>>;
8721
8862
  floatPosition: z.ZodOptional<z.ZodObject<{
8722
8863
  horizontal: z.ZodUnion<readonly [z.ZodObject<{
8723
8864
  relativeTo: z.ZodEnum<{
@@ -9532,6 +9673,11 @@ declare const ContentDocumentSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
9532
9673
  xml: z.ZodString;
9533
9674
  }, z.core.$strict>>;
9534
9675
  }, z.core.$strip>>;
9676
+ names: z.ZodOptional<z.ZodArray<z.ZodObject<{
9677
+ name: z.ZodString;
9678
+ refersTo: z.ZodString;
9679
+ scopeSheetIndex: z.ZodOptional<z.ZodNumber>;
9680
+ }, z.core.$strip>>>;
9535
9681
  symbolTable: z.ZodOptional<z.ZodObject<{
9536
9682
  symbols: z.ZodArray<z.ZodObject<{
9537
9683
  glyph: z.ZodString;
@@ -10270,4 +10416,4 @@ declare const ContentDocumentSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
10270
10416
  }, z.core.$strip>], "kind">;
10271
10417
  type ContentDocument = z.infer<typeof ContentDocumentSchema>;
10272
10418
  //#endregion
10273
- export { ContentPageBreak as $, ContentStrokeStyle as $t, ContentFillPatternSchema as A, ContentSheetDataValidation as At, ContentFormulaSchema as B, ContentSheetRange as Bt, ContentDrawPageSchema as C, isContentBlock as Cn, ContentSheetColumnSchema as Ct, ContentEmbeddedObjectKind as D, resolveCellFillColor as Dn, ContentSheetConditionalFormatStyleSchema as Dt, ContentEmbeddedObjectBlockSchema as E, isRunConstructExtent as En, ContentSheetConditionalFormatStyle as Et, ContentFloatOrigin as F, ContentSheetImageSchema as Ft, ContentHatchFill as G, ContentSheetRowSchema as Gt, ContentGradientFillSchema as H, ContentSheetRepeatRange as Ht, ContentFloatOriginSchema as I, ContentSheetPrintRange as It, ContentHatchStyleSchema as J, ContentSlideSchema as Jt, ContentHatchFillSchema as K, ContentSheetSchema as Kt, ContentFloatPosition as L, ContentSheetPrintRangeSchema as Lt, ContentFloatAlignSchema as M, ContentSheetDataValidationType as Mt, ContentFloatAxis as N, ContentSheetDataValidationTypeSchema as Nt, ContentEmbeddedObjectSchema as O, unrecognizedFillKind as On, ContentSheetConditionalFormatValue as Ot, ContentFloatAxisSchema as P, ContentSheetImage as Pt, ContentListMembershipSchema as Q, ContentStrokeSchema as Qt, ContentFloatPositionSchema as R, ContentSheetPrintSettings as Rt, ContentDrawPage as S, findRunConstructFault as Sn, ContentSheetColumn as St, ContentEmbeddedObjectBlock as T, isContentConstructStart as Tn, ContentSheetConditionalFormatSchema as Tt, ContentGradientStyle as U, ContentSheetRepeatRangeSchema as Ut, ContentGradientFill as V, ContentSheetRangeSchema as Vt, ContentGradientStyleSchema as W, ContentSheetRow as Wt, ContentImageBlockSchema as X, ContentStrokeDash as Xt, ContentImageBlock as Y, ContentStroke as Yt, ContentListMembership as Z, ContentStrokeDashSchema as Zt, ContentConstructEndSchema as _, SheetRuleOperator as _n, ContentSheet as _t, ContentBlockSchema as a, ContentTableCellSchema as an, ContentParagraphBordersSchema as at, ContentDocument as b, contentDocumentSharedFields as bn, ContentSheetCellCommentSchema as bt, ContentCellBorders as c, ContentTableSchema as cn, ContentPathPointSchema as ct, ContentCellFillSchema as d, DecimalString as dn, ContentRun as dt, ContentStrokeStyleSchema as en, ContentPageBreakSchema as et, ContentCellPatternType as f, DecimalStringSchema as fn, ContentRunSchema as ft, ContentConstructEnd as g, RunConstructFault as gn, ContentShapeSchema as gt, ContentCellValueSchema as h, RunConstructExtentSchema as hn, ContentShape as ht, ContentBlock as i, ContentTableCell as in, ContentParagraphBorders as it, ContentFloatAlign as j, ContentSheetDataValidationSchema as jt, ContentFillPattern as k, ContentSheetConditionalFormatValueSchema as kt, ContentCellBordersSchema as l, ContentVector as ln, ContentPathSegment as lt, ContentCellValue as m, RunConstructExtent as mn, ContentSectionSchema as mt, ContentBitmapFill as n, ContentSubpathSchema as nn, ContentPageFurnitureSchema as nt, ContentBorder as o, ContentTableRow as on, ContentParagraphSchema as ot, ContentCellPatternTypeSchema as p, FusedNode as pn, ContentSection as pt, ContentHatchStyle as q, ContentSlide as qt, ContentBitmapFillSchema as r, ContentTable as rn, ContentParagraph as rt, ContentBorderSchema as s, ContentTableRowSchema as sn, ContentPathPoint as st, ConstructMarkerImbalance as t, ContentSubpath as tn, ContentPageFurniture as tt, ContentCellFill as u, ContentVectorSchema as un, ContentPathSegmentSchema as ut, ContentConstructStart as v, SheetRuleOperatorSchema as vn, ContentSheetCell as vt, ContentEmbeddedObject as w, isContentConstructEnd as wn, ContentSheetConditionalFormat as wt, ContentDocumentSchema as x, findConstructMarkerImbalance as xn, ContentSheetCellSchema as xt, ContentConstructStartSchema as y, clampHeadingLevel as yn, ContentSheetCellComment as yt, ContentFormula as z, ContentSheetPrintSettingsSchema as zt };
10419
+ export { ContentImageBlock as $, ContentSlide as $t, ContentEmbeddedObjectSchema as A, findConstructMarkerImbalance as An, ContentSheetConditionalFormat as At, ContentFloatPositionSchema as B, ContentSheetImage as Bt, ContentDocumentSchema as C, RunConstructExtent as Cn, ContentSheet as Ct, ContentEmbeddedObjectBlock as D, SheetRuleOperatorSchema as Dn, ContentSheetCellSchema as Dt, ContentEmbeddedObject as E, SheetRuleOperator as En, ContentSheetCellCommentSchema as Et, ContentFloatAxis as F, isRunConstructExtent as Fn, ContentSheetConditionalFormatValueSchema as Ft, ContentGradientFill as G, ContentSheetPrintSettingsSchema as Gt, ContentFontSchema as H, ContentSheetPrintRange as Ht, ContentFloatAxisSchema as I, resolveCellFillColor as In, ContentSheetDataValidation as It, ContentGradientStyleSchema as J, ContentSheetRepeatRange as Jt, ContentGradientFillSchema as K, ContentSheetRange as Kt, ContentFloatOrigin as L, unrecognizedFillKind as Ln, ContentSheetDataValidationSchema as Lt, ContentFillPatternSchema as M, isContentBlock as Mn, ContentSheetConditionalFormatStyle as Mt, ContentFloatAlign as N, isContentConstructEnd as Nn, ContentSheetConditionalFormatStyleSchema as Nt, ContentEmbeddedObjectBlockSchema as O, clampHeadingLevel as On, ContentSheetColumn as Ot, ContentFloatAlignSchema as P, isContentConstructStart as Pn, ContentSheetConditionalFormatValue as Pt, ContentHatchStyleSchema as Q, ContentSheetSchema as Qt, ContentFloatOriginSchema as R, ContentSheetDataValidationType as Rt, ContentDocument as S, RUN_FONT_PROPERTY_SHAPE as Sn, ContentShapeSchema as St, ContentDrawPageSchema as T, RunConstructFault as Tn, ContentSheetCellComment as Tt, ContentFormula as U, ContentSheetPrintRangeSchema as Ut, ContentFont as V, ContentSheetImageSchema as Vt, ContentFormulaSchema as W, ContentSheetPrintSettings as Wt, ContentHatchFillSchema as X, ContentSheetRow as Xt, ContentHatchFill as Y, ContentSheetRepeatRangeSchema as Yt, ContentHatchStyle as Z, ContentSheetRowSchema as Zt, ContentConstructEndSchema as _, DecimalString as _n, ContentRun as _t, ContentBlockSchema as a, ContentStrokeStyle as an, ContentPageBreak as at, ContentDefinedName as b, IMAGE_FORMATS as bn, ContentSectionSchema as bt, ContentCellBorders as c, ContentSubpathSchema as cn, ContentPageFurnitureSchema as ct, ContentCellFillSchema as d, ContentTableCellSchema as dn, ContentParagraphBordersSchema as dt, ContentSlideSchema as en, ContentImageBlockSchema as et, ContentCellPatternType as f, ContentTableRow as fn, ContentParagraphSchema as ft, ContentConstructEnd as g, ContentVectorSchema as gn, ContentPathSegmentSchema as gt, ContentCellValueSchema as h, ContentVector as hn, ContentPathSegment as ht, ContentBlock as i, ContentStrokeSchema as in, ContentListMembershipSchema as it, ContentFillPattern as j, findRunConstructFault as jn, ContentSheetConditionalFormatSchema as jt, ContentEmbeddedObjectKind as k, contentDocumentSharedFields as kn, ContentSheetColumnSchema as kt, ContentCellBordersSchema as l, ContentTable as ln, ContentParagraph as lt, ContentCellValue as m, ContentTableSchema as mn, ContentPathPointSchema as mt, ContentBitmapFill as n, ContentStrokeDash as nn, ContentImageOriginalSchema as nt, ContentBorder as o, ContentStrokeStyleSchema as on, ContentPageBreakSchema as ot, ContentCellPatternTypeSchema as p, ContentTableRowSchema as pn, ContentPathPoint as pt, ContentGradientStyle as q, ContentSheetRangeSchema as qt, ContentBitmapFillSchema as r, ContentStrokeDashSchema as rn, ContentListMembership as rt, ContentBorderSchema as s, ContentSubpath as sn, ContentPageFurniture as st, ConstructMarkerImbalance as t, ContentStroke as tn, ContentImageOriginal as tt, ContentCellFill as u, ContentTableCell as un, ContentParagraphBorders as ut, ContentConstructStart as v, DecimalStringSchema as vn, ContentRunSchema as vt, ContentDrawPage as w, RunConstructExtentSchema as wn, ContentSheetCell as wt, ContentDefinedNameSchema as x, ImageFormat as xn, ContentShape as xt, ContentConstructStartSchema as y, FusedNode as yn, ContentSection as yt, ContentFloatPosition as z, ContentSheetDataValidationTypeSchema as zt };
@@ -495,6 +495,19 @@ const CONTENT_DEFS = {
495
495
  required: ["horizontal", "vertical"],
496
496
  additionalProperties: false
497
497
  },
498
+ ContentImageOriginal: {
499
+ type: "object",
500
+ properties: {
501
+ filter: {
502
+ type: "string",
503
+ enum: ["jbig2", "jpeg2000"]
504
+ },
505
+ base64: { type: "string" },
506
+ jbig2GlobalsBase64: { type: "string" }
507
+ },
508
+ required: ["filter", "base64"],
509
+ additionalProperties: false
510
+ },
498
511
  ContentImageBlock: {
499
512
  type: "object",
500
513
  properties: {
@@ -521,6 +534,7 @@ const CONTENT_DEFS = {
521
534
  exclusiveMinimum: 0
522
535
  },
523
536
  altText: { type: "string" },
537
+ original: { $ref: "#/$defs/ContentImageOriginal" },
524
538
  floatPosition: { $ref: "#/$defs/ContentFloatPosition" },
525
539
  sourcePath: { type: "string" },
526
540
  source: { $ref: "#/$defs/SourceResidue" },
@@ -1040,6 +1054,22 @@ const CONTENT_DEFS = {
1040
1054
  ],
1041
1055
  additionalProperties: false
1042
1056
  },
1057
+ ContentFont: {
1058
+ type: "object",
1059
+ properties: {
1060
+ bold: { type: "boolean" },
1061
+ italic: { type: "boolean" },
1062
+ underline: { type: "boolean" },
1063
+ strike: { type: "boolean" },
1064
+ fontFamily: { type: "string" },
1065
+ sizePt: {
1066
+ type: "number",
1067
+ exclusiveMinimum: 0
1068
+ },
1069
+ color: { $ref: "#/$defs/Color" }
1070
+ },
1071
+ additionalProperties: false
1072
+ },
1043
1073
  ContentSheetCell: {
1044
1074
  type: "object",
1045
1075
  properties: {
@@ -1057,6 +1087,7 @@ const CONTENT_DEFS = {
1057
1087
  formula: { type: "string" },
1058
1088
  displayText: { type: "string" },
1059
1089
  numberFormatCode: { type: "string" },
1090
+ font: { $ref: "#/$defs/ContentFont" },
1060
1091
  runs: {
1061
1092
  type: "array",
1062
1093
  items: { $ref: "#/$defs/ContentRun" }
@@ -1854,6 +1885,7 @@ const CONTENT_DEFS = {
1854
1885
  exclusiveMinimum: 0
1855
1886
  },
1856
1887
  altText: { type: "string" },
1888
+ original: { $ref: "#/$defs/ContentImageOriginal" },
1857
1889
  floatPosition: { $ref: "#/$defs/ContentFloatPosition" },
1858
1890
  sourcePath: { type: "string" },
1859
1891
  source: { $ref: "#/$defs/SourceResidue" },
@@ -494,6 +494,19 @@ const CONTENT_DEFS = {
494
494
  required: ["horizontal", "vertical"],
495
495
  additionalProperties: false
496
496
  },
497
+ ContentImageOriginal: {
498
+ type: "object",
499
+ properties: {
500
+ filter: {
501
+ type: "string",
502
+ enum: ["jbig2", "jpeg2000"]
503
+ },
504
+ base64: { type: "string" },
505
+ jbig2GlobalsBase64: { type: "string" }
506
+ },
507
+ required: ["filter", "base64"],
508
+ additionalProperties: false
509
+ },
497
510
  ContentImageBlock: {
498
511
  type: "object",
499
512
  properties: {
@@ -520,6 +533,7 @@ const CONTENT_DEFS = {
520
533
  exclusiveMinimum: 0
521
534
  },
522
535
  altText: { type: "string" },
536
+ original: { $ref: "#/$defs/ContentImageOriginal" },
523
537
  floatPosition: { $ref: "#/$defs/ContentFloatPosition" },
524
538
  sourcePath: { type: "string" },
525
539
  source: { $ref: "#/$defs/SourceResidue" },
@@ -1039,6 +1053,22 @@ const CONTENT_DEFS = {
1039
1053
  ],
1040
1054
  additionalProperties: false
1041
1055
  },
1056
+ ContentFont: {
1057
+ type: "object",
1058
+ properties: {
1059
+ bold: { type: "boolean" },
1060
+ italic: { type: "boolean" },
1061
+ underline: { type: "boolean" },
1062
+ strike: { type: "boolean" },
1063
+ fontFamily: { type: "string" },
1064
+ sizePt: {
1065
+ type: "number",
1066
+ exclusiveMinimum: 0
1067
+ },
1068
+ color: { $ref: "#/$defs/Color" }
1069
+ },
1070
+ additionalProperties: false
1071
+ },
1042
1072
  ContentSheetCell: {
1043
1073
  type: "object",
1044
1074
  properties: {
@@ -1056,6 +1086,7 @@ const CONTENT_DEFS = {
1056
1086
  formula: { type: "string" },
1057
1087
  displayText: { type: "string" },
1058
1088
  numberFormatCode: { type: "string" },
1089
+ font: { $ref: "#/$defs/ContentFont" },
1059
1090
  runs: {
1060
1091
  type: "array",
1061
1092
  items: { $ref: "#/$defs/ContentRun" }
@@ -1853,6 +1884,7 @@ const CONTENT_DEFS = {
1853
1884
  exclusiveMinimum: 0
1854
1885
  },
1855
1886
  altText: { type: "string" },
1887
+ original: { $ref: "#/$defs/ContentImageOriginal" },
1856
1888
  floatPosition: { $ref: "#/$defs/ContentFloatPosition" },
1857
1889
  sourcePath: { type: "string" },
1858
1890
  source: { $ref: "#/$defs/SourceResidue" },
package/dist/content.cjs CHANGED
@@ -9,15 +9,19 @@ const require_style = require("./style.cjs");
9
9
  const require_metadata = require("./metadata.cjs");
10
10
  let zod = require("zod");
11
11
  //#region src/content.ts
12
- const ContentRunSchema = zod.z.object({
13
- text: zod.z.string(),
12
+ const RUN_FONT_PROPERTY_SHAPE = {
14
13
  bold: zod.z.boolean().optional(),
15
14
  italic: zod.z.boolean().optional(),
16
15
  underline: zod.z.boolean().optional(),
17
16
  strike: zod.z.boolean().optional(),
18
17
  fontFamily: zod.z.string().optional(),
19
18
  sizePt: zod.z.number().positive().optional(),
20
- color: require_color.ColorSchema.optional(),
19
+ color: require_color.ColorSchema.optional()
20
+ };
21
+ const ContentFontSchema = zod.z.object(RUN_FONT_PROPERTY_SHAPE);
22
+ const ContentRunSchema = zod.z.object({
23
+ text: zod.z.string(),
24
+ ...RUN_FONT_PROPERTY_SHAPE,
21
25
  hyperlink: zod.z.string().optional(),
22
26
  verticalAlign: zod.z.enum(["superscript", "subscript"]).optional(),
23
27
  direction: require_style.TextDirectionSchema.optional(),
@@ -123,18 +127,28 @@ const ContentFloatPositionSchema = zod.z.object({
123
127
  horizontal: ContentFloatAxisSchema,
124
128
  vertical: ContentFloatAxisSchema
125
129
  });
130
+ const IMAGE_FORMATS = [
131
+ "png",
132
+ "jpeg",
133
+ "svg",
134
+ "gif"
135
+ ];
136
+ function isImageFormat(value) {
137
+ return typeof value === "string" && IMAGE_FORMATS.includes(value);
138
+ }
139
+ const ContentImageOriginalSchema = zod.z.object({
140
+ filter: zod.z.enum(["jbig2", "jpeg2000"]),
141
+ base64: zod.z.string(),
142
+ jbig2GlobalsBase64: zod.z.string().optional()
143
+ });
126
144
  const ContentImageBlockSchema = zod.z.object({
127
145
  kind: zod.z.literal("image"),
128
- format: zod.z.enum([
129
- "png",
130
- "jpeg",
131
- "svg",
132
- "gif"
133
- ]),
146
+ format: zod.z.enum(IMAGE_FORMATS),
134
147
  base64: zod.z.string(),
135
148
  widthPt: zod.z.number().positive(),
136
149
  heightPt: zod.z.number().positive(),
137
150
  altText: zod.z.string().optional(),
151
+ original: ContentImageOriginalSchema.optional(),
138
152
  floatPosition: ContentFloatPositionSchema.optional(),
139
153
  sourcePath: zod.z.string().optional(),
140
154
  source: require_source.SourceResidueSchema.optional(),
@@ -187,7 +201,7 @@ function isContentBlock(value) {
187
201
  if (!isRecord(value)) return false;
188
202
  const kind = value.kind;
189
203
  if (kind === "paragraph") return Array.isArray(value.runs) && value.runs.every(isContentRun) && (value.constructs === void 0 || Array.isArray(value.constructs) && value.constructs.every(isRunConstructExtent));
190
- if (kind === "image") return (value.format === "png" || value.format === "jpeg") && typeof value.base64 === "string" && typeof value.widthPt === "number" && typeof value.heightPt === "number";
204
+ if (kind === "image") return isImageFormat(value.format) && typeof value.base64 === "string" && typeof value.widthPt === "number" && typeof value.heightPt === "number";
191
205
  if (kind === "pageBreak") return true;
192
206
  if (kind === "table") return Array.isArray(value.rows) && value.rows.every(isContentTableRow) && Array.isArray(value.columnWidthsPt) && value.columnWidthsPt.every((w) => typeof w === "number");
193
207
  if (kind === "embeddedObject") return isContentEmbeddedObject(value);
@@ -462,6 +476,7 @@ const ContentSheetCellSchema = zod.z.object({
462
476
  formula: zod.z.string().optional(),
463
477
  displayText: zod.z.string(),
464
478
  numberFormatCode: zod.z.string().optional(),
479
+ font: ContentFontSchema.optional(),
465
480
  runs: zod.z.array(ContentRunSchema).optional(),
466
481
  colSpan: zod.z.number().int().positive().optional(),
467
482
  rowSpan: zod.z.number().int().positive().optional(),
@@ -838,6 +853,11 @@ const ContentFormulaSchema = zod.z.object({
838
853
  source: require_source.SourceResidueSchema.optional()
839
854
  });
840
855
  const contentDocumentSharedFields = { symbolTable: require_math.SymbolTableSchema.optional() };
856
+ const ContentDefinedNameSchema = zod.z.object({
857
+ name: zod.z.string(),
858
+ refersTo: zod.z.string(),
859
+ scopeSheetIndex: zod.z.number().int().nonnegative().optional()
860
+ });
841
861
  const ContentDocumentSchema = zod.z.discriminatedUnion("kind", [
842
862
  zod.z.object({
843
863
  kind: zod.z.literal("wordprocessing"),
@@ -855,7 +875,8 @@ const ContentDocumentSchema = zod.z.discriminatedUnion("kind", [
855
875
  kind: zod.z.literal("spreadsheet"),
856
876
  metadata: require_metadata.LayoutMetadataSchema,
857
877
  ...contentDocumentSharedFields,
858
- sheets: zod.z.array(ContentSheetSchema)
878
+ sheets: zod.z.array(ContentSheetSchema),
879
+ names: zod.z.array(ContentDefinedNameSchema).optional()
859
880
  }),
860
881
  zod.z.object({
861
882
  kind: zod.z.literal("drawing"),
@@ -880,6 +901,7 @@ exports.ContentCellPatternTypeSchema = ContentCellPatternTypeSchema;
880
901
  exports.ContentCellValueSchema = ContentCellValueSchema;
881
902
  exports.ContentConstructEndSchema = ContentConstructEndSchema;
882
903
  exports.ContentConstructStartSchema = ContentConstructStartSchema;
904
+ exports.ContentDefinedNameSchema = ContentDefinedNameSchema;
883
905
  exports.ContentDocumentSchema = ContentDocumentSchema;
884
906
  exports.ContentDrawPageSchema = ContentDrawPageSchema;
885
907
  exports.ContentEmbeddedObjectBlockSchema = ContentEmbeddedObjectBlockSchema;
@@ -889,12 +911,14 @@ exports.ContentFloatAlignSchema = ContentFloatAlignSchema;
889
911
  exports.ContentFloatAxisSchema = ContentFloatAxisSchema;
890
912
  exports.ContentFloatOriginSchema = ContentFloatOriginSchema;
891
913
  exports.ContentFloatPositionSchema = ContentFloatPositionSchema;
914
+ exports.ContentFontSchema = ContentFontSchema;
892
915
  exports.ContentFormulaSchema = ContentFormulaSchema;
893
916
  exports.ContentGradientFillSchema = ContentGradientFillSchema;
894
917
  exports.ContentGradientStyleSchema = ContentGradientStyleSchema;
895
918
  exports.ContentHatchFillSchema = ContentHatchFillSchema;
896
919
  exports.ContentHatchStyleSchema = ContentHatchStyleSchema;
897
920
  exports.ContentImageBlockSchema = ContentImageBlockSchema;
921
+ exports.ContentImageOriginalSchema = ContentImageOriginalSchema;
898
922
  exports.ContentListMembershipSchema = ContentListMembershipSchema;
899
923
  exports.ContentPageBreakSchema = ContentPageBreakSchema;
900
924
  exports.ContentPageFurnitureSchema = ContentPageFurnitureSchema;
@@ -930,6 +954,8 @@ exports.ContentTableRowSchema = ContentTableRowSchema;
930
954
  exports.ContentTableSchema = ContentTableSchema;
931
955
  exports.ContentVectorSchema = ContentVectorSchema;
932
956
  exports.DecimalStringSchema = DecimalStringSchema;
957
+ exports.IMAGE_FORMATS = IMAGE_FORMATS;
958
+ exports.RUN_FONT_PROPERTY_SHAPE = RUN_FONT_PROPERTY_SHAPE;
933
959
  exports.RunConstructExtentSchema = RunConstructExtentSchema;
934
960
  exports.SheetRuleOperatorSchema = SheetRuleOperatorSchema;
935
961
  exports.clampHeadingLevel = clampHeadingLevel;