@stll/docx-core 0.25.2 → 0.26.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.
- package/dist/{document-P82X2cGL.d.ts → document-BA86X0Ma.d.ts} +53 -20
- package/dist/{document-DJuN_2kr.js → document-Bz9rYlJI.js} +5 -1
- package/dist/docx_kernel_bg.wasm +0 -0
- package/dist/index.d.ts +2 -2
- package/dist/index.js +9 -3
- package/dist/model/document.d.ts +2 -2
- package/dist/model/document.js +1 -1
- package/dist/schema/sequenceChildren.d.ts +1 -1
- package/dist/schema/sequenceChildren.js +1 -1
- package/dist/{sequenceChildren-DlUb7FZG.js → sequenceChildren-BIixCB49.js} +3 -1
- package/package.json +1 -1
|
@@ -1256,7 +1256,7 @@ type NumberingInstance = {
|
|
|
1256
1256
|
preservedAttributes?: PreservedAttribute[];
|
|
1257
1257
|
};
|
|
1258
1258
|
/** Typography from numbering-level `w:rPr` that applies to the marker glyphs. */
|
|
1259
|
-
type ListMarkerFormatting = Pick<TextFormatting, "fontFamily" | "fontSize" | "fontSizeCs" | "bold" | "boldCs" | "italic" | "italicCs" | "rtl" | "cs">;
|
|
1259
|
+
type ListMarkerFormatting = Pick<TextFormatting, "fontFamily" | "fontSize" | "fontSizeCs" | "bold" | "boldCs" | "italic" | "italicCs" | "rtl" | "cs" | "color">;
|
|
1260
1260
|
/**
|
|
1261
1261
|
* Computed list rendering info
|
|
1262
1262
|
*/
|
|
@@ -1293,6 +1293,11 @@ type ListRendering = {
|
|
|
1293
1293
|
* adds one space glyph; `nothing` lets body text butt against the marker.
|
|
1294
1294
|
*/
|
|
1295
1295
|
markerSuffix?: LevelSuffix;
|
|
1296
|
+
/**
|
|
1297
|
+
* Custom tab stops from the numbering level's `w:pPr/w:tabs` (§17.9.23).
|
|
1298
|
+
* They apply to the paragraph beneath its own and its style's stops.
|
|
1299
|
+
*/
|
|
1300
|
+
levelTabs?: ParagraphFormatting["tabs"];
|
|
1296
1301
|
/** What each level from 0 through this paragraph's counts in. */
|
|
1297
1302
|
levelNumFmts?: CounterFormat[];
|
|
1298
1303
|
/**
|
|
@@ -2337,15 +2342,7 @@ type TableCell = {
|
|
|
2337
2342
|
propertyChanges?: TableCellPropertyChange[];
|
|
2338
2343
|
/** Tracked structural changes (cell insert/delete/merge) */
|
|
2339
2344
|
structuralChange?: TableStructuralChangeInfo;
|
|
2340
|
-
/**
|
|
2341
|
-
* Cell content.
|
|
2342
|
-
*
|
|
2343
|
-
* Derived from {@link BlockContent} rather than listed, so a new block kind
|
|
2344
|
-
* cannot land without a decision here; `BlockSdt` is excluded because folio
|
|
2345
|
-
* unwraps a `w:sdt` inside a cell into its `sdtContent` children rather
|
|
2346
|
-
* than modelling the wrapper, and keeping the branch out of the cell keeps
|
|
2347
|
-
* the model's recursion out of every table.
|
|
2348
|
-
*/
|
|
2345
|
+
/** Cell content, including block controls nested directly in the cell. */
|
|
2349
2346
|
content: TableCellBlock[];
|
|
2350
2347
|
/**
|
|
2351
2348
|
* The cell-level content controls (`CT_SdtCell`) this cell sits inside,
|
|
@@ -2613,7 +2610,7 @@ type PropertyChangeInfo = {
|
|
|
2613
2610
|
* with it: the text is then neither inserted nor deleted, and accepting and
|
|
2614
2611
|
* rejecting the revision both keep it.
|
|
2615
2612
|
*/
|
|
2616
|
-
type TrackedRunContent = Run | Hyperlink | BookmarkStart | BookmarkEnd | SimpleField | ComplexField | InlineSdt | InlineWrapper | MathEquation | PreservedInline | TrackedRunChange;
|
|
2613
|
+
type TrackedRunContent = Run | Hyperlink | BookmarkStart | BookmarkEnd | MoveFromRangeStart | MoveFromRangeEnd | MoveToRangeStart | MoveToRangeEnd | SimpleField | ComplexField | InlineSdt | InlineWrapper | MathEquation | PreservedInline | TrackedRunChange;
|
|
2617
2614
|
/**
|
|
2618
2615
|
* Insertion wrapper (w:ins) — runs inserted by tracked changes
|
|
2619
2616
|
*/
|
|
@@ -3017,20 +3014,20 @@ type SdtEndProperties = {
|
|
|
3017
3014
|
* this level. All of them must survive parse → edit → save so docProps-bound
|
|
3018
3015
|
* fields and reviewed template content do not lose their wrapper on round-trip.
|
|
3019
3016
|
*
|
|
3020
|
-
*
|
|
3021
|
-
* do: `CT_SdtContentRun` reaches them through
|
|
3017
|
+
* Bookmark and tracked-move boundaries belong here for the reason the revision
|
|
3018
|
+
* wrapper's do: `CT_SdtContentRun` reaches them through
|
|
3022
3019
|
* `EG_RunLevelElts > EG_RangeMarkupElements`, and a marker lifted out to a
|
|
3023
|
-
* sibling of the control
|
|
3020
|
+
* sibling of the control has changed extent or ownership. A bookmark that
|
|
3024
3021
|
* covered the control's content ends up covering the control and whatever
|
|
3025
|
-
* follows it
|
|
3026
|
-
*
|
|
3022
|
+
* follows it; a tracked move can stop covering the marker that identifies its
|
|
3023
|
+
* source or destination.
|
|
3027
3024
|
*/
|
|
3028
3025
|
type InlineSdt = {
|
|
3029
3026
|
type: "inlineSdt";
|
|
3030
3027
|
/** SDT properties */
|
|
3031
3028
|
properties: SdtProperties;
|
|
3032
3029
|
/** Inline content held inside the control */
|
|
3033
|
-
content: (Run | Hyperlink | BookmarkStart | BookmarkEnd | SimpleField | ComplexField | InlineSdt | InlineWrapper | Insertion | Deletion | MoveFrom | MoveTo | MathEquation | PreservedInline)[];
|
|
3030
|
+
content: (Run | Hyperlink | BookmarkStart | BookmarkEnd | MoveFromRangeStart | MoveFromRangeEnd | MoveToRangeStart | MoveToRangeEnd | SimpleField | ComplexField | InlineSdt | InlineWrapper | Insertion | Deletion | MoveFrom | MoveTo | MathEquation | PreservedInline)[];
|
|
3034
3031
|
};
|
|
3035
3032
|
/**
|
|
3036
3033
|
* Block-level SDT (content control wrapping paragraphs/tables).
|
|
@@ -3521,8 +3518,8 @@ type PreservedBlock = {
|
|
|
3521
3518
|
* bookmark would not merely move, it would go.
|
|
3522
3519
|
*/
|
|
3523
3520
|
type BlockContent = Paragraph | Table | BlockSdt | PreservedBlock | BookmarkStart | BookmarkEnd;
|
|
3524
|
-
/**
|
|
3525
|
-
type TableCellBlock =
|
|
3521
|
+
/** A block that can occur inside a table cell. */
|
|
3522
|
+
type TableCellBlock = BlockContent;
|
|
3526
3523
|
/**
|
|
3527
3524
|
* Section (implicit or explicit based on sectPr)
|
|
3528
3525
|
*/
|
|
@@ -3536,10 +3533,36 @@ type Section = {
|
|
|
3536
3533
|
/** Footers for this section */
|
|
3537
3534
|
footers?: Map<HeaderFooterType, HeaderFooter>;
|
|
3538
3535
|
};
|
|
3536
|
+
/**
|
|
3537
|
+
* Drawing payload under the document-level `w:background`.
|
|
3538
|
+
*
|
|
3539
|
+
* Folio does not interpret this drawing. Keeping it as authored markup avoids
|
|
3540
|
+
* inventing an editable projection for legacy VML/DrawingML page art while the
|
|
3541
|
+
* surrounding background attributes remain typed.
|
|
3542
|
+
*/
|
|
3543
|
+
type DocumentBackgroundDrawing = {
|
|
3544
|
+
/** Replayable `w:drawing` markup, as the source wrote it. */
|
|
3545
|
+
rawXml: string;
|
|
3546
|
+
};
|
|
3547
|
+
/** Page background declared directly under `w:document`. */
|
|
3548
|
+
type DocumentBackground = {
|
|
3549
|
+
/** Direct colour or the `auto` sentinel. */
|
|
3550
|
+
color?: ColorValue;
|
|
3551
|
+
/** Theme colour token, including the explicit `none` cancellation. */
|
|
3552
|
+
themeColor?: ThemeColorValue;
|
|
3553
|
+
/** Theme tint modifier, kept in its authored hexadecimal spelling. */
|
|
3554
|
+
themeTint?: string;
|
|
3555
|
+
/** Theme shade modifier, kept in its authored hexadecimal spelling. */
|
|
3556
|
+
themeShade?: string;
|
|
3557
|
+
/** Optional drawing payload carried opaquely through an editor save. */
|
|
3558
|
+
drawing?: DocumentBackgroundDrawing;
|
|
3559
|
+
};
|
|
3539
3560
|
/**
|
|
3540
3561
|
* Document body (w:body)
|
|
3541
3562
|
*/
|
|
3542
3563
|
type DocumentBody = {
|
|
3564
|
+
/** Optional `w:document/w:background`, serialized before the body. */
|
|
3565
|
+
background?: DocumentBackground;
|
|
3543
3566
|
/** All content (paragraphs, tables) */
|
|
3544
3567
|
content: BlockContent[];
|
|
3545
3568
|
/** Sections (derived from sectPr in paragraphs and final sectPr) */
|
|
@@ -3967,6 +3990,11 @@ type DocumentSettings = {
|
|
|
3967
3990
|
* pitch to paragraphs inside table cells.
|
|
3968
3991
|
*/
|
|
3969
3992
|
adjustLineHeightInTable?: true;
|
|
3993
|
+
/**
|
|
3994
|
+
* `w:doNotUseIndentAsNumberingTabStop` (§17.15.3): a hanging indent is not
|
|
3995
|
+
* an implicit tab stop for the tab that follows a list number.
|
|
3996
|
+
*/
|
|
3997
|
+
doNotUseIndentAsNumberingTabStop?: true;
|
|
3970
3998
|
/**
|
|
3971
3999
|
* `w:updateFields` (§17.15.1.93) — ask the consuming application to
|
|
3972
4000
|
* recompute every field when the document opens. Set by generators that
|
|
@@ -4004,6 +4032,11 @@ type DocumentSettings = {
|
|
|
4004
4032
|
};
|
|
4005
4033
|
/** Move a break-only paragraph mark onto the page after its hard page break. */
|
|
4006
4034
|
splitPageBreakAndParagraphMark?: boolean;
|
|
4035
|
+
/**
|
|
4036
|
+
* Document-wide endnote properties from `w:settings/w:endnotePr`
|
|
4037
|
+
* (§17.11.4): where endnotes are placed (`w:pos`) and how they are numbered.
|
|
4038
|
+
*/
|
|
4039
|
+
endnotePr?: EndnoteProperties;
|
|
4007
4040
|
};
|
|
4008
4041
|
/** DOCX package conformance classes. */
|
|
4009
4042
|
declare const DOCX_CONFORMANCE_CLASSES: Readonly<{
|
|
@@ -4072,4 +4105,4 @@ type Document = {
|
|
|
4072
4105
|
parseWarnings?: ParseWarning[];
|
|
4073
4106
|
};
|
|
4074
4107
|
//#endregion
|
|
4075
|
-
export {
|
|
4108
|
+
export { EndnotePosition as $, presetLineDashFrom as $n, paragraphNumberingSlots as $r, PreservedInline as $t, BlockContent as A, isSchemeColorValue as Ai, TableCellPropertyChange as An, TableCellFormatting as Ar, MoveBookmarkMarker as At, CommentReference as B, BorderStyleValue as Bi, TrackedChangeInfo as Bn, UnderlineStyle as Br, NoteReferenceContent as Bt, MAX_RETAINED_PARSE_WARNINGS_PER_CODE as C, BorderSpec as Ci, SimpleField as Cn, LineSpacingRule as Cr, InlineWrapper as Ct, ParseWarningLocation as D, THEME_COLOR_BY_SCHEME_COLOR_VALUE as Di, Table as Dn, TabStop as Dr, MAX_REVISION_ID as Dt, ParseWarningCode as E, SCHEME_COLOR_VALUE_BY_THEME_COLOR as Ei, TabContent as En, TabLeader as Er, LineNumberRestart as Et, BreakContent as F, themeColorToken as Fi, TableRowPropertyChange as Fn, TablePropertyExceptionFormatting as Fr, MoveToRangeEnd as Ft, DocumentBackground as G, isBorderNone as Gi, WrapDistanceSlots as Gn, ParagraphNumberingSlots as Gr, ParagraphContent as Gt, DRAWING_RAW_XML_MODES as H, borderStyleFrom as Hi, TrackedRunContent as Hn, NO_PARAGRAPH_NUMBERING as Hr, PROPERTY_REVISION_KINDS as Ht, Column as I, SchemeColorSlot as Ii, TableStructuralChangeInfo as In, TableRowFormatting as Ir, MoveToRangeStart as It, DrawingAnchor as J, BORDER_STYLES as Ji, isOoxmlSymbolCharacter as Jn, mergeParagraphNumbering as Jr, ParagraphPropertyChange as Jt, DocumentBackgroundDrawing as K, isBorderStyle as Ki, WrapDistances as Kn, ResolvedParagraphNumbering as Kr, ParagraphMarkChange as Kt, Comment as L, SchemeColorValue as Li, TextBox as Ln, TableWidthType as Lr, NoBreakHyphenContent as Lt, BookmarkEnd as M, knownThemeColor as Mi, TablePropertyChange as Mn, TableGridChange as Mr, MoveFromRangeEnd as Mt, BookmarkRangeMarker as N, readThemeColor as Ni, TablePropertyExceptionChange as Nn, TableLook as Nr, MoveFromRangeStart as Nt, BIDI_CONTROLS as O, ThemeColorValue as Oi, TableCell as On, TableBorders as Or, MarkupRangeMarker as Ot, BookmarkStart as P, themeColorSlot as Pi, TableRow as Pn, TableMeasurement as Pr, MoveTo as Pt, Endnote as Q, isPresetLineDashVal as Qn, paragraphNumberingReferenceId as Qr, PreservedBlock as Qt, CommentRangeEnd as R, THEME_COLORS as Ri, TextContent as Rn, TextEffect as Rr, NonVisualDrawingNames as Rt, ThemeFontScheme as S, TextDirectionFlow as Si, ShapeType as Sn, FloatingTableProperties as Sr, InlineSdt as St, ParseWarning as T, ShadingProperties as Ti, SymbolContent as Tn, SpacingExplicit as Tr, InstrTextContent as Tt, Deletion as U, borderStyleToken as Ui, VerticalAlign as Un, ParagraphNumberingOverride as Ur, PageOrientation as Ut, ComplexField as V, UnrecognisedBorderStyle as Vi, TrackedRunChange as Vn, NO_NUMBERING_NUM_ID as Vr, PARAGRAPH_MARK_CHANGE_KINDS as Vt, DisplacedByCustomXml as W, isBorderNil as Wi, Watermark as Wn, ParagraphNumberingReference as Wr, Paragraph as Wt, DrawingRawXmlMode as X, PresetLineDashValue as Xn, paragraphNumberingLevel as Xr, PositionalTab as Xt, DrawingContent as Y, BorderStyle as Yi, normalizeRevisionId as Yn, paragraphNumberingFromSlots as Yr, PictureWatermark as Yt, EffectExtentSlots as Z, UnrecognisedPresetLineDash as Zn, paragraphNumberingReference as Zr, PositionedBookmarkMarker as Zt, StyleDefinitions as _, TEXT_DIRECTION_FLOWS as _i, ShapeContent as _n, NumberingDefinitions as _r, ImagePosition as _t, DocxPackage as a, OutlineLevel as ai, ReviewCarrier as an, relationshipIdOf as ar, Footnote as at, ThemeColorScheme as b, TableAlignment as bi, ShapeOutline as bn, ConditionalFormatStyle as br, ImageWrap as bt, EmbeddedFontRef as c, outlineLevelFromStatedValue as ci, RunPropertyChange as cn, AbstractNumbering as cr, HeaderFooter as ct, FontTable as d, NumberFormat as di, SdtType as dn, LevelLegacy as dr, Hyperlink as dt, resolveParagraphNumbering as ei, PreservedXmlContent as en, presetLineDashToken as er, EndnoteProperties as et, MediaFile as f, PARAGRAPH_ALIGNMENTS as fi, Section as fn, LevelOverride as fr, Image as ft, Style as g, TEXT_DIRECTIONS as gi, Shape as gn, ListRendering as gr, ImagePadding as gt, RelationshipType as h, TAB_STOP_ALIGNMENTS as hi, SectionStart as hn, ListMarkerFormatting as hr, ImageFrameLocks as ht, DocxConformanceClass as i, HeadingOutlineLevel as ii, REVIEW_CARRIERS as in, mintRelationshipId as ir, FooterReference as it, BlockSdt as j, isThemeColor as ji, TablePreservedMarkup as jn, TableFormatting as jr, MoveFrom as jt, BidiControl as k, UnrecognisedThemeColor as ki, TableCellBlock as kn, TableCellBorders as kr, MathEquation as kt, FontCharset as l, outlineLevelStatedValue as li, SdtEndProperties as ln, COUNTER_FORMATS as lr, HeaderFooterType as lt, RelationshipMap as m, TABLE_ALIGNMENTS as mi, SectionPropertyChange as mn, ListLevel as mr, ImageDocPrLink as mt, Document as n, sameStatedParagraphNumbering as ni, PropertyChangeInfo as nn, PresetLineDashVal as nr, FieldCharContent as nt, ExhaustiveFields as o, headingLevelOf as oi, Run as on, PreviewDescriptor as or, FootnotePosition as ot, Relationship as p, ParagraphAlignment as pi, SectionProperties as pn, LevelSuffix as pr, ImageCrop as pt, DocumentBody as q, statesNoBorder as qi, WrapPolygonPoint as qn, isNumberingReference as qr, ParagraphMarkChangeKind as qt, DocumentSettings as r, BODY_TEXT_OUTLINE_LEVEL as ri, PropertyRevisionKind as rn, RelationshipId as rr, FieldType as rt, DocDefaults as s, headingOutlineLevel as si, RunContent as sn, PreviewShape as sr, FootnoteProperties as st, DOCX_CONFORMANCE_CLASSES as t, sameEffectiveParagraphNumbering as ti, PropertyChange as tn, PRESET_LINE_DASH_VALS as tr, Field as tt, FontInfo as u, NUMBER_FORMATS as ui, SdtProperties as un, CounterFormat as ur, HeaderReference as ut, StyleType as v, TEXT_DIRECTION_FLOW_BY_TOKEN as vi, ShapeFill as vn, NumberingInstance as vr, ImageSize as vt, PARSE_WARNING_CODES as w, ColorValue as wi, SoftHyphenContent as wn, ParagraphFormatting as wr, Insertion as wt, ThemeFont as x, TextDirection as xi, ShapeTextBody as xn, EmphasisMark as xr, ImageWrapPolygon as xt, Theme as y, TabStopAlignment as yi, ShapeGeometryAdjustment as yn, CellMargins as yr, ImageTransform as yt, CommentRangeStart as z, ThemeColor as zi, TextWatermark as zn, TextFormatting as zr, NoteNumberRestart as zt };
|
|
@@ -1104,6 +1104,10 @@ const COUNTER_FORMATS = [
|
|
|
1104
1104
|
const OOXML_SYMBOL_CHARACTER_PATTERN = /^[\dA-Fa-f]{4}$/u;
|
|
1105
1105
|
/** Whether a symbol character is exactly four hexadecimal digits. */
|
|
1106
1106
|
const isOoxmlSymbolCharacter = (value) => OOXML_SYMBOL_CHARACTER_PATTERN.test(value);
|
|
1107
|
+
/** IDs reserved for the separator records in footnotes.xml and endnotes.xml. */
|
|
1108
|
+
const RESERVED_NOTE_REFERENCE_IDS = [-1, 0];
|
|
1109
|
+
/** Whether an id can name a note from a body reference. */
|
|
1110
|
+
const isNoteReferenceId = (id) => RESERVED_NOTE_REFERENCE_IDS.every((reserved) => id !== reserved);
|
|
1107
1111
|
/** Raw XML handling modes for drawings that Folio cannot model completely. */
|
|
1108
1112
|
const DRAWING_RAW_XML_MODES = {
|
|
1109
1113
|
PRESERVE_ONLY: "preserveOnly",
|
|
@@ -1197,4 +1201,4 @@ const DOCX_CONFORMANCE_CLASSES = Object.freeze({
|
|
|
1197
1201
|
UNKNOWN: "unknown"
|
|
1198
1202
|
});
|
|
1199
1203
|
//#endregion
|
|
1200
|
-
export {
|
|
1204
|
+
export { paragraphNumberingReferenceId as $, SCHEME_COLOR_VALUE_BY_THEME_COLOR as A, relationshipIdOf as B, NUMBER_FORMATS as C, TEXT_DIRECTIONS as D, TAB_STOP_ALIGNMENTS as E, readThemeColor as F, outlineLevelStatedValue as G, headingLevelOf as H, themeColorSlot as I, isNumberingReference as J, NO_NUMBERING_NUM_ID as K, themeColorToken as L, isSchemeColorValue as M, isThemeColor as N, TEXT_DIRECTION_FLOWS as O, knownThemeColor as P, paragraphNumberingReference as Q, THEME_COLORS as R, BORDER_STYLES as S, TABLE_ALIGNMENTS as T, headingOutlineLevel as U, BODY_TEXT_OUTLINE_LEVEL as V, outlineLevelFromStatedValue as W, paragraphNumberingFromSlots as X, mergeParagraphNumbering as Y, paragraphNumberingLevel as Z, borderStyleToken as _, PARAGRAPH_MARK_CHANGE_KINDS as a, PARSE_WARNING_CODES as at, isBorderStyle as b, isNoteReferenceId as c, COUNTER_FORMATS as d, paragraphNumberingSlots as et, isPresetLineDashVal as f, borderStyleFrom as g, PRESET_LINE_DASH_VALS as h, MAX_REVISION_ID as i, MAX_RETAINED_PARSE_WARNINGS_PER_CODE as it, THEME_COLOR_BY_SCHEME_COLOR_VALUE as j, TEXT_DIRECTION_FLOW_BY_TOKEN as k, isOoxmlSymbolCharacter as l, presetLineDashToken as m, BIDI_CONTROLS as n, sameEffectiveParagraphNumbering as nt, PROPERTY_REVISION_KINDS as o, presetLineDashFrom as p, NO_PARAGRAPH_NUMBERING as q, DRAWING_RAW_XML_MODES as r, sameStatedParagraphNumbering as rt, REVIEW_CARRIERS as s, DOCX_CONFORMANCE_CLASSES as t, resolveParagraphNumbering as tt, normalizeRevisionId as u, isBorderNil as v, PARAGRAPH_ALIGNMENTS as w, statesNoBorder as x, isBorderNone as y, mintRelationshipId as z };
|
package/dist/docx_kernel_bg.wasm
CHANGED
|
Binary file
|
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { A as BlockContent,
|
|
1
|
+
import { A as BlockContent, Dn as Table, F as BreakContent, G as DocumentBackground, Gt as ParagraphContent, K as DocumentBackgroundDrawing, On as TableCell, Pn as TableRow, Rn as TextContent, Wt as Paragraph, Xt as PositionalTab, _r as NumberingDefinitions, a as DocxPackage, g as Style, i as DocxConformanceClass, n as Document, on as Run, pn as SectionProperties, q as DocumentBody, sn as RunContent, t as DOCX_CONFORMANCE_CLASSES } from "./document-BA86X0Ma.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";
|
|
@@ -307,4 +307,4 @@ declare const validateDocxPackage: (buffer: ArrayBuffer | Uint8Array) => Promise
|
|
|
307
307
|
declare const validateDocumentModel: (document: Document) => ValidateDocumentModelResult;
|
|
308
308
|
declare const assertValidDocumentModel: (document: Document) => void;
|
|
309
309
|
//#endregion
|
|
310
|
-
export { type Autofix, type BlockContent, type BreakContent, type CompiledLegalDocument, DOCX_CONFORMANCE_CLASSES, DOCX_PACKAGE_ISSUE_CODES, type Document, type DocumentBody, type DocxConformanceClass, type DocxPackage, type DocxPackageIssueCode, type LegalDraft, type LegalDraftBlock, type LegalDraftDiagnostic, type LegalSourceCompileOptions, type LegalSourceCompileResult, type LegalSourceDocxCompileResult, type LegalSourceParseResult, type MarkdownContent, 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, compileMarkdownToContent, escapeXmlAttribute, escapeXmlText, hasIllegalXmlCharacters, parseLegalSource, pushOnOffElement, requiresXmlSpacePreserve, sanitizeExternalUrl, sanitizeXmlCharacters, serializeDocumentToDocx, serializeOnOffElement, validateDocumentModel, validateDocxPackage, validateLegalDraft };
|
|
310
|
+
export { type Autofix, type BlockContent, type BreakContent, type CompiledLegalDocument, DOCX_CONFORMANCE_CLASSES, DOCX_PACKAGE_ISSUE_CODES, type Document, type DocumentBackground, type DocumentBackgroundDrawing, type DocumentBody, type DocxConformanceClass, type DocxPackage, type DocxPackageIssueCode, type LegalDraft, type LegalDraftBlock, type LegalDraftDiagnostic, type LegalSourceCompileOptions, type LegalSourceCompileResult, type LegalSourceDocxCompileResult, type LegalSourceParseResult, type MarkdownContent, 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, compileMarkdownToContent, escapeXmlAttribute, escapeXmlText, hasIllegalXmlCharacters, parseLegalSource, pushOnOffElement, requiresXmlSpacePreserve, sanitizeExternalUrl, sanitizeXmlCharacters, serializeDocumentToDocx, serializeOnOffElement, validateDocumentModel, validateDocxPackage, validateLegalDraft };
|
package/dist/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { $ as
|
|
2
|
-
import { i as serializeSequenceChildren } from "./sequenceChildren-
|
|
1
|
+
import { $ as paragraphNumberingReferenceId, Q as paragraphNumberingReference, U as headingOutlineLevel, Z as paragraphNumberingLevel, _ as borderStyleToken, c as isNoteReferenceId, et as paragraphNumberingSlots, l as isOoxmlSymbolCharacter, t as DOCX_CONFORMANCE_CLASSES, x as statesNoBorder } from "./document-Bz9rYlJI.js";
|
|
2
|
+
import { i as serializeSequenceChildren } from "./sequenceChildren-BIixCB49.js";
|
|
3
3
|
import { panic } from "better-result";
|
|
4
4
|
import JSZip from "jszip";
|
|
5
5
|
import { XMLParser, XMLValidator } from "fast-xml-parser";
|
|
@@ -1035,7 +1035,13 @@ const validateNoteCollection = ({ refs, notes, path, label, ctx }) => {
|
|
|
1035
1035
|
ids.add(note.id);
|
|
1036
1036
|
validateBlocks(note.content, `${path}[${index}].content`, ctx);
|
|
1037
1037
|
}
|
|
1038
|
-
for (const [id, paths] of refs.entries())
|
|
1038
|
+
for (const [id, paths] of refs.entries()) {
|
|
1039
|
+
if (!isNoteReferenceId(id)) {
|
|
1040
|
+
addError(ctx, paths.at(0) ?? path, `${label} id ${id} is reserved for a note-part separator and cannot be referenced.`);
|
|
1041
|
+
continue;
|
|
1042
|
+
}
|
|
1043
|
+
if (!ids.has(id)) addError(ctx, paths.at(0) ?? path, `${label} ${id} is referenced but not present in the package.`);
|
|
1044
|
+
}
|
|
1039
1045
|
};
|
|
1040
1046
|
const validateMedia = (document, ctx) => {
|
|
1041
1047
|
const media = document.package.media;
|
package/dist/model/document.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { $ as
|
|
1
|
+
import { $ as EndnotePosition, $n as presetLineDashFrom, $r as paragraphNumberingSlots, $t as PreservedInline, A as BlockContent, Ai as isSchemeColorValue, An as TableCellPropertyChange, Ar as TableCellFormatting, At as MoveBookmarkMarker, B as CommentReference, Bi as BorderStyleValue, Bn as TrackedChangeInfo, Br as UnderlineStyle, Bt as NoteReferenceContent, C as MAX_RETAINED_PARSE_WARNINGS_PER_CODE, Ci as BorderSpec, Cn as SimpleField, Cr as LineSpacingRule, Ct as InlineWrapper, D as ParseWarningLocation, Di as THEME_COLOR_BY_SCHEME_COLOR_VALUE, Dn as Table, Dr as TabStop, Dt as MAX_REVISION_ID, E as ParseWarningCode, Ei as SCHEME_COLOR_VALUE_BY_THEME_COLOR, En as TabContent, Er as TabLeader, Et as LineNumberRestart, F as BreakContent, Fi as themeColorToken, Fn as TableRowPropertyChange, Fr as TablePropertyExceptionFormatting, Ft as MoveToRangeEnd, G as DocumentBackground, Gi as isBorderNone, Gn as WrapDistanceSlots, Gr as ParagraphNumberingSlots, Gt as ParagraphContent, H as DRAWING_RAW_XML_MODES, Hi as borderStyleFrom, Hn as TrackedRunContent, Hr as NO_PARAGRAPH_NUMBERING, Ht as PROPERTY_REVISION_KINDS, I as Column, Ii as SchemeColorSlot, In as TableStructuralChangeInfo, Ir as TableRowFormatting, It as MoveToRangeStart, J as DrawingAnchor, Ji as BORDER_STYLES, Jn as isOoxmlSymbolCharacter, Jr as mergeParagraphNumbering, Jt as ParagraphPropertyChange, K as DocumentBackgroundDrawing, Ki as isBorderStyle, Kn as WrapDistances, Kr as ResolvedParagraphNumbering, Kt as ParagraphMarkChange, L as Comment, Li as SchemeColorValue, Ln as TextBox, Lr as TableWidthType, Lt as NoBreakHyphenContent, M as BookmarkEnd, Mi as knownThemeColor, Mn as TablePropertyChange, Mr as TableGridChange, Mt as MoveFromRangeEnd, N as BookmarkRangeMarker, Ni as readThemeColor, Nn as TablePropertyExceptionChange, Nr as TableLook, Nt as MoveFromRangeStart, O as BIDI_CONTROLS, Oi as ThemeColorValue, On as TableCell, Or as TableBorders, Ot as MarkupRangeMarker, P as BookmarkStart, Pi as themeColorSlot, Pn as TableRow, Pr as TableMeasurement, Pt as MoveTo, Q as Endnote, Qn as isPresetLineDashVal, Qr as paragraphNumberingReferenceId, Qt as PreservedBlock, R as CommentRangeEnd, Ri as THEME_COLORS, Rn as TextContent, Rr as TextEffect, Rt as NonVisualDrawingNames, S as ThemeFontScheme, Si as TextDirectionFlow, Sn as ShapeType, Sr as FloatingTableProperties, St as InlineSdt, T as ParseWarning, Ti as ShadingProperties, Tn as SymbolContent, Tr as SpacingExplicit, Tt as InstrTextContent, U as Deletion, Ui as borderStyleToken, Un as VerticalAlign, Ur as ParagraphNumberingOverride, Ut as PageOrientation, V as ComplexField, Vi as UnrecognisedBorderStyle, Vn as TrackedRunChange, Vr as NO_NUMBERING_NUM_ID, Vt as PARAGRAPH_MARK_CHANGE_KINDS, W as DisplacedByCustomXml, Wi as isBorderNil, Wn as Watermark, Wr as ParagraphNumberingReference, Wt as Paragraph, X as DrawingRawXmlMode, Xn as PresetLineDashValue, Xr as paragraphNumberingLevel, Xt as PositionalTab, Y as DrawingContent, Yi as BorderStyle, Yn as normalizeRevisionId, Yr as paragraphNumberingFromSlots, Yt as PictureWatermark, Z as EffectExtentSlots, Zn as UnrecognisedPresetLineDash, Zr as paragraphNumberingReference, Zt as PositionedBookmarkMarker, _ as StyleDefinitions, _i as TEXT_DIRECTION_FLOWS, _n as ShapeContent, _r as NumberingDefinitions, _t as ImagePosition, a as DocxPackage, ai as OutlineLevel, an as ReviewCarrier, ar as relationshipIdOf, at as Footnote, b as ThemeColorScheme, bi as TableAlignment, bn as ShapeOutline, br as ConditionalFormatStyle, bt as ImageWrap, c as EmbeddedFontRef, ci as outlineLevelFromStatedValue, cn as RunPropertyChange, cr as AbstractNumbering, ct as HeaderFooter, d as FontTable, di as NumberFormat, dn as SdtType, dr as LevelLegacy, dt as Hyperlink, ei as resolveParagraphNumbering, en as PreservedXmlContent, er as presetLineDashToken, et as EndnoteProperties, f as MediaFile, fi as PARAGRAPH_ALIGNMENTS, fn as Section, fr as LevelOverride, ft as Image, g as Style, gi as TEXT_DIRECTIONS, gn as Shape, gr as ListRendering, gt as ImagePadding, h as RelationshipType, hi as TAB_STOP_ALIGNMENTS, hn as SectionStart, hr as ListMarkerFormatting, ht as ImageFrameLocks, i as DocxConformanceClass, ii as HeadingOutlineLevel, in as REVIEW_CARRIERS, ir as mintRelationshipId, it as FooterReference, j as BlockSdt, ji as isThemeColor, jn as TablePreservedMarkup, jr as TableFormatting, jt as MoveFrom, k as BidiControl, ki as UnrecognisedThemeColor, kn as TableCellBlock, kr as TableCellBorders, kt as MathEquation, l as FontCharset, li as outlineLevelStatedValue, ln as SdtEndProperties, lr as COUNTER_FORMATS, lt as HeaderFooterType, m as RelationshipMap, mi as TABLE_ALIGNMENTS, mn as SectionPropertyChange, mr as ListLevel, mt as ImageDocPrLink, n as Document, ni as sameStatedParagraphNumbering, nn as PropertyChangeInfo, nr as PresetLineDashVal, nt as FieldCharContent, o as ExhaustiveFields, oi as headingLevelOf, on as Run, or as PreviewDescriptor, ot as FootnotePosition, p as Relationship, pi as ParagraphAlignment, pn as SectionProperties, pr as LevelSuffix, pt as ImageCrop, q as DocumentBody, qi as statesNoBorder, qn as WrapPolygonPoint, qr as isNumberingReference, qt as ParagraphMarkChangeKind, r as DocumentSettings, ri as BODY_TEXT_OUTLINE_LEVEL, rn as PropertyRevisionKind, rr as RelationshipId, rt as FieldType, s as DocDefaults, si as headingOutlineLevel, sn as RunContent, sr as PreviewShape, st as FootnoteProperties, t as DOCX_CONFORMANCE_CLASSES, ti as sameEffectiveParagraphNumbering, tn as PropertyChange, tr as PRESET_LINE_DASH_VALS, tt as Field, u as FontInfo, ui as NUMBER_FORMATS, un as SdtProperties, ur as CounterFormat, ut as HeaderReference, v as StyleType, vi as TEXT_DIRECTION_FLOW_BY_TOKEN, vn as ShapeFill, vr as NumberingInstance, vt as ImageSize, w as PARSE_WARNING_CODES, wi as ColorValue, wn as SoftHyphenContent, wr as ParagraphFormatting, wt as Insertion, x as ThemeFont, xi as TextDirection, xn as ShapeTextBody, xr as EmphasisMark, xt as ImageWrapPolygon, y as Theme, yi as TabStopAlignment, yn as ShapeGeometryAdjustment, yr as CellMargins, yt as ImageTransform, z as CommentRangeStart, zi as ThemeColor, zn as TextWatermark, zr as TextFormatting, zt as NoteNumberRestart } from "../document-BA86X0Ma.js";
|
|
2
2
|
import { n as PreservedChild, r as PreservedMarkup, t as PreservedAttribute } from "../preservedMarkup-G8XjWhs2.js";
|
|
3
|
-
export { type AbstractNumbering, BIDI_CONTROLS, BODY_TEXT_OUTLINE_LEVEL, BORDER_STYLES, type BidiControl, type BlockContent, type BlockSdt, type BookmarkEnd, type BookmarkRangeMarker, type BookmarkStart, type BorderSpec, type BorderStyle, type BorderStyleValue, type BreakContent, COUNTER_FORMATS, type CellMargins, type ColorValue, type Column, type Comment, type CommentRangeEnd, type CommentRangeStart, type CommentReference, type ComplexField, type ConditionalFormatStyle, type CounterFormat, DOCX_CONFORMANCE_CLASSES, DRAWING_RAW_XML_MODES, type Deletion, type DisplacedByCustomXml, type DocDefaults, Document, type DocumentBody, DocumentSettings, DocxConformanceClass, DocxPackage, type DrawingAnchor, type DrawingContent, type DrawingRawXmlMode, type EffectExtentSlots, type EmbeddedFontRef, type EmphasisMark, type Endnote, type EndnotePosition, type EndnoteProperties, type ExhaustiveFields, type Field, type FieldCharContent, type FieldType, type FloatingTableProperties, type FontCharset, type FontInfo, type FontTable, type FooterReference, type Footnote, type FootnotePosition, type FootnoteProperties, type HeaderFooter, type HeaderFooterType, type HeaderReference, type HeadingOutlineLevel, type Hyperlink, type Image, type ImageCrop, type ImageDocPrLink, type ImageFrameLocks, type ImagePadding, type ImagePosition, type ImageSize, type ImageTransform, type ImageWrap, type ImageWrapPolygon, type InlineSdt, type InlineWrapper, type Insertion, type InstrTextContent, type LevelLegacy, type LevelOverride, type LevelSuffix, type LineNumberRestart, type LineSpacingRule, type ListLevel, type ListMarkerFormatting, type ListRendering, MAX_RETAINED_PARSE_WARNINGS_PER_CODE, MAX_REVISION_ID, type MarkupRangeMarker, type MathEquation, type MediaFile, type MoveBookmarkMarker, type MoveFrom, type MoveFromRangeEnd, type MoveFromRangeStart, type MoveTo, type MoveToRangeEnd, type MoveToRangeStart, NO_NUMBERING_NUM_ID, NO_PARAGRAPH_NUMBERING, NUMBER_FORMATS, type NoBreakHyphenContent, type NonVisualDrawingNames, type NoteNumberRestart, type NoteReferenceContent, type NumberFormat, type NumberingDefinitions, type NumberingInstance, type OutlineLevel, PARAGRAPH_ALIGNMENTS, PARAGRAPH_MARK_CHANGE_KINDS, PARSE_WARNING_CODES, PRESET_LINE_DASH_VALS, PROPERTY_REVISION_KINDS, type PageOrientation, type Paragraph, type ParagraphAlignment, type ParagraphContent, type ParagraphFormatting, type ParagraphMarkChange, type ParagraphMarkChangeKind, type ParagraphNumberingOverride, type ParagraphNumberingReference, type ParagraphNumberingSlots, type ParagraphPropertyChange, type ParseWarning, type ParseWarningCode, type ParseWarningLocation, type PictureWatermark, type PositionalTab, type PositionedBookmarkMarker, type PreservedAttribute, type PreservedBlock, type PreservedChild, type PreservedInline, type PreservedMarkup, type PreservedXmlContent, type PresetLineDashVal, type PresetLineDashValue, type PreviewDescriptor, type PreviewShape, type PropertyChange, type PropertyChangeInfo, type PropertyRevisionKind, REVIEW_CARRIERS, type Relationship, type RelationshipId, type RelationshipMap, type RelationshipType, type ResolvedParagraphNumbering, type ReviewCarrier, type Run, type RunContent, type RunPropertyChange, SCHEME_COLOR_VALUE_BY_THEME_COLOR, type SchemeColorSlot, type SchemeColorValue, type SdtEndProperties, type SdtProperties, type SdtType, type Section, type SectionProperties, type SectionPropertyChange, type SectionStart, type ShadingProperties, type Shape, type ShapeContent, type ShapeFill, type ShapeGeometryAdjustment, type ShapeOutline, type ShapeTextBody, type ShapeType, type SimpleField, type SoftHyphenContent, type SpacingExplicit, type Style, type StyleDefinitions, type StyleType, type SymbolContent, TABLE_ALIGNMENTS, TAB_STOP_ALIGNMENTS, TEXT_DIRECTIONS, TEXT_DIRECTION_FLOWS, TEXT_DIRECTION_FLOW_BY_TOKEN, THEME_COLORS, THEME_COLOR_BY_SCHEME_COLOR_VALUE, type TabContent, type TabLeader, type TabStop, type TabStopAlignment, type Table, type TableAlignment, type TableBorders, type TableCell, type TableCellBlock, type TableCellBorders, type TableCellFormatting, type TableCellPropertyChange, type TableFormatting, type TableGridChange, type TableLook, type TableMeasurement, type TablePreservedMarkup, type TablePropertyChange, type TablePropertyExceptionChange, type TablePropertyExceptionFormatting, type TableRow, type TableRowFormatting, type TableRowPropertyChange, type TableStructuralChangeInfo, type TableWidthType, type TextBox, type TextContent, type TextDirection, type TextDirectionFlow, type TextEffect, type TextFormatting, type TextWatermark, type Theme, type ThemeColor, type ThemeColorScheme, type ThemeColorValue, type ThemeFont, type ThemeFontScheme, type TrackedChangeInfo, type TrackedRunChange, type TrackedRunContent, type UnderlineStyle, type UnrecognisedBorderStyle, type UnrecognisedPresetLineDash, type UnrecognisedThemeColor, type VerticalAlign, type Watermark, type WrapDistanceSlots, type WrapDistances, type WrapPolygonPoint, borderStyleFrom, borderStyleToken, headingLevelOf, headingOutlineLevel, isBorderNil, isBorderNone, isBorderStyle, isNumberingReference, isOoxmlSymbolCharacter, isPresetLineDashVal, isSchemeColorValue, isThemeColor, knownThemeColor, mergeParagraphNumbering, mintRelationshipId, normalizeRevisionId, outlineLevelFromStatedValue, outlineLevelStatedValue, paragraphNumberingFromSlots, paragraphNumberingLevel, paragraphNumberingReference, paragraphNumberingReferenceId, paragraphNumberingSlots, presetLineDashFrom, presetLineDashToken, readThemeColor, relationshipIdOf, resolveParagraphNumbering, sameEffectiveParagraphNumbering, sameStatedParagraphNumbering, statesNoBorder, themeColorSlot, themeColorToken };
|
|
3
|
+
export { type AbstractNumbering, BIDI_CONTROLS, BODY_TEXT_OUTLINE_LEVEL, BORDER_STYLES, type BidiControl, type BlockContent, type BlockSdt, type BookmarkEnd, type BookmarkRangeMarker, type BookmarkStart, type BorderSpec, type BorderStyle, type BorderStyleValue, type BreakContent, COUNTER_FORMATS, type CellMargins, type ColorValue, type Column, type Comment, type CommentRangeEnd, type CommentRangeStart, type CommentReference, type ComplexField, type ConditionalFormatStyle, type CounterFormat, DOCX_CONFORMANCE_CLASSES, DRAWING_RAW_XML_MODES, type Deletion, type DisplacedByCustomXml, type DocDefaults, Document, type DocumentBackground, type DocumentBackgroundDrawing, type DocumentBody, DocumentSettings, DocxConformanceClass, DocxPackage, type DrawingAnchor, type DrawingContent, type DrawingRawXmlMode, type EffectExtentSlots, type EmbeddedFontRef, type EmphasisMark, type Endnote, type EndnotePosition, type EndnoteProperties, type ExhaustiveFields, type Field, type FieldCharContent, type FieldType, type FloatingTableProperties, type FontCharset, type FontInfo, type FontTable, type FooterReference, type Footnote, type FootnotePosition, type FootnoteProperties, type HeaderFooter, type HeaderFooterType, type HeaderReference, type HeadingOutlineLevel, type Hyperlink, type Image, type ImageCrop, type ImageDocPrLink, type ImageFrameLocks, type ImagePadding, type ImagePosition, type ImageSize, type ImageTransform, type ImageWrap, type ImageWrapPolygon, type InlineSdt, type InlineWrapper, type Insertion, type InstrTextContent, type LevelLegacy, type LevelOverride, type LevelSuffix, type LineNumberRestart, type LineSpacingRule, type ListLevel, type ListMarkerFormatting, type ListRendering, MAX_RETAINED_PARSE_WARNINGS_PER_CODE, MAX_REVISION_ID, type MarkupRangeMarker, type MathEquation, type MediaFile, type MoveBookmarkMarker, type MoveFrom, type MoveFromRangeEnd, type MoveFromRangeStart, type MoveTo, type MoveToRangeEnd, type MoveToRangeStart, NO_NUMBERING_NUM_ID, NO_PARAGRAPH_NUMBERING, NUMBER_FORMATS, type NoBreakHyphenContent, type NonVisualDrawingNames, type NoteNumberRestart, type NoteReferenceContent, type NumberFormat, type NumberingDefinitions, type NumberingInstance, type OutlineLevel, PARAGRAPH_ALIGNMENTS, PARAGRAPH_MARK_CHANGE_KINDS, PARSE_WARNING_CODES, PRESET_LINE_DASH_VALS, PROPERTY_REVISION_KINDS, type PageOrientation, type Paragraph, type ParagraphAlignment, type ParagraphContent, type ParagraphFormatting, type ParagraphMarkChange, type ParagraphMarkChangeKind, type ParagraphNumberingOverride, type ParagraphNumberingReference, type ParagraphNumberingSlots, type ParagraphPropertyChange, type ParseWarning, type ParseWarningCode, type ParseWarningLocation, type PictureWatermark, type PositionalTab, type PositionedBookmarkMarker, type PreservedAttribute, type PreservedBlock, type PreservedChild, type PreservedInline, type PreservedMarkup, type PreservedXmlContent, type PresetLineDashVal, type PresetLineDashValue, type PreviewDescriptor, type PreviewShape, type PropertyChange, type PropertyChangeInfo, type PropertyRevisionKind, REVIEW_CARRIERS, type Relationship, type RelationshipId, type RelationshipMap, type RelationshipType, type ResolvedParagraphNumbering, type ReviewCarrier, type Run, type RunContent, type RunPropertyChange, SCHEME_COLOR_VALUE_BY_THEME_COLOR, type SchemeColorSlot, type SchemeColorValue, type SdtEndProperties, type SdtProperties, type SdtType, type Section, type SectionProperties, type SectionPropertyChange, type SectionStart, type ShadingProperties, type Shape, type ShapeContent, type ShapeFill, type ShapeGeometryAdjustment, type ShapeOutline, type ShapeTextBody, type ShapeType, type SimpleField, type SoftHyphenContent, type SpacingExplicit, type Style, type StyleDefinitions, type StyleType, type SymbolContent, TABLE_ALIGNMENTS, TAB_STOP_ALIGNMENTS, TEXT_DIRECTIONS, TEXT_DIRECTION_FLOWS, TEXT_DIRECTION_FLOW_BY_TOKEN, THEME_COLORS, THEME_COLOR_BY_SCHEME_COLOR_VALUE, type TabContent, type TabLeader, type TabStop, type TabStopAlignment, type Table, type TableAlignment, type TableBorders, type TableCell, type TableCellBlock, type TableCellBorders, type TableCellFormatting, type TableCellPropertyChange, type TableFormatting, type TableGridChange, type TableLook, type TableMeasurement, type TablePreservedMarkup, type TablePropertyChange, type TablePropertyExceptionChange, type TablePropertyExceptionFormatting, type TableRow, type TableRowFormatting, type TableRowPropertyChange, type TableStructuralChangeInfo, type TableWidthType, type TextBox, type TextContent, type TextDirection, type TextDirectionFlow, type TextEffect, type TextFormatting, type TextWatermark, type Theme, type ThemeColor, type ThemeColorScheme, type ThemeColorValue, type ThemeFont, type ThemeFontScheme, type TrackedChangeInfo, type TrackedRunChange, type TrackedRunContent, type UnderlineStyle, type UnrecognisedBorderStyle, type UnrecognisedPresetLineDash, type UnrecognisedThemeColor, type VerticalAlign, type Watermark, type WrapDistanceSlots, type WrapDistances, type WrapPolygonPoint, borderStyleFrom, borderStyleToken, headingLevelOf, headingOutlineLevel, isBorderNil, isBorderNone, isBorderStyle, isNumberingReference, isOoxmlSymbolCharacter, isPresetLineDashVal, isSchemeColorValue, isThemeColor, knownThemeColor, mergeParagraphNumbering, mintRelationshipId, normalizeRevisionId, outlineLevelFromStatedValue, outlineLevelStatedValue, paragraphNumberingFromSlots, paragraphNumberingLevel, paragraphNumberingReference, paragraphNumberingReferenceId, paragraphNumberingSlots, presetLineDashFrom, presetLineDashToken, readThemeColor, relationshipIdOf, resolveParagraphNumbering, sameEffectiveParagraphNumbering, sameStatedParagraphNumbering, statesNoBorder, themeColorSlot, themeColorToken };
|
package/dist/model/document.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { $ as
|
|
1
|
+
import { $ as paragraphNumberingReferenceId, A as SCHEME_COLOR_VALUE_BY_THEME_COLOR, B as relationshipIdOf, C as NUMBER_FORMATS, D as TEXT_DIRECTIONS, E as TAB_STOP_ALIGNMENTS, F as readThemeColor, G as outlineLevelStatedValue, H as headingLevelOf, I as themeColorSlot, J as isNumberingReference, K as NO_NUMBERING_NUM_ID, L as themeColorToken, M as isSchemeColorValue, N as isThemeColor, O as TEXT_DIRECTION_FLOWS, P as knownThemeColor, Q as paragraphNumberingReference, R as THEME_COLORS, S as BORDER_STYLES, T as TABLE_ALIGNMENTS, U as headingOutlineLevel, V as BODY_TEXT_OUTLINE_LEVEL, W as outlineLevelFromStatedValue, X as paragraphNumberingFromSlots, Y as mergeParagraphNumbering, Z as paragraphNumberingLevel, _ as borderStyleToken, a as PARAGRAPH_MARK_CHANGE_KINDS, at as PARSE_WARNING_CODES, b as isBorderStyle, d as COUNTER_FORMATS, et as paragraphNumberingSlots, f as isPresetLineDashVal, g as borderStyleFrom, h as PRESET_LINE_DASH_VALS, i as MAX_REVISION_ID, it as MAX_RETAINED_PARSE_WARNINGS_PER_CODE, j as THEME_COLOR_BY_SCHEME_COLOR_VALUE, k as TEXT_DIRECTION_FLOW_BY_TOKEN, l as isOoxmlSymbolCharacter, m as presetLineDashToken, n as BIDI_CONTROLS, nt as sameEffectiveParagraphNumbering, o as PROPERTY_REVISION_KINDS, p as presetLineDashFrom, q as NO_PARAGRAPH_NUMBERING, r as DRAWING_RAW_XML_MODES, rt as sameStatedParagraphNumbering, s as REVIEW_CARRIERS, t as DOCX_CONFORMANCE_CLASSES, tt as resolveParagraphNumbering, u as normalizeRevisionId, v as isBorderNil, w as PARAGRAPH_ALIGNMENTS, x as statesNoBorder, y as isBorderNone, z as mintRelationshipId } from "../document-Bz9rYlJI.js";
|
|
2
2
|
export { BIDI_CONTROLS, BODY_TEXT_OUTLINE_LEVEL, BORDER_STYLES, COUNTER_FORMATS, DOCX_CONFORMANCE_CLASSES, DRAWING_RAW_XML_MODES, MAX_RETAINED_PARSE_WARNINGS_PER_CODE, MAX_REVISION_ID, NO_NUMBERING_NUM_ID, NO_PARAGRAPH_NUMBERING, NUMBER_FORMATS, PARAGRAPH_ALIGNMENTS, PARAGRAPH_MARK_CHANGE_KINDS, PARSE_WARNING_CODES, PRESET_LINE_DASH_VALS, PROPERTY_REVISION_KINDS, REVIEW_CARRIERS, SCHEME_COLOR_VALUE_BY_THEME_COLOR, TABLE_ALIGNMENTS, TAB_STOP_ALIGNMENTS, TEXT_DIRECTIONS, TEXT_DIRECTION_FLOWS, TEXT_DIRECTION_FLOW_BY_TOKEN, THEME_COLORS, THEME_COLOR_BY_SCHEME_COLOR_VALUE, borderStyleFrom, borderStyleToken, headingLevelOf, headingOutlineLevel, isBorderNil, isBorderNone, isBorderStyle, isNumberingReference, isOoxmlSymbolCharacter, isPresetLineDashVal, isSchemeColorValue, isThemeColor, knownThemeColor, mergeParagraphNumbering, mintRelationshipId, normalizeRevisionId, outlineLevelFromStatedValue, outlineLevelStatedValue, paragraphNumberingFromSlots, paragraphNumberingLevel, paragraphNumberingReference, paragraphNumberingReferenceId, paragraphNumberingSlots, presetLineDashFrom, presetLineDashToken, readThemeColor, relationshipIdOf, resolveParagraphNumbering, sameEffectiveParagraphNumbering, sameStatedParagraphNumbering, statesNoBorder, themeColorSlot, themeColorToken };
|
|
@@ -58,7 +58,7 @@ type SerializeSequenceChildrenOptions<Container extends SequenceContainer> = {
|
|
|
58
58
|
/** Whether a captured child is exactly one bounded, well-formed XML element. */
|
|
59
59
|
declare const isSafePreservedChildXml: (xml: string) => boolean;
|
|
60
60
|
/** Whether a capture collection stays within its aggregate resource budget. */
|
|
61
|
-
declare const isWithinPreservedMarkupBudget: (children:
|
|
61
|
+
declare const isWithinPreservedMarkupBudget: (children: Iterable<unknown>) => boolean;
|
|
62
62
|
/** Reject unsafe captured children before a caller performs any transformation. */
|
|
63
63
|
declare const assertSafePreservedMarkup: (preserved: PreservedMarkup | undefined) => void;
|
|
64
64
|
/**
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as SEQUENCE_CHILDREN, i as serializeSequenceChildren, n as isSafePreservedChildXml, r as isWithinPreservedMarkupBudget, t as assertSafePreservedMarkup } from "../sequenceChildren-
|
|
1
|
+
import { a as SEQUENCE_CHILDREN, i as serializeSequenceChildren, n as isSafePreservedChildXml, r as isWithinPreservedMarkupBudget, t as assertSafePreservedMarkup } from "../sequenceChildren-BIixCB49.js";
|
|
2
2
|
export { SEQUENCE_CHILDREN, assertSafePreservedMarkup, isSafePreservedChildXml, isWithinPreservedMarkupBudget, serializeSequenceChildren };
|
|
@@ -410,9 +410,11 @@ const isSafePreservedChildXml = (xml) => {
|
|
|
410
410
|
};
|
|
411
411
|
/** Whether a capture collection stays within its aggregate resource budget. */
|
|
412
412
|
const isWithinPreservedMarkupBudget = (children) => {
|
|
413
|
-
|
|
413
|
+
let count = 0;
|
|
414
414
|
let characters = 0;
|
|
415
415
|
for (const child of children) {
|
|
416
|
+
count += 1;
|
|
417
|
+
if (count > MAX_PRESERVED_CHILD_COUNT) return false;
|
|
416
418
|
if (!isRecord(child)) continue;
|
|
417
419
|
const xml = child["xml"];
|
|
418
420
|
if (typeof xml !== "string") continue;
|
package/package.json
CHANGED