@stll/docx-core 0.25.1 → 0.25.3
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-DJuN_2kr.js → document-Bz9rYlJI.js} +5 -1
- package/dist/{document-F2xMRFVZ.d.ts → document-Cy1Dd6UE.d.ts} +45 -19
- 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
|
@@ -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 };
|
|
@@ -760,6 +760,14 @@ type ParagraphFormatting = {
|
|
|
760
760
|
* it travels as markup rather than as a parsed shape.
|
|
761
761
|
*/
|
|
762
762
|
numberingChangeXml?: string;
|
|
763
|
+
/**
|
|
764
|
+
* The `w:ins` revision record inside the paragraph's `w:numPr`, verbatim.
|
|
765
|
+
*
|
|
766
|
+
* It records who inserted the numbering properties and when. Nothing in the
|
|
767
|
+
* editable model derives it, so it travels as markup beside the historical
|
|
768
|
+
* numbering-change snapshot.
|
|
769
|
+
*/
|
|
770
|
+
numberingInsertionXml?: string;
|
|
763
771
|
/**
|
|
764
772
|
* The stated `w:outlineLvl` (17.3.1.20). Absent means the paragraph states
|
|
765
773
|
* none and inherits one; {@link OutlineLevel} carries the rest, so the
|
|
@@ -2329,15 +2337,7 @@ type TableCell = {
|
|
|
2329
2337
|
propertyChanges?: TableCellPropertyChange[];
|
|
2330
2338
|
/** Tracked structural changes (cell insert/delete/merge) */
|
|
2331
2339
|
structuralChange?: TableStructuralChangeInfo;
|
|
2332
|
-
/**
|
|
2333
|
-
* Cell content.
|
|
2334
|
-
*
|
|
2335
|
-
* Derived from {@link BlockContent} rather than listed, so a new block kind
|
|
2336
|
-
* cannot land without a decision here; `BlockSdt` is excluded because folio
|
|
2337
|
-
* unwraps a `w:sdt` inside a cell into its `sdtContent` children rather
|
|
2338
|
-
* than modelling the wrapper, and keeping the branch out of the cell keeps
|
|
2339
|
-
* the model's recursion out of every table.
|
|
2340
|
-
*/
|
|
2340
|
+
/** Cell content, including block controls nested directly in the cell. */
|
|
2341
2341
|
content: TableCellBlock[];
|
|
2342
2342
|
/**
|
|
2343
2343
|
* The cell-level content controls (`CT_SdtCell`) this cell sits inside,
|
|
@@ -2605,7 +2605,7 @@ type PropertyChangeInfo = {
|
|
|
2605
2605
|
* with it: the text is then neither inserted nor deleted, and accepting and
|
|
2606
2606
|
* rejecting the revision both keep it.
|
|
2607
2607
|
*/
|
|
2608
|
-
type TrackedRunContent = Run | Hyperlink | BookmarkStart | BookmarkEnd | SimpleField | ComplexField | InlineSdt | InlineWrapper | MathEquation | PreservedInline | TrackedRunChange;
|
|
2608
|
+
type TrackedRunContent = Run | Hyperlink | BookmarkStart | BookmarkEnd | MoveFromRangeStart | MoveFromRangeEnd | MoveToRangeStart | MoveToRangeEnd | SimpleField | ComplexField | InlineSdt | InlineWrapper | MathEquation | PreservedInline | TrackedRunChange;
|
|
2609
2609
|
/**
|
|
2610
2610
|
* Insertion wrapper (w:ins) — runs inserted by tracked changes
|
|
2611
2611
|
*/
|
|
@@ -3009,20 +3009,20 @@ type SdtEndProperties = {
|
|
|
3009
3009
|
* this level. All of them must survive parse → edit → save so docProps-bound
|
|
3010
3010
|
* fields and reviewed template content do not lose their wrapper on round-trip.
|
|
3011
3011
|
*
|
|
3012
|
-
*
|
|
3013
|
-
* do: `CT_SdtContentRun` reaches them through
|
|
3012
|
+
* Bookmark and tracked-move boundaries belong here for the reason the revision
|
|
3013
|
+
* wrapper's do: `CT_SdtContentRun` reaches them through
|
|
3014
3014
|
* `EG_RunLevelElts > EG_RangeMarkupElements`, and a marker lifted out to a
|
|
3015
|
-
* sibling of the control
|
|
3015
|
+
* sibling of the control has changed extent or ownership. A bookmark that
|
|
3016
3016
|
* covered the control's content ends up covering the control and whatever
|
|
3017
|
-
* follows it
|
|
3018
|
-
*
|
|
3017
|
+
* follows it; a tracked move can stop covering the marker that identifies its
|
|
3018
|
+
* source or destination.
|
|
3019
3019
|
*/
|
|
3020
3020
|
type InlineSdt = {
|
|
3021
3021
|
type: "inlineSdt";
|
|
3022
3022
|
/** SDT properties */
|
|
3023
3023
|
properties: SdtProperties;
|
|
3024
3024
|
/** Inline content held inside the control */
|
|
3025
|
-
content: (Run | Hyperlink | BookmarkStart | BookmarkEnd | SimpleField | ComplexField | InlineSdt | InlineWrapper | Insertion | Deletion | MoveFrom | MoveTo | MathEquation | PreservedInline)[];
|
|
3025
|
+
content: (Run | Hyperlink | BookmarkStart | BookmarkEnd | MoveFromRangeStart | MoveFromRangeEnd | MoveToRangeStart | MoveToRangeEnd | SimpleField | ComplexField | InlineSdt | InlineWrapper | Insertion | Deletion | MoveFrom | MoveTo | MathEquation | PreservedInline)[];
|
|
3026
3026
|
};
|
|
3027
3027
|
/**
|
|
3028
3028
|
* Block-level SDT (content control wrapping paragraphs/tables).
|
|
@@ -3513,8 +3513,8 @@ type PreservedBlock = {
|
|
|
3513
3513
|
* bookmark would not merely move, it would go.
|
|
3514
3514
|
*/
|
|
3515
3515
|
type BlockContent = Paragraph | Table | BlockSdt | PreservedBlock | BookmarkStart | BookmarkEnd;
|
|
3516
|
-
/**
|
|
3517
|
-
type TableCellBlock =
|
|
3516
|
+
/** A block that can occur inside a table cell. */
|
|
3517
|
+
type TableCellBlock = BlockContent;
|
|
3518
3518
|
/**
|
|
3519
3519
|
* Section (implicit or explicit based on sectPr)
|
|
3520
3520
|
*/
|
|
@@ -3528,10 +3528,36 @@ type Section = {
|
|
|
3528
3528
|
/** Footers for this section */
|
|
3529
3529
|
footers?: Map<HeaderFooterType, HeaderFooter>;
|
|
3530
3530
|
};
|
|
3531
|
+
/**
|
|
3532
|
+
* Drawing payload under the document-level `w:background`.
|
|
3533
|
+
*
|
|
3534
|
+
* Folio does not interpret this drawing. Keeping it as authored markup avoids
|
|
3535
|
+
* inventing an editable projection for legacy VML/DrawingML page art while the
|
|
3536
|
+
* surrounding background attributes remain typed.
|
|
3537
|
+
*/
|
|
3538
|
+
type DocumentBackgroundDrawing = {
|
|
3539
|
+
/** Replayable `w:drawing` markup, as the source wrote it. */
|
|
3540
|
+
rawXml: string;
|
|
3541
|
+
};
|
|
3542
|
+
/** Page background declared directly under `w:document`. */
|
|
3543
|
+
type DocumentBackground = {
|
|
3544
|
+
/** Direct colour or the `auto` sentinel. */
|
|
3545
|
+
color?: ColorValue;
|
|
3546
|
+
/** Theme colour token, including the explicit `none` cancellation. */
|
|
3547
|
+
themeColor?: ThemeColorValue;
|
|
3548
|
+
/** Theme tint modifier, kept in its authored hexadecimal spelling. */
|
|
3549
|
+
themeTint?: string;
|
|
3550
|
+
/** Theme shade modifier, kept in its authored hexadecimal spelling. */
|
|
3551
|
+
themeShade?: string;
|
|
3552
|
+
/** Optional drawing payload carried opaquely through an editor save. */
|
|
3553
|
+
drawing?: DocumentBackgroundDrawing;
|
|
3554
|
+
};
|
|
3531
3555
|
/**
|
|
3532
3556
|
* Document body (w:body)
|
|
3533
3557
|
*/
|
|
3534
3558
|
type DocumentBody = {
|
|
3559
|
+
/** Optional `w:document/w:background`, serialized before the body. */
|
|
3560
|
+
background?: DocumentBackground;
|
|
3535
3561
|
/** All content (paragraphs, tables) */
|
|
3536
3562
|
content: BlockContent[];
|
|
3537
3563
|
/** Sections (derived from sectPr in paragraphs and final sectPr) */
|
|
@@ -4064,4 +4090,4 @@ type Document = {
|
|
|
4064
4090
|
parseWarnings?: ParseWarning[];
|
|
4065
4091
|
};
|
|
4066
4092
|
//#endregion
|
|
4067
|
-
export {
|
|
4093
|
+
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 };
|
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-Cy1Dd6UE.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-Cy1Dd6UE.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