@stll/docx-core 0.5.1 → 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.
|
@@ -652,8 +652,15 @@ type TextContent = {
|
|
|
652
652
|
/**
|
|
653
653
|
* Tab character
|
|
654
654
|
*/
|
|
655
|
+
type PositionalTab = {
|
|
656
|
+
relativeTo?: "margin" | "indent";
|
|
657
|
+
alignment?: "left" | "center" | "right";
|
|
658
|
+
leader?: "none" | "dot" | "hyphen" | "underscore" | "middleDot";
|
|
659
|
+
};
|
|
655
660
|
type TabContent = {
|
|
656
661
|
type: "tab";
|
|
662
|
+
/** Word positional-tab properties (`w:ptab`); absent for a regular `w:tab`. */
|
|
663
|
+
positional?: PositionalTab;
|
|
657
664
|
};
|
|
658
665
|
/**
|
|
659
666
|
* Line break
|
|
@@ -1000,6 +1007,11 @@ type ShapeType = "rect" | "roundRect" | "ellipse" | "triangle" | "rtTriangle" |
|
|
|
1000
1007
|
*/
|
|
1001
1008
|
type ShapeFill = {
|
|
1002
1009
|
type: "none" | "solid" | "gradient" | "pattern" | "picture";
|
|
1010
|
+
/**
|
|
1011
|
+
* Authored DrawingML retained when the normalized projection is incomplete.
|
|
1012
|
+
* Serializers prefer this value; omit it when modifying the fill.
|
|
1013
|
+
*/
|
|
1014
|
+
rawXml?: string;
|
|
1003
1015
|
/** Solid fill color */
|
|
1004
1016
|
color?: ColorValue;
|
|
1005
1017
|
/** Gradient stops for gradient fill */
|
|
@@ -1016,6 +1028,11 @@ type ShapeFill = {
|
|
|
1016
1028
|
* Shape outline/stroke
|
|
1017
1029
|
*/
|
|
1018
1030
|
type ShapeOutline = {
|
|
1031
|
+
/**
|
|
1032
|
+
* Authored DrawingML retained for lossless round-trips. Serializers prefer
|
|
1033
|
+
* this value; callers modifying structured outline fields must omit it.
|
|
1034
|
+
*/
|
|
1035
|
+
rawXml?: string;
|
|
1019
1036
|
/** Line width in EMUs */
|
|
1020
1037
|
width?: number;
|
|
1021
1038
|
/** Line color */
|
|
@@ -1176,6 +1193,8 @@ type Comment = {
|
|
|
1176
1193
|
date?: string;
|
|
1177
1194
|
/** Comment content (paragraphs) */
|
|
1178
1195
|
content: Paragraph[];
|
|
1196
|
+
/** Formatting of the structural annotation-reference run in the first paragraph */
|
|
1197
|
+
annotationReferenceFormatting?: TextFormatting;
|
|
1179
1198
|
/** Parent comment ID (for replies) */
|
|
1180
1199
|
parentId?: number;
|
|
1181
1200
|
/** Whether the comment is resolved/done */
|
|
@@ -2257,4 +2276,4 @@ type Document = {
|
|
|
2257
2276
|
warnings?: string[];
|
|
2258
2277
|
};
|
|
2259
2278
|
//#endregion
|
|
2260
|
-
export { ImageTransform as $,
|
|
2279
|
+
export { ImageTransform as $, TrackedChangeInfo as $t, ComplexField as A, TextEffect as An, SectionProperties as At, FooterReference as B, SoftHyphenContent as Bt, BookmarkStart as C, TableCellBorders as Cn, PropertyChangeInfo as Ct, CommentRangeEnd as D, TableMeasurement as Dn, SdtProperties as Dt, Comment as E, TableLook as En, RunPropertyChange as Et, EndnotePosition as F, KnownBorderStyle as Fn, ShapeFill as Ft, HeaderFooterType as G, TableCellPropertyChange as Gt, FootnotePosition as H, TabContent as Ht, EndnoteProperties as I, ShadingProperties as In, ShapeOutline as It, Image as J, TableRowPropertyChange as Jt, HeaderReference as K, TablePropertyChange as Kt, Field as L, ThemeColorSlot as Ln, ShapeTextBody as Lt, DocumentBody as M, UnderlineStyle as Mn, SectionStart as Mt, DrawingContent as N, BorderSpec as Nn, Shape as Nt, CommentRangeStart as O, TableRowFormatting as On, SdtType as Ot, Endnote as P, ColorValue as Pn, ShapeContent as Pt, ImageSize as Q, TextWatermark as Qt, FieldCharContent as R, ShapeType as Rt, BookmarkEnd as S, TableBorders as Sn, PositionalTab as St, Column as T, TableFormatting as Tn, RunContent as Tt, FootnoteProperties as U, Table as Ut, Footnote as V, SymbolContent as Vt, HeaderFooter as W, TableCell as Wt, ImagePadding as X, TextBox as Xt, ImageCrop as Y, TableStructuralChangeInfo as Yt, ImagePosition as Z, TextContent as Zt, ThemeColorScheme as _, ParagraphFormatting as _n, Paragraph as _t, DocxPackage as a, LevelSuffix as an, MAX_REVISION_ID as at, BlockContent as b, TabStop as bn, ParagraphPropertyChange as bt, FontTable as c, NumberFormat as cn, MoveFromRangeEnd as ct, RelationshipMap as d, CellMargins as dn, MoveToRangeEnd as dt, TrackedRunChange as en, ImageWrap as et, RelationshipType as f, ConditionalFormatStyle as fn, MoveToRangeStart as ft, Theme as g, ParagraphAlignment as gn, PageOrientation as gt, StyleType as h, LineSpacingRule as hn, NoteReferenceContent as ht, DocxConformanceClass as i, AbstractNumbering as in, LineNumberRestart as it, Deletion as j, TextFormatting as jn, SectionPropertyChange as jt, CommentReference as k, TableWidthType as kn, Section as kt, MediaFile as l, NumberingDefinitions as ln, MoveFromRangeStart as lt, StyleDefinitions as m, FloatingTableProperties as mn, NoteNumberRestart as mt, Document as n, Watermark as nn, Insertion as nt, DocDefaults as o, ListLevel as on, MathEquation as ot, Style as p, EmphasisMark as pn, NoBreakHyphenContent as pt, Hyperlink as q, TableRow as qt, DocumentSettings as r, normalizeRevisionId as rn, InstrTextContent as rt, FontInfo as s, ListRendering as sn, MoveFrom as st, DOCX_CONFORMANCE_CLASSES as t, VerticalAlign as tn, InlineSdt as tt, Relationship as u, NumberingInstance as un, MoveTo as ut, ThemeFont as v, SpacingExplicit as vn, ParagraphContent as vt, BreakContent as w, TableCellFormatting as wn, Run as wt, BlockSdt as x, TabStopAlignment as xn, PictureWatermark as xt, ThemeFontScheme as y, TabLeader as yn, ParagraphMarkChange as yt, FieldType as z, SimpleField as zt };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
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";
|
|
2
2
|
//#region src/legal-source/types.d.ts
|
|
3
3
|
type LegalDocumentKind = "agreement" | "letter" | "memo" | "checklist" | "pleading" | "other";
|
|
4
4
|
type LegalNumberingProfile = "legal" | "none" | "checklist";
|
|
@@ -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":
|
|
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)}"/>`;
|
package/dist/model/document.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { $ as ImageTransform, $t as
|
|
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