superdoc 0.31.0-next.3 → 0.31.0-next.5
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-UMfEMyPR.es.js → PdfViewer-BjFaPQBd.es.js} +1 -1
- package/dist/chunks/{PdfViewer-DoOKSkNf.cjs → PdfViewer-DXwcotXc.cjs} +1 -1
- package/dist/chunks/{index-D78pvKjo.es.js → index-B6TttOzK.es.js} +3 -3
- package/dist/chunks/{index-B74saKaW-CeHVjvs8.es.js → index-B7dC-H-Q-BeQx_MXI.es.js} +1 -1
- package/dist/chunks/{index-B74saKaW-nw0M-3t9.cjs → index-B7dC-H-Q-DfBEU7rR.cjs} +1 -1
- package/dist/chunks/{index-CjrYy0l4.cjs → index-BF_Yvius.cjs} +3 -3
- package/dist/chunks/{super-editor.es-DTqtLZgT.cjs → super-editor.es-CVDIAxlg.cjs} +1037 -1002
- package/dist/chunks/{super-editor.es-CQFVPho1.es.js → super-editor.es-M2e4wbRW.es.js} +1037 -1002
- package/dist/super-editor/ai-writer.es.js +2 -2
- package/dist/super-editor/chunks/{converter-BdxQSBuI.js → converter-BIsS-JzD.js} +1055 -1020
- package/dist/super-editor/chunks/{docx-zipper-CeENQy4K.js → docx-zipper-DVDiaIyD.js} +1 -1
- package/dist/super-editor/chunks/{editor-fHPBoGEW.js → editor-ZbcM1RTL.js} +4 -4
- package/dist/super-editor/chunks/{index-B74saKaW.js → index-B7dC-H-Q.js} +1 -1
- package/dist/super-editor/chunks/{toolbar-DVn2P_6q.js → toolbar-8qqw8IXG.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/super-editor/src/core/super-converter/exporter.d.ts +0 -48
- package/dist/super-editor/super-editor/src/core/super-converter/exporter.d.ts.map +1 -1
- package/dist/super-editor/super-editor/src/core/super-converter/v2/importer/autoPageNumberImporter.d.ts.map +1 -1
- package/dist/super-editor/super-editor/src/core/super-converter/v3/handlers/sd/autoPageNumber/autoPageNumber-translator.d.ts +8 -0
- package/dist/super-editor/super-editor/src/core/super-converter/v3/handlers/sd/autoPageNumber/autoPageNumber-translator.d.ts.map +1 -0
- package/dist/super-editor/super-editor/src/core/super-converter/v3/handlers/sd/autoPageNumber/index.d.ts +2 -0
- package/dist/super-editor/super-editor/src/core/super-converter/v3/handlers/sd/autoPageNumber/index.d.ts.map +1 -0
- package/dist/super-editor/super-editor/src/core/super-converter/v3/handlers/sd/totalPageNumber/index.d.ts +2 -0
- package/dist/super-editor/super-editor/src/core/super-converter/v3/handlers/sd/totalPageNumber/index.d.ts.map +1 -0
- package/dist/super-editor/super-editor/src/core/super-converter/v3/handlers/sd/totalPageNumber/totalPageNumber-translator.d.ts +8 -0
- package/dist/super-editor/super-editor/src/core/super-converter/v3/handlers/sd/totalPageNumber/totalPageNumber-translator.d.ts.map +1 -0
- package/dist/super-editor/super-editor/src/core/super-converter/v3/handlers/w/p/helpers/generate-paragraph-properties.d.ts +8 -0
- package/dist/super-editor/super-editor/src/core/super-converter/v3/handlers/w/p/helpers/generate-paragraph-properties.d.ts.map +1 -0
- package/dist/super-editor/super-editor/src/core/super-converter/v3/handlers/w/p/helpers/translate-paragraph-node.d.ts +8 -0
- package/dist/super-editor/super-editor/src/core/super-converter/v3/handlers/w/p/helpers/translate-paragraph-node.d.ts.map +1 -0
- package/dist/super-editor/super-editor/src/core/super-converter/v3/handlers/w/sdt/helpers/convert-sdt-content-to-runs.d.ts +7 -0
- package/dist/super-editor/super-editor/src/core/super-converter/v3/handlers/w/sdt/helpers/convert-sdt-content-to-runs.d.ts.map +1 -0
- package/dist/super-editor/super-editor/src/core/super-converter/v3/handlers/w/sdt/helpers/translate-field-annotation.d.ts.map +1 -1
- package/dist/super-editor/super-editor/src/core/super-converter/v3/handlers/w/t/helpers/translate-text-node.d.ts +5 -0
- package/dist/super-editor/super-editor/src/core/super-converter/v3/handlers/w/t/helpers/translate-text-node.d.ts.map +1 -0
- package/dist/super-editor/super-editor.es.js +6 -6
- 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 +1041 -1006
- package/dist/superdoc.umd.js.map +1 -1
- package/package.json +1 -1
|
@@ -15426,19 +15426,6 @@ const hasSomeParentWithClass = (element, classname) => {
|
|
|
15426
15426
|
if (element.className?.split(" ")?.indexOf(classname) >= 0) return true;
|
|
15427
15427
|
return element.parentNode && hasSomeParentWithClass(element.parentNode, classname);
|
|
15428
15428
|
};
|
|
15429
|
-
function generateDocxRandomId(length2 = 8) {
|
|
15430
|
-
const max2 = 2147483647;
|
|
15431
|
-
const value = Math.floor(Math.random() * (max2 + 1));
|
|
15432
|
-
return value.toString(16).padStart(length2, "0").slice(0, length2);
|
|
15433
|
-
}
|
|
15434
|
-
function generateRandomSigned32BitIntStrId() {
|
|
15435
|
-
const val = Math.floor(Math.random() * 2147483647);
|
|
15436
|
-
return val.toString();
|
|
15437
|
-
}
|
|
15438
|
-
function generateRandom32BitHex() {
|
|
15439
|
-
const val = Math.floor(Math.random() * 2147483647);
|
|
15440
|
-
return val.toString(16).toUpperCase().padStart(8, "0");
|
|
15441
|
-
}
|
|
15442
15429
|
const DEFAULT_DOCX_DEFS = {
|
|
15443
15430
|
"xmlns:wpc": "http://schemas.microsoft.com/office/word/2010/wordprocessingCanvas",
|
|
15444
15431
|
"xmlns:cx": "http://schemas.microsoft.com/office/drawing/2014/chartex",
|
|
@@ -16644,15 +16631,6 @@ const COMMENTS_XML_DEFINITIONS = {
|
|
|
16644
16631
|
DOCUMENT_RELS_XML_DEF,
|
|
16645
16632
|
CONTENT_TYPES
|
|
16646
16633
|
};
|
|
16647
|
-
const carbonCopy = (obj) => {
|
|
16648
|
-
if (!obj) return void 0;
|
|
16649
|
-
try {
|
|
16650
|
-
return JSON.parse(JSON.stringify(obj));
|
|
16651
|
-
} catch (e) {
|
|
16652
|
-
console.error("Error in carbonCopy", obj, e);
|
|
16653
|
-
return void 0;
|
|
16654
|
-
}
|
|
16655
|
-
};
|
|
16656
16634
|
function translateChildNodes(params2) {
|
|
16657
16635
|
const { content: nodes } = params2.node;
|
|
16658
16636
|
if (!nodes) return [];
|
|
@@ -18053,37 +18031,37 @@ const _NodeTranslator = class _NodeTranslator2 {
|
|
|
18053
18031
|
};
|
|
18054
18032
|
__publicField$2(_NodeTranslator, "translatorTypes", TranslatorTypes);
|
|
18055
18033
|
let NodeTranslator = _NodeTranslator;
|
|
18056
|
-
const encode$
|
|
18034
|
+
const encode$R = (attributes) => {
|
|
18057
18035
|
return attributes["w:type"];
|
|
18058
18036
|
};
|
|
18059
|
-
const decode$
|
|
18037
|
+
const decode$T = (attrs) => {
|
|
18060
18038
|
const { lineBreakType } = attrs;
|
|
18061
18039
|
return lineBreakType;
|
|
18062
18040
|
};
|
|
18063
18041
|
const attrConfig$s = Object.freeze({
|
|
18064
18042
|
xmlName: "w:type",
|
|
18065
18043
|
sdName: "lineBreakType",
|
|
18066
|
-
encode: encode$
|
|
18067
|
-
decode: decode$
|
|
18044
|
+
encode: encode$R,
|
|
18045
|
+
decode: decode$T
|
|
18068
18046
|
});
|
|
18069
|
-
const encode$
|
|
18047
|
+
const encode$Q = (attributes) => {
|
|
18070
18048
|
const xmlAttrValue = attributes["w:clear"];
|
|
18071
18049
|
return xmlAttrValue;
|
|
18072
18050
|
};
|
|
18073
|
-
const decode$
|
|
18051
|
+
const decode$S = (attrs) => {
|
|
18074
18052
|
const { clear } = attrs;
|
|
18075
18053
|
return clear;
|
|
18076
18054
|
};
|
|
18077
18055
|
const attrConfig$r = Object.freeze({
|
|
18078
18056
|
xmlName: "w:clear",
|
|
18079
18057
|
sdName: "clear",
|
|
18080
|
-
encode: encode$
|
|
18081
|
-
decode: decode$
|
|
18058
|
+
encode: encode$Q,
|
|
18059
|
+
decode: decode$S
|
|
18082
18060
|
});
|
|
18083
18061
|
const validXmlAttributes$j = [attrConfig$s, attrConfig$r];
|
|
18084
|
-
const XML_NODE_NAME$
|
|
18085
|
-
const SD_NODE_NAME$
|
|
18086
|
-
const encode$
|
|
18062
|
+
const XML_NODE_NAME$q = "w:br";
|
|
18063
|
+
const SD_NODE_NAME$k = "lineBreak";
|
|
18064
|
+
const encode$P = (_2, encodedAttrs) => {
|
|
18087
18065
|
const isPageBreak = encodedAttrs?.lineBreakType === "page";
|
|
18088
18066
|
const translated = {
|
|
18089
18067
|
type: isPageBreak ? "hardBreak" : "lineBreak"
|
|
@@ -18093,7 +18071,7 @@ const encode$N = (_2, encodedAttrs) => {
|
|
|
18093
18071
|
}
|
|
18094
18072
|
return translated;
|
|
18095
18073
|
};
|
|
18096
|
-
const decode$
|
|
18074
|
+
const decode$R = (params2, decodedAttrs) => {
|
|
18097
18075
|
const { node } = params2;
|
|
18098
18076
|
if (!node) return;
|
|
18099
18077
|
const wBreak = { name: "w:br" };
|
|
@@ -18110,39 +18088,39 @@ const decode$P = (params2, decodedAttrs) => {
|
|
|
18110
18088
|
};
|
|
18111
18089
|
return translated;
|
|
18112
18090
|
};
|
|
18113
|
-
const config$
|
|
18114
|
-
xmlName: XML_NODE_NAME$
|
|
18115
|
-
sdNodeOrKeyName: SD_NODE_NAME$
|
|
18091
|
+
const config$p = {
|
|
18092
|
+
xmlName: XML_NODE_NAME$q,
|
|
18093
|
+
sdNodeOrKeyName: SD_NODE_NAME$k,
|
|
18116
18094
|
type: NodeTranslator.translatorTypes.NODE,
|
|
18117
|
-
encode: encode$
|
|
18118
|
-
decode: decode$
|
|
18095
|
+
encode: encode$P,
|
|
18096
|
+
decode: decode$R,
|
|
18119
18097
|
attributes: validXmlAttributes$j
|
|
18120
18098
|
};
|
|
18121
|
-
const translator$
|
|
18122
|
-
const encode$
|
|
18123
|
-
const decode$
|
|
18099
|
+
const translator$23 = NodeTranslator.from(config$p);
|
|
18100
|
+
const encode$O = (attributes) => attributes?.["w:val"];
|
|
18101
|
+
const decode$Q = (attrs) => attrs?.highlight;
|
|
18124
18102
|
const attrConfig$q = Object.freeze({
|
|
18125
18103
|
xmlName: "w:val",
|
|
18126
18104
|
sdName: "highlight",
|
|
18127
|
-
encode: encode$
|
|
18128
|
-
decode: decode$
|
|
18105
|
+
encode: encode$O,
|
|
18106
|
+
decode: decode$Q
|
|
18129
18107
|
});
|
|
18130
18108
|
const validXmlAttributes$i = [attrConfig$q];
|
|
18131
|
-
const XML_NODE_NAME$
|
|
18109
|
+
const XML_NODE_NAME$p = "w:highlight";
|
|
18132
18110
|
const SD_ATTR_KEY$4 = "highlight";
|
|
18133
18111
|
const DISABLED_TOKENS = /* @__PURE__ */ new Set(["transparent", "none", "inherit"]);
|
|
18134
|
-
const encode$
|
|
18112
|
+
const encode$N = (params2, encodedAttrs = {}) => {
|
|
18135
18113
|
const { nodes } = params2;
|
|
18136
18114
|
const node = nodes?.[0];
|
|
18137
18115
|
const value = encodedAttrs.highlight ?? node?.attributes?.["w:val"];
|
|
18138
18116
|
return {
|
|
18139
18117
|
type: "attr",
|
|
18140
|
-
xmlName: XML_NODE_NAME$
|
|
18118
|
+
xmlName: XML_NODE_NAME$p,
|
|
18141
18119
|
sdNodeOrKeyName: SD_ATTR_KEY$4,
|
|
18142
18120
|
attributes: { "w:val": value ?? null }
|
|
18143
18121
|
};
|
|
18144
18122
|
};
|
|
18145
|
-
const decode$
|
|
18123
|
+
const decode$P = (params2) => {
|
|
18146
18124
|
const attrs = params2?.node?.attrs || {};
|
|
18147
18125
|
const highlightValue = attrs.highlight?.["w:val"] ?? attrs.highlight ?? attrs.color ?? null;
|
|
18148
18126
|
if (!highlightValue) return void 0;
|
|
@@ -18150,14 +18128,14 @@ const decode$N = (params2) => {
|
|
|
18150
18128
|
if (!normalizedValue) return void 0;
|
|
18151
18129
|
if (DISABLED_TOKENS.has(normalizedValue)) {
|
|
18152
18130
|
return {
|
|
18153
|
-
name: XML_NODE_NAME$
|
|
18131
|
+
name: XML_NODE_NAME$p,
|
|
18154
18132
|
attributes: { "w:val": "none" }
|
|
18155
18133
|
};
|
|
18156
18134
|
}
|
|
18157
18135
|
const keyword = getDocxHighlightKeywordFromHex(highlightValue);
|
|
18158
18136
|
if (keyword) {
|
|
18159
18137
|
return {
|
|
18160
|
-
name: XML_NODE_NAME$
|
|
18138
|
+
name: XML_NODE_NAME$p,
|
|
18161
18139
|
attributes: { "w:val": keyword }
|
|
18162
18140
|
};
|
|
18163
18141
|
}
|
|
@@ -18172,64 +18150,64 @@ const decode$N = (params2) => {
|
|
|
18172
18150
|
}
|
|
18173
18151
|
};
|
|
18174
18152
|
};
|
|
18175
|
-
const config$
|
|
18176
|
-
xmlName: XML_NODE_NAME$
|
|
18153
|
+
const config$o = {
|
|
18154
|
+
xmlName: XML_NODE_NAME$p,
|
|
18177
18155
|
sdNodeOrKeyName: SD_ATTR_KEY$4,
|
|
18178
18156
|
type: NodeTranslator.translatorTypes.ATTRIBUTE,
|
|
18179
|
-
encode: encode$
|
|
18180
|
-
decode: decode$
|
|
18157
|
+
encode: encode$N,
|
|
18158
|
+
decode: decode$P,
|
|
18181
18159
|
attributes: validXmlAttributes$i
|
|
18182
18160
|
};
|
|
18183
|
-
const translator$
|
|
18184
|
-
const encode$
|
|
18161
|
+
const translator$22 = NodeTranslator.from(config$o);
|
|
18162
|
+
const encode$M = (attributes) => {
|
|
18185
18163
|
return attributes["w:val"];
|
|
18186
18164
|
};
|
|
18187
|
-
const decode$
|
|
18165
|
+
const decode$O = (attrs) => {
|
|
18188
18166
|
const { tabType } = attrs || {};
|
|
18189
18167
|
return tabType;
|
|
18190
18168
|
};
|
|
18191
18169
|
const attrConfig$p = Object.freeze({
|
|
18192
18170
|
xmlName: "w:val",
|
|
18193
18171
|
sdName: "tabType",
|
|
18194
|
-
encode: encode$
|
|
18195
|
-
decode: decode$
|
|
18172
|
+
encode: encode$M,
|
|
18173
|
+
decode: decode$O
|
|
18196
18174
|
});
|
|
18197
|
-
const encode$
|
|
18175
|
+
const encode$L = (attributes) => {
|
|
18198
18176
|
return attributes["w:leader"];
|
|
18199
18177
|
};
|
|
18200
|
-
const decode$
|
|
18178
|
+
const decode$N = (attrs) => {
|
|
18201
18179
|
const { leader } = attrs || {};
|
|
18202
18180
|
return leader;
|
|
18203
18181
|
};
|
|
18204
18182
|
const attrConfig$o = Object.freeze({
|
|
18205
18183
|
xmlName: "w:leader",
|
|
18206
18184
|
sdName: "leader",
|
|
18207
|
-
encode: encode$
|
|
18208
|
-
decode: decode$
|
|
18185
|
+
encode: encode$L,
|
|
18186
|
+
decode: decode$N
|
|
18209
18187
|
});
|
|
18210
|
-
const encode$
|
|
18188
|
+
const encode$K = (attributes) => {
|
|
18211
18189
|
if (attributes["w:pos"] != null) return parseInt(attributes["w:pos"]);
|
|
18212
18190
|
return null;
|
|
18213
18191
|
};
|
|
18214
|
-
const decode$
|
|
18192
|
+
const decode$M = (attrs) => {
|
|
18215
18193
|
const { pos } = attrs || {};
|
|
18216
18194
|
return pos?.toString();
|
|
18217
18195
|
};
|
|
18218
18196
|
const attrConfig$n = Object.freeze({
|
|
18219
18197
|
xmlName: "w:pos",
|
|
18220
18198
|
sdName: "pos",
|
|
18221
|
-
encode: encode$
|
|
18222
|
-
decode: decode$
|
|
18199
|
+
encode: encode$K,
|
|
18200
|
+
decode: decode$M
|
|
18223
18201
|
});
|
|
18224
18202
|
const validXmlAttributes$h = [attrConfig$p, attrConfig$n, attrConfig$o];
|
|
18225
|
-
const XML_NODE_NAME$
|
|
18226
|
-
const SD_NODE_NAME$
|
|
18227
|
-
const encode$
|
|
18203
|
+
const XML_NODE_NAME$o = "w:tab";
|
|
18204
|
+
const SD_NODE_NAME$j = "tab";
|
|
18205
|
+
const encode$J = (_2, encodedAttrs = {}) => {
|
|
18228
18206
|
const translated = { type: "tab" };
|
|
18229
18207
|
if (encodedAttrs) translated.attrs = { ...encodedAttrs };
|
|
18230
18208
|
return translated;
|
|
18231
18209
|
};
|
|
18232
|
-
function decode$
|
|
18210
|
+
function decode$L(params2, decodedAttrs = {}) {
|
|
18233
18211
|
const { node } = params2 || {};
|
|
18234
18212
|
if (!node) return;
|
|
18235
18213
|
const wTab = { name: "w:tab", elements: [] };
|
|
@@ -18251,15 +18229,24 @@ function decode$J(params2, decodedAttrs = {}) {
|
|
|
18251
18229
|
}
|
|
18252
18230
|
return translated;
|
|
18253
18231
|
}
|
|
18254
|
-
const config$
|
|
18255
|
-
xmlName: XML_NODE_NAME$
|
|
18256
|
-
sdNodeOrKeyName: SD_NODE_NAME$
|
|
18232
|
+
const config$n = {
|
|
18233
|
+
xmlName: XML_NODE_NAME$o,
|
|
18234
|
+
sdNodeOrKeyName: SD_NODE_NAME$j,
|
|
18257
18235
|
type: NodeTranslator.translatorTypes.NODE,
|
|
18258
|
-
encode: encode$
|
|
18259
|
-
decode: decode$
|
|
18236
|
+
encode: encode$J,
|
|
18237
|
+
decode: decode$L,
|
|
18260
18238
|
attributes: validXmlAttributes$h
|
|
18261
18239
|
};
|
|
18262
|
-
const translator$
|
|
18240
|
+
const translator$21 = NodeTranslator.from(config$n);
|
|
18241
|
+
const carbonCopy = (obj) => {
|
|
18242
|
+
if (!obj) return void 0;
|
|
18243
|
+
try {
|
|
18244
|
+
return JSON.parse(JSON.stringify(obj));
|
|
18245
|
+
} catch (e) {
|
|
18246
|
+
console.error("Error in carbonCopy", obj, e);
|
|
18247
|
+
return void 0;
|
|
18248
|
+
}
|
|
18249
|
+
};
|
|
18263
18250
|
const mergeTextNodes = (nodes) => {
|
|
18264
18251
|
if (!nodes || !Array.isArray(nodes)) {
|
|
18265
18252
|
return nodes;
|
|
@@ -18576,53 +18563,53 @@ const integerToString = (value) => {
|
|
|
18576
18563
|
const intValue = parseInteger(value);
|
|
18577
18564
|
return intValue != void 0 ? String(intValue) : void 0;
|
|
18578
18565
|
};
|
|
18579
|
-
const translator$
|
|
18580
|
-
const translator$
|
|
18581
|
-
const translator$
|
|
18582
|
-
const encode$
|
|
18583
|
-
const decode$
|
|
18566
|
+
const translator$20 = NodeTranslator.from(createSingleBooleanPropertyHandler("w:b", "bold"));
|
|
18567
|
+
const translator$1$ = NodeTranslator.from(createSingleBooleanPropertyHandler("w:bCs", "boldCs"));
|
|
18568
|
+
const translator$1_ = NodeTranslator.from(createSingleBooleanPropertyHandler("w:i", "italic"));
|
|
18569
|
+
const encode$I = (attributes) => attributes?.["w:val"];
|
|
18570
|
+
const decode$K = (attrs) => attrs?.underline;
|
|
18584
18571
|
const attrConfig$m = Object.freeze({
|
|
18585
18572
|
xmlName: "w:val",
|
|
18586
18573
|
sdName: "underline",
|
|
18587
|
-
encode: encode$
|
|
18588
|
-
decode: decode$
|
|
18574
|
+
encode: encode$I,
|
|
18575
|
+
decode: decode$K
|
|
18589
18576
|
});
|
|
18590
|
-
const encode$
|
|
18591
|
-
const decode$
|
|
18577
|
+
const encode$H = (attributes) => attributes?.["w:color"];
|
|
18578
|
+
const decode$J = (attrs) => attrs?.color;
|
|
18592
18579
|
const attrConfig$l = Object.freeze({
|
|
18593
18580
|
xmlName: "w:color",
|
|
18594
18581
|
sdName: "color",
|
|
18595
|
-
encode: encode$
|
|
18596
|
-
decode: decode$
|
|
18582
|
+
encode: encode$H,
|
|
18583
|
+
decode: decode$J
|
|
18597
18584
|
});
|
|
18598
|
-
const encode$
|
|
18599
|
-
const decode$
|
|
18585
|
+
const encode$G = (attributes) => attributes?.["w:themeColor"];
|
|
18586
|
+
const decode$I = (attrs) => attrs?.themeColor;
|
|
18600
18587
|
const attrConfig$k = Object.freeze({
|
|
18601
18588
|
xmlName: "w:themeColor",
|
|
18602
18589
|
sdName: "themeColor",
|
|
18603
|
-
encode: encode$
|
|
18604
|
-
decode: decode$
|
|
18590
|
+
encode: encode$G,
|
|
18591
|
+
decode: decode$I
|
|
18605
18592
|
});
|
|
18606
|
-
const encode$
|
|
18607
|
-
const decode$
|
|
18593
|
+
const encode$F = (attributes) => attributes?.["w:themeTint"];
|
|
18594
|
+
const decode$H = (attrs) => attrs?.themeTint;
|
|
18608
18595
|
const attrConfig$j = Object.freeze({
|
|
18609
18596
|
xmlName: "w:themeTint",
|
|
18610
18597
|
sdName: "themeTint",
|
|
18611
|
-
encode: encode$
|
|
18612
|
-
decode: decode$
|
|
18598
|
+
encode: encode$F,
|
|
18599
|
+
decode: decode$H
|
|
18613
18600
|
});
|
|
18614
|
-
const encode$
|
|
18615
|
-
const decode$
|
|
18601
|
+
const encode$E = (attributes) => attributes?.["w:themeShade"];
|
|
18602
|
+
const decode$G = (attrs) => attrs?.themeShade;
|
|
18616
18603
|
const attrConfig$i = Object.freeze({
|
|
18617
18604
|
xmlName: "w:themeShade",
|
|
18618
18605
|
sdName: "themeShade",
|
|
18619
|
-
encode: encode$
|
|
18620
|
-
decode: decode$
|
|
18606
|
+
encode: encode$E,
|
|
18607
|
+
decode: decode$G
|
|
18621
18608
|
});
|
|
18622
18609
|
const validXmlAttributes$g = [attrConfig$m, attrConfig$l, attrConfig$k, attrConfig$j, attrConfig$i];
|
|
18623
|
-
const XML_NODE_NAME$
|
|
18610
|
+
const XML_NODE_NAME$n = "w:u";
|
|
18624
18611
|
const SD_ATTR_KEY$3 = "underline";
|
|
18625
|
-
const encode$
|
|
18612
|
+
const encode$D = (params2, encodedAttrs = {}) => {
|
|
18626
18613
|
const { nodes } = params2;
|
|
18627
18614
|
const node = nodes?.[0];
|
|
18628
18615
|
const sourceAttrs = node?.attributes || {};
|
|
@@ -18638,12 +18625,12 @@ const encode$B = (params2, encodedAttrs = {}) => {
|
|
|
18638
18625
|
if (themeShade !== void 0 && themeShade !== null) attributes["w:themeShade"] = themeShade;
|
|
18639
18626
|
return {
|
|
18640
18627
|
type: "attr",
|
|
18641
|
-
xmlName: XML_NODE_NAME$
|
|
18628
|
+
xmlName: XML_NODE_NAME$n,
|
|
18642
18629
|
sdNodeOrKeyName: SD_ATTR_KEY$3,
|
|
18643
18630
|
attributes
|
|
18644
18631
|
};
|
|
18645
18632
|
};
|
|
18646
|
-
const decode$
|
|
18633
|
+
const decode$F = (params2) => {
|
|
18647
18634
|
const attrs = params2?.node?.attrs?.underline || params2?.node?.attrs || {};
|
|
18648
18635
|
const underlineType = attrs.underlineType ?? attrs.underline ?? attrs["w:val"] ?? null;
|
|
18649
18636
|
const color = attrs.underlineColor ?? attrs.color ?? attrs["w:color"] ?? null;
|
|
@@ -18661,22 +18648,22 @@ const decode$D = (params2) => {
|
|
|
18661
18648
|
if (themeTint) attributes["w:themeTint"] = themeTint;
|
|
18662
18649
|
if (themeShade) attributes["w:themeShade"] = themeShade;
|
|
18663
18650
|
return {
|
|
18664
|
-
name: XML_NODE_NAME$
|
|
18651
|
+
name: XML_NODE_NAME$n,
|
|
18665
18652
|
attributes
|
|
18666
18653
|
};
|
|
18667
18654
|
};
|
|
18668
|
-
const config$
|
|
18669
|
-
xmlName: XML_NODE_NAME$
|
|
18655
|
+
const config$m = {
|
|
18656
|
+
xmlName: XML_NODE_NAME$n,
|
|
18670
18657
|
sdNodeOrKeyName: SD_ATTR_KEY$3,
|
|
18671
18658
|
type: NodeTranslator.translatorTypes.ATTRIBUTE,
|
|
18672
|
-
encode: encode$
|
|
18673
|
-
decode: decode$
|
|
18659
|
+
encode: encode$D,
|
|
18660
|
+
decode: decode$F,
|
|
18674
18661
|
attributes: validXmlAttributes$g
|
|
18675
18662
|
};
|
|
18676
|
-
const translator$
|
|
18677
|
-
const translator$
|
|
18678
|
-
const translator$
|
|
18679
|
-
const translator$
|
|
18663
|
+
const translator$1Z = NodeTranslator.from(config$m);
|
|
18664
|
+
const translator$1Y = NodeTranslator.from(createSingleBooleanPropertyHandler("w:strike"));
|
|
18665
|
+
const translator$1X = NodeTranslator.from(createSingleBooleanPropertyHandler("w:dstrike"));
|
|
18666
|
+
const translator$1W = NodeTranslator.from({
|
|
18680
18667
|
xmlName: "w:color",
|
|
18681
18668
|
sdNodeOrKeyName: "color",
|
|
18682
18669
|
attributes: [
|
|
@@ -18693,7 +18680,7 @@ const translator$1U = NodeTranslator.from({
|
|
|
18693
18680
|
return Object.keys(decodedAttrs).length > 0 ? { attributes: decodedAttrs } : void 0;
|
|
18694
18681
|
}
|
|
18695
18682
|
});
|
|
18696
|
-
const translator$
|
|
18683
|
+
const translator$1V = NodeTranslator.from({
|
|
18697
18684
|
xmlName: "w:rFonts",
|
|
18698
18685
|
sdNodeOrKeyName: "fontFamily",
|
|
18699
18686
|
attributes: [
|
|
@@ -18724,16 +18711,16 @@ const translator$1T = NodeTranslator.from({
|
|
|
18724
18711
|
return Object.keys(decodedAttrs).length > 0 ? { attributes: decodedAttrs } : void 0;
|
|
18725
18712
|
}
|
|
18726
18713
|
});
|
|
18727
|
-
const translator$
|
|
18728
|
-
const translator$
|
|
18729
|
-
const translator$
|
|
18730
|
-
const translator$
|
|
18714
|
+
const translator$1U = NodeTranslator.from(createSingleAttrPropertyHandler("w:rStyle", "styleId"));
|
|
18715
|
+
const translator$1T = NodeTranslator.from(createSingleIntegerPropertyHandler("w:sz", "fontSize"));
|
|
18716
|
+
const translator$1S = NodeTranslator.from(createSingleIntegerPropertyHandler("w:szCs", "fontSizeCs"));
|
|
18717
|
+
const translator$1R = NodeTranslator.from({
|
|
18731
18718
|
xmlName: "w:caps",
|
|
18732
18719
|
sdNodeOrKeyName: "textTransform",
|
|
18733
18720
|
encode: ({ nodes }) => parseBoolean(nodes[0].attributes?.["w:val"] ?? "1") ? "uppercase" : "none",
|
|
18734
18721
|
decode: ({ node }) => node.attrs["textTransform"] != null ? { name: "w:caps", attributes: { "w:val": booleanToString(node.attrs["textTransform"] === "uppercase") } } : void 0
|
|
18735
18722
|
});
|
|
18736
|
-
const translator$
|
|
18723
|
+
const translator$1Q = NodeTranslator.from({
|
|
18737
18724
|
xmlName: "w:shd",
|
|
18738
18725
|
sdNodeOrKeyName: "shading",
|
|
18739
18726
|
attributes: [
|
|
@@ -18755,7 +18742,7 @@ const translator$1O = NodeTranslator.from({
|
|
|
18755
18742
|
return Object.keys(decodedAttrs).length > 0 ? { attributes: decodedAttrs } : void 0;
|
|
18756
18743
|
}
|
|
18757
18744
|
});
|
|
18758
|
-
const translator$
|
|
18745
|
+
const translator$1P = NodeTranslator.from({
|
|
18759
18746
|
xmlName: "w:lang",
|
|
18760
18747
|
sdNodeOrKeyName: "lang",
|
|
18761
18748
|
attributes: [createAttributeHandler("w:val"), createAttributeHandler("w:eastAsia"), createAttributeHandler("w:bidi")],
|
|
@@ -18767,26 +18754,26 @@ const translator$1N = NodeTranslator.from({
|
|
|
18767
18754
|
return Object.keys(decodedAttrs).length > 0 ? { attributes: decodedAttrs } : void 0;
|
|
18768
18755
|
}
|
|
18769
18756
|
});
|
|
18770
|
-
const translator$
|
|
18757
|
+
const translator$1O = NodeTranslator.from(createSingleIntegerPropertyHandler("w:spacing", "letterSpacing"));
|
|
18771
18758
|
const propertyTranslators$b = [
|
|
18759
|
+
translator$20,
|
|
18760
|
+
translator$1$,
|
|
18772
18761
|
translator$1_,
|
|
18773
18762
|
translator$1Z,
|
|
18774
18763
|
translator$1Y,
|
|
18775
18764
|
translator$1X,
|
|
18776
18765
|
translator$1W,
|
|
18766
|
+
translator$22,
|
|
18777
18767
|
translator$1V,
|
|
18778
18768
|
translator$1U,
|
|
18779
|
-
translator$20,
|
|
18780
18769
|
translator$1T,
|
|
18781
18770
|
translator$1S,
|
|
18782
18771
|
translator$1R,
|
|
18783
18772
|
translator$1Q,
|
|
18784
18773
|
translator$1P,
|
|
18785
|
-
translator$1O
|
|
18786
|
-
translator$1N,
|
|
18787
|
-
translator$1M
|
|
18774
|
+
translator$1O
|
|
18788
18775
|
];
|
|
18789
|
-
const translator$
|
|
18776
|
+
const translator$1N = NodeTranslator.from(
|
|
18790
18777
|
createNestedPropertiesTranslator("w:rPr", "runProperties", propertyTranslators$b)
|
|
18791
18778
|
);
|
|
18792
18779
|
const SUPPORTED_ALTERNATE_CONTENT_REQUIRES = /* @__PURE__ */ new Set([
|
|
@@ -18803,10 +18790,10 @@ const SUPPORTED_ALTERNATE_CONTENT_REQUIRES = /* @__PURE__ */ new Set([
|
|
|
18803
18790
|
"w16sdtfl",
|
|
18804
18791
|
"w16se"
|
|
18805
18792
|
]);
|
|
18806
|
-
const XML_NODE_NAME$
|
|
18807
|
-
const SD_NODE_NAME$
|
|
18793
|
+
const XML_NODE_NAME$m = "mc:AlternateContent";
|
|
18794
|
+
const SD_NODE_NAME$i = [];
|
|
18808
18795
|
const validXmlAttributes$f = [];
|
|
18809
|
-
function encode$
|
|
18796
|
+
function encode$C(params2) {
|
|
18810
18797
|
const { nodeListHandler } = params2;
|
|
18811
18798
|
const { node } = params2.extraParams;
|
|
18812
18799
|
if (!node || !node.type) {
|
|
@@ -18822,7 +18809,7 @@ function encode$A(params2) {
|
|
|
18822
18809
|
path: buildPath(params2.path, node, branch)
|
|
18823
18810
|
});
|
|
18824
18811
|
}
|
|
18825
|
-
function decode$
|
|
18812
|
+
function decode$E(params2) {
|
|
18826
18813
|
const { node } = params2;
|
|
18827
18814
|
const { drawingContent } = node.attrs;
|
|
18828
18815
|
const drawing = {
|
|
@@ -18839,12 +18826,12 @@ function decode$C(params2) {
|
|
|
18839
18826
|
elements: [choice]
|
|
18840
18827
|
};
|
|
18841
18828
|
}
|
|
18842
|
-
const config$
|
|
18843
|
-
xmlName: XML_NODE_NAME$
|
|
18844
|
-
sdNodeOrKeyName: SD_NODE_NAME$
|
|
18829
|
+
const config$l = {
|
|
18830
|
+
xmlName: XML_NODE_NAME$m,
|
|
18831
|
+
sdNodeOrKeyName: SD_NODE_NAME$i,
|
|
18845
18832
|
type: NodeTranslator.translatorTypes.NODE,
|
|
18846
|
-
encode: encode$
|
|
18847
|
-
decode: decode$
|
|
18833
|
+
encode: encode$C,
|
|
18834
|
+
decode: decode$E,
|
|
18848
18835
|
attributes: validXmlAttributes$f
|
|
18849
18836
|
};
|
|
18850
18837
|
function selectAlternateContentElements(node) {
|
|
@@ -18868,18 +18855,18 @@ function selectAlternateContentElements(node) {
|
|
|
18868
18855
|
elements: carbonCopy(selectedElements)
|
|
18869
18856
|
};
|
|
18870
18857
|
}
|
|
18871
|
-
const translator$
|
|
18858
|
+
const translator$1M = NodeTranslator.from(config$l);
|
|
18872
18859
|
function buildPath(existingPath = [], node, branch) {
|
|
18873
18860
|
const path = [...existingPath];
|
|
18874
18861
|
if (node) path.push(node);
|
|
18875
18862
|
if (branch) path.push(branch);
|
|
18876
18863
|
return path;
|
|
18877
18864
|
}
|
|
18878
|
-
const translator$
|
|
18879
|
-
const translator$
|
|
18880
|
-
const translator$
|
|
18881
|
-
const translator$
|
|
18882
|
-
const translator$
|
|
18865
|
+
const translator$1L = NodeTranslator.from(createSingleBooleanPropertyHandler("w:adjustRightInd"));
|
|
18866
|
+
const translator$1K = NodeTranslator.from(createSingleBooleanPropertyHandler("w:autoSpaceDE"));
|
|
18867
|
+
const translator$1J = NodeTranslator.from(createSingleBooleanPropertyHandler("w:autoSpaceDN"));
|
|
18868
|
+
const translator$1I = NodeTranslator.from(createSingleBooleanPropertyHandler("w:bidi", "rightToLeft"));
|
|
18869
|
+
const translator$1H = NodeTranslator.from({
|
|
18883
18870
|
xmlName: "w:cnfStyle",
|
|
18884
18871
|
sdNodeOrKeyName: "cnfStyle",
|
|
18885
18872
|
attributes: [
|
|
@@ -18905,9 +18892,9 @@ const translator$1F = NodeTranslator.from({
|
|
|
18905
18892
|
return Object.keys(decodedAttrs).length > 0 ? { attributes: decodedAttrs } : void 0;
|
|
18906
18893
|
}
|
|
18907
18894
|
});
|
|
18908
|
-
const translator$
|
|
18909
|
-
const translator$
|
|
18910
|
-
const translator$
|
|
18895
|
+
const translator$1G = NodeTranslator.from(createSingleBooleanPropertyHandler("w:contextualSpacing"));
|
|
18896
|
+
const translator$1F = NodeTranslator.from(createSingleAttrPropertyHandler("w:divId"));
|
|
18897
|
+
const translator$1E = NodeTranslator.from({
|
|
18911
18898
|
xmlName: "w:framePr",
|
|
18912
18899
|
sdNodeOrKeyName: "framePr",
|
|
18913
18900
|
attributes: [
|
|
@@ -18935,7 +18922,7 @@ const translator$1C = NodeTranslator.from({
|
|
|
18935
18922
|
return Object.keys(decodedAttrs).length > 0 ? { attributes: decodedAttrs } : void 0;
|
|
18936
18923
|
}
|
|
18937
18924
|
});
|
|
18938
|
-
const translator$
|
|
18925
|
+
const translator$1D = NodeTranslator.from({
|
|
18939
18926
|
xmlName: "w:ind",
|
|
18940
18927
|
sdNodeOrKeyName: "indent",
|
|
18941
18928
|
attributes: [
|
|
@@ -18960,12 +18947,12 @@ const translator$1B = NodeTranslator.from({
|
|
|
18960
18947
|
return Object.keys(decodedAttrs).length > 0 ? { attributes: decodedAttrs } : void 0;
|
|
18961
18948
|
}
|
|
18962
18949
|
});
|
|
18963
|
-
const translator$
|
|
18964
|
-
const translator$
|
|
18965
|
-
const translator$
|
|
18966
|
-
const translator$
|
|
18967
|
-
const translator$
|
|
18968
|
-
const translator$
|
|
18950
|
+
const translator$1C = NodeTranslator.from(createSingleAttrPropertyHandler("w:jc", "justification"));
|
|
18951
|
+
const translator$1B = NodeTranslator.from(createSingleBooleanPropertyHandler("w:keepLines"));
|
|
18952
|
+
const translator$1A = NodeTranslator.from(createSingleBooleanPropertyHandler("w:keepNext"));
|
|
18953
|
+
const translator$1z = NodeTranslator.from(createSingleBooleanPropertyHandler("w:kinsoku"));
|
|
18954
|
+
const translator$1y = NodeTranslator.from(createSingleBooleanPropertyHandler("w:mirrorIndents"));
|
|
18955
|
+
const translator$1x = NodeTranslator.from(createSingleIntegerPropertyHandler("w:ilvl"));
|
|
18969
18956
|
const createTrackStyleMark = (marks) => {
|
|
18970
18957
|
const trackStyleMark = marks.find((mark) => mark.type === "trackFormat");
|
|
18971
18958
|
if (trackStyleMark) {
|
|
@@ -18983,7 +18970,7 @@ const createTrackStyleMark = (marks) => {
|
|
|
18983
18970
|
}
|
|
18984
18971
|
return void 0;
|
|
18985
18972
|
};
|
|
18986
|
-
const XML_NODE_NAME$
|
|
18973
|
+
const XML_NODE_NAME$l = "w:ins";
|
|
18987
18974
|
const SD_ATTR_KEY$2 = "trackInsert";
|
|
18988
18975
|
const validXmlAttributes$e = [
|
|
18989
18976
|
createAttributeHandler("w:id", "id"),
|
|
@@ -18991,7 +18978,7 @@ const validXmlAttributes$e = [
|
|
|
18991
18978
|
createAttributeHandler("w:author", "author"),
|
|
18992
18979
|
createAttributeHandler("w:authorEmail", "authorEmail")
|
|
18993
18980
|
];
|
|
18994
|
-
const encode$
|
|
18981
|
+
const encode$B = (params2, encodedAttrs = {}) => {
|
|
18995
18982
|
const { nodeListHandler, extraParams = {} } = params2;
|
|
18996
18983
|
const { node } = extraParams;
|
|
18997
18984
|
const subs = nodeListHandler.handler({
|
|
@@ -19007,7 +18994,7 @@ const encode$z = (params2, encodedAttrs = {}) => {
|
|
|
19007
18994
|
});
|
|
19008
18995
|
return subs;
|
|
19009
18996
|
};
|
|
19010
|
-
function decode$
|
|
18997
|
+
function decode$D(params2) {
|
|
19011
18998
|
const { node } = params2;
|
|
19012
18999
|
if (!node || !node.type) {
|
|
19013
19000
|
return null;
|
|
@@ -19032,50 +19019,50 @@ function decode$B(params2) {
|
|
|
19032
19019
|
elements: [translatedTextNode]
|
|
19033
19020
|
};
|
|
19034
19021
|
}
|
|
19035
|
-
const config$
|
|
19036
|
-
xmlName: XML_NODE_NAME$
|
|
19022
|
+
const config$k = {
|
|
19023
|
+
xmlName: XML_NODE_NAME$l,
|
|
19037
19024
|
sdNodeOrKeyName: SD_ATTR_KEY$2,
|
|
19038
19025
|
type: NodeTranslator.translatorTypes.ATTRIBUTE,
|
|
19039
|
-
encode: encode$
|
|
19040
|
-
decode: decode$
|
|
19026
|
+
encode: encode$B,
|
|
19027
|
+
decode: decode$D,
|
|
19041
19028
|
attributes: validXmlAttributes$e
|
|
19042
19029
|
};
|
|
19043
|
-
const translator$
|
|
19044
|
-
const translator$
|
|
19045
|
-
const propertyTranslators$a = [translator$
|
|
19046
|
-
const translator$
|
|
19030
|
+
const translator$1w = NodeTranslator.from(config$k);
|
|
19031
|
+
const translator$1v = NodeTranslator.from(createSingleIntegerPropertyHandler("w:numId"));
|
|
19032
|
+
const propertyTranslators$a = [translator$1M, translator$1x, translator$1w, translator$1v];
|
|
19033
|
+
const translator$1u = NodeTranslator.from(
|
|
19047
19034
|
createNestedPropertiesTranslator("w:numPr", "numberingProperties", propertyTranslators$a)
|
|
19048
19035
|
);
|
|
19049
|
-
const translator$
|
|
19036
|
+
const translator$1t = NodeTranslator.from(
|
|
19050
19037
|
createSingleAttrPropertyHandler("w:outlineLvl", "outlineLvl", "w:val", parseInteger, integerToString)
|
|
19051
19038
|
);
|
|
19052
|
-
const translator$
|
|
19053
|
-
const translator$
|
|
19054
|
-
const translator$
|
|
19055
|
-
const translator$
|
|
19056
|
-
const translator$
|
|
19057
|
-
const translator$
|
|
19058
|
-
const translator$
|
|
19059
|
-
const translator$
|
|
19060
|
-
const translator$
|
|
19061
|
-
const translator$
|
|
19062
|
-
const translator$
|
|
19039
|
+
const translator$1s = NodeTranslator.from(createSingleBooleanPropertyHandler("w:overflowPunct"));
|
|
19040
|
+
const translator$1r = NodeTranslator.from(createBorderPropertyHandler("w:bar"));
|
|
19041
|
+
const translator$1q = NodeTranslator.from(createBorderPropertyHandler("w:between"));
|
|
19042
|
+
const translator$1p = NodeTranslator.from(createBorderPropertyHandler("w:bottom"));
|
|
19043
|
+
const translator$1o = NodeTranslator.from(createMeasurementPropertyHandler("w:bottom", "marginBottom"));
|
|
19044
|
+
const translator$1n = NodeTranslator.from(createBorderPropertyHandler("w:left"));
|
|
19045
|
+
const translator$1m = NodeTranslator.from(createMeasurementPropertyHandler("w:left", "marginLeft"));
|
|
19046
|
+
const translator$1l = NodeTranslator.from(createBorderPropertyHandler("w:right"));
|
|
19047
|
+
const translator$1k = NodeTranslator.from(createMeasurementPropertyHandler("w:right", "marginRight"));
|
|
19048
|
+
const translator$1j = NodeTranslator.from(createBorderPropertyHandler("w:top"));
|
|
19049
|
+
const translator$1i = NodeTranslator.from(createMeasurementPropertyHandler("w:top", "marginTop"));
|
|
19063
19050
|
const propertyTranslators$9 = [
|
|
19064
|
-
translator$
|
|
19051
|
+
translator$1M,
|
|
19052
|
+
translator$1r,
|
|
19053
|
+
translator$1q,
|
|
19065
19054
|
translator$1p,
|
|
19066
|
-
translator$1o,
|
|
19067
19055
|
translator$1n,
|
|
19068
19056
|
translator$1l,
|
|
19069
|
-
translator$1j
|
|
19070
|
-
translator$1h
|
|
19057
|
+
translator$1j
|
|
19071
19058
|
];
|
|
19072
|
-
const translator$
|
|
19059
|
+
const translator$1h = NodeTranslator.from(
|
|
19073
19060
|
createNestedPropertiesTranslator("w:pBdr", "borders", propertyTranslators$9)
|
|
19074
19061
|
);
|
|
19075
|
-
const translator$
|
|
19076
|
-
const translator$
|
|
19077
|
-
const translator$
|
|
19078
|
-
const translator$
|
|
19062
|
+
const translator$1g = NodeTranslator.from(createSingleAttrPropertyHandler("w:pStyle", "styleId"));
|
|
19063
|
+
const translator$1f = NodeTranslator.from(createSingleBooleanPropertyHandler("w:pageBreakBefore"));
|
|
19064
|
+
const translator$1e = NodeTranslator.from(createSingleBooleanPropertyHandler("w:snapToGrid"));
|
|
19065
|
+
const translator$1d = NodeTranslator.from({
|
|
19079
19066
|
xmlName: "w:spacing",
|
|
19080
19067
|
sdNodeOrKeyName: "spacing",
|
|
19081
19068
|
attributes: [
|
|
@@ -19096,20 +19083,22 @@ const translator$1b = NodeTranslator.from({
|
|
|
19096
19083
|
return Object.keys(decodedAttrs).length > 0 ? { attributes: decodedAttrs } : void 0;
|
|
19097
19084
|
}
|
|
19098
19085
|
});
|
|
19099
|
-
const translator$
|
|
19100
|
-
const translator$
|
|
19101
|
-
const translator$
|
|
19102
|
-
const propertyTranslators$8 = [translator$
|
|
19103
|
-
const translator$
|
|
19086
|
+
const translator$1c = NodeTranslator.from(createSingleBooleanPropertyHandler("w:suppressAutoHyphens"));
|
|
19087
|
+
const translator$1b = NodeTranslator.from(createSingleBooleanPropertyHandler("w:suppressLineNumbers"));
|
|
19088
|
+
const translator$1a = NodeTranslator.from(createSingleBooleanPropertyHandler("w:suppressOverlap"));
|
|
19089
|
+
const propertyTranslators$8 = [translator$1M, translator$21];
|
|
19090
|
+
const translator$19 = NodeTranslator.from(
|
|
19104
19091
|
createNestedArrayPropertyHandler("w:tabs", "tabStops", propertyTranslators$8, { skipRun: true })
|
|
19105
19092
|
);
|
|
19106
|
-
const translator$
|
|
19107
|
-
const translator$
|
|
19108
|
-
const translator$
|
|
19109
|
-
const translator$
|
|
19110
|
-
const translator$
|
|
19111
|
-
const translator$
|
|
19093
|
+
const translator$18 = NodeTranslator.from(createSingleAttrPropertyHandler("w:textAlignment"));
|
|
19094
|
+
const translator$17 = NodeTranslator.from(createSingleAttrPropertyHandler("w:textDirection"));
|
|
19095
|
+
const translator$16 = NodeTranslator.from(createSingleAttrPropertyHandler("w:textboxTightWrap"));
|
|
19096
|
+
const translator$15 = NodeTranslator.from(createSingleBooleanPropertyHandler("w:topLinePunct"));
|
|
19097
|
+
const translator$14 = NodeTranslator.from(createSingleBooleanPropertyHandler("w:widowControl"));
|
|
19098
|
+
const translator$13 = NodeTranslator.from(createSingleBooleanPropertyHandler("w:wordWrap"));
|
|
19112
19099
|
const propertyTranslators$7 = [
|
|
19100
|
+
translator$1M,
|
|
19101
|
+
translator$1L,
|
|
19113
19102
|
translator$1K,
|
|
19114
19103
|
translator$1J,
|
|
19115
19104
|
translator$1I,
|
|
@@ -19123,15 +19112,15 @@ const propertyTranslators$7 = [
|
|
|
19123
19112
|
translator$1A,
|
|
19124
19113
|
translator$1z,
|
|
19125
19114
|
translator$1y,
|
|
19126
|
-
translator$
|
|
19127
|
-
translator$
|
|
19115
|
+
translator$1u,
|
|
19116
|
+
translator$1t,
|
|
19128
19117
|
translator$1s,
|
|
19129
|
-
translator$
|
|
19130
|
-
translator$
|
|
19118
|
+
translator$1h,
|
|
19119
|
+
translator$1g,
|
|
19131
19120
|
translator$1f,
|
|
19121
|
+
translator$1Q,
|
|
19132
19122
|
translator$1e,
|
|
19133
19123
|
translator$1d,
|
|
19134
|
-
translator$1O,
|
|
19135
19124
|
translator$1c,
|
|
19136
19125
|
translator$1b,
|
|
19137
19126
|
translator$1a,
|
|
@@ -19142,11 +19131,9 @@ const propertyTranslators$7 = [
|
|
|
19142
19131
|
translator$15,
|
|
19143
19132
|
translator$14,
|
|
19144
19133
|
translator$13,
|
|
19145
|
-
translator$
|
|
19146
|
-
translator$11,
|
|
19147
|
-
translator$1L
|
|
19134
|
+
translator$1N
|
|
19148
19135
|
];
|
|
19149
|
-
const translator$
|
|
19136
|
+
const translator$12 = NodeTranslator.from(
|
|
19150
19137
|
createNestedPropertiesTranslator("w:pPr", "paragraphProperties", propertyTranslators$7)
|
|
19151
19138
|
);
|
|
19152
19139
|
function getUnderlineCssString({ type: type2 = "single", color = null, thickness = null, approximate = true } = {}) {
|
|
@@ -19215,12 +19202,12 @@ function getUnderlineCssString({ type: type2 = "single", color = null, thickness
|
|
|
19215
19202
|
}
|
|
19216
19203
|
const resolveRunProperties = (params2, inlineRpr, resolvedPpr, isListNumber = false, numberingDefinedInline = false) => {
|
|
19217
19204
|
const paragraphStyleId = resolvedPpr?.styleId;
|
|
19218
|
-
const paragraphStyleProps = resolveStyleChain(params2, paragraphStyleId, translator$
|
|
19219
|
-
const defaultProps2 = getDefaultProperties(params2, translator$
|
|
19220
|
-
const { properties: normalProps, isDefault: isNormalDefault } = getStyleProperties(params2, "Normal", translator$
|
|
19205
|
+
const paragraphStyleProps = resolveStyleChain(params2, paragraphStyleId, translator$1N);
|
|
19206
|
+
const defaultProps2 = getDefaultProperties(params2, translator$1N);
|
|
19207
|
+
const { properties: normalProps, isDefault: isNormalDefault } = getStyleProperties(params2, "Normal", translator$1N);
|
|
19221
19208
|
let runStyleProps = {};
|
|
19222
19209
|
if (!paragraphStyleId?.startsWith("TOC")) {
|
|
19223
|
-
runStyleProps = inlineRpr.styleId ? resolveStyleChain(params2, inlineRpr.styleId, translator$
|
|
19210
|
+
runStyleProps = inlineRpr.styleId ? resolveStyleChain(params2, inlineRpr.styleId, translator$1N) : {};
|
|
19224
19211
|
}
|
|
19225
19212
|
let styleChain;
|
|
19226
19213
|
if (isNormalDefault) {
|
|
@@ -19235,7 +19222,7 @@ const resolveRunProperties = (params2, inlineRpr, resolvedPpr, isListNumber = fa
|
|
|
19235
19222
|
params2,
|
|
19236
19223
|
resolvedPpr.numberingProperties.ilvl ?? 0,
|
|
19237
19224
|
resolvedPpr.numberingProperties.numId,
|
|
19238
|
-
translator$
|
|
19225
|
+
translator$1N
|
|
19239
19226
|
);
|
|
19240
19227
|
}
|
|
19241
19228
|
if (!numberingDefinedInline) {
|
|
@@ -19252,10 +19239,10 @@ const resolveRunProperties = (params2, inlineRpr, resolvedPpr, isListNumber = fa
|
|
|
19252
19239
|
return finalProps;
|
|
19253
19240
|
};
|
|
19254
19241
|
function resolveParagraphProperties(params2, inlineProps, insideTable = false, overrideInlineStyleId = false) {
|
|
19255
|
-
const defaultProps2 = getDefaultProperties(params2, translator$
|
|
19256
|
-
const { properties: normalProps, isDefault: isNormalDefault } = getStyleProperties(params2, "Normal", translator$
|
|
19242
|
+
const defaultProps2 = getDefaultProperties(params2, translator$12);
|
|
19243
|
+
const { properties: normalProps, isDefault: isNormalDefault } = getStyleProperties(params2, "Normal", translator$12);
|
|
19257
19244
|
let styleId = inlineProps?.styleId;
|
|
19258
|
-
let styleProps = inlineProps?.styleId ? resolveStyleChain(params2, inlineProps?.styleId, translator$
|
|
19245
|
+
let styleProps = inlineProps?.styleId ? resolveStyleChain(params2, inlineProps?.styleId, translator$12) : {};
|
|
19259
19246
|
let numberingProps = {};
|
|
19260
19247
|
let ilvl = inlineProps?.numberingProperties?.ilvl ?? styleProps?.numberingProperties?.ilvl;
|
|
19261
19248
|
const numId = inlineProps?.numberingProperties?.numId ?? styleProps?.numberingProperties?.numId;
|
|
@@ -19263,10 +19250,10 @@ function resolveParagraphProperties(params2, inlineProps, insideTable = false, o
|
|
|
19263
19250
|
const isList2 = numId != null;
|
|
19264
19251
|
if (isList2) {
|
|
19265
19252
|
ilvl = ilvl != null ? ilvl : 0;
|
|
19266
|
-
numberingProps = getNumberingProperties(params2, ilvl, numId, translator$
|
|
19253
|
+
numberingProps = getNumberingProperties(params2, ilvl, numId, translator$12);
|
|
19267
19254
|
if (overrideInlineStyleId && numberingProps.styleId) {
|
|
19268
19255
|
styleId = numberingProps.styleId;
|
|
19269
|
-
styleProps = resolveStyleChain(params2, styleId, translator$
|
|
19256
|
+
styleProps = resolveStyleChain(params2, styleId, translator$12);
|
|
19270
19257
|
if (inlineProps) {
|
|
19271
19258
|
inlineProps.styleId = styleId;
|
|
19272
19259
|
if (styleProps.numberingProperties?.ilvl === inlineProps.numberingProperties?.ilvl && styleProps.numberingProperties?.numId === inlineProps.numberingProperties?.numId) {
|
|
@@ -19288,7 +19275,7 @@ function resolveParagraphProperties(params2, inlineProps, insideTable = false, o
|
|
|
19288
19275
|
if (numberingDefinedInline) {
|
|
19289
19276
|
indentChain = [...defaultsChain, styleProps, numberingProps, inlineProps];
|
|
19290
19277
|
} else {
|
|
19291
|
-
styleProps = resolveStyleChain(params2, styleId, translator$
|
|
19278
|
+
styleProps = resolveStyleChain(params2, styleId, translator$12, false);
|
|
19292
19279
|
indentChain = [...defaultsChain, numberingProps, styleProps, inlineProps];
|
|
19293
19280
|
}
|
|
19294
19281
|
} else {
|
|
@@ -19396,7 +19383,7 @@ function getNumberingProperties(params2, ilvl, numId, translator2, tries = 0) {
|
|
|
19396
19383
|
const numStyleLink = listDefinitionForThisNumId.elements?.find((item) => item.name === "w:numStyleLink");
|
|
19397
19384
|
const styleId = numStyleLink?.attributes?.["w:val"];
|
|
19398
19385
|
if (styleId && tries < 1) {
|
|
19399
|
-
const { properties: styleProps } = getStyleProperties(params2, styleId, translator$
|
|
19386
|
+
const { properties: styleProps } = getStyleProperties(params2, styleId, translator$12);
|
|
19400
19387
|
if (styleProps?.numberingProperties?.numId) {
|
|
19401
19388
|
return getNumberingProperties(params2, ilvl, styleProps.numberingProperties.numId, translator2, tries + 1);
|
|
19402
19389
|
}
|
|
@@ -19931,7 +19918,7 @@ function handleStyleChangeMarksV2(rPrChange, currentMarks, params2) {
|
|
|
19931
19918
|
let submarks = [];
|
|
19932
19919
|
const rPr = rPrChange.elements?.find((el) => el.name === "w:rPr");
|
|
19933
19920
|
if (rPr) {
|
|
19934
|
-
const runProperties = translator$
|
|
19921
|
+
const runProperties = translator$1N.encode({ ...params2, nodes: [rPr] });
|
|
19935
19922
|
submarks = encodeMarksFromRPr(runProperties, params2?.docx);
|
|
19936
19923
|
}
|
|
19937
19924
|
return [{ type: TrackFormatMarkName, attrs: { ...mappedAttributes, before: submarks, after: [...currentMarks] } }];
|
|
@@ -20040,7 +20027,7 @@ const handleParagraphNode$1 = (params2) => {
|
|
|
20040
20027
|
const pPr = node.elements?.find((el) => el.name === "w:pPr");
|
|
20041
20028
|
let inlineParagraphProperties = {};
|
|
20042
20029
|
if (pPr) {
|
|
20043
|
-
inlineParagraphProperties = translator$
|
|
20030
|
+
inlineParagraphProperties = translator$12.encode({ ...params2, nodes: [pPr] }) || {};
|
|
20044
20031
|
}
|
|
20045
20032
|
const insideTable = (params2.path || []).some((ancestor) => ancestor.name === "w:tc");
|
|
20046
20033
|
const resolvedParagraphProperties = resolveParagraphProperties(params2, inlineParagraphProperties, insideTable);
|
|
@@ -20093,89 +20080,139 @@ const handleParagraphNode$1 = (params2) => {
|
|
|
20093
20080
|
}
|
|
20094
20081
|
return schemaNode;
|
|
20095
20082
|
};
|
|
20096
|
-
|
|
20083
|
+
function generateParagraphProperties(params2) {
|
|
20084
|
+
const { node } = params2;
|
|
20085
|
+
const { attrs = {} } = node;
|
|
20086
|
+
const paragraphProperties = carbonCopy(attrs.paragraphProperties || {});
|
|
20087
|
+
if (attrs.styleId !== paragraphProperties.styleId) {
|
|
20088
|
+
paragraphProperties.styleId = attrs.styleId;
|
|
20089
|
+
}
|
|
20090
|
+
["borders", "styleId", "indent", "textAlign", "keepLines", "keepNext", "spacing", "tabStops"].forEach((key2) => {
|
|
20091
|
+
let propKey = key2 === "textAlign" ? "justification" : key2;
|
|
20092
|
+
if (JSON.stringify(paragraphProperties[propKey]) !== JSON.stringify(attrs[key2])) {
|
|
20093
|
+
paragraphProperties[propKey] = attrs[key2];
|
|
20094
|
+
}
|
|
20095
|
+
});
|
|
20096
|
+
const framePr = attrs.dropcap;
|
|
20097
|
+
if (framePr) {
|
|
20098
|
+
framePr.dropCap = framePr.type;
|
|
20099
|
+
delete framePr.type;
|
|
20100
|
+
}
|
|
20101
|
+
if (JSON.stringify(paragraphProperties.framePr) !== JSON.stringify(framePr)) {
|
|
20102
|
+
paragraphProperties.framePr = framePr;
|
|
20103
|
+
}
|
|
20104
|
+
const marksProps = decodeRPrFromMarks(attrs.marksAttrs || []);
|
|
20105
|
+
const finalRunProps = combineRunProperties([paragraphProperties.runProperties || {}, marksProps]);
|
|
20106
|
+
paragraphProperties.runProperties = finalRunProps;
|
|
20107
|
+
const pPr = translator$12.decode({ node: { ...node, attrs: { paragraphProperties } } });
|
|
20108
|
+
const sectPr = node.attrs?.paragraphProperties?.sectPr;
|
|
20109
|
+
if (sectPr) {
|
|
20110
|
+
pPr.elements.push(sectPr);
|
|
20111
|
+
}
|
|
20112
|
+
return pPr;
|
|
20113
|
+
}
|
|
20114
|
+
function translateParagraphNode(params2) {
|
|
20115
|
+
const elements = translateChildNodes(params2);
|
|
20116
|
+
const htmlAnnotationChild = elements.find((element) => element.name === "htmlAnnotation");
|
|
20117
|
+
if (htmlAnnotationChild) {
|
|
20118
|
+
return htmlAnnotationChild.elements;
|
|
20119
|
+
}
|
|
20120
|
+
const pPr = generateParagraphProperties(params2);
|
|
20121
|
+
if (pPr) elements.unshift(pPr);
|
|
20122
|
+
let attributes = {};
|
|
20123
|
+
if (params2.node.attrs?.rsidRDefault) {
|
|
20124
|
+
attributes["w:rsidRDefault"] = params2.node.attrs.rsidRDefault;
|
|
20125
|
+
}
|
|
20126
|
+
const result = {
|
|
20127
|
+
name: "w:p",
|
|
20128
|
+
elements,
|
|
20129
|
+
attributes
|
|
20130
|
+
};
|
|
20131
|
+
return result;
|
|
20132
|
+
}
|
|
20133
|
+
const encode$A = (attributes) => {
|
|
20097
20134
|
return attributes["w:rsidDel"];
|
|
20098
20135
|
};
|
|
20099
|
-
const decode$
|
|
20136
|
+
const decode$C = (attrs) => {
|
|
20100
20137
|
return attrs.rsidDel;
|
|
20101
20138
|
};
|
|
20102
20139
|
const attrConfig$h = Object.freeze({
|
|
20103
20140
|
xmlName: "w:rsidDel",
|
|
20104
20141
|
sdName: "rsidDel",
|
|
20105
|
-
encode: encode$
|
|
20106
|
-
decode: decode$
|
|
20142
|
+
encode: encode$A,
|
|
20143
|
+
decode: decode$C
|
|
20107
20144
|
});
|
|
20108
|
-
const encode$
|
|
20145
|
+
const encode$z = (attributes) => {
|
|
20109
20146
|
return attributes["w:rsidP"];
|
|
20110
20147
|
};
|
|
20111
|
-
const decode$
|
|
20148
|
+
const decode$B = (attrs) => {
|
|
20112
20149
|
return attrs.rsidP;
|
|
20113
20150
|
};
|
|
20114
20151
|
const attrConfig$g = Object.freeze({
|
|
20115
20152
|
xmlName: "w:rsidP",
|
|
20116
20153
|
sdName: "rsidP",
|
|
20117
|
-
encode: encode$
|
|
20118
|
-
decode: decode$
|
|
20154
|
+
encode: encode$z,
|
|
20155
|
+
decode: decode$B
|
|
20119
20156
|
});
|
|
20120
|
-
const encode$
|
|
20157
|
+
const encode$y = (attributes) => {
|
|
20121
20158
|
return attributes["w:rsidR"];
|
|
20122
20159
|
};
|
|
20123
|
-
const decode$
|
|
20160
|
+
const decode$A = (attrs) => {
|
|
20124
20161
|
return attrs.rsidR;
|
|
20125
20162
|
};
|
|
20126
20163
|
const attrConfig$f = Object.freeze({
|
|
20127
20164
|
xmlName: "w:rsidR",
|
|
20128
20165
|
sdName: "rsidR",
|
|
20129
|
-
encode: encode$
|
|
20130
|
-
decode: decode$
|
|
20166
|
+
encode: encode$y,
|
|
20167
|
+
decode: decode$A
|
|
20131
20168
|
});
|
|
20132
|
-
const encode$
|
|
20169
|
+
const encode$x = (attributes) => {
|
|
20133
20170
|
return attributes["w:rsidRPr"];
|
|
20134
20171
|
};
|
|
20135
|
-
const decode$
|
|
20172
|
+
const decode$z = (attrs) => {
|
|
20136
20173
|
return attrs.rsidRPr;
|
|
20137
20174
|
};
|
|
20138
20175
|
const attrConfig$e = Object.freeze({
|
|
20139
20176
|
xmlName: "w:rsidRPr",
|
|
20140
20177
|
sdName: "rsidRPr",
|
|
20141
|
-
encode: encode$
|
|
20142
|
-
decode: decode$
|
|
20178
|
+
encode: encode$x,
|
|
20179
|
+
decode: decode$z
|
|
20143
20180
|
});
|
|
20144
|
-
const encode$
|
|
20181
|
+
const encode$w = (attributes) => {
|
|
20145
20182
|
return attributes["w:rsidRDefault"];
|
|
20146
20183
|
};
|
|
20147
|
-
const decode$
|
|
20184
|
+
const decode$y = (attrs) => {
|
|
20148
20185
|
return attrs.rsidRDefault;
|
|
20149
20186
|
};
|
|
20150
20187
|
const attrConfig$d = Object.freeze({
|
|
20151
20188
|
xmlName: "w:rsidRDefault",
|
|
20152
20189
|
sdName: "rsidRDefault",
|
|
20153
|
-
encode: encode$
|
|
20154
|
-
decode: decode$
|
|
20190
|
+
encode: encode$w,
|
|
20191
|
+
decode: decode$y
|
|
20155
20192
|
});
|
|
20156
|
-
const encode$
|
|
20193
|
+
const encode$v = (attributes) => {
|
|
20157
20194
|
return attributes["w14:paraId"];
|
|
20158
20195
|
};
|
|
20159
|
-
const decode$
|
|
20196
|
+
const decode$x = (attrs) => {
|
|
20160
20197
|
return attrs.paraId;
|
|
20161
20198
|
};
|
|
20162
20199
|
const attrConfig$c = Object.freeze({
|
|
20163
20200
|
xmlName: "w14:paraId",
|
|
20164
20201
|
sdName: "paraId",
|
|
20165
|
-
encode: encode$
|
|
20166
|
-
decode: decode$
|
|
20202
|
+
encode: encode$v,
|
|
20203
|
+
decode: decode$x
|
|
20167
20204
|
});
|
|
20168
|
-
const encode$
|
|
20205
|
+
const encode$u = (attributes) => {
|
|
20169
20206
|
return attributes["w14:textId"];
|
|
20170
20207
|
};
|
|
20171
|
-
const decode$
|
|
20208
|
+
const decode$w = (attrs) => {
|
|
20172
20209
|
return attrs.textId;
|
|
20173
20210
|
};
|
|
20174
20211
|
const attrConfig$b = Object.freeze({
|
|
20175
20212
|
xmlName: "w14:textId",
|
|
20176
20213
|
sdName: "textId",
|
|
20177
|
-
encode: encode$
|
|
20178
|
-
decode: decode$
|
|
20214
|
+
encode: encode$u,
|
|
20215
|
+
decode: decode$w
|
|
20179
20216
|
});
|
|
20180
20217
|
const validXmlAttributes$d = [
|
|
20181
20218
|
attrConfig$c,
|
|
@@ -20186,9 +20223,9 @@ const validXmlAttributes$d = [
|
|
|
20186
20223
|
attrConfig$e,
|
|
20187
20224
|
attrConfig$h
|
|
20188
20225
|
];
|
|
20189
|
-
const XML_NODE_NAME$
|
|
20190
|
-
const SD_NODE_NAME$
|
|
20191
|
-
const encode$
|
|
20226
|
+
const XML_NODE_NAME$k = "w:p";
|
|
20227
|
+
const SD_NODE_NAME$h = "paragraph";
|
|
20228
|
+
const encode$t = (params2, encodedAttrs = {}) => {
|
|
20192
20229
|
const node = handleParagraphNode$1(params2);
|
|
20193
20230
|
if (!node) return void 0;
|
|
20194
20231
|
if (encodedAttrs && Object.keys(encodedAttrs).length) {
|
|
@@ -20196,7 +20233,7 @@ const encode$r = (params2, encodedAttrs = {}) => {
|
|
|
20196
20233
|
}
|
|
20197
20234
|
return node;
|
|
20198
20235
|
};
|
|
20199
|
-
const decode$
|
|
20236
|
+
const decode$v = (params2, decodedAttrs = {}) => {
|
|
20200
20237
|
const translated = translateParagraphNode(params2);
|
|
20201
20238
|
if (!translated) return void 0;
|
|
20202
20239
|
if (decodedAttrs && Object.keys(decodedAttrs).length) {
|
|
@@ -20204,15 +20241,15 @@ const decode$t = (params2, decodedAttrs = {}) => {
|
|
|
20204
20241
|
}
|
|
20205
20242
|
return translated;
|
|
20206
20243
|
};
|
|
20207
|
-
const config$
|
|
20208
|
-
xmlName: XML_NODE_NAME$
|
|
20209
|
-
sdNodeOrKeyName: SD_NODE_NAME$
|
|
20244
|
+
const config$j = {
|
|
20245
|
+
xmlName: XML_NODE_NAME$k,
|
|
20246
|
+
sdNodeOrKeyName: SD_NODE_NAME$h,
|
|
20210
20247
|
type: NodeTranslator.translatorTypes.NODE,
|
|
20211
|
-
encode: encode$
|
|
20212
|
-
decode: decode$
|
|
20248
|
+
encode: encode$t,
|
|
20249
|
+
decode: decode$v,
|
|
20213
20250
|
attributes: validXmlAttributes$d
|
|
20214
20251
|
};
|
|
20215
|
-
const translator
|
|
20252
|
+
const translator$11 = NodeTranslator.from(config$j);
|
|
20216
20253
|
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;
|
|
20217
20254
|
const containsEastAsianCharacters = (text) => EAST_ASIAN_CHARACTER_REGEX.test(text);
|
|
20218
20255
|
const resolveFontFamily = (textStyleAttrs, text) => {
|
|
@@ -20372,8 +20409,21 @@ const ensureTrackedWrapper = (runs, trackingMarksByType = /* @__PURE__ */ new Ma
|
|
|
20372
20409
|
}
|
|
20373
20410
|
return runs;
|
|
20374
20411
|
};
|
|
20375
|
-
|
|
20376
|
-
const
|
|
20412
|
+
function generateDocxRandomId(length2 = 8) {
|
|
20413
|
+
const max2 = 2147483647;
|
|
20414
|
+
const value = Math.floor(Math.random() * (max2 + 1));
|
|
20415
|
+
return value.toString(16).padStart(length2, "0").slice(0, length2);
|
|
20416
|
+
}
|
|
20417
|
+
function generateRandomSigned32BitIntStrId() {
|
|
20418
|
+
const val = Math.floor(Math.random() * 2147483647);
|
|
20419
|
+
return val.toString();
|
|
20420
|
+
}
|
|
20421
|
+
function generateRandom32BitHex() {
|
|
20422
|
+
const val = Math.floor(Math.random() * 2147483647);
|
|
20423
|
+
return val.toString(16).toUpperCase().padStart(8, "0");
|
|
20424
|
+
}
|
|
20425
|
+
const XML_NODE_NAME$j = "w:hyperlink";
|
|
20426
|
+
const SD_NODE_NAME$g = "link";
|
|
20377
20427
|
const _createAttributeHandler = (xmlName, sdName) => ({
|
|
20378
20428
|
xmlName,
|
|
20379
20429
|
sdName,
|
|
@@ -20393,7 +20443,7 @@ const validXmlAttributes$c = [
|
|
|
20393
20443
|
_createAttributeHandler("r:id", "rId"),
|
|
20394
20444
|
_createAttributeHandler("w:tgtFrame", "target")
|
|
20395
20445
|
];
|
|
20396
|
-
const encode$
|
|
20446
|
+
const encode$s = (params2, encodedAttrs) => {
|
|
20397
20447
|
const { nodes, docx, nodeListHandler } = params2;
|
|
20398
20448
|
const node = nodes[0];
|
|
20399
20449
|
let href = _resolveHref(docx, encodedAttrs);
|
|
@@ -20427,7 +20477,7 @@ const _resolveHref = (docx, encodedAttrs) => {
|
|
|
20427
20477
|
}
|
|
20428
20478
|
return href;
|
|
20429
20479
|
};
|
|
20430
|
-
function decode$
|
|
20480
|
+
function decode$u(params2) {
|
|
20431
20481
|
const { hyperlinkGroup = [params2.node] } = params2.extraParams || {};
|
|
20432
20482
|
const node = hyperlinkGroup[0];
|
|
20433
20483
|
const linkMark = node.marks.find((m2) => m2.type === "link");
|
|
@@ -20468,69 +20518,69 @@ function _addNewLinkRelationship(params2, link) {
|
|
|
20468
20518
|
type: "element",
|
|
20469
20519
|
name: "Relationship",
|
|
20470
20520
|
attributes: {
|
|
20471
|
-
Id: id
|
|
20521
|
+
Id: `rId${id}`,
|
|
20472
20522
|
Type: "http://schemas.openxmlformats.org/officeDocument/2006/relationships/hyperlink",
|
|
20473
20523
|
Target: link,
|
|
20474
20524
|
TargetMode: "External"
|
|
20475
20525
|
}
|
|
20476
20526
|
});
|
|
20477
|
-
return id
|
|
20527
|
+
return `rId${id}`;
|
|
20478
20528
|
}
|
|
20479
|
-
const config$
|
|
20480
|
-
xmlName: XML_NODE_NAME$
|
|
20481
|
-
sdNodeOrKeyName: SD_NODE_NAME$
|
|
20529
|
+
const config$i = {
|
|
20530
|
+
xmlName: XML_NODE_NAME$j,
|
|
20531
|
+
sdNodeOrKeyName: SD_NODE_NAME$g,
|
|
20482
20532
|
type: NodeTranslator.translatorTypes.NODE,
|
|
20483
|
-
encode: encode$
|
|
20484
|
-
decode: decode$
|
|
20533
|
+
encode: encode$s,
|
|
20534
|
+
decode: decode$u,
|
|
20485
20535
|
attributes: validXmlAttributes$c
|
|
20486
20536
|
};
|
|
20487
|
-
const translator$
|
|
20488
|
-
const encode$
|
|
20537
|
+
const translator$10 = NodeTranslator.from(config$i);
|
|
20538
|
+
const encode$r = (attributes) => {
|
|
20489
20539
|
return attributes["w:rsidR"];
|
|
20490
20540
|
};
|
|
20491
|
-
const decode$
|
|
20541
|
+
const decode$t = (attrs) => {
|
|
20492
20542
|
return attrs.rsidR;
|
|
20493
20543
|
};
|
|
20494
20544
|
const attrConfig$a = Object.freeze({
|
|
20495
20545
|
xmlName: "w:rsidR",
|
|
20496
20546
|
sdName: "rsidR",
|
|
20497
|
-
encode: encode$
|
|
20498
|
-
decode: decode$
|
|
20547
|
+
encode: encode$r,
|
|
20548
|
+
decode: decode$t
|
|
20499
20549
|
});
|
|
20500
|
-
const encode$
|
|
20550
|
+
const encode$q = (attributes) => {
|
|
20501
20551
|
return attributes["w:rsidRPr"];
|
|
20502
20552
|
};
|
|
20503
|
-
const decode$
|
|
20553
|
+
const decode$s = (attrs) => {
|
|
20504
20554
|
return attrs.rsidRPr;
|
|
20505
20555
|
};
|
|
20506
20556
|
const attrConfig$9 = Object.freeze({
|
|
20507
20557
|
xmlName: "w:rsidRPr",
|
|
20508
20558
|
sdName: "rsidRPr",
|
|
20509
|
-
encode: encode$
|
|
20510
|
-
decode: decode$
|
|
20559
|
+
encode: encode$q,
|
|
20560
|
+
decode: decode$s
|
|
20511
20561
|
});
|
|
20512
|
-
const encode$
|
|
20562
|
+
const encode$p = (attributes) => {
|
|
20513
20563
|
return attributes["w:rsidDel"];
|
|
20514
20564
|
};
|
|
20515
|
-
const decode$
|
|
20565
|
+
const decode$r = (attrs) => {
|
|
20516
20566
|
return attrs.rsidDel;
|
|
20517
20567
|
};
|
|
20518
20568
|
const attrConfig$8 = Object.freeze({
|
|
20519
20569
|
xmlName: "w:rsidDel",
|
|
20520
20570
|
sdName: "rsidDel",
|
|
20521
|
-
encode: encode$
|
|
20522
|
-
decode: decode$
|
|
20571
|
+
encode: encode$p,
|
|
20572
|
+
decode: decode$r
|
|
20523
20573
|
});
|
|
20524
20574
|
const validXmlAttributes$b = [attrConfig$a, attrConfig$9, attrConfig$8];
|
|
20525
|
-
const XML_NODE_NAME$
|
|
20575
|
+
const XML_NODE_NAME$i = "w:r";
|
|
20526
20576
|
const SD_KEY_NAME = "run";
|
|
20527
|
-
const encode$
|
|
20577
|
+
const encode$o = (params2, encodedAttrs = {}) => {
|
|
20528
20578
|
const { nodes = [], nodeListHandler } = params2 || {};
|
|
20529
20579
|
const runNode = nodes[0];
|
|
20530
20580
|
if (!runNode) return void 0;
|
|
20531
20581
|
const elements = Array.isArray(runNode.elements) ? runNode.elements : [];
|
|
20532
20582
|
const rPrNode = elements.find((child) => child?.name === "w:rPr");
|
|
20533
|
-
const runProperties = rPrNode ? translator$
|
|
20583
|
+
const runProperties = rPrNode ? translator$1N.encode({ ...params2, nodes: [rPrNode] }) : {};
|
|
20534
20584
|
const paragraphProperties = params2?.extraParams?.paragraphProperties || {};
|
|
20535
20585
|
const resolvedRunProperties = resolveRunProperties(params2, runProperties ?? {}, paragraphProperties);
|
|
20536
20586
|
const marks = encodeMarksFromRPr(resolvedRunProperties, params2?.docx) || [];
|
|
@@ -20577,7 +20627,7 @@ const encode$m = (params2, encodedAttrs = {}) => {
|
|
|
20577
20627
|
}
|
|
20578
20628
|
return runNodeResult;
|
|
20579
20629
|
};
|
|
20580
|
-
const decode$
|
|
20630
|
+
const decode$q = (params2, decodedAttrs = {}) => {
|
|
20581
20631
|
const { node } = params2 || {};
|
|
20582
20632
|
if (!node) return void 0;
|
|
20583
20633
|
const isLinkNode = node.marks?.some((m2) => m2.type === "link");
|
|
@@ -20586,7 +20636,7 @@ const decode$o = (params2, decodedAttrs = {}) => {
|
|
|
20586
20636
|
...params2.extraParams,
|
|
20587
20637
|
linkProcessed: true
|
|
20588
20638
|
};
|
|
20589
|
-
return translator$
|
|
20639
|
+
return translator$10.decode({ ...params2, extraParams });
|
|
20590
20640
|
}
|
|
20591
20641
|
const { runNode: runNodeForExport, trackingMarksByType } = prepareRunTrackingContext(node);
|
|
20592
20642
|
const runAttrs = runNodeForExport.attrs || {};
|
|
@@ -20602,7 +20652,7 @@ const decode$o = (params2, decodedAttrs = {}) => {
|
|
|
20602
20652
|
exportParams.editor = { extensionService: { extensions: [] } };
|
|
20603
20653
|
}
|
|
20604
20654
|
const childElements = translateChildNodes(exportParams) || [];
|
|
20605
|
-
let runPropertiesElement = translator$
|
|
20655
|
+
let runPropertiesElement = translator$1N.decode({
|
|
20606
20656
|
...params2,
|
|
20607
20657
|
node: { attrs: { runProperties: finalRunProperties } }
|
|
20608
20658
|
});
|
|
@@ -20635,7 +20685,7 @@ const decode$o = (params2, decodedAttrs = {}) => {
|
|
|
20635
20685
|
runs.push(trackedClone);
|
|
20636
20686
|
return;
|
|
20637
20687
|
}
|
|
20638
|
-
const runWrapper = { name: XML_NODE_NAME$
|
|
20688
|
+
const runWrapper = { name: XML_NODE_NAME$i, elements: [] };
|
|
20639
20689
|
applyBaseRunProps(runWrapper);
|
|
20640
20690
|
if (!Array.isArray(runWrapper.elements)) runWrapper.elements = [];
|
|
20641
20691
|
runWrapper.elements.push(cloneXmlNode(child));
|
|
@@ -20643,7 +20693,7 @@ const decode$o = (params2, decodedAttrs = {}) => {
|
|
|
20643
20693
|
});
|
|
20644
20694
|
const trackedRuns = ensureTrackedWrapper(runs, trackingMarksByType);
|
|
20645
20695
|
if (!trackedRuns.length) {
|
|
20646
|
-
const emptyRun = { name: XML_NODE_NAME$
|
|
20696
|
+
const emptyRun = { name: XML_NODE_NAME$i, elements: [] };
|
|
20647
20697
|
applyBaseRunProps(emptyRun);
|
|
20648
20698
|
trackedRuns.push(emptyRun);
|
|
20649
20699
|
}
|
|
@@ -20657,17 +20707,17 @@ const decode$o = (params2, decodedAttrs = {}) => {
|
|
|
20657
20707
|
}
|
|
20658
20708
|
return trackedRuns;
|
|
20659
20709
|
};
|
|
20660
|
-
const config$
|
|
20661
|
-
xmlName: XML_NODE_NAME$
|
|
20710
|
+
const config$h = {
|
|
20711
|
+
xmlName: XML_NODE_NAME$i,
|
|
20662
20712
|
sdNodeOrKeyName: SD_KEY_NAME,
|
|
20663
20713
|
type: NodeTranslator.translatorTypes.NODE,
|
|
20664
|
-
encode: encode$
|
|
20665
|
-
decode: decode$
|
|
20714
|
+
encode: encode$o,
|
|
20715
|
+
decode: decode$q,
|
|
20666
20716
|
attributes: validXmlAttributes$b
|
|
20667
20717
|
};
|
|
20668
|
-
const translator
|
|
20669
|
-
const translator$
|
|
20670
|
-
const translator$
|
|
20718
|
+
const translator$$ = NodeTranslator.from(config$h);
|
|
20719
|
+
const translator$_ = NodeTranslator.from(createMeasurementPropertyHandler("w:tcW", "cellWidth"));
|
|
20720
|
+
const translator$Z = NodeTranslator.from(
|
|
20671
20721
|
createSingleAttrPropertyHandler(
|
|
20672
20722
|
"w:gridSpan",
|
|
20673
20723
|
null,
|
|
@@ -20676,31 +20726,31 @@ const translator$X = NodeTranslator.from(
|
|
|
20676
20726
|
(v2) => integerToString(v2)
|
|
20677
20727
|
)
|
|
20678
20728
|
);
|
|
20679
|
-
const translator$
|
|
20680
|
-
const translator$
|
|
20681
|
-
const translator$
|
|
20682
|
-
const translator$
|
|
20683
|
-
const translator$
|
|
20684
|
-
const translator$
|
|
20685
|
-
const translator$
|
|
20686
|
-
const translator$
|
|
20687
|
-
const translator$
|
|
20729
|
+
const translator$Y = NodeTranslator.from(createSingleAttrPropertyHandler("w:vMerge"));
|
|
20730
|
+
const translator$X = NodeTranslator.from(createBorderPropertyHandler("w:end"));
|
|
20731
|
+
const translator$W = NodeTranslator.from(createMeasurementPropertyHandler("w:end", "marginEnd"));
|
|
20732
|
+
const translator$V = NodeTranslator.from(createBorderPropertyHandler("w:insideH"));
|
|
20733
|
+
const translator$U = NodeTranslator.from(createBorderPropertyHandler("w:insideV"));
|
|
20734
|
+
const translator$T = NodeTranslator.from(createBorderPropertyHandler("w:start"));
|
|
20735
|
+
const translator$S = NodeTranslator.from(createMeasurementPropertyHandler("w:start", "marginStart"));
|
|
20736
|
+
const translator$R = NodeTranslator.from(createBorderPropertyHandler("w:tl2br"));
|
|
20737
|
+
const translator$Q = NodeTranslator.from(createBorderPropertyHandler("w:tr2bl"));
|
|
20688
20738
|
const propertyTranslators$6 = [
|
|
20689
|
-
translator$1h,
|
|
20690
|
-
translator$R,
|
|
20691
|
-
translator$1l,
|
|
20692
|
-
translator$1n,
|
|
20693
|
-
translator$V,
|
|
20694
20739
|
translator$1j,
|
|
20695
20740
|
translator$T,
|
|
20696
|
-
translator$
|
|
20697
|
-
translator$
|
|
20698
|
-
translator$
|
|
20741
|
+
translator$1n,
|
|
20742
|
+
translator$1p,
|
|
20743
|
+
translator$X,
|
|
20744
|
+
translator$1l,
|
|
20745
|
+
translator$V,
|
|
20746
|
+
translator$U,
|
|
20747
|
+
translator$R,
|
|
20748
|
+
translator$Q
|
|
20699
20749
|
];
|
|
20700
|
-
const translator$
|
|
20750
|
+
const translator$P = NodeTranslator.from(
|
|
20701
20751
|
createNestedPropertiesTranslator("w:tcBorders", "borders", propertyTranslators$6)
|
|
20702
20752
|
);
|
|
20703
|
-
const translator$
|
|
20753
|
+
const translator$O = NodeTranslator.from(
|
|
20704
20754
|
createSingleAttrPropertyHandler(
|
|
20705
20755
|
"w:noWrap",
|
|
20706
20756
|
null,
|
|
@@ -20710,17 +20760,17 @@ const translator$M = NodeTranslator.from(
|
|
|
20710
20760
|
)
|
|
20711
20761
|
);
|
|
20712
20762
|
const propertyTranslators$5 = [
|
|
20763
|
+
translator$1o,
|
|
20764
|
+
translator$W,
|
|
20713
20765
|
translator$1m,
|
|
20714
|
-
translator$U,
|
|
20715
20766
|
translator$1k,
|
|
20716
|
-
translator$
|
|
20717
|
-
translator$
|
|
20718
|
-
translator$1g
|
|
20767
|
+
translator$S,
|
|
20768
|
+
translator$1i
|
|
20719
20769
|
];
|
|
20720
|
-
const translator$
|
|
20770
|
+
const translator$N = NodeTranslator.from(
|
|
20721
20771
|
createNestedPropertiesTranslator("w:tcMar", "cellMargins", propertyTranslators$5)
|
|
20722
20772
|
);
|
|
20723
|
-
const translator$
|
|
20773
|
+
const translator$M = NodeTranslator.from(
|
|
20724
20774
|
createSingleAttrPropertyHandler(
|
|
20725
20775
|
"w:tcFitText",
|
|
20726
20776
|
null,
|
|
@@ -20729,8 +20779,8 @@ const translator$K = NodeTranslator.from(
|
|
|
20729
20779
|
(v2) => booleanToString(v2)
|
|
20730
20780
|
)
|
|
20731
20781
|
);
|
|
20732
|
-
const translator$
|
|
20733
|
-
const translator$
|
|
20782
|
+
const translator$L = NodeTranslator.from(createSingleAttrPropertyHandler("w:vAlign"));
|
|
20783
|
+
const translator$K = NodeTranslator.from(
|
|
20734
20784
|
createSingleAttrPropertyHandler(
|
|
20735
20785
|
"w:hideMark",
|
|
20736
20786
|
null,
|
|
@@ -20739,26 +20789,26 @@ const translator$I = NodeTranslator.from(
|
|
|
20739
20789
|
(v2) => booleanToString(v2)
|
|
20740
20790
|
)
|
|
20741
20791
|
);
|
|
20742
|
-
const translator$
|
|
20743
|
-
const translator$
|
|
20744
|
-
createNestedArrayPropertyHandler("w:headers", "headers", [translator$
|
|
20792
|
+
const translator$J = NodeTranslator.from(createSingleAttrPropertyHandler("w:header"));
|
|
20793
|
+
const translator$I = NodeTranslator.from(
|
|
20794
|
+
createNestedArrayPropertyHandler("w:headers", "headers", [translator$J])
|
|
20745
20795
|
);
|
|
20746
20796
|
const propertyTranslators$4 = [
|
|
20747
|
-
translator$
|
|
20797
|
+
translator$1H,
|
|
20798
|
+
translator$_,
|
|
20799
|
+
translator$Z,
|
|
20748
20800
|
translator$Y,
|
|
20749
|
-
translator$
|
|
20750
|
-
translator$
|
|
20801
|
+
translator$P,
|
|
20802
|
+
translator$1Q,
|
|
20803
|
+
translator$O,
|
|
20751
20804
|
translator$N,
|
|
20752
|
-
translator$
|
|
20805
|
+
translator$17,
|
|
20753
20806
|
translator$M,
|
|
20754
20807
|
translator$L,
|
|
20755
|
-
translator$15,
|
|
20756
20808
|
translator$K,
|
|
20757
|
-
translator$
|
|
20758
|
-
translator$I,
|
|
20759
|
-
translator$G
|
|
20809
|
+
translator$I
|
|
20760
20810
|
];
|
|
20761
|
-
const translator$
|
|
20811
|
+
const translator$H = NodeTranslator.from(
|
|
20762
20812
|
createNestedPropertiesTranslator("w:tcPr", "tableCellProperties", propertyTranslators$4)
|
|
20763
20813
|
);
|
|
20764
20814
|
function handleTableCellNode({
|
|
@@ -20776,7 +20826,7 @@ function handleTableCellNode({
|
|
|
20776
20826
|
const attributes = {};
|
|
20777
20827
|
const referencedStyles = _referencedStyles ?? { fontSize: null, fonts: {}, cellMargins: {} };
|
|
20778
20828
|
const tcPr = node.elements.find((el) => el.name === "w:tcPr");
|
|
20779
|
-
const tableCellProperties = tcPr ? translator$
|
|
20829
|
+
const tableCellProperties = tcPr ? translator$H.encode({ ...params2, nodes: [tcPr] }) ?? {} : {};
|
|
20780
20830
|
attributes["tableCellProperties"] = tableCellProperties;
|
|
20781
20831
|
if (rowBorders?.insideH) {
|
|
20782
20832
|
rowBorders["bottom"] = rowBorders.insideH;
|
|
@@ -21088,13 +21138,13 @@ function generateTableCellProperties(node) {
|
|
|
21088
21138
|
} else if (tableCellProperties?.borders) {
|
|
21089
21139
|
delete tableCellProperties.borders;
|
|
21090
21140
|
}
|
|
21091
|
-
const result = translator$
|
|
21141
|
+
const result = translator$H.decode({ node: { ...node, attrs: { ...node.attrs, tableCellProperties } } });
|
|
21092
21142
|
return result;
|
|
21093
21143
|
}
|
|
21094
|
-
const XML_NODE_NAME$
|
|
21095
|
-
const SD_NODE_NAME$
|
|
21144
|
+
const XML_NODE_NAME$h = "w:tc";
|
|
21145
|
+
const SD_NODE_NAME$f = "tableCell";
|
|
21096
21146
|
const validXmlAttributes$a = [];
|
|
21097
|
-
function encode$
|
|
21147
|
+
function encode$n(params2, encodedAttrs) {
|
|
21098
21148
|
const {
|
|
21099
21149
|
node,
|
|
21100
21150
|
table,
|
|
@@ -21121,29 +21171,29 @@ function encode$l(params2, encodedAttrs) {
|
|
|
21121
21171
|
}
|
|
21122
21172
|
return schemaNode;
|
|
21123
21173
|
}
|
|
21124
|
-
function decode$
|
|
21174
|
+
function decode$p(params2, decodedAttrs) {
|
|
21125
21175
|
const translated = translateTableCell(params2);
|
|
21126
21176
|
if (decodedAttrs && Object.keys(decodedAttrs).length) {
|
|
21127
21177
|
translated.attributes = { ...translated.attributes || {}, ...decodedAttrs };
|
|
21128
21178
|
}
|
|
21129
21179
|
return translated;
|
|
21130
21180
|
}
|
|
21131
|
-
const config$
|
|
21132
|
-
xmlName: XML_NODE_NAME$
|
|
21133
|
-
sdNodeOrKeyName: SD_NODE_NAME$
|
|
21181
|
+
const config$g = {
|
|
21182
|
+
xmlName: XML_NODE_NAME$h,
|
|
21183
|
+
sdNodeOrKeyName: SD_NODE_NAME$f,
|
|
21134
21184
|
type: NodeTranslator.translatorTypes.NODE,
|
|
21135
|
-
encode: encode$
|
|
21136
|
-
decode: decode$
|
|
21185
|
+
encode: encode$n,
|
|
21186
|
+
decode: decode$p,
|
|
21137
21187
|
attributes: validXmlAttributes$a
|
|
21138
21188
|
};
|
|
21139
|
-
const translator$
|
|
21140
|
-
const translator$
|
|
21189
|
+
const translator$G = NodeTranslator.from(config$g);
|
|
21190
|
+
const translator$F = NodeTranslator.from({
|
|
21141
21191
|
xmlName: "w:cantSplit",
|
|
21142
21192
|
sdNodeOrKeyName: "cantSplit",
|
|
21143
21193
|
encode: ({ nodes }) => ["1", "true"].includes(nodes[0].attributes?.["w:val"] ?? "1"),
|
|
21144
21194
|
decode: ({ node }) => node.attrs?.cantSplit ? { attributes: {} } : void 0
|
|
21145
21195
|
});
|
|
21146
|
-
const translator$
|
|
21196
|
+
const translator$E = NodeTranslator.from(
|
|
21147
21197
|
createSingleAttrPropertyHandler(
|
|
21148
21198
|
"w:gridAfter",
|
|
21149
21199
|
null,
|
|
@@ -21152,7 +21202,7 @@ const translator$C = NodeTranslator.from(
|
|
|
21152
21202
|
(v2) => integerToString(v2)
|
|
21153
21203
|
)
|
|
21154
21204
|
);
|
|
21155
|
-
const translator$
|
|
21205
|
+
const translator$D = NodeTranslator.from(
|
|
21156
21206
|
createSingleAttrPropertyHandler(
|
|
21157
21207
|
"w:gridBefore",
|
|
21158
21208
|
null,
|
|
@@ -21161,20 +21211,20 @@ const translator$B = NodeTranslator.from(
|
|
|
21161
21211
|
(v2) => integerToString(v2)
|
|
21162
21212
|
)
|
|
21163
21213
|
);
|
|
21164
|
-
const translator$
|
|
21214
|
+
const translator$C = NodeTranslator.from({
|
|
21165
21215
|
xmlName: "w:hidden",
|
|
21166
21216
|
sdNodeOrKeyName: "hidden",
|
|
21167
21217
|
encode: ({ nodes }) => parseBoolean(nodes[0].attributes?.["w:val"] ?? "1"),
|
|
21168
21218
|
decode: ({ node }) => node.attrs.hidden ? { attributes: {} } : void 0
|
|
21169
21219
|
});
|
|
21170
|
-
const translator$
|
|
21171
|
-
const translator$
|
|
21220
|
+
const translator$B = NodeTranslator.from(createMeasurementPropertyHandler("w:tblCellSpacing", "tableCellSpacing"));
|
|
21221
|
+
const translator$A = NodeTranslator.from({
|
|
21172
21222
|
xmlName: "w:tblHeader",
|
|
21173
21223
|
sdNodeOrKeyName: "repeatHeader",
|
|
21174
21224
|
encode: ({ nodes }) => parseBoolean(nodes[0].attributes?.["w:val"] ?? "1"),
|
|
21175
21225
|
decode: ({ node }) => node.attrs.repeatHeader ? { attributes: {} } : void 0
|
|
21176
21226
|
});
|
|
21177
|
-
const translator$
|
|
21227
|
+
const translator$z = NodeTranslator.from({
|
|
21178
21228
|
xmlName: "w:trHeight",
|
|
21179
21229
|
sdNodeOrKeyName: "rowHeight",
|
|
21180
21230
|
encode: ({ nodes }) => {
|
|
@@ -21201,23 +21251,23 @@ const translator$x = NodeTranslator.from({
|
|
|
21201
21251
|
return Object.keys(heightAttrs).length > 0 ? { attributes: heightAttrs } : void 0;
|
|
21202
21252
|
}
|
|
21203
21253
|
});
|
|
21204
|
-
const translator$
|
|
21205
|
-
const translator$
|
|
21254
|
+
const translator$y = NodeTranslator.from(createMeasurementPropertyHandler("w:wAfter"));
|
|
21255
|
+
const translator$x = NodeTranslator.from(createMeasurementPropertyHandler("w:wBefore"));
|
|
21206
21256
|
const propertyTranslators$3 = [
|
|
21207
|
-
translator$
|
|
21257
|
+
translator$F,
|
|
21258
|
+
translator$1H,
|
|
21208
21259
|
translator$1F,
|
|
21209
|
-
translator$
|
|
21260
|
+
translator$E,
|
|
21261
|
+
translator$D,
|
|
21210
21262
|
translator$C,
|
|
21263
|
+
translator$1C,
|
|
21211
21264
|
translator$B,
|
|
21212
21265
|
translator$A,
|
|
21213
|
-
translator$1A,
|
|
21214
21266
|
translator$z,
|
|
21215
21267
|
translator$y,
|
|
21216
|
-
translator$x
|
|
21217
|
-
translator$w,
|
|
21218
|
-
translator$v
|
|
21268
|
+
translator$x
|
|
21219
21269
|
];
|
|
21220
|
-
const translator$
|
|
21270
|
+
const translator$w = NodeTranslator.from(
|
|
21221
21271
|
createNestedPropertiesTranslator("w:trPr", "tableRowProperties", propertyTranslators$3, {
|
|
21222
21272
|
cantSplit: false,
|
|
21223
21273
|
hidden: false,
|
|
@@ -21286,17 +21336,17 @@ const isPlaceholderCell = (cell) => {
|
|
|
21286
21336
|
}
|
|
21287
21337
|
return false;
|
|
21288
21338
|
};
|
|
21289
|
-
const XML_NODE_NAME$
|
|
21290
|
-
const SD_NODE_NAME$
|
|
21339
|
+
const XML_NODE_NAME$g = "w:tr";
|
|
21340
|
+
const SD_NODE_NAME$e = "tableRow";
|
|
21291
21341
|
const validXmlAttributes$9 = ["w:rsidDel", "w:rsidR", "w:rsidRPr", "w:rsidTr", "w14:paraId", "w14:textId"].map(
|
|
21292
21342
|
(xmlName) => createAttributeHandler(xmlName)
|
|
21293
21343
|
);
|
|
21294
|
-
const encode$
|
|
21344
|
+
const encode$m = (params2, encodedAttrs) => {
|
|
21295
21345
|
const { row } = params2.extraParams;
|
|
21296
21346
|
let tableRowProperties = {};
|
|
21297
21347
|
const tPr = row.elements.find((el) => el.name === "w:trPr");
|
|
21298
21348
|
if (tPr) {
|
|
21299
|
-
tableRowProperties = translator$
|
|
21349
|
+
tableRowProperties = translator$w.encode({
|
|
21300
21350
|
...params2,
|
|
21301
21351
|
nodes: [tPr]
|
|
21302
21352
|
});
|
|
@@ -21333,7 +21383,7 @@ const encode$k = (params2, encodedAttrs) => {
|
|
|
21333
21383
|
skipOccupiedColumns();
|
|
21334
21384
|
const startColumn = currentColumnIndex;
|
|
21335
21385
|
const columnWidth = gridColumnWidths?.[startColumn] || null;
|
|
21336
|
-
const result = translator$
|
|
21386
|
+
const result = translator$G.encode({
|
|
21337
21387
|
...params2,
|
|
21338
21388
|
extraParams: {
|
|
21339
21389
|
...params2.extraParams,
|
|
@@ -21366,7 +21416,7 @@ const encode$k = (params2, encodedAttrs) => {
|
|
|
21366
21416
|
};
|
|
21367
21417
|
return newNode;
|
|
21368
21418
|
};
|
|
21369
|
-
const decode$
|
|
21419
|
+
const decode$o = (params2, decodedAttrs) => {
|
|
21370
21420
|
const { node } = params2;
|
|
21371
21421
|
const cells = node.content || [];
|
|
21372
21422
|
let leadingPlaceholders = 0;
|
|
@@ -21406,7 +21456,7 @@ const decode$m = (params2, decodedAttrs) => {
|
|
|
21406
21456
|
}
|
|
21407
21457
|
}
|
|
21408
21458
|
tableRowProperties["cantSplit"] = node.attrs["cantSplit"];
|
|
21409
|
-
const trPr = translator$
|
|
21459
|
+
const trPr = translator$w.decode({
|
|
21410
21460
|
...params2,
|
|
21411
21461
|
node: { ...node, attrs: { ...node.attrs, tableRowProperties } }
|
|
21412
21462
|
});
|
|
@@ -21418,15 +21468,15 @@ const decode$m = (params2, decodedAttrs) => {
|
|
|
21418
21468
|
elements
|
|
21419
21469
|
};
|
|
21420
21470
|
};
|
|
21421
|
-
const config$
|
|
21422
|
-
xmlName: XML_NODE_NAME$
|
|
21423
|
-
sdNodeOrKeyName: SD_NODE_NAME$
|
|
21471
|
+
const config$f = {
|
|
21472
|
+
xmlName: XML_NODE_NAME$g,
|
|
21473
|
+
sdNodeOrKeyName: SD_NODE_NAME$e,
|
|
21424
21474
|
type: NodeTranslator.translatorTypes.NODE,
|
|
21425
|
-
encode: encode$
|
|
21426
|
-
decode: decode$
|
|
21475
|
+
encode: encode$m,
|
|
21476
|
+
decode: decode$o,
|
|
21427
21477
|
attributes: validXmlAttributes$9
|
|
21428
21478
|
};
|
|
21429
|
-
const translator$
|
|
21479
|
+
const translator$v = NodeTranslator.from(config$f);
|
|
21430
21480
|
function parseTagValueJSON(json) {
|
|
21431
21481
|
if (typeof json !== "string") {
|
|
21432
21482
|
return {};
|
|
@@ -30380,32 +30430,32 @@ function translateAnchorNode(params2) {
|
|
|
30380
30430
|
elements: [...anchorElements, ...elementsWithWrap]
|
|
30381
30431
|
};
|
|
30382
30432
|
}
|
|
30383
|
-
const XML_NODE_NAME$
|
|
30384
|
-
const SD_NODE_NAME$
|
|
30433
|
+
const XML_NODE_NAME$f = "wp:anchor";
|
|
30434
|
+
const SD_NODE_NAME$d = ["image", "shapeGroup", "vectorShape", "contentBlock"];
|
|
30385
30435
|
const validXmlAttributes$8 = ["distT", "distB", "distL", "distR"].map((xmlName) => createAttributeHandler(xmlName));
|
|
30386
|
-
function encode$
|
|
30436
|
+
function encode$l(params2) {
|
|
30387
30437
|
const { node } = params2.extraParams;
|
|
30388
30438
|
if (!node || !node.name) {
|
|
30389
30439
|
return null;
|
|
30390
30440
|
}
|
|
30391
30441
|
return handleAnchorNode(params2);
|
|
30392
30442
|
}
|
|
30393
|
-
function decode$
|
|
30443
|
+
function decode$n(params2) {
|
|
30394
30444
|
const { node } = params2;
|
|
30395
30445
|
if (!node || !node.type) {
|
|
30396
30446
|
return null;
|
|
30397
30447
|
}
|
|
30398
30448
|
return translateAnchorNode(params2);
|
|
30399
30449
|
}
|
|
30400
|
-
const config$
|
|
30401
|
-
xmlName: XML_NODE_NAME$
|
|
30402
|
-
sdNodeOrKeyName: SD_NODE_NAME$
|
|
30450
|
+
const config$e = {
|
|
30451
|
+
xmlName: XML_NODE_NAME$f,
|
|
30452
|
+
sdNodeOrKeyName: SD_NODE_NAME$d,
|
|
30403
30453
|
type: NodeTranslator.translatorTypes.NODE,
|
|
30404
|
-
encode: encode$
|
|
30405
|
-
decode: decode$
|
|
30454
|
+
encode: encode$l,
|
|
30455
|
+
decode: decode$n,
|
|
30406
30456
|
attributes: validXmlAttributes$8
|
|
30407
30457
|
};
|
|
30408
|
-
const translator$
|
|
30458
|
+
const translator$u = NodeTranslator.from(config$e);
|
|
30409
30459
|
function handleInlineNode(params2) {
|
|
30410
30460
|
const { node } = params2.extraParams;
|
|
30411
30461
|
if (node.name !== "wp:inline") {
|
|
@@ -30421,41 +30471,41 @@ function translateInlineNode(params2) {
|
|
|
30421
30471
|
elements: nodeElements.elements
|
|
30422
30472
|
};
|
|
30423
30473
|
}
|
|
30424
|
-
const XML_NODE_NAME$
|
|
30425
|
-
const SD_NODE_NAME$
|
|
30474
|
+
const XML_NODE_NAME$e = "wp:inline";
|
|
30475
|
+
const SD_NODE_NAME$c = ["image", "shapeGroup", "vectorShape", "contentBlock"];
|
|
30426
30476
|
const validXmlAttributes$7 = ["distT", "distB", "distL", "distR"].map((xmlName) => createAttributeHandler(xmlName));
|
|
30427
|
-
function encode$
|
|
30477
|
+
function encode$k(params2) {
|
|
30428
30478
|
const { node } = params2.extraParams;
|
|
30429
30479
|
if (!node || !node.name) {
|
|
30430
30480
|
return null;
|
|
30431
30481
|
}
|
|
30432
30482
|
return handleInlineNode(params2);
|
|
30433
30483
|
}
|
|
30434
|
-
function decode$
|
|
30484
|
+
function decode$m(params2) {
|
|
30435
30485
|
const { node } = params2;
|
|
30436
30486
|
if (!node || !node.type) {
|
|
30437
30487
|
return null;
|
|
30438
30488
|
}
|
|
30439
30489
|
return translateInlineNode(params2);
|
|
30440
30490
|
}
|
|
30441
|
-
const config$
|
|
30442
|
-
xmlName: XML_NODE_NAME$
|
|
30443
|
-
sdNodeOrKeyName: SD_NODE_NAME$
|
|
30491
|
+
const config$d = {
|
|
30492
|
+
xmlName: XML_NODE_NAME$e,
|
|
30493
|
+
sdNodeOrKeyName: SD_NODE_NAME$c,
|
|
30444
30494
|
type: NodeTranslator.translatorTypes.NODE,
|
|
30445
|
-
encode: encode$
|
|
30446
|
-
decode: decode$
|
|
30495
|
+
encode: encode$k,
|
|
30496
|
+
decode: decode$m,
|
|
30447
30497
|
attributes: validXmlAttributes$7
|
|
30448
30498
|
};
|
|
30449
|
-
const translator$
|
|
30450
|
-
const XML_NODE_NAME$
|
|
30451
|
-
const SD_NODE_NAME$
|
|
30499
|
+
const translator$t = NodeTranslator.from(config$d);
|
|
30500
|
+
const XML_NODE_NAME$d = "w:drawing";
|
|
30501
|
+
const SD_NODE_NAME$b = [];
|
|
30452
30502
|
const validXmlAttributes$6 = [];
|
|
30453
|
-
function encode$
|
|
30503
|
+
function encode$j(params2) {
|
|
30454
30504
|
const nodes = params2.nodes;
|
|
30455
30505
|
const node = nodes[0];
|
|
30456
30506
|
const translatorByChildName = {
|
|
30457
|
-
"wp:anchor": translator$
|
|
30458
|
-
"wp:inline": translator$
|
|
30507
|
+
"wp:anchor": translator$u,
|
|
30508
|
+
"wp:inline": translator$t
|
|
30459
30509
|
};
|
|
30460
30510
|
return node.elements.reduce((acc, child) => {
|
|
30461
30511
|
if (acc) return acc;
|
|
@@ -30464,12 +30514,12 @@ function encode$h(params2) {
|
|
|
30464
30514
|
return translator2.encode({ ...params2, extraParams: { node: child } }) || acc;
|
|
30465
30515
|
}, null);
|
|
30466
30516
|
}
|
|
30467
|
-
function decode$
|
|
30517
|
+
function decode$l(params2) {
|
|
30468
30518
|
const { node } = params2;
|
|
30469
30519
|
if (!node || !node.type) {
|
|
30470
30520
|
return null;
|
|
30471
30521
|
}
|
|
30472
|
-
const childTranslator = node.attrs.isAnchor ? translator$
|
|
30522
|
+
const childTranslator = node.attrs.isAnchor ? translator$u : translator$t;
|
|
30473
30523
|
const resultNode = childTranslator.decode(params2);
|
|
30474
30524
|
return wrapTextInRun(
|
|
30475
30525
|
{
|
|
@@ -30479,15 +30529,68 @@ function decode$j(params2) {
|
|
|
30479
30529
|
[]
|
|
30480
30530
|
);
|
|
30481
30531
|
}
|
|
30482
|
-
const config$
|
|
30483
|
-
xmlName: XML_NODE_NAME$
|
|
30484
|
-
sdNodeOrKeyName: SD_NODE_NAME$
|
|
30532
|
+
const config$c = {
|
|
30533
|
+
xmlName: XML_NODE_NAME$d,
|
|
30534
|
+
sdNodeOrKeyName: SD_NODE_NAME$b,
|
|
30485
30535
|
type: NodeTranslator.translatorTypes.NODE,
|
|
30486
|
-
encode: encode$
|
|
30487
|
-
decode: decode$
|
|
30536
|
+
encode: encode$j,
|
|
30537
|
+
decode: decode$l,
|
|
30488
30538
|
attributes: validXmlAttributes$6
|
|
30489
30539
|
};
|
|
30490
|
-
const translator$
|
|
30540
|
+
const translator$s = NodeTranslator.from(config$c);
|
|
30541
|
+
function getTextNodeForExport(text, marks, params2) {
|
|
30542
|
+
const hasLeadingOrTrailingSpace = /^\s|\s$/.test(text);
|
|
30543
|
+
const space = hasLeadingOrTrailingSpace ? "preserve" : null;
|
|
30544
|
+
const nodeAttrs = space ? { "xml:space": space } : null;
|
|
30545
|
+
const textNodes = [];
|
|
30546
|
+
const textRunProperties = decodeRPrFromMarks(marks || []);
|
|
30547
|
+
const parentRunProperties = params2.extraParams?.runProperties || {};
|
|
30548
|
+
const combinedRunProperties = combineRunProperties([parentRunProperties, textRunProperties]);
|
|
30549
|
+
const rPrNode = translator$1N.decode({ node: { attrs: { runProperties: combinedRunProperties } } });
|
|
30550
|
+
textNodes.push({
|
|
30551
|
+
name: "w:t",
|
|
30552
|
+
elements: [{ text, type: "text" }],
|
|
30553
|
+
attributes: nodeAttrs
|
|
30554
|
+
});
|
|
30555
|
+
if (params2) {
|
|
30556
|
+
const { editor } = params2;
|
|
30557
|
+
const customMarks = editor.extensionService.extensions.filter((e) => e.isExternal === true);
|
|
30558
|
+
marks.forEach((mark) => {
|
|
30559
|
+
const isCustomMark = customMarks.some((customMark) => {
|
|
30560
|
+
const customMarkName = customMark.name;
|
|
30561
|
+
return mark.type === customMarkName;
|
|
30562
|
+
});
|
|
30563
|
+
if (!isCustomMark) return;
|
|
30564
|
+
let attrsString = "";
|
|
30565
|
+
Object.entries(mark.attrs).forEach(([key2, value]) => {
|
|
30566
|
+
if (value) {
|
|
30567
|
+
attrsString += `${key2}=${value};`;
|
|
30568
|
+
}
|
|
30569
|
+
});
|
|
30570
|
+
if (isCustomMark) {
|
|
30571
|
+
textNodes.unshift({
|
|
30572
|
+
type: "element",
|
|
30573
|
+
name: "w:bookmarkStart",
|
|
30574
|
+
attributes: {
|
|
30575
|
+
"w:id": "5000",
|
|
30576
|
+
"w:name": mark.type + ";" + attrsString
|
|
30577
|
+
}
|
|
30578
|
+
});
|
|
30579
|
+
textNodes.push({
|
|
30580
|
+
type: "element",
|
|
30581
|
+
name: "w:bookmarkEnd",
|
|
30582
|
+
attributes: {
|
|
30583
|
+
"w:id": "5000"
|
|
30584
|
+
}
|
|
30585
|
+
});
|
|
30586
|
+
}
|
|
30587
|
+
});
|
|
30588
|
+
}
|
|
30589
|
+
return {
|
|
30590
|
+
name: "w:r",
|
|
30591
|
+
elements: rPrNode ? [rPrNode, ...textNodes] : textNodes
|
|
30592
|
+
};
|
|
30593
|
+
}
|
|
30491
30594
|
var he$2 = { exports: {} };
|
|
30492
30595
|
/*! https://mths.be/he v1.2.0 by @mathias | MIT license */
|
|
30493
30596
|
var he$1 = he$2.exports;
|
|
@@ -30834,7 +30937,7 @@ function prepareTextAnnotation(params2) {
|
|
|
30834
30937
|
return getTextNodeForExport(attrs.displayLabel, [...marks, ...marksFromAttrs], params2);
|
|
30835
30938
|
}
|
|
30836
30939
|
function prepareImageAnnotation(params2, imageSize) {
|
|
30837
|
-
return translator$
|
|
30940
|
+
return translator$s.decode({
|
|
30838
30941
|
...params2,
|
|
30839
30942
|
imageSize
|
|
30840
30943
|
});
|
|
@@ -30894,18 +30997,31 @@ function prepareUrlAnnotation(params2) {
|
|
|
30894
30997
|
node: { attrs = {}, marks = [] }
|
|
30895
30998
|
} = params2;
|
|
30896
30999
|
if (!attrs.linkUrl) return prepareTextAnnotation(params2);
|
|
30897
|
-
const
|
|
30898
|
-
|
|
30899
|
-
|
|
30900
|
-
|
|
30901
|
-
|
|
30902
|
-
|
|
30903
|
-
|
|
30904
|
-
|
|
30905
|
-
|
|
30906
|
-
|
|
30907
|
-
|
|
31000
|
+
const linkTextNode = {
|
|
31001
|
+
type: "text",
|
|
31002
|
+
text: attrs.linkUrl,
|
|
31003
|
+
marks: [
|
|
31004
|
+
...marks,
|
|
31005
|
+
{
|
|
31006
|
+
type: "link",
|
|
31007
|
+
attrs: {
|
|
31008
|
+
href: attrs.linkUrl,
|
|
31009
|
+
history: true,
|
|
31010
|
+
text: attrs.linkUrl
|
|
31011
|
+
}
|
|
31012
|
+
},
|
|
31013
|
+
{
|
|
31014
|
+
type: "textStyle",
|
|
31015
|
+
attrs: {
|
|
31016
|
+
color: "#467886"
|
|
31017
|
+
}
|
|
31018
|
+
}
|
|
31019
|
+
]
|
|
30908
31020
|
};
|
|
31021
|
+
return translator$10.decode({
|
|
31022
|
+
...params2,
|
|
31023
|
+
node: linkTextNode
|
|
31024
|
+
});
|
|
30909
31025
|
}
|
|
30910
31026
|
function translateFieldAttrsToMarks(attrs = {}) {
|
|
30911
31027
|
const { fontFamily: fontFamily2, fontSize: fontSize2, bold, underline, italic, textColor, textHighlight } = attrs;
|
|
@@ -31098,6 +31214,46 @@ function translateDocumentPartObj(params2) {
|
|
|
31098
31214
|
};
|
|
31099
31215
|
return result;
|
|
31100
31216
|
}
|
|
31217
|
+
const RUN_LEVEL_WRAPPERS = /* @__PURE__ */ new Set(["w:hyperlink", "w:ins", "w:del"]);
|
|
31218
|
+
function convertSdtContentToRuns(elements) {
|
|
31219
|
+
const normalized = Array.isArray(elements) ? elements : [elements];
|
|
31220
|
+
const runs = [];
|
|
31221
|
+
normalized.forEach((element) => {
|
|
31222
|
+
if (!element) return;
|
|
31223
|
+
if (element.name === "w:sdtPr") {
|
|
31224
|
+
return;
|
|
31225
|
+
}
|
|
31226
|
+
if (element.name === "w:r") {
|
|
31227
|
+
runs.push(element);
|
|
31228
|
+
return;
|
|
31229
|
+
}
|
|
31230
|
+
if (element.name === "w:sdt") {
|
|
31231
|
+
const sdtContent = (element.elements || []).find((child) => child?.name === "w:sdtContent");
|
|
31232
|
+
if (sdtContent?.elements) {
|
|
31233
|
+
runs.push(...convertSdtContentToRuns(sdtContent.elements));
|
|
31234
|
+
}
|
|
31235
|
+
return;
|
|
31236
|
+
}
|
|
31237
|
+
if (RUN_LEVEL_WRAPPERS.has(element.name)) {
|
|
31238
|
+
const wrapperElements = convertSdtContentToRuns(element.elements || []);
|
|
31239
|
+
if (wrapperElements.length) {
|
|
31240
|
+
runs.push({
|
|
31241
|
+
...element,
|
|
31242
|
+
elements: wrapperElements
|
|
31243
|
+
});
|
|
31244
|
+
}
|
|
31245
|
+
return;
|
|
31246
|
+
}
|
|
31247
|
+
if (element.name) {
|
|
31248
|
+
runs.push({
|
|
31249
|
+
name: "w:r",
|
|
31250
|
+
type: "element",
|
|
31251
|
+
elements: element.elements || [element]
|
|
31252
|
+
});
|
|
31253
|
+
}
|
|
31254
|
+
});
|
|
31255
|
+
return runs.filter((run2) => Array.isArray(run2.elements) && run2.elements.length > 0);
|
|
31256
|
+
}
|
|
31101
31257
|
function translateStructuredContent(params2) {
|
|
31102
31258
|
const { node, isFinalDoc } = params2;
|
|
31103
31259
|
const childContent = translateChildNodes({ ...params2, node });
|
|
@@ -31158,10 +31314,10 @@ function generateSdtPrTagForStructuredContent({ node }) {
|
|
|
31158
31314
|
};
|
|
31159
31315
|
return result;
|
|
31160
31316
|
}
|
|
31161
|
-
const XML_NODE_NAME$
|
|
31162
|
-
const SD_NODE_NAME$
|
|
31317
|
+
const XML_NODE_NAME$c = "w:sdt";
|
|
31318
|
+
const SD_NODE_NAME$a = ["fieldAnnotation", "structuredContent", "structuredContentBlock", "documentSection"];
|
|
31163
31319
|
const validXmlAttributes$5 = [];
|
|
31164
|
-
function encode$
|
|
31320
|
+
function encode$i(params2) {
|
|
31165
31321
|
const nodes = params2.nodes;
|
|
31166
31322
|
const node = nodes[0];
|
|
31167
31323
|
const { type: sdtType, handler: handler2 } = sdtNodeTypeStrategy(node);
|
|
@@ -31171,7 +31327,7 @@ function encode$g(params2) {
|
|
|
31171
31327
|
const result = handler2(params2);
|
|
31172
31328
|
return result;
|
|
31173
31329
|
}
|
|
31174
|
-
function decode$
|
|
31330
|
+
function decode$k(params2) {
|
|
31175
31331
|
const { node } = params2;
|
|
31176
31332
|
if (!node || !node.type) {
|
|
31177
31333
|
return null;
|
|
@@ -31189,15 +31345,15 @@ function decode$i(params2) {
|
|
|
31189
31345
|
const result = decoder();
|
|
31190
31346
|
return result;
|
|
31191
31347
|
}
|
|
31192
|
-
const config$
|
|
31193
|
-
xmlName: XML_NODE_NAME$
|
|
31194
|
-
sdNodeOrKeyName: SD_NODE_NAME$
|
|
31348
|
+
const config$b = {
|
|
31349
|
+
xmlName: XML_NODE_NAME$c,
|
|
31350
|
+
sdNodeOrKeyName: SD_NODE_NAME$a,
|
|
31195
31351
|
type: NodeTranslator.translatorTypes.NODE,
|
|
31196
|
-
encode: encode$
|
|
31197
|
-
decode: decode$
|
|
31352
|
+
encode: encode$i,
|
|
31353
|
+
decode: decode$k,
|
|
31198
31354
|
attributes: validXmlAttributes$5
|
|
31199
31355
|
};
|
|
31200
|
-
const translator$
|
|
31356
|
+
const translator$r = NodeTranslator.from(config$b);
|
|
31201
31357
|
function preProcessVerticalMergeCells(table, { editorSchema }) {
|
|
31202
31358
|
if (!table || !Array.isArray(table.content)) {
|
|
31203
31359
|
return table;
|
|
@@ -31238,17 +31394,17 @@ function preProcessVerticalMergeCells(table, { editorSchema }) {
|
|
|
31238
31394
|
}
|
|
31239
31395
|
return table;
|
|
31240
31396
|
}
|
|
31241
|
-
const translator$
|
|
31397
|
+
const translator$q = NodeTranslator.from({
|
|
31242
31398
|
xmlName: "w:bidiVisual",
|
|
31243
31399
|
sdNodeOrKeyName: "rightToLeft",
|
|
31244
31400
|
encode: ({ nodes }) => parseBoolean(nodes[0].attributes?.["w:val"] ?? "1"),
|
|
31245
31401
|
decode: ({ node }) => node.attrs.rightToLeft ? { attributes: {} } : void 0
|
|
31246
31402
|
});
|
|
31247
|
-
const translator$
|
|
31248
|
-
const translator$
|
|
31249
|
-
const translator$
|
|
31250
|
-
const translator$
|
|
31251
|
-
const translator$
|
|
31403
|
+
const translator$p = NodeTranslator.from(createSingleAttrPropertyHandler("w:tblCaption", "caption"));
|
|
31404
|
+
const translator$o = NodeTranslator.from(createSingleAttrPropertyHandler("w:tblDescription", "description"));
|
|
31405
|
+
const translator$n = NodeTranslator.from(createMeasurementPropertyHandler("w:tblInd", "tableIndent"));
|
|
31406
|
+
const translator$m = NodeTranslator.from(createSingleAttrPropertyHandler("w:tblLayout", "tableLayout", "w:type"));
|
|
31407
|
+
const translator$l = NodeTranslator.from({
|
|
31252
31408
|
xmlName: "w:tblLook",
|
|
31253
31409
|
sdNodeOrKeyName: "tblLook",
|
|
31254
31410
|
attributes: ["w:firstColumn", "w:firstRow", "w:lastColumn", "w:lastRow", "w:noHBand", "w:noVBand"].map((attr) => createAttributeHandler(attr, null, parseBoolean, booleanToString)).concat([createAttributeHandler("w:val")]),
|
|
@@ -31260,16 +31416,16 @@ const translator$j = NodeTranslator.from({
|
|
|
31260
31416
|
return Object.keys(decodedAttrs).length > 0 ? { attributes: decodedAttrs } : void 0;
|
|
31261
31417
|
}
|
|
31262
31418
|
});
|
|
31263
|
-
const translator$
|
|
31264
|
-
const translator$
|
|
31265
|
-
const translator$
|
|
31419
|
+
const translator$k = NodeTranslator.from(createSingleAttrPropertyHandler("w:tblOverlap", "overlap"));
|
|
31420
|
+
const translator$j = NodeTranslator.from(createSingleAttrPropertyHandler("w:tblStyle", "tableStyleId"));
|
|
31421
|
+
const translator$i = NodeTranslator.from(
|
|
31266
31422
|
createSingleAttrPropertyHandler("w:tblStyleColBandSize", "tableStyleColBandSize")
|
|
31267
31423
|
);
|
|
31268
|
-
const translator$
|
|
31424
|
+
const translator$h = NodeTranslator.from(
|
|
31269
31425
|
createSingleAttrPropertyHandler("w:tblStyleRowBandSize", "tableStyleRowBandSize")
|
|
31270
31426
|
);
|
|
31271
|
-
const translator$
|
|
31272
|
-
const translator$
|
|
31427
|
+
const translator$g = NodeTranslator.from(createMeasurementPropertyHandler("w:tblW", "tableWidth"));
|
|
31428
|
+
const translator$f = NodeTranslator.from({
|
|
31273
31429
|
xmlName: "w:tblpPr",
|
|
31274
31430
|
sdNodeOrKeyName: "floatingTableProperties",
|
|
31275
31431
|
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))),
|
|
@@ -31282,35 +31438,37 @@ const translator$d = NodeTranslator.from({
|
|
|
31282
31438
|
}
|
|
31283
31439
|
});
|
|
31284
31440
|
const propertyTranslators$2 = [
|
|
31285
|
-
translator$
|
|
31441
|
+
translator$1p,
|
|
31442
|
+
translator$X,
|
|
31286
31443
|
translator$V,
|
|
31287
|
-
translator$
|
|
31288
|
-
translator$
|
|
31444
|
+
translator$U,
|
|
31445
|
+
translator$1n,
|
|
31289
31446
|
translator$1l,
|
|
31290
|
-
translator$
|
|
31291
|
-
translator$
|
|
31292
|
-
translator$1h
|
|
31447
|
+
translator$T,
|
|
31448
|
+
translator$1j
|
|
31293
31449
|
];
|
|
31294
|
-
const translator$
|
|
31450
|
+
const translator$e = NodeTranslator.from(
|
|
31295
31451
|
createNestedPropertiesTranslator("w:tblBorders", "borders", propertyTranslators$2)
|
|
31296
31452
|
);
|
|
31297
31453
|
const propertyTranslators$1 = [
|
|
31454
|
+
translator$1o,
|
|
31455
|
+
translator$W,
|
|
31298
31456
|
translator$1m,
|
|
31299
|
-
translator$U,
|
|
31300
31457
|
translator$1k,
|
|
31301
|
-
translator$
|
|
31302
|
-
translator$
|
|
31303
|
-
translator$1g
|
|
31458
|
+
translator$S,
|
|
31459
|
+
translator$1i
|
|
31304
31460
|
];
|
|
31305
|
-
const translator$
|
|
31461
|
+
const translator$d = NodeTranslator.from(
|
|
31306
31462
|
createNestedPropertiesTranslator("w:tblCellMar", "cellMargins", propertyTranslators$1)
|
|
31307
31463
|
);
|
|
31308
31464
|
const propertyTranslators = [
|
|
31465
|
+
translator$q,
|
|
31466
|
+
translator$1C,
|
|
31467
|
+
translator$1Q,
|
|
31468
|
+
translator$p,
|
|
31469
|
+
translator$B,
|
|
31309
31470
|
translator$o,
|
|
31310
|
-
translator$1A,
|
|
31311
|
-
translator$1O,
|
|
31312
31471
|
translator$n,
|
|
31313
|
-
translator$z,
|
|
31314
31472
|
translator$m,
|
|
31315
31473
|
translator$l,
|
|
31316
31474
|
translator$k,
|
|
@@ -31320,14 +31478,12 @@ const propertyTranslators = [
|
|
|
31320
31478
|
translator$g,
|
|
31321
31479
|
translator$f,
|
|
31322
31480
|
translator$e,
|
|
31323
|
-
translator$d
|
|
31324
|
-
translator$c,
|
|
31325
|
-
translator$b
|
|
31481
|
+
translator$d
|
|
31326
31482
|
];
|
|
31327
|
-
const translator$
|
|
31483
|
+
const translator$c = NodeTranslator.from(
|
|
31328
31484
|
createNestedPropertiesTranslator("w:tblPr", "tableProperties", propertyTranslators)
|
|
31329
31485
|
);
|
|
31330
|
-
const translator$
|
|
31486
|
+
const translator$b = NodeTranslator.from(
|
|
31331
31487
|
createSingleAttrPropertyHandler("w:gridCol", "col", "w:w", parseInteger, integerToString)
|
|
31332
31488
|
);
|
|
31333
31489
|
const DEFAULT_COLUMN_WIDTH_PX = 100;
|
|
@@ -31377,24 +31533,24 @@ const resolveFallbackColumnWidthTwips = (params2, totalColumns, cellMinWidthTwip
|
|
|
31377
31533
|
}
|
|
31378
31534
|
return Math.max(fallbackWidthTwips, cellMinWidthTwips);
|
|
31379
31535
|
};
|
|
31380
|
-
const XML_NODE_NAME$
|
|
31536
|
+
const XML_NODE_NAME$b = "w:tblGrid";
|
|
31381
31537
|
const SD_ATTR_KEY$1 = "grid";
|
|
31382
31538
|
const cellMinWidth = pixelsToTwips(10);
|
|
31383
|
-
const encode$
|
|
31539
|
+
const encode$h = (params2) => {
|
|
31384
31540
|
const { nodes } = params2;
|
|
31385
31541
|
const node = nodes[0];
|
|
31386
31542
|
const attributes = encodeProperties(
|
|
31387
31543
|
{ ...params2, nodes: [node] },
|
|
31388
|
-
{ [translator$
|
|
31544
|
+
{ [translator$b.xmlName]: translator$b },
|
|
31389
31545
|
true
|
|
31390
31546
|
);
|
|
31391
31547
|
return {
|
|
31392
|
-
xmlName: XML_NODE_NAME$
|
|
31548
|
+
xmlName: XML_NODE_NAME$b,
|
|
31393
31549
|
sdNodeOrKeyName: SD_ATTR_KEY$1,
|
|
31394
31550
|
attributes
|
|
31395
31551
|
};
|
|
31396
31552
|
};
|
|
31397
|
-
const decode$
|
|
31553
|
+
const decode$j = (params2) => {
|
|
31398
31554
|
const { grid: rawGrid } = params2.node.attrs || {};
|
|
31399
31555
|
const grid = Array.isArray(rawGrid) ? rawGrid : [];
|
|
31400
31556
|
const { firstRow = {} } = params2.extraParams || {};
|
|
@@ -31417,10 +31573,10 @@ const decode$h = (params2) => {
|
|
|
31417
31573
|
const roundedWidth = Math.round(numericWidth);
|
|
31418
31574
|
const minimumWidth = shouldEnforceMinimum ? cellMinWidth : 1;
|
|
31419
31575
|
const safeWidth = Math.max(roundedWidth, minimumWidth);
|
|
31420
|
-
const decoded = translator$
|
|
31576
|
+
const decoded = translator$b.decode({
|
|
31421
31577
|
node: { type: (
|
|
31422
31578
|
/** @type {string} */
|
|
31423
|
-
translator$
|
|
31579
|
+
translator$b.sdNodeOrKeyName
|
|
31424
31580
|
), attrs: { col: safeWidth } }
|
|
31425
31581
|
});
|
|
31426
31582
|
if (decoded) elements.push(decoded);
|
|
@@ -31460,19 +31616,19 @@ const decode$h = (params2) => {
|
|
|
31460
31616
|
columnIndex++;
|
|
31461
31617
|
}
|
|
31462
31618
|
const newNode = {
|
|
31463
|
-
name: XML_NODE_NAME$
|
|
31619
|
+
name: XML_NODE_NAME$b,
|
|
31464
31620
|
attributes: {},
|
|
31465
31621
|
elements
|
|
31466
31622
|
};
|
|
31467
31623
|
return newNode;
|
|
31468
31624
|
};
|
|
31469
|
-
const config$
|
|
31470
|
-
xmlName: XML_NODE_NAME$
|
|
31625
|
+
const config$a = {
|
|
31626
|
+
xmlName: XML_NODE_NAME$b,
|
|
31471
31627
|
sdNodeOrKeyName: SD_ATTR_KEY$1,
|
|
31472
|
-
encode: encode$
|
|
31473
|
-
decode: decode$
|
|
31628
|
+
encode: encode$h,
|
|
31629
|
+
decode: decode$j
|
|
31474
31630
|
};
|
|
31475
|
-
const translator$
|
|
31631
|
+
const translator$a = NodeTranslator.from(config$a);
|
|
31476
31632
|
const DEFAULT_PAGE_WIDTH_TWIPS = 12240;
|
|
31477
31633
|
const DEFAULT_PAGE_MARGIN_TWIPS = 1440;
|
|
31478
31634
|
const DEFAULT_CONTENT_WIDTH_TWIPS = DEFAULT_PAGE_WIDTH_TWIPS - 2 * DEFAULT_PAGE_MARGIN_TWIPS;
|
|
@@ -31535,19 +31691,19 @@ const buildFallbackGridForTable = ({ params: params2, rows, tableWidth, tableWid
|
|
|
31535
31691
|
columnWidths: Array(columnCount).fill(fallbackColumnWidthPx)
|
|
31536
31692
|
};
|
|
31537
31693
|
};
|
|
31538
|
-
const XML_NODE_NAME$
|
|
31539
|
-
const SD_NODE_NAME$
|
|
31540
|
-
const encode$
|
|
31694
|
+
const XML_NODE_NAME$a = "w:tbl";
|
|
31695
|
+
const SD_NODE_NAME$9 = "table";
|
|
31696
|
+
const encode$g = (params2, encodedAttrs) => {
|
|
31541
31697
|
const { nodes } = params2;
|
|
31542
31698
|
const node = nodes[0];
|
|
31543
31699
|
const tblPr = node.elements.find((el) => el.name === "w:tblPr");
|
|
31544
31700
|
if (tblPr) {
|
|
31545
|
-
const encodedProperties = translator$
|
|
31701
|
+
const encodedProperties = translator$c.encode({ ...params2, nodes: [tblPr] });
|
|
31546
31702
|
encodedAttrs["tableProperties"] = encodedProperties || {};
|
|
31547
31703
|
}
|
|
31548
31704
|
const tblGrid = node.elements.find((el) => el.name === "w:tblGrid");
|
|
31549
31705
|
if (tblGrid) {
|
|
31550
|
-
encodedAttrs["grid"] = translator$
|
|
31706
|
+
encodedAttrs["grid"] = translator$a.encode({ ...params2, nodes: [tblGrid] }).attributes;
|
|
31551
31707
|
}
|
|
31552
31708
|
[
|
|
31553
31709
|
"tableStyleId",
|
|
@@ -31615,7 +31771,7 @@ const encode$e = (params2, encodedAttrs) => {
|
|
|
31615
31771
|
const totalColumns = columnWidths.length;
|
|
31616
31772
|
const activeRowSpans = totalColumns > 0 ? new Array(totalColumns).fill(0) : [];
|
|
31617
31773
|
rows.forEach((row, rowIndex) => {
|
|
31618
|
-
const result = translator$
|
|
31774
|
+
const result = translator$v.encode({
|
|
31619
31775
|
...params2,
|
|
31620
31776
|
nodes: [row],
|
|
31621
31777
|
extraParams: {
|
|
@@ -31669,13 +31825,13 @@ const encode$e = (params2, encodedAttrs) => {
|
|
|
31669
31825
|
attrs: encodedAttrs
|
|
31670
31826
|
};
|
|
31671
31827
|
};
|
|
31672
|
-
const decode$
|
|
31828
|
+
const decode$i = (params2, decodedAttrs) => {
|
|
31673
31829
|
params2.node = preProcessVerticalMergeCells(params2.node, params2);
|
|
31674
31830
|
const { node } = params2;
|
|
31675
31831
|
const elements = translateChildNodes(params2);
|
|
31676
31832
|
const firstRow = node.content?.find((n) => n.type === "tableRow");
|
|
31677
31833
|
const properties = node.attrs.grid;
|
|
31678
|
-
const element = translator$
|
|
31834
|
+
const element = translator$a.decode({
|
|
31679
31835
|
...params2,
|
|
31680
31836
|
node: { ...node, attrs: { ...node.attrs, grid: properties } },
|
|
31681
31837
|
extraParams: {
|
|
@@ -31685,7 +31841,7 @@ const decode$g = (params2, decodedAttrs) => {
|
|
|
31685
31841
|
if (element) elements.unshift(element);
|
|
31686
31842
|
if (node.attrs?.tableProperties) {
|
|
31687
31843
|
const properties2 = { ...node.attrs.tableProperties };
|
|
31688
|
-
const element2 = translator$
|
|
31844
|
+
const element2 = translator$c.decode({
|
|
31689
31845
|
...params2,
|
|
31690
31846
|
node: { ...node, attrs: { ...node.attrs, tableProperties: properties2 } }
|
|
31691
31847
|
});
|
|
@@ -31751,7 +31907,7 @@ function _getReferencedTableStyles(tableStyleReference, params2) {
|
|
|
31751
31907
|
if (baseTblPr && baseTblPr.elements) {
|
|
31752
31908
|
tblPr.elements.push(...baseTblPr.elements);
|
|
31753
31909
|
}
|
|
31754
|
-
const tableProperties = translator$
|
|
31910
|
+
const tableProperties = translator$c.encode({ ...params2, nodes: [tblPr] });
|
|
31755
31911
|
if (tableProperties) {
|
|
31756
31912
|
const { borders, rowBorders } = _processTableBorders(tableProperties.borders || {});
|
|
31757
31913
|
if (borders) stylesToReturn.borders = borders;
|
|
@@ -31770,85 +31926,85 @@ function _getReferencedTableStyles(tableStyleReference, params2) {
|
|
|
31770
31926
|
}
|
|
31771
31927
|
return stylesToReturn;
|
|
31772
31928
|
}
|
|
31773
|
-
const config$
|
|
31774
|
-
xmlName: XML_NODE_NAME$
|
|
31775
|
-
sdNodeOrKeyName: SD_NODE_NAME$
|
|
31929
|
+
const config$9 = {
|
|
31930
|
+
xmlName: XML_NODE_NAME$a,
|
|
31931
|
+
sdNodeOrKeyName: SD_NODE_NAME$9,
|
|
31776
31932
|
type: NodeTranslator.translatorTypes.NODE,
|
|
31777
|
-
encode: encode$
|
|
31778
|
-
decode: decode$
|
|
31933
|
+
encode: encode$g,
|
|
31934
|
+
decode: decode$i,
|
|
31779
31935
|
attributes: []
|
|
31780
31936
|
};
|
|
31781
|
-
const translator$
|
|
31782
|
-
const encode$
|
|
31937
|
+
const translator$9 = NodeTranslator.from(config$9);
|
|
31938
|
+
const encode$f = (attributes) => {
|
|
31783
31939
|
return attributes["w:id"];
|
|
31784
31940
|
};
|
|
31785
|
-
const decode$
|
|
31941
|
+
const decode$h = (attrs) => {
|
|
31786
31942
|
return attrs.id;
|
|
31787
31943
|
};
|
|
31788
31944
|
const attrConfig$7 = Object.freeze({
|
|
31789
31945
|
xmlName: "w:id",
|
|
31790
31946
|
sdName: "id",
|
|
31791
|
-
encode: encode$
|
|
31792
|
-
decode: decode$
|
|
31947
|
+
encode: encode$f,
|
|
31948
|
+
decode: decode$h
|
|
31793
31949
|
});
|
|
31794
|
-
const encode$
|
|
31950
|
+
const encode$e = (attributes) => {
|
|
31795
31951
|
return attributes["w:name"];
|
|
31796
31952
|
};
|
|
31797
|
-
const decode$
|
|
31953
|
+
const decode$g = (attrs) => {
|
|
31798
31954
|
return attrs.name;
|
|
31799
31955
|
};
|
|
31800
31956
|
const attrConfig$6 = Object.freeze({
|
|
31801
31957
|
xmlName: "w:name",
|
|
31802
31958
|
sdName: "name",
|
|
31803
|
-
encode: encode$
|
|
31804
|
-
decode: decode$
|
|
31959
|
+
encode: encode$e,
|
|
31960
|
+
decode: decode$g
|
|
31805
31961
|
});
|
|
31806
|
-
const encode$
|
|
31962
|
+
const encode$d = (attributes) => {
|
|
31807
31963
|
return attributes["w:colFirst"];
|
|
31808
31964
|
};
|
|
31809
|
-
const decode$
|
|
31965
|
+
const decode$f = (attrs) => {
|
|
31810
31966
|
return attrs.colFirst;
|
|
31811
31967
|
};
|
|
31812
31968
|
const attrConfig$5 = Object.freeze({
|
|
31813
31969
|
xmlName: "w:colFirst",
|
|
31814
31970
|
sdName: "colFirst",
|
|
31815
|
-
encode: encode$
|
|
31816
|
-
decode: decode$
|
|
31971
|
+
encode: encode$d,
|
|
31972
|
+
decode: decode$f
|
|
31817
31973
|
});
|
|
31818
|
-
const encode$
|
|
31974
|
+
const encode$c = (attributes) => {
|
|
31819
31975
|
return attributes["w:colLast"];
|
|
31820
31976
|
};
|
|
31821
|
-
const decode$
|
|
31977
|
+
const decode$e = (attrs) => {
|
|
31822
31978
|
return attrs.colLast;
|
|
31823
31979
|
};
|
|
31824
31980
|
const attrConfig$4 = Object.freeze({
|
|
31825
31981
|
xmlName: "w:colLast",
|
|
31826
31982
|
sdName: "colLast",
|
|
31827
|
-
encode: encode$
|
|
31828
|
-
decode: decode$
|
|
31983
|
+
encode: encode$c,
|
|
31984
|
+
decode: decode$e
|
|
31829
31985
|
});
|
|
31830
|
-
const encode$
|
|
31986
|
+
const encode$b = (attributes) => {
|
|
31831
31987
|
return attributes["w:displacedByCustomXml"];
|
|
31832
31988
|
};
|
|
31833
|
-
const decode$
|
|
31989
|
+
const decode$d = (attrs) => {
|
|
31834
31990
|
return attrs.displacedByCustomXml;
|
|
31835
31991
|
};
|
|
31836
31992
|
const attrConfig$3 = Object.freeze({
|
|
31837
31993
|
xmlName: "w:displacedByCustomXml",
|
|
31838
31994
|
sdName: "displacedByCustomXml",
|
|
31839
|
-
encode: encode$
|
|
31840
|
-
decode: decode$
|
|
31995
|
+
encode: encode$b,
|
|
31996
|
+
decode: decode$d
|
|
31841
31997
|
});
|
|
31842
31998
|
const validXmlAttributes$4 = [attrConfig$7, attrConfig$6, attrConfig$5, attrConfig$4, attrConfig$3];
|
|
31843
|
-
const XML_NODE_NAME$
|
|
31844
|
-
const SD_NODE_NAME$
|
|
31845
|
-
const encode$
|
|
31999
|
+
const XML_NODE_NAME$9 = "w:bookmarkStart";
|
|
32000
|
+
const SD_NODE_NAME$8 = "bookmarkStart";
|
|
32001
|
+
const encode$a = (params2, encodedAttrs = {}) => {
|
|
31846
32002
|
return {
|
|
31847
32003
|
type: "bookmarkStart",
|
|
31848
32004
|
attrs: encodedAttrs
|
|
31849
32005
|
};
|
|
31850
32006
|
};
|
|
31851
|
-
const decode$
|
|
32007
|
+
const decode$c = (params2, decodedAttrs = {}) => {
|
|
31852
32008
|
const result = {
|
|
31853
32009
|
name: "w:bookmarkStart",
|
|
31854
32010
|
elements: []
|
|
@@ -31858,49 +32014,49 @@ const decode$a = (params2, decodedAttrs = {}) => {
|
|
|
31858
32014
|
}
|
|
31859
32015
|
return result;
|
|
31860
32016
|
};
|
|
31861
|
-
const config$
|
|
31862
|
-
xmlName: XML_NODE_NAME$
|
|
31863
|
-
sdNodeOrKeyName: SD_NODE_NAME$
|
|
32017
|
+
const config$8 = {
|
|
32018
|
+
xmlName: XML_NODE_NAME$9,
|
|
32019
|
+
sdNodeOrKeyName: SD_NODE_NAME$8,
|
|
31864
32020
|
type: NodeTranslator.translatorTypes.NODE,
|
|
31865
|
-
encode: encode$
|
|
31866
|
-
decode: decode$
|
|
32021
|
+
encode: encode$a,
|
|
32022
|
+
decode: decode$c,
|
|
31867
32023
|
attributes: validXmlAttributes$4
|
|
31868
32024
|
};
|
|
31869
|
-
const translator$
|
|
31870
|
-
const encode$
|
|
32025
|
+
const translator$8 = NodeTranslator.from(config$8);
|
|
32026
|
+
const encode$9 = (attributes) => {
|
|
31871
32027
|
return attributes["w:id"];
|
|
31872
32028
|
};
|
|
31873
|
-
const decode$
|
|
32029
|
+
const decode$b = (attrs) => {
|
|
31874
32030
|
return attrs.id;
|
|
31875
32031
|
};
|
|
31876
32032
|
const attrConfig$2 = Object.freeze({
|
|
31877
32033
|
xmlName: "w:id",
|
|
31878
32034
|
sdName: "id",
|
|
31879
|
-
encode: encode$
|
|
31880
|
-
decode: decode$
|
|
32035
|
+
encode: encode$9,
|
|
32036
|
+
decode: decode$b
|
|
31881
32037
|
});
|
|
31882
|
-
const encode$
|
|
32038
|
+
const encode$8 = (attributes) => {
|
|
31883
32039
|
return attributes["w:displacedByCustomXml"];
|
|
31884
32040
|
};
|
|
31885
|
-
const decode$
|
|
32041
|
+
const decode$a = (attrs) => {
|
|
31886
32042
|
return attrs.displacedByCustomXml;
|
|
31887
32043
|
};
|
|
31888
32044
|
const attrConfig$1 = Object.freeze({
|
|
31889
32045
|
xmlName: "w:displacedByCustomXml",
|
|
31890
32046
|
sdName: "displacedByCustomXml",
|
|
31891
|
-
encode: encode$
|
|
31892
|
-
decode: decode$
|
|
32047
|
+
encode: encode$8,
|
|
32048
|
+
decode: decode$a
|
|
31893
32049
|
});
|
|
31894
32050
|
const validXmlAttributes$3 = [attrConfig$2, attrConfig$1];
|
|
31895
|
-
const XML_NODE_NAME$
|
|
31896
|
-
const SD_NODE_NAME$
|
|
31897
|
-
const encode$
|
|
32051
|
+
const XML_NODE_NAME$8 = "w:bookmarkEnd";
|
|
32052
|
+
const SD_NODE_NAME$7 = "bookmarkEnd";
|
|
32053
|
+
const encode$7 = (params2, encodedAttrs = {}) => {
|
|
31898
32054
|
return {
|
|
31899
32055
|
type: "bookmarkEnd",
|
|
31900
32056
|
attrs: encodedAttrs
|
|
31901
32057
|
};
|
|
31902
32058
|
};
|
|
31903
|
-
const decode$
|
|
32059
|
+
const decode$9 = (params2, decodedAttrs = {}) => {
|
|
31904
32060
|
const result = {
|
|
31905
32061
|
name: "w:bookmarkEnd",
|
|
31906
32062
|
elements: []
|
|
@@ -31910,27 +32066,27 @@ const decode$7 = (params2, decodedAttrs = {}) => {
|
|
|
31910
32066
|
}
|
|
31911
32067
|
return result;
|
|
31912
32068
|
};
|
|
31913
|
-
const config$
|
|
31914
|
-
xmlName: XML_NODE_NAME$
|
|
31915
|
-
sdNodeOrKeyName: SD_NODE_NAME$
|
|
32069
|
+
const config$7 = {
|
|
32070
|
+
xmlName: XML_NODE_NAME$8,
|
|
32071
|
+
sdNodeOrKeyName: SD_NODE_NAME$7,
|
|
31916
32072
|
type: NodeTranslator.translatorTypes.NODE,
|
|
31917
|
-
encode: encode$
|
|
31918
|
-
decode: decode$
|
|
32073
|
+
encode: encode$7,
|
|
32074
|
+
decode: decode$9,
|
|
31919
32075
|
attributes: validXmlAttributes$3
|
|
31920
32076
|
};
|
|
31921
|
-
const translator$
|
|
31922
|
-
const decode$
|
|
32077
|
+
const translator$7 = NodeTranslator.from(config$7);
|
|
32078
|
+
const decode$8 = (attrs) => attrs?.["w:id"];
|
|
31923
32079
|
const attrConfig = Object.freeze({
|
|
31924
32080
|
xmlName: "w:id",
|
|
31925
32081
|
sdName: "w:id",
|
|
31926
32082
|
// We do not translate it from 'w:id' to 'id' when encoding, so the name is the same
|
|
31927
32083
|
encode: () => {
|
|
31928
32084
|
},
|
|
31929
|
-
decode: decode$
|
|
32085
|
+
decode: decode$8
|
|
31930
32086
|
});
|
|
31931
|
-
const XML_NODE_NAME$
|
|
31932
|
-
const SD_NODE_NAME$
|
|
31933
|
-
const decode$
|
|
32087
|
+
const XML_NODE_NAME$7 = "w:commentRange";
|
|
32088
|
+
const SD_NODE_NAME$6 = "commentRange";
|
|
32089
|
+
const decode$7 = (params2) => {
|
|
31934
32090
|
const { node, comments, commentsExportType, exportedCommentDefs } = params2;
|
|
31935
32091
|
if (!node) return;
|
|
31936
32092
|
if (!comments) return;
|
|
@@ -31973,19 +32129,19 @@ const getCommentSchema = (type2, commentIndex) => {
|
|
|
31973
32129
|
};
|
|
31974
32130
|
};
|
|
31975
32131
|
const getConfig = (type2) => ({
|
|
31976
|
-
xmlName: `${XML_NODE_NAME$
|
|
31977
|
-
sdNodeOrKeyName: `${SD_NODE_NAME$
|
|
32132
|
+
xmlName: `${XML_NODE_NAME$7}${type2}`,
|
|
32133
|
+
sdNodeOrKeyName: `${SD_NODE_NAME$6}${type2}`,
|
|
31978
32134
|
type: NodeTranslator.translatorTypes.NODE,
|
|
31979
32135
|
encode: () => {
|
|
31980
32136
|
},
|
|
31981
|
-
decode: decode$
|
|
32137
|
+
decode: decode$7,
|
|
31982
32138
|
attributes: [attrConfig]
|
|
31983
32139
|
});
|
|
31984
32140
|
const commentRangeStartTranslator = NodeTranslator.from(getConfig("Start"));
|
|
31985
32141
|
const commentRangeEndTranslator = NodeTranslator.from(getConfig("End"));
|
|
31986
|
-
const XML_NODE_NAME$
|
|
31987
|
-
const SD_NODE_NAME$
|
|
31988
|
-
const encode$
|
|
32142
|
+
const XML_NODE_NAME$6 = "sd:pageReference";
|
|
32143
|
+
const SD_NODE_NAME$5 = "pageReference";
|
|
32144
|
+
const encode$6 = (params2) => {
|
|
31989
32145
|
const { nodes = [], nodeListHandler } = params2 || {};
|
|
31990
32146
|
const node = nodes[0];
|
|
31991
32147
|
const processedText = nodeListHandler.handler({
|
|
@@ -32002,7 +32158,7 @@ const encode$4 = (params2) => {
|
|
|
32002
32158
|
};
|
|
32003
32159
|
return processedNode;
|
|
32004
32160
|
};
|
|
32005
|
-
const decode$
|
|
32161
|
+
const decode$6 = (params2) => {
|
|
32006
32162
|
const { node } = params2;
|
|
32007
32163
|
const outputMarks = processOutputMarks(node.attrs?.marksAsAttrs || []);
|
|
32008
32164
|
const contentNodes = (node.content ?? []).flatMap((n) => exportSchemaToJson({ ...params2, node: n }));
|
|
@@ -32075,17 +32231,17 @@ const decode$4 = (params2) => {
|
|
|
32075
32231
|
];
|
|
32076
32232
|
return translated;
|
|
32077
32233
|
};
|
|
32078
|
-
const config$
|
|
32079
|
-
xmlName: XML_NODE_NAME$
|
|
32080
|
-
sdNodeOrKeyName: SD_NODE_NAME$
|
|
32234
|
+
const config$6 = {
|
|
32235
|
+
xmlName: XML_NODE_NAME$6,
|
|
32236
|
+
sdNodeOrKeyName: SD_NODE_NAME$5,
|
|
32081
32237
|
type: NodeTranslator.translatorTypes.NODE,
|
|
32082
|
-
encode: encode$
|
|
32083
|
-
decode: decode$
|
|
32238
|
+
encode: encode$6,
|
|
32239
|
+
decode: decode$6
|
|
32084
32240
|
};
|
|
32085
|
-
const translator$
|
|
32086
|
-
const XML_NODE_NAME$
|
|
32087
|
-
const SD_NODE_NAME$
|
|
32088
|
-
const encode$
|
|
32241
|
+
const translator$6 = NodeTranslator.from(config$6);
|
|
32242
|
+
const XML_NODE_NAME$5 = "sd:tableOfContents";
|
|
32243
|
+
const SD_NODE_NAME$4 = "tableOfContents";
|
|
32244
|
+
const encode$5 = (params2) => {
|
|
32089
32245
|
const { nodes = [], nodeListHandler } = params2 || {};
|
|
32090
32246
|
const node = nodes[0];
|
|
32091
32247
|
const processedContent = nodeListHandler.handler({
|
|
@@ -32101,7 +32257,7 @@ const encode$3 = (params2) => {
|
|
|
32101
32257
|
};
|
|
32102
32258
|
return processedNode;
|
|
32103
32259
|
};
|
|
32104
|
-
const decode$
|
|
32260
|
+
const decode$5 = (params2) => {
|
|
32105
32261
|
const { node } = params2;
|
|
32106
32262
|
const contentNodes = node.content.map((n) => exportSchemaToJson({ ...params2, node: n }));
|
|
32107
32263
|
const tocBeginElements = [
|
|
@@ -32148,6 +32304,194 @@ const decode$3 = (params2) => {
|
|
|
32148
32304
|
}
|
|
32149
32305
|
return contentNodes;
|
|
32150
32306
|
};
|
|
32307
|
+
const config$5 = {
|
|
32308
|
+
xmlName: XML_NODE_NAME$5,
|
|
32309
|
+
sdNodeOrKeyName: SD_NODE_NAME$4,
|
|
32310
|
+
type: NodeTranslator.translatorTypes.NODE,
|
|
32311
|
+
encode: encode$5,
|
|
32312
|
+
decode: decode$5
|
|
32313
|
+
};
|
|
32314
|
+
const translator$5 = NodeTranslator.from(config$5);
|
|
32315
|
+
const XML_NODE_NAME$4 = "sd:autoPageNumber";
|
|
32316
|
+
const SD_NODE_NAME$3 = "page-number";
|
|
32317
|
+
const encode$4 = (params2) => {
|
|
32318
|
+
const { nodes = [] } = params2 || {};
|
|
32319
|
+
const node = nodes[0];
|
|
32320
|
+
const rPr = node.elements?.find((el) => el.name === "w:rPr");
|
|
32321
|
+
const marks = parseMarks(rPr || { elements: [] });
|
|
32322
|
+
const processedNode = {
|
|
32323
|
+
type: "page-number",
|
|
32324
|
+
attrs: {
|
|
32325
|
+
marksAsAttrs: marks
|
|
32326
|
+
}
|
|
32327
|
+
};
|
|
32328
|
+
return processedNode;
|
|
32329
|
+
};
|
|
32330
|
+
const decode$4 = (params2) => {
|
|
32331
|
+
const { node } = params2;
|
|
32332
|
+
const outputMarks = processOutputMarks(node.attrs?.marksAsAttrs || []);
|
|
32333
|
+
const translated = [
|
|
32334
|
+
{
|
|
32335
|
+
name: "w:r",
|
|
32336
|
+
elements: [
|
|
32337
|
+
{
|
|
32338
|
+
name: "w:rPr",
|
|
32339
|
+
elements: outputMarks
|
|
32340
|
+
},
|
|
32341
|
+
{
|
|
32342
|
+
name: "w:fldChar",
|
|
32343
|
+
attributes: {
|
|
32344
|
+
"w:fldCharType": "begin"
|
|
32345
|
+
}
|
|
32346
|
+
}
|
|
32347
|
+
]
|
|
32348
|
+
},
|
|
32349
|
+
{
|
|
32350
|
+
name: "w:r",
|
|
32351
|
+
elements: [
|
|
32352
|
+
{
|
|
32353
|
+
name: "w:rPr",
|
|
32354
|
+
elements: outputMarks
|
|
32355
|
+
},
|
|
32356
|
+
{
|
|
32357
|
+
name: "w:instrText",
|
|
32358
|
+
attributes: { "xml:space": "preserve" },
|
|
32359
|
+
elements: [
|
|
32360
|
+
{
|
|
32361
|
+
type: "text",
|
|
32362
|
+
text: " PAGE"
|
|
32363
|
+
}
|
|
32364
|
+
]
|
|
32365
|
+
}
|
|
32366
|
+
]
|
|
32367
|
+
},
|
|
32368
|
+
{
|
|
32369
|
+
name: "w:r",
|
|
32370
|
+
elements: [
|
|
32371
|
+
{
|
|
32372
|
+
name: "w:rPr",
|
|
32373
|
+
elements: outputMarks
|
|
32374
|
+
},
|
|
32375
|
+
{
|
|
32376
|
+
name: "w:fldChar",
|
|
32377
|
+
attributes: {
|
|
32378
|
+
"w:fldCharType": "separate"
|
|
32379
|
+
}
|
|
32380
|
+
}
|
|
32381
|
+
]
|
|
32382
|
+
},
|
|
32383
|
+
{
|
|
32384
|
+
name: "w:r",
|
|
32385
|
+
elements: [
|
|
32386
|
+
{
|
|
32387
|
+
name: "w:rPr",
|
|
32388
|
+
elements: outputMarks
|
|
32389
|
+
},
|
|
32390
|
+
{
|
|
32391
|
+
name: "w:fldChar",
|
|
32392
|
+
attributes: {
|
|
32393
|
+
"w:fldCharType": "end"
|
|
32394
|
+
}
|
|
32395
|
+
}
|
|
32396
|
+
]
|
|
32397
|
+
}
|
|
32398
|
+
];
|
|
32399
|
+
return translated;
|
|
32400
|
+
};
|
|
32401
|
+
const config$4 = {
|
|
32402
|
+
xmlName: XML_NODE_NAME$4,
|
|
32403
|
+
sdNodeOrKeyName: SD_NODE_NAME$3,
|
|
32404
|
+
type: NodeTranslator.translatorTypes.NODE,
|
|
32405
|
+
encode: encode$4,
|
|
32406
|
+
decode: decode$4
|
|
32407
|
+
};
|
|
32408
|
+
const translator$4 = NodeTranslator.from(config$4);
|
|
32409
|
+
const XML_NODE_NAME$3 = "sd:totalPageNumber";
|
|
32410
|
+
const SD_NODE_NAME$2 = "total-page-number";
|
|
32411
|
+
const encode$3 = (params2) => {
|
|
32412
|
+
const { nodes = [] } = params2 || {};
|
|
32413
|
+
const node = nodes[0];
|
|
32414
|
+
const rPr = node.elements?.find((el) => el.name === "w:rPr");
|
|
32415
|
+
const marks = parseMarks(rPr || { elements: [] });
|
|
32416
|
+
const processedNode = {
|
|
32417
|
+
type: "total-page-number",
|
|
32418
|
+
attrs: {
|
|
32419
|
+
marksAsAttrs: marks
|
|
32420
|
+
}
|
|
32421
|
+
};
|
|
32422
|
+
return processedNode;
|
|
32423
|
+
};
|
|
32424
|
+
const decode$3 = (params2) => {
|
|
32425
|
+
const { node } = params2;
|
|
32426
|
+
const outputMarks = processOutputMarks(node.attrs?.marksAsAttrs || []);
|
|
32427
|
+
const translated = [
|
|
32428
|
+
{
|
|
32429
|
+
name: "w:r",
|
|
32430
|
+
elements: [
|
|
32431
|
+
{
|
|
32432
|
+
name: "w:rPr",
|
|
32433
|
+
elements: outputMarks
|
|
32434
|
+
},
|
|
32435
|
+
{
|
|
32436
|
+
name: "w:fldChar",
|
|
32437
|
+
attributes: {
|
|
32438
|
+
"w:fldCharType": "begin"
|
|
32439
|
+
}
|
|
32440
|
+
}
|
|
32441
|
+
]
|
|
32442
|
+
},
|
|
32443
|
+
{
|
|
32444
|
+
name: "w:r",
|
|
32445
|
+
elements: [
|
|
32446
|
+
{
|
|
32447
|
+
name: "w:rPr",
|
|
32448
|
+
elements: outputMarks
|
|
32449
|
+
},
|
|
32450
|
+
{
|
|
32451
|
+
name: "w:instrText",
|
|
32452
|
+
attributes: { "xml:space": "preserve" },
|
|
32453
|
+
elements: [
|
|
32454
|
+
{
|
|
32455
|
+
type: "text",
|
|
32456
|
+
text: " NUMPAGES"
|
|
32457
|
+
}
|
|
32458
|
+
]
|
|
32459
|
+
}
|
|
32460
|
+
]
|
|
32461
|
+
},
|
|
32462
|
+
{
|
|
32463
|
+
name: "w:r",
|
|
32464
|
+
elements: [
|
|
32465
|
+
{
|
|
32466
|
+
name: "w:rPr",
|
|
32467
|
+
elements: outputMarks
|
|
32468
|
+
},
|
|
32469
|
+
{
|
|
32470
|
+
name: "w:fldChar",
|
|
32471
|
+
attributes: {
|
|
32472
|
+
"w:fldCharType": "separate"
|
|
32473
|
+
}
|
|
32474
|
+
}
|
|
32475
|
+
]
|
|
32476
|
+
},
|
|
32477
|
+
{
|
|
32478
|
+
name: "w:r",
|
|
32479
|
+
elements: [
|
|
32480
|
+
{
|
|
32481
|
+
name: "w:rPr",
|
|
32482
|
+
elements: outputMarks
|
|
32483
|
+
},
|
|
32484
|
+
{
|
|
32485
|
+
name: "w:fldChar",
|
|
32486
|
+
attributes: {
|
|
32487
|
+
"w:fldCharType": "end"
|
|
32488
|
+
}
|
|
32489
|
+
}
|
|
32490
|
+
]
|
|
32491
|
+
}
|
|
32492
|
+
];
|
|
32493
|
+
return translated;
|
|
32494
|
+
};
|
|
32151
32495
|
const config$3 = {
|
|
32152
32496
|
xmlName: XML_NODE_NAME$3,
|
|
32153
32497
|
sdNodeOrKeyName: SD_NODE_NAME$2,
|
|
@@ -32207,7 +32551,7 @@ function handleVRectImport({ pNode, pict, params: params2 }) {
|
|
|
32207
32551
|
if (isHorizontalRule) {
|
|
32208
32552
|
schemaAttrs.horizontalRule = true;
|
|
32209
32553
|
}
|
|
32210
|
-
const pElement = translator
|
|
32554
|
+
const pElement = translator$11.encode({
|
|
32211
32555
|
...params2,
|
|
32212
32556
|
nodes: [{ ...pNode, elements: pNode.elements.filter((el) => el.name !== "w:r") }]
|
|
32213
32557
|
});
|
|
@@ -32264,7 +32608,7 @@ const handleDrawingNode = (params2) => {
|
|
|
32264
32608
|
if (mainNode.name === "w:drawing") node = mainNode;
|
|
32265
32609
|
else node = mainNode.elements.find((el) => el.name === "w:drawing");
|
|
32266
32610
|
if (!node) return { nodes: [], consumed: 0 };
|
|
32267
|
-
const schemaNode = translator$
|
|
32611
|
+
const schemaNode = translator$s.encode(params2);
|
|
32268
32612
|
const newNodes = schemaNode ? [schemaNode] : [];
|
|
32269
32613
|
return { nodes: newNodes, consumed: 1 };
|
|
32270
32614
|
};
|
|
@@ -32379,7 +32723,7 @@ const handleTrackChangeNode = (params2) => {
|
|
|
32379
32723
|
});
|
|
32380
32724
|
break;
|
|
32381
32725
|
case "w:ins":
|
|
32382
|
-
result = translator$
|
|
32726
|
+
result = translator$1w.encode({
|
|
32383
32727
|
...translatorParams,
|
|
32384
32728
|
extraParams: {
|
|
32385
32729
|
...translatorParams.extraParams,
|
|
@@ -32394,8 +32738,8 @@ const trackChangeNodeHandlerEntity = {
|
|
|
32394
32738
|
handlerName: "trackChangeNodeHandler",
|
|
32395
32739
|
handler: handleTrackChangeNode
|
|
32396
32740
|
};
|
|
32397
|
-
const hyperlinkNodeHandlerEntity = generateV2HandlerEntity("hyperlinkNodeHandler", translator$
|
|
32398
|
-
const runNodeHandlerEntity = generateV2HandlerEntity("runNodeHandler", translator
|
|
32741
|
+
const hyperlinkNodeHandlerEntity = generateV2HandlerEntity("hyperlinkNodeHandler", translator$10);
|
|
32742
|
+
const runNodeHandlerEntity = generateV2HandlerEntity("runNodeHandler", translator$$);
|
|
32399
32743
|
const XML_NODE_NAME$1 = "w:t";
|
|
32400
32744
|
const SD_NODE_NAME$1 = "text";
|
|
32401
32745
|
const validXmlAttributes$1 = [createAttributeHandler("xml:space", "xmlSpace")];
|
|
@@ -32435,12 +32779,12 @@ const decode$1 = (params2) => {
|
|
|
32435
32779
|
case "trackDelete":
|
|
32436
32780
|
return translator$2.decode(params2);
|
|
32437
32781
|
case "trackInsert":
|
|
32438
|
-
return translator$
|
|
32782
|
+
return translator$1w.decode(params2);
|
|
32439
32783
|
}
|
|
32440
32784
|
}
|
|
32441
32785
|
const isLinkNode = node.marks?.some((m2) => m2.type === "link");
|
|
32442
32786
|
if (isLinkNode && !extraParams?.linkProcessed) {
|
|
32443
|
-
return translator$
|
|
32787
|
+
return translator$10.decode(params2);
|
|
32444
32788
|
}
|
|
32445
32789
|
const { text, marks = [] } = node;
|
|
32446
32790
|
return getTextNodeForExport(text, marks, params2);
|
|
@@ -32482,7 +32826,7 @@ const handleParagraphNode = (params2) => {
|
|
|
32482
32826
|
if (nodes.length === 0 || nodes[0].name !== "w:p") {
|
|
32483
32827
|
return { nodes: [], consumed: 0 };
|
|
32484
32828
|
}
|
|
32485
|
-
const schemaNode = translator
|
|
32829
|
+
const schemaNode = translator$11.encode(params2);
|
|
32486
32830
|
const newNodes = schemaNode ? [schemaNode] : [];
|
|
32487
32831
|
return { nodes: newNodes, consumed: 1 };
|
|
32488
32832
|
};
|
|
@@ -32495,7 +32839,7 @@ const handleSdtNode = (params2) => {
|
|
|
32495
32839
|
if (nodes.length === 0 || nodes[0].name !== "w:sdt") {
|
|
32496
32840
|
return { nodes: [], consumed: 0 };
|
|
32497
32841
|
}
|
|
32498
|
-
const result = translator$
|
|
32842
|
+
const result = translator$r.encode(params2);
|
|
32499
32843
|
if (!result) {
|
|
32500
32844
|
return { nodes: [], consumed: 0 };
|
|
32501
32845
|
}
|
|
@@ -32636,7 +32980,7 @@ const handler = (params2) => {
|
|
|
32636
32980
|
if (nodes.length === 0 || nodes[0].name !== "w:br") {
|
|
32637
32981
|
return { nodes: [], consumed: 0 };
|
|
32638
32982
|
}
|
|
32639
|
-
const result = translator$
|
|
32983
|
+
const result = translator$23.encode(params2);
|
|
32640
32984
|
if (!result) return { nodes: [], consumed: 0 };
|
|
32641
32985
|
return {
|
|
32642
32986
|
nodes: [result],
|
|
@@ -32708,7 +33052,7 @@ const handleBookmarkStartNode = (params2) => {
|
|
|
32708
33052
|
if (isCustomMarkBookmark(nodes[0], params2.editor)) {
|
|
32709
33053
|
return handleBookmarkNode(params2);
|
|
32710
33054
|
}
|
|
32711
|
-
const node = translator$
|
|
33055
|
+
const node = translator$8.encode(params2);
|
|
32712
33056
|
if (!node) return { nodes: [], consumed: 0 };
|
|
32713
33057
|
return { nodes: [node], consumed: 1 };
|
|
32714
33058
|
};
|
|
@@ -32740,7 +33084,7 @@ const handleBookmarkEndNode = (params2) => {
|
|
|
32740
33084
|
if (!nodes.length || nodes[0].name !== "w:bookmarkEnd") {
|
|
32741
33085
|
return { nodes: [], consumed: 0 };
|
|
32742
33086
|
}
|
|
32743
|
-
const node = translator$
|
|
33087
|
+
const node = translator$7.encode(params2);
|
|
32744
33088
|
if (!node) return { nodes: [], consumed: 0 };
|
|
32745
33089
|
return { nodes: [node], consumed: 1 };
|
|
32746
33090
|
};
|
|
@@ -32790,7 +33134,7 @@ const handleAlternateChoice = (params2) => {
|
|
|
32790
33134
|
...currentNode,
|
|
32791
33135
|
type: "element"
|
|
32792
33136
|
};
|
|
32793
|
-
const translated = translator$
|
|
33137
|
+
const translated = translator$1M.encode({
|
|
32794
33138
|
...params2,
|
|
32795
33139
|
nodes: [nodeForTranslator],
|
|
32796
33140
|
extraParams: { ...params2.extraParams || {}, node: nodeForTranslator }
|
|
@@ -32816,45 +33160,9 @@ const alternateChoiceHandler = {
|
|
|
32816
33160
|
handlerName: "alternateChoiceHandler",
|
|
32817
33161
|
handler: handleAlternateChoice
|
|
32818
33162
|
};
|
|
32819
|
-
const
|
|
32820
|
-
|
|
32821
|
-
|
|
32822
|
-
return { nodes: [], consumed: 0 };
|
|
32823
|
-
}
|
|
32824
|
-
const rPr = nodes[0].elements?.find((el) => el.name === "w:rPr");
|
|
32825
|
-
const marks = parseMarks(rPr || { elements: [] });
|
|
32826
|
-
const processedNode = {
|
|
32827
|
-
type: "page-number",
|
|
32828
|
-
attrs: {
|
|
32829
|
-
marksAsAttrs: marks
|
|
32830
|
-
}
|
|
32831
|
-
};
|
|
32832
|
-
return { nodes: [processedNode], consumed: 1 };
|
|
32833
|
-
};
|
|
32834
|
-
const autoPageHandlerEntity = {
|
|
32835
|
-
handlerName: "autoPageNumberHandler",
|
|
32836
|
-
handler: handleAutoPageNumber
|
|
32837
|
-
};
|
|
32838
|
-
const handleAutoTotalPageNumber = (params2) => {
|
|
32839
|
-
const { nodes } = params2;
|
|
32840
|
-
if (nodes.length === 0 || nodes[0].name !== "sd:totalPageNumber") {
|
|
32841
|
-
return { nodes: [], consumed: 0 };
|
|
32842
|
-
}
|
|
32843
|
-
const rPr = nodes[0].elements?.find((el) => el.name === "w:rPr");
|
|
32844
|
-
const marks = parseMarks(rPr || { elements: [] });
|
|
32845
|
-
const processedNode = {
|
|
32846
|
-
type: "total-page-number",
|
|
32847
|
-
attrs: {
|
|
32848
|
-
marksAsAttrs: marks
|
|
32849
|
-
}
|
|
32850
|
-
};
|
|
32851
|
-
return { nodes: [processedNode], consumed: 1 };
|
|
32852
|
-
};
|
|
32853
|
-
const autoTotalPageCountEntity = {
|
|
32854
|
-
handlerName: "autoTotalPageCountEntity",
|
|
32855
|
-
handler: handleAutoTotalPageNumber
|
|
32856
|
-
};
|
|
32857
|
-
const pageReferenceEntity = generateV2HandlerEntity("pageReferenceNodeHandler", translator$4);
|
|
33163
|
+
const autoPageHandlerEntity = generateV2HandlerEntity("autoPageNumberHandler", translator$4);
|
|
33164
|
+
const autoTotalPageCountEntity = generateV2HandlerEntity("autoTotalPageCountEntity", translator$3);
|
|
33165
|
+
const pageReferenceEntity = generateV2HandlerEntity("pageReferenceNodeHandler", translator$6);
|
|
32858
33166
|
const handlePictNode = (params2) => {
|
|
32859
33167
|
const { nodes } = params2;
|
|
32860
33168
|
if (!nodes.length || nodes[0].name !== "w:p") {
|
|
@@ -33252,15 +33560,15 @@ const handleTabNode = (params2) => {
|
|
|
33252
33560
|
if (!nodes.length || nodes[0].name !== "w:tab") {
|
|
33253
33561
|
return { nodes: [], consumed: 0 };
|
|
33254
33562
|
}
|
|
33255
|
-
const node = translator$
|
|
33563
|
+
const node = translator$21.encode(params2);
|
|
33256
33564
|
return { nodes: [node], consumed: 1 };
|
|
33257
33565
|
};
|
|
33258
33566
|
const tabNodeEntityHandler = {
|
|
33259
33567
|
handlerName: "w:tabTranslator",
|
|
33260
33568
|
handler: handleTabNode
|
|
33261
33569
|
};
|
|
33262
|
-
const tableNodeHandlerEntity = generateV2HandlerEntity("tableNodeHandler", translator$
|
|
33263
|
-
const tableOfContentsHandlerEntity = generateV2HandlerEntity("tableOfContentsHandler", translator$
|
|
33570
|
+
const tableNodeHandlerEntity = generateV2HandlerEntity("tableNodeHandler", translator$9);
|
|
33571
|
+
const tableOfContentsHandlerEntity = generateV2HandlerEntity("tableOfContentsHandler", translator$5);
|
|
33264
33572
|
function preProcessPageInstruction(nodesToCombine) {
|
|
33265
33573
|
const pageNumNode = {
|
|
33266
33574
|
name: "sd:autoPageNumber",
|
|
@@ -34112,7 +34420,7 @@ function translateContentBlock(params2) {
|
|
|
34112
34420
|
if (vmlAttributes || horizontalRule) {
|
|
34113
34421
|
return translateVRectContentBlock(params2);
|
|
34114
34422
|
}
|
|
34115
|
-
const alternateContent = translator$
|
|
34423
|
+
const alternateContent = translator$1M.decode(params2);
|
|
34116
34424
|
return wrapTextInRun(alternateContent);
|
|
34117
34425
|
}
|
|
34118
34426
|
function translateVRectContentBlock(params2) {
|
|
@@ -34156,7 +34464,7 @@ function translateVRectContentBlock(params2) {
|
|
|
34156
34464
|
const XML_NODE_NAME = "w:pict";
|
|
34157
34465
|
const SD_NODE_NAME = ["shapeContainer", "contentBlock"];
|
|
34158
34466
|
const validXmlAttributes = [];
|
|
34159
|
-
function encode$
|
|
34467
|
+
function encode$S(params2) {
|
|
34160
34468
|
const { node, pNode } = params2.extraParams;
|
|
34161
34469
|
const { type: pictType, handler: handler2 } = pictNodeTypeStrategy(node);
|
|
34162
34470
|
if (!handler2 || pictType === "unknown") {
|
|
@@ -34188,12 +34496,11 @@ const config = {
|
|
|
34188
34496
|
xmlName: XML_NODE_NAME,
|
|
34189
34497
|
sdNodeOrKeyName: SD_NODE_NAME,
|
|
34190
34498
|
type: NodeTranslator.translatorTypes.NODE,
|
|
34191
|
-
encode: encode$
|
|
34499
|
+
encode: encode$S,
|
|
34192
34500
|
decode,
|
|
34193
34501
|
attributes: validXmlAttributes
|
|
34194
34502
|
};
|
|
34195
34503
|
const translator = NodeTranslator.from(config);
|
|
34196
|
-
const RUN_LEVEL_WRAPPERS = /* @__PURE__ */ new Set(["w:hyperlink", "w:ins", "w:del"]);
|
|
34197
34504
|
const DEFAULT_SECTION_PROPS_TWIPS = Object.freeze({
|
|
34198
34505
|
pageSize: Object.freeze({ width: "12240", height: "15840" }),
|
|
34199
34506
|
pageMargins: Object.freeze({
|
|
@@ -34251,64 +34558,25 @@ const ensureSectionLayoutDefaults = (sectPr, converter) => {
|
|
|
34251
34558
|
});
|
|
34252
34559
|
return sectPr;
|
|
34253
34560
|
};
|
|
34254
|
-
function convertSdtContentToRuns(elements) {
|
|
34255
|
-
const normalized = Array.isArray(elements) ? elements : [elements];
|
|
34256
|
-
const runs = [];
|
|
34257
|
-
normalized.forEach((element) => {
|
|
34258
|
-
if (!element) return;
|
|
34259
|
-
if (element.name === "w:sdtPr") {
|
|
34260
|
-
return;
|
|
34261
|
-
}
|
|
34262
|
-
if (element.name === "w:r") {
|
|
34263
|
-
runs.push(element);
|
|
34264
|
-
return;
|
|
34265
|
-
}
|
|
34266
|
-
if (element.name === "w:sdt") {
|
|
34267
|
-
const sdtContent = (element.elements || []).find((child) => child?.name === "w:sdtContent");
|
|
34268
|
-
if (sdtContent?.elements) {
|
|
34269
|
-
runs.push(...convertSdtContentToRuns(sdtContent.elements));
|
|
34270
|
-
}
|
|
34271
|
-
return;
|
|
34272
|
-
}
|
|
34273
|
-
if (RUN_LEVEL_WRAPPERS.has(element.name)) {
|
|
34274
|
-
const wrapperElements = convertSdtContentToRuns(element.elements || []);
|
|
34275
|
-
if (wrapperElements.length) {
|
|
34276
|
-
runs.push({
|
|
34277
|
-
...element,
|
|
34278
|
-
elements: wrapperElements
|
|
34279
|
-
});
|
|
34280
|
-
}
|
|
34281
|
-
return;
|
|
34282
|
-
}
|
|
34283
|
-
if (element.name) {
|
|
34284
|
-
runs.push({
|
|
34285
|
-
name: "w:r",
|
|
34286
|
-
type: "element",
|
|
34287
|
-
elements: element.elements || [element]
|
|
34288
|
-
});
|
|
34289
|
-
}
|
|
34290
|
-
});
|
|
34291
|
-
return runs.filter((run2) => Array.isArray(run2.elements) && run2.elements.length > 0);
|
|
34292
|
-
}
|
|
34293
34561
|
function exportSchemaToJson(params2) {
|
|
34294
34562
|
const { type: type2 } = params2.node || {};
|
|
34295
34563
|
const router = {
|
|
34296
34564
|
doc: translateDocumentNode,
|
|
34297
34565
|
body: translateBodyNode,
|
|
34298
34566
|
heading: translateHeadingNode,
|
|
34299
|
-
paragraph: translator
|
|
34300
|
-
run: translator
|
|
34567
|
+
paragraph: translator$11,
|
|
34568
|
+
run: translator$$,
|
|
34301
34569
|
text: translator$1,
|
|
34302
|
-
lineBreak: translator$
|
|
34303
|
-
table: translator$
|
|
34304
|
-
tableRow: translator$
|
|
34305
|
-
tableCell: translator$
|
|
34306
|
-
bookmarkStart: translator$
|
|
34307
|
-
bookmarkEnd: translator$
|
|
34308
|
-
fieldAnnotation: translator$
|
|
34309
|
-
tab: translator$
|
|
34310
|
-
image: translator$
|
|
34311
|
-
hardBreak: translator$
|
|
34570
|
+
lineBreak: translator$23,
|
|
34571
|
+
table: translator$9,
|
|
34572
|
+
tableRow: translator$v,
|
|
34573
|
+
tableCell: translator$G,
|
|
34574
|
+
bookmarkStart: translator$8,
|
|
34575
|
+
bookmarkEnd: translator$7,
|
|
34576
|
+
fieldAnnotation: translator$r,
|
|
34577
|
+
tab: translator$21,
|
|
34578
|
+
image: translator$s,
|
|
34579
|
+
hardBreak: translator$23,
|
|
34312
34580
|
commentRangeStart: commentRangeStartTranslator,
|
|
34313
34581
|
commentRangeEnd: commentRangeEndTranslator,
|
|
34314
34582
|
commentReference: () => null,
|
|
@@ -34317,14 +34585,14 @@ function exportSchemaToJson(params2) {
|
|
|
34317
34585
|
contentBlock: translator,
|
|
34318
34586
|
vectorShape: translateVectorShape,
|
|
34319
34587
|
shapeGroup: translateShapeGroup,
|
|
34320
|
-
structuredContent: translator$
|
|
34321
|
-
structuredContentBlock: translator$
|
|
34322
|
-
documentPartObject: translator$
|
|
34323
|
-
documentSection: translator$
|
|
34324
|
-
"page-number":
|
|
34325
|
-
"total-page-number":
|
|
34326
|
-
pageReference: translator$
|
|
34327
|
-
tableOfContents: translator$
|
|
34588
|
+
structuredContent: translator$r,
|
|
34589
|
+
structuredContentBlock: translator$r,
|
|
34590
|
+
documentPartObject: translator$r,
|
|
34591
|
+
documentSection: translator$r,
|
|
34592
|
+
"page-number": translator$4,
|
|
34593
|
+
"total-page-number": translator$3,
|
|
34594
|
+
pageReference: translator$6,
|
|
34595
|
+
tableOfContents: translator$5
|
|
34328
34596
|
};
|
|
34329
34597
|
let handler2 = router[type2];
|
|
34330
34598
|
if (handler2 && "decode" in handler2 && typeof handler2.decode === "function") {
|
|
@@ -34396,57 +34664,7 @@ function translateHeadingNode(params2) {
|
|
|
34396
34664
|
// Maps to Heading1, Heading2, etc. in Word
|
|
34397
34665
|
}
|
|
34398
34666
|
};
|
|
34399
|
-
return
|
|
34400
|
-
}
|
|
34401
|
-
function translateParagraphNode(params2) {
|
|
34402
|
-
const elements = translateChildNodes(params2);
|
|
34403
|
-
const htmlAnnotationChild = elements.find((element) => element.name === "htmlAnnotation");
|
|
34404
|
-
if (htmlAnnotationChild) {
|
|
34405
|
-
return htmlAnnotationChild.elements;
|
|
34406
|
-
}
|
|
34407
|
-
const pPr = generateParagraphProperties(params2);
|
|
34408
|
-
if (pPr) elements.unshift(pPr);
|
|
34409
|
-
let attributes = {};
|
|
34410
|
-
if (params2.node.attrs?.rsidRDefault) {
|
|
34411
|
-
attributes["w:rsidRDefault"] = params2.node.attrs.rsidRDefault;
|
|
34412
|
-
}
|
|
34413
|
-
const result = {
|
|
34414
|
-
name: "w:p",
|
|
34415
|
-
elements,
|
|
34416
|
-
attributes
|
|
34417
|
-
};
|
|
34418
|
-
return result;
|
|
34419
|
-
}
|
|
34420
|
-
function generateParagraphProperties(params2) {
|
|
34421
|
-
const { node } = params2;
|
|
34422
|
-
const { attrs = {} } = node;
|
|
34423
|
-
const paragraphProperties = carbonCopy(attrs.paragraphProperties || {});
|
|
34424
|
-
if (attrs.styleId !== paragraphProperties.styleId) {
|
|
34425
|
-
paragraphProperties.styleId = attrs.styleId;
|
|
34426
|
-
}
|
|
34427
|
-
["borders", "styleId", "indent", "textAlign", "keepLines", "keepNext", "spacing", "tabStops"].forEach((key2) => {
|
|
34428
|
-
let propKey = key2 === "textAlign" ? "justification" : key2;
|
|
34429
|
-
if (JSON.stringify(paragraphProperties[propKey]) !== JSON.stringify(attrs[key2])) {
|
|
34430
|
-
paragraphProperties[key2] = attrs[key2];
|
|
34431
|
-
}
|
|
34432
|
-
});
|
|
34433
|
-
const framePr = attrs.dropcap;
|
|
34434
|
-
if (framePr) {
|
|
34435
|
-
framePr.dropCap = framePr.type;
|
|
34436
|
-
delete framePr.type;
|
|
34437
|
-
}
|
|
34438
|
-
if (JSON.stringify(paragraphProperties.framePr) !== JSON.stringify(framePr)) {
|
|
34439
|
-
paragraphProperties.framePr = framePr;
|
|
34440
|
-
}
|
|
34441
|
-
const marksProps = decodeRPrFromMarks(attrs.marksAttrs || []);
|
|
34442
|
-
const finalRunProps = combineRunProperties([paragraphProperties.runProperties || {}, marksProps]);
|
|
34443
|
-
paragraphProperties.runProperties = finalRunProps;
|
|
34444
|
-
const pPr = translator$10.decode({ node: { ...node, attrs: { paragraphProperties } } });
|
|
34445
|
-
const sectPr = node.attrs?.paragraphProperties?.sectPr;
|
|
34446
|
-
if (sectPr) {
|
|
34447
|
-
pPr.elements.push(sectPr);
|
|
34448
|
-
}
|
|
34449
|
-
return pPr;
|
|
34667
|
+
return translator$11.decode({ ...params2, node: paragraphNode });
|
|
34450
34668
|
}
|
|
34451
34669
|
function translateDocumentNode(params2) {
|
|
34452
34670
|
const bodyNode = {
|
|
@@ -34461,59 +34679,6 @@ function translateDocumentNode(params2) {
|
|
|
34461
34679
|
};
|
|
34462
34680
|
return [node, params2];
|
|
34463
34681
|
}
|
|
34464
|
-
function getTextNodeForExport(text, marks, params2) {
|
|
34465
|
-
const hasLeadingOrTrailingSpace = /^\s|\s$/.test(text);
|
|
34466
|
-
const space = hasLeadingOrTrailingSpace ? "preserve" : null;
|
|
34467
|
-
const nodeAttrs = space ? { "xml:space": space } : null;
|
|
34468
|
-
const textNodes = [];
|
|
34469
|
-
const textRunProperties = decodeRPrFromMarks(marks || []);
|
|
34470
|
-
const parentRunProperties = params2.extraParams?.runProperties || {};
|
|
34471
|
-
const combinedRunProperties = combineRunProperties([parentRunProperties, textRunProperties]);
|
|
34472
|
-
const rPrNode = translator$1L.decode({ node: { attrs: { runProperties: combinedRunProperties } } });
|
|
34473
|
-
textNodes.push({
|
|
34474
|
-
name: "w:t",
|
|
34475
|
-
elements: [{ text, type: "text" }],
|
|
34476
|
-
attributes: nodeAttrs
|
|
34477
|
-
});
|
|
34478
|
-
if (params2) {
|
|
34479
|
-
const { editor } = params2;
|
|
34480
|
-
const customMarks = editor.extensionService.extensions.filter((e) => e.isExternal === true);
|
|
34481
|
-
marks.forEach((mark) => {
|
|
34482
|
-
const isCustomMark = customMarks.some((customMark) => {
|
|
34483
|
-
const customMarkName = customMark.name;
|
|
34484
|
-
return mark.type === customMarkName;
|
|
34485
|
-
});
|
|
34486
|
-
if (!isCustomMark) return;
|
|
34487
|
-
let attrsString = "";
|
|
34488
|
-
Object.entries(mark.attrs).forEach(([key2, value]) => {
|
|
34489
|
-
if (value) {
|
|
34490
|
-
attrsString += `${key2}=${value};`;
|
|
34491
|
-
}
|
|
34492
|
-
});
|
|
34493
|
-
if (isCustomMark) {
|
|
34494
|
-
textNodes.unshift({
|
|
34495
|
-
type: "element",
|
|
34496
|
-
name: "w:bookmarkStart",
|
|
34497
|
-
attributes: {
|
|
34498
|
-
"w:id": "5000",
|
|
34499
|
-
"w:name": mark.type + ";" + attrsString
|
|
34500
|
-
}
|
|
34501
|
-
});
|
|
34502
|
-
textNodes.push({
|
|
34503
|
-
type: "element",
|
|
34504
|
-
name: "w:bookmarkEnd",
|
|
34505
|
-
attributes: {
|
|
34506
|
-
"w:id": "5000"
|
|
34507
|
-
}
|
|
34508
|
-
});
|
|
34509
|
-
}
|
|
34510
|
-
});
|
|
34511
|
-
}
|
|
34512
|
-
return {
|
|
34513
|
-
name: "w:r",
|
|
34514
|
-
elements: rPrNode ? [rPrNode, ...textNodes] : textNodes
|
|
34515
|
-
};
|
|
34516
|
-
}
|
|
34517
34682
|
function wrapTextInRun(nodeOrNodes, marks) {
|
|
34518
34683
|
let elements = [];
|
|
34519
34684
|
if (Array.isArray(nodeOrNodes)) elements = nodeOrNodes;
|
|
@@ -34542,60 +34707,6 @@ function processOutputMarks(marks = []) {
|
|
|
34542
34707
|
}
|
|
34543
34708
|
});
|
|
34544
34709
|
}
|
|
34545
|
-
function processLinkContentNode(node) {
|
|
34546
|
-
if (!node) return node;
|
|
34547
|
-
const contentNode = carbonCopy(node);
|
|
34548
|
-
if (!contentNode) return contentNode;
|
|
34549
|
-
const hyperlinkStyle = {
|
|
34550
|
-
name: "w:rStyle",
|
|
34551
|
-
attributes: { "w:val": "Hyperlink" }
|
|
34552
|
-
};
|
|
34553
|
-
const color = {
|
|
34554
|
-
name: "w:color",
|
|
34555
|
-
attributes: { "w:val": "467886" }
|
|
34556
|
-
};
|
|
34557
|
-
const underline = {
|
|
34558
|
-
name: "w:u",
|
|
34559
|
-
attributes: {
|
|
34560
|
-
"w:val": "none"
|
|
34561
|
-
}
|
|
34562
|
-
};
|
|
34563
|
-
if (contentNode.name === "w:r") {
|
|
34564
|
-
const runProps = contentNode.elements.find((el) => el.name === "w:rPr");
|
|
34565
|
-
if (runProps) {
|
|
34566
|
-
const foundColor = runProps.elements.find((el) => el.name === "w:color");
|
|
34567
|
-
const foundHyperlinkStyle = runProps.elements.find((el) => el.name === "w:rStyle");
|
|
34568
|
-
const underlineMark = runProps.elements.find((el) => el.name === "w:u");
|
|
34569
|
-
if (!foundColor) runProps.elements.unshift(color);
|
|
34570
|
-
if (!foundHyperlinkStyle) runProps.elements.unshift(hyperlinkStyle);
|
|
34571
|
-
if (!underlineMark) runProps.elements.unshift(underline);
|
|
34572
|
-
} else {
|
|
34573
|
-
const runProps2 = {
|
|
34574
|
-
name: "w:rPr",
|
|
34575
|
-
elements: [hyperlinkStyle, color]
|
|
34576
|
-
};
|
|
34577
|
-
contentNode.elements.unshift(runProps2);
|
|
34578
|
-
}
|
|
34579
|
-
}
|
|
34580
|
-
return contentNode;
|
|
34581
|
-
}
|
|
34582
|
-
function addNewLinkRelationship(params2, link) {
|
|
34583
|
-
const newId = "rId" + generateDocxRandomId();
|
|
34584
|
-
if (!params2.relationships || !Array.isArray(params2.relationships)) {
|
|
34585
|
-
params2.relationships = [];
|
|
34586
|
-
}
|
|
34587
|
-
params2.relationships.push({
|
|
34588
|
-
type: "element",
|
|
34589
|
-
name: "Relationship",
|
|
34590
|
-
attributes: {
|
|
34591
|
-
Id: newId,
|
|
34592
|
-
Type: "http://schemas.openxmlformats.org/officeDocument/2006/relationships/hyperlink",
|
|
34593
|
-
Target: link,
|
|
34594
|
-
TargetMode: "External"
|
|
34595
|
-
}
|
|
34596
|
-
});
|
|
34597
|
-
return newId;
|
|
34598
|
-
}
|
|
34599
34710
|
function translateMark(mark) {
|
|
34600
34711
|
const xmlMark = SuperConverter.markTypes.find((m2) => m2.type === mark.type);
|
|
34601
34712
|
if (!xmlMark) {
|
|
@@ -34622,7 +34733,7 @@ function translateMark(mark) {
|
|
|
34622
34733
|
markElement.type = "element";
|
|
34623
34734
|
break;
|
|
34624
34735
|
case "underline": {
|
|
34625
|
-
const translated = translator$
|
|
34736
|
+
const translated = translator$1Z.decode({
|
|
34626
34737
|
node: {
|
|
34627
34738
|
attrs: {
|
|
34628
34739
|
underlineType: attrs.underlineType ?? attrs.underline ?? null,
|
|
@@ -34686,7 +34797,7 @@ function translateMark(mark) {
|
|
|
34686
34797
|
break;
|
|
34687
34798
|
case "highlight": {
|
|
34688
34799
|
const highlightValue = attrs.color ?? attrs.highlight ?? null;
|
|
34689
|
-
const translated = translator$
|
|
34800
|
+
const translated = translator$22.decode({ node: { attrs: { highlight: highlightValue } } });
|
|
34690
34801
|
return translated || {};
|
|
34691
34802
|
}
|
|
34692
34803
|
case "strike":
|
|
@@ -34768,82 +34879,6 @@ generateXml_fn = function(node) {
|
|
|
34768
34879
|
if (!selfClosing) tags.push(`</${name}>`);
|
|
34769
34880
|
return tags;
|
|
34770
34881
|
};
|
|
34771
|
-
const translatePageNumberNode = (params2) => {
|
|
34772
|
-
const outputMarks = processOutputMarks(params2.node.attrs?.marksAsAttrs || []);
|
|
34773
|
-
return getAutoPageJson("PAGE", outputMarks);
|
|
34774
|
-
};
|
|
34775
|
-
const translateTotalPageNumberNode = (params2) => {
|
|
34776
|
-
const outputMarks = processOutputMarks(params2.node.attrs?.marksAsAttrs || []);
|
|
34777
|
-
return getAutoPageJson("NUMPAGES", outputMarks);
|
|
34778
|
-
};
|
|
34779
|
-
const getAutoPageJson = (type2, outputMarks = []) => {
|
|
34780
|
-
return [
|
|
34781
|
-
{
|
|
34782
|
-
name: "w:r",
|
|
34783
|
-
elements: [
|
|
34784
|
-
{
|
|
34785
|
-
name: "w:rPr",
|
|
34786
|
-
elements: outputMarks
|
|
34787
|
-
},
|
|
34788
|
-
{
|
|
34789
|
-
name: "w:fldChar",
|
|
34790
|
-
attributes: {
|
|
34791
|
-
"w:fldCharType": "begin"
|
|
34792
|
-
}
|
|
34793
|
-
}
|
|
34794
|
-
]
|
|
34795
|
-
},
|
|
34796
|
-
{
|
|
34797
|
-
name: "w:r",
|
|
34798
|
-
elements: [
|
|
34799
|
-
{
|
|
34800
|
-
name: "w:rPr",
|
|
34801
|
-
elements: outputMarks
|
|
34802
|
-
},
|
|
34803
|
-
{
|
|
34804
|
-
name: "w:instrText",
|
|
34805
|
-
attributes: { "xml:space": "preserve" },
|
|
34806
|
-
elements: [
|
|
34807
|
-
{
|
|
34808
|
-
type: "text",
|
|
34809
|
-
text: ` ${type2}`
|
|
34810
|
-
}
|
|
34811
|
-
]
|
|
34812
|
-
}
|
|
34813
|
-
]
|
|
34814
|
-
},
|
|
34815
|
-
{
|
|
34816
|
-
name: "w:r",
|
|
34817
|
-
elements: [
|
|
34818
|
-
{
|
|
34819
|
-
name: "w:rPr",
|
|
34820
|
-
elements: outputMarks
|
|
34821
|
-
},
|
|
34822
|
-
{
|
|
34823
|
-
name: "w:fldChar",
|
|
34824
|
-
attributes: {
|
|
34825
|
-
"w:fldCharType": "separate"
|
|
34826
|
-
}
|
|
34827
|
-
}
|
|
34828
|
-
]
|
|
34829
|
-
},
|
|
34830
|
-
{
|
|
34831
|
-
name: "w:r",
|
|
34832
|
-
elements: [
|
|
34833
|
-
{
|
|
34834
|
-
name: "w:rPr",
|
|
34835
|
-
elements: outputMarks
|
|
34836
|
-
},
|
|
34837
|
-
{
|
|
34838
|
-
name: "w:fldChar",
|
|
34839
|
-
attributes: {
|
|
34840
|
-
"w:fldCharType": "end"
|
|
34841
|
-
}
|
|
34842
|
-
}
|
|
34843
|
-
]
|
|
34844
|
-
}
|
|
34845
|
-
];
|
|
34846
|
-
};
|
|
34847
34882
|
const prepareCommentParaIds = (comment) => {
|
|
34848
34883
|
const newComment = {
|
|
34849
34884
|
...comment,
|
|
@@ -34852,7 +34887,7 @@ const prepareCommentParaIds = (comment) => {
|
|
|
34852
34887
|
return newComment;
|
|
34853
34888
|
};
|
|
34854
34889
|
const getCommentDefinition = (comment, commentId, allComments, editor) => {
|
|
34855
|
-
const translatedText =
|
|
34890
|
+
const translatedText = translator$11.decode({ editor, node: comment.commentJSON });
|
|
34856
34891
|
const attributes = {
|
|
34857
34892
|
"w:id": String(commentId),
|
|
34858
34893
|
"w:author": comment.creatorName || comment.importedAuthor?.name,
|
|
@@ -35267,7 +35302,7 @@ const _SuperConverter = class _SuperConverter2 {
|
|
|
35267
35302
|
static getStoredSuperdocVersion(docx) {
|
|
35268
35303
|
return _SuperConverter2.getStoredCustomProperty(docx, "SuperdocVersion");
|
|
35269
35304
|
}
|
|
35270
|
-
static setStoredSuperdocVersion(docx = this.convertedXml, version2 = "0.31.0-next.
|
|
35305
|
+
static setStoredSuperdocVersion(docx = this.convertedXml, version2 = "0.31.0-next.5") {
|
|
35271
35306
|
return _SuperConverter2.setStoredCustomProperty(docx, "SuperdocVersion", version2, false);
|
|
35272
35307
|
}
|
|
35273
35308
|
/**
|
|
@@ -52527,7 +52562,7 @@ const _Editor = class _Editor2 extends EventEmitter$1 {
|
|
|
52527
52562
|
{ default: remarkStringify },
|
|
52528
52563
|
{ default: remarkGfm }
|
|
52529
52564
|
] = await Promise.all([
|
|
52530
|
-
Promise.resolve().then(() => require("./index-
|
|
52565
|
+
Promise.resolve().then(() => require("./index-B7dC-H-Q-DfBEU7rR.cjs")),
|
|
52531
52566
|
Promise.resolve().then(() => require("./index-DRCvimau-H4Ck3S9a.cjs")),
|
|
52532
52567
|
Promise.resolve().then(() => require("./index-C_x_N6Uh-Db3CUJMX.cjs")),
|
|
52533
52568
|
Promise.resolve().then(() => require("./index-D_sWOSiG-BtDZzJ6I.cjs")),
|
|
@@ -52728,7 +52763,7 @@ const _Editor = class _Editor2 extends EventEmitter$1 {
|
|
|
52728
52763
|
* Process collaboration migrations
|
|
52729
52764
|
*/
|
|
52730
52765
|
processCollaborationMigrations() {
|
|
52731
|
-
console.debug("[checkVersionMigrations] Current editor version", "0.31.0-next.
|
|
52766
|
+
console.debug("[checkVersionMigrations] Current editor version", "0.31.0-next.5");
|
|
52732
52767
|
if (!this.options.ydoc) return;
|
|
52733
52768
|
const metaMap = this.options.ydoc.getMap("meta");
|
|
52734
52769
|
let docVersion = metaMap.get("version");
|
|
@@ -91557,92 +91592,92 @@ const _sfc_main = {
|
|
|
91557
91592
|
};
|
|
91558
91593
|
const SuperInput = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-4d5cff52"]]);
|
|
91559
91594
|
const additionalHandlers = Object.freeze({
|
|
91560
|
-
"mc:AlternateContent": translator$
|
|
91561
|
-
"sd:pageReference": translator$
|
|
91562
|
-
"sd:tableOfContents": translator$
|
|
91563
|
-
"w:b": translator$
|
|
91564
|
-
"w:bCs": translator$
|
|
91565
|
-
"w:bidiVisual": translator$
|
|
91566
|
-
"w:bookmarkEnd": translator$
|
|
91567
|
-
"w:bookmarkStart": translator$
|
|
91568
|
-
"w:bottom": translator$
|
|
91569
|
-
"w:br": translator$
|
|
91570
|
-
"w:cantSplit": translator$
|
|
91571
|
-
"w:caps": translator$
|
|
91572
|
-
"w:cnfStyle": translator$
|
|
91573
|
-
"w:color": translator$
|
|
91574
|
-
"w:divId": translator$
|
|
91575
|
-
"w:drawing": translator$
|
|
91576
|
-
"w:end": translator$
|
|
91577
|
-
"w:gridAfter": translator$
|
|
91578
|
-
"w:gridBefore": translator$
|
|
91579
|
-
"w:gridCol": translator$
|
|
91580
|
-
"w:hidden": translator$
|
|
91581
|
-
"w:highlight": translator$
|
|
91582
|
-
"w:hyperlink": translator$
|
|
91583
|
-
"w:i": translator$
|
|
91584
|
-
"w:insideH": translator$
|
|
91585
|
-
"w:insideV": translator$
|
|
91586
|
-
"w:jc": translator$
|
|
91587
|
-
"w:left": translator$
|
|
91588
|
-
"w:p": translator
|
|
91589
|
-
"w:r": translator
|
|
91590
|
-
"w:rFonts": translator$
|
|
91591
|
-
"w:rPr": translator$
|
|
91592
|
-
"w:rStyle": translator$
|
|
91593
|
-
"w:right": translator$
|
|
91594
|
-
"w:sdt": translator$
|
|
91595
|
-
"w:shd": translator$
|
|
91596
|
-
"w:start": translator$
|
|
91597
|
-
"w:strike": translator$
|
|
91598
|
-
"w:sz": translator$
|
|
91599
|
-
"w:szCs": translator$
|
|
91600
|
-
"w:tab": translator$
|
|
91601
|
-
"w:tbl": translator$
|
|
91602
|
-
"w:tblBorders": translator$
|
|
91603
|
-
"w:tblCaption": translator$
|
|
91604
|
-
"w:tblCellMar": translator$
|
|
91605
|
-
"w:tblCellSpacing": translator$
|
|
91606
|
-
"w:tblDescription": translator$
|
|
91607
|
-
"w:tblGrid": translator$
|
|
91608
|
-
"w:tblHeader": translator$
|
|
91609
|
-
"w:tblInd": translator$
|
|
91610
|
-
"w:tblLayout": translator$
|
|
91611
|
-
"w:tblLook": translator$
|
|
91612
|
-
"w:tblOverlap": translator$
|
|
91613
|
-
"w:tblPr": translator$
|
|
91614
|
-
"w:tblStyle": translator$
|
|
91615
|
-
"w:tblStyleColBandSize": translator$
|
|
91616
|
-
"w:tblStyleRowBandSize": translator$
|
|
91617
|
-
"w:tblW": translator$
|
|
91618
|
-
"w:tblpPr": translator$
|
|
91619
|
-
"w:tc": translator$
|
|
91620
|
-
"w:top": translator$
|
|
91621
|
-
"w:tr": translator$
|
|
91622
|
-
"w:trHeight": translator$
|
|
91623
|
-
"w:trPr": translator$
|
|
91624
|
-
"w:u": translator$
|
|
91625
|
-
"w:wAfter": translator$
|
|
91626
|
-
"w:wBefore": translator$
|
|
91627
|
-
"wp:anchor": translator$
|
|
91628
|
-
"wp:inline": translator$
|
|
91595
|
+
"mc:AlternateContent": translator$1M,
|
|
91596
|
+
"sd:pageReference": translator$6,
|
|
91597
|
+
"sd:tableOfContents": translator$5,
|
|
91598
|
+
"w:b": translator$20,
|
|
91599
|
+
"w:bCs": translator$1$,
|
|
91600
|
+
"w:bidiVisual": translator$q,
|
|
91601
|
+
"w:bookmarkEnd": translator$7,
|
|
91602
|
+
"w:bookmarkStart": translator$8,
|
|
91603
|
+
"w:bottom": translator$1p,
|
|
91604
|
+
"w:br": translator$23,
|
|
91605
|
+
"w:cantSplit": translator$F,
|
|
91606
|
+
"w:caps": translator$1R,
|
|
91607
|
+
"w:cnfStyle": translator$1H,
|
|
91608
|
+
"w:color": translator$1W,
|
|
91609
|
+
"w:divId": translator$1F,
|
|
91610
|
+
"w:drawing": translator$s,
|
|
91611
|
+
"w:end": translator$X,
|
|
91612
|
+
"w:gridAfter": translator$E,
|
|
91613
|
+
"w:gridBefore": translator$D,
|
|
91614
|
+
"w:gridCol": translator$b,
|
|
91615
|
+
"w:hidden": translator$C,
|
|
91616
|
+
"w:highlight": translator$22,
|
|
91617
|
+
"w:hyperlink": translator$10,
|
|
91618
|
+
"w:i": translator$1_,
|
|
91619
|
+
"w:insideH": translator$V,
|
|
91620
|
+
"w:insideV": translator$U,
|
|
91621
|
+
"w:jc": translator$1C,
|
|
91622
|
+
"w:left": translator$1n,
|
|
91623
|
+
"w:p": translator$11,
|
|
91624
|
+
"w:r": translator$$,
|
|
91625
|
+
"w:rFonts": translator$1V,
|
|
91626
|
+
"w:rPr": translator$1N,
|
|
91627
|
+
"w:rStyle": translator$1U,
|
|
91628
|
+
"w:right": translator$1l,
|
|
91629
|
+
"w:sdt": translator$r,
|
|
91630
|
+
"w:shd": translator$1Q,
|
|
91631
|
+
"w:start": translator$T,
|
|
91632
|
+
"w:strike": translator$1Y,
|
|
91633
|
+
"w:sz": translator$1T,
|
|
91634
|
+
"w:szCs": translator$1S,
|
|
91635
|
+
"w:tab": translator$21,
|
|
91636
|
+
"w:tbl": translator$9,
|
|
91637
|
+
"w:tblBorders": translator$e,
|
|
91638
|
+
"w:tblCaption": translator$p,
|
|
91639
|
+
"w:tblCellMar": translator$d,
|
|
91640
|
+
"w:tblCellSpacing": translator$B,
|
|
91641
|
+
"w:tblDescription": translator$o,
|
|
91642
|
+
"w:tblGrid": translator$a,
|
|
91643
|
+
"w:tblHeader": translator$A,
|
|
91644
|
+
"w:tblInd": translator$n,
|
|
91645
|
+
"w:tblLayout": translator$m,
|
|
91646
|
+
"w:tblLook": translator$l,
|
|
91647
|
+
"w:tblOverlap": translator$k,
|
|
91648
|
+
"w:tblPr": translator$c,
|
|
91649
|
+
"w:tblStyle": translator$j,
|
|
91650
|
+
"w:tblStyleColBandSize": translator$i,
|
|
91651
|
+
"w:tblStyleRowBandSize": translator$h,
|
|
91652
|
+
"w:tblW": translator$g,
|
|
91653
|
+
"w:tblpPr": translator$f,
|
|
91654
|
+
"w:tc": translator$G,
|
|
91655
|
+
"w:top": translator$1j,
|
|
91656
|
+
"w:tr": translator$v,
|
|
91657
|
+
"w:trHeight": translator$z,
|
|
91658
|
+
"w:trPr": translator$w,
|
|
91659
|
+
"w:u": translator$1Z,
|
|
91660
|
+
"w:wAfter": translator$y,
|
|
91661
|
+
"w:wBefore": translator$x,
|
|
91662
|
+
"wp:anchor": translator$u,
|
|
91663
|
+
"wp:inline": translator$t,
|
|
91629
91664
|
"w:commentRangeStart": commentRangeStartTranslator,
|
|
91630
91665
|
"w:commentRangeEnd": commentRangeEndTranslator,
|
|
91631
|
-
"w:vMerge": translator$
|
|
91632
|
-
"w:gridSpan": translator$
|
|
91633
|
-
"w:vAlign": translator$
|
|
91634
|
-
"w:noWrap": translator$
|
|
91635
|
-
"w:tcFitText": translator$
|
|
91636
|
-
"w:tcW": translator$
|
|
91637
|
-
"w:hideMark": translator$
|
|
91638
|
-
"w:textDirection": translator$
|
|
91639
|
-
"w:tl2br": translator$
|
|
91640
|
-
"w:tr2bl": translator$
|
|
91641
|
-
"w:header": translator$
|
|
91642
|
-
"w:headers": translator$
|
|
91643
|
-
"w:tcBorders": translator$
|
|
91644
|
-
"w:tcMar": translator$
|
|
91645
|
-
"w:tcPr": translator$
|
|
91666
|
+
"w:vMerge": translator$Y,
|
|
91667
|
+
"w:gridSpan": translator$Z,
|
|
91668
|
+
"w:vAlign": translator$L,
|
|
91669
|
+
"w:noWrap": translator$O,
|
|
91670
|
+
"w:tcFitText": translator$M,
|
|
91671
|
+
"w:tcW": translator$_,
|
|
91672
|
+
"w:hideMark": translator$K,
|
|
91673
|
+
"w:textDirection": translator$17,
|
|
91674
|
+
"w:tl2br": translator$R,
|
|
91675
|
+
"w:tr2bl": translator$Q,
|
|
91676
|
+
"w:header": translator$J,
|
|
91677
|
+
"w:headers": translator$I,
|
|
91678
|
+
"w:tcBorders": translator$P,
|
|
91679
|
+
"w:tcMar": translator$N,
|
|
91680
|
+
"w:tcPr": translator$H
|
|
91646
91681
|
});
|
|
91647
91682
|
const baseHandlers = {
|
|
91648
91683
|
...additionalHandlers
|