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/package.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import { d as MathMlNode } from "./mathml-Czqc1mdZ.js";
2
2
  import { p as MathExpression } from "./math-BScHxedi.js";
3
- import { I as SlideGroupNode, M as SheetGroupNode, b as SectionGroupNode, i as DrawPageGroupNode } from "./package-node-C_rpWAh2.js";
3
+ import { I as SlideGroupNode, M as SheetGroupNode, b as SectionGroupNode, i as DrawPageGroupNode } from "./package-node-F0sdAYc9.js";
4
4
  import { z } from "zod";
5
5
  //#region src/package.d.ts
6
6
  declare const DocumentTreeSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
@@ -13,8 +13,8 @@ declare const DocumentTreeSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
13
13
  paragraph: z.ZodOptional<z.ZodObject<{
14
14
  alignment: z.ZodOptional<z.ZodEnum<{
15
15
  left: "left";
16
- center: "center";
17
16
  right: "right";
17
+ center: "center";
18
18
  justify: "justify";
19
19
  }>>;
20
20
  list: z.ZodOptional<z.ZodObject<{
@@ -162,8 +162,8 @@ declare const DocumentTreeSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
162
162
  paragraph: z.ZodOptional<z.ZodObject<{
163
163
  alignment: z.ZodOptional<z.ZodEnum<{
164
164
  left: "left";
165
- center: "center";
166
165
  right: "right";
166
+ center: "center";
167
167
  justify: "justify";
168
168
  }>>;
169
169
  list: z.ZodOptional<z.ZodObject<{
@@ -302,6 +302,11 @@ declare const DocumentTreeSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
302
302
  }, z.core.$strip>;
303
303
  kind: z.ZodLiteral<"presentation">;
304
304
  }, z.core.$strip>, z.ZodObject<{
305
+ names: z.ZodOptional<z.ZodArray<z.ZodObject<{
306
+ name: z.ZodString;
307
+ refersTo: z.ZodString;
308
+ scopeSheetIndex: z.ZodOptional<z.ZodNumber>;
309
+ }, z.core.$strip>>>;
305
310
  children: z.ZodArray<z.ZodCustom<SheetGroupNode, SheetGroupNode>>;
306
311
  pages: z.ZodOptional<z.ZodArray<z.ZodObject<{
307
312
  widthPt: z.ZodNumber;
@@ -311,8 +316,8 @@ declare const DocumentTreeSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
311
316
  paragraph: z.ZodOptional<z.ZodObject<{
312
317
  alignment: z.ZodOptional<z.ZodEnum<{
313
318
  left: "left";
314
- center: "center";
315
319
  right: "right";
320
+ center: "center";
316
321
  justify: "justify";
317
322
  }>>;
318
323
  list: z.ZodOptional<z.ZodObject<{
@@ -460,8 +465,8 @@ declare const DocumentTreeSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
460
465
  paragraph: z.ZodOptional<z.ZodObject<{
461
466
  alignment: z.ZodOptional<z.ZodEnum<{
462
467
  left: "left";
463
- center: "center";
464
468
  right: "right";
469
+ center: "center";
465
470
  justify: "justify";
466
471
  }>>;
467
472
  list: z.ZodOptional<z.ZodObject<{
@@ -601,6 +606,33 @@ declare const DocumentTreeSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
601
606
  kind: z.ZodLiteral<"drawing">;
602
607
  }, z.core.$strip>, z.ZodObject<{
603
608
  children: z.ZodArray<z.ZodObject<{
609
+ origin: z.ZodOptional<z.ZodEnum<{
610
+ chart: "chart";
611
+ diagram: "diagram";
612
+ table: "table";
613
+ image: "image";
614
+ notes: "notes";
615
+ body: "body";
616
+ }>>;
617
+ interpretation: z.ZodOptional<z.ZodObject<{
618
+ transcript: z.ZodOptional<z.ZodObject<{
619
+ text: z.ZodString;
620
+ confidence: z.ZodEnum<{
621
+ high: "high";
622
+ medium: "medium";
623
+ low: "low";
624
+ }>;
625
+ mechanism: z.ZodEnum<{
626
+ deterministic: "deterministic";
627
+ model: "model";
628
+ }>;
629
+ }, z.core.$strip>>;
630
+ description: z.ZodOptional<z.ZodString>;
631
+ by: z.ZodOptional<z.ZodObject<{
632
+ model: z.ZodString;
633
+ at: z.ZodString;
634
+ }, z.core.$strip>>;
635
+ }, z.core.$strip>>;
604
636
  mathml: z.ZodArray<z.ZodType<MathMlNode, MathMlNode, z.core.$ZodTypeInternals<MathMlNode, MathMlNode>>>;
605
637
  starMath: z.ZodOptional<z.ZodString>;
606
638
  presentation: z.ZodOptional<z.ZodObject<{
@@ -641,8 +673,8 @@ declare const DocumentTreeSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
641
673
  paragraph: z.ZodOptional<z.ZodObject<{
642
674
  alignment: z.ZodOptional<z.ZodEnum<{
643
675
  left: "left";
644
- center: "center";
645
676
  right: "right";
677
+ center: "center";
646
678
  justify: "justify";
647
679
  }>>;
648
680
  list: z.ZodOptional<z.ZodObject<{
package/dist/package.js CHANGED
@@ -1,7 +1,7 @@
1
1
  import { SourceResidueSchema } from "./source.js";
2
2
  import { PageSizeSchema } from "./geometry.js";
3
3
  import { LayoutMetadataSchema } from "./metadata.js";
4
- import { ContentFormulaSchema, contentDocumentSharedFields } from "./content.js";
4
+ import { ContentDefinedNameSchema, ContentFormulaSchema, contentDocumentSharedFields } from "./content.js";
5
5
  import { DefinitionsTableSchema, StylesTableSchema } from "./definitions.js";
6
6
  import { DrawPageGroupSchema, SectionGroupSchema, SheetGroupSchema, SlideGroupSchema } from "./package-node.js";
7
7
  import { z } from "zod";
@@ -31,6 +31,7 @@ const DocumentTreeSchema = z.discriminatedUnion("kind", [
31
31
  z.object({
32
32
  kind: z.literal("spreadsheet"),
33
33
  ...packageEnvelopeFields,
34
+ names: z.array(ContentDefinedNameSchema).optional(),
34
35
  children: z.array(SheetGroupSchema)
35
36
  }),
36
37
  z.object({
@@ -7,7 +7,7 @@ const SCHEMA_FILE_NAMES = {
7
7
  ContentDocument: "content-document.schema.json"
8
8
  };
9
9
  function schemaUriFor(kind) {
10
- return `https://cdn.jsdelivr.net/npm/document-schema.js@7.6.1/schemas/${SCHEMA_FILE_NAMES[kind]}`;
10
+ return `https://cdn.jsdelivr.net/npm/document-schema.js@7.8.0/schemas/${SCHEMA_FILE_NAMES[kind]}`;
11
11
  }
12
12
  const SCHEMA_URI_PATTERN = /^https:\/\/cdn\.jsdelivr\.net\/npm\/document-schema\.js@([^/]+)\/schemas\/(document-tree|document-package|content-document|layout-document)\.schema\.json$/;
13
13
  function parseSchemaUri(uri) {
@@ -102,7 +102,7 @@ function documentFromJson(value) {
102
102
  if (parts.stem === "document-package") throw new DocumentPackageRenamedError(value.$schema);
103
103
  const kind = kindForFileStem(parts.stem);
104
104
  if (kind === void 0) throw new UnrecognizedDocumentSchemaError(value.$schema);
105
- if (majorVersionOf(parts.version) !== majorVersionOf("7.6.1")) throw new SchemaVersionMismatchError(value.$schema, parts.version, "7.6.1");
105
+ if (majorVersionOf(parts.version) !== majorVersionOf("7.8.0")) throw new SchemaVersionMismatchError(value.$schema, parts.version, "7.8.0");
106
106
  switch (kind) {
107
107
  case "DocumentTree": return {
108
108
  kind,
@@ -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/schema-io.d.ts
4
4
  type DocumentSchemaKind = "DocumentTree" | "ContentDocument";
@@ -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/schema-io.d.ts
4
4
  type DocumentSchemaKind = "DocumentTree" | "ContentDocument";
package/dist/schema-io.js CHANGED
@@ -6,7 +6,7 @@ const SCHEMA_FILE_NAMES = {
6
6
  ContentDocument: "content-document.schema.json"
7
7
  };
8
8
  function schemaUriFor(kind) {
9
- return `https://cdn.jsdelivr.net/npm/document-schema.js@7.6.1/schemas/${SCHEMA_FILE_NAMES[kind]}`;
9
+ return `https://cdn.jsdelivr.net/npm/document-schema.js@7.8.0/schemas/${SCHEMA_FILE_NAMES[kind]}`;
10
10
  }
11
11
  const SCHEMA_URI_PATTERN = /^https:\/\/cdn\.jsdelivr\.net\/npm\/document-schema\.js@([^/]+)\/schemas\/(document-tree|document-package|content-document|layout-document)\.schema\.json$/;
12
12
  function parseSchemaUri(uri) {
@@ -101,7 +101,7 @@ function documentFromJson(value) {
101
101
  if (parts.stem === "document-package") throw new DocumentPackageRenamedError(value.$schema);
102
102
  const kind = kindForFileStem(parts.stem);
103
103
  if (kind === void 0) throw new UnrecognizedDocumentSchemaError(value.$schema);
104
- if (majorVersionOf(parts.version) !== majorVersionOf("7.6.1")) throw new SchemaVersionMismatchError(value.$schema, parts.version, "7.6.1");
104
+ if (majorVersionOf(parts.version) !== majorVersionOf("7.8.0")) throw new SchemaVersionMismatchError(value.$schema, parts.version, "7.8.0");
105
105
  switch (kind) {
106
106
  case "DocumentTree": return {
107
107
  kind,
@@ -2,8 +2,8 @@ import { z } from "zod";
2
2
  //#region src/style.d.ts
3
3
  declare const AlignmentSchema: z.ZodEnum<{
4
4
  left: "left";
5
- center: "center";
6
5
  right: "right";
6
+ center: "center";
7
7
  justify: "justify";
8
8
  }>;
9
9
  type Alignment = z.infer<typeof AlignmentSchema>;
@@ -2,8 +2,8 @@ import { z } from "zod";
2
2
  //#region src/style.d.ts
3
3
  declare const AlignmentSchema: z.ZodEnum<{
4
4
  left: "left";
5
- center: "center";
6
5
  right: "right";
6
+ center: "center";
7
7
  justify: "justify";
8
8
  }>;
9
9
  type Alignment = z.infer<typeof AlignmentSchema>;
package/dist/style.d.cts CHANGED
@@ -1,2 +1,2 @@
1
- import { a as LayoutFontSchema, i as LayoutFont, n as AlignmentSchema, o as TextDirection, r as DEFAULT_LAYOUT_FONT, s as TextDirectionSchema, t as Alignment } from "./style-D06NwxAJ.cjs";
1
+ import { a as LayoutFontSchema, i as LayoutFont, n as AlignmentSchema, o as TextDirection, r as DEFAULT_LAYOUT_FONT, s as TextDirectionSchema, t as Alignment } from "./style-BGMcYrD2.cjs";
2
2
  export { Alignment, AlignmentSchema, DEFAULT_LAYOUT_FONT, LayoutFont, LayoutFontSchema, TextDirection, TextDirectionSchema };
package/dist/style.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- import { a as LayoutFontSchema, i as LayoutFont, n as AlignmentSchema, o as TextDirection, r as DEFAULT_LAYOUT_FONT, s as TextDirectionSchema, t as Alignment } from "./style-D06NwxAJ.js";
1
+ import { a as LayoutFontSchema, i as LayoutFont, n as AlignmentSchema, o as TextDirection, r as DEFAULT_LAYOUT_FONT, s as TextDirectionSchema, t as Alignment } from "./style-BGMcYrD2.js";
2
2
  export { Alignment, AlignmentSchema, DEFAULT_LAYOUT_FONT, LayoutFont, LayoutFontSchema, TextDirection, TextDirectionSchema };
@@ -1,5 +1,5 @@
1
1
  import { n as Color } from "./color-AELCDH_b.cjs";
2
- import { i as LayoutFont } from "./style-D06NwxAJ.cjs";
2
+ import { i as LayoutFont } from "./style-BGMcYrD2.cjs";
3
3
  //#region src/text-layout.d.ts
4
4
  interface UnderlineMetrics {
5
5
  readonly offsetPt: number;
@@ -1,5 +1,5 @@
1
1
  import { n as Color } from "./color-AELCDH_b.js";
2
- import { i as LayoutFont } from "./style-D06NwxAJ.js";
2
+ import { i as LayoutFont } from "./style-BGMcYrD2.js";
3
3
  //#region src/text-layout.d.ts
4
4
  interface UnderlineMetrics {
5
5
  readonly offsetPt: number;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "document-schema",
3
- "version": "7.6.1",
3
+ "version": "7.8.0",
4
4
  "description": "The canonical, format-agnostic content and document-tree schemas shared by ooxml.js, odf.js, documents.js, pdf-codec, and markdown-codec, plus the structural transform between them -- no format-specific or I/O behaviour.",
5
5
  "type": "module",
6
6
  "repository": {