@harbour-enterprises/superdoc 1.5.0 → 1.6.0-next.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/chunks/{PdfViewer-B_zxY1AJ.cjs → PdfViewer-Dr4K1JKD.cjs} +2 -2
- package/dist/chunks/{PdfViewer-DOsj8296.es.js → PdfViewer-DzppMlfu.es.js} +2 -2
- package/dist/chunks/{SuperConverter-Dfxp14RO.es.js → SuperConverter-Cyn9peRO.es.js} +1282 -875
- package/dist/chunks/{SuperConverter-DmX1tktl.cjs → SuperConverter-DpKjVrPl.cjs} +1282 -875
- package/dist/chunks/{index-B6UxxE5v.es.js → index-C7KECpDt.es.js} +1257 -15
- package/dist/chunks/{index-BqmzYr4Q.cjs → index-CmZ15rIJ.cjs} +4 -4
- package/dist/chunks/{index-BFU5qWH7.cjs → index-Cto-XsBE.cjs} +1257 -15
- package/dist/chunks/{index-zeVoYVRM.es.js → index-DrcLOCfC.es.js} +4 -4
- package/dist/style.css +7 -0
- package/dist/super-editor/converter.cjs +1 -1
- package/dist/super-editor/converter.es.js +1 -1
- package/dist/super-editor/docx-zipper.cjs +10 -0
- package/dist/super-editor/docx-zipper.es.js +10 -0
- package/dist/super-editor.cjs +2 -2
- package/dist/super-editor.es.js +3 -3
- package/dist/superdoc.cjs +3 -3
- package/dist/superdoc.es.js +3 -3
- package/dist/superdoc.umd.js +2549 -890
- package/dist/superdoc.umd.js.map +1 -1
- package/package.json +3 -3
|
@@ -4409,6 +4409,60 @@ const COMMENTS_XML_DEF = {
|
|
|
4409
4409
|
}
|
|
4410
4410
|
]
|
|
4411
4411
|
};
|
|
4412
|
+
const FOOTNOTES_XML_DEF = {
|
|
4413
|
+
declaration: {
|
|
4414
|
+
attributes: {
|
|
4415
|
+
version: "1.0",
|
|
4416
|
+
encoding: "UTF-8",
|
|
4417
|
+
standalone: "yes"
|
|
4418
|
+
}
|
|
4419
|
+
},
|
|
4420
|
+
elements: [
|
|
4421
|
+
{
|
|
4422
|
+
type: "element",
|
|
4423
|
+
name: "w:footnotes",
|
|
4424
|
+
attributes: {
|
|
4425
|
+
"xmlns:wpc": "http://schemas.microsoft.com/office/word/2010/wordprocessingCanvas",
|
|
4426
|
+
"xmlns:cx": "http://schemas.microsoft.com/office/drawing/2014/chartex",
|
|
4427
|
+
"xmlns:cx1": "http://schemas.microsoft.com/office/drawing/2015/9/8/chartex",
|
|
4428
|
+
"xmlns:cx2": "http://schemas.microsoft.com/office/drawing/2015/10/21/chartex",
|
|
4429
|
+
"xmlns:cx3": "http://schemas.microsoft.com/office/drawing/2016/5/9/chartex",
|
|
4430
|
+
"xmlns:cx4": "http://schemas.microsoft.com/office/drawing/2016/5/10/chartex",
|
|
4431
|
+
"xmlns:cx5": "http://schemas.microsoft.com/office/drawing/2016/5/11/chartex",
|
|
4432
|
+
"xmlns:cx6": "http://schemas.microsoft.com/office/drawing/2016/5/12/chartex",
|
|
4433
|
+
"xmlns:cx7": "http://schemas.microsoft.com/office/drawing/2016/5/13/chartex",
|
|
4434
|
+
"xmlns:cx8": "http://schemas.microsoft.com/office/drawing/2016/5/14/chartex",
|
|
4435
|
+
"xmlns:mc": "http://schemas.openxmlformats.org/markup-compatibility/2006",
|
|
4436
|
+
"xmlns:aink": "http://schemas.microsoft.com/office/drawing/2016/ink",
|
|
4437
|
+
"xmlns:am3d": "http://schemas.microsoft.com/office/drawing/2017/model3d",
|
|
4438
|
+
"xmlns:o": "urn:schemas-microsoft-com:office:office",
|
|
4439
|
+
"xmlns:oel": "http://schemas.microsoft.com/office/2019/extlst",
|
|
4440
|
+
"xmlns:r": "http://schemas.openxmlformats.org/officeDocument/2006/relationships",
|
|
4441
|
+
"xmlns:m": "http://schemas.openxmlformats.org/officeDocument/2006/math",
|
|
4442
|
+
"xmlns:v": "urn:schemas-microsoft-com:vml",
|
|
4443
|
+
"xmlns:wp14": "http://schemas.microsoft.com/office/word/2010/wordprocessingDrawing",
|
|
4444
|
+
"xmlns:wp": "http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing",
|
|
4445
|
+
"xmlns:w10": "urn:schemas-microsoft-com:office:word",
|
|
4446
|
+
"xmlns:w": "http://schemas.openxmlformats.org/wordprocessingml/2006/main",
|
|
4447
|
+
"xmlns:w14": "http://schemas.microsoft.com/office/word/2010/wordml",
|
|
4448
|
+
"xmlns:w15": "http://schemas.microsoft.com/office/word/2012/wordml",
|
|
4449
|
+
"xmlns:w16cex": "http://schemas.microsoft.com/office/word/2018/wordml/cex",
|
|
4450
|
+
"xmlns:w16cid": "http://schemas.microsoft.com/office/word/2016/wordml/cid",
|
|
4451
|
+
"xmlns:w16": "http://schemas.microsoft.com/office/word/2018/wordml",
|
|
4452
|
+
"xmlns:w16du": "http://schemas.microsoft.com/office/word/2023/wordml/word16du",
|
|
4453
|
+
"xmlns:w16sdtdh": "http://schemas.microsoft.com/office/word/2020/wordml/sdtdatahash",
|
|
4454
|
+
"xmlns:w16sdtfl": "http://schemas.microsoft.com/office/word/2024/wordml/sdtformatlock",
|
|
4455
|
+
"xmlns:w16se": "http://schemas.microsoft.com/office/word/2015/wordml/symex",
|
|
4456
|
+
"xmlns:wpg": "http://schemas.microsoft.com/office/word/2010/wordprocessingGroup",
|
|
4457
|
+
"xmlns:wpi": "http://schemas.microsoft.com/office/word/2010/wordprocessingInk",
|
|
4458
|
+
"xmlns:wne": "http://schemas.microsoft.com/office/word/2006/wordml",
|
|
4459
|
+
"xmlns:wps": "http://schemas.microsoft.com/office/word/2010/wordprocessingShape",
|
|
4460
|
+
"mc:Ignorable": "w14 w15 w16se w16cid w16 w16cex w16sdtdh w16sdtfl w16du wp14"
|
|
4461
|
+
},
|
|
4462
|
+
elements: []
|
|
4463
|
+
}
|
|
4464
|
+
]
|
|
4465
|
+
};
|
|
4412
4466
|
const COMMENTS_EXTENDED_XML_DEF = {
|
|
4413
4467
|
declaration: {
|
|
4414
4468
|
attributes: {
|
|
@@ -6239,37 +6293,37 @@ class NodeTranslator {
|
|
|
6239
6293
|
return `NodeTranslator(${this.xmlName}, priority=${this.priority})`;
|
|
6240
6294
|
}
|
|
6241
6295
|
}
|
|
6242
|
-
const encode$
|
|
6296
|
+
const encode$11 = (attributes) => {
|
|
6243
6297
|
return attributes["w:type"];
|
|
6244
6298
|
};
|
|
6245
|
-
const decode$
|
|
6299
|
+
const decode$13 = (attrs) => {
|
|
6246
6300
|
const { lineBreakType } = attrs;
|
|
6247
6301
|
return lineBreakType;
|
|
6248
6302
|
};
|
|
6249
|
-
const attrConfig$
|
|
6303
|
+
const attrConfig$B = Object.freeze({
|
|
6250
6304
|
xmlName: "w:type",
|
|
6251
6305
|
sdName: "lineBreakType",
|
|
6252
|
-
encode: encode$
|
|
6253
|
-
decode: decode$
|
|
6306
|
+
encode: encode$11,
|
|
6307
|
+
decode: decode$13
|
|
6254
6308
|
});
|
|
6255
|
-
const encode$
|
|
6309
|
+
const encode$10 = (attributes) => {
|
|
6256
6310
|
const xmlAttrValue = attributes["w:clear"];
|
|
6257
6311
|
return xmlAttrValue;
|
|
6258
6312
|
};
|
|
6259
|
-
const decode
|
|
6313
|
+
const decode$12 = (attrs) => {
|
|
6260
6314
|
const { clear } = attrs;
|
|
6261
6315
|
return clear;
|
|
6262
6316
|
};
|
|
6263
|
-
const attrConfig$
|
|
6317
|
+
const attrConfig$A = Object.freeze({
|
|
6264
6318
|
xmlName: "w:clear",
|
|
6265
6319
|
sdName: "clear",
|
|
6266
|
-
encode: encode$
|
|
6267
|
-
decode: decode
|
|
6320
|
+
encode: encode$10,
|
|
6321
|
+
decode: decode$12
|
|
6268
6322
|
});
|
|
6269
|
-
const validXmlAttributes$j = [attrConfig$
|
|
6270
|
-
const XML_NODE_NAME$
|
|
6271
|
-
const SD_NODE_NAME$
|
|
6272
|
-
const encode
|
|
6323
|
+
const validXmlAttributes$j = [attrConfig$B, attrConfig$A];
|
|
6324
|
+
const XML_NODE_NAME$t = "w:br";
|
|
6325
|
+
const SD_NODE_NAME$n = "lineBreak";
|
|
6326
|
+
const encode$$ = (_2, encodedAttrs) => {
|
|
6273
6327
|
const isPageBreak = encodedAttrs?.lineBreakType === "page";
|
|
6274
6328
|
const translated = {
|
|
6275
6329
|
type: isPageBreak ? "hardBreak" : "lineBreak"
|
|
@@ -6279,7 +6333,7 @@ const encode$Y = (_2, encodedAttrs) => {
|
|
|
6279
6333
|
}
|
|
6280
6334
|
return translated;
|
|
6281
6335
|
};
|
|
6282
|
-
const decode$
|
|
6336
|
+
const decode$11 = (params, decodedAttrs) => {
|
|
6283
6337
|
const { node } = params;
|
|
6284
6338
|
if (!node) return;
|
|
6285
6339
|
const wBreak = { name: "w:br" };
|
|
@@ -6296,39 +6350,39 @@ const decode$_ = (params, decodedAttrs) => {
|
|
|
6296
6350
|
};
|
|
6297
6351
|
return translated;
|
|
6298
6352
|
};
|
|
6299
|
-
const config$
|
|
6300
|
-
xmlName: XML_NODE_NAME$
|
|
6301
|
-
sdNodeOrKeyName: SD_NODE_NAME$
|
|
6353
|
+
const config$s = {
|
|
6354
|
+
xmlName: XML_NODE_NAME$t,
|
|
6355
|
+
sdNodeOrKeyName: SD_NODE_NAME$n,
|
|
6302
6356
|
type: NodeTranslator.translatorTypes.NODE,
|
|
6303
|
-
encode: encode
|
|
6304
|
-
decode: decode$
|
|
6357
|
+
encode: encode$$,
|
|
6358
|
+
decode: decode$11,
|
|
6305
6359
|
attributes: validXmlAttributes$j
|
|
6306
6360
|
};
|
|
6307
|
-
const translator$
|
|
6308
|
-
const encode$
|
|
6309
|
-
const decode$
|
|
6310
|
-
const attrConfig$
|
|
6361
|
+
const translator$2t = NodeTranslator.from(config$s);
|
|
6362
|
+
const encode$_ = (attributes) => attributes?.["w:val"];
|
|
6363
|
+
const decode$10 = (attrs) => attrs?.highlight;
|
|
6364
|
+
const attrConfig$z = Object.freeze({
|
|
6311
6365
|
xmlName: "w:val",
|
|
6312
6366
|
sdName: "highlight",
|
|
6313
|
-
encode: encode$
|
|
6314
|
-
decode: decode$
|
|
6367
|
+
encode: encode$_,
|
|
6368
|
+
decode: decode$10
|
|
6315
6369
|
});
|
|
6316
|
-
const validXmlAttributes$i = [attrConfig$
|
|
6317
|
-
const XML_NODE_NAME$
|
|
6370
|
+
const validXmlAttributes$i = [attrConfig$z];
|
|
6371
|
+
const XML_NODE_NAME$s = "w:highlight";
|
|
6318
6372
|
const SD_ATTR_KEY$4 = "highlight";
|
|
6319
6373
|
const DISABLED_TOKENS = /* @__PURE__ */ new Set(["transparent", "none", "inherit"]);
|
|
6320
|
-
const encode$
|
|
6374
|
+
const encode$Z = (params, encodedAttrs = {}) => {
|
|
6321
6375
|
const { nodes } = params;
|
|
6322
6376
|
const node = nodes?.[0];
|
|
6323
6377
|
const value = encodedAttrs.highlight ?? node?.attributes?.["w:val"];
|
|
6324
6378
|
return {
|
|
6325
6379
|
type: "attr",
|
|
6326
|
-
xmlName: XML_NODE_NAME$
|
|
6380
|
+
xmlName: XML_NODE_NAME$s,
|
|
6327
6381
|
sdNodeOrKeyName: SD_ATTR_KEY$4,
|
|
6328
6382
|
attributes: { "w:val": value ?? null }
|
|
6329
6383
|
};
|
|
6330
6384
|
};
|
|
6331
|
-
const decode
|
|
6385
|
+
const decode$$ = (params) => {
|
|
6332
6386
|
const attrs = params?.node?.attrs || {};
|
|
6333
6387
|
const highlightValue = attrs.highlight?.["w:val"] ?? attrs.highlight ?? attrs.color ?? null;
|
|
6334
6388
|
if (!highlightValue) return void 0;
|
|
@@ -6336,14 +6390,14 @@ const decode$Y = (params) => {
|
|
|
6336
6390
|
if (!normalizedValue) return void 0;
|
|
6337
6391
|
if (DISABLED_TOKENS.has(normalizedValue)) {
|
|
6338
6392
|
return {
|
|
6339
|
-
name: XML_NODE_NAME$
|
|
6393
|
+
name: XML_NODE_NAME$s,
|
|
6340
6394
|
attributes: { "w:val": "none" }
|
|
6341
6395
|
};
|
|
6342
6396
|
}
|
|
6343
6397
|
const keyword = getDocxHighlightKeywordFromHex(highlightValue);
|
|
6344
6398
|
if (keyword) {
|
|
6345
6399
|
return {
|
|
6346
|
-
name: XML_NODE_NAME$
|
|
6400
|
+
name: XML_NODE_NAME$s,
|
|
6347
6401
|
attributes: { "w:val": keyword }
|
|
6348
6402
|
};
|
|
6349
6403
|
}
|
|
@@ -6358,64 +6412,64 @@ const decode$Y = (params) => {
|
|
|
6358
6412
|
}
|
|
6359
6413
|
};
|
|
6360
6414
|
};
|
|
6361
|
-
const config$
|
|
6362
|
-
xmlName: XML_NODE_NAME$
|
|
6415
|
+
const config$r = {
|
|
6416
|
+
xmlName: XML_NODE_NAME$s,
|
|
6363
6417
|
sdNodeOrKeyName: SD_ATTR_KEY$4,
|
|
6364
6418
|
type: NodeTranslator.translatorTypes.ATTRIBUTE,
|
|
6365
|
-
encode: encode$
|
|
6366
|
-
decode: decode
|
|
6419
|
+
encode: encode$Z,
|
|
6420
|
+
decode: decode$$,
|
|
6367
6421
|
attributes: validXmlAttributes$i
|
|
6368
6422
|
};
|
|
6369
|
-
const translator$
|
|
6370
|
-
const encode$
|
|
6423
|
+
const translator$2s = NodeTranslator.from(config$r);
|
|
6424
|
+
const encode$Y = (attributes) => {
|
|
6371
6425
|
return attributes["w:val"];
|
|
6372
6426
|
};
|
|
6373
|
-
const decode$
|
|
6427
|
+
const decode$_ = (attrs) => {
|
|
6374
6428
|
const { tabType } = attrs || {};
|
|
6375
6429
|
return tabType;
|
|
6376
6430
|
};
|
|
6377
|
-
const attrConfig$
|
|
6431
|
+
const attrConfig$y = Object.freeze({
|
|
6378
6432
|
xmlName: "w:val",
|
|
6379
6433
|
sdName: "tabType",
|
|
6380
|
-
encode: encode$
|
|
6381
|
-
decode: decode$
|
|
6434
|
+
encode: encode$Y,
|
|
6435
|
+
decode: decode$_
|
|
6382
6436
|
});
|
|
6383
|
-
const encode$
|
|
6437
|
+
const encode$X = (attributes) => {
|
|
6384
6438
|
return attributes["w:leader"];
|
|
6385
6439
|
};
|
|
6386
|
-
const decode$
|
|
6440
|
+
const decode$Z = (attrs) => {
|
|
6387
6441
|
const { leader } = attrs || {};
|
|
6388
6442
|
return leader;
|
|
6389
6443
|
};
|
|
6390
|
-
const attrConfig$
|
|
6444
|
+
const attrConfig$x = Object.freeze({
|
|
6391
6445
|
xmlName: "w:leader",
|
|
6392
6446
|
sdName: "leader",
|
|
6393
|
-
encode: encode$
|
|
6394
|
-
decode: decode$
|
|
6447
|
+
encode: encode$X,
|
|
6448
|
+
decode: decode$Z
|
|
6395
6449
|
});
|
|
6396
|
-
const encode$
|
|
6450
|
+
const encode$W = (attributes) => {
|
|
6397
6451
|
if (attributes["w:pos"] != null) return parseInt(attributes["w:pos"]);
|
|
6398
6452
|
return null;
|
|
6399
6453
|
};
|
|
6400
|
-
const decode$
|
|
6454
|
+
const decode$Y = (attrs) => {
|
|
6401
6455
|
const { pos } = attrs || {};
|
|
6402
6456
|
return pos?.toString();
|
|
6403
6457
|
};
|
|
6404
|
-
const attrConfig$
|
|
6458
|
+
const attrConfig$w = Object.freeze({
|
|
6405
6459
|
xmlName: "w:pos",
|
|
6406
6460
|
sdName: "pos",
|
|
6407
|
-
encode: encode$
|
|
6408
|
-
decode: decode$
|
|
6461
|
+
encode: encode$W,
|
|
6462
|
+
decode: decode$Y
|
|
6409
6463
|
});
|
|
6410
|
-
const validXmlAttributes$h = [attrConfig$
|
|
6411
|
-
const XML_NODE_NAME$
|
|
6412
|
-
const SD_NODE_NAME$
|
|
6413
|
-
const encode$
|
|
6464
|
+
const validXmlAttributes$h = [attrConfig$y, attrConfig$w, attrConfig$x];
|
|
6465
|
+
const XML_NODE_NAME$r = "w:tab";
|
|
6466
|
+
const SD_NODE_NAME$m = "tab";
|
|
6467
|
+
const encode$V = (_2, encodedAttrs = {}) => {
|
|
6414
6468
|
const translated = { type: "tab" };
|
|
6415
6469
|
if (encodedAttrs) translated.attrs = { ...encodedAttrs };
|
|
6416
6470
|
return translated;
|
|
6417
6471
|
};
|
|
6418
|
-
function decode$
|
|
6472
|
+
function decode$X(params, decodedAttrs = {}) {
|
|
6419
6473
|
const { node } = params || {};
|
|
6420
6474
|
if (!node) return;
|
|
6421
6475
|
const wTab = { name: "w:tab", elements: [] };
|
|
@@ -6437,15 +6491,15 @@ function decode$U(params, decodedAttrs = {}) {
|
|
|
6437
6491
|
}
|
|
6438
6492
|
return translated;
|
|
6439
6493
|
}
|
|
6440
|
-
const config$
|
|
6441
|
-
xmlName: XML_NODE_NAME$
|
|
6442
|
-
sdNodeOrKeyName: SD_NODE_NAME$
|
|
6494
|
+
const config$q = {
|
|
6495
|
+
xmlName: XML_NODE_NAME$r,
|
|
6496
|
+
sdNodeOrKeyName: SD_NODE_NAME$m,
|
|
6443
6497
|
type: NodeTranslator.translatorTypes.NODE,
|
|
6444
|
-
encode: encode$
|
|
6445
|
-
decode: decode$
|
|
6498
|
+
encode: encode$V,
|
|
6499
|
+
decode: decode$X,
|
|
6446
6500
|
attributes: validXmlAttributes$h
|
|
6447
6501
|
};
|
|
6448
|
-
const translator$
|
|
6502
|
+
const translator$2r = NodeTranslator.from(config$q);
|
|
6449
6503
|
const carbonCopy = (obj) => {
|
|
6450
6504
|
if (!obj) return void 0;
|
|
6451
6505
|
try {
|
|
@@ -6771,54 +6825,54 @@ const integerToString = (value) => {
|
|
|
6771
6825
|
const intValue = parseInteger(value);
|
|
6772
6826
|
return intValue != void 0 ? String(intValue) : void 0;
|
|
6773
6827
|
};
|
|
6774
|
-
const translator$
|
|
6775
|
-
const translator$
|
|
6776
|
-
const translator$
|
|
6777
|
-
const translator$
|
|
6778
|
-
const encode$
|
|
6779
|
-
const decode$
|
|
6780
|
-
const attrConfig$
|
|
6828
|
+
const translator$2q = NodeTranslator.from(createSingleBooleanPropertyHandler("w:b", "bold"));
|
|
6829
|
+
const translator$2p = NodeTranslator.from(createSingleBooleanPropertyHandler("w:bCs", "boldCs"));
|
|
6830
|
+
const translator$2o = NodeTranslator.from(createBorderPropertyHandler("w:bdr", "borders"));
|
|
6831
|
+
const translator$2n = NodeTranslator.from(createSingleBooleanPropertyHandler("w:i", "italic"));
|
|
6832
|
+
const encode$U = (attributes) => attributes?.["w:val"];
|
|
6833
|
+
const decode$W = (attrs) => attrs?.underline;
|
|
6834
|
+
const attrConfig$v = Object.freeze({
|
|
6781
6835
|
xmlName: "w:val",
|
|
6782
6836
|
sdName: "underline",
|
|
6783
|
-
encode: encode$
|
|
6784
|
-
decode: decode$
|
|
6837
|
+
encode: encode$U,
|
|
6838
|
+
decode: decode$W
|
|
6785
6839
|
});
|
|
6786
|
-
const encode$
|
|
6787
|
-
const decode$
|
|
6788
|
-
const attrConfig$
|
|
6840
|
+
const encode$T = (attributes) => attributes?.["w:color"];
|
|
6841
|
+
const decode$V = (attrs) => attrs?.color;
|
|
6842
|
+
const attrConfig$u = Object.freeze({
|
|
6789
6843
|
xmlName: "w:color",
|
|
6790
6844
|
sdName: "color",
|
|
6791
|
-
encode: encode$
|
|
6792
|
-
decode: decode$
|
|
6845
|
+
encode: encode$T,
|
|
6846
|
+
decode: decode$V
|
|
6793
6847
|
});
|
|
6794
|
-
const encode$
|
|
6795
|
-
const decode$
|
|
6796
|
-
const attrConfig$
|
|
6848
|
+
const encode$S = (attributes) => attributes?.["w:themeColor"];
|
|
6849
|
+
const decode$U = (attrs) => attrs?.themeColor;
|
|
6850
|
+
const attrConfig$t = Object.freeze({
|
|
6797
6851
|
xmlName: "w:themeColor",
|
|
6798
6852
|
sdName: "themeColor",
|
|
6799
|
-
encode: encode$
|
|
6800
|
-
decode: decode$
|
|
6853
|
+
encode: encode$S,
|
|
6854
|
+
decode: decode$U
|
|
6801
6855
|
});
|
|
6802
|
-
const encode$
|
|
6803
|
-
const decode$
|
|
6804
|
-
const attrConfig$
|
|
6856
|
+
const encode$R = (attributes) => attributes?.["w:themeTint"];
|
|
6857
|
+
const decode$T = (attrs) => attrs?.themeTint;
|
|
6858
|
+
const attrConfig$s = Object.freeze({
|
|
6805
6859
|
xmlName: "w:themeTint",
|
|
6806
6860
|
sdName: "themeTint",
|
|
6807
|
-
encode: encode$
|
|
6808
|
-
decode: decode$
|
|
6861
|
+
encode: encode$R,
|
|
6862
|
+
decode: decode$T
|
|
6809
6863
|
});
|
|
6810
|
-
const encode$
|
|
6811
|
-
const decode$
|
|
6812
|
-
const attrConfig$
|
|
6864
|
+
const encode$Q = (attributes) => attributes?.["w:themeShade"];
|
|
6865
|
+
const decode$S = (attrs) => attrs?.themeShade;
|
|
6866
|
+
const attrConfig$r = Object.freeze({
|
|
6813
6867
|
xmlName: "w:themeShade",
|
|
6814
6868
|
sdName: "themeShade",
|
|
6815
|
-
encode: encode$
|
|
6816
|
-
decode: decode$
|
|
6869
|
+
encode: encode$Q,
|
|
6870
|
+
decode: decode$S
|
|
6817
6871
|
});
|
|
6818
|
-
const validXmlAttributes$g = [attrConfig$
|
|
6819
|
-
const XML_NODE_NAME$
|
|
6872
|
+
const validXmlAttributes$g = [attrConfig$v, attrConfig$u, attrConfig$t, attrConfig$s, attrConfig$r];
|
|
6873
|
+
const XML_NODE_NAME$q = "w:u";
|
|
6820
6874
|
const SD_ATTR_KEY$3 = "underline";
|
|
6821
|
-
const encode$
|
|
6875
|
+
const encode$P = (params, encodedAttrs = {}) => {
|
|
6822
6876
|
const { nodes } = params;
|
|
6823
6877
|
const node = nodes?.[0];
|
|
6824
6878
|
const sourceAttrs = node?.attributes || {};
|
|
@@ -6834,12 +6888,12 @@ const encode$M = (params, encodedAttrs = {}) => {
|
|
|
6834
6888
|
if (themeShade !== void 0 && themeShade !== null) attributes["w:themeShade"] = themeShade;
|
|
6835
6889
|
return {
|
|
6836
6890
|
type: "attr",
|
|
6837
|
-
xmlName: XML_NODE_NAME$
|
|
6891
|
+
xmlName: XML_NODE_NAME$q,
|
|
6838
6892
|
sdNodeOrKeyName: SD_ATTR_KEY$3,
|
|
6839
6893
|
attributes
|
|
6840
6894
|
};
|
|
6841
6895
|
};
|
|
6842
|
-
const decode$
|
|
6896
|
+
const decode$R = (params) => {
|
|
6843
6897
|
const attrs = params?.node?.attrs?.underline || params?.node?.attrs || {};
|
|
6844
6898
|
const underlineType = attrs.underlineType ?? attrs.underline ?? attrs["w:val"] ?? null;
|
|
6845
6899
|
const color = attrs.underlineColor ?? attrs.color ?? attrs["w:color"] ?? null;
|
|
@@ -6857,22 +6911,22 @@ const decode$O = (params) => {
|
|
|
6857
6911
|
if (themeTint) attributes["w:themeTint"] = themeTint;
|
|
6858
6912
|
if (themeShade) attributes["w:themeShade"] = themeShade;
|
|
6859
6913
|
return {
|
|
6860
|
-
name: XML_NODE_NAME$
|
|
6914
|
+
name: XML_NODE_NAME$q,
|
|
6861
6915
|
attributes
|
|
6862
6916
|
};
|
|
6863
6917
|
};
|
|
6864
|
-
const config$
|
|
6865
|
-
xmlName: XML_NODE_NAME$
|
|
6918
|
+
const config$p = {
|
|
6919
|
+
xmlName: XML_NODE_NAME$q,
|
|
6866
6920
|
sdNodeOrKeyName: SD_ATTR_KEY$3,
|
|
6867
6921
|
type: NodeTranslator.translatorTypes.ATTRIBUTE,
|
|
6868
|
-
encode: encode$
|
|
6869
|
-
decode: decode$
|
|
6922
|
+
encode: encode$P,
|
|
6923
|
+
decode: decode$R,
|
|
6870
6924
|
attributes: validXmlAttributes$g
|
|
6871
6925
|
};
|
|
6872
|
-
const translator$
|
|
6873
|
-
const translator$
|
|
6874
|
-
const translator$
|
|
6875
|
-
const translator$
|
|
6926
|
+
const translator$2m = NodeTranslator.from(config$p);
|
|
6927
|
+
const translator$2l = NodeTranslator.from(createSingleBooleanPropertyHandler("w:strike"));
|
|
6928
|
+
const translator$2k = NodeTranslator.from(createSingleBooleanPropertyHandler("w:dstrike"));
|
|
6929
|
+
const translator$2j = NodeTranslator.from({
|
|
6876
6930
|
xmlName: "w:color",
|
|
6877
6931
|
sdNodeOrKeyName: "color",
|
|
6878
6932
|
attributes: [
|
|
@@ -6889,7 +6943,7 @@ const translator$2i = NodeTranslator.from({
|
|
|
6889
6943
|
return Object.keys(decodedAttrs).length > 0 ? { attributes: decodedAttrs } : void 0;
|
|
6890
6944
|
}
|
|
6891
6945
|
});
|
|
6892
|
-
const translator$
|
|
6946
|
+
const translator$2i = NodeTranslator.from({
|
|
6893
6947
|
xmlName: "w:rFonts",
|
|
6894
6948
|
sdNodeOrKeyName: "fontFamily",
|
|
6895
6949
|
attributes: [
|
|
@@ -6920,16 +6974,16 @@ const translator$2h = NodeTranslator.from({
|
|
|
6920
6974
|
return Object.keys(decodedAttrs).length > 0 ? { attributes: decodedAttrs } : void 0;
|
|
6921
6975
|
}
|
|
6922
6976
|
});
|
|
6923
|
-
const translator$
|
|
6924
|
-
const translator$
|
|
6925
|
-
const translator$
|
|
6926
|
-
const translator$
|
|
6977
|
+
const translator$2h = NodeTranslator.from(createSingleAttrPropertyHandler("w:rStyle", "styleId"));
|
|
6978
|
+
const translator$2g = NodeTranslator.from(createSingleIntegerPropertyHandler("w:sz", "fontSize"));
|
|
6979
|
+
const translator$2f = NodeTranslator.from(createSingleIntegerPropertyHandler("w:szCs", "fontSizeCs"));
|
|
6980
|
+
const translator$2e = NodeTranslator.from({
|
|
6927
6981
|
xmlName: "w:caps",
|
|
6928
6982
|
sdNodeOrKeyName: "textTransform",
|
|
6929
6983
|
encode: ({ nodes }) => parseBoolean(nodes[0].attributes?.["w:val"] ?? "1") ? "uppercase" : "none",
|
|
6930
6984
|
decode: ({ node }) => node.attrs["textTransform"] != null ? { name: "w:caps", attributes: { "w:val": booleanToString(node.attrs["textTransform"] === "uppercase") } } : void 0
|
|
6931
6985
|
});
|
|
6932
|
-
const translator$
|
|
6986
|
+
const translator$2d = NodeTranslator.from({
|
|
6933
6987
|
xmlName: "w:shd",
|
|
6934
6988
|
sdNodeOrKeyName: "shading",
|
|
6935
6989
|
attributes: [
|
|
@@ -6951,7 +7005,7 @@ const translator$2c = NodeTranslator.from({
|
|
|
6951
7005
|
return Object.keys(decodedAttrs).length > 0 ? { attributes: decodedAttrs } : void 0;
|
|
6952
7006
|
}
|
|
6953
7007
|
});
|
|
6954
|
-
const translator$
|
|
7008
|
+
const translator$2c = NodeTranslator.from({
|
|
6955
7009
|
xmlName: "w:lang",
|
|
6956
7010
|
sdNodeOrKeyName: "lang",
|
|
6957
7011
|
attributes: [createAttributeHandler("w:val"), createAttributeHandler("w:eastAsia"), createAttributeHandler("w:bidi")],
|
|
@@ -6963,24 +7017,24 @@ const translator$2b = NodeTranslator.from({
|
|
|
6963
7017
|
return Object.keys(decodedAttrs).length > 0 ? { attributes: decodedAttrs } : void 0;
|
|
6964
7018
|
}
|
|
6965
7019
|
});
|
|
6966
|
-
const translator$
|
|
6967
|
-
const translator$
|
|
6968
|
-
const translator$
|
|
6969
|
-
const translator$
|
|
6970
|
-
const translator$
|
|
6971
|
-
const translator$
|
|
6972
|
-
const translator$
|
|
6973
|
-
const translator$
|
|
6974
|
-
const translator$
|
|
6975
|
-
const translator$
|
|
6976
|
-
const translator$
|
|
6977
|
-
const translator$
|
|
6978
|
-
const translator$
|
|
6979
|
-
const translator$
|
|
6980
|
-
const translator$
|
|
6981
|
-
const translator$
|
|
6982
|
-
const translator$
|
|
6983
|
-
const translator$
|
|
7020
|
+
const translator$2b = NodeTranslator.from(createSingleIntegerPropertyHandler("w:spacing", "letterSpacing"));
|
|
7021
|
+
const translator$2a = NodeTranslator.from(createSingleAttrPropertyHandler("w:vertAlign"));
|
|
7022
|
+
const translator$29 = NodeTranslator.from(createSingleBooleanPropertyHandler("w:smallCaps"));
|
|
7023
|
+
const translator$28 = NodeTranslator.from(createSingleBooleanPropertyHandler("w:snapToGrid"));
|
|
7024
|
+
const translator$27 = NodeTranslator.from(createSingleBooleanPropertyHandler("w:emboss"));
|
|
7025
|
+
const translator$26 = NodeTranslator.from(createSingleBooleanPropertyHandler("w:imprint"));
|
|
7026
|
+
const translator$25 = NodeTranslator.from(createSingleBooleanPropertyHandler("w:noProof"));
|
|
7027
|
+
const translator$24 = NodeTranslator.from(createSingleBooleanPropertyHandler("w:oMath"));
|
|
7028
|
+
const translator$23 = NodeTranslator.from(createSingleBooleanPropertyHandler("w:outline"));
|
|
7029
|
+
const translator$22 = NodeTranslator.from(createSingleBooleanPropertyHandler("w:shadow"));
|
|
7030
|
+
const translator$21 = NodeTranslator.from(createSingleBooleanPropertyHandler("w:vanish"));
|
|
7031
|
+
const translator$20 = NodeTranslator.from(createSingleBooleanPropertyHandler("w:specVanish"));
|
|
7032
|
+
const translator$1$ = NodeTranslator.from(createSingleAttrPropertyHandler("w:effect"));
|
|
7033
|
+
const translator$1_ = NodeTranslator.from(createSingleAttrPropertyHandler("w:em"));
|
|
7034
|
+
const translator$1Z = NodeTranslator.from(createSingleAttrPropertyHandler("w:w"));
|
|
7035
|
+
const translator$1Y = NodeTranslator.from(createSingleIntegerPropertyHandler("w:kern"));
|
|
7036
|
+
const translator$1X = NodeTranslator.from(createSingleIntegerPropertyHandler("w:position"));
|
|
7037
|
+
const translator$1W = NodeTranslator.from({
|
|
6984
7038
|
xmlName: "w:fitText",
|
|
6985
7039
|
sdNodeOrKeyName: "fitText",
|
|
6986
7040
|
attributes: [createIntegerAttributeHandler("w:val"), createIntegerAttributeHandler("w:id")],
|
|
@@ -6992,7 +7046,7 @@ const translator$1V = NodeTranslator.from({
|
|
|
6992
7046
|
return Object.keys(decodedAttrs).length > 0 ? { attributes: decodedAttrs } : void 0;
|
|
6993
7047
|
}
|
|
6994
7048
|
});
|
|
6995
|
-
const translator$
|
|
7049
|
+
const translator$1V = NodeTranslator.from({
|
|
6996
7050
|
xmlName: "w:eastAsianLayout",
|
|
6997
7051
|
sdNodeOrKeyName: "eastAsianLayout",
|
|
6998
7052
|
attributes: [
|
|
@@ -7010,52 +7064,52 @@ const translator$1U = NodeTranslator.from({
|
|
|
7010
7064
|
return Object.keys(decodedAttrs).length > 0 ? { attributes: decodedAttrs } : void 0;
|
|
7011
7065
|
}
|
|
7012
7066
|
});
|
|
7013
|
-
const translator$
|
|
7014
|
-
const translator$
|
|
7015
|
-
const translator$
|
|
7016
|
-
const translator$
|
|
7067
|
+
const translator$1U = NodeTranslator.from(createSingleBooleanPropertyHandler("w:rtl"));
|
|
7068
|
+
const translator$1T = NodeTranslator.from(createSingleBooleanPropertyHandler("w:cs"));
|
|
7069
|
+
const translator$1S = NodeTranslator.from(createSingleBooleanPropertyHandler("w:iCs"));
|
|
7070
|
+
const translator$1R = NodeTranslator.from(createSingleBooleanPropertyHandler("w:webHidden"));
|
|
7017
7071
|
const propertyTranslators$c = [
|
|
7018
|
-
translator$2o,
|
|
7019
7072
|
translator$2p,
|
|
7020
|
-
translator$
|
|
7021
|
-
translator$
|
|
7022
|
-
translator$
|
|
7023
|
-
translator$1S,
|
|
7073
|
+
translator$2q,
|
|
7074
|
+
translator$2o,
|
|
7075
|
+
translator$2e,
|
|
7024
7076
|
translator$2j,
|
|
7025
|
-
translator$
|
|
7026
|
-
translator$
|
|
7027
|
-
translator$1Z,
|
|
7028
|
-
translator$26,
|
|
7077
|
+
translator$1T,
|
|
7078
|
+
translator$2k,
|
|
7029
7079
|
translator$1V,
|
|
7030
|
-
translator$
|
|
7031
|
-
translator$
|
|
7080
|
+
translator$1$,
|
|
7081
|
+
translator$1_,
|
|
7082
|
+
translator$27,
|
|
7083
|
+
translator$1W,
|
|
7084
|
+
translator$2i,
|
|
7032
7085
|
translator$2f,
|
|
7033
|
-
translator$
|
|
7034
|
-
translator$
|
|
7035
|
-
translator$
|
|
7036
|
-
translator$
|
|
7037
|
-
translator$
|
|
7086
|
+
translator$2g,
|
|
7087
|
+
translator$2s,
|
|
7088
|
+
translator$26,
|
|
7089
|
+
translator$2n,
|
|
7090
|
+
translator$1S,
|
|
7091
|
+
translator$1Y,
|
|
7092
|
+
translator$2c,
|
|
7038
7093
|
translator$2b,
|
|
7039
|
-
translator$
|
|
7094
|
+
translator$25,
|
|
7040
7095
|
translator$24,
|
|
7041
7096
|
translator$23,
|
|
7097
|
+
translator$1X,
|
|
7098
|
+
translator$1U,
|
|
7099
|
+
translator$2h,
|
|
7042
7100
|
translator$22,
|
|
7043
|
-
translator$
|
|
7044
|
-
translator$
|
|
7045
|
-
translator$2g,
|
|
7046
|
-
translator$21,
|
|
7047
|
-
translator$2c,
|
|
7101
|
+
translator$2d,
|
|
7102
|
+
translator$29,
|
|
7048
7103
|
translator$28,
|
|
7049
|
-
translator$27,
|
|
7050
|
-
translator$1$,
|
|
7051
|
-
translator$2k,
|
|
7052
|
-
translator$2l,
|
|
7053
7104
|
translator$20,
|
|
7054
|
-
translator$
|
|
7055
|
-
translator$
|
|
7056
|
-
translator$
|
|
7105
|
+
translator$2l,
|
|
7106
|
+
translator$2m,
|
|
7107
|
+
translator$21,
|
|
7108
|
+
translator$2a,
|
|
7109
|
+
translator$1R,
|
|
7110
|
+
translator$1Z
|
|
7057
7111
|
];
|
|
7058
|
-
const translator$
|
|
7112
|
+
const translator$1Q = NodeTranslator.from(
|
|
7059
7113
|
createNestedPropertiesTranslator("w:rPr", "runProperties", propertyTranslators$c)
|
|
7060
7114
|
);
|
|
7061
7115
|
const SUPPORTED_ALTERNATE_CONTENT_REQUIRES = /* @__PURE__ */ new Set([
|
|
@@ -7072,10 +7126,10 @@ const SUPPORTED_ALTERNATE_CONTENT_REQUIRES = /* @__PURE__ */ new Set([
|
|
|
7072
7126
|
"w16sdtfl",
|
|
7073
7127
|
"w16se"
|
|
7074
7128
|
]);
|
|
7075
|
-
const XML_NODE_NAME$
|
|
7076
|
-
const SD_NODE_NAME$
|
|
7129
|
+
const XML_NODE_NAME$p = "mc:AlternateContent";
|
|
7130
|
+
const SD_NODE_NAME$l = [];
|
|
7077
7131
|
const validXmlAttributes$f = [];
|
|
7078
|
-
function encode$
|
|
7132
|
+
function encode$O(params) {
|
|
7079
7133
|
const { nodeListHandler } = params;
|
|
7080
7134
|
const { node } = params.extraParams;
|
|
7081
7135
|
if (!node || !node.type) {
|
|
@@ -7091,7 +7145,7 @@ function encode$L(params) {
|
|
|
7091
7145
|
path: buildPath(params.path, node, branch)
|
|
7092
7146
|
});
|
|
7093
7147
|
}
|
|
7094
|
-
function decode$
|
|
7148
|
+
function decode$Q(params) {
|
|
7095
7149
|
const { node } = params;
|
|
7096
7150
|
const { drawingContent } = node.attrs;
|
|
7097
7151
|
const drawing = {
|
|
@@ -7108,12 +7162,12 @@ function decode$N(params) {
|
|
|
7108
7162
|
elements: [choice]
|
|
7109
7163
|
};
|
|
7110
7164
|
}
|
|
7111
|
-
const config$
|
|
7112
|
-
xmlName: XML_NODE_NAME$
|
|
7113
|
-
sdNodeOrKeyName: SD_NODE_NAME$
|
|
7165
|
+
const config$o = {
|
|
7166
|
+
xmlName: XML_NODE_NAME$p,
|
|
7167
|
+
sdNodeOrKeyName: SD_NODE_NAME$l,
|
|
7114
7168
|
type: NodeTranslator.translatorTypes.NODE,
|
|
7115
|
-
encode: encode$
|
|
7116
|
-
decode: decode$
|
|
7169
|
+
encode: encode$O,
|
|
7170
|
+
decode: decode$Q,
|
|
7117
7171
|
attributes: validXmlAttributes$f
|
|
7118
7172
|
};
|
|
7119
7173
|
function selectAlternateContentElements(node) {
|
|
@@ -7137,18 +7191,18 @@ function selectAlternateContentElements(node) {
|
|
|
7137
7191
|
elements: carbonCopy(selectedElements)
|
|
7138
7192
|
};
|
|
7139
7193
|
}
|
|
7140
|
-
const translator$
|
|
7194
|
+
const translator$1P = NodeTranslator.from(config$o);
|
|
7141
7195
|
function buildPath(existingPath = [], node, branch) {
|
|
7142
7196
|
const path = [...existingPath];
|
|
7143
7197
|
if (node) path.push(node);
|
|
7144
7198
|
if (branch) path.push(branch);
|
|
7145
7199
|
return path;
|
|
7146
7200
|
}
|
|
7147
|
-
const translator$
|
|
7148
|
-
const translator$
|
|
7149
|
-
const translator$
|
|
7150
|
-
const translator$
|
|
7151
|
-
const translator$
|
|
7201
|
+
const translator$1O = NodeTranslator.from(createSingleBooleanPropertyHandler("w:adjustRightInd"));
|
|
7202
|
+
const translator$1N = NodeTranslator.from(createSingleBooleanPropertyHandler("w:autoSpaceDE"));
|
|
7203
|
+
const translator$1M = NodeTranslator.from(createSingleBooleanPropertyHandler("w:autoSpaceDN"));
|
|
7204
|
+
const translator$1L = NodeTranslator.from(createSingleBooleanPropertyHandler("w:bidi", "rightToLeft"));
|
|
7205
|
+
const translator$1K = NodeTranslator.from({
|
|
7152
7206
|
xmlName: "w:cnfStyle",
|
|
7153
7207
|
sdNodeOrKeyName: "cnfStyle",
|
|
7154
7208
|
attributes: [
|
|
@@ -7174,9 +7228,9 @@ const translator$1J = NodeTranslator.from({
|
|
|
7174
7228
|
return Object.keys(decodedAttrs).length > 0 ? { attributes: decodedAttrs } : void 0;
|
|
7175
7229
|
}
|
|
7176
7230
|
});
|
|
7177
|
-
const translator$
|
|
7178
|
-
const translator$
|
|
7179
|
-
const translator$
|
|
7231
|
+
const translator$1J = NodeTranslator.from(createSingleBooleanPropertyHandler("w:contextualSpacing"));
|
|
7232
|
+
const translator$1I = NodeTranslator.from(createSingleAttrPropertyHandler("w:divId"));
|
|
7233
|
+
const translator$1H = NodeTranslator.from({
|
|
7180
7234
|
xmlName: "w:framePr",
|
|
7181
7235
|
sdNodeOrKeyName: "framePr",
|
|
7182
7236
|
attributes: [
|
|
@@ -7204,7 +7258,7 @@ const translator$1G = NodeTranslator.from({
|
|
|
7204
7258
|
return Object.keys(decodedAttrs).length > 0 ? { attributes: decodedAttrs } : void 0;
|
|
7205
7259
|
}
|
|
7206
7260
|
});
|
|
7207
|
-
const translator$
|
|
7261
|
+
const translator$1G = NodeTranslator.from({
|
|
7208
7262
|
xmlName: "w:ind",
|
|
7209
7263
|
sdNodeOrKeyName: "indent",
|
|
7210
7264
|
attributes: [
|
|
@@ -7229,12 +7283,12 @@ const translator$1F = NodeTranslator.from({
|
|
|
7229
7283
|
return Object.keys(decodedAttrs).length > 0 ? { attributes: decodedAttrs } : void 0;
|
|
7230
7284
|
}
|
|
7231
7285
|
});
|
|
7232
|
-
const translator$
|
|
7233
|
-
const translator$
|
|
7234
|
-
const translator$
|
|
7235
|
-
const translator$
|
|
7236
|
-
const translator$
|
|
7237
|
-
const translator$
|
|
7286
|
+
const translator$1F = NodeTranslator.from(createSingleAttrPropertyHandler("w:jc", "justification"));
|
|
7287
|
+
const translator$1E = NodeTranslator.from(createSingleBooleanPropertyHandler("w:keepLines"));
|
|
7288
|
+
const translator$1D = NodeTranslator.from(createSingleBooleanPropertyHandler("w:keepNext"));
|
|
7289
|
+
const translator$1C = NodeTranslator.from(createSingleBooleanPropertyHandler("w:kinsoku"));
|
|
7290
|
+
const translator$1B = NodeTranslator.from(createSingleBooleanPropertyHandler("w:mirrorIndents"));
|
|
7291
|
+
const translator$1A = NodeTranslator.from(createSingleIntegerPropertyHandler("w:ilvl"));
|
|
7238
7292
|
const createTrackStyleMark = (marks) => {
|
|
7239
7293
|
const trackStyleMark = marks.find((mark) => mark.type === "trackFormat");
|
|
7240
7294
|
if (trackStyleMark) {
|
|
@@ -7252,7 +7306,7 @@ const createTrackStyleMark = (marks) => {
|
|
|
7252
7306
|
}
|
|
7253
7307
|
return void 0;
|
|
7254
7308
|
};
|
|
7255
|
-
const XML_NODE_NAME$
|
|
7309
|
+
const XML_NODE_NAME$o = "w:ins";
|
|
7256
7310
|
const SD_ATTR_KEY$2 = "trackInsert";
|
|
7257
7311
|
const validXmlAttributes$e = [
|
|
7258
7312
|
createAttributeHandler("w:id", "id"),
|
|
@@ -7260,7 +7314,7 @@ const validXmlAttributes$e = [
|
|
|
7260
7314
|
createAttributeHandler("w:author", "author"),
|
|
7261
7315
|
createAttributeHandler("w:authorEmail", "authorEmail")
|
|
7262
7316
|
];
|
|
7263
|
-
const encode$
|
|
7317
|
+
const encode$N = (params, encodedAttrs = {}) => {
|
|
7264
7318
|
const { nodeListHandler, extraParams = {}, converter } = params;
|
|
7265
7319
|
const { node } = extraParams;
|
|
7266
7320
|
if (encodedAttrs.id && converter?.trackedChangeIdMap?.has(encodedAttrs.id)) {
|
|
@@ -7289,7 +7343,7 @@ const encode$K = (params, encodedAttrs = {}) => {
|
|
|
7289
7343
|
});
|
|
7290
7344
|
return subs;
|
|
7291
7345
|
};
|
|
7292
|
-
function decode$
|
|
7346
|
+
function decode$P(params) {
|
|
7293
7347
|
const { node } = params;
|
|
7294
7348
|
if (!node || !node.type) {
|
|
7295
7349
|
return null;
|
|
@@ -7314,49 +7368,49 @@ function decode$M(params) {
|
|
|
7314
7368
|
elements: [translatedTextNode]
|
|
7315
7369
|
};
|
|
7316
7370
|
}
|
|
7317
|
-
const config$
|
|
7318
|
-
xmlName: XML_NODE_NAME$
|
|
7371
|
+
const config$n = {
|
|
7372
|
+
xmlName: XML_NODE_NAME$o,
|
|
7319
7373
|
sdNodeOrKeyName: SD_ATTR_KEY$2,
|
|
7320
7374
|
type: NodeTranslator.translatorTypes.ATTRIBUTE,
|
|
7321
|
-
encode: encode$
|
|
7322
|
-
decode: decode$
|
|
7375
|
+
encode: encode$N,
|
|
7376
|
+
decode: decode$P,
|
|
7323
7377
|
attributes: validXmlAttributes$e
|
|
7324
7378
|
};
|
|
7325
|
-
const translator$
|
|
7326
|
-
const translator$
|
|
7327
|
-
const propertyTranslators$b = [translator$
|
|
7328
|
-
const translator$
|
|
7379
|
+
const translator$1z = NodeTranslator.from(config$n);
|
|
7380
|
+
const translator$1y = NodeTranslator.from(createSingleIntegerPropertyHandler("w:numId"));
|
|
7381
|
+
const propertyTranslators$b = [translator$1P, translator$1A, translator$1z, translator$1y];
|
|
7382
|
+
const translator$1x = NodeTranslator.from(
|
|
7329
7383
|
createNestedPropertiesTranslator("w:numPr", "numberingProperties", propertyTranslators$b)
|
|
7330
7384
|
);
|
|
7331
|
-
const translator$
|
|
7385
|
+
const translator$1w = NodeTranslator.from(
|
|
7332
7386
|
createSingleAttrPropertyHandler("w:outlineLvl", "outlineLvl", "w:val", parseInteger, integerToString)
|
|
7333
7387
|
);
|
|
7334
|
-
const translator$
|
|
7335
|
-
const translator$
|
|
7336
|
-
const translator$
|
|
7337
|
-
const translator$
|
|
7338
|
-
const translator$
|
|
7339
|
-
const translator$
|
|
7340
|
-
const translator$
|
|
7341
|
-
const translator$
|
|
7342
|
-
const translator$
|
|
7343
|
-
const translator$
|
|
7344
|
-
const translator$
|
|
7388
|
+
const translator$1v = NodeTranslator.from(createSingleBooleanPropertyHandler("w:overflowPunct"));
|
|
7389
|
+
const translator$1u = NodeTranslator.from(createBorderPropertyHandler("w:bar"));
|
|
7390
|
+
const translator$1t = NodeTranslator.from(createBorderPropertyHandler("w:between"));
|
|
7391
|
+
const translator$1s = NodeTranslator.from(createBorderPropertyHandler("w:bottom"));
|
|
7392
|
+
const translator$1r = NodeTranslator.from(createMeasurementPropertyHandler("w:bottom", "marginBottom"));
|
|
7393
|
+
const translator$1q = NodeTranslator.from(createBorderPropertyHandler("w:left"));
|
|
7394
|
+
const translator$1p = NodeTranslator.from(createMeasurementPropertyHandler("w:left", "marginLeft"));
|
|
7395
|
+
const translator$1o = NodeTranslator.from(createBorderPropertyHandler("w:right"));
|
|
7396
|
+
const translator$1n = NodeTranslator.from(createMeasurementPropertyHandler("w:right", "marginRight"));
|
|
7397
|
+
const translator$1m = NodeTranslator.from(createBorderPropertyHandler("w:top"));
|
|
7398
|
+
const translator$1l = NodeTranslator.from(createMeasurementPropertyHandler("w:top", "marginTop"));
|
|
7345
7399
|
const propertyTranslators$a = [
|
|
7346
|
-
translator$
|
|
7400
|
+
translator$1P,
|
|
7401
|
+
translator$1u,
|
|
7347
7402
|
translator$1t,
|
|
7348
7403
|
translator$1s,
|
|
7349
|
-
translator$
|
|
7350
|
-
translator$
|
|
7351
|
-
translator$
|
|
7352
|
-
translator$1l
|
|
7404
|
+
translator$1q,
|
|
7405
|
+
translator$1o,
|
|
7406
|
+
translator$1m
|
|
7353
7407
|
];
|
|
7354
|
-
const translator$
|
|
7408
|
+
const translator$1k = NodeTranslator.from(
|
|
7355
7409
|
createNestedPropertiesTranslator("w:pBdr", "borders", propertyTranslators$a)
|
|
7356
7410
|
);
|
|
7357
|
-
const translator$
|
|
7358
|
-
const translator$
|
|
7359
|
-
const translator$
|
|
7411
|
+
const translator$1j = NodeTranslator.from(createSingleAttrPropertyHandler("w:pStyle", "styleId"));
|
|
7412
|
+
const translator$1i = NodeTranslator.from(createSingleBooleanPropertyHandler("w:pageBreakBefore"));
|
|
7413
|
+
const translator$1h = NodeTranslator.from({
|
|
7360
7414
|
xmlName: "w:spacing",
|
|
7361
7415
|
sdNodeOrKeyName: "spacing",
|
|
7362
7416
|
attributes: [
|
|
@@ -7377,20 +7431,21 @@ const translator$1g = NodeTranslator.from({
|
|
|
7377
7431
|
return Object.keys(decodedAttrs).length > 0 ? { attributes: decodedAttrs } : void 0;
|
|
7378
7432
|
}
|
|
7379
7433
|
});
|
|
7380
|
-
const translator$
|
|
7381
|
-
const translator$
|
|
7382
|
-
const translator$
|
|
7383
|
-
const propertyTranslators$9 = [translator$
|
|
7384
|
-
const translator$
|
|
7434
|
+
const translator$1g = NodeTranslator.from(createSingleBooleanPropertyHandler("w:suppressAutoHyphens"));
|
|
7435
|
+
const translator$1f = NodeTranslator.from(createSingleBooleanPropertyHandler("w:suppressLineNumbers"));
|
|
7436
|
+
const translator$1e = NodeTranslator.from(createSingleBooleanPropertyHandler("w:suppressOverlap"));
|
|
7437
|
+
const propertyTranslators$9 = [translator$1P, translator$2r];
|
|
7438
|
+
const translator$1d = NodeTranslator.from(
|
|
7385
7439
|
createNestedArrayPropertyHandler("w:tabs", "tabStops", propertyTranslators$9, { skipRun: true })
|
|
7386
7440
|
);
|
|
7387
|
-
const translator$
|
|
7388
|
-
const translator$
|
|
7389
|
-
const translator$
|
|
7390
|
-
const translator$
|
|
7391
|
-
const translator$
|
|
7392
|
-
const translator$
|
|
7441
|
+
const translator$1c = NodeTranslator.from(createSingleAttrPropertyHandler("w:textAlignment"));
|
|
7442
|
+
const translator$1b = NodeTranslator.from(createSingleAttrPropertyHandler("w:textDirection"));
|
|
7443
|
+
const translator$1a = NodeTranslator.from(createSingleAttrPropertyHandler("w:textboxTightWrap"));
|
|
7444
|
+
const translator$19 = NodeTranslator.from(createSingleBooleanPropertyHandler("w:topLinePunct"));
|
|
7445
|
+
const translator$18 = NodeTranslator.from(createSingleBooleanPropertyHandler("w:widowControl"));
|
|
7446
|
+
const translator$17 = NodeTranslator.from(createSingleBooleanPropertyHandler("w:wordWrap"));
|
|
7393
7447
|
const propertyTranslators$8 = [
|
|
7448
|
+
translator$1P,
|
|
7394
7449
|
translator$1O,
|
|
7395
7450
|
translator$1N,
|
|
7396
7451
|
translator$1M,
|
|
@@ -7405,15 +7460,15 @@ const propertyTranslators$8 = [
|
|
|
7405
7460
|
translator$1D,
|
|
7406
7461
|
translator$1C,
|
|
7407
7462
|
translator$1B,
|
|
7408
|
-
translator$
|
|
7463
|
+
translator$1x,
|
|
7409
7464
|
translator$1w,
|
|
7410
7465
|
translator$1v,
|
|
7411
|
-
translator$
|
|
7466
|
+
translator$1k,
|
|
7412
7467
|
translator$1j,
|
|
7413
7468
|
translator$1i,
|
|
7469
|
+
translator$2d,
|
|
7470
|
+
translator$28,
|
|
7414
7471
|
translator$1h,
|
|
7415
|
-
translator$2c,
|
|
7416
|
-
translator$27,
|
|
7417
7472
|
translator$1g,
|
|
7418
7473
|
translator$1f,
|
|
7419
7474
|
translator$1e,
|
|
@@ -7424,10 +7479,9 @@ const propertyTranslators$8 = [
|
|
|
7424
7479
|
translator$19,
|
|
7425
7480
|
translator$18,
|
|
7426
7481
|
translator$17,
|
|
7427
|
-
translator$
|
|
7428
|
-
translator$1P
|
|
7482
|
+
translator$1Q
|
|
7429
7483
|
];
|
|
7430
|
-
const translator$
|
|
7484
|
+
const translator$16 = NodeTranslator.from(
|
|
7431
7485
|
createNestedPropertiesTranslator("w:pPr", "paragraphProperties", propertyTranslators$8)
|
|
7432
7486
|
);
|
|
7433
7487
|
function getUnderlineCssString({ type = "single", color = null, thickness = null, approximate = true } = {}) {
|
|
@@ -7842,7 +7896,7 @@ function resolveDocxFontFamily(attributes, docx, toCssFontFamily) {
|
|
|
7842
7896
|
}
|
|
7843
7897
|
return resolved;
|
|
7844
7898
|
}
|
|
7845
|
-
const ooxmlResolver = createOoxmlResolver({ pPr: translator$
|
|
7899
|
+
const ooxmlResolver = createOoxmlResolver({ pPr: translator$16, rPr: translator$1Q });
|
|
7846
7900
|
const getToCssFontFamily = () => {
|
|
7847
7901
|
return SuperConverter.toCssFontFamily;
|
|
7848
7902
|
};
|
|
@@ -8536,7 +8590,7 @@ function handleStyleChangeMarksV2(rPrChange, currentMarks, params) {
|
|
|
8536
8590
|
let submarks = [];
|
|
8537
8591
|
const rPr = rPrChange.elements?.find((el) => el.name === "w:rPr");
|
|
8538
8592
|
if (rPr) {
|
|
8539
|
-
const runProperties = translator$
|
|
8593
|
+
const runProperties = translator$1Q.encode({ ...params, nodes: [rPr] });
|
|
8540
8594
|
submarks = encodeMarksFromRPr(runProperties, params?.docx);
|
|
8541
8595
|
}
|
|
8542
8596
|
return [{ type: TrackFormatMarkName, attrs: { ...mappedAttributes, before: submarks, after: [...currentMarks] } }];
|
|
@@ -8705,7 +8759,7 @@ const handleParagraphNode$1 = (params) => {
|
|
|
8705
8759
|
const pPr = node.elements?.find((el) => el.name === "w:pPr");
|
|
8706
8760
|
let inlineParagraphProperties = {};
|
|
8707
8761
|
if (pPr) {
|
|
8708
|
-
inlineParagraphProperties = translator$
|
|
8762
|
+
inlineParagraphProperties = translator$16.encode({ ...params, nodes: [pPr] }) || {};
|
|
8709
8763
|
}
|
|
8710
8764
|
const insideTable = (params.path || []).some((ancestor) => ancestor.name === "w:tc");
|
|
8711
8765
|
const tableStyleId = getTableStyleId(params.path || []);
|
|
@@ -8760,7 +8814,7 @@ function generateParagraphProperties(params) {
|
|
|
8760
8814
|
const { node } = params;
|
|
8761
8815
|
const { attrs = {} } = node;
|
|
8762
8816
|
const paragraphProperties = carbonCopy(attrs.paragraphProperties || {});
|
|
8763
|
-
let pPr = translator$
|
|
8817
|
+
let pPr = translator$16.decode({ node: { ...node, attrs: { paragraphProperties } } });
|
|
8764
8818
|
const sectPr = node.attrs?.paragraphProperties?.sectPr;
|
|
8765
8819
|
if (sectPr) {
|
|
8766
8820
|
if (!pPr) {
|
|
@@ -8793,102 +8847,102 @@ function translateParagraphNode(params) {
|
|
|
8793
8847
|
};
|
|
8794
8848
|
return result;
|
|
8795
8849
|
}
|
|
8796
|
-
const encode$
|
|
8850
|
+
const encode$M = (attributes) => {
|
|
8797
8851
|
return attributes["w:rsidDel"];
|
|
8798
8852
|
};
|
|
8799
|
-
const decode$
|
|
8853
|
+
const decode$O = (attrs) => {
|
|
8800
8854
|
return attrs.rsidDel;
|
|
8801
8855
|
};
|
|
8802
|
-
const attrConfig$
|
|
8856
|
+
const attrConfig$q = Object.freeze({
|
|
8803
8857
|
xmlName: "w:rsidDel",
|
|
8804
8858
|
sdName: "rsidDel",
|
|
8805
|
-
encode: encode$
|
|
8806
|
-
decode: decode$
|
|
8859
|
+
encode: encode$M,
|
|
8860
|
+
decode: decode$O
|
|
8807
8861
|
});
|
|
8808
|
-
const encode$
|
|
8862
|
+
const encode$L = (attributes) => {
|
|
8809
8863
|
return attributes["w:rsidP"];
|
|
8810
8864
|
};
|
|
8811
|
-
const decode$
|
|
8865
|
+
const decode$N = (attrs) => {
|
|
8812
8866
|
return attrs.rsidP;
|
|
8813
8867
|
};
|
|
8814
|
-
const attrConfig$
|
|
8868
|
+
const attrConfig$p = Object.freeze({
|
|
8815
8869
|
xmlName: "w:rsidP",
|
|
8816
8870
|
sdName: "rsidP",
|
|
8817
|
-
encode: encode$
|
|
8818
|
-
decode: decode$
|
|
8871
|
+
encode: encode$L,
|
|
8872
|
+
decode: decode$N
|
|
8819
8873
|
});
|
|
8820
|
-
const encode$
|
|
8874
|
+
const encode$K = (attributes) => {
|
|
8821
8875
|
return attributes["w:rsidR"];
|
|
8822
8876
|
};
|
|
8823
|
-
const decode$
|
|
8877
|
+
const decode$M = (attrs) => {
|
|
8824
8878
|
return attrs.rsidR;
|
|
8825
8879
|
};
|
|
8826
|
-
const attrConfig$
|
|
8880
|
+
const attrConfig$o = Object.freeze({
|
|
8827
8881
|
xmlName: "w:rsidR",
|
|
8828
8882
|
sdName: "rsidR",
|
|
8829
|
-
encode: encode$
|
|
8830
|
-
decode: decode$
|
|
8883
|
+
encode: encode$K,
|
|
8884
|
+
decode: decode$M
|
|
8831
8885
|
});
|
|
8832
|
-
const encode$
|
|
8886
|
+
const encode$J = (attributes) => {
|
|
8833
8887
|
return attributes["w:rsidRPr"];
|
|
8834
8888
|
};
|
|
8835
|
-
const decode$
|
|
8889
|
+
const decode$L = (attrs) => {
|
|
8836
8890
|
return attrs.rsidRPr;
|
|
8837
8891
|
};
|
|
8838
|
-
const attrConfig$
|
|
8892
|
+
const attrConfig$n = Object.freeze({
|
|
8839
8893
|
xmlName: "w:rsidRPr",
|
|
8840
8894
|
sdName: "rsidRPr",
|
|
8841
|
-
encode: encode$
|
|
8842
|
-
decode: decode$
|
|
8895
|
+
encode: encode$J,
|
|
8896
|
+
decode: decode$L
|
|
8843
8897
|
});
|
|
8844
|
-
const encode$
|
|
8898
|
+
const encode$I = (attributes) => {
|
|
8845
8899
|
return attributes["w:rsidRDefault"];
|
|
8846
8900
|
};
|
|
8847
|
-
const decode$
|
|
8901
|
+
const decode$K = (attrs) => {
|
|
8848
8902
|
return attrs.rsidRDefault;
|
|
8849
8903
|
};
|
|
8850
|
-
const attrConfig$
|
|
8904
|
+
const attrConfig$m = Object.freeze({
|
|
8851
8905
|
xmlName: "w:rsidRDefault",
|
|
8852
8906
|
sdName: "rsidRDefault",
|
|
8853
|
-
encode: encode$
|
|
8854
|
-
decode: decode$
|
|
8907
|
+
encode: encode$I,
|
|
8908
|
+
decode: decode$K
|
|
8855
8909
|
});
|
|
8856
|
-
const encode$
|
|
8910
|
+
const encode$H = (attributes) => {
|
|
8857
8911
|
return attributes["w14:paraId"];
|
|
8858
8912
|
};
|
|
8859
|
-
const decode$
|
|
8913
|
+
const decode$J = (attrs) => {
|
|
8860
8914
|
return attrs.paraId;
|
|
8861
8915
|
};
|
|
8862
|
-
const attrConfig$
|
|
8916
|
+
const attrConfig$l = Object.freeze({
|
|
8863
8917
|
xmlName: "w14:paraId",
|
|
8864
8918
|
sdName: "paraId",
|
|
8865
|
-
encode: encode$
|
|
8866
|
-
decode: decode$
|
|
8919
|
+
encode: encode$H,
|
|
8920
|
+
decode: decode$J
|
|
8867
8921
|
});
|
|
8868
|
-
const encode$
|
|
8922
|
+
const encode$G = (attributes) => {
|
|
8869
8923
|
return attributes["w14:textId"];
|
|
8870
8924
|
};
|
|
8871
|
-
const decode$
|
|
8925
|
+
const decode$I = (attrs) => {
|
|
8872
8926
|
return attrs.textId;
|
|
8873
8927
|
};
|
|
8874
|
-
const attrConfig$
|
|
8928
|
+
const attrConfig$k = Object.freeze({
|
|
8875
8929
|
xmlName: "w14:textId",
|
|
8876
8930
|
sdName: "textId",
|
|
8877
|
-
encode: encode$
|
|
8878
|
-
decode: decode$
|
|
8931
|
+
encode: encode$G,
|
|
8932
|
+
decode: decode$I
|
|
8879
8933
|
});
|
|
8880
8934
|
const validXmlAttributes$d = [
|
|
8881
|
-
attrConfig$
|
|
8882
|
-
attrConfig$i,
|
|
8883
|
-
attrConfig$m,
|
|
8935
|
+
attrConfig$l,
|
|
8884
8936
|
attrConfig$k,
|
|
8937
|
+
attrConfig$o,
|
|
8938
|
+
attrConfig$m,
|
|
8939
|
+
attrConfig$p,
|
|
8885
8940
|
attrConfig$n,
|
|
8886
|
-
attrConfig$
|
|
8887
|
-
attrConfig$o
|
|
8941
|
+
attrConfig$q
|
|
8888
8942
|
];
|
|
8889
|
-
const XML_NODE_NAME$
|
|
8890
|
-
const SD_NODE_NAME$
|
|
8891
|
-
const encode$
|
|
8943
|
+
const XML_NODE_NAME$n = "w:p";
|
|
8944
|
+
const SD_NODE_NAME$k = "paragraph";
|
|
8945
|
+
const encode$F = (params, encodedAttrs = {}) => {
|
|
8892
8946
|
const node = handleParagraphNode$1(params);
|
|
8893
8947
|
if (!node) return void 0;
|
|
8894
8948
|
if (encodedAttrs && Object.keys(encodedAttrs).length) {
|
|
@@ -8896,7 +8950,7 @@ const encode$C = (params, encodedAttrs = {}) => {
|
|
|
8896
8950
|
}
|
|
8897
8951
|
return node;
|
|
8898
8952
|
};
|
|
8899
|
-
const decode$
|
|
8953
|
+
const decode$H = (params, decodedAttrs = {}) => {
|
|
8900
8954
|
const translated = translateParagraphNode(params);
|
|
8901
8955
|
if (!translated) return void 0;
|
|
8902
8956
|
if (decodedAttrs && Object.keys(decodedAttrs).length) {
|
|
@@ -8904,15 +8958,15 @@ const decode$E = (params, decodedAttrs = {}) => {
|
|
|
8904
8958
|
}
|
|
8905
8959
|
return translated;
|
|
8906
8960
|
};
|
|
8907
|
-
const config$
|
|
8908
|
-
xmlName: XML_NODE_NAME$
|
|
8909
|
-
sdNodeOrKeyName: SD_NODE_NAME$
|
|
8961
|
+
const config$m = {
|
|
8962
|
+
xmlName: XML_NODE_NAME$n,
|
|
8963
|
+
sdNodeOrKeyName: SD_NODE_NAME$k,
|
|
8910
8964
|
type: NodeTranslator.translatorTypes.NODE,
|
|
8911
|
-
encode: encode$
|
|
8912
|
-
decode: decode$
|
|
8965
|
+
encode: encode$F,
|
|
8966
|
+
decode: decode$H,
|
|
8913
8967
|
attributes: validXmlAttributes$d
|
|
8914
8968
|
};
|
|
8915
|
-
const translator$
|
|
8969
|
+
const translator$15 = NodeTranslator.from(config$m);
|
|
8916
8970
|
const EAST_ASIAN_CHARACTER_REGEX = /[\u1100-\u11FF\u2E80-\u2EFF\u2F00-\u2FDF\u3040-\u30FF\u3100-\u312F\u3130-\u318F\u31A0-\u31BF\u3400-\u4DBF\u4E00-\u9FFF\uA960-\uA97F\uAC00-\uD7AF\uF900-\uFAFF\uFF00-\uFFEF]/u;
|
|
8917
8971
|
const containsEastAsianCharacters = (text) => EAST_ASIAN_CHARACTER_REGEX.test(text);
|
|
8918
8972
|
const resolveFontFamily = (textStyleAttrs, text) => {
|
|
@@ -9085,8 +9139,8 @@ function generateRandom32BitHex() {
|
|
|
9085
9139
|
const val = Math.floor(Math.random() * 2147483647);
|
|
9086
9140
|
return val.toString(16).toUpperCase().padStart(8, "0");
|
|
9087
9141
|
}
|
|
9088
|
-
const XML_NODE_NAME$
|
|
9089
|
-
const SD_NODE_NAME$
|
|
9142
|
+
const XML_NODE_NAME$m = "w:hyperlink";
|
|
9143
|
+
const SD_NODE_NAME$j = "link";
|
|
9090
9144
|
const _createAttributeHandler = (xmlName, sdName) => ({
|
|
9091
9145
|
xmlName,
|
|
9092
9146
|
sdName,
|
|
@@ -9106,10 +9160,10 @@ const validXmlAttributes$c = [
|
|
|
9106
9160
|
_createAttributeHandler("r:id", "rId"),
|
|
9107
9161
|
_createAttributeHandler("w:tgtFrame", "target")
|
|
9108
9162
|
];
|
|
9109
|
-
const encode$
|
|
9163
|
+
const encode$E = (params, encodedAttrs) => {
|
|
9110
9164
|
const { nodes, docx, nodeListHandler } = params;
|
|
9111
9165
|
const node = nodes[0];
|
|
9112
|
-
let href = _resolveHref(docx, encodedAttrs);
|
|
9166
|
+
let href = _resolveHref(docx, encodedAttrs, params.filename);
|
|
9113
9167
|
const linkMark = { type: "link", attrs: { ...encodedAttrs, href } };
|
|
9114
9168
|
const referenceNodeTypes = ["sd:pageReference", "sd:autoPageNumber", "sd:totalPageNumber"];
|
|
9115
9169
|
const contentNodes = node.elements.filter((el) => el.name === "w:r" || referenceNodeTypes.includes(el.name));
|
|
@@ -9125,22 +9179,24 @@ const encode$B = (params, encodedAttrs) => {
|
|
|
9125
9179
|
});
|
|
9126
9180
|
return updatedNode;
|
|
9127
9181
|
};
|
|
9128
|
-
const _resolveHref = (docx, encodedAttrs) => {
|
|
9129
|
-
const
|
|
9130
|
-
|
|
9131
|
-
|
|
9182
|
+
const _resolveHref = (docx, encodedAttrs, filename) => {
|
|
9183
|
+
const currentFile = filename || "document.xml";
|
|
9184
|
+
let rels = docx?.[`word/_rels/${currentFile}.rels`];
|
|
9185
|
+
if (!rels) rels = docx?.["word/_rels/document.xml.rels"];
|
|
9186
|
+
const relationships = rels?.elements?.find((el) => el.name === "Relationships");
|
|
9187
|
+
const elements = relationships?.elements || [];
|
|
9132
9188
|
const { rId, anchor } = encodedAttrs;
|
|
9133
9189
|
let href;
|
|
9134
9190
|
if (!rId && anchor) {
|
|
9135
9191
|
href = `#${anchor}`;
|
|
9136
9192
|
} else if (rId) {
|
|
9137
|
-
const rel = elements.find((el) => el.attributes["Id"] === rId) || {};
|
|
9193
|
+
const rel = elements.find((el) => el.attributes?.["Id"] === rId) || {};
|
|
9138
9194
|
const { attributes: relAttributes = {} } = rel;
|
|
9139
9195
|
href = relAttributes["Target"];
|
|
9140
9196
|
}
|
|
9141
9197
|
return href;
|
|
9142
9198
|
};
|
|
9143
|
-
function decode$
|
|
9199
|
+
function decode$G(params) {
|
|
9144
9200
|
const { hyperlinkGroup = [params.node] } = params.extraParams || {};
|
|
9145
9201
|
const node = hyperlinkGroup[0];
|
|
9146
9202
|
const linkMark = node.marks.find((m2) => m2.type === "link");
|
|
@@ -9189,53 +9245,53 @@ function _addNewLinkRelationship(params, link) {
|
|
|
9189
9245
|
});
|
|
9190
9246
|
return `rId${id}`;
|
|
9191
9247
|
}
|
|
9192
|
-
const config$
|
|
9193
|
-
xmlName: XML_NODE_NAME$
|
|
9194
|
-
sdNodeOrKeyName: SD_NODE_NAME$
|
|
9248
|
+
const config$l = {
|
|
9249
|
+
xmlName: XML_NODE_NAME$m,
|
|
9250
|
+
sdNodeOrKeyName: SD_NODE_NAME$j,
|
|
9195
9251
|
type: NodeTranslator.translatorTypes.NODE,
|
|
9196
|
-
encode: encode$
|
|
9197
|
-
decode: decode$
|
|
9252
|
+
encode: encode$E,
|
|
9253
|
+
decode: decode$G,
|
|
9198
9254
|
attributes: validXmlAttributes$c
|
|
9199
9255
|
};
|
|
9200
|
-
const translator$
|
|
9201
|
-
const encode$
|
|
9256
|
+
const translator$14 = NodeTranslator.from(config$l);
|
|
9257
|
+
const encode$D = (attributes) => {
|
|
9202
9258
|
return attributes["w:rsidR"];
|
|
9203
9259
|
};
|
|
9204
|
-
const decode$
|
|
9260
|
+
const decode$F = (attrs) => {
|
|
9205
9261
|
return attrs.rsidR;
|
|
9206
9262
|
};
|
|
9207
|
-
const attrConfig$
|
|
9263
|
+
const attrConfig$j = Object.freeze({
|
|
9208
9264
|
xmlName: "w:rsidR",
|
|
9209
9265
|
sdName: "rsidR",
|
|
9210
|
-
encode: encode$
|
|
9211
|
-
decode: decode$
|
|
9266
|
+
encode: encode$D,
|
|
9267
|
+
decode: decode$F
|
|
9212
9268
|
});
|
|
9213
|
-
const encode$
|
|
9269
|
+
const encode$C = (attributes) => {
|
|
9214
9270
|
return attributes["w:rsidRPr"];
|
|
9215
9271
|
};
|
|
9216
|
-
const decode$
|
|
9272
|
+
const decode$E = (attrs) => {
|
|
9217
9273
|
return attrs.rsidRPr;
|
|
9218
9274
|
};
|
|
9219
|
-
const attrConfig$
|
|
9275
|
+
const attrConfig$i = Object.freeze({
|
|
9220
9276
|
xmlName: "w:rsidRPr",
|
|
9221
9277
|
sdName: "rsidRPr",
|
|
9222
|
-
encode: encode$
|
|
9223
|
-
decode: decode$
|
|
9278
|
+
encode: encode$C,
|
|
9279
|
+
decode: decode$E
|
|
9224
9280
|
});
|
|
9225
|
-
const encode$
|
|
9281
|
+
const encode$B = (attributes) => {
|
|
9226
9282
|
return attributes["w:rsidDel"];
|
|
9227
9283
|
};
|
|
9228
|
-
const decode$
|
|
9284
|
+
const decode$D = (attrs) => {
|
|
9229
9285
|
return attrs.rsidDel;
|
|
9230
9286
|
};
|
|
9231
|
-
const attrConfig$
|
|
9287
|
+
const attrConfig$h = Object.freeze({
|
|
9232
9288
|
xmlName: "w:rsidDel",
|
|
9233
9289
|
sdName: "rsidDel",
|
|
9234
|
-
encode: encode$
|
|
9235
|
-
decode: decode$
|
|
9290
|
+
encode: encode$B,
|
|
9291
|
+
decode: decode$D
|
|
9236
9292
|
});
|
|
9237
|
-
const validXmlAttributes$b = [attrConfig$
|
|
9238
|
-
const XML_NODE_NAME$
|
|
9293
|
+
const validXmlAttributes$b = [attrConfig$j, attrConfig$i, attrConfig$h];
|
|
9294
|
+
const XML_NODE_NAME$l = "w:r";
|
|
9239
9295
|
const SD_KEY_NAME = "run";
|
|
9240
9296
|
const createRunNodeWithContent = (content, encodedAttrs, runLevelMarks, runProperties) => {
|
|
9241
9297
|
const node = {
|
|
@@ -9248,13 +9304,13 @@ const createRunNodeWithContent = (content, encodedAttrs, runLevelMarks, runPrope
|
|
|
9248
9304
|
}
|
|
9249
9305
|
return node;
|
|
9250
9306
|
};
|
|
9251
|
-
const encode$
|
|
9307
|
+
const encode$A = (params, encodedAttrs = {}) => {
|
|
9252
9308
|
const { nodes = [], nodeListHandler } = params || {};
|
|
9253
9309
|
const runNode = nodes[0];
|
|
9254
9310
|
if (!runNode) return void 0;
|
|
9255
9311
|
const elements = Array.isArray(runNode.elements) ? runNode.elements : [];
|
|
9256
9312
|
const rPrNode = elements.find((child) => child?.name === "w:rPr");
|
|
9257
|
-
const runProperties = rPrNode ? translator$
|
|
9313
|
+
const runProperties = rPrNode ? translator$1Q.encode({ ...params, nodes: [rPrNode] }) : {};
|
|
9258
9314
|
const paragraphProperties = params?.extraParams?.paragraphProperties || {};
|
|
9259
9315
|
const resolvedRunProperties = resolveRunProperties(params, runProperties ?? {}, paragraphProperties);
|
|
9260
9316
|
const marksResult = encodeMarksFromRPr(resolvedRunProperties, params?.docx);
|
|
@@ -9317,7 +9373,7 @@ const encode$x = (params, encodedAttrs = {}) => {
|
|
|
9317
9373
|
finalizeTextChunk();
|
|
9318
9374
|
return splitRuns;
|
|
9319
9375
|
};
|
|
9320
|
-
const decode$
|
|
9376
|
+
const decode$C = (params, decodedAttrs = {}) => {
|
|
9321
9377
|
const { node } = params || {};
|
|
9322
9378
|
if (!node) return void 0;
|
|
9323
9379
|
const isLinkNode = node.marks?.some((m2) => m2.type === "link");
|
|
@@ -9326,7 +9382,7 @@ const decode$z = (params, decodedAttrs = {}) => {
|
|
|
9326
9382
|
...params.extraParams,
|
|
9327
9383
|
linkProcessed: true
|
|
9328
9384
|
};
|
|
9329
|
-
return translator$
|
|
9385
|
+
return translator$14.decode({ ...params, extraParams });
|
|
9330
9386
|
}
|
|
9331
9387
|
const { runNode: runNodeForExport, trackingMarksByType } = prepareRunTrackingContext(node);
|
|
9332
9388
|
const runAttrs = runNodeForExport.attrs || {};
|
|
@@ -9340,7 +9396,7 @@ const decode$z = (params, decodedAttrs = {}) => {
|
|
|
9340
9396
|
exportParams.editor = { extensionService: { extensions: [] } };
|
|
9341
9397
|
}
|
|
9342
9398
|
const childElements = translateChildNodes(exportParams) || [];
|
|
9343
|
-
let runPropertiesElement = translator$
|
|
9399
|
+
let runPropertiesElement = translator$1Q.decode({
|
|
9344
9400
|
...params,
|
|
9345
9401
|
node: { attrs: { runProperties } }
|
|
9346
9402
|
});
|
|
@@ -9388,7 +9444,7 @@ const decode$z = (params, decodedAttrs = {}) => {
|
|
|
9388
9444
|
runs.push(commentRangeClone);
|
|
9389
9445
|
return;
|
|
9390
9446
|
}
|
|
9391
|
-
const runWrapper = { name: XML_NODE_NAME$
|
|
9447
|
+
const runWrapper = { name: XML_NODE_NAME$l, elements: [] };
|
|
9392
9448
|
applyBaseRunProps(runWrapper);
|
|
9393
9449
|
if (!Array.isArray(runWrapper.elements)) runWrapper.elements = [];
|
|
9394
9450
|
runWrapper.elements.push(cloneXmlNode(child));
|
|
@@ -9396,7 +9452,7 @@ const decode$z = (params, decodedAttrs = {}) => {
|
|
|
9396
9452
|
});
|
|
9397
9453
|
const trackedRuns = ensureTrackedWrapper(runs, trackingMarksByType);
|
|
9398
9454
|
if (!trackedRuns.length) {
|
|
9399
|
-
const emptyRun = { name: XML_NODE_NAME$
|
|
9455
|
+
const emptyRun = { name: XML_NODE_NAME$l, elements: [] };
|
|
9400
9456
|
applyBaseRunProps(emptyRun);
|
|
9401
9457
|
trackedRuns.push(emptyRun);
|
|
9402
9458
|
}
|
|
@@ -9410,17 +9466,17 @@ const decode$z = (params, decodedAttrs = {}) => {
|
|
|
9410
9466
|
}
|
|
9411
9467
|
return trackedRuns;
|
|
9412
9468
|
};
|
|
9413
|
-
const config$
|
|
9414
|
-
xmlName: XML_NODE_NAME$
|
|
9469
|
+
const config$k = {
|
|
9470
|
+
xmlName: XML_NODE_NAME$l,
|
|
9415
9471
|
sdNodeOrKeyName: SD_KEY_NAME,
|
|
9416
9472
|
type: NodeTranslator.translatorTypes.NODE,
|
|
9417
|
-
encode: encode$
|
|
9418
|
-
decode: decode$
|
|
9473
|
+
encode: encode$A,
|
|
9474
|
+
decode: decode$C,
|
|
9419
9475
|
attributes: validXmlAttributes$b
|
|
9420
9476
|
};
|
|
9421
|
-
const translator$
|
|
9422
|
-
const translator$
|
|
9423
|
-
const translator$
|
|
9477
|
+
const translator$13 = NodeTranslator.from(config$k);
|
|
9478
|
+
const translator$12 = NodeTranslator.from(createMeasurementPropertyHandler("w:tcW", "cellWidth"));
|
|
9479
|
+
const translator$11 = NodeTranslator.from(
|
|
9424
9480
|
createSingleAttrPropertyHandler(
|
|
9425
9481
|
"w:gridSpan",
|
|
9426
9482
|
null,
|
|
@@ -9429,33 +9485,33 @@ const translator$10 = NodeTranslator.from(
|
|
|
9429
9485
|
(v2) => integerToString(v2)
|
|
9430
9486
|
)
|
|
9431
9487
|
);
|
|
9432
|
-
const translator
|
|
9488
|
+
const translator$10 = NodeTranslator.from(
|
|
9433
9489
|
createSingleAttrPropertyHandler("w:vMerge", null, "w:val", (val) => !val ? "continue" : val)
|
|
9434
9490
|
);
|
|
9435
|
-
const translator
|
|
9436
|
-
const translator$
|
|
9437
|
-
const translator$
|
|
9438
|
-
const translator$
|
|
9439
|
-
const translator$
|
|
9440
|
-
const translator$
|
|
9441
|
-
const translator$
|
|
9442
|
-
const translator$
|
|
9491
|
+
const translator$$ = NodeTranslator.from(createBorderPropertyHandler("w:end"));
|
|
9492
|
+
const translator$_ = NodeTranslator.from(createMeasurementPropertyHandler("w:end", "marginEnd"));
|
|
9493
|
+
const translator$Z = NodeTranslator.from(createBorderPropertyHandler("w:insideH"));
|
|
9494
|
+
const translator$Y = NodeTranslator.from(createBorderPropertyHandler("w:insideV"));
|
|
9495
|
+
const translator$X = NodeTranslator.from(createBorderPropertyHandler("w:start"));
|
|
9496
|
+
const translator$W = NodeTranslator.from(createMeasurementPropertyHandler("w:start", "marginStart"));
|
|
9497
|
+
const translator$V = NodeTranslator.from(createBorderPropertyHandler("w:tl2br"));
|
|
9498
|
+
const translator$U = NodeTranslator.from(createBorderPropertyHandler("w:tr2bl"));
|
|
9443
9499
|
const propertyTranslators$7 = [
|
|
9444
|
-
translator$
|
|
9445
|
-
translator$W,
|
|
9446
|
-
translator$1p,
|
|
9447
|
-
translator$1r,
|
|
9448
|
-
translator$_,
|
|
9449
|
-
translator$1n,
|
|
9450
|
-
translator$Y,
|
|
9500
|
+
translator$1m,
|
|
9451
9501
|
translator$X,
|
|
9452
|
-
translator$
|
|
9453
|
-
translator$
|
|
9502
|
+
translator$1q,
|
|
9503
|
+
translator$1s,
|
|
9504
|
+
translator$$,
|
|
9505
|
+
translator$1o,
|
|
9506
|
+
translator$Z,
|
|
9507
|
+
translator$Y,
|
|
9508
|
+
translator$V,
|
|
9509
|
+
translator$U
|
|
9454
9510
|
];
|
|
9455
|
-
const translator$
|
|
9511
|
+
const translator$T = NodeTranslator.from(
|
|
9456
9512
|
createNestedPropertiesTranslator("w:tcBorders", "borders", propertyTranslators$7)
|
|
9457
9513
|
);
|
|
9458
|
-
const translator$
|
|
9514
|
+
const translator$S = NodeTranslator.from(
|
|
9459
9515
|
createSingleAttrPropertyHandler(
|
|
9460
9516
|
"w:noWrap",
|
|
9461
9517
|
null,
|
|
@@ -9465,17 +9521,17 @@ const translator$R = NodeTranslator.from(
|
|
|
9465
9521
|
)
|
|
9466
9522
|
);
|
|
9467
9523
|
const propertyTranslators$6 = [
|
|
9468
|
-
translator$
|
|
9469
|
-
translator$
|
|
9470
|
-
translator$
|
|
9471
|
-
translator$
|
|
9472
|
-
translator$
|
|
9473
|
-
translator$
|
|
9524
|
+
translator$1r,
|
|
9525
|
+
translator$_,
|
|
9526
|
+
translator$1p,
|
|
9527
|
+
translator$1n,
|
|
9528
|
+
translator$W,
|
|
9529
|
+
translator$1l
|
|
9474
9530
|
];
|
|
9475
|
-
const translator$
|
|
9531
|
+
const translator$R = NodeTranslator.from(
|
|
9476
9532
|
createNestedPropertiesTranslator("w:tcMar", "cellMargins", propertyTranslators$6)
|
|
9477
9533
|
);
|
|
9478
|
-
const translator$
|
|
9534
|
+
const translator$Q = NodeTranslator.from(
|
|
9479
9535
|
createSingleAttrPropertyHandler(
|
|
9480
9536
|
"w:tcFitText",
|
|
9481
9537
|
null,
|
|
@@ -9484,8 +9540,8 @@ const translator$P = NodeTranslator.from(
|
|
|
9484
9540
|
(v2) => booleanToString(v2)
|
|
9485
9541
|
)
|
|
9486
9542
|
);
|
|
9487
|
-
const translator$
|
|
9488
|
-
const translator$
|
|
9543
|
+
const translator$P = NodeTranslator.from(createSingleAttrPropertyHandler("w:vAlign"));
|
|
9544
|
+
const translator$O = NodeTranslator.from(
|
|
9489
9545
|
createSingleAttrPropertyHandler(
|
|
9490
9546
|
"w:hideMark",
|
|
9491
9547
|
null,
|
|
@@ -9494,26 +9550,26 @@ const translator$N = NodeTranslator.from(
|
|
|
9494
9550
|
(v2) => booleanToString(v2)
|
|
9495
9551
|
)
|
|
9496
9552
|
);
|
|
9497
|
-
const translator$
|
|
9498
|
-
const translator$
|
|
9499
|
-
createNestedArrayPropertyHandler("w:headers", "headers", [translator$
|
|
9553
|
+
const translator$N = NodeTranslator.from(createSingleAttrPropertyHandler("w:header"));
|
|
9554
|
+
const translator$M = NodeTranslator.from(
|
|
9555
|
+
createNestedArrayPropertyHandler("w:headers", "headers", [translator$N])
|
|
9500
9556
|
);
|
|
9501
9557
|
const propertyTranslators$5 = [
|
|
9502
|
-
translator$
|
|
9558
|
+
translator$1K,
|
|
9559
|
+
translator$12,
|
|
9503
9560
|
translator$11,
|
|
9504
9561
|
translator$10,
|
|
9505
|
-
translator
|
|
9562
|
+
translator$T,
|
|
9563
|
+
translator$2d,
|
|
9506
9564
|
translator$S,
|
|
9507
|
-
translator$2c,
|
|
9508
9565
|
translator$R,
|
|
9566
|
+
translator$1b,
|
|
9509
9567
|
translator$Q,
|
|
9510
|
-
translator$1a,
|
|
9511
9568
|
translator$P,
|
|
9512
9569
|
translator$O,
|
|
9513
|
-
translator$
|
|
9514
|
-
translator$L
|
|
9570
|
+
translator$M
|
|
9515
9571
|
];
|
|
9516
|
-
const translator$
|
|
9572
|
+
const translator$L = NodeTranslator.from(
|
|
9517
9573
|
createNestedPropertiesTranslator("w:tcPr", "tableCellProperties", propertyTranslators$5)
|
|
9518
9574
|
);
|
|
9519
9575
|
function handleTableCellNode({
|
|
@@ -9537,7 +9593,7 @@ function handleTableCellNode({
|
|
|
9537
9593
|
const attributes = {};
|
|
9538
9594
|
const referencedStyles = _referencedStyles ?? { fontSize: null, fonts: {}, cellMargins: {} };
|
|
9539
9595
|
const tcPr = node.elements.find((el) => el.name === "w:tcPr");
|
|
9540
|
-
const tableCellProperties = tcPr ? translator$
|
|
9596
|
+
const tableCellProperties = tcPr ? translator$L.encode({ ...params, nodes: [tcPr] }) ?? {} : {};
|
|
9541
9597
|
attributes["tableCellProperties"] = tableCellProperties;
|
|
9542
9598
|
const effectiveTotalColumns = totalColumns ?? (allColumnWidths.length || 1);
|
|
9543
9599
|
const effectiveTotalRows = totalRows ?? (table?.elements?.filter((el) => el.name === "w:tr").length || 1);
|
|
@@ -9941,13 +9997,13 @@ function generateTableCellProperties(node) {
|
|
|
9941
9997
|
} else if (tableCellProperties?.borders) {
|
|
9942
9998
|
delete tableCellProperties.borders;
|
|
9943
9999
|
}
|
|
9944
|
-
const result = translator$
|
|
10000
|
+
const result = translator$L.decode({ node: { ...node, attrs: { ...node.attrs, tableCellProperties } } });
|
|
9945
10001
|
return result;
|
|
9946
10002
|
}
|
|
9947
|
-
const XML_NODE_NAME$
|
|
9948
|
-
const SD_NODE_NAME$
|
|
10003
|
+
const XML_NODE_NAME$k = "w:tc";
|
|
10004
|
+
const SD_NODE_NAME$i = "tableCell";
|
|
9949
10005
|
const validXmlAttributes$a = [];
|
|
9950
|
-
function encode$
|
|
10006
|
+
function encode$z(params, encodedAttrs) {
|
|
9951
10007
|
const {
|
|
9952
10008
|
node,
|
|
9953
10009
|
table,
|
|
@@ -9986,42 +10042,42 @@ function encode$w(params, encodedAttrs) {
|
|
|
9986
10042
|
}
|
|
9987
10043
|
return schemaNode;
|
|
9988
10044
|
}
|
|
9989
|
-
function decode$
|
|
10045
|
+
function decode$B(params, decodedAttrs) {
|
|
9990
10046
|
const translated = translateTableCell(params);
|
|
9991
10047
|
if (decodedAttrs && Object.keys(decodedAttrs).length) {
|
|
9992
10048
|
translated.attributes = { ...translated.attributes || {}, ...decodedAttrs };
|
|
9993
10049
|
}
|
|
9994
10050
|
return translated;
|
|
9995
10051
|
}
|
|
9996
|
-
const config$
|
|
9997
|
-
xmlName: XML_NODE_NAME$
|
|
9998
|
-
sdNodeOrKeyName: SD_NODE_NAME$
|
|
10052
|
+
const config$j = {
|
|
10053
|
+
xmlName: XML_NODE_NAME$k,
|
|
10054
|
+
sdNodeOrKeyName: SD_NODE_NAME$i,
|
|
9999
10055
|
type: NodeTranslator.translatorTypes.NODE,
|
|
10000
|
-
encode: encode$
|
|
10001
|
-
decode: decode$
|
|
10056
|
+
encode: encode$z,
|
|
10057
|
+
decode: decode$B,
|
|
10002
10058
|
attributes: validXmlAttributes$a
|
|
10003
10059
|
};
|
|
10004
|
-
const translator$
|
|
10060
|
+
const translator$K = NodeTranslator.from(config$j);
|
|
10005
10061
|
const propertyTranslators$4 = [
|
|
10006
|
-
translator$
|
|
10007
|
-
translator
|
|
10062
|
+
translator$1s,
|
|
10063
|
+
translator$$,
|
|
10064
|
+
translator$Z,
|
|
10008
10065
|
translator$Y,
|
|
10066
|
+
translator$1q,
|
|
10067
|
+
translator$1o,
|
|
10009
10068
|
translator$X,
|
|
10010
|
-
translator$
|
|
10011
|
-
translator$1n,
|
|
10012
|
-
translator$W,
|
|
10013
|
-
translator$1l
|
|
10069
|
+
translator$1m
|
|
10014
10070
|
];
|
|
10015
|
-
const translator$
|
|
10071
|
+
const translator$J = NodeTranslator.from(
|
|
10016
10072
|
createNestedPropertiesTranslator("w:tblBorders", "borders", propertyTranslators$4)
|
|
10017
10073
|
);
|
|
10018
|
-
const translator$
|
|
10074
|
+
const translator$I = NodeTranslator.from({
|
|
10019
10075
|
xmlName: "w:cantSplit",
|
|
10020
10076
|
sdNodeOrKeyName: "cantSplit",
|
|
10021
10077
|
encode: ({ nodes }) => ["1", "true"].includes(nodes[0].attributes?.["w:val"] ?? "1"),
|
|
10022
10078
|
decode: ({ node }) => node.attrs?.cantSplit ? { attributes: {} } : void 0
|
|
10023
10079
|
});
|
|
10024
|
-
const translator$
|
|
10080
|
+
const translator$H = NodeTranslator.from(
|
|
10025
10081
|
createSingleAttrPropertyHandler(
|
|
10026
10082
|
"w:gridAfter",
|
|
10027
10083
|
null,
|
|
@@ -10030,7 +10086,7 @@ const translator$G = NodeTranslator.from(
|
|
|
10030
10086
|
(v2) => integerToString(v2)
|
|
10031
10087
|
)
|
|
10032
10088
|
);
|
|
10033
|
-
const translator$
|
|
10089
|
+
const translator$G = NodeTranslator.from(
|
|
10034
10090
|
createSingleAttrPropertyHandler(
|
|
10035
10091
|
"w:gridBefore",
|
|
10036
10092
|
null,
|
|
@@ -10039,20 +10095,20 @@ const translator$F = NodeTranslator.from(
|
|
|
10039
10095
|
(v2) => integerToString(v2)
|
|
10040
10096
|
)
|
|
10041
10097
|
);
|
|
10042
|
-
const translator$
|
|
10098
|
+
const translator$F = NodeTranslator.from({
|
|
10043
10099
|
xmlName: "w:hidden",
|
|
10044
10100
|
sdNodeOrKeyName: "hidden",
|
|
10045
10101
|
encode: ({ nodes }) => parseBoolean(nodes[0].attributes?.["w:val"] ?? "1"),
|
|
10046
10102
|
decode: ({ node }) => node.attrs.hidden ? { attributes: {} } : void 0
|
|
10047
10103
|
});
|
|
10048
|
-
const translator$
|
|
10049
|
-
const translator$
|
|
10104
|
+
const translator$E = NodeTranslator.from(createMeasurementPropertyHandler("w:tblCellSpacing", "tableCellSpacing"));
|
|
10105
|
+
const translator$D = NodeTranslator.from({
|
|
10050
10106
|
xmlName: "w:tblHeader",
|
|
10051
10107
|
sdNodeOrKeyName: "repeatHeader",
|
|
10052
10108
|
encode: ({ nodes }) => parseBoolean(nodes[0].attributes?.["w:val"] ?? "1"),
|
|
10053
10109
|
decode: ({ node }) => node.attrs.repeatHeader ? { attributes: {} } : void 0
|
|
10054
10110
|
});
|
|
10055
|
-
const translator$
|
|
10111
|
+
const translator$C = NodeTranslator.from({
|
|
10056
10112
|
xmlName: "w:trHeight",
|
|
10057
10113
|
sdNodeOrKeyName: "rowHeight",
|
|
10058
10114
|
encode: ({ nodes }) => {
|
|
@@ -10079,23 +10135,23 @@ const translator$B = NodeTranslator.from({
|
|
|
10079
10135
|
return Object.keys(heightAttrs).length > 0 ? { attributes: heightAttrs } : void 0;
|
|
10080
10136
|
}
|
|
10081
10137
|
});
|
|
10082
|
-
const translator$
|
|
10083
|
-
const translator$
|
|
10138
|
+
const translator$B = NodeTranslator.from(createMeasurementPropertyHandler("w:wAfter"));
|
|
10139
|
+
const translator$A = NodeTranslator.from(createMeasurementPropertyHandler("w:wBefore"));
|
|
10084
10140
|
const propertyTranslators$3 = [
|
|
10141
|
+
translator$I,
|
|
10142
|
+
translator$1K,
|
|
10143
|
+
translator$1I,
|
|
10085
10144
|
translator$H,
|
|
10086
|
-
translator$1J,
|
|
10087
|
-
translator$1H,
|
|
10088
10145
|
translator$G,
|
|
10089
10146
|
translator$F,
|
|
10147
|
+
translator$1F,
|
|
10090
10148
|
translator$E,
|
|
10091
|
-
translator$1E,
|
|
10092
10149
|
translator$D,
|
|
10093
10150
|
translator$C,
|
|
10094
10151
|
translator$B,
|
|
10095
|
-
translator$A
|
|
10096
|
-
translator$z
|
|
10152
|
+
translator$A
|
|
10097
10153
|
];
|
|
10098
|
-
const translator$
|
|
10154
|
+
const translator$z = NodeTranslator.from(
|
|
10099
10155
|
createNestedPropertiesTranslator("w:trPr", "tableRowProperties", propertyTranslators$3, {
|
|
10100
10156
|
cantSplit: false,
|
|
10101
10157
|
hidden: false,
|
|
@@ -10164,8 +10220,8 @@ const isPlaceholderCell = (cell) => {
|
|
|
10164
10220
|
}
|
|
10165
10221
|
return false;
|
|
10166
10222
|
};
|
|
10167
|
-
const XML_NODE_NAME$
|
|
10168
|
-
const SD_NODE_NAME$
|
|
10223
|
+
const XML_NODE_NAME$j = "w:tr";
|
|
10224
|
+
const SD_NODE_NAME$h = "tableRow";
|
|
10169
10225
|
const validXmlAttributes$9 = ["w:rsidDel", "w:rsidR", "w:rsidRPr", "w:rsidTr", "w14:paraId", "w14:textId"].map(
|
|
10170
10226
|
(xmlName) => createAttributeHandler(xmlName)
|
|
10171
10227
|
);
|
|
@@ -10174,12 +10230,12 @@ const getColspan$1 = (cell) => {
|
|
|
10174
10230
|
const numericColspan = typeof rawColspan === "string" ? parseInt(rawColspan, 10) : rawColspan;
|
|
10175
10231
|
return Number.isFinite(numericColspan) && numericColspan > 0 ? numericColspan : 1;
|
|
10176
10232
|
};
|
|
10177
|
-
const encode$
|
|
10233
|
+
const encode$y = (params, encodedAttrs) => {
|
|
10178
10234
|
const { row, tableLook } = params.extraParams;
|
|
10179
10235
|
let tableRowProperties = {};
|
|
10180
10236
|
const tPr = row.elements.find((el) => el.name === "w:trPr");
|
|
10181
10237
|
if (tPr) {
|
|
10182
|
-
tableRowProperties = translator$
|
|
10238
|
+
tableRowProperties = translator$z.encode({
|
|
10183
10239
|
...params,
|
|
10184
10240
|
nodes: [tPr]
|
|
10185
10241
|
});
|
|
@@ -10223,7 +10279,7 @@ const encode$v = (params, encodedAttrs) => {
|
|
|
10223
10279
|
skipOccupiedColumns();
|
|
10224
10280
|
const startColumn = currentColumnIndex;
|
|
10225
10281
|
const columnWidth = gridColumnWidths?.[startColumn] || null;
|
|
10226
|
-
const result = translator$
|
|
10282
|
+
const result = translator$K.encode({
|
|
10227
10283
|
...params,
|
|
10228
10284
|
path: [...params.path || [], node],
|
|
10229
10285
|
extraParams: {
|
|
@@ -10275,7 +10331,7 @@ function getRowBorders({ params, row, baseBorders }) {
|
|
|
10275
10331
|
if (!tblBorders) {
|
|
10276
10332
|
return rowBaseBorders;
|
|
10277
10333
|
}
|
|
10278
|
-
const rawOverrides = translator$
|
|
10334
|
+
const rawOverrides = translator$J.encode({ ...params, nodes: [tblBorders] }) || {};
|
|
10279
10335
|
const overrides = processRawTableBorders(rawOverrides);
|
|
10280
10336
|
if (!Object.keys(overrides).length) {
|
|
10281
10337
|
console.info(
|
|
@@ -10305,7 +10361,7 @@ function processRawTableBorders(rawBorders) {
|
|
|
10305
10361
|
});
|
|
10306
10362
|
return borders;
|
|
10307
10363
|
}
|
|
10308
|
-
const decode$
|
|
10364
|
+
const decode$A = (params, decodedAttrs) => {
|
|
10309
10365
|
const { node } = params;
|
|
10310
10366
|
const cells = node.content || [];
|
|
10311
10367
|
let leadingPlaceholders = 0;
|
|
@@ -10365,7 +10421,7 @@ const decode$x = (params, decodedAttrs) => {
|
|
|
10365
10421
|
}
|
|
10366
10422
|
}
|
|
10367
10423
|
tableRowProperties["cantSplit"] = node.attrs["cantSplit"];
|
|
10368
|
-
const trPr = translator$
|
|
10424
|
+
const trPr = translator$z.decode({
|
|
10369
10425
|
...params,
|
|
10370
10426
|
node: { ...node, attrs: { ...node.attrs, tableRowProperties } }
|
|
10371
10427
|
});
|
|
@@ -10377,15 +10433,15 @@ const decode$x = (params, decodedAttrs) => {
|
|
|
10377
10433
|
elements
|
|
10378
10434
|
};
|
|
10379
10435
|
};
|
|
10380
|
-
const config$
|
|
10381
|
-
xmlName: XML_NODE_NAME$
|
|
10382
|
-
sdNodeOrKeyName: SD_NODE_NAME$
|
|
10436
|
+
const config$i = {
|
|
10437
|
+
xmlName: XML_NODE_NAME$j,
|
|
10438
|
+
sdNodeOrKeyName: SD_NODE_NAME$h,
|
|
10383
10439
|
type: NodeTranslator.translatorTypes.NODE,
|
|
10384
|
-
encode: encode$
|
|
10385
|
-
decode: decode$
|
|
10440
|
+
encode: encode$y,
|
|
10441
|
+
decode: decode$A,
|
|
10386
10442
|
attributes: validXmlAttributes$9
|
|
10387
10443
|
};
|
|
10388
|
-
const translator$
|
|
10444
|
+
const translator$y = NodeTranslator.from(config$i);
|
|
10389
10445
|
function parseTagValueJSON(json) {
|
|
10390
10446
|
if (typeof json !== "string") {
|
|
10391
10447
|
return {};
|
|
@@ -25076,8 +25132,8 @@ function translateAnchorNode(params) {
|
|
|
25076
25132
|
elements: mergedElements
|
|
25077
25133
|
};
|
|
25078
25134
|
}
|
|
25079
|
-
const XML_NODE_NAME$
|
|
25080
|
-
const SD_NODE_NAME$
|
|
25135
|
+
const XML_NODE_NAME$i = "wp:anchor";
|
|
25136
|
+
const SD_NODE_NAME$g = ["image", "shapeGroup", "vectorShape", "contentBlock"];
|
|
25081
25137
|
const validXmlAttributes$8 = [
|
|
25082
25138
|
"distT",
|
|
25083
25139
|
"distB",
|
|
@@ -25092,29 +25148,29 @@ const validXmlAttributes$8 = [
|
|
|
25092
25148
|
"wp14:anchorId",
|
|
25093
25149
|
"wp14:editId"
|
|
25094
25150
|
].map((xmlName) => createAttributeHandler(xmlName));
|
|
25095
|
-
function encode$
|
|
25151
|
+
function encode$x(params) {
|
|
25096
25152
|
const { node } = params.extraParams;
|
|
25097
25153
|
if (!node || !node.name) {
|
|
25098
25154
|
return null;
|
|
25099
25155
|
}
|
|
25100
25156
|
return handleAnchorNode(params);
|
|
25101
25157
|
}
|
|
25102
|
-
function decode$
|
|
25158
|
+
function decode$z(params) {
|
|
25103
25159
|
const { node } = params;
|
|
25104
25160
|
if (!node || !node.type) {
|
|
25105
25161
|
return null;
|
|
25106
25162
|
}
|
|
25107
25163
|
return translateAnchorNode(params);
|
|
25108
25164
|
}
|
|
25109
|
-
const config$
|
|
25110
|
-
xmlName: XML_NODE_NAME$
|
|
25111
|
-
sdNodeOrKeyName: SD_NODE_NAME$
|
|
25165
|
+
const config$h = {
|
|
25166
|
+
xmlName: XML_NODE_NAME$i,
|
|
25167
|
+
sdNodeOrKeyName: SD_NODE_NAME$g,
|
|
25112
25168
|
type: NodeTranslator.translatorTypes.NODE,
|
|
25113
|
-
encode: encode$
|
|
25114
|
-
decode: decode$
|
|
25169
|
+
encode: encode$x,
|
|
25170
|
+
decode: decode$z,
|
|
25115
25171
|
attributes: validXmlAttributes$8
|
|
25116
25172
|
};
|
|
25117
|
-
const translator$
|
|
25173
|
+
const translator$x = NodeTranslator.from(config$h);
|
|
25118
25174
|
function handleInlineNode(params) {
|
|
25119
25175
|
const { node } = params.extraParams;
|
|
25120
25176
|
if (node.name !== "wp:inline") {
|
|
@@ -25141,43 +25197,43 @@ function translateInlineNode(params) {
|
|
|
25141
25197
|
elements: mergedElements
|
|
25142
25198
|
};
|
|
25143
25199
|
}
|
|
25144
|
-
const XML_NODE_NAME$
|
|
25145
|
-
const SD_NODE_NAME$
|
|
25200
|
+
const XML_NODE_NAME$h = "wp:inline";
|
|
25201
|
+
const SD_NODE_NAME$f = ["image", "shapeGroup", "vectorShape", "contentBlock"];
|
|
25146
25202
|
const validXmlAttributes$7 = ["distT", "distB", "distL", "distR", "wp14:anchorId", "wp14:editId"].map(
|
|
25147
25203
|
(xmlName) => createAttributeHandler(xmlName)
|
|
25148
25204
|
);
|
|
25149
|
-
function encode$
|
|
25205
|
+
function encode$w(params) {
|
|
25150
25206
|
const { node } = params.extraParams;
|
|
25151
25207
|
if (!node || !node.name) {
|
|
25152
25208
|
return null;
|
|
25153
25209
|
}
|
|
25154
25210
|
return handleInlineNode(params);
|
|
25155
25211
|
}
|
|
25156
|
-
function decode$
|
|
25212
|
+
function decode$y(params) {
|
|
25157
25213
|
const { node } = params;
|
|
25158
25214
|
if (!node || !node.type) {
|
|
25159
25215
|
return null;
|
|
25160
25216
|
}
|
|
25161
25217
|
return translateInlineNode(params);
|
|
25162
25218
|
}
|
|
25163
|
-
const config$
|
|
25164
|
-
xmlName: XML_NODE_NAME$
|
|
25165
|
-
sdNodeOrKeyName: SD_NODE_NAME$
|
|
25219
|
+
const config$g = {
|
|
25220
|
+
xmlName: XML_NODE_NAME$h,
|
|
25221
|
+
sdNodeOrKeyName: SD_NODE_NAME$f,
|
|
25166
25222
|
type: NodeTranslator.translatorTypes.NODE,
|
|
25167
|
-
encode: encode$
|
|
25168
|
-
decode: decode$
|
|
25223
|
+
encode: encode$w,
|
|
25224
|
+
decode: decode$y,
|
|
25169
25225
|
attributes: validXmlAttributes$7
|
|
25170
25226
|
};
|
|
25171
|
-
const translator$
|
|
25172
|
-
const XML_NODE_NAME$
|
|
25173
|
-
const SD_NODE_NAME$
|
|
25227
|
+
const translator$w = NodeTranslator.from(config$g);
|
|
25228
|
+
const XML_NODE_NAME$g = "w:drawing";
|
|
25229
|
+
const SD_NODE_NAME$e = [];
|
|
25174
25230
|
const validXmlAttributes$6 = [];
|
|
25175
|
-
function encode$
|
|
25231
|
+
function encode$v(params) {
|
|
25176
25232
|
const nodes = params.nodes;
|
|
25177
25233
|
const node = nodes[0];
|
|
25178
25234
|
const translatorByChildName = {
|
|
25179
|
-
"wp:anchor": translator$
|
|
25180
|
-
"wp:inline": translator$
|
|
25235
|
+
"wp:anchor": translator$x,
|
|
25236
|
+
"wp:inline": translator$w
|
|
25181
25237
|
};
|
|
25182
25238
|
const result = (node.elements || []).reduce((acc, child) => {
|
|
25183
25239
|
if (acc) return acc;
|
|
@@ -25195,12 +25251,12 @@ function encode$s(params) {
|
|
|
25195
25251
|
}
|
|
25196
25252
|
};
|
|
25197
25253
|
}
|
|
25198
|
-
function decode$
|
|
25254
|
+
function decode$x(params) {
|
|
25199
25255
|
const { node } = params;
|
|
25200
25256
|
if (!node || !node.type) {
|
|
25201
25257
|
return null;
|
|
25202
25258
|
}
|
|
25203
|
-
const childTranslator = node.attrs.isAnchor ? translator$
|
|
25259
|
+
const childTranslator = node.attrs.isAnchor ? translator$x : translator$w;
|
|
25204
25260
|
const resultNode = childTranslator.decode(params);
|
|
25205
25261
|
return wrapTextInRun(
|
|
25206
25262
|
{
|
|
@@ -25210,15 +25266,15 @@ function decode$u(params) {
|
|
|
25210
25266
|
[]
|
|
25211
25267
|
);
|
|
25212
25268
|
}
|
|
25213
|
-
const config$
|
|
25214
|
-
xmlName: XML_NODE_NAME$
|
|
25215
|
-
sdNodeOrKeyName: SD_NODE_NAME$
|
|
25269
|
+
const config$f = {
|
|
25270
|
+
xmlName: XML_NODE_NAME$g,
|
|
25271
|
+
sdNodeOrKeyName: SD_NODE_NAME$e,
|
|
25216
25272
|
type: NodeTranslator.translatorTypes.NODE,
|
|
25217
|
-
encode: encode$
|
|
25218
|
-
decode: decode$
|
|
25273
|
+
encode: encode$v,
|
|
25274
|
+
decode: decode$x,
|
|
25219
25275
|
attributes: validXmlAttributes$6
|
|
25220
25276
|
};
|
|
25221
|
-
const translator$
|
|
25277
|
+
const translator$v = NodeTranslator.from(config$f);
|
|
25222
25278
|
function getTextNodeForExport(text, marks, params) {
|
|
25223
25279
|
const hasLeadingOrTrailingSpace = /^\s|\s$/.test(text);
|
|
25224
25280
|
const space = hasLeadingOrTrailingSpace ? "preserve" : null;
|
|
@@ -25227,7 +25283,7 @@ function getTextNodeForExport(text, marks, params) {
|
|
|
25227
25283
|
const textRunProperties = decodeRPrFromMarks(marks || []);
|
|
25228
25284
|
const parentRunProperties = params.extraParams?.runProperties || {};
|
|
25229
25285
|
const combinedRunProperties = combineRunProperties([parentRunProperties, textRunProperties]);
|
|
25230
|
-
const rPrNode = translator$
|
|
25286
|
+
const rPrNode = translator$1Q.decode({ node: { attrs: { runProperties: combinedRunProperties } } });
|
|
25231
25287
|
textNodes.push({
|
|
25232
25288
|
name: "w:t",
|
|
25233
25289
|
elements: [{ text, type: "text" }],
|
|
@@ -25626,7 +25682,7 @@ function prepareTextAnnotation(params) {
|
|
|
25626
25682
|
return getTextNodeForExport(attrs.displayLabel, [...marks, ...marksFromAttrs], params);
|
|
25627
25683
|
}
|
|
25628
25684
|
function prepareImageAnnotation(params, imageSize) {
|
|
25629
|
-
return translator$
|
|
25685
|
+
return translator$v.decode({
|
|
25630
25686
|
...params,
|
|
25631
25687
|
imageSize
|
|
25632
25688
|
});
|
|
@@ -25711,7 +25767,7 @@ function prepareUrlAnnotation(params) {
|
|
|
25711
25767
|
}
|
|
25712
25768
|
]
|
|
25713
25769
|
};
|
|
25714
|
-
return translator$
|
|
25770
|
+
return translator$14.decode({
|
|
25715
25771
|
...params,
|
|
25716
25772
|
node: linkTextNode
|
|
25717
25773
|
});
|
|
@@ -26049,10 +26105,10 @@ function generateSdtPrTagForStructuredContent({ node }) {
|
|
|
26049
26105
|
};
|
|
26050
26106
|
return result;
|
|
26051
26107
|
}
|
|
26052
|
-
const XML_NODE_NAME$
|
|
26053
|
-
const SD_NODE_NAME$
|
|
26108
|
+
const XML_NODE_NAME$f = "w:sdt";
|
|
26109
|
+
const SD_NODE_NAME$d = ["fieldAnnotation", "structuredContent", "structuredContentBlock", "documentSection"];
|
|
26054
26110
|
const validXmlAttributes$5 = [];
|
|
26055
|
-
function encode$
|
|
26111
|
+
function encode$u(params) {
|
|
26056
26112
|
const nodes = params.nodes;
|
|
26057
26113
|
const node = nodes[0];
|
|
26058
26114
|
const { type: sdtType, handler: handler2 } = sdtNodeTypeStrategy(node);
|
|
@@ -26062,7 +26118,7 @@ function encode$r(params) {
|
|
|
26062
26118
|
const result = handler2(params);
|
|
26063
26119
|
return result;
|
|
26064
26120
|
}
|
|
26065
|
-
function decode$
|
|
26121
|
+
function decode$w(params) {
|
|
26066
26122
|
const { node } = params;
|
|
26067
26123
|
if (!node || !node.type) {
|
|
26068
26124
|
return null;
|
|
@@ -26080,15 +26136,15 @@ function decode$t(params) {
|
|
|
26080
26136
|
const result = decoder();
|
|
26081
26137
|
return result;
|
|
26082
26138
|
}
|
|
26083
|
-
const config$
|
|
26084
|
-
xmlName: XML_NODE_NAME$
|
|
26085
|
-
sdNodeOrKeyName: SD_NODE_NAME$
|
|
26139
|
+
const config$e = {
|
|
26140
|
+
xmlName: XML_NODE_NAME$f,
|
|
26141
|
+
sdNodeOrKeyName: SD_NODE_NAME$d,
|
|
26086
26142
|
type: NodeTranslator.translatorTypes.NODE,
|
|
26087
|
-
encode: encode$
|
|
26088
|
-
decode: decode$
|
|
26143
|
+
encode: encode$u,
|
|
26144
|
+
decode: decode$w,
|
|
26089
26145
|
attributes: validXmlAttributes$5
|
|
26090
26146
|
};
|
|
26091
|
-
const translator$
|
|
26147
|
+
const translator$u = NodeTranslator.from(config$e);
|
|
26092
26148
|
const getColspan = (cell) => {
|
|
26093
26149
|
const rawColspan = cell?.attrs?.colspan;
|
|
26094
26150
|
const numericColspan = typeof rawColspan === "string" ? parseInt(rawColspan, 10) : rawColspan;
|
|
@@ -26179,16 +26235,16 @@ function preProcessVerticalMergeCells(table, { editorSchema }) {
|
|
|
26179
26235
|
}
|
|
26180
26236
|
return table;
|
|
26181
26237
|
}
|
|
26182
|
-
const translator$
|
|
26238
|
+
const translator$t = NodeTranslator.from({
|
|
26183
26239
|
xmlName: "w:bidiVisual",
|
|
26184
26240
|
sdNodeOrKeyName: "rightToLeft",
|
|
26185
26241
|
encode: ({ nodes }) => parseBoolean(nodes[0].attributes?.["w:val"] ?? "1"),
|
|
26186
26242
|
decode: ({ node }) => node.attrs.rightToLeft ? { attributes: {} } : void 0
|
|
26187
26243
|
});
|
|
26188
|
-
const translator$
|
|
26189
|
-
const translator$
|
|
26190
|
-
const translator$
|
|
26191
|
-
const translator$
|
|
26244
|
+
const translator$s = NodeTranslator.from(createSingleAttrPropertyHandler("w:tblCaption", "caption"));
|
|
26245
|
+
const translator$r = NodeTranslator.from(createSingleAttrPropertyHandler("w:tblDescription", "description"));
|
|
26246
|
+
const translator$q = NodeTranslator.from(createMeasurementPropertyHandler("w:tblInd", "tableIndent"));
|
|
26247
|
+
const translator$p = NodeTranslator.from(createSingleAttrPropertyHandler("w:tblLayout", "tableLayout", "w:type"));
|
|
26192
26248
|
const tblLookBitmask = Object.freeze({
|
|
26193
26249
|
firstRow: 32,
|
|
26194
26250
|
lastRow: 64,
|
|
@@ -26207,7 +26263,7 @@ const decodeTblLookVal = (val) => {
|
|
|
26207
26263
|
if (!Number.isFinite(numeric)) return null;
|
|
26208
26264
|
return Object.fromEntries(Object.entries(tblLookBitmask).map(([key, mask]) => [key, (numeric & mask) === mask]));
|
|
26209
26265
|
};
|
|
26210
|
-
const translator$
|
|
26266
|
+
const translator$o = NodeTranslator.from({
|
|
26211
26267
|
xmlName: "w:tblLook",
|
|
26212
26268
|
sdNodeOrKeyName: "tblLook",
|
|
26213
26269
|
attributes: ["w:firstColumn", "w:firstRow", "w:lastColumn", "w:lastRow", "w:noHBand", "w:noVBand"].map((attr) => createAttributeHandler(attr, null, parseBoolean, booleanToString)).concat([createAttributeHandler("w:val")]),
|
|
@@ -26227,16 +26283,16 @@ const translator$n = NodeTranslator.from({
|
|
|
26227
26283
|
return Object.keys(decodedAttrs).length > 0 ? { attributes: decodedAttrs } : void 0;
|
|
26228
26284
|
}
|
|
26229
26285
|
});
|
|
26230
|
-
const translator$
|
|
26231
|
-
const translator$
|
|
26232
|
-
const translator$
|
|
26286
|
+
const translator$n = NodeTranslator.from(createSingleAttrPropertyHandler("w:tblOverlap", "overlap"));
|
|
26287
|
+
const translator$m = NodeTranslator.from(createSingleAttrPropertyHandler("w:tblStyle", "tableStyleId"));
|
|
26288
|
+
const translator$l = NodeTranslator.from(
|
|
26233
26289
|
createSingleAttrPropertyHandler("w:tblStyleColBandSize", "tableStyleColBandSize")
|
|
26234
26290
|
);
|
|
26235
|
-
const translator$
|
|
26291
|
+
const translator$k = NodeTranslator.from(
|
|
26236
26292
|
createSingleAttrPropertyHandler("w:tblStyleRowBandSize", "tableStyleRowBandSize")
|
|
26237
26293
|
);
|
|
26238
|
-
const translator$
|
|
26239
|
-
const translator$
|
|
26294
|
+
const translator$j = NodeTranslator.from(createMeasurementPropertyHandler("w:tblW", "tableWidth"));
|
|
26295
|
+
const translator$i = NodeTranslator.from({
|
|
26240
26296
|
xmlName: "w:tblpPr",
|
|
26241
26297
|
sdNodeOrKeyName: "floatingTableProperties",
|
|
26242
26298
|
attributes: ["w:leftFromText", "w:rightFromText", "w:topFromText", "w:bottomFromText", "w:tblpX", "w:tblpY"].map((attr) => createAttributeHandler(attr, null, parseInteger, integerToString)).concat(["w:horzAnchor", "w:vertAnchor", "w:tblpXSpec", "w:tblpYSpec"].map((attr) => createAttributeHandler(attr))),
|
|
@@ -26249,22 +26305,23 @@ const translator$h = NodeTranslator.from({
|
|
|
26249
26305
|
}
|
|
26250
26306
|
});
|
|
26251
26307
|
const propertyTranslators$2 = [
|
|
26252
|
-
translator$
|
|
26253
|
-
translator$
|
|
26254
|
-
translator$
|
|
26255
|
-
translator$
|
|
26256
|
-
translator$
|
|
26257
|
-
translator$
|
|
26308
|
+
translator$1r,
|
|
26309
|
+
translator$_,
|
|
26310
|
+
translator$1p,
|
|
26311
|
+
translator$1n,
|
|
26312
|
+
translator$W,
|
|
26313
|
+
translator$1l
|
|
26258
26314
|
];
|
|
26259
|
-
const translator$
|
|
26315
|
+
const translator$h = NodeTranslator.from(
|
|
26260
26316
|
createNestedPropertiesTranslator("w:tblCellMar", "cellMargins", propertyTranslators$2)
|
|
26261
26317
|
);
|
|
26262
26318
|
const propertyTranslators$1 = [
|
|
26319
|
+
translator$t,
|
|
26320
|
+
translator$1F,
|
|
26321
|
+
translator$2d,
|
|
26263
26322
|
translator$s,
|
|
26264
|
-
translator$
|
|
26265
|
-
translator$2c,
|
|
26323
|
+
translator$E,
|
|
26266
26324
|
translator$r,
|
|
26267
|
-
translator$D,
|
|
26268
26325
|
translator$q,
|
|
26269
26326
|
translator$p,
|
|
26270
26327
|
translator$o,
|
|
@@ -26274,14 +26331,13 @@ const propertyTranslators$1 = [
|
|
|
26274
26331
|
translator$k,
|
|
26275
26332
|
translator$j,
|
|
26276
26333
|
translator$i,
|
|
26277
|
-
translator$
|
|
26278
|
-
translator$
|
|
26279
|
-
translator$g
|
|
26334
|
+
translator$J,
|
|
26335
|
+
translator$h
|
|
26280
26336
|
];
|
|
26281
|
-
const translator$
|
|
26337
|
+
const translator$g = NodeTranslator.from(
|
|
26282
26338
|
createNestedPropertiesTranslator("w:tblPr", "tableProperties", propertyTranslators$1)
|
|
26283
26339
|
);
|
|
26284
|
-
const translator$
|
|
26340
|
+
const translator$f = NodeTranslator.from(
|
|
26285
26341
|
createSingleAttrPropertyHandler("w:gridCol", "col", "w:w", parseInteger, integerToString)
|
|
26286
26342
|
);
|
|
26287
26343
|
const DEFAULT_COLUMN_WIDTH_PX = 100;
|
|
@@ -26331,24 +26387,24 @@ const resolveFallbackColumnWidthTwips = (params, totalColumns, cellMinWidthTwips
|
|
|
26331
26387
|
}
|
|
26332
26388
|
return Math.max(fallbackWidthTwips, cellMinWidthTwips);
|
|
26333
26389
|
};
|
|
26334
|
-
const XML_NODE_NAME$
|
|
26390
|
+
const XML_NODE_NAME$e = "w:tblGrid";
|
|
26335
26391
|
const SD_ATTR_KEY$1 = "grid";
|
|
26336
26392
|
const cellMinWidth = pixelsToTwips(10);
|
|
26337
|
-
const encode$
|
|
26393
|
+
const encode$t = (params) => {
|
|
26338
26394
|
const { nodes } = params;
|
|
26339
26395
|
const node = nodes[0];
|
|
26340
26396
|
const attributes = encodeProperties(
|
|
26341
26397
|
{ ...params, nodes: [node] },
|
|
26342
|
-
{ [translator$
|
|
26398
|
+
{ [translator$f.xmlName]: translator$f },
|
|
26343
26399
|
true
|
|
26344
26400
|
);
|
|
26345
26401
|
return {
|
|
26346
|
-
xmlName: XML_NODE_NAME$
|
|
26402
|
+
xmlName: XML_NODE_NAME$e,
|
|
26347
26403
|
sdNodeOrKeyName: SD_ATTR_KEY$1,
|
|
26348
26404
|
attributes
|
|
26349
26405
|
};
|
|
26350
26406
|
};
|
|
26351
|
-
const decode$
|
|
26407
|
+
const decode$v = (params) => {
|
|
26352
26408
|
const { grid: rawGrid } = params.node.attrs || {};
|
|
26353
26409
|
const grid = Array.isArray(rawGrid) ? rawGrid : [];
|
|
26354
26410
|
const { firstRow = {}, preferTableGrid = false, totalColumns: requestedColumns } = params.extraParams || {};
|
|
@@ -26381,10 +26437,10 @@ const decode$s = (params) => {
|
|
|
26381
26437
|
const roundedWidth = Math.round(numericWidth);
|
|
26382
26438
|
const minimumWidth = shouldEnforceMinimum ? cellMinWidth : 1;
|
|
26383
26439
|
const safeWidth = Math.max(roundedWidth, minimumWidth);
|
|
26384
|
-
const decoded = translator$
|
|
26440
|
+
const decoded = translator$f.decode({
|
|
26385
26441
|
node: { type: (
|
|
26386
26442
|
/** @type {string} */
|
|
26387
|
-
translator$
|
|
26443
|
+
translator$f.sdNodeOrKeyName
|
|
26388
26444
|
), attrs: { col: safeWidth } }
|
|
26389
26445
|
});
|
|
26390
26446
|
if (decoded) elements.push(decoded);
|
|
@@ -26414,21 +26470,21 @@ const decode$s = (params) => {
|
|
|
26414
26470
|
pushColumn(cellWidthTwips, { enforceMinimum });
|
|
26415
26471
|
}
|
|
26416
26472
|
const newNode = {
|
|
26417
|
-
name: XML_NODE_NAME$
|
|
26473
|
+
name: XML_NODE_NAME$e,
|
|
26418
26474
|
attributes: {},
|
|
26419
26475
|
elements
|
|
26420
26476
|
};
|
|
26421
26477
|
return newNode;
|
|
26422
26478
|
};
|
|
26423
|
-
const config$
|
|
26424
|
-
xmlName: XML_NODE_NAME$
|
|
26479
|
+
const config$d = {
|
|
26480
|
+
xmlName: XML_NODE_NAME$e,
|
|
26425
26481
|
sdNodeOrKeyName: SD_ATTR_KEY$1,
|
|
26426
|
-
encode: encode$
|
|
26427
|
-
decode: decode$
|
|
26482
|
+
encode: encode$t,
|
|
26483
|
+
decode: decode$v
|
|
26428
26484
|
};
|
|
26429
|
-
const translator$
|
|
26430
|
-
const propertyTranslators = [translator$
|
|
26431
|
-
const translator$
|
|
26485
|
+
const translator$e = NodeTranslator.from(config$d);
|
|
26486
|
+
const propertyTranslators = [translator$g, translator$L];
|
|
26487
|
+
const translator$d = NodeTranslator.from(
|
|
26432
26488
|
createNestedPropertiesTranslator("w:tblStylePr", "tableStyleProperties", propertyTranslators)
|
|
26433
26489
|
);
|
|
26434
26490
|
const DEFAULT_PAGE_WIDTH_TWIPS = 12240;
|
|
@@ -26493,21 +26549,21 @@ const buildFallbackGridForTable = ({ params, rows, tableWidth, tableWidthMeasure
|
|
|
26493
26549
|
columnWidths: Array(columnCount).fill(fallbackColumnWidthPx)
|
|
26494
26550
|
};
|
|
26495
26551
|
};
|
|
26496
|
-
const XML_NODE_NAME$
|
|
26497
|
-
const SD_NODE_NAME$
|
|
26498
|
-
const encode$
|
|
26552
|
+
const XML_NODE_NAME$d = "w:tbl";
|
|
26553
|
+
const SD_NODE_NAME$c = "table";
|
|
26554
|
+
const encode$s = (params, encodedAttrs) => {
|
|
26499
26555
|
const { nodes } = params;
|
|
26500
26556
|
const node = nodes[0];
|
|
26501
26557
|
const tblPr = node.elements.find((el) => el.name === "w:tblPr");
|
|
26502
26558
|
if (tblPr) {
|
|
26503
|
-
const encodedProperties = translator$
|
|
26559
|
+
const encodedProperties = translator$g.encode({ ...params, nodes: [tblPr] });
|
|
26504
26560
|
encodedAttrs["tableProperties"] = encodedProperties || {};
|
|
26505
26561
|
} else {
|
|
26506
26562
|
encodedAttrs["tableProperties"] ||= {};
|
|
26507
26563
|
}
|
|
26508
26564
|
const tblGrid = node.elements.find((el) => el.name === "w:tblGrid");
|
|
26509
26565
|
if (tblGrid) {
|
|
26510
|
-
encodedAttrs["grid"] = translator$
|
|
26566
|
+
encodedAttrs["grid"] = translator$e.encode({ ...params, nodes: [tblGrid] }).attributes;
|
|
26511
26567
|
}
|
|
26512
26568
|
[
|
|
26513
26569
|
"tableStyleId",
|
|
@@ -26573,7 +26629,7 @@ const encode$p = (params, encodedAttrs) => {
|
|
|
26573
26629
|
const totalRows = rows.length;
|
|
26574
26630
|
const activeRowSpans = totalColumns > 0 ? new Array(totalColumns).fill(0) : [];
|
|
26575
26631
|
rows.forEach((row, rowIndex) => {
|
|
26576
|
-
const result = translator$
|
|
26632
|
+
const result = translator$y.encode({
|
|
26577
26633
|
...params,
|
|
26578
26634
|
path: [...params.path || [], node],
|
|
26579
26635
|
nodes: [row],
|
|
@@ -26631,7 +26687,7 @@ const encode$p = (params, encodedAttrs) => {
|
|
|
26631
26687
|
attrs: encodedAttrs
|
|
26632
26688
|
};
|
|
26633
26689
|
};
|
|
26634
|
-
const decode$
|
|
26690
|
+
const decode$u = (params, decodedAttrs) => {
|
|
26635
26691
|
params.node = preProcessVerticalMergeCells(params.node, params);
|
|
26636
26692
|
const { node } = params;
|
|
26637
26693
|
const rawGrid = node.attrs?.grid;
|
|
@@ -26645,7 +26701,7 @@ const decode$r = (params, decodedAttrs) => {
|
|
|
26645
26701
|
};
|
|
26646
26702
|
const elements = translateChildNodes({ ...params, extraParams });
|
|
26647
26703
|
const firstRow = node.content?.find((n) => n.type === "tableRow");
|
|
26648
|
-
const element = translator$
|
|
26704
|
+
const element = translator$e.decode({
|
|
26649
26705
|
...params,
|
|
26650
26706
|
node: { ...node, attrs: { ...node.attrs, grid } },
|
|
26651
26707
|
extraParams: {
|
|
@@ -26656,7 +26712,7 @@ const decode$r = (params, decodedAttrs) => {
|
|
|
26656
26712
|
if (element) elements.unshift(element);
|
|
26657
26713
|
if (node.attrs?.tableProperties) {
|
|
26658
26714
|
const properties = { ...node.attrs.tableProperties };
|
|
26659
|
-
const element2 = translator$
|
|
26715
|
+
const element2 = translator$g.decode({
|
|
26660
26716
|
...params,
|
|
26661
26717
|
node: { ...node, attrs: { ...node.attrs, tableProperties: properties } }
|
|
26662
26718
|
});
|
|
@@ -26718,7 +26774,7 @@ function _getReferencedTableStyles(tableStyleReference, params) {
|
|
|
26718
26774
|
if (baseTblPr && baseTblPr.elements) {
|
|
26719
26775
|
tblPr.elements = [...baseTblPr.elements, ...tblPr.elements];
|
|
26720
26776
|
}
|
|
26721
|
-
const tableProperties = translator$
|
|
26777
|
+
const tableProperties = translator$g.encode({ ...params, nodes: [tblPr] });
|
|
26722
26778
|
if (tableProperties) {
|
|
26723
26779
|
const borders = _processTableBorders(tableProperties.borders || {});
|
|
26724
26780
|
if (borders || Object.keys(borders).length) stylesToReturn.borders = borders;
|
|
@@ -26738,7 +26794,7 @@ function _getReferencedTableStyles(tableStyleReference, params) {
|
|
|
26738
26794
|
let styleProps = {};
|
|
26739
26795
|
if (tblStylePr) {
|
|
26740
26796
|
styleProps = tblStylePr.reduce((acc, el) => {
|
|
26741
|
-
acc[el.attributes["w:type"]] = translator$
|
|
26797
|
+
acc[el.attributes["w:type"]] = translator$d.encode({ ...params, nodes: [el] });
|
|
26742
26798
|
return acc;
|
|
26743
26799
|
}, {});
|
|
26744
26800
|
}
|
|
@@ -26747,85 +26803,85 @@ function _getReferencedTableStyles(tableStyleReference, params) {
|
|
|
26747
26803
|
...styleProps
|
|
26748
26804
|
};
|
|
26749
26805
|
}
|
|
26750
|
-
const config$
|
|
26751
|
-
xmlName: XML_NODE_NAME$
|
|
26752
|
-
sdNodeOrKeyName: SD_NODE_NAME$
|
|
26806
|
+
const config$c = {
|
|
26807
|
+
xmlName: XML_NODE_NAME$d,
|
|
26808
|
+
sdNodeOrKeyName: SD_NODE_NAME$c,
|
|
26753
26809
|
type: NodeTranslator.translatorTypes.NODE,
|
|
26754
|
-
encode: encode$
|
|
26755
|
-
decode: decode$
|
|
26810
|
+
encode: encode$s,
|
|
26811
|
+
decode: decode$u,
|
|
26756
26812
|
attributes: []
|
|
26757
26813
|
};
|
|
26758
|
-
const translator$
|
|
26759
|
-
const encode$
|
|
26814
|
+
const translator$c = NodeTranslator.from(config$c);
|
|
26815
|
+
const encode$r = (attributes) => {
|
|
26760
26816
|
return attributes["w:id"];
|
|
26761
26817
|
};
|
|
26762
|
-
const decode$
|
|
26818
|
+
const decode$t = (attrs) => {
|
|
26763
26819
|
return attrs.id;
|
|
26764
26820
|
};
|
|
26765
|
-
const attrConfig$
|
|
26821
|
+
const attrConfig$g = Object.freeze({
|
|
26766
26822
|
xmlName: "w:id",
|
|
26767
26823
|
sdName: "id",
|
|
26768
|
-
encode: encode$
|
|
26769
|
-
decode: decode$
|
|
26824
|
+
encode: encode$r,
|
|
26825
|
+
decode: decode$t
|
|
26770
26826
|
});
|
|
26771
|
-
const encode$
|
|
26827
|
+
const encode$q = (attributes) => {
|
|
26772
26828
|
return attributes["w:name"];
|
|
26773
26829
|
};
|
|
26774
|
-
const decode$
|
|
26830
|
+
const decode$s = (attrs) => {
|
|
26775
26831
|
return attrs.name;
|
|
26776
26832
|
};
|
|
26777
|
-
const attrConfig$
|
|
26833
|
+
const attrConfig$f = Object.freeze({
|
|
26778
26834
|
xmlName: "w:name",
|
|
26779
26835
|
sdName: "name",
|
|
26780
|
-
encode: encode$
|
|
26781
|
-
decode: decode$
|
|
26836
|
+
encode: encode$q,
|
|
26837
|
+
decode: decode$s
|
|
26782
26838
|
});
|
|
26783
|
-
const encode$
|
|
26839
|
+
const encode$p = (attributes) => {
|
|
26784
26840
|
return attributes["w:colFirst"];
|
|
26785
26841
|
};
|
|
26786
|
-
const decode$
|
|
26842
|
+
const decode$r = (attrs) => {
|
|
26787
26843
|
return attrs.colFirst;
|
|
26788
26844
|
};
|
|
26789
|
-
const attrConfig$
|
|
26845
|
+
const attrConfig$e = Object.freeze({
|
|
26790
26846
|
xmlName: "w:colFirst",
|
|
26791
26847
|
sdName: "colFirst",
|
|
26792
|
-
encode: encode$
|
|
26793
|
-
decode: decode$
|
|
26848
|
+
encode: encode$p,
|
|
26849
|
+
decode: decode$r
|
|
26794
26850
|
});
|
|
26795
|
-
const encode$
|
|
26851
|
+
const encode$o = (attributes) => {
|
|
26796
26852
|
return attributes["w:colLast"];
|
|
26797
26853
|
};
|
|
26798
|
-
const decode$
|
|
26854
|
+
const decode$q = (attrs) => {
|
|
26799
26855
|
return attrs.colLast;
|
|
26800
26856
|
};
|
|
26801
|
-
const attrConfig$
|
|
26857
|
+
const attrConfig$d = Object.freeze({
|
|
26802
26858
|
xmlName: "w:colLast",
|
|
26803
26859
|
sdName: "colLast",
|
|
26804
|
-
encode: encode$
|
|
26805
|
-
decode: decode$
|
|
26860
|
+
encode: encode$o,
|
|
26861
|
+
decode: decode$q
|
|
26806
26862
|
});
|
|
26807
|
-
const encode$
|
|
26863
|
+
const encode$n = (attributes) => {
|
|
26808
26864
|
return attributes["w:displacedByCustomXml"];
|
|
26809
26865
|
};
|
|
26810
|
-
const decode$
|
|
26866
|
+
const decode$p = (attrs) => {
|
|
26811
26867
|
return attrs.displacedByCustomXml;
|
|
26812
26868
|
};
|
|
26813
|
-
const attrConfig$
|
|
26869
|
+
const attrConfig$c = Object.freeze({
|
|
26814
26870
|
xmlName: "w:displacedByCustomXml",
|
|
26815
26871
|
sdName: "displacedByCustomXml",
|
|
26816
|
-
encode: encode$
|
|
26817
|
-
decode: decode$
|
|
26872
|
+
encode: encode$n,
|
|
26873
|
+
decode: decode$p
|
|
26818
26874
|
});
|
|
26819
|
-
const bookmarkStartAttrConfigs = [attrConfig$
|
|
26820
|
-
const XML_NODE_NAME$
|
|
26821
|
-
const SD_NODE_NAME$
|
|
26822
|
-
const encode$
|
|
26875
|
+
const bookmarkStartAttrConfigs = [attrConfig$g, attrConfig$f, attrConfig$e, attrConfig$d, attrConfig$c];
|
|
26876
|
+
const XML_NODE_NAME$c = "w:bookmarkStart";
|
|
26877
|
+
const SD_NODE_NAME$b = "bookmarkStart";
|
|
26878
|
+
const encode$m = (params, encodedAttrs = {}) => {
|
|
26823
26879
|
return {
|
|
26824
26880
|
type: "bookmarkStart",
|
|
26825
26881
|
attrs: encodedAttrs
|
|
26826
26882
|
};
|
|
26827
26883
|
};
|
|
26828
|
-
const decode$
|
|
26884
|
+
const decode$o = (params, decodedAttrs = {}) => {
|
|
26829
26885
|
const result = {
|
|
26830
26886
|
name: "w:bookmarkStart",
|
|
26831
26887
|
elements: []
|
|
@@ -26835,49 +26891,49 @@ const decode$l = (params, decodedAttrs = {}) => {
|
|
|
26835
26891
|
}
|
|
26836
26892
|
return result;
|
|
26837
26893
|
};
|
|
26838
|
-
const config$
|
|
26839
|
-
xmlName: XML_NODE_NAME$
|
|
26840
|
-
sdNodeOrKeyName: SD_NODE_NAME$
|
|
26894
|
+
const config$b = {
|
|
26895
|
+
xmlName: XML_NODE_NAME$c,
|
|
26896
|
+
sdNodeOrKeyName: SD_NODE_NAME$b,
|
|
26841
26897
|
type: NodeTranslator.translatorTypes.NODE,
|
|
26842
|
-
encode: encode$
|
|
26843
|
-
decode: decode$
|
|
26898
|
+
encode: encode$m,
|
|
26899
|
+
decode: decode$o,
|
|
26844
26900
|
attributes: bookmarkStartAttrConfigs
|
|
26845
26901
|
};
|
|
26846
|
-
const translator$
|
|
26847
|
-
const encode$
|
|
26902
|
+
const translator$b = NodeTranslator.from(config$b);
|
|
26903
|
+
const encode$l = (attributes) => {
|
|
26848
26904
|
return attributes["w:id"];
|
|
26849
26905
|
};
|
|
26850
|
-
const decode$
|
|
26906
|
+
const decode$n = (attrs) => {
|
|
26851
26907
|
return attrs.id;
|
|
26852
26908
|
};
|
|
26853
|
-
const attrConfig$
|
|
26909
|
+
const attrConfig$b = Object.freeze({
|
|
26854
26910
|
xmlName: "w:id",
|
|
26855
26911
|
sdName: "id",
|
|
26856
|
-
encode: encode$
|
|
26857
|
-
decode: decode$
|
|
26912
|
+
encode: encode$l,
|
|
26913
|
+
decode: decode$n
|
|
26858
26914
|
});
|
|
26859
|
-
const encode$
|
|
26915
|
+
const encode$k = (attributes) => {
|
|
26860
26916
|
return attributes["w:displacedByCustomXml"];
|
|
26861
26917
|
};
|
|
26862
|
-
const decode$
|
|
26918
|
+
const decode$m = (attrs) => {
|
|
26863
26919
|
return attrs.displacedByCustomXml;
|
|
26864
26920
|
};
|
|
26865
|
-
const attrConfig$
|
|
26921
|
+
const attrConfig$a = Object.freeze({
|
|
26866
26922
|
xmlName: "w:displacedByCustomXml",
|
|
26867
26923
|
sdName: "displacedByCustomXml",
|
|
26868
|
-
encode: encode$
|
|
26869
|
-
decode: decode$
|
|
26924
|
+
encode: encode$k,
|
|
26925
|
+
decode: decode$m
|
|
26870
26926
|
});
|
|
26871
|
-
const bookmarkEndAttrConfigs = [attrConfig$
|
|
26872
|
-
const XML_NODE_NAME$
|
|
26873
|
-
const SD_NODE_NAME$
|
|
26874
|
-
const encode$
|
|
26927
|
+
const bookmarkEndAttrConfigs = [attrConfig$b, attrConfig$a];
|
|
26928
|
+
const XML_NODE_NAME$b = "w:bookmarkEnd";
|
|
26929
|
+
const SD_NODE_NAME$a = "bookmarkEnd";
|
|
26930
|
+
const encode$j = (params, encodedAttrs = {}) => {
|
|
26875
26931
|
return {
|
|
26876
26932
|
type: "bookmarkEnd",
|
|
26877
26933
|
attrs: encodedAttrs
|
|
26878
26934
|
};
|
|
26879
26935
|
};
|
|
26880
|
-
const decode$
|
|
26936
|
+
const decode$l = (params, decodedAttrs = {}) => {
|
|
26881
26937
|
const result = {
|
|
26882
26938
|
name: "w:bookmarkEnd",
|
|
26883
26939
|
elements: []
|
|
@@ -26887,27 +26943,27 @@ const decode$i = (params, decodedAttrs = {}) => {
|
|
|
26887
26943
|
}
|
|
26888
26944
|
return result;
|
|
26889
26945
|
};
|
|
26890
|
-
const config$
|
|
26891
|
-
xmlName: XML_NODE_NAME$
|
|
26892
|
-
sdNodeOrKeyName: SD_NODE_NAME$
|
|
26946
|
+
const config$a = {
|
|
26947
|
+
xmlName: XML_NODE_NAME$b,
|
|
26948
|
+
sdNodeOrKeyName: SD_NODE_NAME$a,
|
|
26893
26949
|
type: NodeTranslator.translatorTypes.NODE,
|
|
26894
|
-
encode: encode$
|
|
26895
|
-
decode: decode$
|
|
26950
|
+
encode: encode$j,
|
|
26951
|
+
decode: decode$l,
|
|
26896
26952
|
attributes: bookmarkEndAttrConfigs
|
|
26897
26953
|
};
|
|
26898
|
-
const translator$
|
|
26899
|
-
const decode$
|
|
26900
|
-
const attrConfig$
|
|
26954
|
+
const translator$a = NodeTranslator.from(config$a);
|
|
26955
|
+
const decode$k = (attrs) => attrs?.["w:id"];
|
|
26956
|
+
const attrConfig$9 = Object.freeze({
|
|
26901
26957
|
xmlName: "w:id",
|
|
26902
26958
|
sdName: "w:id",
|
|
26903
26959
|
// We do not translate it from 'w:id' to 'id' when encoding, so the name is the same
|
|
26904
26960
|
encode: () => {
|
|
26905
26961
|
},
|
|
26906
|
-
decode: decode$
|
|
26962
|
+
decode: decode$k
|
|
26907
26963
|
});
|
|
26908
|
-
const XML_NODE_NAME$
|
|
26909
|
-
const SD_NODE_NAME$
|
|
26910
|
-
const decode$
|
|
26964
|
+
const XML_NODE_NAME$a = "w:commentRange";
|
|
26965
|
+
const SD_NODE_NAME$9 = "commentRange";
|
|
26966
|
+
const decode$j = (params) => {
|
|
26911
26967
|
const { node, comments, commentsExportType, exportedCommentDefs } = params;
|
|
26912
26968
|
if (!node) return;
|
|
26913
26969
|
if (!comments) return;
|
|
@@ -26948,10 +27004,10 @@ const getCommentSchema = (type, commentIndex) => {
|
|
|
26948
27004
|
};
|
|
26949
27005
|
};
|
|
26950
27006
|
const getConfig = (type) => {
|
|
26951
|
-
const sdName = `${SD_NODE_NAME$
|
|
27007
|
+
const sdName = `${SD_NODE_NAME$9}${type}`;
|
|
26952
27008
|
const isStart = type === "Start";
|
|
26953
27009
|
return {
|
|
26954
|
-
xmlName: `${XML_NODE_NAME$
|
|
27010
|
+
xmlName: `${XML_NODE_NAME$a}${type}`,
|
|
26955
27011
|
sdNodeOrKeyName: sdName,
|
|
26956
27012
|
type: NodeTranslator.translatorTypes.NODE,
|
|
26957
27013
|
encode: ({ nodes }) => {
|
|
@@ -26963,84 +27019,84 @@ const getConfig = (type) => {
|
|
|
26963
27019
|
attrs
|
|
26964
27020
|
};
|
|
26965
27021
|
},
|
|
26966
|
-
decode: decode$
|
|
26967
|
-
attributes: [attrConfig$
|
|
27022
|
+
decode: decode$j,
|
|
27023
|
+
attributes: [attrConfig$9]
|
|
26968
27024
|
};
|
|
26969
27025
|
};
|
|
26970
27026
|
const commentRangeStartTranslator = NodeTranslator.from(getConfig("Start"));
|
|
26971
27027
|
const commentRangeEndTranslator = NodeTranslator.from(getConfig("End"));
|
|
26972
|
-
const encode$
|
|
27028
|
+
const encode$i = (attributes) => {
|
|
26973
27029
|
return attributes["w:id"];
|
|
26974
27030
|
};
|
|
26975
|
-
const decode$
|
|
27031
|
+
const decode$i = (attrs) => {
|
|
26976
27032
|
return attrs.id;
|
|
26977
27033
|
};
|
|
26978
|
-
const attrConfig$
|
|
27034
|
+
const attrConfig$8 = Object.freeze({
|
|
26979
27035
|
xmlName: "w:id",
|
|
26980
27036
|
sdName: "id",
|
|
26981
|
-
encode: encode$
|
|
26982
|
-
decode: decode$
|
|
27037
|
+
encode: encode$i,
|
|
27038
|
+
decode: decode$i
|
|
26983
27039
|
});
|
|
26984
|
-
const encode$
|
|
27040
|
+
const encode$h = (attributes) => {
|
|
26985
27041
|
return attributes["w:edGrp"];
|
|
26986
27042
|
};
|
|
26987
|
-
const decode$
|
|
27043
|
+
const decode$h = (attrs) => {
|
|
26988
27044
|
return attrs.edGrp;
|
|
26989
27045
|
};
|
|
26990
|
-
const attrConfig$
|
|
27046
|
+
const attrConfig$7 = Object.freeze({
|
|
26991
27047
|
xmlName: "w:edGrp",
|
|
26992
27048
|
sdName: "edGrp",
|
|
26993
|
-
encode: encode$
|
|
26994
|
-
decode: decode$
|
|
27049
|
+
encode: encode$h,
|
|
27050
|
+
decode: decode$h
|
|
26995
27051
|
});
|
|
26996
|
-
const encode$
|
|
27052
|
+
const encode$g = (attributes) => {
|
|
26997
27053
|
return attributes["w:ed"];
|
|
26998
27054
|
};
|
|
26999
|
-
const decode$
|
|
27055
|
+
const decode$g = (attrs) => {
|
|
27000
27056
|
return attrs.ed;
|
|
27001
27057
|
};
|
|
27002
|
-
const attrConfig$
|
|
27058
|
+
const attrConfig$6 = Object.freeze({
|
|
27003
27059
|
xmlName: "w:ed",
|
|
27004
27060
|
sdName: "ed",
|
|
27005
|
-
encode: encode$
|
|
27006
|
-
decode: decode$
|
|
27061
|
+
encode: encode$g,
|
|
27062
|
+
decode: decode$g
|
|
27007
27063
|
});
|
|
27008
|
-
const encode$
|
|
27064
|
+
const encode$f = (attributes) => {
|
|
27009
27065
|
return parseInteger(attributes["w:colFirst"]);
|
|
27010
27066
|
};
|
|
27011
|
-
const decode$
|
|
27067
|
+
const decode$f = (attrs) => {
|
|
27012
27068
|
return integerToString(attrs.colFirst);
|
|
27013
27069
|
};
|
|
27014
|
-
const attrConfig$
|
|
27070
|
+
const attrConfig$5 = Object.freeze({
|
|
27015
27071
|
xmlName: "w:colFirst",
|
|
27016
27072
|
sdName: "colFirst",
|
|
27017
|
-
encode: encode$
|
|
27018
|
-
decode: decode$
|
|
27073
|
+
encode: encode$f,
|
|
27074
|
+
decode: decode$f
|
|
27019
27075
|
});
|
|
27020
|
-
const encode$
|
|
27076
|
+
const encode$e = (attributes) => {
|
|
27021
27077
|
return parseInteger(attributes["w:colLast"]);
|
|
27022
27078
|
};
|
|
27023
|
-
const decode$
|
|
27079
|
+
const decode$e = (attrs) => {
|
|
27024
27080
|
return integerToString(attrs.colLast);
|
|
27025
27081
|
};
|
|
27026
|
-
const attrConfig$
|
|
27082
|
+
const attrConfig$4 = Object.freeze({
|
|
27027
27083
|
xmlName: "w:colLast",
|
|
27028
27084
|
sdName: "colLast",
|
|
27029
|
-
encode: encode$
|
|
27030
|
-
decode: decode$
|
|
27085
|
+
encode: encode$e,
|
|
27086
|
+
decode: decode$e
|
|
27031
27087
|
});
|
|
27032
|
-
const validXmlAttributes$4 = [attrConfig$
|
|
27033
|
-
const XML_NODE_NAME$
|
|
27034
|
-
const SD_NODE_NAME$
|
|
27035
|
-
const encode$
|
|
27088
|
+
const validXmlAttributes$4 = [attrConfig$8, attrConfig$7, attrConfig$6, attrConfig$5, attrConfig$4];
|
|
27089
|
+
const XML_NODE_NAME$9 = "w:permStart";
|
|
27090
|
+
const SD_NODE_NAME$8 = "permStart";
|
|
27091
|
+
const encode$d = (params, encodedAttrs = {}) => {
|
|
27036
27092
|
return {
|
|
27037
27093
|
type: "permStart",
|
|
27038
27094
|
attrs: encodedAttrs
|
|
27039
27095
|
};
|
|
27040
27096
|
};
|
|
27041
|
-
const decode$
|
|
27097
|
+
const decode$d = (params, decodedAttrs = {}) => {
|
|
27042
27098
|
const result = {
|
|
27043
|
-
name: XML_NODE_NAME$
|
|
27099
|
+
name: XML_NODE_NAME$9,
|
|
27044
27100
|
elements: []
|
|
27045
27101
|
};
|
|
27046
27102
|
if (decodedAttrs && Object.keys(decodedAttrs).length) {
|
|
@@ -27048,51 +27104,51 @@ const decode$a = (params, decodedAttrs = {}) => {
|
|
|
27048
27104
|
}
|
|
27049
27105
|
return result;
|
|
27050
27106
|
};
|
|
27051
|
-
const config$
|
|
27052
|
-
xmlName: XML_NODE_NAME$
|
|
27053
|
-
sdNodeOrKeyName: SD_NODE_NAME$
|
|
27107
|
+
const config$9 = {
|
|
27108
|
+
xmlName: XML_NODE_NAME$9,
|
|
27109
|
+
sdNodeOrKeyName: SD_NODE_NAME$8,
|
|
27054
27110
|
type: NodeTranslator.translatorTypes.NODE,
|
|
27055
|
-
encode: encode$
|
|
27056
|
-
decode: decode$
|
|
27111
|
+
encode: encode$d,
|
|
27112
|
+
decode: decode$d,
|
|
27057
27113
|
attributes: validXmlAttributes$4
|
|
27058
27114
|
};
|
|
27059
|
-
const translator$
|
|
27060
|
-
const encode$
|
|
27115
|
+
const translator$9 = NodeTranslator.from(config$9);
|
|
27116
|
+
const encode$c = (attributes) => {
|
|
27061
27117
|
return attributes["w:id"];
|
|
27062
27118
|
};
|
|
27063
|
-
const decode$
|
|
27119
|
+
const decode$c = (attrs) => {
|
|
27064
27120
|
return attrs.id;
|
|
27065
27121
|
};
|
|
27066
|
-
const attrConfig$
|
|
27122
|
+
const attrConfig$3 = Object.freeze({
|
|
27067
27123
|
xmlName: "w:id",
|
|
27068
27124
|
sdName: "id",
|
|
27069
|
-
encode: encode$
|
|
27070
|
-
decode: decode$
|
|
27125
|
+
encode: encode$c,
|
|
27126
|
+
decode: decode$c
|
|
27071
27127
|
});
|
|
27072
|
-
const encode$
|
|
27128
|
+
const encode$b = (attributes) => {
|
|
27073
27129
|
return attributes["w:displacedByCustomXml"];
|
|
27074
27130
|
};
|
|
27075
|
-
const decode$
|
|
27131
|
+
const decode$b = (attrs) => {
|
|
27076
27132
|
return attrs.displacedByCustomXml;
|
|
27077
27133
|
};
|
|
27078
|
-
const attrConfig = Object.freeze({
|
|
27134
|
+
const attrConfig$2 = Object.freeze({
|
|
27079
27135
|
xmlName: "w:displacedByCustomXml",
|
|
27080
27136
|
sdName: "displacedByCustomXml",
|
|
27081
|
-
encode: encode$
|
|
27082
|
-
decode: decode$
|
|
27137
|
+
encode: encode$b,
|
|
27138
|
+
decode: decode$b
|
|
27083
27139
|
});
|
|
27084
|
-
const validXmlAttributes$3 = [attrConfig$
|
|
27085
|
-
const XML_NODE_NAME$
|
|
27086
|
-
const SD_NODE_NAME$
|
|
27087
|
-
const encode$
|
|
27140
|
+
const validXmlAttributes$3 = [attrConfig$3, attrConfig$2];
|
|
27141
|
+
const XML_NODE_NAME$8 = "w:permEnd";
|
|
27142
|
+
const SD_NODE_NAME$7 = "permEnd";
|
|
27143
|
+
const encode$a = (params, encodedAttrs = {}) => {
|
|
27088
27144
|
return {
|
|
27089
27145
|
type: "permEnd",
|
|
27090
27146
|
attrs: encodedAttrs
|
|
27091
27147
|
};
|
|
27092
27148
|
};
|
|
27093
|
-
const decode$
|
|
27149
|
+
const decode$a = (params, decodedAttrs = {}) => {
|
|
27094
27150
|
const result = {
|
|
27095
|
-
name: XML_NODE_NAME$
|
|
27151
|
+
name: XML_NODE_NAME$8,
|
|
27096
27152
|
elements: []
|
|
27097
27153
|
};
|
|
27098
27154
|
if (decodedAttrs && Object.keys(decodedAttrs).length) {
|
|
@@ -27100,18 +27156,18 @@ const decode$7 = (params, decodedAttrs = {}) => {
|
|
|
27100
27156
|
}
|
|
27101
27157
|
return result;
|
|
27102
27158
|
};
|
|
27103
|
-
const config$
|
|
27104
|
-
xmlName: XML_NODE_NAME$
|
|
27105
|
-
sdNodeOrKeyName: SD_NODE_NAME$
|
|
27159
|
+
const config$8 = {
|
|
27160
|
+
xmlName: XML_NODE_NAME$8,
|
|
27161
|
+
sdNodeOrKeyName: SD_NODE_NAME$7,
|
|
27106
27162
|
type: NodeTranslator.translatorTypes.NODE,
|
|
27107
|
-
encode: encode$
|
|
27108
|
-
decode: decode$
|
|
27163
|
+
encode: encode$a,
|
|
27164
|
+
decode: decode$a,
|
|
27109
27165
|
attributes: validXmlAttributes$3
|
|
27110
27166
|
};
|
|
27111
|
-
const translator$
|
|
27112
|
-
const XML_NODE_NAME$
|
|
27113
|
-
const SD_NODE_NAME$
|
|
27114
|
-
const encode$
|
|
27167
|
+
const translator$8 = NodeTranslator.from(config$8);
|
|
27168
|
+
const XML_NODE_NAME$7 = "sd:pageReference";
|
|
27169
|
+
const SD_NODE_NAME$6 = "pageReference";
|
|
27170
|
+
const encode$9 = (params) => {
|
|
27115
27171
|
const { nodes = [], nodeListHandler } = params || {};
|
|
27116
27172
|
const node = nodes[0];
|
|
27117
27173
|
const processedText = nodeListHandler.handler({
|
|
@@ -27128,7 +27184,7 @@ const encode$6 = (params) => {
|
|
|
27128
27184
|
};
|
|
27129
27185
|
return processedNode;
|
|
27130
27186
|
};
|
|
27131
|
-
const decode$
|
|
27187
|
+
const decode$9 = (params) => {
|
|
27132
27188
|
const { node } = params;
|
|
27133
27189
|
const outputMarks = processOutputMarks(node.attrs?.marksAsAttrs || []);
|
|
27134
27190
|
const contentNodes = (node.content ?? []).flatMap((n) => exportSchemaToJson({ ...params, node: n }));
|
|
@@ -27201,17 +27257,17 @@ const decode$6 = (params) => {
|
|
|
27201
27257
|
];
|
|
27202
27258
|
return translated;
|
|
27203
27259
|
};
|
|
27204
|
-
const config$
|
|
27205
|
-
xmlName: XML_NODE_NAME$
|
|
27206
|
-
sdNodeOrKeyName: SD_NODE_NAME$
|
|
27260
|
+
const config$7 = {
|
|
27261
|
+
xmlName: XML_NODE_NAME$7,
|
|
27262
|
+
sdNodeOrKeyName: SD_NODE_NAME$6,
|
|
27207
27263
|
type: NodeTranslator.translatorTypes.NODE,
|
|
27208
|
-
encode: encode$
|
|
27209
|
-
decode: decode$
|
|
27264
|
+
encode: encode$9,
|
|
27265
|
+
decode: decode$9
|
|
27210
27266
|
};
|
|
27211
|
-
const translator$
|
|
27212
|
-
const XML_NODE_NAME$
|
|
27213
|
-
const SD_NODE_NAME$
|
|
27214
|
-
const encode$
|
|
27267
|
+
const translator$7 = NodeTranslator.from(config$7);
|
|
27268
|
+
const XML_NODE_NAME$6 = "sd:tableOfContents";
|
|
27269
|
+
const SD_NODE_NAME$5 = "tableOfContents";
|
|
27270
|
+
const encode$8 = (params) => {
|
|
27215
27271
|
const { nodes = [], nodeListHandler } = params || {};
|
|
27216
27272
|
const node = nodes[0];
|
|
27217
27273
|
const processedContent = nodeListHandler.handler({
|
|
@@ -27227,7 +27283,7 @@ const encode$5 = (params) => {
|
|
|
27227
27283
|
};
|
|
27228
27284
|
return processedNode;
|
|
27229
27285
|
};
|
|
27230
|
-
const decode$
|
|
27286
|
+
const decode$8 = (params) => {
|
|
27231
27287
|
const { node } = params;
|
|
27232
27288
|
const contentNodes = node.content.map((n) => exportSchemaToJson({ ...params, node: n }));
|
|
27233
27289
|
const tocBeginElements = [
|
|
@@ -27274,17 +27330,17 @@ const decode$5 = (params) => {
|
|
|
27274
27330
|
}
|
|
27275
27331
|
return contentNodes;
|
|
27276
27332
|
};
|
|
27277
|
-
const config$
|
|
27278
|
-
xmlName: XML_NODE_NAME$
|
|
27279
|
-
sdNodeOrKeyName: SD_NODE_NAME$
|
|
27333
|
+
const config$6 = {
|
|
27334
|
+
xmlName: XML_NODE_NAME$6,
|
|
27335
|
+
sdNodeOrKeyName: SD_NODE_NAME$5,
|
|
27280
27336
|
type: NodeTranslator.translatorTypes.NODE,
|
|
27281
|
-
encode: encode$
|
|
27282
|
-
decode: decode$
|
|
27337
|
+
encode: encode$8,
|
|
27338
|
+
decode: decode$8
|
|
27283
27339
|
};
|
|
27284
|
-
const translator$
|
|
27285
|
-
const XML_NODE_NAME$
|
|
27286
|
-
const SD_NODE_NAME$
|
|
27287
|
-
const encode$
|
|
27340
|
+
const translator$6 = NodeTranslator.from(config$6);
|
|
27341
|
+
const XML_NODE_NAME$5 = "sd:autoPageNumber";
|
|
27342
|
+
const SD_NODE_NAME$4 = "page-number";
|
|
27343
|
+
const encode$7 = (params) => {
|
|
27288
27344
|
const { nodes = [] } = params || {};
|
|
27289
27345
|
const node = nodes[0];
|
|
27290
27346
|
const rPr = node.elements?.find((el) => el.name === "w:rPr");
|
|
@@ -27297,7 +27353,7 @@ const encode$4 = (params) => {
|
|
|
27297
27353
|
};
|
|
27298
27354
|
return processedNode;
|
|
27299
27355
|
};
|
|
27300
|
-
const decode$
|
|
27356
|
+
const decode$7 = (params) => {
|
|
27301
27357
|
const { node } = params;
|
|
27302
27358
|
const outputMarks = processOutputMarks(node.attrs?.marksAsAttrs || []);
|
|
27303
27359
|
const translated = [
|
|
@@ -27368,17 +27424,17 @@ const decode$4 = (params) => {
|
|
|
27368
27424
|
];
|
|
27369
27425
|
return translated;
|
|
27370
27426
|
};
|
|
27371
|
-
const config$
|
|
27372
|
-
xmlName: XML_NODE_NAME$
|
|
27373
|
-
sdNodeOrKeyName: SD_NODE_NAME$
|
|
27427
|
+
const config$5 = {
|
|
27428
|
+
xmlName: XML_NODE_NAME$5,
|
|
27429
|
+
sdNodeOrKeyName: SD_NODE_NAME$4,
|
|
27374
27430
|
type: NodeTranslator.translatorTypes.NODE,
|
|
27375
|
-
encode: encode$
|
|
27376
|
-
decode: decode$
|
|
27431
|
+
encode: encode$7,
|
|
27432
|
+
decode: decode$7
|
|
27377
27433
|
};
|
|
27378
|
-
const translator$
|
|
27379
|
-
const XML_NODE_NAME$
|
|
27380
|
-
const SD_NODE_NAME$
|
|
27381
|
-
const encode$
|
|
27434
|
+
const translator$5 = NodeTranslator.from(config$5);
|
|
27435
|
+
const XML_NODE_NAME$4 = "sd:totalPageNumber";
|
|
27436
|
+
const SD_NODE_NAME$3 = "total-page-number";
|
|
27437
|
+
const encode$6 = (params) => {
|
|
27382
27438
|
const { nodes = [] } = params || {};
|
|
27383
27439
|
const node = nodes[0];
|
|
27384
27440
|
const rPr = node.elements?.find((el) => el.name === "w:rPr");
|
|
@@ -27391,7 +27447,7 @@ const encode$3 = (params) => {
|
|
|
27391
27447
|
};
|
|
27392
27448
|
return processedNode;
|
|
27393
27449
|
};
|
|
27394
|
-
const decode$
|
|
27450
|
+
const decode$6 = (params) => {
|
|
27395
27451
|
const { node } = params;
|
|
27396
27452
|
const outputMarks = processOutputMarks(node.attrs?.marksAsAttrs || []);
|
|
27397
27453
|
const translated = [
|
|
@@ -27462,14 +27518,14 @@ const decode$3 = (params) => {
|
|
|
27462
27518
|
];
|
|
27463
27519
|
return translated;
|
|
27464
27520
|
};
|
|
27465
|
-
const config$
|
|
27466
|
-
xmlName: XML_NODE_NAME$
|
|
27467
|
-
sdNodeOrKeyName: SD_NODE_NAME$
|
|
27521
|
+
const config$4 = {
|
|
27522
|
+
xmlName: XML_NODE_NAME$4,
|
|
27523
|
+
sdNodeOrKeyName: SD_NODE_NAME$3,
|
|
27468
27524
|
type: NodeTranslator.translatorTypes.NODE,
|
|
27469
|
-
encode: encode$
|
|
27470
|
-
decode: decode$
|
|
27525
|
+
encode: encode$6,
|
|
27526
|
+
decode: decode$6
|
|
27471
27527
|
};
|
|
27472
|
-
const translator$
|
|
27528
|
+
const translator$4 = NodeTranslator.from(config$4);
|
|
27473
27529
|
function parseInlineStyles(styleString) {
|
|
27474
27530
|
if (!styleString) return {};
|
|
27475
27531
|
return styleString.split(";").filter((style) => !!style.trim()).reduce((acc, style) => {
|
|
@@ -27521,7 +27577,7 @@ function handleVRectImport({ pNode, pict, params }) {
|
|
|
27521
27577
|
if (isHorizontalRule) {
|
|
27522
27578
|
schemaAttrs.horizontalRule = true;
|
|
27523
27579
|
}
|
|
27524
|
-
const pElement = translator$
|
|
27580
|
+
const pElement = translator$15.encode({
|
|
27525
27581
|
...params,
|
|
27526
27582
|
nodes: [{ ...pNode, elements: pNode.elements.filter((el) => el.name !== "w:r") }]
|
|
27527
27583
|
});
|
|
@@ -27581,7 +27637,7 @@ const handleDrawingNode = (params) => {
|
|
|
27581
27637
|
return { nodes: [], consumed: 0 };
|
|
27582
27638
|
}
|
|
27583
27639
|
const translatorParams = { ...params, nodes: [node] };
|
|
27584
|
-
const schemaNode = translator$
|
|
27640
|
+
const schemaNode = translator$v.encode(translatorParams);
|
|
27585
27641
|
const newNodes = schemaNode ? [schemaNode] : [];
|
|
27586
27642
|
return { nodes: newNodes, consumed: 1 };
|
|
27587
27643
|
};
|
|
@@ -27589,7 +27645,7 @@ const drawingNodeHandlerEntity = {
|
|
|
27589
27645
|
handlerName: "drawingNodeHandler",
|
|
27590
27646
|
handler: handleDrawingNode
|
|
27591
27647
|
};
|
|
27592
|
-
const XML_NODE_NAME$
|
|
27648
|
+
const XML_NODE_NAME$3 = "w:del";
|
|
27593
27649
|
const SD_ATTR_KEY = "trackDelete";
|
|
27594
27650
|
const validXmlAttributes$2 = [
|
|
27595
27651
|
createAttributeHandler("w:id", "id"),
|
|
@@ -27597,7 +27653,7 @@ const validXmlAttributes$2 = [
|
|
|
27597
27653
|
createAttributeHandler("w:author", "author"),
|
|
27598
27654
|
createAttributeHandler("w:authorEmail", "authorEmail")
|
|
27599
27655
|
];
|
|
27600
|
-
const encode$
|
|
27656
|
+
const encode$5 = (params, encodedAttrs = {}) => {
|
|
27601
27657
|
const { nodeListHandler, extraParams = {}, converter } = params;
|
|
27602
27658
|
const { node } = extraParams;
|
|
27603
27659
|
if (encodedAttrs.id && converter?.trackedChangeIdMap?.has(encodedAttrs.id)) {
|
|
@@ -27626,7 +27682,7 @@ const encode$2 = (params, encodedAttrs = {}) => {
|
|
|
27626
27682
|
});
|
|
27627
27683
|
return subs;
|
|
27628
27684
|
};
|
|
27629
|
-
function decode$
|
|
27685
|
+
function decode$5(params) {
|
|
27630
27686
|
const { node } = params;
|
|
27631
27687
|
if (!node || !node.type) {
|
|
27632
27688
|
return null;
|
|
@@ -27653,15 +27709,15 @@ function decode$2(params) {
|
|
|
27653
27709
|
elements: [translatedTextNode]
|
|
27654
27710
|
};
|
|
27655
27711
|
}
|
|
27656
|
-
const config$
|
|
27657
|
-
xmlName: XML_NODE_NAME$
|
|
27712
|
+
const config$3 = {
|
|
27713
|
+
xmlName: XML_NODE_NAME$3,
|
|
27658
27714
|
sdNodeOrKeyName: SD_ATTR_KEY,
|
|
27659
27715
|
type: NodeTranslator.translatorTypes.ATTRIBUTE,
|
|
27660
|
-
encode: encode$
|
|
27661
|
-
decode: decode$
|
|
27716
|
+
encode: encode$5,
|
|
27717
|
+
decode: decode$5,
|
|
27662
27718
|
attributes: validXmlAttributes$2
|
|
27663
27719
|
};
|
|
27664
|
-
const translator$
|
|
27720
|
+
const translator$3 = NodeTranslator.from(config$3);
|
|
27665
27721
|
const isTrackChangeElement = (node) => node?.name === "w:del" || node?.name === "w:ins";
|
|
27666
27722
|
const unwrapTrackChangeNode = (node) => {
|
|
27667
27723
|
if (!node) {
|
|
@@ -27700,7 +27756,7 @@ const handleTrackChangeNode = (params) => {
|
|
|
27700
27756
|
};
|
|
27701
27757
|
switch (mainNode.name) {
|
|
27702
27758
|
case "w:del":
|
|
27703
|
-
result = translator$
|
|
27759
|
+
result = translator$3.encode({
|
|
27704
27760
|
...translatorParams,
|
|
27705
27761
|
extraParams: {
|
|
27706
27762
|
...translatorParams.extraParams,
|
|
@@ -27709,7 +27765,7 @@ const handleTrackChangeNode = (params) => {
|
|
|
27709
27765
|
});
|
|
27710
27766
|
break;
|
|
27711
27767
|
case "w:ins":
|
|
27712
|
-
result = translator$
|
|
27768
|
+
result = translator$1z.encode({
|
|
27713
27769
|
...translatorParams,
|
|
27714
27770
|
extraParams: {
|
|
27715
27771
|
...translatorParams.extraParams,
|
|
@@ -27724,12 +27780,12 @@ const trackChangeNodeHandlerEntity = {
|
|
|
27724
27780
|
handlerName: "trackChangeNodeHandler",
|
|
27725
27781
|
handler: handleTrackChangeNode
|
|
27726
27782
|
};
|
|
27727
|
-
const hyperlinkNodeHandlerEntity = generateV2HandlerEntity("hyperlinkNodeHandler", translator$
|
|
27728
|
-
const runNodeHandlerEntity = generateV2HandlerEntity("runNodeHandler", translator$
|
|
27729
|
-
const XML_NODE_NAME$
|
|
27730
|
-
const SD_NODE_NAME$
|
|
27783
|
+
const hyperlinkNodeHandlerEntity = generateV2HandlerEntity("hyperlinkNodeHandler", translator$14);
|
|
27784
|
+
const runNodeHandlerEntity = generateV2HandlerEntity("runNodeHandler", translator$13);
|
|
27785
|
+
const XML_NODE_NAME$2 = "w:t";
|
|
27786
|
+
const SD_NODE_NAME$2 = "text";
|
|
27731
27787
|
const validXmlAttributes$1 = [createAttributeHandler("xml:space", "xmlSpace")];
|
|
27732
|
-
const encode$
|
|
27788
|
+
const encode$4 = (params, encodedAttrs = {}) => {
|
|
27733
27789
|
const { node } = params.extraParams;
|
|
27734
27790
|
const { elements, type, attributes } = node;
|
|
27735
27791
|
let text;
|
|
@@ -27758,7 +27814,7 @@ const encode$1 = (params, encodedAttrs = {}) => {
|
|
|
27758
27814
|
marks: []
|
|
27759
27815
|
};
|
|
27760
27816
|
};
|
|
27761
|
-
const decode$
|
|
27817
|
+
const decode$4 = (params) => {
|
|
27762
27818
|
const { node, extraParams } = params;
|
|
27763
27819
|
if (!node || !node.type) {
|
|
27764
27820
|
return null;
|
|
@@ -27768,34 +27824,34 @@ const decode$1 = (params) => {
|
|
|
27768
27824
|
if (trackedMark) {
|
|
27769
27825
|
switch (trackedMark.type) {
|
|
27770
27826
|
case "trackDelete":
|
|
27771
|
-
return translator$
|
|
27827
|
+
return translator$3.decode(params);
|
|
27772
27828
|
case "trackInsert":
|
|
27773
|
-
return translator$
|
|
27829
|
+
return translator$1z.decode(params);
|
|
27774
27830
|
}
|
|
27775
27831
|
}
|
|
27776
27832
|
const isLinkNode = node.marks?.some((m2) => m2.type === "link");
|
|
27777
27833
|
if (isLinkNode && !extraParams?.linkProcessed) {
|
|
27778
|
-
return translator$
|
|
27834
|
+
return translator$14.decode(params);
|
|
27779
27835
|
}
|
|
27780
27836
|
const { text, marks = [] } = node;
|
|
27781
27837
|
return getTextNodeForExport(text, marks, params);
|
|
27782
27838
|
};
|
|
27783
|
-
const config$
|
|
27784
|
-
xmlName: XML_NODE_NAME$
|
|
27785
|
-
sdNodeOrKeyName: SD_NODE_NAME$
|
|
27839
|
+
const config$2 = {
|
|
27840
|
+
xmlName: XML_NODE_NAME$2,
|
|
27841
|
+
sdNodeOrKeyName: SD_NODE_NAME$2,
|
|
27786
27842
|
type: NodeTranslator.translatorTypes.NODE,
|
|
27787
|
-
encode: encode$
|
|
27788
|
-
decode: decode$
|
|
27843
|
+
encode: encode$4,
|
|
27844
|
+
decode: decode$4,
|
|
27789
27845
|
attributes: validXmlAttributes$1
|
|
27790
27846
|
};
|
|
27791
|
-
const translator$
|
|
27847
|
+
const translator$2 = NodeTranslator.from(config$2);
|
|
27792
27848
|
const handleTextNode = (params) => {
|
|
27793
27849
|
const { nodes, insideTrackChange } = params;
|
|
27794
27850
|
if (nodes.length === 0 || !(nodes[0].name === "w:t" || insideTrackChange && nodes[0].name === "w:delText")) {
|
|
27795
27851
|
return { nodes: [], consumed: 0 };
|
|
27796
27852
|
}
|
|
27797
27853
|
const node = nodes[0];
|
|
27798
|
-
const resultNode = translator$
|
|
27854
|
+
const resultNode = translator$2.encode({
|
|
27799
27855
|
...params,
|
|
27800
27856
|
extraParams: {
|
|
27801
27857
|
...params.extraParams || {},
|
|
@@ -27817,7 +27873,7 @@ const handleParagraphNode = (params) => {
|
|
|
27817
27873
|
if (nodes.length === 0 || nodes[0].name !== "w:p") {
|
|
27818
27874
|
return { nodes: [], consumed: 0 };
|
|
27819
27875
|
}
|
|
27820
|
-
const schemaNode = translator$
|
|
27876
|
+
const schemaNode = translator$15.encode(params);
|
|
27821
27877
|
const newNodes = schemaNode ? [schemaNode] : [];
|
|
27822
27878
|
return { nodes: newNodes, consumed: 1 };
|
|
27823
27879
|
};
|
|
@@ -27830,7 +27886,7 @@ const handleSdtNode = (params) => {
|
|
|
27830
27886
|
if (nodes.length === 0 || nodes[0].name !== "w:sdt") {
|
|
27831
27887
|
return { nodes: [], consumed: 0 };
|
|
27832
27888
|
}
|
|
27833
|
-
const result = translator$
|
|
27889
|
+
const result = translator$u.encode(params);
|
|
27834
27890
|
if (!result) {
|
|
27835
27891
|
return { nodes: [], consumed: 0 };
|
|
27836
27892
|
}
|
|
@@ -27844,154 +27900,205 @@ const sdtNodeHandlerEntity = {
|
|
|
27844
27900
|
handlerName: "sdtNodeHandler",
|
|
27845
27901
|
handler: handleSdtNode
|
|
27846
27902
|
};
|
|
27903
|
+
const encode$3 = (attributes) => {
|
|
27904
|
+
return attributes?.["w:id"];
|
|
27905
|
+
};
|
|
27906
|
+
const decode$3 = (attrs) => {
|
|
27907
|
+
return attrs?.id;
|
|
27908
|
+
};
|
|
27909
|
+
const attrConfig$1 = Object.freeze({
|
|
27910
|
+
xmlName: "w:id",
|
|
27911
|
+
sdName: "id",
|
|
27912
|
+
encode: encode$3,
|
|
27913
|
+
decode: decode$3
|
|
27914
|
+
});
|
|
27915
|
+
const encode$2 = (attributes) => {
|
|
27916
|
+
const val = attributes?.["w:customMarkFollows"];
|
|
27917
|
+
return val === "1" || val === "true" || val === true ? true : void 0;
|
|
27918
|
+
};
|
|
27919
|
+
const decode$2 = (attrs) => {
|
|
27920
|
+
return attrs?.customMarkFollows ? "1" : void 0;
|
|
27921
|
+
};
|
|
27922
|
+
const attrConfig = Object.freeze({
|
|
27923
|
+
xmlName: "w:customMarkFollows",
|
|
27924
|
+
sdName: "customMarkFollows",
|
|
27925
|
+
encode: encode$2,
|
|
27926
|
+
decode: decode$2
|
|
27927
|
+
});
|
|
27928
|
+
const XML_NODE_NAME$1 = "w:footnoteReference";
|
|
27929
|
+
const SD_NODE_NAME$1 = "footnoteReference";
|
|
27930
|
+
const encode$1 = (_2, encodedAttrs) => {
|
|
27931
|
+
const translated = { type: SD_NODE_NAME$1 };
|
|
27932
|
+
if (encodedAttrs && Object.keys(encodedAttrs).length > 0) {
|
|
27933
|
+
translated.attrs = { ...encodedAttrs };
|
|
27934
|
+
}
|
|
27935
|
+
return translated;
|
|
27936
|
+
};
|
|
27937
|
+
const decode$1 = (_params, decodedAttrs) => {
|
|
27938
|
+
const ref = { name: XML_NODE_NAME$1, elements: [] };
|
|
27939
|
+
if (decodedAttrs && Object.keys(decodedAttrs).length > 0) {
|
|
27940
|
+
ref.attributes = { ...decodedAttrs };
|
|
27941
|
+
}
|
|
27942
|
+
return ref;
|
|
27943
|
+
};
|
|
27944
|
+
const config$1 = {
|
|
27945
|
+
xmlName: XML_NODE_NAME$1,
|
|
27946
|
+
sdNodeOrKeyName: SD_NODE_NAME$1,
|
|
27947
|
+
type: NodeTranslator.translatorTypes.NODE,
|
|
27948
|
+
encode: encode$1,
|
|
27949
|
+
decode: decode$1,
|
|
27950
|
+
attributes: [attrConfig$1, attrConfig]
|
|
27951
|
+
};
|
|
27952
|
+
const translator$1 = NodeTranslator.from(config$1);
|
|
27847
27953
|
const translatorList = Array.from(
|
|
27848
27954
|
/* @__PURE__ */ new Set([
|
|
27849
|
-
translator$
|
|
27955
|
+
translator$1P,
|
|
27956
|
+
translator$7,
|
|
27850
27957
|
translator$6,
|
|
27851
27958
|
translator$5,
|
|
27852
27959
|
translator$4,
|
|
27853
|
-
translator$
|
|
27960
|
+
translator$1O,
|
|
27854
27961
|
translator$1N,
|
|
27855
27962
|
translator$1M,
|
|
27856
|
-
translator$
|
|
27963
|
+
translator$2q,
|
|
27964
|
+
translator$1u,
|
|
27857
27965
|
translator$2p,
|
|
27858
|
-
translator$1t,
|
|
27859
27966
|
translator$2o,
|
|
27860
|
-
translator$
|
|
27861
|
-
translator$s,
|
|
27862
|
-
translator$9,
|
|
27967
|
+
translator$t,
|
|
27863
27968
|
translator$a,
|
|
27864
|
-
translator$
|
|
27865
|
-
translator$
|
|
27866
|
-
translator$
|
|
27867
|
-
translator$
|
|
27969
|
+
translator$b,
|
|
27970
|
+
translator$1s,
|
|
27971
|
+
translator$2t,
|
|
27972
|
+
translator$I,
|
|
27973
|
+
translator$2e,
|
|
27974
|
+
translator$1K,
|
|
27975
|
+
translator$2j,
|
|
27868
27976
|
translator$1J,
|
|
27869
|
-
translator$
|
|
27977
|
+
translator$1T,
|
|
27978
|
+
translator$3,
|
|
27870
27979
|
translator$1I,
|
|
27871
|
-
translator$
|
|
27872
|
-
translator$
|
|
27873
|
-
translator$1H,
|
|
27874
|
-
translator$u,
|
|
27875
|
-
translator$2j,
|
|
27876
|
-
translator$1U,
|
|
27877
|
-
translator$1_,
|
|
27878
|
-
translator$1Z,
|
|
27879
|
-
translator$26,
|
|
27880
|
-
translator$_,
|
|
27980
|
+
translator$v,
|
|
27981
|
+
translator$2k,
|
|
27881
27982
|
translator$1V,
|
|
27882
|
-
translator$
|
|
27983
|
+
translator$1$,
|
|
27984
|
+
translator$1_,
|
|
27985
|
+
translator$27,
|
|
27986
|
+
translator$$,
|
|
27987
|
+
translator$1,
|
|
27988
|
+
translator$1W,
|
|
27989
|
+
translator$1H,
|
|
27990
|
+
translator$H,
|
|
27883
27991
|
translator$G,
|
|
27884
|
-
translator$
|
|
27885
|
-
translator$
|
|
27886
|
-
translator$10,
|
|
27887
|
-
translator$M,
|
|
27888
|
-
translator$L,
|
|
27889
|
-
translator$E,
|
|
27992
|
+
translator$f,
|
|
27993
|
+
translator$11,
|
|
27890
27994
|
translator$N,
|
|
27891
|
-
translator$
|
|
27892
|
-
translator$
|
|
27893
|
-
translator$
|
|
27894
|
-
translator$
|
|
27995
|
+
translator$M,
|
|
27996
|
+
translator$F,
|
|
27997
|
+
translator$O,
|
|
27998
|
+
translator$2s,
|
|
27999
|
+
translator$14,
|
|
28000
|
+
translator$2n,
|
|
28001
|
+
translator$1S,
|
|
28002
|
+
translator$1A,
|
|
28003
|
+
translator$1G,
|
|
28004
|
+
translator$26,
|
|
27895
28005
|
translator$1z,
|
|
27896
|
-
translator$
|
|
27897
|
-
translator$25,
|
|
27898
|
-
translator$1y,
|
|
28006
|
+
translator$Z,
|
|
27899
28007
|
translator$Y,
|
|
27900
|
-
translator$
|
|
28008
|
+
translator$1F,
|
|
27901
28009
|
translator$1E,
|
|
27902
28010
|
translator$1D,
|
|
28011
|
+
translator$1Y,
|
|
27903
28012
|
translator$1C,
|
|
27904
|
-
translator$
|
|
28013
|
+
translator$2c,
|
|
28014
|
+
translator$1q,
|
|
27905
28015
|
translator$1B,
|
|
27906
|
-
translator$
|
|
27907
|
-
translator$
|
|
27908
|
-
translator$
|
|
27909
|
-
translator$24,
|
|
27910
|
-
translator$R,
|
|
28016
|
+
translator$25,
|
|
28017
|
+
translator$S,
|
|
28018
|
+
translator$1y,
|
|
27911
28019
|
translator$1x,
|
|
28020
|
+
translator$23,
|
|
27912
28021
|
translator$1w,
|
|
27913
|
-
translator$22,
|
|
27914
28022
|
translator$1v,
|
|
27915
|
-
translator$
|
|
27916
|
-
translator$23,
|
|
27917
|
-
translator$14,
|
|
27918
|
-
translator$1h,
|
|
27919
|
-
translator$1j,
|
|
27920
|
-
translator$1W,
|
|
28023
|
+
translator$24,
|
|
27921
28024
|
translator$15,
|
|
27922
28025
|
translator$1i,
|
|
28026
|
+
translator$1k,
|
|
28027
|
+
translator$1X,
|
|
28028
|
+
translator$16,
|
|
28029
|
+
translator$1j,
|
|
28030
|
+
translator$9,
|
|
27923
28031
|
translator$8,
|
|
27924
|
-
translator$
|
|
27925
|
-
translator$
|
|
28032
|
+
translator$13,
|
|
28033
|
+
translator$2i,
|
|
28034
|
+
translator$1Q,
|
|
27926
28035
|
translator$2h,
|
|
27927
|
-
translator$
|
|
27928
|
-
translator$
|
|
27929
|
-
translator$
|
|
27930
|
-
translator$
|
|
27931
|
-
translator$
|
|
27932
|
-
translator$
|
|
27933
|
-
translator$2c,
|
|
28036
|
+
translator$1U,
|
|
28037
|
+
translator$1o,
|
|
28038
|
+
translator$u,
|
|
28039
|
+
translator$22,
|
|
28040
|
+
translator$2d,
|
|
28041
|
+
translator$29,
|
|
27934
28042
|
translator$28,
|
|
27935
|
-
translator$
|
|
28043
|
+
translator$1h,
|
|
27936
28044
|
translator$1g,
|
|
27937
28045
|
translator$1f,
|
|
27938
28046
|
translator$1e,
|
|
27939
|
-
translator$
|
|
27940
|
-
translator$
|
|
27941
|
-
translator$
|
|
27942
|
-
translator$
|
|
28047
|
+
translator$20,
|
|
28048
|
+
translator$X,
|
|
28049
|
+
translator$2l,
|
|
28050
|
+
translator$2g,
|
|
27943
28051
|
translator$2f,
|
|
27944
|
-
translator$
|
|
27945
|
-
translator$
|
|
27946
|
-
translator$
|
|
27947
|
-
translator$
|
|
27948
|
-
translator$
|
|
27949
|
-
translator$
|
|
28052
|
+
translator$2,
|
|
28053
|
+
translator$2r,
|
|
28054
|
+
translator$1d,
|
|
28055
|
+
translator$c,
|
|
28056
|
+
translator$J,
|
|
28057
|
+
translator$s,
|
|
28058
|
+
translator$h,
|
|
28059
|
+
translator$E,
|
|
27950
28060
|
translator$r,
|
|
27951
|
-
translator$
|
|
28061
|
+
translator$e,
|
|
27952
28062
|
translator$D,
|
|
27953
28063
|
translator$q,
|
|
27954
|
-
translator$d,
|
|
27955
|
-
translator$C,
|
|
27956
28064
|
translator$p,
|
|
27957
28065
|
translator$o,
|
|
27958
28066
|
translator$n,
|
|
28067
|
+
translator$g,
|
|
27959
28068
|
translator$m,
|
|
27960
|
-
translator$f,
|
|
27961
28069
|
translator$l,
|
|
27962
28070
|
translator$k,
|
|
27963
28071
|
translator$j,
|
|
27964
28072
|
translator$i,
|
|
27965
|
-
translator$h,
|
|
27966
|
-
translator$J,
|
|
27967
|
-
translator$S,
|
|
27968
|
-
translator$P,
|
|
27969
|
-
translator$Q,
|
|
27970
28073
|
translator$K,
|
|
27971
|
-
translator$11,
|
|
27972
|
-
translator$1a,
|
|
27973
|
-
translator$U,
|
|
27974
|
-
translator$x,
|
|
27975
28074
|
translator$T,
|
|
27976
|
-
translator$
|
|
27977
|
-
translator$
|
|
28075
|
+
translator$Q,
|
|
28076
|
+
translator$R,
|
|
28077
|
+
translator$L,
|
|
28078
|
+
translator$12,
|
|
27978
28079
|
translator$1b,
|
|
28080
|
+
translator$V,
|
|
28081
|
+
translator$y,
|
|
28082
|
+
translator$U,
|
|
28083
|
+
translator$C,
|
|
28084
|
+
translator$z,
|
|
28085
|
+
translator$1c,
|
|
28086
|
+
translator$1a,
|
|
27979
28087
|
translator$19,
|
|
27980
|
-
translator$
|
|
27981
|
-
translator$
|
|
27982
|
-
translator$
|
|
27983
|
-
translator$
|
|
27984
|
-
translator$
|
|
27985
|
-
translator$
|
|
27986
|
-
translator
|
|
27987
|
-
translator$
|
|
28088
|
+
translator$1m,
|
|
28089
|
+
translator$2m,
|
|
28090
|
+
translator$P,
|
|
28091
|
+
translator$21,
|
|
28092
|
+
translator$2a,
|
|
28093
|
+
translator$10,
|
|
28094
|
+
translator$1Z,
|
|
28095
|
+
translator$B,
|
|
27988
28096
|
translator$A,
|
|
27989
|
-
translator$
|
|
27990
|
-
translator$
|
|
28097
|
+
translator$1R,
|
|
28098
|
+
translator$18,
|
|
27991
28099
|
translator$17,
|
|
27992
|
-
translator$
|
|
28100
|
+
translator$x,
|
|
27993
28101
|
translator$w,
|
|
27994
|
-
translator$v,
|
|
27995
28102
|
commentRangeStartTranslator,
|
|
27996
28103
|
commentRangeEndTranslator
|
|
27997
28104
|
])
|
|
@@ -28096,7 +28203,7 @@ const handler = (params) => {
|
|
|
28096
28203
|
if (nodes.length === 0 || nodes[0].name !== "w:br") {
|
|
28097
28204
|
return { nodes: [], consumed: 0 };
|
|
28098
28205
|
}
|
|
28099
|
-
const result = translator$
|
|
28206
|
+
const result = translator$2t.encode(params);
|
|
28100
28207
|
if (!result) return { nodes: [], consumed: 0 };
|
|
28101
28208
|
return {
|
|
28102
28209
|
nodes: [result],
|
|
@@ -28144,7 +28251,7 @@ const handleBookmarkNode = (params) => {
|
|
|
28144
28251
|
consumed: translatedText.length + 2
|
|
28145
28252
|
};
|
|
28146
28253
|
}
|
|
28147
|
-
const encoded = translator$
|
|
28254
|
+
const encoded = translator$b.encode({ ...params, nodes: [node] });
|
|
28148
28255
|
if (!encoded) {
|
|
28149
28256
|
return { nodes: [], consumed: 0 };
|
|
28150
28257
|
}
|
|
@@ -28158,7 +28265,7 @@ const handleBookmarkStartNode = (params) => {
|
|
|
28158
28265
|
if (isCustomMarkBookmark(nodes[0], params.editor)) {
|
|
28159
28266
|
return handleBookmarkNode(params);
|
|
28160
28267
|
}
|
|
28161
|
-
const node = translator$
|
|
28268
|
+
const node = translator$b.encode(params);
|
|
28162
28269
|
if (!node) return { nodes: [], consumed: 0 };
|
|
28163
28270
|
return { nodes: [node], consumed: 1 };
|
|
28164
28271
|
};
|
|
@@ -28190,7 +28297,7 @@ const handleBookmarkEndNode = (params) => {
|
|
|
28190
28297
|
if (!nodes.length || nodes[0].name !== "w:bookmarkEnd") {
|
|
28191
28298
|
return { nodes: [], consumed: 0 };
|
|
28192
28299
|
}
|
|
28193
|
-
const node = translator$
|
|
28300
|
+
const node = translator$a.encode(params);
|
|
28194
28301
|
if (!node) return { nodes: [], consumed: 0 };
|
|
28195
28302
|
return { nodes: [node], consumed: 1 };
|
|
28196
28303
|
};
|
|
@@ -28240,7 +28347,7 @@ const handleAlternateChoice = (params) => {
|
|
|
28240
28347
|
...currentNode,
|
|
28241
28348
|
type: "element"
|
|
28242
28349
|
};
|
|
28243
|
-
const translated = translator$
|
|
28350
|
+
const translated = translator$1P.encode({
|
|
28244
28351
|
...params,
|
|
28245
28352
|
nodes: [nodeForTranslator],
|
|
28246
28353
|
extraParams: { ...params.extraParams || {}, node: nodeForTranslator }
|
|
@@ -28266,9 +28373,9 @@ const alternateChoiceHandler = {
|
|
|
28266
28373
|
handlerName: "alternateChoiceHandler",
|
|
28267
28374
|
handler: handleAlternateChoice
|
|
28268
28375
|
};
|
|
28269
|
-
const autoPageHandlerEntity = generateV2HandlerEntity("autoPageNumberHandler", translator$
|
|
28270
|
-
const autoTotalPageCountEntity = generateV2HandlerEntity("autoTotalPageCountEntity", translator$
|
|
28271
|
-
const pageReferenceEntity = generateV2HandlerEntity("pageReferenceNodeHandler", translator$
|
|
28376
|
+
const autoPageHandlerEntity = generateV2HandlerEntity("autoPageNumberHandler", translator$5);
|
|
28377
|
+
const autoTotalPageCountEntity = generateV2HandlerEntity("autoTotalPageCountEntity", translator$4);
|
|
28378
|
+
const pageReferenceEntity = generateV2HandlerEntity("pageReferenceNodeHandler", translator$7);
|
|
28272
28379
|
const handlePictNode = (params) => {
|
|
28273
28380
|
const { nodes } = params;
|
|
28274
28381
|
if (!nodes.length || nodes[0].name !== "w:p") {
|
|
@@ -28673,6 +28780,77 @@ const applyParentRelationships = (comments, parentMap, trackedChangeParentMap =
|
|
|
28673
28780
|
return comment;
|
|
28674
28781
|
});
|
|
28675
28782
|
};
|
|
28783
|
+
const stripFootnoteMarkerNodes = (nodes) => {
|
|
28784
|
+
if (!Array.isArray(nodes) || nodes.length === 0) return nodes;
|
|
28785
|
+
const walk = (list) => {
|
|
28786
|
+
if (!Array.isArray(list) || list.length === 0) return;
|
|
28787
|
+
for (let i = list.length - 1; i >= 0; i--) {
|
|
28788
|
+
const node = list[i];
|
|
28789
|
+
if (!node) continue;
|
|
28790
|
+
if (node.type === "passthroughInline" && node.attrs?.originalName === "w:footnoteRef") {
|
|
28791
|
+
list.splice(i, 1);
|
|
28792
|
+
continue;
|
|
28793
|
+
}
|
|
28794
|
+
if (Array.isArray(node.content)) {
|
|
28795
|
+
walk(node.content);
|
|
28796
|
+
}
|
|
28797
|
+
}
|
|
28798
|
+
};
|
|
28799
|
+
const copy2 = JSON.parse(JSON.stringify(nodes));
|
|
28800
|
+
walk(copy2);
|
|
28801
|
+
return copy2;
|
|
28802
|
+
};
|
|
28803
|
+
function importFootnoteData({ docx, editor, converter, nodeListHandler, numbering } = {}) {
|
|
28804
|
+
const handler2 = nodeListHandler || defaultNodeListHandler();
|
|
28805
|
+
const footnotes = docx?.["word/footnotes.xml"];
|
|
28806
|
+
if (!footnotes?.elements?.length) return [];
|
|
28807
|
+
const root = footnotes.elements[0];
|
|
28808
|
+
const elements = Array.isArray(root?.elements) ? root.elements : [];
|
|
28809
|
+
const footnoteElements = elements.filter((el) => el?.name === "w:footnote");
|
|
28810
|
+
if (footnoteElements.length === 0) return [];
|
|
28811
|
+
const results = [];
|
|
28812
|
+
const lists = {};
|
|
28813
|
+
const inlineDocumentFonts = [];
|
|
28814
|
+
footnoteElements.forEach((el) => {
|
|
28815
|
+
const idRaw = el?.attributes?.["w:id"];
|
|
28816
|
+
if (idRaw === void 0 || idRaw === null) return;
|
|
28817
|
+
const id = String(idRaw);
|
|
28818
|
+
const idNumber = Number(id);
|
|
28819
|
+
const originalXml = carbonCopy(el);
|
|
28820
|
+
const type = el?.attributes?.["w:type"] || null;
|
|
28821
|
+
if (type === "separator" || type === "continuationSeparator") {
|
|
28822
|
+
results.push({
|
|
28823
|
+
id,
|
|
28824
|
+
type,
|
|
28825
|
+
originalXml,
|
|
28826
|
+
content: []
|
|
28827
|
+
});
|
|
28828
|
+
return;
|
|
28829
|
+
}
|
|
28830
|
+
if (!Number.isFinite(idNumber) || idNumber < 0) return;
|
|
28831
|
+
const childElements = Array.isArray(el.elements) ? el.elements : [];
|
|
28832
|
+
const converted = handler2.handler({
|
|
28833
|
+
nodes: childElements,
|
|
28834
|
+
nodeListHandler: handler2,
|
|
28835
|
+
docx,
|
|
28836
|
+
editor,
|
|
28837
|
+
converter,
|
|
28838
|
+
numbering,
|
|
28839
|
+
lists,
|
|
28840
|
+
inlineDocumentFonts,
|
|
28841
|
+
filename: "footnotes.xml",
|
|
28842
|
+
path: [el]
|
|
28843
|
+
});
|
|
28844
|
+
const stripped = stripFootnoteMarkerNodes(converted);
|
|
28845
|
+
results.push({
|
|
28846
|
+
id,
|
|
28847
|
+
type,
|
|
28848
|
+
originalXml,
|
|
28849
|
+
content: stripped
|
|
28850
|
+
});
|
|
28851
|
+
});
|
|
28852
|
+
return results;
|
|
28853
|
+
}
|
|
28676
28854
|
const RELATIONSHIP_TYPES = (
|
|
28677
28855
|
/** @type {const} */
|
|
28678
28856
|
{
|
|
@@ -29167,15 +29345,16 @@ const handleTabNode = (params) => {
|
|
|
29167
29345
|
if (!nodes.length || nodes[0].name !== "w:tab") {
|
|
29168
29346
|
return { nodes: [], consumed: 0 };
|
|
29169
29347
|
}
|
|
29170
|
-
const node = translator$
|
|
29348
|
+
const node = translator$2r.encode(params);
|
|
29171
29349
|
return { nodes: [node], consumed: 1 };
|
|
29172
29350
|
};
|
|
29173
29351
|
const tabNodeEntityHandler = {
|
|
29174
29352
|
handlerName: "w:tabTranslator",
|
|
29175
29353
|
handler: handleTabNode
|
|
29176
29354
|
};
|
|
29177
|
-
const
|
|
29178
|
-
const
|
|
29355
|
+
const footnoteReferenceHandlerEntity = generateV2HandlerEntity("footnoteReferenceHandler", translator$1);
|
|
29356
|
+
const tableNodeHandlerEntity = generateV2HandlerEntity("tableNodeHandler", translator$c);
|
|
29357
|
+
const tableOfContentsHandlerEntity = generateV2HandlerEntity("tableOfContentsHandler", translator$6);
|
|
29179
29358
|
function preProcessPageInstruction(nodesToCombine, _instrText, fieldRunRPr = null) {
|
|
29180
29359
|
const pageNumNode = {
|
|
29181
29360
|
name: "sd:autoPageNumber",
|
|
@@ -29536,8 +29715,8 @@ const commentRangeEndHandlerEntity = generateV2HandlerEntity(
|
|
|
29536
29715
|
"commentRangeEndHandler",
|
|
29537
29716
|
commentRangeEndTranslator
|
|
29538
29717
|
);
|
|
29539
|
-
const permStartHandlerEntity = generateV2HandlerEntity("permStartHandler", translator$
|
|
29540
|
-
const permEndHandlerEntity = generateV2HandlerEntity("permEndHandler", translator$
|
|
29718
|
+
const permStartHandlerEntity = generateV2HandlerEntity("permStartHandler", translator$9);
|
|
29719
|
+
const permEndHandlerEntity = generateV2HandlerEntity("permEndHandler", translator$8);
|
|
29541
29720
|
const detectDocumentOrigin = (docx) => {
|
|
29542
29721
|
const commentsExtended = docx["word/commentsExtended.xml"];
|
|
29543
29722
|
if (commentsExtended) {
|
|
@@ -29560,6 +29739,7 @@ const createDocumentJson = (docx, converter, editor) => {
|
|
|
29560
29739
|
const json = carbonCopy(getInitialJSON(docx));
|
|
29561
29740
|
if (!json) return null;
|
|
29562
29741
|
if (converter) {
|
|
29742
|
+
importFootnotePropertiesFromSettings(docx, converter);
|
|
29563
29743
|
converter.documentOrigin = detectDocumentOrigin(docx);
|
|
29564
29744
|
}
|
|
29565
29745
|
if (converter?.telemetry) {
|
|
@@ -29609,10 +29789,11 @@ const createDocumentJson = (docx, converter, editor) => {
|
|
|
29609
29789
|
}
|
|
29610
29790
|
const contentElements = node.elements?.filter((n) => n.name !== "w:sectPr") ?? [];
|
|
29611
29791
|
const content = pruneIgnoredNodes(contentElements);
|
|
29612
|
-
const comments = importCommentData({ docx, converter, editor });
|
|
29613
29792
|
const lists = {};
|
|
29614
29793
|
const inlineDocumentFonts = [];
|
|
29615
29794
|
const numbering = getNumberingDefinitions(docx);
|
|
29795
|
+
const comments = importCommentData({ docx, converter, editor });
|
|
29796
|
+
const footnotes = importFootnoteData({ docx, nodeListHandler, converter, editor, numbering });
|
|
29616
29797
|
let parsedContent = nodeListHandler.handler({
|
|
29617
29798
|
nodes: content,
|
|
29618
29799
|
nodeListHandler,
|
|
@@ -29646,6 +29827,7 @@ const createDocumentJson = (docx, converter, editor) => {
|
|
|
29646
29827
|
savedTagsToRestore: node,
|
|
29647
29828
|
pageStyles: getDocumentStyles(node, docx, converter, editor),
|
|
29648
29829
|
comments,
|
|
29830
|
+
footnotes,
|
|
29649
29831
|
inlineDocumentFonts,
|
|
29650
29832
|
linkedStyles: getStyleDefinitions(docx),
|
|
29651
29833
|
numbering: getNumberingDefinitions(docx, converter),
|
|
@@ -29671,6 +29853,7 @@ const defaultNodeListHandler = () => {
|
|
|
29671
29853
|
drawingNodeHandlerEntity,
|
|
29672
29854
|
trackChangeNodeHandlerEntity,
|
|
29673
29855
|
tableNodeHandlerEntity,
|
|
29856
|
+
footnoteReferenceHandlerEntity,
|
|
29674
29857
|
tabNodeEntityHandler,
|
|
29675
29858
|
tableOfContentsHandlerEntity,
|
|
29676
29859
|
autoPageHandlerEntity,
|
|
@@ -29815,6 +29998,39 @@ const createNodeListHandler = (nodeHandlers) => {
|
|
|
29815
29998
|
};
|
|
29816
29999
|
return nodeListHandlerFn;
|
|
29817
30000
|
};
|
|
30001
|
+
function parseFootnoteProperties(footnotePrElement, source) {
|
|
30002
|
+
if (!footnotePrElement) return null;
|
|
30003
|
+
const props = { source };
|
|
30004
|
+
const elements = Array.isArray(footnotePrElement.elements) ? footnotePrElement.elements : [];
|
|
30005
|
+
elements.forEach((el) => {
|
|
30006
|
+
const val = el?.attributes?.["w:val"];
|
|
30007
|
+
switch (el.name) {
|
|
30008
|
+
case "w:numFmt":
|
|
30009
|
+
if (val) props.numFmt = val;
|
|
30010
|
+
break;
|
|
30011
|
+
case "w:numStart":
|
|
30012
|
+
if (val) props.numStart = val;
|
|
30013
|
+
break;
|
|
30014
|
+
case "w:numRestart":
|
|
30015
|
+
if (val) props.numRestart = val;
|
|
30016
|
+
break;
|
|
30017
|
+
case "w:pos":
|
|
30018
|
+
if (val) props.pos = val;
|
|
30019
|
+
break;
|
|
30020
|
+
}
|
|
30021
|
+
});
|
|
30022
|
+
props.originalXml = carbonCopy(footnotePrElement);
|
|
30023
|
+
return props;
|
|
30024
|
+
}
|
|
30025
|
+
function importFootnotePropertiesFromSettings(docx, converter) {
|
|
30026
|
+
if (!docx || !converter || converter.footnoteProperties) return;
|
|
30027
|
+
const settings = docx["word/settings.xml"];
|
|
30028
|
+
const settingsRoot = settings?.elements?.[0];
|
|
30029
|
+
const elements = Array.isArray(settingsRoot?.elements) ? settingsRoot.elements : [];
|
|
30030
|
+
const footnotePr = elements.find((el) => el?.name === "w:footnotePr");
|
|
30031
|
+
if (!footnotePr) return;
|
|
30032
|
+
converter.footnoteProperties = parseFootnoteProperties(footnotePr, "settings");
|
|
30033
|
+
}
|
|
29818
30034
|
function getDocumentStyles(node, docx, converter, editor, numbering) {
|
|
29819
30035
|
const sectPr = node.elements?.find((n) => n.name === "w:sectPr");
|
|
29820
30036
|
const styles = {};
|
|
@@ -29853,6 +30069,12 @@ function getDocumentStyles(node, docx, converter, editor, numbering) {
|
|
|
29853
30069
|
break;
|
|
29854
30070
|
case "w:titlePg":
|
|
29855
30071
|
converter.headerIds.titlePg = true;
|
|
30072
|
+
break;
|
|
30073
|
+
case "w:footnotePr":
|
|
30074
|
+
if (!converter.footnoteProperties) {
|
|
30075
|
+
converter.footnoteProperties = parseFootnoteProperties(el, "sectPr");
|
|
30076
|
+
}
|
|
30077
|
+
break;
|
|
29856
30078
|
}
|
|
29857
30079
|
});
|
|
29858
30080
|
importHeadersFooters(docx, converter, editor);
|
|
@@ -30062,6 +30284,7 @@ function filterOutRootInlineNodes(content = []) {
|
|
|
30062
30284
|
"commentRangeStart",
|
|
30063
30285
|
"commentRangeEnd",
|
|
30064
30286
|
"commentReference",
|
|
30287
|
+
"footnoteReference",
|
|
30065
30288
|
"structuredContent"
|
|
30066
30289
|
]);
|
|
30067
30290
|
const PRESERVABLE_INLINE_XML_NAMES = {
|
|
@@ -30745,7 +30968,7 @@ function translateContentBlock(params) {
|
|
|
30745
30968
|
if (vmlAttributes || horizontalRule) {
|
|
30746
30969
|
return translateVRectContentBlock(params);
|
|
30747
30970
|
}
|
|
30748
|
-
const alternateContent = translator$
|
|
30971
|
+
const alternateContent = translator$1P.decode(params);
|
|
30749
30972
|
return wrapTextInRun(alternateContent);
|
|
30750
30973
|
}
|
|
30751
30974
|
function translateVRectContentBlock(params) {
|
|
@@ -31212,37 +31435,38 @@ function exportSchemaToJson(params) {
|
|
|
31212
31435
|
doc: translateDocumentNode,
|
|
31213
31436
|
body: translateBodyNode,
|
|
31214
31437
|
heading: translateHeadingNode,
|
|
31215
|
-
paragraph: translator$
|
|
31216
|
-
run: translator$
|
|
31217
|
-
text: translator$
|
|
31218
|
-
lineBreak: translator$
|
|
31219
|
-
table: translator$
|
|
31220
|
-
tableRow: translator$
|
|
31221
|
-
tableCell: translator$
|
|
31222
|
-
bookmarkStart: translator$
|
|
31223
|
-
bookmarkEnd: translator$
|
|
31224
|
-
fieldAnnotation: translator$
|
|
31225
|
-
tab: translator$
|
|
31226
|
-
image: translator$
|
|
31227
|
-
hardBreak: translator$
|
|
31438
|
+
paragraph: translator$15,
|
|
31439
|
+
run: translator$13,
|
|
31440
|
+
text: translator$2,
|
|
31441
|
+
lineBreak: translator$2t,
|
|
31442
|
+
table: translator$c,
|
|
31443
|
+
tableRow: translator$y,
|
|
31444
|
+
tableCell: translator$K,
|
|
31445
|
+
bookmarkStart: translator$b,
|
|
31446
|
+
bookmarkEnd: translator$a,
|
|
31447
|
+
fieldAnnotation: translator$u,
|
|
31448
|
+
tab: translator$2r,
|
|
31449
|
+
image: translator$v,
|
|
31450
|
+
hardBreak: translator$2t,
|
|
31228
31451
|
commentRangeStart: commentRangeStartTranslator,
|
|
31229
31452
|
commentRangeEnd: commentRangeEndTranslator,
|
|
31230
|
-
permStart: translator$
|
|
31231
|
-
permEnd: translator$
|
|
31453
|
+
permStart: translator$9,
|
|
31454
|
+
permEnd: translator$8,
|
|
31232
31455
|
commentReference: () => null,
|
|
31456
|
+
footnoteReference: translator$1,
|
|
31233
31457
|
shapeContainer: translator,
|
|
31234
31458
|
shapeTextbox: translator,
|
|
31235
31459
|
contentBlock: translator,
|
|
31236
31460
|
vectorShape: translateVectorShape,
|
|
31237
31461
|
shapeGroup: translateShapeGroup,
|
|
31238
|
-
structuredContent: translator$
|
|
31239
|
-
structuredContentBlock: translator$
|
|
31240
|
-
documentPartObject: translator$
|
|
31241
|
-
documentSection: translator$
|
|
31242
|
-
"page-number": translator$
|
|
31243
|
-
"total-page-number": translator$
|
|
31244
|
-
pageReference: translator$
|
|
31245
|
-
tableOfContents: translator$
|
|
31462
|
+
structuredContent: translator$u,
|
|
31463
|
+
structuredContentBlock: translator$u,
|
|
31464
|
+
documentPartObject: translator$u,
|
|
31465
|
+
documentSection: translator$u,
|
|
31466
|
+
"page-number": translator$5,
|
|
31467
|
+
"total-page-number": translator$4,
|
|
31468
|
+
pageReference: translator$7,
|
|
31469
|
+
tableOfContents: translator$6,
|
|
31246
31470
|
passthroughBlock: translatePassthroughNode,
|
|
31247
31471
|
passthroughInline: translatePassthroughNode
|
|
31248
31472
|
};
|
|
@@ -31288,6 +31512,11 @@ function translateBodyNode(params) {
|
|
|
31288
31512
|
const defaultFooter = generateDefaultHeaderFooter("footer", params.converter.footerIds?.default);
|
|
31289
31513
|
sectPr.elements.push(defaultFooter);
|
|
31290
31514
|
}
|
|
31515
|
+
const hasFootnotePr = sectPr.elements?.some((n) => n.name === "w:footnotePr");
|
|
31516
|
+
const footnoteProperties = params.converter.footnoteProperties;
|
|
31517
|
+
if (!hasFootnotePr && footnoteProperties?.source === "sectPr" && footnoteProperties.originalXml) {
|
|
31518
|
+
sectPr.elements.push(carbonCopy(footnoteProperties.originalXml));
|
|
31519
|
+
}
|
|
31291
31520
|
}
|
|
31292
31521
|
const elements = translateChildNodes(params);
|
|
31293
31522
|
if (params.isHeaderFooter) {
|
|
@@ -31323,7 +31552,7 @@ function translateHeadingNode(params) {
|
|
|
31323
31552
|
// Maps to Heading1, Heading2, etc. in Word
|
|
31324
31553
|
}
|
|
31325
31554
|
};
|
|
31326
|
-
return translator$
|
|
31555
|
+
return translator$15.decode({ ...params, node: paragraphNode });
|
|
31327
31556
|
}
|
|
31328
31557
|
function translateDocumentNode(params) {
|
|
31329
31558
|
const bodyNode = {
|
|
@@ -31392,7 +31621,7 @@ function translateMark(mark) {
|
|
|
31392
31621
|
markElement.type = "element";
|
|
31393
31622
|
break;
|
|
31394
31623
|
case "underline": {
|
|
31395
|
-
const translated = translator$
|
|
31624
|
+
const translated = translator$2m.decode({
|
|
31396
31625
|
node: {
|
|
31397
31626
|
attrs: {
|
|
31398
31627
|
underlineType: attrs.underlineType ?? attrs.underline ?? null,
|
|
@@ -31456,7 +31685,7 @@ function translateMark(mark) {
|
|
|
31456
31685
|
break;
|
|
31457
31686
|
case "highlight": {
|
|
31458
31687
|
const highlightValue = attrs.color ?? attrs.highlight ?? null;
|
|
31459
|
-
const translated = translator$
|
|
31688
|
+
const translated = translator$2s.decode({ node: { attrs: { highlight: highlightValue } } });
|
|
31460
31689
|
return translated || {};
|
|
31461
31690
|
}
|
|
31462
31691
|
case "strike":
|
|
@@ -31590,7 +31819,7 @@ const prepareCommentParaIds = (comment) => {
|
|
|
31590
31819
|
return newComment;
|
|
31591
31820
|
};
|
|
31592
31821
|
const getCommentDefinition = (comment, commentId, allComments, editor) => {
|
|
31593
|
-
const translatedText = translator$
|
|
31822
|
+
const translatedText = translator$15.decode({ editor, node: comment.commentJSON });
|
|
31594
31823
|
const attributes = {
|
|
31595
31824
|
"w:id": String(commentId),
|
|
31596
31825
|
"w:author": comment.creatorName || comment.importedAuthor?.name,
|
|
@@ -31829,6 +32058,169 @@ const mergeRelationshipElements = (existingRelationships = [], newRelationships
|
|
|
31829
32058
|
const result = additions.length ? [...existingRelationships, ...additions] : existingRelationships;
|
|
31830
32059
|
return result;
|
|
31831
32060
|
};
|
|
32061
|
+
const RELS_XMLNS = "http://schemas.openxmlformats.org/package/2006/relationships";
|
|
32062
|
+
const FOOTNOTES_RELS_PATH = "word/_rels/footnotes.xml.rels";
|
|
32063
|
+
const paragraphHasFootnoteRef = (node) => {
|
|
32064
|
+
if (!node) return false;
|
|
32065
|
+
if (node.name === "w:footnoteRef") return true;
|
|
32066
|
+
const children = Array.isArray(node.elements) ? node.elements : [];
|
|
32067
|
+
return children.some((child) => paragraphHasFootnoteRef(child));
|
|
32068
|
+
};
|
|
32069
|
+
const insertFootnoteRefIntoParagraph = (paragraph) => {
|
|
32070
|
+
if (!paragraph || paragraph.name !== "w:p") return;
|
|
32071
|
+
if (!Array.isArray(paragraph.elements)) paragraph.elements = [];
|
|
32072
|
+
if (paragraphHasFootnoteRef(paragraph)) return;
|
|
32073
|
+
const footnoteRef = { type: "element", name: "w:footnoteRef", elements: [] };
|
|
32074
|
+
const footnoteRefRun = {
|
|
32075
|
+
type: "element",
|
|
32076
|
+
name: "w:r",
|
|
32077
|
+
elements: [
|
|
32078
|
+
{
|
|
32079
|
+
type: "element",
|
|
32080
|
+
name: "w:rPr",
|
|
32081
|
+
elements: [{ type: "element", name: "w:rStyle", attributes: { "w:val": "FootnoteReference" } }]
|
|
32082
|
+
},
|
|
32083
|
+
footnoteRef
|
|
32084
|
+
]
|
|
32085
|
+
};
|
|
32086
|
+
const pPrIndex = paragraph.elements.findIndex((el) => el?.name === "w:pPr");
|
|
32087
|
+
const insertAt = pPrIndex >= 0 ? pPrIndex + 1 : 0;
|
|
32088
|
+
paragraph.elements.splice(insertAt, 0, footnoteRefRun);
|
|
32089
|
+
};
|
|
32090
|
+
const ensureFootnoteRefMarker = (elements) => {
|
|
32091
|
+
if (!Array.isArray(elements)) return;
|
|
32092
|
+
const firstParagraphIndex = elements.findIndex((el) => el?.name === "w:p");
|
|
32093
|
+
if (firstParagraphIndex >= 0) {
|
|
32094
|
+
insertFootnoteRefIntoParagraph(elements[firstParagraphIndex]);
|
|
32095
|
+
return;
|
|
32096
|
+
}
|
|
32097
|
+
const paragraph = {
|
|
32098
|
+
type: "element",
|
|
32099
|
+
name: "w:p",
|
|
32100
|
+
elements: []
|
|
32101
|
+
};
|
|
32102
|
+
insertFootnoteRefIntoParagraph(paragraph);
|
|
32103
|
+
elements.unshift(paragraph);
|
|
32104
|
+
};
|
|
32105
|
+
const translateFootnoteContent = (content, exportContext) => {
|
|
32106
|
+
if (!Array.isArray(content) || content.length === 0) return [];
|
|
32107
|
+
const translated = [];
|
|
32108
|
+
content.forEach((node) => {
|
|
32109
|
+
if (!node) return;
|
|
32110
|
+
const result = exportSchemaToJson({ ...exportContext, node });
|
|
32111
|
+
if (Array.isArray(result)) {
|
|
32112
|
+
result.filter(Boolean).forEach((entry) => translated.push(entry));
|
|
32113
|
+
return;
|
|
32114
|
+
}
|
|
32115
|
+
if (result) translated.push(result);
|
|
32116
|
+
});
|
|
32117
|
+
return translated;
|
|
32118
|
+
};
|
|
32119
|
+
const createFootnoteElement = (footnote, exportContext) => {
|
|
32120
|
+
if (!footnote) return null;
|
|
32121
|
+
const { id, content, type, originalXml } = footnote;
|
|
32122
|
+
if ((type === "separator" || type === "continuationSeparator") && originalXml) {
|
|
32123
|
+
return carbonCopy(originalXml);
|
|
32124
|
+
}
|
|
32125
|
+
const attributes = { "w:id": String(id) };
|
|
32126
|
+
if (type) attributes["w:type"] = type;
|
|
32127
|
+
const translatedContent = translateFootnoteContent(content, exportContext);
|
|
32128
|
+
const originalHadFootnoteRef = originalXml ? paragraphHasFootnoteRef(originalXml) : true;
|
|
32129
|
+
if (originalHadFootnoteRef) {
|
|
32130
|
+
ensureFootnoteRefMarker(translatedContent);
|
|
32131
|
+
}
|
|
32132
|
+
const base = originalXml ? carbonCopy(originalXml) : {
|
|
32133
|
+
type: "element",
|
|
32134
|
+
name: "w:footnote",
|
|
32135
|
+
attributes: {},
|
|
32136
|
+
elements: []
|
|
32137
|
+
};
|
|
32138
|
+
base.attributes = { ...base.attributes || {}, ...attributes };
|
|
32139
|
+
base.elements = translatedContent;
|
|
32140
|
+
return base;
|
|
32141
|
+
};
|
|
32142
|
+
const applyFootnotePropertiesToSettings = (converter, convertedXml) => {
|
|
32143
|
+
const props = converter?.footnoteProperties;
|
|
32144
|
+
if (!props || props.source !== "settings" || !props.originalXml) {
|
|
32145
|
+
return convertedXml;
|
|
32146
|
+
}
|
|
32147
|
+
const settingsXml = convertedXml["word/settings.xml"];
|
|
32148
|
+
const settingsRoot = settingsXml?.elements?.[0];
|
|
32149
|
+
if (!settingsRoot) return convertedXml;
|
|
32150
|
+
const updatedSettings = carbonCopy(settingsXml);
|
|
32151
|
+
const updatedRoot = updatedSettings.elements?.[0];
|
|
32152
|
+
if (!updatedRoot) return convertedXml;
|
|
32153
|
+
const elements = Array.isArray(updatedRoot.elements) ? updatedRoot.elements : [];
|
|
32154
|
+
const nextElements = elements.filter((el) => el?.name !== "w:footnotePr");
|
|
32155
|
+
nextElements.push(carbonCopy(props.originalXml));
|
|
32156
|
+
updatedRoot.elements = nextElements;
|
|
32157
|
+
return { ...convertedXml, "word/settings.xml": updatedSettings };
|
|
32158
|
+
};
|
|
32159
|
+
const buildFootnotesRelsXml = (converter, convertedXml, relationships) => {
|
|
32160
|
+
if (!relationships.length) return null;
|
|
32161
|
+
const existingRels = convertedXml[FOOTNOTES_RELS_PATH];
|
|
32162
|
+
const existingRoot = existingRels?.elements?.find((el) => el.name === "Relationships");
|
|
32163
|
+
const existingElements = Array.isArray(existingRoot?.elements) ? existingRoot.elements : [];
|
|
32164
|
+
const merged = mergeRelationshipElements(existingElements, relationships);
|
|
32165
|
+
const declaration = existingRels?.declaration ?? converter?.initialJSON?.declaration;
|
|
32166
|
+
const relsXml = {
|
|
32167
|
+
...declaration ? { declaration } : {},
|
|
32168
|
+
elements: [
|
|
32169
|
+
{
|
|
32170
|
+
name: "Relationships",
|
|
32171
|
+
attributes: { xmlns: RELS_XMLNS },
|
|
32172
|
+
elements: merged
|
|
32173
|
+
}
|
|
32174
|
+
]
|
|
32175
|
+
};
|
|
32176
|
+
return relsXml;
|
|
32177
|
+
};
|
|
32178
|
+
const prepareFootnotesXmlForExport = ({ footnotes, editor, converter, convertedXml }) => {
|
|
32179
|
+
let updatedXml = applyFootnotePropertiesToSettings(converter, convertedXml);
|
|
32180
|
+
if (!footnotes || !Array.isArray(footnotes) || footnotes.length === 0) {
|
|
32181
|
+
return { updatedXml, relationships: [], media: {} };
|
|
32182
|
+
}
|
|
32183
|
+
const footnoteRelationships = [];
|
|
32184
|
+
const footnoteMedia = {};
|
|
32185
|
+
const exportContext = {
|
|
32186
|
+
editor,
|
|
32187
|
+
editorSchema: editor?.schema,
|
|
32188
|
+
converter,
|
|
32189
|
+
relationships: footnoteRelationships,
|
|
32190
|
+
media: footnoteMedia
|
|
32191
|
+
};
|
|
32192
|
+
const footnoteElements = footnotes.map((fn) => createFootnoteElement(fn, exportContext)).filter(Boolean);
|
|
32193
|
+
if (footnoteElements.length === 0) {
|
|
32194
|
+
return { updatedXml, relationships: [], media: footnoteMedia };
|
|
32195
|
+
}
|
|
32196
|
+
let footnotesXml = updatedXml["word/footnotes.xml"];
|
|
32197
|
+
if (!footnotesXml) {
|
|
32198
|
+
footnotesXml = carbonCopy(FOOTNOTES_XML_DEF);
|
|
32199
|
+
} else {
|
|
32200
|
+
footnotesXml = carbonCopy(footnotesXml);
|
|
32201
|
+
}
|
|
32202
|
+
if (footnotesXml.elements && footnotesXml.elements[0]) {
|
|
32203
|
+
footnotesXml.elements[0].elements = footnoteElements;
|
|
32204
|
+
}
|
|
32205
|
+
updatedXml = { ...updatedXml, "word/footnotes.xml": footnotesXml };
|
|
32206
|
+
if (footnoteRelationships.length > 0) {
|
|
32207
|
+
const footnotesRelsXml = buildFootnotesRelsXml(converter, updatedXml, footnoteRelationships);
|
|
32208
|
+
if (footnotesRelsXml) {
|
|
32209
|
+
updatedXml = { ...updatedXml, [FOOTNOTES_RELS_PATH]: footnotesRelsXml };
|
|
32210
|
+
}
|
|
32211
|
+
}
|
|
32212
|
+
const relationships = [
|
|
32213
|
+
{
|
|
32214
|
+
type: "element",
|
|
32215
|
+
name: "Relationship",
|
|
32216
|
+
attributes: {
|
|
32217
|
+
Type: "http://schemas.openxmlformats.org/officeDocument/2006/relationships/footnotes",
|
|
32218
|
+
Target: "footnotes.xml"
|
|
32219
|
+
}
|
|
32220
|
+
}
|
|
32221
|
+
];
|
|
32222
|
+
return { updatedXml, relationships, media: footnoteMedia };
|
|
32223
|
+
};
|
|
31832
32224
|
const FONT_FAMILY_FALLBACKS = Object.freeze({
|
|
31833
32225
|
swiss: "Arial, sans-serif",
|
|
31834
32226
|
roman: "Times New Roman, serif",
|
|
@@ -31960,6 +32352,8 @@ class SuperConverter {
|
|
|
31960
32352
|
this.fonts = params?.fonts || {};
|
|
31961
32353
|
this.addedMedia = {};
|
|
31962
32354
|
this.comments = [];
|
|
32355
|
+
this.footnotes = [];
|
|
32356
|
+
this.footnoteProperties = null;
|
|
31963
32357
|
this.inlineDocumentFonts = [];
|
|
31964
32358
|
this.docHiglightColors = /* @__PURE__ */ new Set([]);
|
|
31965
32359
|
this.xml = params?.xml;
|
|
@@ -32275,7 +32669,7 @@ class SuperConverter {
|
|
|
32275
32669
|
static getStoredSuperdocVersion(docx) {
|
|
32276
32670
|
return SuperConverter.getStoredCustomProperty(docx, "SuperdocVersion");
|
|
32277
32671
|
}
|
|
32278
|
-
static setStoredSuperdocVersion(docx = this.convertedXml, version = "1.
|
|
32672
|
+
static setStoredSuperdocVersion(docx = this.convertedXml, version = "1.6.0-next.1") {
|
|
32279
32673
|
return SuperConverter.setStoredCustomProperty(docx, "SuperdocVersion", version, false);
|
|
32280
32674
|
}
|
|
32281
32675
|
/**
|
|
@@ -32550,6 +32944,7 @@ class SuperConverter {
|
|
|
32550
32944
|
this.pageStyles = result.pageStyles;
|
|
32551
32945
|
this.numbering = result.numbering;
|
|
32552
32946
|
this.comments = result.comments;
|
|
32947
|
+
this.footnotes = result.footnotes;
|
|
32553
32948
|
this.linkedStyles = result.linkedStyles;
|
|
32554
32949
|
this.inlineDocumentFonts = result.inlineDocumentFonts;
|
|
32555
32950
|
this.themeColors = result.themeColors ?? null;
|
|
@@ -32580,10 +32975,22 @@ class SuperConverter {
|
|
|
32580
32975
|
if (exportJsonOnly) return result;
|
|
32581
32976
|
const exporter = new DocxExporter(this);
|
|
32582
32977
|
const xml = exporter.schemaToXml(result);
|
|
32978
|
+
const {
|
|
32979
|
+
updatedXml: footnotesUpdatedXml,
|
|
32980
|
+
relationships: footnotesRels,
|
|
32981
|
+
media: footnotesMedia
|
|
32982
|
+
} = prepareFootnotesXmlForExport({
|
|
32983
|
+
footnotes: this.footnotes,
|
|
32984
|
+
editor,
|
|
32985
|
+
converter: this,
|
|
32986
|
+
convertedXml: this.convertedXml
|
|
32987
|
+
});
|
|
32988
|
+
this.convertedXml = { ...this.convertedXml, ...footnotesUpdatedXml };
|
|
32583
32989
|
await this.#exportProcessMediaFiles(
|
|
32584
32990
|
{
|
|
32585
32991
|
...documentMedia,
|
|
32586
32992
|
...params.media,
|
|
32993
|
+
...footnotesMedia,
|
|
32587
32994
|
...this.media
|
|
32588
32995
|
},
|
|
32589
32996
|
editor
|
|
@@ -32601,7 +33008,7 @@ class SuperConverter {
|
|
|
32601
33008
|
}
|
|
32602
33009
|
this.convertedXml = { ...this.convertedXml, ...updatedXml };
|
|
32603
33010
|
const headFootRels = this.#exportProcessHeadersFooters({ isFinalDoc });
|
|
32604
|
-
this.#exportProcessNewRelationships([...params.relationships, ...commentsRels, ...headFootRels]);
|
|
33011
|
+
this.#exportProcessNewRelationships([...params.relationships, ...commentsRels, ...footnotesRels, ...headFootRels]);
|
|
32605
33012
|
SuperConverter.setStoredSuperdocVersion(this.convertedXml);
|
|
32606
33013
|
if (this.documentModified || this.documentGuid) {
|
|
32607
33014
|
if (!this.documentGuid) {
|
|
@@ -32950,8 +33357,8 @@ export {
|
|
|
32950
33357
|
SelectionRange as Z,
|
|
32951
33358
|
Transform as _,
|
|
32952
33359
|
createDocFromHTML as a,
|
|
32953
|
-
translator$
|
|
32954
|
-
translator$
|
|
33360
|
+
translator$1Q as a0,
|
|
33361
|
+
translator$16 as a1,
|
|
32955
33362
|
resolveDocxFontFamily as a2,
|
|
32956
33363
|
combineIndentProperties as a3,
|
|
32957
33364
|
_getReferencedTableStyles as a4,
|