document-schema 7.11.0 → 7.11.2

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/a1.cjs +1 -1
  2. package/dist/a1.js +1 -1
  3. package/dist/codec.d.cts +1 -1
  4. package/dist/codec.d.ts +1 -1
  5. package/dist/color.cjs +3 -5
  6. package/dist/color.js +3 -5
  7. package/dist/{construct-GVdTKrE7.d.ts → construct-C9cYkjnd.d.ts} +3 -3
  8. package/dist/construct.d.ts +1 -1
  9. package/dist/{content-Ck4LdLBJ.d.ts → content-GHj_31uQ.d.ts} +3 -3
  10. package/dist/content-json-schema-defs.cjs +1 -3
  11. package/dist/content-json-schema-defs.js +1 -3
  12. package/dist/{content-JJrcHjkR.d.cts → content-zNNPbwYY.d.cts} +3 -3
  13. package/dist/content.cjs +1 -1
  14. package/dist/content.d.cts +1 -1
  15. package/dist/content.d.ts +1 -1
  16. package/dist/content.js +1 -1
  17. package/dist/decompose.d.cts +2 -2
  18. package/dist/decompose.d.ts +2 -2
  19. package/dist/definitions.d.cts +1 -1
  20. package/dist/definitions.d.ts +1 -1
  21. package/dist/factor-styles.cjs +17 -61
  22. package/dist/factor-styles.d.cts +1 -1
  23. package/dist/factor-styles.d.ts +1 -1
  24. package/dist/factor-styles.js +17 -61
  25. package/dist/flatten.d.cts +1 -1
  26. package/dist/flatten.d.ts +1 -1
  27. package/dist/index.d.cts +2 -2
  28. package/dist/index.d.ts +3 -3
  29. package/dist/{package-node-BGyYUU-O.d.ts → package-node-CIZQ2_C1.d.ts} +8 -8
  30. package/dist/{package-node-CzUJ6jKN.d.cts → package-node-DaPwHzsg.d.cts} +7 -7
  31. package/dist/package-node.cjs +0 -1
  32. package/dist/package-node.d.cts +1 -1
  33. package/dist/package-node.d.ts +1 -1
  34. package/dist/package-node.js +0 -1
  35. package/dist/package.d.cts +1 -1
  36. package/dist/package.d.ts +1 -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 +2 -2
  42. package/schemas/content-document.schema.json +16 -16
  43. package/schemas/document-tree.schema.json +3 -3
package/dist/a1.cjs CHANGED
@@ -43,7 +43,7 @@ function cellReference(row, column) {
43
43
  function parseRangeReference(ref) {
44
44
  const separatorIndex = ref.indexOf(":");
45
45
  const startRaw = separatorIndex === -1 ? ref : ref.slice(0, separatorIndex);
46
- const endRaw = separatorIndex === -1 ? ref : ref.slice(separatorIndex + 1);
46
+ const endRaw = ref.slice(separatorIndex + 1);
47
47
  const start = parseCellReference(startRaw);
48
48
  const end = parseCellReference(endRaw);
49
49
  if (start === void 0 || end === void 0) return;
package/dist/a1.js CHANGED
@@ -42,7 +42,7 @@ function cellReference(row, column) {
42
42
  function parseRangeReference(ref) {
43
43
  const separatorIndex = ref.indexOf(":");
44
44
  const startRaw = separatorIndex === -1 ? ref : ref.slice(0, separatorIndex);
45
- const endRaw = separatorIndex === -1 ? ref : ref.slice(separatorIndex + 1);
45
+ const endRaw = ref.slice(separatorIndex + 1);
46
46
  const start = parseCellReference(startRaw);
47
47
  const end = parseCellReference(endRaw);
48
48
  if (start === void 0 || end === void 0) return;
package/dist/codec.d.cts CHANGED
@@ -1,4 +1,4 @@
1
- import { C as ContentDocument } from "./content-JJrcHjkR.cjs";
1
+ import { C as ContentDocument } from "./content-zNNPbwYY.cjs";
2
2
  //#region src/codec.d.ts
3
3
  interface ContentCodec<TOptions = unknown> {
4
4
  read(bytes: Uint8Array, options?: TOptions): ContentDocument;
package/dist/codec.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { C as ContentDocument } from "./content-Ck4LdLBJ.js";
1
+ import { C as ContentDocument } from "./content-GHj_31uQ.js";
2
2
  //#region src/codec.d.ts
3
3
  interface ContentCodec<TOptions = unknown> {
4
4
  read(bytes: Uint8Array, options?: TOptions): ContentDocument;
package/dist/color.cjs CHANGED
@@ -11,13 +11,11 @@ const COLOR_BLACK = {
11
11
  g: 0,
12
12
  b: 0
13
13
  };
14
- const HEX_COLOR_PATTERN = /^#?([0-9a-fA-F]{6})$/;
14
+ const HEX_DIGITS_PATTERN = /^[0-9a-fA-F]{6}$/;
15
15
  const HEX_BYTE_MAX = 255;
16
16
  function rgbHexToColor(hex) {
17
- const match = HEX_COLOR_PATTERN.exec(hex);
18
- if (match === null) throw new Error(`not a 6-digit hex colour: ${hex}`);
19
- const digits = match[1];
20
- if (digits === void 0) throw new Error(`not a 6-digit hex colour: ${hex}`);
17
+ const digits = hex.startsWith("#") ? hex.slice(1) : hex;
18
+ if (!HEX_DIGITS_PATTERN.test(digits)) throw new Error(`not a 6-digit hex colour: ${hex}`);
21
19
  const r = Number.parseInt(digits.slice(0, 2), 16);
22
20
  const g = Number.parseInt(digits.slice(2, 4), 16);
23
21
  const b = Number.parseInt(digits.slice(4, 6), 16);
package/dist/color.js CHANGED
@@ -10,13 +10,11 @@ const COLOR_BLACK = {
10
10
  g: 0,
11
11
  b: 0
12
12
  };
13
- const HEX_COLOR_PATTERN = /^#?([0-9a-fA-F]{6})$/;
13
+ const HEX_DIGITS_PATTERN = /^[0-9a-fA-F]{6}$/;
14
14
  const HEX_BYTE_MAX = 255;
15
15
  function rgbHexToColor(hex) {
16
- const match = HEX_COLOR_PATTERN.exec(hex);
17
- if (match === null) throw new Error(`not a 6-digit hex colour: ${hex}`);
18
- const digits = match[1];
19
- if (digits === void 0) throw new Error(`not a 6-digit hex colour: ${hex}`);
16
+ const digits = hex.startsWith("#") ? hex.slice(1) : hex;
17
+ if (!HEX_DIGITS_PATTERN.test(digits)) throw new Error(`not a 6-digit hex colour: ${hex}`);
20
18
  const r = Number.parseInt(digits.slice(0, 2), 16);
21
19
  const g = Number.parseInt(digits.slice(2, 4), 16);
22
20
  const b = Number.parseInt(digits.slice(4, 6), 16);
@@ -1,12 +1,12 @@
1
1
  import { z } from "zod";
2
2
  //#region src/construct.d.ts
3
3
  declare const ContentControlTypeSchema: z.ZodEnum<{
4
- date: "date";
5
4
  richText: "richText";
6
5
  plainText: "plainText";
7
6
  checkbox: "checkbox";
8
7
  dropDown: "dropDown";
9
8
  comboBox: "comboBox";
9
+ date: "date";
10
10
  picture: "picture";
11
11
  repeatingSection: "repeatingSection";
12
12
  button: "button";
@@ -23,12 +23,12 @@ type ContentControlLock = z.infer<typeof ContentControlLockSchema>;
23
23
  declare const ContentControlDescriptorSchema: z.ZodObject<{
24
24
  kind: z.ZodLiteral<"contentControl">;
25
25
  controlType: z.ZodEnum<{
26
- date: "date";
27
26
  richText: "richText";
28
27
  plainText: "plainText";
29
28
  checkbox: "checkbox";
30
29
  dropDown: "dropDown";
31
30
  comboBox: "comboBox";
31
+ date: "date";
32
32
  picture: "picture";
33
33
  repeatingSection: "repeatingSection";
34
34
  button: "button";
@@ -252,12 +252,12 @@ type DivisionDescriptor = z.infer<typeof DivisionDescriptorSchema>;
252
252
  declare const ConstructDescriptorSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
253
253
  kind: z.ZodLiteral<"contentControl">;
254
254
  controlType: z.ZodEnum<{
255
- date: "date";
256
255
  richText: "richText";
257
256
  plainText: "plainText";
258
257
  checkbox: "checkbox";
259
258
  dropDown: "dropDown";
260
259
  comboBox: "comboBox";
260
+ date: "date";
261
261
  picture: "picture";
262
262
  repeatingSection: "repeatingSection";
263
263
  button: "button";
@@ -1,2 +1,2 @@
1
- import { C as ProvenanceChange, E as ProvenanceDescriptorSchema, S as LinkTargetSchema, T as ProvenanceDescriptor, _ as FieldDescriptor, a as ConstructDescriptor, b as LinkDescriptorSchema, c as ContentControlDescriptorSchema, d as ContentControlType, f as ContentControlTypeSchema, g as DivisionSourceSchema, h as DivisionSource, i as AnchorTypeSchema, l as ContentControlLock, m as DivisionDescriptorSchema, n as AnchorDescriptorSchema, o as ConstructDescriptorSchema, p as DivisionDescriptor, r as AnchorType, s as ContentControlDescriptor, t as AnchorDescriptor, u as ContentControlLockSchema, v as FieldDescriptorSchema, w as ProvenanceChangeSchema, x as LinkTarget, y as LinkDescriptor } from "./construct-GVdTKrE7.js";
1
+ import { C as ProvenanceChange, E as ProvenanceDescriptorSchema, S as LinkTargetSchema, T as ProvenanceDescriptor, _ as FieldDescriptor, a as ConstructDescriptor, b as LinkDescriptorSchema, c as ContentControlDescriptorSchema, d as ContentControlType, f as ContentControlTypeSchema, g as DivisionSourceSchema, h as DivisionSource, i as AnchorTypeSchema, l as ContentControlLock, m as DivisionDescriptorSchema, n as AnchorDescriptorSchema, o as ConstructDescriptorSchema, p as DivisionDescriptor, r as AnchorType, s as ContentControlDescriptor, t as AnchorDescriptor, u as ContentControlLockSchema, v as FieldDescriptorSchema, w as ProvenanceChangeSchema, x as LinkTarget, y as LinkDescriptor } from "./construct-C9cYkjnd.js";
2
2
  export { AnchorDescriptor, AnchorDescriptorSchema, AnchorType, AnchorTypeSchema, ConstructDescriptor, ConstructDescriptorSchema, ContentControlDescriptor, ContentControlDescriptorSchema, ContentControlLock, ContentControlLockSchema, ContentControlType, ContentControlTypeSchema, DivisionDescriptor, DivisionDescriptorSchema, DivisionSource, DivisionSourceSchema, FieldDescriptor, FieldDescriptorSchema, LinkDescriptor, LinkDescriptorSchema, LinkTarget, LinkTargetSchema, ProvenanceChange, ProvenanceChangeSchema, ProvenanceDescriptor, ProvenanceDescriptorSchema };
@@ -205,12 +205,12 @@ declare const RunConstructExtentSchema: z.ZodObject<{
205
205
  descriptor: z.ZodDiscriminatedUnion<[z.ZodObject<{
206
206
  kind: z.ZodLiteral<"contentControl">;
207
207
  controlType: z.ZodEnum<{
208
- date: "date";
209
208
  richText: "richText";
210
209
  plainText: "plainText";
211
210
  checkbox: "checkbox";
212
211
  dropDown: "dropDown";
213
212
  comboBox: "comboBox";
213
+ date: "date";
214
214
  picture: "picture";
215
215
  repeatingSection: "repeatingSection";
216
216
  button: "button";
@@ -588,12 +588,12 @@ declare const ContentParagraphSchema: z.ZodObject<{
588
588
  descriptor: z.ZodDiscriminatedUnion<[z.ZodObject<{
589
589
  kind: z.ZodLiteral<"contentControl">;
590
590
  controlType: z.ZodEnum<{
591
- date: "date";
592
591
  richText: "richText";
593
592
  plainText: "plainText";
594
593
  checkbox: "checkbox";
595
594
  dropDown: "dropDown";
596
595
  comboBox: "comboBox";
596
+ date: "date";
597
597
  picture: "picture";
598
598
  repeatingSection: "repeatingSection";
599
599
  button: "button";
@@ -1305,12 +1305,12 @@ declare const ContentConstructStartSchema: z.ZodObject<{
1305
1305
  descriptor: z.ZodDiscriminatedUnion<[z.ZodObject<{
1306
1306
  kind: z.ZodLiteral<"contentControl">;
1307
1307
  controlType: z.ZodEnum<{
1308
- date: "date";
1309
1308
  richText: "richText";
1310
1309
  plainText: "plainText";
1311
1310
  checkbox: "checkbox";
1312
1311
  dropDown: "dropDown";
1313
1312
  comboBox: "comboBox";
1313
+ date: "date";
1314
1314
  picture: "picture";
1315
1315
  repeatingSection: "repeatingSection";
1316
1316
  button: "button";
@@ -27,9 +27,7 @@ function getMathMlJsonSchemas() {
27
27
  return cachedMathMlJsonSchemas;
28
28
  }
29
29
  function mathMlDef(id) {
30
- const generated = getMathMlJsonSchemas()[id];
31
- if (generated === void 0) throw new Error(`z.toJSONSchema() produced no schema for registered id "${id}"`);
32
- const stripped = { ...generated };
30
+ const stripped = { ...getMathMlJsonSchemas()[id] };
33
31
  delete stripped.$schema;
34
32
  delete stripped.$id;
35
33
  return stripped;
@@ -26,9 +26,7 @@ function getMathMlJsonSchemas() {
26
26
  return cachedMathMlJsonSchemas;
27
27
  }
28
28
  function mathMlDef(id) {
29
- const generated = getMathMlJsonSchemas()[id];
30
- if (generated === void 0) throw new Error(`z.toJSONSchema() produced no schema for registered id "${id}"`);
31
- const stripped = { ...generated };
29
+ const stripped = { ...getMathMlJsonSchemas()[id] };
32
30
  delete stripped.$schema;
33
31
  delete stripped.$id;
34
32
  return stripped;
@@ -205,12 +205,12 @@ declare const RunConstructExtentSchema: z.ZodObject<{
205
205
  descriptor: z.ZodDiscriminatedUnion<[z.ZodObject<{
206
206
  kind: z.ZodLiteral<"contentControl">;
207
207
  controlType: z.ZodEnum<{
208
- date: "date";
209
208
  richText: "richText";
210
209
  plainText: "plainText";
211
210
  checkbox: "checkbox";
212
211
  dropDown: "dropDown";
213
212
  comboBox: "comboBox";
213
+ date: "date";
214
214
  picture: "picture";
215
215
  repeatingSection: "repeatingSection";
216
216
  button: "button";
@@ -588,12 +588,12 @@ declare const ContentParagraphSchema: z.ZodObject<{
588
588
  descriptor: z.ZodDiscriminatedUnion<[z.ZodObject<{
589
589
  kind: z.ZodLiteral<"contentControl">;
590
590
  controlType: z.ZodEnum<{
591
- date: "date";
592
591
  richText: "richText";
593
592
  plainText: "plainText";
594
593
  checkbox: "checkbox";
595
594
  dropDown: "dropDown";
596
595
  comboBox: "comboBox";
596
+ date: "date";
597
597
  picture: "picture";
598
598
  repeatingSection: "repeatingSection";
599
599
  button: "button";
@@ -1305,12 +1305,12 @@ declare const ContentConstructStartSchema: z.ZodObject<{
1305
1305
  descriptor: z.ZodDiscriminatedUnion<[z.ZodObject<{
1306
1306
  kind: z.ZodLiteral<"contentControl">;
1307
1307
  controlType: z.ZodEnum<{
1308
- date: "date";
1309
1308
  richText: "richText";
1310
1309
  plainText: "plainText";
1311
1310
  checkbox: "checkbox";
1312
1311
  dropDown: "dropDown";
1313
1312
  comboBox: "comboBox";
1313
+ date: "date";
1314
1314
  picture: "picture";
1315
1315
  repeatingSection: "repeatingSection";
1316
1316
  button: "button";
package/dist/content.cjs CHANGED
@@ -165,7 +165,7 @@ const IMAGE_FORMATS = [
165
165
  "gif"
166
166
  ];
167
167
  function isImageFormat(value) {
168
- return typeof value === "string" && IMAGE_FORMATS.includes(value);
168
+ return IMAGE_FORMATS.includes(value);
169
169
  }
170
170
  const ContentImageOriginalSchema = zod.z.object({
171
171
  filter: zod.z.enum(["jbig2", "jpeg2000"]),
@@ -1,2 +1,2 @@
1
- import { $ as ContentHatchStyleSchema, $t as ContentSheetRepeatRange, A as ContentEmbeddedObjectKind, An as RunConstructExtent, At as ContentSheetCellComment, B as ContentFloatPosition, Bn as isContentConstructEnd, Bt as ContentSheetConditionalFormatValueSchema, C as ContentDocument, Cn as ContentVectorSchema, Ct as ContentRunSchema, D as ContentEmbeddedObject, Dn as IMAGE_FORMATS, Dt as ContentShapeSchema, E as ContentDrawPageSchema, En as FusedNode, Et as ContentShape, F as ContentFloatAlignSchema, Fn as clampHeadingLevel, Ft as ContentSheetConditionalFormat, G as ContentFormulaSchema, Gt as ContentSheetImage, H as ContentFont, Hn as isRunConstructExtent, Ht as ContentSheetDataValidationSchema, I as ContentFloatAxis, In as contentDocumentSharedFields, It as ContentSheetConditionalFormatSchema, J as ContentGradientStyle, Jt as ContentSheetPrintRangeSchema, K as ContentGradientFill, Kt as ContentSheetImageSchema, L as ContentFloatAxisSchema, Ln as findConstructMarkerImbalance, Lt as ContentSheetConditionalFormatStyle, M as ContentFillPattern, Mn as RunConstructFault, Mt as ContentSheetCellSchema, N as ContentFillPatternSchema, Nn as SheetRuleOperator, Nt as ContentSheetColumn, O as ContentEmbeddedObjectBlock, On as ImageFormat, Ot as ContentSheet, P as ContentFloatAlign, Pn as SheetRuleOperatorSchema, Pt as ContentSheetColumnSchema, Q as ContentHatchStyle, Qt as ContentSheetRangeSchema, R as ContentFloatOrigin, Rn as findRunConstructFault, Rt as ContentSheetConditionalFormatStyleSchema, S as ContentDefinedNameSchema, Sn as ContentVector, St as ContentRun, T as ContentDrawPage, Tn as DecimalStringSchema, Tt as ContentSectionSchema, U as ContentFontSchema, Un as resolveCellFillColor, Ut as ContentSheetDataValidationType, V as ContentFloatPositionSchema, Vn as isContentConstructStart, Vt as ContentSheetDataValidation, W as ContentFormula, Wn as unrecognizedFillKind, Wt as ContentSheetDataValidationTypeSchema, X as ContentHatchFill, Xt as ContentSheetPrintSettingsSchema, Y as ContentGradientStyleSchema, Yt as ContentSheetPrintSettings, Z as ContentHatchFillSchema, Zt as ContentSheetRange, _ as ContentConstructEnd, _n as ContentTableRow, _t as ContentParagraphSchema, a as ContentBlock, an as ContentSlideSchema, at as ContentInterpretationSchema, b as ContentConstructStartSchema, bn as ContentTranscript, bt as ContentPathSegment, c as ContentBorderSchema, cn as ContentStrokeDashSchema, ct as ContentOrigin, d as ContentCellFill, dn as ContentStrokeStyleSchema, dt as ContentPageBreakSchema, en as ContentSheetRepeatRangeSchema, et as ContentImageBlock, f as ContentCellFillSchema, fn as ContentSubpath, ft as ContentPageFurniture, g as ContentCellValueSchema, gn as ContentTableCellSchema, gt as ContentParagraphBordersSchema, h as ContentCellValue, hn as ContentTableCell, ht as ContentParagraphBorders, i as ContentBitmapFillSchema, in as ContentSlide, it as ContentInterpretation, j as ContentEmbeddedObjectSchema, jn as RunConstructExtentSchema, jt as ContentSheetCellCommentSchema, k as ContentEmbeddedObjectBlockSchema, kn as RUN_FONT_PROPERTY_SHAPE, kt as ContentSheetCell, l as ContentCellBorders, ln as ContentStrokeSchema, lt as ContentOriginSchema, m as ContentCellPatternTypeSchema, mn as ContentTable, mt as ContentParagraph, n as ConstructMarkerImbalance, nn as ContentSheetRowSchema, nt as ContentImageOriginal, o as ContentBlockSchema, on as ContentStroke, ot as ContentListMembership, p as ContentCellPatternType, pn as ContentSubpathSchema, pt as ContentPageFurnitureSchema, q as ContentGradientFillSchema, qt as ContentSheetPrintRange, r as ContentBitmapFill, rn as ContentSheetSchema, rt as ContentImageOriginalSchema, s as ContentBorder, sn as ContentStrokeDash, st as ContentListMembershipSchema, t as CONTENT_ANNOTATION_FIELDS, tn as ContentSheetRow, tt as ContentImageBlockSchema, u as ContentCellBordersSchema, un as ContentStrokeStyle, ut as ContentPageBreak, v as ContentConstructEndSchema, vn as ContentTableRowSchema, vt as ContentPathPoint, w as ContentDocumentSchema, wn as DecimalString, wt as ContentSection, x as ContentDefinedName, xn as ContentTranscriptSchema, xt as ContentPathSegmentSchema, y as ContentConstructStart, yn as ContentTableSchema, yt as ContentPathPointSchema, z as ContentFloatOriginSchema, zn as isContentBlock, zt as ContentSheetConditionalFormatValue } from "./content-JJrcHjkR.cjs";
1
+ import { $ as ContentHatchStyleSchema, $t as ContentSheetRepeatRange, A as ContentEmbeddedObjectKind, An as RunConstructExtent, At as ContentSheetCellComment, B as ContentFloatPosition, Bn as isContentConstructEnd, Bt as ContentSheetConditionalFormatValueSchema, C as ContentDocument, Cn as ContentVectorSchema, Ct as ContentRunSchema, D as ContentEmbeddedObject, Dn as IMAGE_FORMATS, Dt as ContentShapeSchema, E as ContentDrawPageSchema, En as FusedNode, Et as ContentShape, F as ContentFloatAlignSchema, Fn as clampHeadingLevel, Ft as ContentSheetConditionalFormat, G as ContentFormulaSchema, Gt as ContentSheetImage, H as ContentFont, Hn as isRunConstructExtent, Ht as ContentSheetDataValidationSchema, I as ContentFloatAxis, In as contentDocumentSharedFields, It as ContentSheetConditionalFormatSchema, J as ContentGradientStyle, Jt as ContentSheetPrintRangeSchema, K as ContentGradientFill, Kt as ContentSheetImageSchema, L as ContentFloatAxisSchema, Ln as findConstructMarkerImbalance, Lt as ContentSheetConditionalFormatStyle, M as ContentFillPattern, Mn as RunConstructFault, Mt as ContentSheetCellSchema, N as ContentFillPatternSchema, Nn as SheetRuleOperator, Nt as ContentSheetColumn, O as ContentEmbeddedObjectBlock, On as ImageFormat, Ot as ContentSheet, P as ContentFloatAlign, Pn as SheetRuleOperatorSchema, Pt as ContentSheetColumnSchema, Q as ContentHatchStyle, Qt as ContentSheetRangeSchema, R as ContentFloatOrigin, Rn as findRunConstructFault, Rt as ContentSheetConditionalFormatStyleSchema, S as ContentDefinedNameSchema, Sn as ContentVector, St as ContentRun, T as ContentDrawPage, Tn as DecimalStringSchema, Tt as ContentSectionSchema, U as ContentFontSchema, Un as resolveCellFillColor, Ut as ContentSheetDataValidationType, V as ContentFloatPositionSchema, Vn as isContentConstructStart, Vt as ContentSheetDataValidation, W as ContentFormula, Wn as unrecognizedFillKind, Wt as ContentSheetDataValidationTypeSchema, X as ContentHatchFill, Xt as ContentSheetPrintSettingsSchema, Y as ContentGradientStyleSchema, Yt as ContentSheetPrintSettings, Z as ContentHatchFillSchema, Zt as ContentSheetRange, _ as ContentConstructEnd, _n as ContentTableRow, _t as ContentParagraphSchema, a as ContentBlock, an as ContentSlideSchema, at as ContentInterpretationSchema, b as ContentConstructStartSchema, bn as ContentTranscript, bt as ContentPathSegment, c as ContentBorderSchema, cn as ContentStrokeDashSchema, ct as ContentOrigin, d as ContentCellFill, dn as ContentStrokeStyleSchema, dt as ContentPageBreakSchema, en as ContentSheetRepeatRangeSchema, et as ContentImageBlock, f as ContentCellFillSchema, fn as ContentSubpath, ft as ContentPageFurniture, g as ContentCellValueSchema, gn as ContentTableCellSchema, gt as ContentParagraphBordersSchema, h as ContentCellValue, hn as ContentTableCell, ht as ContentParagraphBorders, i as ContentBitmapFillSchema, in as ContentSlide, it as ContentInterpretation, j as ContentEmbeddedObjectSchema, jn as RunConstructExtentSchema, jt as ContentSheetCellCommentSchema, k as ContentEmbeddedObjectBlockSchema, kn as RUN_FONT_PROPERTY_SHAPE, kt as ContentSheetCell, l as ContentCellBorders, ln as ContentStrokeSchema, lt as ContentOriginSchema, m as ContentCellPatternTypeSchema, mn as ContentTable, mt as ContentParagraph, n as ConstructMarkerImbalance, nn as ContentSheetRowSchema, nt as ContentImageOriginal, o as ContentBlockSchema, on as ContentStroke, ot as ContentListMembership, p as ContentCellPatternType, pn as ContentSubpathSchema, pt as ContentPageFurnitureSchema, q as ContentGradientFillSchema, qt as ContentSheetPrintRange, r as ContentBitmapFill, rn as ContentSheetSchema, rt as ContentImageOriginalSchema, s as ContentBorder, sn as ContentStrokeDash, st as ContentListMembershipSchema, t as CONTENT_ANNOTATION_FIELDS, tn as ContentSheetRow, tt as ContentImageBlockSchema, u as ContentCellBordersSchema, un as ContentStrokeStyle, ut as ContentPageBreak, v as ContentConstructEndSchema, vn as ContentTableRowSchema, vt as ContentPathPoint, w as ContentDocumentSchema, wn as DecimalString, wt as ContentSection, x as ContentDefinedName, xn as ContentTranscriptSchema, xt as ContentPathSegmentSchema, y as ContentConstructStart, yn as ContentTableSchema, yt as ContentPathPointSchema, z as ContentFloatOriginSchema, zn as isContentBlock, zt as ContentSheetConditionalFormatValue } from "./content-zNNPbwYY.cjs";
2
2
  export { CONTENT_ANNOTATION_FIELDS, ConstructMarkerImbalance, ContentBitmapFill, ContentBitmapFillSchema, ContentBlock, ContentBlockSchema, ContentBorder, ContentBorderSchema, ContentCellBorders, ContentCellBordersSchema, ContentCellFill, ContentCellFillSchema, ContentCellPatternType, ContentCellPatternTypeSchema, ContentCellValue, ContentCellValueSchema, ContentConstructEnd, ContentConstructEndSchema, ContentConstructStart, ContentConstructStartSchema, ContentDefinedName, ContentDefinedNameSchema, ContentDocument, ContentDocumentSchema, ContentDrawPage, ContentDrawPageSchema, ContentEmbeddedObject, ContentEmbeddedObjectBlock, ContentEmbeddedObjectBlockSchema, ContentEmbeddedObjectKind, ContentEmbeddedObjectSchema, ContentFillPattern, ContentFillPatternSchema, ContentFloatAlign, ContentFloatAlignSchema, ContentFloatAxis, ContentFloatAxisSchema, ContentFloatOrigin, ContentFloatOriginSchema, ContentFloatPosition, ContentFloatPositionSchema, ContentFont, ContentFontSchema, ContentFormula, ContentFormulaSchema, ContentGradientFill, ContentGradientFillSchema, ContentGradientStyle, ContentGradientStyleSchema, ContentHatchFill, ContentHatchFillSchema, ContentHatchStyle, ContentHatchStyleSchema, ContentImageBlock, ContentImageBlockSchema, ContentImageOriginal, ContentImageOriginalSchema, ContentInterpretation, ContentInterpretationSchema, ContentListMembership, ContentListMembershipSchema, ContentOrigin, ContentOriginSchema, ContentPageBreak, ContentPageBreakSchema, ContentPageFurniture, ContentPageFurnitureSchema, ContentParagraph, ContentParagraphBorders, ContentParagraphBordersSchema, ContentParagraphSchema, ContentPathPoint, ContentPathPointSchema, ContentPathSegment, ContentPathSegmentSchema, ContentRun, ContentRunSchema, ContentSection, ContentSectionSchema, ContentShape, ContentShapeSchema, ContentSheet, ContentSheetCell, ContentSheetCellComment, ContentSheetCellCommentSchema, ContentSheetCellSchema, ContentSheetColumn, ContentSheetColumnSchema, ContentSheetConditionalFormat, ContentSheetConditionalFormatSchema, ContentSheetConditionalFormatStyle, ContentSheetConditionalFormatStyleSchema, ContentSheetConditionalFormatValue, ContentSheetConditionalFormatValueSchema, ContentSheetDataValidation, ContentSheetDataValidationSchema, ContentSheetDataValidationType, ContentSheetDataValidationTypeSchema, ContentSheetImage, ContentSheetImageSchema, ContentSheetPrintRange, ContentSheetPrintRangeSchema, ContentSheetPrintSettings, ContentSheetPrintSettingsSchema, ContentSheetRange, ContentSheetRangeSchema, ContentSheetRepeatRange, ContentSheetRepeatRangeSchema, ContentSheetRow, ContentSheetRowSchema, ContentSheetSchema, ContentSlide, ContentSlideSchema, ContentStroke, ContentStrokeDash, ContentStrokeDashSchema, ContentStrokeSchema, ContentStrokeStyle, ContentStrokeStyleSchema, ContentSubpath, ContentSubpathSchema, ContentTable, ContentTableCell, ContentTableCellSchema, ContentTableRow, ContentTableRowSchema, ContentTableSchema, ContentTranscript, ContentTranscriptSchema, ContentVector, ContentVectorSchema, DecimalString, DecimalStringSchema, FusedNode, IMAGE_FORMATS, ImageFormat, RUN_FONT_PROPERTY_SHAPE, RunConstructExtent, RunConstructExtentSchema, RunConstructFault, SheetRuleOperator, SheetRuleOperatorSchema, clampHeadingLevel, contentDocumentSharedFields, findConstructMarkerImbalance, findRunConstructFault, isContentBlock, isContentConstructEnd, isContentConstructStart, isRunConstructExtent, resolveCellFillColor, unrecognizedFillKind };
package/dist/content.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- import { $ as ContentHatchStyleSchema, $t as ContentSheetRepeatRange, A as ContentEmbeddedObjectKind, An as RunConstructExtent, At as ContentSheetCellComment, B as ContentFloatPosition, Bn as isContentConstructEnd, Bt as ContentSheetConditionalFormatValueSchema, C as ContentDocument, Cn as ContentVectorSchema, Ct as ContentRunSchema, D as ContentEmbeddedObject, Dn as IMAGE_FORMATS, Dt as ContentShapeSchema, E as ContentDrawPageSchema, En as FusedNode, Et as ContentShape, F as ContentFloatAlignSchema, Fn as clampHeadingLevel, Ft as ContentSheetConditionalFormat, G as ContentFormulaSchema, Gt as ContentSheetImage, H as ContentFont, Hn as isRunConstructExtent, Ht as ContentSheetDataValidationSchema, I as ContentFloatAxis, In as contentDocumentSharedFields, It as ContentSheetConditionalFormatSchema, J as ContentGradientStyle, Jt as ContentSheetPrintRangeSchema, K as ContentGradientFill, Kt as ContentSheetImageSchema, L as ContentFloatAxisSchema, Ln as findConstructMarkerImbalance, Lt as ContentSheetConditionalFormatStyle, M as ContentFillPattern, Mn as RunConstructFault, Mt as ContentSheetCellSchema, N as ContentFillPatternSchema, Nn as SheetRuleOperator, Nt as ContentSheetColumn, O as ContentEmbeddedObjectBlock, On as ImageFormat, Ot as ContentSheet, P as ContentFloatAlign, Pn as SheetRuleOperatorSchema, Pt as ContentSheetColumnSchema, Q as ContentHatchStyle, Qt as ContentSheetRangeSchema, R as ContentFloatOrigin, Rn as findRunConstructFault, Rt as ContentSheetConditionalFormatStyleSchema, S as ContentDefinedNameSchema, Sn as ContentVector, St as ContentRun, T as ContentDrawPage, Tn as DecimalStringSchema, Tt as ContentSectionSchema, U as ContentFontSchema, Un as resolveCellFillColor, Ut as ContentSheetDataValidationType, V as ContentFloatPositionSchema, Vn as isContentConstructStart, Vt as ContentSheetDataValidation, W as ContentFormula, Wn as unrecognizedFillKind, Wt as ContentSheetDataValidationTypeSchema, X as ContentHatchFill, Xt as ContentSheetPrintSettingsSchema, Y as ContentGradientStyleSchema, Yt as ContentSheetPrintSettings, Z as ContentHatchFillSchema, Zt as ContentSheetRange, _ as ContentConstructEnd, _n as ContentTableRow, _t as ContentParagraphSchema, a as ContentBlock, an as ContentSlideSchema, at as ContentInterpretationSchema, b as ContentConstructStartSchema, bn as ContentTranscript, bt as ContentPathSegment, c as ContentBorderSchema, cn as ContentStrokeDashSchema, ct as ContentOrigin, d as ContentCellFill, dn as ContentStrokeStyleSchema, dt as ContentPageBreakSchema, en as ContentSheetRepeatRangeSchema, et as ContentImageBlock, f as ContentCellFillSchema, fn as ContentSubpath, ft as ContentPageFurniture, g as ContentCellValueSchema, gn as ContentTableCellSchema, gt as ContentParagraphBordersSchema, h as ContentCellValue, hn as ContentTableCell, ht as ContentParagraphBorders, i as ContentBitmapFillSchema, in as ContentSlide, it as ContentInterpretation, j as ContentEmbeddedObjectSchema, jn as RunConstructExtentSchema, jt as ContentSheetCellCommentSchema, k as ContentEmbeddedObjectBlockSchema, kn as RUN_FONT_PROPERTY_SHAPE, kt as ContentSheetCell, l as ContentCellBorders, ln as ContentStrokeSchema, lt as ContentOriginSchema, m as ContentCellPatternTypeSchema, mn as ContentTable, mt as ContentParagraph, n as ConstructMarkerImbalance, nn as ContentSheetRowSchema, nt as ContentImageOriginal, o as ContentBlockSchema, on as ContentStroke, ot as ContentListMembership, p as ContentCellPatternType, pn as ContentSubpathSchema, pt as ContentPageFurnitureSchema, q as ContentGradientFillSchema, qt as ContentSheetPrintRange, r as ContentBitmapFill, rn as ContentSheetSchema, rt as ContentImageOriginalSchema, s as ContentBorder, sn as ContentStrokeDash, st as ContentListMembershipSchema, t as CONTENT_ANNOTATION_FIELDS, tn as ContentSheetRow, tt as ContentImageBlockSchema, u as ContentCellBordersSchema, un as ContentStrokeStyle, ut as ContentPageBreak, v as ContentConstructEndSchema, vn as ContentTableRowSchema, vt as ContentPathPoint, w as ContentDocumentSchema, wn as DecimalString, wt as ContentSection, x as ContentDefinedName, xn as ContentTranscriptSchema, xt as ContentPathSegmentSchema, y as ContentConstructStart, yn as ContentTableSchema, yt as ContentPathPointSchema, z as ContentFloatOriginSchema, zn as isContentBlock, zt as ContentSheetConditionalFormatValue } from "./content-Ck4LdLBJ.js";
1
+ import { $ as ContentHatchStyleSchema, $t as ContentSheetRepeatRange, A as ContentEmbeddedObjectKind, An as RunConstructExtent, At as ContentSheetCellComment, B as ContentFloatPosition, Bn as isContentConstructEnd, Bt as ContentSheetConditionalFormatValueSchema, C as ContentDocument, Cn as ContentVectorSchema, Ct as ContentRunSchema, D as ContentEmbeddedObject, Dn as IMAGE_FORMATS, Dt as ContentShapeSchema, E as ContentDrawPageSchema, En as FusedNode, Et as ContentShape, F as ContentFloatAlignSchema, Fn as clampHeadingLevel, Ft as ContentSheetConditionalFormat, G as ContentFormulaSchema, Gt as ContentSheetImage, H as ContentFont, Hn as isRunConstructExtent, Ht as ContentSheetDataValidationSchema, I as ContentFloatAxis, In as contentDocumentSharedFields, It as ContentSheetConditionalFormatSchema, J as ContentGradientStyle, Jt as ContentSheetPrintRangeSchema, K as ContentGradientFill, Kt as ContentSheetImageSchema, L as ContentFloatAxisSchema, Ln as findConstructMarkerImbalance, Lt as ContentSheetConditionalFormatStyle, M as ContentFillPattern, Mn as RunConstructFault, Mt as ContentSheetCellSchema, N as ContentFillPatternSchema, Nn as SheetRuleOperator, Nt as ContentSheetColumn, O as ContentEmbeddedObjectBlock, On as ImageFormat, Ot as ContentSheet, P as ContentFloatAlign, Pn as SheetRuleOperatorSchema, Pt as ContentSheetColumnSchema, Q as ContentHatchStyle, Qt as ContentSheetRangeSchema, R as ContentFloatOrigin, Rn as findRunConstructFault, Rt as ContentSheetConditionalFormatStyleSchema, S as ContentDefinedNameSchema, Sn as ContentVector, St as ContentRun, T as ContentDrawPage, Tn as DecimalStringSchema, Tt as ContentSectionSchema, U as ContentFontSchema, Un as resolveCellFillColor, Ut as ContentSheetDataValidationType, V as ContentFloatPositionSchema, Vn as isContentConstructStart, Vt as ContentSheetDataValidation, W as ContentFormula, Wn as unrecognizedFillKind, Wt as ContentSheetDataValidationTypeSchema, X as ContentHatchFill, Xt as ContentSheetPrintSettingsSchema, Y as ContentGradientStyleSchema, Yt as ContentSheetPrintSettings, Z as ContentHatchFillSchema, Zt as ContentSheetRange, _ as ContentConstructEnd, _n as ContentTableRow, _t as ContentParagraphSchema, a as ContentBlock, an as ContentSlideSchema, at as ContentInterpretationSchema, b as ContentConstructStartSchema, bn as ContentTranscript, bt as ContentPathSegment, c as ContentBorderSchema, cn as ContentStrokeDashSchema, ct as ContentOrigin, d as ContentCellFill, dn as ContentStrokeStyleSchema, dt as ContentPageBreakSchema, en as ContentSheetRepeatRangeSchema, et as ContentImageBlock, f as ContentCellFillSchema, fn as ContentSubpath, ft as ContentPageFurniture, g as ContentCellValueSchema, gn as ContentTableCellSchema, gt as ContentParagraphBordersSchema, h as ContentCellValue, hn as ContentTableCell, ht as ContentParagraphBorders, i as ContentBitmapFillSchema, in as ContentSlide, it as ContentInterpretation, j as ContentEmbeddedObjectSchema, jn as RunConstructExtentSchema, jt as ContentSheetCellCommentSchema, k as ContentEmbeddedObjectBlockSchema, kn as RUN_FONT_PROPERTY_SHAPE, kt as ContentSheetCell, l as ContentCellBorders, ln as ContentStrokeSchema, lt as ContentOriginSchema, m as ContentCellPatternTypeSchema, mn as ContentTable, mt as ContentParagraph, n as ConstructMarkerImbalance, nn as ContentSheetRowSchema, nt as ContentImageOriginal, o as ContentBlockSchema, on as ContentStroke, ot as ContentListMembership, p as ContentCellPatternType, pn as ContentSubpathSchema, pt as ContentPageFurnitureSchema, q as ContentGradientFillSchema, qt as ContentSheetPrintRange, r as ContentBitmapFill, rn as ContentSheetSchema, rt as ContentImageOriginalSchema, s as ContentBorder, sn as ContentStrokeDash, st as ContentListMembershipSchema, t as CONTENT_ANNOTATION_FIELDS, tn as ContentSheetRow, tt as ContentImageBlockSchema, u as ContentCellBordersSchema, un as ContentStrokeStyle, ut as ContentPageBreak, v as ContentConstructEndSchema, vn as ContentTableRowSchema, vt as ContentPathPoint, w as ContentDocumentSchema, wn as DecimalString, wt as ContentSection, x as ContentDefinedName, xn as ContentTranscriptSchema, xt as ContentPathSegmentSchema, y as ContentConstructStart, yn as ContentTableSchema, yt as ContentPathPointSchema, z as ContentFloatOriginSchema, zn as isContentBlock, zt as ContentSheetConditionalFormatValue } from "./content-GHj_31uQ.js";
2
2
  export { CONTENT_ANNOTATION_FIELDS, ConstructMarkerImbalance, ContentBitmapFill, ContentBitmapFillSchema, ContentBlock, ContentBlockSchema, ContentBorder, ContentBorderSchema, ContentCellBorders, ContentCellBordersSchema, ContentCellFill, ContentCellFillSchema, ContentCellPatternType, ContentCellPatternTypeSchema, ContentCellValue, ContentCellValueSchema, ContentConstructEnd, ContentConstructEndSchema, ContentConstructStart, ContentConstructStartSchema, ContentDefinedName, ContentDefinedNameSchema, ContentDocument, ContentDocumentSchema, ContentDrawPage, ContentDrawPageSchema, ContentEmbeddedObject, ContentEmbeddedObjectBlock, ContentEmbeddedObjectBlockSchema, ContentEmbeddedObjectKind, ContentEmbeddedObjectSchema, ContentFillPattern, ContentFillPatternSchema, ContentFloatAlign, ContentFloatAlignSchema, ContentFloatAxis, ContentFloatAxisSchema, ContentFloatOrigin, ContentFloatOriginSchema, ContentFloatPosition, ContentFloatPositionSchema, ContentFont, ContentFontSchema, ContentFormula, ContentFormulaSchema, ContentGradientFill, ContentGradientFillSchema, ContentGradientStyle, ContentGradientStyleSchema, ContentHatchFill, ContentHatchFillSchema, ContentHatchStyle, ContentHatchStyleSchema, ContentImageBlock, ContentImageBlockSchema, ContentImageOriginal, ContentImageOriginalSchema, ContentInterpretation, ContentInterpretationSchema, ContentListMembership, ContentListMembershipSchema, ContentOrigin, ContentOriginSchema, ContentPageBreak, ContentPageBreakSchema, ContentPageFurniture, ContentPageFurnitureSchema, ContentParagraph, ContentParagraphBorders, ContentParagraphBordersSchema, ContentParagraphSchema, ContentPathPoint, ContentPathPointSchema, ContentPathSegment, ContentPathSegmentSchema, ContentRun, ContentRunSchema, ContentSection, ContentSectionSchema, ContentShape, ContentShapeSchema, ContentSheet, ContentSheetCell, ContentSheetCellComment, ContentSheetCellCommentSchema, ContentSheetCellSchema, ContentSheetColumn, ContentSheetColumnSchema, ContentSheetConditionalFormat, ContentSheetConditionalFormatSchema, ContentSheetConditionalFormatStyle, ContentSheetConditionalFormatStyleSchema, ContentSheetConditionalFormatValue, ContentSheetConditionalFormatValueSchema, ContentSheetDataValidation, ContentSheetDataValidationSchema, ContentSheetDataValidationType, ContentSheetDataValidationTypeSchema, ContentSheetImage, ContentSheetImageSchema, ContentSheetPrintRange, ContentSheetPrintRangeSchema, ContentSheetPrintSettings, ContentSheetPrintSettingsSchema, ContentSheetRange, ContentSheetRangeSchema, ContentSheetRepeatRange, ContentSheetRepeatRangeSchema, ContentSheetRow, ContentSheetRowSchema, ContentSheetSchema, ContentSlide, ContentSlideSchema, ContentStroke, ContentStrokeDash, ContentStrokeDashSchema, ContentStrokeSchema, ContentStrokeStyle, ContentStrokeStyleSchema, ContentSubpath, ContentSubpathSchema, ContentTable, ContentTableCell, ContentTableCellSchema, ContentTableRow, ContentTableRowSchema, ContentTableSchema, ContentTranscript, ContentTranscriptSchema, ContentVector, ContentVectorSchema, DecimalString, DecimalStringSchema, FusedNode, IMAGE_FORMATS, ImageFormat, RUN_FONT_PROPERTY_SHAPE, RunConstructExtent, RunConstructExtentSchema, RunConstructFault, SheetRuleOperator, SheetRuleOperatorSchema, clampHeadingLevel, contentDocumentSharedFields, findConstructMarkerImbalance, findRunConstructFault, isContentBlock, isContentConstructEnd, isContentConstructStart, isRunConstructExtent, resolveCellFillColor, unrecognizedFillKind };
package/dist/content.js CHANGED
@@ -164,7 +164,7 @@ const IMAGE_FORMATS = [
164
164
  "gif"
165
165
  ];
166
166
  function isImageFormat(value) {
167
- return typeof value === "string" && IMAGE_FORMATS.includes(value);
167
+ return IMAGE_FORMATS.includes(value);
168
168
  }
169
169
  const ContentImageOriginalSchema = z.object({
170
170
  filter: z.enum(["jbig2", "jpeg2000"]),
@@ -1,5 +1,5 @@
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-JJrcHjkR.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-CzUJ6jKN.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-zNNPbwYY.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-DaPwHzsg.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 { 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-Ck4LdLBJ.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-BGyYUU-O.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-GHj_31uQ.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-CIZQ2_C1.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,4 +1,4 @@
1
- import { St as ContentRun, mt as ContentParagraph } from "./content-JJrcHjkR.cjs";
1
+ import { St as ContentRun, mt as ContentParagraph } from "./content-zNNPbwYY.cjs";
2
2
  import { z } from "zod";
3
3
  //#region src/definitions.d.ts
4
4
  declare const StyleParagraphPropertiesSchema: z.ZodObject<{
@@ -1,4 +1,4 @@
1
- import { St as ContentRun, mt as ContentParagraph } from "./content-Ck4LdLBJ.js";
1
+ import { St as ContentRun, mt as ContentParagraph } from "./content-GHj_31uQ.js";
2
2
  import { z } from "zod";
3
3
  //#region src/definitions.d.ts
4
4
  declare const StyleParagraphPropertiesSchema: z.ZodObject<{
@@ -22,18 +22,9 @@ const RUN_STYLE_KEYS = [
22
22
  "sizePt",
23
23
  "color"
24
24
  ];
25
- function isShapeGroupWrapper(wrapper) {
26
- return !("kind" in wrapper.node);
27
- }
28
25
  function isAnchorGroupWrapper(wrapper) {
29
26
  return "kind" in wrapper.node && wrapper.node.kind === "paragraph";
30
27
  }
31
- function isSlideGroupWrapper(wrapper) {
32
- return "kind" in wrapper.node && wrapper.node.kind === "slide";
33
- }
34
- function isDrawPageGroupWrapper(wrapper) {
35
- return "kind" in wrapper.node && wrapper.node.kind === "drawPage";
36
- }
37
28
  function isHeadingGroup(group) {
38
29
  return group.node.headingLevel !== void 0;
39
30
  }
@@ -82,21 +73,13 @@ function factorStyles(pkg) {
82
73
  ...pkg.fonts !== void 0 ? { fonts: pkg.fonts } : {},
83
74
  ...pkg.source !== void 0 ? { source: pkg.source } : {}
84
75
  };
85
- if (pkg.definitions === void 0 && pkg.fonts === void 0 && pkg.source === void 0) return reassembled;
86
76
  return {
87
77
  ...reassembled,
88
78
  ...carried
89
79
  };
90
80
  }
91
81
  function extentOf(wrapper) {
92
- if (isShapeGroupWrapper(wrapper)) return flowExtent(wrapper.children);
93
82
  if (isAnchorGroupWrapper(wrapper)) return [wrapper.node, ...flowExtent(wrapper.children)];
94
- if (isSlideGroupWrapper(wrapper)) return wrapper.children.flatMap(extentOf);
95
- if (isDrawPageGroupWrapper(wrapper)) {
96
- const paragraphs = [];
97
- for (const child of wrapper.children) if ("node" in child) paragraphs.push(...extentOf(child));
98
- return paragraphs;
99
- }
100
83
  return flowExtent(wrapper.children);
101
84
  }
102
85
  function flowExtent(children) {
@@ -107,12 +90,12 @@ function flowExtent(children) {
107
90
  }
108
91
  function paragraphTuple(paragraph, keys) {
109
92
  const tuple = {};
110
- for (const key of keys) if (paragraph[key] !== void 0) tuple[key] = paragraph[key];
93
+ for (const key of keys) tuple[key] = paragraph[key];
111
94
  return tuple;
112
95
  }
113
96
  function runTuple(run, keys) {
114
97
  const tuple = {};
115
- for (const key of keys) if (run[key] !== void 0) tuple[key] = run[key];
98
+ for (const key of keys) tuple[key] = run[key];
116
99
  return tuple;
117
100
  }
118
101
  function commonParagraphKeys(extent, frozen) {
@@ -120,7 +103,6 @@ function commonParagraphKeys(extent, frozen) {
120
103
  }
121
104
  function commonRunKeys(extent, frozen) {
122
105
  const runs = extent.flatMap((paragraph) => paragraph.runs);
123
- if (runs.length === 0) return [];
124
106
  return RUN_STYLE_KEYS.filter((key) => !frozen.has(key) && runs.every((run) => run[key] !== void 0));
125
107
  }
126
108
  function bestParagraphCandidate(extent, keys, factored) {
@@ -165,10 +147,10 @@ function bestGroup(groups) {
165
147
  }
166
148
  return best;
167
149
  }
168
- function plan(wrapper, visit, branch, state, entries) {
150
+ function plan(wrapper, branch, state, entries) {
169
151
  const extent = extentOf(wrapper);
170
- const paragraphCandidate = extent.length > 0 ? bestParagraphCandidate(extent, commonParagraphKeys(extent, branch.frozenParagraphs), branch.factoredParagraphs) : void 0;
171
- const runCandidate = extent.length > 0 ? bestRunCandidate(extent, commonRunKeys(extent, branch.frozenRuns), branch.factoredRuns) : void 0;
152
+ const paragraphCandidate = bestParagraphCandidate(extent, commonParagraphKeys(extent, branch.frozenParagraphs), branch.factoredParagraphs);
153
+ const runCandidate = bestRunCandidate(extent, commonRunKeys(extent, branch.frozenRuns), branch.factoredRuns);
172
154
  const nextFrozenParagraphs = new Set(branch.frozenParagraphs);
173
155
  const nextFrozenRuns = new Set(branch.frozenRuns);
174
156
  const nextFactoredParagraphs = new Set(branch.factoredParagraphs);
@@ -183,8 +165,7 @@ function plan(wrapper, visit, branch, state, entries) {
183
165
  if (existing === void 0) entries.set(contentKey, {
184
166
  content,
185
167
  wrappers: [wrapper],
186
- frequency: (paragraphCandidate?.positions.length ?? 0) + (runCandidate?.positions.length ?? 0),
187
- firstVisit: visit.index
168
+ frequency: (paragraphCandidate?.positions.length ?? 0) + (runCandidate?.positions.length ?? 0)
188
169
  });
189
170
  else {
190
171
  existing.wrappers.push(wrapper);
@@ -210,27 +191,15 @@ function plan(wrapper, visit, branch, state, entries) {
210
191
  }
211
192
  state.wrapperStrips.set(wrapper, strips);
212
193
  }
213
- visit.index += 1;
214
194
  const next = {
215
195
  frozenParagraphs: nextFrozenParagraphs,
216
196
  frozenRuns: nextFrozenRuns,
217
197
  factoredParagraphs: nextFactoredParagraphs,
218
198
  factoredRuns: nextFactoredRuns
219
199
  };
220
- for (const child of childWrappers(wrapper)) plan(child, visit, next, state, entries);
200
+ for (const child of childWrappers(wrapper)) plan(child, next, state, entries);
221
201
  }
222
202
  function childWrappers(wrapper) {
223
- if (isShapeGroupWrapper(wrapper) || isAnchorGroupWrapper(wrapper)) {
224
- const wrappers = [];
225
- for (const child of wrapper.children) if ("node" in child && "children" in child) wrappers.push(child);
226
- return wrappers;
227
- }
228
- if (isSlideGroupWrapper(wrapper)) return [...wrapper.children];
229
- if (isDrawPageGroupWrapper(wrapper)) {
230
- const shapes = [];
231
- for (const child of wrapper.children) if ("node" in child) shapes.push(child);
232
- return shapes;
233
- }
234
203
  const wrappers = [];
235
204
  for (const child of wrapper.children) if ("node" in child && "children" in child) wrappers.push(child);
236
205
  return wrappers;
@@ -241,7 +210,6 @@ function mint(pkg) {
241
210
  wrapperStrips: /* @__PURE__ */ new Map()
242
211
  };
243
212
  const entries = /* @__PURE__ */ new Map();
244
- const visit = { index: 0 };
245
213
  const rootBranch = {
246
214
  frozenParagraphs: /* @__PURE__ */ new Set(),
247
215
  frozenRuns: /* @__PURE__ */ new Set(),
@@ -250,15 +218,11 @@ function mint(pkg) {
250
218
  };
251
219
  switch (pkg.kind) {
252
220
  case "wordprocessing":
253
- for (const root of pkg.children) plan(root, visit, rootBranch, state, entries);
254
- break;
255
221
  case "presentation":
256
- for (const root of pkg.children) plan(root, visit, rootBranch, state, entries);
257
- break;
258
- case "drawing": for (const root of pkg.children) plan(root, visit, rootBranch, state, entries);
222
+ case "drawing": for (const root of pkg.children) plan(root, rootBranch, state, entries);
259
223
  }
260
224
  if (entries.size === 0) return pkg;
261
- const ordered = [...entries.values()].sort((a, b) => b.frequency - a.frequency || a.firstVisit - b.firstVisit);
225
+ const ordered = [...entries.values()].sort((a, b) => b.frequency - a.frequency);
262
226
  const styles = {};
263
227
  ordered.forEach((entry, index) => {
264
228
  const id = `s${index + 1}`;
@@ -312,7 +276,7 @@ function rebuildSlideGroup(group, chain, state) {
312
276
  const inner = innerChain(group, chain, state);
313
277
  const children = group.children.map((shape) => rebuildShapeGroup(shape, inner, state));
314
278
  const ref = state.wrapperRefs.get(group);
315
- return ref === void 0 && children.every((child, index) => child === group.children[index]) ? group : {
279
+ return children.every((child, index) => child === group.children[index]) ? group : {
316
280
  node: group.node,
317
281
  ...ref !== void 0 ? { style: ref } : {},
318
282
  children
@@ -322,7 +286,7 @@ function rebuildDrawPageGroup(group, chain, state) {
322
286
  const inner = innerChain(group, chain, state);
323
287
  const children = group.children.map((child) => "node" in child ? rebuildShapeGroup(child, inner, state) : child);
324
288
  const ref = state.wrapperRefs.get(group);
325
- return ref === void 0 && children.every((child, index) => child === group.children[index]) ? group : {
289
+ return children.every((child, index) => child === group.children[index]) ? group : {
326
290
  node: group.node,
327
291
  ...ref !== void 0 ? { style: ref } : {},
328
292
  children
@@ -332,7 +296,7 @@ function rebuildSectionGroup(group, chain, state) {
332
296
  const inner = innerChain(group, chain, state);
333
297
  const children = group.children.map((child) => rebuildSectionChild(child, inner, state));
334
298
  const ref = state.wrapperRefs.get(group);
335
- return ref === void 0 && children.every((child, index) => child === group.children[index]) ? group : {
299
+ return children.every((child, index) => child === group.children[index]) ? group : {
336
300
  node: group.node,
337
301
  ...ref !== void 0 ? { style: ref } : {},
338
302
  children
@@ -354,7 +318,7 @@ function rebuildShapeGroup(group, chain, state) {
354
318
  const inner = innerChain(group, chain, state);
355
319
  const children = group.children.map((child) => rebuildListChild(child, inner, state));
356
320
  const ref = state.wrapperRefs.get(group);
357
- return ref === void 0 && children.every((child, index) => child === group.children[index]) ? group : {
321
+ return children.every((child, index) => child === group.children[index]) ? group : {
358
322
  node: group.node,
359
323
  ...ref !== void 0 ? { style: ref } : {},
360
324
  children
@@ -364,7 +328,7 @@ function rebuildSectionConstructGroup(group, chain, state) {
364
328
  const inner = innerChain(group, chain, state);
365
329
  const children = group.children.map((child) => rebuildSectionChild(child, inner, state));
366
330
  const ref = state.wrapperRefs.get(group);
367
- return ref === void 0 && children.every((child, index) => child === group.children[index]) ? group : {
331
+ return children.every((child, index) => child === group.children[index]) ? group : {
368
332
  node: group.node,
369
333
  ...ref !== void 0 ? { style: ref } : {},
370
334
  children
@@ -374,7 +338,7 @@ function rebuildShapeConstructGroup(group, chain, state) {
374
338
  const inner = innerChain(group, chain, state);
375
339
  const children = group.children.map((child) => rebuildListChild(child, inner, state));
376
340
  const ref = state.wrapperRefs.get(group);
377
- return ref === void 0 && children.every((child, index) => child === group.children[index]) ? group : {
341
+ return children.every((child, index) => child === group.children[index]) ? group : {
378
342
  node: group.node,
379
343
  ...ref !== void 0 ? { style: ref } : {},
380
344
  children
@@ -383,10 +347,9 @@ function rebuildShapeConstructGroup(group, chain, state) {
383
347
  function rebuildHeadingGroup(group, chain, state, rebuildChild) {
384
348
  const inner = innerChain(group, chain, state);
385
349
  const anchor = rebuildParagraph(group.node, inner);
386
- assertHeadingAnchor(anchor);
387
350
  const children = group.children.map((child) => rebuildChild(child, inner, state));
388
351
  const ref = state.wrapperRefs.get(group);
389
- return ref === void 0 && anchor === group.node && children.every((child, index) => child === group.children[index]) ? group : {
352
+ return anchor === group.node && children.every((child, index) => child === group.children[index]) ? group : {
390
353
  node: anchor,
391
354
  ...ref !== void 0 ? { style: ref } : {},
392
355
  children
@@ -395,21 +358,14 @@ function rebuildHeadingGroup(group, chain, state, rebuildChild) {
395
358
  function rebuildListGroup(group, chain, state, rebuildChild) {
396
359
  const inner = innerChain(group, chain, state);
397
360
  const anchor = rebuildParagraph(group.node, inner);
398
- assertListAnchor(anchor);
399
361
  const children = group.children.map((child) => rebuildChild(child, inner, state));
400
362
  const ref = state.wrapperRefs.get(group);
401
- return ref === void 0 && anchor === group.node && children.every((child, index) => child === group.children[index]) ? group : {
363
+ return anchor === group.node && children.every((child, index) => child === group.children[index]) ? group : {
402
364
  node: anchor,
403
365
  ...ref !== void 0 ? { style: ref } : {},
404
366
  children
405
367
  };
406
368
  }
407
- function assertHeadingAnchor(paragraph) {
408
- if (paragraph.headingLevel === void 0) throw new Error("factorStyles: stripping dropped a heading anchor's headingLevel");
409
- }
410
- function assertListAnchor(paragraph) {
411
- if (paragraph.list === void 0) throw new Error("factorStyles: stripping dropped a list anchor's list membership");
412
- }
413
369
  function rebuildParagraph(paragraph, chain) {
414
370
  const strips = paragraphStripsOf(chain, paragraph);
415
371
  const base = strips === void 0 ? paragraph : stripParagraphKeys(paragraph, strips);
@@ -1,5 +1,5 @@
1
1
  import { l as PageSize } from "./geometry-CvcjSwnA.cjs";
2
- import { C as ContentDocument } from "./content-JJrcHjkR.cjs";
2
+ import { C as ContentDocument } from "./content-zNNPbwYY.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 { C as ContentDocument } from "./content-Ck4LdLBJ.js";
2
+ import { C as ContentDocument } from "./content-GHj_31uQ.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;