document-schema 4.3.3 → 7.6.1

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 (96) hide show
  1. package/README.md +274 -95
  2. package/dist/border-weight.cjs +26 -0
  3. package/dist/border-weight.d.cts +12 -0
  4. package/dist/border-weight.d.ts +12 -0
  5. package/dist/border-weight.js +23 -0
  6. package/dist/codec.d.cts +1 -1
  7. package/dist/codec.d.ts +1 -1
  8. package/dist/{construct-CdQuI9f5.d.cts → construct-C9cYkjnd.d.cts} +242 -2
  9. package/dist/{construct-CdQuI9f5.d.ts → construct-C9cYkjnd.d.ts} +242 -2
  10. package/dist/construct.cjs +13 -6
  11. package/dist/construct.d.cts +1 -1
  12. package/dist/construct.d.ts +1 -1
  13. package/dist/construct.js +13 -6
  14. package/dist/content-CIIFuBbn.d.cts +10273 -0
  15. package/dist/content-json-schema-defs.cjs +1056 -189
  16. package/dist/content-json-schema-defs.js +1056 -189
  17. package/dist/content-wL5-wetq.d.ts +10273 -0
  18. package/dist/content.cjs +514 -36
  19. package/dist/content.d.cts +2 -2
  20. package/dist/content.d.ts +2 -2
  21. package/dist/content.js +488 -37
  22. package/dist/decompose.cjs +7 -17
  23. package/dist/decompose.d.cts +5 -5
  24. package/dist/decompose.d.ts +5 -5
  25. package/dist/decompose.js +7 -17
  26. package/dist/definitions.cjs +5 -1
  27. package/dist/definitions.d.cts +37 -1
  28. package/dist/definitions.d.ts +37 -1
  29. package/dist/definitions.js +5 -1
  30. package/dist/factor-styles.cjs +14 -8
  31. package/dist/factor-styles.d.cts +6 -6
  32. package/dist/factor-styles.d.ts +6 -6
  33. package/dist/factor-styles.js +15 -9
  34. package/dist/flatten.cjs +5 -5
  35. package/dist/flatten.d.cts +4 -4
  36. package/dist/flatten.d.ts +4 -4
  37. package/dist/flatten.js +5 -5
  38. package/dist/font-port.d.cts +2 -2
  39. package/dist/font-port.d.ts +2 -2
  40. package/dist/index.cjs +54 -14
  41. package/dist/index.d.cts +14 -12
  42. package/dist/index.d.ts +14 -12
  43. package/dist/index.js +12 -10
  44. package/dist/{math-B7gZJeND.d.cts → math-BScHxedi.d.cts} +100 -17
  45. package/dist/{math-B7gZJeND.d.ts → math-BScHxedi.d.ts} +100 -17
  46. package/dist/math-layout.d.cts +6 -6
  47. package/dist/math-layout.d.ts +6 -6
  48. package/dist/math.cjs +32 -6
  49. package/dist/math.d.cts +2 -2
  50. package/dist/math.d.ts +2 -2
  51. package/dist/math.js +29 -7
  52. package/dist/{mathml-B1oTCtzc.d.cts → mathml-Czqc1mdZ.d.cts} +3 -3
  53. package/dist/{mathml-B1oTCtzc.d.ts → mathml-Czqc1mdZ.d.ts} +3 -3
  54. package/dist/mathml.cjs +9 -2
  55. package/dist/mathml.d.cts +1 -1
  56. package/dist/mathml.d.ts +1 -1
  57. package/dist/mathml.js +9 -2
  58. package/dist/metadata.cjs +12 -1
  59. package/dist/metadata.d.cts +13 -0
  60. package/dist/metadata.d.ts +13 -0
  61. package/dist/metadata.js +12 -1
  62. package/dist/package-node-C9iYNIXi.d.cts +1989 -0
  63. package/dist/package-node-C_rpWAh2.d.ts +1989 -0
  64. package/dist/package-node.cjs +21 -21
  65. package/dist/package-node.d.cts +2 -2
  66. package/dist/package-node.d.ts +2 -2
  67. package/dist/package-node.js +14 -14
  68. package/dist/package.cjs +5 -3
  69. package/dist/package.d.cts +258 -13
  70. package/dist/package.d.ts +258 -13
  71. package/dist/package.js +5 -3
  72. package/dist/schema-io.cjs +21 -11
  73. package/dist/schema-io.d.cts +13 -9
  74. package/dist/schema-io.d.ts +13 -9
  75. package/dist/schema-io.js +21 -12
  76. package/dist/source-Bas5ol6f.d.cts +43 -0
  77. package/dist/source-Bas5ol6f.d.ts +43 -0
  78. package/dist/source.cjs +27 -0
  79. package/dist/source.d.cts +2 -0
  80. package/dist/source.d.ts +2 -0
  81. package/dist/source.js +25 -0
  82. package/dist/style-D06NwxAJ.d.cts +29 -0
  83. package/dist/style-D06NwxAJ.d.ts +29 -0
  84. package/dist/style.cjs +2 -0
  85. package/dist/style.d.cts +2 -24
  86. package/dist/style.d.ts +2 -24
  87. package/dist/style.js +2 -1
  88. package/dist/text-layout.d.cts +1 -1
  89. package/dist/text-layout.d.ts +1 -1
  90. package/package.json +28 -29
  91. package/schemas/content-document.schema.json +6623 -1694
  92. package/schemas/{document-package.schema.json → document-tree.schema.json} +1826 -143
  93. package/dist/content-BmqzegMG.d.cts +0 -2481
  94. package/dist/content-CIwPb_yh.d.ts +0 -2481
  95. package/dist/package-node-C7RiYhyk.d.ts +0 -459
  96. package/dist/package-node-a9CyRaD3.d.cts +0 -459
@@ -29,19 +29,19 @@ function isLeafChild(schema, value) {
29
29
  if (isRecord(value) && "style" in value) return false;
30
30
  return schema.safeParse(value).success;
31
31
  }
32
- function isPackageBlockLeaf(value) {
32
+ function isTreeBlockLeaf(value) {
33
33
  if (require_content.isContentConstructStart(value) || require_content.isContentConstructEnd(value)) return false;
34
34
  return require_content.isContentBlock(value);
35
35
  }
36
- const PackageBlockLeafSchema = zod.z.custom(isPackageBlockLeaf);
36
+ const TreeBlockLeafSchema = zod.z.custom(isTreeBlockLeaf);
37
37
  function isSectionChild(value) {
38
- return isHeadingGroupNode(value) || isListGroupNode(value) || isSectionConstructGroupNode(value) || isLeafChild(PackageBlockLeafSchema, value);
38
+ return isHeadingGroupNode(value) || isListGroupNode(value) || isSectionConstructGroupNode(value) || isLeafChild(TreeBlockLeafSchema, value);
39
39
  }
40
40
  function isShapeChild(value) {
41
- return isListGroupNode(value) || isShapeConstructGroupNode(value) || isLeafChild(PackageBlockLeafSchema, value);
41
+ return isListGroupNode(value) || isShapeConstructGroupNode(value) || isLeafChild(TreeBlockLeafSchema, value);
42
42
  }
43
43
  function isListChild(value) {
44
- return isListGroupNode(value) || isShapeConstructGroupNode(value) || isLeafChild(PackageBlockLeafSchema, value);
44
+ return isListGroupNode(value) || isShapeConstructGroupNode(value) || isLeafChild(TreeBlockLeafSchema, value);
45
45
  }
46
46
  function isSheetChild(value) {
47
47
  return isLeafChild(require_content.ContentSheetImageSchema, value) || isLeafChild(require_content.ContentEmbeddedObjectSchema, value);
@@ -77,20 +77,20 @@ function isShapeConstructGroupNode(value) {
77
77
  return isRecord(value) && require_construct.ConstructDescriptorSchema.safeParse(value.node).success && isGroupWrapper(value, isShapeChild);
78
78
  }
79
79
  const packageLeafUnion = zod.z.union([
80
- PackageBlockLeafSchema,
80
+ TreeBlockLeafSchema,
81
81
  require_content.ContentSheetImageSchema,
82
82
  require_content.ContentEmbeddedObjectSchema,
83
83
  require_content.ContentVectorSchema,
84
84
  require_content.ContentFormulaSchema
85
85
  ]);
86
- function isPackageLeaf(value) {
86
+ function isTreeLeaf(value) {
87
87
  return packageLeafUnion.safeParse(value).success;
88
88
  }
89
- function isPackageGroup(value) {
89
+ function isTreeGroup(value) {
90
90
  return isSectionGroupNode(value) || isSlideGroupNode(value) || isSheetGroupNode(value) || isDrawPageGroupNode(value) || isShapeGroupNode(value) || isHeadingGroupNode(value) || isListGroupNode(value) || isSectionConstructGroupNode(value) || isShapeConstructGroupNode(value);
91
91
  }
92
- function isPackageNode(value) {
93
- return isPackageGroup(value) || isPackageLeaf(value);
92
+ function isTreeNode(value) {
93
+ return isTreeGroup(value) || isTreeLeaf(value);
94
94
  }
95
95
  const SectionGroupSchema = zod.z.custom(isSectionGroupNode);
96
96
  const SlideGroupSchema = zod.z.custom(isSlideGroupNode);
@@ -101,9 +101,9 @@ const HeadingGroupSchema = zod.z.custom(isHeadingGroupNode);
101
101
  const ListGroupSchema = zod.z.custom(isListGroupNode);
102
102
  const SectionConstructGroupSchema = zod.z.custom(isSectionConstructGroupNode);
103
103
  const ShapeConstructGroupSchema = zod.z.custom(isShapeConstructGroupNode);
104
- const PackageGroupSchema = zod.z.custom(isPackageGroup);
105
- const PackageLeafSchema = zod.z.custom(isPackageLeaf);
106
- const PackageNodeSchema = zod.z.custom(isPackageNode);
104
+ const TreeGroupSchema = zod.z.custom(isTreeGroup);
105
+ const TreeLeafSchema = zod.z.custom(isTreeLeaf);
106
+ const TreeNodeSchema = zod.z.custom(isTreeNode);
107
107
  //#endregion
108
108
  exports.DrawPageDescriptorSchema = DrawPageDescriptorSchema;
109
109
  exports.DrawPageGroupSchema = DrawPageGroupSchema;
@@ -111,10 +111,6 @@ exports.HeadingGroupSchema = HeadingGroupSchema;
111
111
  exports.HeadingParagraphSchema = HeadingParagraphSchema;
112
112
  exports.ListGroupSchema = ListGroupSchema;
113
113
  exports.ListParagraphSchema = ListParagraphSchema;
114
- exports.PackageBlockLeafSchema = PackageBlockLeafSchema;
115
- exports.PackageGroupSchema = PackageGroupSchema;
116
- exports.PackageLeafSchema = PackageLeafSchema;
117
- exports.PackageNodeSchema = PackageNodeSchema;
118
114
  exports.SectionConstructGroupSchema = SectionConstructGroupSchema;
119
115
  exports.SectionDescriptorSchema = SectionDescriptorSchema;
120
116
  exports.SectionGroupSchema = SectionGroupSchema;
@@ -125,16 +121,20 @@ exports.SheetDescriptorSchema = SheetDescriptorSchema;
125
121
  exports.SheetGroupSchema = SheetGroupSchema;
126
122
  exports.SlideDescriptorSchema = SlideDescriptorSchema;
127
123
  exports.SlideGroupSchema = SlideGroupSchema;
124
+ exports.TreeBlockLeafSchema = TreeBlockLeafSchema;
125
+ exports.TreeGroupSchema = TreeGroupSchema;
126
+ exports.TreeLeafSchema = TreeLeafSchema;
127
+ exports.TreeNodeSchema = TreeNodeSchema;
128
128
  exports.isDrawPageGroupNode = isDrawPageGroupNode;
129
129
  exports.isHeadingGroupNode = isHeadingGroupNode;
130
130
  exports.isListGroupNode = isListGroupNode;
131
- exports.isPackageBlockLeaf = isPackageBlockLeaf;
132
- exports.isPackageGroup = isPackageGroup;
133
- exports.isPackageLeaf = isPackageLeaf;
134
- exports.isPackageNode = isPackageNode;
135
131
  exports.isSectionConstructGroupNode = isSectionConstructGroupNode;
136
132
  exports.isSectionGroupNode = isSectionGroupNode;
137
133
  exports.isShapeConstructGroupNode = isShapeConstructGroupNode;
138
134
  exports.isShapeGroupNode = isShapeGroupNode;
139
135
  exports.isSheetGroupNode = isSheetGroupNode;
140
136
  exports.isSlideGroupNode = isSlideGroupNode;
137
+ exports.isTreeBlockLeaf = isTreeBlockLeaf;
138
+ exports.isTreeGroup = isTreeGroup;
139
+ exports.isTreeLeaf = isTreeLeaf;
140
+ exports.isTreeNode = isTreeNode;
@@ -1,2 +1,2 @@
1
- import { $ as isSectionConstructGroupNode, A as ShapeChild, B as SheetGroupNode, C as SectionChild, D as SectionDescriptorSchema, E as SectionDescriptor, F as ShapeGroupNode, G as SlideGroupSchema, H as SlideDescriptor, I as ShapeGroupSchema, J as isListGroupNode, K as isDrawPageGroupNode, L as SheetChild, M as ShapeConstructGroupSchema, N as ShapeDescriptor, O as SectionGroupNode, P as ShapeDescriptorSchema, Q as isPackageNode, R as SheetDescriptor, S as PackageNodeSchema, T as SectionConstructGroupSchema, U as SlideDescriptorSchema, V as SheetGroupSchema, W as SlideGroupNode, X as isPackageGroup, Y as isPackageBlockLeaf, Z as isPackageLeaf, _ as PackageGroup, a as DrawPageGroupSchema, b as PackageLeafSchema, c as HeadingParagraph, d as ListGroupNode, et as isSectionGroupNode, f as ListGroupSchema, g as PackageBlockLeafSchema, h as PackageBlockLeaf, i as DrawPageGroupNode, it as isSlideGroupNode, j as ShapeConstructGroupNode, k as SectionGroupSchema, l as HeadingParagraphSchema, m as ListParagraphSchema, n as DrawPageDescriptor, nt as isShapeGroupNode, o as HeadingGroupNode, p as ListParagraph, q as isHeadingGroupNode, r as DrawPageDescriptorSchema, rt as isSheetGroupNode, s as HeadingGroupSchema, t as DrawPageChild, tt as isShapeConstructGroupNode, u as ListChild, v as PackageGroupSchema, w as SectionConstructGroupNode, x as PackageNode, y as PackageLeaf, z as SheetDescriptorSchema } from "./package-node-a9CyRaD3.cjs";
2
- export { DrawPageChild, DrawPageDescriptor, DrawPageDescriptorSchema, DrawPageGroupNode, DrawPageGroupSchema, HeadingGroupNode, HeadingGroupSchema, HeadingParagraph, HeadingParagraphSchema, ListChild, ListGroupNode, ListGroupSchema, ListParagraph, ListParagraphSchema, PackageBlockLeaf, PackageBlockLeafSchema, PackageGroup, PackageGroupSchema, PackageLeaf, PackageLeafSchema, PackageNode, PackageNodeSchema, SectionChild, SectionConstructGroupNode, SectionConstructGroupSchema, SectionDescriptor, SectionDescriptorSchema, SectionGroupNode, SectionGroupSchema, ShapeChild, ShapeConstructGroupNode, ShapeConstructGroupSchema, ShapeDescriptor, ShapeDescriptorSchema, ShapeGroupNode, ShapeGroupSchema, SheetChild, SheetDescriptor, SheetDescriptorSchema, SheetGroupNode, SheetGroupSchema, SlideDescriptor, SlideDescriptorSchema, SlideGroupNode, SlideGroupSchema, isDrawPageGroupNode, isHeadingGroupNode, isListGroupNode, isPackageBlockLeaf, isPackageGroup, isPackageLeaf, isPackageNode, isSectionConstructGroupNode, isSectionGroupNode, isShapeConstructGroupNode, isShapeGroupNode, isSheetGroupNode, isSlideGroupNode };
1
+ import { $ as isSheetGroupNode, A as SheetDescriptor, B as TreeGroup, C as ShapeConstructGroupNode, D as ShapeGroupNode, E as ShapeDescriptorSchema, F as SlideDescriptorSchema, G as TreeNodeSchema, H as TreeLeaf, I as SlideGroupNode, J as isListGroupNode, K as isDrawPageGroupNode, L as SlideGroupSchema, M as SheetGroupNode, N as SheetGroupSchema, O as ShapeGroupSchema, P as SlideDescriptor, Q as isShapeGroupNode, R as TreeBlockLeaf, S as ShapeChild, T as ShapeDescriptor, U as TreeLeafSchema, V as TreeGroupSchema, W as TreeNode, X as isSectionGroupNode, Y as isSectionConstructGroupNode, Z as isShapeConstructGroupNode, _ as SectionConstructGroupSchema, a as DrawPageGroupSchema, b as SectionGroupNode, c as HeadingParagraph, d as ListGroupNode, et as isSlideGroupNode, f as ListGroupSchema, g as SectionConstructGroupNode, h as SectionChild, i as DrawPageGroupNode, it as isTreeNode, j as SheetDescriptorSchema, k as SheetChild, l as HeadingParagraphSchema, m as ListParagraphSchema, n as DrawPageDescriptor, nt as isTreeGroup, o as HeadingGroupNode, p as ListParagraph, q as isHeadingGroupNode, r as DrawPageDescriptorSchema, rt as isTreeLeaf, s as HeadingGroupSchema, t as DrawPageChild, tt as isTreeBlockLeaf, u as ListChild, v as SectionDescriptor, w as ShapeConstructGroupSchema, x as SectionGroupSchema, y as SectionDescriptorSchema, z as TreeBlockLeafSchema } from "./package-node-C9iYNIXi.cjs";
2
+ export { DrawPageChild, DrawPageDescriptor, DrawPageDescriptorSchema, DrawPageGroupNode, DrawPageGroupSchema, HeadingGroupNode, HeadingGroupSchema, HeadingParagraph, HeadingParagraphSchema, ListChild, ListGroupNode, ListGroupSchema, ListParagraph, ListParagraphSchema, SectionChild, SectionConstructGroupNode, SectionConstructGroupSchema, SectionDescriptor, SectionDescriptorSchema, SectionGroupNode, SectionGroupSchema, ShapeChild, ShapeConstructGroupNode, ShapeConstructGroupSchema, ShapeDescriptor, ShapeDescriptorSchema, ShapeGroupNode, ShapeGroupSchema, SheetChild, SheetDescriptor, SheetDescriptorSchema, SheetGroupNode, SheetGroupSchema, SlideDescriptor, SlideDescriptorSchema, SlideGroupNode, SlideGroupSchema, TreeBlockLeaf, TreeBlockLeafSchema, TreeGroup, TreeGroupSchema, TreeLeaf, TreeLeafSchema, TreeNode, TreeNodeSchema, isDrawPageGroupNode, isHeadingGroupNode, isListGroupNode, isSectionConstructGroupNode, isSectionGroupNode, isShapeConstructGroupNode, isShapeGroupNode, isSheetGroupNode, isSlideGroupNode, isTreeBlockLeaf, isTreeGroup, isTreeLeaf, isTreeNode };
@@ -1,2 +1,2 @@
1
- import { $ as isSectionConstructGroupNode, A as ShapeChild, B as SheetGroupNode, C as SectionChild, D as SectionDescriptorSchema, E as SectionDescriptor, F as ShapeGroupNode, G as SlideGroupSchema, H as SlideDescriptor, I as ShapeGroupSchema, J as isListGroupNode, K as isDrawPageGroupNode, L as SheetChild, M as ShapeConstructGroupSchema, N as ShapeDescriptor, O as SectionGroupNode, P as ShapeDescriptorSchema, Q as isPackageNode, R as SheetDescriptor, S as PackageNodeSchema, T as SectionConstructGroupSchema, U as SlideDescriptorSchema, V as SheetGroupSchema, W as SlideGroupNode, X as isPackageGroup, Y as isPackageBlockLeaf, Z as isPackageLeaf, _ as PackageGroup, a as DrawPageGroupSchema, b as PackageLeafSchema, c as HeadingParagraph, d as ListGroupNode, et as isSectionGroupNode, f as ListGroupSchema, g as PackageBlockLeafSchema, h as PackageBlockLeaf, i as DrawPageGroupNode, it as isSlideGroupNode, j as ShapeConstructGroupNode, k as SectionGroupSchema, l as HeadingParagraphSchema, m as ListParagraphSchema, n as DrawPageDescriptor, nt as isShapeGroupNode, o as HeadingGroupNode, p as ListParagraph, q as isHeadingGroupNode, r as DrawPageDescriptorSchema, rt as isSheetGroupNode, s as HeadingGroupSchema, t as DrawPageChild, tt as isShapeConstructGroupNode, u as ListChild, v as PackageGroupSchema, w as SectionConstructGroupNode, x as PackageNode, y as PackageLeaf, z as SheetDescriptorSchema } from "./package-node-C7RiYhyk.js";
2
- export { DrawPageChild, DrawPageDescriptor, DrawPageDescriptorSchema, DrawPageGroupNode, DrawPageGroupSchema, HeadingGroupNode, HeadingGroupSchema, HeadingParagraph, HeadingParagraphSchema, ListChild, ListGroupNode, ListGroupSchema, ListParagraph, ListParagraphSchema, PackageBlockLeaf, PackageBlockLeafSchema, PackageGroup, PackageGroupSchema, PackageLeaf, PackageLeafSchema, PackageNode, PackageNodeSchema, SectionChild, SectionConstructGroupNode, SectionConstructGroupSchema, SectionDescriptor, SectionDescriptorSchema, SectionGroupNode, SectionGroupSchema, ShapeChild, ShapeConstructGroupNode, ShapeConstructGroupSchema, ShapeDescriptor, ShapeDescriptorSchema, ShapeGroupNode, ShapeGroupSchema, SheetChild, SheetDescriptor, SheetDescriptorSchema, SheetGroupNode, SheetGroupSchema, SlideDescriptor, SlideDescriptorSchema, SlideGroupNode, SlideGroupSchema, isDrawPageGroupNode, isHeadingGroupNode, isListGroupNode, isPackageBlockLeaf, isPackageGroup, isPackageLeaf, isPackageNode, isSectionConstructGroupNode, isSectionGroupNode, isShapeConstructGroupNode, isShapeGroupNode, isSheetGroupNode, isSlideGroupNode };
1
+ import { $ as isSheetGroupNode, A as SheetDescriptor, B as TreeGroup, C as ShapeConstructGroupNode, D as ShapeGroupNode, E as ShapeDescriptorSchema, F as SlideDescriptorSchema, G as TreeNodeSchema, H as TreeLeaf, I as SlideGroupNode, J as isListGroupNode, K as isDrawPageGroupNode, L as SlideGroupSchema, M as SheetGroupNode, N as SheetGroupSchema, O as ShapeGroupSchema, P as SlideDescriptor, Q as isShapeGroupNode, R as TreeBlockLeaf, S as ShapeChild, T as ShapeDescriptor, U as TreeLeafSchema, V as TreeGroupSchema, W as TreeNode, X as isSectionGroupNode, Y as isSectionConstructGroupNode, Z as isShapeConstructGroupNode, _ as SectionConstructGroupSchema, a as DrawPageGroupSchema, b as SectionGroupNode, c as HeadingParagraph, d as ListGroupNode, et as isSlideGroupNode, f as ListGroupSchema, g as SectionConstructGroupNode, h as SectionChild, i as DrawPageGroupNode, it as isTreeNode, j as SheetDescriptorSchema, k as SheetChild, l as HeadingParagraphSchema, m as ListParagraphSchema, n as DrawPageDescriptor, nt as isTreeGroup, o as HeadingGroupNode, p as ListParagraph, q as isHeadingGroupNode, r as DrawPageDescriptorSchema, rt as isTreeLeaf, s as HeadingGroupSchema, t as DrawPageChild, tt as isTreeBlockLeaf, u as ListChild, v as SectionDescriptor, w as ShapeConstructGroupSchema, x as SectionGroupSchema, y as SectionDescriptorSchema, z as TreeBlockLeafSchema } from "./package-node-C_rpWAh2.js";
2
+ export { DrawPageChild, DrawPageDescriptor, DrawPageDescriptorSchema, DrawPageGroupNode, DrawPageGroupSchema, HeadingGroupNode, HeadingGroupSchema, HeadingParagraph, HeadingParagraphSchema, ListChild, ListGroupNode, ListGroupSchema, ListParagraph, ListParagraphSchema, SectionChild, SectionConstructGroupNode, SectionConstructGroupSchema, SectionDescriptor, SectionDescriptorSchema, SectionGroupNode, SectionGroupSchema, ShapeChild, ShapeConstructGroupNode, ShapeConstructGroupSchema, ShapeDescriptor, ShapeDescriptorSchema, ShapeGroupNode, ShapeGroupSchema, SheetChild, SheetDescriptor, SheetDescriptorSchema, SheetGroupNode, SheetGroupSchema, SlideDescriptor, SlideDescriptorSchema, SlideGroupNode, SlideGroupSchema, TreeBlockLeaf, TreeBlockLeafSchema, TreeGroup, TreeGroupSchema, TreeLeaf, TreeLeafSchema, TreeNode, TreeNodeSchema, isDrawPageGroupNode, isHeadingGroupNode, isListGroupNode, isSectionConstructGroupNode, isSectionGroupNode, isShapeConstructGroupNode, isShapeGroupNode, isSheetGroupNode, isSlideGroupNode, isTreeBlockLeaf, isTreeGroup, isTreeLeaf, isTreeNode };
@@ -28,19 +28,19 @@ function isLeafChild(schema, value) {
28
28
  if (isRecord(value) && "style" in value) return false;
29
29
  return schema.safeParse(value).success;
30
30
  }
31
- function isPackageBlockLeaf(value) {
31
+ function isTreeBlockLeaf(value) {
32
32
  if (isContentConstructStart(value) || isContentConstructEnd(value)) return false;
33
33
  return isContentBlock(value);
34
34
  }
35
- const PackageBlockLeafSchema = z.custom(isPackageBlockLeaf);
35
+ const TreeBlockLeafSchema = z.custom(isTreeBlockLeaf);
36
36
  function isSectionChild(value) {
37
- return isHeadingGroupNode(value) || isListGroupNode(value) || isSectionConstructGroupNode(value) || isLeafChild(PackageBlockLeafSchema, value);
37
+ return isHeadingGroupNode(value) || isListGroupNode(value) || isSectionConstructGroupNode(value) || isLeafChild(TreeBlockLeafSchema, value);
38
38
  }
39
39
  function isShapeChild(value) {
40
- return isListGroupNode(value) || isShapeConstructGroupNode(value) || isLeafChild(PackageBlockLeafSchema, value);
40
+ return isListGroupNode(value) || isShapeConstructGroupNode(value) || isLeafChild(TreeBlockLeafSchema, value);
41
41
  }
42
42
  function isListChild(value) {
43
- return isListGroupNode(value) || isShapeConstructGroupNode(value) || isLeafChild(PackageBlockLeafSchema, value);
43
+ return isListGroupNode(value) || isShapeConstructGroupNode(value) || isLeafChild(TreeBlockLeafSchema, value);
44
44
  }
45
45
  function isSheetChild(value) {
46
46
  return isLeafChild(ContentSheetImageSchema, value) || isLeafChild(ContentEmbeddedObjectSchema, value);
@@ -76,20 +76,20 @@ function isShapeConstructGroupNode(value) {
76
76
  return isRecord(value) && ConstructDescriptorSchema.safeParse(value.node).success && isGroupWrapper(value, isShapeChild);
77
77
  }
78
78
  const packageLeafUnion = z.union([
79
- PackageBlockLeafSchema,
79
+ TreeBlockLeafSchema,
80
80
  ContentSheetImageSchema,
81
81
  ContentEmbeddedObjectSchema,
82
82
  ContentVectorSchema,
83
83
  ContentFormulaSchema
84
84
  ]);
85
- function isPackageLeaf(value) {
85
+ function isTreeLeaf(value) {
86
86
  return packageLeafUnion.safeParse(value).success;
87
87
  }
88
- function isPackageGroup(value) {
88
+ function isTreeGroup(value) {
89
89
  return isSectionGroupNode(value) || isSlideGroupNode(value) || isSheetGroupNode(value) || isDrawPageGroupNode(value) || isShapeGroupNode(value) || isHeadingGroupNode(value) || isListGroupNode(value) || isSectionConstructGroupNode(value) || isShapeConstructGroupNode(value);
90
90
  }
91
- function isPackageNode(value) {
92
- return isPackageGroup(value) || isPackageLeaf(value);
91
+ function isTreeNode(value) {
92
+ return isTreeGroup(value) || isTreeLeaf(value);
93
93
  }
94
94
  const SectionGroupSchema = z.custom(isSectionGroupNode);
95
95
  const SlideGroupSchema = z.custom(isSlideGroupNode);
@@ -100,8 +100,8 @@ const HeadingGroupSchema = z.custom(isHeadingGroupNode);
100
100
  const ListGroupSchema = z.custom(isListGroupNode);
101
101
  const SectionConstructGroupSchema = z.custom(isSectionConstructGroupNode);
102
102
  const ShapeConstructGroupSchema = z.custom(isShapeConstructGroupNode);
103
- const PackageGroupSchema = z.custom(isPackageGroup);
104
- const PackageLeafSchema = z.custom(isPackageLeaf);
105
- const PackageNodeSchema = z.custom(isPackageNode);
103
+ const TreeGroupSchema = z.custom(isTreeGroup);
104
+ const TreeLeafSchema = z.custom(isTreeLeaf);
105
+ const TreeNodeSchema = z.custom(isTreeNode);
106
106
  //#endregion
107
- export { DrawPageDescriptorSchema, DrawPageGroupSchema, HeadingGroupSchema, HeadingParagraphSchema, ListGroupSchema, ListParagraphSchema, PackageBlockLeafSchema, PackageGroupSchema, PackageLeafSchema, PackageNodeSchema, SectionConstructGroupSchema, SectionDescriptorSchema, SectionGroupSchema, ShapeConstructGroupSchema, ShapeDescriptorSchema, ShapeGroupSchema, SheetDescriptorSchema, SheetGroupSchema, SlideDescriptorSchema, SlideGroupSchema, isDrawPageGroupNode, isHeadingGroupNode, isListGroupNode, isPackageBlockLeaf, isPackageGroup, isPackageLeaf, isPackageNode, isSectionConstructGroupNode, isSectionGroupNode, isShapeConstructGroupNode, isShapeGroupNode, isSheetGroupNode, isSlideGroupNode };
107
+ export { DrawPageDescriptorSchema, DrawPageGroupSchema, HeadingGroupSchema, HeadingParagraphSchema, ListGroupSchema, ListParagraphSchema, SectionConstructGroupSchema, SectionDescriptorSchema, SectionGroupSchema, ShapeConstructGroupSchema, ShapeDescriptorSchema, ShapeGroupSchema, SheetDescriptorSchema, SheetGroupSchema, SlideDescriptorSchema, SlideGroupSchema, TreeBlockLeafSchema, TreeGroupSchema, TreeLeafSchema, TreeNodeSchema, isDrawPageGroupNode, isHeadingGroupNode, isListGroupNode, isSectionConstructGroupNode, isSectionGroupNode, isShapeConstructGroupNode, isShapeGroupNode, isSheetGroupNode, isSlideGroupNode, isTreeBlockLeaf, isTreeGroup, isTreeLeaf, isTreeNode };
package/dist/package.cjs CHANGED
@@ -1,4 +1,5 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
+ const require_source = require("./source.cjs");
2
3
  const require_geometry = require("./geometry.cjs");
3
4
  const require_metadata = require("./metadata.cjs");
4
5
  const require_content = require("./content.cjs");
@@ -14,9 +15,10 @@ const packageEnvelopeFields = {
14
15
  definitions: require_definitions.DefinitionsTableSchema.optional(),
15
16
  layers: require_definitions.DefinitionsTableSchema.optional(),
16
17
  attachments: require_definitions.DefinitionsTableSchema.optional(),
17
- destinations: require_definitions.DefinitionsTableSchema.optional()
18
+ destinations: require_definitions.DefinitionsTableSchema.optional(),
19
+ source: zod.z.record(zod.z.string(), require_source.SourceResidueSchema).optional()
18
20
  };
19
- const DocumentPackageSchema = zod.z.discriminatedUnion("kind", [
21
+ const DocumentTreeSchema = zod.z.discriminatedUnion("kind", [
20
22
  zod.z.object({
21
23
  kind: zod.z.literal("wordprocessing"),
22
24
  ...packageEnvelopeFields,
@@ -44,4 +46,4 @@ const DocumentPackageSchema = zod.z.discriminatedUnion("kind", [
44
46
  })
45
47
  ]);
46
48
  //#endregion
47
- exports.DocumentPackageSchema = DocumentPackageSchema;
49
+ exports.DocumentTreeSchema = DocumentTreeSchema;