@stll/docx-core 0.39.1 → 0.39.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,5 +1,4 @@
1
- import { n as PreservedChild, r as PreservedMarkup, t as PreservedAttribute } from "./preservedMarkup-G8XjWhs2.js";
2
- //#region src/model/borderStyle.gen.d.ts
1
+ import { n as PreservedChild, r as PreservedMarkup, t as PreservedAttribute } from "./preservedMarkup-9L4lbGnE.js";
3
2
  /**
4
3
  * GENERATED FILE — do not edit.
5
4
  *
@@ -19,8 +18,6 @@ import { n as PreservedChild, r as PreservedMarkup, t as PreservedAttribute } fr
19
18
  declare const BORDER_STYLES: readonly ["nil", "none", "single", "thick", "double", "dotted", "dashed", "dotDash", "dotDotDash", "triple", "thinThickSmallGap", "thickThinSmallGap", "thinThickThinSmallGap", "thinThickMediumGap", "thickThinMediumGap", "thinThickThinMediumGap", "thinThickLargeGap", "thickThinLargeGap", "thinThickThinLargeGap", "wave", "doubleWave", "dashSmallGap", "dashDotStroked", "threeDEmboss", "threeDEngrave", "outset", "inset", "apples", "archedScallops", "babyPacifier", "babyRattle", "balloons3Colors", "balloonsHotAir", "basicBlackDashes", "basicBlackDots", "basicBlackSquares", "basicThinLines", "basicWhiteDashes", "basicWhiteDots", "basicWhiteSquares", "basicWideInline", "basicWideMidline", "basicWideOutline", "bats", "birds", "birdsFlight", "cabins", "cakeSlice", "candyCorn", "celticKnotwork", "certificateBanner", "chainLink", "champagneBottle", "checkedBarBlack", "checkedBarColor", "checkered", "christmasTree", "circlesLines", "circlesRectangles", "classicalWave", "clocks", "compass", "confetti", "confettiGrays", "confettiOutline", "confettiStreamers", "confettiWhite", "cornerTriangles", "couponCutoutDashes", "couponCutoutDots", "crazyMaze", "creaturesButterfly", "creaturesFish", "creaturesInsects", "creaturesLadyBug", "crossStitch", "cup", "decoArch", "decoArchColor", "decoBlocks", "diamondsGray", "doubleD", "doubleDiamonds", "earth1", "earth2", "earth3", "eclipsingSquares1", "eclipsingSquares2", "eggsBlack", "fans", "film", "firecrackers", "flowersBlockPrint", "flowersDaisies", "flowersModern1", "flowersModern2", "flowersPansy", "flowersRedRose", "flowersRoses", "flowersTeacup", "flowersTiny", "gems", "gingerbreadMan", "gradient", "handmade1", "handmade2", "heartBalloon", "heartGray", "hearts", "heebieJeebies", "holly", "houseFunky", "hypnotic", "iceCreamCones", "lightBulb", "lightning1", "lightning2", "mapPins", "mapleLeaf", "mapleMuffins", "marquee", "marqueeToothed", "moons", "mosaic", "musicNotes", "northwest", "ovals", "packages", "palmsBlack", "palmsColor", "paperClips", "papyrus", "partyFavor", "partyGlass", "pencils", "people", "peopleWaving", "peopleHats", "poinsettias", "postageStamp", "pumpkin1", "pushPinNote2", "pushPinNote1", "pyramids", "pyramidsAbove", "quadrants", "rings", "safari", "sawtooth", "sawtoothGray", "scaredCat", "seattle", "shadowedSquares", "sharksTeeth", "shorebirdTracks", "skyrocket", "snowflakeFancy", "snowflakes", "sombrero", "southwest", "stars", "starsTop", "stars3d", "starsBlack", "starsShadowed", "sun", "swirligig", "tornPaper", "tornPaperBlack", "trees", "triangleParty", "triangles", "triangle1", "triangle2", "triangleCircle1", "triangleCircle2", "shapes1", "shapes2", "twistedLines1", "twistedLines2", "vine", "waveline", "weavingAngles", "weavingBraid", "weavingRibbon", "weavingStrips", "whiteFlowers", "woodwork", "xIllusions", "zanyTriangles", "zigZag", "zigZagStitch", "custom"];
20
19
  /** `w:val` on `CT_Border`: a border style the schema declares. */
21
20
  type BorderStyle = (typeof BORDER_STYLES)[number];
22
- //#endregion
23
- //#region src/model/borderStyle.d.ts
24
21
  /**
25
22
  * A `w:val` the schema does not declare, kept exactly as the file spelled it.
26
23
  *
@@ -54,8 +51,6 @@ declare const isBorderNil: (style: BorderStyleValue | undefined) => boolean;
54
51
  * the value keeps it.
55
52
  */
56
53
  declare const statesNoBorder: (style: BorderStyleValue | undefined) => boolean;
57
- //#endregion
58
- //#region src/model/themeColor.gen.d.ts
59
54
  /**
60
55
  * GENERATED FILE — do not edit.
61
56
  *
@@ -78,8 +73,6 @@ declare const THEME_COLORS: readonly ["dark1", "light1", "dark2", "light2", "acc
78
73
  type ThemeColor = "dark1" | "light1" | "dark2" | "light2" | "accent1" | "accent2" | "accent3" | "accent4" | "accent5" | "accent6" | "hyperlink" | "followedHyperlink" | "none" | "background1" | "text1" | "background2" | "text2";
79
74
  type SchemeColorSlot = "dk1" | "lt1" | "dk2" | "lt2" | "accent1" | "accent2" | "accent3" | "accent4" | "accent5" | "accent6" | "hlink" | "folHlink";
80
75
  type SchemeColorValue = "bg1" | "tx1" | "bg2" | "tx2" | "accent1" | "accent2" | "accent3" | "accent4" | "accent5" | "accent6" | "hlink" | "folHlink" | "phClr" | "dk1" | "lt1" | "dk2" | "lt2";
81
- //#endregion
82
- //#region src/model/themeColor.d.ts
83
76
  /**
84
77
  * The `a:schemeClr/@val` spelling of each theme colour.
85
78
  *
@@ -166,8 +159,6 @@ declare const knownThemeColor: (value: ThemeColorValue) => ThemeColor | undefine
166
159
  * a token the schema does not enumerate.
167
160
  */
168
161
  declare const themeColorSlot: (value: ThemeColorValue) => SchemeColorSlot | undefined;
169
- //#endregion
170
- //#region src/model/colors.d.ts
171
162
  /**
172
163
  * Color value - can be direct RGB, theme reference, or auto
173
164
  */
@@ -242,8 +233,6 @@ type ShadingProperties = {
242
233
  /** `CT_Shd` attributes this record has no field for; see {@link BorderSpec}. */
243
234
  preservedAttributes?: PreservedAttribute[];
244
235
  };
245
- //#endregion
246
- //#region src/model/ooxmlEnumerations.gen.d.ts
247
236
  /**
248
237
  * GENERATED FILE — do not edit.
249
238
  *
@@ -338,8 +327,6 @@ declare const TEXT_DIRECTION_FLOW_BY_TOKEN: {
338
327
  */
339
328
  declare const NUMBER_FORMATS: readonly ["decimal", "upperRoman", "lowerRoman", "upperLetter", "lowerLetter", "ordinal", "cardinalText", "ordinalText", "hex", "chicago", "ideographDigital", "japaneseCounting", "aiueo", "iroha", "decimalFullWidth", "decimalHalfWidth", "japaneseLegal", "japaneseDigitalTenThousand", "decimalEnclosedCircle", "decimalFullWidth2", "aiueoFullWidth", "irohaFullWidth", "decimalZero", "bullet", "ganada", "chosung", "decimalEnclosedFullstop", "decimalEnclosedParen", "decimalEnclosedCircleChinese", "ideographEnclosedCircle", "ideographTraditional", "ideographZodiac", "ideographZodiacTraditional", "taiwaneseCounting", "ideographLegalTraditional", "taiwaneseCountingThousand", "taiwaneseDigital", "chineseCounting", "chineseLegalSimplified", "chineseCountingThousand", "koreanDigital", "koreanCounting", "koreanLegal", "koreanDigital2", "vietnameseCounting", "russianLower", "russianUpper", "none", "numberInDash", "hebrew1", "hebrew2", "arabicAlpha", "arabicAbjad", "hindiVowels", "hindiConsonants", "hindiNumbers", "hindiCounting", "thaiLetters", "thaiNumbers", "thaiCounting", "bahtText", "dollarText", "custom"];
340
329
  type NumberFormat = "decimal" | "upperRoman" | "lowerRoman" | "upperLetter" | "lowerLetter" | "ordinal" | "cardinalText" | "ordinalText" | "hex" | "chicago" | "ideographDigital" | "japaneseCounting" | "aiueo" | "iroha" | "decimalFullWidth" | "decimalHalfWidth" | "japaneseLegal" | "japaneseDigitalTenThousand" | "decimalEnclosedCircle" | "decimalFullWidth2" | "aiueoFullWidth" | "irohaFullWidth" | "decimalZero" | "bullet" | "ganada" | "chosung" | "decimalEnclosedFullstop" | "decimalEnclosedParen" | "decimalEnclosedCircleChinese" | "ideographEnclosedCircle" | "ideographTraditional" | "ideographZodiac" | "ideographZodiacTraditional" | "taiwaneseCounting" | "ideographLegalTraditional" | "taiwaneseCountingThousand" | "taiwaneseDigital" | "chineseCounting" | "chineseLegalSimplified" | "chineseCountingThousand" | "koreanDigital" | "koreanCounting" | "koreanLegal" | "koreanDigital2" | "vietnameseCounting" | "russianLower" | "russianUpper" | "none" | "numberInDash" | "hebrew1" | "hebrew2" | "arabicAlpha" | "arabicAbjad" | "hindiVowels" | "hindiConsonants" | "hindiNumbers" | "hindiCounting" | "thaiLetters" | "thaiNumbers" | "thaiCounting" | "bahtText" | "dollarText" | "custom";
341
- //#endregion
342
- //#region src/model/outlineLevel.d.ts
343
330
  /**
344
331
  * `w:outlineLvl`: nine heading levels and one reserved "not a heading".
345
332
  *
@@ -389,8 +376,6 @@ declare const outlineLevelStatedValue: (outlineLevel: OutlineLevel) => number;
389
376
  * cascade still has a tier left to ask.
390
377
  */
391
378
  declare const headingLevelOf: (outlineLevel: OutlineLevel | null | undefined) => HeadingOutlineLevel | undefined;
392
- //#endregion
393
- //#region src/model/paragraphNumbering.d.ts
394
379
  /**
395
380
  * `w:numPr`: what a tier states about a paragraph's numbering, and what the
396
381
  * cascade resolves that to.
@@ -514,8 +499,6 @@ declare const paragraphNumberingReferenceId: (numbering: ParagraphNumberingOverr
514
499
  declare const sameStatedParagraphNumbering: (left: ParagraphNumberingOverride | undefined, right: ParagraphNumberingOverride | undefined) => boolean;
515
500
  /** Whether two stated overrides render the same, an absent `w:ilvl` read as zero. */
516
501
  declare const sameEffectiveParagraphNumbering: (left: ParagraphNumberingOverride | undefined, right: ParagraphNumberingOverride | undefined) => boolean;
517
- //#endregion
518
- //#region src/model/formatting.d.ts
519
502
  /** Formatting journals retain an explicitly undefined own field. */
520
503
  type OwnFieldPresence<Formatting> = { [Key in keyof Formatting]: Formatting[Key] | undefined; };
521
504
  /**
@@ -1128,8 +1111,6 @@ type TableCellFormatting = {
1128
1111
  */
1129
1112
  sourceXml?: string;
1130
1113
  };
1131
- //#endregion
1132
- //#region src/model/lists.d.ts
1133
1114
  /**
1134
1115
  * What the marker renderer counts in: folio's own vocabulary, not the format's.
1135
1116
  *
@@ -1345,8 +1326,6 @@ type NumberingDefinitions = {
1345
1326
  /** Attributes of `w:numbering` the model has no field for. */
1346
1327
  preservedAttributes?: PreservedAttribute[];
1347
1328
  };
1348
- //#endregion
1349
- //#region src/model/presetLineDash.gen.d.ts
1350
1329
  /**
1351
1330
  * GENERATED FILE — do not edit.
1352
1331
  *
@@ -1364,8 +1343,6 @@ type NumberingDefinitions = {
1364
1343
  declare const PRESET_LINE_DASH_VALS: readonly ["solid", "dot", "dash", "lgDash", "dashDot", "lgDashDot", "lgDashDotDot", "sysDash", "sysDot", "sysDashDot", "sysDashDotDot"];
1365
1344
  /** `a:prstDash@val`: a preset dash the schema declares. */
1366
1345
  type PresetLineDashVal = (typeof PRESET_LINE_DASH_VALS)[number];
1367
- //#endregion
1368
- //#region src/model/presetLineDash.d.ts
1369
1346
  /**
1370
1347
  * A `@val` the schema does not declare, kept exactly as the file spelled it.
1371
1348
  *
@@ -1386,8 +1363,6 @@ declare const isPresetLineDashVal: (value: string) => value is PresetLineDashVal
1386
1363
  declare const presetLineDashFrom: (value: string) => PresetLineDashValue;
1387
1364
  /** The token to write back, whether or not the schema declares it. */
1388
1365
  declare const presetLineDashToken: (dash: PresetLineDashValue) => string;
1389
- //#endregion
1390
- //#region src/model/preview.d.ts
1391
1366
  /**
1392
1367
  * How a drawing with no image data is drawn, without drawing it.
1393
1368
  *
@@ -1447,8 +1422,6 @@ type PreviewDescriptor = {
1447
1422
  /** Already bounded by the shape and point caps, in paint order. */
1448
1423
  readonly shapes: readonly PreviewShape[];
1449
1424
  };
1450
- //#endregion
1451
- //#region src/model/relationshipId.d.ts
1452
1425
  /**
1453
1426
  * A relationship reference that names something.
1454
1427
  *
@@ -1484,8 +1457,6 @@ declare const relationshipIdOf: (value: string | null | undefined) => Relationsh
1484
1457
  * one where the refinement has stopped describing the type.
1485
1458
  */
1486
1459
  declare const mintRelationshipId: (ordinal: number) => RelationshipId;
1487
- //#endregion
1488
- //#region src/model/content.d.ts
1489
1460
  /**
1490
1461
  * Plain text content
1491
1462
  */
@@ -3764,12 +3735,8 @@ type DocumentBody = {
3764
3735
  /** Comments from comments.xml */
3765
3736
  comments?: Comment[];
3766
3737
  };
3767
- //#endregion
3768
- //#region src/model/runPropertyReview.d.ts
3769
3738
  /** A run-property container has one pending formatting revision. */
3770
3739
  declare const getSingularRunPropertyChange: (propertyChanges: readonly RunPropertyChange[] | undefined) => RunPropertyChange | undefined;
3771
- //#endregion
3772
- //#region src/model/canonical.d.ts
3773
3740
  /** Set modeled comments while keeping an empty comments part out of the document model. */
3774
3741
  declare const setDocumentBodyComments: (body: DocumentBody, comments: Comment[]) => void;
3775
3742
  /**
@@ -3782,8 +3749,6 @@ declare const setDocumentBodyComments: (body: DocumentBody, comments: Comment[])
3782
3749
  declare const finalizeParagraphFormatting: (formatting: ParagraphFormatting | undefined) => ParagraphFormatting | undefined;
3783
3750
  /** Whether paragraph formatting states no modeled properties. */
3784
3751
  declare const isCanonicallyEmptyParagraphFormatting: (formatting: ParagraphFormatting | undefined) => boolean;
3785
- //#endregion
3786
- //#region src/model/parseWarning.d.ts
3787
3752
  /**
3788
3753
  * What folio normalised to open a document, as data rather than as prose.
3789
3754
  *
@@ -3913,8 +3878,6 @@ type ParseWarning = {
3913
3878
  * thousand records. Occurrences past the cap are counted, not kept.
3914
3879
  */
3915
3880
  declare const MAX_RETAINED_PARSE_WARNINGS_PER_CODE = 20;
3916
- //#endregion
3917
- //#region src/model/styles.d.ts
3918
3881
  /**
3919
3882
  * Style type
3920
3883
  */
@@ -4173,8 +4136,6 @@ type MediaFile = {
4173
4136
  /** Data URL for direct use in src attributes */
4174
4137
  dataUrl?: string;
4175
4138
  };
4176
- //#endregion
4177
- //#region src/model/exhaustiveFields.d.ts
4178
4139
  /**
4179
4140
  * Compile-time totality over every field of a model type.
4180
4141
  *
@@ -4190,12 +4151,8 @@ type MediaFile = {
4190
4151
  * ```
4191
4152
  */
4192
4153
  type ExhaustiveFields<Source, Classified extends keyof Source> = Exclude<keyof Source, Classified> extends never ? Source : never;
4193
- //#endregion
4194
- //#region src/model/numberingLevel.d.ts
4195
4154
  /** Resolve only defined numbering levels; preserve unsupported source values elsewhere. */
4196
4155
  declare const isNumberingLevel: (value: number) => boolean;
4197
- //#endregion
4198
- //#region src/model/numberingLevels.d.ts
4199
4156
  type NumberingLevelResolution = {
4200
4157
  kind: "level";
4201
4158
  level: ListLevel;
@@ -4241,8 +4198,6 @@ declare const numberingLevelEntries: (definitions: NumberingDefinitions) => Numb
4241
4198
  * current level's legal-numbering mode, `none`, and placeholder rendering.
4242
4199
  */
4243
4200
  declare const levelShowsMarker: (definitions: NumberingDefinitions, numId: number, ilvl: number) => boolean;
4244
- //#endregion
4245
- //#region src/model/document.d.ts
4246
4201
  /** OOXML default per §17.6.13 when `w:defaultTabStop` is absent. */
4247
4202
  declare const DEFAULT_TAB_STOP_TWIPS = 720;
4248
4203
  /**
@@ -4404,5 +4359,4 @@ declare const COMMENT_PART_RELATIONSHIPS: {
4404
4359
  readonly target: "commentsExtended.xml";
4405
4360
  };
4406
4361
  };
4407
- //#endregion
4408
4362
  export { Column as $, UnrecognisedThemeColor as $i, TableContentCarrier as $n, TableCellBorders as $r, MoveFromRangeStart as $t, ThemeColorScheme as A, headingLevelOf as Ai, SdtEndProperties as An, PRESET_LINE_DASH_VALS as Ar, Hyperlink as At, finalizeParagraphFormatting as B, TEXT_DIRECTIONS as Bi, ShapeFill as Bn, ListRendering as Br, ImageWrap as Bt, Relationship as C, paragraphNumberingSlots as Ci, PropertyChangeInfo as Cn, PreviewDescriptor as Cr, FooterReference as Ct, StyleDefinitions as D, BODY_TEXT_OUTLINE_LEVEL as Di, Run as Dn, isPresetLineDashVal as Dr, HeaderFooter as Dt, Style as E, sameStatedParagraphNumbering as Ei, ReviewCarrier as En, UnrecognisedPresetLineDash as Er, FootnoteProperties as Et, MAX_RETAINED_PARSE_WARNINGS_PER_CODE as F, NumberFormat as Fi, SectionPropertyChange as Fn, LevelLegacy as Fr, ImageFrameLocks as Ft, BidiControl as G, TextDirection as Gi, SimpleField as Gn, EmphasisMark as Gr, InstrTextContent as Gt, setDocumentBodyComments as H, TEXT_DIRECTION_FLOW_BY_TOKEN as Hi, ShapeOutline as Hn, NumberingInstance as Hr, InlineSdt as Ht, PARSE_WARNING_CODES as I, PARAGRAPH_ALIGNMENTS as Ii, SectionStart as In, LevelOverride as Ir, ImagePadding as It, BlockSdt as J, ColorValue as Ji, TabContent as Jn, ParagraphFormatting as Jr, MarkupRangeMarker as Jt, BlockContent as K, TextDirectionFlow as Ki, SoftHyphenContent as Kn, FloatingTableProperties as Kr, LineNumberRestart as Kt, ParseWarning as L, ParagraphAlignment as Li, Shape as Ln, LevelSuffix as Lr, ImagePosition as Lt, ThemeFontScheme as M, outlineLevelFromStatedValue as Mi, SdtType as Mn, AbstractNumbering as Mr, Image as Mt, IMPORTED_ID_COLLISION_KINDS as N, outlineLevelStatedValue as Ni, Section as Nn, COUNTER_FORMATS as Nr, ImageCrop as Nt, StyleType as O, HeadingOutlineLevel as Oi, RunContent as On, presetLineDashFrom as Or, HeaderFooterType as Ot, ImportedIdCollisionKind as P, NUMBER_FORMATS as Pi, SectionProperties as Pn, CounterFormat as Pr, ImageDocPrLink as Pt, BreakContent as Q, ThemeColorValue as Qi, TableCellPropertyChange as Qn, TableBorders as Qr, MoveFromRangeEnd as Qt, ParseWarningCode as R, TABLE_ALIGNMENTS as Ri, ShapeAlternateContent as Rn, ListLevel as Rr, ImageSize as Rt, MediaFile as S, paragraphNumberingReferenceId as Si, PropertyChange as Sn, relationshipIdOf as Sr, FoldedListNumber as St, RelationshipType as T, sameEffectiveParagraphNumbering as Ti, REVIEW_CARRIERS as Tn, PresetLineDashValue as Tr, FootnotePosition as Tt, getSingularRunPropertyChange as U, TabStopAlignment as Ui, ShapeTextBody as Un, CellMargins as Ur, InlineWrapper as Ut, isCanonicallyEmptyParagraphFormatting as V, TEXT_DIRECTION_FLOWS as Vi, ShapeGeometryAdjustment as Vn, NumberingDefinitions as Vr, ImageWrapPolygon as Vt, BIDI_CONTROLS as W, TableAlignment as Wi, ShapeType as Wn, ConditionalFormatStyle as Wr, Insertion as Wt, BookmarkRangeMarker as X, SCHEME_COLOR_VALUE_BY_THEME_COLOR as Xi, TableCell as Xn, TabLeader as Xr, MoveBookmarkMarker as Xt, BookmarkEnd as Y, ShadingProperties as Yi, Table as Yn, SpacingExplicit as Yr, MathEquation as Yt, BookmarkStart as Z, THEME_COLOR_BY_SCHEME_COLOR_VALUE as Zi, TableCellBlock as Zn, TabStop as Zr, MoveFrom as Zt, DocDefaults as _, statesNoBorder as _a, isNumberingReference as _i, PositionalTab as _n, WrapPolygonPoint as _r, EndnotePosition as _t, DocumentSettings as a, themeColorToken as aa, TablePropertyExceptionFormatting as ai, NoteMarkerContent as an, TableRowPropertyChange as ar, DRAWING_RAW_XML_MODES as at, FontInfo as b, paragraphNumberingLevel as bi, PreservedInline as bn, RelationshipId as br, FieldCharContent as bt, NumberingLevelEntry as c, THEME_COLORS as ca, TextEffect as ci, PARAGRAPH_MARK_CHANGE_KINDS as cn, TextContent as cr, DocumentBackground as ct, numberingInstanceResolves as d, UnrecognisedBorderStyle as da, NO_NUMBERING_NUM_ID as di, Paragraph as dn, TrackedRunChange as dr, DrawingAnchor as dt, isSchemeColorValue as ea, TableCellFormatting as ei, MoveTo as en, TableCustomXmlWrapper as er, Comment as et, numberingLevelEntries as f, borderStyleFrom as fa, NO_PARAGRAPH_NUMBERING as fi, ParagraphContent as fn, TrackedRunContent as fr, DrawingContent as ft, ExhaustiveFields as g, isBorderStyle as ga, ResolvedParagraphNumbering as gi, PictureWatermark as gn, WrapDistances as gr, Endnote as gt, isNumberingLevel as h, isBorderNone as ha, ParagraphNumberingSlots as hi, ParagraphPropertyChange as hn, WrapDistanceSlots as hr, EffectExtentSlots as ht, Document as i, themeColorSlot as ia, TableMeasurement as ii, NonVisualDrawingNames as in, TableRow as ir, ComplexField as it, ThemeFont as j, headingOutlineLevel as ji, SdtProperties as jn, PresetLineDashVal as jr, INSERTION_SEAM_POLICIES as jt, Theme as k, OutlineLevel as ki, RunPropertyChange as kn, presetLineDashToken as kr, HeaderReference as kt, NumberingLevelResolution as l, ThemeColor as la, TextFormatting as li, PROPERTY_REVISION_KINDS as ln, TextWatermark as lr, DocumentBackgroundDrawing as lt, resolveNumberingLevel as m, isBorderNil as ma, ParagraphNumberingReference as mi, ParagraphMarkChangeKind as mn, Watermark as mr, DrawingRawXmlMode as mt, DEFAULT_TAB_STOP_TWIPS as n, knownThemeColor as na, TableGridChange as ni, MoveToRangeStart as nn, TablePropertyChange as nr, CommentRangeStart as nt, DocxConformanceClass as o, SchemeColorSlot as oa, TableRowFormatting as oi, NoteNumberRestart as on, TableStructuralChangeInfo as or, Deletion as ot, numberingLevelHasMarkerSlot as p, borderStyleToken as pa, ParagraphNumberingOverride as pi, ParagraphMarkChange as pn, VerticalAlign as pr, DrawingGroupChild as pt, BlockCustomXml as q, BorderSpec as qi, SymbolContent as qn, LineSpacingRule as qr, MAX_REVISION_ID as qt, DOCX_CONFORMANCE_CLASSES as r, readThemeColor as ra, TableLook as ri, NoBreakHyphenContent as rn, TablePropertyExceptionChange as rr, CommentReference as rt, DocxPackage as s, SchemeColorValue as sa, TableWidthType as si, NoteReferenceContent as sn, TextBox as sr, DisplacedByCustomXml as st, COMMENT_PART_RELATIONSHIPS as t, isThemeColor as ta, TableFormatting as ti, MoveToRangeEnd as tn, TablePreservedMarkup as tr, CommentRangeEnd as tt, levelShowsMarker as u, BorderStyleValue as ua, UnderlineStyle as ui, PageOrientation as un, TrackedChangeInfo as ur, DocumentBody as ut, EmbeddedFontRef as v, BORDER_STYLES as va, mergeParagraphNumbering as vi, PositionedBookmarkMarker as vn, isOoxmlSymbolCharacter as vr, EndnoteProperties as vt, RelationshipMap as w, resolveParagraphNumbering as wi, PropertyRevisionKind as wn, PreviewShape as wr, Footnote as wt, FontTable as x, paragraphNumberingReference as xi, PreservedXmlContent as xn, mintRelationshipId as xr, FieldType as xt, FontCharset as y, BorderStyle as ya, paragraphNumberingFromSlots as yi, PreservedBlock as yn, normalizeRevisionId as yr, Field as yt, ParseWarningLocation as z, TAB_STOP_ALIGNMENTS as zi, ShapeContent as zn, ListMarkerFormatting as zr, ImageTransform as zt };
@@ -1,5 +1,5 @@
1
1
  import { panic } from "better-result";
2
- //#region src/model/runPropertyReview.ts
2
+ // src/model/runPropertyReview.ts
3
3
  /** A run-property container has one pending formatting revision. */
4
4
  const getSingularRunPropertyChange = (propertyChanges) => {
5
5
  const propertyChangeCount = propertyChanges?.length ?? 0;
@@ -9,8 +9,7 @@ const getSingularRunPropertyChange = (propertyChanges) => {
9
9
  });
10
10
  return propertyChanges?.at(0);
11
11
  };
12
- //#endregion
13
- //#region src/model/canonical.ts
12
+ // src/model/canonical.ts
14
13
  /** Set modeled comments while keeping an empty comments part out of the document model. */
15
14
  const setDocumentBodyComments = (body, comments) => {
16
15
  if (comments.length === 0) {
@@ -31,8 +30,7 @@ const finalizeParagraphFormatting = (formatting) => {
31
30
  };
32
31
  /** Whether paragraph formatting states no modeled properties. */
33
32
  const isCanonicallyEmptyParagraphFormatting = (formatting) => formatting === void 0 || Object.keys(formatting).every((key) => key === "sourceXml");
34
- //#endregion
35
- //#region src/model/parseWarning.ts
33
+ // src/model/parseWarning.ts
36
34
  /**
37
35
  * What folio normalised to open a document, as data rather than as prose.
38
36
  *
@@ -132,8 +130,7 @@ const IMPORTED_ID_COLLISION_KINDS = {
132
130
  * thousand records. Occurrences past the cap are counted, not kept.
133
131
  */
134
132
  const MAX_RETAINED_PARSE_WARNINGS_PER_CODE = 20;
135
- //#endregion
136
- //#region src/model/paragraphNumbering.ts
133
+ // src/model/paragraphNumbering.ts
137
134
  /**
138
135
  * `w:numPr`: what a tier states about a paragraph's numbering, and what the
139
136
  * cascade resolves that to.
@@ -300,8 +297,7 @@ const sameEffectiveParagraphNumbering = (left, right) => {
300
297
  if (resolvedLeft.kind === "none" || resolvedRight.kind === "none") return resolvedLeft.kind === resolvedRight.kind;
301
298
  return resolvedLeft.numId === resolvedRight.numId && resolvedLeft.ilvl === resolvedRight.ilvl;
302
299
  };
303
- //#endregion
304
- //#region src/model/numberingLevel.ts
300
+ // src/model/numberingLevel.ts
305
301
  /** A w:ilvl outside the nine numbering levels names no level. */
306
302
  const NUMBERING_LEVELS = /* @__PURE__ */ new Set([
307
303
  0,
@@ -316,8 +312,7 @@ const NUMBERING_LEVELS = /* @__PURE__ */ new Set([
316
312
  ]);
317
313
  /** Resolve only defined numbering levels; preserve unsupported source values elsewhere. */
318
314
  const isNumberingLevel = (value) => NUMBERING_LEVELS.has(value);
319
- //#endregion
320
- //#region src/model/outlineLevel.ts
315
+ // src/model/outlineLevel.ts
321
316
  /**
322
317
  * `w:outlineLvl`: nine heading levels and one reserved "not a heading".
323
318
  *
@@ -383,8 +378,7 @@ const outlineLevelStatedValue = (outlineLevel) => {
383
378
  * cascade still has a tier left to ask.
384
379
  */
385
380
  const headingLevelOf = (outlineLevel) => outlineLevel?.kind === "heading" ? outlineLevel.level : void 0;
386
- //#endregion
387
- //#region src/model/relationshipId.ts
381
+ // src/model/relationshipId.ts
388
382
  /**
389
383
  * Whether a string names a relationship. The refinement is a type predicate
390
384
  * rather than a cast, so no site that mints an id needs an assertion.
@@ -409,8 +403,7 @@ const mintRelationshipId = (ordinal) => {
409
403
  const id = `rId${ordinal}`;
410
404
  return isRelationshipId(id) ? id : panic("A minted relationship id names nothing.");
411
405
  };
412
- //#endregion
413
- //#region src/model/themeColor.gen.ts
406
+ // src/model/themeColor.gen.ts
414
407
  /**
415
408
  * GENERATED FILE — do not edit.
416
409
  *
@@ -474,8 +467,7 @@ const SCHEME_COLOR_VALUES = [
474
467
  "dk2",
475
468
  "lt2"
476
469
  ];
477
- //#endregion
478
- //#region src/model/themeColor.ts
470
+ // src/model/themeColor.ts
479
471
  /**
480
472
  * The one mapping between a WordprocessingML theme reference and a theme slot.
481
473
  *
@@ -636,8 +628,7 @@ const themeColorSlot = (value) => {
636
628
  default: return target;
637
629
  }
638
630
  };
639
- //#endregion
640
- //#region src/model/ooxmlEnumerations.gen.ts
631
+ // src/model/ooxmlEnumerations.gen.ts
641
632
  /**
642
633
  * GENERATED FILE — do not edit.
643
634
  *
@@ -839,8 +830,7 @@ const NUMBER_FORMATS = [
839
830
  "dollarText",
840
831
  "custom"
841
832
  ];
842
- //#endregion
843
- //#region src/model/borderStyle.gen.ts
833
+ // src/model/borderStyle.gen.ts
844
834
  /**
845
835
  * GENERATED FILE — do not edit.
846
836
  *
@@ -1052,8 +1042,7 @@ const BORDER_STYLES = [
1052
1042
  "zigZagStitch",
1053
1043
  "custom"
1054
1044
  ];
1055
- //#endregion
1056
- //#region src/model/borderStyle.ts
1045
+ // src/model/borderStyle.ts
1057
1046
  /**
1058
1047
  * The one place a `CT_Border` `w:val` is decided.
1059
1048
  *
@@ -1093,8 +1082,7 @@ const isBorderNil = (style) => style === "nil";
1093
1082
  * the value keeps it.
1094
1083
  */
1095
1084
  const statesNoBorder = (style) => isBorderNone(style) || isBorderNil(style);
1096
- //#endregion
1097
- //#region src/model/presetLineDash.gen.ts
1085
+ // src/model/presetLineDash.gen.ts
1098
1086
  /**
1099
1087
  * GENERATED FILE — do not edit.
1100
1088
  *
@@ -1122,8 +1110,7 @@ const PRESET_LINE_DASH_VALS = [
1122
1110
  "sysDashDot",
1123
1111
  "sysDashDotDot"
1124
1112
  ];
1125
- //#endregion
1126
- //#region src/model/presetLineDash.ts
1113
+ // src/model/presetLineDash.ts
1127
1114
  /**
1128
1115
  * The one place an `a:ln/a:prstDash` `@val` is decided.
1129
1116
  *
@@ -1152,8 +1139,7 @@ const presetLineDashFrom = (value) => isPresetLineDashVal(value) ? value : {
1152
1139
  };
1153
1140
  /** The token to write back, whether or not the schema declares it. */
1154
1141
  const presetLineDashToken = (dash) => typeof dash === "string" ? dash : dash.raw;
1155
- //#endregion
1156
- //#region src/model/lists.ts
1142
+ // src/model/lists.ts
1157
1143
  /**
1158
1144
  * What the marker renderer counts in: folio's own vocabulary, not the format's.
1159
1145
  *
@@ -1169,8 +1155,7 @@ const COUNTER_FORMATS = [
1169
1155
  "decimalZero4",
1170
1156
  "decimalZero5"
1171
1157
  ];
1172
- //#endregion
1173
- //#region src/model/numberingLevels.ts
1158
+ // src/model/numberingLevels.ts
1174
1159
  const MIN_NUMBERING_LEVEL = 0;
1175
1160
  const MAX_NUMBERING_LEVEL = 8;
1176
1161
  /** Whether a numbering level reserves space for a visible marker. */
@@ -1287,8 +1272,7 @@ const levelShowsMarker = (definitions, numId, ilvl) => {
1287
1272
  return numberingLevelHasMarkerSlot(referenced.level, level.isLgl) ? "x" : "";
1288
1273
  }).trim().length > 0;
1289
1274
  };
1290
- //#endregion
1291
- //#region src/model/content.ts
1275
+ // src/model/content.ts
1292
1276
  const OOXML_SYMBOL_CHARACTER_PATTERN = /^[\dA-Fa-f]{4}$/u;
1293
1277
  /** Whether a symbol character is exactly four hexadecimal digits. */
1294
1278
  const isOoxmlSymbolCharacter = (value) => OOXML_SYMBOL_CHARACTER_PATTERN.test(value);
@@ -1381,8 +1365,7 @@ const PARAGRAPH_MARK_CHANGE_KINDS = Object.freeze([
1381
1365
  "del"
1382
1366
  ]);
1383
1367
  const REVIEW_CARRIERS = { TERMINAL_TABLE: "terminal-table" };
1384
- //#endregion
1385
- //#region src/model/document.ts
1368
+ // src/model/document.ts
1386
1369
  /** OOXML default per §17.6.13 when `w:defaultTabStop` is absent. */
1387
1370
  const DEFAULT_TAB_STOP_TWIPS = 720;
1388
1371
  /** DOCX package conformance classes. */
@@ -1402,5 +1385,4 @@ const COMMENT_PART_RELATIONSHIPS = {
1402
1385
  target: "commentsExtended.xml"
1403
1386
  }
1404
1387
  };
1405
- //#endregion
1406
1388
  export { outlineLevelStatedValue as $, BORDER_STYLES as A, isSchemeColorValue as B, PRESET_LINE_DASH_VALS as C, isBorderNone as D, isBorderNil as E, TEXT_DIRECTIONS as F, themeColorToken as G, knownThemeColor as H, TEXT_DIRECTION_FLOWS as I, relationshipIdOf as J, THEME_COLORS as K, TEXT_DIRECTION_FLOW_BY_TOKEN as L, PARAGRAPH_ALIGNMENTS as M, TABLE_ALIGNMENTS as N, isBorderStyle as O, TAB_STOP_ALIGNMENTS as P, outlineLevelFromStatedValue as Q, SCHEME_COLOR_VALUE_BY_THEME_COLOR as R, presetLineDashToken as S, borderStyleToken as T, readThemeColor as U, isThemeColor as V, themeColorSlot as W, headingLevelOf as X, BODY_TEXT_OUTLINE_LEVEL as Y, headingOutlineLevel as Z, numberingLevelHasMarkerSlot as _, isCanonicallyEmptyParagraphFormatting as _t, DRAWING_RAW_XML_MODES as a, paragraphNumberingFromSlots as at, isPresetLineDashVal as b, PARAGRAPH_MARK_CHANGE_KINDS as c, paragraphNumberingReferenceId as ct, isNoteReferenceId as d, sameEffectiveParagraphNumbering as dt, isNumberingLevel as et, isOoxmlSymbolCharacter as f, sameStatedParagraphNumbering as ft, numberingLevelEntries as g, finalizeParagraphFormatting as gt, numberingInstanceResolves as h, PARSE_WARNING_CODES as ht, BIDI_CONTROLS as i, mergeParagraphNumbering as it, NUMBER_FORMATS as j, statesNoBorder as k, PROPERTY_REVISION_KINDS as l, paragraphNumberingSlots as lt, levelShowsMarker as m, MAX_RETAINED_PARSE_WARNINGS_PER_CODE as mt, DEFAULT_TAB_STOP_TWIPS as n, NO_PARAGRAPH_NUMBERING as nt, INSERTION_SEAM_POLICIES as o, paragraphNumberingLevel as ot, normalizeRevisionId as p, IMPORTED_ID_COLLISION_KINDS as pt, mintRelationshipId as q, DOCX_CONFORMANCE_CLASSES as r, isNumberingReference as rt, MAX_REVISION_ID as s, paragraphNumberingReference as st, COMMENT_PART_RELATIONSHIPS as t, NO_NUMBERING_NUM_ID as tt, REVIEW_CARRIERS as u, resolveParagraphNumbering as ut, resolveNumberingLevel as v, setDocumentBodyComments as vt, borderStyleFrom as w, presetLineDashFrom as x, COUNTER_FORMATS as y, getSingularRunPropertyChange as yt, THEME_COLOR_BY_SCHEME_COLOR_VALUE as z };
Binary file
@@ -1,4 +1,4 @@
1
- //#region src/serialize/xmlEscape.ts
1
+ // src/serialize/xmlEscape.ts
2
2
  /**
3
3
  * The one owner of XML character escaping for every part folio writes.
4
4
  *
@@ -88,8 +88,7 @@ const hasIllegalXmlCharacters = (value) => ILLEGAL_XML_CHARACTER_PROBE.test(valu
88
88
  * further down, but by then nobody can say which input lost a character.
89
89
  */
90
90
  const sanitizeXmlCharacters = (value) => hasIllegalXmlCharacters(value) ? value.replace(LONE_SURROGATE_PATTERN, REPLACEMENT_CHARACTER).replace(ILLEGAL_XML_CHARACTER_PATTERN, "") : value;
91
- //#endregion
92
- //#region src/markdown/href.ts
91
+ // src/markdown/href.ts
93
92
  const ALLOWED_URL_PROTOCOLS = /* @__PURE__ */ new Set([
94
93
  "http:",
95
94
  "https:",
@@ -136,5 +135,4 @@ const sanitizeMarkdownHref = (rawHref) => {
136
135
  }
137
136
  return sanitizeExternalUrl(trimmed);
138
137
  };
139
- //#endregion
140
138
  export { hasIllegalXmlCharacters as a, escapeXmlText as i, sanitizeMarkdownHref as n, sanitizeXmlCharacters as o, escapeXmlAttribute as r, sanitizeExternalUrl as t };
package/dist/index.d.ts CHANGED
@@ -1,8 +1,7 @@
1
- import { B as finalizeParagraphFormatting, Dn as Run, E as Style, H as setDocumentBodyComments, K as BlockContent, On as RunContent, Pn as SectionProperties, Q as BreakContent, V as isCanonicallyEmptyParagraphFormatting, Vr as NumberingDefinitions, Xn as TableCell, Yn as Table, _n as PositionalTab, cr as TextContent, ct as DocumentBackground, dn as Paragraph, fn as ParagraphContent, i as Document, ir as TableRow, lt as DocumentBackgroundDrawing, o as DocxConformanceClass, r as DOCX_CONFORMANCE_CLASSES, s as DocxPackage, ut as DocumentBody } from "./document-BkGU2ctn.js";
1
+ import { B as finalizeParagraphFormatting, Dn as Run, E as Style, H as setDocumentBodyComments, K as BlockContent, On as RunContent, Pn as SectionProperties, Q as BreakContent, V as isCanonicallyEmptyParagraphFormatting, Vr as NumberingDefinitions, Xn as TableCell, Yn as Table, _n as PositionalTab, cr as TextContent, ct as DocumentBackground, dn as Paragraph, fn as ParagraphContent, i as Document, ir as TableRow, lt as DocumentBackgroundDrawing, o as DocxConformanceClass, r as DOCX_CONFORMANCE_CLASSES, s as DocxPackage, ut as DocumentBody } from "./document-BWDHON3T.js";
2
2
  import { TaggedErrorClass } from "better-result";
3
3
  import JSZip from "jszip";
4
4
  import { Buffer } from "node:buffer";
5
- //#region src/legal-source/types.d.ts
6
5
  type LegalDocumentKind = "agreement" | "letter" | "memo" | "checklist" | "pleading" | "other";
7
6
  type LegalNumberingProfile = "legal" | "none" | "checklist";
8
7
  type LegalPageSize = "A4" | "Letter";
@@ -107,22 +106,12 @@ type LegalSourceDocxCompileResult = ({
107
106
  } & CompiledLegalDocument) | Extract<LegalSourceCompileResult, {
108
107
  status: "needs_llm_repair";
109
108
  }>;
110
- //#endregion
111
- //#region src/legal-source/compile.d.ts
112
109
  export declare const compileLegalSourceToDocument: (source: string, options?: LegalSourceCompileOptions) => LegalSourceCompileResult;
113
- //#endregion
114
- //#region src/legal-source/parser.d.ts
115
110
  export declare const parseLegalSource: (source: string, options?: {
116
111
  titleFallback?: string;
117
112
  }) => LegalSourceParseResult;
118
- //#endregion
119
- //#region src/legal-source/validate.d.ts
120
113
  export declare const validateLegalDraft: (draft: LegalDraft) => LegalDraftDiagnostic[];
121
- //#endregion
122
- //#region src/legal-source/index.d.ts
123
114
  export declare const compileLegalSourceToDocx: (source: string, options?: LegalSourceCompileOptions) => Promise<LegalSourceDocxCompileResult>;
124
- //#endregion
125
- //#region src/markdown/content.d.ts
126
115
  /** Block content and the numbering definitions its list paragraphs reference. */
127
116
  type MarkdownContent = {
128
117
  content: BlockContent[];
@@ -141,8 +130,6 @@ type MarkdownContent = {
141
130
  * (page geometry, styles, and presets are the host's decision).
142
131
  */
143
132
  export declare const compileMarkdownToContent: (markdown: string) => MarkdownContent;
144
- //#endregion
145
- //#region src/markdown/href.d.ts
146
133
  /**
147
134
  * Keep only http(s), mailto, and tel URLs, normalised through the URL parser.
148
135
  * Anything else (javascript:, data:, relative paths, malformed input) drops to
@@ -150,8 +137,6 @@ export declare const compileMarkdownToContent: (markdown: string) => MarkdownCon
150
137
  * executable target into the document.
151
138
  */
152
139
  export declare const sanitizeExternalUrl: (rawUrl: string | undefined) => string | undefined;
153
- //#endregion
154
- //#region src/serialize/docx.d.ts
155
140
  type SerializeDocumentOptions = {
156
141
  /** BCP-47 language tag (e.g. "en", "cs", "cs-CZ"); used for footer labels. */
157
142
  language?: string;
@@ -177,8 +162,6 @@ type SerializeDocumentOptions = {
177
162
  * not the other way round.
178
163
  */
179
164
  export declare const serializeDocumentToDocx: (document: Document, options?: SerializeDocumentOptions) => Promise<ArrayBuffer>;
180
- //#endregion
181
- //#region src/serialize/numericIds.d.ts
182
165
  declare const InvalidOoxmlNumericIdErrorBase: TaggedErrorClass<"InvalidOoxmlNumericIdError">;
183
166
  /** A writer would emit an identifier outside its OOXML schema's numeric domain. */
184
167
  export declare class InvalidOoxmlNumericIdError extends InvalidOoxmlNumericIdErrorBase<{
@@ -226,8 +209,6 @@ export declare const mayContainInvalidOoxmlNumericIds: (xml: string, mode?: "sch
226
209
  * Permission-range ids are strings in OOXML and intentionally remain unrestricted.
227
210
  */
228
211
  export declare const assertValidOoxmlNumericIds: (xml: string, partPath: string) => void;
229
- //#endregion
230
- //#region src/serialize/xml.d.ts
231
212
  /**
232
213
  * The one writer for a `CT_OnOff` element: `w:b`, `w:cantSplit`, `w:hideMark`,
233
214
  * every element the schema types `CT_OnOff`.
@@ -259,8 +240,6 @@ export declare const serializeOnOffElement: (value: boolean | undefined, name: s
259
240
  * that would turn an unformatted run into a `<w:rPr></w:rPr>`.
260
241
  */
261
242
  export declare const pushOnOffElement: (parts: string[], value: boolean | undefined, name: string) => void;
262
- //#endregion
263
- //#region src/serialize/xmlEscape.d.ts
264
243
  /** Escape a value for XML element content. Tab and LF survive as themselves. */
265
244
  export declare const escapeXmlText: (value: string) => string;
266
245
  /**
@@ -282,8 +261,6 @@ export declare const hasIllegalXmlCharacters: (value: string) => boolean;
282
261
  * further down, but by then nobody can say which input lost a character.
283
262
  */
284
263
  export declare const sanitizeXmlCharacters: (value: string) => string;
285
- //#endregion
286
- //#region src/serialize/textWhitespace.d.ts
287
264
  /**
288
265
  * Whether `<w:t>` needs `xml:space="preserve"` to render the text as written.
289
266
  *
@@ -295,8 +272,6 @@ export declare const sanitizeXmlCharacters: (value: string) => string;
295
272
  * runs merged, because ProseMirror has nowhere to carry it.
296
273
  */
297
274
  export declare const requiresXmlSpacePreserve: (text: string) => boolean;
298
- //#endregion
299
- //#region src/validate/docx.d.ts
300
275
  declare module "jszip" {
301
276
  interface JSZipObject {
302
277
  /** Chunked read of the entry content, missing from the published typings. */
@@ -332,5 +307,4 @@ type ValidateDocumentModelResult = {
332
307
  export declare const validateDocxPackage: (buffer: ArrayBuffer | Uint8Array) => Promise<ValidateDocxPackageResult>;
333
308
  export declare const validateDocumentModel: (document: Document) => ValidateDocumentModelResult;
334
309
  export declare const assertValidDocumentModel: (document: Document) => void;
335
- //#endregion
336
310
  export { type Autofix, type BlockContent, type BreakContent, type CompiledLegalDocument, DOCX_CONFORMANCE_CLASSES, 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, finalizeParagraphFormatting, isCanonicallyEmptyParagraphFormatting, setDocumentBodyComments };