@office-open/docx 0.7.0 → 0.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +12 -6
- package/dist/index.d.mts +750 -91
- package/dist/index.d.mts.map +1 -1
- package/dist/index.mjs +2223 -588
- package/dist/index.mjs.map +1 -1
- package/package.json +4 -5
package/dist/index.mjs
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { i as __toCommonJS, n as __exportAll, r as __reExport, t as __esmMin } from "./chunk-DHfcOUro.mjs";
|
|
2
|
-
import { AppProperties, BaseXmlComponent, BuilderElement, BuilderElement as BuilderElement$1, DOCX_NS, EMPTY_OBJECT, EmptyElement, Formatter, Formatter as Formatter$1, IgnoreIfEmptyXmlComponent, ImportedRootElementAttributes, ImportedXmlComponent, InitializableXmlComponent, OoxmlMimeType, RawPassthrough, Relationships, TargetModeType, XmlComponent, addSmartArtRelationships, appendContentType, appendRelationship, attrObj, chartAttr, convertEmuToPixels, convertInchesToTwip, convertMillimetersToTwip, convertPixelsToEmu, convertToXmlComponent, createDefault, createOverride, createPacker, createReplacer, createTraverser, getNextRelationshipIndex, getReferencedMedia, hasPlaceholders, hashedId, hpsMeasureObj, hpsMeasureObj as hpsMeasureObj$1, numberValObj, numberValObj as numberValObj$1, onOffObj, onOffObj as onOffObj$1, parseArchive, parseCorePropsElement, replaceChartPlaceholders, replaceImagePlaceholders, replaceSmartArtPlaceholders, strFromU8, stringContainerObj, stringEnumValObj, stringEnumValObj as stringEnumValObj$1, stringValObj, stringValObj as stringValObj$1, toJson, uniqueId, uniqueNumericIdCreator, uniqueNumericIdCreator as uniqueNumericIdCreator$1, uniqueUuid, unzipSync, wrapEl, xsdVerticalMergeRev, zipAndConvert } from "@office-open/core";
|
|
2
|
+
import { AppProperties, BaseXmlComponent, BuilderElement, BuilderElement as BuilderElement$1, DOCX_NS, EMPTY_OBJECT, EmptyElement, Formatter, Formatter as Formatter$1, IgnoreIfEmptyXmlComponent, ImportedRootElementAttributes, ImportedXmlComponent, InitializableXmlComponent, OoxmlMimeType, RawPassthrough, Relationships, TargetModeType, XmlComponent, addSmartArtRelationships, appendContentType, appendRelationship, attrObj, chartAttr, convertEmuToPixels, convertInchesToTwip, convertMillimetersToTwip, convertPixelsToEmu, convertToXmlComponent, createDefault, createOverride, createPacker, createReplacer, createTraverser, derivePasswordHash, getNextRelationshipIndex, getReferencedMedia, hasPlaceholders, hashedId, hpsMeasureObj, hpsMeasureObj as hpsMeasureObj$1, numberValObj, numberValObj as numberValObj$1, onOffObj, onOffObj as onOffObj$1, parseArchive, parseCorePropsElement, replaceChartPlaceholders, replaceImagePlaceholders, replaceSmartArtPlaceholders, strFromU8, stringContainerObj, stringEnumValObj, stringEnumValObj as stringEnumValObj$1, stringValObj, stringValObj as stringValObj$1, toJson, toUint8Array, uniqueId, uniqueNumericIdCreator, uniqueNumericIdCreator as uniqueNumericIdCreator$1, uniqueUuid, unzipSync, wrapEl, xsdVerticalMergeRev, zipAndConvert } from "@office-open/core";
|
|
3
3
|
import { attr, attrBool, attrNum, children, colorAttr, findChild, findDeep, js2xml, textOf, xml, xml2js } from "@office-open/xml";
|
|
4
|
-
import { toUint8Array } from "undio";
|
|
5
4
|
import { PresetGeometry, buildFill, createBlipFill, createCustomGeometry, createEffectDag, createEffectList, createOutline, createScene3D, createShape3D, createTransform2D, extractBlipFillMedia } from "@office-open/core/drawingml";
|
|
6
5
|
import { ChartCollection, ChartSpace } from "@office-open/core/chart";
|
|
7
6
|
import { COLOR_CATEGORIES, DEFAULT_DRAWING_XML, LAYOUT_CATEGORIES, STYLE_CATEGORIES, SmartArtCollection, createDataModel, getColorXml, getLayoutXml, getStyleXml } from "@office-open/core/smartart";
|
|
@@ -213,6 +212,7 @@ function buildParagraphBorders(options) {
|
|
|
213
212
|
if (options.bottom) children.push(buildBorderObj("w:bottom", options.bottom));
|
|
214
213
|
if (options.right) children.push(buildBorderObj("w:right", options.right));
|
|
215
214
|
if (options.between) children.push(buildBorderObj("w:between", options.between));
|
|
215
|
+
if (options.bar) children.push(buildBorderObj("w:bar", options.bar));
|
|
216
216
|
return children.length > 0 ? { "w:pBdr": children } : void 0;
|
|
217
217
|
}
|
|
218
218
|
/**
|
|
@@ -238,6 +238,7 @@ var init_border = __esmMin((() => {
|
|
|
238
238
|
if (options.bottom) this.root.push(createBorderElement("w:bottom", options.bottom));
|
|
239
239
|
if (options.right) this.root.push(createBorderElement("w:right", options.right));
|
|
240
240
|
if (options.between) this.root.push(createBorderElement("w:between", options.between));
|
|
241
|
+
if (options.bar) this.root.push(createBorderElement("w:bar", options.bar));
|
|
241
242
|
}
|
|
242
243
|
};
|
|
243
244
|
ThematicBreak = class extends XmlComponent {
|
|
@@ -588,8 +589,9 @@ var init_field = __esmMin((() => {
|
|
|
588
589
|
END: "end",
|
|
589
590
|
SEPARATE: "separate"
|
|
590
591
|
};
|
|
591
|
-
createFieldChar = (type, dirty, ffData) => {
|
|
592
|
+
createFieldChar = (type, dirty, ffData, fldData, fieldLock) => {
|
|
592
593
|
const children = [];
|
|
594
|
+
if (fldData !== void 0) children.push({ "w:fldData": [{ _attr: { "xml:space": "preserve" } }, fldData] });
|
|
593
595
|
if (ffData) children.push(ffData);
|
|
594
596
|
return new BuilderElement({
|
|
595
597
|
attributes: {
|
|
@@ -597,6 +599,10 @@ var init_field = __esmMin((() => {
|
|
|
597
599
|
key: "w:dirty",
|
|
598
600
|
value: dirty
|
|
599
601
|
},
|
|
602
|
+
fieldLock: {
|
|
603
|
+
key: "w:fldLock",
|
|
604
|
+
value: fieldLock
|
|
605
|
+
},
|
|
600
606
|
type: {
|
|
601
607
|
key: "w:fldCharType",
|
|
602
608
|
value: type
|
|
@@ -606,7 +612,7 @@ var init_field = __esmMin((() => {
|
|
|
606
612
|
name: "w:fldChar"
|
|
607
613
|
});
|
|
608
614
|
};
|
|
609
|
-
createBegin = (dirty, formField) => createFieldChar(FieldCharacterType.BEGIN, dirty, formField ? createFormFieldData(formField) : void 0);
|
|
615
|
+
createBegin = (dirty, formField, fieldLock) => createFieldChar(FieldCharacterType.BEGIN, dirty, formField ? createFormFieldData(formField) : void 0, void 0, fieldLock);
|
|
610
616
|
createSeparate = (dirty) => createFieldChar(FieldCharacterType.SEPARATE, dirty);
|
|
611
617
|
createEnd = (dirty) => createFieldChar(FieldCharacterType.END, dirty);
|
|
612
618
|
}));
|
|
@@ -1019,7 +1025,7 @@ var init_underline = __esmMin((() => {
|
|
|
1019
1025
|
//#region src/file/paragraph/run/properties.ts
|
|
1020
1026
|
/**
|
|
1021
1027
|
* Build run properties (w:rPr) as IXmlableObject without allocating XmlComponent tree.
|
|
1022
|
-
* Used by Run.
|
|
1028
|
+
* Used by Run.toXml for O(1) construction.
|
|
1023
1029
|
*/
|
|
1024
1030
|
function buildRunProperties(options) {
|
|
1025
1031
|
if (!options) return void 0;
|
|
@@ -1070,6 +1076,7 @@ function buildRunProperties(options) {
|
|
|
1070
1076
|
if (options.fitText !== void 0) children.push(numberValObj$1("w:fitText", options.fitText));
|
|
1071
1077
|
if (options.complexScript !== void 0) children.push(onOffObj$1("w:cs", options.complexScript));
|
|
1072
1078
|
if (options.eastAsianLayout) children.push(buildEastAsianLayoutObj(options.eastAsianLayout));
|
|
1079
|
+
if (options.contentPartRId) children.push({ "w:contentPart": { _attr: { "r:id": options.contentPartRId } } });
|
|
1073
1080
|
if (options.revision) {
|
|
1074
1081
|
const rev = options.revision;
|
|
1075
1082
|
const { author: _, date: __, id: ___, ...originalProps } = rev;
|
|
@@ -1340,7 +1347,7 @@ var init_run$1 = __esmMin((() => {
|
|
|
1340
1347
|
constructor(options) {
|
|
1341
1348
|
super("w:r");
|
|
1342
1349
|
this.options = options;
|
|
1343
|
-
if (!options.children && !options.break) {
|
|
1350
|
+
if (!options.children && !options.break && !options.rsidRPr && !options.rsidDel) {
|
|
1344
1351
|
const rPr = buildRunProperties(options);
|
|
1345
1352
|
const text = options.text !== void 0 ? buildText(options.text) : void 0;
|
|
1346
1353
|
if (rPr || text) {
|
|
@@ -1351,64 +1358,67 @@ var init_run$1 = __esmMin((() => {
|
|
|
1351
1358
|
}
|
|
1352
1359
|
}
|
|
1353
1360
|
}
|
|
1354
|
-
|
|
1355
|
-
|
|
1361
|
+
/**
|
|
1362
|
+
* Hook for subclasses to register resources before serialization.
|
|
1363
|
+
* Called once per run during toXml().
|
|
1364
|
+
*/
|
|
1365
|
+
registerResources(_context) {}
|
|
1366
|
+
toXml(context) {
|
|
1367
|
+
if (this._prebuilt && this.extraChildren.length === 0) return xml(this._prebuilt);
|
|
1368
|
+
this.registerResources(context);
|
|
1369
|
+
const parts = [];
|
|
1356
1370
|
const rPr = buildRunProperties(this.options);
|
|
1357
|
-
|
|
1358
|
-
if (
|
|
1359
|
-
if (this.options.break) for (let i = 0; i < this.options.break; i++) children.push(createBreak().prepForXml(context));
|
|
1371
|
+
if (rPr) parts.push(xml(rPr));
|
|
1372
|
+
if (this.options.break) for (let i = 0; i < this.options.break; i++) parts.push(createBreak().toXml(context));
|
|
1360
1373
|
if (this.options.children) for (const child of this.options.children) {
|
|
1361
1374
|
if (typeof child === "string") {
|
|
1362
1375
|
switch (child) {
|
|
1363
1376
|
case PageNumber.CURRENT:
|
|
1364
|
-
|
|
1365
|
-
|
|
1366
|
-
|
|
1367
|
-
|
|
1377
|
+
parts.push(createBegin().toXml(context));
|
|
1378
|
+
parts.push(xml(buildPage()));
|
|
1379
|
+
parts.push(createSeparate().toXml(context));
|
|
1380
|
+
parts.push(createEnd().toXml(context));
|
|
1368
1381
|
break;
|
|
1369
1382
|
case PageNumber.TOTAL_PAGES:
|
|
1370
|
-
|
|
1371
|
-
|
|
1372
|
-
|
|
1373
|
-
|
|
1383
|
+
parts.push(createBegin().toXml(context));
|
|
1384
|
+
parts.push(xml(buildNumberOfPages()));
|
|
1385
|
+
parts.push(createSeparate().toXml(context));
|
|
1386
|
+
parts.push(createEnd().toXml(context));
|
|
1374
1387
|
break;
|
|
1375
1388
|
case PageNumber.TOTAL_PAGES_IN_SECTION:
|
|
1376
|
-
|
|
1377
|
-
|
|
1378
|
-
|
|
1379
|
-
|
|
1389
|
+
parts.push(createBegin().toXml(context));
|
|
1390
|
+
parts.push(xml(buildNumberOfPagesSection()));
|
|
1391
|
+
parts.push(createSeparate().toXml(context));
|
|
1392
|
+
parts.push(createEnd().toXml(context));
|
|
1380
1393
|
break;
|
|
1381
1394
|
case PageNumber.CURRENT_SECTION:
|
|
1382
|
-
|
|
1383
|
-
|
|
1384
|
-
|
|
1385
|
-
|
|
1395
|
+
parts.push(createBegin().toXml(context));
|
|
1396
|
+
parts.push(xml(buildCurrentSection()));
|
|
1397
|
+
parts.push(createSeparate().toXml(context));
|
|
1398
|
+
parts.push(createEnd().toXml(context));
|
|
1386
1399
|
break;
|
|
1387
1400
|
default:
|
|
1388
|
-
|
|
1401
|
+
parts.push(xml(buildText(child)));
|
|
1389
1402
|
break;
|
|
1390
1403
|
}
|
|
1391
1404
|
continue;
|
|
1392
1405
|
}
|
|
1393
1406
|
if (child instanceof BaseXmlComponent) {
|
|
1394
|
-
const
|
|
1395
|
-
if (
|
|
1396
|
-
} else
|
|
1407
|
+
const s = child.toXml(context);
|
|
1408
|
+
if (s) parts.push(s);
|
|
1409
|
+
} else parts.push(xml(child));
|
|
1397
1410
|
}
|
|
1398
|
-
else if (this.options.text !== void 0)
|
|
1411
|
+
else if (this.options.text !== void 0) parts.push(xml(buildText(this.options.text)));
|
|
1399
1412
|
for (const child of this.extraChildren) if (child instanceof BaseXmlComponent) {
|
|
1400
|
-
const
|
|
1401
|
-
if (
|
|
1402
|
-
} else
|
|
1403
|
-
|
|
1404
|
-
|
|
1405
|
-
|
|
1406
|
-
|
|
1407
|
-
|
|
1408
|
-
|
|
1409
|
-
if (this._prebuilt && this.extraChildren.length === 0) return xml(this._prebuilt);
|
|
1410
|
-
const obj = this.prepForXml(context);
|
|
1411
|
-
return obj ? xml(obj) : "";
|
|
1413
|
+
const s = child.toXml(context);
|
|
1414
|
+
if (s) parts.push(s);
|
|
1415
|
+
} else parts.push(xml(child));
|
|
1416
|
+
const body = parts.join("");
|
|
1417
|
+
const rsidAttrs = [];
|
|
1418
|
+
if (this.options.rsidRPr) rsidAttrs.push(` w:rsidRPr="${this.options.rsidRPr}"`);
|
|
1419
|
+
if (this.options.rsidDel) rsidAttrs.push(` w:rsidDel="${this.options.rsidDel}"`);
|
|
1420
|
+
const attr = rsidAttrs.join("");
|
|
1421
|
+
return body.length === 0 ? attr ? `<w:r${attr}/>` : "<w:r/>" : `<w:r${attr}>${body}</w:r>`;
|
|
1412
1422
|
}
|
|
1413
1423
|
};
|
|
1414
1424
|
}));
|
|
@@ -3044,10 +3054,9 @@ var init_image_run = __esmMin((() => {
|
|
|
3044
3054
|
});
|
|
3045
3055
|
this.extraChildren.push(drawing);
|
|
3046
3056
|
}
|
|
3047
|
-
|
|
3057
|
+
registerResources(context) {
|
|
3048
3058
|
context.file.media.addImage(this.imageData.fileName, this.imageData);
|
|
3049
3059
|
if (this.imageData.type === "svg") context.file.media.addImage(this.imageData.fallback.fileName, this.imageData.fallback);
|
|
3050
|
-
return super.prepForXml(context);
|
|
3051
3060
|
}
|
|
3052
3061
|
};
|
|
3053
3062
|
}));
|
|
@@ -3080,7 +3089,7 @@ var init_chart_run = __esmMin((() => {
|
|
|
3080
3089
|
});
|
|
3081
3090
|
this.extraChildren.push(drawing);
|
|
3082
3091
|
}
|
|
3083
|
-
|
|
3092
|
+
registerResources(context) {
|
|
3084
3093
|
const chartSpace = new ChartSpace({
|
|
3085
3094
|
categories: this.chartOptions.data.categories,
|
|
3086
3095
|
series: this.chartOptions.data.series,
|
|
@@ -3094,7 +3103,6 @@ var init_chart_run = __esmMin((() => {
|
|
|
3094
3103
|
chartSpace,
|
|
3095
3104
|
key: this.chartKey
|
|
3096
3105
|
});
|
|
3097
|
-
return super.prepForXml(context);
|
|
3098
3106
|
}
|
|
3099
3107
|
};
|
|
3100
3108
|
}));
|
|
@@ -3127,7 +3135,7 @@ var init_smartart_run = __esmMin((() => {
|
|
|
3127
3135
|
});
|
|
3128
3136
|
this.extraChildren.push(drawing);
|
|
3129
3137
|
}
|
|
3130
|
-
|
|
3138
|
+
registerResources(context) {
|
|
3131
3139
|
const layoutId = this.smartArtOptions.layout ?? "default";
|
|
3132
3140
|
const styleId = this.smartArtOptions.style ?? "simple1";
|
|
3133
3141
|
const colorId = this.smartArtOptions.color ?? "accent1_2";
|
|
@@ -3139,7 +3147,6 @@ var init_smartart_run = __esmMin((() => {
|
|
|
3139
3147
|
color: colorId
|
|
3140
3148
|
};
|
|
3141
3149
|
context.file.smartArts.addSmartArt(this.smartArtKey, smartArtData);
|
|
3142
|
-
return super.prepForXml(context);
|
|
3143
3150
|
}
|
|
3144
3151
|
hashSmartArtData(options) {
|
|
3145
3152
|
const data = JSON.stringify(options.data);
|
|
@@ -3204,12 +3211,11 @@ var init_wpg_group_run = __esmMin((() => {
|
|
|
3204
3211
|
this.mediaDatas = options.children.filter((child) => child.type !== "wps").map((child) => child);
|
|
3205
3212
|
this.extraChildren.push(drawing);
|
|
3206
3213
|
}
|
|
3207
|
-
|
|
3214
|
+
registerResources(context) {
|
|
3208
3215
|
for (const child of this.mediaDatas) {
|
|
3209
3216
|
context.file.media.addImage(child.fileName, child);
|
|
3210
3217
|
if (child.type === "svg") context.file.media.addImage(child.fallback.fileName, child.fallback);
|
|
3211
3218
|
}
|
|
3212
|
-
return super.prepForXml(context);
|
|
3213
3219
|
}
|
|
3214
3220
|
};
|
|
3215
3221
|
}));
|
|
@@ -3614,18 +3620,22 @@ var init_bookmark = __esmMin((() => {
|
|
|
3614
3620
|
}
|
|
3615
3621
|
};
|
|
3616
3622
|
BookmarkStart = class extends XmlComponent {
|
|
3617
|
-
constructor(id, linkId) {
|
|
3623
|
+
constructor(id, linkId, displacedByCustomXml) {
|
|
3618
3624
|
super("w:bookmarkStart");
|
|
3619
|
-
|
|
3625
|
+
const attrs = {
|
|
3620
3626
|
"w:id": linkId,
|
|
3621
3627
|
"w:name": id
|
|
3622
|
-
}
|
|
3628
|
+
};
|
|
3629
|
+
if (displacedByCustomXml !== void 0) attrs["w:displacedByCustomXml"] = displacedByCustomXml;
|
|
3630
|
+
this.root.push({ _attr: attrs });
|
|
3623
3631
|
}
|
|
3624
3632
|
};
|
|
3625
3633
|
BookmarkEnd = class extends XmlComponent {
|
|
3626
|
-
constructor(linkId) {
|
|
3634
|
+
constructor(linkId, displacedByCustomXml) {
|
|
3627
3635
|
super("w:bookmarkEnd");
|
|
3628
|
-
|
|
3636
|
+
const attrs = { "w:id": linkId };
|
|
3637
|
+
if (displacedByCustomXml !== void 0) attrs["w:displacedByCustomXml"] = displacedByCustomXml;
|
|
3638
|
+
this.root.push({ _attr: attrs });
|
|
3629
3639
|
}
|
|
3630
3640
|
};
|
|
3631
3641
|
}));
|
|
@@ -3810,13 +3820,32 @@ var init_math_accent_character = __esmMin((() => {
|
|
|
3810
3820
|
}));
|
|
3811
3821
|
//#endregion
|
|
3812
3822
|
//#region src/file/paragraph/math/n-ary/math-base.ts
|
|
3813
|
-
var createMathBase;
|
|
3823
|
+
var createMathArgProperties, createMathBase;
|
|
3814
3824
|
var init_math_base = __esmMin((() => {
|
|
3815
3825
|
init_xml_components();
|
|
3816
|
-
|
|
3817
|
-
children
|
|
3818
|
-
|
|
3819
|
-
|
|
3826
|
+
createMathArgProperties = (options) => {
|
|
3827
|
+
const children = [];
|
|
3828
|
+
if (options.argSz !== void 0) children.push(new BuilderElement({
|
|
3829
|
+
attributes: { val: {
|
|
3830
|
+
key: "m:val",
|
|
3831
|
+
value: options.argSz
|
|
3832
|
+
} },
|
|
3833
|
+
name: "m:argSz"
|
|
3834
|
+
}));
|
|
3835
|
+
return new BuilderElement({
|
|
3836
|
+
children,
|
|
3837
|
+
name: "m:argPr"
|
|
3838
|
+
});
|
|
3839
|
+
};
|
|
3840
|
+
createMathBase = ({ children, argPr }) => {
|
|
3841
|
+
const allChildren = [];
|
|
3842
|
+
if (argPr) allChildren.push(createMathArgProperties(argPr));
|
|
3843
|
+
allChildren.push(...children);
|
|
3844
|
+
return new BuilderElement({
|
|
3845
|
+
children: allChildren,
|
|
3846
|
+
name: "m:e"
|
|
3847
|
+
});
|
|
3848
|
+
};
|
|
3820
3849
|
}));
|
|
3821
3850
|
//#endregion
|
|
3822
3851
|
//#region src/file/paragraph/math/n-ary/math-limit-location.ts
|
|
@@ -4718,6 +4747,33 @@ var init_math_matrix_properties = __esmMin((() => {
|
|
|
4718
4747
|
} },
|
|
4719
4748
|
name: "m:cGp"
|
|
4720
4749
|
}));
|
|
4750
|
+
if (options.mcs !== void 0 && options.mcs.length > 0) children.push(new BuilderElement({
|
|
4751
|
+
children: options.mcs.map((mc) => {
|
|
4752
|
+
const mcPrChildren = [];
|
|
4753
|
+
if (mc.count !== void 0) mcPrChildren.push(new BuilderElement({
|
|
4754
|
+
attributes: { val: {
|
|
4755
|
+
key: "m:val",
|
|
4756
|
+
value: mc.count
|
|
4757
|
+
} },
|
|
4758
|
+
name: "m:count"
|
|
4759
|
+
}));
|
|
4760
|
+
if (mc.mcJc !== void 0) mcPrChildren.push(new BuilderElement({
|
|
4761
|
+
attributes: { val: {
|
|
4762
|
+
key: "m:val",
|
|
4763
|
+
value: mc.mcJc
|
|
4764
|
+
} },
|
|
4765
|
+
name: "m:mcJc"
|
|
4766
|
+
}));
|
|
4767
|
+
return new BuilderElement({
|
|
4768
|
+
children: [new BuilderElement({
|
|
4769
|
+
children: mcPrChildren,
|
|
4770
|
+
name: "m:mcPr"
|
|
4771
|
+
})],
|
|
4772
|
+
name: "m:mc"
|
|
4773
|
+
});
|
|
4774
|
+
}),
|
|
4775
|
+
name: "m:mcs"
|
|
4776
|
+
}));
|
|
4721
4777
|
return new BuilderElement({
|
|
4722
4778
|
children,
|
|
4723
4779
|
name: "m:mPr"
|
|
@@ -5821,17 +5877,28 @@ MAX: 9026 };
|
|
|
5821
5877
|
/**
|
|
5822
5878
|
* Build numbering properties (w:numPr) as IXmlableObject without allocating XmlComponent tree.
|
|
5823
5879
|
*/
|
|
5824
|
-
function buildNumberProperties(numberId, indentLevel) {
|
|
5825
|
-
|
|
5880
|
+
function buildNumberProperties(numberId, indentLevel, numberingChange) {
|
|
5881
|
+
const children = [{ "w:ilvl": { _attr: { "w:val": Math.min(indentLevel, 9) } } }, { "w:numId": { _attr: { "w:val": typeof numberId === "string" ? `{${numberId}}` : numberId } } }];
|
|
5882
|
+
if (numberingChange) {
|
|
5883
|
+
const changeAttrs = {
|
|
5884
|
+
"w:original": numberingChange.original,
|
|
5885
|
+
"w:id": numberingChange.id,
|
|
5886
|
+
"w:author": numberingChange.author
|
|
5887
|
+
};
|
|
5888
|
+
if (numberingChange.date !== void 0) changeAttrs["w:date"] = numberingChange.date;
|
|
5889
|
+
children.push({ "w:numberingChange": { _attr: changeAttrs } });
|
|
5890
|
+
}
|
|
5891
|
+
return { "w:numPr": children };
|
|
5826
5892
|
}
|
|
5827
|
-
var NumberProperties, IndentLevel, NumberId;
|
|
5893
|
+
var NumberProperties, IndentLevel, NumberId, NumberingChange;
|
|
5828
5894
|
var init_unordered_list = __esmMin((() => {
|
|
5829
5895
|
init_xml_components();
|
|
5830
5896
|
NumberProperties = class extends XmlComponent {
|
|
5831
|
-
constructor(numberId, indentLevel) {
|
|
5897
|
+
constructor(numberId, indentLevel, numberingChange) {
|
|
5832
5898
|
super("w:numPr");
|
|
5833
5899
|
this.root.push(new IndentLevel(indentLevel));
|
|
5834
5900
|
this.root.push(new NumberId(numberId));
|
|
5901
|
+
if (numberingChange) this.root.push(new NumberingChange(numberingChange));
|
|
5835
5902
|
}
|
|
5836
5903
|
};
|
|
5837
5904
|
IndentLevel = class extends XmlComponent {
|
|
@@ -5846,6 +5913,18 @@ var init_unordered_list = __esmMin((() => {
|
|
|
5846
5913
|
this.root.push({ _attr: { "w:val": typeof id === "string" ? `{${id}}` : id } });
|
|
5847
5914
|
}
|
|
5848
5915
|
};
|
|
5916
|
+
NumberingChange = class extends XmlComponent {
|
|
5917
|
+
constructor(options) {
|
|
5918
|
+
super("w:numberingChange");
|
|
5919
|
+
const attrs = {
|
|
5920
|
+
"w:original": options.original,
|
|
5921
|
+
"w:id": options.id,
|
|
5922
|
+
"w:author": options.author
|
|
5923
|
+
};
|
|
5924
|
+
if (options.date !== void 0) attrs["w:date"] = options.date;
|
|
5925
|
+
this.root.push({ _attr: attrs });
|
|
5926
|
+
}
|
|
5927
|
+
};
|
|
5849
5928
|
}));
|
|
5850
5929
|
//#endregion
|
|
5851
5930
|
//#region src/file/paragraph/formatting/word-wrap.ts
|
|
@@ -6011,7 +6090,7 @@ function buildParagraphProperties(options) {
|
|
|
6011
6090
|
instance: options.numbering.instance ?? 0,
|
|
6012
6091
|
reference: options.numbering.reference
|
|
6013
6092
|
});
|
|
6014
|
-
children.push(buildNumberProperties(`${options.numbering.reference}-${options.numbering.instance ?? 0}`, options.numbering.level));
|
|
6093
|
+
children.push(buildNumberProperties(`${options.numbering.reference}-${options.numbering.instance ?? 0}`, options.numbering.level, options.numbering.numberingChange));
|
|
6015
6094
|
} else if (options.numbering === false) children.push(buildNumberProperties(0, 0));
|
|
6016
6095
|
if (options.border) {
|
|
6017
6096
|
const border = buildParagraphBorders(options.border);
|
|
@@ -6163,7 +6242,7 @@ var init_properties = __esmMin((() => {
|
|
|
6163
6242
|
instance: options.numbering.instance ?? 0,
|
|
6164
6243
|
reference: options.numbering.reference
|
|
6165
6244
|
});
|
|
6166
|
-
this.root.push(new NumberProperties(`${options.numbering.reference}-${options.numbering.instance ?? 0}`, options.numbering.level));
|
|
6245
|
+
this.root.push(new NumberProperties(`${options.numbering.reference}-${options.numbering.instance ?? 0}`, options.numbering.level, options.numbering.numberingChange));
|
|
6167
6246
|
} else if (options.numbering === false) this.root.push(new NumberProperties(0, 0));
|
|
6168
6247
|
if (options.border) this.root.push(new Border(options.border));
|
|
6169
6248
|
if (options.thematicBreak) this.root.push(new ThematicBreak());
|
|
@@ -6314,13 +6393,18 @@ var init_paragraph$1 = __esmMin((() => {
|
|
|
6314
6393
|
toXml(context) {
|
|
6315
6394
|
const parts = [];
|
|
6316
6395
|
if (!(context.viewWrapper instanceof FontWrapper)) for (const reference of this._props.numberingReferences) context.file.numbering.createConcreteNumberingInstance(reference.reference, reference.instance);
|
|
6317
|
-
|
|
6318
|
-
if (this.sectionProperties) {
|
|
6319
|
-
const
|
|
6320
|
-
if (
|
|
6321
|
-
|
|
6396
|
+
const pPrObj = this._props.xml;
|
|
6397
|
+
if (pPrObj) if (this.sectionProperties) {
|
|
6398
|
+
const sectPrXml = this.sectionProperties.toXml(context);
|
|
6399
|
+
if (sectPrXml) {
|
|
6400
|
+
const pPrXml = xml(pPrObj);
|
|
6401
|
+
parts.push(pPrXml.replace("</w:pPr>", sectPrXml + "</w:pPr>"));
|
|
6402
|
+
} else parts.push(xml(pPrObj));
|
|
6403
|
+
} else parts.push(xml(pPrObj));
|
|
6404
|
+
else if (this.sectionProperties) {
|
|
6405
|
+
const sectPrXml = this.sectionProperties.toXml(context);
|
|
6406
|
+
if (sectPrXml) parts.push("<w:pPr>" + sectPrXml + "</w:pPr>");
|
|
6322
6407
|
}
|
|
6323
|
-
if (finalPPrObj) parts.push(xml(finalPPrObj));
|
|
6324
6408
|
for (const run of this.frontRuns) {
|
|
6325
6409
|
const s = run.toXml(context);
|
|
6326
6410
|
if (s) parts.push(s);
|
|
@@ -6333,7 +6417,14 @@ var init_paragraph$1 = __esmMin((() => {
|
|
|
6333
6417
|
for (const rawChild of this.options.children) for (const s of this.serializeChild(rawChild, context)) if (s) parts.push(s);
|
|
6334
6418
|
}
|
|
6335
6419
|
const body = parts.join("");
|
|
6336
|
-
|
|
6420
|
+
const rsidAttrs = [];
|
|
6421
|
+
if (this.options.rsidR) rsidAttrs.push(` w:rsidR="${this.options.rsidR}"`);
|
|
6422
|
+
if (this.options.rsidRPr) rsidAttrs.push(` w:rsidRPr="${this.options.rsidRPr}"`);
|
|
6423
|
+
if (this.options.rsidRDefault) rsidAttrs.push(` w:rsidRDefault="${this.options.rsidRDefault}"`);
|
|
6424
|
+
if (this.options.rsidDel) rsidAttrs.push(` w:rsidDel="${this.options.rsidDel}"`);
|
|
6425
|
+
if (this.options.rsidP) rsidAttrs.push(` w:rsidP="${this.options.rsidP}"`);
|
|
6426
|
+
const attr = rsidAttrs.join("");
|
|
6427
|
+
return body ? `<w:p${attr}>${body}</w:p>` : attr ? `<w:p${attr}/>` : "<w:p/>";
|
|
6337
6428
|
}
|
|
6338
6429
|
/**
|
|
6339
6430
|
* Serialize a single child element, handling all type coercions and side effects.
|
|
@@ -6703,6 +6794,143 @@ var init_ruby = __esmMin((() => {
|
|
|
6703
6794
|
};
|
|
6704
6795
|
}));
|
|
6705
6796
|
//#endregion
|
|
6797
|
+
//#region src/file/paragraph/run/smart-tag-run.ts
|
|
6798
|
+
var SmartTagRun, SmartTagProperties;
|
|
6799
|
+
var init_smart_tag_run = __esmMin((() => {
|
|
6800
|
+
init_xml_components();
|
|
6801
|
+
SmartTagRun = class extends XmlComponent {
|
|
6802
|
+
constructor(options) {
|
|
6803
|
+
super("w:smartTag");
|
|
6804
|
+
const attrs = {};
|
|
6805
|
+
if (options.uri !== void 0) attrs["w:uri"] = options.uri;
|
|
6806
|
+
if (options.element !== void 0) attrs["w:element"] = options.element;
|
|
6807
|
+
if (Object.keys(attrs).length > 0) this.root.push({ _attr: attrs });
|
|
6808
|
+
if (options.properties && options.properties.length > 0) this.root.push(new SmartTagProperties(options.properties));
|
|
6809
|
+
if (options.children) {
|
|
6810
|
+
for (const child of options.children) if (child instanceof BaseXmlComponent) this.root.push(child);
|
|
6811
|
+
}
|
|
6812
|
+
}
|
|
6813
|
+
};
|
|
6814
|
+
SmartTagProperties = class extends XmlComponent {
|
|
6815
|
+
constructor(attrs) {
|
|
6816
|
+
super("w:smartTagPr");
|
|
6817
|
+
if (attrs) for (const a of attrs) this.root.push(new BuilderElement({
|
|
6818
|
+
name: "w:attr",
|
|
6819
|
+
attributes: {
|
|
6820
|
+
uri: {
|
|
6821
|
+
key: "w:uri",
|
|
6822
|
+
value: a.uri
|
|
6823
|
+
},
|
|
6824
|
+
name: {
|
|
6825
|
+
key: "w:name",
|
|
6826
|
+
value: a.name
|
|
6827
|
+
},
|
|
6828
|
+
val: {
|
|
6829
|
+
key: "w:val",
|
|
6830
|
+
value: a.val
|
|
6831
|
+
}
|
|
6832
|
+
}
|
|
6833
|
+
}));
|
|
6834
|
+
}
|
|
6835
|
+
};
|
|
6836
|
+
}));
|
|
6837
|
+
//#endregion
|
|
6838
|
+
//#region src/file/paragraph/run/proof-error.ts
|
|
6839
|
+
var ProofErrorType, ProofError;
|
|
6840
|
+
var init_proof_error = __esmMin((() => {
|
|
6841
|
+
init_xml_components();
|
|
6842
|
+
ProofErrorType = {
|
|
6843
|
+
/** Start of a spelling error range */
|
|
6844
|
+
SPELL_START: "spellStart",
|
|
6845
|
+
/** End of a spelling error range */
|
|
6846
|
+
SPELL_END: "spellEnd",
|
|
6847
|
+
/** Start of a grammar error range */
|
|
6848
|
+
GRAM_START: "gramStart",
|
|
6849
|
+
/** End of a grammar error range */
|
|
6850
|
+
GRAM_END: "gramEnd"
|
|
6851
|
+
};
|
|
6852
|
+
ProofError = class extends XmlComponent {
|
|
6853
|
+
constructor(type) {
|
|
6854
|
+
super("w:proofErr");
|
|
6855
|
+
this.root.push({ _attr: { "w:type": type } });
|
|
6856
|
+
}
|
|
6857
|
+
};
|
|
6858
|
+
}));
|
|
6859
|
+
//#endregion
|
|
6860
|
+
//#region src/file/paragraph/run/custom-xml-range.ts
|
|
6861
|
+
var CustomXmlInsRangeStart, CustomXmlInsRangeEnd, CustomXmlDelRangeStart, CustomXmlDelRangeEnd, CustomXmlMoveFromRangeStart, CustomXmlMoveFromRangeEnd, CustomXmlMoveToRangeStart, CustomXmlMoveToRangeEnd;
|
|
6862
|
+
var init_custom_xml_range = __esmMin((() => {
|
|
6863
|
+
init_xml_components();
|
|
6864
|
+
CustomXmlInsRangeStart = class extends XmlComponent {
|
|
6865
|
+
constructor(id, author, date) {
|
|
6866
|
+
super("w:customXmlInsRangeStart");
|
|
6867
|
+
const attrs = {
|
|
6868
|
+
"w:id": id,
|
|
6869
|
+
"w:author": author
|
|
6870
|
+
};
|
|
6871
|
+
if (date !== void 0) attrs["w:date"] = date;
|
|
6872
|
+
this.root.push({ _attr: attrs });
|
|
6873
|
+
}
|
|
6874
|
+
};
|
|
6875
|
+
CustomXmlInsRangeEnd = class extends XmlComponent {
|
|
6876
|
+
constructor(id) {
|
|
6877
|
+
super("w:customXmlInsRangeEnd");
|
|
6878
|
+
this.root.push({ _attr: { "w:id": id } });
|
|
6879
|
+
}
|
|
6880
|
+
};
|
|
6881
|
+
CustomXmlDelRangeStart = class extends XmlComponent {
|
|
6882
|
+
constructor(id, author, date) {
|
|
6883
|
+
super("w:customXmlDelRangeStart");
|
|
6884
|
+
const attrs = {
|
|
6885
|
+
"w:id": id,
|
|
6886
|
+
"w:author": author
|
|
6887
|
+
};
|
|
6888
|
+
if (date !== void 0) attrs["w:date"] = date;
|
|
6889
|
+
this.root.push({ _attr: attrs });
|
|
6890
|
+
}
|
|
6891
|
+
};
|
|
6892
|
+
CustomXmlDelRangeEnd = class extends XmlComponent {
|
|
6893
|
+
constructor(id) {
|
|
6894
|
+
super("w:customXmlDelRangeEnd");
|
|
6895
|
+
this.root.push({ _attr: { "w:id": id } });
|
|
6896
|
+
}
|
|
6897
|
+
};
|
|
6898
|
+
CustomXmlMoveFromRangeStart = class extends XmlComponent {
|
|
6899
|
+
constructor(id, author, date) {
|
|
6900
|
+
super("w:customXmlMoveFromRangeStart");
|
|
6901
|
+
const attrs = {
|
|
6902
|
+
"w:id": id,
|
|
6903
|
+
"w:author": author
|
|
6904
|
+
};
|
|
6905
|
+
if (date !== void 0) attrs["w:date"] = date;
|
|
6906
|
+
this.root.push({ _attr: attrs });
|
|
6907
|
+
}
|
|
6908
|
+
};
|
|
6909
|
+
CustomXmlMoveFromRangeEnd = class extends XmlComponent {
|
|
6910
|
+
constructor(id) {
|
|
6911
|
+
super("w:customXmlMoveFromRangeEnd");
|
|
6912
|
+
this.root.push({ _attr: { "w:id": id } });
|
|
6913
|
+
}
|
|
6914
|
+
};
|
|
6915
|
+
CustomXmlMoveToRangeStart = class extends XmlComponent {
|
|
6916
|
+
constructor(id, author, date) {
|
|
6917
|
+
super("w:customXmlMoveToRangeStart");
|
|
6918
|
+
const attrs = {
|
|
6919
|
+
"w:id": id,
|
|
6920
|
+
"w:author": author
|
|
6921
|
+
};
|
|
6922
|
+
if (date !== void 0) attrs["w:date"] = date;
|
|
6923
|
+
this.root.push({ _attr: attrs });
|
|
6924
|
+
}
|
|
6925
|
+
};
|
|
6926
|
+
CustomXmlMoveToRangeEnd = class extends XmlComponent {
|
|
6927
|
+
constructor(id) {
|
|
6928
|
+
super("w:customXmlMoveToRangeEnd");
|
|
6929
|
+
this.root.push({ _attr: { "w:id": id } });
|
|
6930
|
+
}
|
|
6931
|
+
};
|
|
6932
|
+
}));
|
|
6933
|
+
//#endregion
|
|
6706
6934
|
//#region src/file/paragraph/run/index.ts
|
|
6707
6935
|
var init_run = __esmMin((() => {
|
|
6708
6936
|
init_run$1();
|
|
@@ -6725,6 +6953,9 @@ var init_run = __esmMin((() => {
|
|
|
6725
6953
|
init_ruby();
|
|
6726
6954
|
init_form_field();
|
|
6727
6955
|
init_break$1();
|
|
6956
|
+
init_smart_tag_run();
|
|
6957
|
+
init_proof_error();
|
|
6958
|
+
init_custom_xml_range();
|
|
6728
6959
|
}));
|
|
6729
6960
|
//#endregion
|
|
6730
6961
|
//#region src/file/paragraph/formatting/break.ts
|
|
@@ -6837,61 +7068,310 @@ var init_alt_chunk = __esmMin((() => {
|
|
|
6837
7068
|
};
|
|
6838
7069
|
}));
|
|
6839
7070
|
//#endregion
|
|
6840
|
-
//#region src/file/
|
|
6841
|
-
var
|
|
6842
|
-
var
|
|
6843
|
-
init_shared();
|
|
7071
|
+
//#region src/file/track-revision/track-revision-components/moved-text-run.ts
|
|
7072
|
+
var MovedFromTextRun, MovedToTextRun, MovedFromRunWrapper, MovedToRunWrapper;
|
|
7073
|
+
var init_moved_text_run = __esmMin((() => {
|
|
6844
7074
|
init_xml_components();
|
|
6845
|
-
|
|
6846
|
-
|
|
6847
|
-
|
|
6848
|
-
|
|
6849
|
-
|
|
6850
|
-
|
|
6851
|
-
|
|
6852
|
-
|
|
6853
|
-
|
|
6854
|
-
|
|
6855
|
-
|
|
6856
|
-
|
|
6857
|
-
|
|
6858
|
-
|
|
6859
|
-
|
|
6860
|
-
|
|
6861
|
-
|
|
6862
|
-
|
|
6863
|
-
|
|
6864
|
-
|
|
6865
|
-
|
|
7075
|
+
init_break$1();
|
|
7076
|
+
init_field();
|
|
7077
|
+
init_properties$1();
|
|
7078
|
+
init_run$1();
|
|
7079
|
+
init_text();
|
|
7080
|
+
MovedFromTextRun = class extends XmlComponent {
|
|
7081
|
+
constructor(options) {
|
|
7082
|
+
super("w:moveFrom");
|
|
7083
|
+
this.root.push({ _attr: {
|
|
7084
|
+
"w:author": options.author,
|
|
7085
|
+
"w:date": options.date,
|
|
7086
|
+
"w:id": options.id
|
|
7087
|
+
} });
|
|
7088
|
+
this.addChildElement(new MovedFromRunWrapper(options));
|
|
7089
|
+
}
|
|
7090
|
+
};
|
|
7091
|
+
MovedToTextRun = class extends XmlComponent {
|
|
7092
|
+
constructor(options) {
|
|
7093
|
+
super("w:moveTo");
|
|
7094
|
+
this.root.push({ _attr: {
|
|
7095
|
+
"w:author": options.author,
|
|
7096
|
+
"w:date": options.date,
|
|
7097
|
+
"w:id": options.id
|
|
7098
|
+
} });
|
|
7099
|
+
this.addChildElement(new MovedToRunWrapper(options));
|
|
7100
|
+
}
|
|
7101
|
+
};
|
|
7102
|
+
MovedFromRunWrapper = class extends XmlComponent {
|
|
7103
|
+
constructor(options) {
|
|
7104
|
+
super("w:r");
|
|
7105
|
+
this.root.push(new RunProperties(options));
|
|
7106
|
+
if (options.children) for (const child of options.children) {
|
|
7107
|
+
if (typeof child === "string") {
|
|
7108
|
+
switch (child) {
|
|
7109
|
+
case PageNumber.CURRENT:
|
|
7110
|
+
this.root.push(createBegin());
|
|
7111
|
+
this.root.push(buildText("PAGE"));
|
|
7112
|
+
this.root.push(createSeparate());
|
|
7113
|
+
this.root.push(createEnd());
|
|
7114
|
+
break;
|
|
7115
|
+
case PageNumber.TOTAL_PAGES:
|
|
7116
|
+
this.root.push(createBegin());
|
|
7117
|
+
this.root.push(buildText("NUMPAGES"));
|
|
7118
|
+
this.root.push(createSeparate());
|
|
7119
|
+
this.root.push(createEnd());
|
|
7120
|
+
break;
|
|
7121
|
+
case PageNumber.TOTAL_PAGES_IN_SECTION:
|
|
7122
|
+
this.root.push(createBegin());
|
|
7123
|
+
this.root.push(buildText("SECTIONPAGES"));
|
|
7124
|
+
this.root.push(createSeparate());
|
|
7125
|
+
this.root.push(createEnd());
|
|
7126
|
+
break;
|
|
7127
|
+
default:
|
|
7128
|
+
this.root.push(buildText(child));
|
|
7129
|
+
break;
|
|
7130
|
+
}
|
|
7131
|
+
continue;
|
|
7132
|
+
}
|
|
7133
|
+
this.root.push(child);
|
|
6866
7134
|
}
|
|
6867
|
-
if (this.
|
|
6868
|
-
if (
|
|
6869
|
-
|
|
6870
|
-
|
|
6871
|
-
|
|
7135
|
+
else if (options.text) this.root.push(buildText(options.text));
|
|
7136
|
+
if (options.break) for (let i = 0; i < options.break; i++) this.root.splice(1, 0, createBreak());
|
|
7137
|
+
}
|
|
7138
|
+
};
|
|
7139
|
+
MovedToRunWrapper = class extends XmlComponent {
|
|
7140
|
+
constructor(options) {
|
|
7141
|
+
super("w:r");
|
|
7142
|
+
this.root.push(new RunProperties(options));
|
|
7143
|
+
if (options.children) for (const child of options.children) this.root.push(child);
|
|
7144
|
+
else if (options.text) this.root.push(buildText(options.text));
|
|
7145
|
+
if (options.break) for (let i = 0; i < options.break; i++) this.root.splice(1, 0, createBreak());
|
|
6872
7146
|
}
|
|
6873
7147
|
};
|
|
6874
7148
|
}));
|
|
6875
7149
|
//#endregion
|
|
6876
|
-
//#region src/file/
|
|
6877
|
-
|
|
6878
|
-
|
|
7150
|
+
//#region src/file/track-revision/track-revision-components/inserted-table-row.ts
|
|
7151
|
+
function buildInsertedTableRowObj(options) {
|
|
7152
|
+
return { "w:ins": { _attr: {
|
|
7153
|
+
"w:author": options.author,
|
|
7154
|
+
"w:date": options.date,
|
|
7155
|
+
"w:id": options.id
|
|
7156
|
+
} } };
|
|
7157
|
+
}
|
|
7158
|
+
var InsertedTableRow;
|
|
7159
|
+
var init_inserted_table_row = __esmMin((() => {
|
|
6879
7160
|
init_xml_components();
|
|
6880
|
-
|
|
6881
|
-
constructor() {
|
|
6882
|
-
super("w:
|
|
7161
|
+
InsertedTableRow = class extends XmlComponent {
|
|
7162
|
+
constructor(options) {
|
|
7163
|
+
super("w:ins");
|
|
7164
|
+
this.root.push({ _attr: {
|
|
7165
|
+
"w:author": options.author,
|
|
7166
|
+
"w:date": options.date,
|
|
7167
|
+
"w:id": options.id
|
|
7168
|
+
} });
|
|
6883
7169
|
}
|
|
6884
7170
|
};
|
|
6885
7171
|
}));
|
|
6886
7172
|
//#endregion
|
|
6887
|
-
//#region src/file/
|
|
6888
|
-
|
|
6889
|
-
|
|
7173
|
+
//#region src/file/track-revision/track-revision-components/deleted-table-row.ts
|
|
7174
|
+
function buildDeletedTableRowObj(options) {
|
|
7175
|
+
return { "w:del": { _attr: {
|
|
7176
|
+
"w:author": options.author,
|
|
7177
|
+
"w:date": options.date,
|
|
7178
|
+
"w:id": options.id
|
|
7179
|
+
} } };
|
|
7180
|
+
}
|
|
7181
|
+
var DeletedTableRow;
|
|
7182
|
+
var init_deleted_table_row = __esmMin((() => {
|
|
6890
7183
|
init_xml_components();
|
|
6891
|
-
|
|
6892
|
-
|
|
6893
|
-
|
|
6894
|
-
|
|
7184
|
+
DeletedTableRow = class extends XmlComponent {
|
|
7185
|
+
constructor(options) {
|
|
7186
|
+
super("w:del");
|
|
7187
|
+
this.root.push({ _attr: {
|
|
7188
|
+
"w:author": options.author,
|
|
7189
|
+
"w:date": options.date,
|
|
7190
|
+
"w:id": options.id
|
|
7191
|
+
} });
|
|
7192
|
+
}
|
|
7193
|
+
};
|
|
7194
|
+
}));
|
|
7195
|
+
//#endregion
|
|
7196
|
+
//#region src/file/track-revision/track-revision-components/inserted-table-cell.ts
|
|
7197
|
+
function buildInsertedTableCellObj(options) {
|
|
7198
|
+
return { "w:cellIns": { _attr: {
|
|
7199
|
+
"w:author": options.author,
|
|
7200
|
+
"w:date": options.date,
|
|
7201
|
+
"w:id": options.id
|
|
7202
|
+
} } };
|
|
7203
|
+
}
|
|
7204
|
+
var InsertedTableCell;
|
|
7205
|
+
var init_inserted_table_cell = __esmMin((() => {
|
|
7206
|
+
init_xml_components();
|
|
7207
|
+
InsertedTableCell = class extends XmlComponent {
|
|
7208
|
+
constructor(options) {
|
|
7209
|
+
super("w:cellIns");
|
|
7210
|
+
this.root.push({ _attr: {
|
|
7211
|
+
"w:author": options.author,
|
|
7212
|
+
"w:date": options.date,
|
|
7213
|
+
"w:id": options.id
|
|
7214
|
+
} });
|
|
7215
|
+
}
|
|
7216
|
+
};
|
|
7217
|
+
}));
|
|
7218
|
+
//#endregion
|
|
7219
|
+
//#region src/file/track-revision/track-revision-components/deleted-table-cell.ts
|
|
7220
|
+
function buildDeletedTableCellObj(options) {
|
|
7221
|
+
return { "w:cellDel": { _attr: {
|
|
7222
|
+
"w:author": options.author,
|
|
7223
|
+
"w:date": options.date,
|
|
7224
|
+
"w:id": options.id
|
|
7225
|
+
} } };
|
|
7226
|
+
}
|
|
7227
|
+
var DeletedTableCell;
|
|
7228
|
+
var init_deleted_table_cell = __esmMin((() => {
|
|
7229
|
+
init_xml_components();
|
|
7230
|
+
DeletedTableCell = class extends XmlComponent {
|
|
7231
|
+
constructor(options) {
|
|
7232
|
+
super("w:cellDel");
|
|
7233
|
+
this.root.push({ _attr: {
|
|
7234
|
+
"w:author": options.author,
|
|
7235
|
+
"w:date": options.date,
|
|
7236
|
+
"w:id": options.id
|
|
7237
|
+
} });
|
|
7238
|
+
}
|
|
7239
|
+
};
|
|
7240
|
+
}));
|
|
7241
|
+
//#endregion
|
|
7242
|
+
//#region src/file/track-revision/track-revision-components/cell-merge.ts
|
|
7243
|
+
function buildCellMergeObj(options) {
|
|
7244
|
+
const attrs = {
|
|
7245
|
+
"w:author": options.author,
|
|
7246
|
+
"w:date": options.date,
|
|
7247
|
+
"w:id": options.id
|
|
7248
|
+
};
|
|
7249
|
+
if (options.verticalMerge !== void 0) attrs["w:vMerge"] = xsdVerticalMergeRev.to(options.verticalMerge);
|
|
7250
|
+
if (options.verticalMergeOriginal !== void 0) attrs["w:vMergeOrig"] = xsdVerticalMergeRev.to(options.verticalMergeOriginal);
|
|
7251
|
+
return { "w:cellMerge": { _attr: attrs } };
|
|
7252
|
+
}
|
|
7253
|
+
var VerticalMergeRevisionType, CellMerge;
|
|
7254
|
+
var init_cell_merge = __esmMin((() => {
|
|
7255
|
+
init_xml_components();
|
|
7256
|
+
VerticalMergeRevisionType = {
|
|
7257
|
+
/**
|
|
7258
|
+
* Cell that is merged with upper one.
|
|
7259
|
+
*/
|
|
7260
|
+
CONTINUE: "continue",
|
|
7261
|
+
/**
|
|
7262
|
+
* Cell that is starting the vertical merge.
|
|
7263
|
+
*/
|
|
7264
|
+
RESTART: "restart"
|
|
7265
|
+
};
|
|
7266
|
+
CellMerge = class extends XmlComponent {
|
|
7267
|
+
constructor(options) {
|
|
7268
|
+
super("w:cellMerge");
|
|
7269
|
+
const attrs = {
|
|
7270
|
+
"w:author": options.author,
|
|
7271
|
+
"w:date": options.date,
|
|
7272
|
+
"w:id": options.id
|
|
7273
|
+
};
|
|
7274
|
+
if (options.verticalMerge !== void 0) attrs["w:vMerge"] = xsdVerticalMergeRev.to(options.verticalMerge);
|
|
7275
|
+
if (options.verticalMergeOriginal !== void 0) attrs["w:vMergeOrig"] = xsdVerticalMergeRev.to(options.verticalMergeOriginal);
|
|
7276
|
+
this.root.push({ _attr: attrs });
|
|
7277
|
+
}
|
|
7278
|
+
};
|
|
7279
|
+
}));
|
|
7280
|
+
//#endregion
|
|
7281
|
+
//#region src/file/track-revision/index.ts
|
|
7282
|
+
var init_track_revision = __esmMin((() => {
|
|
7283
|
+
init_inserted_text_run();
|
|
7284
|
+
init_deleted_text_run();
|
|
7285
|
+
init_moved_text_run();
|
|
7286
|
+
init_inserted_table_row();
|
|
7287
|
+
init_deleted_table_row();
|
|
7288
|
+
init_inserted_table_cell();
|
|
7289
|
+
init_deleted_table_cell();
|
|
7290
|
+
init_cell_merge();
|
|
7291
|
+
}));
|
|
7292
|
+
//#endregion
|
|
7293
|
+
//#region src/file/vertical-align/vertical-align.ts
|
|
7294
|
+
var VerticalAlignTable, VerticalAlignSection, createVerticalAlign;
|
|
7295
|
+
var init_vertical_align$1 = __esmMin((() => {
|
|
7296
|
+
init_xml_components();
|
|
7297
|
+
VerticalAlignTable = {
|
|
7298
|
+
BOTTOM: "bottom",
|
|
7299
|
+
CENTER: "center",
|
|
7300
|
+
TOP: "top"
|
|
7301
|
+
};
|
|
7302
|
+
VerticalAlignSection = {
|
|
7303
|
+
...VerticalAlignTable,
|
|
7304
|
+
BOTH: "both"
|
|
7305
|
+
};
|
|
7306
|
+
createVerticalAlign = (value) => new BuilderElement({
|
|
7307
|
+
attributes: { verticalAlign: {
|
|
7308
|
+
key: "w:val",
|
|
7309
|
+
value
|
|
7310
|
+
} },
|
|
7311
|
+
name: "w:vAlign"
|
|
7312
|
+
});
|
|
7313
|
+
}));
|
|
7314
|
+
//#endregion
|
|
7315
|
+
//#region src/file/vertical-align/index.ts
|
|
7316
|
+
var init_vertical_align = __esmMin((() => {
|
|
7317
|
+
init_vertical_align$1();
|
|
7318
|
+
}));
|
|
7319
|
+
//#endregion
|
|
7320
|
+
//#region src/file/table-of-contents/field-instruction.ts
|
|
7321
|
+
var FieldInstruction;
|
|
7322
|
+
var init_field_instruction = __esmMin((() => {
|
|
7323
|
+
init_shared();
|
|
7324
|
+
init_xml_components();
|
|
7325
|
+
FieldInstruction = class extends XmlComponent {
|
|
7326
|
+
properties;
|
|
7327
|
+
constructor(properties = {}) {
|
|
7328
|
+
super("w:instrText");
|
|
7329
|
+
this.properties = properties;
|
|
7330
|
+
this.root.push({ _attr: { "xml:space": SpaceType.PRESERVE } });
|
|
7331
|
+
let instruction = "TOC";
|
|
7332
|
+
if (this.properties.captionLabel) instruction = `${instruction} \\a "${this.properties.captionLabel}"`;
|
|
7333
|
+
if (this.properties.entriesFromBookmark) instruction = `${instruction} \\b "${this.properties.entriesFromBookmark}"`;
|
|
7334
|
+
if (this.properties.captionLabelIncludingNumbers) instruction = `${instruction} \\c "${this.properties.captionLabelIncludingNumbers}"`;
|
|
7335
|
+
if (this.properties.sequenceAndPageNumbersSeparator) instruction = `${instruction} \\d "${this.properties.sequenceAndPageNumbersSeparator}"`;
|
|
7336
|
+
if (this.properties.tcFieldIdentifier) instruction = `${instruction} \\f "${this.properties.tcFieldIdentifier}"`;
|
|
7337
|
+
if (this.properties.hyperlink) instruction = `${instruction} \\h`;
|
|
7338
|
+
if (this.properties.tcFieldLevelRange) instruction = `${instruction} \\l "${this.properties.tcFieldLevelRange}"`;
|
|
7339
|
+
if (this.properties.pageNumbersEntryLevelsRange) instruction = `${instruction} \\n "${this.properties.pageNumbersEntryLevelsRange}"`;
|
|
7340
|
+
if (this.properties.headingStyleRange) instruction = `${instruction} \\o "${this.properties.headingStyleRange}"`;
|
|
7341
|
+
if (this.properties.entryAndPageNumberSeparator) instruction = `${instruction} \\p "${this.properties.entryAndPageNumberSeparator}"`;
|
|
7342
|
+
if (this.properties.seqFieldIdentifierForPrefix) instruction = `${instruction} \\s "${this.properties.seqFieldIdentifierForPrefix}"`;
|
|
7343
|
+
if (this.properties.stylesWithLevels && this.properties.stylesWithLevels.length) {
|
|
7344
|
+
const styles = this.properties.stylesWithLevels.map((sl) => `${sl.styleName},${sl.level}`).join(",");
|
|
7345
|
+
instruction = `${instruction} \\t "${styles}"`;
|
|
7346
|
+
}
|
|
7347
|
+
if (this.properties.useAppliedParagraphOutlineLevel) instruction = `${instruction} \\u`;
|
|
7348
|
+
if (this.properties.preserveTabInEntries) instruction = `${instruction} \\w`;
|
|
7349
|
+
if (this.properties.preserveNewLineInEntries) instruction = `${instruction} \\x`;
|
|
7350
|
+
if (this.properties.hideTabAndPageNumbersInWebView) instruction = `${instruction} \\z`;
|
|
7351
|
+
this.root.push(instruction);
|
|
7352
|
+
}
|
|
7353
|
+
};
|
|
7354
|
+
}));
|
|
7355
|
+
//#endregion
|
|
7356
|
+
//#region src/file/table-of-contents/sdt-content.ts
|
|
7357
|
+
var StructuredDocumentTagContent;
|
|
7358
|
+
var init_sdt_content = __esmMin((() => {
|
|
7359
|
+
init_xml_components();
|
|
7360
|
+
StructuredDocumentTagContent = class extends XmlComponent {
|
|
7361
|
+
constructor() {
|
|
7362
|
+
super("w:sdtContent");
|
|
7363
|
+
}
|
|
7364
|
+
};
|
|
7365
|
+
}));
|
|
7366
|
+
//#endregion
|
|
7367
|
+
//#region src/file/table-of-contents/sdt-properties.ts
|
|
7368
|
+
var SdtLock, SdtDateMappingType, createListItem, createListType, createDate, createDataBinding, createDocPart, StructuredDocumentTagProperties;
|
|
7369
|
+
var init_sdt_properties = __esmMin((() => {
|
|
7370
|
+
init_xml_components();
|
|
7371
|
+
SdtLock = {
|
|
7372
|
+
/** Lock the SDT itself (cannot delete the control) */
|
|
7373
|
+
SDT_LOCKED: "sdtLocked",
|
|
7374
|
+
/** Lock the content (cannot edit content within the control) */
|
|
6895
7375
|
CONTENT_LOCKED: "contentLocked",
|
|
6896
7376
|
/** No locking */
|
|
6897
7377
|
UNLOCKED: "unlocked",
|
|
@@ -7169,14 +7649,24 @@ var init_table_of_contents = __esmMin((() => {
|
|
|
7169
7649
|
}));
|
|
7170
7650
|
//#endregion
|
|
7171
7651
|
//#region src/file/sdt/sdt.ts
|
|
7172
|
-
var StructuredDocumentTagRun, StructuredDocumentTagBlock;
|
|
7652
|
+
var StructuredDocumentTagEndProperties, StructuredDocumentTagRun, StructuredDocumentTagBlock;
|
|
7173
7653
|
var init_sdt$1 = __esmMin((() => {
|
|
7174
7654
|
init_xml_components();
|
|
7175
7655
|
init_table_of_contents();
|
|
7656
|
+
StructuredDocumentTagEndProperties = class extends XmlComponent {
|
|
7657
|
+
constructor() {
|
|
7658
|
+
super("w:sdtEndPr");
|
|
7659
|
+
}
|
|
7660
|
+
};
|
|
7176
7661
|
StructuredDocumentTagRun = class extends XmlComponent {
|
|
7177
7662
|
constructor(options) {
|
|
7178
7663
|
super("w:sdt");
|
|
7179
7664
|
this.root.push(new StructuredDocumentTagProperties(options.properties));
|
|
7665
|
+
if (options.endProperties && options.endProperties.length > 0) {
|
|
7666
|
+
const endPr = new StructuredDocumentTagEndProperties();
|
|
7667
|
+
for (const child of options.endProperties) endPr.addChildElement(child);
|
|
7668
|
+
this.root.push(endPr);
|
|
7669
|
+
}
|
|
7180
7670
|
if (options.children && options.children.length > 0) {
|
|
7181
7671
|
const content = new StructuredDocumentTagContent();
|
|
7182
7672
|
for (const child of options.children) content.addChildElement(child);
|
|
@@ -7189,6 +7679,11 @@ var init_sdt$1 = __esmMin((() => {
|
|
|
7189
7679
|
constructor(options) {
|
|
7190
7680
|
super("w:sdt");
|
|
7191
7681
|
this.root.push(new StructuredDocumentTagProperties(options.properties));
|
|
7682
|
+
if (options.endProperties && options.endProperties.length > 0) {
|
|
7683
|
+
const endPr = new StructuredDocumentTagEndProperties();
|
|
7684
|
+
for (const child of options.endProperties) endPr.addChildElement(child);
|
|
7685
|
+
this.root.push(endPr);
|
|
7686
|
+
}
|
|
7192
7687
|
if (options.children && options.children.length > 0) {
|
|
7193
7688
|
const content = new StructuredDocumentTagContent();
|
|
7194
7689
|
for (const child of options.children) content.addChildElement(child);
|
|
@@ -7198,37 +7693,6 @@ var init_sdt$1 = __esmMin((() => {
|
|
|
7198
7693
|
};
|
|
7199
7694
|
}));
|
|
7200
7695
|
//#endregion
|
|
7201
|
-
//#region src/file/sub-doc/sub-doc.ts
|
|
7202
|
-
var SUBDOC_RELATIONSHIP_TYPE, SubDoc;
|
|
7203
|
-
var init_sub_doc = __esmMin((() => {
|
|
7204
|
-
init_xml_components();
|
|
7205
|
-
init_convenience_functions();
|
|
7206
|
-
SUBDOC_RELATIONSHIP_TYPE = "http://schemas.openxmlformats.org/officeDocument/2006/relationships/subDocument";
|
|
7207
|
-
SubDoc = class extends XmlComponent {
|
|
7208
|
-
fileChild = Symbol();
|
|
7209
|
-
options;
|
|
7210
|
-
constructor(options) {
|
|
7211
|
-
super("w:subDoc");
|
|
7212
|
-
this.options = options;
|
|
7213
|
-
}
|
|
7214
|
-
toXml(context) {
|
|
7215
|
-
const relId = uniqueId();
|
|
7216
|
-
const partPath = `subdocs/subdoc${relId}.docx`;
|
|
7217
|
-
const data = typeof this.options.data === "string" ? new TextEncoder().encode(this.options.data) : this.options.data;
|
|
7218
|
-
context.viewWrapper.relationships.addRelationship(relId, SUBDOC_RELATIONSHIP_TYPE, partPath);
|
|
7219
|
-
context.file.subDocs.addSubDoc(relId, {
|
|
7220
|
-
data,
|
|
7221
|
-
path: partPath
|
|
7222
|
-
});
|
|
7223
|
-
context.file.contentTypes.addSubDoc(`/word/${partPath}`);
|
|
7224
|
-
this.root.splice(0, 0, { _attr: { "r:id": `rId${relId}` } });
|
|
7225
|
-
const result = super.toXml(context);
|
|
7226
|
-
this.root.splice(0, 1);
|
|
7227
|
-
return result;
|
|
7228
|
-
}
|
|
7229
|
-
};
|
|
7230
|
-
}));
|
|
7231
|
-
//#endregion
|
|
7232
7696
|
//#region src/file/sdt/sdt-cell.ts
|
|
7233
7697
|
var StructuredDocumentTagCell;
|
|
7234
7698
|
var init_sdt_cell = __esmMin((() => {
|
|
@@ -7249,253 +7713,69 @@ var init_sdt_cell = __esmMin((() => {
|
|
|
7249
7713
|
};
|
|
7250
7714
|
}));
|
|
7251
7715
|
//#endregion
|
|
7252
|
-
//#region src/file/
|
|
7253
|
-
var
|
|
7254
|
-
var
|
|
7716
|
+
//#region src/file/sdt/sdt-row.ts
|
|
7717
|
+
var StructuredDocumentTagRow;
|
|
7718
|
+
var init_sdt_row = __esmMin((() => {
|
|
7255
7719
|
init_xml_components();
|
|
7256
|
-
|
|
7257
|
-
|
|
7258
|
-
|
|
7259
|
-
|
|
7260
|
-
init_text();
|
|
7261
|
-
MovedFromTextRun = class extends XmlComponent {
|
|
7262
|
-
constructor(options) {
|
|
7263
|
-
super("w:moveFrom");
|
|
7264
|
-
this.root.push({ _attr: {
|
|
7265
|
-
"w:author": options.author,
|
|
7266
|
-
"w:date": options.date,
|
|
7267
|
-
"w:id": options.id
|
|
7268
|
-
} });
|
|
7269
|
-
this.addChildElement(new MovedFromRunWrapper(options));
|
|
7270
|
-
}
|
|
7271
|
-
};
|
|
7272
|
-
MovedToTextRun = class extends XmlComponent {
|
|
7273
|
-
constructor(options) {
|
|
7274
|
-
super("w:moveTo");
|
|
7275
|
-
this.root.push({ _attr: {
|
|
7276
|
-
"w:author": options.author,
|
|
7277
|
-
"w:date": options.date,
|
|
7278
|
-
"w:id": options.id
|
|
7279
|
-
} });
|
|
7280
|
-
this.addChildElement(new MovedToRunWrapper(options));
|
|
7281
|
-
}
|
|
7282
|
-
};
|
|
7283
|
-
MovedFromRunWrapper = class extends XmlComponent {
|
|
7720
|
+
init_table_of_contents();
|
|
7721
|
+
init_table_cell();
|
|
7722
|
+
StructuredDocumentTagRow = class extends XmlComponent {
|
|
7723
|
+
rows;
|
|
7284
7724
|
constructor(options) {
|
|
7285
|
-
super("w:
|
|
7286
|
-
this.
|
|
7287
|
-
|
|
7288
|
-
|
|
7289
|
-
|
|
7290
|
-
|
|
7291
|
-
|
|
7292
|
-
this.root.push(buildText("PAGE"));
|
|
7293
|
-
this.root.push(createSeparate());
|
|
7294
|
-
this.root.push(createEnd());
|
|
7295
|
-
break;
|
|
7296
|
-
case PageNumber.TOTAL_PAGES:
|
|
7297
|
-
this.root.push(createBegin());
|
|
7298
|
-
this.root.push(buildText("NUMPAGES"));
|
|
7299
|
-
this.root.push(createSeparate());
|
|
7300
|
-
this.root.push(createEnd());
|
|
7301
|
-
break;
|
|
7302
|
-
case PageNumber.TOTAL_PAGES_IN_SECTION:
|
|
7303
|
-
this.root.push(createBegin());
|
|
7304
|
-
this.root.push(buildText("SECTIONPAGES"));
|
|
7305
|
-
this.root.push(createSeparate());
|
|
7306
|
-
this.root.push(createEnd());
|
|
7307
|
-
break;
|
|
7308
|
-
default:
|
|
7309
|
-
this.root.push(buildText(child));
|
|
7310
|
-
break;
|
|
7311
|
-
}
|
|
7312
|
-
continue;
|
|
7313
|
-
}
|
|
7314
|
-
this.root.push(child);
|
|
7725
|
+
super("w:sdt");
|
|
7726
|
+
this.rows = options.children ?? [];
|
|
7727
|
+
this.root.push(new StructuredDocumentTagProperties(options.properties));
|
|
7728
|
+
if (this.rows.length > 0) {
|
|
7729
|
+
const content = new StructuredDocumentTagContent();
|
|
7730
|
+
for (const row of this.rows) content.addChildElement(row);
|
|
7731
|
+
this.root.push(content);
|
|
7315
7732
|
}
|
|
7316
|
-
else if (options.text) this.root.push(buildText(options.text));
|
|
7317
|
-
if (options.break) for (let i = 0; i < options.break; i++) this.root.splice(1, 0, createBreak());
|
|
7318
|
-
}
|
|
7319
|
-
};
|
|
7320
|
-
MovedToRunWrapper = class extends XmlComponent {
|
|
7321
|
-
constructor(options) {
|
|
7322
|
-
super("w:r");
|
|
7323
|
-
this.root.push(new RunProperties(options));
|
|
7324
|
-
if (options.children) for (const child of options.children) this.root.push(child);
|
|
7325
|
-
else if (options.text) this.root.push(buildText(options.text));
|
|
7326
|
-
if (options.break) for (let i = 0; i < options.break; i++) this.root.splice(1, 0, createBreak());
|
|
7327
|
-
}
|
|
7328
|
-
};
|
|
7329
|
-
}));
|
|
7330
|
-
//#endregion
|
|
7331
|
-
//#region src/file/track-revision/track-revision-components/inserted-table-row.ts
|
|
7332
|
-
function buildInsertedTableRowObj(options) {
|
|
7333
|
-
return { "w:ins": { _attr: {
|
|
7334
|
-
"w:author": options.author,
|
|
7335
|
-
"w:date": options.date,
|
|
7336
|
-
"w:id": options.id
|
|
7337
|
-
} } };
|
|
7338
|
-
}
|
|
7339
|
-
var InsertedTableRow;
|
|
7340
|
-
var init_inserted_table_row = __esmMin((() => {
|
|
7341
|
-
init_xml_components();
|
|
7342
|
-
InsertedTableRow = class extends XmlComponent {
|
|
7343
|
-
constructor(options) {
|
|
7344
|
-
super("w:ins");
|
|
7345
|
-
this.root.push({ _attr: {
|
|
7346
|
-
"w:author": options.author,
|
|
7347
|
-
"w:date": options.date,
|
|
7348
|
-
"w:id": options.id
|
|
7349
|
-
} });
|
|
7350
|
-
}
|
|
7351
|
-
};
|
|
7352
|
-
}));
|
|
7353
|
-
//#endregion
|
|
7354
|
-
//#region src/file/track-revision/track-revision-components/deleted-table-row.ts
|
|
7355
|
-
function buildDeletedTableRowObj(options) {
|
|
7356
|
-
return { "w:del": { _attr: {
|
|
7357
|
-
"w:author": options.author,
|
|
7358
|
-
"w:date": options.date,
|
|
7359
|
-
"w:id": options.id
|
|
7360
|
-
} } };
|
|
7361
|
-
}
|
|
7362
|
-
var DeletedTableRow;
|
|
7363
|
-
var init_deleted_table_row = __esmMin((() => {
|
|
7364
|
-
init_xml_components();
|
|
7365
|
-
DeletedTableRow = class extends XmlComponent {
|
|
7366
|
-
constructor(options) {
|
|
7367
|
-
super("w:del");
|
|
7368
|
-
this.root.push({ _attr: {
|
|
7369
|
-
"w:author": options.author,
|
|
7370
|
-
"w:date": options.date,
|
|
7371
|
-
"w:id": options.id
|
|
7372
|
-
} });
|
|
7373
7733
|
}
|
|
7374
|
-
|
|
7375
|
-
|
|
7376
|
-
//#endregion
|
|
7377
|
-
//#region src/file/track-revision/track-revision-components/inserted-table-cell.ts
|
|
7378
|
-
function buildInsertedTableCellObj(options) {
|
|
7379
|
-
return { "w:cellIns": { _attr: {
|
|
7380
|
-
"w:author": options.author,
|
|
7381
|
-
"w:date": options.date,
|
|
7382
|
-
"w:id": options.id
|
|
7383
|
-
} } };
|
|
7384
|
-
}
|
|
7385
|
-
var InsertedTableCell;
|
|
7386
|
-
var init_inserted_table_cell = __esmMin((() => {
|
|
7387
|
-
init_xml_components();
|
|
7388
|
-
InsertedTableCell = class extends XmlComponent {
|
|
7389
|
-
constructor(options) {
|
|
7390
|
-
super("w:cellIns");
|
|
7391
|
-
this.root.push({ _attr: {
|
|
7392
|
-
"w:author": options.author,
|
|
7393
|
-
"w:date": options.date,
|
|
7394
|
-
"w:id": options.id
|
|
7395
|
-
} });
|
|
7734
|
+
get cellCount() {
|
|
7735
|
+
return Math.max(...this.rows.map((r) => r.cellCount), 0);
|
|
7396
7736
|
}
|
|
7397
|
-
|
|
7398
|
-
|
|
7399
|
-
//#endregion
|
|
7400
|
-
//#region src/file/track-revision/track-revision-components/deleted-table-cell.ts
|
|
7401
|
-
function buildDeletedTableCellObj(options) {
|
|
7402
|
-
return { "w:cellDel": { _attr: {
|
|
7403
|
-
"w:author": options.author,
|
|
7404
|
-
"w:date": options.date,
|
|
7405
|
-
"w:id": options.id
|
|
7406
|
-
} } };
|
|
7407
|
-
}
|
|
7408
|
-
var DeletedTableCell;
|
|
7409
|
-
var init_deleted_table_cell = __esmMin((() => {
|
|
7410
|
-
init_xml_components();
|
|
7411
|
-
DeletedTableCell = class extends XmlComponent {
|
|
7412
|
-
constructor(options) {
|
|
7413
|
-
super("w:cellDel");
|
|
7414
|
-
this.root.push({ _attr: {
|
|
7415
|
-
"w:author": options.author,
|
|
7416
|
-
"w:date": options.date,
|
|
7417
|
-
"w:id": options.id
|
|
7418
|
-
} });
|
|
7737
|
+
get cells() {
|
|
7738
|
+
return this.rows.flatMap((r) => r.cells);
|
|
7419
7739
|
}
|
|
7420
|
-
|
|
7421
|
-
|
|
7422
|
-
//#endregion
|
|
7423
|
-
//#region src/file/track-revision/track-revision-components/cell-merge.ts
|
|
7424
|
-
function buildCellMergeObj(options) {
|
|
7425
|
-
const attrs = {
|
|
7426
|
-
"w:author": options.author,
|
|
7427
|
-
"w:date": options.date,
|
|
7428
|
-
"w:id": options.id
|
|
7429
|
-
};
|
|
7430
|
-
if (options.verticalMerge !== void 0) attrs["w:vMerge"] = xsdVerticalMergeRev.to(options.verticalMerge);
|
|
7431
|
-
if (options.verticalMergeOriginal !== void 0) attrs["w:vMergeOrig"] = xsdVerticalMergeRev.to(options.verticalMergeOriginal);
|
|
7432
|
-
return { "w:cellMerge": { _attr: attrs } };
|
|
7433
|
-
}
|
|
7434
|
-
var VerticalMergeRevisionType, CellMerge;
|
|
7435
|
-
var init_cell_merge = __esmMin((() => {
|
|
7436
|
-
init_xml_components();
|
|
7437
|
-
VerticalMergeRevisionType = {
|
|
7438
|
-
/**
|
|
7439
|
-
* Cell that is merged with upper one.
|
|
7440
|
-
*/
|
|
7441
|
-
CONTINUE: "continue",
|
|
7442
|
-
/**
|
|
7443
|
-
* Cell that is starting the vertical merge.
|
|
7444
|
-
*/
|
|
7445
|
-
RESTART: "restart"
|
|
7446
|
-
};
|
|
7447
|
-
CellMerge = class extends XmlComponent {
|
|
7448
|
-
constructor(options) {
|
|
7449
|
-
super("w:cellMerge");
|
|
7450
|
-
const attrs = {
|
|
7451
|
-
"w:author": options.author,
|
|
7452
|
-
"w:date": options.date,
|
|
7453
|
-
"w:id": options.id
|
|
7454
|
-
};
|
|
7455
|
-
if (options.verticalMerge !== void 0) attrs["w:vMerge"] = xsdVerticalMergeRev.to(options.verticalMerge);
|
|
7456
|
-
if (options.verticalMergeOriginal !== void 0) attrs["w:vMergeOrig"] = xsdVerticalMergeRev.to(options.verticalMergeOriginal);
|
|
7457
|
-
this.root.push({ _attr: attrs });
|
|
7740
|
+
addCellToColumnIndex(cell, columnIndex) {
|
|
7741
|
+
if (this.rows.length > 0) this.rows[0].addCellToColumnIndex(cell, columnIndex);
|
|
7458
7742
|
}
|
|
7459
7743
|
};
|
|
7460
7744
|
}));
|
|
7461
7745
|
//#endregion
|
|
7462
|
-
//#region src/file/
|
|
7463
|
-
var
|
|
7464
|
-
|
|
7465
|
-
|
|
7466
|
-
|
|
7467
|
-
init_inserted_table_row();
|
|
7468
|
-
init_deleted_table_row();
|
|
7469
|
-
init_inserted_table_cell();
|
|
7470
|
-
init_deleted_table_cell();
|
|
7471
|
-
init_cell_merge();
|
|
7746
|
+
//#region src/file/sdt/index.ts
|
|
7747
|
+
var init_sdt = __esmMin((() => {
|
|
7748
|
+
init_sdt$1();
|
|
7749
|
+
init_sdt_cell();
|
|
7750
|
+
init_sdt_row();
|
|
7472
7751
|
}));
|
|
7473
7752
|
//#endregion
|
|
7474
|
-
//#region src/file/
|
|
7475
|
-
var
|
|
7476
|
-
var
|
|
7753
|
+
//#region src/file/table/grid.ts
|
|
7754
|
+
var createGridCol, TableGrid, TableGridChange;
|
|
7755
|
+
var init_grid = __esmMin((() => {
|
|
7477
7756
|
init_xml_components();
|
|
7478
|
-
|
|
7479
|
-
|
|
7480
|
-
|
|
7481
|
-
|
|
7757
|
+
init_values();
|
|
7758
|
+
createGridCol = (width) => new BuilderElement({
|
|
7759
|
+
attributes: width !== void 0 ? { width: {
|
|
7760
|
+
key: "w:w",
|
|
7761
|
+
value: (0, values_exports.twipsMeasureValue)(width)
|
|
7762
|
+
} } : void 0,
|
|
7763
|
+
name: "w:gridCol"
|
|
7764
|
+
});
|
|
7765
|
+
TableGrid = class extends XmlComponent {
|
|
7766
|
+
constructor(widths, revision) {
|
|
7767
|
+
super("w:tblGrid");
|
|
7768
|
+
for (const width of widths) this.root.push(createGridCol(width));
|
|
7769
|
+
if (revision) this.root.push(new TableGridChange(revision));
|
|
7770
|
+
}
|
|
7482
7771
|
};
|
|
7483
|
-
|
|
7484
|
-
|
|
7485
|
-
|
|
7772
|
+
TableGridChange = class extends XmlComponent {
|
|
7773
|
+
constructor(options) {
|
|
7774
|
+
super("w:tblGridChange");
|
|
7775
|
+
this.root.push({ _attr: { "w:id": options.id } });
|
|
7776
|
+
this.root.push(new TableGrid(options.columnWidths));
|
|
7777
|
+
}
|
|
7486
7778
|
};
|
|
7487
|
-
createVerticalAlign = (value) => new BuilderElement({
|
|
7488
|
-
attributes: { verticalAlign: {
|
|
7489
|
-
key: "w:val",
|
|
7490
|
-
value
|
|
7491
|
-
} },
|
|
7492
|
-
name: "w:vAlign"
|
|
7493
|
-
});
|
|
7494
|
-
}));
|
|
7495
|
-
//#endregion
|
|
7496
|
-
//#region src/file/vertical-align/index.ts
|
|
7497
|
-
var init_vertical_align = __esmMin((() => {
|
|
7498
|
-
init_vertical_align$1();
|
|
7499
7779
|
}));
|
|
7500
7780
|
//#endregion
|
|
7501
7781
|
//#region src/file/table/table-cell/table-cell-components.ts
|
|
@@ -7544,6 +7824,8 @@ function buildTableCellBorders(options) {
|
|
|
7544
7824
|
if (options.bottom) children.push(buildBorderObj("w:bottom", options.bottom));
|
|
7545
7825
|
if (options.end) children.push(buildBorderObj("w:end", options.end));
|
|
7546
7826
|
if (options.right) children.push(buildBorderObj("w:right", options.right));
|
|
7827
|
+
if (options.topLeftToBottomRight) children.push(buildBorderObj("w:tl2br", options.topLeftToBottomRight));
|
|
7828
|
+
if (options.topRightToBottomLeft) children.push(buildBorderObj("w:tr2bl", options.topRightToBottomLeft));
|
|
7547
7829
|
return children.length > 0 ? { "w:tcBorders": children } : void 0;
|
|
7548
7830
|
}
|
|
7549
7831
|
/**
|
|
@@ -7578,6 +7860,8 @@ var init_table_cell_components = __esmMin((() => {
|
|
|
7578
7860
|
if (options.bottom) this.root.push(createBorderElement("w:bottom", options.bottom));
|
|
7579
7861
|
if (options.end) this.root.push(createBorderElement("w:end", options.end));
|
|
7580
7862
|
if (options.right) this.root.push(createBorderElement("w:right", options.right));
|
|
7863
|
+
if (options.topLeftToBottomRight) this.root.push(createBorderElement("w:tl2br", options.topLeftToBottomRight));
|
|
7864
|
+
if (options.topRightToBottomLeft) this.root.push(createBorderElement("w:tr2bl", options.topRightToBottomLeft));
|
|
7581
7865
|
}
|
|
7582
7866
|
};
|
|
7583
7867
|
GridSpan = class extends XmlComponent {
|
|
@@ -8064,6 +8348,24 @@ var init_table_property_exceptions = __esmMin((() => {
|
|
|
8064
8348
|
if (cellMargin) this.root.push(cellMargin);
|
|
8065
8349
|
}
|
|
8066
8350
|
if (options.tableLook) this.root.push(createTableLook(options.tableLook));
|
|
8351
|
+
if (options.tblPrExChange) {
|
|
8352
|
+
const change = options.tblPrExChange;
|
|
8353
|
+
const attrs = [{
|
|
8354
|
+
key: "w:author",
|
|
8355
|
+
value: change.author
|
|
8356
|
+
}, {
|
|
8357
|
+
key: "w:id",
|
|
8358
|
+
value: change.id
|
|
8359
|
+
}];
|
|
8360
|
+
if (change.date !== void 0) attrs.push({
|
|
8361
|
+
key: "w:date",
|
|
8362
|
+
value: change.date
|
|
8363
|
+
});
|
|
8364
|
+
this.root.push(new BuilderElement({
|
|
8365
|
+
name: "w:tblPrExChange",
|
|
8366
|
+
attributes: attrs
|
|
8367
|
+
}));
|
|
8368
|
+
}
|
|
8067
8369
|
}
|
|
8068
8370
|
};
|
|
8069
8371
|
}));
|
|
@@ -8233,6 +8535,7 @@ var init_table_row_properties = __esmMin((() => {
|
|
|
8233
8535
|
var TableRow;
|
|
8234
8536
|
var init_table_row$1 = __esmMin((() => {
|
|
8235
8537
|
init_xml_components();
|
|
8538
|
+
init_custom_xml();
|
|
8236
8539
|
init_sdt();
|
|
8237
8540
|
init_table_cell$1();
|
|
8238
8541
|
init_table_property_exceptions();
|
|
@@ -8244,7 +8547,7 @@ var init_table_row$1 = __esmMin((() => {
|
|
|
8244
8547
|
constructor(options) {
|
|
8245
8548
|
super("w:tr");
|
|
8246
8549
|
this.options = options;
|
|
8247
|
-
this.coercedChildren = options.cells.map((child) => child instanceof TableCell || child instanceof StructuredDocumentTagCell || child instanceof StructuredDocumentTagRow ? child : new TableCell(child));
|
|
8550
|
+
this.coercedChildren = options.cells.map((child) => child instanceof TableCell || child instanceof StructuredDocumentTagCell || child instanceof StructuredDocumentTagRow || child instanceof CustomXmlCell ? child : new TableCell(child));
|
|
8248
8551
|
}
|
|
8249
8552
|
get cellCount() {
|
|
8250
8553
|
return this.coercedChildren.length;
|
|
@@ -8293,7 +8596,13 @@ var init_table_row$1 = __esmMin((() => {
|
|
|
8293
8596
|
const insertIdx = this.findInsertIndex(columnIndex, prefixCount);
|
|
8294
8597
|
parts.splice(insertIdx, 0, cell.toXml(context));
|
|
8295
8598
|
}
|
|
8296
|
-
|
|
8599
|
+
const rsidAttrs = [];
|
|
8600
|
+
if (this.options.rsidRPr) rsidAttrs.push(` w:rsidRPr="${this.options.rsidRPr}"`);
|
|
8601
|
+
if (this.options.rsidR) rsidAttrs.push(` w:rsidR="${this.options.rsidR}"`);
|
|
8602
|
+
if (this.options.rsidDel) rsidAttrs.push(` w:rsidDel="${this.options.rsidDel}"`);
|
|
8603
|
+
if (this.options.rsidTr) rsidAttrs.push(` w:rsidTr="${this.options.rsidTr}"`);
|
|
8604
|
+
const attr = rsidAttrs.join("");
|
|
8605
|
+
return parts.length ? `<w:tr${attr}>${parts.join("")}</w:tr>` : attr ? `<w:tr${attr}/>` : "<w:tr/>";
|
|
8297
8606
|
}
|
|
8298
8607
|
findInsertIndex(columnIndex, prefixCount) {
|
|
8299
8608
|
let colIdx = 0;
|
|
@@ -8314,9 +8623,79 @@ var init_table_row = __esmMin((() => {
|
|
|
8314
8623
|
init_table_row_height();
|
|
8315
8624
|
}));
|
|
8316
8625
|
//#endregion
|
|
8317
|
-
//#region src/file/table/
|
|
8626
|
+
//#region src/file/table/table.ts
|
|
8627
|
+
var Table;
|
|
8318
8628
|
var init_table$1 = __esmMin((() => {
|
|
8319
|
-
|
|
8629
|
+
init_xml_components();
|
|
8630
|
+
init_custom_xml();
|
|
8631
|
+
init_sdt();
|
|
8632
|
+
init_grid();
|
|
8633
|
+
init_table_cell$1();
|
|
8634
|
+
init_table_properties();
|
|
8635
|
+
init_table_row();
|
|
8636
|
+
Table = class extends BaseXmlComponent {
|
|
8637
|
+
fileChild = Symbol();
|
|
8638
|
+
options;
|
|
8639
|
+
columnWidths;
|
|
8640
|
+
rows;
|
|
8641
|
+
constructor(options) {
|
|
8642
|
+
super("w:tbl");
|
|
8643
|
+
this.options = options;
|
|
8644
|
+
this.rows = options.rows.map((row) => row instanceof TableRow || row instanceof StructuredDocumentTagRow || row instanceof CustomXmlRow ? row : new TableRow(row));
|
|
8645
|
+
this.columnWidths = options.columnWidths ?? Array(Math.max(...this.rows.map((row) => row.cellCount))).fill(100);
|
|
8646
|
+
for (let rowIndex = 0; rowIndex < this.rows.length - 1; rowIndex++) {
|
|
8647
|
+
const row = this.rows[rowIndex];
|
|
8648
|
+
if (!(row instanceof TableRow)) continue;
|
|
8649
|
+
let columnIndex = 0;
|
|
8650
|
+
for (const cell of row.cells) {
|
|
8651
|
+
if (cell.options.rowSpan && cell.options.rowSpan > 1) {
|
|
8652
|
+
const nextRow = this.rows[rowIndex + 1];
|
|
8653
|
+
if (nextRow instanceof TableRow) {
|
|
8654
|
+
const continueCell = new TableCell({
|
|
8655
|
+
borders: cell.options.borders,
|
|
8656
|
+
children: [],
|
|
8657
|
+
columnSpan: cell.options.columnSpan,
|
|
8658
|
+
rowSpan: cell.options.rowSpan - 1,
|
|
8659
|
+
verticalMerge: VerticalMergeType.CONTINUE
|
|
8660
|
+
});
|
|
8661
|
+
nextRow.addCellToColumnIndex(continueCell, columnIndex);
|
|
8662
|
+
}
|
|
8663
|
+
}
|
|
8664
|
+
columnIndex += cell.options.columnSpan || 1;
|
|
8665
|
+
}
|
|
8666
|
+
}
|
|
8667
|
+
}
|
|
8668
|
+
toXml(context) {
|
|
8669
|
+
const parts = [];
|
|
8670
|
+
const tblPr = new TableProperties({
|
|
8671
|
+
alignment: this.options.alignment,
|
|
8672
|
+
borders: this.options.borders ?? {},
|
|
8673
|
+
caption: this.options.caption,
|
|
8674
|
+
cellMargin: this.options.margins,
|
|
8675
|
+
cellSpacing: this.options.cellSpacing,
|
|
8676
|
+
description: this.options.description,
|
|
8677
|
+
float: this.options.float,
|
|
8678
|
+
indent: this.options.indent,
|
|
8679
|
+
layout: this.options.layout,
|
|
8680
|
+
revision: this.options.revision,
|
|
8681
|
+
style: this.options.style,
|
|
8682
|
+
styleColBandSize: this.options.styleColBandSize,
|
|
8683
|
+
styleRowBandSize: this.options.styleRowBandSize,
|
|
8684
|
+
tableLook: this.options.tableLook,
|
|
8685
|
+
visuallyRightToLeft: this.options.visuallyRightToLeft,
|
|
8686
|
+
width: this.options.width ?? { size: 100 }
|
|
8687
|
+
});
|
|
8688
|
+
parts.push(tblPr.toXml(context));
|
|
8689
|
+
parts.push(new TableGrid(this.columnWidths, this.options.columnWidthsRevision).toXml(context));
|
|
8690
|
+
for (const row of this.rows) parts.push(row.toXml(context));
|
|
8691
|
+
return `<w:tbl>${parts.join("")}</w:tbl>`;
|
|
8692
|
+
}
|
|
8693
|
+
};
|
|
8694
|
+
}));
|
|
8695
|
+
//#endregion
|
|
8696
|
+
//#region src/file/table/index.ts
|
|
8697
|
+
var init_table = __esmMin((() => {
|
|
8698
|
+
init_table$1();
|
|
8320
8699
|
init_table_cell$1();
|
|
8321
8700
|
init_table_properties();
|
|
8322
8701
|
init_table_row();
|
|
@@ -8326,7 +8705,7 @@ var init_table$1 = __esmMin((() => {
|
|
|
8326
8705
|
//#region src/file/table/table-properties/table-cell-margin.ts
|
|
8327
8706
|
var buildMarginChildren, createTableCellMargin, buildMarginChildrenObjs, buildTableCellMarginObj, buildCellMarginObj;
|
|
8328
8707
|
var init_table_cell_margin = __esmMin((() => {
|
|
8329
|
-
init_table
|
|
8708
|
+
init_table();
|
|
8330
8709
|
init_xml_components();
|
|
8331
8710
|
buildMarginChildren = ({ marginUnitType = WidthType.DXA, top, left, bottom, right }) => [
|
|
8332
8711
|
{
|
|
@@ -8480,23 +8859,43 @@ var init_table_cell = __esmMin((() => {
|
|
|
8480
8859
|
};
|
|
8481
8860
|
}));
|
|
8482
8861
|
//#endregion
|
|
8483
|
-
//#region src/file/
|
|
8484
|
-
var
|
|
8485
|
-
var
|
|
8486
|
-
init_xml_components();
|
|
8487
|
-
init_table_of_contents();
|
|
8862
|
+
//#region src/file/custom-xml/custom-xml.ts
|
|
8863
|
+
var FILE_CHILD, CustomXmlRun, CustomXmlBlock, CustomXmlRow, CustomXmlCell, CustomXmlPrComponent;
|
|
8864
|
+
var init_custom_xml$1 = __esmMin((() => {
|
|
8488
8865
|
init_table_cell();
|
|
8489
|
-
|
|
8866
|
+
init_xml_components();
|
|
8867
|
+
FILE_CHILD = Symbol("fileChild");
|
|
8868
|
+
CustomXmlRun = class extends XmlComponent {
|
|
8869
|
+
constructor(options) {
|
|
8870
|
+
super("w:customXml");
|
|
8871
|
+
const attrs = { "w:element": options.element };
|
|
8872
|
+
if (options.uri !== void 0) attrs["w:uri"] = options.uri;
|
|
8873
|
+
this.root.push({ _attr: attrs });
|
|
8874
|
+
if (options.customXmlPr !== void 0) this.root.push(new CustomXmlPrComponent(options.customXmlPr));
|
|
8875
|
+
if (options.children !== void 0) for (const child of options.children) this.root.push(child);
|
|
8876
|
+
}
|
|
8877
|
+
};
|
|
8878
|
+
CustomXmlBlock = class extends XmlComponent {
|
|
8879
|
+
fileChild = FILE_CHILD;
|
|
8880
|
+
constructor(options) {
|
|
8881
|
+
super("w:customXml");
|
|
8882
|
+
const attrs = { "w:element": options.element };
|
|
8883
|
+
if (options.uri !== void 0) attrs["w:uri"] = options.uri;
|
|
8884
|
+
this.root.push({ _attr: attrs });
|
|
8885
|
+
if (options.customXmlPr !== void 0) this.root.push(new CustomXmlPrComponent(options.customXmlPr));
|
|
8886
|
+
if (options.children !== void 0) for (const child of options.children) this.root.push(child);
|
|
8887
|
+
}
|
|
8888
|
+
};
|
|
8889
|
+
CustomXmlRow = class extends XmlComponent {
|
|
8490
8890
|
rows;
|
|
8491
8891
|
constructor(options) {
|
|
8492
|
-
super("w:
|
|
8892
|
+
super("w:customXml");
|
|
8493
8893
|
this.rows = options.children ?? [];
|
|
8494
|
-
|
|
8495
|
-
if (
|
|
8496
|
-
|
|
8497
|
-
|
|
8498
|
-
|
|
8499
|
-
}
|
|
8894
|
+
const attrs = { "w:element": options.element };
|
|
8895
|
+
if (options.uri !== void 0) attrs["w:uri"] = options.uri;
|
|
8896
|
+
this.root.push({ _attr: attrs });
|
|
8897
|
+
if (options.customXmlPr !== void 0) this.root.push(new CustomXmlPrComponent(options.customXmlPr));
|
|
8898
|
+
for (const row of this.rows) this.root.push(row);
|
|
8500
8899
|
}
|
|
8501
8900
|
get cellCount() {
|
|
8502
8901
|
return Math.max(...this.rows.map((r) => r.cellCount), 0);
|
|
@@ -8504,112 +8903,84 @@ var init_sdt_row = __esmMin((() => {
|
|
|
8504
8903
|
get cells() {
|
|
8505
8904
|
return this.rows.flatMap((r) => r.cells);
|
|
8506
8905
|
}
|
|
8906
|
+
/** @internal Used by Table to insert CONTINUE cells for vertical merge. */
|
|
8507
8907
|
addCellToColumnIndex(cell, columnIndex) {
|
|
8508
8908
|
if (this.rows.length > 0) this.rows[0].addCellToColumnIndex(cell, columnIndex);
|
|
8509
8909
|
}
|
|
8510
8910
|
};
|
|
8511
|
-
|
|
8512
|
-
|
|
8513
|
-
|
|
8514
|
-
|
|
8515
|
-
|
|
8516
|
-
|
|
8517
|
-
|
|
8518
|
-
|
|
8519
|
-
//#endregion
|
|
8520
|
-
//#region src/file/table/grid.ts
|
|
8521
|
-
var createGridCol, TableGrid, TableGridChange;
|
|
8522
|
-
var init_grid = __esmMin((() => {
|
|
8523
|
-
init_xml_components();
|
|
8524
|
-
init_values();
|
|
8525
|
-
createGridCol = (width) => new BuilderElement({
|
|
8526
|
-
attributes: width !== void 0 ? { width: {
|
|
8527
|
-
key: "w:w",
|
|
8528
|
-
value: (0, values_exports.twipsMeasureValue)(width)
|
|
8529
|
-
} } : void 0,
|
|
8530
|
-
name: "w:gridCol"
|
|
8531
|
-
});
|
|
8532
|
-
TableGrid = class extends XmlComponent {
|
|
8533
|
-
constructor(widths, revision) {
|
|
8534
|
-
super("w:tblGrid");
|
|
8535
|
-
for (const width of widths) this.root.push(createGridCol(width));
|
|
8536
|
-
if (revision) this.root.push(new TableGridChange(revision));
|
|
8911
|
+
CustomXmlCell = class extends XmlComponent {
|
|
8912
|
+
constructor(options) {
|
|
8913
|
+
super("w:customXml");
|
|
8914
|
+
const attrs = { "w:element": options.element };
|
|
8915
|
+
if (options.uri !== void 0) attrs["w:uri"] = options.uri;
|
|
8916
|
+
this.root.push({ _attr: attrs });
|
|
8917
|
+
if (options.customXmlPr !== void 0) this.root.push(new CustomXmlPrComponent(options.customXmlPr));
|
|
8918
|
+
if (options.children !== void 0) for (const child of options.children) this.root.push(child);
|
|
8537
8919
|
}
|
|
8538
8920
|
};
|
|
8539
|
-
|
|
8921
|
+
CustomXmlPrComponent = class extends XmlComponent {
|
|
8540
8922
|
constructor(options) {
|
|
8541
|
-
super("w:
|
|
8542
|
-
this.root.push(
|
|
8543
|
-
|
|
8923
|
+
super("w:customXmlPr");
|
|
8924
|
+
if (options.placeholder !== void 0) this.root.push(new BuilderElement({
|
|
8925
|
+
name: "w:placeholder",
|
|
8926
|
+
attributes: [{
|
|
8927
|
+
key: "w:val",
|
|
8928
|
+
value: options.placeholder
|
|
8929
|
+
}]
|
|
8930
|
+
}));
|
|
8931
|
+
if (options.attributes !== void 0) for (const attr of options.attributes) {
|
|
8932
|
+
const attrItems = [{
|
|
8933
|
+
key: "w:name",
|
|
8934
|
+
value: attr.name
|
|
8935
|
+
}, {
|
|
8936
|
+
key: "w:val",
|
|
8937
|
+
value: attr.val
|
|
8938
|
+
}];
|
|
8939
|
+
if (attr.uri !== void 0) attrItems.push({
|
|
8940
|
+
key: "w:uri",
|
|
8941
|
+
value: attr.uri
|
|
8942
|
+
});
|
|
8943
|
+
this.root.push(new BuilderElement({
|
|
8944
|
+
name: "w:attr",
|
|
8945
|
+
attributes: attrItems
|
|
8946
|
+
}));
|
|
8947
|
+
}
|
|
8544
8948
|
}
|
|
8545
8949
|
};
|
|
8546
8950
|
}));
|
|
8547
8951
|
//#endregion
|
|
8548
|
-
//#region src/file/
|
|
8549
|
-
var
|
|
8550
|
-
|
|
8551
|
-
|
|
8552
|
-
|
|
8553
|
-
|
|
8554
|
-
|
|
8555
|
-
|
|
8556
|
-
|
|
8557
|
-
|
|
8558
|
-
|
|
8559
|
-
|
|
8560
|
-
|
|
8561
|
-
|
|
8562
|
-
constructor(options) {
|
|
8563
|
-
super("w:
|
|
8564
|
-
this.options = options;
|
|
8565
|
-
|
|
8566
|
-
|
|
8567
|
-
|
|
8568
|
-
|
|
8569
|
-
|
|
8570
|
-
|
|
8571
|
-
|
|
8572
|
-
|
|
8573
|
-
|
|
8574
|
-
if (nextRow instanceof TableRow) {
|
|
8575
|
-
const continueCell = new TableCell({
|
|
8576
|
-
borders: cell.options.borders,
|
|
8577
|
-
children: [],
|
|
8578
|
-
columnSpan: cell.options.columnSpan,
|
|
8579
|
-
rowSpan: cell.options.rowSpan - 1,
|
|
8580
|
-
verticalMerge: VerticalMergeType.CONTINUE
|
|
8581
|
-
});
|
|
8582
|
-
nextRow.addCellToColumnIndex(continueCell, columnIndex);
|
|
8583
|
-
}
|
|
8584
|
-
}
|
|
8585
|
-
columnIndex += cell.options.columnSpan || 1;
|
|
8586
|
-
}
|
|
8587
|
-
}
|
|
8588
|
-
}
|
|
8589
|
-
toXml(context) {
|
|
8590
|
-
const parts = [];
|
|
8591
|
-
const tblPr = new TableProperties({
|
|
8592
|
-
alignment: this.options.alignment,
|
|
8593
|
-
borders: this.options.borders ?? {},
|
|
8594
|
-
caption: this.options.caption,
|
|
8595
|
-
cellMargin: this.options.margins,
|
|
8596
|
-
cellSpacing: this.options.cellSpacing,
|
|
8597
|
-
description: this.options.description,
|
|
8598
|
-
float: this.options.float,
|
|
8599
|
-
indent: this.options.indent,
|
|
8600
|
-
layout: this.options.layout,
|
|
8601
|
-
revision: this.options.revision,
|
|
8602
|
-
style: this.options.style,
|
|
8603
|
-
styleColBandSize: this.options.styleColBandSize,
|
|
8604
|
-
styleRowBandSize: this.options.styleRowBandSize,
|
|
8605
|
-
tableLook: this.options.tableLook,
|
|
8606
|
-
visuallyRightToLeft: this.options.visuallyRightToLeft,
|
|
8607
|
-
width: this.options.width ?? { size: 100 }
|
|
8952
|
+
//#region src/file/custom-xml/index.ts
|
|
8953
|
+
var init_custom_xml = __esmMin((() => {
|
|
8954
|
+
init_custom_xml$1();
|
|
8955
|
+
}));
|
|
8956
|
+
//#endregion
|
|
8957
|
+
//#region src/file/sub-doc/sub-doc.ts
|
|
8958
|
+
var SUBDOC_RELATIONSHIP_TYPE, SubDoc;
|
|
8959
|
+
var init_sub_doc = __esmMin((() => {
|
|
8960
|
+
init_xml_components();
|
|
8961
|
+
init_convenience_functions();
|
|
8962
|
+
SUBDOC_RELATIONSHIP_TYPE = "http://schemas.openxmlformats.org/officeDocument/2006/relationships/subDocument";
|
|
8963
|
+
SubDoc = class extends XmlComponent {
|
|
8964
|
+
fileChild = Symbol();
|
|
8965
|
+
options;
|
|
8966
|
+
constructor(options) {
|
|
8967
|
+
super("w:subDoc");
|
|
8968
|
+
this.options = options;
|
|
8969
|
+
}
|
|
8970
|
+
toXml(context) {
|
|
8971
|
+
const relId = uniqueId();
|
|
8972
|
+
const partPath = `subdocs/subdoc${relId}.docx`;
|
|
8973
|
+
const data = typeof this.options.data === "string" ? new TextEncoder().encode(this.options.data) : this.options.data;
|
|
8974
|
+
context.viewWrapper.relationships.addRelationship(relId, SUBDOC_RELATIONSHIP_TYPE, partPath);
|
|
8975
|
+
context.file.subDocs.addSubDoc(relId, {
|
|
8976
|
+
data,
|
|
8977
|
+
path: partPath
|
|
8608
8978
|
});
|
|
8609
|
-
|
|
8610
|
-
|
|
8611
|
-
|
|
8612
|
-
|
|
8979
|
+
context.file.contentTypes.addSubDoc(`/word/${partPath}`);
|
|
8980
|
+
this.root.splice(0, 0, { _attr: { "r:id": `rId${relId}` } });
|
|
8981
|
+
const result = super.toXml(context);
|
|
8982
|
+
this.root.splice(0, 1);
|
|
8983
|
+
return result;
|
|
8613
8984
|
}
|
|
8614
8985
|
};
|
|
8615
8986
|
}));
|
|
@@ -8691,7 +9062,8 @@ var init_shape = __esmMin((() => {
|
|
|
8691
9062
|
zIndex: "z-index"
|
|
8692
9063
|
};
|
|
8693
9064
|
formatShapeStyle = (style) => style ? Object.entries(style).map(([key, value]) => `${styleToKeyMap[key]}:${value}`).join(";") : void 0;
|
|
8694
|
-
createShape = ({ id, children, type = SHAPE_TYPE, style }) => new BuilderElement({
|
|
9065
|
+
createShape = ({ id, children, type = SHAPE_TYPE, style, fillColor, strokeColor, strokeWeight, filled, stroked, coordOrigin, coordSize, insetPen, adjustment, path, arcSize, print, equationXml }) => new BuilderElement({
|
|
9066
|
+
name: "v:shape",
|
|
8695
9067
|
attributes: {
|
|
8696
9068
|
id: {
|
|
8697
9069
|
key: "id",
|
|
@@ -8704,13 +9076,64 @@ var init_shape = __esmMin((() => {
|
|
|
8704
9076
|
type: {
|
|
8705
9077
|
key: "type",
|
|
8706
9078
|
value: type
|
|
9079
|
+
},
|
|
9080
|
+
fillColor: {
|
|
9081
|
+
key: "fillcolor",
|
|
9082
|
+
value: fillColor
|
|
9083
|
+
},
|
|
9084
|
+
strokeColor: {
|
|
9085
|
+
key: "strokecolor",
|
|
9086
|
+
value: strokeColor
|
|
9087
|
+
},
|
|
9088
|
+
strokeWeight: {
|
|
9089
|
+
key: "strokeweight",
|
|
9090
|
+
value: strokeWeight
|
|
9091
|
+
},
|
|
9092
|
+
filled: {
|
|
9093
|
+
key: "filled",
|
|
9094
|
+
value: filled !== void 0 ? filled ? "true" : "false" : void 0
|
|
9095
|
+
},
|
|
9096
|
+
stroked: {
|
|
9097
|
+
key: "stroked",
|
|
9098
|
+
value: stroked !== void 0 ? stroked ? "true" : "false" : void 0
|
|
9099
|
+
},
|
|
9100
|
+
coordOrigin: {
|
|
9101
|
+
key: "coordorigin",
|
|
9102
|
+
value: coordOrigin
|
|
9103
|
+
},
|
|
9104
|
+
coordSize: {
|
|
9105
|
+
key: "coordsize",
|
|
9106
|
+
value: coordSize
|
|
9107
|
+
},
|
|
9108
|
+
insetPen: {
|
|
9109
|
+
key: "insetpen",
|
|
9110
|
+
value: insetPen !== void 0 ? insetPen ? "true" : "false" : void 0
|
|
9111
|
+
},
|
|
9112
|
+
adjustment: {
|
|
9113
|
+
key: "adj",
|
|
9114
|
+
value: adjustment
|
|
9115
|
+
},
|
|
9116
|
+
path: {
|
|
9117
|
+
key: "path",
|
|
9118
|
+
value: path
|
|
9119
|
+
},
|
|
9120
|
+
arcSize: {
|
|
9121
|
+
key: "arcsize",
|
|
9122
|
+
value: arcSize
|
|
9123
|
+
},
|
|
9124
|
+
print: {
|
|
9125
|
+
key: "print",
|
|
9126
|
+
value: print !== void 0 ? print ? "true" : "false" : void 0
|
|
9127
|
+
},
|
|
9128
|
+
equationXml: {
|
|
9129
|
+
key: "equationxml",
|
|
9130
|
+
value: equationXml
|
|
8707
9131
|
}
|
|
8708
9132
|
},
|
|
8709
9133
|
children: [createVmlTextbox({
|
|
8710
9134
|
children,
|
|
8711
9135
|
style: "mso-fit-shape-to-text:t;"
|
|
8712
|
-
})]
|
|
8713
|
-
name: "v:shape"
|
|
9136
|
+
})]
|
|
8714
9137
|
});
|
|
8715
9138
|
}));
|
|
8716
9139
|
//#endregion
|
|
@@ -8768,15 +9191,17 @@ function coerceSectionChild(child) {
|
|
|
8768
9191
|
}
|
|
8769
9192
|
if ("altChunk" in child) return new AltChunk(child.altChunk);
|
|
8770
9193
|
if ("subDoc" in child) return new SubDoc(child.subDoc);
|
|
9194
|
+
if ("customXml" in child) return new CustomXmlBlock(child.customXml);
|
|
8771
9195
|
throw new Error("Unknown section child type");
|
|
8772
9196
|
}
|
|
8773
9197
|
var init_coerce = __esmMin((() => {
|
|
8774
9198
|
init_alt_chunk();
|
|
9199
|
+
init_custom_xml();
|
|
8775
9200
|
init_paragraph$1();
|
|
8776
9201
|
init_sdt$1();
|
|
8777
9202
|
init_sub_doc();
|
|
8778
9203
|
init_table_of_contents$1();
|
|
8779
|
-
init_table();
|
|
9204
|
+
init_table$1();
|
|
8780
9205
|
init_textbox();
|
|
8781
9206
|
init_xml_components();
|
|
8782
9207
|
}));
|
|
@@ -8956,6 +9381,18 @@ var ContentTypes = class extends XmlComponent {
|
|
|
8956
9381
|
this.root.push(createOverride("application/vnd.openxmlformats-officedocument.wordprocessingml.bibliography+xml", "/word/bibliography.xml"));
|
|
8957
9382
|
}
|
|
8958
9383
|
/**
|
|
9384
|
+
* Registers a glossary document part in the content types.
|
|
9385
|
+
*/
|
|
9386
|
+
addGlossary() {
|
|
9387
|
+
this.root.push(createOverride("application/vnd.openxmlformats-officedocument.wordprocessingml.glossary+xml", "/word/glossary/document.xml"));
|
|
9388
|
+
}
|
|
9389
|
+
/**
|
|
9390
|
+
* Registers a web settings part in the content types.
|
|
9391
|
+
*/
|
|
9392
|
+
addWebSettings() {
|
|
9393
|
+
this.root.push(createOverride("application/vnd.openxmlformats-officedocument.wordprocessingml.webSettings+xml", "/word/webSettings.xml"));
|
|
9394
|
+
}
|
|
9395
|
+
/**
|
|
8959
9396
|
* Registers a footer part in the content types.
|
|
8960
9397
|
*
|
|
8961
9398
|
* @param index - Footer index number (e.g., 1 for footer1.xml)
|
|
@@ -10217,8 +10654,14 @@ const sectionPageSizeDefaults = {
|
|
|
10217
10654
|
* ```
|
|
10218
10655
|
*/
|
|
10219
10656
|
var SectionProperties = class extends XmlComponent {
|
|
10220
|
-
constructor({ page: { size: { width = sectionPageSizeDefaults.WIDTH, height = sectionPageSizeDefaults.HEIGHT, orientation = sectionPageSizeDefaults.ORIENTATION } = {}, margin: { top = sectionMarginDefaults.TOP, right = sectionMarginDefaults.RIGHT, bottom = sectionMarginDefaults.BOTTOM, left = sectionMarginDefaults.LEFT, header = sectionMarginDefaults.HEADER, footer = sectionMarginDefaults.FOOTER, gutter = sectionMarginDefaults.GUTTER } = {}, pageNumbers = {}, borders, textDirection } = {}, grid: { linePitch = 312, charSpace = 0, type: gridType = "lines" } = {}, headerWrapperGroup = {}, footerWrapperGroup = {}, lineNumbers, titlePage, verticalAlign, column, type, revision, noEndnote, formProtection, bidi, rtlGutter, paperSrc, footnotePr, endnotePr, printerSettingsId } = {}) {
|
|
10657
|
+
constructor({ page: { size: { width = sectionPageSizeDefaults.WIDTH, height = sectionPageSizeDefaults.HEIGHT, orientation = sectionPageSizeDefaults.ORIENTATION } = {}, margin: { top = sectionMarginDefaults.TOP, right = sectionMarginDefaults.RIGHT, bottom = sectionMarginDefaults.BOTTOM, left = sectionMarginDefaults.LEFT, header = sectionMarginDefaults.HEADER, footer = sectionMarginDefaults.FOOTER, gutter = sectionMarginDefaults.GUTTER } = {}, pageNumbers = {}, borders, textDirection } = {}, grid: { linePitch = 312, charSpace = 0, type: gridType = "lines" } = {}, headerWrapperGroup = {}, footerWrapperGroup = {}, lineNumbers, titlePage, verticalAlign, column, type, revision, noEndnote, formProtection, bidi, rtlGutter, paperSrc, footnotePr, endnotePr, printerSettingsId, rsidRPr, rsidDel, rsidR, rsidSect } = {}) {
|
|
10221
10658
|
super("w:sectPr");
|
|
10659
|
+
const sectAttrs = {};
|
|
10660
|
+
if (rsidRPr !== void 0) sectAttrs["w:rsidRPr"] = rsidRPr;
|
|
10661
|
+
if (rsidDel !== void 0) sectAttrs["w:rsidDel"] = rsidDel;
|
|
10662
|
+
if (rsidR !== void 0) sectAttrs["w:rsidR"] = rsidR;
|
|
10663
|
+
if (rsidSect !== void 0) sectAttrs["w:rsidSect"] = rsidSect;
|
|
10664
|
+
if (Object.keys(sectAttrs).length > 0) this.root.push({ _attr: sectAttrs });
|
|
10222
10665
|
this.addHeaderFooterGroup(HeaderFooterType.HEADER, headerWrapperGroup);
|
|
10223
10666
|
this.addHeaderFooterGroup(HeaderFooterType.FOOTER, footerWrapperGroup);
|
|
10224
10667
|
if (footnotePr) this.root.push(createFootnoteProperties(footnotePr));
|
|
@@ -10624,6 +11067,7 @@ var Document = class extends XmlComponent {
|
|
|
10624
11067
|
"w16sdtdh",
|
|
10625
11068
|
"w16se"
|
|
10626
11069
|
], "w14 w15 wp14"));
|
|
11070
|
+
if (options.conformance) this.root.push({ _attr: { "w:conformance": options.conformance } });
|
|
10627
11071
|
this.body = new Body();
|
|
10628
11072
|
if (options.background) this.root.push(new DocumentBackground(options.background));
|
|
10629
11073
|
this.root.push(this.body);
|
|
@@ -11036,14 +11480,18 @@ init_xml_components();
|
|
|
11036
11480
|
*
|
|
11037
11481
|
* ## XSD Schema
|
|
11038
11482
|
* ```xml
|
|
11039
|
-
* <xsd:
|
|
11483
|
+
* <xsd:complexType name="CT_FtnEdnRef">
|
|
11484
|
+
* <xsd:attribute name="customMarkFollows" type="s:ST_OnOff" use="optional"/>
|
|
11485
|
+
* <xsd:attribute name="id" use="required" type="ST_DecimalNumber"/>
|
|
11486
|
+
* </xsd:complexType>
|
|
11040
11487
|
* ```
|
|
11041
11488
|
*
|
|
11042
11489
|
* @internal
|
|
11043
11490
|
*/
|
|
11044
11491
|
var FootnoteRef = class extends XmlComponent {
|
|
11045
|
-
constructor() {
|
|
11492
|
+
constructor(options) {
|
|
11046
11493
|
super("w:footnoteRef");
|
|
11494
|
+
if (options?.customMarkFollows !== void 0) this.root.push({ _attr: { "w:customMarkFollows": options.customMarkFollows ? "1" : "0" } });
|
|
11047
11495
|
}
|
|
11048
11496
|
};
|
|
11049
11497
|
//#endregion
|
|
@@ -11568,9 +12016,11 @@ var NumberFormat$1 = class extends XmlComponent {
|
|
|
11568
12016
|
* numbering from different levels.
|
|
11569
12017
|
*/
|
|
11570
12018
|
var LevelText = class extends XmlComponent {
|
|
11571
|
-
constructor(value) {
|
|
12019
|
+
constructor(value, nullAttribute) {
|
|
11572
12020
|
super("w:lvlText");
|
|
11573
|
-
|
|
12021
|
+
const attrs = { "w:val": value };
|
|
12022
|
+
if (nullAttribute !== void 0) attrs["w:null"] = nullAttribute ? "1" : "0";
|
|
12023
|
+
this.root.push({ _attr: attrs });
|
|
11574
12024
|
}
|
|
11575
12025
|
};
|
|
11576
12026
|
/**
|
|
@@ -11673,13 +12123,32 @@ var LevelBase = class extends XmlComponent {
|
|
|
11673
12123
|
* @param options - Level configuration options
|
|
11674
12124
|
* @throws Error if level is greater than 9 (Word limitation)
|
|
11675
12125
|
*/
|
|
11676
|
-
constructor({ level, format, text, alignment = AlignmentType.START, start = 1, style, suffix, isLegalNumberingStyle }) {
|
|
12126
|
+
constructor({ level, format, text, alignment = AlignmentType.START, start = 1, style, suffix, isLegalNumberingStyle, lvlRestart, lvlPicBulletId, legacy, templateCode, tentative }) {
|
|
11677
12127
|
super("w:lvl");
|
|
12128
|
+
if (templateCode !== void 0) this.root.push({ _attr: { "w:tplc": templateCode } });
|
|
12129
|
+
if (tentative !== void 0) this.root.push({ _attr: { "w:tentative": tentative ? 1 : 0 } });
|
|
11678
12130
|
this.root.push(numberValObj("w:start", (0, values_exports.decimalNumber)(start)));
|
|
11679
12131
|
if (format) this.root.push(new NumberFormat$1(format));
|
|
12132
|
+
if (lvlRestart !== void 0) this.root.push(numberValObj("w:lvlRestart", (0, values_exports.decimalNumber)(lvlRestart)));
|
|
11680
12133
|
if (suffix) this.root.push(new Suffix(suffix));
|
|
11681
12134
|
if (isLegalNumberingStyle) this.root.push(new IsLegalNumberingStyle());
|
|
11682
12135
|
if (text) this.root.push(new LevelText(text));
|
|
12136
|
+
if (lvlPicBulletId !== void 0) this.root.push(numberValObj("w:lvlPicBulletId", (0, values_exports.decimalNumber)(lvlPicBulletId)));
|
|
12137
|
+
if (legacy !== void 0) {
|
|
12138
|
+
const attrs = [];
|
|
12139
|
+
if (legacy.space !== void 0) attrs.push({
|
|
12140
|
+
key: "w:legacySpace",
|
|
12141
|
+
value: legacy.space
|
|
12142
|
+
});
|
|
12143
|
+
if (legacy.indent !== void 0) attrs.push({
|
|
12144
|
+
key: "w:legacyIndent",
|
|
12145
|
+
value: legacy.indent
|
|
12146
|
+
});
|
|
12147
|
+
this.root.push(new BuilderElement({
|
|
12148
|
+
attributes: attrs,
|
|
12149
|
+
name: "w:legacy"
|
|
12150
|
+
}));
|
|
12151
|
+
}
|
|
11683
12152
|
this.root.push(new LevelJc(alignment));
|
|
11684
12153
|
this.paragraphProperties = new ParagraphProperties(style && style.paragraph);
|
|
11685
12154
|
this.runProperties = new RunProperties(style && style.run);
|
|
@@ -11785,10 +12254,6 @@ init_values();
|
|
|
11785
12254
|
/**
|
|
11786
12255
|
* Represents an abstract numbering definition in a WordprocessingML document.
|
|
11787
12256
|
*
|
|
11788
|
-
* Abstract numbering definitions define the formatting and style of numbered or
|
|
11789
|
-
* bulleted lists that can be referenced by concrete numbering instances.
|
|
11790
|
-
* Each abstract definition can contain up to 9 levels.
|
|
11791
|
-
*
|
|
11792
12257
|
* Reference: http://officeopenxml.com/WPnumbering.php
|
|
11793
12258
|
*
|
|
11794
12259
|
* ## XSD Schema
|
|
@@ -11806,43 +12271,26 @@ init_values();
|
|
|
11806
12271
|
* <xsd:attribute name="abstractNumId" type="ST_DecimalNumber" use="required"/>
|
|
11807
12272
|
* </xsd:complexType>
|
|
11808
12273
|
* ```
|
|
11809
|
-
*
|
|
11810
|
-
* @example
|
|
11811
|
-
* ```typescript
|
|
11812
|
-
* // Create an abstract numbering definition with multiple levels
|
|
11813
|
-
* const abstractNumbering = new AbstractNumbering(1, [
|
|
11814
|
-
* {
|
|
11815
|
-
* level: 0,
|
|
11816
|
-
* format: LevelFormat.DECIMAL,
|
|
11817
|
-
* text: "%1.",
|
|
11818
|
-
* alignment: AlignmentType.LEFT,
|
|
11819
|
-
* },
|
|
11820
|
-
* {
|
|
11821
|
-
* level: 1,
|
|
11822
|
-
* format: LevelFormat.LOWER_LETTER,
|
|
11823
|
-
* text: "%2)",
|
|
11824
|
-
* alignment: AlignmentType.LEFT,
|
|
11825
|
-
* },
|
|
11826
|
-
* ]);
|
|
11827
|
-
* ```
|
|
11828
12274
|
*/
|
|
11829
12275
|
var AbstractNumbering = class extends XmlComponent {
|
|
11830
12276
|
/** The unique identifier for this abstract numbering definition. */
|
|
11831
12277
|
id;
|
|
11832
12278
|
/**
|
|
11833
12279
|
* Creates a new abstract numbering definition.
|
|
11834
|
-
*
|
|
11835
|
-
* @param id - Unique identifier for this abstract numbering definition
|
|
11836
|
-
* @param levelOptions - Array of level definitions (up to 9 levels)
|
|
11837
12280
|
*/
|
|
11838
|
-
constructor(id, levelOptions) {
|
|
12281
|
+
constructor(id, levelOptions, extraOptions) {
|
|
11839
12282
|
super("w:abstractNum");
|
|
11840
12283
|
this.root.push({ _attr: {
|
|
11841
12284
|
"w:abstractNumId": (0, values_exports.decimalNumber)(id),
|
|
11842
12285
|
"w15:restartNumberingAfterBreak": 0
|
|
11843
12286
|
} });
|
|
11844
|
-
this.root.push(new MultiLevelType("hybridMultilevel"));
|
|
11845
12287
|
this.id = id;
|
|
12288
|
+
if (extraOptions?.nsid !== void 0) this.root.push(stringValObj("w:nsid", extraOptions.nsid));
|
|
12289
|
+
this.root.push(new MultiLevelType("hybridMultilevel"));
|
|
12290
|
+
if (extraOptions?.tmpl !== void 0) this.root.push(stringValObj("w:tmpl", extraOptions.tmpl));
|
|
12291
|
+
if (extraOptions?.name !== void 0) this.root.push(stringValObj("w:name", extraOptions.name));
|
|
12292
|
+
if (extraOptions?.styleLink !== void 0) this.root.push(stringValObj("w:styleLink", extraOptions.styleLink));
|
|
12293
|
+
if (extraOptions?.numStyleLink !== void 0) this.root.push(stringValObj("w:numStyleLink", extraOptions.numStyleLink));
|
|
11846
12294
|
for (const option of levelOptions) this.root.push(new Level(option));
|
|
11847
12295
|
}
|
|
11848
12296
|
};
|
|
@@ -11959,6 +12407,7 @@ var StartOverride = class extends XmlComponent {
|
|
|
11959
12407
|
init_paragraph();
|
|
11960
12408
|
init_xml_components();
|
|
11961
12409
|
init_convenience_functions();
|
|
12410
|
+
init_values();
|
|
11962
12411
|
/**
|
|
11963
12412
|
* Represents the numbering definitions in a WordprocessingML document.
|
|
11964
12413
|
*
|
|
@@ -12026,6 +12475,8 @@ var Numbering = class extends XmlComponent {
|
|
|
12026
12475
|
referenceConfigMap = /* @__PURE__ */ new Map();
|
|
12027
12476
|
abstractNumUniqueNumericId = abstractNumUniqueNumericIdGen();
|
|
12028
12477
|
concreteNumUniqueNumericId = concreteNumUniqueNumericIdGen();
|
|
12478
|
+
_numIdMacAtCleanup;
|
|
12479
|
+
_numPicBullets;
|
|
12029
12480
|
/**
|
|
12030
12481
|
* Creates a new numbering definition collection.
|
|
12031
12482
|
*
|
|
@@ -12036,6 +12487,8 @@ var Numbering = class extends XmlComponent {
|
|
|
12036
12487
|
*/
|
|
12037
12488
|
constructor(options) {
|
|
12038
12489
|
super("w:numbering");
|
|
12490
|
+
this._numIdMacAtCleanup = options.numIdMacAtCleanup;
|
|
12491
|
+
this._numPicBullets = options.numPicBullets;
|
|
12039
12492
|
this.root.push(buildDocumentAttributes([
|
|
12040
12493
|
"wpc",
|
|
12041
12494
|
"mc",
|
|
@@ -12164,8 +12617,10 @@ var Numbering = class extends XmlComponent {
|
|
|
12164
12617
|
}
|
|
12165
12618
|
toXml(context) {
|
|
12166
12619
|
const start = this.root.length;
|
|
12620
|
+
if (this._numPicBullets) for (const bullet of this._numPicBullets) this.root.push(new NumPicBullet(bullet.numPicBulletId, bullet.pict));
|
|
12167
12621
|
for (const numbering of this.abstractNumberingMap.values()) this.root.push(numbering);
|
|
12168
12622
|
for (const numbering of this.concreteNumberingMap.values()) this.root.push(numbering);
|
|
12623
|
+
if (this._numIdMacAtCleanup !== void 0) this.root.push(numberValObj("w:numIdMacAtCleanup", (0, values_exports.decimalNumber)(this._numIdMacAtCleanup)));
|
|
12169
12624
|
const result = super.toXml(context);
|
|
12170
12625
|
this.root.length = start;
|
|
12171
12626
|
return result;
|
|
@@ -12219,6 +12674,20 @@ var Numbering = class extends XmlComponent {
|
|
|
12219
12674
|
return [...this.referenceConfigMap.values()];
|
|
12220
12675
|
}
|
|
12221
12676
|
};
|
|
12677
|
+
/**
|
|
12678
|
+
* Picture bullet definition (CT_NumPicBullet).
|
|
12679
|
+
*
|
|
12680
|
+
* Defines a picture to be used as a bullet in a numbering definition.
|
|
12681
|
+
*
|
|
12682
|
+
* Reference: ISO/IEC 29500-4, wml.xsd, CT_NumPicBullet
|
|
12683
|
+
*/
|
|
12684
|
+
var NumPicBullet = class extends XmlComponent {
|
|
12685
|
+
constructor(id, pict) {
|
|
12686
|
+
super("w:numPicBullet");
|
|
12687
|
+
this.root.push(numberValObj("w:numPicBulletId", id));
|
|
12688
|
+
if (pict) this.root.push({ _raw: pict });
|
|
12689
|
+
}
|
|
12690
|
+
};
|
|
12222
12691
|
//#endregion
|
|
12223
12692
|
//#region src/file/settings/compatibility-setting/compatibility-setting.ts
|
|
12224
12693
|
init_xml_components();
|
|
@@ -12389,6 +12858,16 @@ var Compatibility = class extends XmlComponent {
|
|
|
12389
12858
|
};
|
|
12390
12859
|
//#endregion
|
|
12391
12860
|
//#region src/file/settings/settings.ts
|
|
12861
|
+
/**
|
|
12862
|
+
* Settings module for WordprocessingML documents.
|
|
12863
|
+
*
|
|
12864
|
+
* This module provides document-level settings including compatibility,
|
|
12865
|
+
* track changes, headers/footers, and hyphenation options.
|
|
12866
|
+
*
|
|
12867
|
+
* Reference: http://officeopenxml.com/WPsettings.php
|
|
12868
|
+
*
|
|
12869
|
+
* @module
|
|
12870
|
+
*/
|
|
12392
12871
|
init_xml_components();
|
|
12393
12872
|
/**
|
|
12394
12873
|
* Represents document settings in a WordprocessingML document.
|
|
@@ -12464,20 +12943,251 @@ var Settings = class extends XmlComponent {
|
|
|
12464
12943
|
val: options.zoom.val,
|
|
12465
12944
|
percent: options.zoom.percent ?? 100
|
|
12466
12945
|
}));
|
|
12946
|
+
if (options.removePersonalInformation !== void 0) this.root.push(onOffObj("w:removePersonalInformation", options.removePersonalInformation));
|
|
12947
|
+
if (options.removeDateAndTime !== void 0) this.root.push(onOffObj("w:removeDateAndTime", options.removeDateAndTime));
|
|
12467
12948
|
if (options.displayBackgroundShape !== void 0) this.root.push(onOffObj("w:displayBackgroundShape", options.displayBackgroundShape));
|
|
12949
|
+
if (options.doNotDisplayPageBoundaries !== void 0) this.root.push(onOffObj("w:doNotDisplayPageBoundaries", options.doNotDisplayPageBoundaries));
|
|
12950
|
+
if (options.printPostScriptOverText !== void 0) this.root.push(onOffObj("w:printPostScriptOverText", options.printPostScriptOverText));
|
|
12951
|
+
if (options.printFractionalCharacterWidth !== void 0) this.root.push(onOffObj("w:printFractionalCharacterWidth", options.printFractionalCharacterWidth));
|
|
12952
|
+
if (options.printFormsData !== void 0) this.root.push(onOffObj("w:printFormsData", options.printFormsData));
|
|
12468
12953
|
if (options.embedTrueTypeFonts !== void 0) this.root.push(onOffObj("w:embedTrueTypeFonts", options.embedTrueTypeFonts));
|
|
12469
12954
|
if (options.embedSystemFonts !== void 0) this.root.push(onOffObj("w:embedSystemFonts", options.embedSystemFonts));
|
|
12470
12955
|
if (options.saveSubsetFonts !== void 0) this.root.push(onOffObj("w:saveSubsetFonts", options.saveSubsetFonts));
|
|
12956
|
+
if (options.saveFormsData !== void 0) this.root.push(onOffObj("w:saveFormsData", options.saveFormsData));
|
|
12957
|
+
if (options.mirrorMargins !== void 0) this.root.push(onOffObj("w:mirrorMargins", options.mirrorMargins));
|
|
12958
|
+
if (options.alignBordersAndEdges !== void 0) this.root.push(onOffObj("w:alignBordersAndEdges", options.alignBordersAndEdges));
|
|
12959
|
+
if (options.bordersDoNotSurroundHeader !== void 0) this.root.push(onOffObj("w:bordersDoNotSurroundHeader", options.bordersDoNotSurroundHeader));
|
|
12960
|
+
if (options.bordersDoNotSurroundFooter !== void 0) this.root.push(onOffObj("w:bordersDoNotSurroundFooter", options.bordersDoNotSurroundFooter));
|
|
12961
|
+
if (options.gutterAtTop !== void 0) this.root.push(onOffObj("w:gutterAtTop", options.gutterAtTop));
|
|
12962
|
+
if (options.hideSpellingErrors !== void 0) this.root.push(onOffObj("w:hideSpellingErrors", options.hideSpellingErrors));
|
|
12963
|
+
if (options.hideGrammaticalErrors !== void 0) this.root.push(onOffObj("w:hideGrammaticalErrors", options.hideGrammaticalErrors));
|
|
12964
|
+
if (options.activeWritingStyle !== void 0) for (const ws of options.activeWritingStyle) {
|
|
12965
|
+
const attrs = [];
|
|
12966
|
+
if (ws.lang !== void 0) attrs.push({
|
|
12967
|
+
key: "w:lang",
|
|
12968
|
+
value: ws.lang
|
|
12969
|
+
});
|
|
12970
|
+
if (ws.vendorID !== void 0) attrs.push({
|
|
12971
|
+
key: "w:vendorID",
|
|
12972
|
+
value: ws.vendorID
|
|
12973
|
+
});
|
|
12974
|
+
if (ws.dllVersion !== void 0) attrs.push({
|
|
12975
|
+
key: "w:dllVersion",
|
|
12976
|
+
value: ws.dllVersion
|
|
12977
|
+
});
|
|
12978
|
+
if (ws.nlCheck !== void 0) attrs.push({
|
|
12979
|
+
key: "w:nlCheck",
|
|
12980
|
+
value: ws.nlCheck
|
|
12981
|
+
});
|
|
12982
|
+
if (ws.checkStyle !== void 0) attrs.push({
|
|
12983
|
+
key: "w:checkStyle",
|
|
12984
|
+
value: ws.checkStyle
|
|
12985
|
+
});
|
|
12986
|
+
if (ws.appCheck !== void 0) attrs.push({
|
|
12987
|
+
key: "w:appCheck",
|
|
12988
|
+
value: ws.appCheck
|
|
12989
|
+
});
|
|
12990
|
+
if (ws.appName !== void 0) attrs.push({
|
|
12991
|
+
key: "w:appName",
|
|
12992
|
+
value: ws.appName
|
|
12993
|
+
});
|
|
12994
|
+
this.root.push(new BuilderElement({
|
|
12995
|
+
name: "w:activeWritingStyle",
|
|
12996
|
+
attributes: attrs
|
|
12997
|
+
}));
|
|
12998
|
+
}
|
|
12999
|
+
if (options.proofState !== void 0) {
|
|
13000
|
+
const attrs = [];
|
|
13001
|
+
if (options.proofState.spelling !== void 0) attrs.push({
|
|
13002
|
+
key: "w:spelling",
|
|
13003
|
+
value: options.proofState.spelling
|
|
13004
|
+
});
|
|
13005
|
+
if (options.proofState.grammar !== void 0) attrs.push({
|
|
13006
|
+
key: "w:grammar",
|
|
13007
|
+
value: options.proofState.grammar
|
|
13008
|
+
});
|
|
13009
|
+
this.root.push(new BuilderElement({
|
|
13010
|
+
name: "w:proofState",
|
|
13011
|
+
attributes: attrs
|
|
13012
|
+
}));
|
|
13013
|
+
}
|
|
13014
|
+
if (options.formsDesign !== void 0) this.root.push(onOffObj("w:formsDesign", options.formsDesign));
|
|
13015
|
+
if (options.attachedTemplate !== void 0) this.root.push(new BuilderElement({
|
|
13016
|
+
name: "w:attachedTemplate",
|
|
13017
|
+
attributes: [{
|
|
13018
|
+
key: "r:id",
|
|
13019
|
+
value: options.attachedTemplate
|
|
13020
|
+
}]
|
|
13021
|
+
}));
|
|
13022
|
+
if (options.linkStyles !== void 0) this.root.push(onOffObj("w:linkStyles", options.linkStyles));
|
|
13023
|
+
if (options.stylePaneFormatFilter !== void 0) {
|
|
13024
|
+
const f = options.stylePaneFormatFilter;
|
|
13025
|
+
const attrs = [];
|
|
13026
|
+
for (const { prop, xmlKey } of [
|
|
13027
|
+
{
|
|
13028
|
+
prop: "allStyles",
|
|
13029
|
+
xmlKey: "w:allStyles"
|
|
13030
|
+
},
|
|
13031
|
+
{
|
|
13032
|
+
prop: "customStyles",
|
|
13033
|
+
xmlKey: "w:customStyles"
|
|
13034
|
+
},
|
|
13035
|
+
{
|
|
13036
|
+
prop: "stylesInUse",
|
|
13037
|
+
xmlKey: "w:stylesInUse"
|
|
13038
|
+
},
|
|
13039
|
+
{
|
|
13040
|
+
prop: "headingStyles",
|
|
13041
|
+
xmlKey: "w:headingStyles"
|
|
13042
|
+
},
|
|
13043
|
+
{
|
|
13044
|
+
prop: "numberingStyles",
|
|
13045
|
+
xmlKey: "w:numberingStyles"
|
|
13046
|
+
},
|
|
13047
|
+
{
|
|
13048
|
+
prop: "tableStyles",
|
|
13049
|
+
xmlKey: "w:tableStyles"
|
|
13050
|
+
},
|
|
13051
|
+
{
|
|
13052
|
+
prop: "directFormattingOnRuns",
|
|
13053
|
+
xmlKey: "w:directFormattingOnRuns"
|
|
13054
|
+
},
|
|
13055
|
+
{
|
|
13056
|
+
prop: "directFormattingOnParagraphs",
|
|
13057
|
+
xmlKey: "w:directFormattingOnParagraphs"
|
|
13058
|
+
},
|
|
13059
|
+
{
|
|
13060
|
+
prop: "directFormattingOnNumbering",
|
|
13061
|
+
xmlKey: "w:directFormattingOnNumbering"
|
|
13062
|
+
},
|
|
13063
|
+
{
|
|
13064
|
+
prop: "directFormattingOnTables",
|
|
13065
|
+
xmlKey: "w:directFormattingOnTables"
|
|
13066
|
+
},
|
|
13067
|
+
{
|
|
13068
|
+
prop: "clearFormatting",
|
|
13069
|
+
xmlKey: "w:clearFormatting"
|
|
13070
|
+
},
|
|
13071
|
+
{
|
|
13072
|
+
prop: "top3HeadingStyles",
|
|
13073
|
+
xmlKey: "w:top3HeadingStyles"
|
|
13074
|
+
},
|
|
13075
|
+
{
|
|
13076
|
+
prop: "visibleStyles",
|
|
13077
|
+
xmlKey: "w:visibleStyles"
|
|
13078
|
+
},
|
|
13079
|
+
{
|
|
13080
|
+
prop: "alternateStyleNames",
|
|
13081
|
+
xmlKey: "w:alternateStyleNames"
|
|
13082
|
+
}
|
|
13083
|
+
]) if (f[prop] !== void 0) attrs.push({
|
|
13084
|
+
key: xmlKey,
|
|
13085
|
+
value: f[prop] ? "1" : "0"
|
|
13086
|
+
});
|
|
13087
|
+
this.root.push(new BuilderElement({
|
|
13088
|
+
name: "w:stylePaneFormatFilter",
|
|
13089
|
+
attributes: attrs
|
|
13090
|
+
}));
|
|
13091
|
+
}
|
|
13092
|
+
if (options.stylePaneSortMethod !== void 0) this.root.push(stringValObj("w:stylePaneSortMethod", options.stylePaneSortMethod));
|
|
13093
|
+
if (options.documentType !== void 0) this.root.push(stringValObj("w:documentType", options.documentType));
|
|
13094
|
+
if (options.revisionView !== void 0) this.root.push(new RevisionView(options.revisionView));
|
|
12471
13095
|
if (options.trackRevisions !== void 0) this.root.push(onOffObj("w:trackRevisions", options.trackRevisions));
|
|
13096
|
+
if (options.doNotTrackMoves !== void 0) this.root.push(onOffObj("w:doNotTrackMoves", options.doNotTrackMoves));
|
|
13097
|
+
if (options.doNotTrackFormatting !== void 0) this.root.push(onOffObj("w:doNotTrackFormatting", options.doNotTrackFormatting));
|
|
13098
|
+
if (options.mailMerge !== void 0) this.root.push(new MailMerge(options.mailMerge));
|
|
12472
13099
|
if (options.documentProtection !== void 0) this.root.push(new DocumentProtection(options.documentProtection));
|
|
13100
|
+
if (options.autoFormatOverride !== void 0) this.root.push(onOffObj("w:autoFormatOverride", options.autoFormatOverride));
|
|
13101
|
+
if (options.styleLockTheme !== void 0) this.root.push(onOffObj("w:styleLockTheme", options.styleLockTheme));
|
|
13102
|
+
if (options.styleLockQFSet !== void 0) this.root.push(onOffObj("w:styleLockQFSet", options.styleLockQFSet));
|
|
12473
13103
|
this.root.push(numberValObj("w:defaultTabStop", options.defaultTabStop ?? 420));
|
|
12474
13104
|
if (options.hyphenation?.autoHyphenation !== void 0) this.root.push(onOffObj("w:autoHyphenation", options.hyphenation.autoHyphenation));
|
|
12475
13105
|
if (options.hyphenation?.consecutiveHyphenLimit !== void 0) this.root.push(numberValObj("w:consecutiveHyphenLimit", options.hyphenation.consecutiveHyphenLimit));
|
|
12476
13106
|
if (options.hyphenation?.hyphenationZone !== void 0) this.root.push(numberValObj("w:hyphenationZone", options.hyphenation.hyphenationZone));
|
|
12477
13107
|
if (options.hyphenation?.doNotHyphenateCaps !== void 0) this.root.push(onOffObj("w:doNotHyphenateCaps", options.hyphenation.doNotHyphenateCaps));
|
|
13108
|
+
if (options.showEnvelope !== void 0) this.root.push(onOffObj("w:showEnvelope", options.showEnvelope));
|
|
13109
|
+
if (options.summaryLength !== void 0) this.root.push(numberValObj("w:summaryLength", options.summaryLength));
|
|
13110
|
+
if (options.clickAndTypeStyle !== void 0) this.root.push(stringValObj("w:clickAndTypeStyle", options.clickAndTypeStyle));
|
|
13111
|
+
if (options.defaultTableStyle !== void 0) this.root.push(stringValObj("w:defaultTableStyle", options.defaultTableStyle));
|
|
12478
13112
|
if (options.evenAndOddHeaders !== void 0) this.root.push(onOffObj("w:evenAndOddHeaders", options.evenAndOddHeaders));
|
|
13113
|
+
if (options.bookFoldRevPrinting !== void 0) this.root.push(onOffObj("w:bookFoldRevPrinting", options.bookFoldRevPrinting));
|
|
13114
|
+
if (options.bookFoldPrinting !== void 0) this.root.push(onOffObj("w:bookFoldPrinting", options.bookFoldPrinting));
|
|
13115
|
+
if (options.bookFoldPrintingSheets !== void 0) this.root.push(numberValObj("w:bookFoldPrintingSheets", options.bookFoldPrintingSheets));
|
|
13116
|
+
if (options.drawingGridHorizontalSpacing !== void 0) this.root.push(numberValObj("w:drawingGridHorizontalSpacing", options.drawingGridHorizontalSpacing));
|
|
13117
|
+
if (options.drawingGridVerticalSpacing !== void 0) this.root.push(numberValObj("w:drawingGridVerticalSpacing", options.drawingGridVerticalSpacing));
|
|
13118
|
+
if (options.displayHorizontalDrawingGridEvery !== void 0) this.root.push(numberValObj("w:displayHorizontalDrawingGridEvery", options.displayHorizontalDrawingGridEvery));
|
|
13119
|
+
if (options.displayVerticalDrawingGridEvery !== void 0) this.root.push(numberValObj("w:displayVerticalDrawingGridEvery", options.displayVerticalDrawingGridEvery));
|
|
13120
|
+
if (options.drawingGridHorizontalOrigin !== void 0) this.root.push(numberValObj("w:drawingGridHorizontalOrigin", options.drawingGridHorizontalOrigin));
|
|
13121
|
+
if (options.drawingGridVerticalOrigin !== void 0) this.root.push(numberValObj("w:drawingGridVerticalOrigin", options.drawingGridVerticalOrigin));
|
|
13122
|
+
if (options.doNotUseMarginsForDrawingGridOrigin !== void 0) this.root.push(onOffObj("w:doNotUseMarginsForDrawingGridOrigin", options.doNotUseMarginsForDrawingGridOrigin));
|
|
13123
|
+
if (options.doNotShadeFormData !== void 0) this.root.push(onOffObj("w:doNotShadeFormData", options.doNotShadeFormData));
|
|
12479
13124
|
this.root.push(stringValObj("w:characterSpacingControl", options.characterSpacingControl ?? "compressPunctuation"));
|
|
13125
|
+
if (options.noPunctuationKerning !== void 0) this.root.push(onOffObj("w:noPunctuationKerning", options.noPunctuationKerning));
|
|
13126
|
+
if (options.printTwoOnOne !== void 0) this.root.push(onOffObj("w:printTwoOnOne", options.printTwoOnOne));
|
|
13127
|
+
if (options.strictFirstAndLastChars !== void 0) this.root.push(onOffObj("w:strictFirstAndLastChars", options.strictFirstAndLastChars));
|
|
13128
|
+
if (options.noLineBreaksAfter !== void 0) {
|
|
13129
|
+
const attrs = [];
|
|
13130
|
+
if (options.noLineBreaksAfter.lang !== void 0) attrs.push({
|
|
13131
|
+
key: "w:lang",
|
|
13132
|
+
value: options.noLineBreaksAfter.lang
|
|
13133
|
+
});
|
|
13134
|
+
if (options.noLineBreaksAfter.val !== void 0) attrs.push({
|
|
13135
|
+
key: "w:val",
|
|
13136
|
+
value: options.noLineBreaksAfter.val
|
|
13137
|
+
});
|
|
13138
|
+
this.root.push(new BuilderElement({
|
|
13139
|
+
name: "w:noLineBreaksAfter",
|
|
13140
|
+
attributes: attrs
|
|
13141
|
+
}));
|
|
13142
|
+
}
|
|
13143
|
+
if (options.noLineBreaksBefore !== void 0) {
|
|
13144
|
+
const attrs = [];
|
|
13145
|
+
if (options.noLineBreaksBefore.lang !== void 0) attrs.push({
|
|
13146
|
+
key: "w:lang",
|
|
13147
|
+
value: options.noLineBreaksBefore.lang
|
|
13148
|
+
});
|
|
13149
|
+
if (options.noLineBreaksBefore.val !== void 0) attrs.push({
|
|
13150
|
+
key: "w:val",
|
|
13151
|
+
value: options.noLineBreaksBefore.val
|
|
13152
|
+
});
|
|
13153
|
+
this.root.push(new BuilderElement({
|
|
13154
|
+
name: "w:noLineBreaksBefore",
|
|
13155
|
+
attributes: attrs
|
|
13156
|
+
}));
|
|
13157
|
+
}
|
|
13158
|
+
if (options.savePreviewPicture !== void 0) this.root.push(onOffObj("w:savePreviewPicture", options.savePreviewPicture));
|
|
13159
|
+
if (options.doNotValidateAgainstSchema !== void 0) this.root.push(onOffObj("w:doNotValidateAgainstSchema", options.doNotValidateAgainstSchema));
|
|
13160
|
+
if (options.saveInvalidXml !== void 0) this.root.push(onOffObj("w:saveInvalidXml", options.saveInvalidXml));
|
|
13161
|
+
if (options.ignoreMixedContent !== void 0) this.root.push(onOffObj("w:ignoreMixedContent", options.ignoreMixedContent));
|
|
13162
|
+
if (options.alwaysShowPlaceholderText !== void 0) this.root.push(onOffObj("w:alwaysShowPlaceholderText", options.alwaysShowPlaceholderText));
|
|
13163
|
+
if (options.doNotDemarcateInvalidXml !== void 0) this.root.push(onOffObj("w:doNotDemarcateInvalidXml", options.doNotDemarcateInvalidXml));
|
|
13164
|
+
if (options.saveXmlDataOnly !== void 0) this.root.push(onOffObj("w:saveXmlDataOnly", options.saveXmlDataOnly));
|
|
13165
|
+
if (options.useXSLTWhenSaving !== void 0) this.root.push(onOffObj("w:useXSLTWhenSaving", options.useXSLTWhenSaving));
|
|
13166
|
+
if (options.saveThroughXslt !== void 0) {
|
|
13167
|
+
const attrs = [];
|
|
13168
|
+
if (options.saveThroughXslt.id !== void 0) attrs.push({
|
|
13169
|
+
key: "r:id",
|
|
13170
|
+
value: options.saveThroughXslt.id
|
|
13171
|
+
});
|
|
13172
|
+
if (options.saveThroughXslt.val !== void 0) attrs.push({
|
|
13173
|
+
key: "w:val",
|
|
13174
|
+
value: options.saveThroughXslt.val
|
|
13175
|
+
});
|
|
13176
|
+
if (options.saveThroughXslt.solutionID !== void 0) attrs.push({
|
|
13177
|
+
key: "w:solutionID",
|
|
13178
|
+
value: options.saveThroughXslt.solutionID
|
|
13179
|
+
});
|
|
13180
|
+
this.root.push(new BuilderElement({
|
|
13181
|
+
name: "w:saveThroughXslt",
|
|
13182
|
+
attributes: attrs
|
|
13183
|
+
}));
|
|
13184
|
+
}
|
|
13185
|
+
if (options.showXMLTags !== void 0) this.root.push(onOffObj("w:showXMLTags", options.showXMLTags));
|
|
13186
|
+
if (options.alwaysMergeEmptyNamespace !== void 0) this.root.push(onOffObj("w:alwaysMergeEmptyNamespace", options.alwaysMergeEmptyNamespace));
|
|
12480
13187
|
if (options.updateFields !== void 0) this.root.push(onOffObj("w:updateFields", options.updateFields));
|
|
13188
|
+
if (options.hdrShapeDefaults !== void 0) this.root.push(new BuilderElement({ name: "w:hdrShapeDefaults" }));
|
|
13189
|
+
if (options.footnotePr !== void 0) this.root.push(new FootnotePrElement(options.footnotePr));
|
|
13190
|
+
if (options.endnotePr !== void 0) this.root.push(new EndnotePrElement(options.endnotePr));
|
|
12481
13191
|
this.root.push(new Compatibility({
|
|
12482
13192
|
...options.compatibility,
|
|
12483
13193
|
version: options.compatibility?.version ?? options.compatibilityModeVersion ?? 15,
|
|
@@ -12505,73 +13215,461 @@ var Settings = class extends XmlComponent {
|
|
|
12505
13215
|
}]
|
|
12506
13216
|
}))
|
|
12507
13217
|
}));
|
|
13218
|
+
if (options.rsids !== void 0) this.root.push(new RsidsElement(options.rsids));
|
|
13219
|
+
if (options.mathPr !== void 0) this.root.push(new MathPrElement(options.mathPr));
|
|
13220
|
+
if (options.attachedSchema !== void 0) for (const schema of options.attachedSchema) this.root.push(stringValObj("w:attachedSchema", schema));
|
|
12508
13221
|
if (options.colorSchemeMapping !== void 0) this.root.push(new ColorSchemeMapping(options.colorSchemeMapping));
|
|
13222
|
+
if (options.themeFontLang !== void 0) this.root.push(new BuilderElement({
|
|
13223
|
+
name: "w:themeFontLang",
|
|
13224
|
+
attributes: [{
|
|
13225
|
+
key: "w:val",
|
|
13226
|
+
value: options.themeFontLang
|
|
13227
|
+
}]
|
|
13228
|
+
}));
|
|
13229
|
+
if (options.doNotIncludeSubdocsInStats !== void 0) this.root.push(onOffObj("w:doNotIncludeSubdocsInStats", options.doNotIncludeSubdocsInStats));
|
|
13230
|
+
if (options.doNotAutoCompressPictures !== void 0) this.root.push(onOffObj("w:doNotAutoCompressPictures", options.doNotAutoCompressPictures));
|
|
13231
|
+
if (options.forceUpgrade !== void 0) this.root.push(new BuilderElement({ name: "w:forceUpgrade" }));
|
|
13232
|
+
if (options.captions !== void 0) this.root.push(new CaptionsElement(options.captions));
|
|
13233
|
+
if (options.readModeInkLockDown !== void 0) this.root.push(new ReadModeInkLockDownElement(options.readModeInkLockDown));
|
|
13234
|
+
if (options.smartTagType !== void 0) for (const st of options.smartTagType) {
|
|
13235
|
+
const attrs = [];
|
|
13236
|
+
if (st.namespace !== void 0) attrs.push({
|
|
13237
|
+
key: "w:namespace",
|
|
13238
|
+
value: st.namespace
|
|
13239
|
+
});
|
|
13240
|
+
if (st.namespaceuri !== void 0) attrs.push({
|
|
13241
|
+
key: "w:namespaceuri",
|
|
13242
|
+
value: st.namespaceuri
|
|
13243
|
+
});
|
|
13244
|
+
if (st.name !== void 0) attrs.push({
|
|
13245
|
+
key: "w:name",
|
|
13246
|
+
value: st.name
|
|
13247
|
+
});
|
|
13248
|
+
if (st.url !== void 0) attrs.push({
|
|
13249
|
+
key: "w:url",
|
|
13250
|
+
value: st.url
|
|
13251
|
+
});
|
|
13252
|
+
this.root.push(new BuilderElement({
|
|
13253
|
+
name: "w:smartTagType",
|
|
13254
|
+
attributes: attrs
|
|
13255
|
+
}));
|
|
13256
|
+
}
|
|
13257
|
+
if (options.doNotEmbedSmartTags !== void 0) this.root.push(onOffObj("w:doNotEmbedSmartTags", options.doNotEmbedSmartTags));
|
|
13258
|
+
if (options.shapeDefaults !== void 0) this.root.push(new BuilderElement({ name: "w:shapeDefaults" }));
|
|
13259
|
+
if (options.decimalSymbol !== void 0) this.root.push(stringValObj("w:decimalSymbol", options.decimalSymbol));
|
|
13260
|
+
if (options.listSeparator !== void 0) this.root.push(stringValObj("w:listSeparator", options.listSeparator));
|
|
13261
|
+
}
|
|
13262
|
+
};
|
|
13263
|
+
/**
|
|
13264
|
+
* Represents document protection settings (CT_DocProtect).
|
|
13265
|
+
*
|
|
13266
|
+
* Restricts the types of editing allowed in the document.
|
|
13267
|
+
* Requires `enforcement: true` to take effect.
|
|
13268
|
+
*
|
|
13269
|
+
* Reference: ISO/IEC 29500-4, wml.xsd, CT_DocProtect
|
|
13270
|
+
*/
|
|
13271
|
+
var DocumentProtection = class extends XmlComponent {
|
|
13272
|
+
constructor(options) {
|
|
13273
|
+
super("w:documentProtection");
|
|
13274
|
+
const attr = { "w:enforcement": "1" };
|
|
13275
|
+
if (options.edit !== void 0) attr["w:edit"] = options.edit;
|
|
13276
|
+
if (options.formatting !== void 0) attr["w:formatting"] = options.formatting ? "1" : "0";
|
|
13277
|
+
let derived;
|
|
13278
|
+
if (options.password !== void 0 && options.hashValue === void 0) derived = derivePasswordHash(options.password);
|
|
13279
|
+
const hashValue = options.hashValue ?? derived?.hashValue;
|
|
13280
|
+
const saltValue = options.saltValue ?? derived?.saltValue;
|
|
13281
|
+
const spinCount = options.spinCount ?? derived?.spinCount;
|
|
13282
|
+
const algorithmName = options.algorithmName ?? derived?.algorithmName;
|
|
13283
|
+
if (algorithmName !== void 0) attr["w:algorithmName"] = algorithmName;
|
|
13284
|
+
if (hashValue !== void 0) attr["w:hashValue"] = hashValue;
|
|
13285
|
+
if (saltValue !== void 0) attr["w:saltValue"] = saltValue;
|
|
13286
|
+
if (options.hash !== void 0) attr["w:hash"] = options.hash;
|
|
13287
|
+
if (options.salt !== void 0) attr["w:salt"] = options.salt;
|
|
13288
|
+
if (spinCount !== void 0) attr["w:spinCount"] = spinCount;
|
|
13289
|
+
if (options.cryptoAlgorithmClass !== void 0) attr["w:cryptAlgorithmClass"] = options.cryptoAlgorithmClass;
|
|
13290
|
+
if (options.cryptoAlgorithmSid !== void 0) attr["w:cryptAlgorithmSid"] = options.cryptoAlgorithmSid;
|
|
13291
|
+
if (options.cryptoAlgorithmType !== void 0) attr["w:cryptAlgorithmType"] = options.cryptoAlgorithmType;
|
|
13292
|
+
if (options.cryptoProvider !== void 0) attr["w:cryptProvider"] = options.cryptoProvider;
|
|
13293
|
+
if (options.cryptoProviderType !== void 0) attr["w:cryptProviderType"] = options.cryptoProviderType;
|
|
13294
|
+
if (options.cryptoProviderTypeExtension !== void 0) attr["w:cryptProviderTypeExt"] = options.cryptoProviderTypeExtension;
|
|
13295
|
+
if (options.cryptoProviderTypeExtensionSource !== void 0) attr["w:cryptProviderTypeExtSource"] = options.cryptoProviderTypeExtensionSource;
|
|
13296
|
+
if (options.algorithmExtensionId !== void 0) attr["w:algIdExt"] = options.algorithmExtensionId;
|
|
13297
|
+
if (options.algorithmExtensionSource !== void 0) attr["w:algIdExtSource"] = options.algorithmExtensionSource;
|
|
13298
|
+
if (options.cryptoSpinCount !== void 0) attr["w:cryptSpinCount"] = options.cryptoSpinCount;
|
|
13299
|
+
this.root.push({ _attr: attr });
|
|
13300
|
+
}
|
|
13301
|
+
};
|
|
13302
|
+
var View = class extends XmlComponent {
|
|
13303
|
+
constructor(val) {
|
|
13304
|
+
super("w:view");
|
|
13305
|
+
this.root.push({ _attr: { "w:val": val } });
|
|
13306
|
+
}
|
|
13307
|
+
};
|
|
13308
|
+
var Zoom = class extends XmlComponent {
|
|
13309
|
+
constructor(options) {
|
|
13310
|
+
super("w:zoom");
|
|
13311
|
+
const attr = { "w:percent": options.percent };
|
|
13312
|
+
if (options.val !== void 0) attr["w:val"] = options.val;
|
|
13313
|
+
this.root.push({ _attr: attr });
|
|
13314
|
+
}
|
|
13315
|
+
};
|
|
13316
|
+
var WriteProtection = class extends XmlComponent {
|
|
13317
|
+
constructor(options) {
|
|
13318
|
+
super("w:writeProtection");
|
|
13319
|
+
const attr = {};
|
|
13320
|
+
if (options.recommended !== void 0) attr["w:recommended"] = options.recommended ? "1" : "0";
|
|
13321
|
+
let derived;
|
|
13322
|
+
if (options.password !== void 0 && options.hashValue === void 0) derived = derivePasswordHash(options.password);
|
|
13323
|
+
const hashValue = options.hashValue ?? derived?.hashValue;
|
|
13324
|
+
const saltValue = options.saltValue ?? derived?.saltValue;
|
|
13325
|
+
const spinCount = options.spinCount ?? derived?.spinCount;
|
|
13326
|
+
const algorithmName = options.algorithmName ?? derived?.algorithmName;
|
|
13327
|
+
if (hashValue !== void 0) attr["w:hashValue"] = hashValue;
|
|
13328
|
+
if (saltValue !== void 0) attr["w:saltValue"] = saltValue;
|
|
13329
|
+
if (options.hash !== void 0) attr["w:hash"] = options.hash;
|
|
13330
|
+
if (options.salt !== void 0) attr["w:salt"] = options.salt;
|
|
13331
|
+
if (spinCount !== void 0) attr["w:spinCount"] = spinCount;
|
|
13332
|
+
if (algorithmName !== void 0) attr["w:algorithmName"] = algorithmName;
|
|
13333
|
+
if (options.cryptoAlgorithmClass !== void 0) attr["w:cryptAlgorithmClass"] = options.cryptoAlgorithmClass;
|
|
13334
|
+
if (options.cryptoAlgorithmSid !== void 0) attr["w:cryptAlgorithmSid"] = options.cryptoAlgorithmSid;
|
|
13335
|
+
if (options.cryptoAlgorithmType !== void 0) attr["w:cryptAlgorithmType"] = options.cryptoAlgorithmType;
|
|
13336
|
+
if (options.cryptoProvider !== void 0) attr["w:cryptProvider"] = options.cryptoProvider;
|
|
13337
|
+
if (options.cryptoProviderType !== void 0) attr["w:cryptProviderType"] = options.cryptoProviderType;
|
|
13338
|
+
if (options.algorithmExtensionId !== void 0) attr["w:algIdExt"] = options.algorithmExtensionId;
|
|
13339
|
+
if (options.algorithmExtensionSource !== void 0) attr["w:algIdExtSource"] = options.algorithmExtensionSource;
|
|
13340
|
+
if (options.cryptoProviderTypeExtension !== void 0) attr["w:cryptProviderTypeExt"] = options.cryptoProviderTypeExtension;
|
|
13341
|
+
if (options.cryptoProviderTypeExtensionSource !== void 0) attr["w:cryptProviderTypeExtSource"] = options.cryptoProviderTypeExtensionSource;
|
|
13342
|
+
if (options.cryptoSpinCount !== void 0) attr["w:cryptSpinCount"] = options.cryptoSpinCount;
|
|
13343
|
+
this.root.push({ _attr: attr });
|
|
13344
|
+
}
|
|
13345
|
+
};
|
|
13346
|
+
var ColorSchemeMapping = class extends XmlComponent {
|
|
13347
|
+
constructor(options) {
|
|
13348
|
+
super("w:clrSchemeMapping");
|
|
13349
|
+
const attr = {};
|
|
13350
|
+
if (options.bg1 !== void 0) attr["w:bg1"] = options.bg1;
|
|
13351
|
+
if (options.t1 !== void 0) attr["w:t1"] = options.t1;
|
|
13352
|
+
if (options.bg2 !== void 0) attr["w:bg2"] = options.bg2;
|
|
13353
|
+
if (options.t2 !== void 0) attr["w:t2"] = options.t2;
|
|
13354
|
+
if (options.accent1 !== void 0) attr["w:accent1"] = options.accent1;
|
|
13355
|
+
if (options.accent2 !== void 0) attr["w:accent2"] = options.accent2;
|
|
13356
|
+
if (options.accent3 !== void 0) attr["w:accent3"] = options.accent3;
|
|
13357
|
+
if (options.accent4 !== void 0) attr["w:accent4"] = options.accent4;
|
|
13358
|
+
if (options.accent5 !== void 0) attr["w:accent5"] = options.accent5;
|
|
13359
|
+
if (options.accent6 !== void 0) attr["w:accent6"] = options.accent6;
|
|
13360
|
+
if (options.hyperlink !== void 0) attr["w:hyperlink"] = options.hyperlink;
|
|
13361
|
+
if (options.followedHyperlink !== void 0) attr["w:followedHyperlink"] = options.followedHyperlink;
|
|
13362
|
+
this.root.push({ _attr: attr });
|
|
13363
|
+
}
|
|
13364
|
+
};
|
|
13365
|
+
/**
|
|
13366
|
+
* Revision view settings (CT_TrackChangesView).
|
|
13367
|
+
* Controls which types of revisions are visible in the document.
|
|
13368
|
+
*/
|
|
13369
|
+
var RevisionView = class extends XmlComponent {
|
|
13370
|
+
constructor(options) {
|
|
13371
|
+
super("w:revisionView");
|
|
13372
|
+
const attr = {};
|
|
13373
|
+
if (options.markup !== void 0) attr["w:markup"] = options.markup ? "true" : "false";
|
|
13374
|
+
if (options.comments !== void 0) attr["w:comments"] = options.comments ? "true" : "false";
|
|
13375
|
+
if (options.insDel !== void 0) attr["w:insDel"] = options.insDel ? "true" : "false";
|
|
13376
|
+
if (options.formatting !== void 0) attr["w:formatting"] = options.formatting ? "true" : "false";
|
|
13377
|
+
if (options.inkAnnotations !== void 0) attr["w:inkAnnotations"] = options.inkAnnotations ? "true" : "false";
|
|
13378
|
+
this.root.push({ _attr: attr });
|
|
13379
|
+
}
|
|
13380
|
+
};
|
|
13381
|
+
/**
|
|
13382
|
+
* Mail merge configuration (CT_MailMerge).
|
|
13383
|
+
*
|
|
13384
|
+
* Generates the w:mailMerge element in document settings with
|
|
13385
|
+
* mainDocumentType, dataType, connectString, query, ODSO, etc.
|
|
13386
|
+
*
|
|
13387
|
+
* Reference: ISO/IEC 29500-4, wml.xsd, CT_MailMerge
|
|
13388
|
+
*/
|
|
13389
|
+
var MailMerge = class extends XmlComponent {
|
|
13390
|
+
constructor(options) {
|
|
13391
|
+
super("w:mailMerge");
|
|
13392
|
+
this.root.push(stringValObj("w:mainDocumentType", options.mainDocumentType));
|
|
13393
|
+
if (options.linkToQuery !== void 0) this.root.push(onOffObj("w:linkToQuery", options.linkToQuery));
|
|
13394
|
+
this.root.push(stringValObj("w:dataType", options.dataType));
|
|
13395
|
+
if (options.connectString !== void 0) this.root.push(stringValObj("w:connectString", options.connectString));
|
|
13396
|
+
if (options.query !== void 0) this.root.push(stringValObj("w:query", options.query));
|
|
13397
|
+
if (options.dataSource !== void 0) this.root.push(new BuilderElement({
|
|
13398
|
+
name: "w:dataSource",
|
|
13399
|
+
attributes: [{
|
|
13400
|
+
key: "r:id",
|
|
13401
|
+
value: options.dataSource
|
|
13402
|
+
}]
|
|
13403
|
+
}));
|
|
13404
|
+
if (options.headerSource !== void 0) this.root.push(new BuilderElement({
|
|
13405
|
+
name: "w:headerSource",
|
|
13406
|
+
attributes: [{
|
|
13407
|
+
key: "r:id",
|
|
13408
|
+
value: options.headerSource
|
|
13409
|
+
}]
|
|
13410
|
+
}));
|
|
13411
|
+
if (options.doNotSuppressBlankLines !== void 0) this.root.push(onOffObj("w:doNotSuppressBlankLines", options.doNotSuppressBlankLines));
|
|
13412
|
+
if (options.destination !== void 0) this.root.push(stringValObj("w:destination", options.destination));
|
|
13413
|
+
if (options.addressFieldName !== void 0) this.root.push(stringValObj("w:addressFieldName", options.addressFieldName));
|
|
13414
|
+
if (options.mailSubject !== void 0) this.root.push(stringValObj("w:mailSubject", options.mailSubject));
|
|
13415
|
+
if (options.mailAsAttachment !== void 0) this.root.push(onOffObj("w:mailAsAttachment", options.mailAsAttachment));
|
|
13416
|
+
if (options.viewMergedData !== void 0) this.root.push(onOffObj("w:viewMergedData", options.viewMergedData));
|
|
13417
|
+
if (options.activeRecord !== void 0) this.root.push(numberValObj("w:activeRecord", options.activeRecord));
|
|
13418
|
+
if (options.checkErrors !== void 0) this.root.push(numberValObj("w:checkErrors", options.checkErrors));
|
|
13419
|
+
if (options.odso !== void 0) this.root.push(new Odso(options.odso));
|
|
13420
|
+
if (options.active !== void 0) this.root.push(onOffObj("w:active", options.active));
|
|
13421
|
+
if (options.recipients !== void 0) this.root.push(new BuilderElement({
|
|
13422
|
+
name: "w:recipients",
|
|
13423
|
+
attributes: [{
|
|
13424
|
+
key: "r:id",
|
|
13425
|
+
value: options.recipients
|
|
13426
|
+
}]
|
|
13427
|
+
}));
|
|
13428
|
+
}
|
|
13429
|
+
};
|
|
13430
|
+
/**
|
|
13431
|
+
* Office Data Source Object (CT_Odso).
|
|
13432
|
+
*/
|
|
13433
|
+
var Odso = class extends XmlComponent {
|
|
13434
|
+
constructor(options) {
|
|
13435
|
+
super("w:odso");
|
|
13436
|
+
if (options.udl !== void 0) this.root.push(stringValObj("w:udl", options.udl));
|
|
13437
|
+
if (options.table !== void 0) this.root.push(stringValObj("w:table", options.table));
|
|
13438
|
+
if (options.src !== void 0) this.root.push(new BuilderElement({
|
|
13439
|
+
name: "w:src",
|
|
13440
|
+
attributes: [{
|
|
13441
|
+
key: "r:id",
|
|
13442
|
+
value: options.src
|
|
13443
|
+
}]
|
|
13444
|
+
}));
|
|
13445
|
+
if (options.colDelim !== void 0) this.root.push(numberValObj("w:colDelim", options.colDelim));
|
|
13446
|
+
if (options.type !== void 0) this.root.push(stringValObj("w:type", options.type));
|
|
13447
|
+
if (options.fHdr !== void 0) this.root.push(onOffObj("w:fHdr", options.fHdr));
|
|
13448
|
+
if (options.fieldMapData !== void 0) for (const fm of options.fieldMapData) this.root.push(new OdsoFieldMapData(fm));
|
|
13449
|
+
if (options.recipientData !== void 0) for (const rd of options.recipientData) this.root.push(new BuilderElement({
|
|
13450
|
+
name: "w:recipientData",
|
|
13451
|
+
attributes: [{
|
|
13452
|
+
key: "r:id",
|
|
13453
|
+
value: rd
|
|
13454
|
+
}]
|
|
13455
|
+
}));
|
|
13456
|
+
if (options.uniqueTag !== void 0) this.root.push(stringValObj("w:uniqueTag", options.uniqueTag));
|
|
13457
|
+
}
|
|
13458
|
+
};
|
|
13459
|
+
/**
|
|
13460
|
+
* ODSO field map data (CT_OdsoFieldMapData).
|
|
13461
|
+
*/
|
|
13462
|
+
var OdsoFieldMapData = class extends XmlComponent {
|
|
13463
|
+
constructor(options) {
|
|
13464
|
+
super("w:fieldMapData");
|
|
13465
|
+
if (options.type !== void 0) this.root.push(stringValObj("w:type", options.type));
|
|
13466
|
+
if (options.name !== void 0) this.root.push(stringValObj("w:name", options.name));
|
|
13467
|
+
if (options.mappedName !== void 0) this.root.push(stringValObj("w:mappedName", options.mappedName));
|
|
13468
|
+
if (options.column !== void 0) this.root.push(numberValObj("w:column", options.column));
|
|
13469
|
+
if (options.lid !== void 0) this.root.push(stringValObj("w:lid", options.lid));
|
|
13470
|
+
if (options.dynamicAddress !== void 0) this.root.push(onOffObj("w:dynamicAddress", options.dynamicAddress));
|
|
13471
|
+
}
|
|
13472
|
+
};
|
|
13473
|
+
/** Document-level footnote properties (CT_FtnDocProps) */
|
|
13474
|
+
var FootnotePrElement = class extends XmlComponent {
|
|
13475
|
+
constructor(options) {
|
|
13476
|
+
super("w:footnotePr");
|
|
13477
|
+
if (options.pos !== void 0) this.root.push(new BuilderElement({
|
|
13478
|
+
name: "w:pos",
|
|
13479
|
+
attributes: [{
|
|
13480
|
+
key: "w:val",
|
|
13481
|
+
value: options.pos
|
|
13482
|
+
}]
|
|
13483
|
+
}));
|
|
13484
|
+
if (options.numFmt !== void 0 || options.format !== void 0) {
|
|
13485
|
+
const attrs = [];
|
|
13486
|
+
if (options.numFmt !== void 0) attrs.push({
|
|
13487
|
+
key: "w:val",
|
|
13488
|
+
value: options.numFmt
|
|
13489
|
+
});
|
|
13490
|
+
if (options.format !== void 0) attrs.push({
|
|
13491
|
+
key: "w:format",
|
|
13492
|
+
value: options.format
|
|
13493
|
+
});
|
|
13494
|
+
this.root.push(new BuilderElement({
|
|
13495
|
+
name: "w:numFmt",
|
|
13496
|
+
attributes: attrs
|
|
13497
|
+
}));
|
|
13498
|
+
}
|
|
13499
|
+
if (options.numStart !== void 0) this.root.push(numberValObj("w:numStart", options.numStart));
|
|
13500
|
+
if (options.numRestart !== void 0) this.root.push(stringValObj("w:numRestart", options.numRestart));
|
|
12509
13501
|
}
|
|
12510
13502
|
};
|
|
12511
|
-
/**
|
|
12512
|
-
|
|
12513
|
-
*
|
|
12514
|
-
* Restricts the types of editing allowed in the document.
|
|
12515
|
-
* Requires `enforcement: true` to take effect.
|
|
12516
|
-
*
|
|
12517
|
-
* Reference: ISO/IEC 29500-4, wml.xsd, CT_DocProtect
|
|
12518
|
-
*/
|
|
12519
|
-
var DocumentProtection = class extends XmlComponent {
|
|
13503
|
+
/** Document-level endnote properties (CT_EdnDocProps) */
|
|
13504
|
+
var EndnotePrElement = class extends XmlComponent {
|
|
12520
13505
|
constructor(options) {
|
|
12521
|
-
super("w:
|
|
12522
|
-
|
|
12523
|
-
|
|
12524
|
-
|
|
12525
|
-
|
|
12526
|
-
|
|
12527
|
-
|
|
12528
|
-
|
|
12529
|
-
|
|
13506
|
+
super("w:endnotePr");
|
|
13507
|
+
if (options.pos !== void 0) this.root.push(new BuilderElement({
|
|
13508
|
+
name: "w:pos",
|
|
13509
|
+
attributes: [{
|
|
13510
|
+
key: "w:val",
|
|
13511
|
+
value: options.pos
|
|
13512
|
+
}]
|
|
13513
|
+
}));
|
|
13514
|
+
if (options.numFmt !== void 0 || options.format !== void 0) {
|
|
13515
|
+
const attrs = [];
|
|
13516
|
+
if (options.numFmt !== void 0) attrs.push({
|
|
13517
|
+
key: "w:val",
|
|
13518
|
+
value: options.numFmt
|
|
13519
|
+
});
|
|
13520
|
+
if (options.format !== void 0) attrs.push({
|
|
13521
|
+
key: "w:format",
|
|
13522
|
+
value: options.format
|
|
13523
|
+
});
|
|
13524
|
+
this.root.push(new BuilderElement({
|
|
13525
|
+
name: "w:numFmt",
|
|
13526
|
+
attributes: attrs
|
|
13527
|
+
}));
|
|
13528
|
+
}
|
|
13529
|
+
if (options.numStart !== void 0) this.root.push(numberValObj("w:numStart", options.numStart));
|
|
13530
|
+
if (options.numRestart !== void 0) this.root.push(stringValObj("w:numRestart", options.numRestart));
|
|
12530
13531
|
}
|
|
12531
13532
|
};
|
|
12532
|
-
|
|
12533
|
-
|
|
12534
|
-
|
|
12535
|
-
|
|
13533
|
+
/** Document revision save IDs (CT_DocRsids) */
|
|
13534
|
+
var RsidsElement = class extends XmlComponent {
|
|
13535
|
+
constructor(options) {
|
|
13536
|
+
super("w:rsids");
|
|
13537
|
+
if (options.rsidRoot !== void 0) this.root.push(new BuilderElement({
|
|
13538
|
+
name: "w:rsidRoot",
|
|
13539
|
+
attributes: [{
|
|
13540
|
+
key: "w:val",
|
|
13541
|
+
value: options.rsidRoot
|
|
13542
|
+
}]
|
|
13543
|
+
}));
|
|
13544
|
+
if (options.rsids !== void 0) for (const rsid of options.rsids) this.root.push(new BuilderElement({
|
|
13545
|
+
name: "w:rsid",
|
|
13546
|
+
attributes: [{
|
|
13547
|
+
key: "w:val",
|
|
13548
|
+
value: rsid
|
|
13549
|
+
}]
|
|
13550
|
+
}));
|
|
12536
13551
|
}
|
|
12537
13552
|
};
|
|
12538
|
-
|
|
13553
|
+
/** Reading mode ink lock-down (CT_ReadingModeInkLockDown) */
|
|
13554
|
+
var ReadModeInkLockDownElement = class extends XmlComponent {
|
|
12539
13555
|
constructor(options) {
|
|
12540
|
-
super("w:
|
|
12541
|
-
const
|
|
12542
|
-
|
|
12543
|
-
|
|
13556
|
+
super("w:readModeInkLockDown");
|
|
13557
|
+
const attrs = {
|
|
13558
|
+
"w:actualPg": options.actualPg === false ? "0" : "1",
|
|
13559
|
+
"w:w": options.w,
|
|
13560
|
+
"w:h": options.h,
|
|
13561
|
+
"w:fontSz": options.fontSz
|
|
13562
|
+
};
|
|
13563
|
+
this.root.push({ _attr: attrs });
|
|
12544
13564
|
}
|
|
12545
13565
|
};
|
|
12546
|
-
|
|
13566
|
+
/** Captions (CT_Captions) */
|
|
13567
|
+
var CaptionsElement = class extends XmlComponent {
|
|
12547
13568
|
constructor(options) {
|
|
12548
|
-
super("w:
|
|
12549
|
-
const
|
|
12550
|
-
|
|
12551
|
-
|
|
12552
|
-
|
|
12553
|
-
|
|
12554
|
-
|
|
12555
|
-
|
|
13569
|
+
super("w:captions");
|
|
13570
|
+
for (const cap of options.captions) {
|
|
13571
|
+
const attrs = [{
|
|
13572
|
+
key: "w:name",
|
|
13573
|
+
value: cap.name
|
|
13574
|
+
}];
|
|
13575
|
+
if (cap.pos !== void 0) attrs.push({
|
|
13576
|
+
key: "w:pos",
|
|
13577
|
+
value: cap.pos
|
|
13578
|
+
});
|
|
13579
|
+
if (cap.chapNum !== void 0) attrs.push({
|
|
13580
|
+
key: "w:chapNum",
|
|
13581
|
+
value: cap.chapNum ? "1" : "0"
|
|
13582
|
+
});
|
|
13583
|
+
if (cap.heading !== void 0) attrs.push({
|
|
13584
|
+
key: "w:heading",
|
|
13585
|
+
value: cap.heading
|
|
13586
|
+
});
|
|
13587
|
+
if (cap.noLabel !== void 0) attrs.push({
|
|
13588
|
+
key: "w:noLabel",
|
|
13589
|
+
value: cap.noLabel ? "1" : "0"
|
|
13590
|
+
});
|
|
13591
|
+
if (cap.numFmt !== void 0) attrs.push({
|
|
13592
|
+
key: "w:numFmt",
|
|
13593
|
+
value: cap.numFmt
|
|
13594
|
+
});
|
|
13595
|
+
if (cap.sep !== void 0) attrs.push({
|
|
13596
|
+
key: "w:sep",
|
|
13597
|
+
value: cap.sep
|
|
13598
|
+
});
|
|
13599
|
+
this.root.push(new BuilderElement({
|
|
13600
|
+
name: "w:caption",
|
|
13601
|
+
attributes: attrs
|
|
13602
|
+
}));
|
|
13603
|
+
}
|
|
13604
|
+
if (options.autoCaptions !== void 0 && options.autoCaptions.length > 0) {
|
|
13605
|
+
const autoCapChildren = options.autoCaptions.map((ac) => new BuilderElement({
|
|
13606
|
+
name: "w:autoCaption",
|
|
13607
|
+
attributes: [{
|
|
13608
|
+
key: "w:name",
|
|
13609
|
+
value: ac.name
|
|
13610
|
+
}, {
|
|
13611
|
+
key: "w:caption",
|
|
13612
|
+
value: ac.caption
|
|
13613
|
+
}]
|
|
13614
|
+
}));
|
|
13615
|
+
this.root.push(new BuilderElement({
|
|
13616
|
+
name: "w:autoCaptions",
|
|
13617
|
+
children: autoCapChildren
|
|
13618
|
+
}));
|
|
13619
|
+
}
|
|
12556
13620
|
}
|
|
12557
13621
|
};
|
|
12558
|
-
|
|
13622
|
+
/** Math properties (m:mathPr) — uses math namespace */
|
|
13623
|
+
var MathPrElement = class extends XmlComponent {
|
|
12559
13624
|
constructor(options) {
|
|
12560
|
-
super("
|
|
12561
|
-
|
|
12562
|
-
|
|
12563
|
-
|
|
12564
|
-
|
|
12565
|
-
|
|
12566
|
-
|
|
12567
|
-
|
|
12568
|
-
if (options.
|
|
12569
|
-
|
|
12570
|
-
|
|
12571
|
-
|
|
12572
|
-
|
|
12573
|
-
|
|
12574
|
-
|
|
13625
|
+
super("m:mathPr");
|
|
13626
|
+
if (options.mathFont !== void 0) this.root.push(new BuilderElement({
|
|
13627
|
+
name: "m:mathFont",
|
|
13628
|
+
attributes: [{
|
|
13629
|
+
key: "m:val",
|
|
13630
|
+
value: options.mathFont
|
|
13631
|
+
}]
|
|
13632
|
+
}));
|
|
13633
|
+
if (options.brkBin !== void 0) this.root.push(new BuilderElement({
|
|
13634
|
+
name: "m:brkBin",
|
|
13635
|
+
attributes: [{
|
|
13636
|
+
key: "m:val",
|
|
13637
|
+
value: options.brkBin
|
|
13638
|
+
}]
|
|
13639
|
+
}));
|
|
13640
|
+
if (options.brkBinSub !== void 0) this.root.push(new BuilderElement({
|
|
13641
|
+
name: "m:brkBinSub",
|
|
13642
|
+
attributes: [{
|
|
13643
|
+
key: "m:val",
|
|
13644
|
+
value: options.brkBinSub
|
|
13645
|
+
}]
|
|
13646
|
+
}));
|
|
13647
|
+
if (options.smallFrac !== void 0) this.root.push(onOffObj("m:smallFrac", options.smallFrac));
|
|
13648
|
+
if (options.dispDef !== void 0) this.root.push(onOffObj("m:dispDef", options.dispDef));
|
|
13649
|
+
if (options.lMargin !== void 0) this.root.push(numberValObj("m:lMargin", options.lMargin));
|
|
13650
|
+
if (options.rMargin !== void 0) this.root.push(numberValObj("m:rMargin", options.rMargin));
|
|
13651
|
+
if (options.defJc !== void 0) this.root.push(new BuilderElement({
|
|
13652
|
+
name: "m:defJc",
|
|
13653
|
+
attributes: [{
|
|
13654
|
+
key: "m:val",
|
|
13655
|
+
value: options.defJc
|
|
13656
|
+
}]
|
|
13657
|
+
}));
|
|
13658
|
+
if (options.wrapIndent !== void 0) this.root.push(numberValObj("m:wrapIndent", options.wrapIndent));
|
|
13659
|
+
if (options.intLim !== void 0) this.root.push(new BuilderElement({
|
|
13660
|
+
name: "m:intLim",
|
|
13661
|
+
attributes: [{
|
|
13662
|
+
key: "m:val",
|
|
13663
|
+
value: options.intLim
|
|
13664
|
+
}]
|
|
13665
|
+
}));
|
|
13666
|
+
if (options.naryLim !== void 0) this.root.push(new BuilderElement({
|
|
13667
|
+
name: "m:naryLim",
|
|
13668
|
+
attributes: [{
|
|
13669
|
+
key: "m:val",
|
|
13670
|
+
value: options.naryLim
|
|
13671
|
+
}]
|
|
13672
|
+
}));
|
|
12575
13673
|
}
|
|
12576
13674
|
};
|
|
12577
13675
|
//#endregion
|
|
@@ -12735,13 +13833,19 @@ var Style = class extends XmlComponent {
|
|
|
12735
13833
|
...attributes.customStyle !== void 0 ? { "w:customStyle": attributes.customStyle } : {}
|
|
12736
13834
|
} });
|
|
12737
13835
|
if (options.name) this.root.push(new Name(options.name));
|
|
13836
|
+
if (options.aliases) this.root.push(stringValObj("w:aliases", options.aliases));
|
|
12738
13837
|
if (options.basedOn) this.root.push(stringValObj("w:basedOn", options.basedOn));
|
|
12739
13838
|
if (options.next) this.root.push(stringValObj("w:next", options.next));
|
|
12740
13839
|
if (options.link) this.root.push(stringValObj("w:link", options.link));
|
|
13840
|
+
if (options.autoRedefine !== void 0) this.root.push(onOffObj("w:autoRedefine", options.autoRedefine));
|
|
12741
13841
|
if (options.uiPriority !== void 0) this.root.push(new UiPriority(options.uiPriority));
|
|
12742
13842
|
if (options.semiHidden !== void 0) this.root.push(onOffObj("w:semiHidden", options.semiHidden));
|
|
12743
13843
|
if (options.unhideWhenUsed !== void 0) this.root.push(onOffObj("w:unhideWhenUsed", options.unhideWhenUsed));
|
|
12744
13844
|
if (options.quickFormat !== void 0) this.root.push(onOffObj("w:qFormat", options.quickFormat));
|
|
13845
|
+
if (options.locked !== void 0) this.root.push(onOffObj("w:locked", options.locked));
|
|
13846
|
+
if (options.personal !== void 0) this.root.push(onOffObj("w:personal", options.personal));
|
|
13847
|
+
if (options.personalCompose !== void 0) this.root.push(onOffObj("w:personalCompose", options.personalCompose));
|
|
13848
|
+
if (options.personalReply !== void 0) this.root.push(onOffObj("w:personalReply", options.personalReply));
|
|
12745
13849
|
if (options.tableStyleOverrides) for (const override of options.tableStyleOverrides) this.root.push(createTableStyleOverride(override));
|
|
12746
13850
|
}
|
|
12747
13851
|
};
|
|
@@ -13496,6 +14600,270 @@ var SubDocCollection = class {
|
|
|
13496
14600
|
}
|
|
13497
14601
|
};
|
|
13498
14602
|
//#endregion
|
|
14603
|
+
//#region src/file/frameset/frameset.ts
|
|
14604
|
+
init_xml_components();
|
|
14605
|
+
var FrameScrollbar = class extends XmlComponent {
|
|
14606
|
+
constructor(val) {
|
|
14607
|
+
super("w:scrollbar");
|
|
14608
|
+
this.root.push({ _attr: { "w:val": val } });
|
|
14609
|
+
}
|
|
14610
|
+
};
|
|
14611
|
+
var FrameElement = class extends XmlComponent {
|
|
14612
|
+
constructor(options) {
|
|
14613
|
+
super("w:frame");
|
|
14614
|
+
if (options.size !== void 0) {
|
|
14615
|
+
this.root.push({ _attr: {} });
|
|
14616
|
+
this.root.push(new StringElement("w:sz", options.size));
|
|
14617
|
+
}
|
|
14618
|
+
if (options.name !== void 0) this.root.push(new StringElement("w:name", options.name));
|
|
14619
|
+
if (options.title !== void 0) this.root.push(new StringElement("w:title", options.title));
|
|
14620
|
+
if (options.sourceRId !== void 0) this.root.push(new RelElement("w:sourceFileName", options.sourceRId));
|
|
14621
|
+
if (options.marginWidth !== void 0) this.root.push(new PixelsElement("w:marW", options.marginWidth));
|
|
14622
|
+
if (options.marginHeight !== void 0) this.root.push(new PixelsElement("w:marH", options.marginHeight));
|
|
14623
|
+
if (options.scrollbar !== void 0) this.root.push(new FrameScrollbar(options.scrollbar));
|
|
14624
|
+
if (options.noResizeAllowed) this.root.push(new OnOffElement("w:noResizeAllowed"));
|
|
14625
|
+
if (options.linkedToFile) this.root.push(new OnOffElement("w:linkedToFile"));
|
|
14626
|
+
if (options.longDescRId !== void 0) this.root.push(new RelElement("w:longDesc", options.longDescRId));
|
|
14627
|
+
}
|
|
14628
|
+
};
|
|
14629
|
+
var FramesetSplitbar = class extends XmlComponent {
|
|
14630
|
+
constructor(options) {
|
|
14631
|
+
super("w:framesetSplitbar");
|
|
14632
|
+
if (options.width !== void 0) this.root.push(new TwipsElement("w:w", options.width));
|
|
14633
|
+
if (options.color !== void 0) this.root.push(new StringElement("w:color", options.color));
|
|
14634
|
+
if (options.noBorder) this.root.push(new OnOffElement("w:noBorder"));
|
|
14635
|
+
if (options.flatBorders) this.root.push(new OnOffElement("w:flatBorders"));
|
|
14636
|
+
}
|
|
14637
|
+
};
|
|
14638
|
+
var FrameLayout = class extends XmlComponent {
|
|
14639
|
+
constructor(val) {
|
|
14640
|
+
super("w:frameLayout");
|
|
14641
|
+
this.root.push({ _attr: { "w:val": val } });
|
|
14642
|
+
}
|
|
14643
|
+
};
|
|
14644
|
+
/** Helper to build a Frameset (can be nested) */
|
|
14645
|
+
var Frameset = class Frameset extends XmlComponent {
|
|
14646
|
+
constructor(options) {
|
|
14647
|
+
super("w:frameset");
|
|
14648
|
+
if (options.size !== void 0) this.root.push(new StringElement("w:sz", options.size));
|
|
14649
|
+
if (options.splitbar) this.root.push(new FramesetSplitbar(options.splitbar));
|
|
14650
|
+
if (options.layout !== void 0) this.root.push(new FrameLayout(options.layout));
|
|
14651
|
+
if (options.title !== void 0) this.root.push(new StringElement("w:title", options.title));
|
|
14652
|
+
if (options.children) for (const child of options.children) if ("children" in child || "layout" in child || "splitbar" in child) this.root.push(new Frameset(child));
|
|
14653
|
+
else this.root.push(new FrameElement(child));
|
|
14654
|
+
}
|
|
14655
|
+
};
|
|
14656
|
+
var StringElement = class extends XmlComponent {
|
|
14657
|
+
constructor(tag, val) {
|
|
14658
|
+
super(tag);
|
|
14659
|
+
this.root.push({ _attr: { "w:val": val } });
|
|
14660
|
+
}
|
|
14661
|
+
};
|
|
14662
|
+
var RelElement = class extends XmlComponent {
|
|
14663
|
+
constructor(tag, rId) {
|
|
14664
|
+
super(tag);
|
|
14665
|
+
this.root.push({ _attr: { "r:id": rId } });
|
|
14666
|
+
}
|
|
14667
|
+
};
|
|
14668
|
+
var PixelsElement = class extends XmlComponent {
|
|
14669
|
+
constructor(tag, val) {
|
|
14670
|
+
super(tag);
|
|
14671
|
+
this.root.push({ _attr: { "w:val": val } });
|
|
14672
|
+
}
|
|
14673
|
+
};
|
|
14674
|
+
var TwipsElement = class extends XmlComponent {
|
|
14675
|
+
constructor(tag, val) {
|
|
14676
|
+
super(tag);
|
|
14677
|
+
this.root.push({ _attr: {
|
|
14678
|
+
"w:w": val,
|
|
14679
|
+
"w:type": "dxa"
|
|
14680
|
+
} });
|
|
14681
|
+
}
|
|
14682
|
+
};
|
|
14683
|
+
var OnOffElement = class extends XmlComponent {
|
|
14684
|
+
constructor(tag) {
|
|
14685
|
+
super(tag);
|
|
14686
|
+
}
|
|
14687
|
+
};
|
|
14688
|
+
//#endregion
|
|
14689
|
+
//#region src/file/web-settings/web-settings.ts
|
|
14690
|
+
init_xml_components();
|
|
14691
|
+
/**
|
|
14692
|
+
* Build div border element.
|
|
14693
|
+
*/
|
|
14694
|
+
function buildDivBorder(options) {
|
|
14695
|
+
const children = [];
|
|
14696
|
+
if (options.top) {
|
|
14697
|
+
const attrs = [];
|
|
14698
|
+
attrs.push({
|
|
14699
|
+
key: "w:val",
|
|
14700
|
+
value: options.top.style
|
|
14701
|
+
});
|
|
14702
|
+
if (options.top.color) attrs.push({
|
|
14703
|
+
key: "w:color",
|
|
14704
|
+
value: options.top.color
|
|
14705
|
+
});
|
|
14706
|
+
if (options.top.size !== void 0) attrs.push({
|
|
14707
|
+
key: "w:sz",
|
|
14708
|
+
value: options.top.size
|
|
14709
|
+
});
|
|
14710
|
+
children.push(new BuilderElement({
|
|
14711
|
+
name: "w:top",
|
|
14712
|
+
attributes: attrs
|
|
14713
|
+
}));
|
|
14714
|
+
}
|
|
14715
|
+
if (options.left) {
|
|
14716
|
+
const attrs = [];
|
|
14717
|
+
attrs.push({
|
|
14718
|
+
key: "w:val",
|
|
14719
|
+
value: options.left.style
|
|
14720
|
+
});
|
|
14721
|
+
if (options.left.color) attrs.push({
|
|
14722
|
+
key: "w:color",
|
|
14723
|
+
value: options.left.color
|
|
14724
|
+
});
|
|
14725
|
+
if (options.left.size !== void 0) attrs.push({
|
|
14726
|
+
key: "w:sz",
|
|
14727
|
+
value: options.left.size
|
|
14728
|
+
});
|
|
14729
|
+
children.push(new BuilderElement({
|
|
14730
|
+
name: "w:left",
|
|
14731
|
+
attributes: attrs
|
|
14732
|
+
}));
|
|
14733
|
+
}
|
|
14734
|
+
if (options.bottom) {
|
|
14735
|
+
const attrs = [];
|
|
14736
|
+
attrs.push({
|
|
14737
|
+
key: "w:val",
|
|
14738
|
+
value: options.bottom.style
|
|
14739
|
+
});
|
|
14740
|
+
if (options.bottom.color) attrs.push({
|
|
14741
|
+
key: "w:color",
|
|
14742
|
+
value: options.bottom.color
|
|
14743
|
+
});
|
|
14744
|
+
if (options.bottom.size !== void 0) attrs.push({
|
|
14745
|
+
key: "w:sz",
|
|
14746
|
+
value: options.bottom.size
|
|
14747
|
+
});
|
|
14748
|
+
children.push(new BuilderElement({
|
|
14749
|
+
name: "w:bottom",
|
|
14750
|
+
attributes: attrs
|
|
14751
|
+
}));
|
|
14752
|
+
}
|
|
14753
|
+
if (options.right) {
|
|
14754
|
+
const attrs = [];
|
|
14755
|
+
attrs.push({
|
|
14756
|
+
key: "w:val",
|
|
14757
|
+
value: options.right.style
|
|
14758
|
+
});
|
|
14759
|
+
if (options.right.color) attrs.push({
|
|
14760
|
+
key: "w:color",
|
|
14761
|
+
value: options.right.color
|
|
14762
|
+
});
|
|
14763
|
+
if (options.right.size !== void 0) attrs.push({
|
|
14764
|
+
key: "w:sz",
|
|
14765
|
+
value: options.right.size
|
|
14766
|
+
});
|
|
14767
|
+
children.push(new BuilderElement({
|
|
14768
|
+
name: "w:right",
|
|
14769
|
+
attributes: attrs
|
|
14770
|
+
}));
|
|
14771
|
+
}
|
|
14772
|
+
return new BuilderElement({
|
|
14773
|
+
name: "w:divBdr",
|
|
14774
|
+
children
|
|
14775
|
+
});
|
|
14776
|
+
}
|
|
14777
|
+
/**
|
|
14778
|
+
* Build a div element (CT_Div).
|
|
14779
|
+
*/
|
|
14780
|
+
function buildDiv(options) {
|
|
14781
|
+
const children = [];
|
|
14782
|
+
if (options.blockQuote !== void 0) children.push(stringValObj("w:blockQuote", options.blockQuote ? "on" : "off"));
|
|
14783
|
+
if (options.bodyDiv !== void 0) children.push(stringValObj("w:bodyDiv", options.bodyDiv ? "on" : "off"));
|
|
14784
|
+
children.push(numberValObj("w:marLeft", options.marginLeft));
|
|
14785
|
+
children.push(numberValObj("w:marRight", options.marginRight));
|
|
14786
|
+
children.push(numberValObj("w:marTop", options.marginTop));
|
|
14787
|
+
children.push(numberValObj("w:marBottom", options.marginBottom));
|
|
14788
|
+
if (options.border) children.push(buildDivBorder(options.border));
|
|
14789
|
+
if (options.children && options.children.length > 0) children.push(new BuilderElement({
|
|
14790
|
+
name: "w:divsChild",
|
|
14791
|
+
children: options.children.map(buildDiv)
|
|
14792
|
+
}));
|
|
14793
|
+
return new BuilderElement({
|
|
14794
|
+
name: "w:div",
|
|
14795
|
+
attributes: { id: {
|
|
14796
|
+
key: "w:id",
|
|
14797
|
+
value: options.id
|
|
14798
|
+
} },
|
|
14799
|
+
children
|
|
14800
|
+
});
|
|
14801
|
+
}
|
|
14802
|
+
/**
|
|
14803
|
+
* Build divs container (CT_Divs).
|
|
14804
|
+
*/
|
|
14805
|
+
function buildDivs(divs) {
|
|
14806
|
+
return new BuilderElement({
|
|
14807
|
+
name: "w:divs",
|
|
14808
|
+
children: divs.map(buildDiv)
|
|
14809
|
+
});
|
|
14810
|
+
}
|
|
14811
|
+
/**
|
|
14812
|
+
* Represents the web settings part (word/webSettings.xml).
|
|
14813
|
+
*
|
|
14814
|
+
* Web settings control how a document is displayed and formatted
|
|
14815
|
+
* when saved as a web page, including framesets, div elements,
|
|
14816
|
+
* encoding, and browser optimization settings.
|
|
14817
|
+
*
|
|
14818
|
+
* Reference: http://officeopenxml.com/WPwebSettings.php
|
|
14819
|
+
*
|
|
14820
|
+
* ## XSD Schema
|
|
14821
|
+
* ```xml
|
|
14822
|
+
* <xsd:complexType name="CT_WebSettings">
|
|
14823
|
+
* <xsd:sequence>
|
|
14824
|
+
* <xsd:element name="frameset" type="CT_Frameset" minOccurs="0"/>
|
|
14825
|
+
* <xsd:element name="divs" type="CT_Divs" minOccurs="0"/>
|
|
14826
|
+
* <xsd:element name="encoding" type="CT_String" minOccurs="0"/>
|
|
14827
|
+
* <xsd:element name="optimizeForBrowser" type="CT_OptimizeForBrowser" minOccurs="0"/>
|
|
14828
|
+
* <xsd:element name="relyOnVML" type="CT_OnOff" minOccurs="0"/>
|
|
14829
|
+
* <xsd:element name="allowPNG" type="CT_OnOff" minOccurs="0"/>
|
|
14830
|
+
* <xsd:element name="doNotRelyOnCSS" type="CT_OnOff" minOccurs="0"/>
|
|
14831
|
+
* <xsd:element name="doNotSaveAsSingleFile" type="CT_OnOff" minOccurs="0"/>
|
|
14832
|
+
* <xsd:element name="doNotOrganizeInFolder" type="CT_OnOff" minOccurs="0"/>
|
|
14833
|
+
* <xsd:element name="doNotUseLongFileNames" type="CT_OnOff" minOccurs="0"/>
|
|
14834
|
+
* <xsd:element name="pixelsPerInch" type="CT_DecimalNumber" minOccurs="0"/>
|
|
14835
|
+
* <xsd:element name="targetScreenSz" type="CT_TargetScreenSz" minOccurs="0"/>
|
|
14836
|
+
* <xsd:element name="saveSmartTagsAsXml" type="CT_OnOff" minOccurs="0"/>
|
|
14837
|
+
* </xsd:sequence>
|
|
14838
|
+
* </xsd:complexType>
|
|
14839
|
+
* ```
|
|
14840
|
+
*/
|
|
14841
|
+
var WebSettings = class extends XmlComponent {
|
|
14842
|
+
constructor(options) {
|
|
14843
|
+
super("w:webSettings");
|
|
14844
|
+
this.root.push({ _attr: {
|
|
14845
|
+
"xmlns:mc": "http://schemas.openxmlformats.org/markup-compatibility/2006",
|
|
14846
|
+
"xmlns:r": "http://schemas.openxmlformats.org/officeDocument/2006/relationships",
|
|
14847
|
+
"xmlns:w": "http://schemas.openxmlformats.org/wordprocessingml/2006/main",
|
|
14848
|
+
"xmlns:w15": "http://schemas.microsoft.com/office/word/2012/wordml"
|
|
14849
|
+
} });
|
|
14850
|
+
if (options === void 0) return;
|
|
14851
|
+
if (options.frameset !== void 0) this.root.push(new Frameset(options.frameset));
|
|
14852
|
+
if (options.divs !== void 0 && options.divs.length > 0) this.root.push(buildDivs(options.divs));
|
|
14853
|
+
if (options.encoding !== void 0) this.root.push(stringValObj("w:encoding", options.encoding));
|
|
14854
|
+
if (options.optimizeForBrowser !== void 0) this.root.push(onOffObj("w:optimizeForBrowser", options.optimizeForBrowser));
|
|
14855
|
+
if (options.relyOnVML !== void 0) this.root.push(onOffObj("w:relyOnVML", options.relyOnVML));
|
|
14856
|
+
if (options.allowPNG !== void 0) this.root.push(onOffObj("w:allowPNG", options.allowPNG));
|
|
14857
|
+
if (options.doNotRelyOnCSS !== void 0) this.root.push(onOffObj("w:doNotRelyOnCSS", options.doNotRelyOnCSS));
|
|
14858
|
+
if (options.doNotSaveAsSingleFile !== void 0) this.root.push(onOffObj("w:doNotSaveAsSingleFile", options.doNotSaveAsSingleFile));
|
|
14859
|
+
if (options.doNotOrganizeInFolder !== void 0) this.root.push(onOffObj("w:doNotOrganizeInFolder", options.doNotOrganizeInFolder));
|
|
14860
|
+
if (options.doNotUseLongFileNames !== void 0) this.root.push(onOffObj("w:doNotUseLongFileNames", options.doNotUseLongFileNames));
|
|
14861
|
+
if (options.pixelsPerInch !== void 0) this.root.push(numberValObj("w:pixelsPerInch", options.pixelsPerInch));
|
|
14862
|
+
if (options.targetScreenSz !== void 0) this.root.push(stringValObj("w:targetScreenSz", options.targetScreenSz));
|
|
14863
|
+
if (options.saveSmartTagsAsXml !== void 0) this.root.push(onOffObj("w:saveSmartTagsAsXml", options.saveSmartTagsAsXml));
|
|
14864
|
+
}
|
|
14865
|
+
};
|
|
14866
|
+
//#endregion
|
|
13499
14867
|
//#region src/file/file.ts
|
|
13500
14868
|
/**
|
|
13501
14869
|
* File module for WordprocessingML documents.
|
|
@@ -13607,6 +14975,8 @@ var File = class {
|
|
|
13607
14975
|
comments;
|
|
13608
14976
|
bibliography;
|
|
13609
14977
|
fontTable;
|
|
14978
|
+
glossaryOptions;
|
|
14979
|
+
webSettings;
|
|
13610
14980
|
constructor(options) {
|
|
13611
14981
|
this.coreProperties = new CoreProperties({
|
|
13612
14982
|
...options,
|
|
@@ -13647,7 +15017,9 @@ var File = class {
|
|
|
13647
15017
|
embedSystemFonts: options.embedSystemFonts,
|
|
13648
15018
|
saveSubsetFonts: options.saveSubsetFonts,
|
|
13649
15019
|
docVars: options.docVars,
|
|
13650
|
-
colorSchemeMapping: options.colorSchemeMapping
|
|
15020
|
+
colorSchemeMapping: options.colorSchemeMapping,
|
|
15021
|
+
mailMerge: options.mailMerge,
|
|
15022
|
+
...options.settings
|
|
13651
15023
|
});
|
|
13652
15024
|
this.media = new Media();
|
|
13653
15025
|
this.charts = new ChartCollection();
|
|
@@ -13684,6 +15056,16 @@ var File = class {
|
|
|
13684
15056
|
this.endnotes.view.createEndnote(parseFloat(key), children);
|
|
13685
15057
|
}
|
|
13686
15058
|
this.fontTable = new FontWrapper(options.fonts ?? []);
|
|
15059
|
+
this.glossaryOptions = options.glossary;
|
|
15060
|
+
this.webSettings = options.webSettings ? new WebSettings(options.webSettings) : void 0;
|
|
15061
|
+
if (options.glossary) {
|
|
15062
|
+
this.contentTypes.addGlossary();
|
|
15063
|
+
this.document.relationships.addRelationship(this._currentRelationshipId++, "http://schemas.openxmlformats.org/officeDocument/2006/relationships/glossaryDocument", "glossary/document.xml");
|
|
15064
|
+
}
|
|
15065
|
+
if (this.webSettings) {
|
|
15066
|
+
this.contentTypes.addWebSettings();
|
|
15067
|
+
this.document.relationships.addRelationship(this._currentRelationshipId++, "http://schemas.openxmlformats.org/officeDocument/2006/relationships/webSettings", "webSettings.xml");
|
|
15068
|
+
}
|
|
13687
15069
|
}
|
|
13688
15070
|
addSection({ headers = {}, footers = {}, children, properties }) {
|
|
13689
15071
|
this.document.view.body.addSection({
|
|
@@ -14028,6 +15410,180 @@ var smartart_exports = /* @__PURE__ */ __exportAll({
|
|
|
14028
15410
|
});
|
|
14029
15411
|
init_tree_to_model();
|
|
14030
15412
|
//#endregion
|
|
15413
|
+
//#region src/file/glossary/glossary-document.ts
|
|
15414
|
+
/** Gallery type for building blocks (ST_DocPartGallery) */
|
|
15415
|
+
const DocPartGallery = {
|
|
15416
|
+
PLACEHOLDER: "placeholder",
|
|
15417
|
+
DEFAULT: "default",
|
|
15418
|
+
DOC_PARTS: "docParts",
|
|
15419
|
+
COVER_PAGE: "coverPg",
|
|
15420
|
+
EQUATIONS: "eq",
|
|
15421
|
+
FOOTERS: "ftrs",
|
|
15422
|
+
HEADERS: "hdrs",
|
|
15423
|
+
PAGE_NUMBERS: "pgNum",
|
|
15424
|
+
TABLES: "tbls",
|
|
15425
|
+
WATERMARKS: "watermarks",
|
|
15426
|
+
AUTO_TEXT: "autoTxt",
|
|
15427
|
+
TEXT_BOX: "txtBox",
|
|
15428
|
+
PAGE_NUMBERS_TOP: "pgNumT",
|
|
15429
|
+
PAGE_NUMBERS_BOTTOM: "pgNumB",
|
|
15430
|
+
PAGE_NUMBERS_MARGIN: "pgNumMargins",
|
|
15431
|
+
TABLE_OF_CONTENTS: "tblOfContents",
|
|
15432
|
+
BIBLIOGRAPHY: "bib",
|
|
15433
|
+
CUSTOM_QUICK_PARTS: "custQuickParts",
|
|
15434
|
+
CUSTOM_COVER_PAGE: "custCoverPg",
|
|
15435
|
+
CUSTOM_EQUATIONS: "custEq",
|
|
15436
|
+
CUSTOM_FOOTERS: "custFtrs",
|
|
15437
|
+
CUSTOM_HEADERS: "custHdrs",
|
|
15438
|
+
CUSTOM_PAGE_NUMBERS: "custPgNum",
|
|
15439
|
+
CUSTOM_TABLES: "custTbls",
|
|
15440
|
+
CUSTOM_WATERMARKS: "custWatermarks",
|
|
15441
|
+
CUSTOM_AUTO_TEXT: "custAutoTxt",
|
|
15442
|
+
CUSTOM_TEXT_BOX: "custTxtBox",
|
|
15443
|
+
CUSTOM_PAGE_NUMBERS_TOP: "custPgNumT",
|
|
15444
|
+
CUSTOM_PAGE_NUMBERS_BOTTOM: "custPgNumB",
|
|
15445
|
+
CUSTOM_PAGE_NUMBERS_MARGIN: "custPgNumMargins",
|
|
15446
|
+
CUSTOM_TABLE_OF_CONTENTS: "custTblOfContents",
|
|
15447
|
+
CUSTOM_BIBLIOGRAPHY: "custBib",
|
|
15448
|
+
CUSTOM1: "custom1",
|
|
15449
|
+
CUSTOM2: "custom2",
|
|
15450
|
+
CUSTOM3: "custom3",
|
|
15451
|
+
CUSTOM4: "custom4",
|
|
15452
|
+
CUSTOM5: "custom5"
|
|
15453
|
+
};
|
|
15454
|
+
/** Building block type (ST_DocPartType) */
|
|
15455
|
+
const DocPartType = {
|
|
15456
|
+
NONE: "none",
|
|
15457
|
+
NORMAL: "normal",
|
|
15458
|
+
AUTO_EXPAND: "autoExp",
|
|
15459
|
+
TOOLBAR: "toolbar",
|
|
15460
|
+
SPELLER: "speller",
|
|
15461
|
+
FORM_FIELD: "formFld",
|
|
15462
|
+
BUILDING_BLOCK_PLACEHOLDER: "bbPlcHdr"
|
|
15463
|
+
};
|
|
15464
|
+
/** Building block behavior (ST_DocPartBehavior) */
|
|
15465
|
+
const DocPartBehavior = {
|
|
15466
|
+
CONTENT: "content",
|
|
15467
|
+
PARAGRAPH: "p",
|
|
15468
|
+
PAGE: "pg"
|
|
15469
|
+
};
|
|
15470
|
+
//#endregion
|
|
15471
|
+
//#region src/file/object/object-element.ts
|
|
15472
|
+
init_xml_components();
|
|
15473
|
+
const STYLE_MAP = {
|
|
15474
|
+
width: "width",
|
|
15475
|
+
height: "height",
|
|
15476
|
+
position: "position",
|
|
15477
|
+
left: "left",
|
|
15478
|
+
top: "top"
|
|
15479
|
+
};
|
|
15480
|
+
function formatStyle(style) {
|
|
15481
|
+
if (!style) return void 0;
|
|
15482
|
+
return Object.entries(style).filter(([, v]) => v !== void 0).map(([k, v]) => `${STYLE_MAP[k] ?? k}:${v}`).join(";");
|
|
15483
|
+
}
|
|
15484
|
+
var ObjectEmbed = class extends XmlComponent {
|
|
15485
|
+
constructor(options) {
|
|
15486
|
+
super("w:objectEmbed");
|
|
15487
|
+
const attrs = { "r:id": options.rId };
|
|
15488
|
+
if (options.progId) attrs["w:progId"] = options.progId;
|
|
15489
|
+
if (options.drawAspect) attrs["w:drawAspect"] = options.drawAspect;
|
|
15490
|
+
if (options.shapeId) attrs["w:shapeId"] = options.shapeId;
|
|
15491
|
+
if (options.fieldCodes) attrs["w:fieldCodes"] = options.fieldCodes;
|
|
15492
|
+
this.root.push({ _attr: attrs });
|
|
15493
|
+
}
|
|
15494
|
+
};
|
|
15495
|
+
var ObjectLink = class extends XmlComponent {
|
|
15496
|
+
constructor(options) {
|
|
15497
|
+
super("w:objectLink");
|
|
15498
|
+
const attrs = {
|
|
15499
|
+
"r:id": options.rId,
|
|
15500
|
+
"w:updateMode": options.updateMode
|
|
15501
|
+
};
|
|
15502
|
+
if (options.progId) attrs["w:progId"] = options.progId;
|
|
15503
|
+
if (options.drawAspect) attrs["w:drawAspect"] = options.drawAspect;
|
|
15504
|
+
if (options.shapeId) attrs["w:shapeId"] = options.shapeId;
|
|
15505
|
+
if (options.fieldCodes) attrs["w:fieldCodes"] = options.fieldCodes;
|
|
15506
|
+
if (options.lockedField) attrs["w:lockedField"] = "1";
|
|
15507
|
+
this.root.push({ _attr: attrs });
|
|
15508
|
+
}
|
|
15509
|
+
};
|
|
15510
|
+
/** Creates a w:object element with VML shape and optional embed/link */
|
|
15511
|
+
var ObjectElement = class extends XmlComponent {
|
|
15512
|
+
fileChild = Symbol();
|
|
15513
|
+
constructor(options) {
|
|
15514
|
+
super("w:object");
|
|
15515
|
+
const attrs = {};
|
|
15516
|
+
if (options.dxaOrig !== void 0) attrs["w:dxaOrig"] = options.dxaOrig;
|
|
15517
|
+
if (options.dyaOrig !== void 0) attrs["w:dyaOrig"] = options.dyaOrig;
|
|
15518
|
+
if (Object.keys(attrs).length > 0) this.root.push({ _attr: attrs });
|
|
15519
|
+
const shapeAttrs = {
|
|
15520
|
+
id: options.shapeId ?? `_x0000_i1025`,
|
|
15521
|
+
type: "#_x0000_t75"
|
|
15522
|
+
};
|
|
15523
|
+
const styleStr = formatStyle(options.style);
|
|
15524
|
+
if (styleStr) shapeAttrs.style = styleStr;
|
|
15525
|
+
this.root.push(new BuilderElement({
|
|
15526
|
+
name: "v:shape",
|
|
15527
|
+
attributes: Object.fromEntries(Object.entries(shapeAttrs).map(([key, value]) => [key, {
|
|
15528
|
+
key,
|
|
15529
|
+
value
|
|
15530
|
+
}])),
|
|
15531
|
+
children: []
|
|
15532
|
+
}));
|
|
15533
|
+
this.root.push(new BuilderElement({
|
|
15534
|
+
name: "o:OLEObject",
|
|
15535
|
+
attributes: {
|
|
15536
|
+
Type: {
|
|
15537
|
+
key: "Type",
|
|
15538
|
+
value: options.link ? "Link" : "Embed"
|
|
15539
|
+
},
|
|
15540
|
+
ProgID: {
|
|
15541
|
+
key: "ProgID",
|
|
15542
|
+
value: options.embed?.progId ?? options.link?.progId
|
|
15543
|
+
},
|
|
15544
|
+
ShapeID: {
|
|
15545
|
+
key: "ShapeID",
|
|
15546
|
+
value: options.shapeId ?? `_x0000_i1025`
|
|
15547
|
+
},
|
|
15548
|
+
DrawAspect: {
|
|
15549
|
+
key: "DrawAspect",
|
|
15550
|
+
value: options.embed?.drawAspect ?? options.link?.drawAspect ?? "Content"
|
|
15551
|
+
},
|
|
15552
|
+
ObjectID: {
|
|
15553
|
+
key: "ObjectID",
|
|
15554
|
+
value: `_${generateId()}`
|
|
15555
|
+
}
|
|
15556
|
+
},
|
|
15557
|
+
children: []
|
|
15558
|
+
}));
|
|
15559
|
+
if (options.embed) this.root.push(new ObjectEmbed(options.embed));
|
|
15560
|
+
else if (options.link) this.root.push(new ObjectLink(options.link));
|
|
15561
|
+
if (options.control) {
|
|
15562
|
+
const controlAttrs = [];
|
|
15563
|
+
if (options.control.name !== void 0) controlAttrs.push({
|
|
15564
|
+
key: "w:name",
|
|
15565
|
+
value: options.control.name
|
|
15566
|
+
});
|
|
15567
|
+
if (options.control.shapeid !== void 0) controlAttrs.push({
|
|
15568
|
+
key: "w:shapeid",
|
|
15569
|
+
value: options.control.shapeid
|
|
15570
|
+
});
|
|
15571
|
+
if (options.control.rId !== void 0) controlAttrs.push({
|
|
15572
|
+
key: "r:id",
|
|
15573
|
+
value: options.control.rId
|
|
15574
|
+
});
|
|
15575
|
+
this.root.push(new BuilderElement({
|
|
15576
|
+
name: "w:control",
|
|
15577
|
+
attributes: controlAttrs
|
|
15578
|
+
}));
|
|
15579
|
+
}
|
|
15580
|
+
if (options.movie !== void 0) this.root.push(stringValObj("w:movie", options.movie));
|
|
15581
|
+
}
|
|
15582
|
+
};
|
|
15583
|
+
function generateId() {
|
|
15584
|
+
return Math.random().toString(16).slice(2, 18).toUpperCase().padEnd(16, "0");
|
|
15585
|
+
}
|
|
15586
|
+
//#endregion
|
|
14031
15587
|
//#region src/file/index.ts
|
|
14032
15588
|
var file_exports = /* @__PURE__ */ __exportAll({
|
|
14033
15589
|
AbstractNumbering: () => AbstractNumbering,
|
|
@@ -14065,6 +15621,18 @@ var file_exports = /* @__PURE__ */ __exportAll({
|
|
|
14065
15621
|
ConcreteHyperlink: () => ConcreteHyperlink,
|
|
14066
15622
|
ConcreteNumbering: () => ConcreteNumbering,
|
|
14067
15623
|
ContinuationSeparator: () => ContinuationSeparator,
|
|
15624
|
+
CustomXmlBlock: () => CustomXmlBlock,
|
|
15625
|
+
CustomXmlCell: () => CustomXmlCell,
|
|
15626
|
+
CustomXmlDelRangeEnd: () => CustomXmlDelRangeEnd,
|
|
15627
|
+
CustomXmlDelRangeStart: () => CustomXmlDelRangeStart,
|
|
15628
|
+
CustomXmlInsRangeEnd: () => CustomXmlInsRangeEnd,
|
|
15629
|
+
CustomXmlInsRangeStart: () => CustomXmlInsRangeStart,
|
|
15630
|
+
CustomXmlMoveFromRangeEnd: () => CustomXmlMoveFromRangeEnd,
|
|
15631
|
+
CustomXmlMoveFromRangeStart: () => CustomXmlMoveFromRangeStart,
|
|
15632
|
+
CustomXmlMoveToRangeEnd: () => CustomXmlMoveToRangeEnd,
|
|
15633
|
+
CustomXmlMoveToRangeStart: () => CustomXmlMoveToRangeStart,
|
|
15634
|
+
CustomXmlRow: () => CustomXmlRow,
|
|
15635
|
+
CustomXmlRun: () => CustomXmlRun,
|
|
14068
15636
|
DEFAULT_DRAWING_XML: () => DEFAULT_DRAWING_XML,
|
|
14069
15637
|
DayLong: () => DayLong,
|
|
14070
15638
|
DayShort: () => DayShort,
|
|
@@ -14072,6 +15640,9 @@ var file_exports = /* @__PURE__ */ __exportAll({
|
|
|
14072
15640
|
DeletedTableRow: () => DeletedTableRow,
|
|
14073
15641
|
DeletedTextRun: () => DeletedTextRun,
|
|
14074
15642
|
Dir: () => Dir,
|
|
15643
|
+
DocPartBehavior: () => DocPartBehavior,
|
|
15644
|
+
DocPartGallery: () => DocPartGallery,
|
|
15645
|
+
DocPartType: () => DocPartType,
|
|
14075
15646
|
Document: () => Document,
|
|
14076
15647
|
DocumentAttributeNamespaces: () => DocumentAttributeNamespaces,
|
|
14077
15648
|
DocumentBackground: () => DocumentBackground,
|
|
@@ -14099,6 +15670,7 @@ var file_exports = /* @__PURE__ */ __exportAll({
|
|
|
14099
15670
|
FractionType: () => FractionType,
|
|
14100
15671
|
FrameAnchorType: () => FrameAnchorType,
|
|
14101
15672
|
FrameWrap: () => FrameWrap,
|
|
15673
|
+
Frameset: () => Frameset,
|
|
14102
15674
|
GridSpan: () => GridSpan,
|
|
14103
15675
|
Header: () => Header,
|
|
14104
15676
|
HeaderFooterReferenceType: () => HeaderFooterReferenceType,
|
|
@@ -14175,6 +15747,7 @@ var file_exports = /* @__PURE__ */ __exportAll({
|
|
|
14175
15747
|
NumberedItemReference: () => NumberedItemReference,
|
|
14176
15748
|
NumberedItemReferenceFormat: () => NumberedItemReferenceFormat,
|
|
14177
15749
|
Numbering: () => Numbering,
|
|
15750
|
+
ObjectElement: () => ObjectElement,
|
|
14178
15751
|
OverlapType: () => OverlapType,
|
|
14179
15752
|
PageBorderDisplay: () => PageBorderDisplay,
|
|
14180
15753
|
PageBorderOffsetFrom: () => PageBorderOffsetFrom,
|
|
@@ -14200,6 +15773,8 @@ var file_exports = /* @__PURE__ */ __exportAll({
|
|
|
14200
15773
|
PositionalTabAlignment: () => PositionalTabAlignment,
|
|
14201
15774
|
PositionalTabLeader: () => PositionalTabLeader,
|
|
14202
15775
|
PositionalTabRelativeTo: () => PositionalTabRelativeTo,
|
|
15776
|
+
ProofError: () => ProofError,
|
|
15777
|
+
ProofErrorType: () => ProofErrorType,
|
|
14203
15778
|
RelativeHorizontalPosition: () => RelativeHorizontalPosition,
|
|
14204
15779
|
RelativeVerticalPosition: () => RelativeVerticalPosition,
|
|
14205
15780
|
RubyAlign: () => RubyAlign,
|
|
@@ -14220,6 +15795,7 @@ var file_exports = /* @__PURE__ */ __exportAll({
|
|
|
14220
15795
|
SimpleMailMergeField: () => SimpleMailMergeField,
|
|
14221
15796
|
SmartArtCollection: () => SmartArtCollection,
|
|
14222
15797
|
SmartArtRun: () => SmartArtRun,
|
|
15798
|
+
SmartTagRun: () => SmartTagRun,
|
|
14223
15799
|
SoftHyphen: () => SoftHyphen,
|
|
14224
15800
|
SpaceType: () => SpaceType,
|
|
14225
15801
|
StructuredDocumentTagBlock: () => StructuredDocumentTagBlock,
|
|
@@ -14408,7 +15984,7 @@ var file_exports = /* @__PURE__ */ __exportAll({
|
|
|
14408
15984
|
});
|
|
14409
15985
|
init_paragraph();
|
|
14410
15986
|
init_coerce();
|
|
14411
|
-
init_table
|
|
15987
|
+
init_table();
|
|
14412
15988
|
init_media();
|
|
14413
15989
|
init_drawing();
|
|
14414
15990
|
init_shading();
|
|
@@ -14418,6 +15994,7 @@ init_track_revision();
|
|
|
14418
15994
|
init_shared();
|
|
14419
15995
|
init_border$1();
|
|
14420
15996
|
init_vertical_align();
|
|
15997
|
+
init_custom_xml();
|
|
14421
15998
|
init_sdt();
|
|
14422
15999
|
__reExport(file_exports, smartart_exports);
|
|
14423
16000
|
//#endregion
|
|
@@ -14756,10 +16333,48 @@ var Compiler = class {
|
|
|
14756
16333
|
...file.subDocs.array.length > 0 ? { SubDocs: file.subDocs.array.map((subDocData) => ({
|
|
14757
16334
|
data: subDocData.data,
|
|
14758
16335
|
path: `word/${subDocData.path}`
|
|
14759
|
-
})) } : {}
|
|
16336
|
+
})) } : {},
|
|
16337
|
+
...file.glossaryOptions ? { Glossary: {
|
|
16338
|
+
data: buildGlossaryXml(file.glossaryOptions, this.formatter, mkCtx),
|
|
16339
|
+
path: "word/glossary/document.xml"
|
|
16340
|
+
} } : {},
|
|
16341
|
+
...file.webSettings ? { WebSettings: {
|
|
16342
|
+
data: this.formatter.formatToXml(file.webSettings, mkCtx(file.document)),
|
|
16343
|
+
path: "word/webSettings.xml"
|
|
16344
|
+
} } : {}
|
|
14760
16345
|
};
|
|
14761
16346
|
}
|
|
14762
16347
|
};
|
|
16348
|
+
/**
|
|
16349
|
+
* Build glossary document XML from options.
|
|
16350
|
+
* Generates <w:glossaryDocument><w:docParts>...</w:docParts></w:glossaryDocument>.
|
|
16351
|
+
*/
|
|
16352
|
+
function buildGlossaryXml(opts, formatter, mkCtx) {
|
|
16353
|
+
const escapeAttr = (text) => text.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """);
|
|
16354
|
+
return `<w:glossaryDocument xmlns:wpc="http://schemas.microsoft.com/office/word/2010/wordprocessingCanvas" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships" xmlns:m="http://schemas.openxmlformats.org/officeDocument/2006/math" xmlns:v="urn:schemas-microsoft-com:vml" xmlns:wp="http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing" xmlns:w10="urn:schemas-microsoft-com:office:word" xmlns:w="http://schemas.openxmlformats.org/wordprocessingml/2006/main" xmlns:w14="http://schemas.microsoft.com/office/word/2010/wordml" xmlns:wpg="http://schemas.microsoft.com/office/word/2010/wordprocessingGroup" xmlns:wpi="http://schemas.microsoft.com/office/word/2010/wordprocessingInk" xmlns:wne="http://schemas.microsoft.com/office/word/2006/wordml" xmlns:wps="http://schemas.microsoft.com/office/word/2010/wordprocessingShape"><w:docParts>${opts.parts.map((part) => {
|
|
16355
|
+
const prParts = [];
|
|
16356
|
+
prParts.push(`<w:name w:val="${escapeAttr(part.name)}"${part.decorated ? " w:decorated=\"1\"" : ""}/>`);
|
|
16357
|
+
if (part.category || part.gallery) {
|
|
16358
|
+
const catParts = [];
|
|
16359
|
+
if (part.category) catParts.push(`<w:name w:val="${escapeAttr(part.category)}"/>`);
|
|
16360
|
+
catParts.push(`<w:gallery w:val="${part.gallery}"/>`);
|
|
16361
|
+
prParts.push(`<w:category>${catParts.join("")}</w:category>`);
|
|
16362
|
+
}
|
|
16363
|
+
if (part.types && part.types.length > 0) {
|
|
16364
|
+
const typeXml = part.types.map((t) => `<w:type w:val="${t}"/>`).join("");
|
|
16365
|
+
const allAttr = part.allTypes ? " w:all=\"1\"" : "";
|
|
16366
|
+
prParts.push(`<w:types${allAttr}>${typeXml}</w:types>`);
|
|
16367
|
+
}
|
|
16368
|
+
if (part.behaviors && part.behaviors.length > 0) {
|
|
16369
|
+
const behaviorXml = part.behaviors.map((b) => `<w:behavior w:val="${b}"/>`).join("");
|
|
16370
|
+
prParts.push(`<w:behaviors>${behaviorXml}</w:behaviors>`);
|
|
16371
|
+
}
|
|
16372
|
+
if (part.description) prParts.push(`<w:description w:val="${escapeAttr(part.description)}"/>`);
|
|
16373
|
+
if (part.guid) prParts.push(`<w:guid w:val="${escapeAttr(part.guid)}"/>`);
|
|
16374
|
+
const bodyContent = part.children.map((child) => formatter.formatToXml(child, mkCtx(void 0))).join("");
|
|
16375
|
+
return `<w:docPart><w:docPartPr>${prParts.join("")}</w:docPartPr><w:docPartBody>${bodyContent}</w:docPartBody></w:docPart>`;
|
|
16376
|
+
}).join("")}</w:docParts></w:glossaryDocument>`;
|
|
16377
|
+
}
|
|
14763
16378
|
//#endregion
|
|
14764
16379
|
//#region src/export/packer/packer.ts
|
|
14765
16380
|
const compiler = new Compiler();
|
|
@@ -17617,6 +19232,18 @@ var src_exports = /* @__PURE__ */ __exportAll({
|
|
|
17617
19232
|
ConcreteHyperlink: () => ConcreteHyperlink,
|
|
17618
19233
|
ConcreteNumbering: () => ConcreteNumbering,
|
|
17619
19234
|
ContinuationSeparator: () => ContinuationSeparator,
|
|
19235
|
+
CustomXmlBlock: () => CustomXmlBlock,
|
|
19236
|
+
CustomXmlCell: () => CustomXmlCell,
|
|
19237
|
+
CustomXmlDelRangeEnd: () => CustomXmlDelRangeEnd,
|
|
19238
|
+
CustomXmlDelRangeStart: () => CustomXmlDelRangeStart,
|
|
19239
|
+
CustomXmlInsRangeEnd: () => CustomXmlInsRangeEnd,
|
|
19240
|
+
CustomXmlInsRangeStart: () => CustomXmlInsRangeStart,
|
|
19241
|
+
CustomXmlMoveFromRangeEnd: () => CustomXmlMoveFromRangeEnd,
|
|
19242
|
+
CustomXmlMoveFromRangeStart: () => CustomXmlMoveFromRangeStart,
|
|
19243
|
+
CustomXmlMoveToRangeEnd: () => CustomXmlMoveToRangeEnd,
|
|
19244
|
+
CustomXmlMoveToRangeStart: () => CustomXmlMoveToRangeStart,
|
|
19245
|
+
CustomXmlRow: () => CustomXmlRow,
|
|
19246
|
+
CustomXmlRun: () => CustomXmlRun,
|
|
17620
19247
|
DEFAULT_DRAWING_XML: () => DEFAULT_DRAWING_XML,
|
|
17621
19248
|
DayLong: () => DayLong,
|
|
17622
19249
|
DayShort: () => DayShort,
|
|
@@ -17624,6 +19251,9 @@ var src_exports = /* @__PURE__ */ __exportAll({
|
|
|
17624
19251
|
DeletedTableRow: () => DeletedTableRow,
|
|
17625
19252
|
DeletedTextRun: () => DeletedTextRun,
|
|
17626
19253
|
Dir: () => Dir,
|
|
19254
|
+
DocPartBehavior: () => DocPartBehavior,
|
|
19255
|
+
DocPartGallery: () => DocPartGallery,
|
|
19256
|
+
DocPartType: () => DocPartType,
|
|
17627
19257
|
Document: () => File,
|
|
17628
19258
|
DocumentAttributeNamespaces: () => DocumentAttributeNamespaces,
|
|
17629
19259
|
DocumentBackground: () => DocumentBackground,
|
|
@@ -17651,6 +19281,7 @@ var src_exports = /* @__PURE__ */ __exportAll({
|
|
|
17651
19281
|
FractionType: () => FractionType,
|
|
17652
19282
|
FrameAnchorType: () => FrameAnchorType,
|
|
17653
19283
|
FrameWrap: () => FrameWrap,
|
|
19284
|
+
Frameset: () => Frameset,
|
|
17654
19285
|
GridSpan: () => GridSpan,
|
|
17655
19286
|
Header: () => Header,
|
|
17656
19287
|
HeaderFooterReferenceType: () => HeaderFooterReferenceType,
|
|
@@ -17727,6 +19358,7 @@ var src_exports = /* @__PURE__ */ __exportAll({
|
|
|
17727
19358
|
NumberedItemReference: () => NumberedItemReference,
|
|
17728
19359
|
NumberedItemReferenceFormat: () => NumberedItemReferenceFormat,
|
|
17729
19360
|
Numbering: () => Numbering,
|
|
19361
|
+
ObjectElement: () => ObjectElement,
|
|
17730
19362
|
OverlapType: () => OverlapType,
|
|
17731
19363
|
Packer: () => Packer,
|
|
17732
19364
|
PageBorderDisplay: () => PageBorderDisplay,
|
|
@@ -17754,6 +19386,8 @@ var src_exports = /* @__PURE__ */ __exportAll({
|
|
|
17754
19386
|
PositionalTabAlignment: () => PositionalTabAlignment,
|
|
17755
19387
|
PositionalTabLeader: () => PositionalTabLeader,
|
|
17756
19388
|
PositionalTabRelativeTo: () => PositionalTabRelativeTo,
|
|
19389
|
+
ProofError: () => ProofError,
|
|
19390
|
+
ProofErrorType: () => ProofErrorType,
|
|
17757
19391
|
RelativeHorizontalPosition: () => RelativeHorizontalPosition,
|
|
17758
19392
|
RelativeVerticalPosition: () => RelativeVerticalPosition,
|
|
17759
19393
|
RubyAlign: () => RubyAlign,
|
|
@@ -17774,6 +19408,7 @@ var src_exports = /* @__PURE__ */ __exportAll({
|
|
|
17774
19408
|
SimpleMailMergeField: () => SimpleMailMergeField,
|
|
17775
19409
|
SmartArtCollection: () => SmartArtCollection,
|
|
17776
19410
|
SmartArtRun: () => SmartArtRun,
|
|
19411
|
+
SmartTagRun: () => SmartTagRun,
|
|
17777
19412
|
SoftHyphen: () => SoftHyphen,
|
|
17778
19413
|
SpaceType: () => SpaceType,
|
|
17779
19414
|
StructuredDocumentTagBlock: () => StructuredDocumentTagBlock,
|
|
@@ -17978,6 +19613,6 @@ var src_exports = /* @__PURE__ */ __exportAll({
|
|
|
17978
19613
|
__reExport(src_exports, file_exports);
|
|
17979
19614
|
__reExport(src_exports, util_exports);
|
|
17980
19615
|
//#endregion
|
|
17981
|
-
export { AbstractNumbering, AlignmentType, AltChunk, AltChunkCollection, AnnotationReference, BaseXmlComponent, Bdo, Bibliography, Body, Bookmark, BookmarkEnd, BookmarkStart, Border, BorderStyle, BuilderElement, COLOR_CATEGORIES, CarriageReturn, CellMerge, CharacterSet, ChartCollection, ChartRun, ChartSpace, CheckBox, CheckBoxSymbolElement, CheckBoxUtil, Column, ColumnBreak, Comment, CommentRangeEnd, CommentRangeStart, CommentReference, Comments, ConcreteHyperlink, ConcreteNumbering, ContinuationSeparator, DEFAULT_DRAWING_XML, DayLong, DayShort, DeletedTableCell, DeletedTableRow, DeletedTextRun, Dir, File as Document, File, DocumentAttributeNamespaces, DocumentBackground, DocumentDefaults, DocumentGridType, Drawing, DropCapType, EMPTY_OBJECT, EditGroupType, EmphasisMarkType, EmptyElement, EndnoteIdReference, EndnoteReference, EndnoteReferenceRun, Endnotes, ExternalHyperlink, FootNotes, Footer, FooterWrapper, FootnoteReference, FootnoteReferenceElement, FootnoteReferenceRun, FormFieldTextType, FractionType, FrameAnchorType, FrameWrap, GridSpan, Header, HeaderFooterReferenceType, HeaderFooterType, HeaderWrapper, HeadingLevel, HeightRule, HighlightColor, HorizontalPositionAlign, HorizontalPositionRelativeFrom, HyperlinkType, IgnoreIfEmptyXmlComponent, ImageRun, ImportedRootElementAttributes, ImportedXmlComponent, InitializableXmlComponent, InsertedTableCell, InsertedTableRow, InsertedTextRun, InternalHyperlink, LAYOUT_CATEGORIES, LastRenderedPageBreak, LeaderType, Level, LevelBase, LevelForOverride, LevelFormat, LevelOverride, LevelSuffix, LineNumberRestartFormat, LineRuleType, Math$1 as Math, MathAngledBrackets, MathBorderBox, MathBox, MathCurlyBrackets, MathDegree, MathDenominator, MathEqArr, MathFraction, MathFunction, MathFunctionName, MathGroupChr, MathIntegral, MathLimit, MathLimitLower, MathLimitUpper, MathMatrix, MathNumerator, MathParagraph, MathPhant, MathPreSubSuperScript, MathRadical, MathRadicalProperties, MathRoundBrackets, MathRun, MathSquareBrackets, MathSubScript, MathSubSuperScript, MathSum, MathSuperScript, Media, MonthLong, MonthShort, MoveFromRangeEnd, MoveFromRangeStart, MoveToRangeEnd, MoveToRangeStart, MovedFromTextRun, MovedToTextRun, NoBreakHyphen, NumberFormat, NumberProperties, NumberedItemReference, NumberedItemReferenceFormat, Numbering, OverlapType, Packer, PageBorderDisplay, PageBorderOffsetFrom, PageBorderZOrder, PageBorders, PageBreak, PageBreakBefore, PageNumber, PageNumberElement, PageNumberSeparator, PageOrientation, PageReference, PageTextDirection, PageTextDirectionType, Paragraph, ParagraphProperties, ParagraphPropertiesChange, ParagraphPropertiesDefaults, ParagraphRunProperties, PatchType, PermEnd, PermStart, PositionalTab, PositionalTabAlignment, PositionalTabLeader, PositionalTabRelativeTo, RelativeHorizontalPosition, RelativeVerticalPosition, RubyAlign, Run, RunProperties, RunPropertiesChange, RunPropertiesDefaults, STYLE_CATEGORIES, SdtDateMappingType, SdtLock, SectionProperties, SectionPropertiesChange, SectionType, Separator, SequentialIdentifier, ShadingType, SimpleField, SimpleMailMergeField, SmartArtCollection, SmartArtRun, SoftHyphen, SpaceType, StructuredDocumentTagBlock, StructuredDocumentTagCell, StructuredDocumentTagContent, StructuredDocumentTagProperties, StructuredDocumentTagRow, StructuredDocumentTagRun, StyleForCharacter, StyleForParagraph, StyleLevel, Styles, SubDoc, SubDocCollection, SymbolRun, TDirection, Tab, TabStopPosition, TabStopType, Table, TableAnchorType, TableBorders, TableCell, TableCellBorders, TableLayoutType, TableOfContents, TableProperties, TablePropertyExceptions, TableRow, TableRowProperties, TableRowPropertiesChange, TextAlignmentType, TextBodyWrappingType, TextDirection, TextEffect, TextHorzOverflowType, TextRun, TextVertOverflowType, TextVerticalType, TextWrappingSide, TextWrappingType, Textbox, TextboxTightWrapType, ThematicBreak, UnderlineType, VerticalAlignSection, VerticalAlignTable, VerticalAnchor, VerticalMerge, VerticalMergeRevisionType, VerticalMergeType, VerticalPositionAlign, VerticalPositionRelativeFrom, WORKAROUND2, WORKAROUND4, WidthType, WpgGroupRun, WpsShapeRun, XmlComponent, YearLong, YearShort, abstractNumUniqueNumericIdGen, attrObj, bookmarkUniqueNumericIdGen, buildBorderObj, buildCellMergeObj, buildCnfStyleObj, buildDeletedTableCellObj, buildDeletedTableRowObj, buildDivIdObj, buildDocumentAttributes, buildEmphasisMarkObj, buildFramePropertiesObj, buildGridSpan, buildIndentObj, buildInsertedTableCellObj, buildInsertedTableRowObj, buildNumberProperties, buildOutlineLevelObj, buildParagraphBorders, buildParagraphProperties, buildRunFontsObj, buildRunProperties, buildShadingObj, buildSpacingObj, buildTabStopObj, buildTableBorders, buildTableCellBorders, buildTableFloatPropertiesObj, buildTableProperties, buildTableRowProperties, buildTableRowPropertiesChangeObj, buildTableWidthObj, buildTextDirection, buildThematicBreakObj, buildUnderlineObj, buildVerticalMerge, chartAttr, coerceMathJson, coerceSectionChild, concreteNumUniqueNumericIdGen, convertInchesToTwip, convertMillimetersToTwip, convertToXmlComponent, createAlignment, createBodyProperties, createBorderElement, createBreak, createCnfStyle, createColumns, createDataModel, createDivId, createDocumentGrid, createDotEmphasisMark, createEmphasisMark, createFormFieldData, createFrameProperties, createHeaderFooterReference, createHorizontalPosition, createIndent, createLineNumberType, createMathAccent, createMathAccentCharacter, createMathAccentProperties, createMathBar, createMathBarProperties, createMathBase, createMathBorderBoxProperties, createMathBoxProperties, createMathControlProperties, createMathEqArrProperties, createMathFractionProperties, createMathFunctionProperties, createMathGroupChrProperties, createMathLimitLocation, createMathLimitLowProperties, createMathLimitUpperProperties, createMathMatrixProperties, createMathNAryProperties, createMathPhantProperties, createMathPreSubSuperScriptProperties, createMathProperties, createMathRunProperties, createMathSubScriptElement, createMathSubScriptProperties, createMathSubSuperScriptProperties, createMathSuperScriptElement, createMathSuperScriptProperties, createOutlineLevel, createPageMargin, createPageNumberType, createPageSize, createParagraphStyle, createRuby, createRunFonts, createSectionType, createShading, createSimplePos, createSpacing, createStringElement, createTabStop, createTabStopItem, createTableFloatProperties, createTableLayout, createTableLook, createTableOverlap, createTableRowHeight, createTableWidthElement, createTransformation, createUnderline, createVerticalAlign, createVerticalPosition, createWrapNone, createWrapSquare, createWrapThrough, createWrapTight, createWrapTopAndBottom, docPropertiesUniqueNumericIdGen, getColorXml, getLayoutXml, getStyleXml, hashedId, hpsMeasureObj, numberValObj, onOffObj, parseArchive, parseDocument, parseDocx, parseMathChildren, patchDetector, patchDocument, sectionMarginDefaults, sectionPageSizeDefaults, stringContainerObj, stringEnumValObj, stringValObj, uniqueId, uniqueNumericIdCreator, uniqueUuid, wrapEl };
|
|
19616
|
+
export { AbstractNumbering, AlignmentType, AltChunk, AltChunkCollection, AnnotationReference, BaseXmlComponent, Bdo, Bibliography, Body, Bookmark, BookmarkEnd, BookmarkStart, Border, BorderStyle, BuilderElement, COLOR_CATEGORIES, CarriageReturn, CellMerge, CharacterSet, ChartCollection, ChartRun, ChartSpace, CheckBox, CheckBoxSymbolElement, CheckBoxUtil, Column, ColumnBreak, Comment, CommentRangeEnd, CommentRangeStart, CommentReference, Comments, ConcreteHyperlink, ConcreteNumbering, ContinuationSeparator, CustomXmlBlock, CustomXmlCell, CustomXmlDelRangeEnd, CustomXmlDelRangeStart, CustomXmlInsRangeEnd, CustomXmlInsRangeStart, CustomXmlMoveFromRangeEnd, CustomXmlMoveFromRangeStart, CustomXmlMoveToRangeEnd, CustomXmlMoveToRangeStart, CustomXmlRow, CustomXmlRun, DEFAULT_DRAWING_XML, DayLong, DayShort, DeletedTableCell, DeletedTableRow, DeletedTextRun, Dir, DocPartBehavior, DocPartGallery, DocPartType, File as Document, File, DocumentAttributeNamespaces, DocumentBackground, DocumentDefaults, DocumentGridType, Drawing, DropCapType, EMPTY_OBJECT, EditGroupType, EmphasisMarkType, EmptyElement, EndnoteIdReference, EndnoteReference, EndnoteReferenceRun, Endnotes, ExternalHyperlink, FootNotes, Footer, FooterWrapper, FootnoteReference, FootnoteReferenceElement, FootnoteReferenceRun, FormFieldTextType, FractionType, FrameAnchorType, FrameWrap, Frameset, GridSpan, Header, HeaderFooterReferenceType, HeaderFooterType, HeaderWrapper, HeadingLevel, HeightRule, HighlightColor, HorizontalPositionAlign, HorizontalPositionRelativeFrom, HyperlinkType, IgnoreIfEmptyXmlComponent, ImageRun, ImportedRootElementAttributes, ImportedXmlComponent, InitializableXmlComponent, InsertedTableCell, InsertedTableRow, InsertedTextRun, InternalHyperlink, LAYOUT_CATEGORIES, LastRenderedPageBreak, LeaderType, Level, LevelBase, LevelForOverride, LevelFormat, LevelOverride, LevelSuffix, LineNumberRestartFormat, LineRuleType, Math$1 as Math, MathAngledBrackets, MathBorderBox, MathBox, MathCurlyBrackets, MathDegree, MathDenominator, MathEqArr, MathFraction, MathFunction, MathFunctionName, MathGroupChr, MathIntegral, MathLimit, MathLimitLower, MathLimitUpper, MathMatrix, MathNumerator, MathParagraph, MathPhant, MathPreSubSuperScript, MathRadical, MathRadicalProperties, MathRoundBrackets, MathRun, MathSquareBrackets, MathSubScript, MathSubSuperScript, MathSum, MathSuperScript, Media, MonthLong, MonthShort, MoveFromRangeEnd, MoveFromRangeStart, MoveToRangeEnd, MoveToRangeStart, MovedFromTextRun, MovedToTextRun, NoBreakHyphen, NumberFormat, NumberProperties, NumberedItemReference, NumberedItemReferenceFormat, Numbering, ObjectElement, OverlapType, Packer, PageBorderDisplay, PageBorderOffsetFrom, PageBorderZOrder, PageBorders, PageBreak, PageBreakBefore, PageNumber, PageNumberElement, PageNumberSeparator, PageOrientation, PageReference, PageTextDirection, PageTextDirectionType, Paragraph, ParagraphProperties, ParagraphPropertiesChange, ParagraphPropertiesDefaults, ParagraphRunProperties, PatchType, PermEnd, PermStart, PositionalTab, PositionalTabAlignment, PositionalTabLeader, PositionalTabRelativeTo, ProofError, ProofErrorType, RelativeHorizontalPosition, RelativeVerticalPosition, RubyAlign, Run, RunProperties, RunPropertiesChange, RunPropertiesDefaults, STYLE_CATEGORIES, SdtDateMappingType, SdtLock, SectionProperties, SectionPropertiesChange, SectionType, Separator, SequentialIdentifier, ShadingType, SimpleField, SimpleMailMergeField, SmartArtCollection, SmartArtRun, SmartTagRun, SoftHyphen, SpaceType, StructuredDocumentTagBlock, StructuredDocumentTagCell, StructuredDocumentTagContent, StructuredDocumentTagProperties, StructuredDocumentTagRow, StructuredDocumentTagRun, StyleForCharacter, StyleForParagraph, StyleLevel, Styles, SubDoc, SubDocCollection, SymbolRun, TDirection, Tab, TabStopPosition, TabStopType, Table, TableAnchorType, TableBorders, TableCell, TableCellBorders, TableLayoutType, TableOfContents, TableProperties, TablePropertyExceptions, TableRow, TableRowProperties, TableRowPropertiesChange, TextAlignmentType, TextBodyWrappingType, TextDirection, TextEffect, TextHorzOverflowType, TextRun, TextVertOverflowType, TextVerticalType, TextWrappingSide, TextWrappingType, Textbox, TextboxTightWrapType, ThematicBreak, UnderlineType, VerticalAlignSection, VerticalAlignTable, VerticalAnchor, VerticalMerge, VerticalMergeRevisionType, VerticalMergeType, VerticalPositionAlign, VerticalPositionRelativeFrom, WORKAROUND2, WORKAROUND4, WidthType, WpgGroupRun, WpsShapeRun, XmlComponent, YearLong, YearShort, abstractNumUniqueNumericIdGen, attrObj, bookmarkUniqueNumericIdGen, buildBorderObj, buildCellMergeObj, buildCnfStyleObj, buildDeletedTableCellObj, buildDeletedTableRowObj, buildDivIdObj, buildDocumentAttributes, buildEmphasisMarkObj, buildFramePropertiesObj, buildGridSpan, buildIndentObj, buildInsertedTableCellObj, buildInsertedTableRowObj, buildNumberProperties, buildOutlineLevelObj, buildParagraphBorders, buildParagraphProperties, buildRunFontsObj, buildRunProperties, buildShadingObj, buildSpacingObj, buildTabStopObj, buildTableBorders, buildTableCellBorders, buildTableFloatPropertiesObj, buildTableProperties, buildTableRowProperties, buildTableRowPropertiesChangeObj, buildTableWidthObj, buildTextDirection, buildThematicBreakObj, buildUnderlineObj, buildVerticalMerge, chartAttr, coerceMathJson, coerceSectionChild, concreteNumUniqueNumericIdGen, convertInchesToTwip, convertMillimetersToTwip, convertToXmlComponent, createAlignment, createBodyProperties, createBorderElement, createBreak, createCnfStyle, createColumns, createDataModel, createDivId, createDocumentGrid, createDotEmphasisMark, createEmphasisMark, createFormFieldData, createFrameProperties, createHeaderFooterReference, createHorizontalPosition, createIndent, createLineNumberType, createMathAccent, createMathAccentCharacter, createMathAccentProperties, createMathBar, createMathBarProperties, createMathBase, createMathBorderBoxProperties, createMathBoxProperties, createMathControlProperties, createMathEqArrProperties, createMathFractionProperties, createMathFunctionProperties, createMathGroupChrProperties, createMathLimitLocation, createMathLimitLowProperties, createMathLimitUpperProperties, createMathMatrixProperties, createMathNAryProperties, createMathPhantProperties, createMathPreSubSuperScriptProperties, createMathProperties, createMathRunProperties, createMathSubScriptElement, createMathSubScriptProperties, createMathSubSuperScriptProperties, createMathSuperScriptElement, createMathSuperScriptProperties, createOutlineLevel, createPageMargin, createPageNumberType, createPageSize, createParagraphStyle, createRuby, createRunFonts, createSectionType, createShading, createSimplePos, createSpacing, createStringElement, createTabStop, createTabStopItem, createTableFloatProperties, createTableLayout, createTableLook, createTableOverlap, createTableRowHeight, createTableWidthElement, createTransformation, createUnderline, createVerticalAlign, createVerticalPosition, createWrapNone, createWrapSquare, createWrapThrough, createWrapTight, createWrapTopAndBottom, docPropertiesUniqueNumericIdGen, getColorXml, getLayoutXml, getStyleXml, hashedId, hpsMeasureObj, numberValObj, onOffObj, parseArchive, parseDocument, parseDocx, parseMathChildren, patchDetector, patchDocument, sectionMarginDefaults, sectionPageSizeDefaults, stringContainerObj, stringEnumValObj, stringValObj, uniqueId, uniqueNumericIdCreator, uniqueUuid, wrapEl };
|
|
17982
19617
|
|
|
17983
19618
|
//# sourceMappingURL=index.mjs.map
|