@harbour-enterprises/superdoc 0.24.0-next.1 → 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-DbOqZXrQ.es.js → PdfViewer-DEWI6Uts.es.js} +1 -1
- package/dist/chunks/{PdfViewer-JCz8O4m9.cjs → PdfViewer-skWUtg2N.cjs} +1 -1
- package/dist/chunks/{index-BppAJo0E.cjs → index-2QL0aZ2S.cjs} +2 -2
- package/dist/chunks/{index-BRpb9ulj.es.js → index-C_AMhrHP.es.js} +2 -2
- package/dist/chunks/{super-editor.es-B6zt2zq-.cjs → super-editor.es-CfK_qBM9.cjs} +1496 -897
- package/dist/chunks/{super-editor.es-BkjovEJQ.es.js → super-editor.es-iMAoOYOw.es.js} +1496 -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-CTR0TlK4.js → converter-BueCftlx.js} +1179 -858
- package/dist/super-editor/chunks/{docx-zipper-DUHu_gKU.js → docx-zipper-C9jmfWYZ.js} +1 -1
- package/dist/super-editor/chunks/{editor-uVrxFmWV.js → editor-BsuNqVvp.js} +332 -53
- package/dist/super-editor/chunks/{toolbar-CotoiG3_.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/exporter.d.ts +5 -0
- 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 +1496 -897
- package/dist/superdoc.umd.js.map +1 -1
- package/package.json +1 -1
|
@@ -15090,14 +15090,21 @@ function twipsToInches(twips) {
|
|
|
15090
15090
|
function twipsToPixels(twips) {
|
|
15091
15091
|
if (twips == null) return;
|
|
15092
15092
|
const inches = twipsToInches(twips);
|
|
15093
|
+
return inchesToPixels(inches);
|
|
15094
|
+
}
|
|
15095
|
+
function pixelsToTwips(pixels) {
|
|
15096
|
+
const inches = pixelsToInches(pixels);
|
|
15097
|
+
return inchesToTwips(inches);
|
|
15098
|
+
}
|
|
15099
|
+
function inchesToPixels(inches) {
|
|
15093
15100
|
if (inches == null) return;
|
|
15094
15101
|
const pixels = inches * 96;
|
|
15095
15102
|
return Math.round(pixels * 1e3) / 1e3;
|
|
15096
15103
|
}
|
|
15097
|
-
function
|
|
15104
|
+
function pixelsToInches(pixels) {
|
|
15098
15105
|
if (pixels == null) return;
|
|
15099
15106
|
const inches = Number(pixels) / 96;
|
|
15100
|
-
return
|
|
15107
|
+
return inches;
|
|
15101
15108
|
}
|
|
15102
15109
|
function twipsToLines(twips) {
|
|
15103
15110
|
if (twips == null) return;
|
|
@@ -15148,6 +15155,71 @@ function degreesToRot(degrees) {
|
|
|
15148
15155
|
if (degrees == null) return;
|
|
15149
15156
|
return degrees * 6e4;
|
|
15150
15157
|
}
|
|
15158
|
+
function pixelsToPolygonUnits(pixels) {
|
|
15159
|
+
if (pixels == null) return;
|
|
15160
|
+
const pu = pixels * 96;
|
|
15161
|
+
return Math.round(pu);
|
|
15162
|
+
}
|
|
15163
|
+
function polygonUnitsToPixels(pu) {
|
|
15164
|
+
if (pu == null) return;
|
|
15165
|
+
const pixels = Number(pu) / 96;
|
|
15166
|
+
return Math.round(pixels * 1e3) / 1e3;
|
|
15167
|
+
}
|
|
15168
|
+
function polygonToObj(polygonNode) {
|
|
15169
|
+
if (!polygonNode) return null;
|
|
15170
|
+
const points = [];
|
|
15171
|
+
polygonNode.elements.forEach((element) => {
|
|
15172
|
+
if (["wp:start", "wp:lineTo"].includes(element.name)) {
|
|
15173
|
+
const { x, y: y2 } = element.attributes;
|
|
15174
|
+
points.push([polygonUnitsToPixels(x), polygonUnitsToPixels(y2)]);
|
|
15175
|
+
}
|
|
15176
|
+
});
|
|
15177
|
+
if (points.length > 1) {
|
|
15178
|
+
const firstPoint = points[0];
|
|
15179
|
+
const lastPoint = points[points.length - 1];
|
|
15180
|
+
if (firstPoint[0] === lastPoint[0] && firstPoint[1] === lastPoint[1]) {
|
|
15181
|
+
points.pop();
|
|
15182
|
+
}
|
|
15183
|
+
}
|
|
15184
|
+
return points;
|
|
15185
|
+
}
|
|
15186
|
+
function objToPolygon(points) {
|
|
15187
|
+
if (!points || !Array.isArray(points)) return null;
|
|
15188
|
+
const polygonNode = {
|
|
15189
|
+
name: "wp:wrapPolygon",
|
|
15190
|
+
type: "wp:wrapPolygon",
|
|
15191
|
+
attributes: {
|
|
15192
|
+
edited: "0"
|
|
15193
|
+
},
|
|
15194
|
+
elements: []
|
|
15195
|
+
};
|
|
15196
|
+
points.forEach((point, index2) => {
|
|
15197
|
+
const [x, y2] = point;
|
|
15198
|
+
const tagName = index2 === 0 ? "wp:start" : "wp:lineTo";
|
|
15199
|
+
const pointNode = {
|
|
15200
|
+
name: tagName,
|
|
15201
|
+
type: tagName,
|
|
15202
|
+
attributes: {
|
|
15203
|
+
x: pixelsToPolygonUnits(x),
|
|
15204
|
+
y: pixelsToPolygonUnits(y2)
|
|
15205
|
+
}
|
|
15206
|
+
};
|
|
15207
|
+
polygonNode.elements.push(pointNode);
|
|
15208
|
+
});
|
|
15209
|
+
if (points.length > 0) {
|
|
15210
|
+
const [startX, startY] = points[0];
|
|
15211
|
+
const closePointNode = {
|
|
15212
|
+
name: "wp:lineTo",
|
|
15213
|
+
type: "wp:lineTo",
|
|
15214
|
+
attributes: {
|
|
15215
|
+
x: pixelsToPolygonUnits(startX),
|
|
15216
|
+
y: pixelsToPolygonUnits(startY)
|
|
15217
|
+
}
|
|
15218
|
+
};
|
|
15219
|
+
polygonNode.elements.push(closePointNode);
|
|
15220
|
+
}
|
|
15221
|
+
return polygonNode;
|
|
15222
|
+
}
|
|
15151
15223
|
const getTextIndentExportValue = (indent) => {
|
|
15152
15224
|
const [value, unit] = parseSizeUnit(indent);
|
|
15153
15225
|
const functionsMap = {
|
|
@@ -24463,37 +24535,37 @@ const _NodeTranslator = class _NodeTranslator2 {
|
|
|
24463
24535
|
};
|
|
24464
24536
|
__publicField$2(_NodeTranslator, "translatorTypes", TranslatorTypes);
|
|
24465
24537
|
let NodeTranslator = _NodeTranslator;
|
|
24466
|
-
const encode$
|
|
24538
|
+
const encode$1e = (attributes) => {
|
|
24467
24539
|
return attributes["w:type"];
|
|
24468
24540
|
};
|
|
24469
|
-
const decode$
|
|
24541
|
+
const decode$16 = (attrs) => {
|
|
24470
24542
|
const { lineBreakType } = attrs;
|
|
24471
24543
|
return lineBreakType;
|
|
24472
24544
|
};
|
|
24473
24545
|
const attrConfig$G = Object.freeze({
|
|
24474
24546
|
xmlName: "w:type",
|
|
24475
24547
|
sdName: "lineBreakType",
|
|
24476
|
-
encode: encode$
|
|
24477
|
-
decode: decode$
|
|
24548
|
+
encode: encode$1e,
|
|
24549
|
+
decode: decode$16
|
|
24478
24550
|
});
|
|
24479
|
-
const encode$
|
|
24551
|
+
const encode$1d = (attributes) => {
|
|
24480
24552
|
const xmlAttrValue = attributes["w:clear"];
|
|
24481
24553
|
return xmlAttrValue;
|
|
24482
24554
|
};
|
|
24483
|
-
const decode$
|
|
24555
|
+
const decode$15 = (attrs) => {
|
|
24484
24556
|
const { clear } = attrs;
|
|
24485
24557
|
return clear;
|
|
24486
24558
|
};
|
|
24487
24559
|
const attrConfig$F = Object.freeze({
|
|
24488
24560
|
xmlName: "w:clear",
|
|
24489
24561
|
sdName: "clear",
|
|
24490
|
-
encode: encode$
|
|
24491
|
-
decode: decode$
|
|
24562
|
+
encode: encode$1d,
|
|
24563
|
+
decode: decode$15
|
|
24492
24564
|
});
|
|
24493
|
-
const validXmlAttributes$
|
|
24494
|
-
const XML_NODE_NAME$
|
|
24565
|
+
const validXmlAttributes$p = [attrConfig$G, attrConfig$F];
|
|
24566
|
+
const XML_NODE_NAME$B = "w:br";
|
|
24495
24567
|
const SD_NODE_NAME$h = "lineBreak";
|
|
24496
|
-
const encode$
|
|
24568
|
+
const encode$1c = (_2, encodedAttrs) => {
|
|
24497
24569
|
const isPageBreak = encodedAttrs?.lineBreakType === "page";
|
|
24498
24570
|
const translated = {
|
|
24499
24571
|
type: isPageBreak ? "hardBreak" : "lineBreak"
|
|
@@ -24503,7 +24575,7 @@ const encode$1a = (_2, encodedAttrs) => {
|
|
|
24503
24575
|
}
|
|
24504
24576
|
return translated;
|
|
24505
24577
|
};
|
|
24506
|
-
const decode$
|
|
24578
|
+
const decode$14 = (params2, decodedAttrs) => {
|
|
24507
24579
|
const { node } = params2;
|
|
24508
24580
|
if (!node) return;
|
|
24509
24581
|
const wBreak = { name: "w:br" };
|
|
@@ -24520,39 +24592,39 @@ const decode$12 = (params2, decodedAttrs) => {
|
|
|
24520
24592
|
};
|
|
24521
24593
|
return translated;
|
|
24522
24594
|
};
|
|
24523
|
-
const config$
|
|
24524
|
-
xmlName: XML_NODE_NAME$
|
|
24595
|
+
const config$y = {
|
|
24596
|
+
xmlName: XML_NODE_NAME$B,
|
|
24525
24597
|
sdNodeOrKeyName: SD_NODE_NAME$h,
|
|
24526
24598
|
type: NodeTranslator.translatorTypes.NODE,
|
|
24527
|
-
encode: encode$
|
|
24528
|
-
decode: decode$
|
|
24529
|
-
attributes: validXmlAttributes$
|
|
24599
|
+
encode: encode$1c,
|
|
24600
|
+
decode: decode$14,
|
|
24601
|
+
attributes: validXmlAttributes$p
|
|
24530
24602
|
};
|
|
24531
|
-
const translator$
|
|
24532
|
-
const encode$
|
|
24533
|
-
const decode$
|
|
24603
|
+
const translator$1c = NodeTranslator.from(config$y);
|
|
24604
|
+
const encode$1b = (attributes) => attributes?.["w:val"];
|
|
24605
|
+
const decode$13 = (attrs) => attrs?.highlight;
|
|
24534
24606
|
const attrConfig$E = Object.freeze({
|
|
24535
24607
|
xmlName: "w:val",
|
|
24536
24608
|
sdName: "highlight",
|
|
24537
|
-
encode: encode$
|
|
24538
|
-
decode: decode$
|
|
24609
|
+
encode: encode$1b,
|
|
24610
|
+
decode: decode$13
|
|
24539
24611
|
});
|
|
24540
|
-
const validXmlAttributes$
|
|
24541
|
-
const XML_NODE_NAME$
|
|
24542
|
-
const SD_ATTR_KEY$
|
|
24612
|
+
const validXmlAttributes$o = [attrConfig$E];
|
|
24613
|
+
const XML_NODE_NAME$A = "w:highlight";
|
|
24614
|
+
const SD_ATTR_KEY$i = "highlight";
|
|
24543
24615
|
const DISABLED_TOKENS = /* @__PURE__ */ new Set(["transparent", "none", "inherit"]);
|
|
24544
|
-
const encode$
|
|
24616
|
+
const encode$1a = (params2, encodedAttrs = {}) => {
|
|
24545
24617
|
const { nodes } = params2;
|
|
24546
24618
|
const node = nodes?.[0];
|
|
24547
24619
|
const value = encodedAttrs.highlight ?? node?.attributes?.["w:val"];
|
|
24548
24620
|
return {
|
|
24549
24621
|
type: "attr",
|
|
24550
|
-
xmlName: XML_NODE_NAME$
|
|
24551
|
-
sdNodeOrKeyName: SD_ATTR_KEY$
|
|
24622
|
+
xmlName: XML_NODE_NAME$A,
|
|
24623
|
+
sdNodeOrKeyName: SD_ATTR_KEY$i,
|
|
24552
24624
|
attributes: { "w:val": value ?? null }
|
|
24553
24625
|
};
|
|
24554
24626
|
};
|
|
24555
|
-
const decode$
|
|
24627
|
+
const decode$12 = (params2) => {
|
|
24556
24628
|
const attrs = params2?.node?.attrs || {};
|
|
24557
24629
|
const highlightValue = attrs.highlight ?? attrs.color ?? null;
|
|
24558
24630
|
if (!highlightValue) return void 0;
|
|
@@ -24560,14 +24632,14 @@ const decode$10 = (params2) => {
|
|
|
24560
24632
|
if (!normalizedValue) return void 0;
|
|
24561
24633
|
if (DISABLED_TOKENS.has(normalizedValue)) {
|
|
24562
24634
|
return {
|
|
24563
|
-
name: XML_NODE_NAME$
|
|
24635
|
+
name: XML_NODE_NAME$A,
|
|
24564
24636
|
attributes: { "w:val": "none" }
|
|
24565
24637
|
};
|
|
24566
24638
|
}
|
|
24567
24639
|
const keyword = getDocxHighlightKeywordFromHex(highlightValue);
|
|
24568
24640
|
if (keyword) {
|
|
24569
24641
|
return {
|
|
24570
|
-
name: XML_NODE_NAME$
|
|
24642
|
+
name: XML_NODE_NAME$A,
|
|
24571
24643
|
attributes: { "w:val": keyword }
|
|
24572
24644
|
};
|
|
24573
24645
|
}
|
|
@@ -24582,63 +24654,63 @@ const decode$10 = (params2) => {
|
|
|
24582
24654
|
}
|
|
24583
24655
|
};
|
|
24584
24656
|
};
|
|
24585
|
-
const config$
|
|
24586
|
-
xmlName: XML_NODE_NAME$
|
|
24587
|
-
sdNodeOrKeyName: SD_ATTR_KEY$
|
|
24657
|
+
const config$x = {
|
|
24658
|
+
xmlName: XML_NODE_NAME$A,
|
|
24659
|
+
sdNodeOrKeyName: SD_ATTR_KEY$i,
|
|
24588
24660
|
type: NodeTranslator.translatorTypes.ATTRIBUTE,
|
|
24589
|
-
encode: encode$
|
|
24590
|
-
decode: decode$
|
|
24591
|
-
attributes: validXmlAttributes$
|
|
24661
|
+
encode: encode$1a,
|
|
24662
|
+
decode: decode$12,
|
|
24663
|
+
attributes: validXmlAttributes$o
|
|
24592
24664
|
};
|
|
24593
|
-
const translator$
|
|
24594
|
-
const encode$
|
|
24665
|
+
const translator$1b = NodeTranslator.from(config$x);
|
|
24666
|
+
const encode$19 = (attributes) => {
|
|
24595
24667
|
return attributes["w:val"];
|
|
24596
24668
|
};
|
|
24597
|
-
const decode
|
|
24669
|
+
const decode$11 = (attrs) => {
|
|
24598
24670
|
const { tabSize } = attrs || {};
|
|
24599
24671
|
return tabSize;
|
|
24600
24672
|
};
|
|
24601
24673
|
const attrConfig$D = Object.freeze({
|
|
24602
24674
|
xmlName: "w:val",
|
|
24603
24675
|
sdName: "tabSize",
|
|
24604
|
-
encode: encode$
|
|
24605
|
-
decode: decode
|
|
24676
|
+
encode: encode$19,
|
|
24677
|
+
decode: decode$11
|
|
24606
24678
|
});
|
|
24607
|
-
const encode$
|
|
24679
|
+
const encode$18 = (attributes) => {
|
|
24608
24680
|
return attributes["w:leader"];
|
|
24609
24681
|
};
|
|
24610
|
-
const decode$
|
|
24682
|
+
const decode$10 = (attrs) => {
|
|
24611
24683
|
const { leader } = attrs || {};
|
|
24612
24684
|
return leader;
|
|
24613
24685
|
};
|
|
24614
24686
|
const attrConfig$C = Object.freeze({
|
|
24615
24687
|
xmlName: "w:leader",
|
|
24616
24688
|
sdName: "leader",
|
|
24617
|
-
encode: encode$
|
|
24618
|
-
decode: decode$
|
|
24689
|
+
encode: encode$18,
|
|
24690
|
+
decode: decode$10
|
|
24619
24691
|
});
|
|
24620
|
-
const encode$
|
|
24692
|
+
const encode$17 = (attributes) => {
|
|
24621
24693
|
return attributes["w:pos"];
|
|
24622
24694
|
};
|
|
24623
|
-
const decode
|
|
24695
|
+
const decode$$ = (attrs) => {
|
|
24624
24696
|
const { pos } = attrs || {};
|
|
24625
24697
|
return pos;
|
|
24626
24698
|
};
|
|
24627
24699
|
const attrConfig$B = Object.freeze({
|
|
24628
24700
|
xmlName: "w:pos",
|
|
24629
24701
|
sdName: "pos",
|
|
24630
|
-
encode: encode$
|
|
24631
|
-
decode: decode
|
|
24702
|
+
encode: encode$17,
|
|
24703
|
+
decode: decode$$
|
|
24632
24704
|
});
|
|
24633
|
-
const validXmlAttributes$
|
|
24634
|
-
const XML_NODE_NAME$
|
|
24705
|
+
const validXmlAttributes$n = [attrConfig$D, attrConfig$B, attrConfig$C];
|
|
24706
|
+
const XML_NODE_NAME$z = "w:tab";
|
|
24635
24707
|
const SD_NODE_NAME$g = "tab";
|
|
24636
|
-
const encode$
|
|
24708
|
+
const encode$16 = (_2, encodedAttrs = {}) => {
|
|
24637
24709
|
const translated = { type: "tab" };
|
|
24638
24710
|
if (encodedAttrs) translated.attrs = { ...encodedAttrs };
|
|
24639
24711
|
return translated;
|
|
24640
24712
|
};
|
|
24641
|
-
const decode$
|
|
24713
|
+
const decode$_ = (params2, decodedAttrs = {}) => {
|
|
24642
24714
|
const { node } = params2 || {};
|
|
24643
24715
|
if (!node) return;
|
|
24644
24716
|
const wTab = { name: "w:tab" };
|
|
@@ -24654,15 +24726,15 @@ const decode$Y = (params2, decodedAttrs = {}) => {
|
|
|
24654
24726
|
}
|
|
24655
24727
|
return translated;
|
|
24656
24728
|
};
|
|
24657
|
-
const config$
|
|
24658
|
-
xmlName: XML_NODE_NAME$
|
|
24729
|
+
const config$w = {
|
|
24730
|
+
xmlName: XML_NODE_NAME$z,
|
|
24659
24731
|
sdNodeOrKeyName: SD_NODE_NAME$g,
|
|
24660
24732
|
type: NodeTranslator.translatorTypes.NODE,
|
|
24661
|
-
encode: encode$
|
|
24662
|
-
decode: decode$
|
|
24663
|
-
attributes: validXmlAttributes$
|
|
24733
|
+
encode: encode$16,
|
|
24734
|
+
decode: decode$_,
|
|
24735
|
+
attributes: validXmlAttributes$n
|
|
24664
24736
|
};
|
|
24665
|
-
const translator$
|
|
24737
|
+
const translator$1a = NodeTranslator.from(config$w);
|
|
24666
24738
|
const mergeTextNodes = (nodes) => {
|
|
24667
24739
|
if (!nodes || !Array.isArray(nodes)) {
|
|
24668
24740
|
return nodes;
|
|
@@ -25180,91 +25252,91 @@ const handleParagraphNode$1 = (params2) => {
|
|
|
25180
25252
|
}
|
|
25181
25253
|
return schemaNode;
|
|
25182
25254
|
};
|
|
25183
|
-
const encode$
|
|
25255
|
+
const encode$15 = (attributes) => {
|
|
25184
25256
|
return attributes["w:rsidDel"];
|
|
25185
25257
|
};
|
|
25186
|
-
const decode$
|
|
25258
|
+
const decode$Z = (attrs) => {
|
|
25187
25259
|
return attrs.rsidDel;
|
|
25188
25260
|
};
|
|
25189
25261
|
const attrConfig$A = Object.freeze({
|
|
25190
25262
|
xmlName: "w:rsidDel",
|
|
25191
25263
|
sdName: "rsidDel",
|
|
25192
|
-
encode: encode$
|
|
25193
|
-
decode: decode$
|
|
25264
|
+
encode: encode$15,
|
|
25265
|
+
decode: decode$Z
|
|
25194
25266
|
});
|
|
25195
|
-
const encode$
|
|
25267
|
+
const encode$14 = (attributes) => {
|
|
25196
25268
|
return attributes["w:rsidP"];
|
|
25197
25269
|
};
|
|
25198
|
-
const decode$
|
|
25270
|
+
const decode$Y = (attrs) => {
|
|
25199
25271
|
return attrs.rsidP;
|
|
25200
25272
|
};
|
|
25201
25273
|
const attrConfig$z = Object.freeze({
|
|
25202
25274
|
xmlName: "w:rsidP",
|
|
25203
25275
|
sdName: "rsidP",
|
|
25204
|
-
encode: encode$
|
|
25205
|
-
decode: decode$
|
|
25276
|
+
encode: encode$14,
|
|
25277
|
+
decode: decode$Y
|
|
25206
25278
|
});
|
|
25207
|
-
const encode$
|
|
25279
|
+
const encode$13 = (attributes) => {
|
|
25208
25280
|
return attributes["w:rsidR"];
|
|
25209
25281
|
};
|
|
25210
|
-
const decode$
|
|
25282
|
+
const decode$X = (attrs) => {
|
|
25211
25283
|
return attrs.rsidR;
|
|
25212
25284
|
};
|
|
25213
25285
|
const attrConfig$y = Object.freeze({
|
|
25214
25286
|
xmlName: "w:rsidR",
|
|
25215
25287
|
sdName: "rsidR",
|
|
25216
|
-
encode: encode$
|
|
25217
|
-
decode: decode$
|
|
25288
|
+
encode: encode$13,
|
|
25289
|
+
decode: decode$X
|
|
25218
25290
|
});
|
|
25219
|
-
const encode$
|
|
25291
|
+
const encode$12 = (attributes) => {
|
|
25220
25292
|
return attributes["w:rsidRPr"];
|
|
25221
25293
|
};
|
|
25222
|
-
const decode$
|
|
25294
|
+
const decode$W = (attrs) => {
|
|
25223
25295
|
return attrs.rsidRPr;
|
|
25224
25296
|
};
|
|
25225
25297
|
const attrConfig$x = Object.freeze({
|
|
25226
25298
|
xmlName: "w:rsidRPr",
|
|
25227
25299
|
sdName: "rsidRPr",
|
|
25228
|
-
encode: encode$
|
|
25229
|
-
decode: decode$
|
|
25300
|
+
encode: encode$12,
|
|
25301
|
+
decode: decode$W
|
|
25230
25302
|
});
|
|
25231
|
-
const encode
|
|
25303
|
+
const encode$11 = (attributes) => {
|
|
25232
25304
|
return attributes["w:rsidRDefault"];
|
|
25233
25305
|
};
|
|
25234
|
-
const decode$
|
|
25306
|
+
const decode$V = (attrs) => {
|
|
25235
25307
|
return attrs.rsidRDefault;
|
|
25236
25308
|
};
|
|
25237
25309
|
const attrConfig$w = Object.freeze({
|
|
25238
25310
|
xmlName: "w:rsidRDefault",
|
|
25239
25311
|
sdName: "rsidRDefault",
|
|
25240
|
-
encode: encode
|
|
25241
|
-
decode: decode$
|
|
25312
|
+
encode: encode$11,
|
|
25313
|
+
decode: decode$V
|
|
25242
25314
|
});
|
|
25243
|
-
const encode$
|
|
25315
|
+
const encode$10 = (attributes) => {
|
|
25244
25316
|
return attributes["w14:paraId"];
|
|
25245
25317
|
};
|
|
25246
|
-
const decode$
|
|
25318
|
+
const decode$U = (attrs) => {
|
|
25247
25319
|
return attrs.paraId;
|
|
25248
25320
|
};
|
|
25249
25321
|
const attrConfig$v = Object.freeze({
|
|
25250
25322
|
xmlName: "w14:paraId",
|
|
25251
25323
|
sdName: "paraId",
|
|
25252
|
-
encode: encode$
|
|
25253
|
-
decode: decode$
|
|
25324
|
+
encode: encode$10,
|
|
25325
|
+
decode: decode$U
|
|
25254
25326
|
});
|
|
25255
|
-
const encode
|
|
25327
|
+
const encode$$ = (attributes) => {
|
|
25256
25328
|
return attributes["w14:textId"];
|
|
25257
25329
|
};
|
|
25258
|
-
const decode$
|
|
25330
|
+
const decode$T = (attrs) => {
|
|
25259
25331
|
return attrs.textId;
|
|
25260
25332
|
};
|
|
25261
25333
|
const attrConfig$u = Object.freeze({
|
|
25262
25334
|
xmlName: "w14:textId",
|
|
25263
25335
|
sdName: "textId",
|
|
25264
|
-
encode: encode
|
|
25265
|
-
decode: decode$
|
|
25336
|
+
encode: encode$$,
|
|
25337
|
+
decode: decode$T
|
|
25266
25338
|
});
|
|
25267
|
-
const validXmlAttributes$
|
|
25339
|
+
const validXmlAttributes$m = [
|
|
25268
25340
|
attrConfig$v,
|
|
25269
25341
|
attrConfig$u,
|
|
25270
25342
|
attrConfig$y,
|
|
@@ -25273,9 +25345,9 @@ const validXmlAttributes$k = [
|
|
|
25273
25345
|
attrConfig$x,
|
|
25274
25346
|
attrConfig$A
|
|
25275
25347
|
];
|
|
25276
|
-
const XML_NODE_NAME$
|
|
25348
|
+
const XML_NODE_NAME$y = "w:p";
|
|
25277
25349
|
const SD_NODE_NAME$f = "paragraph";
|
|
25278
|
-
const encode$
|
|
25350
|
+
const encode$_ = (params2, encodedAttrs = {}) => {
|
|
25279
25351
|
const node = handleParagraphNode$1(params2);
|
|
25280
25352
|
if (!node) return void 0;
|
|
25281
25353
|
if (encodedAttrs && Object.keys(encodedAttrs).length) {
|
|
@@ -25283,7 +25355,7 @@ const encode$Y = (params2, encodedAttrs = {}) => {
|
|
|
25283
25355
|
}
|
|
25284
25356
|
return node;
|
|
25285
25357
|
};
|
|
25286
|
-
const decode$
|
|
25358
|
+
const decode$S = (params2, decodedAttrs = {}) => {
|
|
25287
25359
|
const translated = translateParagraphNode(params2);
|
|
25288
25360
|
if (!translated) return void 0;
|
|
25289
25361
|
if (decodedAttrs && Object.keys(decodedAttrs).length) {
|
|
@@ -25291,16 +25363,16 @@ const decode$Q = (params2, decodedAttrs = {}) => {
|
|
|
25291
25363
|
}
|
|
25292
25364
|
return translated;
|
|
25293
25365
|
};
|
|
25294
|
-
const config$
|
|
25295
|
-
xmlName: XML_NODE_NAME$
|
|
25366
|
+
const config$v = {
|
|
25367
|
+
xmlName: XML_NODE_NAME$y,
|
|
25296
25368
|
sdNodeOrKeyName: SD_NODE_NAME$f,
|
|
25297
25369
|
type: NodeTranslator.translatorTypes.NODE,
|
|
25298
|
-
encode: encode$
|
|
25299
|
-
decode: decode$
|
|
25300
|
-
attributes: validXmlAttributes$
|
|
25370
|
+
encode: encode$_,
|
|
25371
|
+
decode: decode$S,
|
|
25372
|
+
attributes: validXmlAttributes$m
|
|
25301
25373
|
};
|
|
25302
|
-
const translator$
|
|
25303
|
-
const encode$
|
|
25374
|
+
const translator$19 = NodeTranslator.from(config$v);
|
|
25375
|
+
const encode$Z = (attributes) => {
|
|
25304
25376
|
const raw = attributes?.["w:val"];
|
|
25305
25377
|
if (raw === void 0 || raw === null) return void 0;
|
|
25306
25378
|
if (typeof raw === "boolean") return raw;
|
|
@@ -25310,24 +25382,24 @@ const encode$X = (attributes) => {
|
|
|
25310
25382
|
if (val === "1" || val === "true" || val === "on") return true;
|
|
25311
25383
|
return void 0;
|
|
25312
25384
|
};
|
|
25313
|
-
const decode$
|
|
25385
|
+
const decode$R = (runProps) => {
|
|
25314
25386
|
if (runProps?.bold === false) return "0";
|
|
25315
25387
|
return void 0;
|
|
25316
25388
|
};
|
|
25317
25389
|
const attrConfig$t = Object.freeze({
|
|
25318
25390
|
xmlName: "w:val",
|
|
25319
25391
|
sdName: "bold",
|
|
25320
|
-
encode: encode$
|
|
25321
|
-
decode: decode$
|
|
25392
|
+
encode: encode$Z,
|
|
25393
|
+
decode: decode$R
|
|
25322
25394
|
});
|
|
25323
|
-
const validXmlAttributes$
|
|
25324
|
-
const XML_NODE_NAME$
|
|
25325
|
-
const SD_ATTR_KEY$
|
|
25326
|
-
const encode$
|
|
25395
|
+
const validXmlAttributes$l = [attrConfig$t];
|
|
25396
|
+
const XML_NODE_NAME$x = "w:b";
|
|
25397
|
+
const SD_ATTR_KEY$h = "bold";
|
|
25398
|
+
const encode$Y = (params2, encodedAttrs = {}) => {
|
|
25327
25399
|
const { nodes } = params2;
|
|
25328
25400
|
const node = nodes[0];
|
|
25329
25401
|
if (!node) return void 0;
|
|
25330
|
-
const val = encodedAttrs?.[SD_ATTR_KEY$
|
|
25402
|
+
const val = encodedAttrs?.[SD_ATTR_KEY$h];
|
|
25331
25403
|
let attributes;
|
|
25332
25404
|
if (val === false) attributes = { "w:val": "0" };
|
|
25333
25405
|
else if (val === true)
|
|
@@ -25335,85 +25407,85 @@ const encode$W = (params2, encodedAttrs = {}) => {
|
|
|
25335
25407
|
else attributes = node.attributes || {};
|
|
25336
25408
|
return {
|
|
25337
25409
|
type: "attr",
|
|
25338
|
-
xmlName: XML_NODE_NAME$
|
|
25339
|
-
sdNodeOrKeyName: SD_ATTR_KEY$
|
|
25410
|
+
xmlName: XML_NODE_NAME$x,
|
|
25411
|
+
sdNodeOrKeyName: SD_ATTR_KEY$h,
|
|
25340
25412
|
attributes
|
|
25341
25413
|
};
|
|
25342
25414
|
};
|
|
25343
|
-
const config$
|
|
25344
|
-
xmlName: XML_NODE_NAME$
|
|
25345
|
-
sdNodeOrKeyName: SD_ATTR_KEY$
|
|
25415
|
+
const config$u = {
|
|
25416
|
+
xmlName: XML_NODE_NAME$x,
|
|
25417
|
+
sdNodeOrKeyName: SD_ATTR_KEY$h,
|
|
25346
25418
|
type: NodeTranslator.translatorTypes.ATTRIBUTE,
|
|
25347
|
-
encode: encode$
|
|
25348
|
-
attributes: validXmlAttributes$
|
|
25419
|
+
encode: encode$Y,
|
|
25420
|
+
attributes: validXmlAttributes$l
|
|
25349
25421
|
};
|
|
25350
|
-
const translator$
|
|
25351
|
-
const XML_NODE_NAME$
|
|
25352
|
-
const SD_ATTR_KEY$
|
|
25353
|
-
const encode$
|
|
25422
|
+
const translator$18 = NodeTranslator.from(config$u);
|
|
25423
|
+
const XML_NODE_NAME$w = "w:i";
|
|
25424
|
+
const SD_ATTR_KEY$g = "italic";
|
|
25425
|
+
const encode$X = (params2) => {
|
|
25354
25426
|
const { nodes } = params2;
|
|
25355
25427
|
const node = nodes?.[0];
|
|
25356
25428
|
if (!node) return void 0;
|
|
25357
25429
|
return {
|
|
25358
25430
|
type: "attr",
|
|
25359
|
-
xmlName: XML_NODE_NAME$
|
|
25360
|
-
sdNodeOrKeyName: SD_ATTR_KEY$
|
|
25431
|
+
xmlName: XML_NODE_NAME$w,
|
|
25432
|
+
sdNodeOrKeyName: SD_ATTR_KEY$g,
|
|
25361
25433
|
attributes: {
|
|
25362
25434
|
"w:val": node.attributes?.["w:val"] ?? null
|
|
25363
25435
|
}
|
|
25364
25436
|
};
|
|
25365
25437
|
};
|
|
25366
|
-
const config$
|
|
25367
|
-
xmlName: XML_NODE_NAME$
|
|
25368
|
-
sdNodeOrKeyName: SD_ATTR_KEY$
|
|
25438
|
+
const config$t = {
|
|
25439
|
+
xmlName: XML_NODE_NAME$w,
|
|
25440
|
+
sdNodeOrKeyName: SD_ATTR_KEY$g,
|
|
25369
25441
|
type: NodeTranslator.translatorTypes.ATTRIBUTE,
|
|
25370
|
-
encode: encode$
|
|
25442
|
+
encode: encode$X
|
|
25371
25443
|
};
|
|
25372
|
-
const translator$
|
|
25373
|
-
const encode$
|
|
25374
|
-
const decode$
|
|
25444
|
+
const translator$17 = NodeTranslator.from(config$t);
|
|
25445
|
+
const encode$W = (attributes) => attributes?.["w:val"];
|
|
25446
|
+
const decode$Q = (attrs) => attrs?.underline;
|
|
25375
25447
|
const attrConfig$s = Object.freeze({
|
|
25376
25448
|
xmlName: "w:val",
|
|
25377
25449
|
sdName: "underline",
|
|
25378
|
-
encode: encode$
|
|
25379
|
-
decode: decode$
|
|
25450
|
+
encode: encode$W,
|
|
25451
|
+
decode: decode$Q
|
|
25380
25452
|
});
|
|
25381
|
-
const encode$
|
|
25382
|
-
const decode$
|
|
25453
|
+
const encode$V = (attributes) => attributes?.["w:color"];
|
|
25454
|
+
const decode$P = (attrs) => attrs?.color;
|
|
25383
25455
|
const attrConfig$r = Object.freeze({
|
|
25384
25456
|
xmlName: "w:color",
|
|
25385
25457
|
sdName: "color",
|
|
25386
|
-
encode: encode$
|
|
25387
|
-
decode: decode$
|
|
25458
|
+
encode: encode$V,
|
|
25459
|
+
decode: decode$P
|
|
25388
25460
|
});
|
|
25389
|
-
const encode$
|
|
25390
|
-
const decode$
|
|
25461
|
+
const encode$U = (attributes) => attributes?.["w:themeColor"];
|
|
25462
|
+
const decode$O = (attrs) => attrs?.themeColor;
|
|
25391
25463
|
const attrConfig$q = Object.freeze({
|
|
25392
25464
|
xmlName: "w:themeColor",
|
|
25393
25465
|
sdName: "themeColor",
|
|
25394
|
-
encode: encode$
|
|
25395
|
-
decode: decode$
|
|
25466
|
+
encode: encode$U,
|
|
25467
|
+
decode: decode$O
|
|
25396
25468
|
});
|
|
25397
|
-
const encode$
|
|
25398
|
-
const decode$
|
|
25469
|
+
const encode$T = (attributes) => attributes?.["w:themeTint"];
|
|
25470
|
+
const decode$N = (attrs) => attrs?.themeTint;
|
|
25399
25471
|
const attrConfig$p = Object.freeze({
|
|
25400
25472
|
xmlName: "w:themeTint",
|
|
25401
25473
|
sdName: "themeTint",
|
|
25402
|
-
encode: encode$
|
|
25403
|
-
decode: decode$
|
|
25474
|
+
encode: encode$T,
|
|
25475
|
+
decode: decode$N
|
|
25404
25476
|
});
|
|
25405
|
-
const encode$
|
|
25406
|
-
const decode$
|
|
25477
|
+
const encode$S = (attributes) => attributes?.["w:themeShade"];
|
|
25478
|
+
const decode$M = (attrs) => attrs?.themeShade;
|
|
25407
25479
|
const attrConfig$o = Object.freeze({
|
|
25408
25480
|
xmlName: "w:themeShade",
|
|
25409
25481
|
sdName: "themeShade",
|
|
25410
|
-
encode: encode$
|
|
25411
|
-
decode: decode$
|
|
25482
|
+
encode: encode$S,
|
|
25483
|
+
decode: decode$M
|
|
25412
25484
|
});
|
|
25413
|
-
const validXmlAttributes$
|
|
25414
|
-
const XML_NODE_NAME$
|
|
25415
|
-
const SD_ATTR_KEY$
|
|
25416
|
-
const encode$
|
|
25485
|
+
const validXmlAttributes$k = [attrConfig$s, attrConfig$r, attrConfig$q, attrConfig$p, attrConfig$o];
|
|
25486
|
+
const XML_NODE_NAME$v = "w:u";
|
|
25487
|
+
const SD_ATTR_KEY$f = "underline";
|
|
25488
|
+
const encode$R = (params2, encodedAttrs = {}) => {
|
|
25417
25489
|
const { nodes } = params2;
|
|
25418
25490
|
const node = nodes?.[0];
|
|
25419
25491
|
const sourceAttrs = node?.attributes || {};
|
|
@@ -25429,12 +25501,12 @@ const encode$P = (params2, encodedAttrs = {}) => {
|
|
|
25429
25501
|
if (themeShade !== void 0 && themeShade !== null) attributes["w:themeShade"] = themeShade;
|
|
25430
25502
|
return {
|
|
25431
25503
|
type: "attr",
|
|
25432
|
-
xmlName: XML_NODE_NAME$
|
|
25433
|
-
sdNodeOrKeyName: SD_ATTR_KEY$
|
|
25504
|
+
xmlName: XML_NODE_NAME$v,
|
|
25505
|
+
sdNodeOrKeyName: SD_ATTR_KEY$f,
|
|
25434
25506
|
attributes
|
|
25435
25507
|
};
|
|
25436
25508
|
};
|
|
25437
|
-
const decode$
|
|
25509
|
+
const decode$L = (params2) => {
|
|
25438
25510
|
const attrs = params2?.node?.attrs || {};
|
|
25439
25511
|
const underlineType = attrs.underlineType ?? attrs.underline ?? null;
|
|
25440
25512
|
const color = attrs.underlineColor ?? attrs.color ?? null;
|
|
@@ -25452,20 +25524,20 @@ const decode$J = (params2) => {
|
|
|
25452
25524
|
if (themeTint) attributes["w:themeTint"] = themeTint;
|
|
25453
25525
|
if (themeShade) attributes["w:themeShade"] = themeShade;
|
|
25454
25526
|
return {
|
|
25455
|
-
name: XML_NODE_NAME$
|
|
25527
|
+
name: XML_NODE_NAME$v,
|
|
25456
25528
|
attributes
|
|
25457
25529
|
};
|
|
25458
25530
|
};
|
|
25459
|
-
const config$
|
|
25460
|
-
xmlName: XML_NODE_NAME$
|
|
25461
|
-
sdNodeOrKeyName: SD_ATTR_KEY$
|
|
25531
|
+
const config$s = {
|
|
25532
|
+
xmlName: XML_NODE_NAME$v,
|
|
25533
|
+
sdNodeOrKeyName: SD_ATTR_KEY$f,
|
|
25462
25534
|
type: NodeTranslator.translatorTypes.ATTRIBUTE,
|
|
25463
|
-
encode: encode$
|
|
25464
|
-
decode: decode$
|
|
25465
|
-
attributes: validXmlAttributes$
|
|
25535
|
+
encode: encode$R,
|
|
25536
|
+
decode: decode$L,
|
|
25537
|
+
attributes: validXmlAttributes$k
|
|
25466
25538
|
};
|
|
25467
|
-
const translator$
|
|
25468
|
-
const encode$
|
|
25539
|
+
const translator$16 = NodeTranslator.from(config$s);
|
|
25540
|
+
const encode$Q = (attributes) => {
|
|
25469
25541
|
const raw = attributes?.["w:val"];
|
|
25470
25542
|
if (raw === void 0 || raw === null) return void 0;
|
|
25471
25543
|
if (typeof raw === "boolean") return raw;
|
|
@@ -25475,24 +25547,24 @@ const encode$O = (attributes) => {
|
|
|
25475
25547
|
if (val === "1" || val === "true" || val === "on") return true;
|
|
25476
25548
|
return void 0;
|
|
25477
25549
|
};
|
|
25478
|
-
const decode$
|
|
25550
|
+
const decode$K = (attrs) => {
|
|
25479
25551
|
if (attrs?.strike === false) return "0";
|
|
25480
25552
|
return void 0;
|
|
25481
25553
|
};
|
|
25482
25554
|
const attrConfig$n = Object.freeze({
|
|
25483
25555
|
xmlName: "w:val",
|
|
25484
25556
|
sdName: "strike",
|
|
25485
|
-
encode: encode$
|
|
25486
|
-
decode: decode$
|
|
25557
|
+
encode: encode$Q,
|
|
25558
|
+
decode: decode$K
|
|
25487
25559
|
});
|
|
25488
|
-
const validXmlAttributes$
|
|
25489
|
-
const XML_NODE_NAME$
|
|
25490
|
-
const SD_ATTR_KEY$
|
|
25491
|
-
const encode$
|
|
25560
|
+
const validXmlAttributes$j = [attrConfig$n];
|
|
25561
|
+
const XML_NODE_NAME$u = "w:strike";
|
|
25562
|
+
const SD_ATTR_KEY$e = "strike";
|
|
25563
|
+
const encode$P = (params2, encodedAttrs = {}) => {
|
|
25492
25564
|
const { nodes } = params2;
|
|
25493
25565
|
const node = nodes?.[0];
|
|
25494
25566
|
if (!node) return void 0;
|
|
25495
|
-
const val = encodedAttrs?.[SD_ATTR_KEY$
|
|
25567
|
+
const val = encodedAttrs?.[SD_ATTR_KEY$e];
|
|
25496
25568
|
let attributes;
|
|
25497
25569
|
if (val === false) attributes = { "w:val": "0" };
|
|
25498
25570
|
else if (val === true) attributes = {};
|
|
@@ -25501,55 +25573,55 @@ const encode$N = (params2, encodedAttrs = {}) => {
|
|
|
25501
25573
|
else if (val === true && attributes["w:val"] === void 0) delete attributes["w:val"];
|
|
25502
25574
|
return {
|
|
25503
25575
|
type: "attr",
|
|
25504
|
-
xmlName: XML_NODE_NAME$
|
|
25505
|
-
sdNodeOrKeyName: SD_ATTR_KEY$
|
|
25576
|
+
xmlName: XML_NODE_NAME$u,
|
|
25577
|
+
sdNodeOrKeyName: SD_ATTR_KEY$e,
|
|
25506
25578
|
attributes
|
|
25507
25579
|
};
|
|
25508
25580
|
};
|
|
25509
|
-
const config$
|
|
25510
|
-
xmlName: XML_NODE_NAME$
|
|
25511
|
-
sdNodeOrKeyName: SD_ATTR_KEY$
|
|
25581
|
+
const config$r = {
|
|
25582
|
+
xmlName: XML_NODE_NAME$u,
|
|
25583
|
+
sdNodeOrKeyName: SD_ATTR_KEY$e,
|
|
25512
25584
|
type: NodeTranslator.translatorTypes.ATTRIBUTE,
|
|
25513
|
-
encode: encode$
|
|
25514
|
-
attributes: validXmlAttributes$
|
|
25585
|
+
encode: encode$P,
|
|
25586
|
+
attributes: validXmlAttributes$j
|
|
25515
25587
|
};
|
|
25516
|
-
const translator$
|
|
25517
|
-
const encode$
|
|
25518
|
-
const decode$
|
|
25588
|
+
const translator$15 = NodeTranslator.from(config$r);
|
|
25589
|
+
const encode$O = (attributes) => attributes?.["w:val"];
|
|
25590
|
+
const decode$J = (attrs) => attrs?.color;
|
|
25519
25591
|
const attrConfig$m = Object.freeze({
|
|
25520
25592
|
xmlName: "w:val",
|
|
25521
25593
|
sdName: "color",
|
|
25522
|
-
encode: encode$
|
|
25523
|
-
decode: decode$
|
|
25594
|
+
encode: encode$O,
|
|
25595
|
+
decode: decode$J
|
|
25524
25596
|
});
|
|
25525
|
-
const encode$
|
|
25526
|
-
const decode$
|
|
25597
|
+
const encode$N = (attributes) => attributes?.["w:themeColor"];
|
|
25598
|
+
const decode$I = (attrs) => attrs?.themeColor;
|
|
25527
25599
|
const attrConfig$l = Object.freeze({
|
|
25528
25600
|
xmlName: "w:themeColor",
|
|
25529
25601
|
sdName: "themeColor",
|
|
25530
|
-
encode: encode$
|
|
25531
|
-
decode: decode$
|
|
25602
|
+
encode: encode$N,
|
|
25603
|
+
decode: decode$I
|
|
25532
25604
|
});
|
|
25533
|
-
const encode$
|
|
25534
|
-
const decode$
|
|
25605
|
+
const encode$M = (attributes) => attributes?.["w:themeTint"];
|
|
25606
|
+
const decode$H = (attrs) => attrs?.themeTint;
|
|
25535
25607
|
const attrConfig$k = Object.freeze({
|
|
25536
25608
|
xmlName: "w:themeTint",
|
|
25537
25609
|
sdName: "themeTint",
|
|
25538
|
-
encode: encode$
|
|
25539
|
-
decode: decode$
|
|
25610
|
+
encode: encode$M,
|
|
25611
|
+
decode: decode$H
|
|
25540
25612
|
});
|
|
25541
|
-
const encode$
|
|
25542
|
-
const decode$
|
|
25613
|
+
const encode$L = (attributes) => attributes?.["w:themeShade"];
|
|
25614
|
+
const decode$G = (attrs) => attrs?.themeShade;
|
|
25543
25615
|
const attrConfig$j = Object.freeze({
|
|
25544
25616
|
xmlName: "w:themeShade",
|
|
25545
25617
|
sdName: "themeShade",
|
|
25546
|
-
encode: encode$
|
|
25547
|
-
decode: decode$
|
|
25618
|
+
encode: encode$L,
|
|
25619
|
+
decode: decode$G
|
|
25548
25620
|
});
|
|
25549
|
-
const validXmlAttributes$
|
|
25550
|
-
const XML_NODE_NAME$
|
|
25551
|
-
const SD_ATTR_KEY$
|
|
25552
|
-
const encode$
|
|
25621
|
+
const validXmlAttributes$i = [attrConfig$m, attrConfig$l, attrConfig$k, attrConfig$j];
|
|
25622
|
+
const XML_NODE_NAME$t = "w:color";
|
|
25623
|
+
const SD_ATTR_KEY$d = "color";
|
|
25624
|
+
const encode$K = (params2, encodedAttrs = {}) => {
|
|
25553
25625
|
const { nodes } = params2;
|
|
25554
25626
|
const node = nodes?.[0];
|
|
25555
25627
|
const sourceAttrs = node?.attributes || {};
|
|
@@ -25564,63 +25636,63 @@ const encode$I = (params2, encodedAttrs = {}) => {
|
|
|
25564
25636
|
if (themeShade !== void 0 && themeShade !== null) attributes["w:themeShade"] = themeShade;
|
|
25565
25637
|
return {
|
|
25566
25638
|
type: "attr",
|
|
25567
|
-
xmlName: XML_NODE_NAME$
|
|
25568
|
-
sdNodeOrKeyName: SD_ATTR_KEY$
|
|
25639
|
+
xmlName: XML_NODE_NAME$t,
|
|
25640
|
+
sdNodeOrKeyName: SD_ATTR_KEY$d,
|
|
25569
25641
|
attributes
|
|
25570
25642
|
};
|
|
25571
25643
|
};
|
|
25572
|
-
const config$
|
|
25573
|
-
xmlName: XML_NODE_NAME$
|
|
25574
|
-
sdNodeOrKeyName: SD_ATTR_KEY$
|
|
25644
|
+
const config$q = {
|
|
25645
|
+
xmlName: XML_NODE_NAME$t,
|
|
25646
|
+
sdNodeOrKeyName: SD_ATTR_KEY$d,
|
|
25575
25647
|
type: NodeTranslator.translatorTypes.ATTRIBUTE,
|
|
25576
|
-
encode: encode$
|
|
25577
|
-
attributes: validXmlAttributes$
|
|
25648
|
+
encode: encode$K,
|
|
25649
|
+
attributes: validXmlAttributes$i
|
|
25578
25650
|
};
|
|
25579
|
-
const translator$
|
|
25580
|
-
const encode$
|
|
25581
|
-
const decode$
|
|
25651
|
+
const translator$14 = NodeTranslator.from(config$q);
|
|
25652
|
+
const encode$J = (attributes) => attributes?.["w:eastAsia"];
|
|
25653
|
+
const decode$F = (attrs) => attrs?.eastAsia;
|
|
25582
25654
|
const attrConfig$i = Object.freeze({
|
|
25583
25655
|
xmlName: "w:eastAsia",
|
|
25584
25656
|
sdName: "eastAsia",
|
|
25585
|
-
encode: encode$
|
|
25586
|
-
decode: decode$
|
|
25657
|
+
encode: encode$J,
|
|
25658
|
+
decode: decode$F
|
|
25587
25659
|
});
|
|
25588
|
-
const encode$
|
|
25589
|
-
const decode$
|
|
25660
|
+
const encode$I = (attributes) => attributes?.["w:ascii"];
|
|
25661
|
+
const decode$E = (attrs) => attrs?.ascii;
|
|
25590
25662
|
const attrConfig$h = Object.freeze({
|
|
25591
25663
|
xmlName: "w:ascii",
|
|
25592
25664
|
sdName: "ascii",
|
|
25593
|
-
encode: encode$
|
|
25594
|
-
decode: decode$
|
|
25665
|
+
encode: encode$I,
|
|
25666
|
+
decode: decode$E
|
|
25595
25667
|
});
|
|
25596
|
-
const encode$
|
|
25597
|
-
const decode$
|
|
25668
|
+
const encode$H = (attributes) => attributes?.["w:hAnsi"];
|
|
25669
|
+
const decode$D = (attrs) => attrs?.hAnsi;
|
|
25598
25670
|
const attrConfig$g = Object.freeze({
|
|
25599
25671
|
xmlName: "w:hAnsi",
|
|
25600
25672
|
sdName: "hAnsi",
|
|
25601
|
-
encode: encode$
|
|
25602
|
-
decode: decode$
|
|
25673
|
+
encode: encode$H,
|
|
25674
|
+
decode: decode$D
|
|
25603
25675
|
});
|
|
25604
|
-
const encode$
|
|
25605
|
-
const decode$
|
|
25676
|
+
const encode$G = (attributes) => attributes?.["w:cs"];
|
|
25677
|
+
const decode$C = (attrs) => attrs?.cs;
|
|
25606
25678
|
const attrConfig$f = Object.freeze({
|
|
25607
25679
|
xmlName: "w:cs",
|
|
25608
25680
|
sdName: "cs",
|
|
25609
|
-
encode: encode$
|
|
25610
|
-
decode: decode$
|
|
25681
|
+
encode: encode$G,
|
|
25682
|
+
decode: decode$C
|
|
25611
25683
|
});
|
|
25612
|
-
const encode$
|
|
25613
|
-
const decode$
|
|
25684
|
+
const encode$F = (attributes) => attributes?.["w:val"];
|
|
25685
|
+
const decode$B = (attrs) => attrs?.value;
|
|
25614
25686
|
const attrConfig$e = Object.freeze({
|
|
25615
25687
|
xmlName: "w:val",
|
|
25616
25688
|
sdName: "value",
|
|
25617
|
-
encode: encode$
|
|
25618
|
-
decode: decode$
|
|
25689
|
+
encode: encode$F,
|
|
25690
|
+
decode: decode$B
|
|
25619
25691
|
});
|
|
25620
|
-
const validXmlAttributes$
|
|
25621
|
-
const XML_NODE_NAME$
|
|
25622
|
-
const SD_ATTR_KEY$
|
|
25623
|
-
const encode$
|
|
25692
|
+
const validXmlAttributes$h = [attrConfig$i, attrConfig$h, attrConfig$g, attrConfig$f, attrConfig$e];
|
|
25693
|
+
const XML_NODE_NAME$s = "w:rFonts";
|
|
25694
|
+
const SD_ATTR_KEY$c = "fontFamily";
|
|
25695
|
+
const encode$E = (params2, encodedAttrs = {}) => {
|
|
25624
25696
|
const { nodes } = params2;
|
|
25625
25697
|
const node = nodes?.[0];
|
|
25626
25698
|
const sourceAttrs = node?.attributes || {};
|
|
@@ -25646,109 +25718,109 @@ const encode$C = (params2, encodedAttrs = {}) => {
|
|
|
25646
25718
|
if (attributes["w:val"] === void 0) delete attributes["w:val"];
|
|
25647
25719
|
return {
|
|
25648
25720
|
type: "attr",
|
|
25649
|
-
xmlName: XML_NODE_NAME$
|
|
25650
|
-
sdNodeOrKeyName: SD_ATTR_KEY$
|
|
25721
|
+
xmlName: XML_NODE_NAME$s,
|
|
25722
|
+
sdNodeOrKeyName: SD_ATTR_KEY$c,
|
|
25651
25723
|
attributes
|
|
25652
25724
|
};
|
|
25653
25725
|
};
|
|
25654
|
-
const config$
|
|
25655
|
-
xmlName: XML_NODE_NAME$
|
|
25656
|
-
sdNodeOrKeyName: SD_ATTR_KEY$
|
|
25726
|
+
const config$p = {
|
|
25727
|
+
xmlName: XML_NODE_NAME$s,
|
|
25728
|
+
sdNodeOrKeyName: SD_ATTR_KEY$c,
|
|
25657
25729
|
type: NodeTranslator.translatorTypes.ATTRIBUTE,
|
|
25658
|
-
encode: encode$
|
|
25659
|
-
attributes: validXmlAttributes$
|
|
25730
|
+
encode: encode$E,
|
|
25731
|
+
attributes: validXmlAttributes$h
|
|
25660
25732
|
};
|
|
25661
|
-
const translator$
|
|
25662
|
-
const encode$
|
|
25663
|
-
const decode$
|
|
25733
|
+
const translator$13 = NodeTranslator.from(config$p);
|
|
25734
|
+
const encode$D = (attributes) => attributes?.["w:val"];
|
|
25735
|
+
const decode$A = (attrs) => attrs?.styleId;
|
|
25664
25736
|
const attrConfig$d = Object.freeze({
|
|
25665
25737
|
xmlName: "w:val",
|
|
25666
25738
|
sdName: "styleId",
|
|
25667
|
-
encode: encode$
|
|
25668
|
-
decode: decode$
|
|
25739
|
+
encode: encode$D,
|
|
25740
|
+
decode: decode$A
|
|
25669
25741
|
});
|
|
25670
|
-
const validXmlAttributes$
|
|
25671
|
-
const XML_NODE_NAME$
|
|
25672
|
-
const SD_ATTR_KEY$
|
|
25673
|
-
const encode$
|
|
25742
|
+
const validXmlAttributes$g = [attrConfig$d];
|
|
25743
|
+
const XML_NODE_NAME$r = "w:rStyle";
|
|
25744
|
+
const SD_ATTR_KEY$b = "styleId";
|
|
25745
|
+
const encode$C = (params2, encodedAttrs = {}) => {
|
|
25674
25746
|
const { nodes } = params2;
|
|
25675
25747
|
const node = nodes?.[0];
|
|
25676
25748
|
const value = encodedAttrs.styleId ?? node?.attributes?.["w:val"];
|
|
25677
25749
|
return {
|
|
25678
25750
|
type: "attr",
|
|
25679
|
-
xmlName: XML_NODE_NAME$
|
|
25680
|
-
sdNodeOrKeyName: SD_ATTR_KEY$
|
|
25751
|
+
xmlName: XML_NODE_NAME$r,
|
|
25752
|
+
sdNodeOrKeyName: SD_ATTR_KEY$b,
|
|
25681
25753
|
attributes: { "w:val": value ?? null }
|
|
25682
25754
|
};
|
|
25683
25755
|
};
|
|
25684
|
-
const config$
|
|
25685
|
-
xmlName: XML_NODE_NAME$
|
|
25686
|
-
sdNodeOrKeyName: SD_ATTR_KEY$
|
|
25756
|
+
const config$o = {
|
|
25757
|
+
xmlName: XML_NODE_NAME$r,
|
|
25758
|
+
sdNodeOrKeyName: SD_ATTR_KEY$b,
|
|
25687
25759
|
type: NodeTranslator.translatorTypes.ATTRIBUTE,
|
|
25688
|
-
encode: encode$
|
|
25689
|
-
attributes: validXmlAttributes$
|
|
25760
|
+
encode: encode$C,
|
|
25761
|
+
attributes: validXmlAttributes$g
|
|
25690
25762
|
};
|
|
25691
|
-
const translator$
|
|
25692
|
-
const encode$
|
|
25693
|
-
const decode$
|
|
25763
|
+
const translator$12 = NodeTranslator.from(config$o);
|
|
25764
|
+
const encode$B = (attributes) => attributes?.["w:val"];
|
|
25765
|
+
const decode$z = (attrs) => attrs?.fontSize;
|
|
25694
25766
|
const attrConfig$c = Object.freeze({
|
|
25695
25767
|
xmlName: "w:val",
|
|
25696
25768
|
sdName: "fontSize",
|
|
25697
|
-
encode: encode$
|
|
25698
|
-
decode: decode$
|
|
25769
|
+
encode: encode$B,
|
|
25770
|
+
decode: decode$z
|
|
25699
25771
|
});
|
|
25700
|
-
const validXmlAttributes$
|
|
25701
|
-
const XML_NODE_NAME$
|
|
25702
|
-
const SD_ATTR_KEY$
|
|
25703
|
-
const encode$
|
|
25772
|
+
const validXmlAttributes$f = [attrConfig$c];
|
|
25773
|
+
const XML_NODE_NAME$q = "w:sz";
|
|
25774
|
+
const SD_ATTR_KEY$a = "fontSize";
|
|
25775
|
+
const encode$A = (params2, encodedAttrs = {}) => {
|
|
25704
25776
|
const { nodes } = params2;
|
|
25705
25777
|
const node = nodes?.[0];
|
|
25706
25778
|
const value = encodedAttrs.fontSize ?? node?.attributes?.["w:val"];
|
|
25707
25779
|
return {
|
|
25708
25780
|
type: "attr",
|
|
25709
|
-
xmlName: XML_NODE_NAME$
|
|
25710
|
-
sdNodeOrKeyName: SD_ATTR_KEY$
|
|
25781
|
+
xmlName: XML_NODE_NAME$q,
|
|
25782
|
+
sdNodeOrKeyName: SD_ATTR_KEY$a,
|
|
25711
25783
|
attributes: { "w:val": value ?? null }
|
|
25712
25784
|
};
|
|
25713
25785
|
};
|
|
25714
|
-
const config$
|
|
25715
|
-
xmlName: XML_NODE_NAME$
|
|
25716
|
-
sdNodeOrKeyName: SD_ATTR_KEY$
|
|
25786
|
+
const config$n = {
|
|
25787
|
+
xmlName: XML_NODE_NAME$q,
|
|
25788
|
+
sdNodeOrKeyName: SD_ATTR_KEY$a,
|
|
25717
25789
|
type: NodeTranslator.translatorTypes.ATTRIBUTE,
|
|
25718
|
-
encode: encode$
|
|
25719
|
-
attributes: validXmlAttributes$
|
|
25790
|
+
encode: encode$A,
|
|
25791
|
+
attributes: validXmlAttributes$f
|
|
25720
25792
|
};
|
|
25721
|
-
const translator
|
|
25722
|
-
const encode$
|
|
25723
|
-
const decode$
|
|
25793
|
+
const translator$11 = NodeTranslator.from(config$n);
|
|
25794
|
+
const encode$z = (attributes) => attributes?.["w:val"];
|
|
25795
|
+
const decode$y = (attrs) => attrs?.fontSizeCs;
|
|
25724
25796
|
const attrConfig$b = Object.freeze({
|
|
25725
25797
|
xmlName: "w:val",
|
|
25726
25798
|
sdName: "fontSizeCs",
|
|
25727
|
-
encode: encode$
|
|
25728
|
-
decode: decode$
|
|
25799
|
+
encode: encode$z,
|
|
25800
|
+
decode: decode$y
|
|
25729
25801
|
});
|
|
25730
|
-
const validXmlAttributes$
|
|
25731
|
-
const XML_NODE_NAME$
|
|
25732
|
-
const SD_ATTR_KEY$
|
|
25733
|
-
const encode$
|
|
25802
|
+
const validXmlAttributes$e = [attrConfig$b];
|
|
25803
|
+
const XML_NODE_NAME$p = "w:szCs";
|
|
25804
|
+
const SD_ATTR_KEY$9 = "fontSizeCs";
|
|
25805
|
+
const encode$y = (params2, encodedAttrs = {}) => {
|
|
25734
25806
|
const { nodes } = params2;
|
|
25735
25807
|
const node = nodes?.[0];
|
|
25736
25808
|
const value = encodedAttrs.fontSizeCs ?? node?.attributes?.["w:val"];
|
|
25737
25809
|
return {
|
|
25738
25810
|
type: "attr",
|
|
25739
|
-
xmlName: XML_NODE_NAME$
|
|
25740
|
-
sdNodeOrKeyName: SD_ATTR_KEY$
|
|
25811
|
+
xmlName: XML_NODE_NAME$p,
|
|
25812
|
+
sdNodeOrKeyName: SD_ATTR_KEY$9,
|
|
25741
25813
|
attributes: { "w:val": value ?? null }
|
|
25742
25814
|
};
|
|
25743
25815
|
};
|
|
25744
|
-
const config$
|
|
25745
|
-
xmlName: XML_NODE_NAME$
|
|
25746
|
-
sdNodeOrKeyName: SD_ATTR_KEY$
|
|
25816
|
+
const config$m = {
|
|
25817
|
+
xmlName: XML_NODE_NAME$p,
|
|
25818
|
+
sdNodeOrKeyName: SD_ATTR_KEY$9,
|
|
25747
25819
|
type: NodeTranslator.translatorTypes.ATTRIBUTE,
|
|
25748
|
-
encode: encode$
|
|
25749
|
-
attributes: validXmlAttributes$
|
|
25820
|
+
encode: encode$y,
|
|
25821
|
+
attributes: validXmlAttributes$e
|
|
25750
25822
|
};
|
|
25751
|
-
const translator$
|
|
25823
|
+
const translator$10 = NodeTranslator.from(config$m);
|
|
25752
25824
|
const generateV2HandlerEntity = (handlerName, translator2) => ({
|
|
25753
25825
|
handlerName,
|
|
25754
25826
|
handler: (params2) => {
|
|
@@ -25882,9 +25954,9 @@ const integerToString = (value) => {
|
|
|
25882
25954
|
const intValue = parseInteger(value);
|
|
25883
25955
|
return intValue != void 0 ? String(intValue) : void 0;
|
|
25884
25956
|
};
|
|
25885
|
-
const XML_NODE_NAME$
|
|
25886
|
-
const SD_ATTR_KEY$
|
|
25887
|
-
const encode$
|
|
25957
|
+
const XML_NODE_NAME$o = "w:caps";
|
|
25958
|
+
const SD_ATTR_KEY$8 = "textTransform";
|
|
25959
|
+
const encode$x = (params2, encodedAttrs = {}) => {
|
|
25888
25960
|
const { nodes } = params2;
|
|
25889
25961
|
const node = nodes[0];
|
|
25890
25962
|
if (!node) return void 0;
|
|
@@ -25896,31 +25968,31 @@ const encode$v = (params2, encodedAttrs = {}) => {
|
|
|
25896
25968
|
}
|
|
25897
25969
|
return {
|
|
25898
25970
|
type: "attr",
|
|
25899
|
-
xmlName: XML_NODE_NAME$
|
|
25900
|
-
sdNodeOrKeyName: SD_ATTR_KEY$
|
|
25901
|
-
attributes: { [SD_ATTR_KEY$
|
|
25971
|
+
xmlName: XML_NODE_NAME$o,
|
|
25972
|
+
sdNodeOrKeyName: SD_ATTR_KEY$8,
|
|
25973
|
+
attributes: { [SD_ATTR_KEY$8]: result }
|
|
25902
25974
|
};
|
|
25903
25975
|
};
|
|
25904
|
-
const config$
|
|
25905
|
-
xmlName: XML_NODE_NAME$
|
|
25906
|
-
sdNodeOrKeyName: SD_ATTR_KEY$
|
|
25976
|
+
const config$l = {
|
|
25977
|
+
xmlName: XML_NODE_NAME$o,
|
|
25978
|
+
sdNodeOrKeyName: SD_ATTR_KEY$8,
|
|
25907
25979
|
type: NodeTranslator.translatorTypes.ATTRIBUTE,
|
|
25908
|
-
encode: encode$
|
|
25980
|
+
encode: encode$x,
|
|
25909
25981
|
attributes: [createAttributeHandler("w:val")]
|
|
25910
25982
|
};
|
|
25911
|
-
const translator
|
|
25983
|
+
const translator$$ = NodeTranslator.from(config$l);
|
|
25912
25984
|
const runPropertyTranslators = Object.freeze({
|
|
25913
|
-
"w:b": translator$
|
|
25914
|
-
"w:i": translator$
|
|
25915
|
-
"w:u": translator$
|
|
25916
|
-
"w:strike": translator$
|
|
25917
|
-
"w:color": translator$
|
|
25918
|
-
"w:highlight": translator$
|
|
25919
|
-
"w:rFonts": translator$
|
|
25920
|
-
"w:rStyle": translator$
|
|
25921
|
-
"w:sz": translator
|
|
25922
|
-
"w:szCs": translator$
|
|
25923
|
-
"w:caps": translator
|
|
25985
|
+
"w:b": translator$18,
|
|
25986
|
+
"w:i": translator$17,
|
|
25987
|
+
"w:u": translator$16,
|
|
25988
|
+
"w:strike": translator$15,
|
|
25989
|
+
"w:color": translator$14,
|
|
25990
|
+
"w:highlight": translator$1b,
|
|
25991
|
+
"w:rFonts": translator$13,
|
|
25992
|
+
"w:rStyle": translator$12,
|
|
25993
|
+
"w:sz": translator$11,
|
|
25994
|
+
"w:szCs": translator$10,
|
|
25995
|
+
"w:caps": translator$$
|
|
25924
25996
|
});
|
|
25925
25997
|
const rawRunPropertyXmlNames = Object.freeze(["w:lang", "w:shd"]);
|
|
25926
25998
|
const RAW_CHILD_NAME_SET = new Set(rawRunPropertyXmlNames);
|
|
@@ -25934,9 +26006,9 @@ const toRunPropertyEntry = (candidate) => {
|
|
|
25934
26006
|
attributes: { ...candidate.attributes || {} }
|
|
25935
26007
|
};
|
|
25936
26008
|
};
|
|
25937
|
-
const XML_NODE_NAME$
|
|
25938
|
-
const SD_ATTR_KEY$
|
|
25939
|
-
const encode$
|
|
26009
|
+
const XML_NODE_NAME$n = "w:rPr";
|
|
26010
|
+
const SD_ATTR_KEY$7 = "runProperties";
|
|
26011
|
+
const encode$w = (params2) => {
|
|
25940
26012
|
const { nodes } = params2;
|
|
25941
26013
|
const node = nodes?.[0] || {};
|
|
25942
26014
|
const contents = Array.isArray(node.elements) ? node.elements : [];
|
|
@@ -25970,16 +26042,16 @@ const encode$u = (params2) => {
|
|
|
25970
26042
|
attributes: runPropsArray
|
|
25971
26043
|
};
|
|
25972
26044
|
};
|
|
25973
|
-
const config$
|
|
25974
|
-
xmlName: XML_NODE_NAME$
|
|
25975
|
-
sdNodeOrKeyName: SD_ATTR_KEY$
|
|
26045
|
+
const config$k = {
|
|
26046
|
+
xmlName: XML_NODE_NAME$n,
|
|
26047
|
+
sdNodeOrKeyName: SD_ATTR_KEY$7,
|
|
25976
26048
|
type: NodeTranslator.translatorTypes.ATTRIBUTE,
|
|
25977
|
-
encode: encode$
|
|
26049
|
+
encode: encode$w
|
|
25978
26050
|
};
|
|
25979
|
-
const translator$
|
|
26051
|
+
const translator$_ = NodeTranslator.from(config$k);
|
|
25980
26052
|
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;
|
|
25981
26053
|
const containsEastAsianCharacters = (text) => EAST_ASIAN_CHARACTER_REGEX.test(text);
|
|
25982
|
-
const collectRunProperties = (params2, rPrNode, translator2 = translator$
|
|
26054
|
+
const collectRunProperties = (params2, rPrNode, translator2 = translator$_) => {
|
|
25983
26055
|
if (!rPrNode) return { entries: [], hadRPr: false, styleChangeMarks: [] };
|
|
25984
26056
|
const result = translator2.encode({ ...params2, nodes: [rPrNode] }) || {};
|
|
25985
26057
|
let entries = [];
|
|
@@ -26452,7 +26524,7 @@ const ensureTrackedWrapper = (runs, trackingMarksByType = /* @__PURE__ */ new Ma
|
|
|
26452
26524
|
}
|
|
26453
26525
|
return runs;
|
|
26454
26526
|
};
|
|
26455
|
-
const XML_NODE_NAME$
|
|
26527
|
+
const XML_NODE_NAME$m = "w:hyperlink";
|
|
26456
26528
|
const SD_NODE_NAME$e = "link";
|
|
26457
26529
|
const _createAttributeHandler = (xmlName, sdName) => ({
|
|
26458
26530
|
xmlName,
|
|
@@ -26460,7 +26532,7 @@ const _createAttributeHandler = (xmlName, sdName) => ({
|
|
|
26460
26532
|
encode: (attributes) => attributes[xmlName],
|
|
26461
26533
|
decode: (attributes) => attributes[sdName]
|
|
26462
26534
|
});
|
|
26463
|
-
const validXmlAttributes$
|
|
26535
|
+
const validXmlAttributes$d = [
|
|
26464
26536
|
_createAttributeHandler("w:anchor", "anchor"),
|
|
26465
26537
|
_createAttributeHandler("w:docLocation", "docLocation"),
|
|
26466
26538
|
{
|
|
@@ -26473,7 +26545,7 @@ const validXmlAttributes$b = [
|
|
|
26473
26545
|
_createAttributeHandler("r:id", "rId"),
|
|
26474
26546
|
_createAttributeHandler("w:tgtFrame", "target")
|
|
26475
26547
|
];
|
|
26476
|
-
const encode$
|
|
26548
|
+
const encode$v = (params2, encodedAttrs) => {
|
|
26477
26549
|
const { nodes, docx, nodeListHandler } = params2;
|
|
26478
26550
|
const node = nodes[0];
|
|
26479
26551
|
let href = _resolveHref(docx, encodedAttrs);
|
|
@@ -26507,7 +26579,7 @@ const _resolveHref = (docx, encodedAttrs) => {
|
|
|
26507
26579
|
}
|
|
26508
26580
|
return href;
|
|
26509
26581
|
};
|
|
26510
|
-
function decode$
|
|
26582
|
+
function decode$x(params2) {
|
|
26511
26583
|
const { hyperlinkGroup = [params2.node] } = params2.extraParams || {};
|
|
26512
26584
|
const node = hyperlinkGroup[0];
|
|
26513
26585
|
const linkMark = node.marks.find((m2) => m2.type === "link");
|
|
@@ -26556,55 +26628,55 @@ function _addNewLinkRelationship(params2, link) {
|
|
|
26556
26628
|
});
|
|
26557
26629
|
return id;
|
|
26558
26630
|
}
|
|
26559
|
-
const config$
|
|
26560
|
-
xmlName: XML_NODE_NAME$
|
|
26631
|
+
const config$j = {
|
|
26632
|
+
xmlName: XML_NODE_NAME$m,
|
|
26561
26633
|
sdNodeOrKeyName: SD_NODE_NAME$e,
|
|
26562
26634
|
type: NodeTranslator.translatorTypes.NODE,
|
|
26563
|
-
encode: encode$
|
|
26564
|
-
decode: decode$
|
|
26565
|
-
attributes: validXmlAttributes$
|
|
26635
|
+
encode: encode$v,
|
|
26636
|
+
decode: decode$x,
|
|
26637
|
+
attributes: validXmlAttributes$d
|
|
26566
26638
|
};
|
|
26567
|
-
const translator$
|
|
26568
|
-
const encode$
|
|
26639
|
+
const translator$Z = NodeTranslator.from(config$j);
|
|
26640
|
+
const encode$u = (attributes) => {
|
|
26569
26641
|
return attributes["w:rsidR"];
|
|
26570
26642
|
};
|
|
26571
|
-
const decode$
|
|
26643
|
+
const decode$w = (attrs) => {
|
|
26572
26644
|
return attrs.rsidR;
|
|
26573
26645
|
};
|
|
26574
26646
|
const attrConfig$a = Object.freeze({
|
|
26575
26647
|
xmlName: "w:rsidR",
|
|
26576
26648
|
sdName: "rsidR",
|
|
26577
|
-
encode: encode$
|
|
26578
|
-
decode: decode$
|
|
26649
|
+
encode: encode$u,
|
|
26650
|
+
decode: decode$w
|
|
26579
26651
|
});
|
|
26580
|
-
const encode$
|
|
26652
|
+
const encode$t = (attributes) => {
|
|
26581
26653
|
return attributes["w:rsidRPr"];
|
|
26582
26654
|
};
|
|
26583
|
-
const decode$
|
|
26655
|
+
const decode$v = (attrs) => {
|
|
26584
26656
|
return attrs.rsidRPr;
|
|
26585
26657
|
};
|
|
26586
26658
|
const attrConfig$9 = Object.freeze({
|
|
26587
26659
|
xmlName: "w:rsidRPr",
|
|
26588
26660
|
sdName: "rsidRPr",
|
|
26589
|
-
encode: encode$
|
|
26590
|
-
decode: decode$
|
|
26661
|
+
encode: encode$t,
|
|
26662
|
+
decode: decode$v
|
|
26591
26663
|
});
|
|
26592
|
-
const encode$
|
|
26664
|
+
const encode$s = (attributes) => {
|
|
26593
26665
|
return attributes["w:rsidDel"];
|
|
26594
26666
|
};
|
|
26595
|
-
const decode$
|
|
26667
|
+
const decode$u = (attrs) => {
|
|
26596
26668
|
return attrs.rsidDel;
|
|
26597
26669
|
};
|
|
26598
26670
|
const attrConfig$8 = Object.freeze({
|
|
26599
26671
|
xmlName: "w:rsidDel",
|
|
26600
26672
|
sdName: "rsidDel",
|
|
26601
|
-
encode: encode$
|
|
26602
|
-
decode: decode$
|
|
26673
|
+
encode: encode$s,
|
|
26674
|
+
decode: decode$u
|
|
26603
26675
|
});
|
|
26604
|
-
const validXmlAttributes$
|
|
26605
|
-
const XML_NODE_NAME$
|
|
26676
|
+
const validXmlAttributes$c = [attrConfig$a, attrConfig$9, attrConfig$8];
|
|
26677
|
+
const XML_NODE_NAME$l = "w:r";
|
|
26606
26678
|
const SD_KEY_NAME = "run";
|
|
26607
|
-
const encode$
|
|
26679
|
+
const encode$r = (params2, encodedAttrs = {}) => {
|
|
26608
26680
|
const { nodes = [], nodeListHandler } = params2 || {};
|
|
26609
26681
|
const runNode = nodes[0];
|
|
26610
26682
|
if (!runNode) return void 0;
|
|
@@ -26652,11 +26724,17 @@ const encode$p = (params2, encodedAttrs = {}) => {
|
|
|
26652
26724
|
}
|
|
26653
26725
|
return runNodeResult;
|
|
26654
26726
|
};
|
|
26655
|
-
const decode$
|
|
26727
|
+
const decode$t = (params2, decodedAttrs = {}) => {
|
|
26656
26728
|
const { node } = params2 || {};
|
|
26657
26729
|
if (!node) return void 0;
|
|
26658
26730
|
const isLinkNode = node.marks?.some((m2) => m2.type === "link");
|
|
26659
|
-
if (isLinkNode)
|
|
26731
|
+
if (isLinkNode) {
|
|
26732
|
+
const extraParams = {
|
|
26733
|
+
...params2.extraParams,
|
|
26734
|
+
linkProcessed: true
|
|
26735
|
+
};
|
|
26736
|
+
return translator$Z.decode({ ...params2, extraParams });
|
|
26737
|
+
}
|
|
26660
26738
|
const { runNode: runNodeForExport, trackingMarksByType } = prepareRunTrackingContext(node);
|
|
26661
26739
|
const runAttrs = runNodeForExport.attrs || {};
|
|
26662
26740
|
const runProperties = Array.isArray(runAttrs.runProperties) ? runAttrs.runProperties : [];
|
|
@@ -26711,7 +26789,7 @@ const decode$r = (params2, decodedAttrs = {}) => {
|
|
|
26711
26789
|
runs.push(trackedClone);
|
|
26712
26790
|
return;
|
|
26713
26791
|
}
|
|
26714
|
-
const runWrapper = { name: XML_NODE_NAME$
|
|
26792
|
+
const runWrapper = { name: XML_NODE_NAME$l, elements: [] };
|
|
26715
26793
|
applyBaseRunProps(runWrapper);
|
|
26716
26794
|
if (!Array.isArray(runWrapper.elements)) runWrapper.elements = [];
|
|
26717
26795
|
runWrapper.elements.push(cloneXmlNode(child));
|
|
@@ -26719,7 +26797,7 @@ const decode$r = (params2, decodedAttrs = {}) => {
|
|
|
26719
26797
|
});
|
|
26720
26798
|
const trackedRuns = ensureTrackedWrapper(runs, trackingMarksByType);
|
|
26721
26799
|
if (!trackedRuns.length) {
|
|
26722
|
-
const emptyRun = { name: XML_NODE_NAME$
|
|
26800
|
+
const emptyRun = { name: XML_NODE_NAME$l, elements: [] };
|
|
26723
26801
|
applyBaseRunProps(emptyRun);
|
|
26724
26802
|
trackedRuns.push(emptyRun);
|
|
26725
26803
|
}
|
|
@@ -26733,15 +26811,15 @@ const decode$r = (params2, decodedAttrs = {}) => {
|
|
|
26733
26811
|
}
|
|
26734
26812
|
return trackedRuns;
|
|
26735
26813
|
};
|
|
26736
|
-
const config$
|
|
26737
|
-
xmlName: XML_NODE_NAME$
|
|
26814
|
+
const config$i = {
|
|
26815
|
+
xmlName: XML_NODE_NAME$l,
|
|
26738
26816
|
sdNodeOrKeyName: SD_KEY_NAME,
|
|
26739
26817
|
type: NodeTranslator.translatorTypes.NODE,
|
|
26740
|
-
encode: encode$
|
|
26741
|
-
decode: decode$
|
|
26742
|
-
attributes: validXmlAttributes$
|
|
26818
|
+
encode: encode$r,
|
|
26819
|
+
decode: decode$t,
|
|
26820
|
+
attributes: validXmlAttributes$c
|
|
26743
26821
|
};
|
|
26744
|
-
const translator$
|
|
26822
|
+
const translator$Y = NodeTranslator.from(config$i);
|
|
26745
26823
|
function preProcessVerticalMergeCells(table, { editorSchema }) {
|
|
26746
26824
|
if (!table || !Array.isArray(table.content)) {
|
|
26747
26825
|
return table;
|
|
@@ -26782,13 +26860,13 @@ function preProcessVerticalMergeCells(table, { editorSchema }) {
|
|
|
26782
26860
|
}
|
|
26783
26861
|
return table;
|
|
26784
26862
|
}
|
|
26785
|
-
const translator$
|
|
26863
|
+
const translator$X = NodeTranslator.from({
|
|
26786
26864
|
xmlName: "w:cantSplit",
|
|
26787
26865
|
sdNodeOrKeyName: "cantSplit",
|
|
26788
26866
|
encode: ({ nodes }) => ["1", "true"].includes(nodes[0].attributes?.["w:val"] ?? "1"),
|
|
26789
26867
|
decode: ({ node }) => node.attrs?.cantSplit ? { attributes: {} } : void 0
|
|
26790
26868
|
});
|
|
26791
|
-
const translator$
|
|
26869
|
+
const translator$W = NodeTranslator.from({
|
|
26792
26870
|
xmlName: "w:cnfStyle",
|
|
26793
26871
|
sdNodeOrKeyName: "cnfStyle",
|
|
26794
26872
|
attributes: [
|
|
@@ -26814,8 +26892,8 @@ const translator$U = NodeTranslator.from({
|
|
|
26814
26892
|
return Object.keys(decodedAttrs).length > 0 ? { attributes: decodedAttrs } : void 0;
|
|
26815
26893
|
}
|
|
26816
26894
|
});
|
|
26817
|
-
const translator$
|
|
26818
|
-
const translator$
|
|
26895
|
+
const translator$V = NodeTranslator.from(createSingleAttrPropertyHandler("w:divId"));
|
|
26896
|
+
const translator$U = NodeTranslator.from(
|
|
26819
26897
|
createSingleAttrPropertyHandler(
|
|
26820
26898
|
"w:gridAfter",
|
|
26821
26899
|
null,
|
|
@@ -26824,7 +26902,7 @@ const translator$S = NodeTranslator.from(
|
|
|
26824
26902
|
(v2) => integerToString(v2)
|
|
26825
26903
|
)
|
|
26826
26904
|
);
|
|
26827
|
-
const translator$
|
|
26905
|
+
const translator$T = NodeTranslator.from(
|
|
26828
26906
|
createSingleAttrPropertyHandler(
|
|
26829
26907
|
"w:gridBefore",
|
|
26830
26908
|
null,
|
|
@@ -26833,21 +26911,21 @@ const translator$R = NodeTranslator.from(
|
|
|
26833
26911
|
(v2) => integerToString(v2)
|
|
26834
26912
|
)
|
|
26835
26913
|
);
|
|
26836
|
-
const translator$
|
|
26914
|
+
const translator$S = NodeTranslator.from({
|
|
26837
26915
|
xmlName: "w:hidden",
|
|
26838
26916
|
sdNodeOrKeyName: "hidden",
|
|
26839
26917
|
encode: ({ nodes }) => parseBoolean(nodes[0].attributes?.["w:val"] ?? "1"),
|
|
26840
26918
|
decode: ({ node }) => node.attrs.hidden ? { attributes: {} } : void 0
|
|
26841
26919
|
});
|
|
26842
|
-
const translator$
|
|
26843
|
-
const translator$
|
|
26844
|
-
const translator$
|
|
26920
|
+
const translator$R = NodeTranslator.from(createSingleAttrPropertyHandler("w:jc", "justification"));
|
|
26921
|
+
const translator$Q = NodeTranslator.from(createMeasurementPropertyHandler("w:tblCellSpacing", "tableCellSpacing"));
|
|
26922
|
+
const translator$P = NodeTranslator.from({
|
|
26845
26923
|
xmlName: "w:tblHeader",
|
|
26846
26924
|
sdNodeOrKeyName: "repeatHeader",
|
|
26847
26925
|
encode: ({ nodes }) => parseBoolean(nodes[0].attributes?.["w:val"] ?? "1"),
|
|
26848
26926
|
decode: ({ node }) => node.attrs.repeatHeader ? { attributes: {} } : void 0
|
|
26849
26927
|
});
|
|
26850
|
-
const translator$
|
|
26928
|
+
const translator$O = NodeTranslator.from({
|
|
26851
26929
|
xmlName: "w:trHeight",
|
|
26852
26930
|
sdNodeOrKeyName: "rowHeight",
|
|
26853
26931
|
encode: ({ nodes }) => {
|
|
@@ -26874,11 +26952,11 @@ const translator$M = NodeTranslator.from({
|
|
|
26874
26952
|
return Object.keys(heightAttrs).length > 0 ? { attributes: heightAttrs } : void 0;
|
|
26875
26953
|
}
|
|
26876
26954
|
});
|
|
26877
|
-
const translator$
|
|
26878
|
-
const translator$
|
|
26879
|
-
const XML_NODE_NAME$
|
|
26880
|
-
const SD_ATTR_KEY$
|
|
26881
|
-
const encode$
|
|
26955
|
+
const translator$N = NodeTranslator.from(createMeasurementPropertyHandler("w:wAfter"));
|
|
26956
|
+
const translator$M = NodeTranslator.from(createMeasurementPropertyHandler("w:wBefore"));
|
|
26957
|
+
const XML_NODE_NAME$k = "w:trPr";
|
|
26958
|
+
const SD_ATTR_KEY$6 = "tableRowProperties";
|
|
26959
|
+
const encode$q = (params2) => {
|
|
26882
26960
|
const { nodes } = params2;
|
|
26883
26961
|
const node = nodes[0];
|
|
26884
26962
|
let attributes = {
|
|
@@ -26892,12 +26970,12 @@ const encode$o = (params2) => {
|
|
|
26892
26970
|
};
|
|
26893
26971
|
return {
|
|
26894
26972
|
type: NodeTranslator.translatorTypes.ATTRIBUTE,
|
|
26895
|
-
xmlName: XML_NODE_NAME$
|
|
26896
|
-
sdNodeOrKeyName: SD_ATTR_KEY$
|
|
26973
|
+
xmlName: XML_NODE_NAME$k,
|
|
26974
|
+
sdNodeOrKeyName: SD_ATTR_KEY$6,
|
|
26897
26975
|
attributes
|
|
26898
26976
|
};
|
|
26899
26977
|
};
|
|
26900
|
-
const decode$
|
|
26978
|
+
const decode$s = (params2) => {
|
|
26901
26979
|
const { tableRowProperties = {} } = params2.node.attrs || {};
|
|
26902
26980
|
const elements = decodeProperties(propertyTranslatorsBySdName$2, tableRowProperties);
|
|
26903
26981
|
const newNode = {
|
|
@@ -26909,6 +26987,8 @@ const decode$q = (params2) => {
|
|
|
26909
26987
|
return newNode;
|
|
26910
26988
|
};
|
|
26911
26989
|
const propertyTranslators$3 = [
|
|
26990
|
+
translator$X,
|
|
26991
|
+
translator$W,
|
|
26912
26992
|
translator$V,
|
|
26913
26993
|
translator$U,
|
|
26914
26994
|
translator$T,
|
|
@@ -26918,9 +26998,7 @@ const propertyTranslators$3 = [
|
|
|
26918
26998
|
translator$P,
|
|
26919
26999
|
translator$O,
|
|
26920
27000
|
translator$N,
|
|
26921
|
-
translator$M
|
|
26922
|
-
translator$L,
|
|
26923
|
-
translator$K
|
|
27001
|
+
translator$M
|
|
26924
27002
|
];
|
|
26925
27003
|
const propertyTranslatorsByXmlName$2 = {};
|
|
26926
27004
|
propertyTranslators$3.forEach((translator2) => {
|
|
@@ -26930,25 +27008,25 @@ const propertyTranslatorsBySdName$2 = {};
|
|
|
26930
27008
|
propertyTranslators$3.forEach((translator2) => {
|
|
26931
27009
|
propertyTranslatorsBySdName$2[translator2.sdNodeOrKeyName] = translator2;
|
|
26932
27010
|
});
|
|
26933
|
-
const config$
|
|
26934
|
-
xmlName: XML_NODE_NAME$
|
|
26935
|
-
sdNodeOrKeyName: SD_ATTR_KEY$
|
|
27011
|
+
const config$h = {
|
|
27012
|
+
xmlName: XML_NODE_NAME$k,
|
|
27013
|
+
sdNodeOrKeyName: SD_ATTR_KEY$6,
|
|
26936
27014
|
type: NodeTranslator.translatorTypes.ATTRIBUTE,
|
|
26937
|
-
encode: encode$
|
|
26938
|
-
decode: decode$
|
|
27015
|
+
encode: encode$q,
|
|
27016
|
+
decode: decode$s
|
|
26939
27017
|
};
|
|
26940
|
-
const translator$
|
|
26941
|
-
const XML_NODE_NAME$
|
|
27018
|
+
const translator$L = NodeTranslator.from(config$h);
|
|
27019
|
+
const XML_NODE_NAME$j = "w:tr";
|
|
26942
27020
|
const SD_NODE_NAME$d = "tableRow";
|
|
26943
|
-
const validXmlAttributes$
|
|
27021
|
+
const validXmlAttributes$b = ["w:rsidDel", "w:rsidR", "w:rsidRPr", "w:rsidTr", "w14:paraId", "w14:textId"].map(
|
|
26944
27022
|
(xmlName) => createAttributeHandler(xmlName)
|
|
26945
27023
|
);
|
|
26946
|
-
const encode$
|
|
27024
|
+
const encode$p = (params2, encodedAttrs) => {
|
|
26947
27025
|
const { row } = params2.extraParams;
|
|
26948
27026
|
let tableRowProperties = {};
|
|
26949
27027
|
const tPr = row.elements.find((el) => el.name === "w:trPr");
|
|
26950
27028
|
if (tPr) {
|
|
26951
|
-
({ attributes: tableRowProperties } = translator$
|
|
27029
|
+
({ attributes: tableRowProperties } = translator$L.encode({
|
|
26952
27030
|
...params2,
|
|
26953
27031
|
nodes: [tPr]
|
|
26954
27032
|
}));
|
|
@@ -26961,7 +27039,7 @@ const encode$n = (params2, encodedAttrs) => {
|
|
|
26961
27039
|
let currentColumnIndex = 0;
|
|
26962
27040
|
const content = cellNodes?.map((n) => {
|
|
26963
27041
|
let columnWidth = gridColumnWidths?.[currentColumnIndex] || null;
|
|
26964
|
-
const result = translator$
|
|
27042
|
+
const result = translator$c.encode({
|
|
26965
27043
|
...params2,
|
|
26966
27044
|
extraParams: {
|
|
26967
27045
|
...params2.extraParams,
|
|
@@ -26983,7 +27061,7 @@ const encode$n = (params2, encodedAttrs) => {
|
|
|
26983
27061
|
};
|
|
26984
27062
|
return newNode;
|
|
26985
27063
|
};
|
|
26986
|
-
const decode$
|
|
27064
|
+
const decode$r = (params2, decodedAttrs) => {
|
|
26987
27065
|
const { node } = params2;
|
|
26988
27066
|
const elements = translateChildNodes(params2);
|
|
26989
27067
|
if (node.attrs?.tableRowProperties) {
|
|
@@ -26995,7 +27073,7 @@ const decode$p = (params2, decodedAttrs) => {
|
|
|
26995
27073
|
}
|
|
26996
27074
|
}
|
|
26997
27075
|
tableRowProperties["cantSplit"] = node.attrs["cantSplit"];
|
|
26998
|
-
const trPr = translator$
|
|
27076
|
+
const trPr = translator$L.decode({
|
|
26999
27077
|
...params2,
|
|
27000
27078
|
node: { ...node, attrs: { ...node.attrs, tableRowProperties } }
|
|
27001
27079
|
});
|
|
@@ -27007,22 +27085,22 @@ const decode$p = (params2, decodedAttrs) => {
|
|
|
27007
27085
|
elements
|
|
27008
27086
|
};
|
|
27009
27087
|
};
|
|
27010
|
-
const config$
|
|
27011
|
-
xmlName: XML_NODE_NAME$
|
|
27088
|
+
const config$g = {
|
|
27089
|
+
xmlName: XML_NODE_NAME$j,
|
|
27012
27090
|
sdNodeOrKeyName: SD_NODE_NAME$d,
|
|
27013
27091
|
type: NodeTranslator.translatorTypes.NODE,
|
|
27014
|
-
encode: encode$
|
|
27015
|
-
decode: decode$
|
|
27016
|
-
attributes: validXmlAttributes$
|
|
27092
|
+
encode: encode$p,
|
|
27093
|
+
decode: decode$r,
|
|
27094
|
+
attributes: validXmlAttributes$b
|
|
27017
27095
|
};
|
|
27018
|
-
const translator$
|
|
27019
|
-
const translator$
|
|
27096
|
+
const translator$K = NodeTranslator.from(config$g);
|
|
27097
|
+
const translator$J = NodeTranslator.from({
|
|
27020
27098
|
xmlName: "w:bidiVisual",
|
|
27021
27099
|
sdNodeOrKeyName: "rightToLeft",
|
|
27022
27100
|
encode: ({ nodes }) => parseBoolean(nodes[0].attributes?.["w:val"] ?? "1"),
|
|
27023
27101
|
decode: ({ node }) => node.attrs.rightToLeft ? { attributes: {} } : void 0
|
|
27024
27102
|
});
|
|
27025
|
-
const translator$
|
|
27103
|
+
const translator$I = NodeTranslator.from({
|
|
27026
27104
|
xmlName: "w:shd",
|
|
27027
27105
|
sdNodeOrKeyName: "shading",
|
|
27028
27106
|
attributes: [
|
|
@@ -27044,11 +27122,11 @@ const translator$G = NodeTranslator.from({
|
|
|
27044
27122
|
return Object.keys(decodedAttrs).length > 0 ? { attributes: decodedAttrs } : void 0;
|
|
27045
27123
|
}
|
|
27046
27124
|
});
|
|
27047
|
-
const translator$
|
|
27048
|
-
const translator$
|
|
27049
|
-
const translator$
|
|
27050
|
-
const translator$
|
|
27051
|
-
const translator$
|
|
27125
|
+
const translator$H = NodeTranslator.from(createSingleAttrPropertyHandler("w:tblCaption", "caption"));
|
|
27126
|
+
const translator$G = NodeTranslator.from(createSingleAttrPropertyHandler("w:tblDescription", "description"));
|
|
27127
|
+
const translator$F = NodeTranslator.from(createMeasurementPropertyHandler("w:tblInd", "tableIndent"));
|
|
27128
|
+
const translator$E = NodeTranslator.from(createSingleAttrPropertyHandler("w:tblLayout", "tableLayout", "w:type"));
|
|
27129
|
+
const translator$D = NodeTranslator.from({
|
|
27052
27130
|
xmlName: "w:tblLook",
|
|
27053
27131
|
sdNodeOrKeyName: "tblLook",
|
|
27054
27132
|
attributes: ["w:firstColumn", "w:firstRow", "w:lastColumn", "w:lastRow", "w:noHBand", "w:noVBand"].map((attr) => createAttributeHandler(attr, null, parseBoolean, booleanToString)).concat([createAttributeHandler("w:val")]),
|
|
@@ -27060,16 +27138,16 @@ const translator$B = NodeTranslator.from({
|
|
|
27060
27138
|
return Object.keys(decodedAttrs).length > 0 ? { attributes: decodedAttrs } : void 0;
|
|
27061
27139
|
}
|
|
27062
27140
|
});
|
|
27063
|
-
const translator$
|
|
27064
|
-
const translator$
|
|
27065
|
-
const translator$
|
|
27141
|
+
const translator$C = NodeTranslator.from(createSingleAttrPropertyHandler("w:tblOverlap", "overlap"));
|
|
27142
|
+
const translator$B = NodeTranslator.from(createSingleAttrPropertyHandler("w:tblStyle", "tableStyleId"));
|
|
27143
|
+
const translator$A = NodeTranslator.from(
|
|
27066
27144
|
createSingleAttrPropertyHandler("w:tblStyleColBandSize", "tableStyleColBandSize")
|
|
27067
27145
|
);
|
|
27068
|
-
const translator$
|
|
27146
|
+
const translator$z = NodeTranslator.from(
|
|
27069
27147
|
createSingleAttrPropertyHandler("w:tblStyleRowBandSize", "tableStyleRowBandSize")
|
|
27070
27148
|
);
|
|
27071
|
-
const translator$
|
|
27072
|
-
const translator$
|
|
27149
|
+
const translator$y = NodeTranslator.from(createMeasurementPropertyHandler("w:tblW", "tableWidth"));
|
|
27150
|
+
const translator$x = NodeTranslator.from({
|
|
27073
27151
|
xmlName: "w:tblpPr",
|
|
27074
27152
|
sdNodeOrKeyName: "floatingTableProperties",
|
|
27075
27153
|
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))),
|
|
@@ -27081,29 +27159,29 @@ const translator$v = NodeTranslator.from({
|
|
|
27081
27159
|
return Object.keys(decodedAttrs).length > 0 ? { attributes: decodedAttrs } : void 0;
|
|
27082
27160
|
}
|
|
27083
27161
|
});
|
|
27084
|
-
const translator$
|
|
27085
|
-
const translator$
|
|
27086
|
-
const translator$
|
|
27087
|
-
const translator$
|
|
27088
|
-
const translator$
|
|
27089
|
-
const translator$
|
|
27090
|
-
const translator$
|
|
27091
|
-
const translator$
|
|
27092
|
-
const translator$
|
|
27093
|
-
const translator$
|
|
27094
|
-
const translator$
|
|
27095
|
-
const translator$
|
|
27096
|
-
const translator$
|
|
27097
|
-
const translator$
|
|
27098
|
-
const XML_NODE_NAME$
|
|
27099
|
-
const SD_ATTR_KEY$
|
|
27100
|
-
const encode$
|
|
27162
|
+
const translator$w = NodeTranslator.from(createBorderPropertyHandler("w:bottom"));
|
|
27163
|
+
const translator$v = NodeTranslator.from(createMeasurementPropertyHandler("w:bottom", "marginBottom"));
|
|
27164
|
+
const translator$u = NodeTranslator.from(createBorderPropertyHandler("w:end"));
|
|
27165
|
+
const translator$t = NodeTranslator.from(createMeasurementPropertyHandler("w:end", "marginEnd"));
|
|
27166
|
+
const translator$s = NodeTranslator.from(createBorderPropertyHandler("w:insideH"));
|
|
27167
|
+
const translator$r = NodeTranslator.from(createBorderPropertyHandler("w:insideV"));
|
|
27168
|
+
const translator$q = NodeTranslator.from(createBorderPropertyHandler("w:left"));
|
|
27169
|
+
const translator$p = NodeTranslator.from(createMeasurementPropertyHandler("w:left", "marginLeft"));
|
|
27170
|
+
const translator$o = NodeTranslator.from(createBorderPropertyHandler("w:right"));
|
|
27171
|
+
const translator$n = NodeTranslator.from(createMeasurementPropertyHandler("w:right", "marginRight"));
|
|
27172
|
+
const translator$m = NodeTranslator.from(createBorderPropertyHandler("w:start"));
|
|
27173
|
+
const translator$l = NodeTranslator.from(createMeasurementPropertyHandler("w:start", "marginStart"));
|
|
27174
|
+
const translator$k = NodeTranslator.from(createBorderPropertyHandler("w:top"));
|
|
27175
|
+
const translator$j = NodeTranslator.from(createMeasurementPropertyHandler("w:top", "marginTop"));
|
|
27176
|
+
const XML_NODE_NAME$i = "w:tblBorders";
|
|
27177
|
+
const SD_ATTR_KEY$5 = "borders";
|
|
27178
|
+
const encode$o = (params2) => {
|
|
27101
27179
|
const { nodes } = params2;
|
|
27102
27180
|
const node = nodes[0];
|
|
27103
27181
|
const attributes = encodeProperties(node, tblBordersTranslatorsByXmlName);
|
|
27104
27182
|
return Object.keys(attributes).length > 0 ? attributes : void 0;
|
|
27105
27183
|
};
|
|
27106
|
-
const decode$
|
|
27184
|
+
const decode$q = (params2) => {
|
|
27107
27185
|
const { borders = {} } = params2.node.attrs || {};
|
|
27108
27186
|
const elements = decodeProperties(tblBordersTranslatorsBySdName, borders);
|
|
27109
27187
|
const newNode = {
|
|
@@ -27115,14 +27193,14 @@ const decode$o = (params2) => {
|
|
|
27115
27193
|
return newNode;
|
|
27116
27194
|
};
|
|
27117
27195
|
const propertyTranslators$2 = [
|
|
27196
|
+
translator$w,
|
|
27118
27197
|
translator$u,
|
|
27119
27198
|
translator$s,
|
|
27199
|
+
translator$r,
|
|
27120
27200
|
translator$q,
|
|
27121
|
-
translator$p,
|
|
27122
27201
|
translator$o,
|
|
27123
27202
|
translator$m,
|
|
27124
|
-
translator$k
|
|
27125
|
-
translator$i
|
|
27203
|
+
translator$k
|
|
27126
27204
|
];
|
|
27127
27205
|
const tblBordersTranslatorsByXmlName = {};
|
|
27128
27206
|
const tblBordersTranslatorsBySdName = {};
|
|
@@ -27130,27 +27208,27 @@ propertyTranslators$2.forEach((translator2) => {
|
|
|
27130
27208
|
tblBordersTranslatorsByXmlName[translator2.xmlName] = translator2;
|
|
27131
27209
|
tblBordersTranslatorsBySdName[translator2.sdNodeOrKeyName] = translator2;
|
|
27132
27210
|
});
|
|
27133
|
-
const translator$
|
|
27134
|
-
xmlName: XML_NODE_NAME$
|
|
27135
|
-
sdNodeOrKeyName: SD_ATTR_KEY$
|
|
27211
|
+
const translator$i = NodeTranslator.from({
|
|
27212
|
+
xmlName: XML_NODE_NAME$i,
|
|
27213
|
+
sdNodeOrKeyName: SD_ATTR_KEY$5,
|
|
27136
27214
|
type: NodeTranslator.translatorTypes.NODE,
|
|
27137
27215
|
attributes: [],
|
|
27138
|
-
encode: encode$
|
|
27139
|
-
decode: decode$
|
|
27216
|
+
encode: encode$o,
|
|
27217
|
+
decode: decode$q
|
|
27140
27218
|
});
|
|
27141
|
-
const XML_NODE_NAME$
|
|
27142
|
-
const SD_ATTR_KEY$
|
|
27143
|
-
const encode$
|
|
27219
|
+
const XML_NODE_NAME$h = "w:tblCellMar";
|
|
27220
|
+
const SD_ATTR_KEY$4 = "cellMargins";
|
|
27221
|
+
const encode$n = (params2) => {
|
|
27144
27222
|
const { nodes } = params2;
|
|
27145
27223
|
const node = nodes[0];
|
|
27146
27224
|
const attributes = encodeProperties(node, propertyTranslatorsByXmlName$1);
|
|
27147
27225
|
return Object.keys(attributes).length > 0 ? attributes : void 0;
|
|
27148
27226
|
};
|
|
27149
|
-
const decode$
|
|
27227
|
+
const decode$p = (params2) => {
|
|
27150
27228
|
const { cellMargins = {} } = params2.node.attrs || {};
|
|
27151
27229
|
const elements = decodeProperties(propertyTranslatorsBySdName$1, cellMargins);
|
|
27152
27230
|
const newNode = {
|
|
27153
|
-
name: XML_NODE_NAME$
|
|
27231
|
+
name: XML_NODE_NAME$h,
|
|
27154
27232
|
type: "element",
|
|
27155
27233
|
attributes: {},
|
|
27156
27234
|
elements
|
|
@@ -27158,12 +27236,12 @@ const decode$n = (params2) => {
|
|
|
27158
27236
|
return newNode;
|
|
27159
27237
|
};
|
|
27160
27238
|
const propertyTranslators$1 = [
|
|
27239
|
+
translator$v,
|
|
27161
27240
|
translator$t,
|
|
27162
|
-
translator$
|
|
27241
|
+
translator$p,
|
|
27163
27242
|
translator$n,
|
|
27164
27243
|
translator$l,
|
|
27165
|
-
translator$j
|
|
27166
|
-
translator$h
|
|
27244
|
+
translator$j
|
|
27167
27245
|
];
|
|
27168
27246
|
const propertyTranslatorsByXmlName$1 = {};
|
|
27169
27247
|
const propertyTranslatorsBySdName$1 = {};
|
|
@@ -27171,27 +27249,27 @@ propertyTranslators$1.forEach((translator2) => {
|
|
|
27171
27249
|
propertyTranslatorsByXmlName$1[translator2.xmlName] = translator2;
|
|
27172
27250
|
propertyTranslatorsBySdName$1[translator2.sdNodeOrKeyName] = translator2;
|
|
27173
27251
|
});
|
|
27174
|
-
const translator$
|
|
27175
|
-
xmlName: XML_NODE_NAME$
|
|
27176
|
-
sdNodeOrKeyName: SD_ATTR_KEY$
|
|
27252
|
+
const translator$h = NodeTranslator.from({
|
|
27253
|
+
xmlName: XML_NODE_NAME$h,
|
|
27254
|
+
sdNodeOrKeyName: SD_ATTR_KEY$4,
|
|
27177
27255
|
type: NodeTranslator.translatorTypes.NODE,
|
|
27178
27256
|
attributes: [],
|
|
27179
|
-
encode: encode$
|
|
27180
|
-
decode: decode$
|
|
27257
|
+
encode: encode$n,
|
|
27258
|
+
decode: decode$p
|
|
27181
27259
|
});
|
|
27182
|
-
const XML_NODE_NAME$
|
|
27183
|
-
const SD_ATTR_KEY$
|
|
27184
|
-
const encode$
|
|
27260
|
+
const XML_NODE_NAME$g = "w:tblPr";
|
|
27261
|
+
const SD_ATTR_KEY$3 = "tableProperties";
|
|
27262
|
+
const encode$m = (params2) => {
|
|
27185
27263
|
const { nodes } = params2;
|
|
27186
27264
|
const node = nodes[0];
|
|
27187
27265
|
const attributes = encodeProperties(node, propertyTranslatorsByXmlName);
|
|
27188
27266
|
return {
|
|
27189
|
-
xmlName: XML_NODE_NAME$
|
|
27190
|
-
sdNodeOrKeyName: SD_ATTR_KEY$
|
|
27267
|
+
xmlName: XML_NODE_NAME$g,
|
|
27268
|
+
sdNodeOrKeyName: SD_ATTR_KEY$3,
|
|
27191
27269
|
attributes
|
|
27192
27270
|
};
|
|
27193
27271
|
};
|
|
27194
|
-
const decode$
|
|
27272
|
+
const decode$o = (params2) => {
|
|
27195
27273
|
const { tableProperties = {} } = params2.node.attrs || {};
|
|
27196
27274
|
const elements = decodeProperties(propertyTranslatorsBySdName, tableProperties);
|
|
27197
27275
|
const newNode = {
|
|
@@ -27203,11 +27281,13 @@ const decode$m = (params2) => {
|
|
|
27203
27281
|
return newNode;
|
|
27204
27282
|
};
|
|
27205
27283
|
const propertyTranslators = [
|
|
27284
|
+
translator$J,
|
|
27285
|
+
translator$R,
|
|
27286
|
+
translator$I,
|
|
27206
27287
|
translator$H,
|
|
27207
|
-
translator$
|
|
27288
|
+
translator$Q,
|
|
27208
27289
|
translator$G,
|
|
27209
27290
|
translator$F,
|
|
27210
|
-
translator$O,
|
|
27211
27291
|
translator$E,
|
|
27212
27292
|
translator$D,
|
|
27213
27293
|
translator$C,
|
|
@@ -27216,10 +27296,8 @@ const propertyTranslators = [
|
|
|
27216
27296
|
translator$z,
|
|
27217
27297
|
translator$y,
|
|
27218
27298
|
translator$x,
|
|
27219
|
-
translator$
|
|
27220
|
-
translator$
|
|
27221
|
-
translator$g,
|
|
27222
|
-
translator$f
|
|
27299
|
+
translator$i,
|
|
27300
|
+
translator$h
|
|
27223
27301
|
];
|
|
27224
27302
|
const propertyTranslatorsByXmlName = {};
|
|
27225
27303
|
const propertyTranslatorsBySdName = {};
|
|
@@ -27227,14 +27305,14 @@ propertyTranslators.forEach((translator2) => {
|
|
|
27227
27305
|
propertyTranslatorsByXmlName[translator2.xmlName] = translator2;
|
|
27228
27306
|
propertyTranslatorsBySdName[translator2.sdNodeOrKeyName] = translator2;
|
|
27229
27307
|
});
|
|
27230
|
-
const config$
|
|
27231
|
-
xmlName: XML_NODE_NAME$
|
|
27232
|
-
sdNodeOrKeyName: SD_ATTR_KEY$
|
|
27233
|
-
encode: encode$
|
|
27234
|
-
decode: decode$
|
|
27308
|
+
const config$f = {
|
|
27309
|
+
xmlName: XML_NODE_NAME$g,
|
|
27310
|
+
sdNodeOrKeyName: SD_ATTR_KEY$3,
|
|
27311
|
+
encode: encode$m,
|
|
27312
|
+
decode: decode$o
|
|
27235
27313
|
};
|
|
27236
|
-
const translator$
|
|
27237
|
-
const translator$
|
|
27314
|
+
const translator$g = NodeTranslator.from(config$f);
|
|
27315
|
+
const translator$f = NodeTranslator.from(
|
|
27238
27316
|
createSingleAttrPropertyHandler("w:gridCol", "col", "w:w", parseInteger, integerToString)
|
|
27239
27317
|
);
|
|
27240
27318
|
const DEFAULT_COLUMN_WIDTH_PX = 100;
|
|
@@ -27284,20 +27362,20 @@ const resolveFallbackColumnWidthTwips = (params2, totalColumns, cellMinWidthTwip
|
|
|
27284
27362
|
}
|
|
27285
27363
|
return Math.max(fallbackWidthTwips, cellMinWidthTwips);
|
|
27286
27364
|
};
|
|
27287
|
-
const XML_NODE_NAME$
|
|
27288
|
-
const SD_ATTR_KEY = "grid";
|
|
27365
|
+
const XML_NODE_NAME$f = "w:tblGrid";
|
|
27366
|
+
const SD_ATTR_KEY$2 = "grid";
|
|
27289
27367
|
const cellMinWidth = pixelsToTwips(10);
|
|
27290
|
-
const encode$
|
|
27368
|
+
const encode$l = (params2) => {
|
|
27291
27369
|
const { nodes } = params2;
|
|
27292
27370
|
const node = nodes[0];
|
|
27293
|
-
const attributes = encodeProperties(node, { [translator$
|
|
27371
|
+
const attributes = encodeProperties(node, { [translator$f.xmlName]: translator$f }, true);
|
|
27294
27372
|
return {
|
|
27295
|
-
xmlName: XML_NODE_NAME$
|
|
27296
|
-
sdNodeOrKeyName: SD_ATTR_KEY,
|
|
27373
|
+
xmlName: XML_NODE_NAME$f,
|
|
27374
|
+
sdNodeOrKeyName: SD_ATTR_KEY$2,
|
|
27297
27375
|
attributes
|
|
27298
27376
|
};
|
|
27299
27377
|
};
|
|
27300
|
-
const decode$
|
|
27378
|
+
const decode$n = (params2) => {
|
|
27301
27379
|
const { grid: rawGrid } = params2.node.attrs || {};
|
|
27302
27380
|
const grid = Array.isArray(rawGrid) ? rawGrid : [];
|
|
27303
27381
|
const { firstRow = {} } = params2.extraParams || {};
|
|
@@ -27316,10 +27394,10 @@ const decode$l = (params2) => {
|
|
|
27316
27394
|
numericWidth = fallbackColumnWidthTwips;
|
|
27317
27395
|
}
|
|
27318
27396
|
numericWidth = Math.max(numericWidth, cellMinWidth);
|
|
27319
|
-
const decoded = translator$
|
|
27397
|
+
const decoded = translator$f.decode({
|
|
27320
27398
|
node: { type: (
|
|
27321
27399
|
/** @type {string} */
|
|
27322
|
-
translator$
|
|
27400
|
+
translator$f.sdNodeOrKeyName
|
|
27323
27401
|
), attrs: { col: numericWidth } }
|
|
27324
27402
|
});
|
|
27325
27403
|
if (decoded) elements.push(decoded);
|
|
@@ -27354,19 +27432,19 @@ const decode$l = (params2) => {
|
|
|
27354
27432
|
columnIndex++;
|
|
27355
27433
|
}
|
|
27356
27434
|
const newNode = {
|
|
27357
|
-
name: XML_NODE_NAME$
|
|
27435
|
+
name: XML_NODE_NAME$f,
|
|
27358
27436
|
attributes: {},
|
|
27359
27437
|
elements
|
|
27360
27438
|
};
|
|
27361
27439
|
return newNode;
|
|
27362
27440
|
};
|
|
27363
|
-
const config$
|
|
27364
|
-
xmlName: XML_NODE_NAME$
|
|
27365
|
-
sdNodeOrKeyName: SD_ATTR_KEY,
|
|
27366
|
-
encode: encode$
|
|
27367
|
-
decode: decode$
|
|
27441
|
+
const config$e = {
|
|
27442
|
+
xmlName: XML_NODE_NAME$f,
|
|
27443
|
+
sdNodeOrKeyName: SD_ATTR_KEY$2,
|
|
27444
|
+
encode: encode$l,
|
|
27445
|
+
decode: decode$n
|
|
27368
27446
|
};
|
|
27369
|
-
const translator$
|
|
27447
|
+
const translator$e = NodeTranslator.from(config$e);
|
|
27370
27448
|
const DEFAULT_PAGE_WIDTH_TWIPS = 12240;
|
|
27371
27449
|
const DEFAULT_PAGE_MARGIN_TWIPS = 1440;
|
|
27372
27450
|
const DEFAULT_CONTENT_WIDTH_TWIPS = DEFAULT_PAGE_WIDTH_TWIPS - 2 * DEFAULT_PAGE_MARGIN_TWIPS;
|
|
@@ -27429,19 +27507,19 @@ const buildFallbackGridForTable = ({ params: params2, rows, tableWidth, tableWid
|
|
|
27429
27507
|
columnWidths: Array(columnCount).fill(fallbackColumnWidthPx)
|
|
27430
27508
|
};
|
|
27431
27509
|
};
|
|
27432
|
-
const XML_NODE_NAME$
|
|
27510
|
+
const XML_NODE_NAME$e = "w:tbl";
|
|
27433
27511
|
const SD_NODE_NAME$c = "table";
|
|
27434
|
-
const encode$
|
|
27512
|
+
const encode$k = (params2, encodedAttrs) => {
|
|
27435
27513
|
const { nodes } = params2;
|
|
27436
27514
|
const node = nodes[0];
|
|
27437
27515
|
const tblPr = node.elements.find((el) => el.name === "w:tblPr");
|
|
27438
27516
|
if (tblPr) {
|
|
27439
|
-
const encodedProperties = translator$
|
|
27517
|
+
const encodedProperties = translator$g.encode({ ...params2, nodes: [tblPr] });
|
|
27440
27518
|
encodedAttrs["tableProperties"] = encodedProperties?.attributes || {};
|
|
27441
27519
|
}
|
|
27442
27520
|
const tblGrid = node.elements.find((el) => el.name === "w:tblGrid");
|
|
27443
27521
|
if (tblGrid) {
|
|
27444
|
-
encodedAttrs["grid"] = translator$
|
|
27522
|
+
encodedAttrs["grid"] = translator$e.encode({ ...params2, nodes: [tblGrid] }).attributes;
|
|
27445
27523
|
}
|
|
27446
27524
|
[
|
|
27447
27525
|
"tableStyleId",
|
|
@@ -27508,7 +27586,7 @@ const encode$i = (params2, encodedAttrs) => {
|
|
|
27508
27586
|
}
|
|
27509
27587
|
const content = [];
|
|
27510
27588
|
rows.forEach((row) => {
|
|
27511
|
-
const result = translator$
|
|
27589
|
+
const result = translator$K.encode({
|
|
27512
27590
|
...params2,
|
|
27513
27591
|
nodes: [row],
|
|
27514
27592
|
extraParams: {
|
|
@@ -27527,13 +27605,13 @@ const encode$i = (params2, encodedAttrs) => {
|
|
|
27527
27605
|
attrs: encodedAttrs
|
|
27528
27606
|
};
|
|
27529
27607
|
};
|
|
27530
|
-
const decode$
|
|
27608
|
+
const decode$m = (params2, decodedAttrs) => {
|
|
27531
27609
|
params2.node = preProcessVerticalMergeCells(params2.node, params2);
|
|
27532
27610
|
const { node } = params2;
|
|
27533
27611
|
const elements = translateChildNodes(params2);
|
|
27534
27612
|
const firstRow = node.content?.find((n) => n.type === "tableRow");
|
|
27535
27613
|
const properties = node.attrs.grid;
|
|
27536
|
-
const element = translator$
|
|
27614
|
+
const element = translator$e.decode({
|
|
27537
27615
|
...params2,
|
|
27538
27616
|
node: { ...node, attrs: { ...node.attrs, grid: properties } },
|
|
27539
27617
|
extraParams: {
|
|
@@ -27543,7 +27621,7 @@ const decode$k = (params2, decodedAttrs) => {
|
|
|
27543
27621
|
if (element) elements.unshift(element);
|
|
27544
27622
|
if (node.attrs?.tableProperties) {
|
|
27545
27623
|
const properties2 = { ...node.attrs.tableProperties };
|
|
27546
|
-
const element2 = translator$
|
|
27624
|
+
const element2 = translator$g.decode({
|
|
27547
27625
|
...params2,
|
|
27548
27626
|
node: { ...node, attrs: { ...node.attrs, tableProperties: properties2 } }
|
|
27549
27627
|
});
|
|
@@ -27609,7 +27687,7 @@ function _getReferencedTableStyles(tableStyleReference, params2) {
|
|
|
27609
27687
|
if (baseTblPr && baseTblPr.elements) {
|
|
27610
27688
|
tblPr.elements.push(...baseTblPr.elements);
|
|
27611
27689
|
}
|
|
27612
|
-
const tableProperties = translator$
|
|
27690
|
+
const tableProperties = translator$g.encode({ ...params2, nodes: [tblPr] }).attributes;
|
|
27613
27691
|
const { borders, rowBorders } = _processTableBorders(tableProperties.borders || {});
|
|
27614
27692
|
if (borders) stylesToReturn.borders = borders;
|
|
27615
27693
|
if (rowBorders) stylesToReturn.rowBorders = rowBorders;
|
|
@@ -27626,16 +27704,16 @@ function _getReferencedTableStyles(tableStyleReference, params2) {
|
|
|
27626
27704
|
}
|
|
27627
27705
|
return stylesToReturn;
|
|
27628
27706
|
}
|
|
27629
|
-
const config$
|
|
27630
|
-
xmlName: XML_NODE_NAME$
|
|
27707
|
+
const config$d = {
|
|
27708
|
+
xmlName: XML_NODE_NAME$e,
|
|
27631
27709
|
sdNodeOrKeyName: SD_NODE_NAME$c,
|
|
27632
27710
|
type: NodeTranslator.translatorTypes.NODE,
|
|
27633
|
-
encode: encode$
|
|
27634
|
-
decode: decode$
|
|
27711
|
+
encode: encode$k,
|
|
27712
|
+
decode: decode$m,
|
|
27635
27713
|
attributes: []
|
|
27636
27714
|
};
|
|
27637
|
-
const translator$
|
|
27638
|
-
const tableNodeHandlerEntity = generateV2HandlerEntity("tableNodeHandler", translator$
|
|
27715
|
+
const translator$d = NodeTranslator.from(config$d);
|
|
27716
|
+
const tableNodeHandlerEntity = generateV2HandlerEntity("tableNodeHandler", translator$d);
|
|
27639
27717
|
function getReferencedTableStyles(tblStyleTag, docx) {
|
|
27640
27718
|
if (!tblStyleTag) return null;
|
|
27641
27719
|
const stylesToReturn = {};
|
|
@@ -27997,10 +28075,10 @@ function generateCellMargins(cellMargins) {
|
|
|
27997
28075
|
if (left2 != null) elements.push({ name: "w:left", attributes: { "w:w": pixelsToTwips(left2) } });
|
|
27998
28076
|
return elements;
|
|
27999
28077
|
}
|
|
28000
|
-
const XML_NODE_NAME$
|
|
28078
|
+
const XML_NODE_NAME$d = "w:tc";
|
|
28001
28079
|
const SD_NODE_NAME$b = "tableCell";
|
|
28002
|
-
const validXmlAttributes$
|
|
28003
|
-
function encode$
|
|
28080
|
+
const validXmlAttributes$a = [];
|
|
28081
|
+
function encode$j(params2, encodedAttrs) {
|
|
28004
28082
|
const {
|
|
28005
28083
|
node,
|
|
28006
28084
|
table,
|
|
@@ -28027,22 +28105,22 @@ function encode$h(params2, encodedAttrs) {
|
|
|
28027
28105
|
}
|
|
28028
28106
|
return schemaNode;
|
|
28029
28107
|
}
|
|
28030
|
-
function decode$
|
|
28108
|
+
function decode$l(params2, decodedAttrs) {
|
|
28031
28109
|
const translated = translateTableCell(params2);
|
|
28032
28110
|
if (decodedAttrs && Object.keys(decodedAttrs).length) {
|
|
28033
28111
|
translated.attributes = { ...translated.attributes || {}, ...decodedAttrs };
|
|
28034
28112
|
}
|
|
28035
28113
|
return translated;
|
|
28036
28114
|
}
|
|
28037
|
-
const config$
|
|
28038
|
-
xmlName: XML_NODE_NAME$
|
|
28115
|
+
const config$c = {
|
|
28116
|
+
xmlName: XML_NODE_NAME$d,
|
|
28039
28117
|
sdNodeOrKeyName: SD_NODE_NAME$b,
|
|
28040
28118
|
type: NodeTranslator.translatorTypes.NODE,
|
|
28041
|
-
encode: encode$
|
|
28042
|
-
decode: decode$
|
|
28043
|
-
attributes: validXmlAttributes$
|
|
28119
|
+
encode: encode$j,
|
|
28120
|
+
decode: decode$l,
|
|
28121
|
+
attributes: validXmlAttributes$a
|
|
28044
28122
|
};
|
|
28045
|
-
const translator$
|
|
28123
|
+
const translator$c = NodeTranslator.from(config$c);
|
|
28046
28124
|
function parseTagValueJSON(json) {
|
|
28047
28125
|
if (typeof json !== "string") {
|
|
28048
28126
|
return {};
|
|
@@ -28469,8 +28547,64 @@ function handleImageNode(node, params2, isAnchor) {
|
|
|
28469
28547
|
const vRelativeFrom = positionVTag?.attributes.relativeFrom;
|
|
28470
28548
|
const alignV = positionVTag?.elements?.find((el) => el.name === "wp:align")?.elements[0]?.text;
|
|
28471
28549
|
const simplePos = node.elements.find((el) => el.name === "wp:simplePos");
|
|
28472
|
-
const
|
|
28473
|
-
|
|
28550
|
+
const wrapNode = isAnchor ? node.elements.find(
|
|
28551
|
+
(el) => ["wp:wrapNone", "wp:wrapSquare", "wp:wrapThrough", "wp:wrapTight", "wp:wrapTopAndBottom"].includes(el.name)
|
|
28552
|
+
) : null;
|
|
28553
|
+
const wrap2 = isAnchor ? { type: wrapNode?.name.slice(7) || "None", attrs: {} } : { type: "Inline" };
|
|
28554
|
+
switch (wrap2.type) {
|
|
28555
|
+
case "Square":
|
|
28556
|
+
wrap2.attrs.wrapText = wrapNode.attributes.wrapText;
|
|
28557
|
+
if ("distB" in (wrapNode.attributes || {})) {
|
|
28558
|
+
wrap2.attrs.distBottom = emuToPixels(wrapNode.attributes.distB);
|
|
28559
|
+
}
|
|
28560
|
+
if ("distL" in (wrapNode.attributes || {})) {
|
|
28561
|
+
wrap2.attrs.distLeft = emuToPixels(wrapNode.attributes.distL);
|
|
28562
|
+
}
|
|
28563
|
+
if ("distR" in (wrapNode.attributes || {})) {
|
|
28564
|
+
wrap2.attrs.distRight = emuToPixels(wrapNode.attributes.distR);
|
|
28565
|
+
}
|
|
28566
|
+
if ("distT" in (wrapNode.attributes || {})) {
|
|
28567
|
+
wrap2.attrs.distTop = emuToPixels(wrapNode.attributes.distT);
|
|
28568
|
+
}
|
|
28569
|
+
break;
|
|
28570
|
+
case "Tight":
|
|
28571
|
+
case "Through": {
|
|
28572
|
+
if ("distL" in (wrapNode.attributes || {})) {
|
|
28573
|
+
wrap2.attrs.distLeft = emuToPixels(wrapNode.attributes.distL);
|
|
28574
|
+
}
|
|
28575
|
+
if ("distR" in (wrapNode.attributes || {})) {
|
|
28576
|
+
wrap2.attrs.distRight = emuToPixels(wrapNode.attributes.distR);
|
|
28577
|
+
}
|
|
28578
|
+
if ("distT" in (wrapNode.attributes || {})) {
|
|
28579
|
+
wrap2.attrs.distTop = emuToPixels(wrapNode.attributes.distT);
|
|
28580
|
+
}
|
|
28581
|
+
if ("distB" in (wrapNode.attributes || {})) {
|
|
28582
|
+
wrap2.attrs.distBottom = emuToPixels(wrapNode.attributes.distB);
|
|
28583
|
+
}
|
|
28584
|
+
if ("wrapText" in (wrapNode.attributes || {})) {
|
|
28585
|
+
wrap2.attrs.wrapText = wrapNode.attributes.wrapText;
|
|
28586
|
+
}
|
|
28587
|
+
const polygon = wrapNode.elements?.find((el) => el.name === "wp:wrapPolygon");
|
|
28588
|
+
if (polygon) {
|
|
28589
|
+
wrap2.attrs.polygon = polygonToObj(polygon);
|
|
28590
|
+
if (polygon.attributes?.edited !== void 0) {
|
|
28591
|
+
wrap2.attrs.polygonEdited = polygon.attributes.edited;
|
|
28592
|
+
}
|
|
28593
|
+
}
|
|
28594
|
+
break;
|
|
28595
|
+
}
|
|
28596
|
+
case "TopAndBottom":
|
|
28597
|
+
if ("distB" in (wrapNode.attributes || {})) {
|
|
28598
|
+
wrap2.attrs.distBottom = emuToPixels(wrapNode.attributes.distB);
|
|
28599
|
+
}
|
|
28600
|
+
if ("distT" in (wrapNode.attributes || {})) {
|
|
28601
|
+
wrap2.attrs.distTop = emuToPixels(wrapNode.attributes.distT);
|
|
28602
|
+
}
|
|
28603
|
+
break;
|
|
28604
|
+
case "None":
|
|
28605
|
+
wrap2.attrs.behindDoc = node.attributes?.behindDoc === "1";
|
|
28606
|
+
break;
|
|
28607
|
+
}
|
|
28474
28608
|
const docPr = node.elements.find((el) => el.name === "wp:docPr");
|
|
28475
28609
|
let anchorData = null;
|
|
28476
28610
|
if (hRelativeFrom || alignH || vRelativeFrom || alignV) {
|
|
@@ -28482,7 +28616,7 @@ function handleImageNode(node, params2, isAnchor) {
|
|
|
28482
28616
|
};
|
|
28483
28617
|
}
|
|
28484
28618
|
const marginOffset = {
|
|
28485
|
-
|
|
28619
|
+
horizontal: positionHValue,
|
|
28486
28620
|
top: positionVValue
|
|
28487
28621
|
};
|
|
28488
28622
|
const { attributes: blipAttributes = {} } = blip;
|
|
@@ -28521,10 +28655,7 @@ function handleImageNode(node, params2, isAnchor) {
|
|
|
28521
28655
|
y: simplePos.attributes.y
|
|
28522
28656
|
}
|
|
28523
28657
|
},
|
|
28524
|
-
|
|
28525
|
-
wrapText: wrapSquare.attributes.wrapText
|
|
28526
|
-
},
|
|
28527
|
-
wrapTopAndBottom: !!wrapTopAndBottom,
|
|
28658
|
+
wrap: wrap2,
|
|
28528
28659
|
originalPadding: {
|
|
28529
28660
|
distT: attributes["distT"],
|
|
28530
28661
|
distB: attributes["distB"],
|
|
@@ -28872,7 +29003,6 @@ function addNewImageRelationship(params2, imagePath) {
|
|
|
28872
29003
|
function translateAnchorNode(params2) {
|
|
28873
29004
|
const { attrs } = params2.node;
|
|
28874
29005
|
const anchorElements = [];
|
|
28875
|
-
const wrapElements = [];
|
|
28876
29006
|
if (attrs.simplePos) {
|
|
28877
29007
|
anchorElements.push({
|
|
28878
29008
|
name: "wp:simplePos",
|
|
@@ -28884,10 +29014,10 @@ function translateAnchorNode(params2) {
|
|
|
28884
29014
|
}
|
|
28885
29015
|
if (attrs.anchorData) {
|
|
28886
29016
|
const hElements = [];
|
|
28887
|
-
if (attrs.marginOffset.
|
|
29017
|
+
if (attrs.marginOffset.horizontal !== void 0) {
|
|
28888
29018
|
hElements.push({
|
|
28889
29019
|
name: "wp:posOffset",
|
|
28890
|
-
elements: [{ type: "text", text: pixelsToEmu(attrs.marginOffset.
|
|
29020
|
+
elements: [{ type: "text", text: pixelsToEmu(attrs.marginOffset.horizontal).toString() }]
|
|
28891
29021
|
});
|
|
28892
29022
|
}
|
|
28893
29023
|
if (attrs.anchorData.alignH) {
|
|
@@ -28920,38 +29050,110 @@ function translateAnchorNode(params2) {
|
|
|
28920
29050
|
...vElements.length && { elements: vElements }
|
|
28921
29051
|
});
|
|
28922
29052
|
}
|
|
28923
|
-
|
|
28924
|
-
|
|
28925
|
-
|
|
28926
|
-
|
|
28927
|
-
|
|
28928
|
-
|
|
28929
|
-
|
|
29053
|
+
const nodeElements = translateImageNode(params2);
|
|
29054
|
+
const inlineAttrs = {
|
|
29055
|
+
...attrs.originalAttributes || {},
|
|
29056
|
+
...nodeElements.attributes || {}
|
|
29057
|
+
};
|
|
29058
|
+
if (inlineAttrs.relativeHeight == null) {
|
|
29059
|
+
inlineAttrs.relativeHeight = 1;
|
|
28930
29060
|
}
|
|
28931
|
-
if (attrs.
|
|
28932
|
-
|
|
28933
|
-
|
|
28934
|
-
|
|
29061
|
+
if (attrs.originalAttributes?.simplePos !== void 0) {
|
|
29062
|
+
inlineAttrs.simplePos = attrs.originalAttributes.simplePos;
|
|
29063
|
+
} else if (attrs.simplePos !== void 0) {
|
|
29064
|
+
inlineAttrs.simplePos = attrs.simplePos;
|
|
28935
29065
|
}
|
|
28936
|
-
if (
|
|
28937
|
-
|
|
28938
|
-
name: "wp:wrapNone"
|
|
28939
|
-
});
|
|
29066
|
+
if (attrs.originalAttributes?.locked !== void 0) {
|
|
29067
|
+
inlineAttrs.locked = attrs.originalAttributes.locked;
|
|
28940
29068
|
}
|
|
28941
|
-
|
|
28942
|
-
|
|
28943
|
-
|
|
28944
|
-
|
|
28945
|
-
|
|
28946
|
-
|
|
28947
|
-
|
|
28948
|
-
|
|
28949
|
-
|
|
29069
|
+
if (attrs.originalAttributes?.layoutInCell !== void 0) {
|
|
29070
|
+
inlineAttrs.layoutInCell = attrs.originalAttributes.layoutInCell;
|
|
29071
|
+
}
|
|
29072
|
+
if (attrs.originalAttributes?.allowOverlap !== void 0) {
|
|
29073
|
+
inlineAttrs.allowOverlap = attrs.originalAttributes.allowOverlap;
|
|
29074
|
+
}
|
|
29075
|
+
const wrapElement = {
|
|
29076
|
+
name: `wp:wrap${attrs.wrap?.type || "None"}`
|
|
29077
|
+
// Important: wp:anchor will break if no wrapping is specified. We need to use wrapNone.
|
|
28950
29078
|
};
|
|
29079
|
+
switch (attrs.wrap?.type) {
|
|
29080
|
+
case "Square":
|
|
29081
|
+
wrapElement.attributes = {
|
|
29082
|
+
wrapText: attrs.wrap.attrs.wrapText
|
|
29083
|
+
};
|
|
29084
|
+
if ("distBottom" in (attrs.wrap.attrs || {})) {
|
|
29085
|
+
wrapElement.attributes.distB = pixelsToEmu(attrs.wrap.attrs.distBottom);
|
|
29086
|
+
}
|
|
29087
|
+
if ("distLeft" in (attrs.wrap.attrs || {})) {
|
|
29088
|
+
wrapElement.attributes.distL = pixelsToEmu(attrs.wrap.attrs.distLeft);
|
|
29089
|
+
}
|
|
29090
|
+
if ("distRight" in (attrs.wrap.attrs || {})) {
|
|
29091
|
+
wrapElement.attributes.distR = pixelsToEmu(attrs.wrap.attrs.distRight);
|
|
29092
|
+
}
|
|
29093
|
+
if ("distTop" in (attrs.wrap.attrs || {})) {
|
|
29094
|
+
wrapElement.attributes.distT = pixelsToEmu(attrs.wrap.attrs.distTop);
|
|
29095
|
+
}
|
|
29096
|
+
break;
|
|
29097
|
+
case "TopAndBottom": {
|
|
29098
|
+
const attributes = {};
|
|
29099
|
+
let hasKeys = false;
|
|
29100
|
+
if ("distBottom" in (attrs.wrap.attrs || {})) {
|
|
29101
|
+
attributes.distB = pixelsToEmu(attrs.wrap.attrs.distBottom);
|
|
29102
|
+
hasKeys = true;
|
|
29103
|
+
}
|
|
29104
|
+
if ("distTop" in (attrs.wrap.attrs || {})) {
|
|
29105
|
+
attributes.distT = pixelsToEmu(attrs.wrap.attrs.distTop);
|
|
29106
|
+
hasKeys = true;
|
|
29107
|
+
}
|
|
29108
|
+
if (hasKeys) {
|
|
29109
|
+
wrapElement.attributes = attributes;
|
|
29110
|
+
}
|
|
29111
|
+
break;
|
|
29112
|
+
}
|
|
29113
|
+
case "Through":
|
|
29114
|
+
case "Tight": {
|
|
29115
|
+
const attributes = {};
|
|
29116
|
+
if ("distLeft" in (attrs.wrap.attrs || {})) {
|
|
29117
|
+
attributes.distL = pixelsToEmu(attrs.wrap.attrs.distLeft);
|
|
29118
|
+
}
|
|
29119
|
+
if ("distRight" in (attrs.wrap.attrs || {})) {
|
|
29120
|
+
attributes.distR = pixelsToEmu(attrs.wrap.attrs.distRight);
|
|
29121
|
+
}
|
|
29122
|
+
if ("distTop" in (attrs.wrap.attrs || {})) {
|
|
29123
|
+
attributes.distT = pixelsToEmu(attrs.wrap.attrs.distTop);
|
|
29124
|
+
}
|
|
29125
|
+
if ("distBottom" in (attrs.wrap.attrs || {})) {
|
|
29126
|
+
attributes.distB = pixelsToEmu(attrs.wrap.attrs.distBottom);
|
|
29127
|
+
}
|
|
29128
|
+
const wrapText = attrs.wrap.attrs?.wrapText || "bothSides";
|
|
29129
|
+
{
|
|
29130
|
+
attributes.wrapText = wrapText;
|
|
29131
|
+
}
|
|
29132
|
+
if (Object.keys(attributes).length) {
|
|
29133
|
+
wrapElement.attributes = attributes;
|
|
29134
|
+
}
|
|
29135
|
+
if (attrs.wrap.attrs?.polygon) {
|
|
29136
|
+
const polygonNode = objToPolygon(attrs.wrap.attrs.polygon);
|
|
29137
|
+
if (polygonNode) {
|
|
29138
|
+
if (attrs.wrap.attrs?.polygonEdited !== void 0) {
|
|
29139
|
+
polygonNode.attributes = {
|
|
29140
|
+
...polygonNode.attributes || {},
|
|
29141
|
+
edited: String(attrs.wrap.attrs.polygonEdited)
|
|
29142
|
+
};
|
|
29143
|
+
}
|
|
29144
|
+
wrapElement.elements = [polygonNode];
|
|
29145
|
+
}
|
|
29146
|
+
}
|
|
29147
|
+
break;
|
|
29148
|
+
}
|
|
29149
|
+
case "None":
|
|
29150
|
+
inlineAttrs.behindDoc = attrs.wrap.attrs?.behindDoc ? "1" : "0";
|
|
29151
|
+
break;
|
|
29152
|
+
}
|
|
28951
29153
|
const effectIndex = nodeElements.elements.findIndex((el) => el.name === "wp:effectExtent");
|
|
28952
29154
|
const elementsWithWrap = [
|
|
28953
29155
|
...nodeElements.elements.slice(0, effectIndex + 1),
|
|
28954
|
-
|
|
29156
|
+
wrapElement,
|
|
28955
29157
|
...nodeElements.elements.slice(effectIndex + 1)
|
|
28956
29158
|
];
|
|
28957
29159
|
return {
|
|
@@ -28960,32 +29162,32 @@ function translateAnchorNode(params2) {
|
|
|
28960
29162
|
elements: [...anchorElements, ...elementsWithWrap]
|
|
28961
29163
|
};
|
|
28962
29164
|
}
|
|
28963
|
-
const XML_NODE_NAME$
|
|
29165
|
+
const XML_NODE_NAME$c = "wp:anchor";
|
|
28964
29166
|
const SD_NODE_NAME$a = ["image"];
|
|
28965
|
-
const validXmlAttributes$
|
|
28966
|
-
function encode$
|
|
29167
|
+
const validXmlAttributes$9 = ["distT", "distB", "distL", "distR"].map((xmlName) => createAttributeHandler(xmlName));
|
|
29168
|
+
function encode$i(params2) {
|
|
28967
29169
|
const { node } = params2.extraParams;
|
|
28968
29170
|
if (!node || !node.type) {
|
|
28969
29171
|
return null;
|
|
28970
29172
|
}
|
|
28971
29173
|
return handleAnchorNode(params2);
|
|
28972
29174
|
}
|
|
28973
|
-
function decode$
|
|
29175
|
+
function decode$k(params2) {
|
|
28974
29176
|
const { node } = params2;
|
|
28975
29177
|
if (!node || !node.type) {
|
|
28976
29178
|
return null;
|
|
28977
29179
|
}
|
|
28978
29180
|
return translateAnchorNode(params2);
|
|
28979
29181
|
}
|
|
28980
|
-
const config$
|
|
28981
|
-
xmlName: XML_NODE_NAME$
|
|
29182
|
+
const config$b = {
|
|
29183
|
+
xmlName: XML_NODE_NAME$c,
|
|
28982
29184
|
sdNodeOrKeyName: SD_NODE_NAME$a,
|
|
28983
29185
|
type: NodeTranslator.translatorTypes.NODE,
|
|
28984
|
-
encode: encode$
|
|
28985
|
-
decode: decode$
|
|
28986
|
-
attributes: validXmlAttributes$
|
|
29186
|
+
encode: encode$i,
|
|
29187
|
+
decode: decode$k,
|
|
29188
|
+
attributes: validXmlAttributes$9
|
|
28987
29189
|
};
|
|
28988
|
-
const translator$
|
|
29190
|
+
const translator$b = NodeTranslator.from(config$b);
|
|
28989
29191
|
function handleInlineNode(params2) {
|
|
28990
29192
|
const { node } = params2.extraParams;
|
|
28991
29193
|
if (node.name !== "wp:inline") {
|
|
@@ -29001,41 +29203,41 @@ function translateInlineNode(params2) {
|
|
|
29001
29203
|
elements: nodeElements.elements
|
|
29002
29204
|
};
|
|
29003
29205
|
}
|
|
29004
|
-
const XML_NODE_NAME$
|
|
29206
|
+
const XML_NODE_NAME$b = "wp:inline";
|
|
29005
29207
|
const SD_NODE_NAME$9 = ["image"];
|
|
29006
|
-
const validXmlAttributes$
|
|
29007
|
-
function encode$
|
|
29208
|
+
const validXmlAttributes$8 = ["distT", "distB", "distL", "distR"].map((xmlName) => createAttributeHandler(xmlName));
|
|
29209
|
+
function encode$h(params2) {
|
|
29008
29210
|
const { node } = params2.extraParams;
|
|
29009
29211
|
if (!node || !node.type) {
|
|
29010
29212
|
return null;
|
|
29011
29213
|
}
|
|
29012
29214
|
return handleInlineNode(params2);
|
|
29013
29215
|
}
|
|
29014
|
-
function decode$
|
|
29216
|
+
function decode$j(params2) {
|
|
29015
29217
|
const { node } = params2;
|
|
29016
29218
|
if (!node || !node.type) {
|
|
29017
29219
|
return null;
|
|
29018
29220
|
}
|
|
29019
29221
|
return translateInlineNode(params2);
|
|
29020
29222
|
}
|
|
29021
|
-
const config$
|
|
29022
|
-
xmlName: XML_NODE_NAME$
|
|
29223
|
+
const config$a = {
|
|
29224
|
+
xmlName: XML_NODE_NAME$b,
|
|
29023
29225
|
sdNodeOrKeyName: SD_NODE_NAME$9,
|
|
29024
29226
|
type: NodeTranslator.translatorTypes.NODE,
|
|
29025
|
-
encode: encode$
|
|
29026
|
-
decode: decode$
|
|
29027
|
-
attributes: validXmlAttributes$
|
|
29227
|
+
encode: encode$h,
|
|
29228
|
+
decode: decode$j,
|
|
29229
|
+
attributes: validXmlAttributes$8
|
|
29028
29230
|
};
|
|
29029
|
-
const translator$
|
|
29030
|
-
const XML_NODE_NAME$
|
|
29231
|
+
const translator$a = NodeTranslator.from(config$a);
|
|
29232
|
+
const XML_NODE_NAME$a = "w:drawing";
|
|
29031
29233
|
const SD_NODE_NAME$8 = [];
|
|
29032
|
-
const validXmlAttributes$
|
|
29033
|
-
function encode$
|
|
29234
|
+
const validXmlAttributes$7 = [];
|
|
29235
|
+
function encode$g(params2) {
|
|
29034
29236
|
const nodes = params2.nodes;
|
|
29035
29237
|
const node = nodes[0];
|
|
29036
29238
|
const translatorByChildName = {
|
|
29037
|
-
"wp:anchor": translator$
|
|
29038
|
-
"wp:inline": translator$
|
|
29239
|
+
"wp:anchor": translator$b,
|
|
29240
|
+
"wp:inline": translator$a
|
|
29039
29241
|
};
|
|
29040
29242
|
return node.elements.reduce((acc, child) => {
|
|
29041
29243
|
if (acc) return acc;
|
|
@@ -29044,12 +29246,12 @@ function encode$e(params2) {
|
|
|
29044
29246
|
return translator2.encode({ ...params2, extraParams: { node: child } }) || acc;
|
|
29045
29247
|
}, null);
|
|
29046
29248
|
}
|
|
29047
|
-
function decode$
|
|
29249
|
+
function decode$i(params2) {
|
|
29048
29250
|
const { node } = params2;
|
|
29049
29251
|
if (!node || !node.type) {
|
|
29050
29252
|
return null;
|
|
29051
29253
|
}
|
|
29052
|
-
const childTranslator = node.attrs.isAnchor ? translator$
|
|
29254
|
+
const childTranslator = node.attrs.isAnchor ? translator$b : translator$a;
|
|
29053
29255
|
const resultNode = childTranslator.decode(params2);
|
|
29054
29256
|
return wrapTextInRun(
|
|
29055
29257
|
{
|
|
@@ -29059,15 +29261,15 @@ function decode$g(params2) {
|
|
|
29059
29261
|
[]
|
|
29060
29262
|
);
|
|
29061
29263
|
}
|
|
29062
|
-
const config$
|
|
29063
|
-
xmlName: XML_NODE_NAME$
|
|
29264
|
+
const config$9 = {
|
|
29265
|
+
xmlName: XML_NODE_NAME$a,
|
|
29064
29266
|
sdNodeOrKeyName: SD_NODE_NAME$8,
|
|
29065
29267
|
type: NodeTranslator.translatorTypes.NODE,
|
|
29066
|
-
encode: encode$
|
|
29067
|
-
decode: decode$
|
|
29068
|
-
attributes: validXmlAttributes$
|
|
29268
|
+
encode: encode$g,
|
|
29269
|
+
decode: decode$i,
|
|
29270
|
+
attributes: validXmlAttributes$7
|
|
29069
29271
|
};
|
|
29070
|
-
const translator$
|
|
29272
|
+
const translator$9 = NodeTranslator.from(config$9);
|
|
29071
29273
|
class CommandService {
|
|
29072
29274
|
/**
|
|
29073
29275
|
* @param {import('./commands/types/index.js').CommandServiceOptions} props
|
|
@@ -30415,7 +30617,7 @@ function prepareTextAnnotation(params2) {
|
|
|
30415
30617
|
return getTextNodeForExport(attrs.displayLabel, [...marks, ...marksFromAttrs], params2);
|
|
30416
30618
|
}
|
|
30417
30619
|
function prepareImageAnnotation(params2, imageSize) {
|
|
30418
|
-
return translator$
|
|
30620
|
+
return translator$9.decode({
|
|
30419
30621
|
...params2,
|
|
30420
30622
|
imageSize
|
|
30421
30623
|
});
|
|
@@ -30730,10 +30932,10 @@ function generateSdtPrTagForStructuredContent({ node }) {
|
|
|
30730
30932
|
};
|
|
30731
30933
|
return result;
|
|
30732
30934
|
}
|
|
30733
|
-
const XML_NODE_NAME$
|
|
30935
|
+
const XML_NODE_NAME$9 = "w:sdt";
|
|
30734
30936
|
const SD_NODE_NAME$7 = ["fieldAnnotation", "structuredContent", "structuredContentBlock", "documentSection"];
|
|
30735
|
-
const validXmlAttributes$
|
|
30736
|
-
function encode$
|
|
30937
|
+
const validXmlAttributes$6 = [];
|
|
30938
|
+
function encode$f(params2) {
|
|
30737
30939
|
const nodes = params2.nodes;
|
|
30738
30940
|
const node = nodes[0];
|
|
30739
30941
|
const { type: sdtType, handler: handler2 } = sdtNodeTypeStrategy(node);
|
|
@@ -30743,7 +30945,7 @@ function encode$d(params2) {
|
|
|
30743
30945
|
const result = handler2(params2);
|
|
30744
30946
|
return result;
|
|
30745
30947
|
}
|
|
30746
|
-
function decode$
|
|
30948
|
+
function decode$h(params2) {
|
|
30747
30949
|
const { node } = params2;
|
|
30748
30950
|
if (!node || !node.type) {
|
|
30749
30951
|
return null;
|
|
@@ -30761,85 +30963,85 @@ function decode$f(params2) {
|
|
|
30761
30963
|
const result = decoder();
|
|
30762
30964
|
return result;
|
|
30763
30965
|
}
|
|
30764
|
-
const config$
|
|
30765
|
-
xmlName: XML_NODE_NAME$
|
|
30966
|
+
const config$8 = {
|
|
30967
|
+
xmlName: XML_NODE_NAME$9,
|
|
30766
30968
|
sdNodeOrKeyName: SD_NODE_NAME$7,
|
|
30767
30969
|
type: NodeTranslator.translatorTypes.NODE,
|
|
30768
|
-
encode: encode$
|
|
30769
|
-
decode: decode$
|
|
30770
|
-
attributes: validXmlAttributes$
|
|
30970
|
+
encode: encode$f,
|
|
30971
|
+
decode: decode$h,
|
|
30972
|
+
attributes: validXmlAttributes$6
|
|
30771
30973
|
};
|
|
30772
|
-
const translator$
|
|
30773
|
-
const encode$
|
|
30974
|
+
const translator$8 = NodeTranslator.from(config$8);
|
|
30975
|
+
const encode$e = (attributes) => {
|
|
30774
30976
|
return attributes["w:id"];
|
|
30775
30977
|
};
|
|
30776
|
-
const decode$
|
|
30978
|
+
const decode$g = (attrs) => {
|
|
30777
30979
|
return attrs.id;
|
|
30778
30980
|
};
|
|
30779
30981
|
const attrConfig$7 = Object.freeze({
|
|
30780
30982
|
xmlName: "w:id",
|
|
30781
30983
|
sdName: "id",
|
|
30782
|
-
encode: encode$
|
|
30783
|
-
decode: decode$
|
|
30984
|
+
encode: encode$e,
|
|
30985
|
+
decode: decode$g
|
|
30784
30986
|
});
|
|
30785
|
-
const encode$
|
|
30987
|
+
const encode$d = (attributes) => {
|
|
30786
30988
|
return attributes["w:name"];
|
|
30787
30989
|
};
|
|
30788
|
-
const decode$
|
|
30990
|
+
const decode$f = (attrs) => {
|
|
30789
30991
|
return attrs.name;
|
|
30790
30992
|
};
|
|
30791
30993
|
const attrConfig$6 = Object.freeze({
|
|
30792
30994
|
xmlName: "w:name",
|
|
30793
30995
|
sdName: "name",
|
|
30794
|
-
encode: encode$
|
|
30795
|
-
decode: decode$
|
|
30996
|
+
encode: encode$d,
|
|
30997
|
+
decode: decode$f
|
|
30796
30998
|
});
|
|
30797
|
-
const encode$
|
|
30999
|
+
const encode$c = (attributes) => {
|
|
30798
31000
|
return attributes["w:colFirst"];
|
|
30799
31001
|
};
|
|
30800
|
-
const decode$
|
|
31002
|
+
const decode$e = (attrs) => {
|
|
30801
31003
|
return attrs.colFirst;
|
|
30802
31004
|
};
|
|
30803
31005
|
const attrConfig$5 = Object.freeze({
|
|
30804
31006
|
xmlName: "w:colFirst",
|
|
30805
31007
|
sdName: "colFirst",
|
|
30806
|
-
encode: encode$
|
|
30807
|
-
decode: decode$
|
|
31008
|
+
encode: encode$c,
|
|
31009
|
+
decode: decode$e
|
|
30808
31010
|
});
|
|
30809
|
-
const encode$
|
|
31011
|
+
const encode$b = (attributes) => {
|
|
30810
31012
|
return attributes["w:colLast"];
|
|
30811
31013
|
};
|
|
30812
|
-
const decode$
|
|
31014
|
+
const decode$d = (attrs) => {
|
|
30813
31015
|
return attrs.colLast;
|
|
30814
31016
|
};
|
|
30815
31017
|
const attrConfig$4 = Object.freeze({
|
|
30816
31018
|
xmlName: "w:colLast",
|
|
30817
31019
|
sdName: "colLast",
|
|
30818
|
-
encode: encode$
|
|
30819
|
-
decode: decode$
|
|
31020
|
+
encode: encode$b,
|
|
31021
|
+
decode: decode$d
|
|
30820
31022
|
});
|
|
30821
|
-
const encode$
|
|
31023
|
+
const encode$a = (attributes) => {
|
|
30822
31024
|
return attributes["w:displacedByCustomXml"];
|
|
30823
31025
|
};
|
|
30824
|
-
const decode$
|
|
31026
|
+
const decode$c = (attrs) => {
|
|
30825
31027
|
return attrs.displacedByCustomXml;
|
|
30826
31028
|
};
|
|
30827
31029
|
const attrConfig$3 = Object.freeze({
|
|
30828
31030
|
xmlName: "w:displacedByCustomXml",
|
|
30829
31031
|
sdName: "displacedByCustomXml",
|
|
30830
|
-
encode: encode$
|
|
30831
|
-
decode: decode$
|
|
31032
|
+
encode: encode$a,
|
|
31033
|
+
decode: decode$c
|
|
30832
31034
|
});
|
|
30833
|
-
const validXmlAttributes$
|
|
30834
|
-
const XML_NODE_NAME$
|
|
31035
|
+
const validXmlAttributes$5 = [attrConfig$7, attrConfig$6, attrConfig$5, attrConfig$4, attrConfig$3];
|
|
31036
|
+
const XML_NODE_NAME$8 = "w:bookmarkStart";
|
|
30835
31037
|
const SD_NODE_NAME$6 = "bookmarkStart";
|
|
30836
|
-
const encode$
|
|
31038
|
+
const encode$9 = (params2, encodedAttrs = {}) => {
|
|
30837
31039
|
return {
|
|
30838
31040
|
type: "bookmarkStart",
|
|
30839
31041
|
attrs: encodedAttrs
|
|
30840
31042
|
};
|
|
30841
31043
|
};
|
|
30842
|
-
const decode$
|
|
31044
|
+
const decode$b = (params2, decodedAttrs = {}) => {
|
|
30843
31045
|
const result = {
|
|
30844
31046
|
name: "w:bookmarkStart",
|
|
30845
31047
|
elements: []
|
|
@@ -30849,49 +31051,49 @@ const decode$9 = (params2, decodedAttrs = {}) => {
|
|
|
30849
31051
|
}
|
|
30850
31052
|
return result;
|
|
30851
31053
|
};
|
|
30852
|
-
const config$
|
|
30853
|
-
xmlName: XML_NODE_NAME$
|
|
31054
|
+
const config$7 = {
|
|
31055
|
+
xmlName: XML_NODE_NAME$8,
|
|
30854
31056
|
sdNodeOrKeyName: SD_NODE_NAME$6,
|
|
30855
31057
|
type: NodeTranslator.translatorTypes.NODE,
|
|
30856
|
-
encode: encode$
|
|
30857
|
-
decode: decode$
|
|
30858
|
-
attributes: validXmlAttributes$
|
|
31058
|
+
encode: encode$9,
|
|
31059
|
+
decode: decode$b,
|
|
31060
|
+
attributes: validXmlAttributes$5
|
|
30859
31061
|
};
|
|
30860
|
-
const translator$
|
|
30861
|
-
const encode$
|
|
31062
|
+
const translator$7 = NodeTranslator.from(config$7);
|
|
31063
|
+
const encode$8 = (attributes) => {
|
|
30862
31064
|
return attributes["w:id"];
|
|
30863
31065
|
};
|
|
30864
|
-
const decode$
|
|
31066
|
+
const decode$a = (attrs) => {
|
|
30865
31067
|
return attrs.id;
|
|
30866
31068
|
};
|
|
30867
31069
|
const attrConfig$2 = Object.freeze({
|
|
30868
31070
|
xmlName: "w:id",
|
|
30869
31071
|
sdName: "id",
|
|
30870
|
-
encode: encode$
|
|
30871
|
-
decode: decode$
|
|
31072
|
+
encode: encode$8,
|
|
31073
|
+
decode: decode$a
|
|
30872
31074
|
});
|
|
30873
|
-
const encode$
|
|
31075
|
+
const encode$7 = (attributes) => {
|
|
30874
31076
|
return attributes["w:displacedByCustomXml"];
|
|
30875
31077
|
};
|
|
30876
|
-
const decode$
|
|
31078
|
+
const decode$9 = (attrs) => {
|
|
30877
31079
|
return attrs.displacedByCustomXml;
|
|
30878
31080
|
};
|
|
30879
31081
|
const attrConfig$1 = Object.freeze({
|
|
30880
31082
|
xmlName: "w:displacedByCustomXml",
|
|
30881
31083
|
sdName: "displacedByCustomXml",
|
|
30882
|
-
encode: encode$
|
|
30883
|
-
decode: decode$
|
|
31084
|
+
encode: encode$7,
|
|
31085
|
+
decode: decode$9
|
|
30884
31086
|
});
|
|
30885
|
-
const validXmlAttributes$
|
|
30886
|
-
const XML_NODE_NAME$
|
|
31087
|
+
const validXmlAttributes$4 = [attrConfig$2, attrConfig$1];
|
|
31088
|
+
const XML_NODE_NAME$7 = "w:bookmarkEnd";
|
|
30887
31089
|
const SD_NODE_NAME$5 = "bookmarkEnd";
|
|
30888
|
-
const encode$
|
|
31090
|
+
const encode$6 = (params2, encodedAttrs = {}) => {
|
|
30889
31091
|
return {
|
|
30890
31092
|
type: "bookmarkEnd",
|
|
30891
31093
|
attrs: encodedAttrs
|
|
30892
31094
|
};
|
|
30893
31095
|
};
|
|
30894
|
-
const decode$
|
|
31096
|
+
const decode$8 = (params2, decodedAttrs = {}) => {
|
|
30895
31097
|
const result = {
|
|
30896
31098
|
name: "w:bookmarkEnd",
|
|
30897
31099
|
elements: []
|
|
@@ -30901,27 +31103,27 @@ const decode$6 = (params2, decodedAttrs = {}) => {
|
|
|
30901
31103
|
}
|
|
30902
31104
|
return result;
|
|
30903
31105
|
};
|
|
30904
|
-
const config$
|
|
30905
|
-
xmlName: XML_NODE_NAME$
|
|
31106
|
+
const config$6 = {
|
|
31107
|
+
xmlName: XML_NODE_NAME$7,
|
|
30906
31108
|
sdNodeOrKeyName: SD_NODE_NAME$5,
|
|
30907
31109
|
type: NodeTranslator.translatorTypes.NODE,
|
|
30908
|
-
encode: encode$
|
|
30909
|
-
decode: decode$
|
|
30910
|
-
attributes: validXmlAttributes$
|
|
31110
|
+
encode: encode$6,
|
|
31111
|
+
decode: decode$8,
|
|
31112
|
+
attributes: validXmlAttributes$4
|
|
30911
31113
|
};
|
|
30912
|
-
const translator$
|
|
30913
|
-
const decode$
|
|
31114
|
+
const translator$6 = NodeTranslator.from(config$6);
|
|
31115
|
+
const decode$7 = (attrs) => attrs?.["w:id"];
|
|
30914
31116
|
const attrConfig = Object.freeze({
|
|
30915
31117
|
xmlName: "w:id",
|
|
30916
31118
|
sdName: "w:id",
|
|
30917
31119
|
// We do not translate it from 'w:id' to 'id' when encoding, so the name is the same
|
|
30918
31120
|
encode: () => {
|
|
30919
31121
|
},
|
|
30920
|
-
decode: decode$
|
|
31122
|
+
decode: decode$7
|
|
30921
31123
|
});
|
|
30922
|
-
const XML_NODE_NAME$
|
|
31124
|
+
const XML_NODE_NAME$6 = "w:commentRange";
|
|
30923
31125
|
const SD_NODE_NAME$4 = "commentRange";
|
|
30924
|
-
const decode$
|
|
31126
|
+
const decode$6 = (params2) => {
|
|
30925
31127
|
const { node, comments, commentsExportType, exportedCommentDefs } = params2;
|
|
30926
31128
|
if (!node) return;
|
|
30927
31129
|
if (!comments) return;
|
|
@@ -30964,19 +31166,19 @@ const getCommentSchema = (type2, commentIndex) => {
|
|
|
30964
31166
|
};
|
|
30965
31167
|
};
|
|
30966
31168
|
const getConfig = (type2) => ({
|
|
30967
|
-
xmlName: `${XML_NODE_NAME$
|
|
31169
|
+
xmlName: `${XML_NODE_NAME$6}${type2}`,
|
|
30968
31170
|
sdNodeOrKeyName: `${SD_NODE_NAME$4}${type2}`,
|
|
30969
31171
|
type: NodeTranslator.translatorTypes.NODE,
|
|
30970
31172
|
encode: () => {
|
|
30971
31173
|
},
|
|
30972
|
-
decode: decode$
|
|
31174
|
+
decode: decode$6,
|
|
30973
31175
|
attributes: [attrConfig]
|
|
30974
31176
|
});
|
|
30975
31177
|
const commentRangeStartTranslator = NodeTranslator.from(getConfig("Start"));
|
|
30976
31178
|
const commentRangeEndTranslator = NodeTranslator.from(getConfig("End"));
|
|
30977
|
-
const XML_NODE_NAME$
|
|
31179
|
+
const XML_NODE_NAME$5 = "sd:pageReference";
|
|
30978
31180
|
const SD_NODE_NAME$3 = "pageReference";
|
|
30979
|
-
const encode$
|
|
31181
|
+
const encode$5 = (params2) => {
|
|
30980
31182
|
const { nodes = [], nodeListHandler } = params2 || {};
|
|
30981
31183
|
const node = nodes[0];
|
|
30982
31184
|
const processedText = nodeListHandler.handler({
|
|
@@ -30993,7 +31195,7 @@ const encode$3 = (params2) => {
|
|
|
30993
31195
|
};
|
|
30994
31196
|
return processedNode;
|
|
30995
31197
|
};
|
|
30996
|
-
const decode$
|
|
31198
|
+
const decode$5 = (params2) => {
|
|
30997
31199
|
const { node } = params2;
|
|
30998
31200
|
const outputMarks = processOutputMarks(node.attrs?.marksAsAttrs || []);
|
|
30999
31201
|
const contentNodes = (node.content ?? []).flatMap((n) => exportSchemaToJson({ ...params2, node: n }));
|
|
@@ -31066,17 +31268,17 @@ const decode$3 = (params2) => {
|
|
|
31066
31268
|
];
|
|
31067
31269
|
return translated;
|
|
31068
31270
|
};
|
|
31069
|
-
const config$
|
|
31070
|
-
xmlName: XML_NODE_NAME$
|
|
31271
|
+
const config$5 = {
|
|
31272
|
+
xmlName: XML_NODE_NAME$5,
|
|
31071
31273
|
sdNodeOrKeyName: SD_NODE_NAME$3,
|
|
31072
31274
|
type: NodeTranslator.translatorTypes.NODE,
|
|
31073
|
-
encode: encode$
|
|
31074
|
-
decode: decode$
|
|
31275
|
+
encode: encode$5,
|
|
31276
|
+
decode: decode$5
|
|
31075
31277
|
};
|
|
31076
|
-
const translator$
|
|
31077
|
-
const XML_NODE_NAME$
|
|
31278
|
+
const translator$5 = NodeTranslator.from(config$5);
|
|
31279
|
+
const XML_NODE_NAME$4 = "sd:tableOfContents";
|
|
31078
31280
|
const SD_NODE_NAME$2 = "tableOfContents";
|
|
31079
|
-
const encode$
|
|
31281
|
+
const encode$4 = (params2) => {
|
|
31080
31282
|
const { nodes = [], nodeListHandler } = params2 || {};
|
|
31081
31283
|
const node = nodes[0];
|
|
31082
31284
|
const processedContent = nodeListHandler.handler({
|
|
@@ -31092,7 +31294,7 @@ const encode$2 = (params2) => {
|
|
|
31092
31294
|
};
|
|
31093
31295
|
return processedNode;
|
|
31094
31296
|
};
|
|
31095
|
-
const decode$
|
|
31297
|
+
const decode$4 = (params2) => {
|
|
31096
31298
|
const { node } = params2;
|
|
31097
31299
|
const contentNodes = node.content.map((n) => exportSchemaToJson({ ...params2, node: n }));
|
|
31098
31300
|
const tocBeginElements = [
|
|
@@ -31139,14 +31341,14 @@ const decode$2 = (params2) => {
|
|
|
31139
31341
|
}
|
|
31140
31342
|
return contentNodes;
|
|
31141
31343
|
};
|
|
31142
|
-
const config$
|
|
31143
|
-
xmlName: XML_NODE_NAME$
|
|
31344
|
+
const config$4 = {
|
|
31345
|
+
xmlName: XML_NODE_NAME$4,
|
|
31144
31346
|
sdNodeOrKeyName: SD_NODE_NAME$2,
|
|
31145
31347
|
type: NodeTranslator.translatorTypes.NODE,
|
|
31146
|
-
encode: encode$
|
|
31147
|
-
decode: decode$
|
|
31348
|
+
encode: encode$4,
|
|
31349
|
+
decode: decode$4
|
|
31148
31350
|
};
|
|
31149
|
-
const translator$
|
|
31351
|
+
const translator$4 = NodeTranslator.from(config$4);
|
|
31150
31352
|
function parseInlineStyles(styleString) {
|
|
31151
31353
|
if (!styleString) return {};
|
|
31152
31354
|
return styleString.split(";").filter((style2) => !!style2.trim()).reduce((acc, style2) => {
|
|
@@ -31280,7 +31482,7 @@ const handleDrawingNode = (params2) => {
|
|
|
31280
31482
|
if (mainNode.name === "w:drawing") node = mainNode;
|
|
31281
31483
|
else node = mainNode.elements.find((el) => el.name === "w:drawing");
|
|
31282
31484
|
if (!node) return { nodes: [], consumed: 0 };
|
|
31283
|
-
const schemaNode = translator$
|
|
31485
|
+
const schemaNode = translator$9.encode(params2);
|
|
31284
31486
|
const newNodes = schemaNode ? [schemaNode] : [];
|
|
31285
31487
|
return { nodes: newNodes, consumed: 1 };
|
|
31286
31488
|
};
|
|
@@ -31288,6 +31490,203 @@ const drawingNodeHandlerEntity = {
|
|
|
31288
31490
|
handlerName: "drawingNodeHandler",
|
|
31289
31491
|
handler: handleDrawingNode
|
|
31290
31492
|
};
|
|
31493
|
+
const createTrackStyleMark = (marks) => {
|
|
31494
|
+
const trackStyleMark = marks.find((mark) => mark.type === "trackFormat");
|
|
31495
|
+
if (trackStyleMark) {
|
|
31496
|
+
return {
|
|
31497
|
+
type: "element",
|
|
31498
|
+
name: "w:rPrChange",
|
|
31499
|
+
attributes: {
|
|
31500
|
+
"w:id": trackStyleMark.attrs.id,
|
|
31501
|
+
"w:author": trackStyleMark.attrs.author,
|
|
31502
|
+
"w:authorEmail": trackStyleMark.attrs.authorEmail,
|
|
31503
|
+
"w:date": trackStyleMark.attrs.date
|
|
31504
|
+
},
|
|
31505
|
+
elements: trackStyleMark.attrs.before.map((mark) => processOutputMarks([mark])).filter((r2) => r2 !== void 0)
|
|
31506
|
+
};
|
|
31507
|
+
}
|
|
31508
|
+
return void 0;
|
|
31509
|
+
};
|
|
31510
|
+
const XML_NODE_NAME$3 = "w:del";
|
|
31511
|
+
const SD_ATTR_KEY$1 = "trackDelete";
|
|
31512
|
+
const validXmlAttributes$3 = [
|
|
31513
|
+
createAttributeHandler("w:id", "id"),
|
|
31514
|
+
createAttributeHandler("w:date", "date"),
|
|
31515
|
+
createAttributeHandler("w:author", "author"),
|
|
31516
|
+
createAttributeHandler("w:authorEmail", "authorEmail")
|
|
31517
|
+
];
|
|
31518
|
+
const encode$3 = (params2, encodedAttrs = {}) => {
|
|
31519
|
+
const { nodeListHandler, extraParams = {} } = params2;
|
|
31520
|
+
const { node } = extraParams;
|
|
31521
|
+
const subs = nodeListHandler.handler({
|
|
31522
|
+
...params2,
|
|
31523
|
+
insideTrackChange: true,
|
|
31524
|
+
nodes: node.elements,
|
|
31525
|
+
path: [...params2.path || [], node]
|
|
31526
|
+
});
|
|
31527
|
+
encodedAttrs.importedAuthor = `${encodedAttrs.author} (imported)`;
|
|
31528
|
+
subs.forEach((subElement) => {
|
|
31529
|
+
if (subElement.marks === void 0) subElement.marks = [];
|
|
31530
|
+
subElement.marks.push({ type: "trackDelete", attrs: encodedAttrs });
|
|
31531
|
+
});
|
|
31532
|
+
return subs;
|
|
31533
|
+
};
|
|
31534
|
+
function decode$3(params2) {
|
|
31535
|
+
const { node } = params2;
|
|
31536
|
+
if (!node || !node.type) {
|
|
31537
|
+
return null;
|
|
31538
|
+
}
|
|
31539
|
+
const trackingMarks = ["trackInsert", "trackFormat", "trackDelete"];
|
|
31540
|
+
const marks = node.marks;
|
|
31541
|
+
const trackedMark = marks.find((m2) => m2.type === "trackDelete");
|
|
31542
|
+
const trackStyleMark = createTrackStyleMark(marks);
|
|
31543
|
+
node.marks = marks.filter((m2) => !trackingMarks.includes(m2.type));
|
|
31544
|
+
if (trackStyleMark) {
|
|
31545
|
+
node.marks.push(trackStyleMark);
|
|
31546
|
+
}
|
|
31547
|
+
const translatedTextNode = exportSchemaToJson({ ...params2, node });
|
|
31548
|
+
const textNode = translatedTextNode.elements.find((n) => n.name === "w:t");
|
|
31549
|
+
textNode.name = "w:delText";
|
|
31550
|
+
return {
|
|
31551
|
+
name: "w:del",
|
|
31552
|
+
attributes: {
|
|
31553
|
+
"w:id": trackedMark.attrs.id,
|
|
31554
|
+
"w:author": trackedMark.attrs.author,
|
|
31555
|
+
"w:authorEmail": trackedMark.attrs.authorEmail,
|
|
31556
|
+
"w:date": trackedMark.attrs.date
|
|
31557
|
+
},
|
|
31558
|
+
elements: [translatedTextNode]
|
|
31559
|
+
};
|
|
31560
|
+
}
|
|
31561
|
+
const config$3 = {
|
|
31562
|
+
xmlName: XML_NODE_NAME$3,
|
|
31563
|
+
sdNodeOrKeyName: SD_ATTR_KEY$1,
|
|
31564
|
+
type: NodeTranslator.translatorTypes.ATTRIBUTE,
|
|
31565
|
+
encode: encode$3,
|
|
31566
|
+
decode: decode$3,
|
|
31567
|
+
attributes: validXmlAttributes$3
|
|
31568
|
+
};
|
|
31569
|
+
const translator$3 = NodeTranslator.from(config$3);
|
|
31570
|
+
const XML_NODE_NAME$2 = "w:ins";
|
|
31571
|
+
const SD_ATTR_KEY = "trackInsert";
|
|
31572
|
+
const validXmlAttributes$2 = [
|
|
31573
|
+
createAttributeHandler("w:id", "id"),
|
|
31574
|
+
createAttributeHandler("w:date", "date"),
|
|
31575
|
+
createAttributeHandler("w:author", "author"),
|
|
31576
|
+
createAttributeHandler("w:authorEmail", "authorEmail")
|
|
31577
|
+
];
|
|
31578
|
+
const encode$2 = (params2, encodedAttrs = {}) => {
|
|
31579
|
+
const { nodeListHandler, extraParams = {} } = params2;
|
|
31580
|
+
const { node } = extraParams;
|
|
31581
|
+
const subs = nodeListHandler.handler({
|
|
31582
|
+
...params2,
|
|
31583
|
+
insideTrackChange: true,
|
|
31584
|
+
nodes: node.elements,
|
|
31585
|
+
path: [...params2.path || [], node]
|
|
31586
|
+
});
|
|
31587
|
+
encodedAttrs.importedAuthor = `${encodedAttrs.author} (imported)`;
|
|
31588
|
+
subs.forEach((subElement) => {
|
|
31589
|
+
if (subElement.marks === void 0) subElement.marks = [];
|
|
31590
|
+
subElement.marks.push({ type: "trackInsert", attrs: encodedAttrs });
|
|
31591
|
+
});
|
|
31592
|
+
return subs;
|
|
31593
|
+
};
|
|
31594
|
+
function decode$2(params2) {
|
|
31595
|
+
const { node } = params2;
|
|
31596
|
+
if (!node || !node.type) {
|
|
31597
|
+
return null;
|
|
31598
|
+
}
|
|
31599
|
+
const trackingMarks = ["trackInsert", "trackFormat", "trackDelete"];
|
|
31600
|
+
const marks = node.marks;
|
|
31601
|
+
const trackedMark = marks.find((m2) => m2.type === "trackInsert");
|
|
31602
|
+
const trackStyleMark = createTrackStyleMark(marks);
|
|
31603
|
+
node.marks = marks.filter((m2) => !trackingMarks.includes(m2.type));
|
|
31604
|
+
if (trackStyleMark) {
|
|
31605
|
+
node.marks.push(trackStyleMark);
|
|
31606
|
+
}
|
|
31607
|
+
const translatedTextNode = exportSchemaToJson({ ...params2, node });
|
|
31608
|
+
return {
|
|
31609
|
+
name: "w:ins",
|
|
31610
|
+
attributes: {
|
|
31611
|
+
"w:id": trackedMark.attrs.id,
|
|
31612
|
+
"w:author": trackedMark.attrs.author,
|
|
31613
|
+
"w:authorEmail": trackedMark.attrs.authorEmail,
|
|
31614
|
+
"w:date": trackedMark.attrs.date
|
|
31615
|
+
},
|
|
31616
|
+
elements: [translatedTextNode]
|
|
31617
|
+
};
|
|
31618
|
+
}
|
|
31619
|
+
const config$2 = {
|
|
31620
|
+
xmlName: XML_NODE_NAME$2,
|
|
31621
|
+
sdNodeOrKeyName: SD_ATTR_KEY,
|
|
31622
|
+
type: NodeTranslator.translatorTypes.ATTRIBUTE,
|
|
31623
|
+
encode: encode$2,
|
|
31624
|
+
decode: decode$2,
|
|
31625
|
+
attributes: validXmlAttributes$2
|
|
31626
|
+
};
|
|
31627
|
+
const translator$2 = NodeTranslator.from(config$2);
|
|
31628
|
+
const isTrackChangeElement = (node) => node?.name === "w:del" || node?.name === "w:ins";
|
|
31629
|
+
const unwrapTrackChangeNode = (node) => {
|
|
31630
|
+
if (!node) {
|
|
31631
|
+
return null;
|
|
31632
|
+
}
|
|
31633
|
+
if (isTrackChangeElement(node)) {
|
|
31634
|
+
return node;
|
|
31635
|
+
}
|
|
31636
|
+
if (node.name === "w:sdt") {
|
|
31637
|
+
const content = node.elements?.find((element) => element.name === "w:sdtContent");
|
|
31638
|
+
if (!content?.elements?.length) {
|
|
31639
|
+
return null;
|
|
31640
|
+
}
|
|
31641
|
+
for (const child of content.elements) {
|
|
31642
|
+
const trackChange = unwrapTrackChangeNode(child);
|
|
31643
|
+
if (trackChange) {
|
|
31644
|
+
return trackChange;
|
|
31645
|
+
}
|
|
31646
|
+
}
|
|
31647
|
+
}
|
|
31648
|
+
return null;
|
|
31649
|
+
};
|
|
31650
|
+
const handleTrackChangeNode = (params2) => {
|
|
31651
|
+
const { nodes } = params2;
|
|
31652
|
+
if (nodes.length === 0) {
|
|
31653
|
+
return { nodes: [], consumed: 0 };
|
|
31654
|
+
}
|
|
31655
|
+
const mainNode = unwrapTrackChangeNode(nodes[0]);
|
|
31656
|
+
if (!mainNode) {
|
|
31657
|
+
return { nodes: [], consumed: 0 };
|
|
31658
|
+
}
|
|
31659
|
+
let result;
|
|
31660
|
+
const translatorParams = {
|
|
31661
|
+
...params2,
|
|
31662
|
+
nodes: [mainNode]
|
|
31663
|
+
};
|
|
31664
|
+
switch (mainNode.name) {
|
|
31665
|
+
case "w:del":
|
|
31666
|
+
result = translator$3.encode({
|
|
31667
|
+
extraParams: {
|
|
31668
|
+
node: mainNode
|
|
31669
|
+
},
|
|
31670
|
+
...translatorParams
|
|
31671
|
+
});
|
|
31672
|
+
break;
|
|
31673
|
+
case "w:ins":
|
|
31674
|
+
result = translator$2.encode({
|
|
31675
|
+
extraParams: {
|
|
31676
|
+
node: mainNode
|
|
31677
|
+
},
|
|
31678
|
+
...translatorParams
|
|
31679
|
+
});
|
|
31680
|
+
break;
|
|
31681
|
+
}
|
|
31682
|
+
return { nodes: result, consumed: 1 };
|
|
31683
|
+
};
|
|
31684
|
+
const trackChangeNodeHandlerEntity = {
|
|
31685
|
+
handlerName: "trackChangeNodeHandler",
|
|
31686
|
+
handler: handleTrackChangeNode
|
|
31687
|
+
};
|
|
31688
|
+
const hyperlinkNodeHandlerEntity = generateV2HandlerEntity("hyperlinkNodeHandler", translator$Z);
|
|
31689
|
+
const runNodeHandlerEntity = generateV2HandlerEntity("runNodeHandler", translator$Y);
|
|
31291
31690
|
function parseProperties(node) {
|
|
31292
31691
|
const marks = [];
|
|
31293
31692
|
const unknownMarks = [];
|
|
@@ -31339,51 +31738,6 @@ function getElementName(element) {
|
|
|
31339
31738
|
const isPropertiesElement = (element) => {
|
|
31340
31739
|
return !!SuperConverter.propertyTypes[element.name || element.type];
|
|
31341
31740
|
};
|
|
31342
|
-
const handleTrackChangeNode = (params2) => {
|
|
31343
|
-
const { nodes, nodeListHandler } = params2;
|
|
31344
|
-
if (nodes.length === 0 || !(nodes[0].name === "w:del" || nodes[0].name === "w:ins" || nodes[0].name === "w:sdt")) {
|
|
31345
|
-
return { nodes: [], consumed: 0 };
|
|
31346
|
-
}
|
|
31347
|
-
const mainNode = nodes[0];
|
|
31348
|
-
let node;
|
|
31349
|
-
if (["w:ins", "w:del"].includes(mainNode.name)) {
|
|
31350
|
-
node = mainNode;
|
|
31351
|
-
} else {
|
|
31352
|
-
const sdtContent = mainNode.elements.find((el) => el.name === "w:sdtContent");
|
|
31353
|
-
const trackedChange = sdtContent?.elements.find((el) => ["w:ins", "w:del"].includes(el.name));
|
|
31354
|
-
if (trackedChange) node = trackedChange;
|
|
31355
|
-
}
|
|
31356
|
-
if (!node) {
|
|
31357
|
-
return { nodes: [], consumed: 0 };
|
|
31358
|
-
}
|
|
31359
|
-
const { name } = node;
|
|
31360
|
-
const { attributes, elements } = parseProperties(node);
|
|
31361
|
-
const subs = nodeListHandler.handler({
|
|
31362
|
-
...params2,
|
|
31363
|
-
insideTrackChange: true,
|
|
31364
|
-
nodes: elements,
|
|
31365
|
-
path: [...params2.path || [], node]
|
|
31366
|
-
});
|
|
31367
|
-
const changeType = name === "w:del" ? TrackDeleteMarkName : TrackInsertMarkName;
|
|
31368
|
-
const mappedAttributes = {
|
|
31369
|
-
id: attributes["w:id"],
|
|
31370
|
-
date: attributes["w:date"],
|
|
31371
|
-
author: attributes["w:author"],
|
|
31372
|
-
authorEmail: attributes["w:authorEmail"],
|
|
31373
|
-
importedAuthor: `${attributes["w:author"]} (imported)`
|
|
31374
|
-
};
|
|
31375
|
-
subs.forEach((subElement) => {
|
|
31376
|
-
if (subElement.marks === void 0) subElement.marks = [];
|
|
31377
|
-
subElement.marks.push({ type: changeType, attrs: mappedAttributes });
|
|
31378
|
-
});
|
|
31379
|
-
return { nodes: subs, consumed: 1 };
|
|
31380
|
-
};
|
|
31381
|
-
const trackChangeNodeHandlerEntity = {
|
|
31382
|
-
handlerName: "trackChangeNodeHandler",
|
|
31383
|
-
handler: handleTrackChangeNode
|
|
31384
|
-
};
|
|
31385
|
-
const hyperlinkNodeHandlerEntity = generateV2HandlerEntity("hyperlinkNodeHandler", translator$X);
|
|
31386
|
-
const runNodeHandlerEntity = generateV2HandlerEntity("runNodeHandler", translator$W);
|
|
31387
31741
|
const handleTextNode = (params2) => {
|
|
31388
31742
|
const { nodes, insideTrackChange } = params2;
|
|
31389
31743
|
if (nodes.length === 0 || !(nodes[0].name === "w:t" || insideTrackChange && nodes[0].name === "w:delText")) {
|
|
@@ -31424,7 +31778,7 @@ const handleParagraphNode = (params2) => {
|
|
|
31424
31778
|
if (nodes.length === 0 || nodes[0].name !== "w:p") {
|
|
31425
31779
|
return { nodes: [], consumed: 0 };
|
|
31426
31780
|
}
|
|
31427
|
-
const schemaNode = translator$
|
|
31781
|
+
const schemaNode = translator$19.encode(params2);
|
|
31428
31782
|
const newNodes = schemaNode ? [schemaNode] : [];
|
|
31429
31783
|
return { nodes: newNodes, consumed: 1 };
|
|
31430
31784
|
};
|
|
@@ -31437,7 +31791,7 @@ const handleSdtNode = (params2) => {
|
|
|
31437
31791
|
if (nodes.length === 0 || nodes[0].name !== "w:sdt") {
|
|
31438
31792
|
return { nodes: [], consumed: 0 };
|
|
31439
31793
|
}
|
|
31440
|
-
const result = translator$
|
|
31794
|
+
const result = translator$8.encode(params2);
|
|
31441
31795
|
if (!result) {
|
|
31442
31796
|
return { nodes: [], consumed: 0 };
|
|
31443
31797
|
}
|
|
@@ -31527,7 +31881,7 @@ const handler = (params2) => {
|
|
|
31527
31881
|
if (nodes.length === 0 || nodes[0].name !== "w:br") {
|
|
31528
31882
|
return { nodes: [], consumed: 0 };
|
|
31529
31883
|
}
|
|
31530
|
-
const result = translator$
|
|
31884
|
+
const result = translator$1c.encode(params2);
|
|
31531
31885
|
if (!result) return { nodes: [], consumed: 0 };
|
|
31532
31886
|
return {
|
|
31533
31887
|
nodes: [result],
|
|
@@ -31599,7 +31953,7 @@ const handleBookmarkStartNode = (params2) => {
|
|
|
31599
31953
|
if (isCustomMarkBookmark(nodes[0], params2.editor)) {
|
|
31600
31954
|
return handleBookmarkNode(params2);
|
|
31601
31955
|
}
|
|
31602
|
-
const node = translator$
|
|
31956
|
+
const node = translator$7.encode(params2);
|
|
31603
31957
|
if (!node) return { nodes: [], consumed: 0 };
|
|
31604
31958
|
return { nodes: [node], consumed: 1 };
|
|
31605
31959
|
};
|
|
@@ -31631,7 +31985,7 @@ const handleBookmarkEndNode = (params2) => {
|
|
|
31631
31985
|
if (!nodes.length || nodes[0].name !== "w:bookmarkEnd") {
|
|
31632
31986
|
return { nodes: [], consumed: 0 };
|
|
31633
31987
|
}
|
|
31634
|
-
const node = translator$
|
|
31988
|
+
const node = translator$6.encode(params2);
|
|
31635
31989
|
if (!node) return { nodes: [], consumed: 0 };
|
|
31636
31990
|
return { nodes: [node], consumed: 1 };
|
|
31637
31991
|
};
|
|
@@ -31764,7 +32118,7 @@ const autoTotalPageCountEntity = {
|
|
|
31764
32118
|
handlerName: "autoTotalPageCountEntity",
|
|
31765
32119
|
handler: handleAutoTotalPageNumber
|
|
31766
32120
|
};
|
|
31767
|
-
const pageReferenceEntity = generateV2HandlerEntity("pageReferenceNodeHandler", translator$
|
|
32121
|
+
const pageReferenceEntity = generateV2HandlerEntity("pageReferenceNodeHandler", translator$5);
|
|
31768
32122
|
const handlePictNode = (params2) => {
|
|
31769
32123
|
const { nodes } = params2;
|
|
31770
32124
|
if (!nodes.length || nodes[0].name !== "w:p") {
|
|
@@ -32153,14 +32507,14 @@ const handleTabNode = (params2) => {
|
|
|
32153
32507
|
if (!nodes.length || nodes[0].name !== "w:tab") {
|
|
32154
32508
|
return { nodes: [], consumed: 0 };
|
|
32155
32509
|
}
|
|
32156
|
-
const node = translator$
|
|
32510
|
+
const node = translator$1a.encode(params2);
|
|
32157
32511
|
return { nodes: [node], consumed: 1 };
|
|
32158
32512
|
};
|
|
32159
32513
|
const tabNodeEntityHandler = {
|
|
32160
32514
|
handlerName: "w:tabTranslator",
|
|
32161
32515
|
handler: handleTabNode
|
|
32162
32516
|
};
|
|
32163
|
-
const tableOfContentsHandlerEntity = generateV2HandlerEntity("tableOfContentsHandler", translator$
|
|
32517
|
+
const tableOfContentsHandlerEntity = generateV2HandlerEntity("tableOfContentsHandler", translator$4);
|
|
32164
32518
|
function preProcessPageInstruction(nodesToCombine) {
|
|
32165
32519
|
const pageNumNode = {
|
|
32166
32520
|
name: "sd:autoPageNumber",
|
|
@@ -33101,7 +33455,7 @@ function translateVRectContentBlock(params2) {
|
|
|
33101
33455
|
const XML_NODE_NAME = "w:pict";
|
|
33102
33456
|
const SD_NODE_NAME = ["shapeContainer", "contentBlock"];
|
|
33103
33457
|
const validXmlAttributes = [];
|
|
33104
|
-
function encode$
|
|
33458
|
+
function encode$1f(params2) {
|
|
33105
33459
|
const { node, pNode } = params2.extraParams;
|
|
33106
33460
|
const { type: pictType, handler: handler2 } = pictNodeTypeStrategy(node);
|
|
33107
33461
|
if (!handler2 || pictType === "unknown") {
|
|
@@ -33133,7 +33487,7 @@ const config = {
|
|
|
33133
33487
|
xmlName: XML_NODE_NAME,
|
|
33134
33488
|
sdNodeOrKeyName: SD_NODE_NAME,
|
|
33135
33489
|
type: NodeTranslator.translatorTypes.NODE,
|
|
33136
|
-
encode: encode$
|
|
33490
|
+
encode: encode$1f,
|
|
33137
33491
|
decode,
|
|
33138
33492
|
attributes: validXmlAttributes
|
|
33139
33493
|
};
|
|
@@ -33209,35 +33563,35 @@ function exportSchemaToJson(params2) {
|
|
|
33209
33563
|
doc: translateDocumentNode,
|
|
33210
33564
|
body: translateBodyNode,
|
|
33211
33565
|
heading: translateHeadingNode,
|
|
33212
|
-
paragraph: translator$
|
|
33213
|
-
run: translator$
|
|
33566
|
+
paragraph: translator$19,
|
|
33567
|
+
run: translator$Y,
|
|
33214
33568
|
text: translateTextNode,
|
|
33215
33569
|
bulletList: translateList,
|
|
33216
33570
|
orderedList: translateList,
|
|
33217
|
-
lineBreak: translator$
|
|
33218
|
-
table: translator$
|
|
33219
|
-
tableRow: translator$
|
|
33220
|
-
tableCell: translator$
|
|
33221
|
-
bookmarkStart: translator$
|
|
33222
|
-
bookmarkEnd: translator$
|
|
33223
|
-
fieldAnnotation: translator$
|
|
33224
|
-
tab: translator$
|
|
33225
|
-
image: translator$
|
|
33226
|
-
hardBreak: translator$
|
|
33571
|
+
lineBreak: translator$1c,
|
|
33572
|
+
table: translator$d,
|
|
33573
|
+
tableRow: translator$K,
|
|
33574
|
+
tableCell: translator$c,
|
|
33575
|
+
bookmarkStart: translator$7,
|
|
33576
|
+
bookmarkEnd: translator$6,
|
|
33577
|
+
fieldAnnotation: translator$8,
|
|
33578
|
+
tab: translator$1a,
|
|
33579
|
+
image: translator$9,
|
|
33580
|
+
hardBreak: translator$1c,
|
|
33227
33581
|
commentRangeStart: commentRangeStartTranslator,
|
|
33228
33582
|
commentRangeEnd: commentRangeEndTranslator,
|
|
33229
33583
|
commentReference: () => null,
|
|
33230
33584
|
shapeContainer: translator,
|
|
33231
33585
|
shapeTextbox: translator,
|
|
33232
33586
|
contentBlock: translator,
|
|
33233
|
-
structuredContent: translator$
|
|
33234
|
-
structuredContentBlock: translator$
|
|
33235
|
-
documentPartObject: translator$
|
|
33236
|
-
documentSection: translator$
|
|
33587
|
+
structuredContent: translator$8,
|
|
33588
|
+
structuredContentBlock: translator$8,
|
|
33589
|
+
documentPartObject: translator$8,
|
|
33590
|
+
documentSection: translator$8,
|
|
33237
33591
|
"page-number": translatePageNumberNode,
|
|
33238
33592
|
"total-page-number": translateTotalPageNumberNode,
|
|
33239
|
-
pageReference: translator$
|
|
33240
|
-
tableOfContents: translator$
|
|
33593
|
+
pageReference: translator$5,
|
|
33594
|
+
tableOfContents: translator$4
|
|
33241
33595
|
};
|
|
33242
33596
|
let handler2 = router[type2];
|
|
33243
33597
|
if (handler2 && "decode" in handler2 && typeof handler2.decode === "function") {
|
|
@@ -33571,59 +33925,23 @@ function getTextNodeForExport(text, marks, params2) {
|
|
|
33571
33925
|
return wrapTextInRun(textNodes, outputMarks);
|
|
33572
33926
|
}
|
|
33573
33927
|
function translateTextNode(params2) {
|
|
33574
|
-
const { node } = params2;
|
|
33928
|
+
const { node, extraParams } = params2;
|
|
33575
33929
|
const trackedMarks = [TrackInsertMarkName, TrackDeleteMarkName];
|
|
33576
|
-
const
|
|
33577
|
-
if (
|
|
33578
|
-
|
|
33579
|
-
|
|
33580
|
-
|
|
33581
|
-
|
|
33582
|
-
|
|
33583
|
-
|
|
33584
|
-
const markElement = {
|
|
33585
|
-
type: "element",
|
|
33586
|
-
name: "w:rPrChange",
|
|
33587
|
-
attributes: {
|
|
33588
|
-
"w:id": trackStyleMark.attrs.id,
|
|
33589
|
-
"w:author": trackStyleMark.attrs.author,
|
|
33590
|
-
"w:authorEmail": trackStyleMark.attrs.authorEmail,
|
|
33591
|
-
"w:date": trackStyleMark.attrs.date
|
|
33592
|
-
},
|
|
33593
|
-
elements: trackStyleMark.attrs.before.map((mark) => processOutputMarks([mark])).filter((r2) => r2 !== void 0)
|
|
33594
|
-
};
|
|
33595
|
-
return markElement;
|
|
33596
|
-
}
|
|
33597
|
-
return void 0;
|
|
33598
|
-
}
|
|
33599
|
-
function translateTrackedNode(params2) {
|
|
33600
|
-
const { node } = params2;
|
|
33601
|
-
const marks = node.marks;
|
|
33602
|
-
const trackingMarks = [TrackInsertMarkName, TrackDeleteMarkName, TrackFormatMarkName];
|
|
33603
|
-
const trackedMark = marks.find((m2) => trackingMarks.includes(m2.type));
|
|
33604
|
-
const isInsert = trackedMark.type === TrackInsertMarkName;
|
|
33605
|
-
const trackStyleMark = createTrackStyleMark(marks);
|
|
33606
|
-
node.marks = marks.filter((m2) => !trackingMarks.includes(m2.type));
|
|
33607
|
-
if (trackStyleMark) {
|
|
33608
|
-
node.marks.push(trackStyleMark);
|
|
33930
|
+
const trackedMark = node.marks?.find((m2) => trackedMarks.includes(m2.type));
|
|
33931
|
+
if (trackedMark) {
|
|
33932
|
+
switch (trackedMark.type) {
|
|
33933
|
+
case "trackDelete":
|
|
33934
|
+
return translator$3.decode(params2);
|
|
33935
|
+
case "trackInsert":
|
|
33936
|
+
return translator$2.decode(params2);
|
|
33937
|
+
}
|
|
33609
33938
|
}
|
|
33610
|
-
const
|
|
33611
|
-
if (!
|
|
33612
|
-
|
|
33613
|
-
textNode.name = "w:delText";
|
|
33939
|
+
const isLinkNode = node.marks?.some((m2) => m2.type === "link");
|
|
33940
|
+
if (isLinkNode && !extraParams?.linkProcessed) {
|
|
33941
|
+
return translator$Z.decode(params2);
|
|
33614
33942
|
}
|
|
33615
|
-
const
|
|
33616
|
-
|
|
33617
|
-
type: "element",
|
|
33618
|
-
attributes: {
|
|
33619
|
-
"w:id": trackedMark.attrs.id,
|
|
33620
|
-
"w:author": trackedMark.attrs.author,
|
|
33621
|
-
"w:authorEmail": trackedMark.attrs.authorEmail,
|
|
33622
|
-
"w:date": trackedMark.attrs.date
|
|
33623
|
-
},
|
|
33624
|
-
elements: [translatedTextNode]
|
|
33625
|
-
};
|
|
33626
|
-
return trackedNode;
|
|
33943
|
+
const { text, marks = [] } = node;
|
|
33944
|
+
return getTextNodeForExport(text, marks, params2);
|
|
33627
33945
|
}
|
|
33628
33946
|
function wrapTextInRun(nodeOrNodes, marks) {
|
|
33629
33947
|
let elements = [];
|
|
@@ -33880,7 +34198,7 @@ function translateMark(mark) {
|
|
|
33880
34198
|
markElement.type = "element";
|
|
33881
34199
|
break;
|
|
33882
34200
|
case "underline": {
|
|
33883
|
-
const translated = translator$
|
|
34201
|
+
const translated = translator$16.decode({
|
|
33884
34202
|
node: {
|
|
33885
34203
|
attrs: {
|
|
33886
34204
|
underlineType: attrs.underlineType ?? attrs.underline ?? null,
|
|
@@ -33944,9 +34262,11 @@ function translateMark(mark) {
|
|
|
33944
34262
|
break;
|
|
33945
34263
|
case "highlight": {
|
|
33946
34264
|
const highlightValue = attrs.color ?? attrs.highlight ?? null;
|
|
33947
|
-
const translated = translator$
|
|
34265
|
+
const translated = translator$1b.decode({ node: { attrs: { highlight: highlightValue } } });
|
|
33948
34266
|
return translated || {};
|
|
33949
34267
|
}
|
|
34268
|
+
case "link":
|
|
34269
|
+
return {};
|
|
33950
34270
|
}
|
|
33951
34271
|
return markElement;
|
|
33952
34272
|
}
|
|
@@ -63885,6 +64205,58 @@ const registerImages = async (foundImages, editor, view) => {
|
|
|
63885
64205
|
}
|
|
63886
64206
|
});
|
|
63887
64207
|
};
|
|
64208
|
+
const normalizeWrap = (attrs = {}) => {
|
|
64209
|
+
const wrap2 = attrs.wrap;
|
|
64210
|
+
if (wrap2?.type && wrap2.type !== "Inline") {
|
|
64211
|
+
return {
|
|
64212
|
+
type: wrap2.type,
|
|
64213
|
+
attrs: wrap2.attrs ?? {}
|
|
64214
|
+
};
|
|
64215
|
+
}
|
|
64216
|
+
if (wrap2?.type === "Inline" && Object.keys(wrap2.attrs ?? {}).length) {
|
|
64217
|
+
return {
|
|
64218
|
+
type: "Inline",
|
|
64219
|
+
attrs: wrap2.attrs
|
|
64220
|
+
};
|
|
64221
|
+
}
|
|
64222
|
+
if (!wrap2 && attrs.wrapText) {
|
|
64223
|
+
return {
|
|
64224
|
+
type: "Square",
|
|
64225
|
+
attrs: {
|
|
64226
|
+
wrapText: attrs.wrapText
|
|
64227
|
+
}
|
|
64228
|
+
};
|
|
64229
|
+
}
|
|
64230
|
+
if (!wrap2 && attrs.wrapTopAndBottom) {
|
|
64231
|
+
return {
|
|
64232
|
+
type: "TopAndBottom",
|
|
64233
|
+
attrs: {}
|
|
64234
|
+
};
|
|
64235
|
+
}
|
|
64236
|
+
if (wrap2?.type === "Inline") {
|
|
64237
|
+
return {
|
|
64238
|
+
type: "Inline",
|
|
64239
|
+
attrs: wrap2.attrs ?? {}
|
|
64240
|
+
};
|
|
64241
|
+
}
|
|
64242
|
+
return {
|
|
64243
|
+
type: "Inline",
|
|
64244
|
+
attrs: {}
|
|
64245
|
+
};
|
|
64246
|
+
};
|
|
64247
|
+
const normalizeMarginOffset = (marginOffset = {}) => {
|
|
64248
|
+
const { left: left2, horizontal, ...rest } = marginOffset;
|
|
64249
|
+
return {
|
|
64250
|
+
...rest,
|
|
64251
|
+
horizontal: horizontal ?? left2
|
|
64252
|
+
};
|
|
64253
|
+
};
|
|
64254
|
+
const getNormalizedImageAttrs = (attrs = {}) => {
|
|
64255
|
+
return {
|
|
64256
|
+
wrap: normalizeWrap(attrs),
|
|
64257
|
+
marginOffset: normalizeMarginOffset(attrs.marginOffset ?? {})
|
|
64258
|
+
};
|
|
64259
|
+
};
|
|
63888
64260
|
const ImagePositionPluginKey = new PluginKey("ImagePosition");
|
|
63889
64261
|
const ImagePositionPlugin = ({ editor }) => {
|
|
63890
64262
|
const { view } = editor;
|
|
@@ -63932,7 +64304,8 @@ const getImagePositionDecorations = (state2, view) => {
|
|
|
63932
64304
|
let style2 = "";
|
|
63933
64305
|
let className = "";
|
|
63934
64306
|
const { vRelativeFrom, alignH } = node.attrs.anchorData;
|
|
63935
|
-
const { size: size2, padding
|
|
64307
|
+
const { size: size2, padding } = node.attrs;
|
|
64308
|
+
const { marginOffset } = getNormalizedImageAttrs(node.attrs);
|
|
63936
64309
|
const pageBreak = findPreviousDomNodeWithClass(view, pos, "pagination-break-wrapper");
|
|
63937
64310
|
if (pageBreak) {
|
|
63938
64311
|
switch (alignH) {
|
|
@@ -64049,7 +64422,24 @@ const Image = Node$1.create({
|
|
|
64049
64422
|
rendered: false
|
|
64050
64423
|
},
|
|
64051
64424
|
originalAttributes: { rendered: false },
|
|
64052
|
-
|
|
64425
|
+
/**
|
|
64426
|
+
* @category Attribute
|
|
64427
|
+
* @param {Object} wrap - Wrapping options
|
|
64428
|
+
* @param {string} wrap.type - Wrap type: "None", "Square", "Through", "Tight", "TopAndBottom", "Inline"
|
|
64429
|
+
* @param {Object} [wrap.attrs] - Wrap attributes (only allowed attributes for the given type will be accepted)
|
|
64430
|
+
* @param {string} [wrap.attrs.wrapText] - Text wrapping mode for Square type: "bothSides", "largest", "left", "right"
|
|
64431
|
+
* @param {number} [wrap.attrs.distTop] - Top distance in pixels
|
|
64432
|
+
* @param {number} [wrap.attrs.distBottom] - Bottom distance in pixels
|
|
64433
|
+
* @param {number} [wrap.attrs.distLeft] - Left distance in pixels
|
|
64434
|
+
* @param {number} [wrap.attrs.distRight] - Right distance in pixels
|
|
64435
|
+
* @param {Array} [wrap.attrs.polygon] - Polygon points for Through/Tight types: [[x1,y1], [x2,y2], ...]
|
|
64436
|
+
* @param {boolean} [wrap.attrs.behindDoc] - Whether image should be behind document text (for wrapNone)
|
|
64437
|
+
*/
|
|
64438
|
+
wrap: {
|
|
64439
|
+
default: { type: "Inline" },
|
|
64440
|
+
rendered: false
|
|
64441
|
+
// Handled in main renderDOM
|
|
64442
|
+
},
|
|
64053
64443
|
anchorData: {
|
|
64054
64444
|
default: null,
|
|
64055
64445
|
rendered: false
|
|
@@ -64095,7 +64485,6 @@ const Image = Node$1.create({
|
|
|
64095
64485
|
* @private
|
|
64096
64486
|
*/
|
|
64097
64487
|
simplePos: { rendered: false },
|
|
64098
|
-
wrapText: { rendered: false },
|
|
64099
64488
|
extension: { rendered: false },
|
|
64100
64489
|
size: {
|
|
64101
64490
|
default: {},
|
|
@@ -64111,55 +64500,13 @@ const Image = Node$1.create({
|
|
|
64111
64500
|
},
|
|
64112
64501
|
padding: {
|
|
64113
64502
|
default: {},
|
|
64114
|
-
|
|
64115
|
-
|
|
64116
|
-
const { rotation } = transformData;
|
|
64117
|
-
const { height, width } = size2;
|
|
64118
|
-
if (rotation && height && width) {
|
|
64119
|
-
const { horizontal, vertical } = getRotationMargins(width, height, rotation);
|
|
64120
|
-
left2 += horizontal;
|
|
64121
|
-
right2 += horizontal;
|
|
64122
|
-
top2 += vertical;
|
|
64123
|
-
bottom2 += vertical;
|
|
64124
|
-
}
|
|
64125
|
-
let style2 = "";
|
|
64126
|
-
if (left2 && marginOffset?.left == null) style2 += `margin-left: ${left2}px;`;
|
|
64127
|
-
if (top2 && marginOffset?.top == null) style2 += `margin-top: ${top2}px;`;
|
|
64128
|
-
if (bottom2) style2 += `margin-bottom: ${bottom2}px;`;
|
|
64129
|
-
if (right2) style2 += `margin-right: ${right2}px;`;
|
|
64130
|
-
return { style: style2 };
|
|
64131
|
-
}
|
|
64503
|
+
rendered: false
|
|
64504
|
+
// Handled in main renderDOM
|
|
64132
64505
|
},
|
|
64133
64506
|
marginOffset: {
|
|
64134
64507
|
default: {},
|
|
64135
|
-
|
|
64136
|
-
|
|
64137
|
-
const hasMarginOffsets = marginOffset?.left != null || marginOffset?.top != null;
|
|
64138
|
-
if (!hasAnchorData && !hasMarginOffsets) return {};
|
|
64139
|
-
const relativeFromPageV = anchorData?.vRelativeFrom === "page";
|
|
64140
|
-
const maxMarginV = 500;
|
|
64141
|
-
const baseLeft = marginOffset?.left ?? 0;
|
|
64142
|
-
const baseTop = marginOffset?.top ?? 0;
|
|
64143
|
-
let rotationLeft = 0;
|
|
64144
|
-
let rotationTop = 0;
|
|
64145
|
-
const { rotation } = transformData ?? {};
|
|
64146
|
-
const { height, width } = size2 ?? {};
|
|
64147
|
-
if (rotation && height && width) {
|
|
64148
|
-
const { horizontal, vertical } = getRotationMargins(width, height, rotation);
|
|
64149
|
-
rotationLeft = horizontal;
|
|
64150
|
-
rotationTop = vertical;
|
|
64151
|
-
}
|
|
64152
|
-
const left2 = baseLeft + rotationLeft;
|
|
64153
|
-
const top2 = baseTop + rotationTop;
|
|
64154
|
-
let style2 = "";
|
|
64155
|
-
if (left2) style2 += `margin-left: ${left2}px;`;
|
|
64156
|
-
if (top2) {
|
|
64157
|
-
if (relativeFromPageV && top2 >= maxMarginV) style2 += `margin-top: ${maxMarginV}px;`;
|
|
64158
|
-
else style2 += `margin-top: ${top2}px;`;
|
|
64159
|
-
}
|
|
64160
|
-
if (!style2) return {};
|
|
64161
|
-
return { style: style2 };
|
|
64162
|
-
}
|
|
64508
|
+
rendered: false
|
|
64509
|
+
// Handled in main renderDOM
|
|
64163
64510
|
},
|
|
64164
64511
|
style: {
|
|
64165
64512
|
default: null,
|
|
@@ -64178,8 +64525,181 @@ const Image = Node$1.create({
|
|
|
64178
64525
|
}
|
|
64179
64526
|
];
|
|
64180
64527
|
},
|
|
64181
|
-
renderDOM({ htmlAttributes }) {
|
|
64182
|
-
|
|
64528
|
+
renderDOM({ node, htmlAttributes }) {
|
|
64529
|
+
const { wrap: wrap2, marginOffset } = getNormalizedImageAttrs(node.attrs);
|
|
64530
|
+
const { anchorData, padding, transformData = {}, size: size2 = { width: 0, height: 0 } } = node.attrs;
|
|
64531
|
+
const margin = {
|
|
64532
|
+
left: 0,
|
|
64533
|
+
right: 0,
|
|
64534
|
+
top: 0,
|
|
64535
|
+
bottom: 0
|
|
64536
|
+
};
|
|
64537
|
+
let centered = false;
|
|
64538
|
+
let floatRight = false;
|
|
64539
|
+
let baseHorizontal = marginOffset?.horizontal || 0;
|
|
64540
|
+
let style2 = "";
|
|
64541
|
+
if (padding) {
|
|
64542
|
+
if (padding.left) margin.left += padding.left;
|
|
64543
|
+
if (padding.right) margin.right += padding.right;
|
|
64544
|
+
if (padding.top) margin.top += padding.top;
|
|
64545
|
+
if (padding.bottom) margin.bottom += padding.bottom;
|
|
64546
|
+
}
|
|
64547
|
+
const { rotation } = transformData;
|
|
64548
|
+
const { height, width } = size2;
|
|
64549
|
+
if (rotation && height && width) {
|
|
64550
|
+
const { horizontal, vertical } = getRotationMargins(width, height, rotation);
|
|
64551
|
+
margin.left += horizontal;
|
|
64552
|
+
margin.right += horizontal;
|
|
64553
|
+
margin.top += vertical;
|
|
64554
|
+
margin.bottom += vertical;
|
|
64555
|
+
}
|
|
64556
|
+
if (wrap2 && wrap2.type) {
|
|
64557
|
+
const { type: type2, attrs = {} } = wrap2;
|
|
64558
|
+
switch (type2) {
|
|
64559
|
+
case "None":
|
|
64560
|
+
style2 += "position: absolute;";
|
|
64561
|
+
if (attrs.behindDoc) {
|
|
64562
|
+
style2 += "z-index: -1;";
|
|
64563
|
+
} else {
|
|
64564
|
+
style2 += "z-index: 1;";
|
|
64565
|
+
}
|
|
64566
|
+
break;
|
|
64567
|
+
case "Square":
|
|
64568
|
+
style2 += "shape-outside: border-box; clear: both;";
|
|
64569
|
+
if (attrs.wrapText === "right") {
|
|
64570
|
+
style2 += "float: left;";
|
|
64571
|
+
} else if (attrs.wrapText === "left") {
|
|
64572
|
+
style2 += "float: right;";
|
|
64573
|
+
floatRight = true;
|
|
64574
|
+
} else if (["largest", "bothSides"].includes(attrs.wrapText)) {
|
|
64575
|
+
const pageStyles2 = this.editor?.converter?.pageStyles;
|
|
64576
|
+
if (pageStyles2?.pageSize && pageStyles2?.pageMargins && size2.width) {
|
|
64577
|
+
const pageWidth = inchesToPixels(pageStyles2.pageSize.width);
|
|
64578
|
+
const leftMargin = inchesToPixels(pageStyles2.pageMargins.left);
|
|
64579
|
+
const rightMargin = inchesToPixels(pageStyles2.pageMargins.right);
|
|
64580
|
+
const contentWidth = pageWidth - leftMargin - rightMargin;
|
|
64581
|
+
const imageWidth = size2.width + (attrs.distLeft || 0) + (attrs.distRight || 0);
|
|
64582
|
+
const leftSpace = marginOffset.horizontal;
|
|
64583
|
+
const rightSpace = contentWidth - leftSpace - imageWidth;
|
|
64584
|
+
if (rightSpace < 0) {
|
|
64585
|
+
style2 += "float: left;";
|
|
64586
|
+
} else if (rightSpace > leftSpace) {
|
|
64587
|
+
style2 += "float: left;";
|
|
64588
|
+
} else {
|
|
64589
|
+
style2 += "float: right;";
|
|
64590
|
+
floatRight = true;
|
|
64591
|
+
baseHorizontal = rightSpace;
|
|
64592
|
+
}
|
|
64593
|
+
} else {
|
|
64594
|
+
style2 += "float: left;";
|
|
64595
|
+
}
|
|
64596
|
+
}
|
|
64597
|
+
if (attrs.distTop) margin.top += attrs.distTop;
|
|
64598
|
+
if (attrs.distBottom) margin.bottom += attrs.distBottom;
|
|
64599
|
+
if (attrs.distLeft) margin.left += attrs.distLeft;
|
|
64600
|
+
if (attrs.distRight) margin.right += attrs.distRight;
|
|
64601
|
+
break;
|
|
64602
|
+
case "Through":
|
|
64603
|
+
case "Tight":
|
|
64604
|
+
style2 += "clear: both;";
|
|
64605
|
+
const pageStyles = this.editor?.converter?.pageStyles;
|
|
64606
|
+
if (pageStyles?.pageSize && pageStyles?.pageMargins && size2.width) {
|
|
64607
|
+
const pageWidth = inchesToPixels(pageStyles.pageSize.width);
|
|
64608
|
+
const leftMargin = inchesToPixels(pageStyles.pageMargins.left);
|
|
64609
|
+
const rightMargin = inchesToPixels(pageStyles.pageMargins.right);
|
|
64610
|
+
const contentWidth = pageWidth - leftMargin - rightMargin;
|
|
64611
|
+
const imageWidth = size2.width + (attrs.distLeft || 0) + (attrs.distRight || 0);
|
|
64612
|
+
const leftSpace = marginOffset.horizontal;
|
|
64613
|
+
const rightSpace = contentWidth - leftSpace - imageWidth;
|
|
64614
|
+
if (rightSpace < 0) {
|
|
64615
|
+
style2 += "float: left;";
|
|
64616
|
+
} else if (rightSpace > leftSpace) {
|
|
64617
|
+
style2 += "float: left;";
|
|
64618
|
+
} else {
|
|
64619
|
+
style2 += "float: right;";
|
|
64620
|
+
floatRight = true;
|
|
64621
|
+
baseHorizontal = rightSpace;
|
|
64622
|
+
}
|
|
64623
|
+
} else {
|
|
64624
|
+
style2 += "float: left;";
|
|
64625
|
+
}
|
|
64626
|
+
if (attrs.distTop) margin.top += attrs.distTop;
|
|
64627
|
+
if (attrs.distBottom) margin.bottom += attrs.distBottom;
|
|
64628
|
+
if (attrs.distLeft) margin.left += attrs.distLeft;
|
|
64629
|
+
if (attrs.distRight) margin.right += attrs.distRight;
|
|
64630
|
+
if (attrs.polygon) {
|
|
64631
|
+
let horizontalOffset = floatRight ? attrs.polygon[0][0] || 0 : marginOffset.horizontal + 15;
|
|
64632
|
+
let maxX = 0;
|
|
64633
|
+
let minX = 0;
|
|
64634
|
+
let minY = 0;
|
|
64635
|
+
let maxY = 0;
|
|
64636
|
+
attrs.polygon.forEach(([x, y2]) => {
|
|
64637
|
+
if (floatRight && x < horizontalOffset) horizontalOffset = x;
|
|
64638
|
+
if (x > maxX) maxX = x;
|
|
64639
|
+
if (x < minX) minX = x;
|
|
64640
|
+
if (y2 > maxY) maxY = y2;
|
|
64641
|
+
if (y2 < minY) minY = y2;
|
|
64642
|
+
});
|
|
64643
|
+
const originalWidth = maxX - minX;
|
|
64644
|
+
const originalHeight = maxY - minY;
|
|
64645
|
+
const scaleWidth = Math.min(1, size2.width / originalWidth);
|
|
64646
|
+
const scaleHeight = Math.min(1, size2.height / originalHeight);
|
|
64647
|
+
const verticalOffset = Math.max(0, marginOffset.top);
|
|
64648
|
+
const points = attrs.polygon.map(([x, y2]) => `${horizontalOffset + x * scaleWidth}px ${verticalOffset + y2 * scaleHeight}px`).join(", ");
|
|
64649
|
+
style2 += `shape-outside: polygon(${points});`;
|
|
64650
|
+
}
|
|
64651
|
+
break;
|
|
64652
|
+
case "TopAndBottom":
|
|
64653
|
+
style2 += "display: block; clear: both;";
|
|
64654
|
+
if (attrs.distTop) margin.top += attrs.distTop;
|
|
64655
|
+
if (attrs.distBottom) margin.bottom += attrs.distBottom;
|
|
64656
|
+
centered = true;
|
|
64657
|
+
break;
|
|
64658
|
+
}
|
|
64659
|
+
}
|
|
64660
|
+
const hasAnchorData = Boolean(anchorData);
|
|
64661
|
+
const hasMarginOffsets = marginOffset?.horizontal != null || marginOffset?.top != null;
|
|
64662
|
+
if (hasAnchorData || hasMarginOffsets) {
|
|
64663
|
+
const relativeFromPageV = anchorData?.vRelativeFrom === "page";
|
|
64664
|
+
const maxMarginV = 500;
|
|
64665
|
+
const baseTop = Math.max(0, marginOffset?.top ?? 0);
|
|
64666
|
+
let rotationHorizontal = 0;
|
|
64667
|
+
let rotationTop = 0;
|
|
64668
|
+
const { rotation: rotation2 } = transformData ?? {};
|
|
64669
|
+
const { height: height2, width: width2 } = size2 ?? {};
|
|
64670
|
+
if (rotation2 && height2 && width2) {
|
|
64671
|
+
const { horizontal: horizontal2, vertical } = getRotationMargins(width2, height2, rotation2);
|
|
64672
|
+
rotationHorizontal = horizontal2;
|
|
64673
|
+
rotationTop = vertical;
|
|
64674
|
+
}
|
|
64675
|
+
const horizontal = baseHorizontal + rotationHorizontal;
|
|
64676
|
+
const top2 = baseTop + rotationTop;
|
|
64677
|
+
if (horizontal) {
|
|
64678
|
+
if (floatRight) {
|
|
64679
|
+
margin.right += horizontal;
|
|
64680
|
+
} else {
|
|
64681
|
+
margin.left += horizontal;
|
|
64682
|
+
}
|
|
64683
|
+
}
|
|
64684
|
+
if (top2) {
|
|
64685
|
+
if (relativeFromPageV && top2 >= maxMarginV) margin.top += maxMarginV;
|
|
64686
|
+
else margin.top += top2;
|
|
64687
|
+
}
|
|
64688
|
+
}
|
|
64689
|
+
if (centered) {
|
|
64690
|
+
style2 += "margin-left: auto; margin-right: auto;";
|
|
64691
|
+
} else {
|
|
64692
|
+
if (margin.left) style2 += `margin-left: ${margin.left}px;`;
|
|
64693
|
+
if (margin.right) style2 += `margin-right: ${margin.right}px;`;
|
|
64694
|
+
}
|
|
64695
|
+
if (margin.top) style2 += `margin-top: ${margin.top}px;`;
|
|
64696
|
+
if (margin.bottom) style2 += `margin-bottom: ${margin.bottom}px;`;
|
|
64697
|
+
const finalAttributes = { ...htmlAttributes };
|
|
64698
|
+
if (style2) {
|
|
64699
|
+
const existingStyle = finalAttributes.style || "";
|
|
64700
|
+
finalAttributes.style = existingStyle + (existingStyle ? " " : "") + style2;
|
|
64701
|
+
}
|
|
64702
|
+
return ["img", Attribute2.mergeAttributes(this.options.htmlAttributes, finalAttributes)];
|
|
64183
64703
|
},
|
|
64184
64704
|
addCommands() {
|
|
64185
64705
|
return {
|
|
@@ -64201,6 +64721,85 @@ const Image = Node$1.create({
|
|
|
64201
64721
|
type: this.name,
|
|
64202
64722
|
attrs: options
|
|
64203
64723
|
});
|
|
64724
|
+
},
|
|
64725
|
+
/**
|
|
64726
|
+
* Set the wrapping mode and attributes for the selected image
|
|
64727
|
+
* @category Command
|
|
64728
|
+
* @param {Object} options - Wrapping options
|
|
64729
|
+
* @param {string} options.type - Wrap type: "None", "Square", "Through", "Tight", "TopAndBottom", "Inline"
|
|
64730
|
+
* @param {Object} [options.attrs] - Wrap attributes (only allowed attributes for the given type will be accepted)
|
|
64731
|
+
* @param {string} [options.attrs.wrapText] - Text wrapping mode for Square type: "bothSides", "largest", "left", "right"
|
|
64732
|
+
* @param {number} [options.attrs.distTop] - Top distance in pixels
|
|
64733
|
+
* @param {number} [options.attrs.distBottom] - Bottom distance in pixels
|
|
64734
|
+
* @param {number} [options.attrs.distLeft] - Left distance in pixels
|
|
64735
|
+
* @param {number} [options.attrs.distRight] - Right distance in pixels
|
|
64736
|
+
* @param {Array} [options.attrs.polygon] - Polygon points for Through/Tight types: [[x1,y1], [x2,y2], ...]
|
|
64737
|
+
* @param {boolean} [options.attrs.behindDoc] - Whether image should be behind document text (for wrapNone)
|
|
64738
|
+
* @example
|
|
64739
|
+
* // No wrapping, behind document
|
|
64740
|
+
* editor.commands.setWrapping({ type: 'None', attrs: {behindDoc: true} })
|
|
64741
|
+
*
|
|
64742
|
+
* // Square wrapping on both sides with distances
|
|
64743
|
+
* editor.commands.setWrapping({
|
|
64744
|
+
* type: 'Square',
|
|
64745
|
+
* attrs: {
|
|
64746
|
+
* wrapText: 'bothSides',
|
|
64747
|
+
* distTop: 10,
|
|
64748
|
+
* distBottom: 10,
|
|
64749
|
+
* distLeft: 10,
|
|
64750
|
+
* distRight: 10
|
|
64751
|
+
* }
|
|
64752
|
+
* })
|
|
64753
|
+
*
|
|
64754
|
+
* // Tight wrapping with polygon
|
|
64755
|
+
* editor.commands.setWrapping({
|
|
64756
|
+
* type: 'Tight',
|
|
64757
|
+
* attrs: {
|
|
64758
|
+
* polygon: [[0, 0], [100, 0], [100, 100], [0, 100]]
|
|
64759
|
+
* }
|
|
64760
|
+
* })
|
|
64761
|
+
*
|
|
64762
|
+
* // Top and bottom wrapping
|
|
64763
|
+
* editor.commands.setWrapping({
|
|
64764
|
+
* type: 'TopAndBottom',
|
|
64765
|
+
* attrs: {
|
|
64766
|
+
* distTop: 15,
|
|
64767
|
+
* distBottom: 15
|
|
64768
|
+
* }
|
|
64769
|
+
* })
|
|
64770
|
+
*/
|
|
64771
|
+
setWrapping: (options) => ({ chain, state: state2 }) => {
|
|
64772
|
+
const { selection } = state2;
|
|
64773
|
+
const { $from } = selection;
|
|
64774
|
+
const node = $from.nodeAfter;
|
|
64775
|
+
if (!node || node.type.name !== this.name) {
|
|
64776
|
+
return false;
|
|
64777
|
+
}
|
|
64778
|
+
const { type: type2, attrs = {} } = options;
|
|
64779
|
+
const allowedAttrs = {};
|
|
64780
|
+
const allowedAttributes = {
|
|
64781
|
+
None: ["behindDoc"],
|
|
64782
|
+
Square: ["wrapText", "distTop", "distBottom", "distLeft", "distRight"],
|
|
64783
|
+
Through: ["distTop", "distBottom", "distLeft", "distRight", "polygon"],
|
|
64784
|
+
Tight: ["distTop", "distBottom", "distLeft", "distRight", "polygon"],
|
|
64785
|
+
TopAndBottom: ["distTop", "distBottom"],
|
|
64786
|
+
Inline: []
|
|
64787
|
+
};
|
|
64788
|
+
const allowedForType = allowedAttributes[type2] || [];
|
|
64789
|
+
Object.keys(attrs).forEach((key2) => {
|
|
64790
|
+
if (allowedForType.includes(key2)) {
|
|
64791
|
+
allowedAttrs[key2] = attrs[key2];
|
|
64792
|
+
}
|
|
64793
|
+
});
|
|
64794
|
+
const updatedAttrs = {
|
|
64795
|
+
...node.attrs,
|
|
64796
|
+
wrap: {
|
|
64797
|
+
type: type2,
|
|
64798
|
+
attrs: allowedAttrs
|
|
64799
|
+
},
|
|
64800
|
+
isAnchor: type2 !== "Inline"
|
|
64801
|
+
};
|
|
64802
|
+
return chain().updateAttributes(this.name, updatedAttrs).run();
|
|
64204
64803
|
}
|
|
64205
64804
|
};
|
|
64206
64805
|
},
|
|
@@ -87549,72 +88148,72 @@ const _sfc_main = {
|
|
|
87549
88148
|
const SuperInput = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-4d5cff52"]]);
|
|
87550
88149
|
const additionalHandlers = Object.freeze({
|
|
87551
88150
|
"mc:AlternateContent": translator$1,
|
|
87552
|
-
"sd:pageReference": translator$
|
|
87553
|
-
"sd:tableOfContents": translator$
|
|
87554
|
-
"w:b": translator$
|
|
87555
|
-
"w:bidiVisual": translator$
|
|
87556
|
-
"w:bookmarkEnd": translator$
|
|
87557
|
-
"w:bookmarkStart": translator$
|
|
87558
|
-
"w:bottom": translator$
|
|
87559
|
-
"w:br": translator$
|
|
87560
|
-
"w:cantSplit": translator$
|
|
87561
|
-
"w:cnfStyle": translator$
|
|
87562
|
-
"w:color": translator$
|
|
87563
|
-
"w:divId": translator$
|
|
87564
|
-
"w:drawing": translator$
|
|
87565
|
-
"w:end": translator$
|
|
87566
|
-
"w:gridAfter": translator$
|
|
87567
|
-
"w:gridBefore": translator$
|
|
87568
|
-
"w:gridCol": translator$
|
|
87569
|
-
"w:hidden": translator$
|
|
87570
|
-
"w:highlight": translator$
|
|
87571
|
-
"w:hyperlink": translator$
|
|
87572
|
-
"w:i": translator$
|
|
87573
|
-
"w:insideH": translator$
|
|
87574
|
-
"w:insideV": translator$
|
|
87575
|
-
"w:jc": translator$
|
|
87576
|
-
"w:left": translator$
|
|
87577
|
-
"w:p": translator$
|
|
87578
|
-
"w:r": translator$
|
|
87579
|
-
"w:rFonts": translator$
|
|
87580
|
-
"w:rPr": translator$
|
|
87581
|
-
"w:rStyle": translator$
|
|
87582
|
-
"w:right": translator$
|
|
87583
|
-
"w:sdt": translator$
|
|
87584
|
-
"w:shd": translator$
|
|
87585
|
-
"w:start": translator$
|
|
87586
|
-
"w:strike": translator$
|
|
87587
|
-
"w:sz": translator
|
|
87588
|
-
"w:szCs": translator$
|
|
87589
|
-
"w:tab": translator$
|
|
87590
|
-
"w:tbl": translator$
|
|
87591
|
-
"w:tblBorders": translator$
|
|
87592
|
-
"w:tblCaption": translator$
|
|
87593
|
-
"w:tblCellMar": translator$
|
|
87594
|
-
"w:tblCellSpacing": translator$
|
|
87595
|
-
"w:tblDescription": translator$
|
|
87596
|
-
"w:tblGrid": translator$
|
|
87597
|
-
"w:tblHeader": translator$
|
|
87598
|
-
"w:tblInd": translator$
|
|
87599
|
-
"w:tblLayout": translator$
|
|
87600
|
-
"w:tblLook": translator$
|
|
87601
|
-
"w:tblOverlap": translator$
|
|
87602
|
-
"w:tblPr": translator$
|
|
87603
|
-
"w:tblStyle": translator$
|
|
87604
|
-
"w:tblStyleColBandSize": translator$
|
|
87605
|
-
"w:tblStyleRowBandSize": translator$
|
|
87606
|
-
"w:tblW": translator$
|
|
87607
|
-
"w:tblpPr": translator$
|
|
87608
|
-
"w:tc": translator$
|
|
87609
|
-
"w:top": translator$
|
|
87610
|
-
"w:tr": translator$
|
|
87611
|
-
"w:trHeight": translator$
|
|
87612
|
-
"w:trPr": translator$
|
|
87613
|
-
"w:u": translator$
|
|
87614
|
-
"w:wAfter": translator$
|
|
87615
|
-
"w:wBefore": translator$
|
|
87616
|
-
"wp:anchor": translator$
|
|
87617
|
-
"wp:inline": translator$
|
|
88151
|
+
"sd:pageReference": translator$5,
|
|
88152
|
+
"sd:tableOfContents": translator$4,
|
|
88153
|
+
"w:b": translator$18,
|
|
88154
|
+
"w:bidiVisual": translator$J,
|
|
88155
|
+
"w:bookmarkEnd": translator$6,
|
|
88156
|
+
"w:bookmarkStart": translator$7,
|
|
88157
|
+
"w:bottom": translator$w,
|
|
88158
|
+
"w:br": translator$1c,
|
|
88159
|
+
"w:cantSplit": translator$X,
|
|
88160
|
+
"w:cnfStyle": translator$W,
|
|
88161
|
+
"w:color": translator$14,
|
|
88162
|
+
"w:divId": translator$V,
|
|
88163
|
+
"w:drawing": translator$9,
|
|
88164
|
+
"w:end": translator$u,
|
|
88165
|
+
"w:gridAfter": translator$U,
|
|
88166
|
+
"w:gridBefore": translator$T,
|
|
88167
|
+
"w:gridCol": translator$f,
|
|
88168
|
+
"w:hidden": translator$S,
|
|
88169
|
+
"w:highlight": translator$1b,
|
|
88170
|
+
"w:hyperlink": translator$Z,
|
|
88171
|
+
"w:i": translator$17,
|
|
88172
|
+
"w:insideH": translator$s,
|
|
88173
|
+
"w:insideV": translator$r,
|
|
88174
|
+
"w:jc": translator$R,
|
|
88175
|
+
"w:left": translator$q,
|
|
88176
|
+
"w:p": translator$19,
|
|
88177
|
+
"w:r": translator$Y,
|
|
88178
|
+
"w:rFonts": translator$13,
|
|
88179
|
+
"w:rPr": translator$_,
|
|
88180
|
+
"w:rStyle": translator$12,
|
|
88181
|
+
"w:right": translator$o,
|
|
88182
|
+
"w:sdt": translator$8,
|
|
88183
|
+
"w:shd": translator$I,
|
|
88184
|
+
"w:start": translator$m,
|
|
88185
|
+
"w:strike": translator$15,
|
|
88186
|
+
"w:sz": translator$11,
|
|
88187
|
+
"w:szCs": translator$10,
|
|
88188
|
+
"w:tab": translator$1a,
|
|
88189
|
+
"w:tbl": translator$d,
|
|
88190
|
+
"w:tblBorders": translator$i,
|
|
88191
|
+
"w:tblCaption": translator$H,
|
|
88192
|
+
"w:tblCellMar": translator$h,
|
|
88193
|
+
"w:tblCellSpacing": translator$Q,
|
|
88194
|
+
"w:tblDescription": translator$G,
|
|
88195
|
+
"w:tblGrid": translator$e,
|
|
88196
|
+
"w:tblHeader": translator$P,
|
|
88197
|
+
"w:tblInd": translator$F,
|
|
88198
|
+
"w:tblLayout": translator$E,
|
|
88199
|
+
"w:tblLook": translator$D,
|
|
88200
|
+
"w:tblOverlap": translator$C,
|
|
88201
|
+
"w:tblPr": translator$g,
|
|
88202
|
+
"w:tblStyle": translator$B,
|
|
88203
|
+
"w:tblStyleColBandSize": translator$A,
|
|
88204
|
+
"w:tblStyleRowBandSize": translator$z,
|
|
88205
|
+
"w:tblW": translator$y,
|
|
88206
|
+
"w:tblpPr": translator$x,
|
|
88207
|
+
"w:tc": translator$c,
|
|
88208
|
+
"w:top": translator$k,
|
|
88209
|
+
"w:tr": translator$K,
|
|
88210
|
+
"w:trHeight": translator$O,
|
|
88211
|
+
"w:trPr": translator$L,
|
|
88212
|
+
"w:u": translator$16,
|
|
88213
|
+
"w:wAfter": translator$N,
|
|
88214
|
+
"w:wBefore": translator$M,
|
|
88215
|
+
"wp:anchor": translator$b,
|
|
88216
|
+
"wp:inline": translator$a,
|
|
87618
88217
|
"w:commentRangeStart": commentRangeStartTranslator,
|
|
87619
88218
|
"w:commentRangeEnd": commentRangeEndTranslator
|
|
87620
88219
|
});
|