document-schema 7.12.0 → 7.13.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 (46) hide show
  1. package/README.md +6 -0
  2. package/dist/codec.d.cts +1 -1
  3. package/dist/codec.d.ts +1 -1
  4. package/dist/{construct-C4XiF8OW.d.cts → construct-GVdTKrE7.d.cts} +3 -3
  5. package/dist/{construct-C4XiF8OW.d.ts → construct-GVdTKrE7.d.ts} +3 -3
  6. package/dist/construct.d.cts +1 -1
  7. package/dist/construct.d.ts +1 -1
  8. package/dist/{content-DnNAXdH_.d.cts → content-CvvaHPSp.d.cts} +145 -145
  9. package/dist/{content-vx3Mbnjy.d.ts → content-DbjeTN2j.d.ts} +145 -145
  10. package/dist/content.d.cts +1 -1
  11. package/dist/content.d.ts +1 -1
  12. package/dist/decompose.d.cts +2 -2
  13. package/dist/decompose.d.ts +2 -2
  14. package/dist/definitions.d.cts +4 -4
  15. package/dist/definitions.d.ts +4 -4
  16. package/dist/factor-styles.d.cts +1 -1
  17. package/dist/factor-styles.d.ts +1 -1
  18. package/dist/flatten.d.cts +1 -1
  19. package/dist/flatten.d.ts +1 -1
  20. package/dist/index.cjs +2 -0
  21. package/dist/index.d.cts +6 -6
  22. package/dist/index.d.ts +6 -6
  23. package/dist/index.js +2 -2
  24. package/dist/{package-node-CjEahULr.d.ts → package-node--fbVCVcl.d.ts} +50 -50
  25. package/dist/{package-node-DMS4Zrfi.d.cts → package-node-D7WUiIDz.d.cts} +50 -50
  26. package/dist/package-node.d.cts +1 -1
  27. package/dist/package-node.d.ts +1 -1
  28. package/dist/package.d.cts +7 -7
  29. package/dist/package.d.ts +7 -7
  30. package/dist/schema-io.cjs +2 -2
  31. package/dist/schema-io.d.cts +1 -1
  32. package/dist/schema-io.d.ts +1 -1
  33. package/dist/schema-io.js +2 -2
  34. package/dist/{style-D06NwxAJ.d.cts → style-BGMcYrD2.d.cts} +1 -1
  35. package/dist/{style-D06NwxAJ.d.ts → style-BGMcYrD2.d.ts} +1 -1
  36. package/dist/style.d.cts +1 -1
  37. package/dist/style.d.ts +1 -1
  38. package/dist/table-grid.cjs +85 -0
  39. package/dist/table-grid.d.cts +49 -3
  40. package/dist/table-grid.d.ts +49 -3
  41. package/dist/table-grid.js +84 -1
  42. package/dist/text-layout.d.cts +1 -1
  43. package/dist/text-layout.d.ts +1 -1
  44. package/package.json +1 -1
  45. package/schemas/content-document.schema.json +16 -16
  46. package/schemas/document-tree.schema.json +3 -3
package/README.md CHANGED
@@ -330,6 +330,12 @@ Well-formedness is a per-entry range check — `0 <= startRun <= endRun <= runs.
330
330
 
331
331
  Two harmonisations the inventories asked for are also deliberately absent. There is **no `fieldType` enum**: `instruction` is required and verbatim, so nothing is lost without one, and #24 asks for exactly one new vocabulary — `link`'s internal targets — rather than one per kind, with the four inventories' own corpus gate still standing before a field-type member set could be frozen honestly. And a **sheet-scoped named range** (xlsx defined names and tables, ODF `table:named-expressions`) is a definitions-table entry, not an `anchor`: a sheet group's children are its images and embedded documents, never a block flow, so there is no extent for an anchor to wrap — which is the odf inventory's own verdict for the identical construct.
332
332
 
333
+ ## The table grid rule
334
+
335
+ A `ContentTable` row's `cells` array is dense: one entry per grid column, so a cell's index is its grid column. A merged region is an anchor entry carrying `colSpan`/`rowSpan` plus a block-less entry at every other position it covers, and `walkTableGrid` classifies every entry as an anchor or as covered. `ContentTableCell` states the rule in full; the schema cannot enforce it, since it is a property of a whole table and not of any one cell.
336
+
337
+ `findTableGridFault(table)` is the one shared definition of when a table contradicts it, in the same way `findConstructMarkerImbalance` is for bracket balance. It never throws: it returns a descriptor of the first fault in reading order, or `undefined` for a conforming table. The faults are rows of differing lengths (`raggedRow`), blocks on a covered position (`coveredContent`), a span stated by a covered position (`coveredSpan`, which is how a second anchor starting inside another region shows up), an anchor reaching past the last column or row (`anchorOverrunsColumns`, `anchorOverrunsRows`), and an anchor reaching a position an earlier region already covers (`overlappingAnchors`). `describeTableGridFault` states a descriptor in one sentence for a writer that refuses or reports it, and every table writer in the family runs the check rather than deciding for itself what a covered position's blocks mean.
338
+
333
339
  ## The residue channel
334
340
 
335
341
  [#22](https://github.com/ExaDev/document-schema.js/issues/22)'s second channel, landed by [#718](https://github.com/ExaDev/documents.js/issues/718) (`src/source.ts`): a quarantined **`source: { format, xml }`** value for what has no cross-format meaning — a WordprocessingML proofing mark, a custom XML payload, a markdown raw-HTML block's remainder, a PDF XMP packet. `format` is a closed enum naming the producing format (one member per reader the workspace has today), so a consumer can tell residue it may restore from residue it must leave alone without reading the text; `xml` is that format's own serialisation, validated as opaque text and nothing more.
package/dist/codec.d.cts CHANGED
@@ -1,4 +1,4 @@
1
- import { C as ContentDocument } from "./content-DnNAXdH_.cjs";
1
+ import { C as ContentDocument } from "./content-CvvaHPSp.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-vx3Mbnjy.js";
1
+ import { C as ContentDocument } from "./content-DbjeTN2j.js";
2
2
  //#region src/codec.d.ts
3
3
  interface ContentCodec<TOptions = unknown> {
4
4
  read(bytes: Uint8Array, options?: TOptions): ContentDocument;
@@ -94,19 +94,19 @@ declare const FieldDescriptorSchema: z.ZodObject<{
94
94
  }, z.core.$strict>;
95
95
  type FieldDescriptor = z.infer<typeof FieldDescriptorSchema>;
96
96
  declare const AnchorTypeSchema: z.ZodEnum<{
97
- comment: "comment";
98
97
  bookmark: "bookmark";
99
98
  footnote: "footnote";
100
99
  endnote: "endnote";
100
+ comment: "comment";
101
101
  }>;
102
102
  type AnchorType = z.infer<typeof AnchorTypeSchema>;
103
103
  declare const AnchorDescriptorSchema: z.ZodObject<{
104
104
  kind: z.ZodLiteral<"anchor">;
105
105
  anchorType: z.ZodEnum<{
106
- comment: "comment";
107
106
  bookmark: "bookmark";
108
107
  footnote: "footnote";
109
108
  endnote: "endnote";
109
+ comment: "comment";
110
110
  }>;
111
111
  name: z.ZodString;
112
112
  definition: z.ZodOptional<z.ZodString>;
@@ -321,10 +321,10 @@ declare const ConstructDescriptorSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
321
321
  }, z.core.$strict>, z.ZodObject<{
322
322
  kind: z.ZodLiteral<"anchor">;
323
323
  anchorType: z.ZodEnum<{
324
- comment: "comment";
325
324
  bookmark: "bookmark";
326
325
  footnote: "footnote";
327
326
  endnote: "endnote";
327
+ comment: "comment";
328
328
  }>;
329
329
  name: z.ZodString;
330
330
  definition: z.ZodOptional<z.ZodString>;
@@ -94,19 +94,19 @@ declare const FieldDescriptorSchema: z.ZodObject<{
94
94
  }, z.core.$strict>;
95
95
  type FieldDescriptor = z.infer<typeof FieldDescriptorSchema>;
96
96
  declare const AnchorTypeSchema: z.ZodEnum<{
97
- comment: "comment";
98
97
  bookmark: "bookmark";
99
98
  footnote: "footnote";
100
99
  endnote: "endnote";
100
+ comment: "comment";
101
101
  }>;
102
102
  type AnchorType = z.infer<typeof AnchorTypeSchema>;
103
103
  declare const AnchorDescriptorSchema: z.ZodObject<{
104
104
  kind: z.ZodLiteral<"anchor">;
105
105
  anchorType: z.ZodEnum<{
106
- comment: "comment";
107
106
  bookmark: "bookmark";
108
107
  footnote: "footnote";
109
108
  endnote: "endnote";
109
+ comment: "comment";
110
110
  }>;
111
111
  name: z.ZodString;
112
112
  definition: z.ZodOptional<z.ZodString>;
@@ -321,10 +321,10 @@ declare const ConstructDescriptorSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
321
321
  }, z.core.$strict>, z.ZodObject<{
322
322
  kind: z.ZodLiteral<"anchor">;
323
323
  anchorType: z.ZodEnum<{
324
- comment: "comment";
325
324
  bookmark: "bookmark";
326
325
  footnote: "footnote";
327
326
  endnote: "endnote";
327
+ comment: "comment";
328
328
  }>;
329
329
  name: z.ZodString;
330
330
  definition: z.ZodOptional<z.ZodString>;
@@ -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-C4XiF8OW.cjs";
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.cjs";
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 };
@@ -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-C4XiF8OW.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-GVdTKrE7.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 };