@harbour-enterprises/superdoc 0.21.0 → 0.22.0-next.2
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-OZDJ7gwT.cjs → PdfViewer-Ck3Syakz.cjs} +1 -1
- package/dist/chunks/{PdfViewer-D3zo7tPo.es.js → PdfViewer-OEs-MC5j.es.js} +1 -1
- package/dist/chunks/{index-MzW5BVNd.es.js → index-B4aklZ4_.es.js} +5 -4
- package/dist/chunks/{index-CfYf4T_z.cjs → index-BM732Zfw.cjs} +5 -4
- package/dist/chunks/{super-editor.es-Bntob7Wd.es.js → super-editor.es-Bokezk1E.es.js} +1179 -766
- package/dist/chunks/{super-editor.es-U-GVCd_F.cjs → super-editor.es-DwGNbrZq.cjs} +1179 -766
- package/dist/core/types/index.d.ts +8 -0
- package/dist/core/types/index.d.ts.map +1 -1
- package/dist/style.css +32 -27
- package/dist/super-editor/ai-writer.es.js +2 -2
- package/dist/super-editor/chunks/{converter-3xnF_NHq.js → converter-BcqEfCTg.js} +775 -645
- package/dist/super-editor/chunks/{docx-zipper-CZdELYi-.js → docx-zipper-DZ9ph0iQ.js} +1 -1
- package/dist/super-editor/chunks/{editor-BqYH4kDD.js → editor-CTHD3ziL.js} +26 -3
- package/dist/super-editor/chunks/{toolbar-TkaE2kKM.js → toolbar-DLQeMuoQ.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/src/components/slash-menu/menuItems.d.ts +5 -1
- package/dist/super-editor/src/components/slash-menu/tests/testHelpers.d.ts +466 -0
- package/dist/super-editor/src/components/slash-menu/utils.d.ts +9 -2
- package/dist/super-editor/src/core/commands/__tests__/schemaWithLists.d.ts +2 -0
- package/dist/super-editor/src/core/commands/__tests__/testHelpers.d.ts +4 -0
- package/dist/super-editor/src/core/commands/__tests__/testSchema.d.ts +2 -0
- package/dist/super-editor/src/core/commands/tests/commandTestUtils.d.ts +7 -0
- package/dist/super-editor/src/core/commands/tests/test-schema.d.ts +2 -0
- package/dist/super-editor/src/core/super-converter/v3/handlers/mc/altermateContent/alternate-content-translator.d.ts +6 -0
- package/dist/super-editor/src/core/super-converter/v3/handlers/mc/altermateContent/index.d.ts +1 -0
- package/dist/super-editor/src/tests/helpers/helpers.d.ts +1 -0
- package/dist/super-editor/src/utils/contextmenu-helpers.d.ts +24 -0
- package/dist/super-editor/style.css +5 -0
- package/dist/super-editor/super-editor.es.js +453 -153
- 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 +1182 -768
- package/dist/superdoc.umd.js.map +1 -1
- package/package.json +1 -1
- package/dist/super-editor/src/extensions/run-item/index.d.ts +0 -1
- package/dist/super-editor/src/extensions/run-item/run-item.d.ts +0 -26
|
@@ -24333,37 +24333,37 @@ const _NodeTranslator = class _NodeTranslator2 {
|
|
|
24333
24333
|
};
|
|
24334
24334
|
__publicField$2(_NodeTranslator, "translatorTypes", TranslatorTypes);
|
|
24335
24335
|
let NodeTranslator = _NodeTranslator;
|
|
24336
|
-
const encode$
|
|
24336
|
+
const encode$18 = (attributes) => {
|
|
24337
24337
|
return attributes["w:type"];
|
|
24338
24338
|
};
|
|
24339
|
-
const decode
|
|
24339
|
+
const decode$$ = (attrs) => {
|
|
24340
24340
|
const { lineBreakType } = attrs;
|
|
24341
24341
|
return lineBreakType;
|
|
24342
24342
|
};
|
|
24343
24343
|
const attrConfig$F = Object.freeze({
|
|
24344
24344
|
xmlName: "w:type",
|
|
24345
24345
|
sdName: "lineBreakType",
|
|
24346
|
-
encode: encode$
|
|
24347
|
-
decode: decode
|
|
24346
|
+
encode: encode$18,
|
|
24347
|
+
decode: decode$$
|
|
24348
24348
|
});
|
|
24349
|
-
const encode$
|
|
24349
|
+
const encode$17 = (attributes) => {
|
|
24350
24350
|
const xmlAttrValue = attributes["w:clear"];
|
|
24351
24351
|
return xmlAttrValue;
|
|
24352
24352
|
};
|
|
24353
|
-
const decode$
|
|
24353
|
+
const decode$_ = (attrs) => {
|
|
24354
24354
|
const { clear } = attrs;
|
|
24355
24355
|
return clear;
|
|
24356
24356
|
};
|
|
24357
24357
|
const attrConfig$E = Object.freeze({
|
|
24358
24358
|
xmlName: "w:clear",
|
|
24359
24359
|
sdName: "clear",
|
|
24360
|
-
encode: encode$
|
|
24361
|
-
decode: decode$
|
|
24360
|
+
encode: encode$17,
|
|
24361
|
+
decode: decode$_
|
|
24362
24362
|
});
|
|
24363
|
-
const validXmlAttributes$
|
|
24364
|
-
const XML_NODE_NAME$
|
|
24365
|
-
const SD_NODE_NAME$
|
|
24366
|
-
const encode$
|
|
24363
|
+
const validXmlAttributes$m = [attrConfig$F, attrConfig$E];
|
|
24364
|
+
const XML_NODE_NAME$u = "w:br";
|
|
24365
|
+
const SD_NODE_NAME$d = "lineBreak";
|
|
24366
|
+
const encode$16 = (_2, encodedAttrs) => {
|
|
24367
24367
|
const isPageBreak = encodedAttrs?.lineBreakType === "page";
|
|
24368
24368
|
const translated = {
|
|
24369
24369
|
type: isPageBreak ? "hardBreak" : "lineBreak"
|
|
@@ -24373,7 +24373,7 @@ const encode$15 = (_2, encodedAttrs) => {
|
|
|
24373
24373
|
}
|
|
24374
24374
|
return translated;
|
|
24375
24375
|
};
|
|
24376
|
-
const decode$
|
|
24376
|
+
const decode$Z = (params2, decodedAttrs) => {
|
|
24377
24377
|
const { node } = params2;
|
|
24378
24378
|
if (!node) return;
|
|
24379
24379
|
const wBreak = { name: "w:br" };
|
|
@@ -24390,39 +24390,39 @@ const decode$Y = (params2, decodedAttrs) => {
|
|
|
24390
24390
|
};
|
|
24391
24391
|
return translated;
|
|
24392
24392
|
};
|
|
24393
|
-
const config$
|
|
24394
|
-
xmlName: XML_NODE_NAME$
|
|
24395
|
-
sdNodeOrKeyName: SD_NODE_NAME$
|
|
24393
|
+
const config$s = {
|
|
24394
|
+
xmlName: XML_NODE_NAME$u,
|
|
24395
|
+
sdNodeOrKeyName: SD_NODE_NAME$d,
|
|
24396
24396
|
type: NodeTranslator.translatorTypes.NODE,
|
|
24397
|
-
encode: encode$
|
|
24398
|
-
decode: decode$
|
|
24399
|
-
attributes: validXmlAttributes$
|
|
24397
|
+
encode: encode$16,
|
|
24398
|
+
decode: decode$Z,
|
|
24399
|
+
attributes: validXmlAttributes$m
|
|
24400
24400
|
};
|
|
24401
|
-
const translator$
|
|
24402
|
-
const encode$
|
|
24403
|
-
const decode$
|
|
24401
|
+
const translator$16 = NodeTranslator.from(config$s);
|
|
24402
|
+
const encode$15 = (attributes) => attributes?.["w:val"];
|
|
24403
|
+
const decode$Y = (attrs) => attrs?.highlight;
|
|
24404
24404
|
const attrConfig$D = Object.freeze({
|
|
24405
24405
|
xmlName: "w:val",
|
|
24406
24406
|
sdName: "highlight",
|
|
24407
|
-
encode: encode$
|
|
24408
|
-
decode: decode$
|
|
24407
|
+
encode: encode$15,
|
|
24408
|
+
decode: decode$Y
|
|
24409
24409
|
});
|
|
24410
|
-
const validXmlAttributes$
|
|
24411
|
-
const XML_NODE_NAME$
|
|
24410
|
+
const validXmlAttributes$l = [attrConfig$D];
|
|
24411
|
+
const XML_NODE_NAME$t = "w:highlight";
|
|
24412
24412
|
const SD_ATTR_KEY$f = "highlight";
|
|
24413
24413
|
const DISABLED_TOKENS = /* @__PURE__ */ new Set(["transparent", "none", "inherit"]);
|
|
24414
|
-
const encode$
|
|
24414
|
+
const encode$14 = (params2, encodedAttrs = {}) => {
|
|
24415
24415
|
const { nodes } = params2;
|
|
24416
24416
|
const node = nodes?.[0];
|
|
24417
24417
|
const value = encodedAttrs.highlight ?? node?.attributes?.["w:val"];
|
|
24418
24418
|
return {
|
|
24419
24419
|
type: "attr",
|
|
24420
|
-
xmlName: XML_NODE_NAME$
|
|
24420
|
+
xmlName: XML_NODE_NAME$t,
|
|
24421
24421
|
sdNodeOrKeyName: SD_ATTR_KEY$f,
|
|
24422
24422
|
attributes: { "w:val": value ?? null }
|
|
24423
24423
|
};
|
|
24424
24424
|
};
|
|
24425
|
-
const decode$
|
|
24425
|
+
const decode$X = (params2) => {
|
|
24426
24426
|
const attrs = params2?.node?.attrs || {};
|
|
24427
24427
|
const highlightValue = attrs.highlight ?? attrs.color ?? null;
|
|
24428
24428
|
if (!highlightValue) return void 0;
|
|
@@ -24430,14 +24430,14 @@ const decode$W = (params2) => {
|
|
|
24430
24430
|
if (!normalizedValue) return void 0;
|
|
24431
24431
|
if (DISABLED_TOKENS.has(normalizedValue)) {
|
|
24432
24432
|
return {
|
|
24433
|
-
name: XML_NODE_NAME$
|
|
24433
|
+
name: XML_NODE_NAME$t,
|
|
24434
24434
|
attributes: { "w:val": "none" }
|
|
24435
24435
|
};
|
|
24436
24436
|
}
|
|
24437
24437
|
const keyword = getDocxHighlightKeywordFromHex(highlightValue);
|
|
24438
24438
|
if (keyword) {
|
|
24439
24439
|
return {
|
|
24440
|
-
name: XML_NODE_NAME$
|
|
24440
|
+
name: XML_NODE_NAME$t,
|
|
24441
24441
|
attributes: { "w:val": keyword }
|
|
24442
24442
|
};
|
|
24443
24443
|
}
|
|
@@ -24452,63 +24452,63 @@ const decode$W = (params2) => {
|
|
|
24452
24452
|
}
|
|
24453
24453
|
};
|
|
24454
24454
|
};
|
|
24455
|
-
const config$
|
|
24456
|
-
xmlName: XML_NODE_NAME$
|
|
24455
|
+
const config$r = {
|
|
24456
|
+
xmlName: XML_NODE_NAME$t,
|
|
24457
24457
|
sdNodeOrKeyName: SD_ATTR_KEY$f,
|
|
24458
24458
|
type: NodeTranslator.translatorTypes.ATTRIBUTE,
|
|
24459
|
-
encode: encode$
|
|
24460
|
-
decode: decode$
|
|
24461
|
-
attributes: validXmlAttributes$
|
|
24459
|
+
encode: encode$14,
|
|
24460
|
+
decode: decode$X,
|
|
24461
|
+
attributes: validXmlAttributes$l
|
|
24462
24462
|
};
|
|
24463
|
-
const translator$
|
|
24464
|
-
const encode$
|
|
24463
|
+
const translator$15 = NodeTranslator.from(config$r);
|
|
24464
|
+
const encode$13 = (attributes) => {
|
|
24465
24465
|
return attributes["w:val"];
|
|
24466
24466
|
};
|
|
24467
|
-
const decode$
|
|
24467
|
+
const decode$W = (attrs) => {
|
|
24468
24468
|
const { tabSize } = attrs || {};
|
|
24469
24469
|
return tabSize;
|
|
24470
24470
|
};
|
|
24471
24471
|
const attrConfig$C = Object.freeze({
|
|
24472
24472
|
xmlName: "w:val",
|
|
24473
24473
|
sdName: "tabSize",
|
|
24474
|
-
encode: encode$
|
|
24475
|
-
decode: decode$
|
|
24474
|
+
encode: encode$13,
|
|
24475
|
+
decode: decode$W
|
|
24476
24476
|
});
|
|
24477
|
-
const encode$
|
|
24477
|
+
const encode$12 = (attributes) => {
|
|
24478
24478
|
return attributes["w:leader"];
|
|
24479
24479
|
};
|
|
24480
|
-
const decode$
|
|
24480
|
+
const decode$V = (attrs) => {
|
|
24481
24481
|
const { leader } = attrs || {};
|
|
24482
24482
|
return leader;
|
|
24483
24483
|
};
|
|
24484
24484
|
const attrConfig$B = Object.freeze({
|
|
24485
24485
|
xmlName: "w:leader",
|
|
24486
24486
|
sdName: "leader",
|
|
24487
|
-
encode: encode$
|
|
24488
|
-
decode: decode$
|
|
24487
|
+
encode: encode$12,
|
|
24488
|
+
decode: decode$V
|
|
24489
24489
|
});
|
|
24490
|
-
const encode$
|
|
24490
|
+
const encode$11 = (attributes) => {
|
|
24491
24491
|
return attributes["w:pos"];
|
|
24492
24492
|
};
|
|
24493
|
-
const decode$
|
|
24493
|
+
const decode$U = (attrs) => {
|
|
24494
24494
|
const { pos } = attrs || {};
|
|
24495
24495
|
return pos;
|
|
24496
24496
|
};
|
|
24497
24497
|
const attrConfig$A = Object.freeze({
|
|
24498
24498
|
xmlName: "w:pos",
|
|
24499
24499
|
sdName: "pos",
|
|
24500
|
-
encode: encode$
|
|
24501
|
-
decode: decode$
|
|
24500
|
+
encode: encode$11,
|
|
24501
|
+
decode: decode$U
|
|
24502
24502
|
});
|
|
24503
|
-
const validXmlAttributes$
|
|
24504
|
-
const XML_NODE_NAME$
|
|
24505
|
-
const SD_NODE_NAME$
|
|
24506
|
-
const encode
|
|
24503
|
+
const validXmlAttributes$k = [attrConfig$C, attrConfig$A, attrConfig$B];
|
|
24504
|
+
const XML_NODE_NAME$s = "w:tab";
|
|
24505
|
+
const SD_NODE_NAME$c = "tab";
|
|
24506
|
+
const encode$10 = (_2, encodedAttrs = {}) => {
|
|
24507
24507
|
const translated = { type: "tab" };
|
|
24508
24508
|
if (encodedAttrs) translated.attrs = { ...encodedAttrs };
|
|
24509
24509
|
return translated;
|
|
24510
24510
|
};
|
|
24511
|
-
const decode$
|
|
24511
|
+
const decode$T = (params2, decodedAttrs = {}) => {
|
|
24512
24512
|
const { node } = params2 || {};
|
|
24513
24513
|
if (!node) return;
|
|
24514
24514
|
const wTab = { name: "w:tab" };
|
|
@@ -24524,15 +24524,15 @@ const decode$S = (params2, decodedAttrs = {}) => {
|
|
|
24524
24524
|
}
|
|
24525
24525
|
return translated;
|
|
24526
24526
|
};
|
|
24527
|
-
const config$
|
|
24528
|
-
xmlName: XML_NODE_NAME$
|
|
24529
|
-
sdNodeOrKeyName: SD_NODE_NAME$
|
|
24527
|
+
const config$q = {
|
|
24528
|
+
xmlName: XML_NODE_NAME$s,
|
|
24529
|
+
sdNodeOrKeyName: SD_NODE_NAME$c,
|
|
24530
24530
|
type: NodeTranslator.translatorTypes.NODE,
|
|
24531
|
-
encode: encode
|
|
24532
|
-
decode: decode$
|
|
24533
|
-
attributes: validXmlAttributes$
|
|
24531
|
+
encode: encode$10,
|
|
24532
|
+
decode: decode$T,
|
|
24533
|
+
attributes: validXmlAttributes$k
|
|
24534
24534
|
};
|
|
24535
|
-
const translator$
|
|
24535
|
+
const translator$14 = NodeTranslator.from(config$q);
|
|
24536
24536
|
const mergeTextNodes = (nodes) => {
|
|
24537
24537
|
if (!nodes || !Array.isArray(nodes)) {
|
|
24538
24538
|
return nodes;
|
|
@@ -25147,91 +25147,91 @@ const handleParagraphNode$1 = (params2) => {
|
|
|
25147
25147
|
}
|
|
25148
25148
|
return schemaNode;
|
|
25149
25149
|
};
|
|
25150
|
-
const encode
|
|
25150
|
+
const encode$$ = (attributes) => {
|
|
25151
25151
|
return attributes["w:rsidDel"];
|
|
25152
25152
|
};
|
|
25153
|
-
const decode$
|
|
25153
|
+
const decode$S = (attrs) => {
|
|
25154
25154
|
return attrs.rsidDel;
|
|
25155
25155
|
};
|
|
25156
25156
|
const attrConfig$z = Object.freeze({
|
|
25157
25157
|
xmlName: "w:rsidDel",
|
|
25158
25158
|
sdName: "rsidDel",
|
|
25159
|
-
encode: encode
|
|
25160
|
-
decode: decode$
|
|
25159
|
+
encode: encode$$,
|
|
25160
|
+
decode: decode$S
|
|
25161
25161
|
});
|
|
25162
|
-
const encode$
|
|
25162
|
+
const encode$_ = (attributes) => {
|
|
25163
25163
|
return attributes["w:rsidP"];
|
|
25164
25164
|
};
|
|
25165
|
-
const decode$
|
|
25165
|
+
const decode$R = (attrs) => {
|
|
25166
25166
|
return attrs.rsidP;
|
|
25167
25167
|
};
|
|
25168
25168
|
const attrConfig$y = Object.freeze({
|
|
25169
25169
|
xmlName: "w:rsidP",
|
|
25170
25170
|
sdName: "rsidP",
|
|
25171
|
-
encode: encode$
|
|
25172
|
-
decode: decode$
|
|
25171
|
+
encode: encode$_,
|
|
25172
|
+
decode: decode$R
|
|
25173
25173
|
});
|
|
25174
|
-
const encode$
|
|
25174
|
+
const encode$Z = (attributes) => {
|
|
25175
25175
|
return attributes["w:rsidR"];
|
|
25176
25176
|
};
|
|
25177
|
-
const decode$
|
|
25177
|
+
const decode$Q = (attrs) => {
|
|
25178
25178
|
return attrs.rsidR;
|
|
25179
25179
|
};
|
|
25180
25180
|
const attrConfig$x = Object.freeze({
|
|
25181
25181
|
xmlName: "w:rsidR",
|
|
25182
25182
|
sdName: "rsidR",
|
|
25183
|
-
encode: encode$
|
|
25184
|
-
decode: decode$
|
|
25183
|
+
encode: encode$Z,
|
|
25184
|
+
decode: decode$Q
|
|
25185
25185
|
});
|
|
25186
|
-
const encode$
|
|
25186
|
+
const encode$Y = (attributes) => {
|
|
25187
25187
|
return attributes["w:rsidRPr"];
|
|
25188
25188
|
};
|
|
25189
|
-
const decode$
|
|
25189
|
+
const decode$P = (attrs) => {
|
|
25190
25190
|
return attrs.rsidRPr;
|
|
25191
25191
|
};
|
|
25192
25192
|
const attrConfig$w = Object.freeze({
|
|
25193
25193
|
xmlName: "w:rsidRPr",
|
|
25194
25194
|
sdName: "rsidRPr",
|
|
25195
|
-
encode: encode$
|
|
25196
|
-
decode: decode$
|
|
25195
|
+
encode: encode$Y,
|
|
25196
|
+
decode: decode$P
|
|
25197
25197
|
});
|
|
25198
|
-
const encode$
|
|
25198
|
+
const encode$X = (attributes) => {
|
|
25199
25199
|
return attributes["w:rsidRDefault"];
|
|
25200
25200
|
};
|
|
25201
|
-
const decode$
|
|
25201
|
+
const decode$O = (attrs) => {
|
|
25202
25202
|
return attrs.rsidRDefault;
|
|
25203
25203
|
};
|
|
25204
25204
|
const attrConfig$v = Object.freeze({
|
|
25205
25205
|
xmlName: "w:rsidRDefault",
|
|
25206
25206
|
sdName: "rsidRDefault",
|
|
25207
|
-
encode: encode$
|
|
25208
|
-
decode: decode$
|
|
25207
|
+
encode: encode$X,
|
|
25208
|
+
decode: decode$O
|
|
25209
25209
|
});
|
|
25210
|
-
const encode$
|
|
25210
|
+
const encode$W = (attributes) => {
|
|
25211
25211
|
return attributes["w14:paraId"];
|
|
25212
25212
|
};
|
|
25213
|
-
const decode$
|
|
25213
|
+
const decode$N = (attrs) => {
|
|
25214
25214
|
return attrs.paraId;
|
|
25215
25215
|
};
|
|
25216
25216
|
const attrConfig$u = Object.freeze({
|
|
25217
25217
|
xmlName: "w14:paraId",
|
|
25218
25218
|
sdName: "paraId",
|
|
25219
|
-
encode: encode$
|
|
25220
|
-
decode: decode$
|
|
25219
|
+
encode: encode$W,
|
|
25220
|
+
decode: decode$N
|
|
25221
25221
|
});
|
|
25222
|
-
const encode$
|
|
25222
|
+
const encode$V = (attributes) => {
|
|
25223
25223
|
return attributes["w14:textId"];
|
|
25224
25224
|
};
|
|
25225
|
-
const decode$
|
|
25225
|
+
const decode$M = (attrs) => {
|
|
25226
25226
|
return attrs.textId;
|
|
25227
25227
|
};
|
|
25228
25228
|
const attrConfig$t = Object.freeze({
|
|
25229
25229
|
xmlName: "w14:textId",
|
|
25230
25230
|
sdName: "textId",
|
|
25231
|
-
encode: encode$
|
|
25232
|
-
decode: decode$
|
|
25231
|
+
encode: encode$V,
|
|
25232
|
+
decode: decode$M
|
|
25233
25233
|
});
|
|
25234
|
-
const validXmlAttributes$
|
|
25234
|
+
const validXmlAttributes$j = [
|
|
25235
25235
|
attrConfig$u,
|
|
25236
25236
|
attrConfig$t,
|
|
25237
25237
|
attrConfig$x,
|
|
@@ -25240,9 +25240,9 @@ const validXmlAttributes$i = [
|
|
|
25240
25240
|
attrConfig$w,
|
|
25241
25241
|
attrConfig$z
|
|
25242
25242
|
];
|
|
25243
|
-
const XML_NODE_NAME$
|
|
25244
|
-
const SD_NODE_NAME$
|
|
25245
|
-
const encode$
|
|
25243
|
+
const XML_NODE_NAME$r = "w:p";
|
|
25244
|
+
const SD_NODE_NAME$b = "paragraph";
|
|
25245
|
+
const encode$U = (params2, encodedAttrs = {}) => {
|
|
25246
25246
|
const node = handleParagraphNode$1(params2);
|
|
25247
25247
|
if (!node) return void 0;
|
|
25248
25248
|
if (encodedAttrs && Object.keys(encodedAttrs).length) {
|
|
@@ -25250,7 +25250,7 @@ const encode$T = (params2, encodedAttrs = {}) => {
|
|
|
25250
25250
|
}
|
|
25251
25251
|
return node;
|
|
25252
25252
|
};
|
|
25253
|
-
const decode$
|
|
25253
|
+
const decode$L = (params2, decodedAttrs = {}) => {
|
|
25254
25254
|
const translated = translateParagraphNode(params2);
|
|
25255
25255
|
if (!translated) return void 0;
|
|
25256
25256
|
if (decodedAttrs && Object.keys(decodedAttrs).length) {
|
|
@@ -25258,16 +25258,16 @@ const decode$K = (params2, decodedAttrs = {}) => {
|
|
|
25258
25258
|
}
|
|
25259
25259
|
return translated;
|
|
25260
25260
|
};
|
|
25261
|
-
const config$
|
|
25262
|
-
xmlName: XML_NODE_NAME$
|
|
25263
|
-
sdNodeOrKeyName: SD_NODE_NAME$
|
|
25261
|
+
const config$p = {
|
|
25262
|
+
xmlName: XML_NODE_NAME$r,
|
|
25263
|
+
sdNodeOrKeyName: SD_NODE_NAME$b,
|
|
25264
25264
|
type: NodeTranslator.translatorTypes.NODE,
|
|
25265
|
-
encode: encode$
|
|
25266
|
-
decode: decode$
|
|
25267
|
-
attributes: validXmlAttributes$
|
|
25265
|
+
encode: encode$U,
|
|
25266
|
+
decode: decode$L,
|
|
25267
|
+
attributes: validXmlAttributes$j
|
|
25268
25268
|
};
|
|
25269
|
-
const translator$
|
|
25270
|
-
const encode$
|
|
25269
|
+
const translator$13 = NodeTranslator.from(config$p);
|
|
25270
|
+
const encode$T = (attributes) => {
|
|
25271
25271
|
const raw = attributes?.["w:val"];
|
|
25272
25272
|
if (raw === void 0 || raw === null) return void 0;
|
|
25273
25273
|
if (typeof raw === "boolean") return raw;
|
|
@@ -25277,20 +25277,20 @@ const encode$S = (attributes) => {
|
|
|
25277
25277
|
if (val === "1" || val === "true" || val === "on") return true;
|
|
25278
25278
|
return void 0;
|
|
25279
25279
|
};
|
|
25280
|
-
const decode$
|
|
25280
|
+
const decode$K = (runProps) => {
|
|
25281
25281
|
if (runProps?.bold === false) return "0";
|
|
25282
25282
|
return void 0;
|
|
25283
25283
|
};
|
|
25284
25284
|
const attrConfig$s = Object.freeze({
|
|
25285
25285
|
xmlName: "w:val",
|
|
25286
25286
|
sdName: "bold",
|
|
25287
|
-
encode: encode$
|
|
25288
|
-
decode: decode$
|
|
25287
|
+
encode: encode$T,
|
|
25288
|
+
decode: decode$K
|
|
25289
25289
|
});
|
|
25290
|
-
const validXmlAttributes$
|
|
25291
|
-
const XML_NODE_NAME$
|
|
25290
|
+
const validXmlAttributes$i = [attrConfig$s];
|
|
25291
|
+
const XML_NODE_NAME$q = "w:b";
|
|
25292
25292
|
const SD_ATTR_KEY$e = "bold";
|
|
25293
|
-
const encode$
|
|
25293
|
+
const encode$S = (params2, encodedAttrs = {}) => {
|
|
25294
25294
|
const { nodes } = params2;
|
|
25295
25295
|
const node = nodes[0];
|
|
25296
25296
|
if (!node) return void 0;
|
|
@@ -25302,85 +25302,85 @@ const encode$R = (params2, encodedAttrs = {}) => {
|
|
|
25302
25302
|
else attributes = node.attributes || {};
|
|
25303
25303
|
return {
|
|
25304
25304
|
type: "attr",
|
|
25305
|
-
xmlName: XML_NODE_NAME$
|
|
25305
|
+
xmlName: XML_NODE_NAME$q,
|
|
25306
25306
|
sdNodeOrKeyName: SD_ATTR_KEY$e,
|
|
25307
25307
|
attributes
|
|
25308
25308
|
};
|
|
25309
25309
|
};
|
|
25310
|
-
const config$
|
|
25311
|
-
xmlName: XML_NODE_NAME$
|
|
25310
|
+
const config$o = {
|
|
25311
|
+
xmlName: XML_NODE_NAME$q,
|
|
25312
25312
|
sdNodeOrKeyName: SD_ATTR_KEY$e,
|
|
25313
25313
|
type: NodeTranslator.translatorTypes.ATTRIBUTE,
|
|
25314
|
-
encode: encode$
|
|
25315
|
-
attributes: validXmlAttributes$
|
|
25314
|
+
encode: encode$S,
|
|
25315
|
+
attributes: validXmlAttributes$i
|
|
25316
25316
|
};
|
|
25317
|
-
const translator$
|
|
25318
|
-
const XML_NODE_NAME$
|
|
25317
|
+
const translator$12 = NodeTranslator.from(config$o);
|
|
25318
|
+
const XML_NODE_NAME$p = "w:i";
|
|
25319
25319
|
const SD_ATTR_KEY$d = "italic";
|
|
25320
|
-
const encode$
|
|
25320
|
+
const encode$R = (params2) => {
|
|
25321
25321
|
const { nodes } = params2;
|
|
25322
25322
|
const node = nodes?.[0];
|
|
25323
25323
|
if (!node) return void 0;
|
|
25324
25324
|
return {
|
|
25325
25325
|
type: "attr",
|
|
25326
|
-
xmlName: XML_NODE_NAME$
|
|
25326
|
+
xmlName: XML_NODE_NAME$p,
|
|
25327
25327
|
sdNodeOrKeyName: SD_ATTR_KEY$d,
|
|
25328
25328
|
attributes: {
|
|
25329
25329
|
"w:val": node.attributes?.["w:val"] ?? null
|
|
25330
25330
|
}
|
|
25331
25331
|
};
|
|
25332
25332
|
};
|
|
25333
|
-
const config$
|
|
25334
|
-
xmlName: XML_NODE_NAME$
|
|
25333
|
+
const config$n = {
|
|
25334
|
+
xmlName: XML_NODE_NAME$p,
|
|
25335
25335
|
sdNodeOrKeyName: SD_ATTR_KEY$d,
|
|
25336
25336
|
type: NodeTranslator.translatorTypes.ATTRIBUTE,
|
|
25337
|
-
encode: encode$
|
|
25337
|
+
encode: encode$R
|
|
25338
25338
|
};
|
|
25339
|
-
const translator$
|
|
25340
|
-
const encode$
|
|
25341
|
-
const decode$
|
|
25339
|
+
const translator$11 = NodeTranslator.from(config$n);
|
|
25340
|
+
const encode$Q = (attributes) => attributes?.["w:val"];
|
|
25341
|
+
const decode$J = (attrs) => attrs?.underline;
|
|
25342
25342
|
const attrConfig$r = Object.freeze({
|
|
25343
25343
|
xmlName: "w:val",
|
|
25344
25344
|
sdName: "underline",
|
|
25345
|
-
encode: encode$
|
|
25346
|
-
decode: decode$
|
|
25345
|
+
encode: encode$Q,
|
|
25346
|
+
decode: decode$J
|
|
25347
25347
|
});
|
|
25348
|
-
const encode$
|
|
25349
|
-
const decode$
|
|
25348
|
+
const encode$P = (attributes) => attributes?.["w:color"];
|
|
25349
|
+
const decode$I = (attrs) => attrs?.color;
|
|
25350
25350
|
const attrConfig$q = Object.freeze({
|
|
25351
25351
|
xmlName: "w:color",
|
|
25352
25352
|
sdName: "color",
|
|
25353
|
-
encode: encode$
|
|
25354
|
-
decode: decode$
|
|
25353
|
+
encode: encode$P,
|
|
25354
|
+
decode: decode$I
|
|
25355
25355
|
});
|
|
25356
|
-
const encode$
|
|
25357
|
-
const decode$
|
|
25356
|
+
const encode$O = (attributes) => attributes?.["w:themeColor"];
|
|
25357
|
+
const decode$H = (attrs) => attrs?.themeColor;
|
|
25358
25358
|
const attrConfig$p = Object.freeze({
|
|
25359
25359
|
xmlName: "w:themeColor",
|
|
25360
25360
|
sdName: "themeColor",
|
|
25361
|
-
encode: encode$
|
|
25362
|
-
decode: decode$
|
|
25361
|
+
encode: encode$O,
|
|
25362
|
+
decode: decode$H
|
|
25363
25363
|
});
|
|
25364
|
-
const encode$
|
|
25365
|
-
const decode$
|
|
25364
|
+
const encode$N = (attributes) => attributes?.["w:themeTint"];
|
|
25365
|
+
const decode$G = (attrs) => attrs?.themeTint;
|
|
25366
25366
|
const attrConfig$o = Object.freeze({
|
|
25367
25367
|
xmlName: "w:themeTint",
|
|
25368
25368
|
sdName: "themeTint",
|
|
25369
|
-
encode: encode$
|
|
25370
|
-
decode: decode$
|
|
25369
|
+
encode: encode$N,
|
|
25370
|
+
decode: decode$G
|
|
25371
25371
|
});
|
|
25372
|
-
const encode$
|
|
25373
|
-
const decode$
|
|
25372
|
+
const encode$M = (attributes) => attributes?.["w:themeShade"];
|
|
25373
|
+
const decode$F = (attrs) => attrs?.themeShade;
|
|
25374
25374
|
const attrConfig$n = Object.freeze({
|
|
25375
25375
|
xmlName: "w:themeShade",
|
|
25376
25376
|
sdName: "themeShade",
|
|
25377
|
-
encode: encode$
|
|
25378
|
-
decode: decode$
|
|
25377
|
+
encode: encode$M,
|
|
25378
|
+
decode: decode$F
|
|
25379
25379
|
});
|
|
25380
|
-
const validXmlAttributes$
|
|
25381
|
-
const XML_NODE_NAME$
|
|
25380
|
+
const validXmlAttributes$h = [attrConfig$r, attrConfig$q, attrConfig$p, attrConfig$o, attrConfig$n];
|
|
25381
|
+
const XML_NODE_NAME$o = "w:u";
|
|
25382
25382
|
const SD_ATTR_KEY$c = "underline";
|
|
25383
|
-
const encode$
|
|
25383
|
+
const encode$L = (params2, encodedAttrs = {}) => {
|
|
25384
25384
|
const { nodes } = params2;
|
|
25385
25385
|
const node = nodes?.[0];
|
|
25386
25386
|
const sourceAttrs = node?.attributes || {};
|
|
@@ -25396,12 +25396,12 @@ const encode$K = (params2, encodedAttrs = {}) => {
|
|
|
25396
25396
|
if (themeShade !== void 0 && themeShade !== null) attributes["w:themeShade"] = themeShade;
|
|
25397
25397
|
return {
|
|
25398
25398
|
type: "attr",
|
|
25399
|
-
xmlName: XML_NODE_NAME$
|
|
25399
|
+
xmlName: XML_NODE_NAME$o,
|
|
25400
25400
|
sdNodeOrKeyName: SD_ATTR_KEY$c,
|
|
25401
25401
|
attributes
|
|
25402
25402
|
};
|
|
25403
25403
|
};
|
|
25404
|
-
const decode$
|
|
25404
|
+
const decode$E = (params2) => {
|
|
25405
25405
|
const attrs = params2?.node?.attrs || {};
|
|
25406
25406
|
const underlineType = attrs.underlineType ?? attrs.underline ?? null;
|
|
25407
25407
|
const color = attrs.underlineColor ?? attrs.color ?? null;
|
|
@@ -25419,20 +25419,20 @@ const decode$D = (params2) => {
|
|
|
25419
25419
|
if (themeTint) attributes["w:themeTint"] = themeTint;
|
|
25420
25420
|
if (themeShade) attributes["w:themeShade"] = themeShade;
|
|
25421
25421
|
return {
|
|
25422
|
-
name: XML_NODE_NAME$
|
|
25422
|
+
name: XML_NODE_NAME$o,
|
|
25423
25423
|
attributes
|
|
25424
25424
|
};
|
|
25425
25425
|
};
|
|
25426
|
-
const config$
|
|
25427
|
-
xmlName: XML_NODE_NAME$
|
|
25426
|
+
const config$m = {
|
|
25427
|
+
xmlName: XML_NODE_NAME$o,
|
|
25428
25428
|
sdNodeOrKeyName: SD_ATTR_KEY$c,
|
|
25429
25429
|
type: NodeTranslator.translatorTypes.ATTRIBUTE,
|
|
25430
|
-
encode: encode$
|
|
25431
|
-
decode: decode$
|
|
25432
|
-
attributes: validXmlAttributes$
|
|
25430
|
+
encode: encode$L,
|
|
25431
|
+
decode: decode$E,
|
|
25432
|
+
attributes: validXmlAttributes$h
|
|
25433
25433
|
};
|
|
25434
|
-
const translator
|
|
25435
|
-
const encode$
|
|
25434
|
+
const translator$10 = NodeTranslator.from(config$m);
|
|
25435
|
+
const encode$K = (attributes) => {
|
|
25436
25436
|
const raw = attributes?.["w:val"];
|
|
25437
25437
|
if (raw === void 0 || raw === null) return void 0;
|
|
25438
25438
|
if (typeof raw === "boolean") return raw;
|
|
@@ -25442,20 +25442,20 @@ const encode$J = (attributes) => {
|
|
|
25442
25442
|
if (val === "1" || val === "true" || val === "on") return true;
|
|
25443
25443
|
return void 0;
|
|
25444
25444
|
};
|
|
25445
|
-
const decode$
|
|
25445
|
+
const decode$D = (attrs) => {
|
|
25446
25446
|
if (attrs?.strike === false) return "0";
|
|
25447
25447
|
return void 0;
|
|
25448
25448
|
};
|
|
25449
25449
|
const attrConfig$m = Object.freeze({
|
|
25450
25450
|
xmlName: "w:val",
|
|
25451
25451
|
sdName: "strike",
|
|
25452
|
-
encode: encode$
|
|
25453
|
-
decode: decode$
|
|
25452
|
+
encode: encode$K,
|
|
25453
|
+
decode: decode$D
|
|
25454
25454
|
});
|
|
25455
|
-
const validXmlAttributes$
|
|
25456
|
-
const XML_NODE_NAME$
|
|
25455
|
+
const validXmlAttributes$g = [attrConfig$m];
|
|
25456
|
+
const XML_NODE_NAME$n = "w:strike";
|
|
25457
25457
|
const SD_ATTR_KEY$b = "strike";
|
|
25458
|
-
const encode$
|
|
25458
|
+
const encode$J = (params2, encodedAttrs = {}) => {
|
|
25459
25459
|
const { nodes } = params2;
|
|
25460
25460
|
const node = nodes?.[0];
|
|
25461
25461
|
if (!node) return void 0;
|
|
@@ -25468,55 +25468,55 @@ const encode$I = (params2, encodedAttrs = {}) => {
|
|
|
25468
25468
|
else if (val === true && attributes["w:val"] === void 0) delete attributes["w:val"];
|
|
25469
25469
|
return {
|
|
25470
25470
|
type: "attr",
|
|
25471
|
-
xmlName: XML_NODE_NAME$
|
|
25471
|
+
xmlName: XML_NODE_NAME$n,
|
|
25472
25472
|
sdNodeOrKeyName: SD_ATTR_KEY$b,
|
|
25473
25473
|
attributes
|
|
25474
25474
|
};
|
|
25475
25475
|
};
|
|
25476
|
-
const config$
|
|
25477
|
-
xmlName: XML_NODE_NAME$
|
|
25476
|
+
const config$l = {
|
|
25477
|
+
xmlName: XML_NODE_NAME$n,
|
|
25478
25478
|
sdNodeOrKeyName: SD_ATTR_KEY$b,
|
|
25479
25479
|
type: NodeTranslator.translatorTypes.ATTRIBUTE,
|
|
25480
|
-
encode: encode$
|
|
25481
|
-
attributes: validXmlAttributes$
|
|
25480
|
+
encode: encode$J,
|
|
25481
|
+
attributes: validXmlAttributes$g
|
|
25482
25482
|
};
|
|
25483
|
-
const translator
|
|
25484
|
-
const encode$
|
|
25485
|
-
const decode$
|
|
25483
|
+
const translator$$ = NodeTranslator.from(config$l);
|
|
25484
|
+
const encode$I = (attributes) => attributes?.["w:val"];
|
|
25485
|
+
const decode$C = (attrs) => attrs?.color;
|
|
25486
25486
|
const attrConfig$l = Object.freeze({
|
|
25487
25487
|
xmlName: "w:val",
|
|
25488
25488
|
sdName: "color",
|
|
25489
|
-
encode: encode$
|
|
25490
|
-
decode: decode$
|
|
25489
|
+
encode: encode$I,
|
|
25490
|
+
decode: decode$C
|
|
25491
25491
|
});
|
|
25492
|
-
const encode$
|
|
25493
|
-
const decode$
|
|
25492
|
+
const encode$H = (attributes) => attributes?.["w:themeColor"];
|
|
25493
|
+
const decode$B = (attrs) => attrs?.themeColor;
|
|
25494
25494
|
const attrConfig$k = Object.freeze({
|
|
25495
25495
|
xmlName: "w:themeColor",
|
|
25496
25496
|
sdName: "themeColor",
|
|
25497
|
-
encode: encode$
|
|
25498
|
-
decode: decode$
|
|
25497
|
+
encode: encode$H,
|
|
25498
|
+
decode: decode$B
|
|
25499
25499
|
});
|
|
25500
|
-
const encode$
|
|
25501
|
-
const decode$
|
|
25500
|
+
const encode$G = (attributes) => attributes?.["w:themeTint"];
|
|
25501
|
+
const decode$A = (attrs) => attrs?.themeTint;
|
|
25502
25502
|
const attrConfig$j = Object.freeze({
|
|
25503
25503
|
xmlName: "w:themeTint",
|
|
25504
25504
|
sdName: "themeTint",
|
|
25505
|
-
encode: encode$
|
|
25506
|
-
decode: decode$
|
|
25505
|
+
encode: encode$G,
|
|
25506
|
+
decode: decode$A
|
|
25507
25507
|
});
|
|
25508
|
-
const encode$
|
|
25509
|
-
const decode$
|
|
25508
|
+
const encode$F = (attributes) => attributes?.["w:themeShade"];
|
|
25509
|
+
const decode$z = (attrs) => attrs?.themeShade;
|
|
25510
25510
|
const attrConfig$i = Object.freeze({
|
|
25511
25511
|
xmlName: "w:themeShade",
|
|
25512
25512
|
sdName: "themeShade",
|
|
25513
|
-
encode: encode$
|
|
25514
|
-
decode: decode$
|
|
25513
|
+
encode: encode$F,
|
|
25514
|
+
decode: decode$z
|
|
25515
25515
|
});
|
|
25516
|
-
const validXmlAttributes$
|
|
25517
|
-
const XML_NODE_NAME$
|
|
25516
|
+
const validXmlAttributes$f = [attrConfig$l, attrConfig$k, attrConfig$j, attrConfig$i];
|
|
25517
|
+
const XML_NODE_NAME$m = "w:color";
|
|
25518
25518
|
const SD_ATTR_KEY$a = "color";
|
|
25519
|
-
const encode$
|
|
25519
|
+
const encode$E = (params2, encodedAttrs = {}) => {
|
|
25520
25520
|
const { nodes } = params2;
|
|
25521
25521
|
const node = nodes?.[0];
|
|
25522
25522
|
const sourceAttrs = node?.attributes || {};
|
|
@@ -25531,63 +25531,63 @@ const encode$D = (params2, encodedAttrs = {}) => {
|
|
|
25531
25531
|
if (themeShade !== void 0 && themeShade !== null) attributes["w:themeShade"] = themeShade;
|
|
25532
25532
|
return {
|
|
25533
25533
|
type: "attr",
|
|
25534
|
-
xmlName: XML_NODE_NAME$
|
|
25534
|
+
xmlName: XML_NODE_NAME$m,
|
|
25535
25535
|
sdNodeOrKeyName: SD_ATTR_KEY$a,
|
|
25536
25536
|
attributes
|
|
25537
25537
|
};
|
|
25538
25538
|
};
|
|
25539
|
-
const config$
|
|
25540
|
-
xmlName: XML_NODE_NAME$
|
|
25539
|
+
const config$k = {
|
|
25540
|
+
xmlName: XML_NODE_NAME$m,
|
|
25541
25541
|
sdNodeOrKeyName: SD_ATTR_KEY$a,
|
|
25542
25542
|
type: NodeTranslator.translatorTypes.ATTRIBUTE,
|
|
25543
|
-
encode: encode$
|
|
25544
|
-
attributes: validXmlAttributes$
|
|
25543
|
+
encode: encode$E,
|
|
25544
|
+
attributes: validXmlAttributes$f
|
|
25545
25545
|
};
|
|
25546
|
-
const translator$
|
|
25547
|
-
const encode$
|
|
25548
|
-
const decode$
|
|
25546
|
+
const translator$_ = NodeTranslator.from(config$k);
|
|
25547
|
+
const encode$D = (attributes) => attributes?.["w:eastAsia"];
|
|
25548
|
+
const decode$y = (attrs) => attrs?.eastAsia;
|
|
25549
25549
|
const attrConfig$h = Object.freeze({
|
|
25550
25550
|
xmlName: "w:eastAsia",
|
|
25551
25551
|
sdName: "eastAsia",
|
|
25552
|
-
encode: encode$
|
|
25553
|
-
decode: decode$
|
|
25552
|
+
encode: encode$D,
|
|
25553
|
+
decode: decode$y
|
|
25554
25554
|
});
|
|
25555
|
-
const encode$
|
|
25556
|
-
const decode$
|
|
25555
|
+
const encode$C = (attributes) => attributes?.["w:ascii"];
|
|
25556
|
+
const decode$x = (attrs) => attrs?.ascii;
|
|
25557
25557
|
const attrConfig$g = Object.freeze({
|
|
25558
25558
|
xmlName: "w:ascii",
|
|
25559
25559
|
sdName: "ascii",
|
|
25560
|
-
encode: encode$
|
|
25561
|
-
decode: decode$
|
|
25560
|
+
encode: encode$C,
|
|
25561
|
+
decode: decode$x
|
|
25562
25562
|
});
|
|
25563
|
-
const encode$
|
|
25564
|
-
const decode$
|
|
25563
|
+
const encode$B = (attributes) => attributes?.["w:hAnsi"];
|
|
25564
|
+
const decode$w = (attrs) => attrs?.hAnsi;
|
|
25565
25565
|
const attrConfig$f = Object.freeze({
|
|
25566
25566
|
xmlName: "w:hAnsi",
|
|
25567
25567
|
sdName: "hAnsi",
|
|
25568
|
-
encode: encode$
|
|
25569
|
-
decode: decode$
|
|
25568
|
+
encode: encode$B,
|
|
25569
|
+
decode: decode$w
|
|
25570
25570
|
});
|
|
25571
|
-
const encode$
|
|
25572
|
-
const decode$
|
|
25571
|
+
const encode$A = (attributes) => attributes?.["w:cs"];
|
|
25572
|
+
const decode$v = (attrs) => attrs?.cs;
|
|
25573
25573
|
const attrConfig$e = Object.freeze({
|
|
25574
25574
|
xmlName: "w:cs",
|
|
25575
25575
|
sdName: "cs",
|
|
25576
|
-
encode: encode$
|
|
25577
|
-
decode: decode$
|
|
25576
|
+
encode: encode$A,
|
|
25577
|
+
decode: decode$v
|
|
25578
25578
|
});
|
|
25579
|
-
const encode$
|
|
25580
|
-
const decode$
|
|
25579
|
+
const encode$z = (attributes) => attributes?.["w:val"];
|
|
25580
|
+
const decode$u = (attrs) => attrs?.value;
|
|
25581
25581
|
const attrConfig$d = Object.freeze({
|
|
25582
25582
|
xmlName: "w:val",
|
|
25583
25583
|
sdName: "value",
|
|
25584
|
-
encode: encode$
|
|
25585
|
-
decode: decode$
|
|
25584
|
+
encode: encode$z,
|
|
25585
|
+
decode: decode$u
|
|
25586
25586
|
});
|
|
25587
|
-
const validXmlAttributes$
|
|
25588
|
-
const XML_NODE_NAME$
|
|
25587
|
+
const validXmlAttributes$e = [attrConfig$h, attrConfig$g, attrConfig$f, attrConfig$e, attrConfig$d];
|
|
25588
|
+
const XML_NODE_NAME$l = "w:rFonts";
|
|
25589
25589
|
const SD_ATTR_KEY$9 = "fontFamily";
|
|
25590
|
-
const encode$
|
|
25590
|
+
const encode$y = (params2, encodedAttrs = {}) => {
|
|
25591
25591
|
const { nodes } = params2;
|
|
25592
25592
|
const node = nodes?.[0];
|
|
25593
25593
|
const sourceAttrs = node?.attributes || {};
|
|
@@ -25613,120 +25613,120 @@ const encode$x = (params2, encodedAttrs = {}) => {
|
|
|
25613
25613
|
if (attributes["w:val"] === void 0) delete attributes["w:val"];
|
|
25614
25614
|
return {
|
|
25615
25615
|
type: "attr",
|
|
25616
|
-
xmlName: XML_NODE_NAME$
|
|
25616
|
+
xmlName: XML_NODE_NAME$l,
|
|
25617
25617
|
sdNodeOrKeyName: SD_ATTR_KEY$9,
|
|
25618
25618
|
attributes
|
|
25619
25619
|
};
|
|
25620
25620
|
};
|
|
25621
|
-
const config$
|
|
25622
|
-
xmlName: XML_NODE_NAME$
|
|
25621
|
+
const config$j = {
|
|
25622
|
+
xmlName: XML_NODE_NAME$l,
|
|
25623
25623
|
sdNodeOrKeyName: SD_ATTR_KEY$9,
|
|
25624
25624
|
type: NodeTranslator.translatorTypes.ATTRIBUTE,
|
|
25625
|
-
encode: encode$
|
|
25626
|
-
attributes: validXmlAttributes$
|
|
25625
|
+
encode: encode$y,
|
|
25626
|
+
attributes: validXmlAttributes$e
|
|
25627
25627
|
};
|
|
25628
|
-
const translator$
|
|
25629
|
-
const encode$
|
|
25630
|
-
const decode$
|
|
25628
|
+
const translator$Z = NodeTranslator.from(config$j);
|
|
25629
|
+
const encode$x = (attributes) => attributes?.["w:val"];
|
|
25630
|
+
const decode$t = (attrs) => attrs?.styleId;
|
|
25631
25631
|
const attrConfig$c = Object.freeze({
|
|
25632
25632
|
xmlName: "w:val",
|
|
25633
25633
|
sdName: "styleId",
|
|
25634
|
-
encode: encode$
|
|
25635
|
-
decode: decode$
|
|
25634
|
+
encode: encode$x,
|
|
25635
|
+
decode: decode$t
|
|
25636
25636
|
});
|
|
25637
|
-
const validXmlAttributes$
|
|
25638
|
-
const XML_NODE_NAME$
|
|
25637
|
+
const validXmlAttributes$d = [attrConfig$c];
|
|
25638
|
+
const XML_NODE_NAME$k = "w:rStyle";
|
|
25639
25639
|
const SD_ATTR_KEY$8 = "styleId";
|
|
25640
|
-
const encode$
|
|
25640
|
+
const encode$w = (params2, encodedAttrs = {}) => {
|
|
25641
25641
|
const { nodes } = params2;
|
|
25642
25642
|
const node = nodes?.[0];
|
|
25643
25643
|
const value = encodedAttrs.styleId ?? node?.attributes?.["w:val"];
|
|
25644
25644
|
return {
|
|
25645
25645
|
type: "attr",
|
|
25646
|
-
xmlName: XML_NODE_NAME$
|
|
25646
|
+
xmlName: XML_NODE_NAME$k,
|
|
25647
25647
|
sdNodeOrKeyName: SD_ATTR_KEY$8,
|
|
25648
25648
|
attributes: { "w:val": value ?? null }
|
|
25649
25649
|
};
|
|
25650
25650
|
};
|
|
25651
|
-
const config$
|
|
25652
|
-
xmlName: XML_NODE_NAME$
|
|
25651
|
+
const config$i = {
|
|
25652
|
+
xmlName: XML_NODE_NAME$k,
|
|
25653
25653
|
sdNodeOrKeyName: SD_ATTR_KEY$8,
|
|
25654
25654
|
type: NodeTranslator.translatorTypes.ATTRIBUTE,
|
|
25655
|
-
encode: encode$
|
|
25656
|
-
attributes: validXmlAttributes$
|
|
25655
|
+
encode: encode$w,
|
|
25656
|
+
attributes: validXmlAttributes$d
|
|
25657
25657
|
};
|
|
25658
|
-
const translator$
|
|
25659
|
-
const encode$
|
|
25660
|
-
const decode$
|
|
25658
|
+
const translator$Y = NodeTranslator.from(config$i);
|
|
25659
|
+
const encode$v = (attributes) => attributes?.["w:val"];
|
|
25660
|
+
const decode$s = (attrs) => attrs?.fontSize;
|
|
25661
25661
|
const attrConfig$b = Object.freeze({
|
|
25662
25662
|
xmlName: "w:val",
|
|
25663
25663
|
sdName: "fontSize",
|
|
25664
|
-
encode: encode$
|
|
25665
|
-
decode: decode$
|
|
25664
|
+
encode: encode$v,
|
|
25665
|
+
decode: decode$s
|
|
25666
25666
|
});
|
|
25667
|
-
const validXmlAttributes$
|
|
25668
|
-
const XML_NODE_NAME$
|
|
25667
|
+
const validXmlAttributes$c = [attrConfig$b];
|
|
25668
|
+
const XML_NODE_NAME$j = "w:sz";
|
|
25669
25669
|
const SD_ATTR_KEY$7 = "fontSize";
|
|
25670
|
-
const encode$
|
|
25670
|
+
const encode$u = (params2, encodedAttrs = {}) => {
|
|
25671
25671
|
const { nodes } = params2;
|
|
25672
25672
|
const node = nodes?.[0];
|
|
25673
25673
|
const value = encodedAttrs.fontSize ?? node?.attributes?.["w:val"];
|
|
25674
25674
|
return {
|
|
25675
25675
|
type: "attr",
|
|
25676
|
-
xmlName: XML_NODE_NAME$
|
|
25676
|
+
xmlName: XML_NODE_NAME$j,
|
|
25677
25677
|
sdNodeOrKeyName: SD_ATTR_KEY$7,
|
|
25678
25678
|
attributes: { "w:val": value ?? null }
|
|
25679
25679
|
};
|
|
25680
25680
|
};
|
|
25681
|
-
const config$
|
|
25682
|
-
xmlName: XML_NODE_NAME$
|
|
25681
|
+
const config$h = {
|
|
25682
|
+
xmlName: XML_NODE_NAME$j,
|
|
25683
25683
|
sdNodeOrKeyName: SD_ATTR_KEY$7,
|
|
25684
25684
|
type: NodeTranslator.translatorTypes.ATTRIBUTE,
|
|
25685
|
-
encode: encode$
|
|
25686
|
-
attributes: validXmlAttributes$
|
|
25685
|
+
encode: encode$u,
|
|
25686
|
+
attributes: validXmlAttributes$c
|
|
25687
25687
|
};
|
|
25688
|
-
const translator$
|
|
25689
|
-
const encode$
|
|
25690
|
-
const decode$
|
|
25688
|
+
const translator$X = NodeTranslator.from(config$h);
|
|
25689
|
+
const encode$t = (attributes) => attributes?.["w:val"];
|
|
25690
|
+
const decode$r = (attrs) => attrs?.fontSizeCs;
|
|
25691
25691
|
const attrConfig$a = Object.freeze({
|
|
25692
25692
|
xmlName: "w:val",
|
|
25693
25693
|
sdName: "fontSizeCs",
|
|
25694
|
-
encode: encode$
|
|
25695
|
-
decode: decode$
|
|
25694
|
+
encode: encode$t,
|
|
25695
|
+
decode: decode$r
|
|
25696
25696
|
});
|
|
25697
|
-
const validXmlAttributes$
|
|
25698
|
-
const XML_NODE_NAME$
|
|
25697
|
+
const validXmlAttributes$b = [attrConfig$a];
|
|
25698
|
+
const XML_NODE_NAME$i = "w:szCs";
|
|
25699
25699
|
const SD_ATTR_KEY$6 = "fontSizeCs";
|
|
25700
|
-
const encode$
|
|
25700
|
+
const encode$s = (params2, encodedAttrs = {}) => {
|
|
25701
25701
|
const { nodes } = params2;
|
|
25702
25702
|
const node = nodes?.[0];
|
|
25703
25703
|
const value = encodedAttrs.fontSizeCs ?? node?.attributes?.["w:val"];
|
|
25704
25704
|
return {
|
|
25705
25705
|
type: "attr",
|
|
25706
|
-
xmlName: XML_NODE_NAME$
|
|
25706
|
+
xmlName: XML_NODE_NAME$i,
|
|
25707
25707
|
sdNodeOrKeyName: SD_ATTR_KEY$6,
|
|
25708
25708
|
attributes: { "w:val": value ?? null }
|
|
25709
25709
|
};
|
|
25710
25710
|
};
|
|
25711
|
-
const config$
|
|
25712
|
-
xmlName: XML_NODE_NAME$
|
|
25711
|
+
const config$g = {
|
|
25712
|
+
xmlName: XML_NODE_NAME$i,
|
|
25713
25713
|
sdNodeOrKeyName: SD_ATTR_KEY$6,
|
|
25714
25714
|
type: NodeTranslator.translatorTypes.ATTRIBUTE,
|
|
25715
|
-
encode: encode$
|
|
25716
|
-
attributes: validXmlAttributes$
|
|
25715
|
+
encode: encode$s,
|
|
25716
|
+
attributes: validXmlAttributes$b
|
|
25717
25717
|
};
|
|
25718
|
-
const translator$
|
|
25718
|
+
const translator$W = NodeTranslator.from(config$g);
|
|
25719
25719
|
const runPropertyTranslators = Object.freeze({
|
|
25720
|
-
"w:b": translator$
|
|
25721
|
-
"w:i": translator$
|
|
25722
|
-
"w:u": translator
|
|
25723
|
-
"w:strike": translator
|
|
25724
|
-
"w:color": translator$
|
|
25725
|
-
"w:highlight": translator$
|
|
25726
|
-
"w:rFonts": translator$
|
|
25727
|
-
"w:rStyle": translator$
|
|
25728
|
-
"w:sz": translator$
|
|
25729
|
-
"w:szCs": translator$
|
|
25720
|
+
"w:b": translator$12,
|
|
25721
|
+
"w:i": translator$11,
|
|
25722
|
+
"w:u": translator$10,
|
|
25723
|
+
"w:strike": translator$$,
|
|
25724
|
+
"w:color": translator$_,
|
|
25725
|
+
"w:highlight": translator$15,
|
|
25726
|
+
"w:rFonts": translator$Z,
|
|
25727
|
+
"w:rStyle": translator$Y,
|
|
25728
|
+
"w:sz": translator$X,
|
|
25729
|
+
"w:szCs": translator$W
|
|
25730
25730
|
});
|
|
25731
25731
|
const rawRunPropertyXmlNames = Object.freeze(["w:lang", "w:shd"]);
|
|
25732
25732
|
const RAW_CHILD_NAME_SET = new Set(rawRunPropertyXmlNames);
|
|
@@ -25740,9 +25740,9 @@ const toRunPropertyEntry = (candidate) => {
|
|
|
25740
25740
|
attributes: { ...candidate.attributes || {} }
|
|
25741
25741
|
};
|
|
25742
25742
|
};
|
|
25743
|
-
const XML_NODE_NAME$
|
|
25743
|
+
const XML_NODE_NAME$h = "w:rPr";
|
|
25744
25744
|
const SD_ATTR_KEY$5 = "runProperties";
|
|
25745
|
-
const encode$
|
|
25745
|
+
const encode$r = (params2) => {
|
|
25746
25746
|
const { nodes } = params2;
|
|
25747
25747
|
const node = nodes?.[0] || {};
|
|
25748
25748
|
const contents = Array.isArray(node.elements) ? node.elements : [];
|
|
@@ -25776,16 +25776,16 @@ const encode$q = (params2) => {
|
|
|
25776
25776
|
attributes: runPropsArray
|
|
25777
25777
|
};
|
|
25778
25778
|
};
|
|
25779
|
-
const config$
|
|
25780
|
-
xmlName: XML_NODE_NAME$
|
|
25779
|
+
const config$f = {
|
|
25780
|
+
xmlName: XML_NODE_NAME$h,
|
|
25781
25781
|
sdNodeOrKeyName: SD_ATTR_KEY$5,
|
|
25782
25782
|
type: NodeTranslator.translatorTypes.ATTRIBUTE,
|
|
25783
|
-
encode: encode$
|
|
25783
|
+
encode: encode$r
|
|
25784
25784
|
};
|
|
25785
|
-
const translator$
|
|
25785
|
+
const translator$V = NodeTranslator.from(config$f);
|
|
25786
25786
|
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;
|
|
25787
25787
|
const containsEastAsianCharacters = (text) => EAST_ASIAN_CHARACTER_REGEX.test(text);
|
|
25788
|
-
const collectRunProperties = (params2, rPrNode, translator2 = translator$
|
|
25788
|
+
const collectRunProperties = (params2, rPrNode, translator2 = translator$V) => {
|
|
25789
25789
|
if (!rPrNode) return { entries: [], hadRPr: false, styleChangeMarks: [] };
|
|
25790
25790
|
const result = translator2.encode({ ...params2, nodes: [rPrNode] }) || {};
|
|
25791
25791
|
let entries = [];
|
|
@@ -26247,46 +26247,46 @@ const ensureTrackedWrapper = (runs, trackingMarksByType = /* @__PURE__ */ new Ma
|
|
|
26247
26247
|
}
|
|
26248
26248
|
return runs;
|
|
26249
26249
|
};
|
|
26250
|
-
const encode$
|
|
26250
|
+
const encode$q = (attributes) => {
|
|
26251
26251
|
return attributes["w:rsidR"];
|
|
26252
26252
|
};
|
|
26253
|
-
const decode$
|
|
26253
|
+
const decode$q = (attrs) => {
|
|
26254
26254
|
return attrs.rsidR;
|
|
26255
26255
|
};
|
|
26256
26256
|
const attrConfig$9 = Object.freeze({
|
|
26257
26257
|
xmlName: "w:rsidR",
|
|
26258
26258
|
sdName: "rsidR",
|
|
26259
|
-
encode: encode$
|
|
26260
|
-
decode: decode$
|
|
26259
|
+
encode: encode$q,
|
|
26260
|
+
decode: decode$q
|
|
26261
26261
|
});
|
|
26262
|
-
const encode$
|
|
26262
|
+
const encode$p = (attributes) => {
|
|
26263
26263
|
return attributes["w:rsidRPr"];
|
|
26264
26264
|
};
|
|
26265
|
-
const decode$
|
|
26265
|
+
const decode$p = (attrs) => {
|
|
26266
26266
|
return attrs.rsidRPr;
|
|
26267
26267
|
};
|
|
26268
26268
|
const attrConfig$8 = Object.freeze({
|
|
26269
26269
|
xmlName: "w:rsidRPr",
|
|
26270
26270
|
sdName: "rsidRPr",
|
|
26271
|
-
encode: encode$
|
|
26272
|
-
decode: decode$
|
|
26271
|
+
encode: encode$p,
|
|
26272
|
+
decode: decode$p
|
|
26273
26273
|
});
|
|
26274
|
-
const encode$
|
|
26274
|
+
const encode$o = (attributes) => {
|
|
26275
26275
|
return attributes["w:rsidDel"];
|
|
26276
26276
|
};
|
|
26277
|
-
const decode$
|
|
26277
|
+
const decode$o = (attrs) => {
|
|
26278
26278
|
return attrs.rsidDel;
|
|
26279
26279
|
};
|
|
26280
26280
|
const attrConfig$7 = Object.freeze({
|
|
26281
26281
|
xmlName: "w:rsidDel",
|
|
26282
26282
|
sdName: "rsidDel",
|
|
26283
|
-
encode: encode$
|
|
26284
|
-
decode: decode$
|
|
26283
|
+
encode: encode$o,
|
|
26284
|
+
decode: decode$o
|
|
26285
26285
|
});
|
|
26286
|
-
const validXmlAttributes$
|
|
26287
|
-
const XML_NODE_NAME$
|
|
26286
|
+
const validXmlAttributes$a = [attrConfig$9, attrConfig$8, attrConfig$7];
|
|
26287
|
+
const XML_NODE_NAME$g = "w:r";
|
|
26288
26288
|
const SD_KEY_NAME = "run";
|
|
26289
|
-
const encode$
|
|
26289
|
+
const encode$n = (params2, encodedAttrs = {}) => {
|
|
26290
26290
|
const { nodes = [], nodeListHandler } = params2 || {};
|
|
26291
26291
|
const runNode = nodes[0];
|
|
26292
26292
|
if (!runNode) return void 0;
|
|
@@ -26334,7 +26334,7 @@ const encode$m = (params2, encodedAttrs = {}) => {
|
|
|
26334
26334
|
}
|
|
26335
26335
|
return runNodeResult;
|
|
26336
26336
|
};
|
|
26337
|
-
const decode$
|
|
26337
|
+
const decode$n = (params2, decodedAttrs = {}) => {
|
|
26338
26338
|
const { node } = params2 || {};
|
|
26339
26339
|
if (!node) return void 0;
|
|
26340
26340
|
const { runNode: runNodeForExport, trackingMarksByType } = prepareRunTrackingContext(node);
|
|
@@ -26391,7 +26391,7 @@ const decode$m = (params2, decodedAttrs = {}) => {
|
|
|
26391
26391
|
runs.push(trackedClone);
|
|
26392
26392
|
return;
|
|
26393
26393
|
}
|
|
26394
|
-
const runWrapper = { name: XML_NODE_NAME$
|
|
26394
|
+
const runWrapper = { name: XML_NODE_NAME$g, elements: [] };
|
|
26395
26395
|
applyBaseRunProps(runWrapper);
|
|
26396
26396
|
if (!Array.isArray(runWrapper.elements)) runWrapper.elements = [];
|
|
26397
26397
|
runWrapper.elements.push(cloneXmlNode(child));
|
|
@@ -26399,7 +26399,7 @@ const decode$m = (params2, decodedAttrs = {}) => {
|
|
|
26399
26399
|
});
|
|
26400
26400
|
const trackedRuns = ensureTrackedWrapper(runs, trackingMarksByType);
|
|
26401
26401
|
if (!trackedRuns.length) {
|
|
26402
|
-
const emptyRun = { name: XML_NODE_NAME$
|
|
26402
|
+
const emptyRun = { name: XML_NODE_NAME$g, elements: [] };
|
|
26403
26403
|
applyBaseRunProps(emptyRun);
|
|
26404
26404
|
trackedRuns.push(emptyRun);
|
|
26405
26405
|
}
|
|
@@ -26413,15 +26413,15 @@ const decode$m = (params2, decodedAttrs = {}) => {
|
|
|
26413
26413
|
}
|
|
26414
26414
|
return trackedRuns;
|
|
26415
26415
|
};
|
|
26416
|
-
const config$
|
|
26417
|
-
xmlName: XML_NODE_NAME$
|
|
26416
|
+
const config$e = {
|
|
26417
|
+
xmlName: XML_NODE_NAME$g,
|
|
26418
26418
|
sdNodeOrKeyName: SD_KEY_NAME,
|
|
26419
26419
|
type: NodeTranslator.translatorTypes.NODE,
|
|
26420
|
-
encode: encode$
|
|
26421
|
-
decode: decode$
|
|
26422
|
-
attributes: validXmlAttributes$
|
|
26420
|
+
encode: encode$n,
|
|
26421
|
+
decode: decode$n,
|
|
26422
|
+
attributes: validXmlAttributes$a
|
|
26423
26423
|
};
|
|
26424
|
-
const translator$
|
|
26424
|
+
const translator$U = NodeTranslator.from(config$e);
|
|
26425
26425
|
const generateV2HandlerEntity = (handlerName, translator2) => ({
|
|
26426
26426
|
handlerName,
|
|
26427
26427
|
handler: (params2) => {
|
|
@@ -26595,13 +26595,13 @@ function preProcessVerticalMergeCells(table, { editorSchema }) {
|
|
|
26595
26595
|
}
|
|
26596
26596
|
return table;
|
|
26597
26597
|
}
|
|
26598
|
-
const translator$
|
|
26598
|
+
const translator$T = NodeTranslator.from({
|
|
26599
26599
|
xmlName: "w:cantSplit",
|
|
26600
26600
|
sdNodeOrKeyName: "cantSplit",
|
|
26601
26601
|
encode: ({ nodes }) => ["1", "true"].includes(nodes[0].attributes?.["w:val"] ?? "1"),
|
|
26602
26602
|
decode: ({ node }) => node.attrs?.cantSplit ? { attributes: {} } : void 0
|
|
26603
26603
|
});
|
|
26604
|
-
const translator$
|
|
26604
|
+
const translator$S = NodeTranslator.from({
|
|
26605
26605
|
xmlName: "w:cnfStyle",
|
|
26606
26606
|
sdNodeOrKeyName: "cnfStyle",
|
|
26607
26607
|
attributes: [
|
|
@@ -26627,8 +26627,8 @@ const translator$R = NodeTranslator.from({
|
|
|
26627
26627
|
return Object.keys(decodedAttrs).length > 0 ? { attributes: decodedAttrs } : void 0;
|
|
26628
26628
|
}
|
|
26629
26629
|
});
|
|
26630
|
-
const translator$
|
|
26631
|
-
const translator$
|
|
26630
|
+
const translator$R = NodeTranslator.from(createSingleAttrPropertyHandler("w:divId"));
|
|
26631
|
+
const translator$Q = NodeTranslator.from(
|
|
26632
26632
|
createSingleAttrPropertyHandler(
|
|
26633
26633
|
"w:gridAfter",
|
|
26634
26634
|
null,
|
|
@@ -26637,7 +26637,7 @@ const translator$P = NodeTranslator.from(
|
|
|
26637
26637
|
(v2) => integerToString(v2)
|
|
26638
26638
|
)
|
|
26639
26639
|
);
|
|
26640
|
-
const translator$
|
|
26640
|
+
const translator$P = NodeTranslator.from(
|
|
26641
26641
|
createSingleAttrPropertyHandler(
|
|
26642
26642
|
"w:gridBefore",
|
|
26643
26643
|
null,
|
|
@@ -26646,21 +26646,21 @@ const translator$O = NodeTranslator.from(
|
|
|
26646
26646
|
(v2) => integerToString(v2)
|
|
26647
26647
|
)
|
|
26648
26648
|
);
|
|
26649
|
-
const translator$
|
|
26649
|
+
const translator$O = NodeTranslator.from({
|
|
26650
26650
|
xmlName: "w:hidden",
|
|
26651
26651
|
sdNodeOrKeyName: "hidden",
|
|
26652
26652
|
encode: ({ nodes }) => parseBoolean(nodes[0].attributes?.["w:val"] ?? "1"),
|
|
26653
26653
|
decode: ({ node }) => node.attrs.hidden ? { attributes: {} } : void 0
|
|
26654
26654
|
});
|
|
26655
|
-
const translator$
|
|
26656
|
-
const translator$
|
|
26657
|
-
const translator$
|
|
26655
|
+
const translator$N = NodeTranslator.from(createSingleAttrPropertyHandler("w:jc", "justification"));
|
|
26656
|
+
const translator$M = NodeTranslator.from(createMeasurementPropertyHandler("w:tblCellSpacing", "tableCellSpacing"));
|
|
26657
|
+
const translator$L = NodeTranslator.from({
|
|
26658
26658
|
xmlName: "w:tblHeader",
|
|
26659
26659
|
sdNodeOrKeyName: "repeatHeader",
|
|
26660
26660
|
encode: ({ nodes }) => parseBoolean(nodes[0].attributes?.["w:val"] ?? "1"),
|
|
26661
26661
|
decode: ({ node }) => node.attrs.repeatHeader ? { attributes: {} } : void 0
|
|
26662
26662
|
});
|
|
26663
|
-
const translator$
|
|
26663
|
+
const translator$K = NodeTranslator.from({
|
|
26664
26664
|
xmlName: "w:trHeight",
|
|
26665
26665
|
sdNodeOrKeyName: "rowHeight",
|
|
26666
26666
|
encode: ({ nodes }) => {
|
|
@@ -26687,11 +26687,11 @@ const translator$J = NodeTranslator.from({
|
|
|
26687
26687
|
return Object.keys(heightAttrs).length > 0 ? { attributes: heightAttrs } : void 0;
|
|
26688
26688
|
}
|
|
26689
26689
|
});
|
|
26690
|
-
const translator$
|
|
26691
|
-
const translator$
|
|
26692
|
-
const XML_NODE_NAME$
|
|
26690
|
+
const translator$J = NodeTranslator.from(createMeasurementPropertyHandler("w:wAfter"));
|
|
26691
|
+
const translator$I = NodeTranslator.from(createMeasurementPropertyHandler("w:wBefore"));
|
|
26692
|
+
const XML_NODE_NAME$f = "w:trPr";
|
|
26693
26693
|
const SD_ATTR_KEY$4 = "tableRowProperties";
|
|
26694
|
-
const encode$
|
|
26694
|
+
const encode$m = (params2) => {
|
|
26695
26695
|
const { nodes } = params2;
|
|
26696
26696
|
const node = nodes[0];
|
|
26697
26697
|
let attributes = {
|
|
@@ -26705,12 +26705,12 @@ const encode$l = (params2) => {
|
|
|
26705
26705
|
};
|
|
26706
26706
|
return {
|
|
26707
26707
|
type: NodeTranslator.translatorTypes.ATTRIBUTE,
|
|
26708
|
-
xmlName: XML_NODE_NAME$
|
|
26708
|
+
xmlName: XML_NODE_NAME$f,
|
|
26709
26709
|
sdNodeOrKeyName: SD_ATTR_KEY$4,
|
|
26710
26710
|
attributes
|
|
26711
26711
|
};
|
|
26712
26712
|
};
|
|
26713
|
-
const decode$
|
|
26713
|
+
const decode$m = (params2) => {
|
|
26714
26714
|
const { tableRowProperties = {} } = params2.node.attrs || {};
|
|
26715
26715
|
const elements = decodeProperties(propertyTranslatorsBySdName$2, tableRowProperties);
|
|
26716
26716
|
const newNode = {
|
|
@@ -26722,6 +26722,7 @@ const decode$l = (params2) => {
|
|
|
26722
26722
|
return newNode;
|
|
26723
26723
|
};
|
|
26724
26724
|
const propertyTranslators$3 = [
|
|
26725
|
+
translator$T,
|
|
26725
26726
|
translator$S,
|
|
26726
26727
|
translator$R,
|
|
26727
26728
|
translator$Q,
|
|
@@ -26732,8 +26733,7 @@ const propertyTranslators$3 = [
|
|
|
26732
26733
|
translator$L,
|
|
26733
26734
|
translator$K,
|
|
26734
26735
|
translator$J,
|
|
26735
|
-
translator$I
|
|
26736
|
-
translator$H
|
|
26736
|
+
translator$I
|
|
26737
26737
|
];
|
|
26738
26738
|
const propertyTranslatorsByXmlName$2 = {};
|
|
26739
26739
|
propertyTranslators$3.forEach((translator2) => {
|
|
@@ -26743,25 +26743,25 @@ const propertyTranslatorsBySdName$2 = {};
|
|
|
26743
26743
|
propertyTranslators$3.forEach((translator2) => {
|
|
26744
26744
|
propertyTranslatorsBySdName$2[translator2.sdNodeOrKeyName] = translator2;
|
|
26745
26745
|
});
|
|
26746
|
-
const config$
|
|
26747
|
-
xmlName: XML_NODE_NAME$
|
|
26746
|
+
const config$d = {
|
|
26747
|
+
xmlName: XML_NODE_NAME$f,
|
|
26748
26748
|
sdNodeOrKeyName: SD_ATTR_KEY$4,
|
|
26749
26749
|
type: NodeTranslator.translatorTypes.ATTRIBUTE,
|
|
26750
|
-
encode: encode$
|
|
26751
|
-
decode: decode$
|
|
26750
|
+
encode: encode$m,
|
|
26751
|
+
decode: decode$m
|
|
26752
26752
|
};
|
|
26753
|
-
const translator$
|
|
26754
|
-
const XML_NODE_NAME$
|
|
26755
|
-
const SD_NODE_NAME$
|
|
26756
|
-
const validXmlAttributes$
|
|
26753
|
+
const translator$H = NodeTranslator.from(config$d);
|
|
26754
|
+
const XML_NODE_NAME$e = "w:tr";
|
|
26755
|
+
const SD_NODE_NAME$a = "tableRow";
|
|
26756
|
+
const validXmlAttributes$9 = ["w:rsidDel", "w:rsidR", "w:rsidRPr", "w:rsidTr", "w14:paraId", "w14:textId"].map(
|
|
26757
26757
|
(xmlName) => createAttributeHandler(xmlName)
|
|
26758
26758
|
);
|
|
26759
|
-
const encode$
|
|
26759
|
+
const encode$l = (params2, encodedAttrs) => {
|
|
26760
26760
|
const { row } = params2.extraParams;
|
|
26761
26761
|
let tableRowProperties = {};
|
|
26762
26762
|
const tPr = row.elements.find((el) => el.name === "w:trPr");
|
|
26763
26763
|
if (tPr) {
|
|
26764
|
-
({ attributes: tableRowProperties } = translator$
|
|
26764
|
+
({ attributes: tableRowProperties } = translator$H.encode({
|
|
26765
26765
|
...params2,
|
|
26766
26766
|
nodes: [tPr]
|
|
26767
26767
|
}));
|
|
@@ -26774,7 +26774,7 @@ const encode$k = (params2, encodedAttrs) => {
|
|
|
26774
26774
|
let currentColumnIndex = 0;
|
|
26775
26775
|
const content = cellNodes?.map((n) => {
|
|
26776
26776
|
let columnWidth = gridColumnWidths?.[currentColumnIndex] || null;
|
|
26777
|
-
const result = translator$
|
|
26777
|
+
const result = translator$8.encode({
|
|
26778
26778
|
...params2,
|
|
26779
26779
|
extraParams: {
|
|
26780
26780
|
...params2.extraParams,
|
|
@@ -26796,7 +26796,7 @@ const encode$k = (params2, encodedAttrs) => {
|
|
|
26796
26796
|
};
|
|
26797
26797
|
return newNode;
|
|
26798
26798
|
};
|
|
26799
|
-
const decode$
|
|
26799
|
+
const decode$l = (params2, decodedAttrs) => {
|
|
26800
26800
|
const { node } = params2;
|
|
26801
26801
|
const elements = translateChildNodes(params2);
|
|
26802
26802
|
if (node.attrs?.tableRowProperties) {
|
|
@@ -26808,7 +26808,7 @@ const decode$k = (params2, decodedAttrs) => {
|
|
|
26808
26808
|
}
|
|
26809
26809
|
}
|
|
26810
26810
|
tableRowProperties["cantSplit"] = node.attrs["cantSplit"];
|
|
26811
|
-
const trPr = translator$
|
|
26811
|
+
const trPr = translator$H.decode({
|
|
26812
26812
|
...params2,
|
|
26813
26813
|
node: { ...node, attrs: { ...node.attrs, tableRowProperties } }
|
|
26814
26814
|
});
|
|
@@ -26820,22 +26820,22 @@ const decode$k = (params2, decodedAttrs) => {
|
|
|
26820
26820
|
elements
|
|
26821
26821
|
};
|
|
26822
26822
|
};
|
|
26823
|
-
const config$
|
|
26824
|
-
xmlName: XML_NODE_NAME$
|
|
26825
|
-
sdNodeOrKeyName: SD_NODE_NAME$
|
|
26823
|
+
const config$c = {
|
|
26824
|
+
xmlName: XML_NODE_NAME$e,
|
|
26825
|
+
sdNodeOrKeyName: SD_NODE_NAME$a,
|
|
26826
26826
|
type: NodeTranslator.translatorTypes.NODE,
|
|
26827
|
-
encode: encode$
|
|
26828
|
-
decode: decode$
|
|
26829
|
-
attributes: validXmlAttributes$
|
|
26827
|
+
encode: encode$l,
|
|
26828
|
+
decode: decode$l,
|
|
26829
|
+
attributes: validXmlAttributes$9
|
|
26830
26830
|
};
|
|
26831
|
-
const translator$
|
|
26832
|
-
const translator$
|
|
26831
|
+
const translator$G = NodeTranslator.from(config$c);
|
|
26832
|
+
const translator$F = NodeTranslator.from({
|
|
26833
26833
|
xmlName: "w:bidiVisual",
|
|
26834
26834
|
sdNodeOrKeyName: "rightToLeft",
|
|
26835
26835
|
encode: ({ nodes }) => parseBoolean(nodes[0].attributes?.["w:val"] ?? "1"),
|
|
26836
26836
|
decode: ({ node }) => node.attrs.rightToLeft ? { attributes: {} } : void 0
|
|
26837
26837
|
});
|
|
26838
|
-
const translator$
|
|
26838
|
+
const translator$E = NodeTranslator.from({
|
|
26839
26839
|
xmlName: "w:shd",
|
|
26840
26840
|
sdNodeOrKeyName: "shading",
|
|
26841
26841
|
attributes: [
|
|
@@ -26857,11 +26857,11 @@ const translator$D = NodeTranslator.from({
|
|
|
26857
26857
|
return Object.keys(decodedAttrs).length > 0 ? { attributes: decodedAttrs } : void 0;
|
|
26858
26858
|
}
|
|
26859
26859
|
});
|
|
26860
|
-
const translator$
|
|
26861
|
-
const translator$
|
|
26862
|
-
const translator$
|
|
26863
|
-
const translator$
|
|
26864
|
-
const translator$
|
|
26860
|
+
const translator$D = NodeTranslator.from(createSingleAttrPropertyHandler("w:tblCaption", "caption"));
|
|
26861
|
+
const translator$C = NodeTranslator.from(createSingleAttrPropertyHandler("w:tblDescription", "description"));
|
|
26862
|
+
const translator$B = NodeTranslator.from(createMeasurementPropertyHandler("w:tblInd", "tableIndent"));
|
|
26863
|
+
const translator$A = NodeTranslator.from(createSingleAttrPropertyHandler("w:tblLayout", "tableLayout", "w:type"));
|
|
26864
|
+
const translator$z = NodeTranslator.from({
|
|
26865
26865
|
xmlName: "w:tblLook",
|
|
26866
26866
|
sdNodeOrKeyName: "tblLook",
|
|
26867
26867
|
attributes: ["w:firstColumn", "w:firstRow", "w:lastColumn", "w:lastRow", "w:noHBand", "w:noVBand"].map((attr) => createAttributeHandler(attr, null, parseBoolean, booleanToString)).concat([createAttributeHandler("w:val")]),
|
|
@@ -26873,16 +26873,16 @@ const translator$y = NodeTranslator.from({
|
|
|
26873
26873
|
return Object.keys(decodedAttrs).length > 0 ? { attributes: decodedAttrs } : void 0;
|
|
26874
26874
|
}
|
|
26875
26875
|
});
|
|
26876
|
-
const translator$
|
|
26877
|
-
const translator$
|
|
26878
|
-
const translator$
|
|
26876
|
+
const translator$y = NodeTranslator.from(createSingleAttrPropertyHandler("w:tblOverlap", "overlap"));
|
|
26877
|
+
const translator$x = NodeTranslator.from(createSingleAttrPropertyHandler("w:tblStyle", "tableStyleId"));
|
|
26878
|
+
const translator$w = NodeTranslator.from(
|
|
26879
26879
|
createSingleAttrPropertyHandler("w:tblStyleColBandSize", "tableStyleColBandSize")
|
|
26880
26880
|
);
|
|
26881
|
-
const translator$
|
|
26881
|
+
const translator$v = NodeTranslator.from(
|
|
26882
26882
|
createSingleAttrPropertyHandler("w:tblStyleRowBandSize", "tableStyleRowBandSize")
|
|
26883
26883
|
);
|
|
26884
|
-
const translator$
|
|
26885
|
-
const translator$
|
|
26884
|
+
const translator$u = NodeTranslator.from(createMeasurementPropertyHandler("w:tblW", "tableWidth"));
|
|
26885
|
+
const translator$t = NodeTranslator.from({
|
|
26886
26886
|
xmlName: "w:tblpPr",
|
|
26887
26887
|
sdNodeOrKeyName: "floatingTableProperties",
|
|
26888
26888
|
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))),
|
|
@@ -26894,29 +26894,29 @@ const translator$s = NodeTranslator.from({
|
|
|
26894
26894
|
return Object.keys(decodedAttrs).length > 0 ? { attributes: decodedAttrs } : void 0;
|
|
26895
26895
|
}
|
|
26896
26896
|
});
|
|
26897
|
-
const translator$
|
|
26898
|
-
const translator$
|
|
26899
|
-
const translator$
|
|
26900
|
-
const translator$
|
|
26901
|
-
const translator$
|
|
26902
|
-
const translator$
|
|
26903
|
-
const translator$
|
|
26904
|
-
const translator$
|
|
26905
|
-
const translator$
|
|
26906
|
-
const translator$
|
|
26907
|
-
const translator$
|
|
26908
|
-
const translator$
|
|
26909
|
-
const translator$
|
|
26910
|
-
const translator$
|
|
26911
|
-
const XML_NODE_NAME$
|
|
26897
|
+
const translator$s = NodeTranslator.from(createBorderPropertyHandler("w:bottom"));
|
|
26898
|
+
const translator$r = NodeTranslator.from(createMeasurementPropertyHandler("w:bottom", "marginBottom"));
|
|
26899
|
+
const translator$q = NodeTranslator.from(createBorderPropertyHandler("w:end"));
|
|
26900
|
+
const translator$p = NodeTranslator.from(createMeasurementPropertyHandler("w:end", "marginEnd"));
|
|
26901
|
+
const translator$o = NodeTranslator.from(createBorderPropertyHandler("w:insideH"));
|
|
26902
|
+
const translator$n = NodeTranslator.from(createBorderPropertyHandler("w:insideV"));
|
|
26903
|
+
const translator$m = NodeTranslator.from(createBorderPropertyHandler("w:left"));
|
|
26904
|
+
const translator$l = NodeTranslator.from(createMeasurementPropertyHandler("w:left", "marginLeft"));
|
|
26905
|
+
const translator$k = NodeTranslator.from(createBorderPropertyHandler("w:right"));
|
|
26906
|
+
const translator$j = NodeTranslator.from(createMeasurementPropertyHandler("w:right", "marginRight"));
|
|
26907
|
+
const translator$i = NodeTranslator.from(createBorderPropertyHandler("w:start"));
|
|
26908
|
+
const translator$h = NodeTranslator.from(createMeasurementPropertyHandler("w:start", "marginStart"));
|
|
26909
|
+
const translator$g = NodeTranslator.from(createBorderPropertyHandler("w:top"));
|
|
26910
|
+
const translator$f = NodeTranslator.from(createMeasurementPropertyHandler("w:top", "marginTop"));
|
|
26911
|
+
const XML_NODE_NAME$d = "w:tblBorders";
|
|
26912
26912
|
const SD_ATTR_KEY$3 = "borders";
|
|
26913
|
-
const encode$
|
|
26913
|
+
const encode$k = (params2) => {
|
|
26914
26914
|
const { nodes } = params2;
|
|
26915
26915
|
const node = nodes[0];
|
|
26916
26916
|
const attributes = encodeProperties(node, tblBordersTranslatorsByXmlName);
|
|
26917
26917
|
return Object.keys(attributes).length > 0 ? attributes : void 0;
|
|
26918
26918
|
};
|
|
26919
|
-
const decode$
|
|
26919
|
+
const decode$k = (params2) => {
|
|
26920
26920
|
const { borders = {} } = params2.node.attrs || {};
|
|
26921
26921
|
const elements = decodeProperties(tblBordersTranslatorsBySdName, borders);
|
|
26922
26922
|
const newNode = {
|
|
@@ -26928,14 +26928,14 @@ const decode$j = (params2) => {
|
|
|
26928
26928
|
return newNode;
|
|
26929
26929
|
};
|
|
26930
26930
|
const propertyTranslators$2 = [
|
|
26931
|
-
translator$
|
|
26932
|
-
translator$
|
|
26931
|
+
translator$s,
|
|
26932
|
+
translator$q,
|
|
26933
|
+
translator$o,
|
|
26933
26934
|
translator$n,
|
|
26934
26935
|
translator$m,
|
|
26935
|
-
translator$
|
|
26936
|
-
translator$
|
|
26937
|
-
translator$
|
|
26938
|
-
translator$f
|
|
26936
|
+
translator$k,
|
|
26937
|
+
translator$i,
|
|
26938
|
+
translator$g
|
|
26939
26939
|
];
|
|
26940
26940
|
const tblBordersTranslatorsByXmlName = {};
|
|
26941
26941
|
const tblBordersTranslatorsBySdName = {};
|
|
@@ -26943,27 +26943,27 @@ propertyTranslators$2.forEach((translator2) => {
|
|
|
26943
26943
|
tblBordersTranslatorsByXmlName[translator2.xmlName] = translator2;
|
|
26944
26944
|
tblBordersTranslatorsBySdName[translator2.sdNodeOrKeyName] = translator2;
|
|
26945
26945
|
});
|
|
26946
|
-
const translator$
|
|
26947
|
-
xmlName: XML_NODE_NAME$
|
|
26946
|
+
const translator$e = NodeTranslator.from({
|
|
26947
|
+
xmlName: XML_NODE_NAME$d,
|
|
26948
26948
|
sdNodeOrKeyName: SD_ATTR_KEY$3,
|
|
26949
26949
|
type: NodeTranslator.translatorTypes.NODE,
|
|
26950
26950
|
attributes: [],
|
|
26951
|
-
encode: encode$
|
|
26952
|
-
decode: decode$
|
|
26951
|
+
encode: encode$k,
|
|
26952
|
+
decode: decode$k
|
|
26953
26953
|
});
|
|
26954
|
-
const XML_NODE_NAME$
|
|
26954
|
+
const XML_NODE_NAME$c = "w:tblCellMar";
|
|
26955
26955
|
const SD_ATTR_KEY$2 = "cellMargins";
|
|
26956
|
-
const encode$
|
|
26956
|
+
const encode$j = (params2) => {
|
|
26957
26957
|
const { nodes } = params2;
|
|
26958
26958
|
const node = nodes[0];
|
|
26959
26959
|
const attributes = encodeProperties(node, propertyTranslatorsByXmlName$1);
|
|
26960
26960
|
return Object.keys(attributes).length > 0 ? attributes : void 0;
|
|
26961
26961
|
};
|
|
26962
|
-
const decode$
|
|
26962
|
+
const decode$j = (params2) => {
|
|
26963
26963
|
const { cellMargins = {} } = params2.node.attrs || {};
|
|
26964
26964
|
const elements = decodeProperties(propertyTranslatorsBySdName$1, cellMargins);
|
|
26965
26965
|
const newNode = {
|
|
26966
|
-
name: XML_NODE_NAME$
|
|
26966
|
+
name: XML_NODE_NAME$c,
|
|
26967
26967
|
type: "element",
|
|
26968
26968
|
attributes: {},
|
|
26969
26969
|
elements
|
|
@@ -26971,12 +26971,12 @@ const decode$i = (params2) => {
|
|
|
26971
26971
|
return newNode;
|
|
26972
26972
|
};
|
|
26973
26973
|
const propertyTranslators$1 = [
|
|
26974
|
-
translator$
|
|
26975
|
-
translator$
|
|
26976
|
-
translator$
|
|
26977
|
-
translator$
|
|
26978
|
-
translator$
|
|
26979
|
-
translator$
|
|
26974
|
+
translator$r,
|
|
26975
|
+
translator$p,
|
|
26976
|
+
translator$l,
|
|
26977
|
+
translator$j,
|
|
26978
|
+
translator$h,
|
|
26979
|
+
translator$f
|
|
26980
26980
|
];
|
|
26981
26981
|
const propertyTranslatorsByXmlName$1 = {};
|
|
26982
26982
|
const propertyTranslatorsBySdName$1 = {};
|
|
@@ -26984,27 +26984,27 @@ propertyTranslators$1.forEach((translator2) => {
|
|
|
26984
26984
|
propertyTranslatorsByXmlName$1[translator2.xmlName] = translator2;
|
|
26985
26985
|
propertyTranslatorsBySdName$1[translator2.sdNodeOrKeyName] = translator2;
|
|
26986
26986
|
});
|
|
26987
|
-
const translator$
|
|
26988
|
-
xmlName: XML_NODE_NAME$
|
|
26987
|
+
const translator$d = NodeTranslator.from({
|
|
26988
|
+
xmlName: XML_NODE_NAME$c,
|
|
26989
26989
|
sdNodeOrKeyName: SD_ATTR_KEY$2,
|
|
26990
26990
|
type: NodeTranslator.translatorTypes.NODE,
|
|
26991
26991
|
attributes: [],
|
|
26992
|
-
encode: encode$
|
|
26993
|
-
decode: decode$
|
|
26992
|
+
encode: encode$j,
|
|
26993
|
+
decode: decode$j
|
|
26994
26994
|
});
|
|
26995
|
-
const XML_NODE_NAME$
|
|
26995
|
+
const XML_NODE_NAME$b = "w:tblPr";
|
|
26996
26996
|
const SD_ATTR_KEY$1 = "tableProperties";
|
|
26997
|
-
const encode$
|
|
26997
|
+
const encode$i = (params2) => {
|
|
26998
26998
|
const { nodes } = params2;
|
|
26999
26999
|
const node = nodes[0];
|
|
27000
27000
|
const attributes = encodeProperties(node, propertyTranslatorsByXmlName);
|
|
27001
27001
|
return {
|
|
27002
|
-
xmlName: XML_NODE_NAME$
|
|
27002
|
+
xmlName: XML_NODE_NAME$b,
|
|
27003
27003
|
sdNodeOrKeyName: SD_ATTR_KEY$1,
|
|
27004
27004
|
attributes
|
|
27005
27005
|
};
|
|
27006
27006
|
};
|
|
27007
|
-
const decode$
|
|
27007
|
+
const decode$i = (params2) => {
|
|
27008
27008
|
const { tableProperties = {} } = params2.node.attrs || {};
|
|
27009
27009
|
const elements = decodeProperties(propertyTranslatorsBySdName, tableProperties);
|
|
27010
27010
|
const newNode = {
|
|
@@ -27016,11 +27016,12 @@ const decode$h = (params2) => {
|
|
|
27016
27016
|
return newNode;
|
|
27017
27017
|
};
|
|
27018
27018
|
const propertyTranslators = [
|
|
27019
|
+
translator$F,
|
|
27020
|
+
translator$N,
|
|
27019
27021
|
translator$E,
|
|
27020
|
-
translator$M,
|
|
27021
27022
|
translator$D,
|
|
27023
|
+
translator$M,
|
|
27022
27024
|
translator$C,
|
|
27023
|
-
translator$L,
|
|
27024
27025
|
translator$B,
|
|
27025
27026
|
translator$A,
|
|
27026
27027
|
translator$z,
|
|
@@ -27030,9 +27031,8 @@ const propertyTranslators = [
|
|
|
27030
27031
|
translator$v,
|
|
27031
27032
|
translator$u,
|
|
27032
27033
|
translator$t,
|
|
27033
|
-
translator$
|
|
27034
|
-
translator$d
|
|
27035
|
-
translator$c
|
|
27034
|
+
translator$e,
|
|
27035
|
+
translator$d
|
|
27036
27036
|
];
|
|
27037
27037
|
const propertyTranslatorsByXmlName = {};
|
|
27038
27038
|
const propertyTranslatorsBySdName = {};
|
|
@@ -27040,14 +27040,14 @@ propertyTranslators.forEach((translator2) => {
|
|
|
27040
27040
|
propertyTranslatorsByXmlName[translator2.xmlName] = translator2;
|
|
27041
27041
|
propertyTranslatorsBySdName[translator2.sdNodeOrKeyName] = translator2;
|
|
27042
27042
|
});
|
|
27043
|
-
const config$
|
|
27044
|
-
xmlName: XML_NODE_NAME$
|
|
27043
|
+
const config$b = {
|
|
27044
|
+
xmlName: XML_NODE_NAME$b,
|
|
27045
27045
|
sdNodeOrKeyName: SD_ATTR_KEY$1,
|
|
27046
|
-
encode: encode$
|
|
27047
|
-
decode: decode$
|
|
27046
|
+
encode: encode$i,
|
|
27047
|
+
decode: decode$i
|
|
27048
27048
|
};
|
|
27049
|
-
const translator$
|
|
27050
|
-
const translator$
|
|
27049
|
+
const translator$c = NodeTranslator.from(config$b);
|
|
27050
|
+
const translator$b = NodeTranslator.from(
|
|
27051
27051
|
createSingleAttrPropertyHandler("w:gridCol", "col", "w:w", parseInteger, integerToString)
|
|
27052
27052
|
);
|
|
27053
27053
|
const DEFAULT_COLUMN_WIDTH_PX = 100;
|
|
@@ -27097,20 +27097,20 @@ const resolveFallbackColumnWidthTwips = (params2, totalColumns, cellMinWidthTwip
|
|
|
27097
27097
|
}
|
|
27098
27098
|
return Math.max(fallbackWidthTwips, cellMinWidthTwips);
|
|
27099
27099
|
};
|
|
27100
|
-
const XML_NODE_NAME$
|
|
27100
|
+
const XML_NODE_NAME$a = "w:tblGrid";
|
|
27101
27101
|
const SD_ATTR_KEY = "grid";
|
|
27102
27102
|
const cellMinWidth = pixelsToTwips(10);
|
|
27103
|
-
const encode$
|
|
27103
|
+
const encode$h = (params2) => {
|
|
27104
27104
|
const { nodes } = params2;
|
|
27105
27105
|
const node = nodes[0];
|
|
27106
|
-
const attributes = encodeProperties(node, { [translator$
|
|
27106
|
+
const attributes = encodeProperties(node, { [translator$b.xmlName]: translator$b }, true);
|
|
27107
27107
|
return {
|
|
27108
|
-
xmlName: XML_NODE_NAME$
|
|
27108
|
+
xmlName: XML_NODE_NAME$a,
|
|
27109
27109
|
sdNodeOrKeyName: SD_ATTR_KEY,
|
|
27110
27110
|
attributes
|
|
27111
27111
|
};
|
|
27112
27112
|
};
|
|
27113
|
-
const decode$
|
|
27113
|
+
const decode$h = (params2) => {
|
|
27114
27114
|
const { grid: rawGrid } = params2.node.attrs || {};
|
|
27115
27115
|
const grid = Array.isArray(rawGrid) ? rawGrid : [];
|
|
27116
27116
|
const { firstRow = {} } = params2.extraParams || {};
|
|
@@ -27129,10 +27129,10 @@ const decode$g = (params2) => {
|
|
|
27129
27129
|
numericWidth = fallbackColumnWidthTwips;
|
|
27130
27130
|
}
|
|
27131
27131
|
numericWidth = Math.max(numericWidth, cellMinWidth);
|
|
27132
|
-
const decoded = translator$
|
|
27132
|
+
const decoded = translator$b.decode({
|
|
27133
27133
|
node: { type: (
|
|
27134
27134
|
/** @type {string} */
|
|
27135
|
-
translator$
|
|
27135
|
+
translator$b.sdNodeOrKeyName
|
|
27136
27136
|
), attrs: { col: numericWidth } }
|
|
27137
27137
|
});
|
|
27138
27138
|
if (decoded) elements.push(decoded);
|
|
@@ -27167,32 +27167,32 @@ const decode$g = (params2) => {
|
|
|
27167
27167
|
columnIndex++;
|
|
27168
27168
|
}
|
|
27169
27169
|
const newNode = {
|
|
27170
|
-
name: XML_NODE_NAME$
|
|
27170
|
+
name: XML_NODE_NAME$a,
|
|
27171
27171
|
attributes: {},
|
|
27172
27172
|
elements
|
|
27173
27173
|
};
|
|
27174
27174
|
return newNode;
|
|
27175
27175
|
};
|
|
27176
|
-
const config$
|
|
27177
|
-
xmlName: XML_NODE_NAME$
|
|
27176
|
+
const config$a = {
|
|
27177
|
+
xmlName: XML_NODE_NAME$a,
|
|
27178
27178
|
sdNodeOrKeyName: SD_ATTR_KEY,
|
|
27179
|
-
encode: encode$
|
|
27180
|
-
decode: decode$
|
|
27179
|
+
encode: encode$h,
|
|
27180
|
+
decode: decode$h
|
|
27181
27181
|
};
|
|
27182
|
-
const translator$
|
|
27183
|
-
const XML_NODE_NAME$
|
|
27184
|
-
const SD_NODE_NAME$
|
|
27185
|
-
const encode$
|
|
27182
|
+
const translator$a = NodeTranslator.from(config$a);
|
|
27183
|
+
const XML_NODE_NAME$9 = "w:tbl";
|
|
27184
|
+
const SD_NODE_NAME$9 = "table";
|
|
27185
|
+
const encode$g = (params2, encodedAttrs) => {
|
|
27186
27186
|
const { nodes } = params2;
|
|
27187
27187
|
const node = nodes[0];
|
|
27188
27188
|
const tblPr = node.elements.find((el) => el.name === "w:tblPr");
|
|
27189
27189
|
if (tblPr) {
|
|
27190
|
-
const encodedProperties = translator$
|
|
27190
|
+
const encodedProperties = translator$c.encode({ ...params2, nodes: [tblPr] });
|
|
27191
27191
|
encodedAttrs["tableProperties"] = encodedProperties?.attributes || {};
|
|
27192
27192
|
}
|
|
27193
27193
|
const tblGrid = node.elements.find((el) => el.name === "w:tblGrid");
|
|
27194
27194
|
if (tblGrid) {
|
|
27195
|
-
encodedAttrs["grid"] = translator$
|
|
27195
|
+
encodedAttrs["grid"] = translator$a.encode({ ...params2, nodes: [tblGrid] }).attributes;
|
|
27196
27196
|
}
|
|
27197
27197
|
[
|
|
27198
27198
|
"tableStyleId",
|
|
@@ -27233,7 +27233,7 @@ const encode$f = (params2, encodedAttrs) => {
|
|
|
27233
27233
|
const columnWidths = (encodedAttrs["grid"] ?? []).map((item) => twipsToPixels(item.col));
|
|
27234
27234
|
const content = [];
|
|
27235
27235
|
rows.forEach((row) => {
|
|
27236
|
-
const result = translator$
|
|
27236
|
+
const result = translator$G.encode({
|
|
27237
27237
|
...params2,
|
|
27238
27238
|
nodes: [row],
|
|
27239
27239
|
extraParams: {
|
|
@@ -27252,13 +27252,13 @@ const encode$f = (params2, encodedAttrs) => {
|
|
|
27252
27252
|
attrs: encodedAttrs
|
|
27253
27253
|
};
|
|
27254
27254
|
};
|
|
27255
|
-
const decode$
|
|
27255
|
+
const decode$g = (params2, decodedAttrs) => {
|
|
27256
27256
|
params2.node = preProcessVerticalMergeCells(params2.node, params2);
|
|
27257
27257
|
const { node } = params2;
|
|
27258
27258
|
const elements = translateChildNodes(params2);
|
|
27259
27259
|
const firstRow = node.content?.find((n) => n.type === "tableRow");
|
|
27260
27260
|
const properties = node.attrs.grid;
|
|
27261
|
-
const element = translator$
|
|
27261
|
+
const element = translator$a.decode({
|
|
27262
27262
|
...params2,
|
|
27263
27263
|
node: { ...node, attrs: { ...node.attrs, grid: properties } },
|
|
27264
27264
|
extraParams: {
|
|
@@ -27268,7 +27268,7 @@ const decode$f = (params2, decodedAttrs) => {
|
|
|
27268
27268
|
if (element) elements.unshift(element);
|
|
27269
27269
|
if (node.attrs?.tableProperties) {
|
|
27270
27270
|
const properties2 = { ...node.attrs.tableProperties };
|
|
27271
|
-
const element2 = translator$
|
|
27271
|
+
const element2 = translator$c.decode({
|
|
27272
27272
|
...params2,
|
|
27273
27273
|
node: { ...node, attrs: { ...node.attrs, tableProperties: properties2 } }
|
|
27274
27274
|
});
|
|
@@ -27334,7 +27334,7 @@ function _getReferencedTableStyles(tableStyleReference, params2) {
|
|
|
27334
27334
|
if (baseTblPr && baseTblPr.elements) {
|
|
27335
27335
|
tblPr.elements.push(...baseTblPr.elements);
|
|
27336
27336
|
}
|
|
27337
|
-
const tableProperties = translator$
|
|
27337
|
+
const tableProperties = translator$c.encode({ ...params2, nodes: [tblPr] }).attributes;
|
|
27338
27338
|
const { borders, rowBorders } = _processTableBorders(tableProperties.borders || {});
|
|
27339
27339
|
if (borders) stylesToReturn.borders = borders;
|
|
27340
27340
|
if (rowBorders) stylesToReturn.rowBorders = rowBorders;
|
|
@@ -27351,16 +27351,16 @@ function _getReferencedTableStyles(tableStyleReference, params2) {
|
|
|
27351
27351
|
}
|
|
27352
27352
|
return stylesToReturn;
|
|
27353
27353
|
}
|
|
27354
|
-
const config$
|
|
27355
|
-
xmlName: XML_NODE_NAME$
|
|
27356
|
-
sdNodeOrKeyName: SD_NODE_NAME$
|
|
27354
|
+
const config$9 = {
|
|
27355
|
+
xmlName: XML_NODE_NAME$9,
|
|
27356
|
+
sdNodeOrKeyName: SD_NODE_NAME$9,
|
|
27357
27357
|
type: NodeTranslator.translatorTypes.NODE,
|
|
27358
|
-
encode: encode$
|
|
27359
|
-
decode: decode$
|
|
27358
|
+
encode: encode$g,
|
|
27359
|
+
decode: decode$g,
|
|
27360
27360
|
attributes: []
|
|
27361
27361
|
};
|
|
27362
|
-
const translator$
|
|
27363
|
-
const tableNodeHandlerEntity = generateV2HandlerEntity("tableNodeHandler", translator$
|
|
27362
|
+
const translator$9 = NodeTranslator.from(config$9);
|
|
27363
|
+
const tableNodeHandlerEntity = generateV2HandlerEntity("tableNodeHandler", translator$9);
|
|
27364
27364
|
function getReferencedTableStyles(tblStyleTag, docx) {
|
|
27365
27365
|
if (!tblStyleTag) return null;
|
|
27366
27366
|
const stylesToReturn = {};
|
|
@@ -27722,10 +27722,10 @@ function generateCellMargins(cellMargins) {
|
|
|
27722
27722
|
if (left2 != null) elements.push({ name: "w:left", attributes: { "w:w": pixelsToTwips(left2) } });
|
|
27723
27723
|
return elements;
|
|
27724
27724
|
}
|
|
27725
|
-
const XML_NODE_NAME$
|
|
27726
|
-
const SD_NODE_NAME$
|
|
27727
|
-
const validXmlAttributes$
|
|
27728
|
-
function encode$
|
|
27725
|
+
const XML_NODE_NAME$8 = "w:tc";
|
|
27726
|
+
const SD_NODE_NAME$8 = "tableCell";
|
|
27727
|
+
const validXmlAttributes$8 = [];
|
|
27728
|
+
function encode$f(params2, encodedAttrs) {
|
|
27729
27729
|
const {
|
|
27730
27730
|
node,
|
|
27731
27731
|
table,
|
|
@@ -27752,31 +27752,31 @@ function encode$e(params2, encodedAttrs) {
|
|
|
27752
27752
|
}
|
|
27753
27753
|
return schemaNode;
|
|
27754
27754
|
}
|
|
27755
|
-
function decode$
|
|
27755
|
+
function decode$f(params2, decodedAttrs) {
|
|
27756
27756
|
const translated = translateTableCell(params2);
|
|
27757
27757
|
if (decodedAttrs && Object.keys(decodedAttrs).length) {
|
|
27758
27758
|
translated.attributes = { ...translated.attributes || {}, ...decodedAttrs };
|
|
27759
27759
|
}
|
|
27760
27760
|
return translated;
|
|
27761
27761
|
}
|
|
27762
|
-
const config$
|
|
27763
|
-
xmlName: XML_NODE_NAME$
|
|
27764
|
-
sdNodeOrKeyName: SD_NODE_NAME$
|
|
27762
|
+
const config$8 = {
|
|
27763
|
+
xmlName: XML_NODE_NAME$8,
|
|
27764
|
+
sdNodeOrKeyName: SD_NODE_NAME$8,
|
|
27765
27765
|
type: NodeTranslator.translatorTypes.NODE,
|
|
27766
|
-
encode: encode$
|
|
27767
|
-
decode: decode$
|
|
27768
|
-
attributes: validXmlAttributes$
|
|
27766
|
+
encode: encode$f,
|
|
27767
|
+
decode: decode$f,
|
|
27768
|
+
attributes: validXmlAttributes$8
|
|
27769
27769
|
};
|
|
27770
|
-
const translator$
|
|
27771
|
-
const XML_NODE_NAME$
|
|
27772
|
-
const SD_NODE_NAME$
|
|
27770
|
+
const translator$8 = NodeTranslator.from(config$8);
|
|
27771
|
+
const XML_NODE_NAME$7 = "w:hyperlink";
|
|
27772
|
+
const SD_NODE_NAME$7 = "link";
|
|
27773
27773
|
const _createAttributeHandler = (xmlName, sdName) => ({
|
|
27774
27774
|
xmlName,
|
|
27775
27775
|
sdName,
|
|
27776
27776
|
encode: (attributes) => attributes[xmlName],
|
|
27777
27777
|
decode: (attributes) => attributes[sdName]
|
|
27778
27778
|
});
|
|
27779
|
-
const validXmlAttributes$
|
|
27779
|
+
const validXmlAttributes$7 = [
|
|
27780
27780
|
_createAttributeHandler("w:anchor", "anchor"),
|
|
27781
27781
|
_createAttributeHandler("w:docLocation", "docLocation"),
|
|
27782
27782
|
{
|
|
@@ -27789,7 +27789,7 @@ const validXmlAttributes$6 = [
|
|
|
27789
27789
|
_createAttributeHandler("r:id", "rId"),
|
|
27790
27790
|
_createAttributeHandler("w:tgtFrame", "target")
|
|
27791
27791
|
];
|
|
27792
|
-
const encode$
|
|
27792
|
+
const encode$e = (params2, encodedAttrs) => {
|
|
27793
27793
|
const { nodes, docx, nodeListHandler } = params2;
|
|
27794
27794
|
const node = nodes[0];
|
|
27795
27795
|
let href = _resolveHref(docx, encodedAttrs);
|
|
@@ -27855,7 +27855,7 @@ const _resolveHref = (docx, encodedAttrs) => {
|
|
|
27855
27855
|
}
|
|
27856
27856
|
return href;
|
|
27857
27857
|
};
|
|
27858
|
-
function decode$
|
|
27858
|
+
function decode$e(params2) {
|
|
27859
27859
|
const { node } = params2;
|
|
27860
27860
|
const linkMark = node.marks.find((m2) => m2.type === "link");
|
|
27861
27861
|
const linkAttrs = this.decodeAttributes({ ...params2, node: linkMark });
|
|
@@ -27899,15 +27899,15 @@ function _addNewLinkRelationship(params2, link, rId) {
|
|
|
27899
27899
|
});
|
|
27900
27900
|
return rId;
|
|
27901
27901
|
}
|
|
27902
|
-
const config$
|
|
27903
|
-
xmlName: XML_NODE_NAME$
|
|
27904
|
-
sdNodeOrKeyName: SD_NODE_NAME$
|
|
27902
|
+
const config$7 = {
|
|
27903
|
+
xmlName: XML_NODE_NAME$7,
|
|
27904
|
+
sdNodeOrKeyName: SD_NODE_NAME$7,
|
|
27905
27905
|
type: NodeTranslator.translatorTypes.NODE,
|
|
27906
|
-
encode: encode$
|
|
27907
|
-
decode: decode$
|
|
27908
|
-
attributes: validXmlAttributes$
|
|
27906
|
+
encode: encode$e,
|
|
27907
|
+
decode: decode$e,
|
|
27908
|
+
attributes: validXmlAttributes$7
|
|
27909
27909
|
};
|
|
27910
|
-
const translator$
|
|
27910
|
+
const translator$7 = NodeTranslator.from(config$7);
|
|
27911
27911
|
function parseTagValueJSON(json) {
|
|
27912
27912
|
if (typeof json !== "string") {
|
|
27913
27913
|
return {};
|
|
@@ -28702,32 +28702,32 @@ function translateAnchorNode(params2) {
|
|
|
28702
28702
|
elements: [...anchorElements, ...elementsWithWrap]
|
|
28703
28703
|
};
|
|
28704
28704
|
}
|
|
28705
|
-
const XML_NODE_NAME$
|
|
28706
|
-
const SD_NODE_NAME$
|
|
28707
|
-
const validXmlAttributes$
|
|
28708
|
-
function encode$
|
|
28705
|
+
const XML_NODE_NAME$6 = "wp:anchor";
|
|
28706
|
+
const SD_NODE_NAME$6 = ["image"];
|
|
28707
|
+
const validXmlAttributes$6 = ["distT", "distB", "distL", "distR"].map((xmlName) => createAttributeHandler(xmlName));
|
|
28708
|
+
function encode$d(params2) {
|
|
28709
28709
|
const { node } = params2.extraParams;
|
|
28710
28710
|
if (!node || !node.type) {
|
|
28711
28711
|
return null;
|
|
28712
28712
|
}
|
|
28713
28713
|
return handleAnchorNode(params2);
|
|
28714
28714
|
}
|
|
28715
|
-
function decode$
|
|
28715
|
+
function decode$d(params2) {
|
|
28716
28716
|
const { node } = params2;
|
|
28717
28717
|
if (!node || !node.type) {
|
|
28718
28718
|
return null;
|
|
28719
28719
|
}
|
|
28720
28720
|
return translateAnchorNode(params2);
|
|
28721
28721
|
}
|
|
28722
|
-
const config$
|
|
28723
|
-
xmlName: XML_NODE_NAME$
|
|
28724
|
-
sdNodeOrKeyName: SD_NODE_NAME$
|
|
28722
|
+
const config$6 = {
|
|
28723
|
+
xmlName: XML_NODE_NAME$6,
|
|
28724
|
+
sdNodeOrKeyName: SD_NODE_NAME$6,
|
|
28725
28725
|
type: NodeTranslator.translatorTypes.NODE,
|
|
28726
|
-
encode: encode$
|
|
28727
|
-
decode: decode$
|
|
28728
|
-
attributes: validXmlAttributes$
|
|
28726
|
+
encode: encode$d,
|
|
28727
|
+
decode: decode$d,
|
|
28728
|
+
attributes: validXmlAttributes$6
|
|
28729
28729
|
};
|
|
28730
|
-
const translator$
|
|
28730
|
+
const translator$6 = NodeTranslator.from(config$6);
|
|
28731
28731
|
function handleInlineNode(params2) {
|
|
28732
28732
|
const { node } = params2.extraParams;
|
|
28733
28733
|
if (node.name !== "wp:inline") {
|
|
@@ -28743,41 +28743,41 @@ function translateInlineNode(params2) {
|
|
|
28743
28743
|
elements: nodeElements.elements
|
|
28744
28744
|
};
|
|
28745
28745
|
}
|
|
28746
|
-
const XML_NODE_NAME$
|
|
28747
|
-
const SD_NODE_NAME$
|
|
28748
|
-
const validXmlAttributes$
|
|
28749
|
-
function encode$
|
|
28746
|
+
const XML_NODE_NAME$5 = "wp:inline";
|
|
28747
|
+
const SD_NODE_NAME$5 = ["image"];
|
|
28748
|
+
const validXmlAttributes$5 = ["distT", "distB", "distL", "distR"].map((xmlName) => createAttributeHandler(xmlName));
|
|
28749
|
+
function encode$c(params2) {
|
|
28750
28750
|
const { node } = params2.extraParams;
|
|
28751
28751
|
if (!node || !node.type) {
|
|
28752
28752
|
return null;
|
|
28753
28753
|
}
|
|
28754
28754
|
return handleInlineNode(params2);
|
|
28755
28755
|
}
|
|
28756
|
-
function decode$
|
|
28756
|
+
function decode$c(params2) {
|
|
28757
28757
|
const { node } = params2;
|
|
28758
28758
|
if (!node || !node.type) {
|
|
28759
28759
|
return null;
|
|
28760
28760
|
}
|
|
28761
28761
|
return translateInlineNode(params2);
|
|
28762
28762
|
}
|
|
28763
|
-
const config$
|
|
28764
|
-
xmlName: XML_NODE_NAME$
|
|
28765
|
-
sdNodeOrKeyName: SD_NODE_NAME$
|
|
28763
|
+
const config$5 = {
|
|
28764
|
+
xmlName: XML_NODE_NAME$5,
|
|
28765
|
+
sdNodeOrKeyName: SD_NODE_NAME$5,
|
|
28766
28766
|
type: NodeTranslator.translatorTypes.NODE,
|
|
28767
|
-
encode: encode$
|
|
28768
|
-
decode: decode$
|
|
28769
|
-
attributes: validXmlAttributes$
|
|
28767
|
+
encode: encode$c,
|
|
28768
|
+
decode: decode$c,
|
|
28769
|
+
attributes: validXmlAttributes$5
|
|
28770
28770
|
};
|
|
28771
|
-
const translator$
|
|
28772
|
-
const XML_NODE_NAME$
|
|
28773
|
-
const SD_NODE_NAME$
|
|
28774
|
-
const validXmlAttributes$
|
|
28775
|
-
function encode$
|
|
28771
|
+
const translator$5 = NodeTranslator.from(config$5);
|
|
28772
|
+
const XML_NODE_NAME$4 = "w:drawing";
|
|
28773
|
+
const SD_NODE_NAME$4 = [];
|
|
28774
|
+
const validXmlAttributes$4 = [];
|
|
28775
|
+
function encode$b(params2) {
|
|
28776
28776
|
const nodes = params2.nodes;
|
|
28777
28777
|
const node = nodes[0];
|
|
28778
28778
|
const translatorByChildName = {
|
|
28779
|
-
"wp:anchor": translator$
|
|
28780
|
-
"wp:inline": translator$
|
|
28779
|
+
"wp:anchor": translator$6,
|
|
28780
|
+
"wp:inline": translator$5
|
|
28781
28781
|
};
|
|
28782
28782
|
return node.elements.reduce((acc, child) => {
|
|
28783
28783
|
if (acc) return acc;
|
|
@@ -28786,12 +28786,12 @@ function encode$a(params2) {
|
|
|
28786
28786
|
return translator2.encode({ ...params2, extraParams: { node: child } }) || acc;
|
|
28787
28787
|
}, null);
|
|
28788
28788
|
}
|
|
28789
|
-
function decode$
|
|
28789
|
+
function decode$b(params2) {
|
|
28790
28790
|
const { node } = params2;
|
|
28791
28791
|
if (!node || !node.type) {
|
|
28792
28792
|
return null;
|
|
28793
28793
|
}
|
|
28794
|
-
const childTranslator = node.attrs.isAnchor ? translator$
|
|
28794
|
+
const childTranslator = node.attrs.isAnchor ? translator$6 : translator$5;
|
|
28795
28795
|
const resultNode = childTranslator.decode(params2);
|
|
28796
28796
|
return wrapTextInRun(
|
|
28797
28797
|
{
|
|
@@ -28801,15 +28801,15 @@ function decode$a(params2) {
|
|
|
28801
28801
|
[]
|
|
28802
28802
|
);
|
|
28803
28803
|
}
|
|
28804
|
-
const config$
|
|
28805
|
-
xmlName: XML_NODE_NAME$
|
|
28806
|
-
sdNodeOrKeyName: SD_NODE_NAME$
|
|
28804
|
+
const config$4 = {
|
|
28805
|
+
xmlName: XML_NODE_NAME$4,
|
|
28806
|
+
sdNodeOrKeyName: SD_NODE_NAME$4,
|
|
28807
28807
|
type: NodeTranslator.translatorTypes.NODE,
|
|
28808
|
-
encode: encode$
|
|
28809
|
-
decode: decode$
|
|
28810
|
-
attributes: validXmlAttributes$
|
|
28808
|
+
encode: encode$b,
|
|
28809
|
+
decode: decode$b,
|
|
28810
|
+
attributes: validXmlAttributes$4
|
|
28811
28811
|
};
|
|
28812
|
-
const translator$
|
|
28812
|
+
const translator$4 = NodeTranslator.from(config$4);
|
|
28813
28813
|
class CommandService {
|
|
28814
28814
|
/**
|
|
28815
28815
|
* @param {import('./commands/types/index.js').CommandServiceOptions} props
|
|
@@ -30147,7 +30147,7 @@ function prepareTextAnnotation(params2) {
|
|
|
30147
30147
|
return getTextNodeForExport(attrs.displayLabel, [...marks, ...marksFromAttrs], params2);
|
|
30148
30148
|
}
|
|
30149
30149
|
function prepareImageAnnotation(params2, imageSize) {
|
|
30150
|
-
return translator$
|
|
30150
|
+
return translator$4.decode({
|
|
30151
30151
|
...params2,
|
|
30152
30152
|
imageSize
|
|
30153
30153
|
});
|
|
@@ -30384,10 +30384,10 @@ function translateStructuredContent(params2) {
|
|
|
30384
30384
|
};
|
|
30385
30385
|
return result;
|
|
30386
30386
|
}
|
|
30387
|
-
const XML_NODE_NAME$
|
|
30388
|
-
const SD_NODE_NAME$
|
|
30389
|
-
const validXmlAttributes$
|
|
30390
|
-
function encode$
|
|
30387
|
+
const XML_NODE_NAME$3 = "w:sdt";
|
|
30388
|
+
const SD_NODE_NAME$3 = ["fieldAnnotation", "structuredContent", "structuredContentBlock", "documentSection"];
|
|
30389
|
+
const validXmlAttributes$3 = [];
|
|
30390
|
+
function encode$a(params2) {
|
|
30391
30391
|
const nodes = params2.nodes;
|
|
30392
30392
|
const node = nodes[0];
|
|
30393
30393
|
const { type: sdtType, handler: handler2 } = sdtNodeTypeStrategy(node);
|
|
@@ -30397,7 +30397,7 @@ function encode$9(params2) {
|
|
|
30397
30397
|
const result = handler2(params2);
|
|
30398
30398
|
return result;
|
|
30399
30399
|
}
|
|
30400
|
-
function decode$
|
|
30400
|
+
function decode$a(params2) {
|
|
30401
30401
|
const { node } = params2;
|
|
30402
30402
|
if (!node || !node.type) {
|
|
30403
30403
|
return null;
|
|
@@ -30413,85 +30413,85 @@ function decode$9(params2) {
|
|
|
30413
30413
|
const result = decoder();
|
|
30414
30414
|
return result;
|
|
30415
30415
|
}
|
|
30416
|
-
const config$
|
|
30417
|
-
xmlName: XML_NODE_NAME$
|
|
30418
|
-
sdNodeOrKeyName: SD_NODE_NAME$
|
|
30416
|
+
const config$3 = {
|
|
30417
|
+
xmlName: XML_NODE_NAME$3,
|
|
30418
|
+
sdNodeOrKeyName: SD_NODE_NAME$3,
|
|
30419
30419
|
type: NodeTranslator.translatorTypes.NODE,
|
|
30420
|
-
encode: encode$
|
|
30421
|
-
decode: decode$
|
|
30422
|
-
attributes: validXmlAttributes$
|
|
30420
|
+
encode: encode$a,
|
|
30421
|
+
decode: decode$a,
|
|
30422
|
+
attributes: validXmlAttributes$3
|
|
30423
30423
|
};
|
|
30424
|
-
const translator$
|
|
30425
|
-
const encode$
|
|
30424
|
+
const translator$3 = NodeTranslator.from(config$3);
|
|
30425
|
+
const encode$9 = (attributes) => {
|
|
30426
30426
|
return attributes["w:id"];
|
|
30427
30427
|
};
|
|
30428
|
-
const decode$
|
|
30428
|
+
const decode$9 = (attrs) => {
|
|
30429
30429
|
return attrs.id;
|
|
30430
30430
|
};
|
|
30431
30431
|
const attrConfig$6 = Object.freeze({
|
|
30432
30432
|
xmlName: "w:id",
|
|
30433
30433
|
sdName: "id",
|
|
30434
|
-
encode: encode$
|
|
30435
|
-
decode: decode$
|
|
30434
|
+
encode: encode$9,
|
|
30435
|
+
decode: decode$9
|
|
30436
30436
|
});
|
|
30437
|
-
const encode$
|
|
30437
|
+
const encode$8 = (attributes) => {
|
|
30438
30438
|
return attributes["w:name"];
|
|
30439
30439
|
};
|
|
30440
|
-
const decode$
|
|
30440
|
+
const decode$8 = (attrs) => {
|
|
30441
30441
|
return attrs.name;
|
|
30442
30442
|
};
|
|
30443
30443
|
const attrConfig$5 = Object.freeze({
|
|
30444
30444
|
xmlName: "w:name",
|
|
30445
30445
|
sdName: "name",
|
|
30446
|
-
encode: encode$
|
|
30447
|
-
decode: decode$
|
|
30446
|
+
encode: encode$8,
|
|
30447
|
+
decode: decode$8
|
|
30448
30448
|
});
|
|
30449
|
-
const encode$
|
|
30449
|
+
const encode$7 = (attributes) => {
|
|
30450
30450
|
return attributes["w:colFirst"];
|
|
30451
30451
|
};
|
|
30452
|
-
const decode$
|
|
30452
|
+
const decode$7 = (attrs) => {
|
|
30453
30453
|
return attrs.colFirst;
|
|
30454
30454
|
};
|
|
30455
30455
|
const attrConfig$4 = Object.freeze({
|
|
30456
30456
|
xmlName: "w:colFirst",
|
|
30457
30457
|
sdName: "colFirst",
|
|
30458
|
-
encode: encode$
|
|
30459
|
-
decode: decode$
|
|
30458
|
+
encode: encode$7,
|
|
30459
|
+
decode: decode$7
|
|
30460
30460
|
});
|
|
30461
|
-
const encode$
|
|
30461
|
+
const encode$6 = (attributes) => {
|
|
30462
30462
|
return attributes["w:colLast"];
|
|
30463
30463
|
};
|
|
30464
|
-
const decode$
|
|
30464
|
+
const decode$6 = (attrs) => {
|
|
30465
30465
|
return attrs.colLast;
|
|
30466
30466
|
};
|
|
30467
30467
|
const attrConfig$3 = Object.freeze({
|
|
30468
30468
|
xmlName: "w:colLast",
|
|
30469
30469
|
sdName: "colLast",
|
|
30470
|
-
encode: encode$
|
|
30471
|
-
decode: decode$
|
|
30470
|
+
encode: encode$6,
|
|
30471
|
+
decode: decode$6
|
|
30472
30472
|
});
|
|
30473
|
-
const encode$
|
|
30473
|
+
const encode$5 = (attributes) => {
|
|
30474
30474
|
return attributes["w:displacedByCustomXml"];
|
|
30475
30475
|
};
|
|
30476
|
-
const decode$
|
|
30476
|
+
const decode$5 = (attrs) => {
|
|
30477
30477
|
return attrs.displacedByCustomXml;
|
|
30478
30478
|
};
|
|
30479
30479
|
const attrConfig$2 = Object.freeze({
|
|
30480
30480
|
xmlName: "w:displacedByCustomXml",
|
|
30481
30481
|
sdName: "displacedByCustomXml",
|
|
30482
|
-
encode: encode$
|
|
30483
|
-
decode: decode$
|
|
30482
|
+
encode: encode$5,
|
|
30483
|
+
decode: decode$5
|
|
30484
30484
|
});
|
|
30485
|
-
const validXmlAttributes$
|
|
30486
|
-
const XML_NODE_NAME$
|
|
30487
|
-
const SD_NODE_NAME$
|
|
30488
|
-
const encode$
|
|
30485
|
+
const validXmlAttributes$2 = [attrConfig$6, attrConfig$5, attrConfig$4, attrConfig$3, attrConfig$2];
|
|
30486
|
+
const XML_NODE_NAME$2 = "w:bookmarkStart";
|
|
30487
|
+
const SD_NODE_NAME$2 = "bookmarkStart";
|
|
30488
|
+
const encode$4 = (params2, encodedAttrs = {}) => {
|
|
30489
30489
|
return {
|
|
30490
30490
|
type: "bookmarkStart",
|
|
30491
30491
|
attrs: encodedAttrs
|
|
30492
30492
|
};
|
|
30493
30493
|
};
|
|
30494
|
-
const decode$
|
|
30494
|
+
const decode$4 = (params2, decodedAttrs = {}) => {
|
|
30495
30495
|
const result = {
|
|
30496
30496
|
name: "w:bookmarkStart",
|
|
30497
30497
|
elements: []
|
|
@@ -30501,49 +30501,49 @@ const decode$3 = (params2, decodedAttrs = {}) => {
|
|
|
30501
30501
|
}
|
|
30502
30502
|
return result;
|
|
30503
30503
|
};
|
|
30504
|
-
const config$
|
|
30505
|
-
xmlName: XML_NODE_NAME$
|
|
30506
|
-
sdNodeOrKeyName: SD_NODE_NAME$
|
|
30504
|
+
const config$2 = {
|
|
30505
|
+
xmlName: XML_NODE_NAME$2,
|
|
30506
|
+
sdNodeOrKeyName: SD_NODE_NAME$2,
|
|
30507
30507
|
type: NodeTranslator.translatorTypes.NODE,
|
|
30508
|
-
encode: encode$
|
|
30509
|
-
decode: decode$
|
|
30510
|
-
attributes: validXmlAttributes$
|
|
30508
|
+
encode: encode$4,
|
|
30509
|
+
decode: decode$4,
|
|
30510
|
+
attributes: validXmlAttributes$2
|
|
30511
30511
|
};
|
|
30512
|
-
const translator$
|
|
30513
|
-
const encode$
|
|
30512
|
+
const translator$2 = NodeTranslator.from(config$2);
|
|
30513
|
+
const encode$3 = (attributes) => {
|
|
30514
30514
|
return attributes["w:id"];
|
|
30515
30515
|
};
|
|
30516
|
-
const decode$
|
|
30516
|
+
const decode$3 = (attrs) => {
|
|
30517
30517
|
return attrs.id;
|
|
30518
30518
|
};
|
|
30519
30519
|
const attrConfig$1 = Object.freeze({
|
|
30520
30520
|
xmlName: "w:id",
|
|
30521
30521
|
sdName: "id",
|
|
30522
|
-
encode: encode$
|
|
30523
|
-
decode: decode$
|
|
30522
|
+
encode: encode$3,
|
|
30523
|
+
decode: decode$3
|
|
30524
30524
|
});
|
|
30525
|
-
const encode$
|
|
30525
|
+
const encode$2 = (attributes) => {
|
|
30526
30526
|
return attributes["w:displacedByCustomXml"];
|
|
30527
30527
|
};
|
|
30528
|
-
const decode$
|
|
30528
|
+
const decode$2 = (attrs) => {
|
|
30529
30529
|
return attrs.displacedByCustomXml;
|
|
30530
30530
|
};
|
|
30531
30531
|
const attrConfig = Object.freeze({
|
|
30532
30532
|
xmlName: "w:displacedByCustomXml",
|
|
30533
30533
|
sdName: "displacedByCustomXml",
|
|
30534
|
-
encode: encode$
|
|
30535
|
-
decode: decode$
|
|
30534
|
+
encode: encode$2,
|
|
30535
|
+
decode: decode$2
|
|
30536
30536
|
});
|
|
30537
|
-
const validXmlAttributes = [attrConfig$1, attrConfig];
|
|
30538
|
-
const XML_NODE_NAME = "w:bookmarkEnd";
|
|
30539
|
-
const SD_NODE_NAME = "bookmarkEnd";
|
|
30540
|
-
const encode$
|
|
30537
|
+
const validXmlAttributes$1 = [attrConfig$1, attrConfig];
|
|
30538
|
+
const XML_NODE_NAME$1 = "w:bookmarkEnd";
|
|
30539
|
+
const SD_NODE_NAME$1 = "bookmarkEnd";
|
|
30540
|
+
const encode$1 = (params2, encodedAttrs = {}) => {
|
|
30541
30541
|
return {
|
|
30542
30542
|
type: "bookmarkEnd",
|
|
30543
30543
|
attrs: encodedAttrs
|
|
30544
30544
|
};
|
|
30545
30545
|
};
|
|
30546
|
-
const decode = (params2, decodedAttrs = {}) => {
|
|
30546
|
+
const decode$1 = (params2, decodedAttrs = {}) => {
|
|
30547
30547
|
const result = {
|
|
30548
30548
|
name: "w:bookmarkEnd",
|
|
30549
30549
|
elements: []
|
|
@@ -30553,11 +30553,60 @@ const decode = (params2, decodedAttrs = {}) => {
|
|
|
30553
30553
|
}
|
|
30554
30554
|
return result;
|
|
30555
30555
|
};
|
|
30556
|
+
const config$1 = {
|
|
30557
|
+
xmlName: XML_NODE_NAME$1,
|
|
30558
|
+
sdNodeOrKeyName: SD_NODE_NAME$1,
|
|
30559
|
+
type: NodeTranslator.translatorTypes.NODE,
|
|
30560
|
+
encode: encode$1,
|
|
30561
|
+
decode: decode$1,
|
|
30562
|
+
attributes: validXmlAttributes$1
|
|
30563
|
+
};
|
|
30564
|
+
const translator$1 = NodeTranslator.from(config$1);
|
|
30565
|
+
const XML_NODE_NAME = "mc:AlternateContent";
|
|
30566
|
+
const SD_NODE_NAME = [];
|
|
30567
|
+
const validXmlAttributes = [];
|
|
30568
|
+
function encode$19(params2) {
|
|
30569
|
+
const { nodeListHandler } = params2;
|
|
30570
|
+
const { node } = params2.extraParams;
|
|
30571
|
+
if (!node || !node.type) {
|
|
30572
|
+
return null;
|
|
30573
|
+
}
|
|
30574
|
+
const allowedNamespaces = ["wps", "wp14", "w14", "w15"];
|
|
30575
|
+
const wpsNode = node.elements.find(
|
|
30576
|
+
(el) => el.name === "mc:Choice" && allowedNamespaces.includes(el.attributes["Requires"])
|
|
30577
|
+
);
|
|
30578
|
+
if (!wpsNode) {
|
|
30579
|
+
return null;
|
|
30580
|
+
}
|
|
30581
|
+
const contents = wpsNode.elements;
|
|
30582
|
+
return nodeListHandler.handler({
|
|
30583
|
+
...params2,
|
|
30584
|
+
nodes: contents,
|
|
30585
|
+
path: [...params2.path || [], wpsNode]
|
|
30586
|
+
});
|
|
30587
|
+
}
|
|
30588
|
+
function decode(params2) {
|
|
30589
|
+
const { node } = params2;
|
|
30590
|
+
const { drawingContent } = node.attrs;
|
|
30591
|
+
const drawing = {
|
|
30592
|
+
name: "w:drawing",
|
|
30593
|
+
elements: [...drawingContent ? [...drawingContent.elements || []] : []]
|
|
30594
|
+
};
|
|
30595
|
+
const choice = {
|
|
30596
|
+
name: "mc:Choice",
|
|
30597
|
+
attributes: { Requires: "wps" },
|
|
30598
|
+
elements: [drawing]
|
|
30599
|
+
};
|
|
30600
|
+
return {
|
|
30601
|
+
name: "mc:AlternateContent",
|
|
30602
|
+
elements: [choice]
|
|
30603
|
+
};
|
|
30604
|
+
}
|
|
30556
30605
|
const config = {
|
|
30557
30606
|
xmlName: XML_NODE_NAME,
|
|
30558
30607
|
sdNodeOrKeyName: SD_NODE_NAME,
|
|
30559
30608
|
type: NodeTranslator.translatorTypes.NODE,
|
|
30560
|
-
encode: encode$
|
|
30609
|
+
encode: encode$19,
|
|
30561
30610
|
decode,
|
|
30562
30611
|
attributes: validXmlAttributes
|
|
30563
30612
|
};
|
|
@@ -30576,30 +30625,30 @@ function exportSchemaToJson(params2) {
|
|
|
30576
30625
|
doc: translateDocumentNode,
|
|
30577
30626
|
body: translateBodyNode,
|
|
30578
30627
|
heading: translateHeadingNode,
|
|
30579
|
-
paragraph: translator$
|
|
30580
|
-
run: translator$
|
|
30628
|
+
paragraph: translator$13,
|
|
30629
|
+
run: translator$U,
|
|
30581
30630
|
text: translateTextNode,
|
|
30582
30631
|
bulletList: translateList,
|
|
30583
30632
|
orderedList: translateList,
|
|
30584
|
-
lineBreak: translator$
|
|
30585
|
-
table: translator$
|
|
30586
|
-
tableRow: translator$
|
|
30587
|
-
tableCell: translator$
|
|
30588
|
-
bookmarkStart: translator$
|
|
30589
|
-
bookmarkEnd: translator,
|
|
30590
|
-
fieldAnnotation: translator$
|
|
30591
|
-
tab: translator$
|
|
30592
|
-
image: translator$
|
|
30593
|
-
hardBreak: translator$
|
|
30633
|
+
lineBreak: translator$16,
|
|
30634
|
+
table: translator$9,
|
|
30635
|
+
tableRow: translator$G,
|
|
30636
|
+
tableCell: translator$8,
|
|
30637
|
+
bookmarkStart: translator$2,
|
|
30638
|
+
bookmarkEnd: translator$1,
|
|
30639
|
+
fieldAnnotation: translator$3,
|
|
30640
|
+
tab: translator$14,
|
|
30641
|
+
image: translator$4,
|
|
30642
|
+
hardBreak: translator$16,
|
|
30594
30643
|
commentRangeStart: () => translateCommentNode(params2, "Start"),
|
|
30595
30644
|
commentRangeEnd: () => translateCommentNode(params2, "End"),
|
|
30596
30645
|
commentReference: () => null,
|
|
30597
30646
|
shapeContainer: translateShapeContainer,
|
|
30598
30647
|
shapeTextbox: translateShapeTextbox,
|
|
30599
30648
|
contentBlock: translateContentBlock,
|
|
30600
|
-
structuredContent: translator$
|
|
30601
|
-
structuredContentBlock: translator$
|
|
30602
|
-
documentSection: translator$
|
|
30649
|
+
structuredContent: translator$3,
|
|
30650
|
+
structuredContentBlock: translator$3,
|
|
30651
|
+
documentSection: translator$3,
|
|
30603
30652
|
"page-number": translatePageNumberNode,
|
|
30604
30653
|
"total-page-number": translateTotalPageNumberNode
|
|
30605
30654
|
};
|
|
@@ -30938,7 +30987,7 @@ function translateTextNode(params2) {
|
|
|
30938
30987
|
const isTrackedNode = node.marks?.some((m2) => trackedMarks.includes(m2.type));
|
|
30939
30988
|
if (isTrackedNode) return translateTrackedNode(params2);
|
|
30940
30989
|
const isLinkNode = node.marks?.some((m2) => m2.type === "link");
|
|
30941
|
-
if (isLinkNode) return translator$
|
|
30990
|
+
if (isLinkNode) return translator$7.decode(params2);
|
|
30942
30991
|
const { text, marks = [] } = node;
|
|
30943
30992
|
return getTextNodeForExport(text, marks, params2);
|
|
30944
30993
|
}
|
|
@@ -31244,7 +31293,7 @@ function translateMark(mark) {
|
|
|
31244
31293
|
markElement.type = "element";
|
|
31245
31294
|
break;
|
|
31246
31295
|
case "underline": {
|
|
31247
|
-
const translated = translator
|
|
31296
|
+
const translated = translator$10.decode({
|
|
31248
31297
|
node: {
|
|
31249
31298
|
attrs: {
|
|
31250
31299
|
underlineType: attrs.underlineType ?? attrs.underline ?? null,
|
|
@@ -31308,7 +31357,7 @@ function translateMark(mark) {
|
|
|
31308
31357
|
break;
|
|
31309
31358
|
case "highlight": {
|
|
31310
31359
|
const highlightValue = attrs.color ?? attrs.highlight ?? null;
|
|
31311
|
-
const translated = translator$
|
|
31360
|
+
const translated = translator$15.decode({ node: { attrs: { highlight: highlightValue } } });
|
|
31312
31361
|
return translated || {};
|
|
31313
31362
|
}
|
|
31314
31363
|
}
|
|
@@ -31364,23 +31413,11 @@ function translateShapeTextbox(params2) {
|
|
|
31364
31413
|
}
|
|
31365
31414
|
function translateContentBlock(params2) {
|
|
31366
31415
|
const { node } = params2;
|
|
31367
|
-
const {
|
|
31416
|
+
const { vmlAttributes, horizontalRule } = node.attrs;
|
|
31368
31417
|
if (vmlAttributes || horizontalRule) {
|
|
31369
31418
|
return translateVRectContentBlock(params2);
|
|
31370
31419
|
}
|
|
31371
|
-
const
|
|
31372
|
-
name: "w:drawing",
|
|
31373
|
-
elements: [...drawingContent ? [...drawingContent.elements || []] : []]
|
|
31374
|
-
};
|
|
31375
|
-
const choice = {
|
|
31376
|
-
name: "mc:Choice",
|
|
31377
|
-
attributes: { Requires: "wps" },
|
|
31378
|
-
elements: [drawing]
|
|
31379
|
-
};
|
|
31380
|
-
const alternateContent = {
|
|
31381
|
-
name: "mc:AlternateContent",
|
|
31382
|
-
elements: [choice]
|
|
31383
|
-
};
|
|
31420
|
+
const alternateContent = translator.decode(params2);
|
|
31384
31421
|
return wrapTextInRun(alternateContent);
|
|
31385
31422
|
}
|
|
31386
31423
|
function translateVRectContentBlock(params2) {
|
|
@@ -31584,7 +31621,7 @@ const handleDrawingNode = (params2) => {
|
|
|
31584
31621
|
if (mainNode.name === "w:drawing") node = mainNode;
|
|
31585
31622
|
else node = mainNode.elements.find((el) => el.name === "w:drawing");
|
|
31586
31623
|
if (!node) return { nodes: [], consumed: 0 };
|
|
31587
|
-
const schemaNode = translator$
|
|
31624
|
+
const schemaNode = translator$4.encode(params2);
|
|
31588
31625
|
const newNodes = schemaNode ? [schemaNode] : [];
|
|
31589
31626
|
return { nodes: newNodes, consumed: 1 };
|
|
31590
31627
|
};
|
|
@@ -31686,8 +31723,8 @@ const trackChangeNodeHandlerEntity = {
|
|
|
31686
31723
|
handlerName: "trackChangeNodeHandler",
|
|
31687
31724
|
handler: handleTrackChangeNode
|
|
31688
31725
|
};
|
|
31689
|
-
const hyperlinkNodeHandlerEntity = generateV2HandlerEntity("hyperlinkNodeHandler", translator$
|
|
31690
|
-
const runNodeHandlerEntity = generateV2HandlerEntity("runNodeHandler", translator$
|
|
31726
|
+
const hyperlinkNodeHandlerEntity = generateV2HandlerEntity("hyperlinkNodeHandler", translator$7);
|
|
31727
|
+
const runNodeHandlerEntity = generateV2HandlerEntity("runNodeHandler", translator$U);
|
|
31691
31728
|
const handleTextNode = (params2) => {
|
|
31692
31729
|
const { nodes, insideTrackChange } = params2;
|
|
31693
31730
|
if (nodes.length === 0 || !(nodes[0].name === "w:t" || insideTrackChange && nodes[0].name === "w:delText")) {
|
|
@@ -31728,7 +31765,7 @@ const handleParagraphNode = (params2) => {
|
|
|
31728
31765
|
if (nodes.length === 0 || nodes[0].name !== "w:p") {
|
|
31729
31766
|
return { nodes: [], consumed: 0 };
|
|
31730
31767
|
}
|
|
31731
|
-
const schemaNode = translator$
|
|
31768
|
+
const schemaNode = translator$13.encode(params2);
|
|
31732
31769
|
const newNodes = schemaNode ? [schemaNode] : [];
|
|
31733
31770
|
return { nodes: newNodes, consumed: 1 };
|
|
31734
31771
|
};
|
|
@@ -31741,7 +31778,7 @@ const handleSdtNode = (params2) => {
|
|
|
31741
31778
|
if (nodes.length === 0 || nodes[0].name !== "w:sdt") {
|
|
31742
31779
|
return { nodes: [], consumed: 0 };
|
|
31743
31780
|
}
|
|
31744
|
-
const result = translator$
|
|
31781
|
+
const result = translator$3.encode(params2);
|
|
31745
31782
|
if (!result) {
|
|
31746
31783
|
return { nodes: [], consumed: 0 };
|
|
31747
31784
|
}
|
|
@@ -31831,7 +31868,7 @@ const handler = (params2) => {
|
|
|
31831
31868
|
if (nodes.length === 0 || nodes[0].name !== "w:br") {
|
|
31832
31869
|
return { nodes: [], consumed: 0 };
|
|
31833
31870
|
}
|
|
31834
|
-
const result = translator$
|
|
31871
|
+
const result = translator$16.encode(params2);
|
|
31835
31872
|
if (!result) return { nodes: [], consumed: 0 };
|
|
31836
31873
|
return {
|
|
31837
31874
|
nodes: [result],
|
|
@@ -31903,7 +31940,7 @@ const handleBookmarkStartNode = (params2) => {
|
|
|
31903
31940
|
if (isCustomMarkBookmark(nodes[0], params2.editor)) {
|
|
31904
31941
|
return handleBookmarkNode(params2);
|
|
31905
31942
|
}
|
|
31906
|
-
const node = translator$
|
|
31943
|
+
const node = translator$2.encode(params2);
|
|
31907
31944
|
if (!node) return { nodes: [], consumed: 0 };
|
|
31908
31945
|
return { nodes: [node], consumed: 1 };
|
|
31909
31946
|
};
|
|
@@ -31935,7 +31972,7 @@ const handleBookmarkEndNode = (params2) => {
|
|
|
31935
31972
|
if (!nodes.length || nodes[0].name !== "w:bookmarkEnd") {
|
|
31936
31973
|
return { nodes: [], consumed: 0 };
|
|
31937
31974
|
}
|
|
31938
|
-
const node = translator.encode(params2);
|
|
31975
|
+
const node = translator$1.encode(params2);
|
|
31939
31976
|
if (!node) return { nodes: [], consumed: 0 };
|
|
31940
31977
|
return { nodes: [node], consumed: 1 };
|
|
31941
31978
|
};
|
|
@@ -31943,32 +31980,86 @@ const bookmarkEndNodeHandlerEntity = {
|
|
|
31943
31980
|
handlerName: "w:bookmarkEndTranslator",
|
|
31944
31981
|
handler: handleBookmarkEndNode
|
|
31945
31982
|
};
|
|
31983
|
+
const ALTERNATE_CONTENT_NODE = "mc:AlternateContent";
|
|
31984
|
+
const SUPPORTED_REQUIRES = /* @__PURE__ */ new Set([
|
|
31985
|
+
"wps",
|
|
31986
|
+
"wp14",
|
|
31987
|
+
"w14",
|
|
31988
|
+
"w15",
|
|
31989
|
+
"w16",
|
|
31990
|
+
"w16cex",
|
|
31991
|
+
"w16cid",
|
|
31992
|
+
"w16du",
|
|
31993
|
+
"w16sdtdh",
|
|
31994
|
+
"w16sdtfl",
|
|
31995
|
+
"w16se"
|
|
31996
|
+
]);
|
|
31997
|
+
const skipHandlerResponse = { nodes: [], consumed: 0 };
|
|
31998
|
+
const isAlternateContentNode = (node) => node?.name === ALTERNATE_CONTENT_NODE;
|
|
31999
|
+
const isSupportedChoice = (choice) => {
|
|
32000
|
+
if (!choice?.attributes) return false;
|
|
32001
|
+
const requires = choice.attributes.Requires || choice.attributes.requires;
|
|
32002
|
+
if (!requires) return false;
|
|
32003
|
+
return requires.split(/\s+/).filter(Boolean).some((namespace2) => SUPPORTED_REQUIRES.has(namespace2));
|
|
32004
|
+
};
|
|
32005
|
+
const resolveAlternateContentElements = (alternateContent) => {
|
|
32006
|
+
if (!alternateContent?.elements?.length) return null;
|
|
32007
|
+
const choices = alternateContent.elements.filter((el) => el.name === "mc:Choice");
|
|
32008
|
+
const fallback = alternateContent.elements.find((el) => el.name === "mc:Fallback");
|
|
32009
|
+
const supportedChoice = choices.find(isSupportedChoice);
|
|
32010
|
+
const selectedElements = supportedChoice?.elements || fallback?.elements || choices[0]?.elements;
|
|
32011
|
+
if (!selectedElements) return null;
|
|
32012
|
+
return carbonCopy(selectedElements);
|
|
32013
|
+
};
|
|
32014
|
+
const buildNodeWithoutAlternateContent = (node) => {
|
|
32015
|
+
const { elements } = node || {};
|
|
32016
|
+
if (!elements?.length) return null;
|
|
32017
|
+
let replaced = false;
|
|
32018
|
+
const updatedElements = [];
|
|
32019
|
+
elements.forEach((element) => {
|
|
32020
|
+
if (isAlternateContentNode(element)) {
|
|
32021
|
+
const resolved = resolveAlternateContentElements(element);
|
|
32022
|
+
if (resolved) {
|
|
32023
|
+
updatedElements.push(...resolved);
|
|
32024
|
+
replaced = true;
|
|
32025
|
+
return;
|
|
32026
|
+
}
|
|
32027
|
+
updatedElements.push(carbonCopy(element));
|
|
32028
|
+
return;
|
|
32029
|
+
}
|
|
32030
|
+
updatedElements.push(carbonCopy(element));
|
|
32031
|
+
});
|
|
32032
|
+
if (!replaced) return null;
|
|
32033
|
+
const clone = carbonCopy(node);
|
|
32034
|
+
clone.elements = updatedElements;
|
|
32035
|
+
return clone;
|
|
32036
|
+
};
|
|
31946
32037
|
const handleAlternateChoice = (params2) => {
|
|
31947
|
-
const skipHandlerResponse = { nodes: [], consumed: 0 };
|
|
31948
32038
|
const { nodes, nodeListHandler } = params2;
|
|
31949
|
-
if (nodes
|
|
32039
|
+
if (!nodes?.length) {
|
|
31950
32040
|
return skipHandlerResponse;
|
|
31951
32041
|
}
|
|
31952
|
-
const
|
|
31953
|
-
|
|
31954
|
-
|
|
31955
|
-
|
|
31956
|
-
|
|
32042
|
+
const [currentNode] = nodes;
|
|
32043
|
+
if (isAlternateContentNode(currentNode)) {
|
|
32044
|
+
const resolvedElements = resolveAlternateContentElements(currentNode);
|
|
32045
|
+
if (!resolvedElements) {
|
|
32046
|
+
return skipHandlerResponse;
|
|
32047
|
+
}
|
|
32048
|
+
const result2 = nodeListHandler.handler({
|
|
32049
|
+
...params2,
|
|
32050
|
+
nodes: resolvedElements,
|
|
32051
|
+
path: [...params2.path || [], currentNode]
|
|
32052
|
+
});
|
|
32053
|
+
return { nodes: result2, consumed: 1 };
|
|
31957
32054
|
}
|
|
31958
|
-
const
|
|
31959
|
-
|
|
31960
|
-
const allowedNamespaces = ["wps", "wp14", "w14", "w15"];
|
|
31961
|
-
const wpsNode = altChoiceNode.elements.find(
|
|
31962
|
-
(el) => el.name === "mc:Choice" && allowedNamespaces.includes(el.attributes["Requires"])
|
|
31963
|
-
);
|
|
31964
|
-
if (!wpsNode) {
|
|
32055
|
+
const sanitizedNode = buildNodeWithoutAlternateContent(currentNode);
|
|
32056
|
+
if (!sanitizedNode) {
|
|
31965
32057
|
return skipHandlerResponse;
|
|
31966
32058
|
}
|
|
31967
|
-
const contents = wpsNode.elements;
|
|
31968
32059
|
const result = nodeListHandler.handler({
|
|
31969
32060
|
...params2,
|
|
31970
|
-
nodes:
|
|
31971
|
-
path: [...params2.path || [],
|
|
32061
|
+
nodes: [sanitizedNode],
|
|
32062
|
+
path: [...params2.path || [], sanitizedNode]
|
|
31972
32063
|
});
|
|
31973
32064
|
return { nodes: result, consumed: 1 };
|
|
31974
32065
|
};
|
|
@@ -32574,7 +32665,7 @@ const handleTabNode = (params2) => {
|
|
|
32574
32665
|
if (!nodes.length || nodes[0].name !== "w:tab") {
|
|
32575
32666
|
return { nodes: [], consumed: 0 };
|
|
32576
32667
|
}
|
|
32577
|
-
const node = translator$
|
|
32668
|
+
const node = translator$14.encode(params2);
|
|
32578
32669
|
return { nodes: [node], consumed: 1 };
|
|
32579
32670
|
};
|
|
32580
32671
|
const tabNodeEntityHandler = {
|
|
@@ -33138,7 +33229,7 @@ const _SuperConverter = class _SuperConverter2 {
|
|
|
33138
33229
|
return;
|
|
33139
33230
|
}
|
|
33140
33231
|
}
|
|
33141
|
-
static updateDocumentVersion(docx = this.convertedXml, version2 = "0.
|
|
33232
|
+
static updateDocumentVersion(docx = this.convertedXml, version2 = "0.21.0") {
|
|
33142
33233
|
const customLocation = "docProps/custom.xml";
|
|
33143
33234
|
if (!docx[customLocation]) {
|
|
33144
33235
|
docx[customLocation] = generateCustomXml();
|
|
@@ -33631,7 +33722,7 @@ function storeSuperdocVersion(docx) {
|
|
|
33631
33722
|
function generateCustomXml() {
|
|
33632
33723
|
return DEFAULT_CUSTOM_XML;
|
|
33633
33724
|
}
|
|
33634
|
-
function generateSuperdocVersion(pid = 2, version2 = "0.
|
|
33725
|
+
function generateSuperdocVersion(pid = 2, version2 = "0.21.0") {
|
|
33635
33726
|
return {
|
|
33636
33727
|
type: "element",
|
|
33637
33728
|
name: "property",
|
|
@@ -50699,6 +50790,8 @@ const _Editor = class _Editor2 extends EventEmitter$1 {
|
|
|
50699
50790
|
element.style.isolation = "isolate";
|
|
50700
50791
|
proseMirror.style.outline = "none";
|
|
50701
50792
|
proseMirror.style.border = "none";
|
|
50793
|
+
element.style.backgroundColor = "#fff";
|
|
50794
|
+
proseMirror.style.backgroundColor = "#fff";
|
|
50702
50795
|
const { typeface, fontSizePt, fontFamilyCss } = this.converter.getDocumentDefaultStyles() ?? {};
|
|
50703
50796
|
const resolvedFontFamily = fontFamilyCss || typeface;
|
|
50704
50797
|
if (resolvedFontFamily) {
|
|
@@ -51021,7 +51114,7 @@ const _Editor = class _Editor2 extends EventEmitter$1 {
|
|
|
51021
51114
|
* @returns {Object | void} Migration results
|
|
51022
51115
|
*/
|
|
51023
51116
|
processCollaborationMigrations() {
|
|
51024
|
-
console.debug("[checkVersionMigrations] Current editor version", "0.
|
|
51117
|
+
console.debug("[checkVersionMigrations] Current editor version", "0.21.0");
|
|
51025
51118
|
if (!this.options.ydoc) return;
|
|
51026
51119
|
const metaMap = this.options.ydoc.getMap("meta");
|
|
51027
51120
|
let docVersion = metaMap.get("version");
|
|
@@ -53498,6 +53591,20 @@ const intToJapaneseCounting = (num) => {
|
|
|
53498
53591
|
}
|
|
53499
53592
|
return result;
|
|
53500
53593
|
};
|
|
53594
|
+
const isKeyboardInvocation = (event) => {
|
|
53595
|
+
return event.type === "contextmenu" && typeof event.detail === "number" && event.detail === 0 && (event.button === 0 || event.button === void 0) && event.clientX === 0 && event.clientY === 0;
|
|
53596
|
+
};
|
|
53597
|
+
const prefersNativeMenu = (event) => {
|
|
53598
|
+
if (!event) return false;
|
|
53599
|
+
if (event.ctrlKey || event.metaKey) {
|
|
53600
|
+
return true;
|
|
53601
|
+
}
|
|
53602
|
+
return isKeyboardInvocation(event);
|
|
53603
|
+
};
|
|
53604
|
+
const shouldAllowNativeContextMenu = (event) => {
|
|
53605
|
+
return prefersNativeMenu(event);
|
|
53606
|
+
};
|
|
53607
|
+
const shouldBypassContextMenu = shouldAllowNativeContextMenu;
|
|
53501
53608
|
const CustomSelectionPluginKey = new PluginKey("CustomSelection");
|
|
53502
53609
|
const handleClickOutside = (event, editor) => {
|
|
53503
53610
|
const editorElem = editor?.options?.element;
|
|
@@ -53560,6 +53667,9 @@ const CustomSelection = Extension.create({
|
|
|
53560
53667
|
props: {
|
|
53561
53668
|
handleDOMEvents: {
|
|
53562
53669
|
contextmenu: (view, event) => {
|
|
53670
|
+
if (shouldAllowNativeContextMenu(event)) {
|
|
53671
|
+
return false;
|
|
53672
|
+
}
|
|
53563
53673
|
event.preventDefault();
|
|
53564
53674
|
const { selection } = view.state;
|
|
53565
53675
|
if (!selection.empty) {
|
|
@@ -53578,6 +53688,9 @@ const CustomSelection = Extension.create({
|
|
|
53578
53688
|
},
|
|
53579
53689
|
mousedown: (view, event) => {
|
|
53580
53690
|
if (event.button === 2) {
|
|
53691
|
+
if (shouldAllowNativeContextMenu(event)) {
|
|
53692
|
+
return false;
|
|
53693
|
+
}
|
|
53581
53694
|
event.preventDefault();
|
|
53582
53695
|
const { selection: selection2 } = view.state;
|
|
53583
53696
|
if (!selection2.empty) {
|
|
@@ -83569,6 +83682,115 @@ runCommandWithArgumentOnly_fn = function({ item, argument, noArgumentCallback =
|
|
|
83569
83682
|
this.updateToolbarState();
|
|
83570
83683
|
}
|
|
83571
83684
|
};
|
|
83685
|
+
const onMarginClickCursorChange = (event, editor) => {
|
|
83686
|
+
const y2 = event.clientY;
|
|
83687
|
+
const x = event.clientX;
|
|
83688
|
+
const { view } = editor;
|
|
83689
|
+
const editorRect = view.dom.getBoundingClientRect();
|
|
83690
|
+
let coords = {
|
|
83691
|
+
left: 0,
|
|
83692
|
+
top: y2
|
|
83693
|
+
};
|
|
83694
|
+
let isRightMargin = false;
|
|
83695
|
+
if (x > editorRect.right) {
|
|
83696
|
+
coords.left = editorRect.left + editorRect.width - 1;
|
|
83697
|
+
isRightMargin = true;
|
|
83698
|
+
} else if (x < editorRect.left) {
|
|
83699
|
+
coords.left = editorRect.left;
|
|
83700
|
+
}
|
|
83701
|
+
const pos = view.posAtCoords(coords)?.pos;
|
|
83702
|
+
if (pos) {
|
|
83703
|
+
let cursorPos = pos;
|
|
83704
|
+
if (isRightMargin) {
|
|
83705
|
+
const $pos = view.state.doc.resolve(pos);
|
|
83706
|
+
const charOffset = $pos.textOffset;
|
|
83707
|
+
const node = view.state.doc.nodeAt(pos);
|
|
83708
|
+
const text = node?.text;
|
|
83709
|
+
const charAtPos = text?.charAt(charOffset);
|
|
83710
|
+
cursorPos = node?.isText && charAtPos !== " " ? pos - 1 : pos;
|
|
83711
|
+
}
|
|
83712
|
+
const transaction = view.state.tr.setSelection(TextSelection$1.create(view.state.doc, cursorPos));
|
|
83713
|
+
view.dispatch(transaction);
|
|
83714
|
+
view.focus();
|
|
83715
|
+
}
|
|
83716
|
+
};
|
|
83717
|
+
const checkNodeSpecificClicks = (editor, event, popoverControls) => {
|
|
83718
|
+
if (!editor) return;
|
|
83719
|
+
if (selectionHasNodeOrMark(editor.view.state, "link", { requireEnds: true })) {
|
|
83720
|
+
popoverControls.component = LinkInput;
|
|
83721
|
+
popoverControls.position = {
|
|
83722
|
+
left: `${event.clientX - editor.element.getBoundingClientRect().left}px`,
|
|
83723
|
+
top: `${event.clientY - editor.element.getBoundingClientRect().top + 15}px`
|
|
83724
|
+
};
|
|
83725
|
+
popoverControls.props = {
|
|
83726
|
+
showInput: true
|
|
83727
|
+
};
|
|
83728
|
+
popoverControls.visible = true;
|
|
83729
|
+
}
|
|
83730
|
+
};
|
|
83731
|
+
function selectionHasNodeOrMark(state2, name, options = {}) {
|
|
83732
|
+
const { requireEnds = false } = options;
|
|
83733
|
+
const $from = state2.selection.$from;
|
|
83734
|
+
const $to = state2.selection.$to;
|
|
83735
|
+
if (requireEnds) {
|
|
83736
|
+
for (let d2 = $from.depth; d2 > 0; d2--) {
|
|
83737
|
+
if ($from.node(d2).type.name === name) {
|
|
83738
|
+
return true;
|
|
83739
|
+
}
|
|
83740
|
+
}
|
|
83741
|
+
for (let d2 = $to.depth; d2 > 0; d2--) {
|
|
83742
|
+
if ($to.node(d2).type.name === name) {
|
|
83743
|
+
return true;
|
|
83744
|
+
}
|
|
83745
|
+
}
|
|
83746
|
+
} else {
|
|
83747
|
+
for (let d2 = $from.depth; d2 > 0; d2--) {
|
|
83748
|
+
if ($from.node(d2).type.name === name) {
|
|
83749
|
+
return true;
|
|
83750
|
+
}
|
|
83751
|
+
}
|
|
83752
|
+
}
|
|
83753
|
+
const markType = state2.schema.marks[name];
|
|
83754
|
+
if (markType) {
|
|
83755
|
+
const { from: from2, to, empty: empty2 } = state2.selection;
|
|
83756
|
+
if (requireEnds) {
|
|
83757
|
+
const fromMarks = markType.isInSet($from.marks());
|
|
83758
|
+
const toMarks = markType.isInSet($to.marks());
|
|
83759
|
+
if (fromMarks || toMarks) {
|
|
83760
|
+
return true;
|
|
83761
|
+
}
|
|
83762
|
+
if (empty2 && markType.isInSet(state2.storedMarks || $from.marks())) {
|
|
83763
|
+
return true;
|
|
83764
|
+
}
|
|
83765
|
+
} else {
|
|
83766
|
+
if (empty2) {
|
|
83767
|
+
if (markType.isInSet(state2.storedMarks || $from.marks())) {
|
|
83768
|
+
return true;
|
|
83769
|
+
}
|
|
83770
|
+
} else {
|
|
83771
|
+
let hasMark = false;
|
|
83772
|
+
state2.doc.nodesBetween(from2, to, (node) => {
|
|
83773
|
+
if (markType.isInSet(node.marks)) {
|
|
83774
|
+
hasMark = true;
|
|
83775
|
+
return false;
|
|
83776
|
+
}
|
|
83777
|
+
});
|
|
83778
|
+
if (hasMark) return true;
|
|
83779
|
+
}
|
|
83780
|
+
}
|
|
83781
|
+
}
|
|
83782
|
+
return false;
|
|
83783
|
+
}
|
|
83784
|
+
function moveCursorToMouseEvent(event, editor) {
|
|
83785
|
+
const { view } = editor;
|
|
83786
|
+
const coords = { left: event.clientX, top: event.clientY };
|
|
83787
|
+
const pos = view.posAtCoords(coords)?.pos;
|
|
83788
|
+
if (typeof pos === "number") {
|
|
83789
|
+
const tr = view.state.tr.setSelection(TextSelection$1.create(view.state.doc, pos));
|
|
83790
|
+
view.dispatch(tr);
|
|
83791
|
+
view.focus();
|
|
83792
|
+
}
|
|
83793
|
+
}
|
|
83572
83794
|
const ICONS = {
|
|
83573
83795
|
addRowBefore: plusIconSvg,
|
|
83574
83796
|
addRowAfter: plusIconSvg,
|
|
@@ -83768,6 +83990,30 @@ const getPropsByItemId = (itemId, props) => {
|
|
|
83768
83990
|
return baseProps;
|
|
83769
83991
|
}
|
|
83770
83992
|
};
|
|
83993
|
+
function normalizeClipboardContent(rawClipboardContent) {
|
|
83994
|
+
if (!rawClipboardContent) {
|
|
83995
|
+
return {
|
|
83996
|
+
html: null,
|
|
83997
|
+
text: null,
|
|
83998
|
+
hasContent: false,
|
|
83999
|
+
raw: null
|
|
84000
|
+
};
|
|
84001
|
+
}
|
|
84002
|
+
const html = typeof rawClipboardContent.html === "string" ? rawClipboardContent.html : null;
|
|
84003
|
+
const text = typeof rawClipboardContent.text === "string" ? rawClipboardContent.text : null;
|
|
84004
|
+
const hasHtml = !!html && html.trim().length > 0;
|
|
84005
|
+
const hasText = !!text && text.length > 0;
|
|
84006
|
+
const isObject2 = typeof rawClipboardContent === "object" && rawClipboardContent !== null;
|
|
84007
|
+
const fragmentSize = typeof rawClipboardContent.size === "number" ? rawClipboardContent.size : null;
|
|
84008
|
+
const nestedSize = isObject2 && rawClipboardContent.content && typeof rawClipboardContent.content.size === "number" ? rawClipboardContent.content.size : null;
|
|
84009
|
+
const hasFragmentContent = (fragmentSize ?? nestedSize ?? 0) > 0;
|
|
84010
|
+
return {
|
|
84011
|
+
html,
|
|
84012
|
+
text,
|
|
84013
|
+
hasContent: hasHtml || hasText || hasFragmentContent,
|
|
84014
|
+
raw: rawClipboardContent
|
|
84015
|
+
};
|
|
84016
|
+
}
|
|
83771
84017
|
async function getEditorContext(editor, event) {
|
|
83772
84018
|
const { view } = editor;
|
|
83773
84019
|
const { state: state2 } = view;
|
|
@@ -83783,123 +84029,144 @@ async function getEditorContext(editor, event) {
|
|
|
83783
84029
|
pos = from2;
|
|
83784
84030
|
node = state2.doc.nodeAt(pos);
|
|
83785
84031
|
}
|
|
83786
|
-
const
|
|
84032
|
+
const rawClipboardContent = await readFromClipboard(state2);
|
|
84033
|
+
const clipboardContent = normalizeClipboardContent(rawClipboardContent);
|
|
84034
|
+
const structureFromResolvedPos = pos !== null ? getStructureFromResolvedPos(state2, pos) : null;
|
|
84035
|
+
const isInTable2 = structureFromResolvedPos?.isInTable ?? selectionHasNodeOrMark(state2, "table", { requireEnds: true });
|
|
84036
|
+
const isInList = structureFromResolvedPos?.isInList ?? (selectionHasNodeOrMark(state2, "bulletList", { requireEnds: false }) || selectionHasNodeOrMark(state2, "orderedList", { requireEnds: false }));
|
|
84037
|
+
const isInSectionNode = structureFromResolvedPos?.isInSectionNode ?? selectionHasNodeOrMark(state2, "documentSection", { requireEnds: true });
|
|
84038
|
+
const currentNodeType = node?.type?.name || null;
|
|
84039
|
+
const activeMarks = [];
|
|
84040
|
+
if (event && pos !== null) {
|
|
84041
|
+
const $pos = state2.doc.resolve(pos);
|
|
84042
|
+
if ($pos.marks && typeof $pos.marks === "function") {
|
|
84043
|
+
$pos.marks().forEach((mark) => activeMarks.push(mark.type.name));
|
|
84044
|
+
}
|
|
84045
|
+
if (node && node.marks) {
|
|
84046
|
+
node.marks.forEach((mark) => activeMarks.push(mark.type.name));
|
|
84047
|
+
}
|
|
84048
|
+
} else {
|
|
84049
|
+
state2.storedMarks?.forEach((mark) => activeMarks.push(mark.type.name));
|
|
84050
|
+
state2.selection.$head.marks().forEach((mark) => activeMarks.push(mark.type.name));
|
|
84051
|
+
}
|
|
84052
|
+
const isTrackedChange = activeMarks.includes("trackInsert") || activeMarks.includes("trackDelete");
|
|
84053
|
+
let trackedChangeId = null;
|
|
84054
|
+
if (isTrackedChange && event && pos !== null) {
|
|
84055
|
+
const $pos = state2.doc.resolve(pos);
|
|
84056
|
+
const marksAtPos = $pos.marks();
|
|
84057
|
+
const trackedMark = marksAtPos.find((mark) => mark.type.name === "trackInsert" || mark.type.name === "trackDelete");
|
|
84058
|
+
if (trackedMark) {
|
|
84059
|
+
trackedChangeId = trackedMark.attrs.id;
|
|
84060
|
+
}
|
|
84061
|
+
}
|
|
84062
|
+
const cursorCoords = pos ? view.coordsAtPos(pos) : null;
|
|
84063
|
+
const cursorPosition = cursorCoords ? {
|
|
84064
|
+
x: cursorCoords.left,
|
|
84065
|
+
y: cursorCoords.top
|
|
84066
|
+
} : null;
|
|
83787
84067
|
return {
|
|
83788
|
-
|
|
84068
|
+
// Selection info
|
|
83789
84069
|
selectedText,
|
|
84070
|
+
hasSelection: !empty2,
|
|
84071
|
+
selectionStart: from2,
|
|
84072
|
+
selectionEnd: to,
|
|
84073
|
+
// Document structure
|
|
84074
|
+
isInTable: isInTable2,
|
|
84075
|
+
isInList,
|
|
84076
|
+
isInSectionNode,
|
|
84077
|
+
currentNodeType,
|
|
84078
|
+
activeMarks,
|
|
84079
|
+
// Document state
|
|
84080
|
+
isTrackedChange,
|
|
84081
|
+
trackedChangeId,
|
|
84082
|
+
documentMode: editor.options?.documentMode || "editing",
|
|
84083
|
+
canUndo: computeCanUndo(editor, state2),
|
|
84084
|
+
canRedo: computeCanRedo(editor, state2),
|
|
84085
|
+
isEditable: editor.isEditable,
|
|
84086
|
+
// Clipboard
|
|
84087
|
+
clipboardContent,
|
|
84088
|
+
// Position and trigger info
|
|
84089
|
+
cursorPosition,
|
|
83790
84090
|
pos,
|
|
83791
84091
|
node,
|
|
83792
84092
|
event,
|
|
83793
|
-
|
|
84093
|
+
// Editor reference for advanced use cases
|
|
84094
|
+
editor
|
|
83794
84095
|
};
|
|
83795
84096
|
}
|
|
83796
|
-
|
|
83797
|
-
|
|
83798
|
-
|
|
83799
|
-
|
|
83800
|
-
|
|
83801
|
-
|
|
83802
|
-
|
|
83803
|
-
|
|
83804
|
-
|
|
83805
|
-
|
|
83806
|
-
if (x > editorRect.right) {
|
|
83807
|
-
coords.left = editorRect.left + editorRect.width - 1;
|
|
83808
|
-
isRightMargin = true;
|
|
83809
|
-
} else if (x < editorRect.left) {
|
|
83810
|
-
coords.left = editorRect.left;
|
|
84097
|
+
function computeCanUndo(editor, state2) {
|
|
84098
|
+
if (typeof editor?.can === "function") {
|
|
84099
|
+
try {
|
|
84100
|
+
const can = editor.can();
|
|
84101
|
+
if (can && typeof can.undo === "function") {
|
|
84102
|
+
return !!can.undo();
|
|
84103
|
+
}
|
|
84104
|
+
} catch (error) {
|
|
84105
|
+
console.warn("[SlashMenu] Unable to determine undo availability via editor.can():", error);
|
|
84106
|
+
}
|
|
83811
84107
|
}
|
|
83812
|
-
|
|
83813
|
-
|
|
83814
|
-
|
|
83815
|
-
|
|
83816
|
-
|
|
83817
|
-
|
|
83818
|
-
const node = view.state.doc.nodeAt(pos);
|
|
83819
|
-
const text = node?.text;
|
|
83820
|
-
const charAtPos = text?.charAt(charOffset);
|
|
83821
|
-
cursorPos = node?.isText && charAtPos !== " " ? pos - 1 : pos;
|
|
84108
|
+
if (isCollaborationEnabled(editor)) {
|
|
84109
|
+
try {
|
|
84110
|
+
const undoManager = yUndoPluginKey.getState(state2)?.undoManager;
|
|
84111
|
+
return !!undoManager && undoManager.undoStack.length > 0;
|
|
84112
|
+
} catch (error) {
|
|
84113
|
+
console.warn("[SlashMenu] Unable to determine undo availability via y-prosemirror:", error);
|
|
83822
84114
|
}
|
|
83823
|
-
const transaction = view.state.tr.setSelection(TextSelection$1.create(view.state.doc, cursorPos));
|
|
83824
|
-
view.dispatch(transaction);
|
|
83825
|
-
view.focus();
|
|
83826
84115
|
}
|
|
83827
|
-
|
|
83828
|
-
|
|
83829
|
-
|
|
83830
|
-
|
|
83831
|
-
|
|
83832
|
-
popoverControls.position = {
|
|
83833
|
-
left: `${event.clientX - editor.element.getBoundingClientRect().left}px`,
|
|
83834
|
-
top: `${event.clientY - editor.element.getBoundingClientRect().top + 15}px`
|
|
83835
|
-
};
|
|
83836
|
-
popoverControls.props = {
|
|
83837
|
-
showInput: true
|
|
83838
|
-
};
|
|
83839
|
-
popoverControls.visible = true;
|
|
84116
|
+
try {
|
|
84117
|
+
return undoDepth(state2) > 0;
|
|
84118
|
+
} catch (error) {
|
|
84119
|
+
console.warn("[SlashMenu] Unable to determine undo availability via history plugin:", error);
|
|
84120
|
+
return false;
|
|
83840
84121
|
}
|
|
83841
|
-
}
|
|
83842
|
-
function
|
|
83843
|
-
|
|
83844
|
-
|
|
83845
|
-
|
|
83846
|
-
|
|
83847
|
-
|
|
83848
|
-
if ($from.node(d2).type.name === name) {
|
|
83849
|
-
return true;
|
|
83850
|
-
}
|
|
83851
|
-
}
|
|
83852
|
-
for (let d2 = $to.depth; d2 > 0; d2--) {
|
|
83853
|
-
if ($to.node(d2).type.name === name) {
|
|
83854
|
-
return true;
|
|
83855
|
-
}
|
|
83856
|
-
}
|
|
83857
|
-
} else {
|
|
83858
|
-
for (let d2 = $from.depth; d2 > 0; d2--) {
|
|
83859
|
-
if ($from.node(d2).type.name === name) {
|
|
83860
|
-
return true;
|
|
84122
|
+
}
|
|
84123
|
+
function computeCanRedo(editor, state2) {
|
|
84124
|
+
if (typeof editor?.can === "function") {
|
|
84125
|
+
try {
|
|
84126
|
+
const can = editor.can();
|
|
84127
|
+
if (can && typeof can.redo === "function") {
|
|
84128
|
+
return !!can.redo();
|
|
83861
84129
|
}
|
|
84130
|
+
} catch (error) {
|
|
84131
|
+
console.warn("[SlashMenu] Unable to determine redo availability via editor.can():", error);
|
|
83862
84132
|
}
|
|
83863
84133
|
}
|
|
83864
|
-
|
|
83865
|
-
|
|
83866
|
-
|
|
83867
|
-
|
|
83868
|
-
|
|
83869
|
-
|
|
83870
|
-
if (fromMarks || toMarks) {
|
|
83871
|
-
return true;
|
|
83872
|
-
}
|
|
83873
|
-
if (empty2 && markType.isInSet(state2.storedMarks || $from.marks())) {
|
|
83874
|
-
return true;
|
|
83875
|
-
}
|
|
83876
|
-
} else {
|
|
83877
|
-
if (empty2) {
|
|
83878
|
-
if (markType.isInSet(state2.storedMarks || $from.marks())) {
|
|
83879
|
-
return true;
|
|
83880
|
-
}
|
|
83881
|
-
} else {
|
|
83882
|
-
let hasMark = false;
|
|
83883
|
-
state2.doc.nodesBetween(from2, to, (node) => {
|
|
83884
|
-
if (markType.isInSet(node.marks)) {
|
|
83885
|
-
hasMark = true;
|
|
83886
|
-
return false;
|
|
83887
|
-
}
|
|
83888
|
-
});
|
|
83889
|
-
if (hasMark) return true;
|
|
83890
|
-
}
|
|
84134
|
+
if (isCollaborationEnabled(editor)) {
|
|
84135
|
+
try {
|
|
84136
|
+
const undoManager = yUndoPluginKey.getState(state2)?.undoManager;
|
|
84137
|
+
return !!undoManager && undoManager.redoStack.length > 0;
|
|
84138
|
+
} catch (error) {
|
|
84139
|
+
console.warn("[SlashMenu] Unable to determine redo availability via y-prosemirror:", error);
|
|
83891
84140
|
}
|
|
83892
84141
|
}
|
|
83893
|
-
|
|
84142
|
+
try {
|
|
84143
|
+
return redoDepth(state2) > 0;
|
|
84144
|
+
} catch (error) {
|
|
84145
|
+
console.warn("[SlashMenu] Unable to determine redo availability via history plugin:", error);
|
|
84146
|
+
return false;
|
|
84147
|
+
}
|
|
83894
84148
|
}
|
|
83895
|
-
function
|
|
83896
|
-
|
|
83897
|
-
|
|
83898
|
-
|
|
83899
|
-
|
|
83900
|
-
const
|
|
83901
|
-
|
|
83902
|
-
|
|
84149
|
+
function isCollaborationEnabled(editor) {
|
|
84150
|
+
return Boolean(editor?.options?.collaborationProvider && editor?.options?.ydoc);
|
|
84151
|
+
}
|
|
84152
|
+
function getStructureFromResolvedPos(state2, pos) {
|
|
84153
|
+
try {
|
|
84154
|
+
const $pos = state2.doc.resolve(pos);
|
|
84155
|
+
const ancestors = /* @__PURE__ */ new Set();
|
|
84156
|
+
for (let depth = $pos.depth; depth > 0; depth--) {
|
|
84157
|
+
ancestors.add($pos.node(depth).type.name);
|
|
84158
|
+
}
|
|
84159
|
+
const isInList = ancestors.has("bulletList") || ancestors.has("orderedList");
|
|
84160
|
+
const isInTable2 = ancestors.has("table") || ancestors.has("tableRow") || ancestors.has("tableCell") || ancestors.has("tableHeader");
|
|
84161
|
+
const isInSectionNode = ancestors.has("documentSection");
|
|
84162
|
+
return {
|
|
84163
|
+
isInTable: isInTable2,
|
|
84164
|
+
isInList,
|
|
84165
|
+
isInSectionNode
|
|
84166
|
+
};
|
|
84167
|
+
} catch (error) {
|
|
84168
|
+
console.warn("[SlashMenu] Unable to resolve position for structural context:", error);
|
|
84169
|
+
return null;
|
|
83903
84170
|
}
|
|
83904
84171
|
}
|
|
83905
84172
|
const isModuleEnabled = (editorOptions, moduleName) => {
|
|
@@ -83913,8 +84180,52 @@ const isModuleEnabled = (editorOptions, moduleName) => {
|
|
|
83913
84180
|
return true;
|
|
83914
84181
|
}
|
|
83915
84182
|
};
|
|
84183
|
+
function applyCustomMenuConfiguration(defaultSections, context) {
|
|
84184
|
+
const { editor } = context;
|
|
84185
|
+
const slashMenuConfig = editor.options?.slashMenuConfig;
|
|
84186
|
+
if (!slashMenuConfig) {
|
|
84187
|
+
return defaultSections;
|
|
84188
|
+
}
|
|
84189
|
+
let sections = [];
|
|
84190
|
+
if (slashMenuConfig.includeDefaultItems !== false) {
|
|
84191
|
+
sections = [...defaultSections];
|
|
84192
|
+
}
|
|
84193
|
+
if (slashMenuConfig.customItems && Array.isArray(slashMenuConfig.customItems)) {
|
|
84194
|
+
sections = [...sections, ...slashMenuConfig.customItems];
|
|
84195
|
+
}
|
|
84196
|
+
if (typeof slashMenuConfig.menuProvider === "function") {
|
|
84197
|
+
try {
|
|
84198
|
+
sections = slashMenuConfig.menuProvider(context, sections) || sections;
|
|
84199
|
+
} catch (error) {
|
|
84200
|
+
console.warn("[SlashMenu] Error in custom menuProvider:", error);
|
|
84201
|
+
}
|
|
84202
|
+
}
|
|
84203
|
+
return sections;
|
|
84204
|
+
}
|
|
84205
|
+
function filterCustomItems(sections, context) {
|
|
84206
|
+
return sections.map((section) => {
|
|
84207
|
+
const filteredItems = section.items.filter((item) => {
|
|
84208
|
+
if (typeof item.showWhen === "function") {
|
|
84209
|
+
try {
|
|
84210
|
+
return item.showWhen(context);
|
|
84211
|
+
} catch (error) {
|
|
84212
|
+
console.warn(`[SlashMenu] Error in showWhen for item ${item.id}:`, error);
|
|
84213
|
+
return false;
|
|
84214
|
+
}
|
|
84215
|
+
}
|
|
84216
|
+
return true;
|
|
84217
|
+
});
|
|
84218
|
+
return {
|
|
84219
|
+
...section,
|
|
84220
|
+
items: filteredItems
|
|
84221
|
+
};
|
|
84222
|
+
}).filter((section) => section.items.length > 0);
|
|
84223
|
+
}
|
|
83916
84224
|
function getItems(context) {
|
|
83917
84225
|
const { editor, selectedText, trigger: trigger2, clipboardContent } = context;
|
|
84226
|
+
const clipboardHasContent = Boolean(
|
|
84227
|
+
clipboardContent?.hasContent || clipboardContent?.html || clipboardContent?.text || typeof clipboardContent?.size === "number" && clipboardContent.size > 0 || clipboardContent && typeof clipboardContent?.content?.size === "number" && clipboardContent.content.size > 0 || clipboardContent?.raw && typeof clipboardContent.raw.size === "number" && clipboardContent.raw.size > 0 || clipboardContent?.raw && typeof clipboardContent.raw?.content?.size === "number" && clipboardContent.raw.content.size > 0
|
|
84228
|
+
);
|
|
83918
84229
|
const isInTable2 = selectionHasNodeOrMark(editor.view.state, "table", { requireEnds: true });
|
|
83919
84230
|
const isInSectionNode = selectionHasNodeOrMark(editor.view.state, "documentSection", { requireEnds: true });
|
|
83920
84231
|
const sections = [
|
|
@@ -84051,12 +84362,13 @@ function getItems(context) {
|
|
|
84051
84362
|
]
|
|
84052
84363
|
}
|
|
84053
84364
|
];
|
|
84054
|
-
|
|
84365
|
+
let allSections = applyCustomMenuConfiguration(sections, context);
|
|
84366
|
+
const filteredSections = allSections.map((section) => {
|
|
84055
84367
|
const filteredItems = section.items.filter((item) => {
|
|
84056
84368
|
if (item.requiresModule && !isModuleEnabled(editor?.options, item.requiresModule)) return false;
|
|
84057
84369
|
if (item.requiresSelection && !selectedText) return false;
|
|
84058
84370
|
if (!item.allowedTriggers.includes(trigger2)) return false;
|
|
84059
|
-
if (item.requiresClipboard && !
|
|
84371
|
+
if (item.requiresClipboard && !clipboardHasContent) return false;
|
|
84060
84372
|
if (item.requiresTableParent && !isInTable2 || item.id === "insert-table" && isInTable2) return false;
|
|
84061
84373
|
if (item.requiresSectionParent && !isInSectionNode) return false;
|
|
84062
84374
|
return true;
|
|
@@ -84066,7 +84378,8 @@ function getItems(context) {
|
|
|
84066
84378
|
items: filteredItems
|
|
84067
84379
|
};
|
|
84068
84380
|
}).filter((section) => section.items.length > 0);
|
|
84069
|
-
|
|
84381
|
+
const finalSections = filterCustomItems(filteredSections, context);
|
|
84382
|
+
return finalSections;
|
|
84070
84383
|
}
|
|
84071
84384
|
const _hoisted_1$3 = { class: "slash-menu-items" };
|
|
84072
84385
|
const _hoisted_2$1 = {
|
|
@@ -84101,6 +84414,7 @@ const _sfc_main$4 = {
|
|
|
84101
84414
|
const menuRef = vue.ref(null);
|
|
84102
84415
|
const sections = vue.ref([]);
|
|
84103
84416
|
const selectedId = vue.ref(null);
|
|
84417
|
+
const currentContext = vue.ref(null);
|
|
84104
84418
|
const handleEditorUpdate = () => {
|
|
84105
84419
|
if (!props.editor?.isEditable && isOpen.value) {
|
|
84106
84420
|
closeMenu({ restoreCursor: false });
|
|
@@ -84146,6 +84460,44 @@ const _sfc_main$4 = {
|
|
|
84146
84460
|
selectedId.value = newItems[0].id;
|
|
84147
84461
|
}
|
|
84148
84462
|
});
|
|
84463
|
+
const customItemRefs = /* @__PURE__ */ new Map();
|
|
84464
|
+
const setCustomItemRef = (el, item) => {
|
|
84465
|
+
if (el && item.render) {
|
|
84466
|
+
customItemRefs.set(item.id, { element: el, item });
|
|
84467
|
+
vue.nextTick(() => {
|
|
84468
|
+
renderCustomItem(item.id);
|
|
84469
|
+
});
|
|
84470
|
+
}
|
|
84471
|
+
};
|
|
84472
|
+
const renderCustomItem = async (itemId) => {
|
|
84473
|
+
const refData = customItemRefs.get(itemId);
|
|
84474
|
+
if (!refData || refData.element.hasCustomContent) return;
|
|
84475
|
+
const { element, item } = refData;
|
|
84476
|
+
try {
|
|
84477
|
+
if (!currentContext.value) {
|
|
84478
|
+
currentContext.value = await getEditorContext(props.editor);
|
|
84479
|
+
}
|
|
84480
|
+
const context = currentContext.value;
|
|
84481
|
+
const customElement = item.render(context);
|
|
84482
|
+
if (customElement instanceof HTMLElement) {
|
|
84483
|
+
element.innerHTML = "";
|
|
84484
|
+
element.appendChild(customElement);
|
|
84485
|
+
element.hasCustomContent = true;
|
|
84486
|
+
}
|
|
84487
|
+
} catch (error) {
|
|
84488
|
+
console.warn(`[SlashMenu] Error rendering custom item ${itemId}:`, error);
|
|
84489
|
+
element.innerHTML = `<span>${item.label || "Custom Item"}</span>`;
|
|
84490
|
+
element.hasCustomContent = true;
|
|
84491
|
+
}
|
|
84492
|
+
};
|
|
84493
|
+
const cleanupCustomItems = () => {
|
|
84494
|
+
customItemRefs.forEach((refData) => {
|
|
84495
|
+
if (refData.element) {
|
|
84496
|
+
refData.element.hasCustomContent = false;
|
|
84497
|
+
}
|
|
84498
|
+
});
|
|
84499
|
+
customItemRefs.clear();
|
|
84500
|
+
};
|
|
84149
84501
|
const handleGlobalKeyDown = (event) => {
|
|
84150
84502
|
if (event.key === "Escape") {
|
|
84151
84503
|
event.preventDefault();
|
|
@@ -84191,27 +84543,27 @@ const _sfc_main$4 = {
|
|
|
84191
84543
|
};
|
|
84192
84544
|
const handleRightClick = async (event) => {
|
|
84193
84545
|
const readOnly = !props.editor?.isEditable;
|
|
84194
|
-
|
|
84195
|
-
if (readOnly || isHoldingCtrl) {
|
|
84546
|
+
if (readOnly || shouldBypassContextMenu(event)) {
|
|
84196
84547
|
return;
|
|
84197
84548
|
}
|
|
84198
84549
|
event.preventDefault();
|
|
84550
|
+
const context = await getEditorContext(props.editor, event);
|
|
84551
|
+
currentContext.value = context;
|
|
84552
|
+
sections.value = getItems({ ...context, trigger: "click" });
|
|
84553
|
+
selectedId.value = flattenedItems.value[0]?.id || null;
|
|
84554
|
+
searchQuery.value = "";
|
|
84199
84555
|
props.editor.view.dispatch(
|
|
84200
84556
|
props.editor.view.state.tr.setMeta(SlashMenuPluginKey, {
|
|
84201
84557
|
type: "open",
|
|
84202
|
-
pos: props.editor.view.state.selection.from,
|
|
84558
|
+
pos: context?.pos ?? props.editor.view.state.selection.from,
|
|
84203
84559
|
clientX: event.clientX,
|
|
84204
84560
|
clientY: event.clientY
|
|
84205
84561
|
})
|
|
84206
84562
|
);
|
|
84207
|
-
searchQuery.value = "";
|
|
84208
|
-
const context = await getEditorContext(props.editor, event);
|
|
84209
|
-
sections.value = getItems({ ...context, trigger: "click" });
|
|
84210
|
-
selectedId.value = flattenedItems.value[0]?.id || null;
|
|
84211
84563
|
};
|
|
84212
84564
|
const executeCommand = async (item) => {
|
|
84213
84565
|
if (props.editor) {
|
|
84214
|
-
item.action ? await item.action(props.editor) : null;
|
|
84566
|
+
item.action ? await item.action(props.editor, currentContext.value) : null;
|
|
84215
84567
|
if (item.component) {
|
|
84216
84568
|
menuRef.value;
|
|
84217
84569
|
const componentProps = getPropsByItemId(item.id, props);
|
|
@@ -84229,7 +84581,7 @@ const _sfc_main$4 = {
|
|
|
84229
84581
|
const closeMenu = (options = { restoreCursor: true }) => {
|
|
84230
84582
|
if (props.editor?.view) {
|
|
84231
84583
|
const pluginState = SlashMenuPluginKey.getState(props.editor.view.state);
|
|
84232
|
-
const
|
|
84584
|
+
const anchorPos = pluginState?.anchorPos;
|
|
84233
84585
|
props.editor.view.dispatch(
|
|
84234
84586
|
props.editor.view.state.tr.setMeta(SlashMenuPluginKey, {
|
|
84235
84587
|
type: "close"
|
|
@@ -84242,6 +84594,8 @@ const _sfc_main$4 = {
|
|
|
84242
84594
|
props.editor.view.dispatch(tr);
|
|
84243
84595
|
props.editor.view.focus();
|
|
84244
84596
|
}
|
|
84597
|
+
cleanupCustomItems();
|
|
84598
|
+
currentContext.value = null;
|
|
84245
84599
|
isOpen.value = false;
|
|
84246
84600
|
searchQuery.value = "";
|
|
84247
84601
|
sections.value = [];
|
|
@@ -84258,19 +84612,29 @@ const _sfc_main$4 = {
|
|
|
84258
84612
|
isOpen.value = true;
|
|
84259
84613
|
menuPosition.value = event.menuPosition;
|
|
84260
84614
|
searchQuery.value = "";
|
|
84261
|
-
|
|
84262
|
-
|
|
84263
|
-
|
|
84615
|
+
if (!currentContext.value) {
|
|
84616
|
+
const context = await getEditorContext(props.editor);
|
|
84617
|
+
currentContext.value = context;
|
|
84618
|
+
sections.value = getItems({ ...context, trigger: "slash" });
|
|
84619
|
+
selectedId.value = flattenedItems.value[0]?.id || null;
|
|
84620
|
+
} else if (sections.value.length === 0) {
|
|
84621
|
+
const trigger2 = currentContext.value.event?.type === "contextmenu" ? "click" : "slash";
|
|
84622
|
+
sections.value = getItems({ ...currentContext.value, trigger: trigger2 });
|
|
84623
|
+
selectedId.value = flattenedItems.value[0]?.id || null;
|
|
84624
|
+
}
|
|
84264
84625
|
});
|
|
84265
84626
|
props.editor.view.dom.addEventListener("contextmenu", handleRightClick);
|
|
84266
84627
|
props.editor.on("slashMenu:close", () => {
|
|
84628
|
+
cleanupCustomItems();
|
|
84267
84629
|
isOpen.value = false;
|
|
84268
84630
|
searchQuery.value = "";
|
|
84631
|
+
currentContext.value = null;
|
|
84269
84632
|
});
|
|
84270
84633
|
});
|
|
84271
84634
|
vue.onBeforeUnmount(() => {
|
|
84272
84635
|
document.removeEventListener("keydown", handleGlobalKeyDown);
|
|
84273
84636
|
document.removeEventListener("mousedown", handleGlobalOutsideClick);
|
|
84637
|
+
cleanupCustomItems();
|
|
84274
84638
|
if (props.editor) {
|
|
84275
84639
|
try {
|
|
84276
84640
|
props.editor.off("slashMenu:open");
|
|
@@ -84317,12 +84681,19 @@ const _sfc_main$4 = {
|
|
|
84317
84681
|
class: vue.normalizeClass(["slash-menu-item", { "is-selected": item.id === selectedId.value }]),
|
|
84318
84682
|
onClick: ($event) => executeCommand(item)
|
|
84319
84683
|
}, [
|
|
84320
|
-
item.
|
|
84684
|
+
item.render ? (vue.openBlock(), vue.createElementBlock("div", {
|
|
84321
84685
|
key: 0,
|
|
84322
|
-
|
|
84323
|
-
|
|
84324
|
-
|
|
84325
|
-
|
|
84686
|
+
ref_for: true,
|
|
84687
|
+
ref: (el) => setCustomItemRef(el, item),
|
|
84688
|
+
class: "slash-menu-custom-item"
|
|
84689
|
+
}, null, 512)) : (vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: 1 }, [
|
|
84690
|
+
item.icon ? (vue.openBlock(), vue.createElementBlock("span", {
|
|
84691
|
+
key: 0,
|
|
84692
|
+
class: "slash-menu-item-icon",
|
|
84693
|
+
innerHTML: item.icon
|
|
84694
|
+
}, null, 8, _hoisted_4)) : vue.createCommentVNode("", true),
|
|
84695
|
+
vue.createBaseVNode("span", null, vue.toDisplayString(item.label), 1)
|
|
84696
|
+
], 64))
|
|
84326
84697
|
], 10, _hoisted_3$1);
|
|
84327
84698
|
}), 128))
|
|
84328
84699
|
], 64);
|
|
@@ -85017,34 +85388,76 @@ const _sfc_main = {
|
|
|
85017
85388
|
}
|
|
85018
85389
|
};
|
|
85019
85390
|
const SuperInput = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-4d5cff52"]]);
|
|
85391
|
+
const additionalHandlers = Object.freeze({
|
|
85392
|
+
"mc:AlternateContent": translator,
|
|
85393
|
+
"w:b": translator$12,
|
|
85394
|
+
"w:bidiVisual": translator$F,
|
|
85395
|
+
"w:bookmarkEnd": translator$1,
|
|
85396
|
+
"w:bookmarkStart": translator$2,
|
|
85397
|
+
"w:bottom": translator$s,
|
|
85398
|
+
"w:br": translator$16,
|
|
85399
|
+
"w:cantSplit": translator$T,
|
|
85400
|
+
"w:cnfStyle": translator$S,
|
|
85401
|
+
"w:color": translator$_,
|
|
85402
|
+
"w:divId": translator$R,
|
|
85403
|
+
"w:drawing": translator$4,
|
|
85404
|
+
"w:end": translator$q,
|
|
85405
|
+
"w:gridAfter": translator$Q,
|
|
85406
|
+
"w:gridBefore": translator$P,
|
|
85407
|
+
"w:gridCol": translator$b,
|
|
85408
|
+
"w:hidden": translator$O,
|
|
85409
|
+
"w:highlight": translator$15,
|
|
85410
|
+
"w:hyperlink": translator$7,
|
|
85411
|
+
"w:i": translator$11,
|
|
85412
|
+
"w:insideH": translator$o,
|
|
85413
|
+
"w:insideV": translator$n,
|
|
85414
|
+
"w:jc": translator$N,
|
|
85415
|
+
"w:left": translator$m,
|
|
85416
|
+
"w:p": translator$13,
|
|
85417
|
+
"w:r": translator$U,
|
|
85418
|
+
"w:rFonts": translator$Z,
|
|
85419
|
+
"w:rPr": translator$V,
|
|
85420
|
+
"w:rStyle": translator$Y,
|
|
85421
|
+
"w:right": translator$k,
|
|
85422
|
+
"w:sdt": translator$3,
|
|
85423
|
+
"w:shd": translator$E,
|
|
85424
|
+
"w:start": translator$i,
|
|
85425
|
+
"w:strike": translator$$,
|
|
85426
|
+
"w:sz": translator$X,
|
|
85427
|
+
"w:szCs": translator$W,
|
|
85428
|
+
"w:tab": translator$14,
|
|
85429
|
+
"w:tbl": translator$9,
|
|
85430
|
+
"w:tblBorders": translator$e,
|
|
85431
|
+
"w:tblCaption": translator$D,
|
|
85432
|
+
"w:tblCellMar": translator$d,
|
|
85433
|
+
"w:tblCellSpacing": translator$M,
|
|
85434
|
+
"w:tblDescription": translator$C,
|
|
85435
|
+
"w:tblGrid": translator$a,
|
|
85436
|
+
"w:tblHeader": translator$L,
|
|
85437
|
+
"w:tblInd": translator$B,
|
|
85438
|
+
"w:tblLayout": translator$A,
|
|
85439
|
+
"w:tblLook": translator$z,
|
|
85440
|
+
"w:tblOverlap": translator$y,
|
|
85441
|
+
"w:tblPr": translator$c,
|
|
85442
|
+
"w:tblStyle": translator$x,
|
|
85443
|
+
"w:tblStyleColBandSize": translator$w,
|
|
85444
|
+
"w:tblStyleRowBandSize": translator$v,
|
|
85445
|
+
"w:tblW": translator$u,
|
|
85446
|
+
"w:tblpPr": translator$t,
|
|
85447
|
+
"w:tc": translator$8,
|
|
85448
|
+
"w:top": translator$g,
|
|
85449
|
+
"w:tr": translator$G,
|
|
85450
|
+
"w:trHeight": translator$K,
|
|
85451
|
+
"w:trPr": translator$H,
|
|
85452
|
+
"w:u": translator$10,
|
|
85453
|
+
"w:wAfter": translator$J,
|
|
85454
|
+
"w:wBefore": translator$I,
|
|
85455
|
+
"wp:anchor": translator$6,
|
|
85456
|
+
"wp:inline": translator$5
|
|
85457
|
+
});
|
|
85020
85458
|
const baseHandlers = {
|
|
85021
85459
|
...runPropertyTranslators,
|
|
85022
|
-
|
|
85023
|
-
"w:cantSplit": translator$S,
|
|
85024
|
-
"w:cnfStyle": translator$R,
|
|
85025
|
-
"w:divId": translator$Q,
|
|
85026
|
-
"w:gridAfter": translator$P,
|
|
85027
|
-
"w:gridBefore": translator$O,
|
|
85028
|
-
"w:hidden": translator$N,
|
|
85029
|
-
"w:hyperlink": translator$6,
|
|
85030
|
-
"w:jc": translator$M,
|
|
85031
|
-
"w:p": translator$12,
|
|
85032
|
-
"w:r": translator$T,
|
|
85033
|
-
"w:rPr": translator$U,
|
|
85034
|
-
"w:sdt": translator$2,
|
|
85035
|
-
"w:tab": translator$13,
|
|
85036
|
-
"w:tblCellSpacing": translator$L,
|
|
85037
|
-
"w:tblHeader": translator$K,
|
|
85038
|
-
"w:tc": translator$7,
|
|
85039
|
-
"w:tr": translator$F,
|
|
85040
|
-
"w:trHeight": translator$J,
|
|
85041
|
-
"w:trPr": translator$G,
|
|
85042
|
-
"w:wAfter": translator$I,
|
|
85043
|
-
"w:wBefore": translator$H,
|
|
85044
|
-
"wp:anchor": translator$5,
|
|
85045
|
-
"wp:inline": translator$4,
|
|
85046
|
-
"w:bookmarkStart": translator$1,
|
|
85047
|
-
"w:bookmarkEnd": translator
|
|
85460
|
+
...additionalHandlers
|
|
85048
85461
|
};
|
|
85049
85462
|
const registeredHandlers = Object.freeze(baseHandlers);
|
|
85050
85463
|
const Extensions = {
|