@stll/docx-core 0.15.2 → 0.16.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.
|
@@ -568,6 +568,8 @@ type NumberingInstance = {
|
|
|
568
568
|
lvl?: ListLevel;
|
|
569
569
|
}[];
|
|
570
570
|
};
|
|
571
|
+
/** Typography from numbering-level `w:rPr` that applies to the marker glyphs. */
|
|
572
|
+
type ListMarkerFormatting = Pick<TextFormatting, "fontFamily" | "fontSize" | "fontSizeCs" | "bold" | "boldCs" | "italic" | "italicCs" | "rtl" | "cs">;
|
|
571
573
|
/**
|
|
572
574
|
* Computed list rendering info
|
|
573
575
|
*/
|
|
@@ -586,12 +588,8 @@ type ListRendering = {
|
|
|
586
588
|
numFmt?: NumberFormat;
|
|
587
589
|
/** Whether the list marker is hidden (w:vanish on level rPr) */
|
|
588
590
|
markerHidden?: boolean;
|
|
589
|
-
/**
|
|
590
|
-
|
|
591
|
-
/** Marker font size from numbering level rPr, in points */
|
|
592
|
-
markerFontSize?: number;
|
|
593
|
-
/** Marker bold state from numbering level rPr */
|
|
594
|
-
markerBold?: boolean;
|
|
591
|
+
/** Canonical numbering-level marker typography, in OOXML units. */
|
|
592
|
+
markerFormatting?: ListMarkerFormatting;
|
|
595
593
|
/** Horizontal alignment of the marker around the paragraph's list anchor. */
|
|
596
594
|
markerAlignment?: "left" | "center" | "right";
|
|
597
595
|
/**
|
|
@@ -2284,4 +2282,4 @@ type Document = {
|
|
|
2284
2282
|
warnings?: string[];
|
|
2285
2283
|
};
|
|
2286
2284
|
//#endregion
|
|
2287
|
-
export { ImageTransform as $, TrackedChangeInfo as $t, ComplexField as A,
|
|
2285
|
+
export { ImageTransform as $, TrackedChangeInfo as $t, ComplexField as A, TableRowFormatting as An, SectionProperties as At, FooterReference as B, SoftHyphenContent as Bt, BookmarkStart as C, TabStopAlignment as Cn, PropertyChangeInfo as Ct, CommentRangeEnd as D, TableFormatting as Dn, SdtProperties as Dt, Comment as E, TableCellFormatting as En, RunPropertyChange as Et, EndnotePosition as F, BorderSpec as Fn, ShapeFill as Ft, HeaderFooterType as G, TableCellPropertyChange as Gt, FootnotePosition as H, TabContent as Ht, EndnoteProperties as I, ColorValue as In, ShapeOutline as It, Image as J, TableRowPropertyChange as Jt, HeaderReference as K, TablePropertyChange as Kt, Field as L, KnownBorderStyle as Ln, ShapeTextBody as Lt, DocumentBody as M, TextEffect as Mn, SectionStart as Mt, DrawingContent as N, TextFormatting as Nn, Shape as Nt, CommentRangeStart as O, TableLook as On, SdtType as Ot, Endnote as P, UnderlineStyle as Pn, ShapeContent as Pt, ImageSize as Q, TextWatermark as Qt, FieldCharContent as R, ShadingProperties as Rn, ShapeType as Rt, BookmarkEnd as S, TabStop as Sn, PositionalTab as St, Column as T, TableCellBorders 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 _, LineSpacingRule as _n, Paragraph as _t, DocxPackage as a, AbstractNumbering as an, MAX_REVISION_ID as at, BlockContent as b, SpacingExplicit as bn, ParagraphPropertyChange as bt, FontTable as c, ListMarkerFormatting as cn, MoveFromRangeEnd as ct, RelationshipMap as d, NumberingDefinitions as dn, MoveToRangeEnd as dt, TrackedRunChange as en, ImageWrap as et, RelationshipType as f, NumberingInstance as fn, MoveToRangeStart as ft, Theme as g, FloatingTableProperties as gn, PageOrientation as gt, StyleType as h, EmphasisMark as hn, NoteReferenceContent as ht, DocxConformanceClass as i, normalizeRevisionId as in, LineNumberRestart as it, Deletion as j, TableWidthType as jn, SectionPropertyChange as jt, CommentReference as k, TableMeasurement as kn, Section as kt, MediaFile as l, ListRendering as ln, MoveFromRangeStart as lt, StyleDefinitions as m, ConditionalFormatStyle as mn, NoteNumberRestart as mt, Document as n, Watermark as nn, Insertion as nt, DocDefaults as o, LevelSuffix as on, MathEquation as ot, Style as p, CellMargins as pn, NoBreakHyphenContent as pt, Hyperlink as q, TableRow as qt, DocumentSettings as r, isOoxmlSymbolCharacter as rn, InstrTextContent as rt, FontInfo as s, ListLevel as sn, MoveFrom as st, DOCX_CONFORMANCE_CLASSES as t, VerticalAlign as tn, InlineSdt as tt, Relationship as u, NumberFormat as un, MoveTo as ut, ThemeFont as v, ParagraphAlignment as vn, ParagraphContent as vt, BreakContent as w, TableBorders as wn, Run as wt, BlockSdt as x, TabLeader as xn, PictureWatermark as xt, ThemeFontScheme as y, ParagraphFormatting as yn, ParagraphMarkChange as yt, FieldType as z, ThemeColorSlot as zn, SimpleField as zt };
|
package/dist/docx_kernel_bg.wasm
CHANGED
|
Binary file
|
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
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-
|
|
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-BBf3sBoZ.js";
|
|
2
2
|
import { Buffer } from "node:buffer";
|
|
3
3
|
//#region src/legal-source/types.d.ts
|
|
4
4
|
type LegalDocumentKind = "agreement" | "letter" | "memo" | "checklist" | "pleading" | "other";
|
package/dist/index.js
CHANGED
|
@@ -171,13 +171,22 @@ const serializeRunProperties = (formatting) => {
|
|
|
171
171
|
if (!formatting) return "";
|
|
172
172
|
const parts = [];
|
|
173
173
|
if (formatting.styleId) parts.push(`<w:rStyle w:val="${escapeXml(formatting.styleId)}"/>`);
|
|
174
|
-
if (formatting.bold) parts.push("<w:b/>");
|
|
175
|
-
if (formatting.
|
|
174
|
+
if (formatting.bold === true) parts.push("<w:b/>");
|
|
175
|
+
else if (formatting.bold === false) parts.push("<w:b w:val=\"0\"/>");
|
|
176
|
+
if (formatting.boldCs === true) parts.push("<w:bCs/>");
|
|
177
|
+
else if (formatting.boldCs === false) parts.push("<w:bCs w:val=\"0\"/>");
|
|
178
|
+
if (formatting.italic === true) parts.push("<w:i/>");
|
|
179
|
+
else if (formatting.italic === false) parts.push("<w:i w:val=\"0\"/>");
|
|
180
|
+
if (formatting.italicCs === true) parts.push("<w:iCs/>");
|
|
181
|
+
else if (formatting.italicCs === false) parts.push("<w:iCs w:val=\"0\"/>");
|
|
176
182
|
if (formatting.allCaps) parts.push("<w:caps/>");
|
|
177
183
|
if (formatting.smallCaps) parts.push("<w:smallCaps/>");
|
|
178
184
|
if (formatting.highlight) parts.push(`<w:highlight w:val="${formatting.highlight}"/>`);
|
|
179
185
|
if (formatting.fontSize !== void 0) parts.push(`<w:sz w:val="${formatting.fontSize}"/>`);
|
|
186
|
+
if (formatting.fontSizeCs !== void 0) parts.push(`<w:szCs w:val="${formatting.fontSizeCs}"/>`);
|
|
180
187
|
if (formatting.fontFamily) parts.push(`<w:rFonts${attr("w:ascii", formatting.fontFamily.ascii)}${attr("w:hAnsi", formatting.fontFamily.hAnsi)}${attr("w:cs", formatting.fontFamily.cs)}/>`);
|
|
188
|
+
if (formatting.cs === true) parts.push("<w:cs/>");
|
|
189
|
+
else if (formatting.cs === false) parts.push("<w:cs w:val=\"0\"/>");
|
|
181
190
|
return parts.length > 0 ? `<w:rPr>${parts.join("")}</w:rPr>` : "";
|
|
182
191
|
};
|
|
183
192
|
const serializeRunContent = (content) => {
|
package/dist/model/document.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { $ as ImageTransform, $t as TrackedChangeInfo, 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, 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 };
|
|
1
|
+
import { $ as ImageTransform, $t as TrackedChangeInfo, A as ComplexField, An as TableRowFormatting, At as SectionProperties, B as FooterReference, Bt as SoftHyphenContent, C as BookmarkStart, Cn as TabStopAlignment, Ct as PropertyChangeInfo, D as CommentRangeEnd, Dn as TableFormatting, Dt as SdtProperties, E as Comment, En as TableCellFormatting, Et as RunPropertyChange, F as EndnotePosition, Fn as BorderSpec, Ft as ShapeFill, G as HeaderFooterType, Gt as TableCellPropertyChange, H as FootnotePosition, Ht as TabContent, I as EndnoteProperties, In as ColorValue, It as ShapeOutline, J as Image, Jt as TableRowPropertyChange, K as HeaderReference, Kt as TablePropertyChange, L as Field, Ln as KnownBorderStyle, Lt as ShapeTextBody, M as DocumentBody, Mn as TextEffect, Mt as SectionStart, N as DrawingContent, Nn as TextFormatting, Nt as Shape, O as CommentRangeStart, On as TableLook, Ot as SdtType, P as Endnote, Pn as UnderlineStyle, Pt as ShapeContent, Q as ImageSize, Qt as TextWatermark, R as FieldCharContent, Rn as ShadingProperties, Rt as ShapeType, S as BookmarkEnd, Sn as TabStop, St as PositionalTab, T as Column, Tn as TableCellBorders, 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 LineSpacingRule, _t as Paragraph, a as DocxPackage, an as AbstractNumbering, at as MAX_REVISION_ID, b as BlockContent, bn as SpacingExplicit, bt as ParagraphPropertyChange, c as FontTable, cn as ListMarkerFormatting, ct as MoveFromRangeEnd, d as RelationshipMap, dn as NumberingDefinitions, dt as MoveToRangeEnd, en as TrackedRunChange, et as ImageWrap, f as RelationshipType, fn as NumberingInstance, ft as MoveToRangeStart, g as Theme, gn as FloatingTableProperties, gt as PageOrientation, h as StyleType, hn as EmphasisMark, ht as NoteReferenceContent, i as DocxConformanceClass, in as normalizeRevisionId, it as LineNumberRestart, j as Deletion, jn as TableWidthType, jt as SectionPropertyChange, k as CommentReference, kn as TableMeasurement, kt as Section, l as MediaFile, ln as ListRendering, lt as MoveFromRangeStart, m as StyleDefinitions, mn as ConditionalFormatStyle, 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 CellMargins, 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 NumberFormat, ut as MoveTo, v as ThemeFont, vn as ParagraphAlignment, vt as ParagraphContent, w as BreakContent, wn as TableBorders, wt as Run, x as BlockSdt, xn as TabLeader, xt as PictureWatermark, y as ThemeFontScheme, yn as ParagraphFormatting, yt as ParagraphMarkChange, z as FieldType, zn as ThemeColorSlot, zt as SimpleField } from "../document-BBf3sBoZ.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 ListMarkerFormatting, 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 };
|
package/package.json
CHANGED