@stll/docx-core 0.11.0 → 0.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.
Binary file
@@ -4,6 +4,8 @@
4
4
  type DocxProjectionFormattingSpan = readonly [startUtf16: number, endUtf16: number, style: "bold" | "highlight" | "superscript"];
5
5
  type DocxProjectionStructure = readonly [] | readonly [type: "table", tableId: string, row: number, column: number];
6
6
  type DocxProjectionParagraph = readonly [ordinal: number, text: string, packageParagraphId: string | null, formatting: readonly DocxProjectionFormattingSpan[], structure: DocxProjectionStructure, styleId: string | null];
7
+ type DocxProjectionFormattingUnknownReason = "document-part-only" | "styles-part-unavailable" | "unsupported-styles";
8
+ type DocxProjectionFormattingStatus = readonly [status: "complete"] | readonly [status: "incomplete", reason: DocxProjectionFormattingUnknownReason];
7
9
  type DocxProjectionFactSet<T> = readonly [status: "known", items: readonly T[]] | readonly [status: "unknown", reason: DocxProjectionUnknownReason];
8
10
  type DocxProjectionUnknownReason = "document-part-only" | "styles-part-unavailable" | "unsupported-styles" | "unsupported-numbering" | "incomplete-bookmark-ranges" | "unsupported-internal-references";
9
11
  type DocxProjectionIndentationFact = readonly [paragraphOrdinal: number, firstLineTwips: number | null, hangingTwips: number | null, leftTwips: number | null, rightTwips: number | null, startTwips: number | null, endTwips: number | null, firstLineCharsHundredths: number | null, hangingCharsHundredths: number | null, leftCharsHundredths: number | null, rightCharsHundredths: number | null, startCharsHundredths: number | null, endCharsHundredths: number | null];
@@ -15,23 +17,24 @@ type DocxProjectionStructuralSpan = readonly [startUtf8: number, endUtf8: number
15
17
  type DocxProjectionStructuralFacts = readonly [indentation: DocxProjectionFactSet<DocxProjectionIndentationFact>, numberingHierarchy: DocxProjectionFactSet<DocxProjectionNumberingFact>, bookmarks: DocxProjectionFactSet<DocxProjectionBookmarkFact>, internalReferences: DocxProjectionFactSet<DocxProjectionReferenceFact>, outlineLevels: DocxProjectionFactSet<DocxProjectionOutlineLevelFact>];
16
18
  type DocxProjectionRevisionUnsupportedReason = "incompatible-paragraph-merge" | "structural-table-revision" | "unsupported-revision-markup";
17
19
  type DocxProjectionRevisionStatus = readonly [status: "complete"] | readonly [status: "incomplete", reasons: readonly DocxProjectionRevisionUnsupportedReason[]];
18
- type DocxProjectionWire = readonly [schemaVersion: 3, paragraphs: readonly DocxProjectionParagraph[], structuralFacts: DocxProjectionStructuralFacts, revisionStatus: DocxProjectionRevisionStatus];
20
+ type DocxProjectionWire = readonly [schemaVersion: 4, paragraphs: readonly DocxProjectionParagraph[], structuralFacts: DocxProjectionStructuralFacts, revisionStatus: DocxProjectionRevisionStatus, formattingStatus: DocxProjectionFormattingStatus];
19
21
  type DocxReviewUnknownReason = "invalid-document" | "invalid-comments" | "invalid-comments-extended" | "resource-limit" | "unsupported-location";
20
22
  type DocxReviewFactSet<T> = readonly [status: "known", items: readonly T[]] | readonly [status: "unknown", reason: DocxReviewUnknownReason];
21
- type DocxReviewDetail<T> = readonly [status: "known", value: T] | readonly [status: "unknown", reason: DocxReviewUnknownReason];
22
- type DocxReviewPoint = readonly [paragraphOrdinal: number, utf8: number, utf16: number];
23
- type DocxReviewSpan = readonly [start: DocxReviewPoint, end: DocxReviewPoint];
24
- /** Compact versioned boundary tuple. Field order is stable within schema version 1. */
25
- type DocxRevisionContent = readonly [span: DocxReviewSpan, text: string, contentKind: "text" | "formatting-only"];
26
- type DocxCommentContent = readonly [anchor: DocxReviewSpan, commentText: string, referencedText: string];
27
- /** Attributed revision wire tuple; positions are named and versioned by its container. */
28
- type DocxAttributedRevision = readonly [type: "insertion" | "deletion" | "moveFrom" | "moveTo" | "cellIns" | "cellDel" | "cellMerge" | "pPrChange" | "rPrChange" | "sectPrChange" | "tblPrChange" | "trPrChange" | "tcPrChange" | "tblGridChange" | "customXmlDelRangeStart" | "customXmlDelRangeEnd" | "customXmlInsRangeStart" | "customXmlInsRangeEnd" | "customXmlMoveFromRangeStart" | "customXmlMoveFromRangeEnd" | "customXmlMoveToRangeStart" | "customXmlMoveToRangeEnd", author: string, date: string | null, revisionId: string | null, content: DocxReviewDetail<DocxRevisionContent>];
29
- /** Attributed comment wire tuple; positions are named and versioned by its container. */
30
- type DocxAttributedComment = readonly [commentId: string, author: string, initials: string | null, date: string | null, parentCommentId: string | null, threadState: "open" | "resolved", content: DocxReviewDetail<DocxCommentContent>];
23
+ type DocxRevisionKind = "insertion" | "deletion" | "moveFrom" | "moveTo" | "cellIns" | "cellDel" | "cellMerge" | "pPrChange" | "rPrChange" | "sectPrChange" | "tblPrChange" | "trPrChange" | "tcPrChange" | "tblGridChange" | "customXmlDelRangeStart" | "customXmlDelRangeEnd" | "customXmlInsRangeStart" | "customXmlInsRangeEnd" | "customXmlMoveFromRangeStart" | "customXmlMoveFromRangeEnd" | "customXmlMoveToRangeStart" | "customXmlMoveToRangeEnd";
24
+ /**
25
+ * Attributed revision wire tuple. Known content is flattened into the item so
26
+ * one review fact creates one JavaScript array at the WASM boundary.
27
+ */
28
+ type DocxAttributedRevision = readonly [type: DocxRevisionKind, author: string, date: string | null, revisionId: string | null, contentStatus: "known", startParagraphOrdinal: number, startUtf8: number, startUtf16: number, endParagraphOrdinal: number, endUtf8: number, endUtf16: number, text: string, contentKind: "text" | "formatting-only"] | readonly [type: DocxRevisionKind, author: string, date: string | null, revisionId: string | null, contentStatus: "unknown", reason: DocxReviewUnknownReason];
29
+ /**
30
+ * Attributed comment wire tuple. Known content is flattened into the item so
31
+ * one review fact creates one JavaScript array at the WASM boundary.
32
+ */
33
+ type DocxAttributedComment = readonly [commentId: string, author: string, initials: string | null, date: string | null, parentCommentId: string | null, threadState: "open" | "resolved", contentStatus: "known", startParagraphOrdinal: number, startUtf8: number, startUtf16: number, endParagraphOrdinal: number, endUtf8: number, endUtf16: number, commentText: string, referencedText: string] | readonly [commentId: string, author: string, initials: string | null, date: string | null, parentCommentId: string | null, threadState: "open" | "resolved", contentStatus: "unknown", reason: DocxReviewUnknownReason];
31
34
  /** Review-fact wire schema. A new tuple layout requires a schema-version bump. */
32
- type DocxReviewFactsWire = readonly [schemaVersion: 1, revisions: DocxReviewFactSet<DocxAttributedRevision>, comments: DocxReviewFactSet<DocxAttributedComment>];
35
+ type DocxReviewFactsWire = readonly [schemaVersion: 2, revisions: DocxReviewFactSet<DocxAttributedRevision>, comments: DocxReviewFactSet<DocxAttributedComment>];
33
36
  /** Fused package wire schema. A new tuple layout requires a schema-version bump. */
34
- type DocxPackageProjectionWire = readonly [schemaVersion: 1, document: DocxProjectionWire, reviewFacts: DocxReviewFactsWire];
37
+ type DocxPackageProjectionWire = readonly [schemaVersion: 2, document: DocxProjectionWire, reviewFacts: DocxReviewFactsWire];
35
38
  //#endregion
36
39
  //#region src/projection.d.ts
37
40
  declare const DocxProjectionInitializationError_base: import("better-result").TaggedErrorClass<"DocxProjectionInitializationError", {
@@ -67,4 +70,4 @@ declare const projectCompressedDocx: (bytes: Uint8Array) => Promise<DocxProjecti
67
70
  */
68
71
  declare const projectCompressedDocxWithReviewFacts: (bytes: Uint8Array, { textMaterialization }?: ProjectCompressedDocxWithReviewFactsOptions) => Promise<DocxPackageProjectionWire>;
69
72
  //#endregion
70
- export { type DocxAttributedComment, type DocxAttributedRevision, type DocxCommentContent, type DocxPackageProjectionWire, type DocxProjectionBookmarkFact, DocxProjectionError, type DocxProjectionFactSet, type DocxProjectionFormattingSpan, type DocxProjectionIndentationFact, DocxProjectionInitializationError, type DocxProjectionNumberingFact, type DocxProjectionOutlineLevelFact, type DocxProjectionParagraph, type DocxProjectionReferenceFact, type DocxProjectionRevisionStatus, type DocxProjectionRevisionUnsupportedReason, type DocxProjectionStructuralFacts, type DocxProjectionStructuralSpan, type DocxProjectionStructure, type DocxProjectionUnknownReason, DocxProjectionWasmSource, type DocxProjectionWire, type DocxReviewDetail, type DocxReviewFactSet, type DocxReviewFactsWire, type DocxReviewPoint, type DocxReviewSpan, type DocxReviewUnknownReason, type DocxRevisionContent, InitializeDocxProjectionOptions, ProjectCompressedDocxWithReviewFactsOptions, initializeDocxProjection, projectCompressedDocx, projectCompressedDocxWithReviewFacts };
73
+ export { type DocxAttributedComment, type DocxAttributedRevision, type DocxPackageProjectionWire, type DocxProjectionBookmarkFact, DocxProjectionError, type DocxProjectionFactSet, type DocxProjectionFormattingSpan, type DocxProjectionFormattingStatus, type DocxProjectionFormattingUnknownReason, type DocxProjectionIndentationFact, DocxProjectionInitializationError, type DocxProjectionNumberingFact, type DocxProjectionOutlineLevelFact, type DocxProjectionParagraph, type DocxProjectionReferenceFact, type DocxProjectionRevisionStatus, type DocxProjectionRevisionUnsupportedReason, type DocxProjectionStructuralFacts, type DocxProjectionStructuralSpan, type DocxProjectionStructure, type DocxProjectionUnknownReason, DocxProjectionWasmSource, type DocxProjectionWire, type DocxReviewFactSet, type DocxReviewFactsWire, type DocxReviewUnknownReason, type DocxRevisionKind, InitializeDocxProjectionOptions, ProjectCompressedDocxWithReviewFactsOptions, initializeDocxProjection, projectCompressedDocx, projectCompressedDocxWithReviewFacts };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stll/docx-core",
3
- "version": "0.11.0",
3
+ "version": "0.13.0",
4
4
  "description": "Typed OOXML/DOCX model, validation, serialization, legal-source compilation, and browser-native package projection.",
5
5
  "keywords": [
6
6
  "document-model",