@stll/docx-core 0.5.0 → 0.5.2

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.
package/dist/index.d.ts CHANGED
@@ -1,5 +1,4 @@
1
- import { Ct as Run, Ht as Table, Kt as TableRow, M as DocumentBody, Ut as TableCell, Xt as TextContent, _t as Paragraph, a as DocxPackage, b as BlockContent, i as DocxConformanceClass, kt as SectionProperties, n as Document, p as Style, t as DOCX_CONFORMANCE_CLASSES, vt as ParagraphContent, w as BreakContent, wt as RunContent } from "./document-BeYAaXPa.js";
2
-
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-DI8X7aZy.js";
3
2
  //#region src/legal-source/types.d.ts
4
3
  type LegalDocumentKind = "agreement" | "letter" | "memo" | "checklist" | "pleading" | "other";
5
4
  type LegalNumberingProfile = "legal" | "none" | "checklist";
@@ -116,7 +115,8 @@ declare const compileLegalSourceToDocx: (source: string, options?: LegalSourceCo
116
115
  //#endregion
117
116
  //#region src/serialize/docx.d.ts
118
117
  type SerializeDocumentOptions = {
119
- /** BCP-47 language tag (e.g. "en", "cs", "cs-CZ"); used for footer labels. */language?: string;
118
+ /** BCP-47 language tag (e.g. "en", "cs", "cs-CZ"); used for footer labels. */
119
+ language?: string;
120
120
  };
121
121
  declare const serializeDocumentToDocx: (document: Document, options?: SerializeDocumentOptions) => Promise<ArrayBuffer>;
122
122
  //#endregion
@@ -140,4 +140,4 @@ declare const validateDocxPackage: (buffer: ArrayBuffer | Uint8Array) => Promise
140
140
  declare const validateDocumentModel: (document: Document) => ValidateDocumentModelResult;
141
141
  declare const assertValidDocumentModel: (document: Document) => void;
142
142
  //#endregion
143
- export { type Autofix, type BlockContent, type BreakContent, type CompiledLegalDocument, DOCX_CONFORMANCE_CLASSES, type Document, type DocumentBody, type DocxConformanceClass, type DocxPackage, type LegalDraft, type LegalDraftBlock, type LegalDraftDiagnostic, type LegalSourceCompileOptions, type LegalSourceCompileResult, type LegalSourceDocxCompileResult, type LegalSourceParseResult, type Paragraph, type ParagraphContent, type Run, type RunContent, type SectionProperties, type Style, type Table, type TableCell, type TableRow, type TextContent, type ValidateDocumentModelIssue, type ValidateDocumentModelResult, type ValidateDocxPackageResult, assertValidDocumentModel, compileLegalSourceToDocument, compileLegalSourceToDocx, parseLegalSource, serializeDocumentToDocx, validateDocumentModel, validateDocxPackage, validateLegalDraft };
143
+ export { type Autofix, type BlockContent, type BreakContent, type CompiledLegalDocument, DOCX_CONFORMANCE_CLASSES, type Document, type DocumentBody, type DocxConformanceClass, type DocxPackage, type LegalDraft, type LegalDraftBlock, type LegalDraftDiagnostic, type LegalSourceCompileOptions, type LegalSourceCompileResult, type LegalSourceDocxCompileResult, type LegalSourceParseResult, type Paragraph, type ParagraphContent, type PositionalTab, type Run, type RunContent, type SectionProperties, type Style, type Table, type TableCell, type TableRow, type TextContent, type ValidateDocumentModelIssue, type ValidateDocumentModelResult, type ValidateDocxPackageResult, assertValidDocumentModel, compileLegalSourceToDocument, compileLegalSourceToDocx, parseLegalSource, serializeDocumentToDocx, validateDocumentModel, validateDocxPackage, validateLegalDraft };
package/dist/index.js CHANGED
@@ -182,7 +182,9 @@ const serializeRunProperties = (formatting) => {
182
182
  const serializeRunContent = (content) => {
183
183
  switch (content.type) {
184
184
  case "text": return `<w:t${content.preserveSpace ? " xml:space=\"preserve\"" : ""}>${escapeXml(content.text)}</w:t>`;
185
- case "tab": return "<w:tab/>";
185
+ case "tab":
186
+ if (!content.positional) return "<w:tab/>";
187
+ return `<w:ptab${attr("w:relativeTo", content.positional.relativeTo)}${attr("w:alignment", content.positional.alignment)}${attr("w:leader", content.positional.leader)}/>`;
186
188
  case "break": return `<w:br${attr("w:type", content.breakType)}/>`;
187
189
  case "renderedPageBreak": return "<w:lastRenderedPageBreak/>";
188
190
  case "symbol": return `<w:sym w:font="${escapeXml(content.font)}" w:char="${escapeXml(content.char)}"/>`;
@@ -1,2 +1,2 @@
1
- import { $ as ImageTransform, $t as TrackedRunChange, A as ComplexField, An as TextFormatting, At as SectionPropertyChange, B as FooterReference, Bt as SymbolContent, C as BookmarkStart, Cn as TableCellFormatting, Ct as Run, D as CommentRangeEnd, Dn as TableRowFormatting, Dt as SdtType, E as Comment, En as TableMeasurement, Et as SdtProperties, F as EndnotePosition, Fn as ShadingProperties, Ft as ShapeOutline, G as HeaderFooterType, Gt as TablePropertyChange, H as FootnotePosition, Ht as Table, I as EndnoteProperties, In as ThemeColorSlot, It as ShapeTextBody, J as Image, Jt as TableStructuralChangeInfo, K as HeaderReference, Kt as TableRow, L as Field, Lt as ShapeType, M as DocumentBody, Mn as BorderSpec, Mt as Shape, N as DrawingContent, Nn as ColorValue, Nt as ShapeContent, O as CommentRangeStart, On as TableWidthType, Ot as Section, P as Endnote, Pn as KnownBorderStyle, Pt as ShapeFill, Q as ImageSize, Qt as TrackedChangeInfo, R as FieldCharContent, Rt as SimpleField, S as BookmarkEnd, Sn as TableCellBorders, St as PropertyChangeInfo, T as Column, Tn as TableLook, Tt as RunPropertyChange, U as FootnoteProperties, Ut as TableCell, V as Footnote, Vt as TabContent, W as HeaderFooter, Wt as TableCellPropertyChange, X as ImagePadding, Xt as TextContent, Y as ImageCrop, Yt as TextBox, Z as ImagePosition, Zt as TextWatermark, _ as ThemeColorScheme, _n as SpacingExplicit, _t as Paragraph, a as DocxPackage, an as ListLevel, at as MAX_REVISION_ID, b as BlockContent, bn as TabStopAlignment, bt as ParagraphPropertyChange, c as FontTable, cn as NumberingDefinitions, ct as MoveFromRangeEnd, d as RelationshipMap, dn as ConditionalFormatStyle, dt as MoveToRangeEnd, en as VerticalAlign, et as ImageWrap, f as RelationshipType, fn as EmphasisMark, ft as MoveToRangeStart, g as Theme, gn as ParagraphFormatting, gt as PageOrientation, h as StyleType, hn as ParagraphAlignment, ht as NoteReferenceContent, i as DocxConformanceClass, in as LevelSuffix, it as LineNumberRestart, j as Deletion, jn as UnderlineStyle, jt as SectionStart, k as CommentReference, kn as TextEffect, kt as SectionProperties, l as MediaFile, ln as NumberingInstance, lt as MoveFromRangeStart, m as StyleDefinitions, mn as LineSpacingRule, mt as NoteNumberRestart, n as Document, nn as normalizeRevisionId, nt as Insertion, o as DocDefaults, on as ListRendering, ot as MathEquation, p as Style, pn as FloatingTableProperties, pt as NoBreakHyphenContent, q as Hyperlink, qt as TableRowPropertyChange, r as DocumentSettings, rn as AbstractNumbering, rt as InstrTextContent, s as FontInfo, sn as NumberFormat, st as MoveFrom, t as DOCX_CONFORMANCE_CLASSES, tn as Watermark, tt as InlineSdt, u as Relationship, un as CellMargins, ut as MoveTo, v as ThemeFont, vn as TabLeader, vt as ParagraphContent, w as BreakContent, wn as TableFormatting, wt as RunContent, x as BlockSdt, xn as TableBorders, xt as PictureWatermark, y as ThemeFontScheme, yn as TabStop, yt as ParagraphMarkChange, z as FieldType, zt as SoftHyphenContent } from "../document-BeYAaXPa.js";
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 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, normalizeRevisionId };
1
+ import { $ as ImageTransform, $t as TrackedChangeInfo, A as ComplexField, An as TextEffect, At as SectionProperties, B as FooterReference, Bt as SoftHyphenContent, C as BookmarkStart, Cn as TableCellBorders, Ct as PropertyChangeInfo, D as CommentRangeEnd, Dn as TableMeasurement, Dt as SdtProperties, E as Comment, En as TableLook, Et as RunPropertyChange, F as EndnotePosition, Fn as KnownBorderStyle, Ft as ShapeFill, G as HeaderFooterType, Gt as TableCellPropertyChange, H as FootnotePosition, Ht as TabContent, I as EndnoteProperties, In as ShadingProperties, It as ShapeOutline, J as Image, Jt as TableRowPropertyChange, K as HeaderReference, Kt as TablePropertyChange, L as Field, Ln as ThemeColorSlot, Lt as ShapeTextBody, M as DocumentBody, Mn as UnderlineStyle, Mt as SectionStart, N as DrawingContent, Nn as BorderSpec, Nt as Shape, O as CommentRangeStart, On as TableRowFormatting, Ot as SdtType, P as Endnote, Pn as ColorValue, Pt as ShapeContent, Q as ImageSize, Qt as TextWatermark, R as FieldCharContent, Rt as ShapeType, S as BookmarkEnd, Sn as TableBorders, St as PositionalTab, T as Column, Tn as TableFormatting, 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 ParagraphFormatting, _t as Paragraph, a as DocxPackage, an as LevelSuffix, at as MAX_REVISION_ID, b as BlockContent, bn as TabStop, bt as ParagraphPropertyChange, c as FontTable, cn as NumberFormat, ct as MoveFromRangeEnd, d as RelationshipMap, dn as CellMargins, dt as MoveToRangeEnd, en as TrackedRunChange, et as ImageWrap, f as RelationshipType, fn as ConditionalFormatStyle, ft as MoveToRangeStart, g as Theme, gn as ParagraphAlignment, gt as PageOrientation, h as StyleType, hn as LineSpacingRule, ht as NoteReferenceContent, i as DocxConformanceClass, in as AbstractNumbering, it as LineNumberRestart, j as Deletion, jn as TextFormatting, jt as SectionPropertyChange, k as CommentReference, kn as TableWidthType, kt as Section, l as MediaFile, ln as NumberingDefinitions, lt as MoveFromRangeStart, m as StyleDefinitions, mn as FloatingTableProperties, mt as NoteNumberRestart, n as Document, nn as Watermark, nt as Insertion, o as DocDefaults, on as ListLevel, ot as MathEquation, p as Style, pn as EmphasisMark, pt as NoBreakHyphenContent, q as Hyperlink, qt as TableRow, r as DocumentSettings, rn as normalizeRevisionId, rt as InstrTextContent, s as FontInfo, sn as ListRendering, st as MoveFrom, t as DOCX_CONFORMANCE_CLASSES, tn as VerticalAlign, tt as InlineSdt, u as Relationship, un as NumberingInstance, ut as MoveTo, v as ThemeFont, vn as SpacingExplicit, vt as ParagraphContent, w as BreakContent, wn as TableCellFormatting, wt as Run, x as BlockSdt, xn as TabStopAlignment, xt as PictureWatermark, y as ThemeFontScheme, yn as TabLeader, yt as ParagraphMarkChange, z as FieldType, zt as SimpleField } from "../document-DI8X7aZy.js";
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, normalizeRevisionId };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stll/docx-core",
3
- "version": "0.5.0",
3
+ "version": "0.5.2",
4
4
  "description": "Typed OOXML/DOCX document model with parsing, validation, and serialization, plus a legal-source compiler that produces DOCX packages.",
5
5
  "keywords": [
6
6
  "document-model",
@@ -54,12 +54,12 @@
54
54
  "prepack": "bun run build"
55
55
  },
56
56
  "dependencies": {
57
- "better-result": "2.9.2",
57
+ "better-result": "2.10.0",
58
58
  "jszip": "3.10.1"
59
59
  },
60
60
  "devDependencies": {
61
61
  "@types/bun": "1.3.14",
62
- "tsdown": "0.22.3"
62
+ "tsdown": "0.22.9"
63
63
  },
64
64
  "main": "./dist/index.js",
65
65
  "types": "./dist/index.d.ts"