@office-open/docx 0.7.1 → 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 +749 -89
- package/dist/index.d.mts.map +1 -1
- package/dist/index.mjs +2223 -587
- package/dist/index.mjs.map +1 -1
- package/package.json +4 -4
package/dist/index.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
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, toUint8Array, 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
4
|
import { PresetGeometry, buildFill, createBlipFill, createCustomGeometry, createEffectDag, createEffectList, createOutline, createScene3D, createShape3D, createTransform2D, extractBlipFillMedia } from "@office-open/core/drawingml";
|
|
5
5
|
import { ChartCollection, ChartSpace } from "@office-open/core/chart";
|
|
@@ -212,6 +212,7 @@ function buildParagraphBorders(options) {
|
|
|
212
212
|
if (options.bottom) children.push(buildBorderObj("w:bottom", options.bottom));
|
|
213
213
|
if (options.right) children.push(buildBorderObj("w:right", options.right));
|
|
214
214
|
if (options.between) children.push(buildBorderObj("w:between", options.between));
|
|
215
|
+
if (options.bar) children.push(buildBorderObj("w:bar", options.bar));
|
|
215
216
|
return children.length > 0 ? { "w:pBdr": children } : void 0;
|
|
216
217
|
}
|
|
217
218
|
/**
|
|
@@ -237,6 +238,7 @@ var init_border = __esmMin((() => {
|
|
|
237
238
|
if (options.bottom) this.root.push(createBorderElement("w:bottom", options.bottom));
|
|
238
239
|
if (options.right) this.root.push(createBorderElement("w:right", options.right));
|
|
239
240
|
if (options.between) this.root.push(createBorderElement("w:between", options.between));
|
|
241
|
+
if (options.bar) this.root.push(createBorderElement("w:bar", options.bar));
|
|
240
242
|
}
|
|
241
243
|
};
|
|
242
244
|
ThematicBreak = class extends XmlComponent {
|
|
@@ -587,8 +589,9 @@ var init_field = __esmMin((() => {
|
|
|
587
589
|
END: "end",
|
|
588
590
|
SEPARATE: "separate"
|
|
589
591
|
};
|
|
590
|
-
createFieldChar = (type, dirty, ffData) => {
|
|
592
|
+
createFieldChar = (type, dirty, ffData, fldData, fieldLock) => {
|
|
591
593
|
const children = [];
|
|
594
|
+
if (fldData !== void 0) children.push({ "w:fldData": [{ _attr: { "xml:space": "preserve" } }, fldData] });
|
|
592
595
|
if (ffData) children.push(ffData);
|
|
593
596
|
return new BuilderElement({
|
|
594
597
|
attributes: {
|
|
@@ -596,6 +599,10 @@ var init_field = __esmMin((() => {
|
|
|
596
599
|
key: "w:dirty",
|
|
597
600
|
value: dirty
|
|
598
601
|
},
|
|
602
|
+
fieldLock: {
|
|
603
|
+
key: "w:fldLock",
|
|
604
|
+
value: fieldLock
|
|
605
|
+
},
|
|
599
606
|
type: {
|
|
600
607
|
key: "w:fldCharType",
|
|
601
608
|
value: type
|
|
@@ -605,7 +612,7 @@ var init_field = __esmMin((() => {
|
|
|
605
612
|
name: "w:fldChar"
|
|
606
613
|
});
|
|
607
614
|
};
|
|
608
|
-
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);
|
|
609
616
|
createSeparate = (dirty) => createFieldChar(FieldCharacterType.SEPARATE, dirty);
|
|
610
617
|
createEnd = (dirty) => createFieldChar(FieldCharacterType.END, dirty);
|
|
611
618
|
}));
|
|
@@ -1018,7 +1025,7 @@ var init_underline = __esmMin((() => {
|
|
|
1018
1025
|
//#region src/file/paragraph/run/properties.ts
|
|
1019
1026
|
/**
|
|
1020
1027
|
* Build run properties (w:rPr) as IXmlableObject without allocating XmlComponent tree.
|
|
1021
|
-
* Used by Run.
|
|
1028
|
+
* Used by Run.toXml for O(1) construction.
|
|
1022
1029
|
*/
|
|
1023
1030
|
function buildRunProperties(options) {
|
|
1024
1031
|
if (!options) return void 0;
|
|
@@ -1069,6 +1076,7 @@ function buildRunProperties(options) {
|
|
|
1069
1076
|
if (options.fitText !== void 0) children.push(numberValObj$1("w:fitText", options.fitText));
|
|
1070
1077
|
if (options.complexScript !== void 0) children.push(onOffObj$1("w:cs", options.complexScript));
|
|
1071
1078
|
if (options.eastAsianLayout) children.push(buildEastAsianLayoutObj(options.eastAsianLayout));
|
|
1079
|
+
if (options.contentPartRId) children.push({ "w:contentPart": { _attr: { "r:id": options.contentPartRId } } });
|
|
1072
1080
|
if (options.revision) {
|
|
1073
1081
|
const rev = options.revision;
|
|
1074
1082
|
const { author: _, date: __, id: ___, ...originalProps } = rev;
|
|
@@ -1339,7 +1347,7 @@ var init_run$1 = __esmMin((() => {
|
|
|
1339
1347
|
constructor(options) {
|
|
1340
1348
|
super("w:r");
|
|
1341
1349
|
this.options = options;
|
|
1342
|
-
if (!options.children && !options.break) {
|
|
1350
|
+
if (!options.children && !options.break && !options.rsidRPr && !options.rsidDel) {
|
|
1343
1351
|
const rPr = buildRunProperties(options);
|
|
1344
1352
|
const text = options.text !== void 0 ? buildText(options.text) : void 0;
|
|
1345
1353
|
if (rPr || text) {
|
|
@@ -1350,64 +1358,67 @@ var init_run$1 = __esmMin((() => {
|
|
|
1350
1358
|
}
|
|
1351
1359
|
}
|
|
1352
1360
|
}
|
|
1353
|
-
|
|
1354
|
-
|
|
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 = [];
|
|
1355
1370
|
const rPr = buildRunProperties(this.options);
|
|
1356
|
-
|
|
1357
|
-
if (
|
|
1358
|
-
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));
|
|
1359
1373
|
if (this.options.children) for (const child of this.options.children) {
|
|
1360
1374
|
if (typeof child === "string") {
|
|
1361
1375
|
switch (child) {
|
|
1362
1376
|
case PageNumber.CURRENT:
|
|
1363
|
-
|
|
1364
|
-
|
|
1365
|
-
|
|
1366
|
-
|
|
1377
|
+
parts.push(createBegin().toXml(context));
|
|
1378
|
+
parts.push(xml(buildPage()));
|
|
1379
|
+
parts.push(createSeparate().toXml(context));
|
|
1380
|
+
parts.push(createEnd().toXml(context));
|
|
1367
1381
|
break;
|
|
1368
1382
|
case PageNumber.TOTAL_PAGES:
|
|
1369
|
-
|
|
1370
|
-
|
|
1371
|
-
|
|
1372
|
-
|
|
1383
|
+
parts.push(createBegin().toXml(context));
|
|
1384
|
+
parts.push(xml(buildNumberOfPages()));
|
|
1385
|
+
parts.push(createSeparate().toXml(context));
|
|
1386
|
+
parts.push(createEnd().toXml(context));
|
|
1373
1387
|
break;
|
|
1374
1388
|
case PageNumber.TOTAL_PAGES_IN_SECTION:
|
|
1375
|
-
|
|
1376
|
-
|
|
1377
|
-
|
|
1378
|
-
|
|
1389
|
+
parts.push(createBegin().toXml(context));
|
|
1390
|
+
parts.push(xml(buildNumberOfPagesSection()));
|
|
1391
|
+
parts.push(createSeparate().toXml(context));
|
|
1392
|
+
parts.push(createEnd().toXml(context));
|
|
1379
1393
|
break;
|
|
1380
1394
|
case PageNumber.CURRENT_SECTION:
|
|
1381
|
-
|
|
1382
|
-
|
|
1383
|
-
|
|
1384
|
-
|
|
1395
|
+
parts.push(createBegin().toXml(context));
|
|
1396
|
+
parts.push(xml(buildCurrentSection()));
|
|
1397
|
+
parts.push(createSeparate().toXml(context));
|
|
1398
|
+
parts.push(createEnd().toXml(context));
|
|
1385
1399
|
break;
|
|
1386
1400
|
default:
|
|
1387
|
-
|
|
1401
|
+
parts.push(xml(buildText(child)));
|
|
1388
1402
|
break;
|
|
1389
1403
|
}
|
|
1390
1404
|
continue;
|
|
1391
1405
|
}
|
|
1392
1406
|
if (child instanceof BaseXmlComponent) {
|
|
1393
|
-
const
|
|
1394
|
-
if (
|
|
1395
|
-
} else
|
|
1407
|
+
const s = child.toXml(context);
|
|
1408
|
+
if (s) parts.push(s);
|
|
1409
|
+
} else parts.push(xml(child));
|
|
1396
1410
|
}
|
|
1397
|
-
else if (this.options.text !== void 0)
|
|
1411
|
+
else if (this.options.text !== void 0) parts.push(xml(buildText(this.options.text)));
|
|
1398
1412
|
for (const child of this.extraChildren) if (child instanceof BaseXmlComponent) {
|
|
1399
|
-
const
|
|
1400
|
-
if (
|
|
1401
|
-
} else
|
|
1402
|
-
|
|
1403
|
-
|
|
1404
|
-
|
|
1405
|
-
|
|
1406
|
-
|
|
1407
|
-
|
|
1408
|
-
if (this._prebuilt && this.extraChildren.length === 0) return xml(this._prebuilt);
|
|
1409
|
-
const obj = this.prepForXml(context);
|
|
1410
|
-
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>`;
|
|
1411
1422
|
}
|
|
1412
1423
|
};
|
|
1413
1424
|
}));
|
|
@@ -3043,10 +3054,9 @@ var init_image_run = __esmMin((() => {
|
|
|
3043
3054
|
});
|
|
3044
3055
|
this.extraChildren.push(drawing);
|
|
3045
3056
|
}
|
|
3046
|
-
|
|
3057
|
+
registerResources(context) {
|
|
3047
3058
|
context.file.media.addImage(this.imageData.fileName, this.imageData);
|
|
3048
3059
|
if (this.imageData.type === "svg") context.file.media.addImage(this.imageData.fallback.fileName, this.imageData.fallback);
|
|
3049
|
-
return super.prepForXml(context);
|
|
3050
3060
|
}
|
|
3051
3061
|
};
|
|
3052
3062
|
}));
|
|
@@ -3079,7 +3089,7 @@ var init_chart_run = __esmMin((() => {
|
|
|
3079
3089
|
});
|
|
3080
3090
|
this.extraChildren.push(drawing);
|
|
3081
3091
|
}
|
|
3082
|
-
|
|
3092
|
+
registerResources(context) {
|
|
3083
3093
|
const chartSpace = new ChartSpace({
|
|
3084
3094
|
categories: this.chartOptions.data.categories,
|
|
3085
3095
|
series: this.chartOptions.data.series,
|
|
@@ -3093,7 +3103,6 @@ var init_chart_run = __esmMin((() => {
|
|
|
3093
3103
|
chartSpace,
|
|
3094
3104
|
key: this.chartKey
|
|
3095
3105
|
});
|
|
3096
|
-
return super.prepForXml(context);
|
|
3097
3106
|
}
|
|
3098
3107
|
};
|
|
3099
3108
|
}));
|
|
@@ -3126,7 +3135,7 @@ var init_smartart_run = __esmMin((() => {
|
|
|
3126
3135
|
});
|
|
3127
3136
|
this.extraChildren.push(drawing);
|
|
3128
3137
|
}
|
|
3129
|
-
|
|
3138
|
+
registerResources(context) {
|
|
3130
3139
|
const layoutId = this.smartArtOptions.layout ?? "default";
|
|
3131
3140
|
const styleId = this.smartArtOptions.style ?? "simple1";
|
|
3132
3141
|
const colorId = this.smartArtOptions.color ?? "accent1_2";
|
|
@@ -3138,7 +3147,6 @@ var init_smartart_run = __esmMin((() => {
|
|
|
3138
3147
|
color: colorId
|
|
3139
3148
|
};
|
|
3140
3149
|
context.file.smartArts.addSmartArt(this.smartArtKey, smartArtData);
|
|
3141
|
-
return super.prepForXml(context);
|
|
3142
3150
|
}
|
|
3143
3151
|
hashSmartArtData(options) {
|
|
3144
3152
|
const data = JSON.stringify(options.data);
|
|
@@ -3203,12 +3211,11 @@ var init_wpg_group_run = __esmMin((() => {
|
|
|
3203
3211
|
this.mediaDatas = options.children.filter((child) => child.type !== "wps").map((child) => child);
|
|
3204
3212
|
this.extraChildren.push(drawing);
|
|
3205
3213
|
}
|
|
3206
|
-
|
|
3214
|
+
registerResources(context) {
|
|
3207
3215
|
for (const child of this.mediaDatas) {
|
|
3208
3216
|
context.file.media.addImage(child.fileName, child);
|
|
3209
3217
|
if (child.type === "svg") context.file.media.addImage(child.fallback.fileName, child.fallback);
|
|
3210
3218
|
}
|
|
3211
|
-
return super.prepForXml(context);
|
|
3212
3219
|
}
|
|
3213
3220
|
};
|
|
3214
3221
|
}));
|
|
@@ -3613,18 +3620,22 @@ var init_bookmark = __esmMin((() => {
|
|
|
3613
3620
|
}
|
|
3614
3621
|
};
|
|
3615
3622
|
BookmarkStart = class extends XmlComponent {
|
|
3616
|
-
constructor(id, linkId) {
|
|
3623
|
+
constructor(id, linkId, displacedByCustomXml) {
|
|
3617
3624
|
super("w:bookmarkStart");
|
|
3618
|
-
|
|
3625
|
+
const attrs = {
|
|
3619
3626
|
"w:id": linkId,
|
|
3620
3627
|
"w:name": id
|
|
3621
|
-
}
|
|
3628
|
+
};
|
|
3629
|
+
if (displacedByCustomXml !== void 0) attrs["w:displacedByCustomXml"] = displacedByCustomXml;
|
|
3630
|
+
this.root.push({ _attr: attrs });
|
|
3622
3631
|
}
|
|
3623
3632
|
};
|
|
3624
3633
|
BookmarkEnd = class extends XmlComponent {
|
|
3625
|
-
constructor(linkId) {
|
|
3634
|
+
constructor(linkId, displacedByCustomXml) {
|
|
3626
3635
|
super("w:bookmarkEnd");
|
|
3627
|
-
|
|
3636
|
+
const attrs = { "w:id": linkId };
|
|
3637
|
+
if (displacedByCustomXml !== void 0) attrs["w:displacedByCustomXml"] = displacedByCustomXml;
|
|
3638
|
+
this.root.push({ _attr: attrs });
|
|
3628
3639
|
}
|
|
3629
3640
|
};
|
|
3630
3641
|
}));
|
|
@@ -3809,13 +3820,32 @@ var init_math_accent_character = __esmMin((() => {
|
|
|
3809
3820
|
}));
|
|
3810
3821
|
//#endregion
|
|
3811
3822
|
//#region src/file/paragraph/math/n-ary/math-base.ts
|
|
3812
|
-
var createMathBase;
|
|
3823
|
+
var createMathArgProperties, createMathBase;
|
|
3813
3824
|
var init_math_base = __esmMin((() => {
|
|
3814
3825
|
init_xml_components();
|
|
3815
|
-
|
|
3816
|
-
children
|
|
3817
|
-
|
|
3818
|
-
|
|
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
|
+
};
|
|
3819
3849
|
}));
|
|
3820
3850
|
//#endregion
|
|
3821
3851
|
//#region src/file/paragraph/math/n-ary/math-limit-location.ts
|
|
@@ -4717,6 +4747,33 @@ var init_math_matrix_properties = __esmMin((() => {
|
|
|
4717
4747
|
} },
|
|
4718
4748
|
name: "m:cGp"
|
|
4719
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
|
+
}));
|
|
4720
4777
|
return new BuilderElement({
|
|
4721
4778
|
children,
|
|
4722
4779
|
name: "m:mPr"
|
|
@@ -5820,17 +5877,28 @@ MAX: 9026 };
|
|
|
5820
5877
|
/**
|
|
5821
5878
|
* Build numbering properties (w:numPr) as IXmlableObject without allocating XmlComponent tree.
|
|
5822
5879
|
*/
|
|
5823
|
-
function buildNumberProperties(numberId, indentLevel) {
|
|
5824
|
-
|
|
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 };
|
|
5825
5892
|
}
|
|
5826
|
-
var NumberProperties, IndentLevel, NumberId;
|
|
5893
|
+
var NumberProperties, IndentLevel, NumberId, NumberingChange;
|
|
5827
5894
|
var init_unordered_list = __esmMin((() => {
|
|
5828
5895
|
init_xml_components();
|
|
5829
5896
|
NumberProperties = class extends XmlComponent {
|
|
5830
|
-
constructor(numberId, indentLevel) {
|
|
5897
|
+
constructor(numberId, indentLevel, numberingChange) {
|
|
5831
5898
|
super("w:numPr");
|
|
5832
5899
|
this.root.push(new IndentLevel(indentLevel));
|
|
5833
5900
|
this.root.push(new NumberId(numberId));
|
|
5901
|
+
if (numberingChange) this.root.push(new NumberingChange(numberingChange));
|
|
5834
5902
|
}
|
|
5835
5903
|
};
|
|
5836
5904
|
IndentLevel = class extends XmlComponent {
|
|
@@ -5845,6 +5913,18 @@ var init_unordered_list = __esmMin((() => {
|
|
|
5845
5913
|
this.root.push({ _attr: { "w:val": typeof id === "string" ? `{${id}}` : id } });
|
|
5846
5914
|
}
|
|
5847
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
|
+
};
|
|
5848
5928
|
}));
|
|
5849
5929
|
//#endregion
|
|
5850
5930
|
//#region src/file/paragraph/formatting/word-wrap.ts
|
|
@@ -6010,7 +6090,7 @@ function buildParagraphProperties(options) {
|
|
|
6010
6090
|
instance: options.numbering.instance ?? 0,
|
|
6011
6091
|
reference: options.numbering.reference
|
|
6012
6092
|
});
|
|
6013
|
-
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));
|
|
6014
6094
|
} else if (options.numbering === false) children.push(buildNumberProperties(0, 0));
|
|
6015
6095
|
if (options.border) {
|
|
6016
6096
|
const border = buildParagraphBorders(options.border);
|
|
@@ -6162,7 +6242,7 @@ var init_properties = __esmMin((() => {
|
|
|
6162
6242
|
instance: options.numbering.instance ?? 0,
|
|
6163
6243
|
reference: options.numbering.reference
|
|
6164
6244
|
});
|
|
6165
|
-
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));
|
|
6166
6246
|
} else if (options.numbering === false) this.root.push(new NumberProperties(0, 0));
|
|
6167
6247
|
if (options.border) this.root.push(new Border(options.border));
|
|
6168
6248
|
if (options.thematicBreak) this.root.push(new ThematicBreak());
|
|
@@ -6313,13 +6393,18 @@ var init_paragraph$1 = __esmMin((() => {
|
|
|
6313
6393
|
toXml(context) {
|
|
6314
6394
|
const parts = [];
|
|
6315
6395
|
if (!(context.viewWrapper instanceof FontWrapper)) for (const reference of this._props.numberingReferences) context.file.numbering.createConcreteNumberingInstance(reference.reference, reference.instance);
|
|
6316
|
-
|
|
6317
|
-
if (this.sectionProperties) {
|
|
6318
|
-
const
|
|
6319
|
-
if (
|
|
6320
|
-
|
|
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>");
|
|
6321
6407
|
}
|
|
6322
|
-
if (finalPPrObj) parts.push(xml(finalPPrObj));
|
|
6323
6408
|
for (const run of this.frontRuns) {
|
|
6324
6409
|
const s = run.toXml(context);
|
|
6325
6410
|
if (s) parts.push(s);
|
|
@@ -6332,7 +6417,14 @@ var init_paragraph$1 = __esmMin((() => {
|
|
|
6332
6417
|
for (const rawChild of this.options.children) for (const s of this.serializeChild(rawChild, context)) if (s) parts.push(s);
|
|
6333
6418
|
}
|
|
6334
6419
|
const body = parts.join("");
|
|
6335
|
-
|
|
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/>";
|
|
6336
6428
|
}
|
|
6337
6429
|
/**
|
|
6338
6430
|
* Serialize a single child element, handling all type coercions and side effects.
|
|
@@ -6702,6 +6794,143 @@ var init_ruby = __esmMin((() => {
|
|
|
6702
6794
|
};
|
|
6703
6795
|
}));
|
|
6704
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
|
|
6705
6934
|
//#region src/file/paragraph/run/index.ts
|
|
6706
6935
|
var init_run = __esmMin((() => {
|
|
6707
6936
|
init_run$1();
|
|
@@ -6724,6 +6953,9 @@ var init_run = __esmMin((() => {
|
|
|
6724
6953
|
init_ruby();
|
|
6725
6954
|
init_form_field();
|
|
6726
6955
|
init_break$1();
|
|
6956
|
+
init_smart_tag_run();
|
|
6957
|
+
init_proof_error();
|
|
6958
|
+
init_custom_xml_range();
|
|
6727
6959
|
}));
|
|
6728
6960
|
//#endregion
|
|
6729
6961
|
//#region src/file/paragraph/formatting/break.ts
|
|
@@ -6836,61 +7068,310 @@ var init_alt_chunk = __esmMin((() => {
|
|
|
6836
7068
|
};
|
|
6837
7069
|
}));
|
|
6838
7070
|
//#endregion
|
|
6839
|
-
//#region src/file/
|
|
6840
|
-
var
|
|
6841
|
-
var
|
|
6842
|
-
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((() => {
|
|
6843
7074
|
init_xml_components();
|
|
6844
|
-
|
|
6845
|
-
|
|
6846
|
-
|
|
6847
|
-
|
|
6848
|
-
|
|
6849
|
-
|
|
6850
|
-
|
|
6851
|
-
|
|
6852
|
-
|
|
6853
|
-
|
|
6854
|
-
|
|
6855
|
-
|
|
6856
|
-
|
|
6857
|
-
|
|
6858
|
-
|
|
6859
|
-
|
|
6860
|
-
|
|
6861
|
-
|
|
6862
|
-
|
|
6863
|
-
|
|
6864
|
-
|
|
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);
|
|
6865
7134
|
}
|
|
6866
|
-
if (this.
|
|
6867
|
-
if (
|
|
6868
|
-
|
|
6869
|
-
|
|
6870
|
-
|
|
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());
|
|
6871
7146
|
}
|
|
6872
7147
|
};
|
|
6873
7148
|
}));
|
|
6874
7149
|
//#endregion
|
|
6875
|
-
//#region src/file/
|
|
6876
|
-
|
|
6877
|
-
|
|
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((() => {
|
|
6878
7160
|
init_xml_components();
|
|
6879
|
-
|
|
6880
|
-
constructor() {
|
|
6881
|
-
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
|
+
} });
|
|
6882
7169
|
}
|
|
6883
7170
|
};
|
|
6884
7171
|
}));
|
|
6885
7172
|
//#endregion
|
|
6886
|
-
//#region src/file/
|
|
6887
|
-
|
|
6888
|
-
|
|
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((() => {
|
|
6889
7183
|
init_xml_components();
|
|
6890
|
-
|
|
6891
|
-
|
|
6892
|
-
|
|
6893
|
-
|
|
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) */
|
|
6894
7375
|
CONTENT_LOCKED: "contentLocked",
|
|
6895
7376
|
/** No locking */
|
|
6896
7377
|
UNLOCKED: "unlocked",
|
|
@@ -7168,14 +7649,24 @@ var init_table_of_contents = __esmMin((() => {
|
|
|
7168
7649
|
}));
|
|
7169
7650
|
//#endregion
|
|
7170
7651
|
//#region src/file/sdt/sdt.ts
|
|
7171
|
-
var StructuredDocumentTagRun, StructuredDocumentTagBlock;
|
|
7652
|
+
var StructuredDocumentTagEndProperties, StructuredDocumentTagRun, StructuredDocumentTagBlock;
|
|
7172
7653
|
var init_sdt$1 = __esmMin((() => {
|
|
7173
7654
|
init_xml_components();
|
|
7174
7655
|
init_table_of_contents();
|
|
7656
|
+
StructuredDocumentTagEndProperties = class extends XmlComponent {
|
|
7657
|
+
constructor() {
|
|
7658
|
+
super("w:sdtEndPr");
|
|
7659
|
+
}
|
|
7660
|
+
};
|
|
7175
7661
|
StructuredDocumentTagRun = class extends XmlComponent {
|
|
7176
7662
|
constructor(options) {
|
|
7177
7663
|
super("w:sdt");
|
|
7178
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
|
+
}
|
|
7179
7670
|
if (options.children && options.children.length > 0) {
|
|
7180
7671
|
const content = new StructuredDocumentTagContent();
|
|
7181
7672
|
for (const child of options.children) content.addChildElement(child);
|
|
@@ -7188,6 +7679,11 @@ var init_sdt$1 = __esmMin((() => {
|
|
|
7188
7679
|
constructor(options) {
|
|
7189
7680
|
super("w:sdt");
|
|
7190
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
|
+
}
|
|
7191
7687
|
if (options.children && options.children.length > 0) {
|
|
7192
7688
|
const content = new StructuredDocumentTagContent();
|
|
7193
7689
|
for (const child of options.children) content.addChildElement(child);
|
|
@@ -7197,37 +7693,6 @@ var init_sdt$1 = __esmMin((() => {
|
|
|
7197
7693
|
};
|
|
7198
7694
|
}));
|
|
7199
7695
|
//#endregion
|
|
7200
|
-
//#region src/file/sub-doc/sub-doc.ts
|
|
7201
|
-
var SUBDOC_RELATIONSHIP_TYPE, SubDoc;
|
|
7202
|
-
var init_sub_doc = __esmMin((() => {
|
|
7203
|
-
init_xml_components();
|
|
7204
|
-
init_convenience_functions();
|
|
7205
|
-
SUBDOC_RELATIONSHIP_TYPE = "http://schemas.openxmlformats.org/officeDocument/2006/relationships/subDocument";
|
|
7206
|
-
SubDoc = class extends XmlComponent {
|
|
7207
|
-
fileChild = Symbol();
|
|
7208
|
-
options;
|
|
7209
|
-
constructor(options) {
|
|
7210
|
-
super("w:subDoc");
|
|
7211
|
-
this.options = options;
|
|
7212
|
-
}
|
|
7213
|
-
toXml(context) {
|
|
7214
|
-
const relId = uniqueId();
|
|
7215
|
-
const partPath = `subdocs/subdoc${relId}.docx`;
|
|
7216
|
-
const data = typeof this.options.data === "string" ? new TextEncoder().encode(this.options.data) : this.options.data;
|
|
7217
|
-
context.viewWrapper.relationships.addRelationship(relId, SUBDOC_RELATIONSHIP_TYPE, partPath);
|
|
7218
|
-
context.file.subDocs.addSubDoc(relId, {
|
|
7219
|
-
data,
|
|
7220
|
-
path: partPath
|
|
7221
|
-
});
|
|
7222
|
-
context.file.contentTypes.addSubDoc(`/word/${partPath}`);
|
|
7223
|
-
this.root.splice(0, 0, { _attr: { "r:id": `rId${relId}` } });
|
|
7224
|
-
const result = super.toXml(context);
|
|
7225
|
-
this.root.splice(0, 1);
|
|
7226
|
-
return result;
|
|
7227
|
-
}
|
|
7228
|
-
};
|
|
7229
|
-
}));
|
|
7230
|
-
//#endregion
|
|
7231
7696
|
//#region src/file/sdt/sdt-cell.ts
|
|
7232
7697
|
var StructuredDocumentTagCell;
|
|
7233
7698
|
var init_sdt_cell = __esmMin((() => {
|
|
@@ -7248,253 +7713,69 @@ var init_sdt_cell = __esmMin((() => {
|
|
|
7248
7713
|
};
|
|
7249
7714
|
}));
|
|
7250
7715
|
//#endregion
|
|
7251
|
-
//#region src/file/
|
|
7252
|
-
var
|
|
7253
|
-
var
|
|
7716
|
+
//#region src/file/sdt/sdt-row.ts
|
|
7717
|
+
var StructuredDocumentTagRow;
|
|
7718
|
+
var init_sdt_row = __esmMin((() => {
|
|
7254
7719
|
init_xml_components();
|
|
7255
|
-
|
|
7256
|
-
|
|
7257
|
-
|
|
7258
|
-
|
|
7259
|
-
init_text();
|
|
7260
|
-
MovedFromTextRun = class extends XmlComponent {
|
|
7261
|
-
constructor(options) {
|
|
7262
|
-
super("w:moveFrom");
|
|
7263
|
-
this.root.push({ _attr: {
|
|
7264
|
-
"w:author": options.author,
|
|
7265
|
-
"w:date": options.date,
|
|
7266
|
-
"w:id": options.id
|
|
7267
|
-
} });
|
|
7268
|
-
this.addChildElement(new MovedFromRunWrapper(options));
|
|
7269
|
-
}
|
|
7270
|
-
};
|
|
7271
|
-
MovedToTextRun = class extends XmlComponent {
|
|
7272
|
-
constructor(options) {
|
|
7273
|
-
super("w:moveTo");
|
|
7274
|
-
this.root.push({ _attr: {
|
|
7275
|
-
"w:author": options.author,
|
|
7276
|
-
"w:date": options.date,
|
|
7277
|
-
"w:id": options.id
|
|
7278
|
-
} });
|
|
7279
|
-
this.addChildElement(new MovedToRunWrapper(options));
|
|
7280
|
-
}
|
|
7281
|
-
};
|
|
7282
|
-
MovedFromRunWrapper = class extends XmlComponent {
|
|
7720
|
+
init_table_of_contents();
|
|
7721
|
+
init_table_cell();
|
|
7722
|
+
StructuredDocumentTagRow = class extends XmlComponent {
|
|
7723
|
+
rows;
|
|
7283
7724
|
constructor(options) {
|
|
7284
|
-
super("w:
|
|
7285
|
-
this.
|
|
7286
|
-
|
|
7287
|
-
|
|
7288
|
-
|
|
7289
|
-
|
|
7290
|
-
|
|
7291
|
-
this.root.push(buildText("PAGE"));
|
|
7292
|
-
this.root.push(createSeparate());
|
|
7293
|
-
this.root.push(createEnd());
|
|
7294
|
-
break;
|
|
7295
|
-
case PageNumber.TOTAL_PAGES:
|
|
7296
|
-
this.root.push(createBegin());
|
|
7297
|
-
this.root.push(buildText("NUMPAGES"));
|
|
7298
|
-
this.root.push(createSeparate());
|
|
7299
|
-
this.root.push(createEnd());
|
|
7300
|
-
break;
|
|
7301
|
-
case PageNumber.TOTAL_PAGES_IN_SECTION:
|
|
7302
|
-
this.root.push(createBegin());
|
|
7303
|
-
this.root.push(buildText("SECTIONPAGES"));
|
|
7304
|
-
this.root.push(createSeparate());
|
|
7305
|
-
this.root.push(createEnd());
|
|
7306
|
-
break;
|
|
7307
|
-
default:
|
|
7308
|
-
this.root.push(buildText(child));
|
|
7309
|
-
break;
|
|
7310
|
-
}
|
|
7311
|
-
continue;
|
|
7312
|
-
}
|
|
7313
|
-
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);
|
|
7314
7732
|
}
|
|
7315
|
-
else if (options.text) this.root.push(buildText(options.text));
|
|
7316
|
-
if (options.break) for (let i = 0; i < options.break; i++) this.root.splice(1, 0, createBreak());
|
|
7317
|
-
}
|
|
7318
|
-
};
|
|
7319
|
-
MovedToRunWrapper = class extends XmlComponent {
|
|
7320
|
-
constructor(options) {
|
|
7321
|
-
super("w:r");
|
|
7322
|
-
this.root.push(new RunProperties(options));
|
|
7323
|
-
if (options.children) for (const child of options.children) this.root.push(child);
|
|
7324
|
-
else if (options.text) this.root.push(buildText(options.text));
|
|
7325
|
-
if (options.break) for (let i = 0; i < options.break; i++) this.root.splice(1, 0, createBreak());
|
|
7326
|
-
}
|
|
7327
|
-
};
|
|
7328
|
-
}));
|
|
7329
|
-
//#endregion
|
|
7330
|
-
//#region src/file/track-revision/track-revision-components/inserted-table-row.ts
|
|
7331
|
-
function buildInsertedTableRowObj(options) {
|
|
7332
|
-
return { "w:ins": { _attr: {
|
|
7333
|
-
"w:author": options.author,
|
|
7334
|
-
"w:date": options.date,
|
|
7335
|
-
"w:id": options.id
|
|
7336
|
-
} } };
|
|
7337
|
-
}
|
|
7338
|
-
var InsertedTableRow;
|
|
7339
|
-
var init_inserted_table_row = __esmMin((() => {
|
|
7340
|
-
init_xml_components();
|
|
7341
|
-
InsertedTableRow = class extends XmlComponent {
|
|
7342
|
-
constructor(options) {
|
|
7343
|
-
super("w:ins");
|
|
7344
|
-
this.root.push({ _attr: {
|
|
7345
|
-
"w:author": options.author,
|
|
7346
|
-
"w:date": options.date,
|
|
7347
|
-
"w:id": options.id
|
|
7348
|
-
} });
|
|
7349
|
-
}
|
|
7350
|
-
};
|
|
7351
|
-
}));
|
|
7352
|
-
//#endregion
|
|
7353
|
-
//#region src/file/track-revision/track-revision-components/deleted-table-row.ts
|
|
7354
|
-
function buildDeletedTableRowObj(options) {
|
|
7355
|
-
return { "w:del": { _attr: {
|
|
7356
|
-
"w:author": options.author,
|
|
7357
|
-
"w:date": options.date,
|
|
7358
|
-
"w:id": options.id
|
|
7359
|
-
} } };
|
|
7360
|
-
}
|
|
7361
|
-
var DeletedTableRow;
|
|
7362
|
-
var init_deleted_table_row = __esmMin((() => {
|
|
7363
|
-
init_xml_components();
|
|
7364
|
-
DeletedTableRow = class extends XmlComponent {
|
|
7365
|
-
constructor(options) {
|
|
7366
|
-
super("w:del");
|
|
7367
|
-
this.root.push({ _attr: {
|
|
7368
|
-
"w:author": options.author,
|
|
7369
|
-
"w:date": options.date,
|
|
7370
|
-
"w:id": options.id
|
|
7371
|
-
} });
|
|
7372
7733
|
}
|
|
7373
|
-
|
|
7374
|
-
|
|
7375
|
-
//#endregion
|
|
7376
|
-
//#region src/file/track-revision/track-revision-components/inserted-table-cell.ts
|
|
7377
|
-
function buildInsertedTableCellObj(options) {
|
|
7378
|
-
return { "w:cellIns": { _attr: {
|
|
7379
|
-
"w:author": options.author,
|
|
7380
|
-
"w:date": options.date,
|
|
7381
|
-
"w:id": options.id
|
|
7382
|
-
} } };
|
|
7383
|
-
}
|
|
7384
|
-
var InsertedTableCell;
|
|
7385
|
-
var init_inserted_table_cell = __esmMin((() => {
|
|
7386
|
-
init_xml_components();
|
|
7387
|
-
InsertedTableCell = class extends XmlComponent {
|
|
7388
|
-
constructor(options) {
|
|
7389
|
-
super("w:cellIns");
|
|
7390
|
-
this.root.push({ _attr: {
|
|
7391
|
-
"w:author": options.author,
|
|
7392
|
-
"w:date": options.date,
|
|
7393
|
-
"w:id": options.id
|
|
7394
|
-
} });
|
|
7734
|
+
get cellCount() {
|
|
7735
|
+
return Math.max(...this.rows.map((r) => r.cellCount), 0);
|
|
7395
7736
|
}
|
|
7396
|
-
|
|
7397
|
-
|
|
7398
|
-
//#endregion
|
|
7399
|
-
//#region src/file/track-revision/track-revision-components/deleted-table-cell.ts
|
|
7400
|
-
function buildDeletedTableCellObj(options) {
|
|
7401
|
-
return { "w:cellDel": { _attr: {
|
|
7402
|
-
"w:author": options.author,
|
|
7403
|
-
"w:date": options.date,
|
|
7404
|
-
"w:id": options.id
|
|
7405
|
-
} } };
|
|
7406
|
-
}
|
|
7407
|
-
var DeletedTableCell;
|
|
7408
|
-
var init_deleted_table_cell = __esmMin((() => {
|
|
7409
|
-
init_xml_components();
|
|
7410
|
-
DeletedTableCell = class extends XmlComponent {
|
|
7411
|
-
constructor(options) {
|
|
7412
|
-
super("w:cellDel");
|
|
7413
|
-
this.root.push({ _attr: {
|
|
7414
|
-
"w:author": options.author,
|
|
7415
|
-
"w:date": options.date,
|
|
7416
|
-
"w:id": options.id
|
|
7417
|
-
} });
|
|
7737
|
+
get cells() {
|
|
7738
|
+
return this.rows.flatMap((r) => r.cells);
|
|
7418
7739
|
}
|
|
7419
|
-
|
|
7420
|
-
|
|
7421
|
-
//#endregion
|
|
7422
|
-
//#region src/file/track-revision/track-revision-components/cell-merge.ts
|
|
7423
|
-
function buildCellMergeObj(options) {
|
|
7424
|
-
const attrs = {
|
|
7425
|
-
"w:author": options.author,
|
|
7426
|
-
"w:date": options.date,
|
|
7427
|
-
"w:id": options.id
|
|
7428
|
-
};
|
|
7429
|
-
if (options.verticalMerge !== void 0) attrs["w:vMerge"] = xsdVerticalMergeRev.to(options.verticalMerge);
|
|
7430
|
-
if (options.verticalMergeOriginal !== void 0) attrs["w:vMergeOrig"] = xsdVerticalMergeRev.to(options.verticalMergeOriginal);
|
|
7431
|
-
return { "w:cellMerge": { _attr: attrs } };
|
|
7432
|
-
}
|
|
7433
|
-
var VerticalMergeRevisionType, CellMerge;
|
|
7434
|
-
var init_cell_merge = __esmMin((() => {
|
|
7435
|
-
init_xml_components();
|
|
7436
|
-
VerticalMergeRevisionType = {
|
|
7437
|
-
/**
|
|
7438
|
-
* Cell that is merged with upper one.
|
|
7439
|
-
*/
|
|
7440
|
-
CONTINUE: "continue",
|
|
7441
|
-
/**
|
|
7442
|
-
* Cell that is starting the vertical merge.
|
|
7443
|
-
*/
|
|
7444
|
-
RESTART: "restart"
|
|
7445
|
-
};
|
|
7446
|
-
CellMerge = class extends XmlComponent {
|
|
7447
|
-
constructor(options) {
|
|
7448
|
-
super("w:cellMerge");
|
|
7449
|
-
const attrs = {
|
|
7450
|
-
"w:author": options.author,
|
|
7451
|
-
"w:date": options.date,
|
|
7452
|
-
"w:id": options.id
|
|
7453
|
-
};
|
|
7454
|
-
if (options.verticalMerge !== void 0) attrs["w:vMerge"] = xsdVerticalMergeRev.to(options.verticalMerge);
|
|
7455
|
-
if (options.verticalMergeOriginal !== void 0) attrs["w:vMergeOrig"] = xsdVerticalMergeRev.to(options.verticalMergeOriginal);
|
|
7456
|
-
this.root.push({ _attr: attrs });
|
|
7740
|
+
addCellToColumnIndex(cell, columnIndex) {
|
|
7741
|
+
if (this.rows.length > 0) this.rows[0].addCellToColumnIndex(cell, columnIndex);
|
|
7457
7742
|
}
|
|
7458
7743
|
};
|
|
7459
7744
|
}));
|
|
7460
7745
|
//#endregion
|
|
7461
|
-
//#region src/file/
|
|
7462
|
-
var
|
|
7463
|
-
|
|
7464
|
-
|
|
7465
|
-
|
|
7466
|
-
init_inserted_table_row();
|
|
7467
|
-
init_deleted_table_row();
|
|
7468
|
-
init_inserted_table_cell();
|
|
7469
|
-
init_deleted_table_cell();
|
|
7470
|
-
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();
|
|
7471
7751
|
}));
|
|
7472
7752
|
//#endregion
|
|
7473
|
-
//#region src/file/
|
|
7474
|
-
var
|
|
7475
|
-
var
|
|
7753
|
+
//#region src/file/table/grid.ts
|
|
7754
|
+
var createGridCol, TableGrid, TableGridChange;
|
|
7755
|
+
var init_grid = __esmMin((() => {
|
|
7476
7756
|
init_xml_components();
|
|
7477
|
-
|
|
7478
|
-
|
|
7479
|
-
|
|
7480
|
-
|
|
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
|
+
}
|
|
7481
7771
|
};
|
|
7482
|
-
|
|
7483
|
-
|
|
7484
|
-
|
|
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
|
+
}
|
|
7485
7778
|
};
|
|
7486
|
-
createVerticalAlign = (value) => new BuilderElement({
|
|
7487
|
-
attributes: { verticalAlign: {
|
|
7488
|
-
key: "w:val",
|
|
7489
|
-
value
|
|
7490
|
-
} },
|
|
7491
|
-
name: "w:vAlign"
|
|
7492
|
-
});
|
|
7493
|
-
}));
|
|
7494
|
-
//#endregion
|
|
7495
|
-
//#region src/file/vertical-align/index.ts
|
|
7496
|
-
var init_vertical_align = __esmMin((() => {
|
|
7497
|
-
init_vertical_align$1();
|
|
7498
7779
|
}));
|
|
7499
7780
|
//#endregion
|
|
7500
7781
|
//#region src/file/table/table-cell/table-cell-components.ts
|
|
@@ -7543,6 +7824,8 @@ function buildTableCellBorders(options) {
|
|
|
7543
7824
|
if (options.bottom) children.push(buildBorderObj("w:bottom", options.bottom));
|
|
7544
7825
|
if (options.end) children.push(buildBorderObj("w:end", options.end));
|
|
7545
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));
|
|
7546
7829
|
return children.length > 0 ? { "w:tcBorders": children } : void 0;
|
|
7547
7830
|
}
|
|
7548
7831
|
/**
|
|
@@ -7577,6 +7860,8 @@ var init_table_cell_components = __esmMin((() => {
|
|
|
7577
7860
|
if (options.bottom) this.root.push(createBorderElement("w:bottom", options.bottom));
|
|
7578
7861
|
if (options.end) this.root.push(createBorderElement("w:end", options.end));
|
|
7579
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));
|
|
7580
7865
|
}
|
|
7581
7866
|
};
|
|
7582
7867
|
GridSpan = class extends XmlComponent {
|
|
@@ -8063,6 +8348,24 @@ var init_table_property_exceptions = __esmMin((() => {
|
|
|
8063
8348
|
if (cellMargin) this.root.push(cellMargin);
|
|
8064
8349
|
}
|
|
8065
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
|
+
}
|
|
8066
8369
|
}
|
|
8067
8370
|
};
|
|
8068
8371
|
}));
|
|
@@ -8232,6 +8535,7 @@ var init_table_row_properties = __esmMin((() => {
|
|
|
8232
8535
|
var TableRow;
|
|
8233
8536
|
var init_table_row$1 = __esmMin((() => {
|
|
8234
8537
|
init_xml_components();
|
|
8538
|
+
init_custom_xml();
|
|
8235
8539
|
init_sdt();
|
|
8236
8540
|
init_table_cell$1();
|
|
8237
8541
|
init_table_property_exceptions();
|
|
@@ -8243,7 +8547,7 @@ var init_table_row$1 = __esmMin((() => {
|
|
|
8243
8547
|
constructor(options) {
|
|
8244
8548
|
super("w:tr");
|
|
8245
8549
|
this.options = options;
|
|
8246
|
-
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));
|
|
8247
8551
|
}
|
|
8248
8552
|
get cellCount() {
|
|
8249
8553
|
return this.coercedChildren.length;
|
|
@@ -8292,7 +8596,13 @@ var init_table_row$1 = __esmMin((() => {
|
|
|
8292
8596
|
const insertIdx = this.findInsertIndex(columnIndex, prefixCount);
|
|
8293
8597
|
parts.splice(insertIdx, 0, cell.toXml(context));
|
|
8294
8598
|
}
|
|
8295
|
-
|
|
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/>";
|
|
8296
8606
|
}
|
|
8297
8607
|
findInsertIndex(columnIndex, prefixCount) {
|
|
8298
8608
|
let colIdx = 0;
|
|
@@ -8313,9 +8623,79 @@ var init_table_row = __esmMin((() => {
|
|
|
8313
8623
|
init_table_row_height();
|
|
8314
8624
|
}));
|
|
8315
8625
|
//#endregion
|
|
8316
|
-
//#region src/file/table/
|
|
8626
|
+
//#region src/file/table/table.ts
|
|
8627
|
+
var Table;
|
|
8317
8628
|
var init_table$1 = __esmMin((() => {
|
|
8318
|
-
|
|
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();
|
|
8319
8699
|
init_table_cell$1();
|
|
8320
8700
|
init_table_properties();
|
|
8321
8701
|
init_table_row();
|
|
@@ -8325,7 +8705,7 @@ var init_table$1 = __esmMin((() => {
|
|
|
8325
8705
|
//#region src/file/table/table-properties/table-cell-margin.ts
|
|
8326
8706
|
var buildMarginChildren, createTableCellMargin, buildMarginChildrenObjs, buildTableCellMarginObj, buildCellMarginObj;
|
|
8327
8707
|
var init_table_cell_margin = __esmMin((() => {
|
|
8328
|
-
init_table
|
|
8708
|
+
init_table();
|
|
8329
8709
|
init_xml_components();
|
|
8330
8710
|
buildMarginChildren = ({ marginUnitType = WidthType.DXA, top, left, bottom, right }) => [
|
|
8331
8711
|
{
|
|
@@ -8479,23 +8859,43 @@ var init_table_cell = __esmMin((() => {
|
|
|
8479
8859
|
};
|
|
8480
8860
|
}));
|
|
8481
8861
|
//#endregion
|
|
8482
|
-
//#region src/file/
|
|
8483
|
-
var
|
|
8484
|
-
var
|
|
8485
|
-
init_xml_components();
|
|
8486
|
-
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((() => {
|
|
8487
8865
|
init_table_cell();
|
|
8488
|
-
|
|
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 {
|
|
8489
8890
|
rows;
|
|
8490
8891
|
constructor(options) {
|
|
8491
|
-
super("w:
|
|
8892
|
+
super("w:customXml");
|
|
8492
8893
|
this.rows = options.children ?? [];
|
|
8493
|
-
|
|
8494
|
-
if (
|
|
8495
|
-
|
|
8496
|
-
|
|
8497
|
-
|
|
8498
|
-
}
|
|
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);
|
|
8499
8899
|
}
|
|
8500
8900
|
get cellCount() {
|
|
8501
8901
|
return Math.max(...this.rows.map((r) => r.cellCount), 0);
|
|
@@ -8503,112 +8903,84 @@ var init_sdt_row = __esmMin((() => {
|
|
|
8503
8903
|
get cells() {
|
|
8504
8904
|
return this.rows.flatMap((r) => r.cells);
|
|
8505
8905
|
}
|
|
8906
|
+
/** @internal Used by Table to insert CONTINUE cells for vertical merge. */
|
|
8506
8907
|
addCellToColumnIndex(cell, columnIndex) {
|
|
8507
8908
|
if (this.rows.length > 0) this.rows[0].addCellToColumnIndex(cell, columnIndex);
|
|
8508
8909
|
}
|
|
8509
8910
|
};
|
|
8510
|
-
|
|
8511
|
-
|
|
8512
|
-
|
|
8513
|
-
|
|
8514
|
-
|
|
8515
|
-
|
|
8516
|
-
|
|
8517
|
-
|
|
8518
|
-
//#endregion
|
|
8519
|
-
//#region src/file/table/grid.ts
|
|
8520
|
-
var createGridCol, TableGrid, TableGridChange;
|
|
8521
|
-
var init_grid = __esmMin((() => {
|
|
8522
|
-
init_xml_components();
|
|
8523
|
-
init_values();
|
|
8524
|
-
createGridCol = (width) => new BuilderElement({
|
|
8525
|
-
attributes: width !== void 0 ? { width: {
|
|
8526
|
-
key: "w:w",
|
|
8527
|
-
value: (0, values_exports.twipsMeasureValue)(width)
|
|
8528
|
-
} } : void 0,
|
|
8529
|
-
name: "w:gridCol"
|
|
8530
|
-
});
|
|
8531
|
-
TableGrid = class extends XmlComponent {
|
|
8532
|
-
constructor(widths, revision) {
|
|
8533
|
-
super("w:tblGrid");
|
|
8534
|
-
for (const width of widths) this.root.push(createGridCol(width));
|
|
8535
|
-
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);
|
|
8536
8919
|
}
|
|
8537
8920
|
};
|
|
8538
|
-
|
|
8921
|
+
CustomXmlPrComponent = class extends XmlComponent {
|
|
8539
8922
|
constructor(options) {
|
|
8540
|
-
super("w:
|
|
8541
|
-
this.root.push(
|
|
8542
|
-
|
|
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
|
+
}
|
|
8543
8948
|
}
|
|
8544
8949
|
};
|
|
8545
8950
|
}));
|
|
8546
8951
|
//#endregion
|
|
8547
|
-
//#region src/file/
|
|
8548
|
-
var
|
|
8549
|
-
|
|
8550
|
-
|
|
8551
|
-
|
|
8552
|
-
|
|
8553
|
-
|
|
8554
|
-
|
|
8555
|
-
|
|
8556
|
-
|
|
8557
|
-
|
|
8558
|
-
|
|
8559
|
-
|
|
8560
|
-
|
|
8561
|
-
constructor(options) {
|
|
8562
|
-
super("w:
|
|
8563
|
-
this.options = options;
|
|
8564
|
-
|
|
8565
|
-
|
|
8566
|
-
|
|
8567
|
-
|
|
8568
|
-
|
|
8569
|
-
|
|
8570
|
-
|
|
8571
|
-
|
|
8572
|
-
|
|
8573
|
-
if (nextRow instanceof TableRow) {
|
|
8574
|
-
const continueCell = new TableCell({
|
|
8575
|
-
borders: cell.options.borders,
|
|
8576
|
-
children: [],
|
|
8577
|
-
columnSpan: cell.options.columnSpan,
|
|
8578
|
-
rowSpan: cell.options.rowSpan - 1,
|
|
8579
|
-
verticalMerge: VerticalMergeType.CONTINUE
|
|
8580
|
-
});
|
|
8581
|
-
nextRow.addCellToColumnIndex(continueCell, columnIndex);
|
|
8582
|
-
}
|
|
8583
|
-
}
|
|
8584
|
-
columnIndex += cell.options.columnSpan || 1;
|
|
8585
|
-
}
|
|
8586
|
-
}
|
|
8587
|
-
}
|
|
8588
|
-
toXml(context) {
|
|
8589
|
-
const parts = [];
|
|
8590
|
-
const tblPr = new TableProperties({
|
|
8591
|
-
alignment: this.options.alignment,
|
|
8592
|
-
borders: this.options.borders ?? {},
|
|
8593
|
-
caption: this.options.caption,
|
|
8594
|
-
cellMargin: this.options.margins,
|
|
8595
|
-
cellSpacing: this.options.cellSpacing,
|
|
8596
|
-
description: this.options.description,
|
|
8597
|
-
float: this.options.float,
|
|
8598
|
-
indent: this.options.indent,
|
|
8599
|
-
layout: this.options.layout,
|
|
8600
|
-
revision: this.options.revision,
|
|
8601
|
-
style: this.options.style,
|
|
8602
|
-
styleColBandSize: this.options.styleColBandSize,
|
|
8603
|
-
styleRowBandSize: this.options.styleRowBandSize,
|
|
8604
|
-
tableLook: this.options.tableLook,
|
|
8605
|
-
visuallyRightToLeft: this.options.visuallyRightToLeft,
|
|
8606
|
-
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
|
|
8607
8978
|
});
|
|
8608
|
-
|
|
8609
|
-
|
|
8610
|
-
|
|
8611
|
-
|
|
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;
|
|
8612
8984
|
}
|
|
8613
8985
|
};
|
|
8614
8986
|
}));
|
|
@@ -8690,7 +9062,8 @@ var init_shape = __esmMin((() => {
|
|
|
8690
9062
|
zIndex: "z-index"
|
|
8691
9063
|
};
|
|
8692
9064
|
formatShapeStyle = (style) => style ? Object.entries(style).map(([key, value]) => `${styleToKeyMap[key]}:${value}`).join(";") : void 0;
|
|
8693
|
-
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",
|
|
8694
9067
|
attributes: {
|
|
8695
9068
|
id: {
|
|
8696
9069
|
key: "id",
|
|
@@ -8703,13 +9076,64 @@ var init_shape = __esmMin((() => {
|
|
|
8703
9076
|
type: {
|
|
8704
9077
|
key: "type",
|
|
8705
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
|
|
8706
9131
|
}
|
|
8707
9132
|
},
|
|
8708
9133
|
children: [createVmlTextbox({
|
|
8709
9134
|
children,
|
|
8710
9135
|
style: "mso-fit-shape-to-text:t;"
|
|
8711
|
-
})]
|
|
8712
|
-
name: "v:shape"
|
|
9136
|
+
})]
|
|
8713
9137
|
});
|
|
8714
9138
|
}));
|
|
8715
9139
|
//#endregion
|
|
@@ -8767,15 +9191,17 @@ function coerceSectionChild(child) {
|
|
|
8767
9191
|
}
|
|
8768
9192
|
if ("altChunk" in child) return new AltChunk(child.altChunk);
|
|
8769
9193
|
if ("subDoc" in child) return new SubDoc(child.subDoc);
|
|
9194
|
+
if ("customXml" in child) return new CustomXmlBlock(child.customXml);
|
|
8770
9195
|
throw new Error("Unknown section child type");
|
|
8771
9196
|
}
|
|
8772
9197
|
var init_coerce = __esmMin((() => {
|
|
8773
9198
|
init_alt_chunk();
|
|
9199
|
+
init_custom_xml();
|
|
8774
9200
|
init_paragraph$1();
|
|
8775
9201
|
init_sdt$1();
|
|
8776
9202
|
init_sub_doc();
|
|
8777
9203
|
init_table_of_contents$1();
|
|
8778
|
-
init_table();
|
|
9204
|
+
init_table$1();
|
|
8779
9205
|
init_textbox();
|
|
8780
9206
|
init_xml_components();
|
|
8781
9207
|
}));
|
|
@@ -8955,6 +9381,18 @@ var ContentTypes = class extends XmlComponent {
|
|
|
8955
9381
|
this.root.push(createOverride("application/vnd.openxmlformats-officedocument.wordprocessingml.bibliography+xml", "/word/bibliography.xml"));
|
|
8956
9382
|
}
|
|
8957
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
|
+
/**
|
|
8958
9396
|
* Registers a footer part in the content types.
|
|
8959
9397
|
*
|
|
8960
9398
|
* @param index - Footer index number (e.g., 1 for footer1.xml)
|
|
@@ -10216,8 +10654,14 @@ const sectionPageSizeDefaults = {
|
|
|
10216
10654
|
* ```
|
|
10217
10655
|
*/
|
|
10218
10656
|
var SectionProperties = class extends XmlComponent {
|
|
10219
|
-
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 } = {}) {
|
|
10220
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 });
|
|
10221
10665
|
this.addHeaderFooterGroup(HeaderFooterType.HEADER, headerWrapperGroup);
|
|
10222
10666
|
this.addHeaderFooterGroup(HeaderFooterType.FOOTER, footerWrapperGroup);
|
|
10223
10667
|
if (footnotePr) this.root.push(createFootnoteProperties(footnotePr));
|
|
@@ -10623,6 +11067,7 @@ var Document = class extends XmlComponent {
|
|
|
10623
11067
|
"w16sdtdh",
|
|
10624
11068
|
"w16se"
|
|
10625
11069
|
], "w14 w15 wp14"));
|
|
11070
|
+
if (options.conformance) this.root.push({ _attr: { "w:conformance": options.conformance } });
|
|
10626
11071
|
this.body = new Body();
|
|
10627
11072
|
if (options.background) this.root.push(new DocumentBackground(options.background));
|
|
10628
11073
|
this.root.push(this.body);
|
|
@@ -11035,14 +11480,18 @@ init_xml_components();
|
|
|
11035
11480
|
*
|
|
11036
11481
|
* ## XSD Schema
|
|
11037
11482
|
* ```xml
|
|
11038
|
-
* <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>
|
|
11039
11487
|
* ```
|
|
11040
11488
|
*
|
|
11041
11489
|
* @internal
|
|
11042
11490
|
*/
|
|
11043
11491
|
var FootnoteRef = class extends XmlComponent {
|
|
11044
|
-
constructor() {
|
|
11492
|
+
constructor(options) {
|
|
11045
11493
|
super("w:footnoteRef");
|
|
11494
|
+
if (options?.customMarkFollows !== void 0) this.root.push({ _attr: { "w:customMarkFollows": options.customMarkFollows ? "1" : "0" } });
|
|
11046
11495
|
}
|
|
11047
11496
|
};
|
|
11048
11497
|
//#endregion
|
|
@@ -11567,9 +12016,11 @@ var NumberFormat$1 = class extends XmlComponent {
|
|
|
11567
12016
|
* numbering from different levels.
|
|
11568
12017
|
*/
|
|
11569
12018
|
var LevelText = class extends XmlComponent {
|
|
11570
|
-
constructor(value) {
|
|
12019
|
+
constructor(value, nullAttribute) {
|
|
11571
12020
|
super("w:lvlText");
|
|
11572
|
-
|
|
12021
|
+
const attrs = { "w:val": value };
|
|
12022
|
+
if (nullAttribute !== void 0) attrs["w:null"] = nullAttribute ? "1" : "0";
|
|
12023
|
+
this.root.push({ _attr: attrs });
|
|
11573
12024
|
}
|
|
11574
12025
|
};
|
|
11575
12026
|
/**
|
|
@@ -11672,13 +12123,32 @@ var LevelBase = class extends XmlComponent {
|
|
|
11672
12123
|
* @param options - Level configuration options
|
|
11673
12124
|
* @throws Error if level is greater than 9 (Word limitation)
|
|
11674
12125
|
*/
|
|
11675
|
-
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 }) {
|
|
11676
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 } });
|
|
11677
12130
|
this.root.push(numberValObj("w:start", (0, values_exports.decimalNumber)(start)));
|
|
11678
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)));
|
|
11679
12133
|
if (suffix) this.root.push(new Suffix(suffix));
|
|
11680
12134
|
if (isLegalNumberingStyle) this.root.push(new IsLegalNumberingStyle());
|
|
11681
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
|
+
}
|
|
11682
12152
|
this.root.push(new LevelJc(alignment));
|
|
11683
12153
|
this.paragraphProperties = new ParagraphProperties(style && style.paragraph);
|
|
11684
12154
|
this.runProperties = new RunProperties(style && style.run);
|
|
@@ -11784,10 +12254,6 @@ init_values();
|
|
|
11784
12254
|
/**
|
|
11785
12255
|
* Represents an abstract numbering definition in a WordprocessingML document.
|
|
11786
12256
|
*
|
|
11787
|
-
* Abstract numbering definitions define the formatting and style of numbered or
|
|
11788
|
-
* bulleted lists that can be referenced by concrete numbering instances.
|
|
11789
|
-
* Each abstract definition can contain up to 9 levels.
|
|
11790
|
-
*
|
|
11791
12257
|
* Reference: http://officeopenxml.com/WPnumbering.php
|
|
11792
12258
|
*
|
|
11793
12259
|
* ## XSD Schema
|
|
@@ -11805,43 +12271,26 @@ init_values();
|
|
|
11805
12271
|
* <xsd:attribute name="abstractNumId" type="ST_DecimalNumber" use="required"/>
|
|
11806
12272
|
* </xsd:complexType>
|
|
11807
12273
|
* ```
|
|
11808
|
-
*
|
|
11809
|
-
* @example
|
|
11810
|
-
* ```typescript
|
|
11811
|
-
* // Create an abstract numbering definition with multiple levels
|
|
11812
|
-
* const abstractNumbering = new AbstractNumbering(1, [
|
|
11813
|
-
* {
|
|
11814
|
-
* level: 0,
|
|
11815
|
-
* format: LevelFormat.DECIMAL,
|
|
11816
|
-
* text: "%1.",
|
|
11817
|
-
* alignment: AlignmentType.LEFT,
|
|
11818
|
-
* },
|
|
11819
|
-
* {
|
|
11820
|
-
* level: 1,
|
|
11821
|
-
* format: LevelFormat.LOWER_LETTER,
|
|
11822
|
-
* text: "%2)",
|
|
11823
|
-
* alignment: AlignmentType.LEFT,
|
|
11824
|
-
* },
|
|
11825
|
-
* ]);
|
|
11826
|
-
* ```
|
|
11827
12274
|
*/
|
|
11828
12275
|
var AbstractNumbering = class extends XmlComponent {
|
|
11829
12276
|
/** The unique identifier for this abstract numbering definition. */
|
|
11830
12277
|
id;
|
|
11831
12278
|
/**
|
|
11832
12279
|
* Creates a new abstract numbering definition.
|
|
11833
|
-
*
|
|
11834
|
-
* @param id - Unique identifier for this abstract numbering definition
|
|
11835
|
-
* @param levelOptions - Array of level definitions (up to 9 levels)
|
|
11836
12280
|
*/
|
|
11837
|
-
constructor(id, levelOptions) {
|
|
12281
|
+
constructor(id, levelOptions, extraOptions) {
|
|
11838
12282
|
super("w:abstractNum");
|
|
11839
12283
|
this.root.push({ _attr: {
|
|
11840
12284
|
"w:abstractNumId": (0, values_exports.decimalNumber)(id),
|
|
11841
12285
|
"w15:restartNumberingAfterBreak": 0
|
|
11842
12286
|
} });
|
|
11843
|
-
this.root.push(new MultiLevelType("hybridMultilevel"));
|
|
11844
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));
|
|
11845
12294
|
for (const option of levelOptions) this.root.push(new Level(option));
|
|
11846
12295
|
}
|
|
11847
12296
|
};
|
|
@@ -11958,6 +12407,7 @@ var StartOverride = class extends XmlComponent {
|
|
|
11958
12407
|
init_paragraph();
|
|
11959
12408
|
init_xml_components();
|
|
11960
12409
|
init_convenience_functions();
|
|
12410
|
+
init_values();
|
|
11961
12411
|
/**
|
|
11962
12412
|
* Represents the numbering definitions in a WordprocessingML document.
|
|
11963
12413
|
*
|
|
@@ -12025,6 +12475,8 @@ var Numbering = class extends XmlComponent {
|
|
|
12025
12475
|
referenceConfigMap = /* @__PURE__ */ new Map();
|
|
12026
12476
|
abstractNumUniqueNumericId = abstractNumUniqueNumericIdGen();
|
|
12027
12477
|
concreteNumUniqueNumericId = concreteNumUniqueNumericIdGen();
|
|
12478
|
+
_numIdMacAtCleanup;
|
|
12479
|
+
_numPicBullets;
|
|
12028
12480
|
/**
|
|
12029
12481
|
* Creates a new numbering definition collection.
|
|
12030
12482
|
*
|
|
@@ -12035,6 +12487,8 @@ var Numbering = class extends XmlComponent {
|
|
|
12035
12487
|
*/
|
|
12036
12488
|
constructor(options) {
|
|
12037
12489
|
super("w:numbering");
|
|
12490
|
+
this._numIdMacAtCleanup = options.numIdMacAtCleanup;
|
|
12491
|
+
this._numPicBullets = options.numPicBullets;
|
|
12038
12492
|
this.root.push(buildDocumentAttributes([
|
|
12039
12493
|
"wpc",
|
|
12040
12494
|
"mc",
|
|
@@ -12163,8 +12617,10 @@ var Numbering = class extends XmlComponent {
|
|
|
12163
12617
|
}
|
|
12164
12618
|
toXml(context) {
|
|
12165
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));
|
|
12166
12621
|
for (const numbering of this.abstractNumberingMap.values()) this.root.push(numbering);
|
|
12167
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)));
|
|
12168
12624
|
const result = super.toXml(context);
|
|
12169
12625
|
this.root.length = start;
|
|
12170
12626
|
return result;
|
|
@@ -12218,6 +12674,20 @@ var Numbering = class extends XmlComponent {
|
|
|
12218
12674
|
return [...this.referenceConfigMap.values()];
|
|
12219
12675
|
}
|
|
12220
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
|
+
};
|
|
12221
12691
|
//#endregion
|
|
12222
12692
|
//#region src/file/settings/compatibility-setting/compatibility-setting.ts
|
|
12223
12693
|
init_xml_components();
|
|
@@ -12388,6 +12858,16 @@ var Compatibility = class extends XmlComponent {
|
|
|
12388
12858
|
};
|
|
12389
12859
|
//#endregion
|
|
12390
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
|
+
*/
|
|
12391
12871
|
init_xml_components();
|
|
12392
12872
|
/**
|
|
12393
12873
|
* Represents document settings in a WordprocessingML document.
|
|
@@ -12463,20 +12943,251 @@ var Settings = class extends XmlComponent {
|
|
|
12463
12943
|
val: options.zoom.val,
|
|
12464
12944
|
percent: options.zoom.percent ?? 100
|
|
12465
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));
|
|
12466
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));
|
|
12467
12953
|
if (options.embedTrueTypeFonts !== void 0) this.root.push(onOffObj("w:embedTrueTypeFonts", options.embedTrueTypeFonts));
|
|
12468
12954
|
if (options.embedSystemFonts !== void 0) this.root.push(onOffObj("w:embedSystemFonts", options.embedSystemFonts));
|
|
12469
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));
|
|
12470
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));
|
|
12471
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));
|
|
12472
13103
|
this.root.push(numberValObj("w:defaultTabStop", options.defaultTabStop ?? 420));
|
|
12473
13104
|
if (options.hyphenation?.autoHyphenation !== void 0) this.root.push(onOffObj("w:autoHyphenation", options.hyphenation.autoHyphenation));
|
|
12474
13105
|
if (options.hyphenation?.consecutiveHyphenLimit !== void 0) this.root.push(numberValObj("w:consecutiveHyphenLimit", options.hyphenation.consecutiveHyphenLimit));
|
|
12475
13106
|
if (options.hyphenation?.hyphenationZone !== void 0) this.root.push(numberValObj("w:hyphenationZone", options.hyphenation.hyphenationZone));
|
|
12476
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));
|
|
12477
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));
|
|
12478
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));
|
|
12479
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));
|
|
12480
13191
|
this.root.push(new Compatibility({
|
|
12481
13192
|
...options.compatibility,
|
|
12482
13193
|
version: options.compatibility?.version ?? options.compatibilityModeVersion ?? 15,
|
|
@@ -12504,73 +13215,461 @@ var Settings = class extends XmlComponent {
|
|
|
12504
13215
|
}]
|
|
12505
13216
|
}))
|
|
12506
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));
|
|
12507
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));
|
|
12508
13501
|
}
|
|
12509
13502
|
};
|
|
12510
|
-
/**
|
|
12511
|
-
|
|
12512
|
-
*
|
|
12513
|
-
* Restricts the types of editing allowed in the document.
|
|
12514
|
-
* Requires `enforcement: true` to take effect.
|
|
12515
|
-
*
|
|
12516
|
-
* Reference: ISO/IEC 29500-4, wml.xsd, CT_DocProtect
|
|
12517
|
-
*/
|
|
12518
|
-
var DocumentProtection = class extends XmlComponent {
|
|
13503
|
+
/** Document-level endnote properties (CT_EdnDocProps) */
|
|
13504
|
+
var EndnotePrElement = class extends XmlComponent {
|
|
12519
13505
|
constructor(options) {
|
|
12520
|
-
super("w:
|
|
12521
|
-
|
|
12522
|
-
|
|
12523
|
-
|
|
12524
|
-
|
|
12525
|
-
|
|
12526
|
-
|
|
12527
|
-
|
|
12528
|
-
|
|
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));
|
|
12529
13531
|
}
|
|
12530
13532
|
};
|
|
12531
|
-
|
|
12532
|
-
|
|
12533
|
-
|
|
12534
|
-
|
|
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
|
+
}));
|
|
12535
13551
|
}
|
|
12536
13552
|
};
|
|
12537
|
-
|
|
13553
|
+
/** Reading mode ink lock-down (CT_ReadingModeInkLockDown) */
|
|
13554
|
+
var ReadModeInkLockDownElement = class extends XmlComponent {
|
|
12538
13555
|
constructor(options) {
|
|
12539
|
-
super("w:
|
|
12540
|
-
const
|
|
12541
|
-
|
|
12542
|
-
|
|
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 });
|
|
12543
13564
|
}
|
|
12544
13565
|
};
|
|
12545
|
-
|
|
13566
|
+
/** Captions (CT_Captions) */
|
|
13567
|
+
var CaptionsElement = class extends XmlComponent {
|
|
12546
13568
|
constructor(options) {
|
|
12547
|
-
super("w:
|
|
12548
|
-
const
|
|
12549
|
-
|
|
12550
|
-
|
|
12551
|
-
|
|
12552
|
-
|
|
12553
|
-
|
|
12554
|
-
|
|
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
|
+
}
|
|
12555
13620
|
}
|
|
12556
13621
|
};
|
|
12557
|
-
|
|
13622
|
+
/** Math properties (m:mathPr) — uses math namespace */
|
|
13623
|
+
var MathPrElement = class extends XmlComponent {
|
|
12558
13624
|
constructor(options) {
|
|
12559
|
-
super("
|
|
12560
|
-
|
|
12561
|
-
|
|
12562
|
-
|
|
12563
|
-
|
|
12564
|
-
|
|
12565
|
-
|
|
12566
|
-
|
|
12567
|
-
if (options.
|
|
12568
|
-
|
|
12569
|
-
|
|
12570
|
-
|
|
12571
|
-
|
|
12572
|
-
|
|
12573
|
-
|
|
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
|
+
}));
|
|
12574
13673
|
}
|
|
12575
13674
|
};
|
|
12576
13675
|
//#endregion
|
|
@@ -12734,13 +13833,19 @@ var Style = class extends XmlComponent {
|
|
|
12734
13833
|
...attributes.customStyle !== void 0 ? { "w:customStyle": attributes.customStyle } : {}
|
|
12735
13834
|
} });
|
|
12736
13835
|
if (options.name) this.root.push(new Name(options.name));
|
|
13836
|
+
if (options.aliases) this.root.push(stringValObj("w:aliases", options.aliases));
|
|
12737
13837
|
if (options.basedOn) this.root.push(stringValObj("w:basedOn", options.basedOn));
|
|
12738
13838
|
if (options.next) this.root.push(stringValObj("w:next", options.next));
|
|
12739
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));
|
|
12740
13841
|
if (options.uiPriority !== void 0) this.root.push(new UiPriority(options.uiPriority));
|
|
12741
13842
|
if (options.semiHidden !== void 0) this.root.push(onOffObj("w:semiHidden", options.semiHidden));
|
|
12742
13843
|
if (options.unhideWhenUsed !== void 0) this.root.push(onOffObj("w:unhideWhenUsed", options.unhideWhenUsed));
|
|
12743
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));
|
|
12744
13849
|
if (options.tableStyleOverrides) for (const override of options.tableStyleOverrides) this.root.push(createTableStyleOverride(override));
|
|
12745
13850
|
}
|
|
12746
13851
|
};
|
|
@@ -13495,6 +14600,270 @@ var SubDocCollection = class {
|
|
|
13495
14600
|
}
|
|
13496
14601
|
};
|
|
13497
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
|
|
13498
14867
|
//#region src/file/file.ts
|
|
13499
14868
|
/**
|
|
13500
14869
|
* File module for WordprocessingML documents.
|
|
@@ -13606,6 +14975,8 @@ var File = class {
|
|
|
13606
14975
|
comments;
|
|
13607
14976
|
bibliography;
|
|
13608
14977
|
fontTable;
|
|
14978
|
+
glossaryOptions;
|
|
14979
|
+
webSettings;
|
|
13609
14980
|
constructor(options) {
|
|
13610
14981
|
this.coreProperties = new CoreProperties({
|
|
13611
14982
|
...options,
|
|
@@ -13646,7 +15017,9 @@ var File = class {
|
|
|
13646
15017
|
embedSystemFonts: options.embedSystemFonts,
|
|
13647
15018
|
saveSubsetFonts: options.saveSubsetFonts,
|
|
13648
15019
|
docVars: options.docVars,
|
|
13649
|
-
colorSchemeMapping: options.colorSchemeMapping
|
|
15020
|
+
colorSchemeMapping: options.colorSchemeMapping,
|
|
15021
|
+
mailMerge: options.mailMerge,
|
|
15022
|
+
...options.settings
|
|
13650
15023
|
});
|
|
13651
15024
|
this.media = new Media();
|
|
13652
15025
|
this.charts = new ChartCollection();
|
|
@@ -13683,6 +15056,16 @@ var File = class {
|
|
|
13683
15056
|
this.endnotes.view.createEndnote(parseFloat(key), children);
|
|
13684
15057
|
}
|
|
13685
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
|
+
}
|
|
13686
15069
|
}
|
|
13687
15070
|
addSection({ headers = {}, footers = {}, children, properties }) {
|
|
13688
15071
|
this.document.view.body.addSection({
|
|
@@ -14027,6 +15410,180 @@ var smartart_exports = /* @__PURE__ */ __exportAll({
|
|
|
14027
15410
|
});
|
|
14028
15411
|
init_tree_to_model();
|
|
14029
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
|
|
14030
15587
|
//#region src/file/index.ts
|
|
14031
15588
|
var file_exports = /* @__PURE__ */ __exportAll({
|
|
14032
15589
|
AbstractNumbering: () => AbstractNumbering,
|
|
@@ -14064,6 +15621,18 @@ var file_exports = /* @__PURE__ */ __exportAll({
|
|
|
14064
15621
|
ConcreteHyperlink: () => ConcreteHyperlink,
|
|
14065
15622
|
ConcreteNumbering: () => ConcreteNumbering,
|
|
14066
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,
|
|
14067
15636
|
DEFAULT_DRAWING_XML: () => DEFAULT_DRAWING_XML,
|
|
14068
15637
|
DayLong: () => DayLong,
|
|
14069
15638
|
DayShort: () => DayShort,
|
|
@@ -14071,6 +15640,9 @@ var file_exports = /* @__PURE__ */ __exportAll({
|
|
|
14071
15640
|
DeletedTableRow: () => DeletedTableRow,
|
|
14072
15641
|
DeletedTextRun: () => DeletedTextRun,
|
|
14073
15642
|
Dir: () => Dir,
|
|
15643
|
+
DocPartBehavior: () => DocPartBehavior,
|
|
15644
|
+
DocPartGallery: () => DocPartGallery,
|
|
15645
|
+
DocPartType: () => DocPartType,
|
|
14074
15646
|
Document: () => Document,
|
|
14075
15647
|
DocumentAttributeNamespaces: () => DocumentAttributeNamespaces,
|
|
14076
15648
|
DocumentBackground: () => DocumentBackground,
|
|
@@ -14098,6 +15670,7 @@ var file_exports = /* @__PURE__ */ __exportAll({
|
|
|
14098
15670
|
FractionType: () => FractionType,
|
|
14099
15671
|
FrameAnchorType: () => FrameAnchorType,
|
|
14100
15672
|
FrameWrap: () => FrameWrap,
|
|
15673
|
+
Frameset: () => Frameset,
|
|
14101
15674
|
GridSpan: () => GridSpan,
|
|
14102
15675
|
Header: () => Header,
|
|
14103
15676
|
HeaderFooterReferenceType: () => HeaderFooterReferenceType,
|
|
@@ -14174,6 +15747,7 @@ var file_exports = /* @__PURE__ */ __exportAll({
|
|
|
14174
15747
|
NumberedItemReference: () => NumberedItemReference,
|
|
14175
15748
|
NumberedItemReferenceFormat: () => NumberedItemReferenceFormat,
|
|
14176
15749
|
Numbering: () => Numbering,
|
|
15750
|
+
ObjectElement: () => ObjectElement,
|
|
14177
15751
|
OverlapType: () => OverlapType,
|
|
14178
15752
|
PageBorderDisplay: () => PageBorderDisplay,
|
|
14179
15753
|
PageBorderOffsetFrom: () => PageBorderOffsetFrom,
|
|
@@ -14199,6 +15773,8 @@ var file_exports = /* @__PURE__ */ __exportAll({
|
|
|
14199
15773
|
PositionalTabAlignment: () => PositionalTabAlignment,
|
|
14200
15774
|
PositionalTabLeader: () => PositionalTabLeader,
|
|
14201
15775
|
PositionalTabRelativeTo: () => PositionalTabRelativeTo,
|
|
15776
|
+
ProofError: () => ProofError,
|
|
15777
|
+
ProofErrorType: () => ProofErrorType,
|
|
14202
15778
|
RelativeHorizontalPosition: () => RelativeHorizontalPosition,
|
|
14203
15779
|
RelativeVerticalPosition: () => RelativeVerticalPosition,
|
|
14204
15780
|
RubyAlign: () => RubyAlign,
|
|
@@ -14219,6 +15795,7 @@ var file_exports = /* @__PURE__ */ __exportAll({
|
|
|
14219
15795
|
SimpleMailMergeField: () => SimpleMailMergeField,
|
|
14220
15796
|
SmartArtCollection: () => SmartArtCollection,
|
|
14221
15797
|
SmartArtRun: () => SmartArtRun,
|
|
15798
|
+
SmartTagRun: () => SmartTagRun,
|
|
14222
15799
|
SoftHyphen: () => SoftHyphen,
|
|
14223
15800
|
SpaceType: () => SpaceType,
|
|
14224
15801
|
StructuredDocumentTagBlock: () => StructuredDocumentTagBlock,
|
|
@@ -14407,7 +15984,7 @@ var file_exports = /* @__PURE__ */ __exportAll({
|
|
|
14407
15984
|
});
|
|
14408
15985
|
init_paragraph();
|
|
14409
15986
|
init_coerce();
|
|
14410
|
-
init_table
|
|
15987
|
+
init_table();
|
|
14411
15988
|
init_media();
|
|
14412
15989
|
init_drawing();
|
|
14413
15990
|
init_shading();
|
|
@@ -14417,6 +15994,7 @@ init_track_revision();
|
|
|
14417
15994
|
init_shared();
|
|
14418
15995
|
init_border$1();
|
|
14419
15996
|
init_vertical_align();
|
|
15997
|
+
init_custom_xml();
|
|
14420
15998
|
init_sdt();
|
|
14421
15999
|
__reExport(file_exports, smartart_exports);
|
|
14422
16000
|
//#endregion
|
|
@@ -14755,10 +16333,48 @@ var Compiler = class {
|
|
|
14755
16333
|
...file.subDocs.array.length > 0 ? { SubDocs: file.subDocs.array.map((subDocData) => ({
|
|
14756
16334
|
data: subDocData.data,
|
|
14757
16335
|
path: `word/${subDocData.path}`
|
|
14758
|
-
})) } : {}
|
|
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
|
+
} } : {}
|
|
14759
16345
|
};
|
|
14760
16346
|
}
|
|
14761
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
|
+
}
|
|
14762
16378
|
//#endregion
|
|
14763
16379
|
//#region src/export/packer/packer.ts
|
|
14764
16380
|
const compiler = new Compiler();
|
|
@@ -17616,6 +19232,18 @@ var src_exports = /* @__PURE__ */ __exportAll({
|
|
|
17616
19232
|
ConcreteHyperlink: () => ConcreteHyperlink,
|
|
17617
19233
|
ConcreteNumbering: () => ConcreteNumbering,
|
|
17618
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,
|
|
17619
19247
|
DEFAULT_DRAWING_XML: () => DEFAULT_DRAWING_XML,
|
|
17620
19248
|
DayLong: () => DayLong,
|
|
17621
19249
|
DayShort: () => DayShort,
|
|
@@ -17623,6 +19251,9 @@ var src_exports = /* @__PURE__ */ __exportAll({
|
|
|
17623
19251
|
DeletedTableRow: () => DeletedTableRow,
|
|
17624
19252
|
DeletedTextRun: () => DeletedTextRun,
|
|
17625
19253
|
Dir: () => Dir,
|
|
19254
|
+
DocPartBehavior: () => DocPartBehavior,
|
|
19255
|
+
DocPartGallery: () => DocPartGallery,
|
|
19256
|
+
DocPartType: () => DocPartType,
|
|
17626
19257
|
Document: () => File,
|
|
17627
19258
|
DocumentAttributeNamespaces: () => DocumentAttributeNamespaces,
|
|
17628
19259
|
DocumentBackground: () => DocumentBackground,
|
|
@@ -17650,6 +19281,7 @@ var src_exports = /* @__PURE__ */ __exportAll({
|
|
|
17650
19281
|
FractionType: () => FractionType,
|
|
17651
19282
|
FrameAnchorType: () => FrameAnchorType,
|
|
17652
19283
|
FrameWrap: () => FrameWrap,
|
|
19284
|
+
Frameset: () => Frameset,
|
|
17653
19285
|
GridSpan: () => GridSpan,
|
|
17654
19286
|
Header: () => Header,
|
|
17655
19287
|
HeaderFooterReferenceType: () => HeaderFooterReferenceType,
|
|
@@ -17726,6 +19358,7 @@ var src_exports = /* @__PURE__ */ __exportAll({
|
|
|
17726
19358
|
NumberedItemReference: () => NumberedItemReference,
|
|
17727
19359
|
NumberedItemReferenceFormat: () => NumberedItemReferenceFormat,
|
|
17728
19360
|
Numbering: () => Numbering,
|
|
19361
|
+
ObjectElement: () => ObjectElement,
|
|
17729
19362
|
OverlapType: () => OverlapType,
|
|
17730
19363
|
Packer: () => Packer,
|
|
17731
19364
|
PageBorderDisplay: () => PageBorderDisplay,
|
|
@@ -17753,6 +19386,8 @@ var src_exports = /* @__PURE__ */ __exportAll({
|
|
|
17753
19386
|
PositionalTabAlignment: () => PositionalTabAlignment,
|
|
17754
19387
|
PositionalTabLeader: () => PositionalTabLeader,
|
|
17755
19388
|
PositionalTabRelativeTo: () => PositionalTabRelativeTo,
|
|
19389
|
+
ProofError: () => ProofError,
|
|
19390
|
+
ProofErrorType: () => ProofErrorType,
|
|
17756
19391
|
RelativeHorizontalPosition: () => RelativeHorizontalPosition,
|
|
17757
19392
|
RelativeVerticalPosition: () => RelativeVerticalPosition,
|
|
17758
19393
|
RubyAlign: () => RubyAlign,
|
|
@@ -17773,6 +19408,7 @@ var src_exports = /* @__PURE__ */ __exportAll({
|
|
|
17773
19408
|
SimpleMailMergeField: () => SimpleMailMergeField,
|
|
17774
19409
|
SmartArtCollection: () => SmartArtCollection,
|
|
17775
19410
|
SmartArtRun: () => SmartArtRun,
|
|
19411
|
+
SmartTagRun: () => SmartTagRun,
|
|
17776
19412
|
SoftHyphen: () => SoftHyphen,
|
|
17777
19413
|
SpaceType: () => SpaceType,
|
|
17778
19414
|
StructuredDocumentTagBlock: () => StructuredDocumentTagBlock,
|
|
@@ -17977,6 +19613,6 @@ var src_exports = /* @__PURE__ */ __exportAll({
|
|
|
17977
19613
|
__reExport(src_exports, file_exports);
|
|
17978
19614
|
__reExport(src_exports, util_exports);
|
|
17979
19615
|
//#endregion
|
|
17980
|
-
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 };
|
|
17981
19617
|
|
|
17982
19618
|
//# sourceMappingURL=index.mjs.map
|