@stll/docx-core 0.39.0 → 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.
- package/dist/{document-BkGU2ctn.d.ts → document-BWDHON3T.d.ts} +1 -47
- package/dist/{document-oU-dz9zs.js → document-NtScxyHH.js} +18 -36
- package/dist/docx_kernel_bg.wasm +0 -0
- package/dist/{href-2XSCK-T8.js → href-ogmJmncc.js} +2 -4
- package/dist/index.d.ts +4 -68
- package/dist/index.js +23 -37
- package/dist/model/document.d.ts +2 -2
- package/dist/model/document.js +1 -1
- package/dist/ops/documentOps.d.ts +9 -79
- package/dist/ops/documentOps.js +63 -112
- package/dist/{preservedMarkup-G8XjWhs2.d.ts → preservedMarkup-9L4lbGnE.d.ts} +0 -2
- package/dist/projection.d.ts +5 -8
- package/dist/projection.js +6 -6
- package/dist/schema/sequenceChildren.d.ts +1 -5
- package/dist/schema/sequenceChildren.js +1 -1
- package/dist/{sequenceChildren-ByDxvF4j.js → sequenceChildren-CrMcryEF.js} +4 -5
- package/dist/zip/writeZipPart.d.ts +0 -2
- package/dist/zip/writeZipPart.js +1 -2
- package/package.json +2 -2
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import { n as PreservedChild, r as PreservedMarkup, t as PreservedAttribute } from "./preservedMarkup-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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 };
|
package/dist/docx_kernel_bg.wasm
CHANGED
|
Binary file
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
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
|
-
|
|
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,7 +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-
|
|
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
|
+
import { TaggedErrorClass } from "better-result";
|
|
2
3
|
import JSZip from "jszip";
|
|
3
4
|
import { Buffer } from "node:buffer";
|
|
4
|
-
//#region src/legal-source/types.d.ts
|
|
5
5
|
type LegalDocumentKind = "agreement" | "letter" | "memo" | "checklist" | "pleading" | "other";
|
|
6
6
|
type LegalNumberingProfile = "legal" | "none" | "checklist";
|
|
7
7
|
type LegalPageSize = "A4" | "Letter";
|
|
@@ -106,22 +106,12 @@ type LegalSourceDocxCompileResult = ({
|
|
|
106
106
|
} & CompiledLegalDocument) | Extract<LegalSourceCompileResult, {
|
|
107
107
|
status: "needs_llm_repair";
|
|
108
108
|
}>;
|
|
109
|
-
//#endregion
|
|
110
|
-
//#region src/legal-source/compile.d.ts
|
|
111
109
|
export declare const compileLegalSourceToDocument: (source: string, options?: LegalSourceCompileOptions) => LegalSourceCompileResult;
|
|
112
|
-
//#endregion
|
|
113
|
-
//#region src/legal-source/parser.d.ts
|
|
114
110
|
export declare const parseLegalSource: (source: string, options?: {
|
|
115
111
|
titleFallback?: string;
|
|
116
112
|
}) => LegalSourceParseResult;
|
|
117
|
-
//#endregion
|
|
118
|
-
//#region src/legal-source/validate.d.ts
|
|
119
113
|
export declare const validateLegalDraft: (draft: LegalDraft) => LegalDraftDiagnostic[];
|
|
120
|
-
//#endregion
|
|
121
|
-
//#region src/legal-source/index.d.ts
|
|
122
114
|
export declare const compileLegalSourceToDocx: (source: string, options?: LegalSourceCompileOptions) => Promise<LegalSourceDocxCompileResult>;
|
|
123
|
-
//#endregion
|
|
124
|
-
//#region src/markdown/content.d.ts
|
|
125
115
|
/** Block content and the numbering definitions its list paragraphs reference. */
|
|
126
116
|
type MarkdownContent = {
|
|
127
117
|
content: BlockContent[];
|
|
@@ -140,8 +130,6 @@ type MarkdownContent = {
|
|
|
140
130
|
* (page geometry, styles, and presets are the host's decision).
|
|
141
131
|
*/
|
|
142
132
|
export declare const compileMarkdownToContent: (markdown: string) => MarkdownContent;
|
|
143
|
-
//#endregion
|
|
144
|
-
//#region src/markdown/href.d.ts
|
|
145
133
|
/**
|
|
146
134
|
* Keep only http(s), mailto, and tel URLs, normalised through the URL parser.
|
|
147
135
|
* Anything else (javascript:, data:, relative paths, malformed input) drops to
|
|
@@ -149,8 +137,6 @@ export declare const compileMarkdownToContent: (markdown: string) => MarkdownCon
|
|
|
149
137
|
* executable target into the document.
|
|
150
138
|
*/
|
|
151
139
|
export declare const sanitizeExternalUrl: (rawUrl: string | undefined) => string | undefined;
|
|
152
|
-
//#endregion
|
|
153
|
-
//#region src/serialize/docx.d.ts
|
|
154
140
|
type SerializeDocumentOptions = {
|
|
155
141
|
/** BCP-47 language tag (e.g. "en", "cs", "cs-CZ"); used for footer labels. */
|
|
156
142
|
language?: string;
|
|
@@ -176,11 +162,9 @@ type SerializeDocumentOptions = {
|
|
|
176
162
|
* not the other way round.
|
|
177
163
|
*/
|
|
178
164
|
export declare const serializeDocumentToDocx: (document: Document, options?: SerializeDocumentOptions) => Promise<ArrayBuffer>;
|
|
179
|
-
|
|
180
|
-
//#region src/serialize/numericIds.d.ts
|
|
181
|
-
declare const InvalidOoxmlNumericIdError_base: import("better-result").TaggedErrorClass<"InvalidOoxmlNumericIdError">;
|
|
165
|
+
declare const InvalidOoxmlNumericIdErrorBase: TaggedErrorClass<"InvalidOoxmlNumericIdError">;
|
|
182
166
|
/** A writer would emit an identifier outside its OOXML schema's numeric domain. */
|
|
183
|
-
export declare class InvalidOoxmlNumericIdError extends
|
|
167
|
+
export declare class InvalidOoxmlNumericIdError extends InvalidOoxmlNumericIdErrorBase<{
|
|
184
168
|
message: string;
|
|
185
169
|
partPath: string;
|
|
186
170
|
elementName: string;
|
|
@@ -225,8 +209,6 @@ export declare const mayContainInvalidOoxmlNumericIds: (xml: string, mode?: "sch
|
|
|
225
209
|
* Permission-range ids are strings in OOXML and intentionally remain unrestricted.
|
|
226
210
|
*/
|
|
227
211
|
export declare const assertValidOoxmlNumericIds: (xml: string, partPath: string) => void;
|
|
228
|
-
//#endregion
|
|
229
|
-
//#region src/serialize/xml.d.ts
|
|
230
212
|
/**
|
|
231
213
|
* The one writer for a `CT_OnOff` element: `w:b`, `w:cantSplit`, `w:hideMark`,
|
|
232
214
|
* every element the schema types `CT_OnOff`.
|
|
@@ -258,47 +240,6 @@ export declare const serializeOnOffElement: (value: boolean | undefined, name: s
|
|
|
258
240
|
* that would turn an unformatted run into a `<w:rPr></w:rPr>`.
|
|
259
241
|
*/
|
|
260
242
|
export declare const pushOnOffElement: (parts: string[], value: boolean | undefined, name: string) => void;
|
|
261
|
-
//#endregion
|
|
262
|
-
//#region src/serialize/xmlEscape.d.ts
|
|
263
|
-
/**
|
|
264
|
-
* The one owner of XML character escaping for every part folio writes.
|
|
265
|
-
*
|
|
266
|
-
* Two contexts, two functions. A value going into element content takes
|
|
267
|
-
* {@link escapeXmlText}; a value going between the quotes of an attribute
|
|
268
|
-
* takes {@link escapeXmlAttribute}. Nothing else escapes XML by hand: a
|
|
269
|
-
* second escaper always ends up disagreeing with this one about some
|
|
270
|
-
* character, and the disagreement is a package Word refuses to open.
|
|
271
|
-
*
|
|
272
|
-
* Both functions guarantee the same contract: **the result is always legal
|
|
273
|
-
* XML 1.0 character data.** That is what makes the contract checkable — a
|
|
274
|
-
* caller cannot produce a corrupt part by forgetting something.
|
|
275
|
-
*
|
|
276
|
-
* XML 1.0 §2.2 `Char` admits tab, LF, CR, `#x20`-`#xD7FF`, `#xE000`-`#xFFFD`
|
|
277
|
-
* and the astral planes. Everything else — the rest of C0, `#xFFFE`,
|
|
278
|
-
* `#xFFFF`, an unpaired surrogate — cannot appear in a document at all, and
|
|
279
|
-
* cannot be escaped into one either: `�` is as illegal as a raw NUL
|
|
280
|
-
* (§4.1 requires a character reference to refer to a legal `Char`). The only
|
|
281
|
-
* output that is well-formed is one without them, so they are dropped here.
|
|
282
|
-
* Callers that own an input boundary sanitise before this point, with
|
|
283
|
-
* `sanitizeXmlCharacters`, so a user-visible value loses its illegal
|
|
284
|
-
* characters where something can still report it; the drop below is the last
|
|
285
|
-
* line of defence for a boundary nobody has covered yet.
|
|
286
|
-
*
|
|
287
|
-
* The whitespace rules are where the two contexts part:
|
|
288
|
-
*
|
|
289
|
-
* - §3.3.3 normalises tab, LF and CR in an **attribute value** to a space in
|
|
290
|
-
* every conformant parser, so a literal one does not survive a save. They
|
|
291
|
-
* are written as character references, which the same step leaves alone.
|
|
292
|
-
* - §2.11 normalises a literal CR (and CRLF) in **content** to LF on read, so
|
|
293
|
-
* CR is written as a reference there too. Tab and LF survive as themselves.
|
|
294
|
-
*
|
|
295
|
-
* Both contexts escape all five of `& < > " '`. Only `&` and `<` must be
|
|
296
|
-
* escaped in content, but folio has always written the full set, `>` closes
|
|
297
|
-
* the `]]>` hazard of §2.4 without a special case, and one lexical form
|
|
298
|
-
* across every writer is worth more than the bytes it costs. Every spelling
|
|
299
|
-
* here reads back as the character it stands for, so the rule preserves the
|
|
300
|
-
* value whichever context it lands in.
|
|
301
|
-
*/
|
|
302
243
|
/** Escape a value for XML element content. Tab and LF survive as themselves. */
|
|
303
244
|
export declare const escapeXmlText: (value: string) => string;
|
|
304
245
|
/**
|
|
@@ -320,8 +261,6 @@ export declare const hasIllegalXmlCharacters: (value: string) => boolean;
|
|
|
320
261
|
* further down, but by then nobody can say which input lost a character.
|
|
321
262
|
*/
|
|
322
263
|
export declare const sanitizeXmlCharacters: (value: string) => string;
|
|
323
|
-
//#endregion
|
|
324
|
-
//#region src/serialize/textWhitespace.d.ts
|
|
325
264
|
/**
|
|
326
265
|
* Whether `<w:t>` needs `xml:space="preserve"` to render the text as written.
|
|
327
266
|
*
|
|
@@ -333,8 +272,6 @@ export declare const sanitizeXmlCharacters: (value: string) => string;
|
|
|
333
272
|
* runs merged, because ProseMirror has nowhere to carry it.
|
|
334
273
|
*/
|
|
335
274
|
export declare const requiresXmlSpacePreserve: (text: string) => boolean;
|
|
336
|
-
//#endregion
|
|
337
|
-
//#region src/validate/docx.d.ts
|
|
338
275
|
declare module "jszip" {
|
|
339
276
|
interface JSZipObject {
|
|
340
277
|
/** Chunked read of the entry content, missing from the published typings. */
|
|
@@ -370,5 +307,4 @@ type ValidateDocumentModelResult = {
|
|
|
370
307
|
export declare const validateDocxPackage: (buffer: ArrayBuffer | Uint8Array) => Promise<ValidateDocxPackageResult>;
|
|
371
308
|
export declare const validateDocumentModel: (document: Document) => ValidateDocumentModelResult;
|
|
372
309
|
export declare const assertValidDocumentModel: (document: Document) => void;
|
|
373
|
-
//#endregion
|
|
374
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 };
|