document-schema 7.6.1 → 7.8.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 (49) hide show
  1. package/dist/codec.d.cts +1 -1
  2. package/dist/codec.d.ts +1 -1
  3. package/dist/{content-CIIFuBbn.d.cts → content-CBkzO-uB.d.cts} +1898 -51
  4. package/dist/content-json-schema-defs.cjs +158 -15
  5. package/dist/content-json-schema-defs.js +158 -15
  6. package/dist/{content-wL5-wetq.d.ts → content-xlX3HwY8.d.ts} +1898 -51
  7. package/dist/content.cjs +106 -27
  8. package/dist/content.d.cts +2 -2
  9. package/dist/content.d.ts +2 -2
  10. package/dist/content.js +98 -28
  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 +4 -4
  15. package/dist/definitions.d.ts +4 -4
  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 +9 -0
  26. package/dist/index.d.cts +4 -4
  27. package/dist/index.d.ts +4 -4
  28. package/dist/index.js +2 -2
  29. package/dist/{package-node-C9iYNIXi.d.cts → package-node-BWHA7o_U.d.cts} +339 -29
  30. package/dist/{package-node-C_rpWAh2.d.ts → package-node-F0sdAYc9.d.ts} +339 -29
  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 +38 -6
  35. package/dist/package.d.ts +38 -6
  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/dist/{style-D06NwxAJ.d.cts → style-BGMcYrD2.d.cts} +1 -1
  42. package/dist/{style-D06NwxAJ.d.ts → style-BGMcYrD2.d.ts} +1 -1
  43. package/dist/style.d.cts +1 -1
  44. package/dist/style.d.ts +1 -1
  45. package/dist/text-layout.d.cts +1 -1
  46. package/dist/text-layout.d.ts +1 -1
  47. package/package.json +1 -1
  48. package/schemas/content-document.schema.json +1296 -13
  49. package/schemas/document-tree.schema.json +292 -3
package/dist/content.js CHANGED
@@ -8,21 +8,55 @@ import { AlignmentSchema, TextDirectionSchema } from "./style.js";
8
8
  import { LayoutMetadataSchema } from "./metadata.js";
9
9
  import { z } from "zod";
10
10
  //#region src/content.ts
11
- const ContentRunSchema = z.object({
11
+ const ContentOriginSchema = z.enum([
12
+ "chart",
13
+ "diagram",
14
+ "table",
15
+ "image",
16
+ "notes",
17
+ "body"
18
+ ]);
19
+ const ContentTranscriptSchema = z.object({
12
20
  text: z.string(),
21
+ confidence: z.enum([
22
+ "high",
23
+ "medium",
24
+ "low"
25
+ ]),
26
+ mechanism: z.enum(["deterministic", "model"])
27
+ });
28
+ const ContentInterpretationSchema = z.object({
29
+ transcript: ContentTranscriptSchema.optional(),
30
+ description: z.string().optional(),
31
+ by: z.object({
32
+ model: z.string(),
33
+ at: z.string()
34
+ }).optional()
35
+ });
36
+ const CONTENT_ANNOTATION_FIELDS = {
37
+ origin: ContentOriginSchema.optional(),
38
+ interpretation: ContentInterpretationSchema.optional()
39
+ };
40
+ const RUN_FONT_PROPERTY_SHAPE = {
13
41
  bold: z.boolean().optional(),
14
42
  italic: z.boolean().optional(),
15
43
  underline: z.boolean().optional(),
16
44
  strike: z.boolean().optional(),
17
45
  fontFamily: z.string().optional(),
18
46
  sizePt: z.number().positive().optional(),
19
- color: ColorSchema.optional(),
47
+ color: ColorSchema.optional()
48
+ };
49
+ const ContentFontSchema = z.object(RUN_FONT_PROPERTY_SHAPE);
50
+ const ContentRunSchema = z.object({
51
+ text: z.string(),
52
+ ...RUN_FONT_PROPERTY_SHAPE,
20
53
  hyperlink: z.string().optional(),
21
54
  verticalAlign: z.enum(["superscript", "subscript"]).optional(),
22
55
  direction: TextDirectionSchema.optional(),
23
56
  sourcePath: z.string().optional(),
24
57
  source: SourceResidueSchema.optional(),
25
- frames: z.array(LayoutFrameSchema).optional()
58
+ frames: z.array(LayoutFrameSchema).optional(),
59
+ ...CONTENT_ANNOTATION_FIELDS
26
60
  });
27
61
  const ContentListMembershipSchema = z.object({
28
62
  numId: z.string().optional(),
@@ -82,7 +116,8 @@ const ContentParagraphSchema = z.object({
82
116
  borders: ContentParagraphBordersSchema.optional(),
83
117
  sourcePath: z.string().optional(),
84
118
  source: SourceResidueSchema.optional(),
85
- frames: z.array(LayoutFrameSchema).optional()
119
+ frames: z.array(LayoutFrameSchema).optional(),
120
+ ...CONTENT_ANNOTATION_FIELDS
86
121
  });
87
122
  function clampHeadingLevel(level) {
88
123
  return Math.min(6, Math.max(1, Math.round(level)));
@@ -122,28 +157,42 @@ const ContentFloatPositionSchema = z.object({
122
157
  horizontal: ContentFloatAxisSchema,
123
158
  vertical: ContentFloatAxisSchema
124
159
  });
160
+ const IMAGE_FORMATS = [
161
+ "png",
162
+ "jpeg",
163
+ "svg",
164
+ "gif"
165
+ ];
166
+ function isImageFormat(value) {
167
+ return typeof value === "string" && IMAGE_FORMATS.includes(value);
168
+ }
169
+ const ContentImageOriginalSchema = z.object({
170
+ filter: z.enum(["jbig2", "jpeg2000"]),
171
+ base64: z.string(),
172
+ jbig2GlobalsBase64: z.string().optional()
173
+ });
125
174
  const ContentImageBlockSchema = z.object({
126
175
  kind: z.literal("image"),
127
- format: z.enum([
128
- "png",
129
- "jpeg",
130
- "svg",
131
- "gif"
132
- ]),
176
+ format: z.enum(IMAGE_FORMATS),
133
177
  base64: z.string(),
134
178
  widthPt: z.number().positive(),
135
179
  heightPt: z.number().positive(),
136
180
  altText: z.string().optional(),
181
+ original: ContentImageOriginalSchema.optional(),
182
+ anchorRunIndex: z.number().int().nonnegative().optional(),
183
+ anchorOffset: z.number().int().nonnegative().optional(),
137
184
  floatPosition: ContentFloatPositionSchema.optional(),
138
185
  sourcePath: z.string().optional(),
139
186
  source: SourceResidueSchema.optional(),
140
- frames: z.array(LayoutFrameSchema).optional()
187
+ frames: z.array(LayoutFrameSchema).optional(),
188
+ ...CONTENT_ANNOTATION_FIELDS
141
189
  });
142
190
  const ContentPageBreakSchema = z.object({
143
191
  kind: z.literal("pageBreak"),
144
192
  sourcePath: z.string().optional(),
145
193
  source: SourceResidueSchema.optional(),
146
- frames: z.array(LayoutFrameSchema).optional()
194
+ frames: z.array(LayoutFrameSchema).optional(),
195
+ ...CONTENT_ANNOTATION_FIELDS
147
196
  });
148
197
  const ContentConstructStartSchema = z.object({
149
198
  kind: z.literal("constructStart"),
@@ -186,7 +235,7 @@ function isContentBlock(value) {
186
235
  if (!isRecord(value)) return false;
187
236
  const kind = value.kind;
188
237
  if (kind === "paragraph") return Array.isArray(value.runs) && value.runs.every(isContentRun) && (value.constructs === void 0 || Array.isArray(value.constructs) && value.constructs.every(isRunConstructExtent));
189
- if (kind === "image") return (value.format === "png" || value.format === "jpeg") && typeof value.base64 === "string" && typeof value.widthPt === "number" && typeof value.heightPt === "number";
238
+ if (kind === "image") return isImageFormat(value.format) && typeof value.base64 === "string" && typeof value.widthPt === "number" && typeof value.heightPt === "number";
190
239
  if (kind === "pageBreak") return true;
191
240
  if (kind === "table") return Array.isArray(value.rows) && value.rows.every(isContentTableRow) && Array.isArray(value.columnWidthsPt) && value.columnWidthsPt.every((w) => typeof w === "number");
192
241
  if (kind === "embeddedObject") return isContentEmbeddedObject(value);
@@ -209,7 +258,8 @@ const CONTENT_EMBEDDED_OBJECT_FIELDS = {
209
258
  anchorColumn: z.number().int().nonnegative().optional(),
210
259
  offsetXPt: z.number().optional(),
211
260
  offsetYPt: z.number().optional(),
212
- source: SourceResidueSchema.optional()
261
+ source: SourceResidueSchema.optional(),
262
+ ...CONTENT_ANNOTATION_FIELDS
213
263
  };
214
264
  const ContentEmbeddedObjectSchema = z.object(CONTENT_EMBEDDED_OBJECT_FIELDS);
215
265
  const ContentEmbeddedObjectBlockSchema = z.object({
@@ -336,7 +386,8 @@ const ContentTableCellSchema = z.object({
336
386
  formula: z.string().optional(),
337
387
  sourcePath: z.string().optional(),
338
388
  source: SourceResidueSchema.optional(),
339
- frames: z.array(LayoutFrameSchema).optional()
389
+ frames: z.array(LayoutFrameSchema).optional(),
390
+ ...CONTENT_ANNOTATION_FIELDS
340
391
  });
341
392
  const ContentTableRowSchema = z.object({
342
393
  cells: z.array(ContentTableCellSchema),
@@ -349,7 +400,8 @@ const ContentTableSchema = z.object({
349
400
  columnWidthsPt: z.array(z.number().nonnegative()),
350
401
  sourcePath: z.string().optional(),
351
402
  source: SourceResidueSchema.optional(),
352
- frames: z.array(LayoutFrameSchema).optional()
403
+ frames: z.array(LayoutFrameSchema).optional(),
404
+ ...CONTENT_ANNOTATION_FIELDS
353
405
  });
354
406
  const ContentBlockSchema = z.discriminatedUnion("kind", [
355
407
  ContentParagraphSchema,
@@ -377,7 +429,8 @@ const ContentSectionSchema = z.object({
377
429
  ]).optional(),
378
430
  headers: ContentPageFurnitureSchema.optional(),
379
431
  footers: ContentPageFurnitureSchema.optional(),
380
- source: SourceResidueSchema.optional()
432
+ source: SourceResidueSchema.optional(),
433
+ ...CONTENT_ANNOTATION_FIELDS
381
434
  });
382
435
  const ContentShapeSchema = z.object({
383
436
  name: z.string().optional(),
@@ -393,13 +446,15 @@ const ContentShapeSchema = z.object({
393
446
  sourcePath: z.string().optional(),
394
447
  source: SourceResidueSchema.optional(),
395
448
  frames: z.array(LayoutFrameSchema).optional(),
449
+ ...CONTENT_ANNOTATION_FIELDS,
396
450
  blocks: z.lazy(() => z.array(ContentBlockSchema))
397
451
  });
398
452
  const ContentSlideSchema = z.object({
399
453
  size: PageSizeSchema,
400
454
  shapes: z.array(ContentShapeSchema),
401
455
  notes: z.string(),
402
- source: SourceResidueSchema.optional()
456
+ source: SourceResidueSchema.optional(),
457
+ ...CONTENT_ANNOTATION_FIELDS
403
458
  });
404
459
  const DecimalStringSchema = z.string().regex(/^-?(0|[1-9]\d*)(\.\d+)?$/);
405
460
  const ContentCellValueSchema = z.discriminatedUnion("kind", [
@@ -461,6 +516,7 @@ const ContentSheetCellSchema = z.object({
461
516
  formula: z.string().optional(),
462
517
  displayText: z.string(),
463
518
  numberFormatCode: z.string().optional(),
519
+ font: ContentFontSchema.optional(),
464
520
  runs: z.array(ContentRunSchema).optional(),
465
521
  colSpan: z.number().int().positive().optional(),
466
522
  rowSpan: z.number().int().positive().optional(),
@@ -475,7 +531,8 @@ const ContentSheetCellSchema = z.object({
475
531
  comment: ContentSheetCellCommentSchema.optional(),
476
532
  sourcePath: z.string().optional(),
477
533
  source: SourceResidueSchema.optional(),
478
- frames: z.array(LayoutFrameSchema).optional()
534
+ frames: z.array(LayoutFrameSchema).optional(),
535
+ ...CONTENT_ANNOTATION_FIELDS
479
536
  });
480
537
  const ContentSheetColumnSchema = z.object({
481
538
  index: z.number().int().nonnegative(),
@@ -693,7 +750,8 @@ const ContentSheetSchema = z.object({
693
750
  embeddedObjects: z.array(ContentEmbeddedObjectSchema).optional(),
694
751
  dataValidations: z.array(ContentSheetDataValidationSchema).optional(),
695
752
  conditionalFormats: z.array(ContentSheetConditionalFormatSchema).optional(),
696
- source: SourceResidueSchema.optional()
753
+ source: SourceResidueSchema.optional(),
754
+ ...CONTENT_ANNOTATION_FIELDS
697
755
  });
698
756
  const ContentStrokeDashSchema = z.object({
699
757
  dots1: z.number().int().positive(),
@@ -781,7 +839,8 @@ const ContentVectorSchema = z.discriminatedUnion("kind", [
781
839
  paintOrder: z.number().optional(),
782
840
  sourcePath: z.string().optional(),
783
841
  source: SourceResidueSchema.optional(),
784
- frames: z.array(LayoutFrameSchema).optional()
842
+ frames: z.array(LayoutFrameSchema).optional(),
843
+ ...CONTENT_ANNOTATION_FIELDS
785
844
  }),
786
845
  z.object({
787
846
  kind: z.literal("ellipse"),
@@ -794,7 +853,8 @@ const ContentVectorSchema = z.discriminatedUnion("kind", [
794
853
  paintOrder: z.number().optional(),
795
854
  sourcePath: z.string().optional(),
796
855
  source: SourceResidueSchema.optional(),
797
- frames: z.array(LayoutFrameSchema).optional()
856
+ frames: z.array(LayoutFrameSchema).optional(),
857
+ ...CONTENT_ANNOTATION_FIELDS
798
858
  }),
799
859
  z.object({
800
860
  kind: z.literal("line"),
@@ -804,7 +864,8 @@ const ContentVectorSchema = z.discriminatedUnion("kind", [
804
864
  paintOrder: z.number().optional(),
805
865
  sourcePath: z.string().optional(),
806
866
  source: SourceResidueSchema.optional(),
807
- frames: z.array(LayoutFrameSchema).optional()
867
+ frames: z.array(LayoutFrameSchema).optional(),
868
+ ...CONTENT_ANNOTATION_FIELDS
808
869
  }),
809
870
  z.object({
810
871
  kind: z.literal("path"),
@@ -819,14 +880,16 @@ const ContentVectorSchema = z.discriminatedUnion("kind", [
819
880
  paintOrder: z.number().optional(),
820
881
  sourcePath: z.string().optional(),
821
882
  source: SourceResidueSchema.optional(),
822
- frames: z.array(LayoutFrameSchema).optional()
883
+ frames: z.array(LayoutFrameSchema).optional(),
884
+ ...CONTENT_ANNOTATION_FIELDS
823
885
  })
824
886
  ]);
825
887
  const ContentDrawPageSchema = z.object({
826
888
  size: PageSizeSchema,
827
889
  shapes: z.array(ContentShapeSchema),
828
890
  vectors: z.array(ContentVectorSchema),
829
- source: SourceResidueSchema.optional()
891
+ source: SourceResidueSchema.optional(),
892
+ ...CONTENT_ANNOTATION_FIELDS
830
893
  });
831
894
  const ContentFormulaSchema = z.object({
832
895
  mathml: z.array(MathMlNodeSchema),
@@ -834,9 +897,15 @@ const ContentFormulaSchema = z.object({
834
897
  presentation: MathPresentationSchema.optional(),
835
898
  content: MathExpressionSchema.optional(),
836
899
  provenance: MathProvenanceSchema.optional(),
837
- source: SourceResidueSchema.optional()
900
+ source: SourceResidueSchema.optional(),
901
+ ...CONTENT_ANNOTATION_FIELDS
838
902
  });
839
903
  const contentDocumentSharedFields = { symbolTable: SymbolTableSchema.optional() };
904
+ const ContentDefinedNameSchema = z.object({
905
+ name: z.string(),
906
+ refersTo: z.string(),
907
+ scopeSheetIndex: z.number().int().nonnegative().optional()
908
+ });
840
909
  const ContentDocumentSchema = z.discriminatedUnion("kind", [
841
910
  z.object({
842
911
  kind: z.literal("wordprocessing"),
@@ -854,7 +923,8 @@ const ContentDocumentSchema = z.discriminatedUnion("kind", [
854
923
  kind: z.literal("spreadsheet"),
855
924
  metadata: LayoutMetadataSchema,
856
925
  ...contentDocumentSharedFields,
857
- sheets: z.array(ContentSheetSchema)
926
+ sheets: z.array(ContentSheetSchema),
927
+ names: z.array(ContentDefinedNameSchema).optional()
858
928
  }),
859
929
  z.object({
860
930
  kind: z.literal("drawing"),
@@ -870,4 +940,4 @@ const ContentDocumentSchema = z.discriminatedUnion("kind", [
870
940
  })
871
941
  ]);
872
942
  //#endregion
873
- export { ContentBitmapFillSchema, ContentBlockSchema, ContentBorderSchema, ContentCellBordersSchema, ContentCellFillSchema, ContentCellPatternTypeSchema, ContentCellValueSchema, ContentConstructEndSchema, ContentConstructStartSchema, ContentDocumentSchema, ContentDrawPageSchema, ContentEmbeddedObjectBlockSchema, ContentEmbeddedObjectSchema, ContentFillPatternSchema, ContentFloatAlignSchema, ContentFloatAxisSchema, ContentFloatOriginSchema, ContentFloatPositionSchema, ContentFormulaSchema, ContentGradientFillSchema, ContentGradientStyleSchema, ContentHatchFillSchema, ContentHatchStyleSchema, ContentImageBlockSchema, ContentListMembershipSchema, ContentPageBreakSchema, ContentPageFurnitureSchema, ContentParagraphBordersSchema, ContentParagraphSchema, ContentPathPointSchema, ContentPathSegmentSchema, ContentRunSchema, ContentSectionSchema, ContentShapeSchema, ContentSheetCellCommentSchema, ContentSheetCellSchema, ContentSheetColumnSchema, ContentSheetConditionalFormatSchema, ContentSheetConditionalFormatStyleSchema, ContentSheetConditionalFormatValueSchema, ContentSheetDataValidationSchema, ContentSheetDataValidationTypeSchema, ContentSheetImageSchema, ContentSheetPrintRangeSchema, ContentSheetPrintSettingsSchema, ContentSheetRangeSchema, ContentSheetRepeatRangeSchema, ContentSheetRowSchema, ContentSheetSchema, ContentSlideSchema, ContentStrokeDashSchema, ContentStrokeSchema, ContentStrokeStyleSchema, ContentSubpathSchema, ContentTableCellSchema, ContentTableRowSchema, ContentTableSchema, ContentVectorSchema, DecimalStringSchema, RunConstructExtentSchema, SheetRuleOperatorSchema, clampHeadingLevel, contentDocumentSharedFields, findConstructMarkerImbalance, findRunConstructFault, isContentBlock, isContentConstructEnd, isContentConstructStart, isRunConstructExtent, resolveCellFillColor, unrecognizedFillKind };
943
+ export { CONTENT_ANNOTATION_FIELDS, ContentBitmapFillSchema, ContentBlockSchema, ContentBorderSchema, ContentCellBordersSchema, ContentCellFillSchema, ContentCellPatternTypeSchema, ContentCellValueSchema, ContentConstructEndSchema, ContentConstructStartSchema, ContentDefinedNameSchema, ContentDocumentSchema, ContentDrawPageSchema, ContentEmbeddedObjectBlockSchema, ContentEmbeddedObjectSchema, ContentFillPatternSchema, ContentFloatAlignSchema, ContentFloatAxisSchema, ContentFloatOriginSchema, ContentFloatPositionSchema, ContentFontSchema, ContentFormulaSchema, ContentGradientFillSchema, ContentGradientStyleSchema, ContentHatchFillSchema, ContentHatchStyleSchema, ContentImageBlockSchema, ContentImageOriginalSchema, ContentInterpretationSchema, ContentListMembershipSchema, ContentOriginSchema, ContentPageBreakSchema, ContentPageFurnitureSchema, ContentParagraphBordersSchema, ContentParagraphSchema, ContentPathPointSchema, ContentPathSegmentSchema, ContentRunSchema, ContentSectionSchema, ContentShapeSchema, ContentSheetCellCommentSchema, ContentSheetCellSchema, ContentSheetColumnSchema, ContentSheetConditionalFormatSchema, ContentSheetConditionalFormatStyleSchema, ContentSheetConditionalFormatValueSchema, ContentSheetDataValidationSchema, ContentSheetDataValidationTypeSchema, ContentSheetImageSchema, ContentSheetPrintRangeSchema, ContentSheetPrintSettingsSchema, ContentSheetRangeSchema, ContentSheetRepeatRangeSchema, ContentSheetRowSchema, ContentSheetSchema, ContentSlideSchema, ContentStrokeDashSchema, ContentStrokeSchema, ContentStrokeStyleSchema, ContentSubpathSchema, ContentTableCellSchema, ContentTableRowSchema, ContentTableSchema, ContentTranscriptSchema, ContentVectorSchema, DecimalStringSchema, IMAGE_FORMATS, RUN_FONT_PROPERTY_SHAPE, RunConstructExtentSchema, SheetRuleOperatorSchema, clampHeadingLevel, contentDocumentSharedFields, findConstructMarkerImbalance, findRunConstructFault, isContentBlock, isContentConstructEnd, isContentConstructStart, isRunConstructExtent, resolveCellFillColor, unrecognizedFillKind };
@@ -1,5 +1,5 @@
1
- import { S as ContentDrawPage, _t as ContentSheet, b as ContentDocument, ht as ContentShape, pt as ContentSection, qt as ContentSlide, rt as ContentParagraph, t as ConstructMarkerImbalance, z as ContentFormula } from "./content-CIIFuBbn.cjs";
2
- import { D as ShapeGroupNode, I as SlideGroupNode, M as SheetGroupNode, b as SectionGroupNode, c as HeadingParagraph, i as DrawPageGroupNode, p as ListParagraph } from "./package-node-C9iYNIXi.cjs";
1
+ import { C as ContentDocument, Et as ContentShape, Ot as ContentSheet, T as ContentDrawPage, W as ContentFormula, in as ContentSlide, mt as ContentParagraph, n as ConstructMarkerImbalance, wt as ContentSection } from "./content-CBkzO-uB.cjs";
2
+ import { D as ShapeGroupNode, I as SlideGroupNode, M as SheetGroupNode, b as SectionGroupNode, c as HeadingParagraph, i as DrawPageGroupNode, p as ListParagraph } from "./package-node-BWHA7o_U.cjs";
3
3
  //#region src/decompose.d.ts
4
4
  declare function isHeadingParagraph(paragraph: ContentParagraph): paragraph is HeadingParagraph;
5
5
  declare function isListParagraph(paragraph: ContentParagraph): paragraph is ListParagraph;
@@ -1,5 +1,5 @@
1
- import { S as ContentDrawPage, _t as ContentSheet, b as ContentDocument, ht as ContentShape, pt as ContentSection, qt as ContentSlide, rt as ContentParagraph, t as ConstructMarkerImbalance, z as ContentFormula } from "./content-wL5-wetq.js";
2
- import { D as ShapeGroupNode, I as SlideGroupNode, M as SheetGroupNode, b as SectionGroupNode, c as HeadingParagraph, i as DrawPageGroupNode, p as ListParagraph } from "./package-node-C_rpWAh2.js";
1
+ import { C as ContentDocument, Et as ContentShape, Ot as ContentSheet, T as ContentDrawPage, W as ContentFormula, in as ContentSlide, mt as ContentParagraph, n as ConstructMarkerImbalance, wt as ContentSection } from "./content-xlX3HwY8.js";
2
+ import { D as ShapeGroupNode, I as SlideGroupNode, M as SheetGroupNode, b as SectionGroupNode, c as HeadingParagraph, i as DrawPageGroupNode, p as ListParagraph } from "./package-node-F0sdAYc9.js";
3
3
  //#region src/decompose.d.ts
4
4
  declare function isHeadingParagraph(paragraph: ContentParagraph): paragraph is HeadingParagraph;
5
5
  declare function isListParagraph(paragraph: ContentParagraph): paragraph is ListParagraph;
@@ -1,5 +1,4 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
- const require_color = require("./color.cjs");
3
2
  const require_style = require("./style.cjs");
4
3
  const require_content = require("./content.cjs");
5
4
  let zod = require("zod");
@@ -15,15 +14,7 @@ const StyleParagraphPropertiesSchema = zod.z.strictObject({
15
14
  pageBreakBefore: zod.z.boolean().optional(),
16
15
  pageBreakAfter: zod.z.boolean().optional()
17
16
  });
18
- const StyleRunPropertiesSchema = zod.z.strictObject({
19
- bold: zod.z.boolean().optional(),
20
- italic: zod.z.boolean().optional(),
21
- underline: zod.z.boolean().optional(),
22
- strike: zod.z.boolean().optional(),
23
- fontFamily: zod.z.string().optional(),
24
- sizePt: zod.z.number().positive().optional(),
25
- color: require_color.ColorSchema.optional()
26
- });
17
+ const StyleRunPropertiesSchema = zod.z.strictObject(require_content.RUN_FONT_PROPERTY_SHAPE);
27
18
  const StyleEntrySchema = zod.z.strictObject({
28
19
  paragraph: StyleParagraphPropertiesSchema.optional(),
29
20
  run: StyleRunPropertiesSchema.optional()
@@ -1,11 +1,11 @@
1
- import { dt as ContentRun, rt as ContentParagraph } from "./content-CIIFuBbn.cjs";
1
+ import { St as ContentRun, mt as ContentParagraph } from "./content-CBkzO-uB.cjs";
2
2
  import { z } from "zod";
3
3
  //#region src/definitions.d.ts
4
4
  declare const StyleParagraphPropertiesSchema: z.ZodObject<{
5
5
  alignment: z.ZodOptional<z.ZodEnum<{
6
6
  left: "left";
7
- center: "center";
8
7
  right: "right";
8
+ center: "center";
9
9
  justify: "justify";
10
10
  }>>;
11
11
  list: z.ZodOptional<z.ZodObject<{
@@ -49,8 +49,8 @@ declare const StyleEntrySchema: z.ZodObject<{
49
49
  paragraph: z.ZodOptional<z.ZodObject<{
50
50
  alignment: z.ZodOptional<z.ZodEnum<{
51
51
  left: "left";
52
- center: "center";
53
52
  right: "right";
53
+ center: "center";
54
54
  justify: "justify";
55
55
  }>>;
56
56
  list: z.ZodOptional<z.ZodObject<{
@@ -94,8 +94,8 @@ declare const StylesTableSchema: z.ZodRecord<z.ZodString, z.ZodObject<{
94
94
  paragraph: z.ZodOptional<z.ZodObject<{
95
95
  alignment: z.ZodOptional<z.ZodEnum<{
96
96
  left: "left";
97
- center: "center";
98
97
  right: "right";
98
+ center: "center";
99
99
  justify: "justify";
100
100
  }>>;
101
101
  list: z.ZodOptional<z.ZodObject<{
@@ -1,11 +1,11 @@
1
- import { dt as ContentRun, rt as ContentParagraph } from "./content-wL5-wetq.js";
1
+ import { St as ContentRun, mt as ContentParagraph } from "./content-xlX3HwY8.js";
2
2
  import { z } from "zod";
3
3
  //#region src/definitions.d.ts
4
4
  declare const StyleParagraphPropertiesSchema: z.ZodObject<{
5
5
  alignment: z.ZodOptional<z.ZodEnum<{
6
6
  left: "left";
7
- center: "center";
8
7
  right: "right";
8
+ center: "center";
9
9
  justify: "justify";
10
10
  }>>;
11
11
  list: z.ZodOptional<z.ZodObject<{
@@ -49,8 +49,8 @@ declare const StyleEntrySchema: z.ZodObject<{
49
49
  paragraph: z.ZodOptional<z.ZodObject<{
50
50
  alignment: z.ZodOptional<z.ZodEnum<{
51
51
  left: "left";
52
- center: "center";
53
52
  right: "right";
53
+ center: "center";
54
54
  justify: "justify";
55
55
  }>>;
56
56
  list: z.ZodOptional<z.ZodObject<{
@@ -94,8 +94,8 @@ declare const StylesTableSchema: z.ZodRecord<z.ZodString, z.ZodObject<{
94
94
  paragraph: z.ZodOptional<z.ZodObject<{
95
95
  alignment: z.ZodOptional<z.ZodEnum<{
96
96
  left: "left";
97
- center: "center";
98
97
  right: "right";
98
+ center: "center";
99
99
  justify: "justify";
100
100
  }>>;
101
101
  list: z.ZodOptional<z.ZodObject<{
@@ -1,6 +1,5 @@
1
- import { ColorSchema } from "./color.js";
2
1
  import { AlignmentSchema } from "./style.js";
3
- import { ContentListMembershipSchema } from "./content.js";
2
+ import { ContentListMembershipSchema, RUN_FONT_PROPERTY_SHAPE } from "./content.js";
4
3
  import { z } from "zod";
5
4
  //#region src/definitions.ts
6
5
  const StyleParagraphPropertiesSchema = z.strictObject({
@@ -14,15 +13,7 @@ const StyleParagraphPropertiesSchema = z.strictObject({
14
13
  pageBreakBefore: z.boolean().optional(),
15
14
  pageBreakAfter: z.boolean().optional()
16
15
  });
17
- const StyleRunPropertiesSchema = z.strictObject({
18
- bold: z.boolean().optional(),
19
- italic: z.boolean().optional(),
20
- underline: z.boolean().optional(),
21
- strike: z.boolean().optional(),
22
- fontFamily: z.string().optional(),
23
- sizePt: z.number().positive().optional(),
24
- color: ColorSchema.optional()
25
- });
16
+ const StyleRunPropertiesSchema = z.strictObject(RUN_FONT_PROPERTY_SHAPE);
26
17
  const StyleEntrySchema = z.strictObject({
27
18
  paragraph: StyleParagraphPropertiesSchema.optional(),
28
19
  run: StyleRunPropertiesSchema.optional()
@@ -60,6 +60,7 @@ function assembleTree(content, pages) {
60
60
  case "spreadsheet": return mint({
61
61
  kind: "spreadsheet",
62
62
  ...envelope,
63
+ ...content.names !== void 0 ? { names: content.names } : {},
63
64
  children: content.sheets.map(require_decompose.decomposeSheet)
64
65
  });
65
66
  case "drawing": return mint({
@@ -1,5 +1,5 @@
1
1
  import { l as PageSize } from "./geometry-CvcjSwnA.cjs";
2
- import { b as ContentDocument } from "./content-CIIFuBbn.cjs";
2
+ import { C as ContentDocument } from "./content-CBkzO-uB.cjs";
3
3
  import { DocumentTree } from "./package.cjs";
4
4
  //#region src/factor-styles.d.ts
5
5
  declare function assembleTree(content: ContentDocument, pages?: readonly PageSize[]): DocumentTree;
@@ -1,5 +1,5 @@
1
1
  import { l as PageSize } from "./geometry-CvcjSwnA.js";
2
- import { b as ContentDocument } from "./content-wL5-wetq.js";
2
+ import { C as ContentDocument } from "./content-xlX3HwY8.js";
3
3
  import { DocumentTree } from "./package.js";
4
4
  //#region src/factor-styles.d.ts
5
5
  declare function assembleTree(content: ContentDocument, pages?: readonly PageSize[]): DocumentTree;
@@ -59,6 +59,7 @@ function assembleTree(content, pages) {
59
59
  case "spreadsheet": return mint({
60
60
  kind: "spreadsheet",
61
61
  ...envelope,
62
+ ...content.names !== void 0 ? { names: content.names } : {},
62
63
  children: content.sheets.map(decomposeSheet)
63
64
  });
64
65
  case "drawing": return mint({
package/dist/flatten.cjs CHANGED
@@ -48,6 +48,7 @@ function flattenTree(pkg) {
48
48
  case "spreadsheet": return {
49
49
  kind: "spreadsheet",
50
50
  ...envelope,
51
+ ...pkg.names !== void 0 ? { names: pkg.names } : {},
51
52
  sheets: pkg.children.map((group) => {
52
53
  if (group.style !== void 0) throw new Error("flattenTree: a sheet group carries a style ref but a sheet holds no block flow to resolve it onto");
53
54
  const images = [];
@@ -1,4 +1,4 @@
1
- import { b as ContentDocument } from "./content-CIIFuBbn.cjs";
1
+ import { C as ContentDocument } from "./content-CBkzO-uB.cjs";
2
2
  import { DocumentTree } from "./package.cjs";
3
3
  //#region src/flatten.d.ts
4
4
  declare function flattenTree(pkg: DocumentTree): ContentDocument;
package/dist/flatten.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { b as ContentDocument } from "./content-wL5-wetq.js";
1
+ import { C as ContentDocument } from "./content-xlX3HwY8.js";
2
2
  import { DocumentTree } from "./package.js";
3
3
  //#region src/flatten.d.ts
4
4
  declare function flattenTree(pkg: DocumentTree): ContentDocument;
package/dist/flatten.js CHANGED
@@ -47,6 +47,7 @@ function flattenTree(pkg) {
47
47
  case "spreadsheet": return {
48
48
  kind: "spreadsheet",
49
49
  ...envelope,
50
+ ...pkg.names !== void 0 ? { names: pkg.names } : {},
50
51
  sheets: pkg.children.map((group) => {
51
52
  if (group.style !== void 0) throw new Error("flattenTree: a sheet group carries a style ref but a sheet holds no block flow to resolve it onto");
52
53
  const images = [];
package/dist/index.cjs CHANGED
@@ -28,6 +28,7 @@ exports.AnchorTypeSchema = require_construct.AnchorTypeSchema;
28
28
  exports.BORDER_WIDTH_PT = require_border_weight.BORDER_WIDTH_PT;
29
29
  exports.BoxSchema = require_geometry.BoxSchema;
30
30
  exports.COLOR_BLACK = require_color.COLOR_BLACK;
31
+ exports.CONTENT_ANNOTATION_FIELDS = require_content.CONTENT_ANNOTATION_FIELDS;
31
32
  exports.CONTENT_DEFS = require_content_json_schema_defs.CONTENT_DEFS;
32
33
  exports.CONTENT_DOCUMENT_URI = require_content_json_schema_defs.CONTENT_DOCUMENT_URI;
33
34
  exports.ColorSchema = require_color.ColorSchema;
@@ -45,6 +46,7 @@ exports.ContentConstructStartSchema = require_content.ContentConstructStartSchem
45
46
  exports.ContentControlDescriptorSchema = require_construct.ContentControlDescriptorSchema;
46
47
  exports.ContentControlLockSchema = require_construct.ContentControlLockSchema;
47
48
  exports.ContentControlTypeSchema = require_construct.ContentControlTypeSchema;
49
+ exports.ContentDefinedNameSchema = require_content.ContentDefinedNameSchema;
48
50
  exports.ContentDocumentSchema = require_content.ContentDocumentSchema;
49
51
  exports.ContentDrawPageSchema = require_content.ContentDrawPageSchema;
50
52
  exports.ContentEmbeddedObjectBlockSchema = require_content.ContentEmbeddedObjectBlockSchema;
@@ -54,13 +56,17 @@ exports.ContentFloatAlignSchema = require_content.ContentFloatAlignSchema;
54
56
  exports.ContentFloatAxisSchema = require_content.ContentFloatAxisSchema;
55
57
  exports.ContentFloatOriginSchema = require_content.ContentFloatOriginSchema;
56
58
  exports.ContentFloatPositionSchema = require_content.ContentFloatPositionSchema;
59
+ exports.ContentFontSchema = require_content.ContentFontSchema;
57
60
  exports.ContentFormulaSchema = require_content.ContentFormulaSchema;
58
61
  exports.ContentGradientFillSchema = require_content.ContentGradientFillSchema;
59
62
  exports.ContentGradientStyleSchema = require_content.ContentGradientStyleSchema;
60
63
  exports.ContentHatchFillSchema = require_content.ContentHatchFillSchema;
61
64
  exports.ContentHatchStyleSchema = require_content.ContentHatchStyleSchema;
62
65
  exports.ContentImageBlockSchema = require_content.ContentImageBlockSchema;
66
+ exports.ContentImageOriginalSchema = require_content.ContentImageOriginalSchema;
67
+ exports.ContentInterpretationSchema = require_content.ContentInterpretationSchema;
63
68
  exports.ContentListMembershipSchema = require_content.ContentListMembershipSchema;
69
+ exports.ContentOriginSchema = require_content.ContentOriginSchema;
64
70
  exports.ContentPageBreakSchema = require_content.ContentPageBreakSchema;
65
71
  exports.ContentPageFurnitureSchema = require_content.ContentPageFurnitureSchema;
66
72
  exports.ContentParagraphBordersSchema = require_content.ContentParagraphBordersSchema;
@@ -93,6 +99,7 @@ exports.ContentSubpathSchema = require_content.ContentSubpathSchema;
93
99
  exports.ContentTableCellSchema = require_content.ContentTableCellSchema;
94
100
  exports.ContentTableRowSchema = require_content.ContentTableRowSchema;
95
101
  exports.ContentTableSchema = require_content.ContentTableSchema;
102
+ exports.ContentTranscriptSchema = require_content.ContentTranscriptSchema;
96
103
  exports.ContentVectorSchema = require_content.ContentVectorSchema;
97
104
  exports.DEFAULT_LAYOUT_FONT = require_style.DEFAULT_LAYOUT_FONT;
98
105
  exports.DecimalStringSchema = require_content.DecimalStringSchema;
@@ -112,6 +119,7 @@ exports.FieldDescriptorSchema = require_construct.FieldDescriptorSchema;
112
119
  exports.FormulaBindingsSchema = require_math.FormulaBindingsSchema;
113
120
  exports.HeadingGroupSchema = require_package_node.HeadingGroupSchema;
114
121
  exports.HeadingParagraphSchema = require_package_node.HeadingParagraphSchema;
122
+ exports.IMAGE_FORMATS = require_content.IMAGE_FORMATS;
115
123
  exports.IntervalSchema = require_math.IntervalSchema;
116
124
  exports.LayoutFontSchema = require_style.LayoutFontSchema;
117
125
  exports.LayoutFrameSchema = require_geometry.LayoutFrameSchema;
@@ -152,6 +160,7 @@ exports.PageSizeSchema = require_geometry.PageSizeSchema;
152
160
  exports.ProvenanceChangeSchema = require_construct.ProvenanceChangeSchema;
153
161
  exports.ProvenanceDescriptorSchema = require_construct.ProvenanceDescriptorSchema;
154
162
  exports.QuantitySchema = require_math.QuantitySchema;
163
+ exports.RUN_FONT_PROPERTY_SHAPE = require_content.RUN_FONT_PROPERTY_SHAPE;
155
164
  exports.RunConstructExtentSchema = require_content.RunConstructExtentSchema;
156
165
  exports.SCHEMA_FILE_NAMES = require_schema_io.SCHEMA_FILE_NAMES;
157
166
  exports.SI_BASE_DIMENSIONS = require_math.SI_BASE_DIMENSIONS;