@harbour-enterprises/superdoc 0.24.0-next.2 → 0.24.0-next.3
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--Z8scsXq.es.js → PdfViewer-DEWI6Uts.es.js} +1 -1
- package/dist/chunks/{PdfViewer-CYiJzT44.cjs → PdfViewer-skWUtg2N.cjs} +1 -1
- package/dist/chunks/{index-CBSXpA57.cjs → index-2QL0aZ2S.cjs} +2 -2
- package/dist/chunks/{index-CCf_X9Jy.es.js → index-C_AMhrHP.es.js} +2 -2
- package/dist/chunks/{super-editor.es-CZFQdEKI.cjs → super-editor.es-CfK_qBM9.cjs} +1484 -897
- package/dist/chunks/{super-editor.es-BFco6Gra.es.js → super-editor.es-iMAoOYOw.es.js} +1484 -897
- package/dist/core/types/index.d.ts.map +1 -1
- package/dist/style.css +5 -4
- package/dist/super-editor/ai-writer.es.js +2 -2
- package/dist/super-editor/chunks/{converter-nWAUAQ83.js → converter-BueCftlx.js} +1167 -858
- package/dist/super-editor/chunks/{docx-zipper-B2uMUaj9.js → docx-zipper-C9jmfWYZ.js} +1 -1
- package/dist/super-editor/chunks/{editor-DAyiX5AL.js → editor-BsuNqVvp.js} +332 -53
- package/dist/super-editor/chunks/{toolbar-LmzuO_YJ.js → toolbar-DxhfgAoa.js} +2 -2
- package/dist/super-editor/converter.es.js +1 -1
- package/dist/super-editor/docx-zipper.es.js +2 -2
- package/dist/super-editor/editor.es.js +3 -3
- package/dist/super-editor/file-zipper.es.js +1 -1
- package/dist/super-editor/style.css +5 -4
- package/dist/super-editor/super-editor/src/core/super-converter/helpers.d.ts +22 -0
- package/dist/super-editor/super-editor/src/core/super-converter/v2/importer/docxImporter.d.ts +1 -0
- package/dist/super-editor/super-editor/src/core/super-converter/v2/importer/trackChangesImporter.d.ts +5 -0
- package/dist/super-editor/super-editor/src/core/super-converter/v2/importer/types/index.d.ts +1 -0
- package/dist/super-editor/super-editor/src/core/super-converter/v3/handlers/helpers.d.ts +1 -0
- package/dist/super-editor/super-editor/src/core/super-converter/v3/handlers/w/del/del-translator.d.ts +7 -0
- package/dist/super-editor/super-editor/src/core/super-converter/v3/handlers/w/del/index.d.ts +1 -0
- package/dist/super-editor/super-editor/src/core/super-converter/v3/handlers/w/ins/index.d.ts +1 -0
- package/dist/super-editor/super-editor/src/core/super-converter/v3/handlers/w/ins/ins-translator.d.ts +7 -0
- package/dist/super-editor/super-editor/src/extensions/image/image.d.ts +1 -1
- package/dist/super-editor/super-editor/src/extensions/image/imageHelpers/index.d.ts +1 -0
- package/dist/super-editor/super-editor/src/extensions/image/imageHelpers/legacyAttributes.d.ts +17 -0
- package/dist/super-editor/super-editor.es.js +7 -7
- package/dist/super-editor/toolbar.es.js +2 -2
- package/dist/super-editor.cjs +1 -1
- package/dist/super-editor.es.js +1 -1
- package/dist/superdoc.cjs +2 -2
- package/dist/superdoc.es.js +2 -2
- package/dist/superdoc.umd.js +1484 -897
- package/dist/superdoc.umd.js.map +1 -1
- package/package.json +1 -1
|
@@ -15088,14 +15088,21 @@ function twipsToInches(twips) {
|
|
|
15088
15088
|
function twipsToPixels(twips) {
|
|
15089
15089
|
if (twips == null) return;
|
|
15090
15090
|
const inches = twipsToInches(twips);
|
|
15091
|
+
return inchesToPixels(inches);
|
|
15092
|
+
}
|
|
15093
|
+
function pixelsToTwips(pixels) {
|
|
15094
|
+
const inches = pixelsToInches(pixels);
|
|
15095
|
+
return inchesToTwips(inches);
|
|
15096
|
+
}
|
|
15097
|
+
function inchesToPixels(inches) {
|
|
15091
15098
|
if (inches == null) return;
|
|
15092
15099
|
const pixels = inches * 96;
|
|
15093
15100
|
return Math.round(pixels * 1e3) / 1e3;
|
|
15094
15101
|
}
|
|
15095
|
-
function
|
|
15102
|
+
function pixelsToInches(pixels) {
|
|
15096
15103
|
if (pixels == null) return;
|
|
15097
15104
|
const inches = Number(pixels) / 96;
|
|
15098
|
-
return
|
|
15105
|
+
return inches;
|
|
15099
15106
|
}
|
|
15100
15107
|
function twipsToLines(twips) {
|
|
15101
15108
|
if (twips == null) return;
|
|
@@ -15146,6 +15153,71 @@ function degreesToRot(degrees) {
|
|
|
15146
15153
|
if (degrees == null) return;
|
|
15147
15154
|
return degrees * 6e4;
|
|
15148
15155
|
}
|
|
15156
|
+
function pixelsToPolygonUnits(pixels) {
|
|
15157
|
+
if (pixels == null) return;
|
|
15158
|
+
const pu = pixels * 96;
|
|
15159
|
+
return Math.round(pu);
|
|
15160
|
+
}
|
|
15161
|
+
function polygonUnitsToPixels(pu) {
|
|
15162
|
+
if (pu == null) return;
|
|
15163
|
+
const pixels = Number(pu) / 96;
|
|
15164
|
+
return Math.round(pixels * 1e3) / 1e3;
|
|
15165
|
+
}
|
|
15166
|
+
function polygonToObj(polygonNode) {
|
|
15167
|
+
if (!polygonNode) return null;
|
|
15168
|
+
const points = [];
|
|
15169
|
+
polygonNode.elements.forEach((element) => {
|
|
15170
|
+
if (["wp:start", "wp:lineTo"].includes(element.name)) {
|
|
15171
|
+
const { x, y: y2 } = element.attributes;
|
|
15172
|
+
points.push([polygonUnitsToPixels(x), polygonUnitsToPixels(y2)]);
|
|
15173
|
+
}
|
|
15174
|
+
});
|
|
15175
|
+
if (points.length > 1) {
|
|
15176
|
+
const firstPoint = points[0];
|
|
15177
|
+
const lastPoint = points[points.length - 1];
|
|
15178
|
+
if (firstPoint[0] === lastPoint[0] && firstPoint[1] === lastPoint[1]) {
|
|
15179
|
+
points.pop();
|
|
15180
|
+
}
|
|
15181
|
+
}
|
|
15182
|
+
return points;
|
|
15183
|
+
}
|
|
15184
|
+
function objToPolygon(points) {
|
|
15185
|
+
if (!points || !Array.isArray(points)) return null;
|
|
15186
|
+
const polygonNode = {
|
|
15187
|
+
name: "wp:wrapPolygon",
|
|
15188
|
+
type: "wp:wrapPolygon",
|
|
15189
|
+
attributes: {
|
|
15190
|
+
edited: "0"
|
|
15191
|
+
},
|
|
15192
|
+
elements: []
|
|
15193
|
+
};
|
|
15194
|
+
points.forEach((point, index2) => {
|
|
15195
|
+
const [x, y2] = point;
|
|
15196
|
+
const tagName = index2 === 0 ? "wp:start" : "wp:lineTo";
|
|
15197
|
+
const pointNode = {
|
|
15198
|
+
name: tagName,
|
|
15199
|
+
type: tagName,
|
|
15200
|
+
attributes: {
|
|
15201
|
+
x: pixelsToPolygonUnits(x),
|
|
15202
|
+
y: pixelsToPolygonUnits(y2)
|
|
15203
|
+
}
|
|
15204
|
+
};
|
|
15205
|
+
polygonNode.elements.push(pointNode);
|
|
15206
|
+
});
|
|
15207
|
+
if (points.length > 0) {
|
|
15208
|
+
const [startX, startY] = points[0];
|
|
15209
|
+
const closePointNode = {
|
|
15210
|
+
name: "wp:lineTo",
|
|
15211
|
+
type: "wp:lineTo",
|
|
15212
|
+
attributes: {
|
|
15213
|
+
x: pixelsToPolygonUnits(startX),
|
|
15214
|
+
y: pixelsToPolygonUnits(startY)
|
|
15215
|
+
}
|
|
15216
|
+
};
|
|
15217
|
+
polygonNode.elements.push(closePointNode);
|
|
15218
|
+
}
|
|
15219
|
+
return polygonNode;
|
|
15220
|
+
}
|
|
15149
15221
|
const getTextIndentExportValue = (indent) => {
|
|
15150
15222
|
const [value, unit] = parseSizeUnit(indent);
|
|
15151
15223
|
const functionsMap = {
|
|
@@ -24470,37 +24542,37 @@ const _NodeTranslator = class _NodeTranslator {
|
|
|
24470
24542
|
/** @type {typeof TranslatorTypes} */
|
|
24471
24543
|
__publicField(_NodeTranslator, "translatorTypes", TranslatorTypes);
|
|
24472
24544
|
let NodeTranslator = _NodeTranslator;
|
|
24473
|
-
const encode$
|
|
24545
|
+
const encode$1e = (attributes) => {
|
|
24474
24546
|
return attributes["w:type"];
|
|
24475
24547
|
};
|
|
24476
|
-
const decode$
|
|
24548
|
+
const decode$16 = (attrs) => {
|
|
24477
24549
|
const { lineBreakType } = attrs;
|
|
24478
24550
|
return lineBreakType;
|
|
24479
24551
|
};
|
|
24480
24552
|
const attrConfig$G = Object.freeze({
|
|
24481
24553
|
xmlName: "w:type",
|
|
24482
24554
|
sdName: "lineBreakType",
|
|
24483
|
-
encode: encode$
|
|
24484
|
-
decode: decode$
|
|
24555
|
+
encode: encode$1e,
|
|
24556
|
+
decode: decode$16
|
|
24485
24557
|
});
|
|
24486
|
-
const encode$
|
|
24558
|
+
const encode$1d = (attributes) => {
|
|
24487
24559
|
const xmlAttrValue = attributes["w:clear"];
|
|
24488
24560
|
return xmlAttrValue;
|
|
24489
24561
|
};
|
|
24490
|
-
const decode$
|
|
24562
|
+
const decode$15 = (attrs) => {
|
|
24491
24563
|
const { clear } = attrs;
|
|
24492
24564
|
return clear;
|
|
24493
24565
|
};
|
|
24494
24566
|
const attrConfig$F = Object.freeze({
|
|
24495
24567
|
xmlName: "w:clear",
|
|
24496
24568
|
sdName: "clear",
|
|
24497
|
-
encode: encode$
|
|
24498
|
-
decode: decode$
|
|
24569
|
+
encode: encode$1d,
|
|
24570
|
+
decode: decode$15
|
|
24499
24571
|
});
|
|
24500
|
-
const validXmlAttributes$
|
|
24501
|
-
const XML_NODE_NAME$
|
|
24572
|
+
const validXmlAttributes$p = [attrConfig$G, attrConfig$F];
|
|
24573
|
+
const XML_NODE_NAME$B = "w:br";
|
|
24502
24574
|
const SD_NODE_NAME$h = "lineBreak";
|
|
24503
|
-
const encode$
|
|
24575
|
+
const encode$1c = (_2, encodedAttrs) => {
|
|
24504
24576
|
const isPageBreak = encodedAttrs?.lineBreakType === "page";
|
|
24505
24577
|
const translated = {
|
|
24506
24578
|
type: isPageBreak ? "hardBreak" : "lineBreak"
|
|
@@ -24510,7 +24582,7 @@ const encode$1a = (_2, encodedAttrs) => {
|
|
|
24510
24582
|
}
|
|
24511
24583
|
return translated;
|
|
24512
24584
|
};
|
|
24513
|
-
const decode$
|
|
24585
|
+
const decode$14 = (params, decodedAttrs) => {
|
|
24514
24586
|
const { node } = params;
|
|
24515
24587
|
if (!node) return;
|
|
24516
24588
|
const wBreak = { name: "w:br" };
|
|
@@ -24527,39 +24599,39 @@ const decode$12 = (params, decodedAttrs) => {
|
|
|
24527
24599
|
};
|
|
24528
24600
|
return translated;
|
|
24529
24601
|
};
|
|
24530
|
-
const config$
|
|
24531
|
-
xmlName: XML_NODE_NAME$
|
|
24602
|
+
const config$y = {
|
|
24603
|
+
xmlName: XML_NODE_NAME$B,
|
|
24532
24604
|
sdNodeOrKeyName: SD_NODE_NAME$h,
|
|
24533
24605
|
type: NodeTranslator.translatorTypes.NODE,
|
|
24534
|
-
encode: encode$
|
|
24535
|
-
decode: decode$
|
|
24536
|
-
attributes: validXmlAttributes$
|
|
24606
|
+
encode: encode$1c,
|
|
24607
|
+
decode: decode$14,
|
|
24608
|
+
attributes: validXmlAttributes$p
|
|
24537
24609
|
};
|
|
24538
|
-
const translator$
|
|
24539
|
-
const encode$
|
|
24540
|
-
const decode$
|
|
24610
|
+
const translator$1c = NodeTranslator.from(config$y);
|
|
24611
|
+
const encode$1b = (attributes) => attributes?.["w:val"];
|
|
24612
|
+
const decode$13 = (attrs) => attrs?.highlight;
|
|
24541
24613
|
const attrConfig$E = Object.freeze({
|
|
24542
24614
|
xmlName: "w:val",
|
|
24543
24615
|
sdName: "highlight",
|
|
24544
|
-
encode: encode$
|
|
24545
|
-
decode: decode$
|
|
24616
|
+
encode: encode$1b,
|
|
24617
|
+
decode: decode$13
|
|
24546
24618
|
});
|
|
24547
|
-
const validXmlAttributes$
|
|
24548
|
-
const XML_NODE_NAME$
|
|
24549
|
-
const SD_ATTR_KEY$
|
|
24619
|
+
const validXmlAttributes$o = [attrConfig$E];
|
|
24620
|
+
const XML_NODE_NAME$A = "w:highlight";
|
|
24621
|
+
const SD_ATTR_KEY$i = "highlight";
|
|
24550
24622
|
const DISABLED_TOKENS = /* @__PURE__ */ new Set(["transparent", "none", "inherit"]);
|
|
24551
|
-
const encode$
|
|
24623
|
+
const encode$1a = (params, encodedAttrs = {}) => {
|
|
24552
24624
|
const { nodes } = params;
|
|
24553
24625
|
const node = nodes?.[0];
|
|
24554
24626
|
const value = encodedAttrs.highlight ?? node?.attributes?.["w:val"];
|
|
24555
24627
|
return {
|
|
24556
24628
|
type: "attr",
|
|
24557
|
-
xmlName: XML_NODE_NAME$
|
|
24558
|
-
sdNodeOrKeyName: SD_ATTR_KEY$
|
|
24629
|
+
xmlName: XML_NODE_NAME$A,
|
|
24630
|
+
sdNodeOrKeyName: SD_ATTR_KEY$i,
|
|
24559
24631
|
attributes: { "w:val": value ?? null }
|
|
24560
24632
|
};
|
|
24561
24633
|
};
|
|
24562
|
-
const decode$
|
|
24634
|
+
const decode$12 = (params) => {
|
|
24563
24635
|
const attrs = params?.node?.attrs || {};
|
|
24564
24636
|
const highlightValue = attrs.highlight ?? attrs.color ?? null;
|
|
24565
24637
|
if (!highlightValue) return void 0;
|
|
@@ -24567,14 +24639,14 @@ const decode$10 = (params) => {
|
|
|
24567
24639
|
if (!normalizedValue) return void 0;
|
|
24568
24640
|
if (DISABLED_TOKENS.has(normalizedValue)) {
|
|
24569
24641
|
return {
|
|
24570
|
-
name: XML_NODE_NAME$
|
|
24642
|
+
name: XML_NODE_NAME$A,
|
|
24571
24643
|
attributes: { "w:val": "none" }
|
|
24572
24644
|
};
|
|
24573
24645
|
}
|
|
24574
24646
|
const keyword = getDocxHighlightKeywordFromHex(highlightValue);
|
|
24575
24647
|
if (keyword) {
|
|
24576
24648
|
return {
|
|
24577
|
-
name: XML_NODE_NAME$
|
|
24649
|
+
name: XML_NODE_NAME$A,
|
|
24578
24650
|
attributes: { "w:val": keyword }
|
|
24579
24651
|
};
|
|
24580
24652
|
}
|
|
@@ -24589,63 +24661,63 @@ const decode$10 = (params) => {
|
|
|
24589
24661
|
}
|
|
24590
24662
|
};
|
|
24591
24663
|
};
|
|
24592
|
-
const config$
|
|
24593
|
-
xmlName: XML_NODE_NAME$
|
|
24594
|
-
sdNodeOrKeyName: SD_ATTR_KEY$
|
|
24664
|
+
const config$x = {
|
|
24665
|
+
xmlName: XML_NODE_NAME$A,
|
|
24666
|
+
sdNodeOrKeyName: SD_ATTR_KEY$i,
|
|
24595
24667
|
type: NodeTranslator.translatorTypes.ATTRIBUTE,
|
|
24596
|
-
encode: encode$
|
|
24597
|
-
decode: decode$
|
|
24598
|
-
attributes: validXmlAttributes$
|
|
24668
|
+
encode: encode$1a,
|
|
24669
|
+
decode: decode$12,
|
|
24670
|
+
attributes: validXmlAttributes$o
|
|
24599
24671
|
};
|
|
24600
|
-
const translator$
|
|
24601
|
-
const encode$
|
|
24672
|
+
const translator$1b = NodeTranslator.from(config$x);
|
|
24673
|
+
const encode$19 = (attributes) => {
|
|
24602
24674
|
return attributes["w:val"];
|
|
24603
24675
|
};
|
|
24604
|
-
const decode
|
|
24676
|
+
const decode$11 = (attrs) => {
|
|
24605
24677
|
const { tabSize } = attrs || {};
|
|
24606
24678
|
return tabSize;
|
|
24607
24679
|
};
|
|
24608
24680
|
const attrConfig$D = Object.freeze({
|
|
24609
24681
|
xmlName: "w:val",
|
|
24610
24682
|
sdName: "tabSize",
|
|
24611
|
-
encode: encode$
|
|
24612
|
-
decode: decode
|
|
24683
|
+
encode: encode$19,
|
|
24684
|
+
decode: decode$11
|
|
24613
24685
|
});
|
|
24614
|
-
const encode$
|
|
24686
|
+
const encode$18 = (attributes) => {
|
|
24615
24687
|
return attributes["w:leader"];
|
|
24616
24688
|
};
|
|
24617
|
-
const decode$
|
|
24689
|
+
const decode$10 = (attrs) => {
|
|
24618
24690
|
const { leader } = attrs || {};
|
|
24619
24691
|
return leader;
|
|
24620
24692
|
};
|
|
24621
24693
|
const attrConfig$C = Object.freeze({
|
|
24622
24694
|
xmlName: "w:leader",
|
|
24623
24695
|
sdName: "leader",
|
|
24624
|
-
encode: encode$
|
|
24625
|
-
decode: decode$
|
|
24696
|
+
encode: encode$18,
|
|
24697
|
+
decode: decode$10
|
|
24626
24698
|
});
|
|
24627
|
-
const encode$
|
|
24699
|
+
const encode$17 = (attributes) => {
|
|
24628
24700
|
return attributes["w:pos"];
|
|
24629
24701
|
};
|
|
24630
|
-
const decode
|
|
24702
|
+
const decode$$ = (attrs) => {
|
|
24631
24703
|
const { pos } = attrs || {};
|
|
24632
24704
|
return pos;
|
|
24633
24705
|
};
|
|
24634
24706
|
const attrConfig$B = Object.freeze({
|
|
24635
24707
|
xmlName: "w:pos",
|
|
24636
24708
|
sdName: "pos",
|
|
24637
|
-
encode: encode$
|
|
24638
|
-
decode: decode
|
|
24709
|
+
encode: encode$17,
|
|
24710
|
+
decode: decode$$
|
|
24639
24711
|
});
|
|
24640
|
-
const validXmlAttributes$
|
|
24641
|
-
const XML_NODE_NAME$
|
|
24712
|
+
const validXmlAttributes$n = [attrConfig$D, attrConfig$B, attrConfig$C];
|
|
24713
|
+
const XML_NODE_NAME$z = "w:tab";
|
|
24642
24714
|
const SD_NODE_NAME$g = "tab";
|
|
24643
|
-
const encode$
|
|
24715
|
+
const encode$16 = (_2, encodedAttrs = {}) => {
|
|
24644
24716
|
const translated = { type: "tab" };
|
|
24645
24717
|
if (encodedAttrs) translated.attrs = { ...encodedAttrs };
|
|
24646
24718
|
return translated;
|
|
24647
24719
|
};
|
|
24648
|
-
const decode$
|
|
24720
|
+
const decode$_ = (params, decodedAttrs = {}) => {
|
|
24649
24721
|
const { node } = params || {};
|
|
24650
24722
|
if (!node) return;
|
|
24651
24723
|
const wTab = { name: "w:tab" };
|
|
@@ -24661,15 +24733,15 @@ const decode$Y = (params, decodedAttrs = {}) => {
|
|
|
24661
24733
|
}
|
|
24662
24734
|
return translated;
|
|
24663
24735
|
};
|
|
24664
|
-
const config$
|
|
24665
|
-
xmlName: XML_NODE_NAME$
|
|
24736
|
+
const config$w = {
|
|
24737
|
+
xmlName: XML_NODE_NAME$z,
|
|
24666
24738
|
sdNodeOrKeyName: SD_NODE_NAME$g,
|
|
24667
24739
|
type: NodeTranslator.translatorTypes.NODE,
|
|
24668
|
-
encode: encode$
|
|
24669
|
-
decode: decode$
|
|
24670
|
-
attributes: validXmlAttributes$
|
|
24740
|
+
encode: encode$16,
|
|
24741
|
+
decode: decode$_,
|
|
24742
|
+
attributes: validXmlAttributes$n
|
|
24671
24743
|
};
|
|
24672
|
-
const translator$
|
|
24744
|
+
const translator$1a = NodeTranslator.from(config$w);
|
|
24673
24745
|
const mergeTextNodes = (nodes) => {
|
|
24674
24746
|
if (!nodes || !Array.isArray(nodes)) {
|
|
24675
24747
|
return nodes;
|
|
@@ -25187,91 +25259,91 @@ const handleParagraphNode$1 = (params) => {
|
|
|
25187
25259
|
}
|
|
25188
25260
|
return schemaNode;
|
|
25189
25261
|
};
|
|
25190
|
-
const encode$
|
|
25262
|
+
const encode$15 = (attributes) => {
|
|
25191
25263
|
return attributes["w:rsidDel"];
|
|
25192
25264
|
};
|
|
25193
|
-
const decode$
|
|
25265
|
+
const decode$Z = (attrs) => {
|
|
25194
25266
|
return attrs.rsidDel;
|
|
25195
25267
|
};
|
|
25196
25268
|
const attrConfig$A = Object.freeze({
|
|
25197
25269
|
xmlName: "w:rsidDel",
|
|
25198
25270
|
sdName: "rsidDel",
|
|
25199
|
-
encode: encode$
|
|
25200
|
-
decode: decode$
|
|
25271
|
+
encode: encode$15,
|
|
25272
|
+
decode: decode$Z
|
|
25201
25273
|
});
|
|
25202
|
-
const encode$
|
|
25274
|
+
const encode$14 = (attributes) => {
|
|
25203
25275
|
return attributes["w:rsidP"];
|
|
25204
25276
|
};
|
|
25205
|
-
const decode$
|
|
25277
|
+
const decode$Y = (attrs) => {
|
|
25206
25278
|
return attrs.rsidP;
|
|
25207
25279
|
};
|
|
25208
25280
|
const attrConfig$z = Object.freeze({
|
|
25209
25281
|
xmlName: "w:rsidP",
|
|
25210
25282
|
sdName: "rsidP",
|
|
25211
|
-
encode: encode$
|
|
25212
|
-
decode: decode$
|
|
25283
|
+
encode: encode$14,
|
|
25284
|
+
decode: decode$Y
|
|
25213
25285
|
});
|
|
25214
|
-
const encode$
|
|
25286
|
+
const encode$13 = (attributes) => {
|
|
25215
25287
|
return attributes["w:rsidR"];
|
|
25216
25288
|
};
|
|
25217
|
-
const decode$
|
|
25289
|
+
const decode$X = (attrs) => {
|
|
25218
25290
|
return attrs.rsidR;
|
|
25219
25291
|
};
|
|
25220
25292
|
const attrConfig$y = Object.freeze({
|
|
25221
25293
|
xmlName: "w:rsidR",
|
|
25222
25294
|
sdName: "rsidR",
|
|
25223
|
-
encode: encode$
|
|
25224
|
-
decode: decode$
|
|
25295
|
+
encode: encode$13,
|
|
25296
|
+
decode: decode$X
|
|
25225
25297
|
});
|
|
25226
|
-
const encode$
|
|
25298
|
+
const encode$12 = (attributes) => {
|
|
25227
25299
|
return attributes["w:rsidRPr"];
|
|
25228
25300
|
};
|
|
25229
|
-
const decode$
|
|
25301
|
+
const decode$W = (attrs) => {
|
|
25230
25302
|
return attrs.rsidRPr;
|
|
25231
25303
|
};
|
|
25232
25304
|
const attrConfig$x = Object.freeze({
|
|
25233
25305
|
xmlName: "w:rsidRPr",
|
|
25234
25306
|
sdName: "rsidRPr",
|
|
25235
|
-
encode: encode$
|
|
25236
|
-
decode: decode$
|
|
25307
|
+
encode: encode$12,
|
|
25308
|
+
decode: decode$W
|
|
25237
25309
|
});
|
|
25238
|
-
const encode
|
|
25310
|
+
const encode$11 = (attributes) => {
|
|
25239
25311
|
return attributes["w:rsidRDefault"];
|
|
25240
25312
|
};
|
|
25241
|
-
const decode$
|
|
25313
|
+
const decode$V = (attrs) => {
|
|
25242
25314
|
return attrs.rsidRDefault;
|
|
25243
25315
|
};
|
|
25244
25316
|
const attrConfig$w = Object.freeze({
|
|
25245
25317
|
xmlName: "w:rsidRDefault",
|
|
25246
25318
|
sdName: "rsidRDefault",
|
|
25247
|
-
encode: encode
|
|
25248
|
-
decode: decode$
|
|
25319
|
+
encode: encode$11,
|
|
25320
|
+
decode: decode$V
|
|
25249
25321
|
});
|
|
25250
|
-
const encode$
|
|
25322
|
+
const encode$10 = (attributes) => {
|
|
25251
25323
|
return attributes["w14:paraId"];
|
|
25252
25324
|
};
|
|
25253
|
-
const decode$
|
|
25325
|
+
const decode$U = (attrs) => {
|
|
25254
25326
|
return attrs.paraId;
|
|
25255
25327
|
};
|
|
25256
25328
|
const attrConfig$v = Object.freeze({
|
|
25257
25329
|
xmlName: "w14:paraId",
|
|
25258
25330
|
sdName: "paraId",
|
|
25259
|
-
encode: encode$
|
|
25260
|
-
decode: decode$
|
|
25331
|
+
encode: encode$10,
|
|
25332
|
+
decode: decode$U
|
|
25261
25333
|
});
|
|
25262
|
-
const encode
|
|
25334
|
+
const encode$$ = (attributes) => {
|
|
25263
25335
|
return attributes["w14:textId"];
|
|
25264
25336
|
};
|
|
25265
|
-
const decode$
|
|
25337
|
+
const decode$T = (attrs) => {
|
|
25266
25338
|
return attrs.textId;
|
|
25267
25339
|
};
|
|
25268
25340
|
const attrConfig$u = Object.freeze({
|
|
25269
25341
|
xmlName: "w14:textId",
|
|
25270
25342
|
sdName: "textId",
|
|
25271
|
-
encode: encode
|
|
25272
|
-
decode: decode$
|
|
25343
|
+
encode: encode$$,
|
|
25344
|
+
decode: decode$T
|
|
25273
25345
|
});
|
|
25274
|
-
const validXmlAttributes$
|
|
25346
|
+
const validXmlAttributes$m = [
|
|
25275
25347
|
attrConfig$v,
|
|
25276
25348
|
attrConfig$u,
|
|
25277
25349
|
attrConfig$y,
|
|
@@ -25280,9 +25352,9 @@ const validXmlAttributes$k = [
|
|
|
25280
25352
|
attrConfig$x,
|
|
25281
25353
|
attrConfig$A
|
|
25282
25354
|
];
|
|
25283
|
-
const XML_NODE_NAME$
|
|
25355
|
+
const XML_NODE_NAME$y = "w:p";
|
|
25284
25356
|
const SD_NODE_NAME$f = "paragraph";
|
|
25285
|
-
const encode$
|
|
25357
|
+
const encode$_ = (params, encodedAttrs = {}) => {
|
|
25286
25358
|
const node = handleParagraphNode$1(params);
|
|
25287
25359
|
if (!node) return void 0;
|
|
25288
25360
|
if (encodedAttrs && Object.keys(encodedAttrs).length) {
|
|
@@ -25290,7 +25362,7 @@ const encode$Y = (params, encodedAttrs = {}) => {
|
|
|
25290
25362
|
}
|
|
25291
25363
|
return node;
|
|
25292
25364
|
};
|
|
25293
|
-
const decode$
|
|
25365
|
+
const decode$S = (params, decodedAttrs = {}) => {
|
|
25294
25366
|
const translated = translateParagraphNode(params);
|
|
25295
25367
|
if (!translated) return void 0;
|
|
25296
25368
|
if (decodedAttrs && Object.keys(decodedAttrs).length) {
|
|
@@ -25298,16 +25370,16 @@ const decode$Q = (params, decodedAttrs = {}) => {
|
|
|
25298
25370
|
}
|
|
25299
25371
|
return translated;
|
|
25300
25372
|
};
|
|
25301
|
-
const config$
|
|
25302
|
-
xmlName: XML_NODE_NAME$
|
|
25373
|
+
const config$v = {
|
|
25374
|
+
xmlName: XML_NODE_NAME$y,
|
|
25303
25375
|
sdNodeOrKeyName: SD_NODE_NAME$f,
|
|
25304
25376
|
type: NodeTranslator.translatorTypes.NODE,
|
|
25305
|
-
encode: encode$
|
|
25306
|
-
decode: decode$
|
|
25307
|
-
attributes: validXmlAttributes$
|
|
25377
|
+
encode: encode$_,
|
|
25378
|
+
decode: decode$S,
|
|
25379
|
+
attributes: validXmlAttributes$m
|
|
25308
25380
|
};
|
|
25309
|
-
const translator$
|
|
25310
|
-
const encode$
|
|
25381
|
+
const translator$19 = NodeTranslator.from(config$v);
|
|
25382
|
+
const encode$Z = (attributes) => {
|
|
25311
25383
|
const raw = attributes?.["w:val"];
|
|
25312
25384
|
if (raw === void 0 || raw === null) return void 0;
|
|
25313
25385
|
if (typeof raw === "boolean") return raw;
|
|
@@ -25317,24 +25389,24 @@ const encode$X = (attributes) => {
|
|
|
25317
25389
|
if (val === "1" || val === "true" || val === "on") return true;
|
|
25318
25390
|
return void 0;
|
|
25319
25391
|
};
|
|
25320
|
-
const decode$
|
|
25392
|
+
const decode$R = (runProps) => {
|
|
25321
25393
|
if (runProps?.bold === false) return "0";
|
|
25322
25394
|
return void 0;
|
|
25323
25395
|
};
|
|
25324
25396
|
const attrConfig$t = Object.freeze({
|
|
25325
25397
|
xmlName: "w:val",
|
|
25326
25398
|
sdName: "bold",
|
|
25327
|
-
encode: encode$
|
|
25328
|
-
decode: decode$
|
|
25399
|
+
encode: encode$Z,
|
|
25400
|
+
decode: decode$R
|
|
25329
25401
|
});
|
|
25330
|
-
const validXmlAttributes$
|
|
25331
|
-
const XML_NODE_NAME$
|
|
25332
|
-
const SD_ATTR_KEY$
|
|
25333
|
-
const encode$
|
|
25402
|
+
const validXmlAttributes$l = [attrConfig$t];
|
|
25403
|
+
const XML_NODE_NAME$x = "w:b";
|
|
25404
|
+
const SD_ATTR_KEY$h = "bold";
|
|
25405
|
+
const encode$Y = (params, encodedAttrs = {}) => {
|
|
25334
25406
|
const { nodes } = params;
|
|
25335
25407
|
const node = nodes[0];
|
|
25336
25408
|
if (!node) return void 0;
|
|
25337
|
-
const val = encodedAttrs?.[SD_ATTR_KEY$
|
|
25409
|
+
const val = encodedAttrs?.[SD_ATTR_KEY$h];
|
|
25338
25410
|
let attributes;
|
|
25339
25411
|
if (val === false) attributes = { "w:val": "0" };
|
|
25340
25412
|
else if (val === true)
|
|
@@ -25342,85 +25414,85 @@ const encode$W = (params, encodedAttrs = {}) => {
|
|
|
25342
25414
|
else attributes = node.attributes || {};
|
|
25343
25415
|
return {
|
|
25344
25416
|
type: "attr",
|
|
25345
|
-
xmlName: XML_NODE_NAME$
|
|
25346
|
-
sdNodeOrKeyName: SD_ATTR_KEY$
|
|
25417
|
+
xmlName: XML_NODE_NAME$x,
|
|
25418
|
+
sdNodeOrKeyName: SD_ATTR_KEY$h,
|
|
25347
25419
|
attributes
|
|
25348
25420
|
};
|
|
25349
25421
|
};
|
|
25350
|
-
const config$
|
|
25351
|
-
xmlName: XML_NODE_NAME$
|
|
25352
|
-
sdNodeOrKeyName: SD_ATTR_KEY$
|
|
25422
|
+
const config$u = {
|
|
25423
|
+
xmlName: XML_NODE_NAME$x,
|
|
25424
|
+
sdNodeOrKeyName: SD_ATTR_KEY$h,
|
|
25353
25425
|
type: NodeTranslator.translatorTypes.ATTRIBUTE,
|
|
25354
|
-
encode: encode$
|
|
25355
|
-
attributes: validXmlAttributes$
|
|
25426
|
+
encode: encode$Y,
|
|
25427
|
+
attributes: validXmlAttributes$l
|
|
25356
25428
|
};
|
|
25357
|
-
const translator$
|
|
25358
|
-
const XML_NODE_NAME$
|
|
25359
|
-
const SD_ATTR_KEY$
|
|
25360
|
-
const encode$
|
|
25429
|
+
const translator$18 = NodeTranslator.from(config$u);
|
|
25430
|
+
const XML_NODE_NAME$w = "w:i";
|
|
25431
|
+
const SD_ATTR_KEY$g = "italic";
|
|
25432
|
+
const encode$X = (params) => {
|
|
25361
25433
|
const { nodes } = params;
|
|
25362
25434
|
const node = nodes?.[0];
|
|
25363
25435
|
if (!node) return void 0;
|
|
25364
25436
|
return {
|
|
25365
25437
|
type: "attr",
|
|
25366
|
-
xmlName: XML_NODE_NAME$
|
|
25367
|
-
sdNodeOrKeyName: SD_ATTR_KEY$
|
|
25438
|
+
xmlName: XML_NODE_NAME$w,
|
|
25439
|
+
sdNodeOrKeyName: SD_ATTR_KEY$g,
|
|
25368
25440
|
attributes: {
|
|
25369
25441
|
"w:val": node.attributes?.["w:val"] ?? null
|
|
25370
25442
|
}
|
|
25371
25443
|
};
|
|
25372
25444
|
};
|
|
25373
|
-
const config$
|
|
25374
|
-
xmlName: XML_NODE_NAME$
|
|
25375
|
-
sdNodeOrKeyName: SD_ATTR_KEY$
|
|
25445
|
+
const config$t = {
|
|
25446
|
+
xmlName: XML_NODE_NAME$w,
|
|
25447
|
+
sdNodeOrKeyName: SD_ATTR_KEY$g,
|
|
25376
25448
|
type: NodeTranslator.translatorTypes.ATTRIBUTE,
|
|
25377
|
-
encode: encode$
|
|
25449
|
+
encode: encode$X
|
|
25378
25450
|
};
|
|
25379
|
-
const translator$
|
|
25380
|
-
const encode$
|
|
25381
|
-
const decode$
|
|
25451
|
+
const translator$17 = NodeTranslator.from(config$t);
|
|
25452
|
+
const encode$W = (attributes) => attributes?.["w:val"];
|
|
25453
|
+
const decode$Q = (attrs) => attrs?.underline;
|
|
25382
25454
|
const attrConfig$s = Object.freeze({
|
|
25383
25455
|
xmlName: "w:val",
|
|
25384
25456
|
sdName: "underline",
|
|
25385
|
-
encode: encode$
|
|
25386
|
-
decode: decode$
|
|
25457
|
+
encode: encode$W,
|
|
25458
|
+
decode: decode$Q
|
|
25387
25459
|
});
|
|
25388
|
-
const encode$
|
|
25389
|
-
const decode$
|
|
25460
|
+
const encode$V = (attributes) => attributes?.["w:color"];
|
|
25461
|
+
const decode$P = (attrs) => attrs?.color;
|
|
25390
25462
|
const attrConfig$r = Object.freeze({
|
|
25391
25463
|
xmlName: "w:color",
|
|
25392
25464
|
sdName: "color",
|
|
25393
|
-
encode: encode$
|
|
25394
|
-
decode: decode$
|
|
25465
|
+
encode: encode$V,
|
|
25466
|
+
decode: decode$P
|
|
25395
25467
|
});
|
|
25396
|
-
const encode$
|
|
25397
|
-
const decode$
|
|
25468
|
+
const encode$U = (attributes) => attributes?.["w:themeColor"];
|
|
25469
|
+
const decode$O = (attrs) => attrs?.themeColor;
|
|
25398
25470
|
const attrConfig$q = Object.freeze({
|
|
25399
25471
|
xmlName: "w:themeColor",
|
|
25400
25472
|
sdName: "themeColor",
|
|
25401
|
-
encode: encode$
|
|
25402
|
-
decode: decode$
|
|
25473
|
+
encode: encode$U,
|
|
25474
|
+
decode: decode$O
|
|
25403
25475
|
});
|
|
25404
|
-
const encode$
|
|
25405
|
-
const decode$
|
|
25476
|
+
const encode$T = (attributes) => attributes?.["w:themeTint"];
|
|
25477
|
+
const decode$N = (attrs) => attrs?.themeTint;
|
|
25406
25478
|
const attrConfig$p = Object.freeze({
|
|
25407
25479
|
xmlName: "w:themeTint",
|
|
25408
25480
|
sdName: "themeTint",
|
|
25409
|
-
encode: encode$
|
|
25410
|
-
decode: decode$
|
|
25481
|
+
encode: encode$T,
|
|
25482
|
+
decode: decode$N
|
|
25411
25483
|
});
|
|
25412
|
-
const encode$
|
|
25413
|
-
const decode$
|
|
25484
|
+
const encode$S = (attributes) => attributes?.["w:themeShade"];
|
|
25485
|
+
const decode$M = (attrs) => attrs?.themeShade;
|
|
25414
25486
|
const attrConfig$o = Object.freeze({
|
|
25415
25487
|
xmlName: "w:themeShade",
|
|
25416
25488
|
sdName: "themeShade",
|
|
25417
|
-
encode: encode$
|
|
25418
|
-
decode: decode$
|
|
25489
|
+
encode: encode$S,
|
|
25490
|
+
decode: decode$M
|
|
25419
25491
|
});
|
|
25420
|
-
const validXmlAttributes$
|
|
25421
|
-
const XML_NODE_NAME$
|
|
25422
|
-
const SD_ATTR_KEY$
|
|
25423
|
-
const encode$
|
|
25492
|
+
const validXmlAttributes$k = [attrConfig$s, attrConfig$r, attrConfig$q, attrConfig$p, attrConfig$o];
|
|
25493
|
+
const XML_NODE_NAME$v = "w:u";
|
|
25494
|
+
const SD_ATTR_KEY$f = "underline";
|
|
25495
|
+
const encode$R = (params, encodedAttrs = {}) => {
|
|
25424
25496
|
const { nodes } = params;
|
|
25425
25497
|
const node = nodes?.[0];
|
|
25426
25498
|
const sourceAttrs = node?.attributes || {};
|
|
@@ -25436,12 +25508,12 @@ const encode$P = (params, encodedAttrs = {}) => {
|
|
|
25436
25508
|
if (themeShade !== void 0 && themeShade !== null) attributes["w:themeShade"] = themeShade;
|
|
25437
25509
|
return {
|
|
25438
25510
|
type: "attr",
|
|
25439
|
-
xmlName: XML_NODE_NAME$
|
|
25440
|
-
sdNodeOrKeyName: SD_ATTR_KEY$
|
|
25511
|
+
xmlName: XML_NODE_NAME$v,
|
|
25512
|
+
sdNodeOrKeyName: SD_ATTR_KEY$f,
|
|
25441
25513
|
attributes
|
|
25442
25514
|
};
|
|
25443
25515
|
};
|
|
25444
|
-
const decode$
|
|
25516
|
+
const decode$L = (params) => {
|
|
25445
25517
|
const attrs = params?.node?.attrs || {};
|
|
25446
25518
|
const underlineType = attrs.underlineType ?? attrs.underline ?? null;
|
|
25447
25519
|
const color = attrs.underlineColor ?? attrs.color ?? null;
|
|
@@ -25459,20 +25531,20 @@ const decode$J = (params) => {
|
|
|
25459
25531
|
if (themeTint) attributes["w:themeTint"] = themeTint;
|
|
25460
25532
|
if (themeShade) attributes["w:themeShade"] = themeShade;
|
|
25461
25533
|
return {
|
|
25462
|
-
name: XML_NODE_NAME$
|
|
25534
|
+
name: XML_NODE_NAME$v,
|
|
25463
25535
|
attributes
|
|
25464
25536
|
};
|
|
25465
25537
|
};
|
|
25466
|
-
const config$
|
|
25467
|
-
xmlName: XML_NODE_NAME$
|
|
25468
|
-
sdNodeOrKeyName: SD_ATTR_KEY$
|
|
25538
|
+
const config$s = {
|
|
25539
|
+
xmlName: XML_NODE_NAME$v,
|
|
25540
|
+
sdNodeOrKeyName: SD_ATTR_KEY$f,
|
|
25469
25541
|
type: NodeTranslator.translatorTypes.ATTRIBUTE,
|
|
25470
|
-
encode: encode$
|
|
25471
|
-
decode: decode$
|
|
25472
|
-
attributes: validXmlAttributes$
|
|
25542
|
+
encode: encode$R,
|
|
25543
|
+
decode: decode$L,
|
|
25544
|
+
attributes: validXmlAttributes$k
|
|
25473
25545
|
};
|
|
25474
|
-
const translator$
|
|
25475
|
-
const encode$
|
|
25546
|
+
const translator$16 = NodeTranslator.from(config$s);
|
|
25547
|
+
const encode$Q = (attributes) => {
|
|
25476
25548
|
const raw = attributes?.["w:val"];
|
|
25477
25549
|
if (raw === void 0 || raw === null) return void 0;
|
|
25478
25550
|
if (typeof raw === "boolean") return raw;
|
|
@@ -25482,24 +25554,24 @@ const encode$O = (attributes) => {
|
|
|
25482
25554
|
if (val === "1" || val === "true" || val === "on") return true;
|
|
25483
25555
|
return void 0;
|
|
25484
25556
|
};
|
|
25485
|
-
const decode$
|
|
25557
|
+
const decode$K = (attrs) => {
|
|
25486
25558
|
if (attrs?.strike === false) return "0";
|
|
25487
25559
|
return void 0;
|
|
25488
25560
|
};
|
|
25489
25561
|
const attrConfig$n = Object.freeze({
|
|
25490
25562
|
xmlName: "w:val",
|
|
25491
25563
|
sdName: "strike",
|
|
25492
|
-
encode: encode$
|
|
25493
|
-
decode: decode$
|
|
25564
|
+
encode: encode$Q,
|
|
25565
|
+
decode: decode$K
|
|
25494
25566
|
});
|
|
25495
|
-
const validXmlAttributes$
|
|
25496
|
-
const XML_NODE_NAME$
|
|
25497
|
-
const SD_ATTR_KEY$
|
|
25498
|
-
const encode$
|
|
25567
|
+
const validXmlAttributes$j = [attrConfig$n];
|
|
25568
|
+
const XML_NODE_NAME$u = "w:strike";
|
|
25569
|
+
const SD_ATTR_KEY$e = "strike";
|
|
25570
|
+
const encode$P = (params, encodedAttrs = {}) => {
|
|
25499
25571
|
const { nodes } = params;
|
|
25500
25572
|
const node = nodes?.[0];
|
|
25501
25573
|
if (!node) return void 0;
|
|
25502
|
-
const val = encodedAttrs?.[SD_ATTR_KEY$
|
|
25574
|
+
const val = encodedAttrs?.[SD_ATTR_KEY$e];
|
|
25503
25575
|
let attributes;
|
|
25504
25576
|
if (val === false) attributes = { "w:val": "0" };
|
|
25505
25577
|
else if (val === true) attributes = {};
|
|
@@ -25508,55 +25580,55 @@ const encode$N = (params, encodedAttrs = {}) => {
|
|
|
25508
25580
|
else if (val === true && attributes["w:val"] === void 0) delete attributes["w:val"];
|
|
25509
25581
|
return {
|
|
25510
25582
|
type: "attr",
|
|
25511
|
-
xmlName: XML_NODE_NAME$
|
|
25512
|
-
sdNodeOrKeyName: SD_ATTR_KEY$
|
|
25583
|
+
xmlName: XML_NODE_NAME$u,
|
|
25584
|
+
sdNodeOrKeyName: SD_ATTR_KEY$e,
|
|
25513
25585
|
attributes
|
|
25514
25586
|
};
|
|
25515
25587
|
};
|
|
25516
|
-
const config$
|
|
25517
|
-
xmlName: XML_NODE_NAME$
|
|
25518
|
-
sdNodeOrKeyName: SD_ATTR_KEY$
|
|
25588
|
+
const config$r = {
|
|
25589
|
+
xmlName: XML_NODE_NAME$u,
|
|
25590
|
+
sdNodeOrKeyName: SD_ATTR_KEY$e,
|
|
25519
25591
|
type: NodeTranslator.translatorTypes.ATTRIBUTE,
|
|
25520
|
-
encode: encode$
|
|
25521
|
-
attributes: validXmlAttributes$
|
|
25592
|
+
encode: encode$P,
|
|
25593
|
+
attributes: validXmlAttributes$j
|
|
25522
25594
|
};
|
|
25523
|
-
const translator$
|
|
25524
|
-
const encode$
|
|
25525
|
-
const decode$
|
|
25595
|
+
const translator$15 = NodeTranslator.from(config$r);
|
|
25596
|
+
const encode$O = (attributes) => attributes?.["w:val"];
|
|
25597
|
+
const decode$J = (attrs) => attrs?.color;
|
|
25526
25598
|
const attrConfig$m = Object.freeze({
|
|
25527
25599
|
xmlName: "w:val",
|
|
25528
25600
|
sdName: "color",
|
|
25529
|
-
encode: encode$
|
|
25530
|
-
decode: decode$
|
|
25601
|
+
encode: encode$O,
|
|
25602
|
+
decode: decode$J
|
|
25531
25603
|
});
|
|
25532
|
-
const encode$
|
|
25533
|
-
const decode$
|
|
25604
|
+
const encode$N = (attributes) => attributes?.["w:themeColor"];
|
|
25605
|
+
const decode$I = (attrs) => attrs?.themeColor;
|
|
25534
25606
|
const attrConfig$l = Object.freeze({
|
|
25535
25607
|
xmlName: "w:themeColor",
|
|
25536
25608
|
sdName: "themeColor",
|
|
25537
|
-
encode: encode$
|
|
25538
|
-
decode: decode$
|
|
25609
|
+
encode: encode$N,
|
|
25610
|
+
decode: decode$I
|
|
25539
25611
|
});
|
|
25540
|
-
const encode$
|
|
25541
|
-
const decode$
|
|
25612
|
+
const encode$M = (attributes) => attributes?.["w:themeTint"];
|
|
25613
|
+
const decode$H = (attrs) => attrs?.themeTint;
|
|
25542
25614
|
const attrConfig$k = Object.freeze({
|
|
25543
25615
|
xmlName: "w:themeTint",
|
|
25544
25616
|
sdName: "themeTint",
|
|
25545
|
-
encode: encode$
|
|
25546
|
-
decode: decode$
|
|
25617
|
+
encode: encode$M,
|
|
25618
|
+
decode: decode$H
|
|
25547
25619
|
});
|
|
25548
|
-
const encode$
|
|
25549
|
-
const decode$
|
|
25620
|
+
const encode$L = (attributes) => attributes?.["w:themeShade"];
|
|
25621
|
+
const decode$G = (attrs) => attrs?.themeShade;
|
|
25550
25622
|
const attrConfig$j = Object.freeze({
|
|
25551
25623
|
xmlName: "w:themeShade",
|
|
25552
25624
|
sdName: "themeShade",
|
|
25553
|
-
encode: encode$
|
|
25554
|
-
decode: decode$
|
|
25625
|
+
encode: encode$L,
|
|
25626
|
+
decode: decode$G
|
|
25555
25627
|
});
|
|
25556
|
-
const validXmlAttributes$
|
|
25557
|
-
const XML_NODE_NAME$
|
|
25558
|
-
const SD_ATTR_KEY$
|
|
25559
|
-
const encode$
|
|
25628
|
+
const validXmlAttributes$i = [attrConfig$m, attrConfig$l, attrConfig$k, attrConfig$j];
|
|
25629
|
+
const XML_NODE_NAME$t = "w:color";
|
|
25630
|
+
const SD_ATTR_KEY$d = "color";
|
|
25631
|
+
const encode$K = (params, encodedAttrs = {}) => {
|
|
25560
25632
|
const { nodes } = params;
|
|
25561
25633
|
const node = nodes?.[0];
|
|
25562
25634
|
const sourceAttrs = node?.attributes || {};
|
|
@@ -25571,63 +25643,63 @@ const encode$I = (params, encodedAttrs = {}) => {
|
|
|
25571
25643
|
if (themeShade !== void 0 && themeShade !== null) attributes["w:themeShade"] = themeShade;
|
|
25572
25644
|
return {
|
|
25573
25645
|
type: "attr",
|
|
25574
|
-
xmlName: XML_NODE_NAME$
|
|
25575
|
-
sdNodeOrKeyName: SD_ATTR_KEY$
|
|
25646
|
+
xmlName: XML_NODE_NAME$t,
|
|
25647
|
+
sdNodeOrKeyName: SD_ATTR_KEY$d,
|
|
25576
25648
|
attributes
|
|
25577
25649
|
};
|
|
25578
25650
|
};
|
|
25579
|
-
const config$
|
|
25580
|
-
xmlName: XML_NODE_NAME$
|
|
25581
|
-
sdNodeOrKeyName: SD_ATTR_KEY$
|
|
25651
|
+
const config$q = {
|
|
25652
|
+
xmlName: XML_NODE_NAME$t,
|
|
25653
|
+
sdNodeOrKeyName: SD_ATTR_KEY$d,
|
|
25582
25654
|
type: NodeTranslator.translatorTypes.ATTRIBUTE,
|
|
25583
|
-
encode: encode$
|
|
25584
|
-
attributes: validXmlAttributes$
|
|
25655
|
+
encode: encode$K,
|
|
25656
|
+
attributes: validXmlAttributes$i
|
|
25585
25657
|
};
|
|
25586
|
-
const translator$
|
|
25587
|
-
const encode$
|
|
25588
|
-
const decode$
|
|
25658
|
+
const translator$14 = NodeTranslator.from(config$q);
|
|
25659
|
+
const encode$J = (attributes) => attributes?.["w:eastAsia"];
|
|
25660
|
+
const decode$F = (attrs) => attrs?.eastAsia;
|
|
25589
25661
|
const attrConfig$i = Object.freeze({
|
|
25590
25662
|
xmlName: "w:eastAsia",
|
|
25591
25663
|
sdName: "eastAsia",
|
|
25592
|
-
encode: encode$
|
|
25593
|
-
decode: decode$
|
|
25664
|
+
encode: encode$J,
|
|
25665
|
+
decode: decode$F
|
|
25594
25666
|
});
|
|
25595
|
-
const encode$
|
|
25596
|
-
const decode$
|
|
25667
|
+
const encode$I = (attributes) => attributes?.["w:ascii"];
|
|
25668
|
+
const decode$E = (attrs) => attrs?.ascii;
|
|
25597
25669
|
const attrConfig$h = Object.freeze({
|
|
25598
25670
|
xmlName: "w:ascii",
|
|
25599
25671
|
sdName: "ascii",
|
|
25600
|
-
encode: encode$
|
|
25601
|
-
decode: decode$
|
|
25672
|
+
encode: encode$I,
|
|
25673
|
+
decode: decode$E
|
|
25602
25674
|
});
|
|
25603
|
-
const encode$
|
|
25604
|
-
const decode$
|
|
25675
|
+
const encode$H = (attributes) => attributes?.["w:hAnsi"];
|
|
25676
|
+
const decode$D = (attrs) => attrs?.hAnsi;
|
|
25605
25677
|
const attrConfig$g = Object.freeze({
|
|
25606
25678
|
xmlName: "w:hAnsi",
|
|
25607
25679
|
sdName: "hAnsi",
|
|
25608
|
-
encode: encode$
|
|
25609
|
-
decode: decode$
|
|
25680
|
+
encode: encode$H,
|
|
25681
|
+
decode: decode$D
|
|
25610
25682
|
});
|
|
25611
|
-
const encode$
|
|
25612
|
-
const decode$
|
|
25683
|
+
const encode$G = (attributes) => attributes?.["w:cs"];
|
|
25684
|
+
const decode$C = (attrs) => attrs?.cs;
|
|
25613
25685
|
const attrConfig$f = Object.freeze({
|
|
25614
25686
|
xmlName: "w:cs",
|
|
25615
25687
|
sdName: "cs",
|
|
25616
|
-
encode: encode$
|
|
25617
|
-
decode: decode$
|
|
25688
|
+
encode: encode$G,
|
|
25689
|
+
decode: decode$C
|
|
25618
25690
|
});
|
|
25619
|
-
const encode$
|
|
25620
|
-
const decode$
|
|
25691
|
+
const encode$F = (attributes) => attributes?.["w:val"];
|
|
25692
|
+
const decode$B = (attrs) => attrs?.value;
|
|
25621
25693
|
const attrConfig$e = Object.freeze({
|
|
25622
25694
|
xmlName: "w:val",
|
|
25623
25695
|
sdName: "value",
|
|
25624
|
-
encode: encode$
|
|
25625
|
-
decode: decode$
|
|
25696
|
+
encode: encode$F,
|
|
25697
|
+
decode: decode$B
|
|
25626
25698
|
});
|
|
25627
|
-
const validXmlAttributes$
|
|
25628
|
-
const XML_NODE_NAME$
|
|
25629
|
-
const SD_ATTR_KEY$
|
|
25630
|
-
const encode$
|
|
25699
|
+
const validXmlAttributes$h = [attrConfig$i, attrConfig$h, attrConfig$g, attrConfig$f, attrConfig$e];
|
|
25700
|
+
const XML_NODE_NAME$s = "w:rFonts";
|
|
25701
|
+
const SD_ATTR_KEY$c = "fontFamily";
|
|
25702
|
+
const encode$E = (params, encodedAttrs = {}) => {
|
|
25631
25703
|
const { nodes } = params;
|
|
25632
25704
|
const node = nodes?.[0];
|
|
25633
25705
|
const sourceAttrs = node?.attributes || {};
|
|
@@ -25653,109 +25725,109 @@ const encode$C = (params, encodedAttrs = {}) => {
|
|
|
25653
25725
|
if (attributes["w:val"] === void 0) delete attributes["w:val"];
|
|
25654
25726
|
return {
|
|
25655
25727
|
type: "attr",
|
|
25656
|
-
xmlName: XML_NODE_NAME$
|
|
25657
|
-
sdNodeOrKeyName: SD_ATTR_KEY$
|
|
25728
|
+
xmlName: XML_NODE_NAME$s,
|
|
25729
|
+
sdNodeOrKeyName: SD_ATTR_KEY$c,
|
|
25658
25730
|
attributes
|
|
25659
25731
|
};
|
|
25660
25732
|
};
|
|
25661
|
-
const config$
|
|
25662
|
-
xmlName: XML_NODE_NAME$
|
|
25663
|
-
sdNodeOrKeyName: SD_ATTR_KEY$
|
|
25733
|
+
const config$p = {
|
|
25734
|
+
xmlName: XML_NODE_NAME$s,
|
|
25735
|
+
sdNodeOrKeyName: SD_ATTR_KEY$c,
|
|
25664
25736
|
type: NodeTranslator.translatorTypes.ATTRIBUTE,
|
|
25665
|
-
encode: encode$
|
|
25666
|
-
attributes: validXmlAttributes$
|
|
25737
|
+
encode: encode$E,
|
|
25738
|
+
attributes: validXmlAttributes$h
|
|
25667
25739
|
};
|
|
25668
|
-
const translator$
|
|
25669
|
-
const encode$
|
|
25670
|
-
const decode$
|
|
25740
|
+
const translator$13 = NodeTranslator.from(config$p);
|
|
25741
|
+
const encode$D = (attributes) => attributes?.["w:val"];
|
|
25742
|
+
const decode$A = (attrs) => attrs?.styleId;
|
|
25671
25743
|
const attrConfig$d = Object.freeze({
|
|
25672
25744
|
xmlName: "w:val",
|
|
25673
25745
|
sdName: "styleId",
|
|
25674
|
-
encode: encode$
|
|
25675
|
-
decode: decode$
|
|
25746
|
+
encode: encode$D,
|
|
25747
|
+
decode: decode$A
|
|
25676
25748
|
});
|
|
25677
|
-
const validXmlAttributes$
|
|
25678
|
-
const XML_NODE_NAME$
|
|
25679
|
-
const SD_ATTR_KEY$
|
|
25680
|
-
const encode$
|
|
25749
|
+
const validXmlAttributes$g = [attrConfig$d];
|
|
25750
|
+
const XML_NODE_NAME$r = "w:rStyle";
|
|
25751
|
+
const SD_ATTR_KEY$b = "styleId";
|
|
25752
|
+
const encode$C = (params, encodedAttrs = {}) => {
|
|
25681
25753
|
const { nodes } = params;
|
|
25682
25754
|
const node = nodes?.[0];
|
|
25683
25755
|
const value = encodedAttrs.styleId ?? node?.attributes?.["w:val"];
|
|
25684
25756
|
return {
|
|
25685
25757
|
type: "attr",
|
|
25686
|
-
xmlName: XML_NODE_NAME$
|
|
25687
|
-
sdNodeOrKeyName: SD_ATTR_KEY$
|
|
25758
|
+
xmlName: XML_NODE_NAME$r,
|
|
25759
|
+
sdNodeOrKeyName: SD_ATTR_KEY$b,
|
|
25688
25760
|
attributes: { "w:val": value ?? null }
|
|
25689
25761
|
};
|
|
25690
25762
|
};
|
|
25691
|
-
const config$
|
|
25692
|
-
xmlName: XML_NODE_NAME$
|
|
25693
|
-
sdNodeOrKeyName: SD_ATTR_KEY$
|
|
25763
|
+
const config$o = {
|
|
25764
|
+
xmlName: XML_NODE_NAME$r,
|
|
25765
|
+
sdNodeOrKeyName: SD_ATTR_KEY$b,
|
|
25694
25766
|
type: NodeTranslator.translatorTypes.ATTRIBUTE,
|
|
25695
|
-
encode: encode$
|
|
25696
|
-
attributes: validXmlAttributes$
|
|
25767
|
+
encode: encode$C,
|
|
25768
|
+
attributes: validXmlAttributes$g
|
|
25697
25769
|
};
|
|
25698
|
-
const translator$
|
|
25699
|
-
const encode$
|
|
25700
|
-
const decode$
|
|
25770
|
+
const translator$12 = NodeTranslator.from(config$o);
|
|
25771
|
+
const encode$B = (attributes) => attributes?.["w:val"];
|
|
25772
|
+
const decode$z = (attrs) => attrs?.fontSize;
|
|
25701
25773
|
const attrConfig$c = Object.freeze({
|
|
25702
25774
|
xmlName: "w:val",
|
|
25703
25775
|
sdName: "fontSize",
|
|
25704
|
-
encode: encode$
|
|
25705
|
-
decode: decode$
|
|
25776
|
+
encode: encode$B,
|
|
25777
|
+
decode: decode$z
|
|
25706
25778
|
});
|
|
25707
|
-
const validXmlAttributes$
|
|
25708
|
-
const XML_NODE_NAME$
|
|
25709
|
-
const SD_ATTR_KEY$
|
|
25710
|
-
const encode$
|
|
25779
|
+
const validXmlAttributes$f = [attrConfig$c];
|
|
25780
|
+
const XML_NODE_NAME$q = "w:sz";
|
|
25781
|
+
const SD_ATTR_KEY$a = "fontSize";
|
|
25782
|
+
const encode$A = (params, encodedAttrs = {}) => {
|
|
25711
25783
|
const { nodes } = params;
|
|
25712
25784
|
const node = nodes?.[0];
|
|
25713
25785
|
const value = encodedAttrs.fontSize ?? node?.attributes?.["w:val"];
|
|
25714
25786
|
return {
|
|
25715
25787
|
type: "attr",
|
|
25716
|
-
xmlName: XML_NODE_NAME$
|
|
25717
|
-
sdNodeOrKeyName: SD_ATTR_KEY$
|
|
25788
|
+
xmlName: XML_NODE_NAME$q,
|
|
25789
|
+
sdNodeOrKeyName: SD_ATTR_KEY$a,
|
|
25718
25790
|
attributes: { "w:val": value ?? null }
|
|
25719
25791
|
};
|
|
25720
25792
|
};
|
|
25721
|
-
const config$
|
|
25722
|
-
xmlName: XML_NODE_NAME$
|
|
25723
|
-
sdNodeOrKeyName: SD_ATTR_KEY$
|
|
25793
|
+
const config$n = {
|
|
25794
|
+
xmlName: XML_NODE_NAME$q,
|
|
25795
|
+
sdNodeOrKeyName: SD_ATTR_KEY$a,
|
|
25724
25796
|
type: NodeTranslator.translatorTypes.ATTRIBUTE,
|
|
25725
|
-
encode: encode$
|
|
25726
|
-
attributes: validXmlAttributes$
|
|
25797
|
+
encode: encode$A,
|
|
25798
|
+
attributes: validXmlAttributes$f
|
|
25727
25799
|
};
|
|
25728
|
-
const translator
|
|
25729
|
-
const encode$
|
|
25730
|
-
const decode$
|
|
25800
|
+
const translator$11 = NodeTranslator.from(config$n);
|
|
25801
|
+
const encode$z = (attributes) => attributes?.["w:val"];
|
|
25802
|
+
const decode$y = (attrs) => attrs?.fontSizeCs;
|
|
25731
25803
|
const attrConfig$b = Object.freeze({
|
|
25732
25804
|
xmlName: "w:val",
|
|
25733
25805
|
sdName: "fontSizeCs",
|
|
25734
|
-
encode: encode$
|
|
25735
|
-
decode: decode$
|
|
25806
|
+
encode: encode$z,
|
|
25807
|
+
decode: decode$y
|
|
25736
25808
|
});
|
|
25737
|
-
const validXmlAttributes$
|
|
25738
|
-
const XML_NODE_NAME$
|
|
25739
|
-
const SD_ATTR_KEY$
|
|
25740
|
-
const encode$
|
|
25809
|
+
const validXmlAttributes$e = [attrConfig$b];
|
|
25810
|
+
const XML_NODE_NAME$p = "w:szCs";
|
|
25811
|
+
const SD_ATTR_KEY$9 = "fontSizeCs";
|
|
25812
|
+
const encode$y = (params, encodedAttrs = {}) => {
|
|
25741
25813
|
const { nodes } = params;
|
|
25742
25814
|
const node = nodes?.[0];
|
|
25743
25815
|
const value = encodedAttrs.fontSizeCs ?? node?.attributes?.["w:val"];
|
|
25744
25816
|
return {
|
|
25745
25817
|
type: "attr",
|
|
25746
|
-
xmlName: XML_NODE_NAME$
|
|
25747
|
-
sdNodeOrKeyName: SD_ATTR_KEY$
|
|
25818
|
+
xmlName: XML_NODE_NAME$p,
|
|
25819
|
+
sdNodeOrKeyName: SD_ATTR_KEY$9,
|
|
25748
25820
|
attributes: { "w:val": value ?? null }
|
|
25749
25821
|
};
|
|
25750
25822
|
};
|
|
25751
|
-
const config$
|
|
25752
|
-
xmlName: XML_NODE_NAME$
|
|
25753
|
-
sdNodeOrKeyName: SD_ATTR_KEY$
|
|
25823
|
+
const config$m = {
|
|
25824
|
+
xmlName: XML_NODE_NAME$p,
|
|
25825
|
+
sdNodeOrKeyName: SD_ATTR_KEY$9,
|
|
25754
25826
|
type: NodeTranslator.translatorTypes.ATTRIBUTE,
|
|
25755
|
-
encode: encode$
|
|
25756
|
-
attributes: validXmlAttributes$
|
|
25827
|
+
encode: encode$y,
|
|
25828
|
+
attributes: validXmlAttributes$e
|
|
25757
25829
|
};
|
|
25758
|
-
const translator$
|
|
25830
|
+
const translator$10 = NodeTranslator.from(config$m);
|
|
25759
25831
|
const generateV2HandlerEntity = (handlerName, translator2) => ({
|
|
25760
25832
|
handlerName,
|
|
25761
25833
|
handler: (params) => {
|
|
@@ -25889,9 +25961,9 @@ const integerToString = (value) => {
|
|
|
25889
25961
|
const intValue = parseInteger(value);
|
|
25890
25962
|
return intValue != void 0 ? String(intValue) : void 0;
|
|
25891
25963
|
};
|
|
25892
|
-
const XML_NODE_NAME$
|
|
25893
|
-
const SD_ATTR_KEY$
|
|
25894
|
-
const encode$
|
|
25964
|
+
const XML_NODE_NAME$o = "w:caps";
|
|
25965
|
+
const SD_ATTR_KEY$8 = "textTransform";
|
|
25966
|
+
const encode$x = (params, encodedAttrs = {}) => {
|
|
25895
25967
|
const { nodes } = params;
|
|
25896
25968
|
const node = nodes[0];
|
|
25897
25969
|
if (!node) return void 0;
|
|
@@ -25903,31 +25975,31 @@ const encode$v = (params, encodedAttrs = {}) => {
|
|
|
25903
25975
|
}
|
|
25904
25976
|
return {
|
|
25905
25977
|
type: "attr",
|
|
25906
|
-
xmlName: XML_NODE_NAME$
|
|
25907
|
-
sdNodeOrKeyName: SD_ATTR_KEY$
|
|
25908
|
-
attributes: { [SD_ATTR_KEY$
|
|
25978
|
+
xmlName: XML_NODE_NAME$o,
|
|
25979
|
+
sdNodeOrKeyName: SD_ATTR_KEY$8,
|
|
25980
|
+
attributes: { [SD_ATTR_KEY$8]: result }
|
|
25909
25981
|
};
|
|
25910
25982
|
};
|
|
25911
|
-
const config$
|
|
25912
|
-
xmlName: XML_NODE_NAME$
|
|
25913
|
-
sdNodeOrKeyName: SD_ATTR_KEY$
|
|
25983
|
+
const config$l = {
|
|
25984
|
+
xmlName: XML_NODE_NAME$o,
|
|
25985
|
+
sdNodeOrKeyName: SD_ATTR_KEY$8,
|
|
25914
25986
|
type: NodeTranslator.translatorTypes.ATTRIBUTE,
|
|
25915
|
-
encode: encode$
|
|
25987
|
+
encode: encode$x,
|
|
25916
25988
|
attributes: [createAttributeHandler("w:val")]
|
|
25917
25989
|
};
|
|
25918
|
-
const translator
|
|
25990
|
+
const translator$$ = NodeTranslator.from(config$l);
|
|
25919
25991
|
const runPropertyTranslators = Object.freeze({
|
|
25920
|
-
"w:b": translator$
|
|
25921
|
-
"w:i": translator$
|
|
25922
|
-
"w:u": translator$
|
|
25923
|
-
"w:strike": translator$
|
|
25924
|
-
"w:color": translator$
|
|
25925
|
-
"w:highlight": translator$
|
|
25926
|
-
"w:rFonts": translator$
|
|
25927
|
-
"w:rStyle": translator$
|
|
25928
|
-
"w:sz": translator
|
|
25929
|
-
"w:szCs": translator$
|
|
25930
|
-
"w:caps": translator
|
|
25992
|
+
"w:b": translator$18,
|
|
25993
|
+
"w:i": translator$17,
|
|
25994
|
+
"w:u": translator$16,
|
|
25995
|
+
"w:strike": translator$15,
|
|
25996
|
+
"w:color": translator$14,
|
|
25997
|
+
"w:highlight": translator$1b,
|
|
25998
|
+
"w:rFonts": translator$13,
|
|
25999
|
+
"w:rStyle": translator$12,
|
|
26000
|
+
"w:sz": translator$11,
|
|
26001
|
+
"w:szCs": translator$10,
|
|
26002
|
+
"w:caps": translator$$
|
|
25931
26003
|
});
|
|
25932
26004
|
const rawRunPropertyXmlNames = Object.freeze(["w:lang", "w:shd"]);
|
|
25933
26005
|
const RAW_CHILD_NAME_SET = new Set(rawRunPropertyXmlNames);
|
|
@@ -25941,9 +26013,9 @@ const toRunPropertyEntry = (candidate) => {
|
|
|
25941
26013
|
attributes: { ...candidate.attributes || {} }
|
|
25942
26014
|
};
|
|
25943
26015
|
};
|
|
25944
|
-
const XML_NODE_NAME$
|
|
25945
|
-
const SD_ATTR_KEY$
|
|
25946
|
-
const encode$
|
|
26016
|
+
const XML_NODE_NAME$n = "w:rPr";
|
|
26017
|
+
const SD_ATTR_KEY$7 = "runProperties";
|
|
26018
|
+
const encode$w = (params) => {
|
|
25947
26019
|
const { nodes } = params;
|
|
25948
26020
|
const node = nodes?.[0] || {};
|
|
25949
26021
|
const contents = Array.isArray(node.elements) ? node.elements : [];
|
|
@@ -25977,16 +26049,16 @@ const encode$u = (params) => {
|
|
|
25977
26049
|
attributes: runPropsArray
|
|
25978
26050
|
};
|
|
25979
26051
|
};
|
|
25980
|
-
const config$
|
|
25981
|
-
xmlName: XML_NODE_NAME$
|
|
25982
|
-
sdNodeOrKeyName: SD_ATTR_KEY$
|
|
26052
|
+
const config$k = {
|
|
26053
|
+
xmlName: XML_NODE_NAME$n,
|
|
26054
|
+
sdNodeOrKeyName: SD_ATTR_KEY$7,
|
|
25983
26055
|
type: NodeTranslator.translatorTypes.ATTRIBUTE,
|
|
25984
|
-
encode: encode$
|
|
26056
|
+
encode: encode$w
|
|
25985
26057
|
};
|
|
25986
|
-
const translator$
|
|
26058
|
+
const translator$_ = NodeTranslator.from(config$k);
|
|
25987
26059
|
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;
|
|
25988
26060
|
const containsEastAsianCharacters = (text) => EAST_ASIAN_CHARACTER_REGEX.test(text);
|
|
25989
|
-
const collectRunProperties = (params, rPrNode, translator2 = translator$
|
|
26061
|
+
const collectRunProperties = (params, rPrNode, translator2 = translator$_) => {
|
|
25990
26062
|
if (!rPrNode) return { entries: [], hadRPr: false, styleChangeMarks: [] };
|
|
25991
26063
|
const result = translator2.encode({ ...params, nodes: [rPrNode] }) || {};
|
|
25992
26064
|
let entries = [];
|
|
@@ -26459,7 +26531,7 @@ const ensureTrackedWrapper = (runs, trackingMarksByType = /* @__PURE__ */ new Ma
|
|
|
26459
26531
|
}
|
|
26460
26532
|
return runs;
|
|
26461
26533
|
};
|
|
26462
|
-
const XML_NODE_NAME$
|
|
26534
|
+
const XML_NODE_NAME$m = "w:hyperlink";
|
|
26463
26535
|
const SD_NODE_NAME$e = "link";
|
|
26464
26536
|
const _createAttributeHandler = (xmlName, sdName) => ({
|
|
26465
26537
|
xmlName,
|
|
@@ -26467,7 +26539,7 @@ const _createAttributeHandler = (xmlName, sdName) => ({
|
|
|
26467
26539
|
encode: (attributes) => attributes[xmlName],
|
|
26468
26540
|
decode: (attributes) => attributes[sdName]
|
|
26469
26541
|
});
|
|
26470
|
-
const validXmlAttributes$
|
|
26542
|
+
const validXmlAttributes$d = [
|
|
26471
26543
|
_createAttributeHandler("w:anchor", "anchor"),
|
|
26472
26544
|
_createAttributeHandler("w:docLocation", "docLocation"),
|
|
26473
26545
|
{
|
|
@@ -26480,7 +26552,7 @@ const validXmlAttributes$b = [
|
|
|
26480
26552
|
_createAttributeHandler("r:id", "rId"),
|
|
26481
26553
|
_createAttributeHandler("w:tgtFrame", "target")
|
|
26482
26554
|
];
|
|
26483
|
-
const encode$
|
|
26555
|
+
const encode$v = (params, encodedAttrs) => {
|
|
26484
26556
|
const { nodes, docx, nodeListHandler } = params;
|
|
26485
26557
|
const node = nodes[0];
|
|
26486
26558
|
let href = _resolveHref(docx, encodedAttrs);
|
|
@@ -26514,7 +26586,7 @@ const _resolveHref = (docx, encodedAttrs) => {
|
|
|
26514
26586
|
}
|
|
26515
26587
|
return href;
|
|
26516
26588
|
};
|
|
26517
|
-
function decode$
|
|
26589
|
+
function decode$x(params) {
|
|
26518
26590
|
const { hyperlinkGroup = [params.node] } = params.extraParams || {};
|
|
26519
26591
|
const node = hyperlinkGroup[0];
|
|
26520
26592
|
const linkMark = node.marks.find((m2) => m2.type === "link");
|
|
@@ -26563,55 +26635,55 @@ function _addNewLinkRelationship(params, link) {
|
|
|
26563
26635
|
});
|
|
26564
26636
|
return id;
|
|
26565
26637
|
}
|
|
26566
|
-
const config$
|
|
26567
|
-
xmlName: XML_NODE_NAME$
|
|
26638
|
+
const config$j = {
|
|
26639
|
+
xmlName: XML_NODE_NAME$m,
|
|
26568
26640
|
sdNodeOrKeyName: SD_NODE_NAME$e,
|
|
26569
26641
|
type: NodeTranslator.translatorTypes.NODE,
|
|
26570
|
-
encode: encode$
|
|
26571
|
-
decode: decode$
|
|
26572
|
-
attributes: validXmlAttributes$
|
|
26642
|
+
encode: encode$v,
|
|
26643
|
+
decode: decode$x,
|
|
26644
|
+
attributes: validXmlAttributes$d
|
|
26573
26645
|
};
|
|
26574
|
-
const translator$
|
|
26575
|
-
const encode$
|
|
26646
|
+
const translator$Z = NodeTranslator.from(config$j);
|
|
26647
|
+
const encode$u = (attributes) => {
|
|
26576
26648
|
return attributes["w:rsidR"];
|
|
26577
26649
|
};
|
|
26578
|
-
const decode$
|
|
26650
|
+
const decode$w = (attrs) => {
|
|
26579
26651
|
return attrs.rsidR;
|
|
26580
26652
|
};
|
|
26581
26653
|
const attrConfig$a = Object.freeze({
|
|
26582
26654
|
xmlName: "w:rsidR",
|
|
26583
26655
|
sdName: "rsidR",
|
|
26584
|
-
encode: encode$
|
|
26585
|
-
decode: decode$
|
|
26656
|
+
encode: encode$u,
|
|
26657
|
+
decode: decode$w
|
|
26586
26658
|
});
|
|
26587
|
-
const encode$
|
|
26659
|
+
const encode$t = (attributes) => {
|
|
26588
26660
|
return attributes["w:rsidRPr"];
|
|
26589
26661
|
};
|
|
26590
|
-
const decode$
|
|
26662
|
+
const decode$v = (attrs) => {
|
|
26591
26663
|
return attrs.rsidRPr;
|
|
26592
26664
|
};
|
|
26593
26665
|
const attrConfig$9 = Object.freeze({
|
|
26594
26666
|
xmlName: "w:rsidRPr",
|
|
26595
26667
|
sdName: "rsidRPr",
|
|
26596
|
-
encode: encode$
|
|
26597
|
-
decode: decode$
|
|
26668
|
+
encode: encode$t,
|
|
26669
|
+
decode: decode$v
|
|
26598
26670
|
});
|
|
26599
|
-
const encode$
|
|
26671
|
+
const encode$s = (attributes) => {
|
|
26600
26672
|
return attributes["w:rsidDel"];
|
|
26601
26673
|
};
|
|
26602
|
-
const decode$
|
|
26674
|
+
const decode$u = (attrs) => {
|
|
26603
26675
|
return attrs.rsidDel;
|
|
26604
26676
|
};
|
|
26605
26677
|
const attrConfig$8 = Object.freeze({
|
|
26606
26678
|
xmlName: "w:rsidDel",
|
|
26607
26679
|
sdName: "rsidDel",
|
|
26608
|
-
encode: encode$
|
|
26609
|
-
decode: decode$
|
|
26680
|
+
encode: encode$s,
|
|
26681
|
+
decode: decode$u
|
|
26610
26682
|
});
|
|
26611
|
-
const validXmlAttributes$
|
|
26612
|
-
const XML_NODE_NAME$
|
|
26683
|
+
const validXmlAttributes$c = [attrConfig$a, attrConfig$9, attrConfig$8];
|
|
26684
|
+
const XML_NODE_NAME$l = "w:r";
|
|
26613
26685
|
const SD_KEY_NAME = "run";
|
|
26614
|
-
const encode$
|
|
26686
|
+
const encode$r = (params, encodedAttrs = {}) => {
|
|
26615
26687
|
const { nodes = [], nodeListHandler } = params || {};
|
|
26616
26688
|
const runNode = nodes[0];
|
|
26617
26689
|
if (!runNode) return void 0;
|
|
@@ -26659,7 +26731,7 @@ const encode$p = (params, encodedAttrs = {}) => {
|
|
|
26659
26731
|
}
|
|
26660
26732
|
return runNodeResult;
|
|
26661
26733
|
};
|
|
26662
|
-
const decode$
|
|
26734
|
+
const decode$t = (params, decodedAttrs = {}) => {
|
|
26663
26735
|
const { node } = params || {};
|
|
26664
26736
|
if (!node) return void 0;
|
|
26665
26737
|
const isLinkNode = node.marks?.some((m2) => m2.type === "link");
|
|
@@ -26668,7 +26740,7 @@ const decode$r = (params, decodedAttrs = {}) => {
|
|
|
26668
26740
|
...params.extraParams,
|
|
26669
26741
|
linkProcessed: true
|
|
26670
26742
|
};
|
|
26671
|
-
return translator$
|
|
26743
|
+
return translator$Z.decode({ ...params, extraParams });
|
|
26672
26744
|
}
|
|
26673
26745
|
const { runNode: runNodeForExport, trackingMarksByType } = prepareRunTrackingContext(node);
|
|
26674
26746
|
const runAttrs = runNodeForExport.attrs || {};
|
|
@@ -26724,7 +26796,7 @@ const decode$r = (params, decodedAttrs = {}) => {
|
|
|
26724
26796
|
runs.push(trackedClone);
|
|
26725
26797
|
return;
|
|
26726
26798
|
}
|
|
26727
|
-
const runWrapper = { name: XML_NODE_NAME$
|
|
26799
|
+
const runWrapper = { name: XML_NODE_NAME$l, elements: [] };
|
|
26728
26800
|
applyBaseRunProps(runWrapper);
|
|
26729
26801
|
if (!Array.isArray(runWrapper.elements)) runWrapper.elements = [];
|
|
26730
26802
|
runWrapper.elements.push(cloneXmlNode(child));
|
|
@@ -26732,7 +26804,7 @@ const decode$r = (params, decodedAttrs = {}) => {
|
|
|
26732
26804
|
});
|
|
26733
26805
|
const trackedRuns = ensureTrackedWrapper(runs, trackingMarksByType);
|
|
26734
26806
|
if (!trackedRuns.length) {
|
|
26735
|
-
const emptyRun = { name: XML_NODE_NAME$
|
|
26807
|
+
const emptyRun = { name: XML_NODE_NAME$l, elements: [] };
|
|
26736
26808
|
applyBaseRunProps(emptyRun);
|
|
26737
26809
|
trackedRuns.push(emptyRun);
|
|
26738
26810
|
}
|
|
@@ -26746,15 +26818,15 @@ const decode$r = (params, decodedAttrs = {}) => {
|
|
|
26746
26818
|
}
|
|
26747
26819
|
return trackedRuns;
|
|
26748
26820
|
};
|
|
26749
|
-
const config$
|
|
26750
|
-
xmlName: XML_NODE_NAME$
|
|
26821
|
+
const config$i = {
|
|
26822
|
+
xmlName: XML_NODE_NAME$l,
|
|
26751
26823
|
sdNodeOrKeyName: SD_KEY_NAME,
|
|
26752
26824
|
type: NodeTranslator.translatorTypes.NODE,
|
|
26753
|
-
encode: encode$
|
|
26754
|
-
decode: decode$
|
|
26755
|
-
attributes: validXmlAttributes$
|
|
26825
|
+
encode: encode$r,
|
|
26826
|
+
decode: decode$t,
|
|
26827
|
+
attributes: validXmlAttributes$c
|
|
26756
26828
|
};
|
|
26757
|
-
const translator$
|
|
26829
|
+
const translator$Y = NodeTranslator.from(config$i);
|
|
26758
26830
|
function preProcessVerticalMergeCells(table, { editorSchema }) {
|
|
26759
26831
|
if (!table || !Array.isArray(table.content)) {
|
|
26760
26832
|
return table;
|
|
@@ -26795,13 +26867,13 @@ function preProcessVerticalMergeCells(table, { editorSchema }) {
|
|
|
26795
26867
|
}
|
|
26796
26868
|
return table;
|
|
26797
26869
|
}
|
|
26798
|
-
const translator$
|
|
26870
|
+
const translator$X = NodeTranslator.from({
|
|
26799
26871
|
xmlName: "w:cantSplit",
|
|
26800
26872
|
sdNodeOrKeyName: "cantSplit",
|
|
26801
26873
|
encode: ({ nodes }) => ["1", "true"].includes(nodes[0].attributes?.["w:val"] ?? "1"),
|
|
26802
26874
|
decode: ({ node }) => node.attrs?.cantSplit ? { attributes: {} } : void 0
|
|
26803
26875
|
});
|
|
26804
|
-
const translator$
|
|
26876
|
+
const translator$W = NodeTranslator.from({
|
|
26805
26877
|
xmlName: "w:cnfStyle",
|
|
26806
26878
|
sdNodeOrKeyName: "cnfStyle",
|
|
26807
26879
|
attributes: [
|
|
@@ -26827,8 +26899,8 @@ const translator$U = NodeTranslator.from({
|
|
|
26827
26899
|
return Object.keys(decodedAttrs).length > 0 ? { attributes: decodedAttrs } : void 0;
|
|
26828
26900
|
}
|
|
26829
26901
|
});
|
|
26830
|
-
const translator$
|
|
26831
|
-
const translator$
|
|
26902
|
+
const translator$V = NodeTranslator.from(createSingleAttrPropertyHandler("w:divId"));
|
|
26903
|
+
const translator$U = NodeTranslator.from(
|
|
26832
26904
|
createSingleAttrPropertyHandler(
|
|
26833
26905
|
"w:gridAfter",
|
|
26834
26906
|
null,
|
|
@@ -26837,7 +26909,7 @@ const translator$S = NodeTranslator.from(
|
|
|
26837
26909
|
(v2) => integerToString(v2)
|
|
26838
26910
|
)
|
|
26839
26911
|
);
|
|
26840
|
-
const translator$
|
|
26912
|
+
const translator$T = NodeTranslator.from(
|
|
26841
26913
|
createSingleAttrPropertyHandler(
|
|
26842
26914
|
"w:gridBefore",
|
|
26843
26915
|
null,
|
|
@@ -26846,21 +26918,21 @@ const translator$R = NodeTranslator.from(
|
|
|
26846
26918
|
(v2) => integerToString(v2)
|
|
26847
26919
|
)
|
|
26848
26920
|
);
|
|
26849
|
-
const translator$
|
|
26921
|
+
const translator$S = NodeTranslator.from({
|
|
26850
26922
|
xmlName: "w:hidden",
|
|
26851
26923
|
sdNodeOrKeyName: "hidden",
|
|
26852
26924
|
encode: ({ nodes }) => parseBoolean(nodes[0].attributes?.["w:val"] ?? "1"),
|
|
26853
26925
|
decode: ({ node }) => node.attrs.hidden ? { attributes: {} } : void 0
|
|
26854
26926
|
});
|
|
26855
|
-
const translator$
|
|
26856
|
-
const translator$
|
|
26857
|
-
const translator$
|
|
26927
|
+
const translator$R = NodeTranslator.from(createSingleAttrPropertyHandler("w:jc", "justification"));
|
|
26928
|
+
const translator$Q = NodeTranslator.from(createMeasurementPropertyHandler("w:tblCellSpacing", "tableCellSpacing"));
|
|
26929
|
+
const translator$P = NodeTranslator.from({
|
|
26858
26930
|
xmlName: "w:tblHeader",
|
|
26859
26931
|
sdNodeOrKeyName: "repeatHeader",
|
|
26860
26932
|
encode: ({ nodes }) => parseBoolean(nodes[0].attributes?.["w:val"] ?? "1"),
|
|
26861
26933
|
decode: ({ node }) => node.attrs.repeatHeader ? { attributes: {} } : void 0
|
|
26862
26934
|
});
|
|
26863
|
-
const translator$
|
|
26935
|
+
const translator$O = NodeTranslator.from({
|
|
26864
26936
|
xmlName: "w:trHeight",
|
|
26865
26937
|
sdNodeOrKeyName: "rowHeight",
|
|
26866
26938
|
encode: ({ nodes }) => {
|
|
@@ -26887,11 +26959,11 @@ const translator$M = NodeTranslator.from({
|
|
|
26887
26959
|
return Object.keys(heightAttrs).length > 0 ? { attributes: heightAttrs } : void 0;
|
|
26888
26960
|
}
|
|
26889
26961
|
});
|
|
26890
|
-
const translator$
|
|
26891
|
-
const translator$
|
|
26892
|
-
const XML_NODE_NAME$
|
|
26893
|
-
const SD_ATTR_KEY$
|
|
26894
|
-
const encode$
|
|
26962
|
+
const translator$N = NodeTranslator.from(createMeasurementPropertyHandler("w:wAfter"));
|
|
26963
|
+
const translator$M = NodeTranslator.from(createMeasurementPropertyHandler("w:wBefore"));
|
|
26964
|
+
const XML_NODE_NAME$k = "w:trPr";
|
|
26965
|
+
const SD_ATTR_KEY$6 = "tableRowProperties";
|
|
26966
|
+
const encode$q = (params) => {
|
|
26895
26967
|
const { nodes } = params;
|
|
26896
26968
|
const node = nodes[0];
|
|
26897
26969
|
let attributes = {
|
|
@@ -26905,12 +26977,12 @@ const encode$o = (params) => {
|
|
|
26905
26977
|
};
|
|
26906
26978
|
return {
|
|
26907
26979
|
type: NodeTranslator.translatorTypes.ATTRIBUTE,
|
|
26908
|
-
xmlName: XML_NODE_NAME$
|
|
26909
|
-
sdNodeOrKeyName: SD_ATTR_KEY$
|
|
26980
|
+
xmlName: XML_NODE_NAME$k,
|
|
26981
|
+
sdNodeOrKeyName: SD_ATTR_KEY$6,
|
|
26910
26982
|
attributes
|
|
26911
26983
|
};
|
|
26912
26984
|
};
|
|
26913
|
-
const decode$
|
|
26985
|
+
const decode$s = (params) => {
|
|
26914
26986
|
const { tableRowProperties = {} } = params.node.attrs || {};
|
|
26915
26987
|
const elements = decodeProperties(propertyTranslatorsBySdName$2, tableRowProperties);
|
|
26916
26988
|
const newNode = {
|
|
@@ -26922,6 +26994,8 @@ const decode$q = (params) => {
|
|
|
26922
26994
|
return newNode;
|
|
26923
26995
|
};
|
|
26924
26996
|
const propertyTranslators$3 = [
|
|
26997
|
+
translator$X,
|
|
26998
|
+
translator$W,
|
|
26925
26999
|
translator$V,
|
|
26926
27000
|
translator$U,
|
|
26927
27001
|
translator$T,
|
|
@@ -26931,9 +27005,7 @@ const propertyTranslators$3 = [
|
|
|
26931
27005
|
translator$P,
|
|
26932
27006
|
translator$O,
|
|
26933
27007
|
translator$N,
|
|
26934
|
-
translator$M
|
|
26935
|
-
translator$L,
|
|
26936
|
-
translator$K
|
|
27008
|
+
translator$M
|
|
26937
27009
|
];
|
|
26938
27010
|
const propertyTranslatorsByXmlName$2 = {};
|
|
26939
27011
|
propertyTranslators$3.forEach((translator2) => {
|
|
@@ -26943,25 +27015,25 @@ const propertyTranslatorsBySdName$2 = {};
|
|
|
26943
27015
|
propertyTranslators$3.forEach((translator2) => {
|
|
26944
27016
|
propertyTranslatorsBySdName$2[translator2.sdNodeOrKeyName] = translator2;
|
|
26945
27017
|
});
|
|
26946
|
-
const config$
|
|
26947
|
-
xmlName: XML_NODE_NAME$
|
|
26948
|
-
sdNodeOrKeyName: SD_ATTR_KEY$
|
|
27018
|
+
const config$h = {
|
|
27019
|
+
xmlName: XML_NODE_NAME$k,
|
|
27020
|
+
sdNodeOrKeyName: SD_ATTR_KEY$6,
|
|
26949
27021
|
type: NodeTranslator.translatorTypes.ATTRIBUTE,
|
|
26950
|
-
encode: encode$
|
|
26951
|
-
decode: decode$
|
|
27022
|
+
encode: encode$q,
|
|
27023
|
+
decode: decode$s
|
|
26952
27024
|
};
|
|
26953
|
-
const translator$
|
|
26954
|
-
const XML_NODE_NAME$
|
|
27025
|
+
const translator$L = NodeTranslator.from(config$h);
|
|
27026
|
+
const XML_NODE_NAME$j = "w:tr";
|
|
26955
27027
|
const SD_NODE_NAME$d = "tableRow";
|
|
26956
|
-
const validXmlAttributes$
|
|
27028
|
+
const validXmlAttributes$b = ["w:rsidDel", "w:rsidR", "w:rsidRPr", "w:rsidTr", "w14:paraId", "w14:textId"].map(
|
|
26957
27029
|
(xmlName) => createAttributeHandler(xmlName)
|
|
26958
27030
|
);
|
|
26959
|
-
const encode$
|
|
27031
|
+
const encode$p = (params, encodedAttrs) => {
|
|
26960
27032
|
const { row } = params.extraParams;
|
|
26961
27033
|
let tableRowProperties = {};
|
|
26962
27034
|
const tPr = row.elements.find((el) => el.name === "w:trPr");
|
|
26963
27035
|
if (tPr) {
|
|
26964
|
-
({ attributes: tableRowProperties } = translator$
|
|
27036
|
+
({ attributes: tableRowProperties } = translator$L.encode({
|
|
26965
27037
|
...params,
|
|
26966
27038
|
nodes: [tPr]
|
|
26967
27039
|
}));
|
|
@@ -26974,7 +27046,7 @@ const encode$n = (params, encodedAttrs) => {
|
|
|
26974
27046
|
let currentColumnIndex = 0;
|
|
26975
27047
|
const content = cellNodes?.map((n) => {
|
|
26976
27048
|
let columnWidth = gridColumnWidths?.[currentColumnIndex] || null;
|
|
26977
|
-
const result = translator$
|
|
27049
|
+
const result = translator$c.encode({
|
|
26978
27050
|
...params,
|
|
26979
27051
|
extraParams: {
|
|
26980
27052
|
...params.extraParams,
|
|
@@ -26996,7 +27068,7 @@ const encode$n = (params, encodedAttrs) => {
|
|
|
26996
27068
|
};
|
|
26997
27069
|
return newNode;
|
|
26998
27070
|
};
|
|
26999
|
-
const decode$
|
|
27071
|
+
const decode$r = (params, decodedAttrs) => {
|
|
27000
27072
|
const { node } = params;
|
|
27001
27073
|
const elements = translateChildNodes(params);
|
|
27002
27074
|
if (node.attrs?.tableRowProperties) {
|
|
@@ -27008,7 +27080,7 @@ const decode$p = (params, decodedAttrs) => {
|
|
|
27008
27080
|
}
|
|
27009
27081
|
}
|
|
27010
27082
|
tableRowProperties["cantSplit"] = node.attrs["cantSplit"];
|
|
27011
|
-
const trPr = translator$
|
|
27083
|
+
const trPr = translator$L.decode({
|
|
27012
27084
|
...params,
|
|
27013
27085
|
node: { ...node, attrs: { ...node.attrs, tableRowProperties } }
|
|
27014
27086
|
});
|
|
@@ -27020,22 +27092,22 @@ const decode$p = (params, decodedAttrs) => {
|
|
|
27020
27092
|
elements
|
|
27021
27093
|
};
|
|
27022
27094
|
};
|
|
27023
|
-
const config$
|
|
27024
|
-
xmlName: XML_NODE_NAME$
|
|
27095
|
+
const config$g = {
|
|
27096
|
+
xmlName: XML_NODE_NAME$j,
|
|
27025
27097
|
sdNodeOrKeyName: SD_NODE_NAME$d,
|
|
27026
27098
|
type: NodeTranslator.translatorTypes.NODE,
|
|
27027
|
-
encode: encode$
|
|
27028
|
-
decode: decode$
|
|
27029
|
-
attributes: validXmlAttributes$
|
|
27099
|
+
encode: encode$p,
|
|
27100
|
+
decode: decode$r,
|
|
27101
|
+
attributes: validXmlAttributes$b
|
|
27030
27102
|
};
|
|
27031
|
-
const translator$
|
|
27032
|
-
const translator$
|
|
27103
|
+
const translator$K = NodeTranslator.from(config$g);
|
|
27104
|
+
const translator$J = NodeTranslator.from({
|
|
27033
27105
|
xmlName: "w:bidiVisual",
|
|
27034
27106
|
sdNodeOrKeyName: "rightToLeft",
|
|
27035
27107
|
encode: ({ nodes }) => parseBoolean(nodes[0].attributes?.["w:val"] ?? "1"),
|
|
27036
27108
|
decode: ({ node }) => node.attrs.rightToLeft ? { attributes: {} } : void 0
|
|
27037
27109
|
});
|
|
27038
|
-
const translator$
|
|
27110
|
+
const translator$I = NodeTranslator.from({
|
|
27039
27111
|
xmlName: "w:shd",
|
|
27040
27112
|
sdNodeOrKeyName: "shading",
|
|
27041
27113
|
attributes: [
|
|
@@ -27057,11 +27129,11 @@ const translator$G = NodeTranslator.from({
|
|
|
27057
27129
|
return Object.keys(decodedAttrs).length > 0 ? { attributes: decodedAttrs } : void 0;
|
|
27058
27130
|
}
|
|
27059
27131
|
});
|
|
27060
|
-
const translator$
|
|
27061
|
-
const translator$
|
|
27062
|
-
const translator$
|
|
27063
|
-
const translator$
|
|
27064
|
-
const translator$
|
|
27132
|
+
const translator$H = NodeTranslator.from(createSingleAttrPropertyHandler("w:tblCaption", "caption"));
|
|
27133
|
+
const translator$G = NodeTranslator.from(createSingleAttrPropertyHandler("w:tblDescription", "description"));
|
|
27134
|
+
const translator$F = NodeTranslator.from(createMeasurementPropertyHandler("w:tblInd", "tableIndent"));
|
|
27135
|
+
const translator$E = NodeTranslator.from(createSingleAttrPropertyHandler("w:tblLayout", "tableLayout", "w:type"));
|
|
27136
|
+
const translator$D = NodeTranslator.from({
|
|
27065
27137
|
xmlName: "w:tblLook",
|
|
27066
27138
|
sdNodeOrKeyName: "tblLook",
|
|
27067
27139
|
attributes: ["w:firstColumn", "w:firstRow", "w:lastColumn", "w:lastRow", "w:noHBand", "w:noVBand"].map((attr) => createAttributeHandler(attr, null, parseBoolean, booleanToString)).concat([createAttributeHandler("w:val")]),
|
|
@@ -27073,16 +27145,16 @@ const translator$B = NodeTranslator.from({
|
|
|
27073
27145
|
return Object.keys(decodedAttrs).length > 0 ? { attributes: decodedAttrs } : void 0;
|
|
27074
27146
|
}
|
|
27075
27147
|
});
|
|
27076
|
-
const translator$
|
|
27077
|
-
const translator$
|
|
27078
|
-
const translator$
|
|
27148
|
+
const translator$C = NodeTranslator.from(createSingleAttrPropertyHandler("w:tblOverlap", "overlap"));
|
|
27149
|
+
const translator$B = NodeTranslator.from(createSingleAttrPropertyHandler("w:tblStyle", "tableStyleId"));
|
|
27150
|
+
const translator$A = NodeTranslator.from(
|
|
27079
27151
|
createSingleAttrPropertyHandler("w:tblStyleColBandSize", "tableStyleColBandSize")
|
|
27080
27152
|
);
|
|
27081
|
-
const translator$
|
|
27153
|
+
const translator$z = NodeTranslator.from(
|
|
27082
27154
|
createSingleAttrPropertyHandler("w:tblStyleRowBandSize", "tableStyleRowBandSize")
|
|
27083
27155
|
);
|
|
27084
|
-
const translator$
|
|
27085
|
-
const translator$
|
|
27156
|
+
const translator$y = NodeTranslator.from(createMeasurementPropertyHandler("w:tblW", "tableWidth"));
|
|
27157
|
+
const translator$x = NodeTranslator.from({
|
|
27086
27158
|
xmlName: "w:tblpPr",
|
|
27087
27159
|
sdNodeOrKeyName: "floatingTableProperties",
|
|
27088
27160
|
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))),
|
|
@@ -27094,29 +27166,29 @@ const translator$v = NodeTranslator.from({
|
|
|
27094
27166
|
return Object.keys(decodedAttrs).length > 0 ? { attributes: decodedAttrs } : void 0;
|
|
27095
27167
|
}
|
|
27096
27168
|
});
|
|
27097
|
-
const translator$
|
|
27098
|
-
const translator$
|
|
27099
|
-
const translator$
|
|
27100
|
-
const translator$
|
|
27101
|
-
const translator$
|
|
27102
|
-
const translator$
|
|
27103
|
-
const translator$
|
|
27104
|
-
const translator$
|
|
27105
|
-
const translator$
|
|
27106
|
-
const translator$
|
|
27107
|
-
const translator$
|
|
27108
|
-
const translator$
|
|
27109
|
-
const translator$
|
|
27110
|
-
const translator$
|
|
27111
|
-
const XML_NODE_NAME$
|
|
27112
|
-
const SD_ATTR_KEY$
|
|
27113
|
-
const encode$
|
|
27169
|
+
const translator$w = NodeTranslator.from(createBorderPropertyHandler("w:bottom"));
|
|
27170
|
+
const translator$v = NodeTranslator.from(createMeasurementPropertyHandler("w:bottom", "marginBottom"));
|
|
27171
|
+
const translator$u = NodeTranslator.from(createBorderPropertyHandler("w:end"));
|
|
27172
|
+
const translator$t = NodeTranslator.from(createMeasurementPropertyHandler("w:end", "marginEnd"));
|
|
27173
|
+
const translator$s = NodeTranslator.from(createBorderPropertyHandler("w:insideH"));
|
|
27174
|
+
const translator$r = NodeTranslator.from(createBorderPropertyHandler("w:insideV"));
|
|
27175
|
+
const translator$q = NodeTranslator.from(createBorderPropertyHandler("w:left"));
|
|
27176
|
+
const translator$p = NodeTranslator.from(createMeasurementPropertyHandler("w:left", "marginLeft"));
|
|
27177
|
+
const translator$o = NodeTranslator.from(createBorderPropertyHandler("w:right"));
|
|
27178
|
+
const translator$n = NodeTranslator.from(createMeasurementPropertyHandler("w:right", "marginRight"));
|
|
27179
|
+
const translator$m = NodeTranslator.from(createBorderPropertyHandler("w:start"));
|
|
27180
|
+
const translator$l = NodeTranslator.from(createMeasurementPropertyHandler("w:start", "marginStart"));
|
|
27181
|
+
const translator$k = NodeTranslator.from(createBorderPropertyHandler("w:top"));
|
|
27182
|
+
const translator$j = NodeTranslator.from(createMeasurementPropertyHandler("w:top", "marginTop"));
|
|
27183
|
+
const XML_NODE_NAME$i = "w:tblBorders";
|
|
27184
|
+
const SD_ATTR_KEY$5 = "borders";
|
|
27185
|
+
const encode$o = (params) => {
|
|
27114
27186
|
const { nodes } = params;
|
|
27115
27187
|
const node = nodes[0];
|
|
27116
27188
|
const attributes = encodeProperties(node, tblBordersTranslatorsByXmlName);
|
|
27117
27189
|
return Object.keys(attributes).length > 0 ? attributes : void 0;
|
|
27118
27190
|
};
|
|
27119
|
-
const decode$
|
|
27191
|
+
const decode$q = (params) => {
|
|
27120
27192
|
const { borders = {} } = params.node.attrs || {};
|
|
27121
27193
|
const elements = decodeProperties(tblBordersTranslatorsBySdName, borders);
|
|
27122
27194
|
const newNode = {
|
|
@@ -27128,14 +27200,14 @@ const decode$o = (params) => {
|
|
|
27128
27200
|
return newNode;
|
|
27129
27201
|
};
|
|
27130
27202
|
const propertyTranslators$2 = [
|
|
27203
|
+
translator$w,
|
|
27131
27204
|
translator$u,
|
|
27132
27205
|
translator$s,
|
|
27206
|
+
translator$r,
|
|
27133
27207
|
translator$q,
|
|
27134
|
-
translator$p,
|
|
27135
27208
|
translator$o,
|
|
27136
27209
|
translator$m,
|
|
27137
|
-
translator$k
|
|
27138
|
-
translator$i
|
|
27210
|
+
translator$k
|
|
27139
27211
|
];
|
|
27140
27212
|
const tblBordersTranslatorsByXmlName = {};
|
|
27141
27213
|
const tblBordersTranslatorsBySdName = {};
|
|
@@ -27143,27 +27215,27 @@ propertyTranslators$2.forEach((translator2) => {
|
|
|
27143
27215
|
tblBordersTranslatorsByXmlName[translator2.xmlName] = translator2;
|
|
27144
27216
|
tblBordersTranslatorsBySdName[translator2.sdNodeOrKeyName] = translator2;
|
|
27145
27217
|
});
|
|
27146
|
-
const translator$
|
|
27147
|
-
xmlName: XML_NODE_NAME$
|
|
27148
|
-
sdNodeOrKeyName: SD_ATTR_KEY$
|
|
27218
|
+
const translator$i = NodeTranslator.from({
|
|
27219
|
+
xmlName: XML_NODE_NAME$i,
|
|
27220
|
+
sdNodeOrKeyName: SD_ATTR_KEY$5,
|
|
27149
27221
|
type: NodeTranslator.translatorTypes.NODE,
|
|
27150
27222
|
attributes: [],
|
|
27151
|
-
encode: encode$
|
|
27152
|
-
decode: decode$
|
|
27223
|
+
encode: encode$o,
|
|
27224
|
+
decode: decode$q
|
|
27153
27225
|
});
|
|
27154
|
-
const XML_NODE_NAME$
|
|
27155
|
-
const SD_ATTR_KEY$
|
|
27156
|
-
const encode$
|
|
27226
|
+
const XML_NODE_NAME$h = "w:tblCellMar";
|
|
27227
|
+
const SD_ATTR_KEY$4 = "cellMargins";
|
|
27228
|
+
const encode$n = (params) => {
|
|
27157
27229
|
const { nodes } = params;
|
|
27158
27230
|
const node = nodes[0];
|
|
27159
27231
|
const attributes = encodeProperties(node, propertyTranslatorsByXmlName$1);
|
|
27160
27232
|
return Object.keys(attributes).length > 0 ? attributes : void 0;
|
|
27161
27233
|
};
|
|
27162
|
-
const decode$
|
|
27234
|
+
const decode$p = (params) => {
|
|
27163
27235
|
const { cellMargins = {} } = params.node.attrs || {};
|
|
27164
27236
|
const elements = decodeProperties(propertyTranslatorsBySdName$1, cellMargins);
|
|
27165
27237
|
const newNode = {
|
|
27166
|
-
name: XML_NODE_NAME$
|
|
27238
|
+
name: XML_NODE_NAME$h,
|
|
27167
27239
|
type: "element",
|
|
27168
27240
|
attributes: {},
|
|
27169
27241
|
elements
|
|
@@ -27171,12 +27243,12 @@ const decode$n = (params) => {
|
|
|
27171
27243
|
return newNode;
|
|
27172
27244
|
};
|
|
27173
27245
|
const propertyTranslators$1 = [
|
|
27246
|
+
translator$v,
|
|
27174
27247
|
translator$t,
|
|
27175
|
-
translator$
|
|
27248
|
+
translator$p,
|
|
27176
27249
|
translator$n,
|
|
27177
27250
|
translator$l,
|
|
27178
|
-
translator$j
|
|
27179
|
-
translator$h
|
|
27251
|
+
translator$j
|
|
27180
27252
|
];
|
|
27181
27253
|
const propertyTranslatorsByXmlName$1 = {};
|
|
27182
27254
|
const propertyTranslatorsBySdName$1 = {};
|
|
@@ -27184,27 +27256,27 @@ propertyTranslators$1.forEach((translator2) => {
|
|
|
27184
27256
|
propertyTranslatorsByXmlName$1[translator2.xmlName] = translator2;
|
|
27185
27257
|
propertyTranslatorsBySdName$1[translator2.sdNodeOrKeyName] = translator2;
|
|
27186
27258
|
});
|
|
27187
|
-
const translator$
|
|
27188
|
-
xmlName: XML_NODE_NAME$
|
|
27189
|
-
sdNodeOrKeyName: SD_ATTR_KEY$
|
|
27259
|
+
const translator$h = NodeTranslator.from({
|
|
27260
|
+
xmlName: XML_NODE_NAME$h,
|
|
27261
|
+
sdNodeOrKeyName: SD_ATTR_KEY$4,
|
|
27190
27262
|
type: NodeTranslator.translatorTypes.NODE,
|
|
27191
27263
|
attributes: [],
|
|
27192
|
-
encode: encode$
|
|
27193
|
-
decode: decode$
|
|
27264
|
+
encode: encode$n,
|
|
27265
|
+
decode: decode$p
|
|
27194
27266
|
});
|
|
27195
|
-
const XML_NODE_NAME$
|
|
27196
|
-
const SD_ATTR_KEY$
|
|
27197
|
-
const encode$
|
|
27267
|
+
const XML_NODE_NAME$g = "w:tblPr";
|
|
27268
|
+
const SD_ATTR_KEY$3 = "tableProperties";
|
|
27269
|
+
const encode$m = (params) => {
|
|
27198
27270
|
const { nodes } = params;
|
|
27199
27271
|
const node = nodes[0];
|
|
27200
27272
|
const attributes = encodeProperties(node, propertyTranslatorsByXmlName);
|
|
27201
27273
|
return {
|
|
27202
|
-
xmlName: XML_NODE_NAME$
|
|
27203
|
-
sdNodeOrKeyName: SD_ATTR_KEY$
|
|
27274
|
+
xmlName: XML_NODE_NAME$g,
|
|
27275
|
+
sdNodeOrKeyName: SD_ATTR_KEY$3,
|
|
27204
27276
|
attributes
|
|
27205
27277
|
};
|
|
27206
27278
|
};
|
|
27207
|
-
const decode$
|
|
27279
|
+
const decode$o = (params) => {
|
|
27208
27280
|
const { tableProperties = {} } = params.node.attrs || {};
|
|
27209
27281
|
const elements = decodeProperties(propertyTranslatorsBySdName, tableProperties);
|
|
27210
27282
|
const newNode = {
|
|
@@ -27216,11 +27288,13 @@ const decode$m = (params) => {
|
|
|
27216
27288
|
return newNode;
|
|
27217
27289
|
};
|
|
27218
27290
|
const propertyTranslators = [
|
|
27291
|
+
translator$J,
|
|
27292
|
+
translator$R,
|
|
27293
|
+
translator$I,
|
|
27219
27294
|
translator$H,
|
|
27220
|
-
translator$
|
|
27295
|
+
translator$Q,
|
|
27221
27296
|
translator$G,
|
|
27222
27297
|
translator$F,
|
|
27223
|
-
translator$O,
|
|
27224
27298
|
translator$E,
|
|
27225
27299
|
translator$D,
|
|
27226
27300
|
translator$C,
|
|
@@ -27229,10 +27303,8 @@ const propertyTranslators = [
|
|
|
27229
27303
|
translator$z,
|
|
27230
27304
|
translator$y,
|
|
27231
27305
|
translator$x,
|
|
27232
|
-
translator$
|
|
27233
|
-
translator$
|
|
27234
|
-
translator$g,
|
|
27235
|
-
translator$f
|
|
27306
|
+
translator$i,
|
|
27307
|
+
translator$h
|
|
27236
27308
|
];
|
|
27237
27309
|
const propertyTranslatorsByXmlName = {};
|
|
27238
27310
|
const propertyTranslatorsBySdName = {};
|
|
@@ -27240,14 +27312,14 @@ propertyTranslators.forEach((translator2) => {
|
|
|
27240
27312
|
propertyTranslatorsByXmlName[translator2.xmlName] = translator2;
|
|
27241
27313
|
propertyTranslatorsBySdName[translator2.sdNodeOrKeyName] = translator2;
|
|
27242
27314
|
});
|
|
27243
|
-
const config$
|
|
27244
|
-
xmlName: XML_NODE_NAME$
|
|
27245
|
-
sdNodeOrKeyName: SD_ATTR_KEY$
|
|
27246
|
-
encode: encode$
|
|
27247
|
-
decode: decode$
|
|
27315
|
+
const config$f = {
|
|
27316
|
+
xmlName: XML_NODE_NAME$g,
|
|
27317
|
+
sdNodeOrKeyName: SD_ATTR_KEY$3,
|
|
27318
|
+
encode: encode$m,
|
|
27319
|
+
decode: decode$o
|
|
27248
27320
|
};
|
|
27249
|
-
const translator$
|
|
27250
|
-
const translator$
|
|
27321
|
+
const translator$g = NodeTranslator.from(config$f);
|
|
27322
|
+
const translator$f = NodeTranslator.from(
|
|
27251
27323
|
createSingleAttrPropertyHandler("w:gridCol", "col", "w:w", parseInteger, integerToString)
|
|
27252
27324
|
);
|
|
27253
27325
|
const DEFAULT_COLUMN_WIDTH_PX = 100;
|
|
@@ -27297,20 +27369,20 @@ const resolveFallbackColumnWidthTwips = (params, totalColumns, cellMinWidthTwips
|
|
|
27297
27369
|
}
|
|
27298
27370
|
return Math.max(fallbackWidthTwips, cellMinWidthTwips);
|
|
27299
27371
|
};
|
|
27300
|
-
const XML_NODE_NAME$
|
|
27301
|
-
const SD_ATTR_KEY = "grid";
|
|
27372
|
+
const XML_NODE_NAME$f = "w:tblGrid";
|
|
27373
|
+
const SD_ATTR_KEY$2 = "grid";
|
|
27302
27374
|
const cellMinWidth = pixelsToTwips(10);
|
|
27303
|
-
const encode$
|
|
27375
|
+
const encode$l = (params) => {
|
|
27304
27376
|
const { nodes } = params;
|
|
27305
27377
|
const node = nodes[0];
|
|
27306
|
-
const attributes = encodeProperties(node, { [translator$
|
|
27378
|
+
const attributes = encodeProperties(node, { [translator$f.xmlName]: translator$f }, true);
|
|
27307
27379
|
return {
|
|
27308
|
-
xmlName: XML_NODE_NAME$
|
|
27309
|
-
sdNodeOrKeyName: SD_ATTR_KEY,
|
|
27380
|
+
xmlName: XML_NODE_NAME$f,
|
|
27381
|
+
sdNodeOrKeyName: SD_ATTR_KEY$2,
|
|
27310
27382
|
attributes
|
|
27311
27383
|
};
|
|
27312
27384
|
};
|
|
27313
|
-
const decode$
|
|
27385
|
+
const decode$n = (params) => {
|
|
27314
27386
|
const { grid: rawGrid } = params.node.attrs || {};
|
|
27315
27387
|
const grid = Array.isArray(rawGrid) ? rawGrid : [];
|
|
27316
27388
|
const { firstRow = {} } = params.extraParams || {};
|
|
@@ -27329,10 +27401,10 @@ const decode$l = (params) => {
|
|
|
27329
27401
|
numericWidth = fallbackColumnWidthTwips;
|
|
27330
27402
|
}
|
|
27331
27403
|
numericWidth = Math.max(numericWidth, cellMinWidth);
|
|
27332
|
-
const decoded = translator$
|
|
27404
|
+
const decoded = translator$f.decode({
|
|
27333
27405
|
node: { type: (
|
|
27334
27406
|
/** @type {string} */
|
|
27335
|
-
translator$
|
|
27407
|
+
translator$f.sdNodeOrKeyName
|
|
27336
27408
|
), attrs: { col: numericWidth } }
|
|
27337
27409
|
});
|
|
27338
27410
|
if (decoded) elements.push(decoded);
|
|
@@ -27367,19 +27439,19 @@ const decode$l = (params) => {
|
|
|
27367
27439
|
columnIndex++;
|
|
27368
27440
|
}
|
|
27369
27441
|
const newNode = {
|
|
27370
|
-
name: XML_NODE_NAME$
|
|
27442
|
+
name: XML_NODE_NAME$f,
|
|
27371
27443
|
attributes: {},
|
|
27372
27444
|
elements
|
|
27373
27445
|
};
|
|
27374
27446
|
return newNode;
|
|
27375
27447
|
};
|
|
27376
|
-
const config$
|
|
27377
|
-
xmlName: XML_NODE_NAME$
|
|
27378
|
-
sdNodeOrKeyName: SD_ATTR_KEY,
|
|
27379
|
-
encode: encode$
|
|
27380
|
-
decode: decode$
|
|
27448
|
+
const config$e = {
|
|
27449
|
+
xmlName: XML_NODE_NAME$f,
|
|
27450
|
+
sdNodeOrKeyName: SD_ATTR_KEY$2,
|
|
27451
|
+
encode: encode$l,
|
|
27452
|
+
decode: decode$n
|
|
27381
27453
|
};
|
|
27382
|
-
const translator$
|
|
27454
|
+
const translator$e = NodeTranslator.from(config$e);
|
|
27383
27455
|
const DEFAULT_PAGE_WIDTH_TWIPS = 12240;
|
|
27384
27456
|
const DEFAULT_PAGE_MARGIN_TWIPS = 1440;
|
|
27385
27457
|
const DEFAULT_CONTENT_WIDTH_TWIPS = DEFAULT_PAGE_WIDTH_TWIPS - 2 * DEFAULT_PAGE_MARGIN_TWIPS;
|
|
@@ -27442,19 +27514,19 @@ const buildFallbackGridForTable = ({ params, rows, tableWidth, tableWidthMeasure
|
|
|
27442
27514
|
columnWidths: Array(columnCount).fill(fallbackColumnWidthPx)
|
|
27443
27515
|
};
|
|
27444
27516
|
};
|
|
27445
|
-
const XML_NODE_NAME$
|
|
27517
|
+
const XML_NODE_NAME$e = "w:tbl";
|
|
27446
27518
|
const SD_NODE_NAME$c = "table";
|
|
27447
|
-
const encode$
|
|
27519
|
+
const encode$k = (params, encodedAttrs) => {
|
|
27448
27520
|
const { nodes } = params;
|
|
27449
27521
|
const node = nodes[0];
|
|
27450
27522
|
const tblPr = node.elements.find((el) => el.name === "w:tblPr");
|
|
27451
27523
|
if (tblPr) {
|
|
27452
|
-
const encodedProperties = translator$
|
|
27524
|
+
const encodedProperties = translator$g.encode({ ...params, nodes: [tblPr] });
|
|
27453
27525
|
encodedAttrs["tableProperties"] = encodedProperties?.attributes || {};
|
|
27454
27526
|
}
|
|
27455
27527
|
const tblGrid = node.elements.find((el) => el.name === "w:tblGrid");
|
|
27456
27528
|
if (tblGrid) {
|
|
27457
|
-
encodedAttrs["grid"] = translator$
|
|
27529
|
+
encodedAttrs["grid"] = translator$e.encode({ ...params, nodes: [tblGrid] }).attributes;
|
|
27458
27530
|
}
|
|
27459
27531
|
[
|
|
27460
27532
|
"tableStyleId",
|
|
@@ -27521,7 +27593,7 @@ const encode$i = (params, encodedAttrs) => {
|
|
|
27521
27593
|
}
|
|
27522
27594
|
const content = [];
|
|
27523
27595
|
rows.forEach((row) => {
|
|
27524
|
-
const result = translator$
|
|
27596
|
+
const result = translator$K.encode({
|
|
27525
27597
|
...params,
|
|
27526
27598
|
nodes: [row],
|
|
27527
27599
|
extraParams: {
|
|
@@ -27540,13 +27612,13 @@ const encode$i = (params, encodedAttrs) => {
|
|
|
27540
27612
|
attrs: encodedAttrs
|
|
27541
27613
|
};
|
|
27542
27614
|
};
|
|
27543
|
-
const decode$
|
|
27615
|
+
const decode$m = (params, decodedAttrs) => {
|
|
27544
27616
|
params.node = preProcessVerticalMergeCells(params.node, params);
|
|
27545
27617
|
const { node } = params;
|
|
27546
27618
|
const elements = translateChildNodes(params);
|
|
27547
27619
|
const firstRow = node.content?.find((n) => n.type === "tableRow");
|
|
27548
27620
|
const properties = node.attrs.grid;
|
|
27549
|
-
const element = translator$
|
|
27621
|
+
const element = translator$e.decode({
|
|
27550
27622
|
...params,
|
|
27551
27623
|
node: { ...node, attrs: { ...node.attrs, grid: properties } },
|
|
27552
27624
|
extraParams: {
|
|
@@ -27556,7 +27628,7 @@ const decode$k = (params, decodedAttrs) => {
|
|
|
27556
27628
|
if (element) elements.unshift(element);
|
|
27557
27629
|
if (node.attrs?.tableProperties) {
|
|
27558
27630
|
const properties2 = { ...node.attrs.tableProperties };
|
|
27559
|
-
const element2 = translator$
|
|
27631
|
+
const element2 = translator$g.decode({
|
|
27560
27632
|
...params,
|
|
27561
27633
|
node: { ...node, attrs: { ...node.attrs, tableProperties: properties2 } }
|
|
27562
27634
|
});
|
|
@@ -27622,7 +27694,7 @@ function _getReferencedTableStyles(tableStyleReference, params) {
|
|
|
27622
27694
|
if (baseTblPr && baseTblPr.elements) {
|
|
27623
27695
|
tblPr.elements.push(...baseTblPr.elements);
|
|
27624
27696
|
}
|
|
27625
|
-
const tableProperties = translator$
|
|
27697
|
+
const tableProperties = translator$g.encode({ ...params, nodes: [tblPr] }).attributes;
|
|
27626
27698
|
const { borders, rowBorders } = _processTableBorders(tableProperties.borders || {});
|
|
27627
27699
|
if (borders) stylesToReturn.borders = borders;
|
|
27628
27700
|
if (rowBorders) stylesToReturn.rowBorders = rowBorders;
|
|
@@ -27639,16 +27711,16 @@ function _getReferencedTableStyles(tableStyleReference, params) {
|
|
|
27639
27711
|
}
|
|
27640
27712
|
return stylesToReturn;
|
|
27641
27713
|
}
|
|
27642
|
-
const config$
|
|
27643
|
-
xmlName: XML_NODE_NAME$
|
|
27714
|
+
const config$d = {
|
|
27715
|
+
xmlName: XML_NODE_NAME$e,
|
|
27644
27716
|
sdNodeOrKeyName: SD_NODE_NAME$c,
|
|
27645
27717
|
type: NodeTranslator.translatorTypes.NODE,
|
|
27646
|
-
encode: encode$
|
|
27647
|
-
decode: decode$
|
|
27718
|
+
encode: encode$k,
|
|
27719
|
+
decode: decode$m,
|
|
27648
27720
|
attributes: []
|
|
27649
27721
|
};
|
|
27650
|
-
const translator$
|
|
27651
|
-
const tableNodeHandlerEntity = generateV2HandlerEntity("tableNodeHandler", translator$
|
|
27722
|
+
const translator$d = NodeTranslator.from(config$d);
|
|
27723
|
+
const tableNodeHandlerEntity = generateV2HandlerEntity("tableNodeHandler", translator$d);
|
|
27652
27724
|
function getReferencedTableStyles(tblStyleTag, docx) {
|
|
27653
27725
|
if (!tblStyleTag) return null;
|
|
27654
27726
|
const stylesToReturn = {};
|
|
@@ -28010,10 +28082,10 @@ function generateCellMargins(cellMargins) {
|
|
|
28010
28082
|
if (left != null) elements.push({ name: "w:left", attributes: { "w:w": pixelsToTwips(left) } });
|
|
28011
28083
|
return elements;
|
|
28012
28084
|
}
|
|
28013
|
-
const XML_NODE_NAME$
|
|
28085
|
+
const XML_NODE_NAME$d = "w:tc";
|
|
28014
28086
|
const SD_NODE_NAME$b = "tableCell";
|
|
28015
|
-
const validXmlAttributes$
|
|
28016
|
-
function encode$
|
|
28087
|
+
const validXmlAttributes$a = [];
|
|
28088
|
+
function encode$j(params, encodedAttrs) {
|
|
28017
28089
|
const {
|
|
28018
28090
|
node,
|
|
28019
28091
|
table,
|
|
@@ -28040,22 +28112,22 @@ function encode$h(params, encodedAttrs) {
|
|
|
28040
28112
|
}
|
|
28041
28113
|
return schemaNode;
|
|
28042
28114
|
}
|
|
28043
|
-
function decode$
|
|
28115
|
+
function decode$l(params, decodedAttrs) {
|
|
28044
28116
|
const translated = translateTableCell(params);
|
|
28045
28117
|
if (decodedAttrs && Object.keys(decodedAttrs).length) {
|
|
28046
28118
|
translated.attributes = { ...translated.attributes || {}, ...decodedAttrs };
|
|
28047
28119
|
}
|
|
28048
28120
|
return translated;
|
|
28049
28121
|
}
|
|
28050
|
-
const config$
|
|
28051
|
-
xmlName: XML_NODE_NAME$
|
|
28122
|
+
const config$c = {
|
|
28123
|
+
xmlName: XML_NODE_NAME$d,
|
|
28052
28124
|
sdNodeOrKeyName: SD_NODE_NAME$b,
|
|
28053
28125
|
type: NodeTranslator.translatorTypes.NODE,
|
|
28054
|
-
encode: encode$
|
|
28055
|
-
decode: decode$
|
|
28056
|
-
attributes: validXmlAttributes$
|
|
28126
|
+
encode: encode$j,
|
|
28127
|
+
decode: decode$l,
|
|
28128
|
+
attributes: validXmlAttributes$a
|
|
28057
28129
|
};
|
|
28058
|
-
const translator$
|
|
28130
|
+
const translator$c = NodeTranslator.from(config$c);
|
|
28059
28131
|
function parseTagValueJSON(json) {
|
|
28060
28132
|
if (typeof json !== "string") {
|
|
28061
28133
|
return {};
|
|
@@ -28482,8 +28554,64 @@ function handleImageNode(node, params, isAnchor) {
|
|
|
28482
28554
|
const vRelativeFrom = positionVTag?.attributes.relativeFrom;
|
|
28483
28555
|
const alignV = positionVTag?.elements?.find((el) => el.name === "wp:align")?.elements[0]?.text;
|
|
28484
28556
|
const simplePos = node.elements.find((el) => el.name === "wp:simplePos");
|
|
28485
|
-
const
|
|
28486
|
-
|
|
28557
|
+
const wrapNode = isAnchor ? node.elements.find(
|
|
28558
|
+
(el) => ["wp:wrapNone", "wp:wrapSquare", "wp:wrapThrough", "wp:wrapTight", "wp:wrapTopAndBottom"].includes(el.name)
|
|
28559
|
+
) : null;
|
|
28560
|
+
const wrap2 = isAnchor ? { type: wrapNode?.name.slice(7) || "None", attrs: {} } : { type: "Inline" };
|
|
28561
|
+
switch (wrap2.type) {
|
|
28562
|
+
case "Square":
|
|
28563
|
+
wrap2.attrs.wrapText = wrapNode.attributes.wrapText;
|
|
28564
|
+
if ("distB" in (wrapNode.attributes || {})) {
|
|
28565
|
+
wrap2.attrs.distBottom = emuToPixels(wrapNode.attributes.distB);
|
|
28566
|
+
}
|
|
28567
|
+
if ("distL" in (wrapNode.attributes || {})) {
|
|
28568
|
+
wrap2.attrs.distLeft = emuToPixels(wrapNode.attributes.distL);
|
|
28569
|
+
}
|
|
28570
|
+
if ("distR" in (wrapNode.attributes || {})) {
|
|
28571
|
+
wrap2.attrs.distRight = emuToPixels(wrapNode.attributes.distR);
|
|
28572
|
+
}
|
|
28573
|
+
if ("distT" in (wrapNode.attributes || {})) {
|
|
28574
|
+
wrap2.attrs.distTop = emuToPixels(wrapNode.attributes.distT);
|
|
28575
|
+
}
|
|
28576
|
+
break;
|
|
28577
|
+
case "Tight":
|
|
28578
|
+
case "Through": {
|
|
28579
|
+
if ("distL" in (wrapNode.attributes || {})) {
|
|
28580
|
+
wrap2.attrs.distLeft = emuToPixels(wrapNode.attributes.distL);
|
|
28581
|
+
}
|
|
28582
|
+
if ("distR" in (wrapNode.attributes || {})) {
|
|
28583
|
+
wrap2.attrs.distRight = emuToPixels(wrapNode.attributes.distR);
|
|
28584
|
+
}
|
|
28585
|
+
if ("distT" in (wrapNode.attributes || {})) {
|
|
28586
|
+
wrap2.attrs.distTop = emuToPixels(wrapNode.attributes.distT);
|
|
28587
|
+
}
|
|
28588
|
+
if ("distB" in (wrapNode.attributes || {})) {
|
|
28589
|
+
wrap2.attrs.distBottom = emuToPixels(wrapNode.attributes.distB);
|
|
28590
|
+
}
|
|
28591
|
+
if ("wrapText" in (wrapNode.attributes || {})) {
|
|
28592
|
+
wrap2.attrs.wrapText = wrapNode.attributes.wrapText;
|
|
28593
|
+
}
|
|
28594
|
+
const polygon = wrapNode.elements?.find((el) => el.name === "wp:wrapPolygon");
|
|
28595
|
+
if (polygon) {
|
|
28596
|
+
wrap2.attrs.polygon = polygonToObj(polygon);
|
|
28597
|
+
if (polygon.attributes?.edited !== void 0) {
|
|
28598
|
+
wrap2.attrs.polygonEdited = polygon.attributes.edited;
|
|
28599
|
+
}
|
|
28600
|
+
}
|
|
28601
|
+
break;
|
|
28602
|
+
}
|
|
28603
|
+
case "TopAndBottom":
|
|
28604
|
+
if ("distB" in (wrapNode.attributes || {})) {
|
|
28605
|
+
wrap2.attrs.distBottom = emuToPixels(wrapNode.attributes.distB);
|
|
28606
|
+
}
|
|
28607
|
+
if ("distT" in (wrapNode.attributes || {})) {
|
|
28608
|
+
wrap2.attrs.distTop = emuToPixels(wrapNode.attributes.distT);
|
|
28609
|
+
}
|
|
28610
|
+
break;
|
|
28611
|
+
case "None":
|
|
28612
|
+
wrap2.attrs.behindDoc = node.attributes?.behindDoc === "1";
|
|
28613
|
+
break;
|
|
28614
|
+
}
|
|
28487
28615
|
const docPr = node.elements.find((el) => el.name === "wp:docPr");
|
|
28488
28616
|
let anchorData = null;
|
|
28489
28617
|
if (hRelativeFrom || alignH || vRelativeFrom || alignV) {
|
|
@@ -28495,7 +28623,7 @@ function handleImageNode(node, params, isAnchor) {
|
|
|
28495
28623
|
};
|
|
28496
28624
|
}
|
|
28497
28625
|
const marginOffset = {
|
|
28498
|
-
|
|
28626
|
+
horizontal: positionHValue,
|
|
28499
28627
|
top: positionVValue
|
|
28500
28628
|
};
|
|
28501
28629
|
const { attributes: blipAttributes = {} } = blip;
|
|
@@ -28534,10 +28662,7 @@ function handleImageNode(node, params, isAnchor) {
|
|
|
28534
28662
|
y: simplePos.attributes.y
|
|
28535
28663
|
}
|
|
28536
28664
|
},
|
|
28537
|
-
|
|
28538
|
-
wrapText: wrapSquare.attributes.wrapText
|
|
28539
|
-
},
|
|
28540
|
-
wrapTopAndBottom: !!wrapTopAndBottom,
|
|
28665
|
+
wrap: wrap2,
|
|
28541
28666
|
originalPadding: {
|
|
28542
28667
|
distT: attributes["distT"],
|
|
28543
28668
|
distB: attributes["distB"],
|
|
@@ -28885,7 +29010,6 @@ function addNewImageRelationship(params, imagePath) {
|
|
|
28885
29010
|
function translateAnchorNode(params) {
|
|
28886
29011
|
const { attrs } = params.node;
|
|
28887
29012
|
const anchorElements = [];
|
|
28888
|
-
const wrapElements = [];
|
|
28889
29013
|
if (attrs.simplePos) {
|
|
28890
29014
|
anchorElements.push({
|
|
28891
29015
|
name: "wp:simplePos",
|
|
@@ -28897,10 +29021,10 @@ function translateAnchorNode(params) {
|
|
|
28897
29021
|
}
|
|
28898
29022
|
if (attrs.anchorData) {
|
|
28899
29023
|
const hElements = [];
|
|
28900
|
-
if (attrs.marginOffset.
|
|
29024
|
+
if (attrs.marginOffset.horizontal !== void 0) {
|
|
28901
29025
|
hElements.push({
|
|
28902
29026
|
name: "wp:posOffset",
|
|
28903
|
-
elements: [{ type: "text", text: pixelsToEmu(attrs.marginOffset.
|
|
29027
|
+
elements: [{ type: "text", text: pixelsToEmu(attrs.marginOffset.horizontal).toString() }]
|
|
28904
29028
|
});
|
|
28905
29029
|
}
|
|
28906
29030
|
if (attrs.anchorData.alignH) {
|
|
@@ -28933,38 +29057,110 @@ function translateAnchorNode(params) {
|
|
|
28933
29057
|
...vElements.length && { elements: vElements }
|
|
28934
29058
|
});
|
|
28935
29059
|
}
|
|
28936
|
-
|
|
28937
|
-
|
|
28938
|
-
|
|
28939
|
-
|
|
28940
|
-
|
|
28941
|
-
|
|
28942
|
-
|
|
29060
|
+
const nodeElements = translateImageNode(params);
|
|
29061
|
+
const inlineAttrs = {
|
|
29062
|
+
...attrs.originalAttributes || {},
|
|
29063
|
+
...nodeElements.attributes || {}
|
|
29064
|
+
};
|
|
29065
|
+
if (inlineAttrs.relativeHeight == null) {
|
|
29066
|
+
inlineAttrs.relativeHeight = 1;
|
|
28943
29067
|
}
|
|
28944
|
-
if (attrs.
|
|
28945
|
-
|
|
28946
|
-
|
|
28947
|
-
|
|
29068
|
+
if (attrs.originalAttributes?.simplePos !== void 0) {
|
|
29069
|
+
inlineAttrs.simplePos = attrs.originalAttributes.simplePos;
|
|
29070
|
+
} else if (attrs.simplePos !== void 0) {
|
|
29071
|
+
inlineAttrs.simplePos = attrs.simplePos;
|
|
28948
29072
|
}
|
|
28949
|
-
if (
|
|
28950
|
-
|
|
28951
|
-
name: "wp:wrapNone"
|
|
28952
|
-
});
|
|
29073
|
+
if (attrs.originalAttributes?.locked !== void 0) {
|
|
29074
|
+
inlineAttrs.locked = attrs.originalAttributes.locked;
|
|
28953
29075
|
}
|
|
28954
|
-
|
|
28955
|
-
|
|
28956
|
-
|
|
28957
|
-
|
|
28958
|
-
|
|
28959
|
-
|
|
28960
|
-
|
|
28961
|
-
|
|
28962
|
-
|
|
29076
|
+
if (attrs.originalAttributes?.layoutInCell !== void 0) {
|
|
29077
|
+
inlineAttrs.layoutInCell = attrs.originalAttributes.layoutInCell;
|
|
29078
|
+
}
|
|
29079
|
+
if (attrs.originalAttributes?.allowOverlap !== void 0) {
|
|
29080
|
+
inlineAttrs.allowOverlap = attrs.originalAttributes.allowOverlap;
|
|
29081
|
+
}
|
|
29082
|
+
const wrapElement = {
|
|
29083
|
+
name: `wp:wrap${attrs.wrap?.type || "None"}`
|
|
29084
|
+
// Important: wp:anchor will break if no wrapping is specified. We need to use wrapNone.
|
|
28963
29085
|
};
|
|
29086
|
+
switch (attrs.wrap?.type) {
|
|
29087
|
+
case "Square":
|
|
29088
|
+
wrapElement.attributes = {
|
|
29089
|
+
wrapText: attrs.wrap.attrs.wrapText
|
|
29090
|
+
};
|
|
29091
|
+
if ("distBottom" in (attrs.wrap.attrs || {})) {
|
|
29092
|
+
wrapElement.attributes.distB = pixelsToEmu(attrs.wrap.attrs.distBottom);
|
|
29093
|
+
}
|
|
29094
|
+
if ("distLeft" in (attrs.wrap.attrs || {})) {
|
|
29095
|
+
wrapElement.attributes.distL = pixelsToEmu(attrs.wrap.attrs.distLeft);
|
|
29096
|
+
}
|
|
29097
|
+
if ("distRight" in (attrs.wrap.attrs || {})) {
|
|
29098
|
+
wrapElement.attributes.distR = pixelsToEmu(attrs.wrap.attrs.distRight);
|
|
29099
|
+
}
|
|
29100
|
+
if ("distTop" in (attrs.wrap.attrs || {})) {
|
|
29101
|
+
wrapElement.attributes.distT = pixelsToEmu(attrs.wrap.attrs.distTop);
|
|
29102
|
+
}
|
|
29103
|
+
break;
|
|
29104
|
+
case "TopAndBottom": {
|
|
29105
|
+
const attributes = {};
|
|
29106
|
+
let hasKeys = false;
|
|
29107
|
+
if ("distBottom" in (attrs.wrap.attrs || {})) {
|
|
29108
|
+
attributes.distB = pixelsToEmu(attrs.wrap.attrs.distBottom);
|
|
29109
|
+
hasKeys = true;
|
|
29110
|
+
}
|
|
29111
|
+
if ("distTop" in (attrs.wrap.attrs || {})) {
|
|
29112
|
+
attributes.distT = pixelsToEmu(attrs.wrap.attrs.distTop);
|
|
29113
|
+
hasKeys = true;
|
|
29114
|
+
}
|
|
29115
|
+
if (hasKeys) {
|
|
29116
|
+
wrapElement.attributes = attributes;
|
|
29117
|
+
}
|
|
29118
|
+
break;
|
|
29119
|
+
}
|
|
29120
|
+
case "Through":
|
|
29121
|
+
case "Tight": {
|
|
29122
|
+
const attributes = {};
|
|
29123
|
+
if ("distLeft" in (attrs.wrap.attrs || {})) {
|
|
29124
|
+
attributes.distL = pixelsToEmu(attrs.wrap.attrs.distLeft);
|
|
29125
|
+
}
|
|
29126
|
+
if ("distRight" in (attrs.wrap.attrs || {})) {
|
|
29127
|
+
attributes.distR = pixelsToEmu(attrs.wrap.attrs.distRight);
|
|
29128
|
+
}
|
|
29129
|
+
if ("distTop" in (attrs.wrap.attrs || {})) {
|
|
29130
|
+
attributes.distT = pixelsToEmu(attrs.wrap.attrs.distTop);
|
|
29131
|
+
}
|
|
29132
|
+
if ("distBottom" in (attrs.wrap.attrs || {})) {
|
|
29133
|
+
attributes.distB = pixelsToEmu(attrs.wrap.attrs.distBottom);
|
|
29134
|
+
}
|
|
29135
|
+
const wrapText = attrs.wrap.attrs?.wrapText || "bothSides";
|
|
29136
|
+
{
|
|
29137
|
+
attributes.wrapText = wrapText;
|
|
29138
|
+
}
|
|
29139
|
+
if (Object.keys(attributes).length) {
|
|
29140
|
+
wrapElement.attributes = attributes;
|
|
29141
|
+
}
|
|
29142
|
+
if (attrs.wrap.attrs?.polygon) {
|
|
29143
|
+
const polygonNode = objToPolygon(attrs.wrap.attrs.polygon);
|
|
29144
|
+
if (polygonNode) {
|
|
29145
|
+
if (attrs.wrap.attrs?.polygonEdited !== void 0) {
|
|
29146
|
+
polygonNode.attributes = {
|
|
29147
|
+
...polygonNode.attributes || {},
|
|
29148
|
+
edited: String(attrs.wrap.attrs.polygonEdited)
|
|
29149
|
+
};
|
|
29150
|
+
}
|
|
29151
|
+
wrapElement.elements = [polygonNode];
|
|
29152
|
+
}
|
|
29153
|
+
}
|
|
29154
|
+
break;
|
|
29155
|
+
}
|
|
29156
|
+
case "None":
|
|
29157
|
+
inlineAttrs.behindDoc = attrs.wrap.attrs?.behindDoc ? "1" : "0";
|
|
29158
|
+
break;
|
|
29159
|
+
}
|
|
28964
29160
|
const effectIndex = nodeElements.elements.findIndex((el) => el.name === "wp:effectExtent");
|
|
28965
29161
|
const elementsWithWrap = [
|
|
28966
29162
|
...nodeElements.elements.slice(0, effectIndex + 1),
|
|
28967
|
-
|
|
29163
|
+
wrapElement,
|
|
28968
29164
|
...nodeElements.elements.slice(effectIndex + 1)
|
|
28969
29165
|
];
|
|
28970
29166
|
return {
|
|
@@ -28973,32 +29169,32 @@ function translateAnchorNode(params) {
|
|
|
28973
29169
|
elements: [...anchorElements, ...elementsWithWrap]
|
|
28974
29170
|
};
|
|
28975
29171
|
}
|
|
28976
|
-
const XML_NODE_NAME$
|
|
29172
|
+
const XML_NODE_NAME$c = "wp:anchor";
|
|
28977
29173
|
const SD_NODE_NAME$a = ["image"];
|
|
28978
|
-
const validXmlAttributes$
|
|
28979
|
-
function encode$
|
|
29174
|
+
const validXmlAttributes$9 = ["distT", "distB", "distL", "distR"].map((xmlName) => createAttributeHandler(xmlName));
|
|
29175
|
+
function encode$i(params) {
|
|
28980
29176
|
const { node } = params.extraParams;
|
|
28981
29177
|
if (!node || !node.type) {
|
|
28982
29178
|
return null;
|
|
28983
29179
|
}
|
|
28984
29180
|
return handleAnchorNode(params);
|
|
28985
29181
|
}
|
|
28986
|
-
function decode$
|
|
29182
|
+
function decode$k(params) {
|
|
28987
29183
|
const { node } = params;
|
|
28988
29184
|
if (!node || !node.type) {
|
|
28989
29185
|
return null;
|
|
28990
29186
|
}
|
|
28991
29187
|
return translateAnchorNode(params);
|
|
28992
29188
|
}
|
|
28993
|
-
const config$
|
|
28994
|
-
xmlName: XML_NODE_NAME$
|
|
29189
|
+
const config$b = {
|
|
29190
|
+
xmlName: XML_NODE_NAME$c,
|
|
28995
29191
|
sdNodeOrKeyName: SD_NODE_NAME$a,
|
|
28996
29192
|
type: NodeTranslator.translatorTypes.NODE,
|
|
28997
|
-
encode: encode$
|
|
28998
|
-
decode: decode$
|
|
28999
|
-
attributes: validXmlAttributes$
|
|
29193
|
+
encode: encode$i,
|
|
29194
|
+
decode: decode$k,
|
|
29195
|
+
attributes: validXmlAttributes$9
|
|
29000
29196
|
};
|
|
29001
|
-
const translator$
|
|
29197
|
+
const translator$b = NodeTranslator.from(config$b);
|
|
29002
29198
|
function handleInlineNode(params) {
|
|
29003
29199
|
const { node } = params.extraParams;
|
|
29004
29200
|
if (node.name !== "wp:inline") {
|
|
@@ -29014,41 +29210,41 @@ function translateInlineNode(params) {
|
|
|
29014
29210
|
elements: nodeElements.elements
|
|
29015
29211
|
};
|
|
29016
29212
|
}
|
|
29017
|
-
const XML_NODE_NAME$
|
|
29213
|
+
const XML_NODE_NAME$b = "wp:inline";
|
|
29018
29214
|
const SD_NODE_NAME$9 = ["image"];
|
|
29019
|
-
const validXmlAttributes$
|
|
29020
|
-
function encode$
|
|
29215
|
+
const validXmlAttributes$8 = ["distT", "distB", "distL", "distR"].map((xmlName) => createAttributeHandler(xmlName));
|
|
29216
|
+
function encode$h(params) {
|
|
29021
29217
|
const { node } = params.extraParams;
|
|
29022
29218
|
if (!node || !node.type) {
|
|
29023
29219
|
return null;
|
|
29024
29220
|
}
|
|
29025
29221
|
return handleInlineNode(params);
|
|
29026
29222
|
}
|
|
29027
|
-
function decode$
|
|
29223
|
+
function decode$j(params) {
|
|
29028
29224
|
const { node } = params;
|
|
29029
29225
|
if (!node || !node.type) {
|
|
29030
29226
|
return null;
|
|
29031
29227
|
}
|
|
29032
29228
|
return translateInlineNode(params);
|
|
29033
29229
|
}
|
|
29034
|
-
const config$
|
|
29035
|
-
xmlName: XML_NODE_NAME$
|
|
29230
|
+
const config$a = {
|
|
29231
|
+
xmlName: XML_NODE_NAME$b,
|
|
29036
29232
|
sdNodeOrKeyName: SD_NODE_NAME$9,
|
|
29037
29233
|
type: NodeTranslator.translatorTypes.NODE,
|
|
29038
|
-
encode: encode$
|
|
29039
|
-
decode: decode$
|
|
29040
|
-
attributes: validXmlAttributes$
|
|
29234
|
+
encode: encode$h,
|
|
29235
|
+
decode: decode$j,
|
|
29236
|
+
attributes: validXmlAttributes$8
|
|
29041
29237
|
};
|
|
29042
|
-
const translator$
|
|
29043
|
-
const XML_NODE_NAME$
|
|
29238
|
+
const translator$a = NodeTranslator.from(config$a);
|
|
29239
|
+
const XML_NODE_NAME$a = "w:drawing";
|
|
29044
29240
|
const SD_NODE_NAME$8 = [];
|
|
29045
|
-
const validXmlAttributes$
|
|
29046
|
-
function encode$
|
|
29241
|
+
const validXmlAttributes$7 = [];
|
|
29242
|
+
function encode$g(params) {
|
|
29047
29243
|
const nodes = params.nodes;
|
|
29048
29244
|
const node = nodes[0];
|
|
29049
29245
|
const translatorByChildName = {
|
|
29050
|
-
"wp:anchor": translator$
|
|
29051
|
-
"wp:inline": translator$
|
|
29246
|
+
"wp:anchor": translator$b,
|
|
29247
|
+
"wp:inline": translator$a
|
|
29052
29248
|
};
|
|
29053
29249
|
return node.elements.reduce((acc, child) => {
|
|
29054
29250
|
if (acc) return acc;
|
|
@@ -29057,12 +29253,12 @@ function encode$e(params) {
|
|
|
29057
29253
|
return translator2.encode({ ...params, extraParams: { node: child } }) || acc;
|
|
29058
29254
|
}, null);
|
|
29059
29255
|
}
|
|
29060
|
-
function decode$
|
|
29256
|
+
function decode$i(params) {
|
|
29061
29257
|
const { node } = params;
|
|
29062
29258
|
if (!node || !node.type) {
|
|
29063
29259
|
return null;
|
|
29064
29260
|
}
|
|
29065
|
-
const childTranslator = node.attrs.isAnchor ? translator$
|
|
29261
|
+
const childTranslator = node.attrs.isAnchor ? translator$b : translator$a;
|
|
29066
29262
|
const resultNode = childTranslator.decode(params);
|
|
29067
29263
|
return wrapTextInRun(
|
|
29068
29264
|
{
|
|
@@ -29072,15 +29268,15 @@ function decode$g(params) {
|
|
|
29072
29268
|
[]
|
|
29073
29269
|
);
|
|
29074
29270
|
}
|
|
29075
|
-
const config$
|
|
29076
|
-
xmlName: XML_NODE_NAME$
|
|
29271
|
+
const config$9 = {
|
|
29272
|
+
xmlName: XML_NODE_NAME$a,
|
|
29077
29273
|
sdNodeOrKeyName: SD_NODE_NAME$8,
|
|
29078
29274
|
type: NodeTranslator.translatorTypes.NODE,
|
|
29079
|
-
encode: encode$
|
|
29080
|
-
decode: decode$
|
|
29081
|
-
attributes: validXmlAttributes$
|
|
29275
|
+
encode: encode$g,
|
|
29276
|
+
decode: decode$i,
|
|
29277
|
+
attributes: validXmlAttributes$7
|
|
29082
29278
|
};
|
|
29083
|
-
const translator$
|
|
29279
|
+
const translator$9 = NodeTranslator.from(config$9);
|
|
29084
29280
|
class CommandService {
|
|
29085
29281
|
/**
|
|
29086
29282
|
* @param {import('./commands/types/index.js').CommandServiceOptions} props
|
|
@@ -30428,7 +30624,7 @@ function prepareTextAnnotation(params) {
|
|
|
30428
30624
|
return getTextNodeForExport(attrs.displayLabel, [...marks, ...marksFromAttrs], params);
|
|
30429
30625
|
}
|
|
30430
30626
|
function prepareImageAnnotation(params, imageSize) {
|
|
30431
|
-
return translator$
|
|
30627
|
+
return translator$9.decode({
|
|
30432
30628
|
...params,
|
|
30433
30629
|
imageSize
|
|
30434
30630
|
});
|
|
@@ -30743,10 +30939,10 @@ function generateSdtPrTagForStructuredContent({ node }) {
|
|
|
30743
30939
|
};
|
|
30744
30940
|
return result;
|
|
30745
30941
|
}
|
|
30746
|
-
const XML_NODE_NAME$
|
|
30942
|
+
const XML_NODE_NAME$9 = "w:sdt";
|
|
30747
30943
|
const SD_NODE_NAME$7 = ["fieldAnnotation", "structuredContent", "structuredContentBlock", "documentSection"];
|
|
30748
|
-
const validXmlAttributes$
|
|
30749
|
-
function encode$
|
|
30944
|
+
const validXmlAttributes$6 = [];
|
|
30945
|
+
function encode$f(params) {
|
|
30750
30946
|
const nodes = params.nodes;
|
|
30751
30947
|
const node = nodes[0];
|
|
30752
30948
|
const { type: sdtType, handler: handler2 } = sdtNodeTypeStrategy(node);
|
|
@@ -30756,7 +30952,7 @@ function encode$d(params) {
|
|
|
30756
30952
|
const result = handler2(params);
|
|
30757
30953
|
return result;
|
|
30758
30954
|
}
|
|
30759
|
-
function decode$
|
|
30955
|
+
function decode$h(params) {
|
|
30760
30956
|
const { node } = params;
|
|
30761
30957
|
if (!node || !node.type) {
|
|
30762
30958
|
return null;
|
|
@@ -30774,85 +30970,85 @@ function decode$f(params) {
|
|
|
30774
30970
|
const result = decoder();
|
|
30775
30971
|
return result;
|
|
30776
30972
|
}
|
|
30777
|
-
const config$
|
|
30778
|
-
xmlName: XML_NODE_NAME$
|
|
30973
|
+
const config$8 = {
|
|
30974
|
+
xmlName: XML_NODE_NAME$9,
|
|
30779
30975
|
sdNodeOrKeyName: SD_NODE_NAME$7,
|
|
30780
30976
|
type: NodeTranslator.translatorTypes.NODE,
|
|
30781
|
-
encode: encode$
|
|
30782
|
-
decode: decode$
|
|
30783
|
-
attributes: validXmlAttributes$
|
|
30977
|
+
encode: encode$f,
|
|
30978
|
+
decode: decode$h,
|
|
30979
|
+
attributes: validXmlAttributes$6
|
|
30784
30980
|
};
|
|
30785
|
-
const translator$
|
|
30786
|
-
const encode$
|
|
30981
|
+
const translator$8 = NodeTranslator.from(config$8);
|
|
30982
|
+
const encode$e = (attributes) => {
|
|
30787
30983
|
return attributes["w:id"];
|
|
30788
30984
|
};
|
|
30789
|
-
const decode$
|
|
30985
|
+
const decode$g = (attrs) => {
|
|
30790
30986
|
return attrs.id;
|
|
30791
30987
|
};
|
|
30792
30988
|
const attrConfig$7 = Object.freeze({
|
|
30793
30989
|
xmlName: "w:id",
|
|
30794
30990
|
sdName: "id",
|
|
30795
|
-
encode: encode$
|
|
30796
|
-
decode: decode$
|
|
30991
|
+
encode: encode$e,
|
|
30992
|
+
decode: decode$g
|
|
30797
30993
|
});
|
|
30798
|
-
const encode$
|
|
30994
|
+
const encode$d = (attributes) => {
|
|
30799
30995
|
return attributes["w:name"];
|
|
30800
30996
|
};
|
|
30801
|
-
const decode$
|
|
30997
|
+
const decode$f = (attrs) => {
|
|
30802
30998
|
return attrs.name;
|
|
30803
30999
|
};
|
|
30804
31000
|
const attrConfig$6 = Object.freeze({
|
|
30805
31001
|
xmlName: "w:name",
|
|
30806
31002
|
sdName: "name",
|
|
30807
|
-
encode: encode$
|
|
30808
|
-
decode: decode$
|
|
31003
|
+
encode: encode$d,
|
|
31004
|
+
decode: decode$f
|
|
30809
31005
|
});
|
|
30810
|
-
const encode$
|
|
31006
|
+
const encode$c = (attributes) => {
|
|
30811
31007
|
return attributes["w:colFirst"];
|
|
30812
31008
|
};
|
|
30813
|
-
const decode$
|
|
31009
|
+
const decode$e = (attrs) => {
|
|
30814
31010
|
return attrs.colFirst;
|
|
30815
31011
|
};
|
|
30816
31012
|
const attrConfig$5 = Object.freeze({
|
|
30817
31013
|
xmlName: "w:colFirst",
|
|
30818
31014
|
sdName: "colFirst",
|
|
30819
|
-
encode: encode$
|
|
30820
|
-
decode: decode$
|
|
31015
|
+
encode: encode$c,
|
|
31016
|
+
decode: decode$e
|
|
30821
31017
|
});
|
|
30822
|
-
const encode$
|
|
31018
|
+
const encode$b = (attributes) => {
|
|
30823
31019
|
return attributes["w:colLast"];
|
|
30824
31020
|
};
|
|
30825
|
-
const decode$
|
|
31021
|
+
const decode$d = (attrs) => {
|
|
30826
31022
|
return attrs.colLast;
|
|
30827
31023
|
};
|
|
30828
31024
|
const attrConfig$4 = Object.freeze({
|
|
30829
31025
|
xmlName: "w:colLast",
|
|
30830
31026
|
sdName: "colLast",
|
|
30831
|
-
encode: encode$
|
|
30832
|
-
decode: decode$
|
|
31027
|
+
encode: encode$b,
|
|
31028
|
+
decode: decode$d
|
|
30833
31029
|
});
|
|
30834
|
-
const encode$
|
|
31030
|
+
const encode$a = (attributes) => {
|
|
30835
31031
|
return attributes["w:displacedByCustomXml"];
|
|
30836
31032
|
};
|
|
30837
|
-
const decode$
|
|
31033
|
+
const decode$c = (attrs) => {
|
|
30838
31034
|
return attrs.displacedByCustomXml;
|
|
30839
31035
|
};
|
|
30840
31036
|
const attrConfig$3 = Object.freeze({
|
|
30841
31037
|
xmlName: "w:displacedByCustomXml",
|
|
30842
31038
|
sdName: "displacedByCustomXml",
|
|
30843
|
-
encode: encode$
|
|
30844
|
-
decode: decode$
|
|
31039
|
+
encode: encode$a,
|
|
31040
|
+
decode: decode$c
|
|
30845
31041
|
});
|
|
30846
|
-
const validXmlAttributes$
|
|
30847
|
-
const XML_NODE_NAME$
|
|
31042
|
+
const validXmlAttributes$5 = [attrConfig$7, attrConfig$6, attrConfig$5, attrConfig$4, attrConfig$3];
|
|
31043
|
+
const XML_NODE_NAME$8 = "w:bookmarkStart";
|
|
30848
31044
|
const SD_NODE_NAME$6 = "bookmarkStart";
|
|
30849
|
-
const encode$
|
|
31045
|
+
const encode$9 = (params, encodedAttrs = {}) => {
|
|
30850
31046
|
return {
|
|
30851
31047
|
type: "bookmarkStart",
|
|
30852
31048
|
attrs: encodedAttrs
|
|
30853
31049
|
};
|
|
30854
31050
|
};
|
|
30855
|
-
const decode$
|
|
31051
|
+
const decode$b = (params, decodedAttrs = {}) => {
|
|
30856
31052
|
const result = {
|
|
30857
31053
|
name: "w:bookmarkStart",
|
|
30858
31054
|
elements: []
|
|
@@ -30862,49 +31058,49 @@ const decode$9 = (params, decodedAttrs = {}) => {
|
|
|
30862
31058
|
}
|
|
30863
31059
|
return result;
|
|
30864
31060
|
};
|
|
30865
|
-
const config$
|
|
30866
|
-
xmlName: XML_NODE_NAME$
|
|
31061
|
+
const config$7 = {
|
|
31062
|
+
xmlName: XML_NODE_NAME$8,
|
|
30867
31063
|
sdNodeOrKeyName: SD_NODE_NAME$6,
|
|
30868
31064
|
type: NodeTranslator.translatorTypes.NODE,
|
|
30869
|
-
encode: encode$
|
|
30870
|
-
decode: decode$
|
|
30871
|
-
attributes: validXmlAttributes$
|
|
31065
|
+
encode: encode$9,
|
|
31066
|
+
decode: decode$b,
|
|
31067
|
+
attributes: validXmlAttributes$5
|
|
30872
31068
|
};
|
|
30873
|
-
const translator$
|
|
30874
|
-
const encode$
|
|
31069
|
+
const translator$7 = NodeTranslator.from(config$7);
|
|
31070
|
+
const encode$8 = (attributes) => {
|
|
30875
31071
|
return attributes["w:id"];
|
|
30876
31072
|
};
|
|
30877
|
-
const decode$
|
|
31073
|
+
const decode$a = (attrs) => {
|
|
30878
31074
|
return attrs.id;
|
|
30879
31075
|
};
|
|
30880
31076
|
const attrConfig$2 = Object.freeze({
|
|
30881
31077
|
xmlName: "w:id",
|
|
30882
31078
|
sdName: "id",
|
|
30883
|
-
encode: encode$
|
|
30884
|
-
decode: decode$
|
|
31079
|
+
encode: encode$8,
|
|
31080
|
+
decode: decode$a
|
|
30885
31081
|
});
|
|
30886
|
-
const encode$
|
|
31082
|
+
const encode$7 = (attributes) => {
|
|
30887
31083
|
return attributes["w:displacedByCustomXml"];
|
|
30888
31084
|
};
|
|
30889
|
-
const decode$
|
|
31085
|
+
const decode$9 = (attrs) => {
|
|
30890
31086
|
return attrs.displacedByCustomXml;
|
|
30891
31087
|
};
|
|
30892
31088
|
const attrConfig$1 = Object.freeze({
|
|
30893
31089
|
xmlName: "w:displacedByCustomXml",
|
|
30894
31090
|
sdName: "displacedByCustomXml",
|
|
30895
|
-
encode: encode$
|
|
30896
|
-
decode: decode$
|
|
31091
|
+
encode: encode$7,
|
|
31092
|
+
decode: decode$9
|
|
30897
31093
|
});
|
|
30898
|
-
const validXmlAttributes$
|
|
30899
|
-
const XML_NODE_NAME$
|
|
31094
|
+
const validXmlAttributes$4 = [attrConfig$2, attrConfig$1];
|
|
31095
|
+
const XML_NODE_NAME$7 = "w:bookmarkEnd";
|
|
30900
31096
|
const SD_NODE_NAME$5 = "bookmarkEnd";
|
|
30901
|
-
const encode$
|
|
31097
|
+
const encode$6 = (params, encodedAttrs = {}) => {
|
|
30902
31098
|
return {
|
|
30903
31099
|
type: "bookmarkEnd",
|
|
30904
31100
|
attrs: encodedAttrs
|
|
30905
31101
|
};
|
|
30906
31102
|
};
|
|
30907
|
-
const decode$
|
|
31103
|
+
const decode$8 = (params, decodedAttrs = {}) => {
|
|
30908
31104
|
const result = {
|
|
30909
31105
|
name: "w:bookmarkEnd",
|
|
30910
31106
|
elements: []
|
|
@@ -30914,27 +31110,27 @@ const decode$6 = (params, decodedAttrs = {}) => {
|
|
|
30914
31110
|
}
|
|
30915
31111
|
return result;
|
|
30916
31112
|
};
|
|
30917
|
-
const config$
|
|
30918
|
-
xmlName: XML_NODE_NAME$
|
|
31113
|
+
const config$6 = {
|
|
31114
|
+
xmlName: XML_NODE_NAME$7,
|
|
30919
31115
|
sdNodeOrKeyName: SD_NODE_NAME$5,
|
|
30920
31116
|
type: NodeTranslator.translatorTypes.NODE,
|
|
30921
|
-
encode: encode$
|
|
30922
|
-
decode: decode$
|
|
30923
|
-
attributes: validXmlAttributes$
|
|
31117
|
+
encode: encode$6,
|
|
31118
|
+
decode: decode$8,
|
|
31119
|
+
attributes: validXmlAttributes$4
|
|
30924
31120
|
};
|
|
30925
|
-
const translator$
|
|
30926
|
-
const decode$
|
|
31121
|
+
const translator$6 = NodeTranslator.from(config$6);
|
|
31122
|
+
const decode$7 = (attrs) => attrs?.["w:id"];
|
|
30927
31123
|
const attrConfig = Object.freeze({
|
|
30928
31124
|
xmlName: "w:id",
|
|
30929
31125
|
sdName: "w:id",
|
|
30930
31126
|
// We do not translate it from 'w:id' to 'id' when encoding, so the name is the same
|
|
30931
31127
|
encode: () => {
|
|
30932
31128
|
},
|
|
30933
|
-
decode: decode$
|
|
31129
|
+
decode: decode$7
|
|
30934
31130
|
});
|
|
30935
|
-
const XML_NODE_NAME$
|
|
31131
|
+
const XML_NODE_NAME$6 = "w:commentRange";
|
|
30936
31132
|
const SD_NODE_NAME$4 = "commentRange";
|
|
30937
|
-
const decode$
|
|
31133
|
+
const decode$6 = (params) => {
|
|
30938
31134
|
const { node, comments, commentsExportType, exportedCommentDefs } = params;
|
|
30939
31135
|
if (!node) return;
|
|
30940
31136
|
if (!comments) return;
|
|
@@ -30977,19 +31173,19 @@ const getCommentSchema = (type2, commentIndex) => {
|
|
|
30977
31173
|
};
|
|
30978
31174
|
};
|
|
30979
31175
|
const getConfig = (type2) => ({
|
|
30980
|
-
xmlName: `${XML_NODE_NAME$
|
|
31176
|
+
xmlName: `${XML_NODE_NAME$6}${type2}`,
|
|
30981
31177
|
sdNodeOrKeyName: `${SD_NODE_NAME$4}${type2}`,
|
|
30982
31178
|
type: NodeTranslator.translatorTypes.NODE,
|
|
30983
31179
|
encode: () => {
|
|
30984
31180
|
},
|
|
30985
|
-
decode: decode$
|
|
31181
|
+
decode: decode$6,
|
|
30986
31182
|
attributes: [attrConfig]
|
|
30987
31183
|
});
|
|
30988
31184
|
const commentRangeStartTranslator = NodeTranslator.from(getConfig("Start"));
|
|
30989
31185
|
const commentRangeEndTranslator = NodeTranslator.from(getConfig("End"));
|
|
30990
|
-
const XML_NODE_NAME$
|
|
31186
|
+
const XML_NODE_NAME$5 = "sd:pageReference";
|
|
30991
31187
|
const SD_NODE_NAME$3 = "pageReference";
|
|
30992
|
-
const encode$
|
|
31188
|
+
const encode$5 = (params) => {
|
|
30993
31189
|
const { nodes = [], nodeListHandler } = params || {};
|
|
30994
31190
|
const node = nodes[0];
|
|
30995
31191
|
const processedText = nodeListHandler.handler({
|
|
@@ -31006,7 +31202,7 @@ const encode$3 = (params) => {
|
|
|
31006
31202
|
};
|
|
31007
31203
|
return processedNode;
|
|
31008
31204
|
};
|
|
31009
|
-
const decode$
|
|
31205
|
+
const decode$5 = (params) => {
|
|
31010
31206
|
const { node } = params;
|
|
31011
31207
|
const outputMarks = processOutputMarks(node.attrs?.marksAsAttrs || []);
|
|
31012
31208
|
const contentNodes = (node.content ?? []).flatMap((n) => exportSchemaToJson({ ...params, node: n }));
|
|
@@ -31079,17 +31275,17 @@ const decode$3 = (params) => {
|
|
|
31079
31275
|
];
|
|
31080
31276
|
return translated;
|
|
31081
31277
|
};
|
|
31082
|
-
const config$
|
|
31083
|
-
xmlName: XML_NODE_NAME$
|
|
31278
|
+
const config$5 = {
|
|
31279
|
+
xmlName: XML_NODE_NAME$5,
|
|
31084
31280
|
sdNodeOrKeyName: SD_NODE_NAME$3,
|
|
31085
31281
|
type: NodeTranslator.translatorTypes.NODE,
|
|
31086
|
-
encode: encode$
|
|
31087
|
-
decode: decode$
|
|
31282
|
+
encode: encode$5,
|
|
31283
|
+
decode: decode$5
|
|
31088
31284
|
};
|
|
31089
|
-
const translator$
|
|
31090
|
-
const XML_NODE_NAME$
|
|
31285
|
+
const translator$5 = NodeTranslator.from(config$5);
|
|
31286
|
+
const XML_NODE_NAME$4 = "sd:tableOfContents";
|
|
31091
31287
|
const SD_NODE_NAME$2 = "tableOfContents";
|
|
31092
|
-
const encode$
|
|
31288
|
+
const encode$4 = (params) => {
|
|
31093
31289
|
const { nodes = [], nodeListHandler } = params || {};
|
|
31094
31290
|
const node = nodes[0];
|
|
31095
31291
|
const processedContent = nodeListHandler.handler({
|
|
@@ -31105,7 +31301,7 @@ const encode$2 = (params) => {
|
|
|
31105
31301
|
};
|
|
31106
31302
|
return processedNode;
|
|
31107
31303
|
};
|
|
31108
|
-
const decode$
|
|
31304
|
+
const decode$4 = (params) => {
|
|
31109
31305
|
const { node } = params;
|
|
31110
31306
|
const contentNodes = node.content.map((n) => exportSchemaToJson({ ...params, node: n }));
|
|
31111
31307
|
const tocBeginElements = [
|
|
@@ -31152,14 +31348,14 @@ const decode$2 = (params) => {
|
|
|
31152
31348
|
}
|
|
31153
31349
|
return contentNodes;
|
|
31154
31350
|
};
|
|
31155
|
-
const config$
|
|
31156
|
-
xmlName: XML_NODE_NAME$
|
|
31351
|
+
const config$4 = {
|
|
31352
|
+
xmlName: XML_NODE_NAME$4,
|
|
31157
31353
|
sdNodeOrKeyName: SD_NODE_NAME$2,
|
|
31158
31354
|
type: NodeTranslator.translatorTypes.NODE,
|
|
31159
|
-
encode: encode$
|
|
31160
|
-
decode: decode$
|
|
31355
|
+
encode: encode$4,
|
|
31356
|
+
decode: decode$4
|
|
31161
31357
|
};
|
|
31162
|
-
const translator$
|
|
31358
|
+
const translator$4 = NodeTranslator.from(config$4);
|
|
31163
31359
|
function parseInlineStyles(styleString) {
|
|
31164
31360
|
if (!styleString) return {};
|
|
31165
31361
|
return styleString.split(";").filter((style) => !!style.trim()).reduce((acc, style) => {
|
|
@@ -31293,7 +31489,7 @@ const handleDrawingNode = (params) => {
|
|
|
31293
31489
|
if (mainNode.name === "w:drawing") node = mainNode;
|
|
31294
31490
|
else node = mainNode.elements.find((el) => el.name === "w:drawing");
|
|
31295
31491
|
if (!node) return { nodes: [], consumed: 0 };
|
|
31296
|
-
const schemaNode = translator$
|
|
31492
|
+
const schemaNode = translator$9.encode(params);
|
|
31297
31493
|
const newNodes = schemaNode ? [schemaNode] : [];
|
|
31298
31494
|
return { nodes: newNodes, consumed: 1 };
|
|
31299
31495
|
};
|
|
@@ -31301,6 +31497,203 @@ const drawingNodeHandlerEntity = {
|
|
|
31301
31497
|
handlerName: "drawingNodeHandler",
|
|
31302
31498
|
handler: handleDrawingNode
|
|
31303
31499
|
};
|
|
31500
|
+
const createTrackStyleMark = (marks) => {
|
|
31501
|
+
const trackStyleMark = marks.find((mark) => mark.type === "trackFormat");
|
|
31502
|
+
if (trackStyleMark) {
|
|
31503
|
+
return {
|
|
31504
|
+
type: "element",
|
|
31505
|
+
name: "w:rPrChange",
|
|
31506
|
+
attributes: {
|
|
31507
|
+
"w:id": trackStyleMark.attrs.id,
|
|
31508
|
+
"w:author": trackStyleMark.attrs.author,
|
|
31509
|
+
"w:authorEmail": trackStyleMark.attrs.authorEmail,
|
|
31510
|
+
"w:date": trackStyleMark.attrs.date
|
|
31511
|
+
},
|
|
31512
|
+
elements: trackStyleMark.attrs.before.map((mark) => processOutputMarks([mark])).filter((r) => r !== void 0)
|
|
31513
|
+
};
|
|
31514
|
+
}
|
|
31515
|
+
return void 0;
|
|
31516
|
+
};
|
|
31517
|
+
const XML_NODE_NAME$3 = "w:del";
|
|
31518
|
+
const SD_ATTR_KEY$1 = "trackDelete";
|
|
31519
|
+
const validXmlAttributes$3 = [
|
|
31520
|
+
createAttributeHandler("w:id", "id"),
|
|
31521
|
+
createAttributeHandler("w:date", "date"),
|
|
31522
|
+
createAttributeHandler("w:author", "author"),
|
|
31523
|
+
createAttributeHandler("w:authorEmail", "authorEmail")
|
|
31524
|
+
];
|
|
31525
|
+
const encode$3 = (params, encodedAttrs = {}) => {
|
|
31526
|
+
const { nodeListHandler, extraParams = {} } = params;
|
|
31527
|
+
const { node } = extraParams;
|
|
31528
|
+
const subs = nodeListHandler.handler({
|
|
31529
|
+
...params,
|
|
31530
|
+
insideTrackChange: true,
|
|
31531
|
+
nodes: node.elements,
|
|
31532
|
+
path: [...params.path || [], node]
|
|
31533
|
+
});
|
|
31534
|
+
encodedAttrs.importedAuthor = `${encodedAttrs.author} (imported)`;
|
|
31535
|
+
subs.forEach((subElement) => {
|
|
31536
|
+
if (subElement.marks === void 0) subElement.marks = [];
|
|
31537
|
+
subElement.marks.push({ type: "trackDelete", attrs: encodedAttrs });
|
|
31538
|
+
});
|
|
31539
|
+
return subs;
|
|
31540
|
+
};
|
|
31541
|
+
function decode$3(params) {
|
|
31542
|
+
const { node } = params;
|
|
31543
|
+
if (!node || !node.type) {
|
|
31544
|
+
return null;
|
|
31545
|
+
}
|
|
31546
|
+
const trackingMarks = ["trackInsert", "trackFormat", "trackDelete"];
|
|
31547
|
+
const marks = node.marks;
|
|
31548
|
+
const trackedMark = marks.find((m2) => m2.type === "trackDelete");
|
|
31549
|
+
const trackStyleMark = createTrackStyleMark(marks);
|
|
31550
|
+
node.marks = marks.filter((m2) => !trackingMarks.includes(m2.type));
|
|
31551
|
+
if (trackStyleMark) {
|
|
31552
|
+
node.marks.push(trackStyleMark);
|
|
31553
|
+
}
|
|
31554
|
+
const translatedTextNode = exportSchemaToJson({ ...params, node });
|
|
31555
|
+
const textNode = translatedTextNode.elements.find((n) => n.name === "w:t");
|
|
31556
|
+
textNode.name = "w:delText";
|
|
31557
|
+
return {
|
|
31558
|
+
name: "w:del",
|
|
31559
|
+
attributes: {
|
|
31560
|
+
"w:id": trackedMark.attrs.id,
|
|
31561
|
+
"w:author": trackedMark.attrs.author,
|
|
31562
|
+
"w:authorEmail": trackedMark.attrs.authorEmail,
|
|
31563
|
+
"w:date": trackedMark.attrs.date
|
|
31564
|
+
},
|
|
31565
|
+
elements: [translatedTextNode]
|
|
31566
|
+
};
|
|
31567
|
+
}
|
|
31568
|
+
const config$3 = {
|
|
31569
|
+
xmlName: XML_NODE_NAME$3,
|
|
31570
|
+
sdNodeOrKeyName: SD_ATTR_KEY$1,
|
|
31571
|
+
type: NodeTranslator.translatorTypes.ATTRIBUTE,
|
|
31572
|
+
encode: encode$3,
|
|
31573
|
+
decode: decode$3,
|
|
31574
|
+
attributes: validXmlAttributes$3
|
|
31575
|
+
};
|
|
31576
|
+
const translator$3 = NodeTranslator.from(config$3);
|
|
31577
|
+
const XML_NODE_NAME$2 = "w:ins";
|
|
31578
|
+
const SD_ATTR_KEY = "trackInsert";
|
|
31579
|
+
const validXmlAttributes$2 = [
|
|
31580
|
+
createAttributeHandler("w:id", "id"),
|
|
31581
|
+
createAttributeHandler("w:date", "date"),
|
|
31582
|
+
createAttributeHandler("w:author", "author"),
|
|
31583
|
+
createAttributeHandler("w:authorEmail", "authorEmail")
|
|
31584
|
+
];
|
|
31585
|
+
const encode$2 = (params, encodedAttrs = {}) => {
|
|
31586
|
+
const { nodeListHandler, extraParams = {} } = params;
|
|
31587
|
+
const { node } = extraParams;
|
|
31588
|
+
const subs = nodeListHandler.handler({
|
|
31589
|
+
...params,
|
|
31590
|
+
insideTrackChange: true,
|
|
31591
|
+
nodes: node.elements,
|
|
31592
|
+
path: [...params.path || [], node]
|
|
31593
|
+
});
|
|
31594
|
+
encodedAttrs.importedAuthor = `${encodedAttrs.author} (imported)`;
|
|
31595
|
+
subs.forEach((subElement) => {
|
|
31596
|
+
if (subElement.marks === void 0) subElement.marks = [];
|
|
31597
|
+
subElement.marks.push({ type: "trackInsert", attrs: encodedAttrs });
|
|
31598
|
+
});
|
|
31599
|
+
return subs;
|
|
31600
|
+
};
|
|
31601
|
+
function decode$2(params) {
|
|
31602
|
+
const { node } = params;
|
|
31603
|
+
if (!node || !node.type) {
|
|
31604
|
+
return null;
|
|
31605
|
+
}
|
|
31606
|
+
const trackingMarks = ["trackInsert", "trackFormat", "trackDelete"];
|
|
31607
|
+
const marks = node.marks;
|
|
31608
|
+
const trackedMark = marks.find((m2) => m2.type === "trackInsert");
|
|
31609
|
+
const trackStyleMark = createTrackStyleMark(marks);
|
|
31610
|
+
node.marks = marks.filter((m2) => !trackingMarks.includes(m2.type));
|
|
31611
|
+
if (trackStyleMark) {
|
|
31612
|
+
node.marks.push(trackStyleMark);
|
|
31613
|
+
}
|
|
31614
|
+
const translatedTextNode = exportSchemaToJson({ ...params, node });
|
|
31615
|
+
return {
|
|
31616
|
+
name: "w:ins",
|
|
31617
|
+
attributes: {
|
|
31618
|
+
"w:id": trackedMark.attrs.id,
|
|
31619
|
+
"w:author": trackedMark.attrs.author,
|
|
31620
|
+
"w:authorEmail": trackedMark.attrs.authorEmail,
|
|
31621
|
+
"w:date": trackedMark.attrs.date
|
|
31622
|
+
},
|
|
31623
|
+
elements: [translatedTextNode]
|
|
31624
|
+
};
|
|
31625
|
+
}
|
|
31626
|
+
const config$2 = {
|
|
31627
|
+
xmlName: XML_NODE_NAME$2,
|
|
31628
|
+
sdNodeOrKeyName: SD_ATTR_KEY,
|
|
31629
|
+
type: NodeTranslator.translatorTypes.ATTRIBUTE,
|
|
31630
|
+
encode: encode$2,
|
|
31631
|
+
decode: decode$2,
|
|
31632
|
+
attributes: validXmlAttributes$2
|
|
31633
|
+
};
|
|
31634
|
+
const translator$2 = NodeTranslator.from(config$2);
|
|
31635
|
+
const isTrackChangeElement = (node) => node?.name === "w:del" || node?.name === "w:ins";
|
|
31636
|
+
const unwrapTrackChangeNode = (node) => {
|
|
31637
|
+
if (!node) {
|
|
31638
|
+
return null;
|
|
31639
|
+
}
|
|
31640
|
+
if (isTrackChangeElement(node)) {
|
|
31641
|
+
return node;
|
|
31642
|
+
}
|
|
31643
|
+
if (node.name === "w:sdt") {
|
|
31644
|
+
const content = node.elements?.find((element) => element.name === "w:sdtContent");
|
|
31645
|
+
if (!content?.elements?.length) {
|
|
31646
|
+
return null;
|
|
31647
|
+
}
|
|
31648
|
+
for (const child of content.elements) {
|
|
31649
|
+
const trackChange = unwrapTrackChangeNode(child);
|
|
31650
|
+
if (trackChange) {
|
|
31651
|
+
return trackChange;
|
|
31652
|
+
}
|
|
31653
|
+
}
|
|
31654
|
+
}
|
|
31655
|
+
return null;
|
|
31656
|
+
};
|
|
31657
|
+
const handleTrackChangeNode = (params) => {
|
|
31658
|
+
const { nodes } = params;
|
|
31659
|
+
if (nodes.length === 0) {
|
|
31660
|
+
return { nodes: [], consumed: 0 };
|
|
31661
|
+
}
|
|
31662
|
+
const mainNode = unwrapTrackChangeNode(nodes[0]);
|
|
31663
|
+
if (!mainNode) {
|
|
31664
|
+
return { nodes: [], consumed: 0 };
|
|
31665
|
+
}
|
|
31666
|
+
let result;
|
|
31667
|
+
const translatorParams = {
|
|
31668
|
+
...params,
|
|
31669
|
+
nodes: [mainNode]
|
|
31670
|
+
};
|
|
31671
|
+
switch (mainNode.name) {
|
|
31672
|
+
case "w:del":
|
|
31673
|
+
result = translator$3.encode({
|
|
31674
|
+
extraParams: {
|
|
31675
|
+
node: mainNode
|
|
31676
|
+
},
|
|
31677
|
+
...translatorParams
|
|
31678
|
+
});
|
|
31679
|
+
break;
|
|
31680
|
+
case "w:ins":
|
|
31681
|
+
result = translator$2.encode({
|
|
31682
|
+
extraParams: {
|
|
31683
|
+
node: mainNode
|
|
31684
|
+
},
|
|
31685
|
+
...translatorParams
|
|
31686
|
+
});
|
|
31687
|
+
break;
|
|
31688
|
+
}
|
|
31689
|
+
return { nodes: result, consumed: 1 };
|
|
31690
|
+
};
|
|
31691
|
+
const trackChangeNodeHandlerEntity = {
|
|
31692
|
+
handlerName: "trackChangeNodeHandler",
|
|
31693
|
+
handler: handleTrackChangeNode
|
|
31694
|
+
};
|
|
31695
|
+
const hyperlinkNodeHandlerEntity = generateV2HandlerEntity("hyperlinkNodeHandler", translator$Z);
|
|
31696
|
+
const runNodeHandlerEntity = generateV2HandlerEntity("runNodeHandler", translator$Y);
|
|
31304
31697
|
function parseProperties(node) {
|
|
31305
31698
|
const marks = [];
|
|
31306
31699
|
const unknownMarks = [];
|
|
@@ -31352,51 +31745,6 @@ function getElementName(element) {
|
|
|
31352
31745
|
const isPropertiesElement = (element) => {
|
|
31353
31746
|
return !!SuperConverter.propertyTypes[element.name || element.type];
|
|
31354
31747
|
};
|
|
31355
|
-
const handleTrackChangeNode = (params) => {
|
|
31356
|
-
const { nodes, nodeListHandler } = params;
|
|
31357
|
-
if (nodes.length === 0 || !(nodes[0].name === "w:del" || nodes[0].name === "w:ins" || nodes[0].name === "w:sdt")) {
|
|
31358
|
-
return { nodes: [], consumed: 0 };
|
|
31359
|
-
}
|
|
31360
|
-
const mainNode = nodes[0];
|
|
31361
|
-
let node;
|
|
31362
|
-
if (["w:ins", "w:del"].includes(mainNode.name)) {
|
|
31363
|
-
node = mainNode;
|
|
31364
|
-
} else {
|
|
31365
|
-
const sdtContent = mainNode.elements.find((el) => el.name === "w:sdtContent");
|
|
31366
|
-
const trackedChange = sdtContent?.elements.find((el) => ["w:ins", "w:del"].includes(el.name));
|
|
31367
|
-
if (trackedChange) node = trackedChange;
|
|
31368
|
-
}
|
|
31369
|
-
if (!node) {
|
|
31370
|
-
return { nodes: [], consumed: 0 };
|
|
31371
|
-
}
|
|
31372
|
-
const { name } = node;
|
|
31373
|
-
const { attributes, elements } = parseProperties(node);
|
|
31374
|
-
const subs = nodeListHandler.handler({
|
|
31375
|
-
...params,
|
|
31376
|
-
insideTrackChange: true,
|
|
31377
|
-
nodes: elements,
|
|
31378
|
-
path: [...params.path || [], node]
|
|
31379
|
-
});
|
|
31380
|
-
const changeType = name === "w:del" ? TrackDeleteMarkName : TrackInsertMarkName;
|
|
31381
|
-
const mappedAttributes = {
|
|
31382
|
-
id: attributes["w:id"],
|
|
31383
|
-
date: attributes["w:date"],
|
|
31384
|
-
author: attributes["w:author"],
|
|
31385
|
-
authorEmail: attributes["w:authorEmail"],
|
|
31386
|
-
importedAuthor: `${attributes["w:author"]} (imported)`
|
|
31387
|
-
};
|
|
31388
|
-
subs.forEach((subElement) => {
|
|
31389
|
-
if (subElement.marks === void 0) subElement.marks = [];
|
|
31390
|
-
subElement.marks.push({ type: changeType, attrs: mappedAttributes });
|
|
31391
|
-
});
|
|
31392
|
-
return { nodes: subs, consumed: 1 };
|
|
31393
|
-
};
|
|
31394
|
-
const trackChangeNodeHandlerEntity = {
|
|
31395
|
-
handlerName: "trackChangeNodeHandler",
|
|
31396
|
-
handler: handleTrackChangeNode
|
|
31397
|
-
};
|
|
31398
|
-
const hyperlinkNodeHandlerEntity = generateV2HandlerEntity("hyperlinkNodeHandler", translator$X);
|
|
31399
|
-
const runNodeHandlerEntity = generateV2HandlerEntity("runNodeHandler", translator$W);
|
|
31400
31748
|
const handleTextNode = (params) => {
|
|
31401
31749
|
const { nodes, insideTrackChange } = params;
|
|
31402
31750
|
if (nodes.length === 0 || !(nodes[0].name === "w:t" || insideTrackChange && nodes[0].name === "w:delText")) {
|
|
@@ -31437,7 +31785,7 @@ const handleParagraphNode = (params) => {
|
|
|
31437
31785
|
if (nodes.length === 0 || nodes[0].name !== "w:p") {
|
|
31438
31786
|
return { nodes: [], consumed: 0 };
|
|
31439
31787
|
}
|
|
31440
|
-
const schemaNode = translator$
|
|
31788
|
+
const schemaNode = translator$19.encode(params);
|
|
31441
31789
|
const newNodes = schemaNode ? [schemaNode] : [];
|
|
31442
31790
|
return { nodes: newNodes, consumed: 1 };
|
|
31443
31791
|
};
|
|
@@ -31450,7 +31798,7 @@ const handleSdtNode = (params) => {
|
|
|
31450
31798
|
if (nodes.length === 0 || nodes[0].name !== "w:sdt") {
|
|
31451
31799
|
return { nodes: [], consumed: 0 };
|
|
31452
31800
|
}
|
|
31453
|
-
const result = translator$
|
|
31801
|
+
const result = translator$8.encode(params);
|
|
31454
31802
|
if (!result) {
|
|
31455
31803
|
return { nodes: [], consumed: 0 };
|
|
31456
31804
|
}
|
|
@@ -31540,7 +31888,7 @@ const handler = (params) => {
|
|
|
31540
31888
|
if (nodes.length === 0 || nodes[0].name !== "w:br") {
|
|
31541
31889
|
return { nodes: [], consumed: 0 };
|
|
31542
31890
|
}
|
|
31543
|
-
const result = translator$
|
|
31891
|
+
const result = translator$1c.encode(params);
|
|
31544
31892
|
if (!result) return { nodes: [], consumed: 0 };
|
|
31545
31893
|
return {
|
|
31546
31894
|
nodes: [result],
|
|
@@ -31612,7 +31960,7 @@ const handleBookmarkStartNode = (params) => {
|
|
|
31612
31960
|
if (isCustomMarkBookmark(nodes[0], params.editor)) {
|
|
31613
31961
|
return handleBookmarkNode(params);
|
|
31614
31962
|
}
|
|
31615
|
-
const node = translator$
|
|
31963
|
+
const node = translator$7.encode(params);
|
|
31616
31964
|
if (!node) return { nodes: [], consumed: 0 };
|
|
31617
31965
|
return { nodes: [node], consumed: 1 };
|
|
31618
31966
|
};
|
|
@@ -31644,7 +31992,7 @@ const handleBookmarkEndNode = (params) => {
|
|
|
31644
31992
|
if (!nodes.length || nodes[0].name !== "w:bookmarkEnd") {
|
|
31645
31993
|
return { nodes: [], consumed: 0 };
|
|
31646
31994
|
}
|
|
31647
|
-
const node = translator$
|
|
31995
|
+
const node = translator$6.encode(params);
|
|
31648
31996
|
if (!node) return { nodes: [], consumed: 0 };
|
|
31649
31997
|
return { nodes: [node], consumed: 1 };
|
|
31650
31998
|
};
|
|
@@ -31777,7 +32125,7 @@ const autoTotalPageCountEntity = {
|
|
|
31777
32125
|
handlerName: "autoTotalPageCountEntity",
|
|
31778
32126
|
handler: handleAutoTotalPageNumber
|
|
31779
32127
|
};
|
|
31780
|
-
const pageReferenceEntity = generateV2HandlerEntity("pageReferenceNodeHandler", translator$
|
|
32128
|
+
const pageReferenceEntity = generateV2HandlerEntity("pageReferenceNodeHandler", translator$5);
|
|
31781
32129
|
const handlePictNode = (params) => {
|
|
31782
32130
|
const { nodes } = params;
|
|
31783
32131
|
if (!nodes.length || nodes[0].name !== "w:p") {
|
|
@@ -32166,14 +32514,14 @@ const handleTabNode = (params) => {
|
|
|
32166
32514
|
if (!nodes.length || nodes[0].name !== "w:tab") {
|
|
32167
32515
|
return { nodes: [], consumed: 0 };
|
|
32168
32516
|
}
|
|
32169
|
-
const node = translator$
|
|
32517
|
+
const node = translator$1a.encode(params);
|
|
32170
32518
|
return { nodes: [node], consumed: 1 };
|
|
32171
32519
|
};
|
|
32172
32520
|
const tabNodeEntityHandler = {
|
|
32173
32521
|
handlerName: "w:tabTranslator",
|
|
32174
32522
|
handler: handleTabNode
|
|
32175
32523
|
};
|
|
32176
|
-
const tableOfContentsHandlerEntity = generateV2HandlerEntity("tableOfContentsHandler", translator$
|
|
32524
|
+
const tableOfContentsHandlerEntity = generateV2HandlerEntity("tableOfContentsHandler", translator$4);
|
|
32177
32525
|
function preProcessPageInstruction(nodesToCombine) {
|
|
32178
32526
|
const pageNumNode = {
|
|
32179
32527
|
name: "sd:autoPageNumber",
|
|
@@ -33222,35 +33570,35 @@ function exportSchemaToJson(params) {
|
|
|
33222
33570
|
doc: translateDocumentNode,
|
|
33223
33571
|
body: translateBodyNode,
|
|
33224
33572
|
heading: translateHeadingNode,
|
|
33225
|
-
paragraph: translator$
|
|
33226
|
-
run: translator$
|
|
33573
|
+
paragraph: translator$19,
|
|
33574
|
+
run: translator$Y,
|
|
33227
33575
|
text: translateTextNode,
|
|
33228
33576
|
bulletList: translateList,
|
|
33229
33577
|
orderedList: translateList,
|
|
33230
|
-
lineBreak: translator$
|
|
33231
|
-
table: translator$
|
|
33232
|
-
tableRow: translator$
|
|
33233
|
-
tableCell: translator$
|
|
33234
|
-
bookmarkStart: translator$
|
|
33235
|
-
bookmarkEnd: translator$
|
|
33236
|
-
fieldAnnotation: translator$
|
|
33237
|
-
tab: translator$
|
|
33238
|
-
image: translator$
|
|
33239
|
-
hardBreak: translator$
|
|
33578
|
+
lineBreak: translator$1c,
|
|
33579
|
+
table: translator$d,
|
|
33580
|
+
tableRow: translator$K,
|
|
33581
|
+
tableCell: translator$c,
|
|
33582
|
+
bookmarkStart: translator$7,
|
|
33583
|
+
bookmarkEnd: translator$6,
|
|
33584
|
+
fieldAnnotation: translator$8,
|
|
33585
|
+
tab: translator$1a,
|
|
33586
|
+
image: translator$9,
|
|
33587
|
+
hardBreak: translator$1c,
|
|
33240
33588
|
commentRangeStart: commentRangeStartTranslator,
|
|
33241
33589
|
commentRangeEnd: commentRangeEndTranslator,
|
|
33242
33590
|
commentReference: () => null,
|
|
33243
33591
|
shapeContainer: translator,
|
|
33244
33592
|
shapeTextbox: translator,
|
|
33245
33593
|
contentBlock: translator,
|
|
33246
|
-
structuredContent: translator$
|
|
33247
|
-
structuredContentBlock: translator$
|
|
33248
|
-
documentPartObject: translator$
|
|
33249
|
-
documentSection: translator$
|
|
33594
|
+
structuredContent: translator$8,
|
|
33595
|
+
structuredContentBlock: translator$8,
|
|
33596
|
+
documentPartObject: translator$8,
|
|
33597
|
+
documentSection: translator$8,
|
|
33250
33598
|
"page-number": translatePageNumberNode,
|
|
33251
33599
|
"total-page-number": translateTotalPageNumberNode,
|
|
33252
|
-
pageReference: translator$
|
|
33253
|
-
tableOfContents: translator$
|
|
33600
|
+
pageReference: translator$5,
|
|
33601
|
+
tableOfContents: translator$4
|
|
33254
33602
|
};
|
|
33255
33603
|
let handler2 = router[type2];
|
|
33256
33604
|
if (handler2 && "decode" in handler2 && typeof handler2.decode === "function") {
|
|
@@ -33586,62 +33934,22 @@ function getTextNodeForExport(text, marks, params) {
|
|
|
33586
33934
|
function translateTextNode(params) {
|
|
33587
33935
|
const { node, extraParams } = params;
|
|
33588
33936
|
const trackedMarks = [TrackInsertMarkName, TrackDeleteMarkName];
|
|
33589
|
-
const
|
|
33590
|
-
if (
|
|
33937
|
+
const trackedMark = node.marks?.find((m2) => trackedMarks.includes(m2.type));
|
|
33938
|
+
if (trackedMark) {
|
|
33939
|
+
switch (trackedMark.type) {
|
|
33940
|
+
case "trackDelete":
|
|
33941
|
+
return translator$3.decode(params);
|
|
33942
|
+
case "trackInsert":
|
|
33943
|
+
return translator$2.decode(params);
|
|
33944
|
+
}
|
|
33945
|
+
}
|
|
33591
33946
|
const isLinkNode = node.marks?.some((m2) => m2.type === "link");
|
|
33592
33947
|
if (isLinkNode && !extraParams?.linkProcessed) {
|
|
33593
|
-
return translator$
|
|
33948
|
+
return translator$Z.decode(params);
|
|
33594
33949
|
}
|
|
33595
33950
|
const { text, marks = [] } = node;
|
|
33596
33951
|
return getTextNodeForExport(text, marks, params);
|
|
33597
33952
|
}
|
|
33598
|
-
function createTrackStyleMark(marks) {
|
|
33599
|
-
const trackStyleMark = marks.find((mark) => mark.type === TrackFormatMarkName);
|
|
33600
|
-
if (trackStyleMark) {
|
|
33601
|
-
const markElement = {
|
|
33602
|
-
type: "element",
|
|
33603
|
-
name: "w:rPrChange",
|
|
33604
|
-
attributes: {
|
|
33605
|
-
"w:id": trackStyleMark.attrs.id,
|
|
33606
|
-
"w:author": trackStyleMark.attrs.author,
|
|
33607
|
-
"w:authorEmail": trackStyleMark.attrs.authorEmail,
|
|
33608
|
-
"w:date": trackStyleMark.attrs.date
|
|
33609
|
-
},
|
|
33610
|
-
elements: trackStyleMark.attrs.before.map((mark) => processOutputMarks([mark])).filter((r) => r !== void 0)
|
|
33611
|
-
};
|
|
33612
|
-
return markElement;
|
|
33613
|
-
}
|
|
33614
|
-
return void 0;
|
|
33615
|
-
}
|
|
33616
|
-
function translateTrackedNode(params) {
|
|
33617
|
-
const { node } = params;
|
|
33618
|
-
const marks = node.marks;
|
|
33619
|
-
const trackingMarks = [TrackInsertMarkName, TrackDeleteMarkName, TrackFormatMarkName];
|
|
33620
|
-
const trackedMark = marks.find((m2) => trackingMarks.includes(m2.type));
|
|
33621
|
-
const isInsert = trackedMark.type === TrackInsertMarkName;
|
|
33622
|
-
const trackStyleMark = createTrackStyleMark(marks);
|
|
33623
|
-
node.marks = marks.filter((m2) => !trackingMarks.includes(m2.type));
|
|
33624
|
-
if (trackStyleMark) {
|
|
33625
|
-
node.marks.push(trackStyleMark);
|
|
33626
|
-
}
|
|
33627
|
-
const translatedTextNode = exportSchemaToJson({ ...params, node });
|
|
33628
|
-
if (!isInsert) {
|
|
33629
|
-
const textNode = translatedTextNode.elements.find((n) => n.name === "w:t");
|
|
33630
|
-
textNode.name = "w:delText";
|
|
33631
|
-
}
|
|
33632
|
-
const trackedNode = {
|
|
33633
|
-
name: isInsert ? "w:ins" : "w:del",
|
|
33634
|
-
type: "element",
|
|
33635
|
-
attributes: {
|
|
33636
|
-
"w:id": trackedMark.attrs.id,
|
|
33637
|
-
"w:author": trackedMark.attrs.author,
|
|
33638
|
-
"w:authorEmail": trackedMark.attrs.authorEmail,
|
|
33639
|
-
"w:date": trackedMark.attrs.date
|
|
33640
|
-
},
|
|
33641
|
-
elements: [translatedTextNode]
|
|
33642
|
-
};
|
|
33643
|
-
return trackedNode;
|
|
33644
|
-
}
|
|
33645
33953
|
function wrapTextInRun(nodeOrNodes, marks) {
|
|
33646
33954
|
let elements = [];
|
|
33647
33955
|
if (Array.isArray(nodeOrNodes)) elements = nodeOrNodes;
|
|
@@ -33897,7 +34205,7 @@ function translateMark(mark) {
|
|
|
33897
34205
|
markElement.type = "element";
|
|
33898
34206
|
break;
|
|
33899
34207
|
case "underline": {
|
|
33900
|
-
const translated = translator$
|
|
34208
|
+
const translated = translator$16.decode({
|
|
33901
34209
|
node: {
|
|
33902
34210
|
attrs: {
|
|
33903
34211
|
underlineType: attrs.underlineType ?? attrs.underline ?? null,
|
|
@@ -33961,7 +34269,7 @@ function translateMark(mark) {
|
|
|
33961
34269
|
break;
|
|
33962
34270
|
case "highlight": {
|
|
33963
34271
|
const highlightValue = attrs.color ?? attrs.highlight ?? null;
|
|
33964
|
-
const translated = translator$
|
|
34272
|
+
const translated = translator$1b.decode({ node: { attrs: { highlight: highlightValue } } });
|
|
33965
34273
|
return translated || {};
|
|
33966
34274
|
}
|
|
33967
34275
|
case "link":
|
|
@@ -35095,7 +35403,7 @@ export {
|
|
|
35095
35403
|
objectIncludes as Z,
|
|
35096
35404
|
AddMarkStep as _,
|
|
35097
35405
|
Plugin as a,
|
|
35098
|
-
translator$
|
|
35406
|
+
translator$E as a$,
|
|
35099
35407
|
twipsToLines as a0,
|
|
35100
35408
|
pixelsToTwips as a1,
|
|
35101
35409
|
helpers as a2,
|
|
@@ -35106,33 +35414,33 @@ export {
|
|
|
35106
35414
|
createDocFromMarkdown as a7,
|
|
35107
35415
|
createDocFromHTML as a8,
|
|
35108
35416
|
EditorState as a9,
|
|
35109
|
-
|
|
35110
|
-
|
|
35111
|
-
|
|
35112
|
-
|
|
35113
|
-
|
|
35114
|
-
|
|
35115
|
-
|
|
35116
|
-
|
|
35117
|
-
|
|
35118
|
-
translator$
|
|
35119
|
-
translator$
|
|
35120
|
-
translator$
|
|
35121
|
-
translator$
|
|
35122
|
-
translator$
|
|
35123
|
-
translator$
|
|
35124
|
-
translator$
|
|
35125
|
-
translator$
|
|
35126
|
-
translator$
|
|
35127
|
-
translator$
|
|
35128
|
-
translator$
|
|
35129
|
-
translator$
|
|
35130
|
-
translator$
|
|
35131
|
-
translator$
|
|
35132
|
-
translator$
|
|
35133
|
-
translator$
|
|
35134
|
-
translator$
|
|
35135
|
-
translator$
|
|
35417
|
+
xmljs as aA,
|
|
35418
|
+
vClickOutside as aB,
|
|
35419
|
+
getActiveFormatting as aC,
|
|
35420
|
+
readFromClipboard as aD,
|
|
35421
|
+
handleClipboardPaste as aE,
|
|
35422
|
+
getFileObject as aF,
|
|
35423
|
+
runPropertyTranslators as aG,
|
|
35424
|
+
commentRangeEndTranslator as aH,
|
|
35425
|
+
commentRangeStartTranslator as aI,
|
|
35426
|
+
translator$a as aJ,
|
|
35427
|
+
translator$b as aK,
|
|
35428
|
+
translator$M as aL,
|
|
35429
|
+
translator$N as aM,
|
|
35430
|
+
translator$16 as aN,
|
|
35431
|
+
translator$L as aO,
|
|
35432
|
+
translator$O as aP,
|
|
35433
|
+
translator$K as aQ,
|
|
35434
|
+
translator$k as aR,
|
|
35435
|
+
translator$c as aS,
|
|
35436
|
+
translator$x as aT,
|
|
35437
|
+
translator$y as aU,
|
|
35438
|
+
translator$z as aV,
|
|
35439
|
+
translator$A as aW,
|
|
35440
|
+
translator$B as aX,
|
|
35441
|
+
translator$g as aY,
|
|
35442
|
+
translator$C as aZ,
|
|
35443
|
+
translator$D as a_,
|
|
35136
35444
|
hasSomeParentWithClass as aa,
|
|
35137
35445
|
isActive as ab,
|
|
35138
35446
|
unflattenListsInHtml as ac,
|
|
@@ -35155,59 +35463,60 @@ export {
|
|
|
35155
35463
|
isInTable as at,
|
|
35156
35464
|
generateDocxRandomId as au,
|
|
35157
35465
|
insertNewRelationship as av,
|
|
35158
|
-
|
|
35159
|
-
|
|
35160
|
-
|
|
35161
|
-
|
|
35466
|
+
inchesToPixels as aw,
|
|
35467
|
+
commonjsGlobal as ax,
|
|
35468
|
+
getDefaultExportFromCjs$2 as ay,
|
|
35469
|
+
getContentTypesFromXml as az,
|
|
35162
35470
|
Slice as b,
|
|
35163
|
-
translator$
|
|
35164
|
-
translator$
|
|
35165
|
-
translator$
|
|
35166
|
-
translator$
|
|
35167
|
-
translator$
|
|
35168
|
-
translator$
|
|
35169
|
-
translator$
|
|
35170
|
-
translator$
|
|
35171
|
-
translator$
|
|
35172
|
-
translator$
|
|
35173
|
-
translator$
|
|
35174
|
-
translator$
|
|
35175
|
-
translator$
|
|
35176
|
-
translator$
|
|
35177
|
-
translator$
|
|
35178
|
-
translator$
|
|
35179
|
-
translator$
|
|
35180
|
-
translator$
|
|
35181
|
-
translator$
|
|
35182
|
-
translator$
|
|
35183
|
-
translator$
|
|
35184
|
-
|
|
35185
|
-
|
|
35186
|
-
translator$
|
|
35187
|
-
translator$
|
|
35188
|
-
translator$
|
|
35189
|
-
translator$
|
|
35190
|
-
translator$
|
|
35191
|
-
translator$
|
|
35192
|
-
translator$
|
|
35193
|
-
translator$
|
|
35194
|
-
translator$
|
|
35195
|
-
translator$
|
|
35196
|
-
translator$
|
|
35197
|
-
translator$
|
|
35198
|
-
translator$
|
|
35199
|
-
translator$
|
|
35200
|
-
translator$
|
|
35201
|
-
translator$
|
|
35202
|
-
translator$
|
|
35203
|
-
translator$
|
|
35204
|
-
translator$
|
|
35205
|
-
translator$
|
|
35206
|
-
translator$
|
|
35207
|
-
translator$
|
|
35208
|
-
translator$
|
|
35209
|
-
translator$
|
|
35210
|
-
translator$
|
|
35471
|
+
translator$F as b0,
|
|
35472
|
+
translator$P as b1,
|
|
35473
|
+
translator$e as b2,
|
|
35474
|
+
translator$G as b3,
|
|
35475
|
+
translator$Q as b4,
|
|
35476
|
+
translator$h as b5,
|
|
35477
|
+
translator$H as b6,
|
|
35478
|
+
translator$i as b7,
|
|
35479
|
+
translator$d as b8,
|
|
35480
|
+
translator$1a as b9,
|
|
35481
|
+
translator$14 as bA,
|
|
35482
|
+
translator$W as bB,
|
|
35483
|
+
translator$X as bC,
|
|
35484
|
+
translator$1c as bD,
|
|
35485
|
+
translator$w as bE,
|
|
35486
|
+
translator$7 as bF,
|
|
35487
|
+
translator$6 as bG,
|
|
35488
|
+
translator$J as bH,
|
|
35489
|
+
translator$18 as bI,
|
|
35490
|
+
translator$4 as bJ,
|
|
35491
|
+
translator$5 as bK,
|
|
35492
|
+
translator$1 as bL,
|
|
35493
|
+
_sfc_main as bM,
|
|
35494
|
+
translator$10 as ba,
|
|
35495
|
+
translator$11 as bb,
|
|
35496
|
+
translator$15 as bc,
|
|
35497
|
+
translator$m as bd,
|
|
35498
|
+
translator$I as be,
|
|
35499
|
+
translator$8 as bf,
|
|
35500
|
+
translator$o as bg,
|
|
35501
|
+
translator$12 as bh,
|
|
35502
|
+
translator$_ as bi,
|
|
35503
|
+
translator$13 as bj,
|
|
35504
|
+
translator$Y as bk,
|
|
35505
|
+
translator$19 as bl,
|
|
35506
|
+
translator$q as bm,
|
|
35507
|
+
translator$R as bn,
|
|
35508
|
+
translator$r as bo,
|
|
35509
|
+
translator$s as bp,
|
|
35510
|
+
translator$17 as bq,
|
|
35511
|
+
translator$Z as br,
|
|
35512
|
+
translator$1b as bs,
|
|
35513
|
+
translator$S as bt,
|
|
35514
|
+
translator$f as bu,
|
|
35515
|
+
translator$T as bv,
|
|
35516
|
+
translator$U as bw,
|
|
35517
|
+
translator$u as bx,
|
|
35518
|
+
translator$9 as by,
|
|
35519
|
+
translator$V as bz,
|
|
35211
35520
|
DOMParser$1 as c,
|
|
35212
35521
|
Mark as d,
|
|
35213
35522
|
dropPoint as e,
|