@stll/docx-core 0.13.0 → 0.15.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.
@@ -2181,6 +2181,12 @@ type DocumentSettings = {
2181
2181
  * it is a document-wide flag; absent means odd/even share one header.
2182
2182
  */
2183
2183
  evenAndOddHeaders?: boolean;
2184
+ /**
2185
+ * `w:updateFields` (§17.15.1.93) — ask the consuming application to
2186
+ * recompute every field when the document opens. Set by generators that
2187
+ * emit a TOC or cross-references without computed results.
2188
+ */
2189
+ updateFields?: boolean;
2184
2190
  /**
2185
2191
  * `w:themeFontLang` (§17.15.1.88) — language Word uses to fill empty
2186
2192
  * `<a:ea>`/`<a:cs>` theme font slots from the script-specific
Binary file
package/dist/index.d.ts CHANGED
@@ -1,4 +1,5 @@
1
- import { At as SectionProperties, M as DocumentBody, St as PositionalTab, Tt as RunContent, Ut as Table, Wt as TableCell, Zt as TextContent, _t as Paragraph, a as DocxPackage, b as BlockContent, i as DocxConformanceClass, n as Document, p as Style, qt as TableRow, t as DOCX_CONFORMANCE_CLASSES, vt as ParagraphContent, w as BreakContent, wt as Run } from "./document-CMZ4oy9i.js";
1
+ import { At as SectionProperties, M as DocumentBody, St as PositionalTab, Tt as RunContent, Ut as Table, Wt as TableCell, Zt as TextContent, _t as Paragraph, a as DocxPackage, b as BlockContent, i as DocxConformanceClass, n as Document, p as Style, qt as TableRow, t as DOCX_CONFORMANCE_CLASSES, vt as ParagraphContent, w as BreakContent, wt as Run } from "./document-ckW6arDW.js";
2
+ import { Buffer } from "node:buffer";
2
3
  //#region src/legal-source/types.d.ts
3
4
  type LegalDocumentKind = "agreement" | "letter" | "memo" | "checklist" | "pleading" | "other";
4
5
  type LegalNumberingProfile = "legal" | "none" | "checklist";
@@ -1,2 +1,2 @@
1
- import { $ as ImageTransform, $t as TrackedChangeInfo, A as ComplexField, An as TableWidthType, At as SectionProperties, B as FooterReference, Bt as SoftHyphenContent, C as BookmarkStart, Cn as TableBorders, Ct as PropertyChangeInfo, D as CommentRangeEnd, Dn as TableLook, Dt as SdtProperties, E as Comment, En as TableFormatting, Et as RunPropertyChange, F as EndnotePosition, Fn as ColorValue, Ft as ShapeFill, G as HeaderFooterType, Gt as TableCellPropertyChange, H as FootnotePosition, Ht as TabContent, I as EndnoteProperties, In as KnownBorderStyle, It as ShapeOutline, J as Image, Jt as TableRowPropertyChange, K as HeaderReference, Kt as TablePropertyChange, L as Field, Ln as ShadingProperties, Lt as ShapeTextBody, M as DocumentBody, Mn as TextFormatting, Mt as SectionStart, N as DrawingContent, Nn as UnderlineStyle, Nt as Shape, O as CommentRangeStart, On as TableMeasurement, Ot as SdtType, P as Endnote, Pn as BorderSpec, Pt as ShapeContent, Q as ImageSize, Qt as TextWatermark, R as FieldCharContent, Rn as ThemeColorSlot, Rt as ShapeType, S as BookmarkEnd, Sn as TabStopAlignment, St as PositionalTab, T as Column, Tn as TableCellFormatting, Tt as RunContent, U as FootnoteProperties, Ut as Table, V as Footnote, Vt as SymbolContent, W as HeaderFooter, Wt as TableCell, X as ImagePadding, Xt as TextBox, Y as ImageCrop, Yt as TableStructuralChangeInfo, Z as ImagePosition, Zt as TextContent, _ as ThemeColorScheme, _n as ParagraphAlignment, _t as Paragraph, a as DocxPackage, an as AbstractNumbering, at as MAX_REVISION_ID, b as BlockContent, bn as TabLeader, bt as ParagraphPropertyChange, c as FontTable, cn as ListRendering, ct as MoveFromRangeEnd, d as RelationshipMap, dn as NumberingInstance, dt as MoveToRangeEnd, en as TrackedRunChange, et as ImageWrap, f as RelationshipType, fn as CellMargins, ft as MoveToRangeStart, g as Theme, gn as LineSpacingRule, gt as PageOrientation, h as StyleType, hn as FloatingTableProperties, ht as NoteReferenceContent, i as DocxConformanceClass, in as normalizeRevisionId, it as LineNumberRestart, j as Deletion, jn as TextEffect, jt as SectionPropertyChange, k as CommentReference, kn as TableRowFormatting, kt as Section, l as MediaFile, ln as NumberFormat, lt as MoveFromRangeStart, m as StyleDefinitions, mn as EmphasisMark, mt as NoteNumberRestart, n as Document, nn as Watermark, nt as Insertion, o as DocDefaults, on as LevelSuffix, ot as MathEquation, p as Style, pn as ConditionalFormatStyle, pt as NoBreakHyphenContent, q as Hyperlink, qt as TableRow, r as DocumentSettings, rn as isOoxmlSymbolCharacter, rt as InstrTextContent, s as FontInfo, sn as ListLevel, st as MoveFrom, t as DOCX_CONFORMANCE_CLASSES, tn as VerticalAlign, tt as InlineSdt, u as Relationship, un as NumberingDefinitions, ut as MoveTo, v as ThemeFont, vn as ParagraphFormatting, vt as ParagraphContent, w as BreakContent, wn as TableCellBorders, wt as Run, x as BlockSdt, xn as TabStop, xt as PictureWatermark, y as ThemeFontScheme, yn as SpacingExplicit, yt as ParagraphMarkChange, z as FieldType, zt as SimpleField } from "../document-CMZ4oy9i.js";
1
+ import { $ as ImageTransform, $t as TrackedChangeInfo, A as ComplexField, An as TableWidthType, At as SectionProperties, B as FooterReference, Bt as SoftHyphenContent, C as BookmarkStart, Cn as TableBorders, Ct as PropertyChangeInfo, D as CommentRangeEnd, Dn as TableLook, Dt as SdtProperties, E as Comment, En as TableFormatting, Et as RunPropertyChange, F as EndnotePosition, Fn as ColorValue, Ft as ShapeFill, G as HeaderFooterType, Gt as TableCellPropertyChange, H as FootnotePosition, Ht as TabContent, I as EndnoteProperties, In as KnownBorderStyle, It as ShapeOutline, J as Image, Jt as TableRowPropertyChange, K as HeaderReference, Kt as TablePropertyChange, L as Field, Ln as ShadingProperties, Lt as ShapeTextBody, M as DocumentBody, Mn as TextFormatting, Mt as SectionStart, N as DrawingContent, Nn as UnderlineStyle, Nt as Shape, O as CommentRangeStart, On as TableMeasurement, Ot as SdtType, P as Endnote, Pn as BorderSpec, Pt as ShapeContent, Q as ImageSize, Qt as TextWatermark, R as FieldCharContent, Rn as ThemeColorSlot, Rt as ShapeType, S as BookmarkEnd, Sn as TabStopAlignment, St as PositionalTab, T as Column, Tn as TableCellFormatting, Tt as RunContent, U as FootnoteProperties, Ut as Table, V as Footnote, Vt as SymbolContent, W as HeaderFooter, Wt as TableCell, X as ImagePadding, Xt as TextBox, Y as ImageCrop, Yt as TableStructuralChangeInfo, Z as ImagePosition, Zt as TextContent, _ as ThemeColorScheme, _n as ParagraphAlignment, _t as Paragraph, a as DocxPackage, an as AbstractNumbering, at as MAX_REVISION_ID, b as BlockContent, bn as TabLeader, bt as ParagraphPropertyChange, c as FontTable, cn as ListRendering, ct as MoveFromRangeEnd, d as RelationshipMap, dn as NumberingInstance, dt as MoveToRangeEnd, en as TrackedRunChange, et as ImageWrap, f as RelationshipType, fn as CellMargins, ft as MoveToRangeStart, g as Theme, gn as LineSpacingRule, gt as PageOrientation, h as StyleType, hn as FloatingTableProperties, ht as NoteReferenceContent, i as DocxConformanceClass, in as normalizeRevisionId, it as LineNumberRestart, j as Deletion, jn as TextEffect, jt as SectionPropertyChange, k as CommentReference, kn as TableRowFormatting, kt as Section, l as MediaFile, ln as NumberFormat, lt as MoveFromRangeStart, m as StyleDefinitions, mn as EmphasisMark, mt as NoteNumberRestart, n as Document, nn as Watermark, nt as Insertion, o as DocDefaults, on as LevelSuffix, ot as MathEquation, p as Style, pn as ConditionalFormatStyle, pt as NoBreakHyphenContent, q as Hyperlink, qt as TableRow, r as DocumentSettings, rn as isOoxmlSymbolCharacter, rt as InstrTextContent, s as FontInfo, sn as ListLevel, st as MoveFrom, t as DOCX_CONFORMANCE_CLASSES, tn as VerticalAlign, tt as InlineSdt, u as Relationship, un as NumberingDefinitions, ut as MoveTo, v as ThemeFont, vn as ParagraphFormatting, vt as ParagraphContent, w as BreakContent, wn as TableCellBorders, wt as Run, x as BlockSdt, xn as TabStop, xt as PictureWatermark, y as ThemeFontScheme, yn as SpacingExplicit, yt as ParagraphMarkChange, z as FieldType, zt as SimpleField } from "../document-ckW6arDW.js";
2
2
  export { type AbstractNumbering, type BlockContent, type BlockSdt, type BookmarkEnd, type BookmarkStart, type BorderSpec, type BreakContent, type CellMargins, type ColorValue, type Column, type Comment, type CommentRangeEnd, type CommentRangeStart, type CommentReference, type ComplexField, type ConditionalFormatStyle, DOCX_CONFORMANCE_CLASSES, type Deletion, type DocDefaults, Document, type DocumentBody, DocumentSettings, DocxConformanceClass, DocxPackage, type DrawingContent, type EmphasisMark, type Endnote, type EndnotePosition, type EndnoteProperties, type Field, type FieldCharContent, type FieldType, type FloatingTableProperties, type FontInfo, type FontTable, type FooterReference, type Footnote, type FootnotePosition, type FootnoteProperties, type HeaderFooter, type HeaderFooterType, type HeaderReference, type Hyperlink, type Image, type ImageCrop, type ImagePadding, type ImagePosition, type ImageSize, type ImageTransform, type ImageWrap, type InlineSdt, type Insertion, type InstrTextContent, type KnownBorderStyle, type LevelSuffix, type LineNumberRestart, type LineSpacingRule, type ListLevel, type ListRendering, MAX_REVISION_ID, type MathEquation, type MediaFile, type MoveFrom, type MoveFromRangeEnd, type MoveFromRangeStart, type MoveTo, type MoveToRangeEnd, type MoveToRangeStart, type NoBreakHyphenContent, type NoteNumberRestart, type NoteReferenceContent, type NumberFormat, type NumberingDefinitions, type NumberingInstance, type PageOrientation, type Paragraph, type ParagraphAlignment, type ParagraphContent, type ParagraphFormatting, type ParagraphMarkChange, type ParagraphPropertyChange, type PictureWatermark, type PositionalTab, type PropertyChangeInfo, type Relationship, type RelationshipMap, type RelationshipType, type Run, type RunContent, type RunPropertyChange, type SdtProperties, type SdtType, type Section, type SectionProperties, type SectionPropertyChange, type SectionStart, type ShadingProperties, type Shape, type ShapeContent, type ShapeFill, type ShapeOutline, type ShapeTextBody, type ShapeType, type SimpleField, type SoftHyphenContent, type SpacingExplicit, type Style, type StyleDefinitions, type StyleType, type SymbolContent, type TabContent, type TabLeader, type TabStop, type TabStopAlignment, type Table, type TableBorders, type TableCell, type TableCellBorders, type TableCellFormatting, type TableCellPropertyChange, type TableFormatting, type TableLook, type TableMeasurement, type TablePropertyChange, type TableRow, type TableRowFormatting, type TableRowPropertyChange, type TableStructuralChangeInfo, type TableWidthType, type TextBox, type TextContent, type TextEffect, type TextFormatting, type TextWatermark, type Theme, type ThemeColorScheme, type ThemeColorSlot, type ThemeFont, type ThemeFontScheme, type TrackedChangeInfo, type TrackedRunChange, type UnderlineStyle, type VerticalAlign, type Watermark, isOoxmlSymbolCharacter, normalizeRevisionId };
@@ -3,7 +3,10 @@
3
3
  /* eslint-disable */
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
- type DocxProjectionParagraph = readonly [ordinal: number, text: string, packageParagraphId: string | null, formatting: readonly DocxProjectionFormattingSpan[], structure: DocxProjectionStructure, styleId: string | null];
6
+ type DocxProjectionAlignmentValue = "center" | "justify" | "left" | "right";
7
+ type DocxProjectionAlignmentSource = "direct" | "style";
8
+ type DocxProjectionAlignment = readonly [value: DocxProjectionAlignmentValue, source: DocxProjectionAlignmentSource] | null;
9
+ type DocxProjectionParagraph = readonly [ordinal: number, text: string, packageParagraphId: string | null, formatting: readonly DocxProjectionFormattingSpan[], structure: DocxProjectionStructure, styleId: string | null, alignment: DocxProjectionAlignment];
7
10
  type DocxProjectionFormattingUnknownReason = "document-part-only" | "styles-part-unavailable" | "unsupported-styles";
8
11
  type DocxProjectionFormattingStatus = readonly [status: "complete"] | readonly [status: "incomplete", reason: DocxProjectionFormattingUnknownReason];
9
12
  type DocxProjectionFactSet<T> = readonly [status: "known", items: readonly T[]] | readonly [status: "unknown", reason: DocxProjectionUnknownReason];
@@ -17,7 +20,7 @@ type DocxProjectionStructuralSpan = readonly [startUtf8: number, endUtf8: number
17
20
  type DocxProjectionStructuralFacts = readonly [indentation: DocxProjectionFactSet<DocxProjectionIndentationFact>, numberingHierarchy: DocxProjectionFactSet<DocxProjectionNumberingFact>, bookmarks: DocxProjectionFactSet<DocxProjectionBookmarkFact>, internalReferences: DocxProjectionFactSet<DocxProjectionReferenceFact>, outlineLevels: DocxProjectionFactSet<DocxProjectionOutlineLevelFact>];
18
21
  type DocxProjectionRevisionUnsupportedReason = "incompatible-paragraph-merge" | "structural-table-revision" | "unsupported-revision-markup";
19
22
  type DocxProjectionRevisionStatus = readonly [status: "complete"] | readonly [status: "incomplete", reasons: readonly DocxProjectionRevisionUnsupportedReason[]];
20
- type DocxProjectionWire = readonly [schemaVersion: 4, paragraphs: readonly DocxProjectionParagraph[], structuralFacts: DocxProjectionStructuralFacts, revisionStatus: DocxProjectionRevisionStatus, formattingStatus: DocxProjectionFormattingStatus];
23
+ type DocxProjectionWire = readonly [schemaVersion: 5, paragraphs: readonly DocxProjectionParagraph[], structuralFacts: DocxProjectionStructuralFacts, revisionStatus: DocxProjectionRevisionStatus, formattingStatus: DocxProjectionFormattingStatus];
21
24
  type DocxReviewUnknownReason = "invalid-document" | "invalid-comments" | "invalid-comments-extended" | "resource-limit" | "unsupported-location";
22
25
  type DocxReviewFactSet<T> = readonly [status: "known", items: readonly T[]] | readonly [status: "unknown", reason: DocxReviewUnknownReason];
23
26
  type DocxRevisionKind = "insertion" | "deletion" | "moveFrom" | "moveTo" | "cellIns" | "cellDel" | "cellMerge" | "pPrChange" | "rPrChange" | "sectPrChange" | "tblPrChange" | "trPrChange" | "tcPrChange" | "tblGridChange" | "customXmlDelRangeStart" | "customXmlDelRangeEnd" | "customXmlInsRangeStart" | "customXmlInsRangeEnd" | "customXmlMoveFromRangeStart" | "customXmlMoveFromRangeEnd" | "customXmlMoveToRangeStart" | "customXmlMoveToRangeEnd";
@@ -70,4 +73,4 @@ declare const projectCompressedDocx: (bytes: Uint8Array) => Promise<DocxProjecti
70
73
  */
71
74
  declare const projectCompressedDocxWithReviewFacts: (bytes: Uint8Array, { textMaterialization }?: ProjectCompressedDocxWithReviewFactsOptions) => Promise<DocxPackageProjectionWire>;
72
75
  //#endregion
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 };
76
+ export { type DocxAttributedComment, type DocxAttributedRevision, type DocxPackageProjectionWire, type DocxProjectionAlignment, type DocxProjectionAlignmentSource, type DocxProjectionAlignmentValue, 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.13.0",
3
+ "version": "0.15.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",
@@ -64,7 +64,7 @@
64
64
  "jszip": "3.10.1"
65
65
  },
66
66
  "devDependencies": {
67
- "@types/bun": "1.3.14",
67
+ "bun-types": "1.4.0",
68
68
  "tsdown": "0.22.9"
69
69
  },
70
70
  "main": "./dist/index.js",