@stll/docx-core 0.2.0 → 0.3.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.
|
@@ -93,6 +93,11 @@ type TextFormatting = {
|
|
|
93
93
|
hAnsiTheme?: string;
|
|
94
94
|
eastAsiaTheme?: string;
|
|
95
95
|
csTheme?: string;
|
|
96
|
+
}; /** Run language metadata (`w:lang`) used by spelling and line breaking. */
|
|
97
|
+
language?: {
|
|
98
|
+
val?: string;
|
|
99
|
+
eastAsia?: string;
|
|
100
|
+
bidi?: string;
|
|
96
101
|
}; /** Character spacing in twips (w:spacing) */
|
|
97
102
|
spacing?: number; /** Raised/lowered text position in half-points (w:position) */
|
|
98
103
|
position?: number; /** Horizontal text scale percentage (w:w) */
|
|
@@ -141,7 +146,9 @@ type SpacingExplicit = {
|
|
|
141
146
|
};
|
|
142
147
|
type ParagraphFormatting = {
|
|
143
148
|
/** Paragraph alignment (w:jc) */alignment?: ParagraphAlignment; /** Text direction (w:bidi) */
|
|
144
|
-
bidi?: boolean; /**
|
|
149
|
+
bidi?: boolean; /** Apply East Asian first/last-character line-breaking rules (w:kinsoku). */
|
|
150
|
+
kinsoku?: boolean; /** Allow punctuation to hang beyond the text margin (w:overflowPunct). */
|
|
151
|
+
overflowPunctuation?: boolean; /** Spacing before in twips (w:spacing/@w:before) */
|
|
145
152
|
spaceBefore?: number; /** Spacing after in twips (w:spacing/@w:after) */
|
|
146
153
|
spaceAfter?: number; /** Line spacing value (w:spacing/@w:line) */
|
|
147
154
|
lineSpacing?: number; /** Line spacing rule (w:spacing/@w:lineRule) */
|
|
@@ -233,6 +240,14 @@ type TableBorders = {
|
|
|
233
240
|
insideH?: BorderSpec;
|
|
234
241
|
insideV?: BorderSpec;
|
|
235
242
|
};
|
|
243
|
+
/**
|
|
244
|
+
* Table cell borders, including w:tl2br (top-left to bottom-right) and
|
|
245
|
+
* w:tr2bl (top-right to bottom-left).
|
|
246
|
+
*/
|
|
247
|
+
type TableCellBorders = TableBorders & {
|
|
248
|
+
topLeftToBottomRight?: BorderSpec;
|
|
249
|
+
topRightToBottomLeft?: BorderSpec;
|
|
250
|
+
};
|
|
236
251
|
/**
|
|
237
252
|
* Cell margins
|
|
238
253
|
*/
|
|
@@ -324,7 +339,7 @@ type ConditionalFormatStyle = {
|
|
|
324
339
|
*/
|
|
325
340
|
type TableCellFormatting = {
|
|
326
341
|
/** Cell width */width?: TableMeasurement; /** Cell borders */
|
|
327
|
-
borders?:
|
|
342
|
+
borders?: TableCellBorders; /** Cell margins (override table default) */
|
|
328
343
|
margins?: CellMargins; /** Cell shading/background */
|
|
329
344
|
shading?: ShadingProperties; /** Vertical alignment */
|
|
330
345
|
verticalAlign?: "top" | "center" | "bottom"; /** Text direction */
|
|
@@ -401,7 +416,8 @@ type ListRendering = {
|
|
|
401
416
|
numFmt?: NumberFormat; /** Whether the list marker is hidden (w:vanish on level rPr) */
|
|
402
417
|
markerHidden?: boolean; /** Marker font family from numbering level rPr (ascii name) */
|
|
403
418
|
markerFontFamily?: string; /** Marker font size from numbering level rPr, in points */
|
|
404
|
-
markerFontSize?: number; /**
|
|
419
|
+
markerFontSize?: number; /** Marker bold state from numbering level rPr */
|
|
420
|
+
markerBold?: boolean; /** Horizontal alignment of the marker around the paragraph's list anchor. */
|
|
405
421
|
markerAlignment?: "left" | "center" | "right";
|
|
406
422
|
/**
|
|
407
423
|
* `w:caps` on the numbering level rPr — the marker text renders in upper
|
|
@@ -1100,14 +1116,14 @@ type SdtProperties = {
|
|
|
1100
1116
|
* Inline SDT (content control within a paragraph).
|
|
1101
1117
|
*
|
|
1102
1118
|
* OOXML allows runs, hyperlinks, simple/complex fields, nested SDTs,
|
|
1103
|
-
* and math at this level. All of them must survive
|
|
1104
|
-
* so docProps-bound fields and
|
|
1105
|
-
* their wrapper on round-trip.
|
|
1119
|
+
* tracked insertions/deletions, and math at this level. All of them must survive
|
|
1120
|
+
* parse → edit → save so docProps-bound fields and reviewed template
|
|
1121
|
+
* content do not lose their wrapper on round-trip.
|
|
1106
1122
|
*/
|
|
1107
1123
|
type InlineSdt = {
|
|
1108
1124
|
type: "inlineSdt"; /** SDT properties */
|
|
1109
1125
|
properties: SdtProperties; /** Inline content held inside the control */
|
|
1110
|
-
content: (Run | Hyperlink | SimpleField | ComplexField | InlineSdt | MathEquation)[];
|
|
1126
|
+
content: (Run | Hyperlink | SimpleField | ComplexField | InlineSdt | Insertion | Deletion | MathEquation)[];
|
|
1111
1127
|
};
|
|
1112
1128
|
/**
|
|
1113
1129
|
* Block-level SDT (content control wrapping paragraphs/tables).
|
|
@@ -1625,7 +1641,23 @@ type DocumentSettings = {
|
|
|
1625
1641
|
themeFontLang?: {
|
|
1626
1642
|
eastAsia?: string;
|
|
1627
1643
|
bidi?: string;
|
|
1628
|
-
};
|
|
1644
|
+
}; /** Automatically hyphenate eligible paragraphs (`w:autoHyphenation`). */
|
|
1645
|
+
autoHyphenation?: boolean; /** Keep all-capital words unhyphenated (`w:doNotHyphenateCaps`). */
|
|
1646
|
+
doNotHyphenateCaps?: boolean; /** Maximum consecutive automatically hyphenated lines; zero means unlimited. */
|
|
1647
|
+
consecutiveHyphenLimit?: number; /** Legacy hyphenation zone (`w:hyphenationZone`) in twips; retained for compatibility tooling. */
|
|
1648
|
+
hyphenationZoneTwips?: number; /** Word/OOXML document-wide line-breaking overrides. */
|
|
1649
|
+
lineBreakRules?: {
|
|
1650
|
+
noLineBreaksBefore?: {
|
|
1651
|
+
language?: string;
|
|
1652
|
+
characters: string;
|
|
1653
|
+
};
|
|
1654
|
+
noLineBreaksAfter?: {
|
|
1655
|
+
language?: string;
|
|
1656
|
+
characters: string;
|
|
1657
|
+
};
|
|
1658
|
+
useLegacyEthiopicAmharicRules?: boolean;
|
|
1659
|
+
}; /** Move a break-only paragraph mark onto the page after its hard page break. */
|
|
1660
|
+
splitPageBreakAndParagraphMark?: boolean;
|
|
1629
1661
|
};
|
|
1630
1662
|
/** DOCX package conformance classes. */
|
|
1631
1663
|
declare const DOCX_CONFORMANCE_CLASSES: Readonly<{
|
|
@@ -1673,4 +1705,4 @@ type Document = {
|
|
|
1673
1705
|
warnings?: string[];
|
|
1674
1706
|
};
|
|
1675
1707
|
//#endregion
|
|
1676
|
-
export { ImageTransform as $, VerticalAlign as $t, ComplexField as A,
|
|
1708
|
+
export { ImageTransform as $, VerticalAlign as $t, ComplexField as A, BorderSpec as An, SectionStart as At, FooterReference as B, TabContent as Bt, BookmarkStart as C, TableLook as Cn, RunContent as Ct, CommentRangeEnd as D, TextEffect as Dn, Section as Dt, Comment as E, TableWidthType as En, SdtType as Et, EndnotePosition as F, ShapeTextBody as Ft, HeaderFooterType as G, TableRow as Gt, FootnotePosition as H, TableCell as Ht, EndnoteProperties as I, ShapeType as It, Image as J, TextBox as Jt, HeaderReference as K, TableRowPropertyChange as Kt, Field as L, SimpleField as Lt, DocumentBody as M, KnownBorderStyle as Mn, ShapeContent as Mt, DrawingContent as N, ShadingProperties as Nn, ShapeFill as Nt, CommentRangeStart as O, TextFormatting as On, SectionProperties as Ot, Endnote as P, ThemeColorSlot as Pn, ShapeOutline as Pt, ImageSize as Q, TrackedRunChange as Qt, FieldCharContent as R, SoftHyphenContent as Rt, BookmarkEnd as S, TableFormatting as Sn, Run as St, Column as T, TableRowFormatting as Tn, SdtProperties as Tt, FootnoteProperties as U, TableCellPropertyChange as Ut, Footnote as V, Table as Vt, HeaderFooter as W, TablePropertyChange as Wt, ImagePadding as X, TextWatermark as Xt, ImageCrop as Y, TextContent as Yt, ImagePosition as Z, TrackedChangeInfo as Zt, ThemeColorScheme as _, TabStop as _n, ParagraphContent as _t, DocxPackage as a, NumberFormat as an, MathEquation as at, BlockContent as b, TableCellBorders as bn, PictureWatermark as bt, FontTable as c, CellMargins as cn, MoveFromRangeStart as ct, RelationshipMap as d, FloatingTableProperties as dn, MoveToRangeStart as dt, Watermark as en, ImageWrap as et, RelationshipType as f, LineSpacingRule as fn, NoBreakHyphenContent as ft, Theme as g, TabLeader as gn, Paragraph as gt, StyleType as h, SpacingExplicit as hn, PageOrientation as ht, DocxConformanceClass as i, ListRendering as in, LineNumberRestart as it, Deletion as j, ColorValue as jn, Shape as jt, CommentReference as k, UnderlineStyle as kn, SectionPropertyChange as kt, MediaFile as l, ConditionalFormatStyle as ln, MoveTo as lt, StyleDefinitions as m, ParagraphFormatting as mn, NoteReferenceContent as mt, Document as n, LevelSuffix as nn, Insertion as nt, DocDefaults as o, NumberingDefinitions as on, MoveFrom as ot, Style as p, ParagraphAlignment as pn, NoteNumberRestart as pt, Hyperlink as q, TableStructuralChangeInfo as qt, DocumentSettings as r, ListLevel as rn, InstrTextContent as rt, FontInfo as s, NumberingInstance as sn, MoveFromRangeEnd as st, DOCX_CONFORMANCE_CLASSES as t, AbstractNumbering as tn, InlineSdt as tt, Relationship as u, EmphasisMark as un, MoveToRangeEnd as ut, ThemeFont as v, TabStopAlignment as vn, ParagraphMarkChange as vt, BreakContent as w, TableMeasurement as wn, RunPropertyChange as wt, BlockSdt as x, TableCellFormatting as xn, PropertyChangeInfo as xt, ThemeFontScheme as y, TableBorders as yn, ParagraphPropertyChange as yt, FieldType as z, SymbolContent as zt };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Ct as RunContent, Gt as TableRow, Ht as TableCell, M as DocumentBody, Ot as SectionProperties, St as Run, Vt as Table, Yt as TextContent, _t as ParagraphContent, a as DocxPackage, b as BlockContent, gt as Paragraph, i as DocxConformanceClass, n as Document, p as Style, t as DOCX_CONFORMANCE_CLASSES, w as BreakContent } from "./document-
|
|
1
|
+
import { Ct as RunContent, Gt as TableRow, Ht as TableCell, M as DocumentBody, Ot as SectionProperties, St as Run, Vt as Table, Yt as TextContent, _t as ParagraphContent, a as DocxPackage, b as BlockContent, gt as Paragraph, i as DocxConformanceClass, n as Document, p as Style, t as DOCX_CONFORMANCE_CLASSES, w as BreakContent } from "./document-Qbe-wA-j.js";
|
|
2
2
|
|
|
3
3
|
//#region src/legal-source/types.d.ts
|
|
4
4
|
type LegalDocumentKind = "agreement" | "letter" | "memo" | "checklist" | "pleading" | "other";
|
package/dist/model/document.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { $ as ImageTransform, $t as VerticalAlign, A as ComplexField, An 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, 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 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 };
|
|
1
|
+
import { $ as ImageTransform, $t as VerticalAlign, A as ComplexField, An as BorderSpec, At as SectionStart, B as FooterReference, Bt as TabContent, C as BookmarkStart, Cn as TableLook, Ct as RunContent, D as CommentRangeEnd, Dn as TextEffect, Dt as Section, E as Comment, En as TableWidthType, Et as SdtType, F as EndnotePosition, Ft as ShapeTextBody, G as HeaderFooterType, Gt as TableRow, H as FootnotePosition, Ht as TableCell, I as EndnoteProperties, It as ShapeType, J as Image, Jt as TextBox, K as HeaderReference, Kt as TableRowPropertyChange, L as Field, Lt as SimpleField, M as DocumentBody, Mn as KnownBorderStyle, Mt as ShapeContent, N as DrawingContent, Nn as ShadingProperties, Nt as ShapeFill, O as CommentRangeStart, On as TextFormatting, Ot as SectionProperties, P as Endnote, Pn as ThemeColorSlot, Pt as ShapeOutline, Q as ImageSize, Qt as TrackedRunChange, R as FieldCharContent, Rt as SoftHyphenContent, S as BookmarkEnd, Sn as TableFormatting, St as Run, T as Column, Tn as TableRowFormatting, Tt as SdtProperties, U as FootnoteProperties, Ut as TableCellPropertyChange, V as Footnote, Vt as Table, W as HeaderFooter, Wt as TablePropertyChange, X as ImagePadding, Xt as TextWatermark, Y as ImageCrop, Yt as TextContent, Z as ImagePosition, Zt as TrackedChangeInfo, _ as ThemeColorScheme, _n as TabStop, _t as ParagraphContent, a as DocxPackage, an as NumberFormat, at as MathEquation, b as BlockContent, bn as TableCellBorders, bt as PictureWatermark, c as FontTable, cn as CellMargins, ct as MoveFromRangeStart, d as RelationshipMap, dn as FloatingTableProperties, dt as MoveToRangeStart, en as Watermark, et as ImageWrap, f as RelationshipType, fn as LineSpacingRule, ft as NoBreakHyphenContent, g as Theme, gn as TabLeader, gt as Paragraph, h as StyleType, hn as SpacingExplicit, ht as PageOrientation, i as DocxConformanceClass, in as ListRendering, it as LineNumberRestart, j as Deletion, jn as ColorValue, jt as Shape, k as CommentReference, kn as UnderlineStyle, kt as SectionPropertyChange, l as MediaFile, ln as ConditionalFormatStyle, lt as MoveTo, m as StyleDefinitions, mn as ParagraphFormatting, mt as NoteReferenceContent, n as Document, nn as LevelSuffix, nt as Insertion, o as DocDefaults, on as NumberingDefinitions, ot as MoveFrom, p as Style, pn as ParagraphAlignment, pt as NoteNumberRestart, q as Hyperlink, qt as TableStructuralChangeInfo, r as DocumentSettings, rn as ListLevel, rt as InstrTextContent, s as FontInfo, sn as NumberingInstance, st as MoveFromRangeEnd, t as DOCX_CONFORMANCE_CLASSES, tn as AbstractNumbering, tt as InlineSdt, u as Relationship, un as EmphasisMark, ut as MoveToRangeEnd, v as ThemeFont, vn as TabStopAlignment, vt as ParagraphMarkChange, w as BreakContent, wn as TableMeasurement, wt as RunPropertyChange, x as BlockSdt, xn as TableCellFormatting, xt as PropertyChangeInfo, y as ThemeFontScheme, yn as TableBorders, yt as ParagraphPropertyChange, z as FieldType, zt as SymbolContent } from "../document-Qbe-wA-j.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, 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 };
|
package/package.json
CHANGED