@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
|
@@ -15107,14 +15107,21 @@ function twipsToInches(twips) {
|
|
|
15107
15107
|
function twipsToPixels(twips) {
|
|
15108
15108
|
if (twips == null) return;
|
|
15109
15109
|
const inches = twipsToInches(twips);
|
|
15110
|
+
return inchesToPixels(inches);
|
|
15111
|
+
}
|
|
15112
|
+
function pixelsToTwips(pixels) {
|
|
15113
|
+
const inches = pixelsToInches(pixels);
|
|
15114
|
+
return inchesToTwips(inches);
|
|
15115
|
+
}
|
|
15116
|
+
function inchesToPixels(inches) {
|
|
15110
15117
|
if (inches == null) return;
|
|
15111
15118
|
const pixels = inches * 96;
|
|
15112
15119
|
return Math.round(pixels * 1e3) / 1e3;
|
|
15113
15120
|
}
|
|
15114
|
-
function
|
|
15121
|
+
function pixelsToInches(pixels) {
|
|
15115
15122
|
if (pixels == null) return;
|
|
15116
15123
|
const inches = Number(pixels) / 96;
|
|
15117
|
-
return
|
|
15124
|
+
return inches;
|
|
15118
15125
|
}
|
|
15119
15126
|
function twipsToLines(twips) {
|
|
15120
15127
|
if (twips == null) return;
|
|
@@ -15165,6 +15172,71 @@ function degreesToRot(degrees) {
|
|
|
15165
15172
|
if (degrees == null) return;
|
|
15166
15173
|
return degrees * 6e4;
|
|
15167
15174
|
}
|
|
15175
|
+
function pixelsToPolygonUnits(pixels) {
|
|
15176
|
+
if (pixels == null) return;
|
|
15177
|
+
const pu = pixels * 96;
|
|
15178
|
+
return Math.round(pu);
|
|
15179
|
+
}
|
|
15180
|
+
function polygonUnitsToPixels(pu) {
|
|
15181
|
+
if (pu == null) return;
|
|
15182
|
+
const pixels = Number(pu) / 96;
|
|
15183
|
+
return Math.round(pixels * 1e3) / 1e3;
|
|
15184
|
+
}
|
|
15185
|
+
function polygonToObj(polygonNode) {
|
|
15186
|
+
if (!polygonNode) return null;
|
|
15187
|
+
const points = [];
|
|
15188
|
+
polygonNode.elements.forEach((element) => {
|
|
15189
|
+
if (["wp:start", "wp:lineTo"].includes(element.name)) {
|
|
15190
|
+
const { x, y: y2 } = element.attributes;
|
|
15191
|
+
points.push([polygonUnitsToPixels(x), polygonUnitsToPixels(y2)]);
|
|
15192
|
+
}
|
|
15193
|
+
});
|
|
15194
|
+
if (points.length > 1) {
|
|
15195
|
+
const firstPoint = points[0];
|
|
15196
|
+
const lastPoint = points[points.length - 1];
|
|
15197
|
+
if (firstPoint[0] === lastPoint[0] && firstPoint[1] === lastPoint[1]) {
|
|
15198
|
+
points.pop();
|
|
15199
|
+
}
|
|
15200
|
+
}
|
|
15201
|
+
return points;
|
|
15202
|
+
}
|
|
15203
|
+
function objToPolygon(points) {
|
|
15204
|
+
if (!points || !Array.isArray(points)) return null;
|
|
15205
|
+
const polygonNode = {
|
|
15206
|
+
name: "wp:wrapPolygon",
|
|
15207
|
+
type: "wp:wrapPolygon",
|
|
15208
|
+
attributes: {
|
|
15209
|
+
edited: "0"
|
|
15210
|
+
},
|
|
15211
|
+
elements: []
|
|
15212
|
+
};
|
|
15213
|
+
points.forEach((point, index2) => {
|
|
15214
|
+
const [x, y2] = point;
|
|
15215
|
+
const tagName = index2 === 0 ? "wp:start" : "wp:lineTo";
|
|
15216
|
+
const pointNode = {
|
|
15217
|
+
name: tagName,
|
|
15218
|
+
type: tagName,
|
|
15219
|
+
attributes: {
|
|
15220
|
+
x: pixelsToPolygonUnits(x),
|
|
15221
|
+
y: pixelsToPolygonUnits(y2)
|
|
15222
|
+
}
|
|
15223
|
+
};
|
|
15224
|
+
polygonNode.elements.push(pointNode);
|
|
15225
|
+
});
|
|
15226
|
+
if (points.length > 0) {
|
|
15227
|
+
const [startX, startY] = points[0];
|
|
15228
|
+
const closePointNode = {
|
|
15229
|
+
name: "wp:lineTo",
|
|
15230
|
+
type: "wp:lineTo",
|
|
15231
|
+
attributes: {
|
|
15232
|
+
x: pixelsToPolygonUnits(startX),
|
|
15233
|
+
y: pixelsToPolygonUnits(startY)
|
|
15234
|
+
}
|
|
15235
|
+
};
|
|
15236
|
+
polygonNode.elements.push(closePointNode);
|
|
15237
|
+
}
|
|
15238
|
+
return polygonNode;
|
|
15239
|
+
}
|
|
15168
15240
|
const getTextIndentExportValue = (indent) => {
|
|
15169
15241
|
const [value, unit] = parseSizeUnit(indent);
|
|
15170
15242
|
const functionsMap = {
|
|
@@ -24480,37 +24552,37 @@ const _NodeTranslator = class _NodeTranslator2 {
|
|
|
24480
24552
|
};
|
|
24481
24553
|
__publicField$2(_NodeTranslator, "translatorTypes", TranslatorTypes);
|
|
24482
24554
|
let NodeTranslator = _NodeTranslator;
|
|
24483
|
-
const encode$
|
|
24555
|
+
const encode$1e = (attributes) => {
|
|
24484
24556
|
return attributes["w:type"];
|
|
24485
24557
|
};
|
|
24486
|
-
const decode$
|
|
24558
|
+
const decode$16 = (attrs) => {
|
|
24487
24559
|
const { lineBreakType } = attrs;
|
|
24488
24560
|
return lineBreakType;
|
|
24489
24561
|
};
|
|
24490
24562
|
const attrConfig$G = Object.freeze({
|
|
24491
24563
|
xmlName: "w:type",
|
|
24492
24564
|
sdName: "lineBreakType",
|
|
24493
|
-
encode: encode$
|
|
24494
|
-
decode: decode$
|
|
24565
|
+
encode: encode$1e,
|
|
24566
|
+
decode: decode$16
|
|
24495
24567
|
});
|
|
24496
|
-
const encode$
|
|
24568
|
+
const encode$1d = (attributes) => {
|
|
24497
24569
|
const xmlAttrValue = attributes["w:clear"];
|
|
24498
24570
|
return xmlAttrValue;
|
|
24499
24571
|
};
|
|
24500
|
-
const decode$
|
|
24572
|
+
const decode$15 = (attrs) => {
|
|
24501
24573
|
const { clear } = attrs;
|
|
24502
24574
|
return clear;
|
|
24503
24575
|
};
|
|
24504
24576
|
const attrConfig$F = Object.freeze({
|
|
24505
24577
|
xmlName: "w:clear",
|
|
24506
24578
|
sdName: "clear",
|
|
24507
|
-
encode: encode$
|
|
24508
|
-
decode: decode$
|
|
24579
|
+
encode: encode$1d,
|
|
24580
|
+
decode: decode$15
|
|
24509
24581
|
});
|
|
24510
|
-
const validXmlAttributes$
|
|
24511
|
-
const XML_NODE_NAME$
|
|
24582
|
+
const validXmlAttributes$p = [attrConfig$G, attrConfig$F];
|
|
24583
|
+
const XML_NODE_NAME$B = "w:br";
|
|
24512
24584
|
const SD_NODE_NAME$h = "lineBreak";
|
|
24513
|
-
const encode$
|
|
24585
|
+
const encode$1c = (_2, encodedAttrs) => {
|
|
24514
24586
|
const isPageBreak = encodedAttrs?.lineBreakType === "page";
|
|
24515
24587
|
const translated = {
|
|
24516
24588
|
type: isPageBreak ? "hardBreak" : "lineBreak"
|
|
@@ -24520,7 +24592,7 @@ const encode$1a = (_2, encodedAttrs) => {
|
|
|
24520
24592
|
}
|
|
24521
24593
|
return translated;
|
|
24522
24594
|
};
|
|
24523
|
-
const decode$
|
|
24595
|
+
const decode$14 = (params2, decodedAttrs) => {
|
|
24524
24596
|
const { node } = params2;
|
|
24525
24597
|
if (!node) return;
|
|
24526
24598
|
const wBreak = { name: "w:br" };
|
|
@@ -24537,39 +24609,39 @@ const decode$12 = (params2, decodedAttrs) => {
|
|
|
24537
24609
|
};
|
|
24538
24610
|
return translated;
|
|
24539
24611
|
};
|
|
24540
|
-
const config$
|
|
24541
|
-
xmlName: XML_NODE_NAME$
|
|
24612
|
+
const config$y = {
|
|
24613
|
+
xmlName: XML_NODE_NAME$B,
|
|
24542
24614
|
sdNodeOrKeyName: SD_NODE_NAME$h,
|
|
24543
24615
|
type: NodeTranslator.translatorTypes.NODE,
|
|
24544
|
-
encode: encode$
|
|
24545
|
-
decode: decode$
|
|
24546
|
-
attributes: validXmlAttributes$
|
|
24616
|
+
encode: encode$1c,
|
|
24617
|
+
decode: decode$14,
|
|
24618
|
+
attributes: validXmlAttributes$p
|
|
24547
24619
|
};
|
|
24548
|
-
const translator$
|
|
24549
|
-
const encode$
|
|
24550
|
-
const decode$
|
|
24620
|
+
const translator$1c = NodeTranslator.from(config$y);
|
|
24621
|
+
const encode$1b = (attributes) => attributes?.["w:val"];
|
|
24622
|
+
const decode$13 = (attrs) => attrs?.highlight;
|
|
24551
24623
|
const attrConfig$E = Object.freeze({
|
|
24552
24624
|
xmlName: "w:val",
|
|
24553
24625
|
sdName: "highlight",
|
|
24554
|
-
encode: encode$
|
|
24555
|
-
decode: decode$
|
|
24626
|
+
encode: encode$1b,
|
|
24627
|
+
decode: decode$13
|
|
24556
24628
|
});
|
|
24557
|
-
const validXmlAttributes$
|
|
24558
|
-
const XML_NODE_NAME$
|
|
24559
|
-
const SD_ATTR_KEY$
|
|
24629
|
+
const validXmlAttributes$o = [attrConfig$E];
|
|
24630
|
+
const XML_NODE_NAME$A = "w:highlight";
|
|
24631
|
+
const SD_ATTR_KEY$i = "highlight";
|
|
24560
24632
|
const DISABLED_TOKENS = /* @__PURE__ */ new Set(["transparent", "none", "inherit"]);
|
|
24561
|
-
const encode$
|
|
24633
|
+
const encode$1a = (params2, encodedAttrs = {}) => {
|
|
24562
24634
|
const { nodes } = params2;
|
|
24563
24635
|
const node = nodes?.[0];
|
|
24564
24636
|
const value = encodedAttrs.highlight ?? node?.attributes?.["w:val"];
|
|
24565
24637
|
return {
|
|
24566
24638
|
type: "attr",
|
|
24567
|
-
xmlName: XML_NODE_NAME$
|
|
24568
|
-
sdNodeOrKeyName: SD_ATTR_KEY$
|
|
24639
|
+
xmlName: XML_NODE_NAME$A,
|
|
24640
|
+
sdNodeOrKeyName: SD_ATTR_KEY$i,
|
|
24569
24641
|
attributes: { "w:val": value ?? null }
|
|
24570
24642
|
};
|
|
24571
24643
|
};
|
|
24572
|
-
const decode$
|
|
24644
|
+
const decode$12 = (params2) => {
|
|
24573
24645
|
const attrs = params2?.node?.attrs || {};
|
|
24574
24646
|
const highlightValue = attrs.highlight ?? attrs.color ?? null;
|
|
24575
24647
|
if (!highlightValue) return void 0;
|
|
@@ -24577,14 +24649,14 @@ const decode$10 = (params2) => {
|
|
|
24577
24649
|
if (!normalizedValue) return void 0;
|
|
24578
24650
|
if (DISABLED_TOKENS.has(normalizedValue)) {
|
|
24579
24651
|
return {
|
|
24580
|
-
name: XML_NODE_NAME$
|
|
24652
|
+
name: XML_NODE_NAME$A,
|
|
24581
24653
|
attributes: { "w:val": "none" }
|
|
24582
24654
|
};
|
|
24583
24655
|
}
|
|
24584
24656
|
const keyword = getDocxHighlightKeywordFromHex(highlightValue);
|
|
24585
24657
|
if (keyword) {
|
|
24586
24658
|
return {
|
|
24587
|
-
name: XML_NODE_NAME$
|
|
24659
|
+
name: XML_NODE_NAME$A,
|
|
24588
24660
|
attributes: { "w:val": keyword }
|
|
24589
24661
|
};
|
|
24590
24662
|
}
|
|
@@ -24599,63 +24671,63 @@ const decode$10 = (params2) => {
|
|
|
24599
24671
|
}
|
|
24600
24672
|
};
|
|
24601
24673
|
};
|
|
24602
|
-
const config$
|
|
24603
|
-
xmlName: XML_NODE_NAME$
|
|
24604
|
-
sdNodeOrKeyName: SD_ATTR_KEY$
|
|
24674
|
+
const config$x = {
|
|
24675
|
+
xmlName: XML_NODE_NAME$A,
|
|
24676
|
+
sdNodeOrKeyName: SD_ATTR_KEY$i,
|
|
24605
24677
|
type: NodeTranslator.translatorTypes.ATTRIBUTE,
|
|
24606
|
-
encode: encode$
|
|
24607
|
-
decode: decode$
|
|
24608
|
-
attributes: validXmlAttributes$
|
|
24678
|
+
encode: encode$1a,
|
|
24679
|
+
decode: decode$12,
|
|
24680
|
+
attributes: validXmlAttributes$o
|
|
24609
24681
|
};
|
|
24610
|
-
const translator$
|
|
24611
|
-
const encode$
|
|
24682
|
+
const translator$1b = NodeTranslator.from(config$x);
|
|
24683
|
+
const encode$19 = (attributes) => {
|
|
24612
24684
|
return attributes["w:val"];
|
|
24613
24685
|
};
|
|
24614
|
-
const decode
|
|
24686
|
+
const decode$11 = (attrs) => {
|
|
24615
24687
|
const { tabSize } = attrs || {};
|
|
24616
24688
|
return tabSize;
|
|
24617
24689
|
};
|
|
24618
24690
|
const attrConfig$D = Object.freeze({
|
|
24619
24691
|
xmlName: "w:val",
|
|
24620
24692
|
sdName: "tabSize",
|
|
24621
|
-
encode: encode$
|
|
24622
|
-
decode: decode
|
|
24693
|
+
encode: encode$19,
|
|
24694
|
+
decode: decode$11
|
|
24623
24695
|
});
|
|
24624
|
-
const encode$
|
|
24696
|
+
const encode$18 = (attributes) => {
|
|
24625
24697
|
return attributes["w:leader"];
|
|
24626
24698
|
};
|
|
24627
|
-
const decode$
|
|
24699
|
+
const decode$10 = (attrs) => {
|
|
24628
24700
|
const { leader } = attrs || {};
|
|
24629
24701
|
return leader;
|
|
24630
24702
|
};
|
|
24631
24703
|
const attrConfig$C = Object.freeze({
|
|
24632
24704
|
xmlName: "w:leader",
|
|
24633
24705
|
sdName: "leader",
|
|
24634
|
-
encode: encode$
|
|
24635
|
-
decode: decode$
|
|
24706
|
+
encode: encode$18,
|
|
24707
|
+
decode: decode$10
|
|
24636
24708
|
});
|
|
24637
|
-
const encode$
|
|
24709
|
+
const encode$17 = (attributes) => {
|
|
24638
24710
|
return attributes["w:pos"];
|
|
24639
24711
|
};
|
|
24640
|
-
const decode
|
|
24712
|
+
const decode$$ = (attrs) => {
|
|
24641
24713
|
const { pos } = attrs || {};
|
|
24642
24714
|
return pos;
|
|
24643
24715
|
};
|
|
24644
24716
|
const attrConfig$B = Object.freeze({
|
|
24645
24717
|
xmlName: "w:pos",
|
|
24646
24718
|
sdName: "pos",
|
|
24647
|
-
encode: encode$
|
|
24648
|
-
decode: decode
|
|
24719
|
+
encode: encode$17,
|
|
24720
|
+
decode: decode$$
|
|
24649
24721
|
});
|
|
24650
|
-
const validXmlAttributes$
|
|
24651
|
-
const XML_NODE_NAME$
|
|
24722
|
+
const validXmlAttributes$n = [attrConfig$D, attrConfig$B, attrConfig$C];
|
|
24723
|
+
const XML_NODE_NAME$z = "w:tab";
|
|
24652
24724
|
const SD_NODE_NAME$g = "tab";
|
|
24653
|
-
const encode$
|
|
24725
|
+
const encode$16 = (_2, encodedAttrs = {}) => {
|
|
24654
24726
|
const translated = { type: "tab" };
|
|
24655
24727
|
if (encodedAttrs) translated.attrs = { ...encodedAttrs };
|
|
24656
24728
|
return translated;
|
|
24657
24729
|
};
|
|
24658
|
-
const decode$
|
|
24730
|
+
const decode$_ = (params2, decodedAttrs = {}) => {
|
|
24659
24731
|
const { node } = params2 || {};
|
|
24660
24732
|
if (!node) return;
|
|
24661
24733
|
const wTab = { name: "w:tab" };
|
|
@@ -24671,15 +24743,15 @@ const decode$Y = (params2, decodedAttrs = {}) => {
|
|
|
24671
24743
|
}
|
|
24672
24744
|
return translated;
|
|
24673
24745
|
};
|
|
24674
|
-
const config$
|
|
24675
|
-
xmlName: XML_NODE_NAME$
|
|
24746
|
+
const config$w = {
|
|
24747
|
+
xmlName: XML_NODE_NAME$z,
|
|
24676
24748
|
sdNodeOrKeyName: SD_NODE_NAME$g,
|
|
24677
24749
|
type: NodeTranslator.translatorTypes.NODE,
|
|
24678
|
-
encode: encode$
|
|
24679
|
-
decode: decode$
|
|
24680
|
-
attributes: validXmlAttributes$
|
|
24750
|
+
encode: encode$16,
|
|
24751
|
+
decode: decode$_,
|
|
24752
|
+
attributes: validXmlAttributes$n
|
|
24681
24753
|
};
|
|
24682
|
-
const translator$
|
|
24754
|
+
const translator$1a = NodeTranslator.from(config$w);
|
|
24683
24755
|
const mergeTextNodes = (nodes) => {
|
|
24684
24756
|
if (!nodes || !Array.isArray(nodes)) {
|
|
24685
24757
|
return nodes;
|
|
@@ -25197,91 +25269,91 @@ const handleParagraphNode$1 = (params2) => {
|
|
|
25197
25269
|
}
|
|
25198
25270
|
return schemaNode;
|
|
25199
25271
|
};
|
|
25200
|
-
const encode$
|
|
25272
|
+
const encode$15 = (attributes) => {
|
|
25201
25273
|
return attributes["w:rsidDel"];
|
|
25202
25274
|
};
|
|
25203
|
-
const decode$
|
|
25275
|
+
const decode$Z = (attrs) => {
|
|
25204
25276
|
return attrs.rsidDel;
|
|
25205
25277
|
};
|
|
25206
25278
|
const attrConfig$A = Object.freeze({
|
|
25207
25279
|
xmlName: "w:rsidDel",
|
|
25208
25280
|
sdName: "rsidDel",
|
|
25209
|
-
encode: encode$
|
|
25210
|
-
decode: decode$
|
|
25281
|
+
encode: encode$15,
|
|
25282
|
+
decode: decode$Z
|
|
25211
25283
|
});
|
|
25212
|
-
const encode$
|
|
25284
|
+
const encode$14 = (attributes) => {
|
|
25213
25285
|
return attributes["w:rsidP"];
|
|
25214
25286
|
};
|
|
25215
|
-
const decode$
|
|
25287
|
+
const decode$Y = (attrs) => {
|
|
25216
25288
|
return attrs.rsidP;
|
|
25217
25289
|
};
|
|
25218
25290
|
const attrConfig$z = Object.freeze({
|
|
25219
25291
|
xmlName: "w:rsidP",
|
|
25220
25292
|
sdName: "rsidP",
|
|
25221
|
-
encode: encode$
|
|
25222
|
-
decode: decode$
|
|
25293
|
+
encode: encode$14,
|
|
25294
|
+
decode: decode$Y
|
|
25223
25295
|
});
|
|
25224
|
-
const encode$
|
|
25296
|
+
const encode$13 = (attributes) => {
|
|
25225
25297
|
return attributes["w:rsidR"];
|
|
25226
25298
|
};
|
|
25227
|
-
const decode$
|
|
25299
|
+
const decode$X = (attrs) => {
|
|
25228
25300
|
return attrs.rsidR;
|
|
25229
25301
|
};
|
|
25230
25302
|
const attrConfig$y = Object.freeze({
|
|
25231
25303
|
xmlName: "w:rsidR",
|
|
25232
25304
|
sdName: "rsidR",
|
|
25233
|
-
encode: encode$
|
|
25234
|
-
decode: decode$
|
|
25305
|
+
encode: encode$13,
|
|
25306
|
+
decode: decode$X
|
|
25235
25307
|
});
|
|
25236
|
-
const encode$
|
|
25308
|
+
const encode$12 = (attributes) => {
|
|
25237
25309
|
return attributes["w:rsidRPr"];
|
|
25238
25310
|
};
|
|
25239
|
-
const decode$
|
|
25311
|
+
const decode$W = (attrs) => {
|
|
25240
25312
|
return attrs.rsidRPr;
|
|
25241
25313
|
};
|
|
25242
25314
|
const attrConfig$x = Object.freeze({
|
|
25243
25315
|
xmlName: "w:rsidRPr",
|
|
25244
25316
|
sdName: "rsidRPr",
|
|
25245
|
-
encode: encode$
|
|
25246
|
-
decode: decode$
|
|
25317
|
+
encode: encode$12,
|
|
25318
|
+
decode: decode$W
|
|
25247
25319
|
});
|
|
25248
|
-
const encode
|
|
25320
|
+
const encode$11 = (attributes) => {
|
|
25249
25321
|
return attributes["w:rsidRDefault"];
|
|
25250
25322
|
};
|
|
25251
|
-
const decode$
|
|
25323
|
+
const decode$V = (attrs) => {
|
|
25252
25324
|
return attrs.rsidRDefault;
|
|
25253
25325
|
};
|
|
25254
25326
|
const attrConfig$w = Object.freeze({
|
|
25255
25327
|
xmlName: "w:rsidRDefault",
|
|
25256
25328
|
sdName: "rsidRDefault",
|
|
25257
|
-
encode: encode
|
|
25258
|
-
decode: decode$
|
|
25329
|
+
encode: encode$11,
|
|
25330
|
+
decode: decode$V
|
|
25259
25331
|
});
|
|
25260
|
-
const encode$
|
|
25332
|
+
const encode$10 = (attributes) => {
|
|
25261
25333
|
return attributes["w14:paraId"];
|
|
25262
25334
|
};
|
|
25263
|
-
const decode$
|
|
25335
|
+
const decode$U = (attrs) => {
|
|
25264
25336
|
return attrs.paraId;
|
|
25265
25337
|
};
|
|
25266
25338
|
const attrConfig$v = Object.freeze({
|
|
25267
25339
|
xmlName: "w14:paraId",
|
|
25268
25340
|
sdName: "paraId",
|
|
25269
|
-
encode: encode$
|
|
25270
|
-
decode: decode$
|
|
25341
|
+
encode: encode$10,
|
|
25342
|
+
decode: decode$U
|
|
25271
25343
|
});
|
|
25272
|
-
const encode
|
|
25344
|
+
const encode$$ = (attributes) => {
|
|
25273
25345
|
return attributes["w14:textId"];
|
|
25274
25346
|
};
|
|
25275
|
-
const decode$
|
|
25347
|
+
const decode$T = (attrs) => {
|
|
25276
25348
|
return attrs.textId;
|
|
25277
25349
|
};
|
|
25278
25350
|
const attrConfig$u = Object.freeze({
|
|
25279
25351
|
xmlName: "w14:textId",
|
|
25280
25352
|
sdName: "textId",
|
|
25281
|
-
encode: encode
|
|
25282
|
-
decode: decode$
|
|
25353
|
+
encode: encode$$,
|
|
25354
|
+
decode: decode$T
|
|
25283
25355
|
});
|
|
25284
|
-
const validXmlAttributes$
|
|
25356
|
+
const validXmlAttributes$m = [
|
|
25285
25357
|
attrConfig$v,
|
|
25286
25358
|
attrConfig$u,
|
|
25287
25359
|
attrConfig$y,
|
|
@@ -25290,9 +25362,9 @@ const validXmlAttributes$k = [
|
|
|
25290
25362
|
attrConfig$x,
|
|
25291
25363
|
attrConfig$A
|
|
25292
25364
|
];
|
|
25293
|
-
const XML_NODE_NAME$
|
|
25365
|
+
const XML_NODE_NAME$y = "w:p";
|
|
25294
25366
|
const SD_NODE_NAME$f = "paragraph";
|
|
25295
|
-
const encode$
|
|
25367
|
+
const encode$_ = (params2, encodedAttrs = {}) => {
|
|
25296
25368
|
const node = handleParagraphNode$1(params2);
|
|
25297
25369
|
if (!node) return void 0;
|
|
25298
25370
|
if (encodedAttrs && Object.keys(encodedAttrs).length) {
|
|
@@ -25300,7 +25372,7 @@ const encode$Y = (params2, encodedAttrs = {}) => {
|
|
|
25300
25372
|
}
|
|
25301
25373
|
return node;
|
|
25302
25374
|
};
|
|
25303
|
-
const decode$
|
|
25375
|
+
const decode$S = (params2, decodedAttrs = {}) => {
|
|
25304
25376
|
const translated = translateParagraphNode(params2);
|
|
25305
25377
|
if (!translated) return void 0;
|
|
25306
25378
|
if (decodedAttrs && Object.keys(decodedAttrs).length) {
|
|
@@ -25308,16 +25380,16 @@ const decode$Q = (params2, decodedAttrs = {}) => {
|
|
|
25308
25380
|
}
|
|
25309
25381
|
return translated;
|
|
25310
25382
|
};
|
|
25311
|
-
const config$
|
|
25312
|
-
xmlName: XML_NODE_NAME$
|
|
25383
|
+
const config$v = {
|
|
25384
|
+
xmlName: XML_NODE_NAME$y,
|
|
25313
25385
|
sdNodeOrKeyName: SD_NODE_NAME$f,
|
|
25314
25386
|
type: NodeTranslator.translatorTypes.NODE,
|
|
25315
|
-
encode: encode$
|
|
25316
|
-
decode: decode$
|
|
25317
|
-
attributes: validXmlAttributes$
|
|
25387
|
+
encode: encode$_,
|
|
25388
|
+
decode: decode$S,
|
|
25389
|
+
attributes: validXmlAttributes$m
|
|
25318
25390
|
};
|
|
25319
|
-
const translator$
|
|
25320
|
-
const encode$
|
|
25391
|
+
const translator$19 = NodeTranslator.from(config$v);
|
|
25392
|
+
const encode$Z = (attributes) => {
|
|
25321
25393
|
const raw = attributes?.["w:val"];
|
|
25322
25394
|
if (raw === void 0 || raw === null) return void 0;
|
|
25323
25395
|
if (typeof raw === "boolean") return raw;
|
|
@@ -25327,24 +25399,24 @@ const encode$X = (attributes) => {
|
|
|
25327
25399
|
if (val === "1" || val === "true" || val === "on") return true;
|
|
25328
25400
|
return void 0;
|
|
25329
25401
|
};
|
|
25330
|
-
const decode$
|
|
25402
|
+
const decode$R = (runProps) => {
|
|
25331
25403
|
if (runProps?.bold === false) return "0";
|
|
25332
25404
|
return void 0;
|
|
25333
25405
|
};
|
|
25334
25406
|
const attrConfig$t = Object.freeze({
|
|
25335
25407
|
xmlName: "w:val",
|
|
25336
25408
|
sdName: "bold",
|
|
25337
|
-
encode: encode$
|
|
25338
|
-
decode: decode$
|
|
25409
|
+
encode: encode$Z,
|
|
25410
|
+
decode: decode$R
|
|
25339
25411
|
});
|
|
25340
|
-
const validXmlAttributes$
|
|
25341
|
-
const XML_NODE_NAME$
|
|
25342
|
-
const SD_ATTR_KEY$
|
|
25343
|
-
const encode$
|
|
25412
|
+
const validXmlAttributes$l = [attrConfig$t];
|
|
25413
|
+
const XML_NODE_NAME$x = "w:b";
|
|
25414
|
+
const SD_ATTR_KEY$h = "bold";
|
|
25415
|
+
const encode$Y = (params2, encodedAttrs = {}) => {
|
|
25344
25416
|
const { nodes } = params2;
|
|
25345
25417
|
const node = nodes[0];
|
|
25346
25418
|
if (!node) return void 0;
|
|
25347
|
-
const val = encodedAttrs?.[SD_ATTR_KEY$
|
|
25419
|
+
const val = encodedAttrs?.[SD_ATTR_KEY$h];
|
|
25348
25420
|
let attributes;
|
|
25349
25421
|
if (val === false) attributes = { "w:val": "0" };
|
|
25350
25422
|
else if (val === true)
|
|
@@ -25352,85 +25424,85 @@ const encode$W = (params2, encodedAttrs = {}) => {
|
|
|
25352
25424
|
else attributes = node.attributes || {};
|
|
25353
25425
|
return {
|
|
25354
25426
|
type: "attr",
|
|
25355
|
-
xmlName: XML_NODE_NAME$
|
|
25356
|
-
sdNodeOrKeyName: SD_ATTR_KEY$
|
|
25427
|
+
xmlName: XML_NODE_NAME$x,
|
|
25428
|
+
sdNodeOrKeyName: SD_ATTR_KEY$h,
|
|
25357
25429
|
attributes
|
|
25358
25430
|
};
|
|
25359
25431
|
};
|
|
25360
|
-
const config$
|
|
25361
|
-
xmlName: XML_NODE_NAME$
|
|
25362
|
-
sdNodeOrKeyName: SD_ATTR_KEY$
|
|
25432
|
+
const config$u = {
|
|
25433
|
+
xmlName: XML_NODE_NAME$x,
|
|
25434
|
+
sdNodeOrKeyName: SD_ATTR_KEY$h,
|
|
25363
25435
|
type: NodeTranslator.translatorTypes.ATTRIBUTE,
|
|
25364
|
-
encode: encode$
|
|
25365
|
-
attributes: validXmlAttributes$
|
|
25436
|
+
encode: encode$Y,
|
|
25437
|
+
attributes: validXmlAttributes$l
|
|
25366
25438
|
};
|
|
25367
|
-
const translator$
|
|
25368
|
-
const XML_NODE_NAME$
|
|
25369
|
-
const SD_ATTR_KEY$
|
|
25370
|
-
const encode$
|
|
25439
|
+
const translator$18 = NodeTranslator.from(config$u);
|
|
25440
|
+
const XML_NODE_NAME$w = "w:i";
|
|
25441
|
+
const SD_ATTR_KEY$g = "italic";
|
|
25442
|
+
const encode$X = (params2) => {
|
|
25371
25443
|
const { nodes } = params2;
|
|
25372
25444
|
const node = nodes?.[0];
|
|
25373
25445
|
if (!node) return void 0;
|
|
25374
25446
|
return {
|
|
25375
25447
|
type: "attr",
|
|
25376
|
-
xmlName: XML_NODE_NAME$
|
|
25377
|
-
sdNodeOrKeyName: SD_ATTR_KEY$
|
|
25448
|
+
xmlName: XML_NODE_NAME$w,
|
|
25449
|
+
sdNodeOrKeyName: SD_ATTR_KEY$g,
|
|
25378
25450
|
attributes: {
|
|
25379
25451
|
"w:val": node.attributes?.["w:val"] ?? null
|
|
25380
25452
|
}
|
|
25381
25453
|
};
|
|
25382
25454
|
};
|
|
25383
|
-
const config$
|
|
25384
|
-
xmlName: XML_NODE_NAME$
|
|
25385
|
-
sdNodeOrKeyName: SD_ATTR_KEY$
|
|
25455
|
+
const config$t = {
|
|
25456
|
+
xmlName: XML_NODE_NAME$w,
|
|
25457
|
+
sdNodeOrKeyName: SD_ATTR_KEY$g,
|
|
25386
25458
|
type: NodeTranslator.translatorTypes.ATTRIBUTE,
|
|
25387
|
-
encode: encode$
|
|
25459
|
+
encode: encode$X
|
|
25388
25460
|
};
|
|
25389
|
-
const translator$
|
|
25390
|
-
const encode$
|
|
25391
|
-
const decode$
|
|
25461
|
+
const translator$17 = NodeTranslator.from(config$t);
|
|
25462
|
+
const encode$W = (attributes) => attributes?.["w:val"];
|
|
25463
|
+
const decode$Q = (attrs) => attrs?.underline;
|
|
25392
25464
|
const attrConfig$s = Object.freeze({
|
|
25393
25465
|
xmlName: "w:val",
|
|
25394
25466
|
sdName: "underline",
|
|
25395
|
-
encode: encode$
|
|
25396
|
-
decode: decode$
|
|
25467
|
+
encode: encode$W,
|
|
25468
|
+
decode: decode$Q
|
|
25397
25469
|
});
|
|
25398
|
-
const encode$
|
|
25399
|
-
const decode$
|
|
25470
|
+
const encode$V = (attributes) => attributes?.["w:color"];
|
|
25471
|
+
const decode$P = (attrs) => attrs?.color;
|
|
25400
25472
|
const attrConfig$r = Object.freeze({
|
|
25401
25473
|
xmlName: "w:color",
|
|
25402
25474
|
sdName: "color",
|
|
25403
|
-
encode: encode$
|
|
25404
|
-
decode: decode$
|
|
25475
|
+
encode: encode$V,
|
|
25476
|
+
decode: decode$P
|
|
25405
25477
|
});
|
|
25406
|
-
const encode$
|
|
25407
|
-
const decode$
|
|
25478
|
+
const encode$U = (attributes) => attributes?.["w:themeColor"];
|
|
25479
|
+
const decode$O = (attrs) => attrs?.themeColor;
|
|
25408
25480
|
const attrConfig$q = Object.freeze({
|
|
25409
25481
|
xmlName: "w:themeColor",
|
|
25410
25482
|
sdName: "themeColor",
|
|
25411
|
-
encode: encode$
|
|
25412
|
-
decode: decode$
|
|
25483
|
+
encode: encode$U,
|
|
25484
|
+
decode: decode$O
|
|
25413
25485
|
});
|
|
25414
|
-
const encode$
|
|
25415
|
-
const decode$
|
|
25486
|
+
const encode$T = (attributes) => attributes?.["w:themeTint"];
|
|
25487
|
+
const decode$N = (attrs) => attrs?.themeTint;
|
|
25416
25488
|
const attrConfig$p = Object.freeze({
|
|
25417
25489
|
xmlName: "w:themeTint",
|
|
25418
25490
|
sdName: "themeTint",
|
|
25419
|
-
encode: encode$
|
|
25420
|
-
decode: decode$
|
|
25491
|
+
encode: encode$T,
|
|
25492
|
+
decode: decode$N
|
|
25421
25493
|
});
|
|
25422
|
-
const encode$
|
|
25423
|
-
const decode$
|
|
25494
|
+
const encode$S = (attributes) => attributes?.["w:themeShade"];
|
|
25495
|
+
const decode$M = (attrs) => attrs?.themeShade;
|
|
25424
25496
|
const attrConfig$o = Object.freeze({
|
|
25425
25497
|
xmlName: "w:themeShade",
|
|
25426
25498
|
sdName: "themeShade",
|
|
25427
|
-
encode: encode$
|
|
25428
|
-
decode: decode$
|
|
25499
|
+
encode: encode$S,
|
|
25500
|
+
decode: decode$M
|
|
25429
25501
|
});
|
|
25430
|
-
const validXmlAttributes$
|
|
25431
|
-
const XML_NODE_NAME$
|
|
25432
|
-
const SD_ATTR_KEY$
|
|
25433
|
-
const encode$
|
|
25502
|
+
const validXmlAttributes$k = [attrConfig$s, attrConfig$r, attrConfig$q, attrConfig$p, attrConfig$o];
|
|
25503
|
+
const XML_NODE_NAME$v = "w:u";
|
|
25504
|
+
const SD_ATTR_KEY$f = "underline";
|
|
25505
|
+
const encode$R = (params2, encodedAttrs = {}) => {
|
|
25434
25506
|
const { nodes } = params2;
|
|
25435
25507
|
const node = nodes?.[0];
|
|
25436
25508
|
const sourceAttrs = node?.attributes || {};
|
|
@@ -25446,12 +25518,12 @@ const encode$P = (params2, encodedAttrs = {}) => {
|
|
|
25446
25518
|
if (themeShade !== void 0 && themeShade !== null) attributes["w:themeShade"] = themeShade;
|
|
25447
25519
|
return {
|
|
25448
25520
|
type: "attr",
|
|
25449
|
-
xmlName: XML_NODE_NAME$
|
|
25450
|
-
sdNodeOrKeyName: SD_ATTR_KEY$
|
|
25521
|
+
xmlName: XML_NODE_NAME$v,
|
|
25522
|
+
sdNodeOrKeyName: SD_ATTR_KEY$f,
|
|
25451
25523
|
attributes
|
|
25452
25524
|
};
|
|
25453
25525
|
};
|
|
25454
|
-
const decode$
|
|
25526
|
+
const decode$L = (params2) => {
|
|
25455
25527
|
const attrs = params2?.node?.attrs || {};
|
|
25456
25528
|
const underlineType = attrs.underlineType ?? attrs.underline ?? null;
|
|
25457
25529
|
const color = attrs.underlineColor ?? attrs.color ?? null;
|
|
@@ -25469,20 +25541,20 @@ const decode$J = (params2) => {
|
|
|
25469
25541
|
if (themeTint) attributes["w:themeTint"] = themeTint;
|
|
25470
25542
|
if (themeShade) attributes["w:themeShade"] = themeShade;
|
|
25471
25543
|
return {
|
|
25472
|
-
name: XML_NODE_NAME$
|
|
25544
|
+
name: XML_NODE_NAME$v,
|
|
25473
25545
|
attributes
|
|
25474
25546
|
};
|
|
25475
25547
|
};
|
|
25476
|
-
const config$
|
|
25477
|
-
xmlName: XML_NODE_NAME$
|
|
25478
|
-
sdNodeOrKeyName: SD_ATTR_KEY$
|
|
25548
|
+
const config$s = {
|
|
25549
|
+
xmlName: XML_NODE_NAME$v,
|
|
25550
|
+
sdNodeOrKeyName: SD_ATTR_KEY$f,
|
|
25479
25551
|
type: NodeTranslator.translatorTypes.ATTRIBUTE,
|
|
25480
|
-
encode: encode$
|
|
25481
|
-
decode: decode$
|
|
25482
|
-
attributes: validXmlAttributes$
|
|
25552
|
+
encode: encode$R,
|
|
25553
|
+
decode: decode$L,
|
|
25554
|
+
attributes: validXmlAttributes$k
|
|
25483
25555
|
};
|
|
25484
|
-
const translator$
|
|
25485
|
-
const encode$
|
|
25556
|
+
const translator$16 = NodeTranslator.from(config$s);
|
|
25557
|
+
const encode$Q = (attributes) => {
|
|
25486
25558
|
const raw = attributes?.["w:val"];
|
|
25487
25559
|
if (raw === void 0 || raw === null) return void 0;
|
|
25488
25560
|
if (typeof raw === "boolean") return raw;
|
|
@@ -25492,24 +25564,24 @@ const encode$O = (attributes) => {
|
|
|
25492
25564
|
if (val === "1" || val === "true" || val === "on") return true;
|
|
25493
25565
|
return void 0;
|
|
25494
25566
|
};
|
|
25495
|
-
const decode$
|
|
25567
|
+
const decode$K = (attrs) => {
|
|
25496
25568
|
if (attrs?.strike === false) return "0";
|
|
25497
25569
|
return void 0;
|
|
25498
25570
|
};
|
|
25499
25571
|
const attrConfig$n = Object.freeze({
|
|
25500
25572
|
xmlName: "w:val",
|
|
25501
25573
|
sdName: "strike",
|
|
25502
|
-
encode: encode$
|
|
25503
|
-
decode: decode$
|
|
25574
|
+
encode: encode$Q,
|
|
25575
|
+
decode: decode$K
|
|
25504
25576
|
});
|
|
25505
|
-
const validXmlAttributes$
|
|
25506
|
-
const XML_NODE_NAME$
|
|
25507
|
-
const SD_ATTR_KEY$
|
|
25508
|
-
const encode$
|
|
25577
|
+
const validXmlAttributes$j = [attrConfig$n];
|
|
25578
|
+
const XML_NODE_NAME$u = "w:strike";
|
|
25579
|
+
const SD_ATTR_KEY$e = "strike";
|
|
25580
|
+
const encode$P = (params2, encodedAttrs = {}) => {
|
|
25509
25581
|
const { nodes } = params2;
|
|
25510
25582
|
const node = nodes?.[0];
|
|
25511
25583
|
if (!node) return void 0;
|
|
25512
|
-
const val = encodedAttrs?.[SD_ATTR_KEY$
|
|
25584
|
+
const val = encodedAttrs?.[SD_ATTR_KEY$e];
|
|
25513
25585
|
let attributes;
|
|
25514
25586
|
if (val === false) attributes = { "w:val": "0" };
|
|
25515
25587
|
else if (val === true) attributes = {};
|
|
@@ -25518,55 +25590,55 @@ const encode$N = (params2, encodedAttrs = {}) => {
|
|
|
25518
25590
|
else if (val === true && attributes["w:val"] === void 0) delete attributes["w:val"];
|
|
25519
25591
|
return {
|
|
25520
25592
|
type: "attr",
|
|
25521
|
-
xmlName: XML_NODE_NAME$
|
|
25522
|
-
sdNodeOrKeyName: SD_ATTR_KEY$
|
|
25593
|
+
xmlName: XML_NODE_NAME$u,
|
|
25594
|
+
sdNodeOrKeyName: SD_ATTR_KEY$e,
|
|
25523
25595
|
attributes
|
|
25524
25596
|
};
|
|
25525
25597
|
};
|
|
25526
|
-
const config$
|
|
25527
|
-
xmlName: XML_NODE_NAME$
|
|
25528
|
-
sdNodeOrKeyName: SD_ATTR_KEY$
|
|
25598
|
+
const config$r = {
|
|
25599
|
+
xmlName: XML_NODE_NAME$u,
|
|
25600
|
+
sdNodeOrKeyName: SD_ATTR_KEY$e,
|
|
25529
25601
|
type: NodeTranslator.translatorTypes.ATTRIBUTE,
|
|
25530
|
-
encode: encode$
|
|
25531
|
-
attributes: validXmlAttributes$
|
|
25602
|
+
encode: encode$P,
|
|
25603
|
+
attributes: validXmlAttributes$j
|
|
25532
25604
|
};
|
|
25533
|
-
const translator$
|
|
25534
|
-
const encode$
|
|
25535
|
-
const decode$
|
|
25605
|
+
const translator$15 = NodeTranslator.from(config$r);
|
|
25606
|
+
const encode$O = (attributes) => attributes?.["w:val"];
|
|
25607
|
+
const decode$J = (attrs) => attrs?.color;
|
|
25536
25608
|
const attrConfig$m = Object.freeze({
|
|
25537
25609
|
xmlName: "w:val",
|
|
25538
25610
|
sdName: "color",
|
|
25539
|
-
encode: encode$
|
|
25540
|
-
decode: decode$
|
|
25611
|
+
encode: encode$O,
|
|
25612
|
+
decode: decode$J
|
|
25541
25613
|
});
|
|
25542
|
-
const encode$
|
|
25543
|
-
const decode$
|
|
25614
|
+
const encode$N = (attributes) => attributes?.["w:themeColor"];
|
|
25615
|
+
const decode$I = (attrs) => attrs?.themeColor;
|
|
25544
25616
|
const attrConfig$l = Object.freeze({
|
|
25545
25617
|
xmlName: "w:themeColor",
|
|
25546
25618
|
sdName: "themeColor",
|
|
25547
|
-
encode: encode$
|
|
25548
|
-
decode: decode$
|
|
25619
|
+
encode: encode$N,
|
|
25620
|
+
decode: decode$I
|
|
25549
25621
|
});
|
|
25550
|
-
const encode$
|
|
25551
|
-
const decode$
|
|
25622
|
+
const encode$M = (attributes) => attributes?.["w:themeTint"];
|
|
25623
|
+
const decode$H = (attrs) => attrs?.themeTint;
|
|
25552
25624
|
const attrConfig$k = Object.freeze({
|
|
25553
25625
|
xmlName: "w:themeTint",
|
|
25554
25626
|
sdName: "themeTint",
|
|
25555
|
-
encode: encode$
|
|
25556
|
-
decode: decode$
|
|
25627
|
+
encode: encode$M,
|
|
25628
|
+
decode: decode$H
|
|
25557
25629
|
});
|
|
25558
|
-
const encode$
|
|
25559
|
-
const decode$
|
|
25630
|
+
const encode$L = (attributes) => attributes?.["w:themeShade"];
|
|
25631
|
+
const decode$G = (attrs) => attrs?.themeShade;
|
|
25560
25632
|
const attrConfig$j = Object.freeze({
|
|
25561
25633
|
xmlName: "w:themeShade",
|
|
25562
25634
|
sdName: "themeShade",
|
|
25563
|
-
encode: encode$
|
|
25564
|
-
decode: decode$
|
|
25635
|
+
encode: encode$L,
|
|
25636
|
+
decode: decode$G
|
|
25565
25637
|
});
|
|
25566
|
-
const validXmlAttributes$
|
|
25567
|
-
const XML_NODE_NAME$
|
|
25568
|
-
const SD_ATTR_KEY$
|
|
25569
|
-
const encode$
|
|
25638
|
+
const validXmlAttributes$i = [attrConfig$m, attrConfig$l, attrConfig$k, attrConfig$j];
|
|
25639
|
+
const XML_NODE_NAME$t = "w:color";
|
|
25640
|
+
const SD_ATTR_KEY$d = "color";
|
|
25641
|
+
const encode$K = (params2, encodedAttrs = {}) => {
|
|
25570
25642
|
const { nodes } = params2;
|
|
25571
25643
|
const node = nodes?.[0];
|
|
25572
25644
|
const sourceAttrs = node?.attributes || {};
|
|
@@ -25581,63 +25653,63 @@ const encode$I = (params2, encodedAttrs = {}) => {
|
|
|
25581
25653
|
if (themeShade !== void 0 && themeShade !== null) attributes["w:themeShade"] = themeShade;
|
|
25582
25654
|
return {
|
|
25583
25655
|
type: "attr",
|
|
25584
|
-
xmlName: XML_NODE_NAME$
|
|
25585
|
-
sdNodeOrKeyName: SD_ATTR_KEY$
|
|
25656
|
+
xmlName: XML_NODE_NAME$t,
|
|
25657
|
+
sdNodeOrKeyName: SD_ATTR_KEY$d,
|
|
25586
25658
|
attributes
|
|
25587
25659
|
};
|
|
25588
25660
|
};
|
|
25589
|
-
const config$
|
|
25590
|
-
xmlName: XML_NODE_NAME$
|
|
25591
|
-
sdNodeOrKeyName: SD_ATTR_KEY$
|
|
25661
|
+
const config$q = {
|
|
25662
|
+
xmlName: XML_NODE_NAME$t,
|
|
25663
|
+
sdNodeOrKeyName: SD_ATTR_KEY$d,
|
|
25592
25664
|
type: NodeTranslator.translatorTypes.ATTRIBUTE,
|
|
25593
|
-
encode: encode$
|
|
25594
|
-
attributes: validXmlAttributes$
|
|
25665
|
+
encode: encode$K,
|
|
25666
|
+
attributes: validXmlAttributes$i
|
|
25595
25667
|
};
|
|
25596
|
-
const translator$
|
|
25597
|
-
const encode$
|
|
25598
|
-
const decode$
|
|
25668
|
+
const translator$14 = NodeTranslator.from(config$q);
|
|
25669
|
+
const encode$J = (attributes) => attributes?.["w:eastAsia"];
|
|
25670
|
+
const decode$F = (attrs) => attrs?.eastAsia;
|
|
25599
25671
|
const attrConfig$i = Object.freeze({
|
|
25600
25672
|
xmlName: "w:eastAsia",
|
|
25601
25673
|
sdName: "eastAsia",
|
|
25602
|
-
encode: encode$
|
|
25603
|
-
decode: decode$
|
|
25674
|
+
encode: encode$J,
|
|
25675
|
+
decode: decode$F
|
|
25604
25676
|
});
|
|
25605
|
-
const encode$
|
|
25606
|
-
const decode$
|
|
25677
|
+
const encode$I = (attributes) => attributes?.["w:ascii"];
|
|
25678
|
+
const decode$E = (attrs) => attrs?.ascii;
|
|
25607
25679
|
const attrConfig$h = Object.freeze({
|
|
25608
25680
|
xmlName: "w:ascii",
|
|
25609
25681
|
sdName: "ascii",
|
|
25610
|
-
encode: encode$
|
|
25611
|
-
decode: decode$
|
|
25682
|
+
encode: encode$I,
|
|
25683
|
+
decode: decode$E
|
|
25612
25684
|
});
|
|
25613
|
-
const encode$
|
|
25614
|
-
const decode$
|
|
25685
|
+
const encode$H = (attributes) => attributes?.["w:hAnsi"];
|
|
25686
|
+
const decode$D = (attrs) => attrs?.hAnsi;
|
|
25615
25687
|
const attrConfig$g = Object.freeze({
|
|
25616
25688
|
xmlName: "w:hAnsi",
|
|
25617
25689
|
sdName: "hAnsi",
|
|
25618
|
-
encode: encode$
|
|
25619
|
-
decode: decode$
|
|
25690
|
+
encode: encode$H,
|
|
25691
|
+
decode: decode$D
|
|
25620
25692
|
});
|
|
25621
|
-
const encode$
|
|
25622
|
-
const decode$
|
|
25693
|
+
const encode$G = (attributes) => attributes?.["w:cs"];
|
|
25694
|
+
const decode$C = (attrs) => attrs?.cs;
|
|
25623
25695
|
const attrConfig$f = Object.freeze({
|
|
25624
25696
|
xmlName: "w:cs",
|
|
25625
25697
|
sdName: "cs",
|
|
25626
|
-
encode: encode$
|
|
25627
|
-
decode: decode$
|
|
25698
|
+
encode: encode$G,
|
|
25699
|
+
decode: decode$C
|
|
25628
25700
|
});
|
|
25629
|
-
const encode$
|
|
25630
|
-
const decode$
|
|
25701
|
+
const encode$F = (attributes) => attributes?.["w:val"];
|
|
25702
|
+
const decode$B = (attrs) => attrs?.value;
|
|
25631
25703
|
const attrConfig$e = Object.freeze({
|
|
25632
25704
|
xmlName: "w:val",
|
|
25633
25705
|
sdName: "value",
|
|
25634
|
-
encode: encode$
|
|
25635
|
-
decode: decode$
|
|
25706
|
+
encode: encode$F,
|
|
25707
|
+
decode: decode$B
|
|
25636
25708
|
});
|
|
25637
|
-
const validXmlAttributes$
|
|
25638
|
-
const XML_NODE_NAME$
|
|
25639
|
-
const SD_ATTR_KEY$
|
|
25640
|
-
const encode$
|
|
25709
|
+
const validXmlAttributes$h = [attrConfig$i, attrConfig$h, attrConfig$g, attrConfig$f, attrConfig$e];
|
|
25710
|
+
const XML_NODE_NAME$s = "w:rFonts";
|
|
25711
|
+
const SD_ATTR_KEY$c = "fontFamily";
|
|
25712
|
+
const encode$E = (params2, encodedAttrs = {}) => {
|
|
25641
25713
|
const { nodes } = params2;
|
|
25642
25714
|
const node = nodes?.[0];
|
|
25643
25715
|
const sourceAttrs = node?.attributes || {};
|
|
@@ -25663,109 +25735,109 @@ const encode$C = (params2, encodedAttrs = {}) => {
|
|
|
25663
25735
|
if (attributes["w:val"] === void 0) delete attributes["w:val"];
|
|
25664
25736
|
return {
|
|
25665
25737
|
type: "attr",
|
|
25666
|
-
xmlName: XML_NODE_NAME$
|
|
25667
|
-
sdNodeOrKeyName: SD_ATTR_KEY$
|
|
25738
|
+
xmlName: XML_NODE_NAME$s,
|
|
25739
|
+
sdNodeOrKeyName: SD_ATTR_KEY$c,
|
|
25668
25740
|
attributes
|
|
25669
25741
|
};
|
|
25670
25742
|
};
|
|
25671
|
-
const config$
|
|
25672
|
-
xmlName: XML_NODE_NAME$
|
|
25673
|
-
sdNodeOrKeyName: SD_ATTR_KEY$
|
|
25743
|
+
const config$p = {
|
|
25744
|
+
xmlName: XML_NODE_NAME$s,
|
|
25745
|
+
sdNodeOrKeyName: SD_ATTR_KEY$c,
|
|
25674
25746
|
type: NodeTranslator.translatorTypes.ATTRIBUTE,
|
|
25675
|
-
encode: encode$
|
|
25676
|
-
attributes: validXmlAttributes$
|
|
25747
|
+
encode: encode$E,
|
|
25748
|
+
attributes: validXmlAttributes$h
|
|
25677
25749
|
};
|
|
25678
|
-
const translator$
|
|
25679
|
-
const encode$
|
|
25680
|
-
const decode$
|
|
25750
|
+
const translator$13 = NodeTranslator.from(config$p);
|
|
25751
|
+
const encode$D = (attributes) => attributes?.["w:val"];
|
|
25752
|
+
const decode$A = (attrs) => attrs?.styleId;
|
|
25681
25753
|
const attrConfig$d = Object.freeze({
|
|
25682
25754
|
xmlName: "w:val",
|
|
25683
25755
|
sdName: "styleId",
|
|
25684
|
-
encode: encode$
|
|
25685
|
-
decode: decode$
|
|
25756
|
+
encode: encode$D,
|
|
25757
|
+
decode: decode$A
|
|
25686
25758
|
});
|
|
25687
|
-
const validXmlAttributes$
|
|
25688
|
-
const XML_NODE_NAME$
|
|
25689
|
-
const SD_ATTR_KEY$
|
|
25690
|
-
const encode$
|
|
25759
|
+
const validXmlAttributes$g = [attrConfig$d];
|
|
25760
|
+
const XML_NODE_NAME$r = "w:rStyle";
|
|
25761
|
+
const SD_ATTR_KEY$b = "styleId";
|
|
25762
|
+
const encode$C = (params2, encodedAttrs = {}) => {
|
|
25691
25763
|
const { nodes } = params2;
|
|
25692
25764
|
const node = nodes?.[0];
|
|
25693
25765
|
const value = encodedAttrs.styleId ?? node?.attributes?.["w:val"];
|
|
25694
25766
|
return {
|
|
25695
25767
|
type: "attr",
|
|
25696
|
-
xmlName: XML_NODE_NAME$
|
|
25697
|
-
sdNodeOrKeyName: SD_ATTR_KEY$
|
|
25768
|
+
xmlName: XML_NODE_NAME$r,
|
|
25769
|
+
sdNodeOrKeyName: SD_ATTR_KEY$b,
|
|
25698
25770
|
attributes: { "w:val": value ?? null }
|
|
25699
25771
|
};
|
|
25700
25772
|
};
|
|
25701
|
-
const config$
|
|
25702
|
-
xmlName: XML_NODE_NAME$
|
|
25703
|
-
sdNodeOrKeyName: SD_ATTR_KEY$
|
|
25773
|
+
const config$o = {
|
|
25774
|
+
xmlName: XML_NODE_NAME$r,
|
|
25775
|
+
sdNodeOrKeyName: SD_ATTR_KEY$b,
|
|
25704
25776
|
type: NodeTranslator.translatorTypes.ATTRIBUTE,
|
|
25705
|
-
encode: encode$
|
|
25706
|
-
attributes: validXmlAttributes$
|
|
25777
|
+
encode: encode$C,
|
|
25778
|
+
attributes: validXmlAttributes$g
|
|
25707
25779
|
};
|
|
25708
|
-
const translator$
|
|
25709
|
-
const encode$
|
|
25710
|
-
const decode$
|
|
25780
|
+
const translator$12 = NodeTranslator.from(config$o);
|
|
25781
|
+
const encode$B = (attributes) => attributes?.["w:val"];
|
|
25782
|
+
const decode$z = (attrs) => attrs?.fontSize;
|
|
25711
25783
|
const attrConfig$c = Object.freeze({
|
|
25712
25784
|
xmlName: "w:val",
|
|
25713
25785
|
sdName: "fontSize",
|
|
25714
|
-
encode: encode$
|
|
25715
|
-
decode: decode$
|
|
25786
|
+
encode: encode$B,
|
|
25787
|
+
decode: decode$z
|
|
25716
25788
|
});
|
|
25717
|
-
const validXmlAttributes$
|
|
25718
|
-
const XML_NODE_NAME$
|
|
25719
|
-
const SD_ATTR_KEY$
|
|
25720
|
-
const encode$
|
|
25789
|
+
const validXmlAttributes$f = [attrConfig$c];
|
|
25790
|
+
const XML_NODE_NAME$q = "w:sz";
|
|
25791
|
+
const SD_ATTR_KEY$a = "fontSize";
|
|
25792
|
+
const encode$A = (params2, encodedAttrs = {}) => {
|
|
25721
25793
|
const { nodes } = params2;
|
|
25722
25794
|
const node = nodes?.[0];
|
|
25723
25795
|
const value = encodedAttrs.fontSize ?? node?.attributes?.["w:val"];
|
|
25724
25796
|
return {
|
|
25725
25797
|
type: "attr",
|
|
25726
|
-
xmlName: XML_NODE_NAME$
|
|
25727
|
-
sdNodeOrKeyName: SD_ATTR_KEY$
|
|
25798
|
+
xmlName: XML_NODE_NAME$q,
|
|
25799
|
+
sdNodeOrKeyName: SD_ATTR_KEY$a,
|
|
25728
25800
|
attributes: { "w:val": value ?? null }
|
|
25729
25801
|
};
|
|
25730
25802
|
};
|
|
25731
|
-
const config$
|
|
25732
|
-
xmlName: XML_NODE_NAME$
|
|
25733
|
-
sdNodeOrKeyName: SD_ATTR_KEY$
|
|
25803
|
+
const config$n = {
|
|
25804
|
+
xmlName: XML_NODE_NAME$q,
|
|
25805
|
+
sdNodeOrKeyName: SD_ATTR_KEY$a,
|
|
25734
25806
|
type: NodeTranslator.translatorTypes.ATTRIBUTE,
|
|
25735
|
-
encode: encode$
|
|
25736
|
-
attributes: validXmlAttributes$
|
|
25807
|
+
encode: encode$A,
|
|
25808
|
+
attributes: validXmlAttributes$f
|
|
25737
25809
|
};
|
|
25738
|
-
const translator
|
|
25739
|
-
const encode$
|
|
25740
|
-
const decode$
|
|
25810
|
+
const translator$11 = NodeTranslator.from(config$n);
|
|
25811
|
+
const encode$z = (attributes) => attributes?.["w:val"];
|
|
25812
|
+
const decode$y = (attrs) => attrs?.fontSizeCs;
|
|
25741
25813
|
const attrConfig$b = Object.freeze({
|
|
25742
25814
|
xmlName: "w:val",
|
|
25743
25815
|
sdName: "fontSizeCs",
|
|
25744
|
-
encode: encode$
|
|
25745
|
-
decode: decode$
|
|
25816
|
+
encode: encode$z,
|
|
25817
|
+
decode: decode$y
|
|
25746
25818
|
});
|
|
25747
|
-
const validXmlAttributes$
|
|
25748
|
-
const XML_NODE_NAME$
|
|
25749
|
-
const SD_ATTR_KEY$
|
|
25750
|
-
const encode$
|
|
25819
|
+
const validXmlAttributes$e = [attrConfig$b];
|
|
25820
|
+
const XML_NODE_NAME$p = "w:szCs";
|
|
25821
|
+
const SD_ATTR_KEY$9 = "fontSizeCs";
|
|
25822
|
+
const encode$y = (params2, encodedAttrs = {}) => {
|
|
25751
25823
|
const { nodes } = params2;
|
|
25752
25824
|
const node = nodes?.[0];
|
|
25753
25825
|
const value = encodedAttrs.fontSizeCs ?? node?.attributes?.["w:val"];
|
|
25754
25826
|
return {
|
|
25755
25827
|
type: "attr",
|
|
25756
|
-
xmlName: XML_NODE_NAME$
|
|
25757
|
-
sdNodeOrKeyName: SD_ATTR_KEY$
|
|
25828
|
+
xmlName: XML_NODE_NAME$p,
|
|
25829
|
+
sdNodeOrKeyName: SD_ATTR_KEY$9,
|
|
25758
25830
|
attributes: { "w:val": value ?? null }
|
|
25759
25831
|
};
|
|
25760
25832
|
};
|
|
25761
|
-
const config$
|
|
25762
|
-
xmlName: XML_NODE_NAME$
|
|
25763
|
-
sdNodeOrKeyName: SD_ATTR_KEY$
|
|
25833
|
+
const config$m = {
|
|
25834
|
+
xmlName: XML_NODE_NAME$p,
|
|
25835
|
+
sdNodeOrKeyName: SD_ATTR_KEY$9,
|
|
25764
25836
|
type: NodeTranslator.translatorTypes.ATTRIBUTE,
|
|
25765
|
-
encode: encode$
|
|
25766
|
-
attributes: validXmlAttributes$
|
|
25837
|
+
encode: encode$y,
|
|
25838
|
+
attributes: validXmlAttributes$e
|
|
25767
25839
|
};
|
|
25768
|
-
const translator$
|
|
25840
|
+
const translator$10 = NodeTranslator.from(config$m);
|
|
25769
25841
|
const generateV2HandlerEntity = (handlerName, translator2) => ({
|
|
25770
25842
|
handlerName,
|
|
25771
25843
|
handler: (params2) => {
|
|
@@ -25899,9 +25971,9 @@ const integerToString = (value) => {
|
|
|
25899
25971
|
const intValue = parseInteger(value);
|
|
25900
25972
|
return intValue != void 0 ? String(intValue) : void 0;
|
|
25901
25973
|
};
|
|
25902
|
-
const XML_NODE_NAME$
|
|
25903
|
-
const SD_ATTR_KEY$
|
|
25904
|
-
const encode$
|
|
25974
|
+
const XML_NODE_NAME$o = "w:caps";
|
|
25975
|
+
const SD_ATTR_KEY$8 = "textTransform";
|
|
25976
|
+
const encode$x = (params2, encodedAttrs = {}) => {
|
|
25905
25977
|
const { nodes } = params2;
|
|
25906
25978
|
const node = nodes[0];
|
|
25907
25979
|
if (!node) return void 0;
|
|
@@ -25913,31 +25985,31 @@ const encode$v = (params2, encodedAttrs = {}) => {
|
|
|
25913
25985
|
}
|
|
25914
25986
|
return {
|
|
25915
25987
|
type: "attr",
|
|
25916
|
-
xmlName: XML_NODE_NAME$
|
|
25917
|
-
sdNodeOrKeyName: SD_ATTR_KEY$
|
|
25918
|
-
attributes: { [SD_ATTR_KEY$
|
|
25988
|
+
xmlName: XML_NODE_NAME$o,
|
|
25989
|
+
sdNodeOrKeyName: SD_ATTR_KEY$8,
|
|
25990
|
+
attributes: { [SD_ATTR_KEY$8]: result }
|
|
25919
25991
|
};
|
|
25920
25992
|
};
|
|
25921
|
-
const config$
|
|
25922
|
-
xmlName: XML_NODE_NAME$
|
|
25923
|
-
sdNodeOrKeyName: SD_ATTR_KEY$
|
|
25993
|
+
const config$l = {
|
|
25994
|
+
xmlName: XML_NODE_NAME$o,
|
|
25995
|
+
sdNodeOrKeyName: SD_ATTR_KEY$8,
|
|
25924
25996
|
type: NodeTranslator.translatorTypes.ATTRIBUTE,
|
|
25925
|
-
encode: encode$
|
|
25997
|
+
encode: encode$x,
|
|
25926
25998
|
attributes: [createAttributeHandler("w:val")]
|
|
25927
25999
|
};
|
|
25928
|
-
const translator
|
|
26000
|
+
const translator$$ = NodeTranslator.from(config$l);
|
|
25929
26001
|
const runPropertyTranslators = Object.freeze({
|
|
25930
|
-
"w:b": translator$
|
|
25931
|
-
"w:i": translator$
|
|
25932
|
-
"w:u": translator$
|
|
25933
|
-
"w:strike": translator$
|
|
25934
|
-
"w:color": translator$
|
|
25935
|
-
"w:highlight": translator$
|
|
25936
|
-
"w:rFonts": translator$
|
|
25937
|
-
"w:rStyle": translator$
|
|
25938
|
-
"w:sz": translator
|
|
25939
|
-
"w:szCs": translator$
|
|
25940
|
-
"w:caps": translator
|
|
26002
|
+
"w:b": translator$18,
|
|
26003
|
+
"w:i": translator$17,
|
|
26004
|
+
"w:u": translator$16,
|
|
26005
|
+
"w:strike": translator$15,
|
|
26006
|
+
"w:color": translator$14,
|
|
26007
|
+
"w:highlight": translator$1b,
|
|
26008
|
+
"w:rFonts": translator$13,
|
|
26009
|
+
"w:rStyle": translator$12,
|
|
26010
|
+
"w:sz": translator$11,
|
|
26011
|
+
"w:szCs": translator$10,
|
|
26012
|
+
"w:caps": translator$$
|
|
25941
26013
|
});
|
|
25942
26014
|
const rawRunPropertyXmlNames = Object.freeze(["w:lang", "w:shd"]);
|
|
25943
26015
|
const RAW_CHILD_NAME_SET = new Set(rawRunPropertyXmlNames);
|
|
@@ -25951,9 +26023,9 @@ const toRunPropertyEntry = (candidate) => {
|
|
|
25951
26023
|
attributes: { ...candidate.attributes || {} }
|
|
25952
26024
|
};
|
|
25953
26025
|
};
|
|
25954
|
-
const XML_NODE_NAME$
|
|
25955
|
-
const SD_ATTR_KEY$
|
|
25956
|
-
const encode$
|
|
26026
|
+
const XML_NODE_NAME$n = "w:rPr";
|
|
26027
|
+
const SD_ATTR_KEY$7 = "runProperties";
|
|
26028
|
+
const encode$w = (params2) => {
|
|
25957
26029
|
const { nodes } = params2;
|
|
25958
26030
|
const node = nodes?.[0] || {};
|
|
25959
26031
|
const contents = Array.isArray(node.elements) ? node.elements : [];
|
|
@@ -25987,16 +26059,16 @@ const encode$u = (params2) => {
|
|
|
25987
26059
|
attributes: runPropsArray
|
|
25988
26060
|
};
|
|
25989
26061
|
};
|
|
25990
|
-
const config$
|
|
25991
|
-
xmlName: XML_NODE_NAME$
|
|
25992
|
-
sdNodeOrKeyName: SD_ATTR_KEY$
|
|
26062
|
+
const config$k = {
|
|
26063
|
+
xmlName: XML_NODE_NAME$n,
|
|
26064
|
+
sdNodeOrKeyName: SD_ATTR_KEY$7,
|
|
25993
26065
|
type: NodeTranslator.translatorTypes.ATTRIBUTE,
|
|
25994
|
-
encode: encode$
|
|
26066
|
+
encode: encode$w
|
|
25995
26067
|
};
|
|
25996
|
-
const translator$
|
|
26068
|
+
const translator$_ = NodeTranslator.from(config$k);
|
|
25997
26069
|
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;
|
|
25998
26070
|
const containsEastAsianCharacters = (text) => EAST_ASIAN_CHARACTER_REGEX.test(text);
|
|
25999
|
-
const collectRunProperties = (params2, rPrNode, translator2 = translator$
|
|
26071
|
+
const collectRunProperties = (params2, rPrNode, translator2 = translator$_) => {
|
|
26000
26072
|
if (!rPrNode) return { entries: [], hadRPr: false, styleChangeMarks: [] };
|
|
26001
26073
|
const result = translator2.encode({ ...params2, nodes: [rPrNode] }) || {};
|
|
26002
26074
|
let entries = [];
|
|
@@ -26469,7 +26541,7 @@ const ensureTrackedWrapper = (runs, trackingMarksByType = /* @__PURE__ */ new Ma
|
|
|
26469
26541
|
}
|
|
26470
26542
|
return runs;
|
|
26471
26543
|
};
|
|
26472
|
-
const XML_NODE_NAME$
|
|
26544
|
+
const XML_NODE_NAME$m = "w:hyperlink";
|
|
26473
26545
|
const SD_NODE_NAME$e = "link";
|
|
26474
26546
|
const _createAttributeHandler = (xmlName, sdName) => ({
|
|
26475
26547
|
xmlName,
|
|
@@ -26477,7 +26549,7 @@ const _createAttributeHandler = (xmlName, sdName) => ({
|
|
|
26477
26549
|
encode: (attributes) => attributes[xmlName],
|
|
26478
26550
|
decode: (attributes) => attributes[sdName]
|
|
26479
26551
|
});
|
|
26480
|
-
const validXmlAttributes$
|
|
26552
|
+
const validXmlAttributes$d = [
|
|
26481
26553
|
_createAttributeHandler("w:anchor", "anchor"),
|
|
26482
26554
|
_createAttributeHandler("w:docLocation", "docLocation"),
|
|
26483
26555
|
{
|
|
@@ -26490,7 +26562,7 @@ const validXmlAttributes$b = [
|
|
|
26490
26562
|
_createAttributeHandler("r:id", "rId"),
|
|
26491
26563
|
_createAttributeHandler("w:tgtFrame", "target")
|
|
26492
26564
|
];
|
|
26493
|
-
const encode$
|
|
26565
|
+
const encode$v = (params2, encodedAttrs) => {
|
|
26494
26566
|
const { nodes, docx, nodeListHandler } = params2;
|
|
26495
26567
|
const node = nodes[0];
|
|
26496
26568
|
let href = _resolveHref(docx, encodedAttrs);
|
|
@@ -26524,7 +26596,7 @@ const _resolveHref = (docx, encodedAttrs) => {
|
|
|
26524
26596
|
}
|
|
26525
26597
|
return href;
|
|
26526
26598
|
};
|
|
26527
|
-
function decode$
|
|
26599
|
+
function decode$x(params2) {
|
|
26528
26600
|
const { hyperlinkGroup = [params2.node] } = params2.extraParams || {};
|
|
26529
26601
|
const node = hyperlinkGroup[0];
|
|
26530
26602
|
const linkMark = node.marks.find((m2) => m2.type === "link");
|
|
@@ -26573,55 +26645,55 @@ function _addNewLinkRelationship(params2, link) {
|
|
|
26573
26645
|
});
|
|
26574
26646
|
return id;
|
|
26575
26647
|
}
|
|
26576
|
-
const config$
|
|
26577
|
-
xmlName: XML_NODE_NAME$
|
|
26648
|
+
const config$j = {
|
|
26649
|
+
xmlName: XML_NODE_NAME$m,
|
|
26578
26650
|
sdNodeOrKeyName: SD_NODE_NAME$e,
|
|
26579
26651
|
type: NodeTranslator.translatorTypes.NODE,
|
|
26580
|
-
encode: encode$
|
|
26581
|
-
decode: decode$
|
|
26582
|
-
attributes: validXmlAttributes$
|
|
26652
|
+
encode: encode$v,
|
|
26653
|
+
decode: decode$x,
|
|
26654
|
+
attributes: validXmlAttributes$d
|
|
26583
26655
|
};
|
|
26584
|
-
const translator$
|
|
26585
|
-
const encode$
|
|
26656
|
+
const translator$Z = NodeTranslator.from(config$j);
|
|
26657
|
+
const encode$u = (attributes) => {
|
|
26586
26658
|
return attributes["w:rsidR"];
|
|
26587
26659
|
};
|
|
26588
|
-
const decode$
|
|
26660
|
+
const decode$w = (attrs) => {
|
|
26589
26661
|
return attrs.rsidR;
|
|
26590
26662
|
};
|
|
26591
26663
|
const attrConfig$a = Object.freeze({
|
|
26592
26664
|
xmlName: "w:rsidR",
|
|
26593
26665
|
sdName: "rsidR",
|
|
26594
|
-
encode: encode$
|
|
26595
|
-
decode: decode$
|
|
26666
|
+
encode: encode$u,
|
|
26667
|
+
decode: decode$w
|
|
26596
26668
|
});
|
|
26597
|
-
const encode$
|
|
26669
|
+
const encode$t = (attributes) => {
|
|
26598
26670
|
return attributes["w:rsidRPr"];
|
|
26599
26671
|
};
|
|
26600
|
-
const decode$
|
|
26672
|
+
const decode$v = (attrs) => {
|
|
26601
26673
|
return attrs.rsidRPr;
|
|
26602
26674
|
};
|
|
26603
26675
|
const attrConfig$9 = Object.freeze({
|
|
26604
26676
|
xmlName: "w:rsidRPr",
|
|
26605
26677
|
sdName: "rsidRPr",
|
|
26606
|
-
encode: encode$
|
|
26607
|
-
decode: decode$
|
|
26678
|
+
encode: encode$t,
|
|
26679
|
+
decode: decode$v
|
|
26608
26680
|
});
|
|
26609
|
-
const encode$
|
|
26681
|
+
const encode$s = (attributes) => {
|
|
26610
26682
|
return attributes["w:rsidDel"];
|
|
26611
26683
|
};
|
|
26612
|
-
const decode$
|
|
26684
|
+
const decode$u = (attrs) => {
|
|
26613
26685
|
return attrs.rsidDel;
|
|
26614
26686
|
};
|
|
26615
26687
|
const attrConfig$8 = Object.freeze({
|
|
26616
26688
|
xmlName: "w:rsidDel",
|
|
26617
26689
|
sdName: "rsidDel",
|
|
26618
|
-
encode: encode$
|
|
26619
|
-
decode: decode$
|
|
26690
|
+
encode: encode$s,
|
|
26691
|
+
decode: decode$u
|
|
26620
26692
|
});
|
|
26621
|
-
const validXmlAttributes$
|
|
26622
|
-
const XML_NODE_NAME$
|
|
26693
|
+
const validXmlAttributes$c = [attrConfig$a, attrConfig$9, attrConfig$8];
|
|
26694
|
+
const XML_NODE_NAME$l = "w:r";
|
|
26623
26695
|
const SD_KEY_NAME = "run";
|
|
26624
|
-
const encode$
|
|
26696
|
+
const encode$r = (params2, encodedAttrs = {}) => {
|
|
26625
26697
|
const { nodes = [], nodeListHandler } = params2 || {};
|
|
26626
26698
|
const runNode = nodes[0];
|
|
26627
26699
|
if (!runNode) return void 0;
|
|
@@ -26669,11 +26741,17 @@ const encode$p = (params2, encodedAttrs = {}) => {
|
|
|
26669
26741
|
}
|
|
26670
26742
|
return runNodeResult;
|
|
26671
26743
|
};
|
|
26672
|
-
const decode$
|
|
26744
|
+
const decode$t = (params2, decodedAttrs = {}) => {
|
|
26673
26745
|
const { node } = params2 || {};
|
|
26674
26746
|
if (!node) return void 0;
|
|
26675
26747
|
const isLinkNode = node.marks?.some((m2) => m2.type === "link");
|
|
26676
|
-
if (isLinkNode)
|
|
26748
|
+
if (isLinkNode) {
|
|
26749
|
+
const extraParams = {
|
|
26750
|
+
...params2.extraParams,
|
|
26751
|
+
linkProcessed: true
|
|
26752
|
+
};
|
|
26753
|
+
return translator$Z.decode({ ...params2, extraParams });
|
|
26754
|
+
}
|
|
26677
26755
|
const { runNode: runNodeForExport, trackingMarksByType } = prepareRunTrackingContext(node);
|
|
26678
26756
|
const runAttrs = runNodeForExport.attrs || {};
|
|
26679
26757
|
const runProperties = Array.isArray(runAttrs.runProperties) ? runAttrs.runProperties : [];
|
|
@@ -26728,7 +26806,7 @@ const decode$r = (params2, decodedAttrs = {}) => {
|
|
|
26728
26806
|
runs.push(trackedClone);
|
|
26729
26807
|
return;
|
|
26730
26808
|
}
|
|
26731
|
-
const runWrapper = { name: XML_NODE_NAME$
|
|
26809
|
+
const runWrapper = { name: XML_NODE_NAME$l, elements: [] };
|
|
26732
26810
|
applyBaseRunProps(runWrapper);
|
|
26733
26811
|
if (!Array.isArray(runWrapper.elements)) runWrapper.elements = [];
|
|
26734
26812
|
runWrapper.elements.push(cloneXmlNode(child));
|
|
@@ -26736,7 +26814,7 @@ const decode$r = (params2, decodedAttrs = {}) => {
|
|
|
26736
26814
|
});
|
|
26737
26815
|
const trackedRuns = ensureTrackedWrapper(runs, trackingMarksByType);
|
|
26738
26816
|
if (!trackedRuns.length) {
|
|
26739
|
-
const emptyRun = { name: XML_NODE_NAME$
|
|
26817
|
+
const emptyRun = { name: XML_NODE_NAME$l, elements: [] };
|
|
26740
26818
|
applyBaseRunProps(emptyRun);
|
|
26741
26819
|
trackedRuns.push(emptyRun);
|
|
26742
26820
|
}
|
|
@@ -26750,15 +26828,15 @@ const decode$r = (params2, decodedAttrs = {}) => {
|
|
|
26750
26828
|
}
|
|
26751
26829
|
return trackedRuns;
|
|
26752
26830
|
};
|
|
26753
|
-
const config$
|
|
26754
|
-
xmlName: XML_NODE_NAME$
|
|
26831
|
+
const config$i = {
|
|
26832
|
+
xmlName: XML_NODE_NAME$l,
|
|
26755
26833
|
sdNodeOrKeyName: SD_KEY_NAME,
|
|
26756
26834
|
type: NodeTranslator.translatorTypes.NODE,
|
|
26757
|
-
encode: encode$
|
|
26758
|
-
decode: decode$
|
|
26759
|
-
attributes: validXmlAttributes$
|
|
26835
|
+
encode: encode$r,
|
|
26836
|
+
decode: decode$t,
|
|
26837
|
+
attributes: validXmlAttributes$c
|
|
26760
26838
|
};
|
|
26761
|
-
const translator$
|
|
26839
|
+
const translator$Y = NodeTranslator.from(config$i);
|
|
26762
26840
|
function preProcessVerticalMergeCells(table, { editorSchema }) {
|
|
26763
26841
|
if (!table || !Array.isArray(table.content)) {
|
|
26764
26842
|
return table;
|
|
@@ -26799,13 +26877,13 @@ function preProcessVerticalMergeCells(table, { editorSchema }) {
|
|
|
26799
26877
|
}
|
|
26800
26878
|
return table;
|
|
26801
26879
|
}
|
|
26802
|
-
const translator$
|
|
26880
|
+
const translator$X = NodeTranslator.from({
|
|
26803
26881
|
xmlName: "w:cantSplit",
|
|
26804
26882
|
sdNodeOrKeyName: "cantSplit",
|
|
26805
26883
|
encode: ({ nodes }) => ["1", "true"].includes(nodes[0].attributes?.["w:val"] ?? "1"),
|
|
26806
26884
|
decode: ({ node }) => node.attrs?.cantSplit ? { attributes: {} } : void 0
|
|
26807
26885
|
});
|
|
26808
|
-
const translator$
|
|
26886
|
+
const translator$W = NodeTranslator.from({
|
|
26809
26887
|
xmlName: "w:cnfStyle",
|
|
26810
26888
|
sdNodeOrKeyName: "cnfStyle",
|
|
26811
26889
|
attributes: [
|
|
@@ -26831,8 +26909,8 @@ const translator$U = NodeTranslator.from({
|
|
|
26831
26909
|
return Object.keys(decodedAttrs).length > 0 ? { attributes: decodedAttrs } : void 0;
|
|
26832
26910
|
}
|
|
26833
26911
|
});
|
|
26834
|
-
const translator$
|
|
26835
|
-
const translator$
|
|
26912
|
+
const translator$V = NodeTranslator.from(createSingleAttrPropertyHandler("w:divId"));
|
|
26913
|
+
const translator$U = NodeTranslator.from(
|
|
26836
26914
|
createSingleAttrPropertyHandler(
|
|
26837
26915
|
"w:gridAfter",
|
|
26838
26916
|
null,
|
|
@@ -26841,7 +26919,7 @@ const translator$S = NodeTranslator.from(
|
|
|
26841
26919
|
(v2) => integerToString(v2)
|
|
26842
26920
|
)
|
|
26843
26921
|
);
|
|
26844
|
-
const translator$
|
|
26922
|
+
const translator$T = NodeTranslator.from(
|
|
26845
26923
|
createSingleAttrPropertyHandler(
|
|
26846
26924
|
"w:gridBefore",
|
|
26847
26925
|
null,
|
|
@@ -26850,21 +26928,21 @@ const translator$R = NodeTranslator.from(
|
|
|
26850
26928
|
(v2) => integerToString(v2)
|
|
26851
26929
|
)
|
|
26852
26930
|
);
|
|
26853
|
-
const translator$
|
|
26931
|
+
const translator$S = NodeTranslator.from({
|
|
26854
26932
|
xmlName: "w:hidden",
|
|
26855
26933
|
sdNodeOrKeyName: "hidden",
|
|
26856
26934
|
encode: ({ nodes }) => parseBoolean(nodes[0].attributes?.["w:val"] ?? "1"),
|
|
26857
26935
|
decode: ({ node }) => node.attrs.hidden ? { attributes: {} } : void 0
|
|
26858
26936
|
});
|
|
26859
|
-
const translator$
|
|
26860
|
-
const translator$
|
|
26861
|
-
const translator$
|
|
26937
|
+
const translator$R = NodeTranslator.from(createSingleAttrPropertyHandler("w:jc", "justification"));
|
|
26938
|
+
const translator$Q = NodeTranslator.from(createMeasurementPropertyHandler("w:tblCellSpacing", "tableCellSpacing"));
|
|
26939
|
+
const translator$P = NodeTranslator.from({
|
|
26862
26940
|
xmlName: "w:tblHeader",
|
|
26863
26941
|
sdNodeOrKeyName: "repeatHeader",
|
|
26864
26942
|
encode: ({ nodes }) => parseBoolean(nodes[0].attributes?.["w:val"] ?? "1"),
|
|
26865
26943
|
decode: ({ node }) => node.attrs.repeatHeader ? { attributes: {} } : void 0
|
|
26866
26944
|
});
|
|
26867
|
-
const translator$
|
|
26945
|
+
const translator$O = NodeTranslator.from({
|
|
26868
26946
|
xmlName: "w:trHeight",
|
|
26869
26947
|
sdNodeOrKeyName: "rowHeight",
|
|
26870
26948
|
encode: ({ nodes }) => {
|
|
@@ -26891,11 +26969,11 @@ const translator$M = NodeTranslator.from({
|
|
|
26891
26969
|
return Object.keys(heightAttrs).length > 0 ? { attributes: heightAttrs } : void 0;
|
|
26892
26970
|
}
|
|
26893
26971
|
});
|
|
26894
|
-
const translator$
|
|
26895
|
-
const translator$
|
|
26896
|
-
const XML_NODE_NAME$
|
|
26897
|
-
const SD_ATTR_KEY$
|
|
26898
|
-
const encode$
|
|
26972
|
+
const translator$N = NodeTranslator.from(createMeasurementPropertyHandler("w:wAfter"));
|
|
26973
|
+
const translator$M = NodeTranslator.from(createMeasurementPropertyHandler("w:wBefore"));
|
|
26974
|
+
const XML_NODE_NAME$k = "w:trPr";
|
|
26975
|
+
const SD_ATTR_KEY$6 = "tableRowProperties";
|
|
26976
|
+
const encode$q = (params2) => {
|
|
26899
26977
|
const { nodes } = params2;
|
|
26900
26978
|
const node = nodes[0];
|
|
26901
26979
|
let attributes = {
|
|
@@ -26909,12 +26987,12 @@ const encode$o = (params2) => {
|
|
|
26909
26987
|
};
|
|
26910
26988
|
return {
|
|
26911
26989
|
type: NodeTranslator.translatorTypes.ATTRIBUTE,
|
|
26912
|
-
xmlName: XML_NODE_NAME$
|
|
26913
|
-
sdNodeOrKeyName: SD_ATTR_KEY$
|
|
26990
|
+
xmlName: XML_NODE_NAME$k,
|
|
26991
|
+
sdNodeOrKeyName: SD_ATTR_KEY$6,
|
|
26914
26992
|
attributes
|
|
26915
26993
|
};
|
|
26916
26994
|
};
|
|
26917
|
-
const decode$
|
|
26995
|
+
const decode$s = (params2) => {
|
|
26918
26996
|
const { tableRowProperties = {} } = params2.node.attrs || {};
|
|
26919
26997
|
const elements = decodeProperties(propertyTranslatorsBySdName$2, tableRowProperties);
|
|
26920
26998
|
const newNode = {
|
|
@@ -26926,6 +27004,8 @@ const decode$q = (params2) => {
|
|
|
26926
27004
|
return newNode;
|
|
26927
27005
|
};
|
|
26928
27006
|
const propertyTranslators$3 = [
|
|
27007
|
+
translator$X,
|
|
27008
|
+
translator$W,
|
|
26929
27009
|
translator$V,
|
|
26930
27010
|
translator$U,
|
|
26931
27011
|
translator$T,
|
|
@@ -26935,9 +27015,7 @@ const propertyTranslators$3 = [
|
|
|
26935
27015
|
translator$P,
|
|
26936
27016
|
translator$O,
|
|
26937
27017
|
translator$N,
|
|
26938
|
-
translator$M
|
|
26939
|
-
translator$L,
|
|
26940
|
-
translator$K
|
|
27018
|
+
translator$M
|
|
26941
27019
|
];
|
|
26942
27020
|
const propertyTranslatorsByXmlName$2 = {};
|
|
26943
27021
|
propertyTranslators$3.forEach((translator2) => {
|
|
@@ -26947,25 +27025,25 @@ const propertyTranslatorsBySdName$2 = {};
|
|
|
26947
27025
|
propertyTranslators$3.forEach((translator2) => {
|
|
26948
27026
|
propertyTranslatorsBySdName$2[translator2.sdNodeOrKeyName] = translator2;
|
|
26949
27027
|
});
|
|
26950
|
-
const config$
|
|
26951
|
-
xmlName: XML_NODE_NAME$
|
|
26952
|
-
sdNodeOrKeyName: SD_ATTR_KEY$
|
|
27028
|
+
const config$h = {
|
|
27029
|
+
xmlName: XML_NODE_NAME$k,
|
|
27030
|
+
sdNodeOrKeyName: SD_ATTR_KEY$6,
|
|
26953
27031
|
type: NodeTranslator.translatorTypes.ATTRIBUTE,
|
|
26954
|
-
encode: encode$
|
|
26955
|
-
decode: decode$
|
|
27032
|
+
encode: encode$q,
|
|
27033
|
+
decode: decode$s
|
|
26956
27034
|
};
|
|
26957
|
-
const translator$
|
|
26958
|
-
const XML_NODE_NAME$
|
|
27035
|
+
const translator$L = NodeTranslator.from(config$h);
|
|
27036
|
+
const XML_NODE_NAME$j = "w:tr";
|
|
26959
27037
|
const SD_NODE_NAME$d = "tableRow";
|
|
26960
|
-
const validXmlAttributes$
|
|
27038
|
+
const validXmlAttributes$b = ["w:rsidDel", "w:rsidR", "w:rsidRPr", "w:rsidTr", "w14:paraId", "w14:textId"].map(
|
|
26961
27039
|
(xmlName) => createAttributeHandler(xmlName)
|
|
26962
27040
|
);
|
|
26963
|
-
const encode$
|
|
27041
|
+
const encode$p = (params2, encodedAttrs) => {
|
|
26964
27042
|
const { row } = params2.extraParams;
|
|
26965
27043
|
let tableRowProperties = {};
|
|
26966
27044
|
const tPr = row.elements.find((el) => el.name === "w:trPr");
|
|
26967
27045
|
if (tPr) {
|
|
26968
|
-
({ attributes: tableRowProperties } = translator$
|
|
27046
|
+
({ attributes: tableRowProperties } = translator$L.encode({
|
|
26969
27047
|
...params2,
|
|
26970
27048
|
nodes: [tPr]
|
|
26971
27049
|
}));
|
|
@@ -26978,7 +27056,7 @@ const encode$n = (params2, encodedAttrs) => {
|
|
|
26978
27056
|
let currentColumnIndex = 0;
|
|
26979
27057
|
const content = cellNodes?.map((n) => {
|
|
26980
27058
|
let columnWidth = gridColumnWidths?.[currentColumnIndex] || null;
|
|
26981
|
-
const result = translator$
|
|
27059
|
+
const result = translator$c.encode({
|
|
26982
27060
|
...params2,
|
|
26983
27061
|
extraParams: {
|
|
26984
27062
|
...params2.extraParams,
|
|
@@ -27000,7 +27078,7 @@ const encode$n = (params2, encodedAttrs) => {
|
|
|
27000
27078
|
};
|
|
27001
27079
|
return newNode;
|
|
27002
27080
|
};
|
|
27003
|
-
const decode$
|
|
27081
|
+
const decode$r = (params2, decodedAttrs) => {
|
|
27004
27082
|
const { node } = params2;
|
|
27005
27083
|
const elements = translateChildNodes(params2);
|
|
27006
27084
|
if (node.attrs?.tableRowProperties) {
|
|
@@ -27012,7 +27090,7 @@ const decode$p = (params2, decodedAttrs) => {
|
|
|
27012
27090
|
}
|
|
27013
27091
|
}
|
|
27014
27092
|
tableRowProperties["cantSplit"] = node.attrs["cantSplit"];
|
|
27015
|
-
const trPr = translator$
|
|
27093
|
+
const trPr = translator$L.decode({
|
|
27016
27094
|
...params2,
|
|
27017
27095
|
node: { ...node, attrs: { ...node.attrs, tableRowProperties } }
|
|
27018
27096
|
});
|
|
@@ -27024,22 +27102,22 @@ const decode$p = (params2, decodedAttrs) => {
|
|
|
27024
27102
|
elements
|
|
27025
27103
|
};
|
|
27026
27104
|
};
|
|
27027
|
-
const config$
|
|
27028
|
-
xmlName: XML_NODE_NAME$
|
|
27105
|
+
const config$g = {
|
|
27106
|
+
xmlName: XML_NODE_NAME$j,
|
|
27029
27107
|
sdNodeOrKeyName: SD_NODE_NAME$d,
|
|
27030
27108
|
type: NodeTranslator.translatorTypes.NODE,
|
|
27031
|
-
encode: encode$
|
|
27032
|
-
decode: decode$
|
|
27033
|
-
attributes: validXmlAttributes$
|
|
27109
|
+
encode: encode$p,
|
|
27110
|
+
decode: decode$r,
|
|
27111
|
+
attributes: validXmlAttributes$b
|
|
27034
27112
|
};
|
|
27035
|
-
const translator$
|
|
27036
|
-
const translator$
|
|
27113
|
+
const translator$K = NodeTranslator.from(config$g);
|
|
27114
|
+
const translator$J = NodeTranslator.from({
|
|
27037
27115
|
xmlName: "w:bidiVisual",
|
|
27038
27116
|
sdNodeOrKeyName: "rightToLeft",
|
|
27039
27117
|
encode: ({ nodes }) => parseBoolean(nodes[0].attributes?.["w:val"] ?? "1"),
|
|
27040
27118
|
decode: ({ node }) => node.attrs.rightToLeft ? { attributes: {} } : void 0
|
|
27041
27119
|
});
|
|
27042
|
-
const translator$
|
|
27120
|
+
const translator$I = NodeTranslator.from({
|
|
27043
27121
|
xmlName: "w:shd",
|
|
27044
27122
|
sdNodeOrKeyName: "shading",
|
|
27045
27123
|
attributes: [
|
|
@@ -27061,11 +27139,11 @@ const translator$G = NodeTranslator.from({
|
|
|
27061
27139
|
return Object.keys(decodedAttrs).length > 0 ? { attributes: decodedAttrs } : void 0;
|
|
27062
27140
|
}
|
|
27063
27141
|
});
|
|
27064
|
-
const translator$
|
|
27065
|
-
const translator$
|
|
27066
|
-
const translator$
|
|
27067
|
-
const translator$
|
|
27068
|
-
const translator$
|
|
27142
|
+
const translator$H = NodeTranslator.from(createSingleAttrPropertyHandler("w:tblCaption", "caption"));
|
|
27143
|
+
const translator$G = NodeTranslator.from(createSingleAttrPropertyHandler("w:tblDescription", "description"));
|
|
27144
|
+
const translator$F = NodeTranslator.from(createMeasurementPropertyHandler("w:tblInd", "tableIndent"));
|
|
27145
|
+
const translator$E = NodeTranslator.from(createSingleAttrPropertyHandler("w:tblLayout", "tableLayout", "w:type"));
|
|
27146
|
+
const translator$D = NodeTranslator.from({
|
|
27069
27147
|
xmlName: "w:tblLook",
|
|
27070
27148
|
sdNodeOrKeyName: "tblLook",
|
|
27071
27149
|
attributes: ["w:firstColumn", "w:firstRow", "w:lastColumn", "w:lastRow", "w:noHBand", "w:noVBand"].map((attr) => createAttributeHandler(attr, null, parseBoolean, booleanToString)).concat([createAttributeHandler("w:val")]),
|
|
@@ -27077,16 +27155,16 @@ const translator$B = NodeTranslator.from({
|
|
|
27077
27155
|
return Object.keys(decodedAttrs).length > 0 ? { attributes: decodedAttrs } : void 0;
|
|
27078
27156
|
}
|
|
27079
27157
|
});
|
|
27080
|
-
const translator$
|
|
27081
|
-
const translator$
|
|
27082
|
-
const translator$
|
|
27158
|
+
const translator$C = NodeTranslator.from(createSingleAttrPropertyHandler("w:tblOverlap", "overlap"));
|
|
27159
|
+
const translator$B = NodeTranslator.from(createSingleAttrPropertyHandler("w:tblStyle", "tableStyleId"));
|
|
27160
|
+
const translator$A = NodeTranslator.from(
|
|
27083
27161
|
createSingleAttrPropertyHandler("w:tblStyleColBandSize", "tableStyleColBandSize")
|
|
27084
27162
|
);
|
|
27085
|
-
const translator$
|
|
27163
|
+
const translator$z = NodeTranslator.from(
|
|
27086
27164
|
createSingleAttrPropertyHandler("w:tblStyleRowBandSize", "tableStyleRowBandSize")
|
|
27087
27165
|
);
|
|
27088
|
-
const translator$
|
|
27089
|
-
const translator$
|
|
27166
|
+
const translator$y = NodeTranslator.from(createMeasurementPropertyHandler("w:tblW", "tableWidth"));
|
|
27167
|
+
const translator$x = NodeTranslator.from({
|
|
27090
27168
|
xmlName: "w:tblpPr",
|
|
27091
27169
|
sdNodeOrKeyName: "floatingTableProperties",
|
|
27092
27170
|
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))),
|
|
@@ -27098,29 +27176,29 @@ const translator$v = NodeTranslator.from({
|
|
|
27098
27176
|
return Object.keys(decodedAttrs).length > 0 ? { attributes: decodedAttrs } : void 0;
|
|
27099
27177
|
}
|
|
27100
27178
|
});
|
|
27101
|
-
const translator$
|
|
27102
|
-
const translator$
|
|
27103
|
-
const translator$
|
|
27104
|
-
const translator$
|
|
27105
|
-
const translator$
|
|
27106
|
-
const translator$
|
|
27107
|
-
const translator$
|
|
27108
|
-
const translator$
|
|
27109
|
-
const translator$
|
|
27110
|
-
const translator$
|
|
27111
|
-
const translator$
|
|
27112
|
-
const translator$
|
|
27113
|
-
const translator$
|
|
27114
|
-
const translator$
|
|
27115
|
-
const XML_NODE_NAME$
|
|
27116
|
-
const SD_ATTR_KEY$
|
|
27117
|
-
const encode$
|
|
27179
|
+
const translator$w = NodeTranslator.from(createBorderPropertyHandler("w:bottom"));
|
|
27180
|
+
const translator$v = NodeTranslator.from(createMeasurementPropertyHandler("w:bottom", "marginBottom"));
|
|
27181
|
+
const translator$u = NodeTranslator.from(createBorderPropertyHandler("w:end"));
|
|
27182
|
+
const translator$t = NodeTranslator.from(createMeasurementPropertyHandler("w:end", "marginEnd"));
|
|
27183
|
+
const translator$s = NodeTranslator.from(createBorderPropertyHandler("w:insideH"));
|
|
27184
|
+
const translator$r = NodeTranslator.from(createBorderPropertyHandler("w:insideV"));
|
|
27185
|
+
const translator$q = NodeTranslator.from(createBorderPropertyHandler("w:left"));
|
|
27186
|
+
const translator$p = NodeTranslator.from(createMeasurementPropertyHandler("w:left", "marginLeft"));
|
|
27187
|
+
const translator$o = NodeTranslator.from(createBorderPropertyHandler("w:right"));
|
|
27188
|
+
const translator$n = NodeTranslator.from(createMeasurementPropertyHandler("w:right", "marginRight"));
|
|
27189
|
+
const translator$m = NodeTranslator.from(createBorderPropertyHandler("w:start"));
|
|
27190
|
+
const translator$l = NodeTranslator.from(createMeasurementPropertyHandler("w:start", "marginStart"));
|
|
27191
|
+
const translator$k = NodeTranslator.from(createBorderPropertyHandler("w:top"));
|
|
27192
|
+
const translator$j = NodeTranslator.from(createMeasurementPropertyHandler("w:top", "marginTop"));
|
|
27193
|
+
const XML_NODE_NAME$i = "w:tblBorders";
|
|
27194
|
+
const SD_ATTR_KEY$5 = "borders";
|
|
27195
|
+
const encode$o = (params2) => {
|
|
27118
27196
|
const { nodes } = params2;
|
|
27119
27197
|
const node = nodes[0];
|
|
27120
27198
|
const attributes = encodeProperties(node, tblBordersTranslatorsByXmlName);
|
|
27121
27199
|
return Object.keys(attributes).length > 0 ? attributes : void 0;
|
|
27122
27200
|
};
|
|
27123
|
-
const decode$
|
|
27201
|
+
const decode$q = (params2) => {
|
|
27124
27202
|
const { borders = {} } = params2.node.attrs || {};
|
|
27125
27203
|
const elements = decodeProperties(tblBordersTranslatorsBySdName, borders);
|
|
27126
27204
|
const newNode = {
|
|
@@ -27132,14 +27210,14 @@ const decode$o = (params2) => {
|
|
|
27132
27210
|
return newNode;
|
|
27133
27211
|
};
|
|
27134
27212
|
const propertyTranslators$2 = [
|
|
27213
|
+
translator$w,
|
|
27135
27214
|
translator$u,
|
|
27136
27215
|
translator$s,
|
|
27216
|
+
translator$r,
|
|
27137
27217
|
translator$q,
|
|
27138
|
-
translator$p,
|
|
27139
27218
|
translator$o,
|
|
27140
27219
|
translator$m,
|
|
27141
|
-
translator$k
|
|
27142
|
-
translator$i
|
|
27220
|
+
translator$k
|
|
27143
27221
|
];
|
|
27144
27222
|
const tblBordersTranslatorsByXmlName = {};
|
|
27145
27223
|
const tblBordersTranslatorsBySdName = {};
|
|
@@ -27147,27 +27225,27 @@ propertyTranslators$2.forEach((translator2) => {
|
|
|
27147
27225
|
tblBordersTranslatorsByXmlName[translator2.xmlName] = translator2;
|
|
27148
27226
|
tblBordersTranslatorsBySdName[translator2.sdNodeOrKeyName] = translator2;
|
|
27149
27227
|
});
|
|
27150
|
-
const translator$
|
|
27151
|
-
xmlName: XML_NODE_NAME$
|
|
27152
|
-
sdNodeOrKeyName: SD_ATTR_KEY$
|
|
27228
|
+
const translator$i = NodeTranslator.from({
|
|
27229
|
+
xmlName: XML_NODE_NAME$i,
|
|
27230
|
+
sdNodeOrKeyName: SD_ATTR_KEY$5,
|
|
27153
27231
|
type: NodeTranslator.translatorTypes.NODE,
|
|
27154
27232
|
attributes: [],
|
|
27155
|
-
encode: encode$
|
|
27156
|
-
decode: decode$
|
|
27233
|
+
encode: encode$o,
|
|
27234
|
+
decode: decode$q
|
|
27157
27235
|
});
|
|
27158
|
-
const XML_NODE_NAME$
|
|
27159
|
-
const SD_ATTR_KEY$
|
|
27160
|
-
const encode$
|
|
27236
|
+
const XML_NODE_NAME$h = "w:tblCellMar";
|
|
27237
|
+
const SD_ATTR_KEY$4 = "cellMargins";
|
|
27238
|
+
const encode$n = (params2) => {
|
|
27161
27239
|
const { nodes } = params2;
|
|
27162
27240
|
const node = nodes[0];
|
|
27163
27241
|
const attributes = encodeProperties(node, propertyTranslatorsByXmlName$1);
|
|
27164
27242
|
return Object.keys(attributes).length > 0 ? attributes : void 0;
|
|
27165
27243
|
};
|
|
27166
|
-
const decode$
|
|
27244
|
+
const decode$p = (params2) => {
|
|
27167
27245
|
const { cellMargins = {} } = params2.node.attrs || {};
|
|
27168
27246
|
const elements = decodeProperties(propertyTranslatorsBySdName$1, cellMargins);
|
|
27169
27247
|
const newNode = {
|
|
27170
|
-
name: XML_NODE_NAME$
|
|
27248
|
+
name: XML_NODE_NAME$h,
|
|
27171
27249
|
type: "element",
|
|
27172
27250
|
attributes: {},
|
|
27173
27251
|
elements
|
|
@@ -27175,12 +27253,12 @@ const decode$n = (params2) => {
|
|
|
27175
27253
|
return newNode;
|
|
27176
27254
|
};
|
|
27177
27255
|
const propertyTranslators$1 = [
|
|
27256
|
+
translator$v,
|
|
27178
27257
|
translator$t,
|
|
27179
|
-
translator$
|
|
27258
|
+
translator$p,
|
|
27180
27259
|
translator$n,
|
|
27181
27260
|
translator$l,
|
|
27182
|
-
translator$j
|
|
27183
|
-
translator$h
|
|
27261
|
+
translator$j
|
|
27184
27262
|
];
|
|
27185
27263
|
const propertyTranslatorsByXmlName$1 = {};
|
|
27186
27264
|
const propertyTranslatorsBySdName$1 = {};
|
|
@@ -27188,27 +27266,27 @@ propertyTranslators$1.forEach((translator2) => {
|
|
|
27188
27266
|
propertyTranslatorsByXmlName$1[translator2.xmlName] = translator2;
|
|
27189
27267
|
propertyTranslatorsBySdName$1[translator2.sdNodeOrKeyName] = translator2;
|
|
27190
27268
|
});
|
|
27191
|
-
const translator$
|
|
27192
|
-
xmlName: XML_NODE_NAME$
|
|
27193
|
-
sdNodeOrKeyName: SD_ATTR_KEY$
|
|
27269
|
+
const translator$h = NodeTranslator.from({
|
|
27270
|
+
xmlName: XML_NODE_NAME$h,
|
|
27271
|
+
sdNodeOrKeyName: SD_ATTR_KEY$4,
|
|
27194
27272
|
type: NodeTranslator.translatorTypes.NODE,
|
|
27195
27273
|
attributes: [],
|
|
27196
|
-
encode: encode$
|
|
27197
|
-
decode: decode$
|
|
27274
|
+
encode: encode$n,
|
|
27275
|
+
decode: decode$p
|
|
27198
27276
|
});
|
|
27199
|
-
const XML_NODE_NAME$
|
|
27200
|
-
const SD_ATTR_KEY$
|
|
27201
|
-
const encode$
|
|
27277
|
+
const XML_NODE_NAME$g = "w:tblPr";
|
|
27278
|
+
const SD_ATTR_KEY$3 = "tableProperties";
|
|
27279
|
+
const encode$m = (params2) => {
|
|
27202
27280
|
const { nodes } = params2;
|
|
27203
27281
|
const node = nodes[0];
|
|
27204
27282
|
const attributes = encodeProperties(node, propertyTranslatorsByXmlName);
|
|
27205
27283
|
return {
|
|
27206
|
-
xmlName: XML_NODE_NAME$
|
|
27207
|
-
sdNodeOrKeyName: SD_ATTR_KEY$
|
|
27284
|
+
xmlName: XML_NODE_NAME$g,
|
|
27285
|
+
sdNodeOrKeyName: SD_ATTR_KEY$3,
|
|
27208
27286
|
attributes
|
|
27209
27287
|
};
|
|
27210
27288
|
};
|
|
27211
|
-
const decode$
|
|
27289
|
+
const decode$o = (params2) => {
|
|
27212
27290
|
const { tableProperties = {} } = params2.node.attrs || {};
|
|
27213
27291
|
const elements = decodeProperties(propertyTranslatorsBySdName, tableProperties);
|
|
27214
27292
|
const newNode = {
|
|
@@ -27220,11 +27298,13 @@ const decode$m = (params2) => {
|
|
|
27220
27298
|
return newNode;
|
|
27221
27299
|
};
|
|
27222
27300
|
const propertyTranslators = [
|
|
27301
|
+
translator$J,
|
|
27302
|
+
translator$R,
|
|
27303
|
+
translator$I,
|
|
27223
27304
|
translator$H,
|
|
27224
|
-
translator$
|
|
27305
|
+
translator$Q,
|
|
27225
27306
|
translator$G,
|
|
27226
27307
|
translator$F,
|
|
27227
|
-
translator$O,
|
|
27228
27308
|
translator$E,
|
|
27229
27309
|
translator$D,
|
|
27230
27310
|
translator$C,
|
|
@@ -27233,10 +27313,8 @@ const propertyTranslators = [
|
|
|
27233
27313
|
translator$z,
|
|
27234
27314
|
translator$y,
|
|
27235
27315
|
translator$x,
|
|
27236
|
-
translator$
|
|
27237
|
-
translator$
|
|
27238
|
-
translator$g,
|
|
27239
|
-
translator$f
|
|
27316
|
+
translator$i,
|
|
27317
|
+
translator$h
|
|
27240
27318
|
];
|
|
27241
27319
|
const propertyTranslatorsByXmlName = {};
|
|
27242
27320
|
const propertyTranslatorsBySdName = {};
|
|
@@ -27244,14 +27322,14 @@ propertyTranslators.forEach((translator2) => {
|
|
|
27244
27322
|
propertyTranslatorsByXmlName[translator2.xmlName] = translator2;
|
|
27245
27323
|
propertyTranslatorsBySdName[translator2.sdNodeOrKeyName] = translator2;
|
|
27246
27324
|
});
|
|
27247
|
-
const config$
|
|
27248
|
-
xmlName: XML_NODE_NAME$
|
|
27249
|
-
sdNodeOrKeyName: SD_ATTR_KEY$
|
|
27250
|
-
encode: encode$
|
|
27251
|
-
decode: decode$
|
|
27325
|
+
const config$f = {
|
|
27326
|
+
xmlName: XML_NODE_NAME$g,
|
|
27327
|
+
sdNodeOrKeyName: SD_ATTR_KEY$3,
|
|
27328
|
+
encode: encode$m,
|
|
27329
|
+
decode: decode$o
|
|
27252
27330
|
};
|
|
27253
|
-
const translator$
|
|
27254
|
-
const translator$
|
|
27331
|
+
const translator$g = NodeTranslator.from(config$f);
|
|
27332
|
+
const translator$f = NodeTranslator.from(
|
|
27255
27333
|
createSingleAttrPropertyHandler("w:gridCol", "col", "w:w", parseInteger, integerToString)
|
|
27256
27334
|
);
|
|
27257
27335
|
const DEFAULT_COLUMN_WIDTH_PX = 100;
|
|
@@ -27301,20 +27379,20 @@ const resolveFallbackColumnWidthTwips = (params2, totalColumns, cellMinWidthTwip
|
|
|
27301
27379
|
}
|
|
27302
27380
|
return Math.max(fallbackWidthTwips, cellMinWidthTwips);
|
|
27303
27381
|
};
|
|
27304
|
-
const XML_NODE_NAME$
|
|
27305
|
-
const SD_ATTR_KEY = "grid";
|
|
27382
|
+
const XML_NODE_NAME$f = "w:tblGrid";
|
|
27383
|
+
const SD_ATTR_KEY$2 = "grid";
|
|
27306
27384
|
const cellMinWidth = pixelsToTwips(10);
|
|
27307
|
-
const encode$
|
|
27385
|
+
const encode$l = (params2) => {
|
|
27308
27386
|
const { nodes } = params2;
|
|
27309
27387
|
const node = nodes[0];
|
|
27310
|
-
const attributes = encodeProperties(node, { [translator$
|
|
27388
|
+
const attributes = encodeProperties(node, { [translator$f.xmlName]: translator$f }, true);
|
|
27311
27389
|
return {
|
|
27312
|
-
xmlName: XML_NODE_NAME$
|
|
27313
|
-
sdNodeOrKeyName: SD_ATTR_KEY,
|
|
27390
|
+
xmlName: XML_NODE_NAME$f,
|
|
27391
|
+
sdNodeOrKeyName: SD_ATTR_KEY$2,
|
|
27314
27392
|
attributes
|
|
27315
27393
|
};
|
|
27316
27394
|
};
|
|
27317
|
-
const decode$
|
|
27395
|
+
const decode$n = (params2) => {
|
|
27318
27396
|
const { grid: rawGrid } = params2.node.attrs || {};
|
|
27319
27397
|
const grid = Array.isArray(rawGrid) ? rawGrid : [];
|
|
27320
27398
|
const { firstRow = {} } = params2.extraParams || {};
|
|
@@ -27333,10 +27411,10 @@ const decode$l = (params2) => {
|
|
|
27333
27411
|
numericWidth = fallbackColumnWidthTwips;
|
|
27334
27412
|
}
|
|
27335
27413
|
numericWidth = Math.max(numericWidth, cellMinWidth);
|
|
27336
|
-
const decoded = translator$
|
|
27414
|
+
const decoded = translator$f.decode({
|
|
27337
27415
|
node: { type: (
|
|
27338
27416
|
/** @type {string} */
|
|
27339
|
-
translator$
|
|
27417
|
+
translator$f.sdNodeOrKeyName
|
|
27340
27418
|
), attrs: { col: numericWidth } }
|
|
27341
27419
|
});
|
|
27342
27420
|
if (decoded) elements.push(decoded);
|
|
@@ -27371,19 +27449,19 @@ const decode$l = (params2) => {
|
|
|
27371
27449
|
columnIndex++;
|
|
27372
27450
|
}
|
|
27373
27451
|
const newNode = {
|
|
27374
|
-
name: XML_NODE_NAME$
|
|
27452
|
+
name: XML_NODE_NAME$f,
|
|
27375
27453
|
attributes: {},
|
|
27376
27454
|
elements
|
|
27377
27455
|
};
|
|
27378
27456
|
return newNode;
|
|
27379
27457
|
};
|
|
27380
|
-
const config$
|
|
27381
|
-
xmlName: XML_NODE_NAME$
|
|
27382
|
-
sdNodeOrKeyName: SD_ATTR_KEY,
|
|
27383
|
-
encode: encode$
|
|
27384
|
-
decode: decode$
|
|
27458
|
+
const config$e = {
|
|
27459
|
+
xmlName: XML_NODE_NAME$f,
|
|
27460
|
+
sdNodeOrKeyName: SD_ATTR_KEY$2,
|
|
27461
|
+
encode: encode$l,
|
|
27462
|
+
decode: decode$n
|
|
27385
27463
|
};
|
|
27386
|
-
const translator$
|
|
27464
|
+
const translator$e = NodeTranslator.from(config$e);
|
|
27387
27465
|
const DEFAULT_PAGE_WIDTH_TWIPS = 12240;
|
|
27388
27466
|
const DEFAULT_PAGE_MARGIN_TWIPS = 1440;
|
|
27389
27467
|
const DEFAULT_CONTENT_WIDTH_TWIPS = DEFAULT_PAGE_WIDTH_TWIPS - 2 * DEFAULT_PAGE_MARGIN_TWIPS;
|
|
@@ -27446,19 +27524,19 @@ const buildFallbackGridForTable = ({ params: params2, rows, tableWidth, tableWid
|
|
|
27446
27524
|
columnWidths: Array(columnCount).fill(fallbackColumnWidthPx)
|
|
27447
27525
|
};
|
|
27448
27526
|
};
|
|
27449
|
-
const XML_NODE_NAME$
|
|
27527
|
+
const XML_NODE_NAME$e = "w:tbl";
|
|
27450
27528
|
const SD_NODE_NAME$c = "table";
|
|
27451
|
-
const encode$
|
|
27529
|
+
const encode$k = (params2, encodedAttrs) => {
|
|
27452
27530
|
const { nodes } = params2;
|
|
27453
27531
|
const node = nodes[0];
|
|
27454
27532
|
const tblPr = node.elements.find((el) => el.name === "w:tblPr");
|
|
27455
27533
|
if (tblPr) {
|
|
27456
|
-
const encodedProperties = translator$
|
|
27534
|
+
const encodedProperties = translator$g.encode({ ...params2, nodes: [tblPr] });
|
|
27457
27535
|
encodedAttrs["tableProperties"] = encodedProperties?.attributes || {};
|
|
27458
27536
|
}
|
|
27459
27537
|
const tblGrid = node.elements.find((el) => el.name === "w:tblGrid");
|
|
27460
27538
|
if (tblGrid) {
|
|
27461
|
-
encodedAttrs["grid"] = translator$
|
|
27539
|
+
encodedAttrs["grid"] = translator$e.encode({ ...params2, nodes: [tblGrid] }).attributes;
|
|
27462
27540
|
}
|
|
27463
27541
|
[
|
|
27464
27542
|
"tableStyleId",
|
|
@@ -27525,7 +27603,7 @@ const encode$i = (params2, encodedAttrs) => {
|
|
|
27525
27603
|
}
|
|
27526
27604
|
const content = [];
|
|
27527
27605
|
rows.forEach((row) => {
|
|
27528
|
-
const result = translator$
|
|
27606
|
+
const result = translator$K.encode({
|
|
27529
27607
|
...params2,
|
|
27530
27608
|
nodes: [row],
|
|
27531
27609
|
extraParams: {
|
|
@@ -27544,13 +27622,13 @@ const encode$i = (params2, encodedAttrs) => {
|
|
|
27544
27622
|
attrs: encodedAttrs
|
|
27545
27623
|
};
|
|
27546
27624
|
};
|
|
27547
|
-
const decode$
|
|
27625
|
+
const decode$m = (params2, decodedAttrs) => {
|
|
27548
27626
|
params2.node = preProcessVerticalMergeCells(params2.node, params2);
|
|
27549
27627
|
const { node } = params2;
|
|
27550
27628
|
const elements = translateChildNodes(params2);
|
|
27551
27629
|
const firstRow = node.content?.find((n) => n.type === "tableRow");
|
|
27552
27630
|
const properties = node.attrs.grid;
|
|
27553
|
-
const element = translator$
|
|
27631
|
+
const element = translator$e.decode({
|
|
27554
27632
|
...params2,
|
|
27555
27633
|
node: { ...node, attrs: { ...node.attrs, grid: properties } },
|
|
27556
27634
|
extraParams: {
|
|
@@ -27560,7 +27638,7 @@ const decode$k = (params2, decodedAttrs) => {
|
|
|
27560
27638
|
if (element) elements.unshift(element);
|
|
27561
27639
|
if (node.attrs?.tableProperties) {
|
|
27562
27640
|
const properties2 = { ...node.attrs.tableProperties };
|
|
27563
|
-
const element2 = translator$
|
|
27641
|
+
const element2 = translator$g.decode({
|
|
27564
27642
|
...params2,
|
|
27565
27643
|
node: { ...node, attrs: { ...node.attrs, tableProperties: properties2 } }
|
|
27566
27644
|
});
|
|
@@ -27626,7 +27704,7 @@ function _getReferencedTableStyles(tableStyleReference, params2) {
|
|
|
27626
27704
|
if (baseTblPr && baseTblPr.elements) {
|
|
27627
27705
|
tblPr.elements.push(...baseTblPr.elements);
|
|
27628
27706
|
}
|
|
27629
|
-
const tableProperties = translator$
|
|
27707
|
+
const tableProperties = translator$g.encode({ ...params2, nodes: [tblPr] }).attributes;
|
|
27630
27708
|
const { borders, rowBorders } = _processTableBorders(tableProperties.borders || {});
|
|
27631
27709
|
if (borders) stylesToReturn.borders = borders;
|
|
27632
27710
|
if (rowBorders) stylesToReturn.rowBorders = rowBorders;
|
|
@@ -27643,16 +27721,16 @@ function _getReferencedTableStyles(tableStyleReference, params2) {
|
|
|
27643
27721
|
}
|
|
27644
27722
|
return stylesToReturn;
|
|
27645
27723
|
}
|
|
27646
|
-
const config$
|
|
27647
|
-
xmlName: XML_NODE_NAME$
|
|
27724
|
+
const config$d = {
|
|
27725
|
+
xmlName: XML_NODE_NAME$e,
|
|
27648
27726
|
sdNodeOrKeyName: SD_NODE_NAME$c,
|
|
27649
27727
|
type: NodeTranslator.translatorTypes.NODE,
|
|
27650
|
-
encode: encode$
|
|
27651
|
-
decode: decode$
|
|
27728
|
+
encode: encode$k,
|
|
27729
|
+
decode: decode$m,
|
|
27652
27730
|
attributes: []
|
|
27653
27731
|
};
|
|
27654
|
-
const translator$
|
|
27655
|
-
const tableNodeHandlerEntity = generateV2HandlerEntity("tableNodeHandler", translator$
|
|
27732
|
+
const translator$d = NodeTranslator.from(config$d);
|
|
27733
|
+
const tableNodeHandlerEntity = generateV2HandlerEntity("tableNodeHandler", translator$d);
|
|
27656
27734
|
function getReferencedTableStyles(tblStyleTag, docx) {
|
|
27657
27735
|
if (!tblStyleTag) return null;
|
|
27658
27736
|
const stylesToReturn = {};
|
|
@@ -28014,10 +28092,10 @@ function generateCellMargins(cellMargins) {
|
|
|
28014
28092
|
if (left2 != null) elements.push({ name: "w:left", attributes: { "w:w": pixelsToTwips(left2) } });
|
|
28015
28093
|
return elements;
|
|
28016
28094
|
}
|
|
28017
|
-
const XML_NODE_NAME$
|
|
28095
|
+
const XML_NODE_NAME$d = "w:tc";
|
|
28018
28096
|
const SD_NODE_NAME$b = "tableCell";
|
|
28019
|
-
const validXmlAttributes$
|
|
28020
|
-
function encode$
|
|
28097
|
+
const validXmlAttributes$a = [];
|
|
28098
|
+
function encode$j(params2, encodedAttrs) {
|
|
28021
28099
|
const {
|
|
28022
28100
|
node,
|
|
28023
28101
|
table,
|
|
@@ -28044,22 +28122,22 @@ function encode$h(params2, encodedAttrs) {
|
|
|
28044
28122
|
}
|
|
28045
28123
|
return schemaNode;
|
|
28046
28124
|
}
|
|
28047
|
-
function decode$
|
|
28125
|
+
function decode$l(params2, decodedAttrs) {
|
|
28048
28126
|
const translated = translateTableCell(params2);
|
|
28049
28127
|
if (decodedAttrs && Object.keys(decodedAttrs).length) {
|
|
28050
28128
|
translated.attributes = { ...translated.attributes || {}, ...decodedAttrs };
|
|
28051
28129
|
}
|
|
28052
28130
|
return translated;
|
|
28053
28131
|
}
|
|
28054
|
-
const config$
|
|
28055
|
-
xmlName: XML_NODE_NAME$
|
|
28132
|
+
const config$c = {
|
|
28133
|
+
xmlName: XML_NODE_NAME$d,
|
|
28056
28134
|
sdNodeOrKeyName: SD_NODE_NAME$b,
|
|
28057
28135
|
type: NodeTranslator.translatorTypes.NODE,
|
|
28058
|
-
encode: encode$
|
|
28059
|
-
decode: decode$
|
|
28060
|
-
attributes: validXmlAttributes$
|
|
28136
|
+
encode: encode$j,
|
|
28137
|
+
decode: decode$l,
|
|
28138
|
+
attributes: validXmlAttributes$a
|
|
28061
28139
|
};
|
|
28062
|
-
const translator$
|
|
28140
|
+
const translator$c = NodeTranslator.from(config$c);
|
|
28063
28141
|
function parseTagValueJSON(json) {
|
|
28064
28142
|
if (typeof json !== "string") {
|
|
28065
28143
|
return {};
|
|
@@ -28486,8 +28564,64 @@ function handleImageNode(node, params2, isAnchor) {
|
|
|
28486
28564
|
const vRelativeFrom = positionVTag?.attributes.relativeFrom;
|
|
28487
28565
|
const alignV = positionVTag?.elements?.find((el) => el.name === "wp:align")?.elements[0]?.text;
|
|
28488
28566
|
const simplePos = node.elements.find((el) => el.name === "wp:simplePos");
|
|
28489
|
-
const
|
|
28490
|
-
|
|
28567
|
+
const wrapNode = isAnchor ? node.elements.find(
|
|
28568
|
+
(el) => ["wp:wrapNone", "wp:wrapSquare", "wp:wrapThrough", "wp:wrapTight", "wp:wrapTopAndBottom"].includes(el.name)
|
|
28569
|
+
) : null;
|
|
28570
|
+
const wrap2 = isAnchor ? { type: wrapNode?.name.slice(7) || "None", attrs: {} } : { type: "Inline" };
|
|
28571
|
+
switch (wrap2.type) {
|
|
28572
|
+
case "Square":
|
|
28573
|
+
wrap2.attrs.wrapText = wrapNode.attributes.wrapText;
|
|
28574
|
+
if ("distB" in (wrapNode.attributes || {})) {
|
|
28575
|
+
wrap2.attrs.distBottom = emuToPixels(wrapNode.attributes.distB);
|
|
28576
|
+
}
|
|
28577
|
+
if ("distL" in (wrapNode.attributes || {})) {
|
|
28578
|
+
wrap2.attrs.distLeft = emuToPixels(wrapNode.attributes.distL);
|
|
28579
|
+
}
|
|
28580
|
+
if ("distR" in (wrapNode.attributes || {})) {
|
|
28581
|
+
wrap2.attrs.distRight = emuToPixels(wrapNode.attributes.distR);
|
|
28582
|
+
}
|
|
28583
|
+
if ("distT" in (wrapNode.attributes || {})) {
|
|
28584
|
+
wrap2.attrs.distTop = emuToPixels(wrapNode.attributes.distT);
|
|
28585
|
+
}
|
|
28586
|
+
break;
|
|
28587
|
+
case "Tight":
|
|
28588
|
+
case "Through": {
|
|
28589
|
+
if ("distL" in (wrapNode.attributes || {})) {
|
|
28590
|
+
wrap2.attrs.distLeft = emuToPixels(wrapNode.attributes.distL);
|
|
28591
|
+
}
|
|
28592
|
+
if ("distR" in (wrapNode.attributes || {})) {
|
|
28593
|
+
wrap2.attrs.distRight = emuToPixels(wrapNode.attributes.distR);
|
|
28594
|
+
}
|
|
28595
|
+
if ("distT" in (wrapNode.attributes || {})) {
|
|
28596
|
+
wrap2.attrs.distTop = emuToPixels(wrapNode.attributes.distT);
|
|
28597
|
+
}
|
|
28598
|
+
if ("distB" in (wrapNode.attributes || {})) {
|
|
28599
|
+
wrap2.attrs.distBottom = emuToPixels(wrapNode.attributes.distB);
|
|
28600
|
+
}
|
|
28601
|
+
if ("wrapText" in (wrapNode.attributes || {})) {
|
|
28602
|
+
wrap2.attrs.wrapText = wrapNode.attributes.wrapText;
|
|
28603
|
+
}
|
|
28604
|
+
const polygon = wrapNode.elements?.find((el) => el.name === "wp:wrapPolygon");
|
|
28605
|
+
if (polygon) {
|
|
28606
|
+
wrap2.attrs.polygon = polygonToObj(polygon);
|
|
28607
|
+
if (polygon.attributes?.edited !== void 0) {
|
|
28608
|
+
wrap2.attrs.polygonEdited = polygon.attributes.edited;
|
|
28609
|
+
}
|
|
28610
|
+
}
|
|
28611
|
+
break;
|
|
28612
|
+
}
|
|
28613
|
+
case "TopAndBottom":
|
|
28614
|
+
if ("distB" in (wrapNode.attributes || {})) {
|
|
28615
|
+
wrap2.attrs.distBottom = emuToPixels(wrapNode.attributes.distB);
|
|
28616
|
+
}
|
|
28617
|
+
if ("distT" in (wrapNode.attributes || {})) {
|
|
28618
|
+
wrap2.attrs.distTop = emuToPixels(wrapNode.attributes.distT);
|
|
28619
|
+
}
|
|
28620
|
+
break;
|
|
28621
|
+
case "None":
|
|
28622
|
+
wrap2.attrs.behindDoc = node.attributes?.behindDoc === "1";
|
|
28623
|
+
break;
|
|
28624
|
+
}
|
|
28491
28625
|
const docPr = node.elements.find((el) => el.name === "wp:docPr");
|
|
28492
28626
|
let anchorData = null;
|
|
28493
28627
|
if (hRelativeFrom || alignH || vRelativeFrom || alignV) {
|
|
@@ -28499,7 +28633,7 @@ function handleImageNode(node, params2, isAnchor) {
|
|
|
28499
28633
|
};
|
|
28500
28634
|
}
|
|
28501
28635
|
const marginOffset = {
|
|
28502
|
-
|
|
28636
|
+
horizontal: positionHValue,
|
|
28503
28637
|
top: positionVValue
|
|
28504
28638
|
};
|
|
28505
28639
|
const { attributes: blipAttributes = {} } = blip;
|
|
@@ -28538,10 +28672,7 @@ function handleImageNode(node, params2, isAnchor) {
|
|
|
28538
28672
|
y: simplePos.attributes.y
|
|
28539
28673
|
}
|
|
28540
28674
|
},
|
|
28541
|
-
|
|
28542
|
-
wrapText: wrapSquare.attributes.wrapText
|
|
28543
|
-
},
|
|
28544
|
-
wrapTopAndBottom: !!wrapTopAndBottom,
|
|
28675
|
+
wrap: wrap2,
|
|
28545
28676
|
originalPadding: {
|
|
28546
28677
|
distT: attributes["distT"],
|
|
28547
28678
|
distB: attributes["distB"],
|
|
@@ -28889,7 +29020,6 @@ function addNewImageRelationship(params2, imagePath) {
|
|
|
28889
29020
|
function translateAnchorNode(params2) {
|
|
28890
29021
|
const { attrs } = params2.node;
|
|
28891
29022
|
const anchorElements = [];
|
|
28892
|
-
const wrapElements = [];
|
|
28893
29023
|
if (attrs.simplePos) {
|
|
28894
29024
|
anchorElements.push({
|
|
28895
29025
|
name: "wp:simplePos",
|
|
@@ -28901,10 +29031,10 @@ function translateAnchorNode(params2) {
|
|
|
28901
29031
|
}
|
|
28902
29032
|
if (attrs.anchorData) {
|
|
28903
29033
|
const hElements = [];
|
|
28904
|
-
if (attrs.marginOffset.
|
|
29034
|
+
if (attrs.marginOffset.horizontal !== void 0) {
|
|
28905
29035
|
hElements.push({
|
|
28906
29036
|
name: "wp:posOffset",
|
|
28907
|
-
elements: [{ type: "text", text: pixelsToEmu(attrs.marginOffset.
|
|
29037
|
+
elements: [{ type: "text", text: pixelsToEmu(attrs.marginOffset.horizontal).toString() }]
|
|
28908
29038
|
});
|
|
28909
29039
|
}
|
|
28910
29040
|
if (attrs.anchorData.alignH) {
|
|
@@ -28937,38 +29067,110 @@ function translateAnchorNode(params2) {
|
|
|
28937
29067
|
...vElements.length && { elements: vElements }
|
|
28938
29068
|
});
|
|
28939
29069
|
}
|
|
28940
|
-
|
|
28941
|
-
|
|
28942
|
-
|
|
28943
|
-
|
|
28944
|
-
|
|
28945
|
-
|
|
28946
|
-
|
|
29070
|
+
const nodeElements = translateImageNode(params2);
|
|
29071
|
+
const inlineAttrs = {
|
|
29072
|
+
...attrs.originalAttributes || {},
|
|
29073
|
+
...nodeElements.attributes || {}
|
|
29074
|
+
};
|
|
29075
|
+
if (inlineAttrs.relativeHeight == null) {
|
|
29076
|
+
inlineAttrs.relativeHeight = 1;
|
|
28947
29077
|
}
|
|
28948
|
-
if (attrs.
|
|
28949
|
-
|
|
28950
|
-
|
|
28951
|
-
|
|
29078
|
+
if (attrs.originalAttributes?.simplePos !== void 0) {
|
|
29079
|
+
inlineAttrs.simplePos = attrs.originalAttributes.simplePos;
|
|
29080
|
+
} else if (attrs.simplePos !== void 0) {
|
|
29081
|
+
inlineAttrs.simplePos = attrs.simplePos;
|
|
28952
29082
|
}
|
|
28953
|
-
if (
|
|
28954
|
-
|
|
28955
|
-
name: "wp:wrapNone"
|
|
28956
|
-
});
|
|
29083
|
+
if (attrs.originalAttributes?.locked !== void 0) {
|
|
29084
|
+
inlineAttrs.locked = attrs.originalAttributes.locked;
|
|
28957
29085
|
}
|
|
28958
|
-
|
|
28959
|
-
|
|
28960
|
-
|
|
28961
|
-
|
|
28962
|
-
|
|
28963
|
-
|
|
28964
|
-
|
|
28965
|
-
|
|
28966
|
-
|
|
29086
|
+
if (attrs.originalAttributes?.layoutInCell !== void 0) {
|
|
29087
|
+
inlineAttrs.layoutInCell = attrs.originalAttributes.layoutInCell;
|
|
29088
|
+
}
|
|
29089
|
+
if (attrs.originalAttributes?.allowOverlap !== void 0) {
|
|
29090
|
+
inlineAttrs.allowOverlap = attrs.originalAttributes.allowOverlap;
|
|
29091
|
+
}
|
|
29092
|
+
const wrapElement = {
|
|
29093
|
+
name: `wp:wrap${attrs.wrap?.type || "None"}`
|
|
29094
|
+
// Important: wp:anchor will break if no wrapping is specified. We need to use wrapNone.
|
|
28967
29095
|
};
|
|
29096
|
+
switch (attrs.wrap?.type) {
|
|
29097
|
+
case "Square":
|
|
29098
|
+
wrapElement.attributes = {
|
|
29099
|
+
wrapText: attrs.wrap.attrs.wrapText
|
|
29100
|
+
};
|
|
29101
|
+
if ("distBottom" in (attrs.wrap.attrs || {})) {
|
|
29102
|
+
wrapElement.attributes.distB = pixelsToEmu(attrs.wrap.attrs.distBottom);
|
|
29103
|
+
}
|
|
29104
|
+
if ("distLeft" in (attrs.wrap.attrs || {})) {
|
|
29105
|
+
wrapElement.attributes.distL = pixelsToEmu(attrs.wrap.attrs.distLeft);
|
|
29106
|
+
}
|
|
29107
|
+
if ("distRight" in (attrs.wrap.attrs || {})) {
|
|
29108
|
+
wrapElement.attributes.distR = pixelsToEmu(attrs.wrap.attrs.distRight);
|
|
29109
|
+
}
|
|
29110
|
+
if ("distTop" in (attrs.wrap.attrs || {})) {
|
|
29111
|
+
wrapElement.attributes.distT = pixelsToEmu(attrs.wrap.attrs.distTop);
|
|
29112
|
+
}
|
|
29113
|
+
break;
|
|
29114
|
+
case "TopAndBottom": {
|
|
29115
|
+
const attributes = {};
|
|
29116
|
+
let hasKeys = false;
|
|
29117
|
+
if ("distBottom" in (attrs.wrap.attrs || {})) {
|
|
29118
|
+
attributes.distB = pixelsToEmu(attrs.wrap.attrs.distBottom);
|
|
29119
|
+
hasKeys = true;
|
|
29120
|
+
}
|
|
29121
|
+
if ("distTop" in (attrs.wrap.attrs || {})) {
|
|
29122
|
+
attributes.distT = pixelsToEmu(attrs.wrap.attrs.distTop);
|
|
29123
|
+
hasKeys = true;
|
|
29124
|
+
}
|
|
29125
|
+
if (hasKeys) {
|
|
29126
|
+
wrapElement.attributes = attributes;
|
|
29127
|
+
}
|
|
29128
|
+
break;
|
|
29129
|
+
}
|
|
29130
|
+
case "Through":
|
|
29131
|
+
case "Tight": {
|
|
29132
|
+
const attributes = {};
|
|
29133
|
+
if ("distLeft" in (attrs.wrap.attrs || {})) {
|
|
29134
|
+
attributes.distL = pixelsToEmu(attrs.wrap.attrs.distLeft);
|
|
29135
|
+
}
|
|
29136
|
+
if ("distRight" in (attrs.wrap.attrs || {})) {
|
|
29137
|
+
attributes.distR = pixelsToEmu(attrs.wrap.attrs.distRight);
|
|
29138
|
+
}
|
|
29139
|
+
if ("distTop" in (attrs.wrap.attrs || {})) {
|
|
29140
|
+
attributes.distT = pixelsToEmu(attrs.wrap.attrs.distTop);
|
|
29141
|
+
}
|
|
29142
|
+
if ("distBottom" in (attrs.wrap.attrs || {})) {
|
|
29143
|
+
attributes.distB = pixelsToEmu(attrs.wrap.attrs.distBottom);
|
|
29144
|
+
}
|
|
29145
|
+
const wrapText = attrs.wrap.attrs?.wrapText || "bothSides";
|
|
29146
|
+
{
|
|
29147
|
+
attributes.wrapText = wrapText;
|
|
29148
|
+
}
|
|
29149
|
+
if (Object.keys(attributes).length) {
|
|
29150
|
+
wrapElement.attributes = attributes;
|
|
29151
|
+
}
|
|
29152
|
+
if (attrs.wrap.attrs?.polygon) {
|
|
29153
|
+
const polygonNode = objToPolygon(attrs.wrap.attrs.polygon);
|
|
29154
|
+
if (polygonNode) {
|
|
29155
|
+
if (attrs.wrap.attrs?.polygonEdited !== void 0) {
|
|
29156
|
+
polygonNode.attributes = {
|
|
29157
|
+
...polygonNode.attributes || {},
|
|
29158
|
+
edited: String(attrs.wrap.attrs.polygonEdited)
|
|
29159
|
+
};
|
|
29160
|
+
}
|
|
29161
|
+
wrapElement.elements = [polygonNode];
|
|
29162
|
+
}
|
|
29163
|
+
}
|
|
29164
|
+
break;
|
|
29165
|
+
}
|
|
29166
|
+
case "None":
|
|
29167
|
+
inlineAttrs.behindDoc = attrs.wrap.attrs?.behindDoc ? "1" : "0";
|
|
29168
|
+
break;
|
|
29169
|
+
}
|
|
28968
29170
|
const effectIndex = nodeElements.elements.findIndex((el) => el.name === "wp:effectExtent");
|
|
28969
29171
|
const elementsWithWrap = [
|
|
28970
29172
|
...nodeElements.elements.slice(0, effectIndex + 1),
|
|
28971
|
-
|
|
29173
|
+
wrapElement,
|
|
28972
29174
|
...nodeElements.elements.slice(effectIndex + 1)
|
|
28973
29175
|
];
|
|
28974
29176
|
return {
|
|
@@ -28977,32 +29179,32 @@ function translateAnchorNode(params2) {
|
|
|
28977
29179
|
elements: [...anchorElements, ...elementsWithWrap]
|
|
28978
29180
|
};
|
|
28979
29181
|
}
|
|
28980
|
-
const XML_NODE_NAME$
|
|
29182
|
+
const XML_NODE_NAME$c = "wp:anchor";
|
|
28981
29183
|
const SD_NODE_NAME$a = ["image"];
|
|
28982
|
-
const validXmlAttributes$
|
|
28983
|
-
function encode$
|
|
29184
|
+
const validXmlAttributes$9 = ["distT", "distB", "distL", "distR"].map((xmlName) => createAttributeHandler(xmlName));
|
|
29185
|
+
function encode$i(params2) {
|
|
28984
29186
|
const { node } = params2.extraParams;
|
|
28985
29187
|
if (!node || !node.type) {
|
|
28986
29188
|
return null;
|
|
28987
29189
|
}
|
|
28988
29190
|
return handleAnchorNode(params2);
|
|
28989
29191
|
}
|
|
28990
|
-
function decode$
|
|
29192
|
+
function decode$k(params2) {
|
|
28991
29193
|
const { node } = params2;
|
|
28992
29194
|
if (!node || !node.type) {
|
|
28993
29195
|
return null;
|
|
28994
29196
|
}
|
|
28995
29197
|
return translateAnchorNode(params2);
|
|
28996
29198
|
}
|
|
28997
|
-
const config$
|
|
28998
|
-
xmlName: XML_NODE_NAME$
|
|
29199
|
+
const config$b = {
|
|
29200
|
+
xmlName: XML_NODE_NAME$c,
|
|
28999
29201
|
sdNodeOrKeyName: SD_NODE_NAME$a,
|
|
29000
29202
|
type: NodeTranslator.translatorTypes.NODE,
|
|
29001
|
-
encode: encode$
|
|
29002
|
-
decode: decode$
|
|
29003
|
-
attributes: validXmlAttributes$
|
|
29203
|
+
encode: encode$i,
|
|
29204
|
+
decode: decode$k,
|
|
29205
|
+
attributes: validXmlAttributes$9
|
|
29004
29206
|
};
|
|
29005
|
-
const translator$
|
|
29207
|
+
const translator$b = NodeTranslator.from(config$b);
|
|
29006
29208
|
function handleInlineNode(params2) {
|
|
29007
29209
|
const { node } = params2.extraParams;
|
|
29008
29210
|
if (node.name !== "wp:inline") {
|
|
@@ -29018,41 +29220,41 @@ function translateInlineNode(params2) {
|
|
|
29018
29220
|
elements: nodeElements.elements
|
|
29019
29221
|
};
|
|
29020
29222
|
}
|
|
29021
|
-
const XML_NODE_NAME$
|
|
29223
|
+
const XML_NODE_NAME$b = "wp:inline";
|
|
29022
29224
|
const SD_NODE_NAME$9 = ["image"];
|
|
29023
|
-
const validXmlAttributes$
|
|
29024
|
-
function encode$
|
|
29225
|
+
const validXmlAttributes$8 = ["distT", "distB", "distL", "distR"].map((xmlName) => createAttributeHandler(xmlName));
|
|
29226
|
+
function encode$h(params2) {
|
|
29025
29227
|
const { node } = params2.extraParams;
|
|
29026
29228
|
if (!node || !node.type) {
|
|
29027
29229
|
return null;
|
|
29028
29230
|
}
|
|
29029
29231
|
return handleInlineNode(params2);
|
|
29030
29232
|
}
|
|
29031
|
-
function decode$
|
|
29233
|
+
function decode$j(params2) {
|
|
29032
29234
|
const { node } = params2;
|
|
29033
29235
|
if (!node || !node.type) {
|
|
29034
29236
|
return null;
|
|
29035
29237
|
}
|
|
29036
29238
|
return translateInlineNode(params2);
|
|
29037
29239
|
}
|
|
29038
|
-
const config$
|
|
29039
|
-
xmlName: XML_NODE_NAME$
|
|
29240
|
+
const config$a = {
|
|
29241
|
+
xmlName: XML_NODE_NAME$b,
|
|
29040
29242
|
sdNodeOrKeyName: SD_NODE_NAME$9,
|
|
29041
29243
|
type: NodeTranslator.translatorTypes.NODE,
|
|
29042
|
-
encode: encode$
|
|
29043
|
-
decode: decode$
|
|
29044
|
-
attributes: validXmlAttributes$
|
|
29244
|
+
encode: encode$h,
|
|
29245
|
+
decode: decode$j,
|
|
29246
|
+
attributes: validXmlAttributes$8
|
|
29045
29247
|
};
|
|
29046
|
-
const translator$
|
|
29047
|
-
const XML_NODE_NAME$
|
|
29248
|
+
const translator$a = NodeTranslator.from(config$a);
|
|
29249
|
+
const XML_NODE_NAME$a = "w:drawing";
|
|
29048
29250
|
const SD_NODE_NAME$8 = [];
|
|
29049
|
-
const validXmlAttributes$
|
|
29050
|
-
function encode$
|
|
29251
|
+
const validXmlAttributes$7 = [];
|
|
29252
|
+
function encode$g(params2) {
|
|
29051
29253
|
const nodes = params2.nodes;
|
|
29052
29254
|
const node = nodes[0];
|
|
29053
29255
|
const translatorByChildName = {
|
|
29054
|
-
"wp:anchor": translator$
|
|
29055
|
-
"wp:inline": translator$
|
|
29256
|
+
"wp:anchor": translator$b,
|
|
29257
|
+
"wp:inline": translator$a
|
|
29056
29258
|
};
|
|
29057
29259
|
return node.elements.reduce((acc, child) => {
|
|
29058
29260
|
if (acc) return acc;
|
|
@@ -29061,12 +29263,12 @@ function encode$e(params2) {
|
|
|
29061
29263
|
return translator2.encode({ ...params2, extraParams: { node: child } }) || acc;
|
|
29062
29264
|
}, null);
|
|
29063
29265
|
}
|
|
29064
|
-
function decode$
|
|
29266
|
+
function decode$i(params2) {
|
|
29065
29267
|
const { node } = params2;
|
|
29066
29268
|
if (!node || !node.type) {
|
|
29067
29269
|
return null;
|
|
29068
29270
|
}
|
|
29069
|
-
const childTranslator = node.attrs.isAnchor ? translator$
|
|
29271
|
+
const childTranslator = node.attrs.isAnchor ? translator$b : translator$a;
|
|
29070
29272
|
const resultNode = childTranslator.decode(params2);
|
|
29071
29273
|
return wrapTextInRun(
|
|
29072
29274
|
{
|
|
@@ -29076,15 +29278,15 @@ function decode$g(params2) {
|
|
|
29076
29278
|
[]
|
|
29077
29279
|
);
|
|
29078
29280
|
}
|
|
29079
|
-
const config$
|
|
29080
|
-
xmlName: XML_NODE_NAME$
|
|
29281
|
+
const config$9 = {
|
|
29282
|
+
xmlName: XML_NODE_NAME$a,
|
|
29081
29283
|
sdNodeOrKeyName: SD_NODE_NAME$8,
|
|
29082
29284
|
type: NodeTranslator.translatorTypes.NODE,
|
|
29083
|
-
encode: encode$
|
|
29084
|
-
decode: decode$
|
|
29085
|
-
attributes: validXmlAttributes$
|
|
29285
|
+
encode: encode$g,
|
|
29286
|
+
decode: decode$i,
|
|
29287
|
+
attributes: validXmlAttributes$7
|
|
29086
29288
|
};
|
|
29087
|
-
const translator$
|
|
29289
|
+
const translator$9 = NodeTranslator.from(config$9);
|
|
29088
29290
|
class CommandService {
|
|
29089
29291
|
/**
|
|
29090
29292
|
* @param {import('./commands/types/index.js').CommandServiceOptions} props
|
|
@@ -30432,7 +30634,7 @@ function prepareTextAnnotation(params2) {
|
|
|
30432
30634
|
return getTextNodeForExport(attrs.displayLabel, [...marks, ...marksFromAttrs], params2);
|
|
30433
30635
|
}
|
|
30434
30636
|
function prepareImageAnnotation(params2, imageSize) {
|
|
30435
|
-
return translator$
|
|
30637
|
+
return translator$9.decode({
|
|
30436
30638
|
...params2,
|
|
30437
30639
|
imageSize
|
|
30438
30640
|
});
|
|
@@ -30747,10 +30949,10 @@ function generateSdtPrTagForStructuredContent({ node }) {
|
|
|
30747
30949
|
};
|
|
30748
30950
|
return result;
|
|
30749
30951
|
}
|
|
30750
|
-
const XML_NODE_NAME$
|
|
30952
|
+
const XML_NODE_NAME$9 = "w:sdt";
|
|
30751
30953
|
const SD_NODE_NAME$7 = ["fieldAnnotation", "structuredContent", "structuredContentBlock", "documentSection"];
|
|
30752
|
-
const validXmlAttributes$
|
|
30753
|
-
function encode$
|
|
30954
|
+
const validXmlAttributes$6 = [];
|
|
30955
|
+
function encode$f(params2) {
|
|
30754
30956
|
const nodes = params2.nodes;
|
|
30755
30957
|
const node = nodes[0];
|
|
30756
30958
|
const { type: sdtType, handler: handler2 } = sdtNodeTypeStrategy(node);
|
|
@@ -30760,7 +30962,7 @@ function encode$d(params2) {
|
|
|
30760
30962
|
const result = handler2(params2);
|
|
30761
30963
|
return result;
|
|
30762
30964
|
}
|
|
30763
|
-
function decode$
|
|
30965
|
+
function decode$h(params2) {
|
|
30764
30966
|
const { node } = params2;
|
|
30765
30967
|
if (!node || !node.type) {
|
|
30766
30968
|
return null;
|
|
@@ -30778,85 +30980,85 @@ function decode$f(params2) {
|
|
|
30778
30980
|
const result = decoder();
|
|
30779
30981
|
return result;
|
|
30780
30982
|
}
|
|
30781
|
-
const config$
|
|
30782
|
-
xmlName: XML_NODE_NAME$
|
|
30983
|
+
const config$8 = {
|
|
30984
|
+
xmlName: XML_NODE_NAME$9,
|
|
30783
30985
|
sdNodeOrKeyName: SD_NODE_NAME$7,
|
|
30784
30986
|
type: NodeTranslator.translatorTypes.NODE,
|
|
30785
|
-
encode: encode$
|
|
30786
|
-
decode: decode$
|
|
30787
|
-
attributes: validXmlAttributes$
|
|
30987
|
+
encode: encode$f,
|
|
30988
|
+
decode: decode$h,
|
|
30989
|
+
attributes: validXmlAttributes$6
|
|
30788
30990
|
};
|
|
30789
|
-
const translator$
|
|
30790
|
-
const encode$
|
|
30991
|
+
const translator$8 = NodeTranslator.from(config$8);
|
|
30992
|
+
const encode$e = (attributes) => {
|
|
30791
30993
|
return attributes["w:id"];
|
|
30792
30994
|
};
|
|
30793
|
-
const decode$
|
|
30995
|
+
const decode$g = (attrs) => {
|
|
30794
30996
|
return attrs.id;
|
|
30795
30997
|
};
|
|
30796
30998
|
const attrConfig$7 = Object.freeze({
|
|
30797
30999
|
xmlName: "w:id",
|
|
30798
31000
|
sdName: "id",
|
|
30799
|
-
encode: encode$
|
|
30800
|
-
decode: decode$
|
|
31001
|
+
encode: encode$e,
|
|
31002
|
+
decode: decode$g
|
|
30801
31003
|
});
|
|
30802
|
-
const encode$
|
|
31004
|
+
const encode$d = (attributes) => {
|
|
30803
31005
|
return attributes["w:name"];
|
|
30804
31006
|
};
|
|
30805
|
-
const decode$
|
|
31007
|
+
const decode$f = (attrs) => {
|
|
30806
31008
|
return attrs.name;
|
|
30807
31009
|
};
|
|
30808
31010
|
const attrConfig$6 = Object.freeze({
|
|
30809
31011
|
xmlName: "w:name",
|
|
30810
31012
|
sdName: "name",
|
|
30811
|
-
encode: encode$
|
|
30812
|
-
decode: decode$
|
|
31013
|
+
encode: encode$d,
|
|
31014
|
+
decode: decode$f
|
|
30813
31015
|
});
|
|
30814
|
-
const encode$
|
|
31016
|
+
const encode$c = (attributes) => {
|
|
30815
31017
|
return attributes["w:colFirst"];
|
|
30816
31018
|
};
|
|
30817
|
-
const decode$
|
|
31019
|
+
const decode$e = (attrs) => {
|
|
30818
31020
|
return attrs.colFirst;
|
|
30819
31021
|
};
|
|
30820
31022
|
const attrConfig$5 = Object.freeze({
|
|
30821
31023
|
xmlName: "w:colFirst",
|
|
30822
31024
|
sdName: "colFirst",
|
|
30823
|
-
encode: encode$
|
|
30824
|
-
decode: decode$
|
|
31025
|
+
encode: encode$c,
|
|
31026
|
+
decode: decode$e
|
|
30825
31027
|
});
|
|
30826
|
-
const encode$
|
|
31028
|
+
const encode$b = (attributes) => {
|
|
30827
31029
|
return attributes["w:colLast"];
|
|
30828
31030
|
};
|
|
30829
|
-
const decode$
|
|
31031
|
+
const decode$d = (attrs) => {
|
|
30830
31032
|
return attrs.colLast;
|
|
30831
31033
|
};
|
|
30832
31034
|
const attrConfig$4 = Object.freeze({
|
|
30833
31035
|
xmlName: "w:colLast",
|
|
30834
31036
|
sdName: "colLast",
|
|
30835
|
-
encode: encode$
|
|
30836
|
-
decode: decode$
|
|
31037
|
+
encode: encode$b,
|
|
31038
|
+
decode: decode$d
|
|
30837
31039
|
});
|
|
30838
|
-
const encode$
|
|
31040
|
+
const encode$a = (attributes) => {
|
|
30839
31041
|
return attributes["w:displacedByCustomXml"];
|
|
30840
31042
|
};
|
|
30841
|
-
const decode$
|
|
31043
|
+
const decode$c = (attrs) => {
|
|
30842
31044
|
return attrs.displacedByCustomXml;
|
|
30843
31045
|
};
|
|
30844
31046
|
const attrConfig$3 = Object.freeze({
|
|
30845
31047
|
xmlName: "w:displacedByCustomXml",
|
|
30846
31048
|
sdName: "displacedByCustomXml",
|
|
30847
|
-
encode: encode$
|
|
30848
|
-
decode: decode$
|
|
31049
|
+
encode: encode$a,
|
|
31050
|
+
decode: decode$c
|
|
30849
31051
|
});
|
|
30850
|
-
const validXmlAttributes$
|
|
30851
|
-
const XML_NODE_NAME$
|
|
31052
|
+
const validXmlAttributes$5 = [attrConfig$7, attrConfig$6, attrConfig$5, attrConfig$4, attrConfig$3];
|
|
31053
|
+
const XML_NODE_NAME$8 = "w:bookmarkStart";
|
|
30852
31054
|
const SD_NODE_NAME$6 = "bookmarkStart";
|
|
30853
|
-
const encode$
|
|
31055
|
+
const encode$9 = (params2, encodedAttrs = {}) => {
|
|
30854
31056
|
return {
|
|
30855
31057
|
type: "bookmarkStart",
|
|
30856
31058
|
attrs: encodedAttrs
|
|
30857
31059
|
};
|
|
30858
31060
|
};
|
|
30859
|
-
const decode$
|
|
31061
|
+
const decode$b = (params2, decodedAttrs = {}) => {
|
|
30860
31062
|
const result = {
|
|
30861
31063
|
name: "w:bookmarkStart",
|
|
30862
31064
|
elements: []
|
|
@@ -30866,49 +31068,49 @@ const decode$9 = (params2, decodedAttrs = {}) => {
|
|
|
30866
31068
|
}
|
|
30867
31069
|
return result;
|
|
30868
31070
|
};
|
|
30869
|
-
const config$
|
|
30870
|
-
xmlName: XML_NODE_NAME$
|
|
31071
|
+
const config$7 = {
|
|
31072
|
+
xmlName: XML_NODE_NAME$8,
|
|
30871
31073
|
sdNodeOrKeyName: SD_NODE_NAME$6,
|
|
30872
31074
|
type: NodeTranslator.translatorTypes.NODE,
|
|
30873
|
-
encode: encode$
|
|
30874
|
-
decode: decode$
|
|
30875
|
-
attributes: validXmlAttributes$
|
|
31075
|
+
encode: encode$9,
|
|
31076
|
+
decode: decode$b,
|
|
31077
|
+
attributes: validXmlAttributes$5
|
|
30876
31078
|
};
|
|
30877
|
-
const translator$
|
|
30878
|
-
const encode$
|
|
31079
|
+
const translator$7 = NodeTranslator.from(config$7);
|
|
31080
|
+
const encode$8 = (attributes) => {
|
|
30879
31081
|
return attributes["w:id"];
|
|
30880
31082
|
};
|
|
30881
|
-
const decode$
|
|
31083
|
+
const decode$a = (attrs) => {
|
|
30882
31084
|
return attrs.id;
|
|
30883
31085
|
};
|
|
30884
31086
|
const attrConfig$2 = Object.freeze({
|
|
30885
31087
|
xmlName: "w:id",
|
|
30886
31088
|
sdName: "id",
|
|
30887
|
-
encode: encode$
|
|
30888
|
-
decode: decode$
|
|
31089
|
+
encode: encode$8,
|
|
31090
|
+
decode: decode$a
|
|
30889
31091
|
});
|
|
30890
|
-
const encode$
|
|
31092
|
+
const encode$7 = (attributes) => {
|
|
30891
31093
|
return attributes["w:displacedByCustomXml"];
|
|
30892
31094
|
};
|
|
30893
|
-
const decode$
|
|
31095
|
+
const decode$9 = (attrs) => {
|
|
30894
31096
|
return attrs.displacedByCustomXml;
|
|
30895
31097
|
};
|
|
30896
31098
|
const attrConfig$1 = Object.freeze({
|
|
30897
31099
|
xmlName: "w:displacedByCustomXml",
|
|
30898
31100
|
sdName: "displacedByCustomXml",
|
|
30899
|
-
encode: encode$
|
|
30900
|
-
decode: decode$
|
|
31101
|
+
encode: encode$7,
|
|
31102
|
+
decode: decode$9
|
|
30901
31103
|
});
|
|
30902
|
-
const validXmlAttributes$
|
|
30903
|
-
const XML_NODE_NAME$
|
|
31104
|
+
const validXmlAttributes$4 = [attrConfig$2, attrConfig$1];
|
|
31105
|
+
const XML_NODE_NAME$7 = "w:bookmarkEnd";
|
|
30904
31106
|
const SD_NODE_NAME$5 = "bookmarkEnd";
|
|
30905
|
-
const encode$
|
|
31107
|
+
const encode$6 = (params2, encodedAttrs = {}) => {
|
|
30906
31108
|
return {
|
|
30907
31109
|
type: "bookmarkEnd",
|
|
30908
31110
|
attrs: encodedAttrs
|
|
30909
31111
|
};
|
|
30910
31112
|
};
|
|
30911
|
-
const decode$
|
|
31113
|
+
const decode$8 = (params2, decodedAttrs = {}) => {
|
|
30912
31114
|
const result = {
|
|
30913
31115
|
name: "w:bookmarkEnd",
|
|
30914
31116
|
elements: []
|
|
@@ -30918,27 +31120,27 @@ const decode$6 = (params2, decodedAttrs = {}) => {
|
|
|
30918
31120
|
}
|
|
30919
31121
|
return result;
|
|
30920
31122
|
};
|
|
30921
|
-
const config$
|
|
30922
|
-
xmlName: XML_NODE_NAME$
|
|
31123
|
+
const config$6 = {
|
|
31124
|
+
xmlName: XML_NODE_NAME$7,
|
|
30923
31125
|
sdNodeOrKeyName: SD_NODE_NAME$5,
|
|
30924
31126
|
type: NodeTranslator.translatorTypes.NODE,
|
|
30925
|
-
encode: encode$
|
|
30926
|
-
decode: decode$
|
|
30927
|
-
attributes: validXmlAttributes$
|
|
31127
|
+
encode: encode$6,
|
|
31128
|
+
decode: decode$8,
|
|
31129
|
+
attributes: validXmlAttributes$4
|
|
30928
31130
|
};
|
|
30929
|
-
const translator$
|
|
30930
|
-
const decode$
|
|
31131
|
+
const translator$6 = NodeTranslator.from(config$6);
|
|
31132
|
+
const decode$7 = (attrs) => attrs?.["w:id"];
|
|
30931
31133
|
const attrConfig = Object.freeze({
|
|
30932
31134
|
xmlName: "w:id",
|
|
30933
31135
|
sdName: "w:id",
|
|
30934
31136
|
// We do not translate it from 'w:id' to 'id' when encoding, so the name is the same
|
|
30935
31137
|
encode: () => {
|
|
30936
31138
|
},
|
|
30937
|
-
decode: decode$
|
|
31139
|
+
decode: decode$7
|
|
30938
31140
|
});
|
|
30939
|
-
const XML_NODE_NAME$
|
|
31141
|
+
const XML_NODE_NAME$6 = "w:commentRange";
|
|
30940
31142
|
const SD_NODE_NAME$4 = "commentRange";
|
|
30941
|
-
const decode$
|
|
31143
|
+
const decode$6 = (params2) => {
|
|
30942
31144
|
const { node, comments, commentsExportType, exportedCommentDefs } = params2;
|
|
30943
31145
|
if (!node) return;
|
|
30944
31146
|
if (!comments) return;
|
|
@@ -30981,19 +31183,19 @@ const getCommentSchema = (type2, commentIndex) => {
|
|
|
30981
31183
|
};
|
|
30982
31184
|
};
|
|
30983
31185
|
const getConfig = (type2) => ({
|
|
30984
|
-
xmlName: `${XML_NODE_NAME$
|
|
31186
|
+
xmlName: `${XML_NODE_NAME$6}${type2}`,
|
|
30985
31187
|
sdNodeOrKeyName: `${SD_NODE_NAME$4}${type2}`,
|
|
30986
31188
|
type: NodeTranslator.translatorTypes.NODE,
|
|
30987
31189
|
encode: () => {
|
|
30988
31190
|
},
|
|
30989
|
-
decode: decode$
|
|
31191
|
+
decode: decode$6,
|
|
30990
31192
|
attributes: [attrConfig]
|
|
30991
31193
|
});
|
|
30992
31194
|
const commentRangeStartTranslator = NodeTranslator.from(getConfig("Start"));
|
|
30993
31195
|
const commentRangeEndTranslator = NodeTranslator.from(getConfig("End"));
|
|
30994
|
-
const XML_NODE_NAME$
|
|
31196
|
+
const XML_NODE_NAME$5 = "sd:pageReference";
|
|
30995
31197
|
const SD_NODE_NAME$3 = "pageReference";
|
|
30996
|
-
const encode$
|
|
31198
|
+
const encode$5 = (params2) => {
|
|
30997
31199
|
const { nodes = [], nodeListHandler } = params2 || {};
|
|
30998
31200
|
const node = nodes[0];
|
|
30999
31201
|
const processedText = nodeListHandler.handler({
|
|
@@ -31010,7 +31212,7 @@ const encode$3 = (params2) => {
|
|
|
31010
31212
|
};
|
|
31011
31213
|
return processedNode;
|
|
31012
31214
|
};
|
|
31013
|
-
const decode$
|
|
31215
|
+
const decode$5 = (params2) => {
|
|
31014
31216
|
const { node } = params2;
|
|
31015
31217
|
const outputMarks = processOutputMarks(node.attrs?.marksAsAttrs || []);
|
|
31016
31218
|
const contentNodes = (node.content ?? []).flatMap((n) => exportSchemaToJson({ ...params2, node: n }));
|
|
@@ -31083,17 +31285,17 @@ const decode$3 = (params2) => {
|
|
|
31083
31285
|
];
|
|
31084
31286
|
return translated;
|
|
31085
31287
|
};
|
|
31086
|
-
const config$
|
|
31087
|
-
xmlName: XML_NODE_NAME$
|
|
31288
|
+
const config$5 = {
|
|
31289
|
+
xmlName: XML_NODE_NAME$5,
|
|
31088
31290
|
sdNodeOrKeyName: SD_NODE_NAME$3,
|
|
31089
31291
|
type: NodeTranslator.translatorTypes.NODE,
|
|
31090
|
-
encode: encode$
|
|
31091
|
-
decode: decode$
|
|
31292
|
+
encode: encode$5,
|
|
31293
|
+
decode: decode$5
|
|
31092
31294
|
};
|
|
31093
|
-
const translator$
|
|
31094
|
-
const XML_NODE_NAME$
|
|
31295
|
+
const translator$5 = NodeTranslator.from(config$5);
|
|
31296
|
+
const XML_NODE_NAME$4 = "sd:tableOfContents";
|
|
31095
31297
|
const SD_NODE_NAME$2 = "tableOfContents";
|
|
31096
|
-
const encode$
|
|
31298
|
+
const encode$4 = (params2) => {
|
|
31097
31299
|
const { nodes = [], nodeListHandler } = params2 || {};
|
|
31098
31300
|
const node = nodes[0];
|
|
31099
31301
|
const processedContent = nodeListHandler.handler({
|
|
@@ -31109,7 +31311,7 @@ const encode$2 = (params2) => {
|
|
|
31109
31311
|
};
|
|
31110
31312
|
return processedNode;
|
|
31111
31313
|
};
|
|
31112
|
-
const decode$
|
|
31314
|
+
const decode$4 = (params2) => {
|
|
31113
31315
|
const { node } = params2;
|
|
31114
31316
|
const contentNodes = node.content.map((n) => exportSchemaToJson({ ...params2, node: n }));
|
|
31115
31317
|
const tocBeginElements = [
|
|
@@ -31156,14 +31358,14 @@ const decode$2 = (params2) => {
|
|
|
31156
31358
|
}
|
|
31157
31359
|
return contentNodes;
|
|
31158
31360
|
};
|
|
31159
|
-
const config$
|
|
31160
|
-
xmlName: XML_NODE_NAME$
|
|
31361
|
+
const config$4 = {
|
|
31362
|
+
xmlName: XML_NODE_NAME$4,
|
|
31161
31363
|
sdNodeOrKeyName: SD_NODE_NAME$2,
|
|
31162
31364
|
type: NodeTranslator.translatorTypes.NODE,
|
|
31163
|
-
encode: encode$
|
|
31164
|
-
decode: decode$
|
|
31365
|
+
encode: encode$4,
|
|
31366
|
+
decode: decode$4
|
|
31165
31367
|
};
|
|
31166
|
-
const translator$
|
|
31368
|
+
const translator$4 = NodeTranslator.from(config$4);
|
|
31167
31369
|
function parseInlineStyles(styleString) {
|
|
31168
31370
|
if (!styleString) return {};
|
|
31169
31371
|
return styleString.split(";").filter((style2) => !!style2.trim()).reduce((acc, style2) => {
|
|
@@ -31297,7 +31499,7 @@ const handleDrawingNode = (params2) => {
|
|
|
31297
31499
|
if (mainNode.name === "w:drawing") node = mainNode;
|
|
31298
31500
|
else node = mainNode.elements.find((el) => el.name === "w:drawing");
|
|
31299
31501
|
if (!node) return { nodes: [], consumed: 0 };
|
|
31300
|
-
const schemaNode = translator$
|
|
31502
|
+
const schemaNode = translator$9.encode(params2);
|
|
31301
31503
|
const newNodes = schemaNode ? [schemaNode] : [];
|
|
31302
31504
|
return { nodes: newNodes, consumed: 1 };
|
|
31303
31505
|
};
|
|
@@ -31305,6 +31507,203 @@ const drawingNodeHandlerEntity = {
|
|
|
31305
31507
|
handlerName: "drawingNodeHandler",
|
|
31306
31508
|
handler: handleDrawingNode
|
|
31307
31509
|
};
|
|
31510
|
+
const createTrackStyleMark = (marks) => {
|
|
31511
|
+
const trackStyleMark = marks.find((mark) => mark.type === "trackFormat");
|
|
31512
|
+
if (trackStyleMark) {
|
|
31513
|
+
return {
|
|
31514
|
+
type: "element",
|
|
31515
|
+
name: "w:rPrChange",
|
|
31516
|
+
attributes: {
|
|
31517
|
+
"w:id": trackStyleMark.attrs.id,
|
|
31518
|
+
"w:author": trackStyleMark.attrs.author,
|
|
31519
|
+
"w:authorEmail": trackStyleMark.attrs.authorEmail,
|
|
31520
|
+
"w:date": trackStyleMark.attrs.date
|
|
31521
|
+
},
|
|
31522
|
+
elements: trackStyleMark.attrs.before.map((mark) => processOutputMarks([mark])).filter((r2) => r2 !== void 0)
|
|
31523
|
+
};
|
|
31524
|
+
}
|
|
31525
|
+
return void 0;
|
|
31526
|
+
};
|
|
31527
|
+
const XML_NODE_NAME$3 = "w:del";
|
|
31528
|
+
const SD_ATTR_KEY$1 = "trackDelete";
|
|
31529
|
+
const validXmlAttributes$3 = [
|
|
31530
|
+
createAttributeHandler("w:id", "id"),
|
|
31531
|
+
createAttributeHandler("w:date", "date"),
|
|
31532
|
+
createAttributeHandler("w:author", "author"),
|
|
31533
|
+
createAttributeHandler("w:authorEmail", "authorEmail")
|
|
31534
|
+
];
|
|
31535
|
+
const encode$3 = (params2, encodedAttrs = {}) => {
|
|
31536
|
+
const { nodeListHandler, extraParams = {} } = params2;
|
|
31537
|
+
const { node } = extraParams;
|
|
31538
|
+
const subs = nodeListHandler.handler({
|
|
31539
|
+
...params2,
|
|
31540
|
+
insideTrackChange: true,
|
|
31541
|
+
nodes: node.elements,
|
|
31542
|
+
path: [...params2.path || [], node]
|
|
31543
|
+
});
|
|
31544
|
+
encodedAttrs.importedAuthor = `${encodedAttrs.author} (imported)`;
|
|
31545
|
+
subs.forEach((subElement) => {
|
|
31546
|
+
if (subElement.marks === void 0) subElement.marks = [];
|
|
31547
|
+
subElement.marks.push({ type: "trackDelete", attrs: encodedAttrs });
|
|
31548
|
+
});
|
|
31549
|
+
return subs;
|
|
31550
|
+
};
|
|
31551
|
+
function decode$3(params2) {
|
|
31552
|
+
const { node } = params2;
|
|
31553
|
+
if (!node || !node.type) {
|
|
31554
|
+
return null;
|
|
31555
|
+
}
|
|
31556
|
+
const trackingMarks = ["trackInsert", "trackFormat", "trackDelete"];
|
|
31557
|
+
const marks = node.marks;
|
|
31558
|
+
const trackedMark = marks.find((m2) => m2.type === "trackDelete");
|
|
31559
|
+
const trackStyleMark = createTrackStyleMark(marks);
|
|
31560
|
+
node.marks = marks.filter((m2) => !trackingMarks.includes(m2.type));
|
|
31561
|
+
if (trackStyleMark) {
|
|
31562
|
+
node.marks.push(trackStyleMark);
|
|
31563
|
+
}
|
|
31564
|
+
const translatedTextNode = exportSchemaToJson({ ...params2, node });
|
|
31565
|
+
const textNode = translatedTextNode.elements.find((n) => n.name === "w:t");
|
|
31566
|
+
textNode.name = "w:delText";
|
|
31567
|
+
return {
|
|
31568
|
+
name: "w:del",
|
|
31569
|
+
attributes: {
|
|
31570
|
+
"w:id": trackedMark.attrs.id,
|
|
31571
|
+
"w:author": trackedMark.attrs.author,
|
|
31572
|
+
"w:authorEmail": trackedMark.attrs.authorEmail,
|
|
31573
|
+
"w:date": trackedMark.attrs.date
|
|
31574
|
+
},
|
|
31575
|
+
elements: [translatedTextNode]
|
|
31576
|
+
};
|
|
31577
|
+
}
|
|
31578
|
+
const config$3 = {
|
|
31579
|
+
xmlName: XML_NODE_NAME$3,
|
|
31580
|
+
sdNodeOrKeyName: SD_ATTR_KEY$1,
|
|
31581
|
+
type: NodeTranslator.translatorTypes.ATTRIBUTE,
|
|
31582
|
+
encode: encode$3,
|
|
31583
|
+
decode: decode$3,
|
|
31584
|
+
attributes: validXmlAttributes$3
|
|
31585
|
+
};
|
|
31586
|
+
const translator$3 = NodeTranslator.from(config$3);
|
|
31587
|
+
const XML_NODE_NAME$2 = "w:ins";
|
|
31588
|
+
const SD_ATTR_KEY = "trackInsert";
|
|
31589
|
+
const validXmlAttributes$2 = [
|
|
31590
|
+
createAttributeHandler("w:id", "id"),
|
|
31591
|
+
createAttributeHandler("w:date", "date"),
|
|
31592
|
+
createAttributeHandler("w:author", "author"),
|
|
31593
|
+
createAttributeHandler("w:authorEmail", "authorEmail")
|
|
31594
|
+
];
|
|
31595
|
+
const encode$2 = (params2, encodedAttrs = {}) => {
|
|
31596
|
+
const { nodeListHandler, extraParams = {} } = params2;
|
|
31597
|
+
const { node } = extraParams;
|
|
31598
|
+
const subs = nodeListHandler.handler({
|
|
31599
|
+
...params2,
|
|
31600
|
+
insideTrackChange: true,
|
|
31601
|
+
nodes: node.elements,
|
|
31602
|
+
path: [...params2.path || [], node]
|
|
31603
|
+
});
|
|
31604
|
+
encodedAttrs.importedAuthor = `${encodedAttrs.author} (imported)`;
|
|
31605
|
+
subs.forEach((subElement) => {
|
|
31606
|
+
if (subElement.marks === void 0) subElement.marks = [];
|
|
31607
|
+
subElement.marks.push({ type: "trackInsert", attrs: encodedAttrs });
|
|
31608
|
+
});
|
|
31609
|
+
return subs;
|
|
31610
|
+
};
|
|
31611
|
+
function decode$2(params2) {
|
|
31612
|
+
const { node } = params2;
|
|
31613
|
+
if (!node || !node.type) {
|
|
31614
|
+
return null;
|
|
31615
|
+
}
|
|
31616
|
+
const trackingMarks = ["trackInsert", "trackFormat", "trackDelete"];
|
|
31617
|
+
const marks = node.marks;
|
|
31618
|
+
const trackedMark = marks.find((m2) => m2.type === "trackInsert");
|
|
31619
|
+
const trackStyleMark = createTrackStyleMark(marks);
|
|
31620
|
+
node.marks = marks.filter((m2) => !trackingMarks.includes(m2.type));
|
|
31621
|
+
if (trackStyleMark) {
|
|
31622
|
+
node.marks.push(trackStyleMark);
|
|
31623
|
+
}
|
|
31624
|
+
const translatedTextNode = exportSchemaToJson({ ...params2, node });
|
|
31625
|
+
return {
|
|
31626
|
+
name: "w:ins",
|
|
31627
|
+
attributes: {
|
|
31628
|
+
"w:id": trackedMark.attrs.id,
|
|
31629
|
+
"w:author": trackedMark.attrs.author,
|
|
31630
|
+
"w:authorEmail": trackedMark.attrs.authorEmail,
|
|
31631
|
+
"w:date": trackedMark.attrs.date
|
|
31632
|
+
},
|
|
31633
|
+
elements: [translatedTextNode]
|
|
31634
|
+
};
|
|
31635
|
+
}
|
|
31636
|
+
const config$2 = {
|
|
31637
|
+
xmlName: XML_NODE_NAME$2,
|
|
31638
|
+
sdNodeOrKeyName: SD_ATTR_KEY,
|
|
31639
|
+
type: NodeTranslator.translatorTypes.ATTRIBUTE,
|
|
31640
|
+
encode: encode$2,
|
|
31641
|
+
decode: decode$2,
|
|
31642
|
+
attributes: validXmlAttributes$2
|
|
31643
|
+
};
|
|
31644
|
+
const translator$2 = NodeTranslator.from(config$2);
|
|
31645
|
+
const isTrackChangeElement = (node) => node?.name === "w:del" || node?.name === "w:ins";
|
|
31646
|
+
const unwrapTrackChangeNode = (node) => {
|
|
31647
|
+
if (!node) {
|
|
31648
|
+
return null;
|
|
31649
|
+
}
|
|
31650
|
+
if (isTrackChangeElement(node)) {
|
|
31651
|
+
return node;
|
|
31652
|
+
}
|
|
31653
|
+
if (node.name === "w:sdt") {
|
|
31654
|
+
const content = node.elements?.find((element) => element.name === "w:sdtContent");
|
|
31655
|
+
if (!content?.elements?.length) {
|
|
31656
|
+
return null;
|
|
31657
|
+
}
|
|
31658
|
+
for (const child of content.elements) {
|
|
31659
|
+
const trackChange = unwrapTrackChangeNode(child);
|
|
31660
|
+
if (trackChange) {
|
|
31661
|
+
return trackChange;
|
|
31662
|
+
}
|
|
31663
|
+
}
|
|
31664
|
+
}
|
|
31665
|
+
return null;
|
|
31666
|
+
};
|
|
31667
|
+
const handleTrackChangeNode = (params2) => {
|
|
31668
|
+
const { nodes } = params2;
|
|
31669
|
+
if (nodes.length === 0) {
|
|
31670
|
+
return { nodes: [], consumed: 0 };
|
|
31671
|
+
}
|
|
31672
|
+
const mainNode = unwrapTrackChangeNode(nodes[0]);
|
|
31673
|
+
if (!mainNode) {
|
|
31674
|
+
return { nodes: [], consumed: 0 };
|
|
31675
|
+
}
|
|
31676
|
+
let result;
|
|
31677
|
+
const translatorParams = {
|
|
31678
|
+
...params2,
|
|
31679
|
+
nodes: [mainNode]
|
|
31680
|
+
};
|
|
31681
|
+
switch (mainNode.name) {
|
|
31682
|
+
case "w:del":
|
|
31683
|
+
result = translator$3.encode({
|
|
31684
|
+
extraParams: {
|
|
31685
|
+
node: mainNode
|
|
31686
|
+
},
|
|
31687
|
+
...translatorParams
|
|
31688
|
+
});
|
|
31689
|
+
break;
|
|
31690
|
+
case "w:ins":
|
|
31691
|
+
result = translator$2.encode({
|
|
31692
|
+
extraParams: {
|
|
31693
|
+
node: mainNode
|
|
31694
|
+
},
|
|
31695
|
+
...translatorParams
|
|
31696
|
+
});
|
|
31697
|
+
break;
|
|
31698
|
+
}
|
|
31699
|
+
return { nodes: result, consumed: 1 };
|
|
31700
|
+
};
|
|
31701
|
+
const trackChangeNodeHandlerEntity = {
|
|
31702
|
+
handlerName: "trackChangeNodeHandler",
|
|
31703
|
+
handler: handleTrackChangeNode
|
|
31704
|
+
};
|
|
31705
|
+
const hyperlinkNodeHandlerEntity = generateV2HandlerEntity("hyperlinkNodeHandler", translator$Z);
|
|
31706
|
+
const runNodeHandlerEntity = generateV2HandlerEntity("runNodeHandler", translator$Y);
|
|
31308
31707
|
function parseProperties(node) {
|
|
31309
31708
|
const marks = [];
|
|
31310
31709
|
const unknownMarks = [];
|
|
@@ -31356,51 +31755,6 @@ function getElementName(element) {
|
|
|
31356
31755
|
const isPropertiesElement = (element) => {
|
|
31357
31756
|
return !!SuperConverter.propertyTypes[element.name || element.type];
|
|
31358
31757
|
};
|
|
31359
|
-
const handleTrackChangeNode = (params2) => {
|
|
31360
|
-
const { nodes, nodeListHandler } = params2;
|
|
31361
|
-
if (nodes.length === 0 || !(nodes[0].name === "w:del" || nodes[0].name === "w:ins" || nodes[0].name === "w:sdt")) {
|
|
31362
|
-
return { nodes: [], consumed: 0 };
|
|
31363
|
-
}
|
|
31364
|
-
const mainNode = nodes[0];
|
|
31365
|
-
let node;
|
|
31366
|
-
if (["w:ins", "w:del"].includes(mainNode.name)) {
|
|
31367
|
-
node = mainNode;
|
|
31368
|
-
} else {
|
|
31369
|
-
const sdtContent = mainNode.elements.find((el) => el.name === "w:sdtContent");
|
|
31370
|
-
const trackedChange = sdtContent?.elements.find((el) => ["w:ins", "w:del"].includes(el.name));
|
|
31371
|
-
if (trackedChange) node = trackedChange;
|
|
31372
|
-
}
|
|
31373
|
-
if (!node) {
|
|
31374
|
-
return { nodes: [], consumed: 0 };
|
|
31375
|
-
}
|
|
31376
|
-
const { name } = node;
|
|
31377
|
-
const { attributes, elements } = parseProperties(node);
|
|
31378
|
-
const subs = nodeListHandler.handler({
|
|
31379
|
-
...params2,
|
|
31380
|
-
insideTrackChange: true,
|
|
31381
|
-
nodes: elements,
|
|
31382
|
-
path: [...params2.path || [], node]
|
|
31383
|
-
});
|
|
31384
|
-
const changeType = name === "w:del" ? TrackDeleteMarkName : TrackInsertMarkName;
|
|
31385
|
-
const mappedAttributes = {
|
|
31386
|
-
id: attributes["w:id"],
|
|
31387
|
-
date: attributes["w:date"],
|
|
31388
|
-
author: attributes["w:author"],
|
|
31389
|
-
authorEmail: attributes["w:authorEmail"],
|
|
31390
|
-
importedAuthor: `${attributes["w:author"]} (imported)`
|
|
31391
|
-
};
|
|
31392
|
-
subs.forEach((subElement) => {
|
|
31393
|
-
if (subElement.marks === void 0) subElement.marks = [];
|
|
31394
|
-
subElement.marks.push({ type: changeType, attrs: mappedAttributes });
|
|
31395
|
-
});
|
|
31396
|
-
return { nodes: subs, consumed: 1 };
|
|
31397
|
-
};
|
|
31398
|
-
const trackChangeNodeHandlerEntity = {
|
|
31399
|
-
handlerName: "trackChangeNodeHandler",
|
|
31400
|
-
handler: handleTrackChangeNode
|
|
31401
|
-
};
|
|
31402
|
-
const hyperlinkNodeHandlerEntity = generateV2HandlerEntity("hyperlinkNodeHandler", translator$X);
|
|
31403
|
-
const runNodeHandlerEntity = generateV2HandlerEntity("runNodeHandler", translator$W);
|
|
31404
31758
|
const handleTextNode = (params2) => {
|
|
31405
31759
|
const { nodes, insideTrackChange } = params2;
|
|
31406
31760
|
if (nodes.length === 0 || !(nodes[0].name === "w:t" || insideTrackChange && nodes[0].name === "w:delText")) {
|
|
@@ -31441,7 +31795,7 @@ const handleParagraphNode = (params2) => {
|
|
|
31441
31795
|
if (nodes.length === 0 || nodes[0].name !== "w:p") {
|
|
31442
31796
|
return { nodes: [], consumed: 0 };
|
|
31443
31797
|
}
|
|
31444
|
-
const schemaNode = translator$
|
|
31798
|
+
const schemaNode = translator$19.encode(params2);
|
|
31445
31799
|
const newNodes = schemaNode ? [schemaNode] : [];
|
|
31446
31800
|
return { nodes: newNodes, consumed: 1 };
|
|
31447
31801
|
};
|
|
@@ -31454,7 +31808,7 @@ const handleSdtNode = (params2) => {
|
|
|
31454
31808
|
if (nodes.length === 0 || nodes[0].name !== "w:sdt") {
|
|
31455
31809
|
return { nodes: [], consumed: 0 };
|
|
31456
31810
|
}
|
|
31457
|
-
const result = translator$
|
|
31811
|
+
const result = translator$8.encode(params2);
|
|
31458
31812
|
if (!result) {
|
|
31459
31813
|
return { nodes: [], consumed: 0 };
|
|
31460
31814
|
}
|
|
@@ -31544,7 +31898,7 @@ const handler = (params2) => {
|
|
|
31544
31898
|
if (nodes.length === 0 || nodes[0].name !== "w:br") {
|
|
31545
31899
|
return { nodes: [], consumed: 0 };
|
|
31546
31900
|
}
|
|
31547
|
-
const result = translator$
|
|
31901
|
+
const result = translator$1c.encode(params2);
|
|
31548
31902
|
if (!result) return { nodes: [], consumed: 0 };
|
|
31549
31903
|
return {
|
|
31550
31904
|
nodes: [result],
|
|
@@ -31616,7 +31970,7 @@ const handleBookmarkStartNode = (params2) => {
|
|
|
31616
31970
|
if (isCustomMarkBookmark(nodes[0], params2.editor)) {
|
|
31617
31971
|
return handleBookmarkNode(params2);
|
|
31618
31972
|
}
|
|
31619
|
-
const node = translator$
|
|
31973
|
+
const node = translator$7.encode(params2);
|
|
31620
31974
|
if (!node) return { nodes: [], consumed: 0 };
|
|
31621
31975
|
return { nodes: [node], consumed: 1 };
|
|
31622
31976
|
};
|
|
@@ -31648,7 +32002,7 @@ const handleBookmarkEndNode = (params2) => {
|
|
|
31648
32002
|
if (!nodes.length || nodes[0].name !== "w:bookmarkEnd") {
|
|
31649
32003
|
return { nodes: [], consumed: 0 };
|
|
31650
32004
|
}
|
|
31651
|
-
const node = translator$
|
|
32005
|
+
const node = translator$6.encode(params2);
|
|
31652
32006
|
if (!node) return { nodes: [], consumed: 0 };
|
|
31653
32007
|
return { nodes: [node], consumed: 1 };
|
|
31654
32008
|
};
|
|
@@ -31781,7 +32135,7 @@ const autoTotalPageCountEntity = {
|
|
|
31781
32135
|
handlerName: "autoTotalPageCountEntity",
|
|
31782
32136
|
handler: handleAutoTotalPageNumber
|
|
31783
32137
|
};
|
|
31784
|
-
const pageReferenceEntity = generateV2HandlerEntity("pageReferenceNodeHandler", translator$
|
|
32138
|
+
const pageReferenceEntity = generateV2HandlerEntity("pageReferenceNodeHandler", translator$5);
|
|
31785
32139
|
const handlePictNode = (params2) => {
|
|
31786
32140
|
const { nodes } = params2;
|
|
31787
32141
|
if (!nodes.length || nodes[0].name !== "w:p") {
|
|
@@ -32170,14 +32524,14 @@ const handleTabNode = (params2) => {
|
|
|
32170
32524
|
if (!nodes.length || nodes[0].name !== "w:tab") {
|
|
32171
32525
|
return { nodes: [], consumed: 0 };
|
|
32172
32526
|
}
|
|
32173
|
-
const node = translator$
|
|
32527
|
+
const node = translator$1a.encode(params2);
|
|
32174
32528
|
return { nodes: [node], consumed: 1 };
|
|
32175
32529
|
};
|
|
32176
32530
|
const tabNodeEntityHandler = {
|
|
32177
32531
|
handlerName: "w:tabTranslator",
|
|
32178
32532
|
handler: handleTabNode
|
|
32179
32533
|
};
|
|
32180
|
-
const tableOfContentsHandlerEntity = generateV2HandlerEntity("tableOfContentsHandler", translator$
|
|
32534
|
+
const tableOfContentsHandlerEntity = generateV2HandlerEntity("tableOfContentsHandler", translator$4);
|
|
32181
32535
|
function preProcessPageInstruction(nodesToCombine) {
|
|
32182
32536
|
const pageNumNode = {
|
|
32183
32537
|
name: "sd:autoPageNumber",
|
|
@@ -33118,7 +33472,7 @@ function translateVRectContentBlock(params2) {
|
|
|
33118
33472
|
const XML_NODE_NAME = "w:pict";
|
|
33119
33473
|
const SD_NODE_NAME = ["shapeContainer", "contentBlock"];
|
|
33120
33474
|
const validXmlAttributes = [];
|
|
33121
|
-
function encode$
|
|
33475
|
+
function encode$1f(params2) {
|
|
33122
33476
|
const { node, pNode } = params2.extraParams;
|
|
33123
33477
|
const { type: pictType, handler: handler2 } = pictNodeTypeStrategy(node);
|
|
33124
33478
|
if (!handler2 || pictType === "unknown") {
|
|
@@ -33150,7 +33504,7 @@ const config = {
|
|
|
33150
33504
|
xmlName: XML_NODE_NAME,
|
|
33151
33505
|
sdNodeOrKeyName: SD_NODE_NAME,
|
|
33152
33506
|
type: NodeTranslator.translatorTypes.NODE,
|
|
33153
|
-
encode: encode$
|
|
33507
|
+
encode: encode$1f,
|
|
33154
33508
|
decode,
|
|
33155
33509
|
attributes: validXmlAttributes
|
|
33156
33510
|
};
|
|
@@ -33226,35 +33580,35 @@ function exportSchemaToJson(params2) {
|
|
|
33226
33580
|
doc: translateDocumentNode,
|
|
33227
33581
|
body: translateBodyNode,
|
|
33228
33582
|
heading: translateHeadingNode,
|
|
33229
|
-
paragraph: translator$
|
|
33230
|
-
run: translator$
|
|
33583
|
+
paragraph: translator$19,
|
|
33584
|
+
run: translator$Y,
|
|
33231
33585
|
text: translateTextNode,
|
|
33232
33586
|
bulletList: translateList,
|
|
33233
33587
|
orderedList: translateList,
|
|
33234
|
-
lineBreak: translator$
|
|
33235
|
-
table: translator$
|
|
33236
|
-
tableRow: translator$
|
|
33237
|
-
tableCell: translator$
|
|
33238
|
-
bookmarkStart: translator$
|
|
33239
|
-
bookmarkEnd: translator$
|
|
33240
|
-
fieldAnnotation: translator$
|
|
33241
|
-
tab: translator$
|
|
33242
|
-
image: translator$
|
|
33243
|
-
hardBreak: translator$
|
|
33588
|
+
lineBreak: translator$1c,
|
|
33589
|
+
table: translator$d,
|
|
33590
|
+
tableRow: translator$K,
|
|
33591
|
+
tableCell: translator$c,
|
|
33592
|
+
bookmarkStart: translator$7,
|
|
33593
|
+
bookmarkEnd: translator$6,
|
|
33594
|
+
fieldAnnotation: translator$8,
|
|
33595
|
+
tab: translator$1a,
|
|
33596
|
+
image: translator$9,
|
|
33597
|
+
hardBreak: translator$1c,
|
|
33244
33598
|
commentRangeStart: commentRangeStartTranslator,
|
|
33245
33599
|
commentRangeEnd: commentRangeEndTranslator,
|
|
33246
33600
|
commentReference: () => null,
|
|
33247
33601
|
shapeContainer: translator,
|
|
33248
33602
|
shapeTextbox: translator,
|
|
33249
33603
|
contentBlock: translator,
|
|
33250
|
-
structuredContent: translator$
|
|
33251
|
-
structuredContentBlock: translator$
|
|
33252
|
-
documentPartObject: translator$
|
|
33253
|
-
documentSection: translator$
|
|
33604
|
+
structuredContent: translator$8,
|
|
33605
|
+
structuredContentBlock: translator$8,
|
|
33606
|
+
documentPartObject: translator$8,
|
|
33607
|
+
documentSection: translator$8,
|
|
33254
33608
|
"page-number": translatePageNumberNode,
|
|
33255
33609
|
"total-page-number": translateTotalPageNumberNode,
|
|
33256
|
-
pageReference: translator$
|
|
33257
|
-
tableOfContents: translator$
|
|
33610
|
+
pageReference: translator$5,
|
|
33611
|
+
tableOfContents: translator$4
|
|
33258
33612
|
};
|
|
33259
33613
|
let handler2 = router[type2];
|
|
33260
33614
|
if (handler2 && "decode" in handler2 && typeof handler2.decode === "function") {
|
|
@@ -33588,59 +33942,23 @@ function getTextNodeForExport(text, marks, params2) {
|
|
|
33588
33942
|
return wrapTextInRun(textNodes, outputMarks);
|
|
33589
33943
|
}
|
|
33590
33944
|
function translateTextNode(params2) {
|
|
33591
|
-
const { node } = params2;
|
|
33945
|
+
const { node, extraParams } = params2;
|
|
33592
33946
|
const trackedMarks = [TrackInsertMarkName, TrackDeleteMarkName];
|
|
33593
|
-
const
|
|
33594
|
-
if (
|
|
33595
|
-
|
|
33596
|
-
|
|
33597
|
-
|
|
33598
|
-
|
|
33599
|
-
|
|
33600
|
-
|
|
33601
|
-
const markElement = {
|
|
33602
|
-
type: "element",
|
|
33603
|
-
name: "w:rPrChange",
|
|
33604
|
-
attributes: {
|
|
33605
|
-
"w:id": trackStyleMark.attrs.id,
|
|
33606
|
-
"w:author": trackStyleMark.attrs.author,
|
|
33607
|
-
"w:authorEmail": trackStyleMark.attrs.authorEmail,
|
|
33608
|
-
"w:date": trackStyleMark.attrs.date
|
|
33609
|
-
},
|
|
33610
|
-
elements: trackStyleMark.attrs.before.map((mark) => processOutputMarks([mark])).filter((r2) => r2 !== void 0)
|
|
33611
|
-
};
|
|
33612
|
-
return markElement;
|
|
33613
|
-
}
|
|
33614
|
-
return void 0;
|
|
33615
|
-
}
|
|
33616
|
-
function translateTrackedNode(params2) {
|
|
33617
|
-
const { node } = params2;
|
|
33618
|
-
const marks = node.marks;
|
|
33619
|
-
const trackingMarks = [TrackInsertMarkName, TrackDeleteMarkName, TrackFormatMarkName];
|
|
33620
|
-
const trackedMark = marks.find((m2) => trackingMarks.includes(m2.type));
|
|
33621
|
-
const isInsert = trackedMark.type === TrackInsertMarkName;
|
|
33622
|
-
const trackStyleMark = createTrackStyleMark(marks);
|
|
33623
|
-
node.marks = marks.filter((m2) => !trackingMarks.includes(m2.type));
|
|
33624
|
-
if (trackStyleMark) {
|
|
33625
|
-
node.marks.push(trackStyleMark);
|
|
33947
|
+
const trackedMark = node.marks?.find((m2) => trackedMarks.includes(m2.type));
|
|
33948
|
+
if (trackedMark) {
|
|
33949
|
+
switch (trackedMark.type) {
|
|
33950
|
+
case "trackDelete":
|
|
33951
|
+
return translator$3.decode(params2);
|
|
33952
|
+
case "trackInsert":
|
|
33953
|
+
return translator$2.decode(params2);
|
|
33954
|
+
}
|
|
33626
33955
|
}
|
|
33627
|
-
const
|
|
33628
|
-
if (!
|
|
33629
|
-
|
|
33630
|
-
textNode.name = "w:delText";
|
|
33956
|
+
const isLinkNode = node.marks?.some((m2) => m2.type === "link");
|
|
33957
|
+
if (isLinkNode && !extraParams?.linkProcessed) {
|
|
33958
|
+
return translator$Z.decode(params2);
|
|
33631
33959
|
}
|
|
33632
|
-
const
|
|
33633
|
-
|
|
33634
|
-
type: "element",
|
|
33635
|
-
attributes: {
|
|
33636
|
-
"w:id": trackedMark.attrs.id,
|
|
33637
|
-
"w:author": trackedMark.attrs.author,
|
|
33638
|
-
"w:authorEmail": trackedMark.attrs.authorEmail,
|
|
33639
|
-
"w:date": trackedMark.attrs.date
|
|
33640
|
-
},
|
|
33641
|
-
elements: [translatedTextNode]
|
|
33642
|
-
};
|
|
33643
|
-
return trackedNode;
|
|
33960
|
+
const { text, marks = [] } = node;
|
|
33961
|
+
return getTextNodeForExport(text, marks, params2);
|
|
33644
33962
|
}
|
|
33645
33963
|
function wrapTextInRun(nodeOrNodes, marks) {
|
|
33646
33964
|
let elements = [];
|
|
@@ -33897,7 +34215,7 @@ function translateMark(mark) {
|
|
|
33897
34215
|
markElement.type = "element";
|
|
33898
34216
|
break;
|
|
33899
34217
|
case "underline": {
|
|
33900
|
-
const translated = translator$
|
|
34218
|
+
const translated = translator$16.decode({
|
|
33901
34219
|
node: {
|
|
33902
34220
|
attrs: {
|
|
33903
34221
|
underlineType: attrs.underlineType ?? attrs.underline ?? null,
|
|
@@ -33961,9 +34279,11 @@ function translateMark(mark) {
|
|
|
33961
34279
|
break;
|
|
33962
34280
|
case "highlight": {
|
|
33963
34281
|
const highlightValue = attrs.color ?? attrs.highlight ?? null;
|
|
33964
|
-
const translated = translator$
|
|
34282
|
+
const translated = translator$1b.decode({ node: { attrs: { highlight: highlightValue } } });
|
|
33965
34283
|
return translated || {};
|
|
33966
34284
|
}
|
|
34285
|
+
case "link":
|
|
34286
|
+
return {};
|
|
33967
34287
|
}
|
|
33968
34288
|
return markElement;
|
|
33969
34289
|
}
|
|
@@ -63902,6 +64222,58 @@ const registerImages = async (foundImages, editor, view) => {
|
|
|
63902
64222
|
}
|
|
63903
64223
|
});
|
|
63904
64224
|
};
|
|
64225
|
+
const normalizeWrap = (attrs = {}) => {
|
|
64226
|
+
const wrap2 = attrs.wrap;
|
|
64227
|
+
if (wrap2?.type && wrap2.type !== "Inline") {
|
|
64228
|
+
return {
|
|
64229
|
+
type: wrap2.type,
|
|
64230
|
+
attrs: wrap2.attrs ?? {}
|
|
64231
|
+
};
|
|
64232
|
+
}
|
|
64233
|
+
if (wrap2?.type === "Inline" && Object.keys(wrap2.attrs ?? {}).length) {
|
|
64234
|
+
return {
|
|
64235
|
+
type: "Inline",
|
|
64236
|
+
attrs: wrap2.attrs
|
|
64237
|
+
};
|
|
64238
|
+
}
|
|
64239
|
+
if (!wrap2 && attrs.wrapText) {
|
|
64240
|
+
return {
|
|
64241
|
+
type: "Square",
|
|
64242
|
+
attrs: {
|
|
64243
|
+
wrapText: attrs.wrapText
|
|
64244
|
+
}
|
|
64245
|
+
};
|
|
64246
|
+
}
|
|
64247
|
+
if (!wrap2 && attrs.wrapTopAndBottom) {
|
|
64248
|
+
return {
|
|
64249
|
+
type: "TopAndBottom",
|
|
64250
|
+
attrs: {}
|
|
64251
|
+
};
|
|
64252
|
+
}
|
|
64253
|
+
if (wrap2?.type === "Inline") {
|
|
64254
|
+
return {
|
|
64255
|
+
type: "Inline",
|
|
64256
|
+
attrs: wrap2.attrs ?? {}
|
|
64257
|
+
};
|
|
64258
|
+
}
|
|
64259
|
+
return {
|
|
64260
|
+
type: "Inline",
|
|
64261
|
+
attrs: {}
|
|
64262
|
+
};
|
|
64263
|
+
};
|
|
64264
|
+
const normalizeMarginOffset = (marginOffset = {}) => {
|
|
64265
|
+
const { left: left2, horizontal, ...rest } = marginOffset;
|
|
64266
|
+
return {
|
|
64267
|
+
...rest,
|
|
64268
|
+
horizontal: horizontal ?? left2
|
|
64269
|
+
};
|
|
64270
|
+
};
|
|
64271
|
+
const getNormalizedImageAttrs = (attrs = {}) => {
|
|
64272
|
+
return {
|
|
64273
|
+
wrap: normalizeWrap(attrs),
|
|
64274
|
+
marginOffset: normalizeMarginOffset(attrs.marginOffset ?? {})
|
|
64275
|
+
};
|
|
64276
|
+
};
|
|
63905
64277
|
const ImagePositionPluginKey = new PluginKey("ImagePosition");
|
|
63906
64278
|
const ImagePositionPlugin = ({ editor }) => {
|
|
63907
64279
|
const { view } = editor;
|
|
@@ -63949,7 +64321,8 @@ const getImagePositionDecorations = (state2, view) => {
|
|
|
63949
64321
|
let style2 = "";
|
|
63950
64322
|
let className = "";
|
|
63951
64323
|
const { vRelativeFrom, alignH } = node.attrs.anchorData;
|
|
63952
|
-
const { size: size2, padding
|
|
64324
|
+
const { size: size2, padding } = node.attrs;
|
|
64325
|
+
const { marginOffset } = getNormalizedImageAttrs(node.attrs);
|
|
63953
64326
|
const pageBreak = findPreviousDomNodeWithClass(view, pos, "pagination-break-wrapper");
|
|
63954
64327
|
if (pageBreak) {
|
|
63955
64328
|
switch (alignH) {
|
|
@@ -64066,7 +64439,24 @@ const Image = Node$1.create({
|
|
|
64066
64439
|
rendered: false
|
|
64067
64440
|
},
|
|
64068
64441
|
originalAttributes: { rendered: false },
|
|
64069
|
-
|
|
64442
|
+
/**
|
|
64443
|
+
* @category Attribute
|
|
64444
|
+
* @param {Object} wrap - Wrapping options
|
|
64445
|
+
* @param {string} wrap.type - Wrap type: "None", "Square", "Through", "Tight", "TopAndBottom", "Inline"
|
|
64446
|
+
* @param {Object} [wrap.attrs] - Wrap attributes (only allowed attributes for the given type will be accepted)
|
|
64447
|
+
* @param {string} [wrap.attrs.wrapText] - Text wrapping mode for Square type: "bothSides", "largest", "left", "right"
|
|
64448
|
+
* @param {number} [wrap.attrs.distTop] - Top distance in pixels
|
|
64449
|
+
* @param {number} [wrap.attrs.distBottom] - Bottom distance in pixels
|
|
64450
|
+
* @param {number} [wrap.attrs.distLeft] - Left distance in pixels
|
|
64451
|
+
* @param {number} [wrap.attrs.distRight] - Right distance in pixels
|
|
64452
|
+
* @param {Array} [wrap.attrs.polygon] - Polygon points for Through/Tight types: [[x1,y1], [x2,y2], ...]
|
|
64453
|
+
* @param {boolean} [wrap.attrs.behindDoc] - Whether image should be behind document text (for wrapNone)
|
|
64454
|
+
*/
|
|
64455
|
+
wrap: {
|
|
64456
|
+
default: { type: "Inline" },
|
|
64457
|
+
rendered: false
|
|
64458
|
+
// Handled in main renderDOM
|
|
64459
|
+
},
|
|
64070
64460
|
anchorData: {
|
|
64071
64461
|
default: null,
|
|
64072
64462
|
rendered: false
|
|
@@ -64112,7 +64502,6 @@ const Image = Node$1.create({
|
|
|
64112
64502
|
* @private
|
|
64113
64503
|
*/
|
|
64114
64504
|
simplePos: { rendered: false },
|
|
64115
|
-
wrapText: { rendered: false },
|
|
64116
64505
|
extension: { rendered: false },
|
|
64117
64506
|
size: {
|
|
64118
64507
|
default: {},
|
|
@@ -64128,55 +64517,13 @@ const Image = Node$1.create({
|
|
|
64128
64517
|
},
|
|
64129
64518
|
padding: {
|
|
64130
64519
|
default: {},
|
|
64131
|
-
|
|
64132
|
-
|
|
64133
|
-
const { rotation } = transformData;
|
|
64134
|
-
const { height, width } = size2;
|
|
64135
|
-
if (rotation && height && width) {
|
|
64136
|
-
const { horizontal, vertical } = getRotationMargins(width, height, rotation);
|
|
64137
|
-
left2 += horizontal;
|
|
64138
|
-
right2 += horizontal;
|
|
64139
|
-
top2 += vertical;
|
|
64140
|
-
bottom2 += vertical;
|
|
64141
|
-
}
|
|
64142
|
-
let style2 = "";
|
|
64143
|
-
if (left2 && marginOffset?.left == null) style2 += `margin-left: ${left2}px;`;
|
|
64144
|
-
if (top2 && marginOffset?.top == null) style2 += `margin-top: ${top2}px;`;
|
|
64145
|
-
if (bottom2) style2 += `margin-bottom: ${bottom2}px;`;
|
|
64146
|
-
if (right2) style2 += `margin-right: ${right2}px;`;
|
|
64147
|
-
return { style: style2 };
|
|
64148
|
-
}
|
|
64520
|
+
rendered: false
|
|
64521
|
+
// Handled in main renderDOM
|
|
64149
64522
|
},
|
|
64150
64523
|
marginOffset: {
|
|
64151
64524
|
default: {},
|
|
64152
|
-
|
|
64153
|
-
|
|
64154
|
-
const hasMarginOffsets = marginOffset?.left != null || marginOffset?.top != null;
|
|
64155
|
-
if (!hasAnchorData && !hasMarginOffsets) return {};
|
|
64156
|
-
const relativeFromPageV = anchorData?.vRelativeFrom === "page";
|
|
64157
|
-
const maxMarginV = 500;
|
|
64158
|
-
const baseLeft = marginOffset?.left ?? 0;
|
|
64159
|
-
const baseTop = marginOffset?.top ?? 0;
|
|
64160
|
-
let rotationLeft = 0;
|
|
64161
|
-
let rotationTop = 0;
|
|
64162
|
-
const { rotation } = transformData ?? {};
|
|
64163
|
-
const { height, width } = size2 ?? {};
|
|
64164
|
-
if (rotation && height && width) {
|
|
64165
|
-
const { horizontal, vertical } = getRotationMargins(width, height, rotation);
|
|
64166
|
-
rotationLeft = horizontal;
|
|
64167
|
-
rotationTop = vertical;
|
|
64168
|
-
}
|
|
64169
|
-
const left2 = baseLeft + rotationLeft;
|
|
64170
|
-
const top2 = baseTop + rotationTop;
|
|
64171
|
-
let style2 = "";
|
|
64172
|
-
if (left2) style2 += `margin-left: ${left2}px;`;
|
|
64173
|
-
if (top2) {
|
|
64174
|
-
if (relativeFromPageV && top2 >= maxMarginV) style2 += `margin-top: ${maxMarginV}px;`;
|
|
64175
|
-
else style2 += `margin-top: ${top2}px;`;
|
|
64176
|
-
}
|
|
64177
|
-
if (!style2) return {};
|
|
64178
|
-
return { style: style2 };
|
|
64179
|
-
}
|
|
64525
|
+
rendered: false
|
|
64526
|
+
// Handled in main renderDOM
|
|
64180
64527
|
},
|
|
64181
64528
|
style: {
|
|
64182
64529
|
default: null,
|
|
@@ -64195,8 +64542,181 @@ const Image = Node$1.create({
|
|
|
64195
64542
|
}
|
|
64196
64543
|
];
|
|
64197
64544
|
},
|
|
64198
|
-
renderDOM({ htmlAttributes }) {
|
|
64199
|
-
|
|
64545
|
+
renderDOM({ node, htmlAttributes }) {
|
|
64546
|
+
const { wrap: wrap2, marginOffset } = getNormalizedImageAttrs(node.attrs);
|
|
64547
|
+
const { anchorData, padding, transformData = {}, size: size2 = { width: 0, height: 0 } } = node.attrs;
|
|
64548
|
+
const margin = {
|
|
64549
|
+
left: 0,
|
|
64550
|
+
right: 0,
|
|
64551
|
+
top: 0,
|
|
64552
|
+
bottom: 0
|
|
64553
|
+
};
|
|
64554
|
+
let centered = false;
|
|
64555
|
+
let floatRight = false;
|
|
64556
|
+
let baseHorizontal = marginOffset?.horizontal || 0;
|
|
64557
|
+
let style2 = "";
|
|
64558
|
+
if (padding) {
|
|
64559
|
+
if (padding.left) margin.left += padding.left;
|
|
64560
|
+
if (padding.right) margin.right += padding.right;
|
|
64561
|
+
if (padding.top) margin.top += padding.top;
|
|
64562
|
+
if (padding.bottom) margin.bottom += padding.bottom;
|
|
64563
|
+
}
|
|
64564
|
+
const { rotation } = transformData;
|
|
64565
|
+
const { height, width } = size2;
|
|
64566
|
+
if (rotation && height && width) {
|
|
64567
|
+
const { horizontal, vertical } = getRotationMargins(width, height, rotation);
|
|
64568
|
+
margin.left += horizontal;
|
|
64569
|
+
margin.right += horizontal;
|
|
64570
|
+
margin.top += vertical;
|
|
64571
|
+
margin.bottom += vertical;
|
|
64572
|
+
}
|
|
64573
|
+
if (wrap2 && wrap2.type) {
|
|
64574
|
+
const { type: type2, attrs = {} } = wrap2;
|
|
64575
|
+
switch (type2) {
|
|
64576
|
+
case "None":
|
|
64577
|
+
style2 += "position: absolute;";
|
|
64578
|
+
if (attrs.behindDoc) {
|
|
64579
|
+
style2 += "z-index: -1;";
|
|
64580
|
+
} else {
|
|
64581
|
+
style2 += "z-index: 1;";
|
|
64582
|
+
}
|
|
64583
|
+
break;
|
|
64584
|
+
case "Square":
|
|
64585
|
+
style2 += "shape-outside: border-box; clear: both;";
|
|
64586
|
+
if (attrs.wrapText === "right") {
|
|
64587
|
+
style2 += "float: left;";
|
|
64588
|
+
} else if (attrs.wrapText === "left") {
|
|
64589
|
+
style2 += "float: right;";
|
|
64590
|
+
floatRight = true;
|
|
64591
|
+
} else if (["largest", "bothSides"].includes(attrs.wrapText)) {
|
|
64592
|
+
const pageStyles2 = this.editor?.converter?.pageStyles;
|
|
64593
|
+
if (pageStyles2?.pageSize && pageStyles2?.pageMargins && size2.width) {
|
|
64594
|
+
const pageWidth = inchesToPixels(pageStyles2.pageSize.width);
|
|
64595
|
+
const leftMargin = inchesToPixels(pageStyles2.pageMargins.left);
|
|
64596
|
+
const rightMargin = inchesToPixels(pageStyles2.pageMargins.right);
|
|
64597
|
+
const contentWidth = pageWidth - leftMargin - rightMargin;
|
|
64598
|
+
const imageWidth = size2.width + (attrs.distLeft || 0) + (attrs.distRight || 0);
|
|
64599
|
+
const leftSpace = marginOffset.horizontal;
|
|
64600
|
+
const rightSpace = contentWidth - leftSpace - imageWidth;
|
|
64601
|
+
if (rightSpace < 0) {
|
|
64602
|
+
style2 += "float: left;";
|
|
64603
|
+
} else if (rightSpace > leftSpace) {
|
|
64604
|
+
style2 += "float: left;";
|
|
64605
|
+
} else {
|
|
64606
|
+
style2 += "float: right;";
|
|
64607
|
+
floatRight = true;
|
|
64608
|
+
baseHorizontal = rightSpace;
|
|
64609
|
+
}
|
|
64610
|
+
} else {
|
|
64611
|
+
style2 += "float: left;";
|
|
64612
|
+
}
|
|
64613
|
+
}
|
|
64614
|
+
if (attrs.distTop) margin.top += attrs.distTop;
|
|
64615
|
+
if (attrs.distBottom) margin.bottom += attrs.distBottom;
|
|
64616
|
+
if (attrs.distLeft) margin.left += attrs.distLeft;
|
|
64617
|
+
if (attrs.distRight) margin.right += attrs.distRight;
|
|
64618
|
+
break;
|
|
64619
|
+
case "Through":
|
|
64620
|
+
case "Tight":
|
|
64621
|
+
style2 += "clear: both;";
|
|
64622
|
+
const pageStyles = this.editor?.converter?.pageStyles;
|
|
64623
|
+
if (pageStyles?.pageSize && pageStyles?.pageMargins && size2.width) {
|
|
64624
|
+
const pageWidth = inchesToPixels(pageStyles.pageSize.width);
|
|
64625
|
+
const leftMargin = inchesToPixels(pageStyles.pageMargins.left);
|
|
64626
|
+
const rightMargin = inchesToPixels(pageStyles.pageMargins.right);
|
|
64627
|
+
const contentWidth = pageWidth - leftMargin - rightMargin;
|
|
64628
|
+
const imageWidth = size2.width + (attrs.distLeft || 0) + (attrs.distRight || 0);
|
|
64629
|
+
const leftSpace = marginOffset.horizontal;
|
|
64630
|
+
const rightSpace = contentWidth - leftSpace - imageWidth;
|
|
64631
|
+
if (rightSpace < 0) {
|
|
64632
|
+
style2 += "float: left;";
|
|
64633
|
+
} else if (rightSpace > leftSpace) {
|
|
64634
|
+
style2 += "float: left;";
|
|
64635
|
+
} else {
|
|
64636
|
+
style2 += "float: right;";
|
|
64637
|
+
floatRight = true;
|
|
64638
|
+
baseHorizontal = rightSpace;
|
|
64639
|
+
}
|
|
64640
|
+
} else {
|
|
64641
|
+
style2 += "float: left;";
|
|
64642
|
+
}
|
|
64643
|
+
if (attrs.distTop) margin.top += attrs.distTop;
|
|
64644
|
+
if (attrs.distBottom) margin.bottom += attrs.distBottom;
|
|
64645
|
+
if (attrs.distLeft) margin.left += attrs.distLeft;
|
|
64646
|
+
if (attrs.distRight) margin.right += attrs.distRight;
|
|
64647
|
+
if (attrs.polygon) {
|
|
64648
|
+
let horizontalOffset = floatRight ? attrs.polygon[0][0] || 0 : marginOffset.horizontal + 15;
|
|
64649
|
+
let maxX = 0;
|
|
64650
|
+
let minX = 0;
|
|
64651
|
+
let minY = 0;
|
|
64652
|
+
let maxY = 0;
|
|
64653
|
+
attrs.polygon.forEach(([x, y2]) => {
|
|
64654
|
+
if (floatRight && x < horizontalOffset) horizontalOffset = x;
|
|
64655
|
+
if (x > maxX) maxX = x;
|
|
64656
|
+
if (x < minX) minX = x;
|
|
64657
|
+
if (y2 > maxY) maxY = y2;
|
|
64658
|
+
if (y2 < minY) minY = y2;
|
|
64659
|
+
});
|
|
64660
|
+
const originalWidth = maxX - minX;
|
|
64661
|
+
const originalHeight = maxY - minY;
|
|
64662
|
+
const scaleWidth = Math.min(1, size2.width / originalWidth);
|
|
64663
|
+
const scaleHeight = Math.min(1, size2.height / originalHeight);
|
|
64664
|
+
const verticalOffset = Math.max(0, marginOffset.top);
|
|
64665
|
+
const points = attrs.polygon.map(([x, y2]) => `${horizontalOffset + x * scaleWidth}px ${verticalOffset + y2 * scaleHeight}px`).join(", ");
|
|
64666
|
+
style2 += `shape-outside: polygon(${points});`;
|
|
64667
|
+
}
|
|
64668
|
+
break;
|
|
64669
|
+
case "TopAndBottom":
|
|
64670
|
+
style2 += "display: block; clear: both;";
|
|
64671
|
+
if (attrs.distTop) margin.top += attrs.distTop;
|
|
64672
|
+
if (attrs.distBottom) margin.bottom += attrs.distBottom;
|
|
64673
|
+
centered = true;
|
|
64674
|
+
break;
|
|
64675
|
+
}
|
|
64676
|
+
}
|
|
64677
|
+
const hasAnchorData = Boolean(anchorData);
|
|
64678
|
+
const hasMarginOffsets = marginOffset?.horizontal != null || marginOffset?.top != null;
|
|
64679
|
+
if (hasAnchorData || hasMarginOffsets) {
|
|
64680
|
+
const relativeFromPageV = anchorData?.vRelativeFrom === "page";
|
|
64681
|
+
const maxMarginV = 500;
|
|
64682
|
+
const baseTop = Math.max(0, marginOffset?.top ?? 0);
|
|
64683
|
+
let rotationHorizontal = 0;
|
|
64684
|
+
let rotationTop = 0;
|
|
64685
|
+
const { rotation: rotation2 } = transformData ?? {};
|
|
64686
|
+
const { height: height2, width: width2 } = size2 ?? {};
|
|
64687
|
+
if (rotation2 && height2 && width2) {
|
|
64688
|
+
const { horizontal: horizontal2, vertical } = getRotationMargins(width2, height2, rotation2);
|
|
64689
|
+
rotationHorizontal = horizontal2;
|
|
64690
|
+
rotationTop = vertical;
|
|
64691
|
+
}
|
|
64692
|
+
const horizontal = baseHorizontal + rotationHorizontal;
|
|
64693
|
+
const top2 = baseTop + rotationTop;
|
|
64694
|
+
if (horizontal) {
|
|
64695
|
+
if (floatRight) {
|
|
64696
|
+
margin.right += horizontal;
|
|
64697
|
+
} else {
|
|
64698
|
+
margin.left += horizontal;
|
|
64699
|
+
}
|
|
64700
|
+
}
|
|
64701
|
+
if (top2) {
|
|
64702
|
+
if (relativeFromPageV && top2 >= maxMarginV) margin.top += maxMarginV;
|
|
64703
|
+
else margin.top += top2;
|
|
64704
|
+
}
|
|
64705
|
+
}
|
|
64706
|
+
if (centered) {
|
|
64707
|
+
style2 += "margin-left: auto; margin-right: auto;";
|
|
64708
|
+
} else {
|
|
64709
|
+
if (margin.left) style2 += `margin-left: ${margin.left}px;`;
|
|
64710
|
+
if (margin.right) style2 += `margin-right: ${margin.right}px;`;
|
|
64711
|
+
}
|
|
64712
|
+
if (margin.top) style2 += `margin-top: ${margin.top}px;`;
|
|
64713
|
+
if (margin.bottom) style2 += `margin-bottom: ${margin.bottom}px;`;
|
|
64714
|
+
const finalAttributes = { ...htmlAttributes };
|
|
64715
|
+
if (style2) {
|
|
64716
|
+
const existingStyle = finalAttributes.style || "";
|
|
64717
|
+
finalAttributes.style = existingStyle + (existingStyle ? " " : "") + style2;
|
|
64718
|
+
}
|
|
64719
|
+
return ["img", Attribute2.mergeAttributes(this.options.htmlAttributes, finalAttributes)];
|
|
64200
64720
|
},
|
|
64201
64721
|
addCommands() {
|
|
64202
64722
|
return {
|
|
@@ -64218,6 +64738,85 @@ const Image = Node$1.create({
|
|
|
64218
64738
|
type: this.name,
|
|
64219
64739
|
attrs: options
|
|
64220
64740
|
});
|
|
64741
|
+
},
|
|
64742
|
+
/**
|
|
64743
|
+
* Set the wrapping mode and attributes for the selected image
|
|
64744
|
+
* @category Command
|
|
64745
|
+
* @param {Object} options - Wrapping options
|
|
64746
|
+
* @param {string} options.type - Wrap type: "None", "Square", "Through", "Tight", "TopAndBottom", "Inline"
|
|
64747
|
+
* @param {Object} [options.attrs] - Wrap attributes (only allowed attributes for the given type will be accepted)
|
|
64748
|
+
* @param {string} [options.attrs.wrapText] - Text wrapping mode for Square type: "bothSides", "largest", "left", "right"
|
|
64749
|
+
* @param {number} [options.attrs.distTop] - Top distance in pixels
|
|
64750
|
+
* @param {number} [options.attrs.distBottom] - Bottom distance in pixels
|
|
64751
|
+
* @param {number} [options.attrs.distLeft] - Left distance in pixels
|
|
64752
|
+
* @param {number} [options.attrs.distRight] - Right distance in pixels
|
|
64753
|
+
* @param {Array} [options.attrs.polygon] - Polygon points for Through/Tight types: [[x1,y1], [x2,y2], ...]
|
|
64754
|
+
* @param {boolean} [options.attrs.behindDoc] - Whether image should be behind document text (for wrapNone)
|
|
64755
|
+
* @example
|
|
64756
|
+
* // No wrapping, behind document
|
|
64757
|
+
* editor.commands.setWrapping({ type: 'None', attrs: {behindDoc: true} })
|
|
64758
|
+
*
|
|
64759
|
+
* // Square wrapping on both sides with distances
|
|
64760
|
+
* editor.commands.setWrapping({
|
|
64761
|
+
* type: 'Square',
|
|
64762
|
+
* attrs: {
|
|
64763
|
+
* wrapText: 'bothSides',
|
|
64764
|
+
* distTop: 10,
|
|
64765
|
+
* distBottom: 10,
|
|
64766
|
+
* distLeft: 10,
|
|
64767
|
+
* distRight: 10
|
|
64768
|
+
* }
|
|
64769
|
+
* })
|
|
64770
|
+
*
|
|
64771
|
+
* // Tight wrapping with polygon
|
|
64772
|
+
* editor.commands.setWrapping({
|
|
64773
|
+
* type: 'Tight',
|
|
64774
|
+
* attrs: {
|
|
64775
|
+
* polygon: [[0, 0], [100, 0], [100, 100], [0, 100]]
|
|
64776
|
+
* }
|
|
64777
|
+
* })
|
|
64778
|
+
*
|
|
64779
|
+
* // Top and bottom wrapping
|
|
64780
|
+
* editor.commands.setWrapping({
|
|
64781
|
+
* type: 'TopAndBottom',
|
|
64782
|
+
* attrs: {
|
|
64783
|
+
* distTop: 15,
|
|
64784
|
+
* distBottom: 15
|
|
64785
|
+
* }
|
|
64786
|
+
* })
|
|
64787
|
+
*/
|
|
64788
|
+
setWrapping: (options) => ({ chain, state: state2 }) => {
|
|
64789
|
+
const { selection } = state2;
|
|
64790
|
+
const { $from } = selection;
|
|
64791
|
+
const node = $from.nodeAfter;
|
|
64792
|
+
if (!node || node.type.name !== this.name) {
|
|
64793
|
+
return false;
|
|
64794
|
+
}
|
|
64795
|
+
const { type: type2, attrs = {} } = options;
|
|
64796
|
+
const allowedAttrs = {};
|
|
64797
|
+
const allowedAttributes = {
|
|
64798
|
+
None: ["behindDoc"],
|
|
64799
|
+
Square: ["wrapText", "distTop", "distBottom", "distLeft", "distRight"],
|
|
64800
|
+
Through: ["distTop", "distBottom", "distLeft", "distRight", "polygon"],
|
|
64801
|
+
Tight: ["distTop", "distBottom", "distLeft", "distRight", "polygon"],
|
|
64802
|
+
TopAndBottom: ["distTop", "distBottom"],
|
|
64803
|
+
Inline: []
|
|
64804
|
+
};
|
|
64805
|
+
const allowedForType = allowedAttributes[type2] || [];
|
|
64806
|
+
Object.keys(attrs).forEach((key2) => {
|
|
64807
|
+
if (allowedForType.includes(key2)) {
|
|
64808
|
+
allowedAttrs[key2] = attrs[key2];
|
|
64809
|
+
}
|
|
64810
|
+
});
|
|
64811
|
+
const updatedAttrs = {
|
|
64812
|
+
...node.attrs,
|
|
64813
|
+
wrap: {
|
|
64814
|
+
type: type2,
|
|
64815
|
+
attrs: allowedAttrs
|
|
64816
|
+
},
|
|
64817
|
+
isAnchor: type2 !== "Inline"
|
|
64818
|
+
};
|
|
64819
|
+
return chain().updateAttributes(this.name, updatedAttrs).run();
|
|
64221
64820
|
}
|
|
64222
64821
|
};
|
|
64223
64822
|
},
|
|
@@ -87566,72 +88165,72 @@ const _sfc_main = {
|
|
|
87566
88165
|
const SuperInput = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-4d5cff52"]]);
|
|
87567
88166
|
const additionalHandlers = Object.freeze({
|
|
87568
88167
|
"mc:AlternateContent": translator$1,
|
|
87569
|
-
"sd:pageReference": translator$
|
|
87570
|
-
"sd:tableOfContents": translator$
|
|
87571
|
-
"w:b": translator$
|
|
87572
|
-
"w:bidiVisual": translator$
|
|
87573
|
-
"w:bookmarkEnd": translator$
|
|
87574
|
-
"w:bookmarkStart": translator$
|
|
87575
|
-
"w:bottom": translator$
|
|
87576
|
-
"w:br": translator$
|
|
87577
|
-
"w:cantSplit": translator$
|
|
87578
|
-
"w:cnfStyle": translator$
|
|
87579
|
-
"w:color": translator$
|
|
87580
|
-
"w:divId": translator$
|
|
87581
|
-
"w:drawing": translator$
|
|
87582
|
-
"w:end": translator$
|
|
87583
|
-
"w:gridAfter": translator$
|
|
87584
|
-
"w:gridBefore": translator$
|
|
87585
|
-
"w:gridCol": translator$
|
|
87586
|
-
"w:hidden": translator$
|
|
87587
|
-
"w:highlight": translator$
|
|
87588
|
-
"w:hyperlink": translator$
|
|
87589
|
-
"w:i": translator$
|
|
87590
|
-
"w:insideH": translator$
|
|
87591
|
-
"w:insideV": translator$
|
|
87592
|
-
"w:jc": translator$
|
|
87593
|
-
"w:left": translator$
|
|
87594
|
-
"w:p": translator$
|
|
87595
|
-
"w:r": translator$
|
|
87596
|
-
"w:rFonts": translator$
|
|
87597
|
-
"w:rPr": translator$
|
|
87598
|
-
"w:rStyle": translator$
|
|
87599
|
-
"w:right": translator$
|
|
87600
|
-
"w:sdt": translator$
|
|
87601
|
-
"w:shd": translator$
|
|
87602
|
-
"w:start": translator$
|
|
87603
|
-
"w:strike": translator$
|
|
87604
|
-
"w:sz": translator
|
|
87605
|
-
"w:szCs": translator$
|
|
87606
|
-
"w:tab": translator$
|
|
87607
|
-
"w:tbl": translator$
|
|
87608
|
-
"w:tblBorders": translator$
|
|
87609
|
-
"w:tblCaption": translator$
|
|
87610
|
-
"w:tblCellMar": translator$
|
|
87611
|
-
"w:tblCellSpacing": translator$
|
|
87612
|
-
"w:tblDescription": translator$
|
|
87613
|
-
"w:tblGrid": translator$
|
|
87614
|
-
"w:tblHeader": translator$
|
|
87615
|
-
"w:tblInd": translator$
|
|
87616
|
-
"w:tblLayout": translator$
|
|
87617
|
-
"w:tblLook": translator$
|
|
87618
|
-
"w:tblOverlap": translator$
|
|
87619
|
-
"w:tblPr": translator$
|
|
87620
|
-
"w:tblStyle": translator$
|
|
87621
|
-
"w:tblStyleColBandSize": translator$
|
|
87622
|
-
"w:tblStyleRowBandSize": translator$
|
|
87623
|
-
"w:tblW": translator$
|
|
87624
|
-
"w:tblpPr": translator$
|
|
87625
|
-
"w:tc": translator$
|
|
87626
|
-
"w:top": translator$
|
|
87627
|
-
"w:tr": translator$
|
|
87628
|
-
"w:trHeight": translator$
|
|
87629
|
-
"w:trPr": translator$
|
|
87630
|
-
"w:u": translator$
|
|
87631
|
-
"w:wAfter": translator$
|
|
87632
|
-
"w:wBefore": translator$
|
|
87633
|
-
"wp:anchor": translator$
|
|
87634
|
-
"wp:inline": translator$
|
|
88168
|
+
"sd:pageReference": translator$5,
|
|
88169
|
+
"sd:tableOfContents": translator$4,
|
|
88170
|
+
"w:b": translator$18,
|
|
88171
|
+
"w:bidiVisual": translator$J,
|
|
88172
|
+
"w:bookmarkEnd": translator$6,
|
|
88173
|
+
"w:bookmarkStart": translator$7,
|
|
88174
|
+
"w:bottom": translator$w,
|
|
88175
|
+
"w:br": translator$1c,
|
|
88176
|
+
"w:cantSplit": translator$X,
|
|
88177
|
+
"w:cnfStyle": translator$W,
|
|
88178
|
+
"w:color": translator$14,
|
|
88179
|
+
"w:divId": translator$V,
|
|
88180
|
+
"w:drawing": translator$9,
|
|
88181
|
+
"w:end": translator$u,
|
|
88182
|
+
"w:gridAfter": translator$U,
|
|
88183
|
+
"w:gridBefore": translator$T,
|
|
88184
|
+
"w:gridCol": translator$f,
|
|
88185
|
+
"w:hidden": translator$S,
|
|
88186
|
+
"w:highlight": translator$1b,
|
|
88187
|
+
"w:hyperlink": translator$Z,
|
|
88188
|
+
"w:i": translator$17,
|
|
88189
|
+
"w:insideH": translator$s,
|
|
88190
|
+
"w:insideV": translator$r,
|
|
88191
|
+
"w:jc": translator$R,
|
|
88192
|
+
"w:left": translator$q,
|
|
88193
|
+
"w:p": translator$19,
|
|
88194
|
+
"w:r": translator$Y,
|
|
88195
|
+
"w:rFonts": translator$13,
|
|
88196
|
+
"w:rPr": translator$_,
|
|
88197
|
+
"w:rStyle": translator$12,
|
|
88198
|
+
"w:right": translator$o,
|
|
88199
|
+
"w:sdt": translator$8,
|
|
88200
|
+
"w:shd": translator$I,
|
|
88201
|
+
"w:start": translator$m,
|
|
88202
|
+
"w:strike": translator$15,
|
|
88203
|
+
"w:sz": translator$11,
|
|
88204
|
+
"w:szCs": translator$10,
|
|
88205
|
+
"w:tab": translator$1a,
|
|
88206
|
+
"w:tbl": translator$d,
|
|
88207
|
+
"w:tblBorders": translator$i,
|
|
88208
|
+
"w:tblCaption": translator$H,
|
|
88209
|
+
"w:tblCellMar": translator$h,
|
|
88210
|
+
"w:tblCellSpacing": translator$Q,
|
|
88211
|
+
"w:tblDescription": translator$G,
|
|
88212
|
+
"w:tblGrid": translator$e,
|
|
88213
|
+
"w:tblHeader": translator$P,
|
|
88214
|
+
"w:tblInd": translator$F,
|
|
88215
|
+
"w:tblLayout": translator$E,
|
|
88216
|
+
"w:tblLook": translator$D,
|
|
88217
|
+
"w:tblOverlap": translator$C,
|
|
88218
|
+
"w:tblPr": translator$g,
|
|
88219
|
+
"w:tblStyle": translator$B,
|
|
88220
|
+
"w:tblStyleColBandSize": translator$A,
|
|
88221
|
+
"w:tblStyleRowBandSize": translator$z,
|
|
88222
|
+
"w:tblW": translator$y,
|
|
88223
|
+
"w:tblpPr": translator$x,
|
|
88224
|
+
"w:tc": translator$c,
|
|
88225
|
+
"w:top": translator$k,
|
|
88226
|
+
"w:tr": translator$K,
|
|
88227
|
+
"w:trHeight": translator$O,
|
|
88228
|
+
"w:trPr": translator$L,
|
|
88229
|
+
"w:u": translator$16,
|
|
88230
|
+
"w:wAfter": translator$N,
|
|
88231
|
+
"w:wBefore": translator$M,
|
|
88232
|
+
"wp:anchor": translator$b,
|
|
88233
|
+
"wp:inline": translator$a,
|
|
87635
88234
|
"w:commentRangeStart": commentRangeStartTranslator,
|
|
87636
88235
|
"w:commentRangeEnd": commentRangeEndTranslator
|
|
87637
88236
|
});
|