@harbour-enterprises/superdoc 0.21.0-next.7 → 0.21.0

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.
Files changed (41) hide show
  1. package/dist/chunks/{PdfViewer-B8R1j6LP.es.js → PdfViewer-D3zo7tPo.es.js} +1 -1
  2. package/dist/chunks/{PdfViewer-DWWRw_re.cjs → PdfViewer-OZDJ7gwT.cjs} +1 -1
  3. package/dist/chunks/{index-Bpp8Ruyf.cjs → index-CfYf4T_z.cjs} +3 -4
  4. package/dist/chunks/{index-CLGEbkfW.es.js → index-MzW5BVNd.es.js} +3 -4
  5. package/dist/chunks/{super-editor.es-DWm41myg.es.js → super-editor.es-Bntob7Wd.es.js} +761 -1155
  6. package/dist/chunks/{super-editor.es-aBw27Tag.cjs → super-editor.es-U-GVCd_F.cjs} +761 -1155
  7. package/dist/core/types/index.d.ts +0 -8
  8. package/dist/core/types/index.d.ts.map +1 -1
  9. package/dist/style.css +27 -32
  10. package/dist/super-editor/ai-writer.es.js +2 -2
  11. package/dist/super-editor/chunks/{converter-DYAHhSrg.js → converter-3xnF_NHq.js} +643 -773
  12. package/dist/super-editor/chunks/{docx-zipper-BDbCmfbE.js → docx-zipper-CZdELYi-.js} +1 -1
  13. package/dist/super-editor/chunks/{editor-VW8eKYoK.js → editor-BqYH4kDD.js} +2 -4
  14. package/dist/super-editor/chunks/{toolbar-B1up5fYV.js → toolbar-TkaE2kKM.js} +2 -2
  15. package/dist/super-editor/converter.es.js +1 -1
  16. package/dist/super-editor/docx-zipper.es.js +2 -2
  17. package/dist/super-editor/editor.es.js +3 -3
  18. package/dist/super-editor/file-zipper.es.js +1 -1
  19. package/dist/super-editor/src/components/slash-menu/menuItems.d.ts +1 -5
  20. package/dist/super-editor/src/components/slash-menu/utils.d.ts +2 -9
  21. package/dist/super-editor/src/extensions/run-item/index.d.ts +1 -0
  22. package/dist/super-editor/src/extensions/run-item/run-item.d.ts +26 -0
  23. package/dist/super-editor/src/tests/helpers/helpers.d.ts +0 -1
  24. package/dist/super-editor/style.css +0 -5
  25. package/dist/super-editor/super-editor.es.js +151 -452
  26. package/dist/super-editor/toolbar.es.js +2 -2
  27. package/dist/super-editor.cjs +1 -1
  28. package/dist/super-editor.es.js +1 -1
  29. package/dist/superdoc.cjs +2 -2
  30. package/dist/superdoc.es.js +2 -2
  31. package/dist/superdoc.umd.js +762 -1157
  32. package/dist/superdoc.umd.js.map +1 -1
  33. package/package.json +1 -1
  34. package/dist/super-editor/src/components/slash-menu/tests/testHelpers.d.ts +0 -466
  35. package/dist/super-editor/src/core/commands/__tests__/schemaWithLists.d.ts +0 -2
  36. package/dist/super-editor/src/core/commands/__tests__/testHelpers.d.ts +0 -4
  37. package/dist/super-editor/src/core/commands/__tests__/testSchema.d.ts +0 -2
  38. package/dist/super-editor/src/core/commands/tests/commandTestUtils.d.ts +0 -7
  39. package/dist/super-editor/src/core/commands/tests/test-schema.d.ts +0 -2
  40. package/dist/super-editor/src/core/super-converter/v3/handlers/mc/altermateContent/alternate-content-translator.d.ts +0 -6
  41. package/dist/super-editor/src/core/super-converter/v3/handlers/mc/altermateContent/index.d.ts +0 -1
@@ -24316,37 +24316,37 @@ const _NodeTranslator = class _NodeTranslator2 {
24316
24316
  };
24317
24317
  __publicField$2(_NodeTranslator, "translatorTypes", TranslatorTypes);
24318
24318
  let NodeTranslator = _NodeTranslator;
24319
- const encode$18 = (attributes) => {
24319
+ const encode$17 = (attributes) => {
24320
24320
  return attributes["w:type"];
24321
24321
  };
24322
- const decode$$ = (attrs) => {
24322
+ const decode$_ = (attrs) => {
24323
24323
  const { lineBreakType } = attrs;
24324
24324
  return lineBreakType;
24325
24325
  };
24326
24326
  const attrConfig$F = Object.freeze({
24327
24327
  xmlName: "w:type",
24328
24328
  sdName: "lineBreakType",
24329
- encode: encode$18,
24330
- decode: decode$$
24329
+ encode: encode$17,
24330
+ decode: decode$_
24331
24331
  });
24332
- const encode$17 = (attributes) => {
24332
+ const encode$16 = (attributes) => {
24333
24333
  const xmlAttrValue = attributes["w:clear"];
24334
24334
  return xmlAttrValue;
24335
24335
  };
24336
- const decode$_ = (attrs) => {
24336
+ const decode$Z = (attrs) => {
24337
24337
  const { clear } = attrs;
24338
24338
  return clear;
24339
24339
  };
24340
24340
  const attrConfig$E = Object.freeze({
24341
24341
  xmlName: "w:clear",
24342
24342
  sdName: "clear",
24343
- encode: encode$17,
24344
- decode: decode$_
24343
+ encode: encode$16,
24344
+ decode: decode$Z
24345
24345
  });
24346
- const validXmlAttributes$m = [attrConfig$F, attrConfig$E];
24347
- const XML_NODE_NAME$u = "w:br";
24348
- const SD_NODE_NAME$d = "lineBreak";
24349
- const encode$16 = (_2, encodedAttrs) => {
24346
+ const validXmlAttributes$l = [attrConfig$F, attrConfig$E];
24347
+ const XML_NODE_NAME$t = "w:br";
24348
+ const SD_NODE_NAME$c = "lineBreak";
24349
+ const encode$15 = (_2, encodedAttrs) => {
24350
24350
  const isPageBreak = encodedAttrs?.lineBreakType === "page";
24351
24351
  const translated = {
24352
24352
  type: isPageBreak ? "hardBreak" : "lineBreak"
@@ -24356,7 +24356,7 @@ const encode$16 = (_2, encodedAttrs) => {
24356
24356
  }
24357
24357
  return translated;
24358
24358
  };
24359
- const decode$Z = (params2, decodedAttrs) => {
24359
+ const decode$Y = (params2, decodedAttrs) => {
24360
24360
  const { node } = params2;
24361
24361
  if (!node) return;
24362
24362
  const wBreak = { name: "w:br" };
@@ -24373,39 +24373,39 @@ const decode$Z = (params2, decodedAttrs) => {
24373
24373
  };
24374
24374
  return translated;
24375
24375
  };
24376
- const config$s = {
24377
- xmlName: XML_NODE_NAME$u,
24378
- sdNodeOrKeyName: SD_NODE_NAME$d,
24376
+ const config$r = {
24377
+ xmlName: XML_NODE_NAME$t,
24378
+ sdNodeOrKeyName: SD_NODE_NAME$c,
24379
24379
  type: NodeTranslator.translatorTypes.NODE,
24380
- encode: encode$16,
24381
- decode: decode$Z,
24382
- attributes: validXmlAttributes$m
24380
+ encode: encode$15,
24381
+ decode: decode$Y,
24382
+ attributes: validXmlAttributes$l
24383
24383
  };
24384
- const translator$16 = NodeTranslator.from(config$s);
24385
- const encode$15 = (attributes) => attributes?.["w:val"];
24386
- const decode$Y = (attrs) => attrs?.highlight;
24384
+ const translator$15 = NodeTranslator.from(config$r);
24385
+ const encode$14 = (attributes) => attributes?.["w:val"];
24386
+ const decode$X = (attrs) => attrs?.highlight;
24387
24387
  const attrConfig$D = Object.freeze({
24388
24388
  xmlName: "w:val",
24389
24389
  sdName: "highlight",
24390
- encode: encode$15,
24391
- decode: decode$Y
24390
+ encode: encode$14,
24391
+ decode: decode$X
24392
24392
  });
24393
- const validXmlAttributes$l = [attrConfig$D];
24394
- const XML_NODE_NAME$t = "w:highlight";
24393
+ const validXmlAttributes$k = [attrConfig$D];
24394
+ const XML_NODE_NAME$s = "w:highlight";
24395
24395
  const SD_ATTR_KEY$f = "highlight";
24396
24396
  const DISABLED_TOKENS = /* @__PURE__ */ new Set(["transparent", "none", "inherit"]);
24397
- const encode$14 = (params2, encodedAttrs = {}) => {
24397
+ const encode$13 = (params2, encodedAttrs = {}) => {
24398
24398
  const { nodes } = params2;
24399
24399
  const node = nodes?.[0];
24400
24400
  const value = encodedAttrs.highlight ?? node?.attributes?.["w:val"];
24401
24401
  return {
24402
24402
  type: "attr",
24403
- xmlName: XML_NODE_NAME$t,
24403
+ xmlName: XML_NODE_NAME$s,
24404
24404
  sdNodeOrKeyName: SD_ATTR_KEY$f,
24405
24405
  attributes: { "w:val": value ?? null }
24406
24406
  };
24407
24407
  };
24408
- const decode$X = (params2) => {
24408
+ const decode$W = (params2) => {
24409
24409
  const attrs = params2?.node?.attrs || {};
24410
24410
  const highlightValue = attrs.highlight ?? attrs.color ?? null;
24411
24411
  if (!highlightValue) return void 0;
@@ -24413,14 +24413,14 @@ const decode$X = (params2) => {
24413
24413
  if (!normalizedValue) return void 0;
24414
24414
  if (DISABLED_TOKENS.has(normalizedValue)) {
24415
24415
  return {
24416
- name: XML_NODE_NAME$t,
24416
+ name: XML_NODE_NAME$s,
24417
24417
  attributes: { "w:val": "none" }
24418
24418
  };
24419
24419
  }
24420
24420
  const keyword = getDocxHighlightKeywordFromHex(highlightValue);
24421
24421
  if (keyword) {
24422
24422
  return {
24423
- name: XML_NODE_NAME$t,
24423
+ name: XML_NODE_NAME$s,
24424
24424
  attributes: { "w:val": keyword }
24425
24425
  };
24426
24426
  }
@@ -24435,63 +24435,63 @@ const decode$X = (params2) => {
24435
24435
  }
24436
24436
  };
24437
24437
  };
24438
- const config$r = {
24439
- xmlName: XML_NODE_NAME$t,
24438
+ const config$q = {
24439
+ xmlName: XML_NODE_NAME$s,
24440
24440
  sdNodeOrKeyName: SD_ATTR_KEY$f,
24441
24441
  type: NodeTranslator.translatorTypes.ATTRIBUTE,
24442
- encode: encode$14,
24443
- decode: decode$X,
24444
- attributes: validXmlAttributes$l
24442
+ encode: encode$13,
24443
+ decode: decode$W,
24444
+ attributes: validXmlAttributes$k
24445
24445
  };
24446
- const translator$15 = NodeTranslator.from(config$r);
24447
- const encode$13 = (attributes) => {
24446
+ const translator$14 = NodeTranslator.from(config$q);
24447
+ const encode$12 = (attributes) => {
24448
24448
  return attributes["w:val"];
24449
24449
  };
24450
- const decode$W = (attrs) => {
24450
+ const decode$V = (attrs) => {
24451
24451
  const { tabSize } = attrs || {};
24452
24452
  return tabSize;
24453
24453
  };
24454
24454
  const attrConfig$C = Object.freeze({
24455
24455
  xmlName: "w:val",
24456
24456
  sdName: "tabSize",
24457
- encode: encode$13,
24458
- decode: decode$W
24457
+ encode: encode$12,
24458
+ decode: decode$V
24459
24459
  });
24460
- const encode$12 = (attributes) => {
24460
+ const encode$11 = (attributes) => {
24461
24461
  return attributes["w:leader"];
24462
24462
  };
24463
- const decode$V = (attrs) => {
24463
+ const decode$U = (attrs) => {
24464
24464
  const { leader } = attrs || {};
24465
24465
  return leader;
24466
24466
  };
24467
24467
  const attrConfig$B = Object.freeze({
24468
24468
  xmlName: "w:leader",
24469
24469
  sdName: "leader",
24470
- encode: encode$12,
24471
- decode: decode$V
24470
+ encode: encode$11,
24471
+ decode: decode$U
24472
24472
  });
24473
- const encode$11 = (attributes) => {
24473
+ const encode$10 = (attributes) => {
24474
24474
  return attributes["w:pos"];
24475
24475
  };
24476
- const decode$U = (attrs) => {
24476
+ const decode$T = (attrs) => {
24477
24477
  const { pos } = attrs || {};
24478
24478
  return pos;
24479
24479
  };
24480
24480
  const attrConfig$A = Object.freeze({
24481
24481
  xmlName: "w:pos",
24482
24482
  sdName: "pos",
24483
- encode: encode$11,
24484
- decode: decode$U
24483
+ encode: encode$10,
24484
+ decode: decode$T
24485
24485
  });
24486
- const validXmlAttributes$k = [attrConfig$C, attrConfig$A, attrConfig$B];
24487
- const XML_NODE_NAME$s = "w:tab";
24488
- const SD_NODE_NAME$c = "tab";
24489
- const encode$10 = (_2, encodedAttrs = {}) => {
24486
+ const validXmlAttributes$j = [attrConfig$C, attrConfig$A, attrConfig$B];
24487
+ const XML_NODE_NAME$r = "w:tab";
24488
+ const SD_NODE_NAME$b = "tab";
24489
+ const encode$$ = (_2, encodedAttrs = {}) => {
24490
24490
  const translated = { type: "tab" };
24491
24491
  if (encodedAttrs) translated.attrs = { ...encodedAttrs };
24492
24492
  return translated;
24493
24493
  };
24494
- const decode$T = (params2, decodedAttrs = {}) => {
24494
+ const decode$S = (params2, decodedAttrs = {}) => {
24495
24495
  const { node } = params2 || {};
24496
24496
  if (!node) return;
24497
24497
  const wTab = { name: "w:tab" };
@@ -24507,15 +24507,15 @@ const decode$T = (params2, decodedAttrs = {}) => {
24507
24507
  }
24508
24508
  return translated;
24509
24509
  };
24510
- const config$q = {
24511
- xmlName: XML_NODE_NAME$s,
24512
- sdNodeOrKeyName: SD_NODE_NAME$c,
24510
+ const config$p = {
24511
+ xmlName: XML_NODE_NAME$r,
24512
+ sdNodeOrKeyName: SD_NODE_NAME$b,
24513
24513
  type: NodeTranslator.translatorTypes.NODE,
24514
- encode: encode$10,
24515
- decode: decode$T,
24516
- attributes: validXmlAttributes$k
24514
+ encode: encode$$,
24515
+ decode: decode$S,
24516
+ attributes: validXmlAttributes$j
24517
24517
  };
24518
- const translator$14 = NodeTranslator.from(config$q);
24518
+ const translator$13 = NodeTranslator.from(config$p);
24519
24519
  const mergeTextNodes = (nodes) => {
24520
24520
  if (!nodes || !Array.isArray(nodes)) {
24521
24521
  return nodes;
@@ -25130,91 +25130,91 @@ const handleParagraphNode$1 = (params2) => {
25130
25130
  }
25131
25131
  return schemaNode;
25132
25132
  };
25133
- const encode$$ = (attributes) => {
25133
+ const encode$_ = (attributes) => {
25134
25134
  return attributes["w:rsidDel"];
25135
25135
  };
25136
- const decode$S = (attrs) => {
25136
+ const decode$R = (attrs) => {
25137
25137
  return attrs.rsidDel;
25138
25138
  };
25139
25139
  const attrConfig$z = Object.freeze({
25140
25140
  xmlName: "w:rsidDel",
25141
25141
  sdName: "rsidDel",
25142
- encode: encode$$,
25143
- decode: decode$S
25142
+ encode: encode$_,
25143
+ decode: decode$R
25144
25144
  });
25145
- const encode$_ = (attributes) => {
25145
+ const encode$Z = (attributes) => {
25146
25146
  return attributes["w:rsidP"];
25147
25147
  };
25148
- const decode$R = (attrs) => {
25148
+ const decode$Q = (attrs) => {
25149
25149
  return attrs.rsidP;
25150
25150
  };
25151
25151
  const attrConfig$y = Object.freeze({
25152
25152
  xmlName: "w:rsidP",
25153
25153
  sdName: "rsidP",
25154
- encode: encode$_,
25155
- decode: decode$R
25154
+ encode: encode$Z,
25155
+ decode: decode$Q
25156
25156
  });
25157
- const encode$Z = (attributes) => {
25157
+ const encode$Y = (attributes) => {
25158
25158
  return attributes["w:rsidR"];
25159
25159
  };
25160
- const decode$Q = (attrs) => {
25160
+ const decode$P = (attrs) => {
25161
25161
  return attrs.rsidR;
25162
25162
  };
25163
25163
  const attrConfig$x = Object.freeze({
25164
25164
  xmlName: "w:rsidR",
25165
25165
  sdName: "rsidR",
25166
- encode: encode$Z,
25167
- decode: decode$Q
25166
+ encode: encode$Y,
25167
+ decode: decode$P
25168
25168
  });
25169
- const encode$Y = (attributes) => {
25169
+ const encode$X = (attributes) => {
25170
25170
  return attributes["w:rsidRPr"];
25171
25171
  };
25172
- const decode$P = (attrs) => {
25172
+ const decode$O = (attrs) => {
25173
25173
  return attrs.rsidRPr;
25174
25174
  };
25175
25175
  const attrConfig$w = Object.freeze({
25176
25176
  xmlName: "w:rsidRPr",
25177
25177
  sdName: "rsidRPr",
25178
- encode: encode$Y,
25179
- decode: decode$P
25178
+ encode: encode$X,
25179
+ decode: decode$O
25180
25180
  });
25181
- const encode$X = (attributes) => {
25181
+ const encode$W = (attributes) => {
25182
25182
  return attributes["w:rsidRDefault"];
25183
25183
  };
25184
- const decode$O = (attrs) => {
25184
+ const decode$N = (attrs) => {
25185
25185
  return attrs.rsidRDefault;
25186
25186
  };
25187
25187
  const attrConfig$v = Object.freeze({
25188
25188
  xmlName: "w:rsidRDefault",
25189
25189
  sdName: "rsidRDefault",
25190
- encode: encode$X,
25191
- decode: decode$O
25190
+ encode: encode$W,
25191
+ decode: decode$N
25192
25192
  });
25193
- const encode$W = (attributes) => {
25193
+ const encode$V = (attributes) => {
25194
25194
  return attributes["w14:paraId"];
25195
25195
  };
25196
- const decode$N = (attrs) => {
25196
+ const decode$M = (attrs) => {
25197
25197
  return attrs.paraId;
25198
25198
  };
25199
25199
  const attrConfig$u = Object.freeze({
25200
25200
  xmlName: "w14:paraId",
25201
25201
  sdName: "paraId",
25202
- encode: encode$W,
25203
- decode: decode$N
25202
+ encode: encode$V,
25203
+ decode: decode$M
25204
25204
  });
25205
- const encode$V = (attributes) => {
25205
+ const encode$U = (attributes) => {
25206
25206
  return attributes["w14:textId"];
25207
25207
  };
25208
- const decode$M = (attrs) => {
25208
+ const decode$L = (attrs) => {
25209
25209
  return attrs.textId;
25210
25210
  };
25211
25211
  const attrConfig$t = Object.freeze({
25212
25212
  xmlName: "w14:textId",
25213
25213
  sdName: "textId",
25214
- encode: encode$V,
25215
- decode: decode$M
25214
+ encode: encode$U,
25215
+ decode: decode$L
25216
25216
  });
25217
- const validXmlAttributes$j = [
25217
+ const validXmlAttributes$i = [
25218
25218
  attrConfig$u,
25219
25219
  attrConfig$t,
25220
25220
  attrConfig$x,
@@ -25223,9 +25223,9 @@ const validXmlAttributes$j = [
25223
25223
  attrConfig$w,
25224
25224
  attrConfig$z
25225
25225
  ];
25226
- const XML_NODE_NAME$r = "w:p";
25227
- const SD_NODE_NAME$b = "paragraph";
25228
- const encode$U = (params2, encodedAttrs = {}) => {
25226
+ const XML_NODE_NAME$q = "w:p";
25227
+ const SD_NODE_NAME$a = "paragraph";
25228
+ const encode$T = (params2, encodedAttrs = {}) => {
25229
25229
  const node = handleParagraphNode$1(params2);
25230
25230
  if (!node) return void 0;
25231
25231
  if (encodedAttrs && Object.keys(encodedAttrs).length) {
@@ -25233,7 +25233,7 @@ const encode$U = (params2, encodedAttrs = {}) => {
25233
25233
  }
25234
25234
  return node;
25235
25235
  };
25236
- const decode$L = (params2, decodedAttrs = {}) => {
25236
+ const decode$K = (params2, decodedAttrs = {}) => {
25237
25237
  const translated = translateParagraphNode(params2);
25238
25238
  if (!translated) return void 0;
25239
25239
  if (decodedAttrs && Object.keys(decodedAttrs).length) {
@@ -25241,16 +25241,16 @@ const decode$L = (params2, decodedAttrs = {}) => {
25241
25241
  }
25242
25242
  return translated;
25243
25243
  };
25244
- const config$p = {
25245
- xmlName: XML_NODE_NAME$r,
25246
- sdNodeOrKeyName: SD_NODE_NAME$b,
25244
+ const config$o = {
25245
+ xmlName: XML_NODE_NAME$q,
25246
+ sdNodeOrKeyName: SD_NODE_NAME$a,
25247
25247
  type: NodeTranslator.translatorTypes.NODE,
25248
- encode: encode$U,
25249
- decode: decode$L,
25250
- attributes: validXmlAttributes$j
25248
+ encode: encode$T,
25249
+ decode: decode$K,
25250
+ attributes: validXmlAttributes$i
25251
25251
  };
25252
- const translator$13 = NodeTranslator.from(config$p);
25253
- const encode$T = (attributes) => {
25252
+ const translator$12 = NodeTranslator.from(config$o);
25253
+ const encode$S = (attributes) => {
25254
25254
  const raw = attributes?.["w:val"];
25255
25255
  if (raw === void 0 || raw === null) return void 0;
25256
25256
  if (typeof raw === "boolean") return raw;
@@ -25260,20 +25260,20 @@ const encode$T = (attributes) => {
25260
25260
  if (val === "1" || val === "true" || val === "on") return true;
25261
25261
  return void 0;
25262
25262
  };
25263
- const decode$K = (runProps) => {
25263
+ const decode$J = (runProps) => {
25264
25264
  if (runProps?.bold === false) return "0";
25265
25265
  return void 0;
25266
25266
  };
25267
25267
  const attrConfig$s = Object.freeze({
25268
25268
  xmlName: "w:val",
25269
25269
  sdName: "bold",
25270
- encode: encode$T,
25271
- decode: decode$K
25270
+ encode: encode$S,
25271
+ decode: decode$J
25272
25272
  });
25273
- const validXmlAttributes$i = [attrConfig$s];
25274
- const XML_NODE_NAME$q = "w:b";
25273
+ const validXmlAttributes$h = [attrConfig$s];
25274
+ const XML_NODE_NAME$p = "w:b";
25275
25275
  const SD_ATTR_KEY$e = "bold";
25276
- const encode$S = (params2, encodedAttrs = {}) => {
25276
+ const encode$R = (params2, encodedAttrs = {}) => {
25277
25277
  const { nodes } = params2;
25278
25278
  const node = nodes[0];
25279
25279
  if (!node) return void 0;
@@ -25285,85 +25285,85 @@ const encode$S = (params2, encodedAttrs = {}) => {
25285
25285
  else attributes = node.attributes || {};
25286
25286
  return {
25287
25287
  type: "attr",
25288
- xmlName: XML_NODE_NAME$q,
25288
+ xmlName: XML_NODE_NAME$p,
25289
25289
  sdNodeOrKeyName: SD_ATTR_KEY$e,
25290
25290
  attributes
25291
25291
  };
25292
25292
  };
25293
- const config$o = {
25294
- xmlName: XML_NODE_NAME$q,
25293
+ const config$n = {
25294
+ xmlName: XML_NODE_NAME$p,
25295
25295
  sdNodeOrKeyName: SD_ATTR_KEY$e,
25296
25296
  type: NodeTranslator.translatorTypes.ATTRIBUTE,
25297
- encode: encode$S,
25298
- attributes: validXmlAttributes$i
25297
+ encode: encode$R,
25298
+ attributes: validXmlAttributes$h
25299
25299
  };
25300
- const translator$12 = NodeTranslator.from(config$o);
25301
- const XML_NODE_NAME$p = "w:i";
25300
+ const translator$11 = NodeTranslator.from(config$n);
25301
+ const XML_NODE_NAME$o = "w:i";
25302
25302
  const SD_ATTR_KEY$d = "italic";
25303
- const encode$R = (params2) => {
25303
+ const encode$Q = (params2) => {
25304
25304
  const { nodes } = params2;
25305
25305
  const node = nodes?.[0];
25306
25306
  if (!node) return void 0;
25307
25307
  return {
25308
25308
  type: "attr",
25309
- xmlName: XML_NODE_NAME$p,
25309
+ xmlName: XML_NODE_NAME$o,
25310
25310
  sdNodeOrKeyName: SD_ATTR_KEY$d,
25311
25311
  attributes: {
25312
25312
  "w:val": node.attributes?.["w:val"] ?? null
25313
25313
  }
25314
25314
  };
25315
25315
  };
25316
- const config$n = {
25317
- xmlName: XML_NODE_NAME$p,
25316
+ const config$m = {
25317
+ xmlName: XML_NODE_NAME$o,
25318
25318
  sdNodeOrKeyName: SD_ATTR_KEY$d,
25319
25319
  type: NodeTranslator.translatorTypes.ATTRIBUTE,
25320
- encode: encode$R
25320
+ encode: encode$Q
25321
25321
  };
25322
- const translator$11 = NodeTranslator.from(config$n);
25323
- const encode$Q = (attributes) => attributes?.["w:val"];
25324
- const decode$J = (attrs) => attrs?.underline;
25322
+ const translator$10 = NodeTranslator.from(config$m);
25323
+ const encode$P = (attributes) => attributes?.["w:val"];
25324
+ const decode$I = (attrs) => attrs?.underline;
25325
25325
  const attrConfig$r = Object.freeze({
25326
25326
  xmlName: "w:val",
25327
25327
  sdName: "underline",
25328
- encode: encode$Q,
25329
- decode: decode$J
25328
+ encode: encode$P,
25329
+ decode: decode$I
25330
25330
  });
25331
- const encode$P = (attributes) => attributes?.["w:color"];
25332
- const decode$I = (attrs) => attrs?.color;
25331
+ const encode$O = (attributes) => attributes?.["w:color"];
25332
+ const decode$H = (attrs) => attrs?.color;
25333
25333
  const attrConfig$q = Object.freeze({
25334
25334
  xmlName: "w:color",
25335
25335
  sdName: "color",
25336
- encode: encode$P,
25337
- decode: decode$I
25336
+ encode: encode$O,
25337
+ decode: decode$H
25338
25338
  });
25339
- const encode$O = (attributes) => attributes?.["w:themeColor"];
25340
- const decode$H = (attrs) => attrs?.themeColor;
25339
+ const encode$N = (attributes) => attributes?.["w:themeColor"];
25340
+ const decode$G = (attrs) => attrs?.themeColor;
25341
25341
  const attrConfig$p = Object.freeze({
25342
25342
  xmlName: "w:themeColor",
25343
25343
  sdName: "themeColor",
25344
- encode: encode$O,
25345
- decode: decode$H
25344
+ encode: encode$N,
25345
+ decode: decode$G
25346
25346
  });
25347
- const encode$N = (attributes) => attributes?.["w:themeTint"];
25348
- const decode$G = (attrs) => attrs?.themeTint;
25347
+ const encode$M = (attributes) => attributes?.["w:themeTint"];
25348
+ const decode$F = (attrs) => attrs?.themeTint;
25349
25349
  const attrConfig$o = Object.freeze({
25350
25350
  xmlName: "w:themeTint",
25351
25351
  sdName: "themeTint",
25352
- encode: encode$N,
25353
- decode: decode$G
25352
+ encode: encode$M,
25353
+ decode: decode$F
25354
25354
  });
25355
- const encode$M = (attributes) => attributes?.["w:themeShade"];
25356
- const decode$F = (attrs) => attrs?.themeShade;
25355
+ const encode$L = (attributes) => attributes?.["w:themeShade"];
25356
+ const decode$E = (attrs) => attrs?.themeShade;
25357
25357
  const attrConfig$n = Object.freeze({
25358
25358
  xmlName: "w:themeShade",
25359
25359
  sdName: "themeShade",
25360
- encode: encode$M,
25361
- decode: decode$F
25360
+ encode: encode$L,
25361
+ decode: decode$E
25362
25362
  });
25363
- const validXmlAttributes$h = [attrConfig$r, attrConfig$q, attrConfig$p, attrConfig$o, attrConfig$n];
25364
- const XML_NODE_NAME$o = "w:u";
25363
+ const validXmlAttributes$g = [attrConfig$r, attrConfig$q, attrConfig$p, attrConfig$o, attrConfig$n];
25364
+ const XML_NODE_NAME$n = "w:u";
25365
25365
  const SD_ATTR_KEY$c = "underline";
25366
- const encode$L = (params2, encodedAttrs = {}) => {
25366
+ const encode$K = (params2, encodedAttrs = {}) => {
25367
25367
  const { nodes } = params2;
25368
25368
  const node = nodes?.[0];
25369
25369
  const sourceAttrs = node?.attributes || {};
@@ -25379,12 +25379,12 @@ const encode$L = (params2, encodedAttrs = {}) => {
25379
25379
  if (themeShade !== void 0 && themeShade !== null) attributes["w:themeShade"] = themeShade;
25380
25380
  return {
25381
25381
  type: "attr",
25382
- xmlName: XML_NODE_NAME$o,
25382
+ xmlName: XML_NODE_NAME$n,
25383
25383
  sdNodeOrKeyName: SD_ATTR_KEY$c,
25384
25384
  attributes
25385
25385
  };
25386
25386
  };
25387
- const decode$E = (params2) => {
25387
+ const decode$D = (params2) => {
25388
25388
  const attrs = params2?.node?.attrs || {};
25389
25389
  const underlineType = attrs.underlineType ?? attrs.underline ?? null;
25390
25390
  const color = attrs.underlineColor ?? attrs.color ?? null;
@@ -25402,20 +25402,20 @@ const decode$E = (params2) => {
25402
25402
  if (themeTint) attributes["w:themeTint"] = themeTint;
25403
25403
  if (themeShade) attributes["w:themeShade"] = themeShade;
25404
25404
  return {
25405
- name: XML_NODE_NAME$o,
25405
+ name: XML_NODE_NAME$n,
25406
25406
  attributes
25407
25407
  };
25408
25408
  };
25409
- const config$m = {
25410
- xmlName: XML_NODE_NAME$o,
25409
+ const config$l = {
25410
+ xmlName: XML_NODE_NAME$n,
25411
25411
  sdNodeOrKeyName: SD_ATTR_KEY$c,
25412
25412
  type: NodeTranslator.translatorTypes.ATTRIBUTE,
25413
- encode: encode$L,
25414
- decode: decode$E,
25415
- attributes: validXmlAttributes$h
25413
+ encode: encode$K,
25414
+ decode: decode$D,
25415
+ attributes: validXmlAttributes$g
25416
25416
  };
25417
- const translator$10 = NodeTranslator.from(config$m);
25418
- const encode$K = (attributes) => {
25417
+ const translator$$ = NodeTranslator.from(config$l);
25418
+ const encode$J = (attributes) => {
25419
25419
  const raw = attributes?.["w:val"];
25420
25420
  if (raw === void 0 || raw === null) return void 0;
25421
25421
  if (typeof raw === "boolean") return raw;
@@ -25425,20 +25425,20 @@ const encode$K = (attributes) => {
25425
25425
  if (val === "1" || val === "true" || val === "on") return true;
25426
25426
  return void 0;
25427
25427
  };
25428
- const decode$D = (attrs) => {
25428
+ const decode$C = (attrs) => {
25429
25429
  if (attrs?.strike === false) return "0";
25430
25430
  return void 0;
25431
25431
  };
25432
25432
  const attrConfig$m = Object.freeze({
25433
25433
  xmlName: "w:val",
25434
25434
  sdName: "strike",
25435
- encode: encode$K,
25436
- decode: decode$D
25435
+ encode: encode$J,
25436
+ decode: decode$C
25437
25437
  });
25438
- const validXmlAttributes$g = [attrConfig$m];
25439
- const XML_NODE_NAME$n = "w:strike";
25438
+ const validXmlAttributes$f = [attrConfig$m];
25439
+ const XML_NODE_NAME$m = "w:strike";
25440
25440
  const SD_ATTR_KEY$b = "strike";
25441
- const encode$J = (params2, encodedAttrs = {}) => {
25441
+ const encode$I = (params2, encodedAttrs = {}) => {
25442
25442
  const { nodes } = params2;
25443
25443
  const node = nodes?.[0];
25444
25444
  if (!node) return void 0;
@@ -25451,55 +25451,55 @@ const encode$J = (params2, encodedAttrs = {}) => {
25451
25451
  else if (val === true && attributes["w:val"] === void 0) delete attributes["w:val"];
25452
25452
  return {
25453
25453
  type: "attr",
25454
- xmlName: XML_NODE_NAME$n,
25454
+ xmlName: XML_NODE_NAME$m,
25455
25455
  sdNodeOrKeyName: SD_ATTR_KEY$b,
25456
25456
  attributes
25457
25457
  };
25458
25458
  };
25459
- const config$l = {
25460
- xmlName: XML_NODE_NAME$n,
25459
+ const config$k = {
25460
+ xmlName: XML_NODE_NAME$m,
25461
25461
  sdNodeOrKeyName: SD_ATTR_KEY$b,
25462
25462
  type: NodeTranslator.translatorTypes.ATTRIBUTE,
25463
- encode: encode$J,
25464
- attributes: validXmlAttributes$g
25463
+ encode: encode$I,
25464
+ attributes: validXmlAttributes$f
25465
25465
  };
25466
- const translator$$ = NodeTranslator.from(config$l);
25467
- const encode$I = (attributes) => attributes?.["w:val"];
25468
- const decode$C = (attrs) => attrs?.color;
25466
+ const translator$_ = NodeTranslator.from(config$k);
25467
+ const encode$H = (attributes) => attributes?.["w:val"];
25468
+ const decode$B = (attrs) => attrs?.color;
25469
25469
  const attrConfig$l = Object.freeze({
25470
25470
  xmlName: "w:val",
25471
25471
  sdName: "color",
25472
- encode: encode$I,
25473
- decode: decode$C
25472
+ encode: encode$H,
25473
+ decode: decode$B
25474
25474
  });
25475
- const encode$H = (attributes) => attributes?.["w:themeColor"];
25476
- const decode$B = (attrs) => attrs?.themeColor;
25475
+ const encode$G = (attributes) => attributes?.["w:themeColor"];
25476
+ const decode$A = (attrs) => attrs?.themeColor;
25477
25477
  const attrConfig$k = Object.freeze({
25478
25478
  xmlName: "w:themeColor",
25479
25479
  sdName: "themeColor",
25480
- encode: encode$H,
25481
- decode: decode$B
25480
+ encode: encode$G,
25481
+ decode: decode$A
25482
25482
  });
25483
- const encode$G = (attributes) => attributes?.["w:themeTint"];
25484
- const decode$A = (attrs) => attrs?.themeTint;
25483
+ const encode$F = (attributes) => attributes?.["w:themeTint"];
25484
+ const decode$z = (attrs) => attrs?.themeTint;
25485
25485
  const attrConfig$j = Object.freeze({
25486
25486
  xmlName: "w:themeTint",
25487
25487
  sdName: "themeTint",
25488
- encode: encode$G,
25489
- decode: decode$A
25488
+ encode: encode$F,
25489
+ decode: decode$z
25490
25490
  });
25491
- const encode$F = (attributes) => attributes?.["w:themeShade"];
25492
- const decode$z = (attrs) => attrs?.themeShade;
25491
+ const encode$E = (attributes) => attributes?.["w:themeShade"];
25492
+ const decode$y = (attrs) => attrs?.themeShade;
25493
25493
  const attrConfig$i = Object.freeze({
25494
25494
  xmlName: "w:themeShade",
25495
25495
  sdName: "themeShade",
25496
- encode: encode$F,
25497
- decode: decode$z
25496
+ encode: encode$E,
25497
+ decode: decode$y
25498
25498
  });
25499
- const validXmlAttributes$f = [attrConfig$l, attrConfig$k, attrConfig$j, attrConfig$i];
25500
- const XML_NODE_NAME$m = "w:color";
25499
+ const validXmlAttributes$e = [attrConfig$l, attrConfig$k, attrConfig$j, attrConfig$i];
25500
+ const XML_NODE_NAME$l = "w:color";
25501
25501
  const SD_ATTR_KEY$a = "color";
25502
- const encode$E = (params2, encodedAttrs = {}) => {
25502
+ const encode$D = (params2, encodedAttrs = {}) => {
25503
25503
  const { nodes } = params2;
25504
25504
  const node = nodes?.[0];
25505
25505
  const sourceAttrs = node?.attributes || {};
@@ -25514,63 +25514,63 @@ const encode$E = (params2, encodedAttrs = {}) => {
25514
25514
  if (themeShade !== void 0 && themeShade !== null) attributes["w:themeShade"] = themeShade;
25515
25515
  return {
25516
25516
  type: "attr",
25517
- xmlName: XML_NODE_NAME$m,
25517
+ xmlName: XML_NODE_NAME$l,
25518
25518
  sdNodeOrKeyName: SD_ATTR_KEY$a,
25519
25519
  attributes
25520
25520
  };
25521
25521
  };
25522
- const config$k = {
25523
- xmlName: XML_NODE_NAME$m,
25522
+ const config$j = {
25523
+ xmlName: XML_NODE_NAME$l,
25524
25524
  sdNodeOrKeyName: SD_ATTR_KEY$a,
25525
25525
  type: NodeTranslator.translatorTypes.ATTRIBUTE,
25526
- encode: encode$E,
25527
- attributes: validXmlAttributes$f
25526
+ encode: encode$D,
25527
+ attributes: validXmlAttributes$e
25528
25528
  };
25529
- const translator$_ = NodeTranslator.from(config$k);
25530
- const encode$D = (attributes) => attributes?.["w:eastAsia"];
25531
- const decode$y = (attrs) => attrs?.eastAsia;
25529
+ const translator$Z = NodeTranslator.from(config$j);
25530
+ const encode$C = (attributes) => attributes?.["w:eastAsia"];
25531
+ const decode$x = (attrs) => attrs?.eastAsia;
25532
25532
  const attrConfig$h = Object.freeze({
25533
25533
  xmlName: "w:eastAsia",
25534
25534
  sdName: "eastAsia",
25535
- encode: encode$D,
25536
- decode: decode$y
25535
+ encode: encode$C,
25536
+ decode: decode$x
25537
25537
  });
25538
- const encode$C = (attributes) => attributes?.["w:ascii"];
25539
- const decode$x = (attrs) => attrs?.ascii;
25538
+ const encode$B = (attributes) => attributes?.["w:ascii"];
25539
+ const decode$w = (attrs) => attrs?.ascii;
25540
25540
  const attrConfig$g = Object.freeze({
25541
25541
  xmlName: "w:ascii",
25542
25542
  sdName: "ascii",
25543
- encode: encode$C,
25544
- decode: decode$x
25543
+ encode: encode$B,
25544
+ decode: decode$w
25545
25545
  });
25546
- const encode$B = (attributes) => attributes?.["w:hAnsi"];
25547
- const decode$w = (attrs) => attrs?.hAnsi;
25546
+ const encode$A = (attributes) => attributes?.["w:hAnsi"];
25547
+ const decode$v = (attrs) => attrs?.hAnsi;
25548
25548
  const attrConfig$f = Object.freeze({
25549
25549
  xmlName: "w:hAnsi",
25550
25550
  sdName: "hAnsi",
25551
- encode: encode$B,
25552
- decode: decode$w
25551
+ encode: encode$A,
25552
+ decode: decode$v
25553
25553
  });
25554
- const encode$A = (attributes) => attributes?.["w:cs"];
25555
- const decode$v = (attrs) => attrs?.cs;
25554
+ const encode$z = (attributes) => attributes?.["w:cs"];
25555
+ const decode$u = (attrs) => attrs?.cs;
25556
25556
  const attrConfig$e = Object.freeze({
25557
25557
  xmlName: "w:cs",
25558
25558
  sdName: "cs",
25559
- encode: encode$A,
25560
- decode: decode$v
25559
+ encode: encode$z,
25560
+ decode: decode$u
25561
25561
  });
25562
- const encode$z = (attributes) => attributes?.["w:val"];
25563
- const decode$u = (attrs) => attrs?.value;
25562
+ const encode$y = (attributes) => attributes?.["w:val"];
25563
+ const decode$t = (attrs) => attrs?.value;
25564
25564
  const attrConfig$d = Object.freeze({
25565
25565
  xmlName: "w:val",
25566
25566
  sdName: "value",
25567
- encode: encode$z,
25568
- decode: decode$u
25567
+ encode: encode$y,
25568
+ decode: decode$t
25569
25569
  });
25570
- const validXmlAttributes$e = [attrConfig$h, attrConfig$g, attrConfig$f, attrConfig$e, attrConfig$d];
25571
- const XML_NODE_NAME$l = "w:rFonts";
25570
+ const validXmlAttributes$d = [attrConfig$h, attrConfig$g, attrConfig$f, attrConfig$e, attrConfig$d];
25571
+ const XML_NODE_NAME$k = "w:rFonts";
25572
25572
  const SD_ATTR_KEY$9 = "fontFamily";
25573
- const encode$y = (params2, encodedAttrs = {}) => {
25573
+ const encode$x = (params2, encodedAttrs = {}) => {
25574
25574
  const { nodes } = params2;
25575
25575
  const node = nodes?.[0];
25576
25576
  const sourceAttrs = node?.attributes || {};
@@ -25596,120 +25596,120 @@ const encode$y = (params2, encodedAttrs = {}) => {
25596
25596
  if (attributes["w:val"] === void 0) delete attributes["w:val"];
25597
25597
  return {
25598
25598
  type: "attr",
25599
- xmlName: XML_NODE_NAME$l,
25599
+ xmlName: XML_NODE_NAME$k,
25600
25600
  sdNodeOrKeyName: SD_ATTR_KEY$9,
25601
25601
  attributes
25602
25602
  };
25603
25603
  };
25604
- const config$j = {
25605
- xmlName: XML_NODE_NAME$l,
25604
+ const config$i = {
25605
+ xmlName: XML_NODE_NAME$k,
25606
25606
  sdNodeOrKeyName: SD_ATTR_KEY$9,
25607
25607
  type: NodeTranslator.translatorTypes.ATTRIBUTE,
25608
- encode: encode$y,
25609
- attributes: validXmlAttributes$e
25608
+ encode: encode$x,
25609
+ attributes: validXmlAttributes$d
25610
25610
  };
25611
- const translator$Z = NodeTranslator.from(config$j);
25612
- const encode$x = (attributes) => attributes?.["w:val"];
25613
- const decode$t = (attrs) => attrs?.styleId;
25611
+ const translator$Y = NodeTranslator.from(config$i);
25612
+ const encode$w = (attributes) => attributes?.["w:val"];
25613
+ const decode$s = (attrs) => attrs?.styleId;
25614
25614
  const attrConfig$c = Object.freeze({
25615
25615
  xmlName: "w:val",
25616
25616
  sdName: "styleId",
25617
- encode: encode$x,
25618
- decode: decode$t
25617
+ encode: encode$w,
25618
+ decode: decode$s
25619
25619
  });
25620
- const validXmlAttributes$d = [attrConfig$c];
25621
- const XML_NODE_NAME$k = "w:rStyle";
25620
+ const validXmlAttributes$c = [attrConfig$c];
25621
+ const XML_NODE_NAME$j = "w:rStyle";
25622
25622
  const SD_ATTR_KEY$8 = "styleId";
25623
- const encode$w = (params2, encodedAttrs = {}) => {
25623
+ const encode$v = (params2, encodedAttrs = {}) => {
25624
25624
  const { nodes } = params2;
25625
25625
  const node = nodes?.[0];
25626
25626
  const value = encodedAttrs.styleId ?? node?.attributes?.["w:val"];
25627
25627
  return {
25628
25628
  type: "attr",
25629
- xmlName: XML_NODE_NAME$k,
25629
+ xmlName: XML_NODE_NAME$j,
25630
25630
  sdNodeOrKeyName: SD_ATTR_KEY$8,
25631
25631
  attributes: { "w:val": value ?? null }
25632
25632
  };
25633
25633
  };
25634
- const config$i = {
25635
- xmlName: XML_NODE_NAME$k,
25634
+ const config$h = {
25635
+ xmlName: XML_NODE_NAME$j,
25636
25636
  sdNodeOrKeyName: SD_ATTR_KEY$8,
25637
25637
  type: NodeTranslator.translatorTypes.ATTRIBUTE,
25638
- encode: encode$w,
25639
- attributes: validXmlAttributes$d
25638
+ encode: encode$v,
25639
+ attributes: validXmlAttributes$c
25640
25640
  };
25641
- const translator$Y = NodeTranslator.from(config$i);
25642
- const encode$v = (attributes) => attributes?.["w:val"];
25643
- const decode$s = (attrs) => attrs?.fontSize;
25641
+ const translator$X = NodeTranslator.from(config$h);
25642
+ const encode$u = (attributes) => attributes?.["w:val"];
25643
+ const decode$r = (attrs) => attrs?.fontSize;
25644
25644
  const attrConfig$b = Object.freeze({
25645
25645
  xmlName: "w:val",
25646
25646
  sdName: "fontSize",
25647
- encode: encode$v,
25648
- decode: decode$s
25647
+ encode: encode$u,
25648
+ decode: decode$r
25649
25649
  });
25650
- const validXmlAttributes$c = [attrConfig$b];
25651
- const XML_NODE_NAME$j = "w:sz";
25650
+ const validXmlAttributes$b = [attrConfig$b];
25651
+ const XML_NODE_NAME$i = "w:sz";
25652
25652
  const SD_ATTR_KEY$7 = "fontSize";
25653
- const encode$u = (params2, encodedAttrs = {}) => {
25653
+ const encode$t = (params2, encodedAttrs = {}) => {
25654
25654
  const { nodes } = params2;
25655
25655
  const node = nodes?.[0];
25656
25656
  const value = encodedAttrs.fontSize ?? node?.attributes?.["w:val"];
25657
25657
  return {
25658
25658
  type: "attr",
25659
- xmlName: XML_NODE_NAME$j,
25659
+ xmlName: XML_NODE_NAME$i,
25660
25660
  sdNodeOrKeyName: SD_ATTR_KEY$7,
25661
25661
  attributes: { "w:val": value ?? null }
25662
25662
  };
25663
25663
  };
25664
- const config$h = {
25665
- xmlName: XML_NODE_NAME$j,
25664
+ const config$g = {
25665
+ xmlName: XML_NODE_NAME$i,
25666
25666
  sdNodeOrKeyName: SD_ATTR_KEY$7,
25667
25667
  type: NodeTranslator.translatorTypes.ATTRIBUTE,
25668
- encode: encode$u,
25669
- attributes: validXmlAttributes$c
25668
+ encode: encode$t,
25669
+ attributes: validXmlAttributes$b
25670
25670
  };
25671
- const translator$X = NodeTranslator.from(config$h);
25672
- const encode$t = (attributes) => attributes?.["w:val"];
25673
- const decode$r = (attrs) => attrs?.fontSizeCs;
25671
+ const translator$W = NodeTranslator.from(config$g);
25672
+ const encode$s = (attributes) => attributes?.["w:val"];
25673
+ const decode$q = (attrs) => attrs?.fontSizeCs;
25674
25674
  const attrConfig$a = Object.freeze({
25675
25675
  xmlName: "w:val",
25676
25676
  sdName: "fontSizeCs",
25677
- encode: encode$t,
25678
- decode: decode$r
25677
+ encode: encode$s,
25678
+ decode: decode$q
25679
25679
  });
25680
- const validXmlAttributes$b = [attrConfig$a];
25681
- const XML_NODE_NAME$i = "w:szCs";
25680
+ const validXmlAttributes$a = [attrConfig$a];
25681
+ const XML_NODE_NAME$h = "w:szCs";
25682
25682
  const SD_ATTR_KEY$6 = "fontSizeCs";
25683
- const encode$s = (params2, encodedAttrs = {}) => {
25683
+ const encode$r = (params2, encodedAttrs = {}) => {
25684
25684
  const { nodes } = params2;
25685
25685
  const node = nodes?.[0];
25686
25686
  const value = encodedAttrs.fontSizeCs ?? node?.attributes?.["w:val"];
25687
25687
  return {
25688
25688
  type: "attr",
25689
- xmlName: XML_NODE_NAME$i,
25689
+ xmlName: XML_NODE_NAME$h,
25690
25690
  sdNodeOrKeyName: SD_ATTR_KEY$6,
25691
25691
  attributes: { "w:val": value ?? null }
25692
25692
  };
25693
25693
  };
25694
- const config$g = {
25695
- xmlName: XML_NODE_NAME$i,
25694
+ const config$f = {
25695
+ xmlName: XML_NODE_NAME$h,
25696
25696
  sdNodeOrKeyName: SD_ATTR_KEY$6,
25697
25697
  type: NodeTranslator.translatorTypes.ATTRIBUTE,
25698
- encode: encode$s,
25699
- attributes: validXmlAttributes$b
25698
+ encode: encode$r,
25699
+ attributes: validXmlAttributes$a
25700
25700
  };
25701
- const translator$W = NodeTranslator.from(config$g);
25701
+ const translator$V = NodeTranslator.from(config$f);
25702
25702
  const runPropertyTranslators = Object.freeze({
25703
- "w:b": translator$12,
25704
- "w:i": translator$11,
25705
- "w:u": translator$10,
25706
- "w:strike": translator$$,
25707
- "w:color": translator$_,
25708
- "w:highlight": translator$15,
25709
- "w:rFonts": translator$Z,
25710
- "w:rStyle": translator$Y,
25711
- "w:sz": translator$X,
25712
- "w:szCs": translator$W
25703
+ "w:b": translator$11,
25704
+ "w:i": translator$10,
25705
+ "w:u": translator$$,
25706
+ "w:strike": translator$_,
25707
+ "w:color": translator$Z,
25708
+ "w:highlight": translator$14,
25709
+ "w:rFonts": translator$Y,
25710
+ "w:rStyle": translator$X,
25711
+ "w:sz": translator$W,
25712
+ "w:szCs": translator$V
25713
25713
  });
25714
25714
  const rawRunPropertyXmlNames = Object.freeze(["w:lang", "w:shd"]);
25715
25715
  const RAW_CHILD_NAME_SET = new Set(rawRunPropertyXmlNames);
@@ -25723,9 +25723,9 @@ const toRunPropertyEntry = (candidate) => {
25723
25723
  attributes: { ...candidate.attributes || {} }
25724
25724
  };
25725
25725
  };
25726
- const XML_NODE_NAME$h = "w:rPr";
25726
+ const XML_NODE_NAME$g = "w:rPr";
25727
25727
  const SD_ATTR_KEY$5 = "runProperties";
25728
- const encode$r = (params2) => {
25728
+ const encode$q = (params2) => {
25729
25729
  const { nodes } = params2;
25730
25730
  const node = nodes?.[0] || {};
25731
25731
  const contents = Array.isArray(node.elements) ? node.elements : [];
@@ -25759,16 +25759,16 @@ const encode$r = (params2) => {
25759
25759
  attributes: runPropsArray
25760
25760
  };
25761
25761
  };
25762
- const config$f = {
25763
- xmlName: XML_NODE_NAME$h,
25762
+ const config$e = {
25763
+ xmlName: XML_NODE_NAME$g,
25764
25764
  sdNodeOrKeyName: SD_ATTR_KEY$5,
25765
25765
  type: NodeTranslator.translatorTypes.ATTRIBUTE,
25766
- encode: encode$r
25766
+ encode: encode$q
25767
25767
  };
25768
- const translator$V = NodeTranslator.from(config$f);
25768
+ const translator$U = NodeTranslator.from(config$e);
25769
25769
  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;
25770
25770
  const containsEastAsianCharacters = (text) => EAST_ASIAN_CHARACTER_REGEX.test(text);
25771
- const collectRunProperties = (params2, rPrNode, translator2 = translator$V) => {
25771
+ const collectRunProperties = (params2, rPrNode, translator2 = translator$U) => {
25772
25772
  if (!rPrNode) return { entries: [], hadRPr: false, styleChangeMarks: [] };
25773
25773
  const result = translator2.encode({ ...params2, nodes: [rPrNode] }) || {};
25774
25774
  let entries = [];
@@ -26230,46 +26230,46 @@ const ensureTrackedWrapper = (runs, trackingMarksByType = /* @__PURE__ */ new Ma
26230
26230
  }
26231
26231
  return runs;
26232
26232
  };
26233
- const encode$q = (attributes) => {
26233
+ const encode$p = (attributes) => {
26234
26234
  return attributes["w:rsidR"];
26235
26235
  };
26236
- const decode$q = (attrs) => {
26236
+ const decode$p = (attrs) => {
26237
26237
  return attrs.rsidR;
26238
26238
  };
26239
26239
  const attrConfig$9 = Object.freeze({
26240
26240
  xmlName: "w:rsidR",
26241
26241
  sdName: "rsidR",
26242
- encode: encode$q,
26243
- decode: decode$q
26242
+ encode: encode$p,
26243
+ decode: decode$p
26244
26244
  });
26245
- const encode$p = (attributes) => {
26245
+ const encode$o = (attributes) => {
26246
26246
  return attributes["w:rsidRPr"];
26247
26247
  };
26248
- const decode$p = (attrs) => {
26248
+ const decode$o = (attrs) => {
26249
26249
  return attrs.rsidRPr;
26250
26250
  };
26251
26251
  const attrConfig$8 = Object.freeze({
26252
26252
  xmlName: "w:rsidRPr",
26253
26253
  sdName: "rsidRPr",
26254
- encode: encode$p,
26255
- decode: decode$p
26254
+ encode: encode$o,
26255
+ decode: decode$o
26256
26256
  });
26257
- const encode$o = (attributes) => {
26257
+ const encode$n = (attributes) => {
26258
26258
  return attributes["w:rsidDel"];
26259
26259
  };
26260
- const decode$o = (attrs) => {
26260
+ const decode$n = (attrs) => {
26261
26261
  return attrs.rsidDel;
26262
26262
  };
26263
26263
  const attrConfig$7 = Object.freeze({
26264
26264
  xmlName: "w:rsidDel",
26265
26265
  sdName: "rsidDel",
26266
- encode: encode$o,
26267
- decode: decode$o
26266
+ encode: encode$n,
26267
+ decode: decode$n
26268
26268
  });
26269
- const validXmlAttributes$a = [attrConfig$9, attrConfig$8, attrConfig$7];
26270
- const XML_NODE_NAME$g = "w:r";
26269
+ const validXmlAttributes$9 = [attrConfig$9, attrConfig$8, attrConfig$7];
26270
+ const XML_NODE_NAME$f = "w:r";
26271
26271
  const SD_KEY_NAME = "run";
26272
- const encode$n = (params2, encodedAttrs = {}) => {
26272
+ const encode$m = (params2, encodedAttrs = {}) => {
26273
26273
  const { nodes = [], nodeListHandler } = params2 || {};
26274
26274
  const runNode = nodes[0];
26275
26275
  if (!runNode) return void 0;
@@ -26317,7 +26317,7 @@ const encode$n = (params2, encodedAttrs = {}) => {
26317
26317
  }
26318
26318
  return runNodeResult;
26319
26319
  };
26320
- const decode$n = (params2, decodedAttrs = {}) => {
26320
+ const decode$m = (params2, decodedAttrs = {}) => {
26321
26321
  const { node } = params2 || {};
26322
26322
  if (!node) return void 0;
26323
26323
  const { runNode: runNodeForExport, trackingMarksByType } = prepareRunTrackingContext(node);
@@ -26374,7 +26374,7 @@ const decode$n = (params2, decodedAttrs = {}) => {
26374
26374
  runs.push(trackedClone);
26375
26375
  return;
26376
26376
  }
26377
- const runWrapper = { name: XML_NODE_NAME$g, elements: [] };
26377
+ const runWrapper = { name: XML_NODE_NAME$f, elements: [] };
26378
26378
  applyBaseRunProps(runWrapper);
26379
26379
  if (!Array.isArray(runWrapper.elements)) runWrapper.elements = [];
26380
26380
  runWrapper.elements.push(cloneXmlNode(child));
@@ -26382,7 +26382,7 @@ const decode$n = (params2, decodedAttrs = {}) => {
26382
26382
  });
26383
26383
  const trackedRuns = ensureTrackedWrapper(runs, trackingMarksByType);
26384
26384
  if (!trackedRuns.length) {
26385
- const emptyRun = { name: XML_NODE_NAME$g, elements: [] };
26385
+ const emptyRun = { name: XML_NODE_NAME$f, elements: [] };
26386
26386
  applyBaseRunProps(emptyRun);
26387
26387
  trackedRuns.push(emptyRun);
26388
26388
  }
@@ -26396,15 +26396,15 @@ const decode$n = (params2, decodedAttrs = {}) => {
26396
26396
  }
26397
26397
  return trackedRuns;
26398
26398
  };
26399
- const config$e = {
26400
- xmlName: XML_NODE_NAME$g,
26399
+ const config$d = {
26400
+ xmlName: XML_NODE_NAME$f,
26401
26401
  sdNodeOrKeyName: SD_KEY_NAME,
26402
26402
  type: NodeTranslator.translatorTypes.NODE,
26403
- encode: encode$n,
26404
- decode: decode$n,
26405
- attributes: validXmlAttributes$a
26403
+ encode: encode$m,
26404
+ decode: decode$m,
26405
+ attributes: validXmlAttributes$9
26406
26406
  };
26407
- const translator$U = NodeTranslator.from(config$e);
26407
+ const translator$T = NodeTranslator.from(config$d);
26408
26408
  const generateV2HandlerEntity = (handlerName, translator2) => ({
26409
26409
  handlerName,
26410
26410
  handler: (params2) => {
@@ -26578,13 +26578,13 @@ function preProcessVerticalMergeCells(table, { editorSchema }) {
26578
26578
  }
26579
26579
  return table;
26580
26580
  }
26581
- const translator$T = NodeTranslator.from({
26581
+ const translator$S = NodeTranslator.from({
26582
26582
  xmlName: "w:cantSplit",
26583
26583
  sdNodeOrKeyName: "cantSplit",
26584
26584
  encode: ({ nodes }) => ["1", "true"].includes(nodes[0].attributes?.["w:val"] ?? "1"),
26585
26585
  decode: ({ node }) => node.attrs?.cantSplit ? { attributes: {} } : void 0
26586
26586
  });
26587
- const translator$S = NodeTranslator.from({
26587
+ const translator$R = NodeTranslator.from({
26588
26588
  xmlName: "w:cnfStyle",
26589
26589
  sdNodeOrKeyName: "cnfStyle",
26590
26590
  attributes: [
@@ -26610,8 +26610,8 @@ const translator$S = NodeTranslator.from({
26610
26610
  return Object.keys(decodedAttrs).length > 0 ? { attributes: decodedAttrs } : void 0;
26611
26611
  }
26612
26612
  });
26613
- const translator$R = NodeTranslator.from(createSingleAttrPropertyHandler("w:divId"));
26614
- const translator$Q = NodeTranslator.from(
26613
+ const translator$Q = NodeTranslator.from(createSingleAttrPropertyHandler("w:divId"));
26614
+ const translator$P = NodeTranslator.from(
26615
26615
  createSingleAttrPropertyHandler(
26616
26616
  "w:gridAfter",
26617
26617
  null,
@@ -26620,7 +26620,7 @@ const translator$Q = NodeTranslator.from(
26620
26620
  (v2) => integerToString(v2)
26621
26621
  )
26622
26622
  );
26623
- const translator$P = NodeTranslator.from(
26623
+ const translator$O = NodeTranslator.from(
26624
26624
  createSingleAttrPropertyHandler(
26625
26625
  "w:gridBefore",
26626
26626
  null,
@@ -26629,21 +26629,21 @@ const translator$P = NodeTranslator.from(
26629
26629
  (v2) => integerToString(v2)
26630
26630
  )
26631
26631
  );
26632
- const translator$O = NodeTranslator.from({
26632
+ const translator$N = NodeTranslator.from({
26633
26633
  xmlName: "w:hidden",
26634
26634
  sdNodeOrKeyName: "hidden",
26635
26635
  encode: ({ nodes }) => parseBoolean(nodes[0].attributes?.["w:val"] ?? "1"),
26636
26636
  decode: ({ node }) => node.attrs.hidden ? { attributes: {} } : void 0
26637
26637
  });
26638
- const translator$N = NodeTranslator.from(createSingleAttrPropertyHandler("w:jc", "justification"));
26639
- const translator$M = NodeTranslator.from(createMeasurementPropertyHandler("w:tblCellSpacing", "tableCellSpacing"));
26640
- const translator$L = NodeTranslator.from({
26638
+ const translator$M = NodeTranslator.from(createSingleAttrPropertyHandler("w:jc", "justification"));
26639
+ const translator$L = NodeTranslator.from(createMeasurementPropertyHandler("w:tblCellSpacing", "tableCellSpacing"));
26640
+ const translator$K = NodeTranslator.from({
26641
26641
  xmlName: "w:tblHeader",
26642
26642
  sdNodeOrKeyName: "repeatHeader",
26643
26643
  encode: ({ nodes }) => parseBoolean(nodes[0].attributes?.["w:val"] ?? "1"),
26644
26644
  decode: ({ node }) => node.attrs.repeatHeader ? { attributes: {} } : void 0
26645
26645
  });
26646
- const translator$K = NodeTranslator.from({
26646
+ const translator$J = NodeTranslator.from({
26647
26647
  xmlName: "w:trHeight",
26648
26648
  sdNodeOrKeyName: "rowHeight",
26649
26649
  encode: ({ nodes }) => {
@@ -26670,11 +26670,11 @@ const translator$K = NodeTranslator.from({
26670
26670
  return Object.keys(heightAttrs).length > 0 ? { attributes: heightAttrs } : void 0;
26671
26671
  }
26672
26672
  });
26673
- const translator$J = NodeTranslator.from(createMeasurementPropertyHandler("w:wAfter"));
26674
- const translator$I = NodeTranslator.from(createMeasurementPropertyHandler("w:wBefore"));
26675
- const XML_NODE_NAME$f = "w:trPr";
26673
+ const translator$I = NodeTranslator.from(createMeasurementPropertyHandler("w:wAfter"));
26674
+ const translator$H = NodeTranslator.from(createMeasurementPropertyHandler("w:wBefore"));
26675
+ const XML_NODE_NAME$e = "w:trPr";
26676
26676
  const SD_ATTR_KEY$4 = "tableRowProperties";
26677
- const encode$m = (params2) => {
26677
+ const encode$l = (params2) => {
26678
26678
  const { nodes } = params2;
26679
26679
  const node = nodes[0];
26680
26680
  let attributes = {
@@ -26688,12 +26688,12 @@ const encode$m = (params2) => {
26688
26688
  };
26689
26689
  return {
26690
26690
  type: NodeTranslator.translatorTypes.ATTRIBUTE,
26691
- xmlName: XML_NODE_NAME$f,
26691
+ xmlName: XML_NODE_NAME$e,
26692
26692
  sdNodeOrKeyName: SD_ATTR_KEY$4,
26693
26693
  attributes
26694
26694
  };
26695
26695
  };
26696
- const decode$m = (params2) => {
26696
+ const decode$l = (params2) => {
26697
26697
  const { tableRowProperties = {} } = params2.node.attrs || {};
26698
26698
  const elements = decodeProperties(propertyTranslatorsBySdName$2, tableRowProperties);
26699
26699
  const newNode = {
@@ -26705,7 +26705,6 @@ const decode$m = (params2) => {
26705
26705
  return newNode;
26706
26706
  };
26707
26707
  const propertyTranslators$3 = [
26708
- translator$T,
26709
26708
  translator$S,
26710
26709
  translator$R,
26711
26710
  translator$Q,
@@ -26716,7 +26715,8 @@ const propertyTranslators$3 = [
26716
26715
  translator$L,
26717
26716
  translator$K,
26718
26717
  translator$J,
26719
- translator$I
26718
+ translator$I,
26719
+ translator$H
26720
26720
  ];
26721
26721
  const propertyTranslatorsByXmlName$2 = {};
26722
26722
  propertyTranslators$3.forEach((translator2) => {
@@ -26726,25 +26726,25 @@ const propertyTranslatorsBySdName$2 = {};
26726
26726
  propertyTranslators$3.forEach((translator2) => {
26727
26727
  propertyTranslatorsBySdName$2[translator2.sdNodeOrKeyName] = translator2;
26728
26728
  });
26729
- const config$d = {
26730
- xmlName: XML_NODE_NAME$f,
26729
+ const config$c = {
26730
+ xmlName: XML_NODE_NAME$e,
26731
26731
  sdNodeOrKeyName: SD_ATTR_KEY$4,
26732
26732
  type: NodeTranslator.translatorTypes.ATTRIBUTE,
26733
- encode: encode$m,
26734
- decode: decode$m
26733
+ encode: encode$l,
26734
+ decode: decode$l
26735
26735
  };
26736
- const translator$H = NodeTranslator.from(config$d);
26737
- const XML_NODE_NAME$e = "w:tr";
26738
- const SD_NODE_NAME$a = "tableRow";
26739
- const validXmlAttributes$9 = ["w:rsidDel", "w:rsidR", "w:rsidRPr", "w:rsidTr", "w14:paraId", "w14:textId"].map(
26736
+ const translator$G = NodeTranslator.from(config$c);
26737
+ const XML_NODE_NAME$d = "w:tr";
26738
+ const SD_NODE_NAME$9 = "tableRow";
26739
+ const validXmlAttributes$8 = ["w:rsidDel", "w:rsidR", "w:rsidRPr", "w:rsidTr", "w14:paraId", "w14:textId"].map(
26740
26740
  (xmlName) => createAttributeHandler(xmlName)
26741
26741
  );
26742
- const encode$l = (params2, encodedAttrs) => {
26742
+ const encode$k = (params2, encodedAttrs) => {
26743
26743
  const { row } = params2.extraParams;
26744
26744
  let tableRowProperties = {};
26745
26745
  const tPr = row.elements.find((el) => el.name === "w:trPr");
26746
26746
  if (tPr) {
26747
- ({ attributes: tableRowProperties } = translator$H.encode({
26747
+ ({ attributes: tableRowProperties } = translator$G.encode({
26748
26748
  ...params2,
26749
26749
  nodes: [tPr]
26750
26750
  }));
@@ -26757,7 +26757,7 @@ const encode$l = (params2, encodedAttrs) => {
26757
26757
  let currentColumnIndex = 0;
26758
26758
  const content = cellNodes?.map((n) => {
26759
26759
  let columnWidth = gridColumnWidths?.[currentColumnIndex] || null;
26760
- const result = translator$8.encode({
26760
+ const result = translator$7.encode({
26761
26761
  ...params2,
26762
26762
  extraParams: {
26763
26763
  ...params2.extraParams,
@@ -26779,7 +26779,7 @@ const encode$l = (params2, encodedAttrs) => {
26779
26779
  };
26780
26780
  return newNode;
26781
26781
  };
26782
- const decode$l = (params2, decodedAttrs) => {
26782
+ const decode$k = (params2, decodedAttrs) => {
26783
26783
  const { node } = params2;
26784
26784
  const elements = translateChildNodes(params2);
26785
26785
  if (node.attrs?.tableRowProperties) {
@@ -26791,7 +26791,7 @@ const decode$l = (params2, decodedAttrs) => {
26791
26791
  }
26792
26792
  }
26793
26793
  tableRowProperties["cantSplit"] = node.attrs["cantSplit"];
26794
- const trPr = translator$H.decode({
26794
+ const trPr = translator$G.decode({
26795
26795
  ...params2,
26796
26796
  node: { ...node, attrs: { ...node.attrs, tableRowProperties } }
26797
26797
  });
@@ -26803,22 +26803,22 @@ const decode$l = (params2, decodedAttrs) => {
26803
26803
  elements
26804
26804
  };
26805
26805
  };
26806
- const config$c = {
26807
- xmlName: XML_NODE_NAME$e,
26808
- sdNodeOrKeyName: SD_NODE_NAME$a,
26806
+ const config$b = {
26807
+ xmlName: XML_NODE_NAME$d,
26808
+ sdNodeOrKeyName: SD_NODE_NAME$9,
26809
26809
  type: NodeTranslator.translatorTypes.NODE,
26810
- encode: encode$l,
26811
- decode: decode$l,
26812
- attributes: validXmlAttributes$9
26810
+ encode: encode$k,
26811
+ decode: decode$k,
26812
+ attributes: validXmlAttributes$8
26813
26813
  };
26814
- const translator$G = NodeTranslator.from(config$c);
26815
- const translator$F = NodeTranslator.from({
26814
+ const translator$F = NodeTranslator.from(config$b);
26815
+ const translator$E = NodeTranslator.from({
26816
26816
  xmlName: "w:bidiVisual",
26817
26817
  sdNodeOrKeyName: "rightToLeft",
26818
26818
  encode: ({ nodes }) => parseBoolean(nodes[0].attributes?.["w:val"] ?? "1"),
26819
26819
  decode: ({ node }) => node.attrs.rightToLeft ? { attributes: {} } : void 0
26820
26820
  });
26821
- const translator$E = NodeTranslator.from({
26821
+ const translator$D = NodeTranslator.from({
26822
26822
  xmlName: "w:shd",
26823
26823
  sdNodeOrKeyName: "shading",
26824
26824
  attributes: [
@@ -26840,11 +26840,11 @@ const translator$E = NodeTranslator.from({
26840
26840
  return Object.keys(decodedAttrs).length > 0 ? { attributes: decodedAttrs } : void 0;
26841
26841
  }
26842
26842
  });
26843
- const translator$D = NodeTranslator.from(createSingleAttrPropertyHandler("w:tblCaption", "caption"));
26844
- const translator$C = NodeTranslator.from(createSingleAttrPropertyHandler("w:tblDescription", "description"));
26845
- const translator$B = NodeTranslator.from(createMeasurementPropertyHandler("w:tblInd", "tableIndent"));
26846
- const translator$A = NodeTranslator.from(createSingleAttrPropertyHandler("w:tblLayout", "tableLayout", "w:type"));
26847
- const translator$z = NodeTranslator.from({
26843
+ const translator$C = NodeTranslator.from(createSingleAttrPropertyHandler("w:tblCaption", "caption"));
26844
+ const translator$B = NodeTranslator.from(createSingleAttrPropertyHandler("w:tblDescription", "description"));
26845
+ const translator$A = NodeTranslator.from(createMeasurementPropertyHandler("w:tblInd", "tableIndent"));
26846
+ const translator$z = NodeTranslator.from(createSingleAttrPropertyHandler("w:tblLayout", "tableLayout", "w:type"));
26847
+ const translator$y = NodeTranslator.from({
26848
26848
  xmlName: "w:tblLook",
26849
26849
  sdNodeOrKeyName: "tblLook",
26850
26850
  attributes: ["w:firstColumn", "w:firstRow", "w:lastColumn", "w:lastRow", "w:noHBand", "w:noVBand"].map((attr) => createAttributeHandler(attr, null, parseBoolean, booleanToString)).concat([createAttributeHandler("w:val")]),
@@ -26856,16 +26856,16 @@ const translator$z = NodeTranslator.from({
26856
26856
  return Object.keys(decodedAttrs).length > 0 ? { attributes: decodedAttrs } : void 0;
26857
26857
  }
26858
26858
  });
26859
- const translator$y = NodeTranslator.from(createSingleAttrPropertyHandler("w:tblOverlap", "overlap"));
26860
- const translator$x = NodeTranslator.from(createSingleAttrPropertyHandler("w:tblStyle", "tableStyleId"));
26861
- const translator$w = NodeTranslator.from(
26859
+ const translator$x = NodeTranslator.from(createSingleAttrPropertyHandler("w:tblOverlap", "overlap"));
26860
+ const translator$w = NodeTranslator.from(createSingleAttrPropertyHandler("w:tblStyle", "tableStyleId"));
26861
+ const translator$v = NodeTranslator.from(
26862
26862
  createSingleAttrPropertyHandler("w:tblStyleColBandSize", "tableStyleColBandSize")
26863
26863
  );
26864
- const translator$v = NodeTranslator.from(
26864
+ const translator$u = NodeTranslator.from(
26865
26865
  createSingleAttrPropertyHandler("w:tblStyleRowBandSize", "tableStyleRowBandSize")
26866
26866
  );
26867
- const translator$u = NodeTranslator.from(createMeasurementPropertyHandler("w:tblW", "tableWidth"));
26868
- const translator$t = NodeTranslator.from({
26867
+ const translator$t = NodeTranslator.from(createMeasurementPropertyHandler("w:tblW", "tableWidth"));
26868
+ const translator$s = NodeTranslator.from({
26869
26869
  xmlName: "w:tblpPr",
26870
26870
  sdNodeOrKeyName: "floatingTableProperties",
26871
26871
  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))),
@@ -26877,29 +26877,29 @@ const translator$t = NodeTranslator.from({
26877
26877
  return Object.keys(decodedAttrs).length > 0 ? { attributes: decodedAttrs } : void 0;
26878
26878
  }
26879
26879
  });
26880
- const translator$s = NodeTranslator.from(createBorderPropertyHandler("w:bottom"));
26881
- const translator$r = NodeTranslator.from(createMeasurementPropertyHandler("w:bottom", "marginBottom"));
26882
- const translator$q = NodeTranslator.from(createBorderPropertyHandler("w:end"));
26883
- const translator$p = NodeTranslator.from(createMeasurementPropertyHandler("w:end", "marginEnd"));
26884
- const translator$o = NodeTranslator.from(createBorderPropertyHandler("w:insideH"));
26885
- const translator$n = NodeTranslator.from(createBorderPropertyHandler("w:insideV"));
26886
- const translator$m = NodeTranslator.from(createBorderPropertyHandler("w:left"));
26887
- const translator$l = NodeTranslator.from(createMeasurementPropertyHandler("w:left", "marginLeft"));
26888
- const translator$k = NodeTranslator.from(createBorderPropertyHandler("w:right"));
26889
- const translator$j = NodeTranslator.from(createMeasurementPropertyHandler("w:right", "marginRight"));
26890
- const translator$i = NodeTranslator.from(createBorderPropertyHandler("w:start"));
26891
- const translator$h = NodeTranslator.from(createMeasurementPropertyHandler("w:start", "marginStart"));
26892
- const translator$g = NodeTranslator.from(createBorderPropertyHandler("w:top"));
26893
- const translator$f = NodeTranslator.from(createMeasurementPropertyHandler("w:top", "marginTop"));
26894
- const XML_NODE_NAME$d = "w:tblBorders";
26880
+ const translator$r = NodeTranslator.from(createBorderPropertyHandler("w:bottom"));
26881
+ const translator$q = NodeTranslator.from(createMeasurementPropertyHandler("w:bottom", "marginBottom"));
26882
+ const translator$p = NodeTranslator.from(createBorderPropertyHandler("w:end"));
26883
+ const translator$o = NodeTranslator.from(createMeasurementPropertyHandler("w:end", "marginEnd"));
26884
+ const translator$n = NodeTranslator.from(createBorderPropertyHandler("w:insideH"));
26885
+ const translator$m = NodeTranslator.from(createBorderPropertyHandler("w:insideV"));
26886
+ const translator$l = NodeTranslator.from(createBorderPropertyHandler("w:left"));
26887
+ const translator$k = NodeTranslator.from(createMeasurementPropertyHandler("w:left", "marginLeft"));
26888
+ const translator$j = NodeTranslator.from(createBorderPropertyHandler("w:right"));
26889
+ const translator$i = NodeTranslator.from(createMeasurementPropertyHandler("w:right", "marginRight"));
26890
+ const translator$h = NodeTranslator.from(createBorderPropertyHandler("w:start"));
26891
+ const translator$g = NodeTranslator.from(createMeasurementPropertyHandler("w:start", "marginStart"));
26892
+ const translator$f = NodeTranslator.from(createBorderPropertyHandler("w:top"));
26893
+ const translator$e = NodeTranslator.from(createMeasurementPropertyHandler("w:top", "marginTop"));
26894
+ const XML_NODE_NAME$c = "w:tblBorders";
26895
26895
  const SD_ATTR_KEY$3 = "borders";
26896
- const encode$k = (params2) => {
26896
+ const encode$j = (params2) => {
26897
26897
  const { nodes } = params2;
26898
26898
  const node = nodes[0];
26899
26899
  const attributes = encodeProperties(node, tblBordersTranslatorsByXmlName);
26900
26900
  return Object.keys(attributes).length > 0 ? attributes : void 0;
26901
26901
  };
26902
- const decode$k = (params2) => {
26902
+ const decode$j = (params2) => {
26903
26903
  const { borders = {} } = params2.node.attrs || {};
26904
26904
  const elements = decodeProperties(tblBordersTranslatorsBySdName, borders);
26905
26905
  const newNode = {
@@ -26911,14 +26911,14 @@ const decode$k = (params2) => {
26911
26911
  return newNode;
26912
26912
  };
26913
26913
  const propertyTranslators$2 = [
26914
- translator$s,
26915
- translator$q,
26916
- translator$o,
26914
+ translator$r,
26915
+ translator$p,
26917
26916
  translator$n,
26918
26917
  translator$m,
26919
- translator$k,
26920
- translator$i,
26921
- translator$g
26918
+ translator$l,
26919
+ translator$j,
26920
+ translator$h,
26921
+ translator$f
26922
26922
  ];
26923
26923
  const tblBordersTranslatorsByXmlName = {};
26924
26924
  const tblBordersTranslatorsBySdName = {};
@@ -26926,27 +26926,27 @@ propertyTranslators$2.forEach((translator2) => {
26926
26926
  tblBordersTranslatorsByXmlName[translator2.xmlName] = translator2;
26927
26927
  tblBordersTranslatorsBySdName[translator2.sdNodeOrKeyName] = translator2;
26928
26928
  });
26929
- const translator$e = NodeTranslator.from({
26930
- xmlName: XML_NODE_NAME$d,
26929
+ const translator$d = NodeTranslator.from({
26930
+ xmlName: XML_NODE_NAME$c,
26931
26931
  sdNodeOrKeyName: SD_ATTR_KEY$3,
26932
26932
  type: NodeTranslator.translatorTypes.NODE,
26933
26933
  attributes: [],
26934
- encode: encode$k,
26935
- decode: decode$k
26934
+ encode: encode$j,
26935
+ decode: decode$j
26936
26936
  });
26937
- const XML_NODE_NAME$c = "w:tblCellMar";
26937
+ const XML_NODE_NAME$b = "w:tblCellMar";
26938
26938
  const SD_ATTR_KEY$2 = "cellMargins";
26939
- const encode$j = (params2) => {
26939
+ const encode$i = (params2) => {
26940
26940
  const { nodes } = params2;
26941
26941
  const node = nodes[0];
26942
26942
  const attributes = encodeProperties(node, propertyTranslatorsByXmlName$1);
26943
26943
  return Object.keys(attributes).length > 0 ? attributes : void 0;
26944
26944
  };
26945
- const decode$j = (params2) => {
26945
+ const decode$i = (params2) => {
26946
26946
  const { cellMargins = {} } = params2.node.attrs || {};
26947
26947
  const elements = decodeProperties(propertyTranslatorsBySdName$1, cellMargins);
26948
26948
  const newNode = {
26949
- name: XML_NODE_NAME$c,
26949
+ name: XML_NODE_NAME$b,
26950
26950
  type: "element",
26951
26951
  attributes: {},
26952
26952
  elements
@@ -26954,12 +26954,12 @@ const decode$j = (params2) => {
26954
26954
  return newNode;
26955
26955
  };
26956
26956
  const propertyTranslators$1 = [
26957
- translator$r,
26958
- translator$p,
26959
- translator$l,
26960
- translator$j,
26961
- translator$h,
26962
- translator$f
26957
+ translator$q,
26958
+ translator$o,
26959
+ translator$k,
26960
+ translator$i,
26961
+ translator$g,
26962
+ translator$e
26963
26963
  ];
26964
26964
  const propertyTranslatorsByXmlName$1 = {};
26965
26965
  const propertyTranslatorsBySdName$1 = {};
@@ -26967,27 +26967,27 @@ propertyTranslators$1.forEach((translator2) => {
26967
26967
  propertyTranslatorsByXmlName$1[translator2.xmlName] = translator2;
26968
26968
  propertyTranslatorsBySdName$1[translator2.sdNodeOrKeyName] = translator2;
26969
26969
  });
26970
- const translator$d = NodeTranslator.from({
26971
- xmlName: XML_NODE_NAME$c,
26970
+ const translator$c = NodeTranslator.from({
26971
+ xmlName: XML_NODE_NAME$b,
26972
26972
  sdNodeOrKeyName: SD_ATTR_KEY$2,
26973
26973
  type: NodeTranslator.translatorTypes.NODE,
26974
26974
  attributes: [],
26975
- encode: encode$j,
26976
- decode: decode$j
26975
+ encode: encode$i,
26976
+ decode: decode$i
26977
26977
  });
26978
- const XML_NODE_NAME$b = "w:tblPr";
26978
+ const XML_NODE_NAME$a = "w:tblPr";
26979
26979
  const SD_ATTR_KEY$1 = "tableProperties";
26980
- const encode$i = (params2) => {
26980
+ const encode$h = (params2) => {
26981
26981
  const { nodes } = params2;
26982
26982
  const node = nodes[0];
26983
26983
  const attributes = encodeProperties(node, propertyTranslatorsByXmlName);
26984
26984
  return {
26985
- xmlName: XML_NODE_NAME$b,
26985
+ xmlName: XML_NODE_NAME$a,
26986
26986
  sdNodeOrKeyName: SD_ATTR_KEY$1,
26987
26987
  attributes
26988
26988
  };
26989
26989
  };
26990
- const decode$i = (params2) => {
26990
+ const decode$h = (params2) => {
26991
26991
  const { tableProperties = {} } = params2.node.attrs || {};
26992
26992
  const elements = decodeProperties(propertyTranslatorsBySdName, tableProperties);
26993
26993
  const newNode = {
@@ -26999,12 +26999,11 @@ const decode$i = (params2) => {
26999
26999
  return newNode;
27000
27000
  };
27001
27001
  const propertyTranslators = [
27002
- translator$F,
27003
- translator$N,
27004
27002
  translator$E,
27005
- translator$D,
27006
27003
  translator$M,
27004
+ translator$D,
27007
27005
  translator$C,
27006
+ translator$L,
27008
27007
  translator$B,
27009
27008
  translator$A,
27010
27009
  translator$z,
@@ -27014,8 +27013,9 @@ const propertyTranslators = [
27014
27013
  translator$v,
27015
27014
  translator$u,
27016
27015
  translator$t,
27017
- translator$e,
27018
- translator$d
27016
+ translator$s,
27017
+ translator$d,
27018
+ translator$c
27019
27019
  ];
27020
27020
  const propertyTranslatorsByXmlName = {};
27021
27021
  const propertyTranslatorsBySdName = {};
@@ -27023,14 +27023,14 @@ propertyTranslators.forEach((translator2) => {
27023
27023
  propertyTranslatorsByXmlName[translator2.xmlName] = translator2;
27024
27024
  propertyTranslatorsBySdName[translator2.sdNodeOrKeyName] = translator2;
27025
27025
  });
27026
- const config$b = {
27027
- xmlName: XML_NODE_NAME$b,
27026
+ const config$a = {
27027
+ xmlName: XML_NODE_NAME$a,
27028
27028
  sdNodeOrKeyName: SD_ATTR_KEY$1,
27029
- encode: encode$i,
27030
- decode: decode$i
27029
+ encode: encode$h,
27030
+ decode: decode$h
27031
27031
  };
27032
- const translator$c = NodeTranslator.from(config$b);
27033
- const translator$b = NodeTranslator.from(
27032
+ const translator$b = NodeTranslator.from(config$a);
27033
+ const translator$a = NodeTranslator.from(
27034
27034
  createSingleAttrPropertyHandler("w:gridCol", "col", "w:w", parseInteger, integerToString)
27035
27035
  );
27036
27036
  const DEFAULT_COLUMN_WIDTH_PX = 100;
@@ -27080,20 +27080,20 @@ const resolveFallbackColumnWidthTwips = (params2, totalColumns, cellMinWidthTwip
27080
27080
  }
27081
27081
  return Math.max(fallbackWidthTwips, cellMinWidthTwips);
27082
27082
  };
27083
- const XML_NODE_NAME$a = "w:tblGrid";
27083
+ const XML_NODE_NAME$9 = "w:tblGrid";
27084
27084
  const SD_ATTR_KEY = "grid";
27085
27085
  const cellMinWidth = pixelsToTwips(10);
27086
- const encode$h = (params2) => {
27086
+ const encode$g = (params2) => {
27087
27087
  const { nodes } = params2;
27088
27088
  const node = nodes[0];
27089
- const attributes = encodeProperties(node, { [translator$b.xmlName]: translator$b }, true);
27089
+ const attributes = encodeProperties(node, { [translator$a.xmlName]: translator$a }, true);
27090
27090
  return {
27091
- xmlName: XML_NODE_NAME$a,
27091
+ xmlName: XML_NODE_NAME$9,
27092
27092
  sdNodeOrKeyName: SD_ATTR_KEY,
27093
27093
  attributes
27094
27094
  };
27095
27095
  };
27096
- const decode$h = (params2) => {
27096
+ const decode$g = (params2) => {
27097
27097
  const { grid: rawGrid } = params2.node.attrs || {};
27098
27098
  const grid = Array.isArray(rawGrid) ? rawGrid : [];
27099
27099
  const { firstRow = {} } = params2.extraParams || {};
@@ -27112,10 +27112,10 @@ const decode$h = (params2) => {
27112
27112
  numericWidth = fallbackColumnWidthTwips;
27113
27113
  }
27114
27114
  numericWidth = Math.max(numericWidth, cellMinWidth);
27115
- const decoded = translator$b.decode({
27115
+ const decoded = translator$a.decode({
27116
27116
  node: { type: (
27117
27117
  /** @type {string} */
27118
- translator$b.sdNodeOrKeyName
27118
+ translator$a.sdNodeOrKeyName
27119
27119
  ), attrs: { col: numericWidth } }
27120
27120
  });
27121
27121
  if (decoded) elements.push(decoded);
@@ -27150,32 +27150,32 @@ const decode$h = (params2) => {
27150
27150
  columnIndex++;
27151
27151
  }
27152
27152
  const newNode = {
27153
- name: XML_NODE_NAME$a,
27153
+ name: XML_NODE_NAME$9,
27154
27154
  attributes: {},
27155
27155
  elements
27156
27156
  };
27157
27157
  return newNode;
27158
27158
  };
27159
- const config$a = {
27160
- xmlName: XML_NODE_NAME$a,
27159
+ const config$9 = {
27160
+ xmlName: XML_NODE_NAME$9,
27161
27161
  sdNodeOrKeyName: SD_ATTR_KEY,
27162
- encode: encode$h,
27163
- decode: decode$h
27162
+ encode: encode$g,
27163
+ decode: decode$g
27164
27164
  };
27165
- const translator$a = NodeTranslator.from(config$a);
27166
- const XML_NODE_NAME$9 = "w:tbl";
27167
- const SD_NODE_NAME$9 = "table";
27168
- const encode$g = (params2, encodedAttrs) => {
27165
+ const translator$9 = NodeTranslator.from(config$9);
27166
+ const XML_NODE_NAME$8 = "w:tbl";
27167
+ const SD_NODE_NAME$8 = "table";
27168
+ const encode$f = (params2, encodedAttrs) => {
27169
27169
  const { nodes } = params2;
27170
27170
  const node = nodes[0];
27171
27171
  const tblPr = node.elements.find((el) => el.name === "w:tblPr");
27172
27172
  if (tblPr) {
27173
- const encodedProperties = translator$c.encode({ ...params2, nodes: [tblPr] });
27173
+ const encodedProperties = translator$b.encode({ ...params2, nodes: [tblPr] });
27174
27174
  encodedAttrs["tableProperties"] = encodedProperties?.attributes || {};
27175
27175
  }
27176
27176
  const tblGrid = node.elements.find((el) => el.name === "w:tblGrid");
27177
27177
  if (tblGrid) {
27178
- encodedAttrs["grid"] = translator$a.encode({ ...params2, nodes: [tblGrid] }).attributes;
27178
+ encodedAttrs["grid"] = translator$9.encode({ ...params2, nodes: [tblGrid] }).attributes;
27179
27179
  }
27180
27180
  [
27181
27181
  "tableStyleId",
@@ -27216,7 +27216,7 @@ const encode$g = (params2, encodedAttrs) => {
27216
27216
  const columnWidths = (encodedAttrs["grid"] ?? []).map((item) => twipsToPixels(item.col));
27217
27217
  const content = [];
27218
27218
  rows.forEach((row) => {
27219
- const result = translator$G.encode({
27219
+ const result = translator$F.encode({
27220
27220
  ...params2,
27221
27221
  nodes: [row],
27222
27222
  extraParams: {
@@ -27235,13 +27235,13 @@ const encode$g = (params2, encodedAttrs) => {
27235
27235
  attrs: encodedAttrs
27236
27236
  };
27237
27237
  };
27238
- const decode$g = (params2, decodedAttrs) => {
27238
+ const decode$f = (params2, decodedAttrs) => {
27239
27239
  params2.node = preProcessVerticalMergeCells(params2.node, params2);
27240
27240
  const { node } = params2;
27241
27241
  const elements = translateChildNodes(params2);
27242
27242
  const firstRow = node.content?.find((n) => n.type === "tableRow");
27243
27243
  const properties = node.attrs.grid;
27244
- const element = translator$a.decode({
27244
+ const element = translator$9.decode({
27245
27245
  ...params2,
27246
27246
  node: { ...node, attrs: { ...node.attrs, grid: properties } },
27247
27247
  extraParams: {
@@ -27251,7 +27251,7 @@ const decode$g = (params2, decodedAttrs) => {
27251
27251
  if (element) elements.unshift(element);
27252
27252
  if (node.attrs?.tableProperties) {
27253
27253
  const properties2 = { ...node.attrs.tableProperties };
27254
- const element2 = translator$c.decode({
27254
+ const element2 = translator$b.decode({
27255
27255
  ...params2,
27256
27256
  node: { ...node, attrs: { ...node.attrs, tableProperties: properties2 } }
27257
27257
  });
@@ -27317,7 +27317,7 @@ function _getReferencedTableStyles(tableStyleReference, params2) {
27317
27317
  if (baseTblPr && baseTblPr.elements) {
27318
27318
  tblPr.elements.push(...baseTblPr.elements);
27319
27319
  }
27320
- const tableProperties = translator$c.encode({ ...params2, nodes: [tblPr] }).attributes;
27320
+ const tableProperties = translator$b.encode({ ...params2, nodes: [tblPr] }).attributes;
27321
27321
  const { borders, rowBorders } = _processTableBorders(tableProperties.borders || {});
27322
27322
  if (borders) stylesToReturn.borders = borders;
27323
27323
  if (rowBorders) stylesToReturn.rowBorders = rowBorders;
@@ -27334,16 +27334,16 @@ function _getReferencedTableStyles(tableStyleReference, params2) {
27334
27334
  }
27335
27335
  return stylesToReturn;
27336
27336
  }
27337
- const config$9 = {
27338
- xmlName: XML_NODE_NAME$9,
27339
- sdNodeOrKeyName: SD_NODE_NAME$9,
27337
+ const config$8 = {
27338
+ xmlName: XML_NODE_NAME$8,
27339
+ sdNodeOrKeyName: SD_NODE_NAME$8,
27340
27340
  type: NodeTranslator.translatorTypes.NODE,
27341
- encode: encode$g,
27342
- decode: decode$g,
27341
+ encode: encode$f,
27342
+ decode: decode$f,
27343
27343
  attributes: []
27344
27344
  };
27345
- const translator$9 = NodeTranslator.from(config$9);
27346
- const tableNodeHandlerEntity = generateV2HandlerEntity("tableNodeHandler", translator$9);
27345
+ const translator$8 = NodeTranslator.from(config$8);
27346
+ const tableNodeHandlerEntity = generateV2HandlerEntity("tableNodeHandler", translator$8);
27347
27347
  function getReferencedTableStyles(tblStyleTag, docx) {
27348
27348
  if (!tblStyleTag) return null;
27349
27349
  const stylesToReturn = {};
@@ -27705,10 +27705,10 @@ function generateCellMargins(cellMargins) {
27705
27705
  if (left2 != null) elements.push({ name: "w:left", attributes: { "w:w": pixelsToTwips(left2) } });
27706
27706
  return elements;
27707
27707
  }
27708
- const XML_NODE_NAME$8 = "w:tc";
27709
- const SD_NODE_NAME$8 = "tableCell";
27710
- const validXmlAttributes$8 = [];
27711
- function encode$f(params2, encodedAttrs) {
27708
+ const XML_NODE_NAME$7 = "w:tc";
27709
+ const SD_NODE_NAME$7 = "tableCell";
27710
+ const validXmlAttributes$7 = [];
27711
+ function encode$e(params2, encodedAttrs) {
27712
27712
  const {
27713
27713
  node,
27714
27714
  table,
@@ -27735,31 +27735,31 @@ function encode$f(params2, encodedAttrs) {
27735
27735
  }
27736
27736
  return schemaNode;
27737
27737
  }
27738
- function decode$f(params2, decodedAttrs) {
27738
+ function decode$e(params2, decodedAttrs) {
27739
27739
  const translated = translateTableCell(params2);
27740
27740
  if (decodedAttrs && Object.keys(decodedAttrs).length) {
27741
27741
  translated.attributes = { ...translated.attributes || {}, ...decodedAttrs };
27742
27742
  }
27743
27743
  return translated;
27744
27744
  }
27745
- const config$8 = {
27746
- xmlName: XML_NODE_NAME$8,
27747
- sdNodeOrKeyName: SD_NODE_NAME$8,
27745
+ const config$7 = {
27746
+ xmlName: XML_NODE_NAME$7,
27747
+ sdNodeOrKeyName: SD_NODE_NAME$7,
27748
27748
  type: NodeTranslator.translatorTypes.NODE,
27749
- encode: encode$f,
27750
- decode: decode$f,
27751
- attributes: validXmlAttributes$8
27749
+ encode: encode$e,
27750
+ decode: decode$e,
27751
+ attributes: validXmlAttributes$7
27752
27752
  };
27753
- const translator$8 = NodeTranslator.from(config$8);
27754
- const XML_NODE_NAME$7 = "w:hyperlink";
27755
- const SD_NODE_NAME$7 = "link";
27753
+ const translator$7 = NodeTranslator.from(config$7);
27754
+ const XML_NODE_NAME$6 = "w:hyperlink";
27755
+ const SD_NODE_NAME$6 = "link";
27756
27756
  const _createAttributeHandler = (xmlName, sdName) => ({
27757
27757
  xmlName,
27758
27758
  sdName,
27759
27759
  encode: (attributes) => attributes[xmlName],
27760
27760
  decode: (attributes) => attributes[sdName]
27761
27761
  });
27762
- const validXmlAttributes$7 = [
27762
+ const validXmlAttributes$6 = [
27763
27763
  _createAttributeHandler("w:anchor", "anchor"),
27764
27764
  _createAttributeHandler("w:docLocation", "docLocation"),
27765
27765
  {
@@ -27772,7 +27772,7 @@ const validXmlAttributes$7 = [
27772
27772
  _createAttributeHandler("r:id", "rId"),
27773
27773
  _createAttributeHandler("w:tgtFrame", "target")
27774
27774
  ];
27775
- const encode$e = (params2, encodedAttrs) => {
27775
+ const encode$d = (params2, encodedAttrs) => {
27776
27776
  const { nodes, docx, nodeListHandler } = params2;
27777
27777
  const node = nodes[0];
27778
27778
  let href = _resolveHref(docx, encodedAttrs);
@@ -27838,7 +27838,7 @@ const _resolveHref = (docx, encodedAttrs) => {
27838
27838
  }
27839
27839
  return href;
27840
27840
  };
27841
- function decode$e(params2) {
27841
+ function decode$d(params2) {
27842
27842
  const { node } = params2;
27843
27843
  const linkMark = node.marks.find((m2) => m2.type === "link");
27844
27844
  const linkAttrs = this.decodeAttributes({ ...params2, node: linkMark });
@@ -27882,15 +27882,15 @@ function _addNewLinkRelationship(params2, link, rId) {
27882
27882
  });
27883
27883
  return rId;
27884
27884
  }
27885
- const config$7 = {
27886
- xmlName: XML_NODE_NAME$7,
27887
- sdNodeOrKeyName: SD_NODE_NAME$7,
27885
+ const config$6 = {
27886
+ xmlName: XML_NODE_NAME$6,
27887
+ sdNodeOrKeyName: SD_NODE_NAME$6,
27888
27888
  type: NodeTranslator.translatorTypes.NODE,
27889
- encode: encode$e,
27890
- decode: decode$e,
27891
- attributes: validXmlAttributes$7
27889
+ encode: encode$d,
27890
+ decode: decode$d,
27891
+ attributes: validXmlAttributes$6
27892
27892
  };
27893
- const translator$7 = NodeTranslator.from(config$7);
27893
+ const translator$6 = NodeTranslator.from(config$6);
27894
27894
  function parseTagValueJSON(json) {
27895
27895
  if (typeof json !== "string") {
27896
27896
  return {};
@@ -28685,32 +28685,32 @@ function translateAnchorNode(params2) {
28685
28685
  elements: [...anchorElements, ...elementsWithWrap]
28686
28686
  };
28687
28687
  }
28688
- const XML_NODE_NAME$6 = "wp:anchor";
28689
- const SD_NODE_NAME$6 = ["image"];
28690
- const validXmlAttributes$6 = ["distT", "distB", "distL", "distR"].map((xmlName) => createAttributeHandler(xmlName));
28691
- function encode$d(params2) {
28688
+ const XML_NODE_NAME$5 = "wp:anchor";
28689
+ const SD_NODE_NAME$5 = ["image"];
28690
+ const validXmlAttributes$5 = ["distT", "distB", "distL", "distR"].map((xmlName) => createAttributeHandler(xmlName));
28691
+ function encode$c(params2) {
28692
28692
  const { node } = params2.extraParams;
28693
28693
  if (!node || !node.type) {
28694
28694
  return null;
28695
28695
  }
28696
28696
  return handleAnchorNode(params2);
28697
28697
  }
28698
- function decode$d(params2) {
28698
+ function decode$c(params2) {
28699
28699
  const { node } = params2;
28700
28700
  if (!node || !node.type) {
28701
28701
  return null;
28702
28702
  }
28703
28703
  return translateAnchorNode(params2);
28704
28704
  }
28705
- const config$6 = {
28706
- xmlName: XML_NODE_NAME$6,
28707
- sdNodeOrKeyName: SD_NODE_NAME$6,
28705
+ const config$5 = {
28706
+ xmlName: XML_NODE_NAME$5,
28707
+ sdNodeOrKeyName: SD_NODE_NAME$5,
28708
28708
  type: NodeTranslator.translatorTypes.NODE,
28709
- encode: encode$d,
28710
- decode: decode$d,
28711
- attributes: validXmlAttributes$6
28709
+ encode: encode$c,
28710
+ decode: decode$c,
28711
+ attributes: validXmlAttributes$5
28712
28712
  };
28713
- const translator$6 = NodeTranslator.from(config$6);
28713
+ const translator$5 = NodeTranslator.from(config$5);
28714
28714
  function handleInlineNode(params2) {
28715
28715
  const { node } = params2.extraParams;
28716
28716
  if (node.name !== "wp:inline") {
@@ -28726,41 +28726,41 @@ function translateInlineNode(params2) {
28726
28726
  elements: nodeElements.elements
28727
28727
  };
28728
28728
  }
28729
- const XML_NODE_NAME$5 = "wp:inline";
28730
- const SD_NODE_NAME$5 = ["image"];
28731
- const validXmlAttributes$5 = ["distT", "distB", "distL", "distR"].map((xmlName) => createAttributeHandler(xmlName));
28732
- function encode$c(params2) {
28729
+ const XML_NODE_NAME$4 = "wp:inline";
28730
+ const SD_NODE_NAME$4 = ["image"];
28731
+ const validXmlAttributes$4 = ["distT", "distB", "distL", "distR"].map((xmlName) => createAttributeHandler(xmlName));
28732
+ function encode$b(params2) {
28733
28733
  const { node } = params2.extraParams;
28734
28734
  if (!node || !node.type) {
28735
28735
  return null;
28736
28736
  }
28737
28737
  return handleInlineNode(params2);
28738
28738
  }
28739
- function decode$c(params2) {
28739
+ function decode$b(params2) {
28740
28740
  const { node } = params2;
28741
28741
  if (!node || !node.type) {
28742
28742
  return null;
28743
28743
  }
28744
28744
  return translateInlineNode(params2);
28745
28745
  }
28746
- const config$5 = {
28747
- xmlName: XML_NODE_NAME$5,
28748
- sdNodeOrKeyName: SD_NODE_NAME$5,
28746
+ const config$4 = {
28747
+ xmlName: XML_NODE_NAME$4,
28748
+ sdNodeOrKeyName: SD_NODE_NAME$4,
28749
28749
  type: NodeTranslator.translatorTypes.NODE,
28750
- encode: encode$c,
28751
- decode: decode$c,
28752
- attributes: validXmlAttributes$5
28750
+ encode: encode$b,
28751
+ decode: decode$b,
28752
+ attributes: validXmlAttributes$4
28753
28753
  };
28754
- const translator$5 = NodeTranslator.from(config$5);
28755
- const XML_NODE_NAME$4 = "w:drawing";
28756
- const SD_NODE_NAME$4 = [];
28757
- const validXmlAttributes$4 = [];
28758
- function encode$b(params2) {
28754
+ const translator$4 = NodeTranslator.from(config$4);
28755
+ const XML_NODE_NAME$3 = "w:drawing";
28756
+ const SD_NODE_NAME$3 = [];
28757
+ const validXmlAttributes$3 = [];
28758
+ function encode$a(params2) {
28759
28759
  const nodes = params2.nodes;
28760
28760
  const node = nodes[0];
28761
28761
  const translatorByChildName = {
28762
- "wp:anchor": translator$6,
28763
- "wp:inline": translator$5
28762
+ "wp:anchor": translator$5,
28763
+ "wp:inline": translator$4
28764
28764
  };
28765
28765
  return node.elements.reduce((acc, child) => {
28766
28766
  if (acc) return acc;
@@ -28769,12 +28769,12 @@ function encode$b(params2) {
28769
28769
  return translator2.encode({ ...params2, extraParams: { node: child } }) || acc;
28770
28770
  }, null);
28771
28771
  }
28772
- function decode$b(params2) {
28772
+ function decode$a(params2) {
28773
28773
  const { node } = params2;
28774
28774
  if (!node || !node.type) {
28775
28775
  return null;
28776
28776
  }
28777
- const childTranslator = node.attrs.isAnchor ? translator$6 : translator$5;
28777
+ const childTranslator = node.attrs.isAnchor ? translator$5 : translator$4;
28778
28778
  const resultNode = childTranslator.decode(params2);
28779
28779
  return wrapTextInRun(
28780
28780
  {
@@ -28784,15 +28784,15 @@ function decode$b(params2) {
28784
28784
  []
28785
28785
  );
28786
28786
  }
28787
- const config$4 = {
28788
- xmlName: XML_NODE_NAME$4,
28789
- sdNodeOrKeyName: SD_NODE_NAME$4,
28787
+ const config$3 = {
28788
+ xmlName: XML_NODE_NAME$3,
28789
+ sdNodeOrKeyName: SD_NODE_NAME$3,
28790
28790
  type: NodeTranslator.translatorTypes.NODE,
28791
- encode: encode$b,
28792
- decode: decode$b,
28793
- attributes: validXmlAttributes$4
28791
+ encode: encode$a,
28792
+ decode: decode$a,
28793
+ attributes: validXmlAttributes$3
28794
28794
  };
28795
- const translator$4 = NodeTranslator.from(config$4);
28795
+ const translator$3 = NodeTranslator.from(config$3);
28796
28796
  class CommandService {
28797
28797
  /**
28798
28798
  * @param {import('./commands/types/index.js').CommandServiceOptions} props
@@ -30130,7 +30130,7 @@ function prepareTextAnnotation(params2) {
30130
30130
  return getTextNodeForExport(attrs.displayLabel, [...marks, ...marksFromAttrs], params2);
30131
30131
  }
30132
30132
  function prepareImageAnnotation(params2, imageSize) {
30133
- return translator$4.decode({
30133
+ return translator$3.decode({
30134
30134
  ...params2,
30135
30135
  imageSize
30136
30136
  });
@@ -30367,10 +30367,10 @@ function translateStructuredContent(params2) {
30367
30367
  };
30368
30368
  return result;
30369
30369
  }
30370
- const XML_NODE_NAME$3 = "w:sdt";
30371
- const SD_NODE_NAME$3 = ["fieldAnnotation", "structuredContent", "structuredContentBlock", "documentSection"];
30372
- const validXmlAttributes$3 = [];
30373
- function encode$a(params2) {
30370
+ const XML_NODE_NAME$2 = "w:sdt";
30371
+ const SD_NODE_NAME$2 = ["fieldAnnotation", "structuredContent", "structuredContentBlock", "documentSection"];
30372
+ const validXmlAttributes$2 = [];
30373
+ function encode$9(params2) {
30374
30374
  const nodes = params2.nodes;
30375
30375
  const node = nodes[0];
30376
30376
  const { type: sdtType, handler: handler2 } = sdtNodeTypeStrategy(node);
@@ -30380,7 +30380,7 @@ function encode$a(params2) {
30380
30380
  const result = handler2(params2);
30381
30381
  return result;
30382
30382
  }
30383
- function decode$a(params2) {
30383
+ function decode$9(params2) {
30384
30384
  const { node } = params2;
30385
30385
  if (!node || !node.type) {
30386
30386
  return null;
@@ -30396,85 +30396,85 @@ function decode$a(params2) {
30396
30396
  const result = decoder();
30397
30397
  return result;
30398
30398
  }
30399
- const config$3 = {
30400
- xmlName: XML_NODE_NAME$3,
30401
- sdNodeOrKeyName: SD_NODE_NAME$3,
30399
+ const config$2 = {
30400
+ xmlName: XML_NODE_NAME$2,
30401
+ sdNodeOrKeyName: SD_NODE_NAME$2,
30402
30402
  type: NodeTranslator.translatorTypes.NODE,
30403
- encode: encode$a,
30404
- decode: decode$a,
30405
- attributes: validXmlAttributes$3
30403
+ encode: encode$9,
30404
+ decode: decode$9,
30405
+ attributes: validXmlAttributes$2
30406
30406
  };
30407
- const translator$3 = NodeTranslator.from(config$3);
30408
- const encode$9 = (attributes) => {
30407
+ const translator$2 = NodeTranslator.from(config$2);
30408
+ const encode$8 = (attributes) => {
30409
30409
  return attributes["w:id"];
30410
30410
  };
30411
- const decode$9 = (attrs) => {
30411
+ const decode$8 = (attrs) => {
30412
30412
  return attrs.id;
30413
30413
  };
30414
30414
  const attrConfig$6 = Object.freeze({
30415
30415
  xmlName: "w:id",
30416
30416
  sdName: "id",
30417
- encode: encode$9,
30418
- decode: decode$9
30417
+ encode: encode$8,
30418
+ decode: decode$8
30419
30419
  });
30420
- const encode$8 = (attributes) => {
30420
+ const encode$7 = (attributes) => {
30421
30421
  return attributes["w:name"];
30422
30422
  };
30423
- const decode$8 = (attrs) => {
30423
+ const decode$7 = (attrs) => {
30424
30424
  return attrs.name;
30425
30425
  };
30426
30426
  const attrConfig$5 = Object.freeze({
30427
30427
  xmlName: "w:name",
30428
30428
  sdName: "name",
30429
- encode: encode$8,
30430
- decode: decode$8
30429
+ encode: encode$7,
30430
+ decode: decode$7
30431
30431
  });
30432
- const encode$7 = (attributes) => {
30432
+ const encode$6 = (attributes) => {
30433
30433
  return attributes["w:colFirst"];
30434
30434
  };
30435
- const decode$7 = (attrs) => {
30435
+ const decode$6 = (attrs) => {
30436
30436
  return attrs.colFirst;
30437
30437
  };
30438
30438
  const attrConfig$4 = Object.freeze({
30439
30439
  xmlName: "w:colFirst",
30440
30440
  sdName: "colFirst",
30441
- encode: encode$7,
30442
- decode: decode$7
30441
+ encode: encode$6,
30442
+ decode: decode$6
30443
30443
  });
30444
- const encode$6 = (attributes) => {
30444
+ const encode$5 = (attributes) => {
30445
30445
  return attributes["w:colLast"];
30446
30446
  };
30447
- const decode$6 = (attrs) => {
30447
+ const decode$5 = (attrs) => {
30448
30448
  return attrs.colLast;
30449
30449
  };
30450
30450
  const attrConfig$3 = Object.freeze({
30451
30451
  xmlName: "w:colLast",
30452
30452
  sdName: "colLast",
30453
- encode: encode$6,
30454
- decode: decode$6
30453
+ encode: encode$5,
30454
+ decode: decode$5
30455
30455
  });
30456
- const encode$5 = (attributes) => {
30456
+ const encode$4 = (attributes) => {
30457
30457
  return attributes["w:displacedByCustomXml"];
30458
30458
  };
30459
- const decode$5 = (attrs) => {
30459
+ const decode$4 = (attrs) => {
30460
30460
  return attrs.displacedByCustomXml;
30461
30461
  };
30462
30462
  const attrConfig$2 = Object.freeze({
30463
30463
  xmlName: "w:displacedByCustomXml",
30464
30464
  sdName: "displacedByCustomXml",
30465
- encode: encode$5,
30466
- decode: decode$5
30465
+ encode: encode$4,
30466
+ decode: decode$4
30467
30467
  });
30468
- const validXmlAttributes$2 = [attrConfig$6, attrConfig$5, attrConfig$4, attrConfig$3, attrConfig$2];
30469
- const XML_NODE_NAME$2 = "w:bookmarkStart";
30470
- const SD_NODE_NAME$2 = "bookmarkStart";
30471
- const encode$4 = (params2, encodedAttrs = {}) => {
30468
+ const validXmlAttributes$1 = [attrConfig$6, attrConfig$5, attrConfig$4, attrConfig$3, attrConfig$2];
30469
+ const XML_NODE_NAME$1 = "w:bookmarkStart";
30470
+ const SD_NODE_NAME$1 = "bookmarkStart";
30471
+ const encode$3 = (params2, encodedAttrs = {}) => {
30472
30472
  return {
30473
30473
  type: "bookmarkStart",
30474
30474
  attrs: encodedAttrs
30475
30475
  };
30476
30476
  };
30477
- const decode$4 = (params2, decodedAttrs = {}) => {
30477
+ const decode$3 = (params2, decodedAttrs = {}) => {
30478
30478
  const result = {
30479
30479
  name: "w:bookmarkStart",
30480
30480
  elements: []
@@ -30484,49 +30484,49 @@ const decode$4 = (params2, decodedAttrs = {}) => {
30484
30484
  }
30485
30485
  return result;
30486
30486
  };
30487
- const config$2 = {
30488
- xmlName: XML_NODE_NAME$2,
30489
- sdNodeOrKeyName: SD_NODE_NAME$2,
30487
+ const config$1 = {
30488
+ xmlName: XML_NODE_NAME$1,
30489
+ sdNodeOrKeyName: SD_NODE_NAME$1,
30490
30490
  type: NodeTranslator.translatorTypes.NODE,
30491
- encode: encode$4,
30492
- decode: decode$4,
30493
- attributes: validXmlAttributes$2
30491
+ encode: encode$3,
30492
+ decode: decode$3,
30493
+ attributes: validXmlAttributes$1
30494
30494
  };
30495
- const translator$2 = NodeTranslator.from(config$2);
30496
- const encode$3 = (attributes) => {
30495
+ const translator$1 = NodeTranslator.from(config$1);
30496
+ const encode$2 = (attributes) => {
30497
30497
  return attributes["w:id"];
30498
30498
  };
30499
- const decode$3 = (attrs) => {
30499
+ const decode$2 = (attrs) => {
30500
30500
  return attrs.id;
30501
30501
  };
30502
30502
  const attrConfig$1 = Object.freeze({
30503
30503
  xmlName: "w:id",
30504
30504
  sdName: "id",
30505
- encode: encode$3,
30506
- decode: decode$3
30505
+ encode: encode$2,
30506
+ decode: decode$2
30507
30507
  });
30508
- const encode$2 = (attributes) => {
30508
+ const encode$1 = (attributes) => {
30509
30509
  return attributes["w:displacedByCustomXml"];
30510
30510
  };
30511
- const decode$2 = (attrs) => {
30511
+ const decode$1 = (attrs) => {
30512
30512
  return attrs.displacedByCustomXml;
30513
30513
  };
30514
30514
  const attrConfig = Object.freeze({
30515
30515
  xmlName: "w:displacedByCustomXml",
30516
30516
  sdName: "displacedByCustomXml",
30517
- encode: encode$2,
30518
- decode: decode$2
30517
+ encode: encode$1,
30518
+ decode: decode$1
30519
30519
  });
30520
- const validXmlAttributes$1 = [attrConfig$1, attrConfig];
30521
- const XML_NODE_NAME$1 = "w:bookmarkEnd";
30522
- const SD_NODE_NAME$1 = "bookmarkEnd";
30523
- const encode$1 = (params2, encodedAttrs = {}) => {
30520
+ const validXmlAttributes = [attrConfig$1, attrConfig];
30521
+ const XML_NODE_NAME = "w:bookmarkEnd";
30522
+ const SD_NODE_NAME = "bookmarkEnd";
30523
+ const encode$18 = (params2, encodedAttrs = {}) => {
30524
30524
  return {
30525
30525
  type: "bookmarkEnd",
30526
30526
  attrs: encodedAttrs
30527
30527
  };
30528
30528
  };
30529
- const decode$1 = (params2, decodedAttrs = {}) => {
30529
+ const decode = (params2, decodedAttrs = {}) => {
30530
30530
  const result = {
30531
30531
  name: "w:bookmarkEnd",
30532
30532
  elements: []
@@ -30536,60 +30536,11 @@ const decode$1 = (params2, decodedAttrs = {}) => {
30536
30536
  }
30537
30537
  return result;
30538
30538
  };
30539
- const config$1 = {
30540
- xmlName: XML_NODE_NAME$1,
30541
- sdNodeOrKeyName: SD_NODE_NAME$1,
30542
- type: NodeTranslator.translatorTypes.NODE,
30543
- encode: encode$1,
30544
- decode: decode$1,
30545
- attributes: validXmlAttributes$1
30546
- };
30547
- const translator$1 = NodeTranslator.from(config$1);
30548
- const XML_NODE_NAME = "mc:AlternateContent";
30549
- const SD_NODE_NAME = [];
30550
- const validXmlAttributes = [];
30551
- function encode$19(params2) {
30552
- const { nodeListHandler } = params2;
30553
- const { node } = params2.extraParams;
30554
- if (!node || !node.type) {
30555
- return null;
30556
- }
30557
- const allowedNamespaces = ["wps", "wp14", "w14", "w15"];
30558
- const wpsNode = node.elements.find(
30559
- (el) => el.name === "mc:Choice" && allowedNamespaces.includes(el.attributes["Requires"])
30560
- );
30561
- if (!wpsNode) {
30562
- return null;
30563
- }
30564
- const contents = wpsNode.elements;
30565
- return nodeListHandler.handler({
30566
- ...params2,
30567
- nodes: contents,
30568
- path: [...params2.path || [], wpsNode]
30569
- });
30570
- }
30571
- function decode(params2) {
30572
- const { node } = params2;
30573
- const { drawingContent } = node.attrs;
30574
- const drawing = {
30575
- name: "w:drawing",
30576
- elements: [...drawingContent ? [...drawingContent.elements || []] : []]
30577
- };
30578
- const choice = {
30579
- name: "mc:Choice",
30580
- attributes: { Requires: "wps" },
30581
- elements: [drawing]
30582
- };
30583
- return {
30584
- name: "mc:AlternateContent",
30585
- elements: [choice]
30586
- };
30587
- }
30588
30539
  const config = {
30589
30540
  xmlName: XML_NODE_NAME,
30590
30541
  sdNodeOrKeyName: SD_NODE_NAME,
30591
30542
  type: NodeTranslator.translatorTypes.NODE,
30592
- encode: encode$19,
30543
+ encode: encode$18,
30593
30544
  decode,
30594
30545
  attributes: validXmlAttributes
30595
30546
  };
@@ -30608,30 +30559,30 @@ function exportSchemaToJson(params2) {
30608
30559
  doc: translateDocumentNode,
30609
30560
  body: translateBodyNode,
30610
30561
  heading: translateHeadingNode,
30611
- paragraph: translator$13,
30612
- run: translator$U,
30562
+ paragraph: translator$12,
30563
+ run: translator$T,
30613
30564
  text: translateTextNode,
30614
30565
  bulletList: translateList,
30615
30566
  orderedList: translateList,
30616
- lineBreak: translator$16,
30617
- table: translator$9,
30618
- tableRow: translator$G,
30619
- tableCell: translator$8,
30620
- bookmarkStart: translator$2,
30621
- bookmarkEnd: translator$1,
30622
- fieldAnnotation: translator$3,
30623
- tab: translator$14,
30624
- image: translator$4,
30625
- hardBreak: translator$16,
30567
+ lineBreak: translator$15,
30568
+ table: translator$8,
30569
+ tableRow: translator$F,
30570
+ tableCell: translator$7,
30571
+ bookmarkStart: translator$1,
30572
+ bookmarkEnd: translator,
30573
+ fieldAnnotation: translator$2,
30574
+ tab: translator$13,
30575
+ image: translator$3,
30576
+ hardBreak: translator$15,
30626
30577
  commentRangeStart: () => translateCommentNode(params2, "Start"),
30627
30578
  commentRangeEnd: () => translateCommentNode(params2, "End"),
30628
30579
  commentReference: () => null,
30629
30580
  shapeContainer: translateShapeContainer,
30630
30581
  shapeTextbox: translateShapeTextbox,
30631
30582
  contentBlock: translateContentBlock,
30632
- structuredContent: translator$3,
30633
- structuredContentBlock: translator$3,
30634
- documentSection: translator$3,
30583
+ structuredContent: translator$2,
30584
+ structuredContentBlock: translator$2,
30585
+ documentSection: translator$2,
30635
30586
  "page-number": translatePageNumberNode,
30636
30587
  "total-page-number": translateTotalPageNumberNode
30637
30588
  };
@@ -30970,7 +30921,7 @@ function translateTextNode(params2) {
30970
30921
  const isTrackedNode = node.marks?.some((m2) => trackedMarks.includes(m2.type));
30971
30922
  if (isTrackedNode) return translateTrackedNode(params2);
30972
30923
  const isLinkNode = node.marks?.some((m2) => m2.type === "link");
30973
- if (isLinkNode) return translator$7.decode(params2);
30924
+ if (isLinkNode) return translator$6.decode(params2);
30974
30925
  const { text, marks = [] } = node;
30975
30926
  return getTextNodeForExport(text, marks, params2);
30976
30927
  }
@@ -31276,7 +31227,7 @@ function translateMark(mark) {
31276
31227
  markElement.type = "element";
31277
31228
  break;
31278
31229
  case "underline": {
31279
- const translated = translator$10.decode({
31230
+ const translated = translator$$.decode({
31280
31231
  node: {
31281
31232
  attrs: {
31282
31233
  underlineType: attrs.underlineType ?? attrs.underline ?? null,
@@ -31340,7 +31291,7 @@ function translateMark(mark) {
31340
31291
  break;
31341
31292
  case "highlight": {
31342
31293
  const highlightValue = attrs.color ?? attrs.highlight ?? null;
31343
- const translated = translator$15.decode({ node: { attrs: { highlight: highlightValue } } });
31294
+ const translated = translator$14.decode({ node: { attrs: { highlight: highlightValue } } });
31344
31295
  return translated || {};
31345
31296
  }
31346
31297
  }
@@ -31396,11 +31347,23 @@ function translateShapeTextbox(params2) {
31396
31347
  }
31397
31348
  function translateContentBlock(params2) {
31398
31349
  const { node } = params2;
31399
- const { vmlAttributes, horizontalRule } = node.attrs;
31350
+ const { drawingContent, vmlAttributes, horizontalRule } = node.attrs;
31400
31351
  if (vmlAttributes || horizontalRule) {
31401
31352
  return translateVRectContentBlock(params2);
31402
31353
  }
31403
- const alternateContent = translator.decode(params2);
31354
+ const drawing = {
31355
+ name: "w:drawing",
31356
+ elements: [...drawingContent ? [...drawingContent.elements || []] : []]
31357
+ };
31358
+ const choice = {
31359
+ name: "mc:Choice",
31360
+ attributes: { Requires: "wps" },
31361
+ elements: [drawing]
31362
+ };
31363
+ const alternateContent = {
31364
+ name: "mc:AlternateContent",
31365
+ elements: [choice]
31366
+ };
31404
31367
  return wrapTextInRun(alternateContent);
31405
31368
  }
31406
31369
  function translateVRectContentBlock(params2) {
@@ -31604,7 +31567,7 @@ const handleDrawingNode = (params2) => {
31604
31567
  if (mainNode.name === "w:drawing") node = mainNode;
31605
31568
  else node = mainNode.elements.find((el) => el.name === "w:drawing");
31606
31569
  if (!node) return { nodes: [], consumed: 0 };
31607
- const schemaNode = translator$4.encode(params2);
31570
+ const schemaNode = translator$3.encode(params2);
31608
31571
  const newNodes = schemaNode ? [schemaNode] : [];
31609
31572
  return { nodes: newNodes, consumed: 1 };
31610
31573
  };
@@ -31706,8 +31669,8 @@ const trackChangeNodeHandlerEntity = {
31706
31669
  handlerName: "trackChangeNodeHandler",
31707
31670
  handler: handleTrackChangeNode
31708
31671
  };
31709
- const hyperlinkNodeHandlerEntity = generateV2HandlerEntity("hyperlinkNodeHandler", translator$7);
31710
- const runNodeHandlerEntity = generateV2HandlerEntity("runNodeHandler", translator$U);
31672
+ const hyperlinkNodeHandlerEntity = generateV2HandlerEntity("hyperlinkNodeHandler", translator$6);
31673
+ const runNodeHandlerEntity = generateV2HandlerEntity("runNodeHandler", translator$T);
31711
31674
  const handleTextNode = (params2) => {
31712
31675
  const { nodes, insideTrackChange } = params2;
31713
31676
  if (nodes.length === 0 || !(nodes[0].name === "w:t" || insideTrackChange && nodes[0].name === "w:delText")) {
@@ -31748,7 +31711,7 @@ const handleParagraphNode = (params2) => {
31748
31711
  if (nodes.length === 0 || nodes[0].name !== "w:p") {
31749
31712
  return { nodes: [], consumed: 0 };
31750
31713
  }
31751
- const schemaNode = translator$13.encode(params2);
31714
+ const schemaNode = translator$12.encode(params2);
31752
31715
  const newNodes = schemaNode ? [schemaNode] : [];
31753
31716
  return { nodes: newNodes, consumed: 1 };
31754
31717
  };
@@ -31761,7 +31724,7 @@ const handleSdtNode = (params2) => {
31761
31724
  if (nodes.length === 0 || nodes[0].name !== "w:sdt") {
31762
31725
  return { nodes: [], consumed: 0 };
31763
31726
  }
31764
- const result = translator$3.encode(params2);
31727
+ const result = translator$2.encode(params2);
31765
31728
  if (!result) {
31766
31729
  return { nodes: [], consumed: 0 };
31767
31730
  }
@@ -31851,7 +31814,7 @@ const handler = (params2) => {
31851
31814
  if (nodes.length === 0 || nodes[0].name !== "w:br") {
31852
31815
  return { nodes: [], consumed: 0 };
31853
31816
  }
31854
- const result = translator$16.encode(params2);
31817
+ const result = translator$15.encode(params2);
31855
31818
  if (!result) return { nodes: [], consumed: 0 };
31856
31819
  return {
31857
31820
  nodes: [result],
@@ -31923,7 +31886,7 @@ const handleBookmarkStartNode = (params2) => {
31923
31886
  if (isCustomMarkBookmark(nodes[0], params2.editor)) {
31924
31887
  return handleBookmarkNode(params2);
31925
31888
  }
31926
- const node = translator$2.encode(params2);
31889
+ const node = translator$1.encode(params2);
31927
31890
  if (!node) return { nodes: [], consumed: 0 };
31928
31891
  return { nodes: [node], consumed: 1 };
31929
31892
  };
@@ -31955,7 +31918,7 @@ const handleBookmarkEndNode = (params2) => {
31955
31918
  if (!nodes.length || nodes[0].name !== "w:bookmarkEnd") {
31956
31919
  return { nodes: [], consumed: 0 };
31957
31920
  }
31958
- const node = translator$1.encode(params2);
31921
+ const node = translator.encode(params2);
31959
31922
  if (!node) return { nodes: [], consumed: 0 };
31960
31923
  return { nodes: [node], consumed: 1 };
31961
31924
  };
@@ -31963,86 +31926,32 @@ const bookmarkEndNodeHandlerEntity = {
31963
31926
  handlerName: "w:bookmarkEndTranslator",
31964
31927
  handler: handleBookmarkEndNode
31965
31928
  };
31966
- const ALTERNATE_CONTENT_NODE = "mc:AlternateContent";
31967
- const SUPPORTED_REQUIRES = /* @__PURE__ */ new Set([
31968
- "wps",
31969
- "wp14",
31970
- "w14",
31971
- "w15",
31972
- "w16",
31973
- "w16cex",
31974
- "w16cid",
31975
- "w16du",
31976
- "w16sdtdh",
31977
- "w16sdtfl",
31978
- "w16se"
31979
- ]);
31980
- const skipHandlerResponse = { nodes: [], consumed: 0 };
31981
- const isAlternateContentNode = (node) => node?.name === ALTERNATE_CONTENT_NODE;
31982
- const isSupportedChoice = (choice) => {
31983
- if (!choice?.attributes) return false;
31984
- const requires = choice.attributes.Requires || choice.attributes.requires;
31985
- if (!requires) return false;
31986
- return requires.split(/\s+/).filter(Boolean).some((namespace2) => SUPPORTED_REQUIRES.has(namespace2));
31987
- };
31988
- const resolveAlternateContentElements = (alternateContent) => {
31989
- if (!alternateContent?.elements?.length) return null;
31990
- const choices = alternateContent.elements.filter((el) => el.name === "mc:Choice");
31991
- const fallback = alternateContent.elements.find((el) => el.name === "mc:Fallback");
31992
- const supportedChoice = choices.find(isSupportedChoice);
31993
- const selectedElements = supportedChoice?.elements || fallback?.elements || choices[0]?.elements;
31994
- if (!selectedElements) return null;
31995
- return carbonCopy(selectedElements);
31996
- };
31997
- const buildNodeWithoutAlternateContent = (node) => {
31998
- const { elements } = node || {};
31999
- if (!elements?.length) return null;
32000
- let replaced = false;
32001
- const updatedElements = [];
32002
- elements.forEach((element) => {
32003
- if (isAlternateContentNode(element)) {
32004
- const resolved = resolveAlternateContentElements(element);
32005
- if (resolved) {
32006
- updatedElements.push(...resolved);
32007
- replaced = true;
32008
- return;
32009
- }
32010
- updatedElements.push(carbonCopy(element));
32011
- return;
32012
- }
32013
- updatedElements.push(carbonCopy(element));
32014
- });
32015
- if (!replaced) return null;
32016
- const clone = carbonCopy(node);
32017
- clone.elements = updatedElements;
32018
- return clone;
32019
- };
32020
31929
  const handleAlternateChoice = (params2) => {
31930
+ const skipHandlerResponse = { nodes: [], consumed: 0 };
32021
31931
  const { nodes, nodeListHandler } = params2;
32022
- if (!nodes?.length) {
31932
+ if (nodes.length === 0 || nodes[0].name !== "w:p") {
32023
31933
  return skipHandlerResponse;
32024
31934
  }
32025
- const [currentNode] = nodes;
32026
- if (isAlternateContentNode(currentNode)) {
32027
- const resolvedElements = resolveAlternateContentElements(currentNode);
32028
- if (!resolvedElements) {
32029
- return skipHandlerResponse;
32030
- }
32031
- const result2 = nodeListHandler.handler({
32032
- ...params2,
32033
- nodes: resolvedElements,
32034
- path: [...params2.path || [], currentNode]
32035
- });
32036
- return { nodes: result2, consumed: 1 };
31935
+ const mainNode = nodes[0];
31936
+ const node = mainNode?.elements?.find((el) => el.name === "w:r");
31937
+ const hasAltChoice = node?.elements?.some((el) => el.name === "mc:AlternateContent");
31938
+ if (!hasAltChoice) {
31939
+ return skipHandlerResponse;
32037
31940
  }
32038
- const sanitizedNode = buildNodeWithoutAlternateContent(currentNode);
32039
- if (!sanitizedNode) {
31941
+ const altChoiceNode = node.elements.find((el) => el.name === "mc:AlternateContent");
31942
+ node.elements.findIndex((el) => el.name === "mc:AlternateContent");
31943
+ const allowedNamespaces = ["wps", "wp14", "w14", "w15"];
31944
+ const wpsNode = altChoiceNode.elements.find(
31945
+ (el) => el.name === "mc:Choice" && allowedNamespaces.includes(el.attributes["Requires"])
31946
+ );
31947
+ if (!wpsNode) {
32040
31948
  return skipHandlerResponse;
32041
31949
  }
31950
+ const contents = wpsNode.elements;
32042
31951
  const result = nodeListHandler.handler({
32043
31952
  ...params2,
32044
- nodes: [sanitizedNode],
32045
- path: [...params2.path || [], sanitizedNode]
31953
+ nodes: contents,
31954
+ path: [...params2.path || [], wpsNode]
32046
31955
  });
32047
31956
  return { nodes: result, consumed: 1 };
32048
31957
  };
@@ -32648,7 +32557,7 @@ const handleTabNode = (params2) => {
32648
32557
  if (!nodes.length || nodes[0].name !== "w:tab") {
32649
32558
  return { nodes: [], consumed: 0 };
32650
32559
  }
32651
- const node = translator$14.encode(params2);
32560
+ const node = translator$13.encode(params2);
32652
32561
  return { nodes: [node], consumed: 1 };
32653
32562
  };
32654
32563
  const tabNodeEntityHandler = {
@@ -50773,8 +50682,6 @@ const _Editor = class _Editor2 extends EventEmitter$1 {
50773
50682
  element.style.isolation = "isolate";
50774
50683
  proseMirror.style.outline = "none";
50775
50684
  proseMirror.style.border = "none";
50776
- element.style.backgroundColor = "#fff";
50777
- proseMirror.style.backgroundColor = "#fff";
50778
50685
  const { typeface, fontSizePt, fontFamilyCss } = this.converter.getDocumentDefaultStyles() ?? {};
50779
50686
  const resolvedFontFamily = fontFamilyCss || typeface;
50780
50687
  if (resolvedFontFamily) {
@@ -83645,115 +83552,6 @@ runCommandWithArgumentOnly_fn = function({ item, argument, noArgumentCallback =
83645
83552
  this.updateToolbarState();
83646
83553
  }
83647
83554
  };
83648
- const onMarginClickCursorChange = (event, editor) => {
83649
- const y2 = event.clientY;
83650
- const x = event.clientX;
83651
- const { view } = editor;
83652
- const editorRect = view.dom.getBoundingClientRect();
83653
- let coords = {
83654
- left: 0,
83655
- top: y2
83656
- };
83657
- let isRightMargin = false;
83658
- if (x > editorRect.right) {
83659
- coords.left = editorRect.left + editorRect.width - 1;
83660
- isRightMargin = true;
83661
- } else if (x < editorRect.left) {
83662
- coords.left = editorRect.left;
83663
- }
83664
- const pos = view.posAtCoords(coords)?.pos;
83665
- if (pos) {
83666
- let cursorPos = pos;
83667
- if (isRightMargin) {
83668
- const $pos = view.state.doc.resolve(pos);
83669
- const charOffset = $pos.textOffset;
83670
- const node = view.state.doc.nodeAt(pos);
83671
- const text = node?.text;
83672
- const charAtPos = text?.charAt(charOffset);
83673
- cursorPos = node?.isText && charAtPos !== " " ? pos - 1 : pos;
83674
- }
83675
- const transaction = view.state.tr.setSelection(TextSelection$1.create(view.state.doc, cursorPos));
83676
- view.dispatch(transaction);
83677
- view.focus();
83678
- }
83679
- };
83680
- const checkNodeSpecificClicks = (editor, event, popoverControls) => {
83681
- if (!editor) return;
83682
- if (selectionHasNodeOrMark(editor.view.state, "link", { requireEnds: true })) {
83683
- popoverControls.component = LinkInput;
83684
- popoverControls.position = {
83685
- left: `${event.clientX - editor.element.getBoundingClientRect().left}px`,
83686
- top: `${event.clientY - editor.element.getBoundingClientRect().top + 15}px`
83687
- };
83688
- popoverControls.props = {
83689
- showInput: true
83690
- };
83691
- popoverControls.visible = true;
83692
- }
83693
- };
83694
- function selectionHasNodeOrMark(state2, name, options = {}) {
83695
- const { requireEnds = false } = options;
83696
- const $from = state2.selection.$from;
83697
- const $to = state2.selection.$to;
83698
- if (requireEnds) {
83699
- for (let d2 = $from.depth; d2 > 0; d2--) {
83700
- if ($from.node(d2).type.name === name) {
83701
- return true;
83702
- }
83703
- }
83704
- for (let d2 = $to.depth; d2 > 0; d2--) {
83705
- if ($to.node(d2).type.name === name) {
83706
- return true;
83707
- }
83708
- }
83709
- } else {
83710
- for (let d2 = $from.depth; d2 > 0; d2--) {
83711
- if ($from.node(d2).type.name === name) {
83712
- return true;
83713
- }
83714
- }
83715
- }
83716
- const markType = state2.schema.marks[name];
83717
- if (markType) {
83718
- const { from: from2, to, empty: empty2 } = state2.selection;
83719
- if (requireEnds) {
83720
- const fromMarks = markType.isInSet($from.marks());
83721
- const toMarks = markType.isInSet($to.marks());
83722
- if (fromMarks || toMarks) {
83723
- return true;
83724
- }
83725
- if (empty2 && markType.isInSet(state2.storedMarks || $from.marks())) {
83726
- return true;
83727
- }
83728
- } else {
83729
- if (empty2) {
83730
- if (markType.isInSet(state2.storedMarks || $from.marks())) {
83731
- return true;
83732
- }
83733
- } else {
83734
- let hasMark = false;
83735
- state2.doc.nodesBetween(from2, to, (node) => {
83736
- if (markType.isInSet(node.marks)) {
83737
- hasMark = true;
83738
- return false;
83739
- }
83740
- });
83741
- if (hasMark) return true;
83742
- }
83743
- }
83744
- }
83745
- return false;
83746
- }
83747
- function moveCursorToMouseEvent(event, editor) {
83748
- const { view } = editor;
83749
- const coords = { left: event.clientX, top: event.clientY };
83750
- const pos = view.posAtCoords(coords)?.pos;
83751
- if (typeof pos === "number") {
83752
- const tr = view.state.tr.setSelection(TextSelection$1.create(view.state.doc, pos));
83753
- view.dispatch(tr);
83754
- view.focus();
83755
- }
83756
- }
83757
83555
  const ICONS = {
83758
83556
  addRowBefore: plusIconSvg,
83759
83557
  addRowAfter: plusIconSvg,
@@ -83953,30 +83751,6 @@ const getPropsByItemId = (itemId, props) => {
83953
83751
  return baseProps;
83954
83752
  }
83955
83753
  };
83956
- function normalizeClipboardContent(rawClipboardContent) {
83957
- if (!rawClipboardContent) {
83958
- return {
83959
- html: null,
83960
- text: null,
83961
- hasContent: false,
83962
- raw: null
83963
- };
83964
- }
83965
- const html = typeof rawClipboardContent.html === "string" ? rawClipboardContent.html : null;
83966
- const text = typeof rawClipboardContent.text === "string" ? rawClipboardContent.text : null;
83967
- const hasHtml = !!html && html.trim().length > 0;
83968
- const hasText = !!text && text.length > 0;
83969
- const isObject2 = typeof rawClipboardContent === "object" && rawClipboardContent !== null;
83970
- const fragmentSize = typeof rawClipboardContent.size === "number" ? rawClipboardContent.size : null;
83971
- const nestedSize = isObject2 && rawClipboardContent.content && typeof rawClipboardContent.content.size === "number" ? rawClipboardContent.content.size : null;
83972
- const hasFragmentContent = (fragmentSize ?? nestedSize ?? 0) > 0;
83973
- return {
83974
- html,
83975
- text,
83976
- hasContent: hasHtml || hasText || hasFragmentContent,
83977
- raw: rawClipboardContent
83978
- };
83979
- }
83980
83754
  async function getEditorContext(editor, event) {
83981
83755
  const { view } = editor;
83982
83756
  const { state: state2 } = view;
@@ -83992,144 +83766,123 @@ async function getEditorContext(editor, event) {
83992
83766
  pos = from2;
83993
83767
  node = state2.doc.nodeAt(pos);
83994
83768
  }
83995
- const rawClipboardContent = await readFromClipboard(state2);
83996
- const clipboardContent = normalizeClipboardContent(rawClipboardContent);
83997
- const structureFromResolvedPos = pos !== null ? getStructureFromResolvedPos(state2, pos) : null;
83998
- const isInTable2 = structureFromResolvedPos?.isInTable ?? selectionHasNodeOrMark(state2, "table", { requireEnds: true });
83999
- const isInList = structureFromResolvedPos?.isInList ?? (selectionHasNodeOrMark(state2, "bulletList", { requireEnds: false }) || selectionHasNodeOrMark(state2, "orderedList", { requireEnds: false }));
84000
- const isInSectionNode = structureFromResolvedPos?.isInSectionNode ?? selectionHasNodeOrMark(state2, "documentSection", { requireEnds: true });
84001
- const currentNodeType = node?.type?.name || null;
84002
- const activeMarks = [];
84003
- if (event && pos !== null) {
84004
- const $pos = state2.doc.resolve(pos);
84005
- if ($pos.marks && typeof $pos.marks === "function") {
84006
- $pos.marks().forEach((mark) => activeMarks.push(mark.type.name));
84007
- }
84008
- if (node && node.marks) {
84009
- node.marks.forEach((mark) => activeMarks.push(mark.type.name));
84010
- }
84011
- } else {
84012
- state2.storedMarks?.forEach((mark) => activeMarks.push(mark.type.name));
84013
- state2.selection.$head.marks().forEach((mark) => activeMarks.push(mark.type.name));
84014
- }
84015
- const isTrackedChange = activeMarks.includes("trackInsert") || activeMarks.includes("trackDelete");
84016
- let trackedChangeId = null;
84017
- if (isTrackedChange && event && pos !== null) {
84018
- const $pos = state2.doc.resolve(pos);
84019
- const marksAtPos = $pos.marks();
84020
- const trackedMark = marksAtPos.find((mark) => mark.type.name === "trackInsert" || mark.type.name === "trackDelete");
84021
- if (trackedMark) {
84022
- trackedChangeId = trackedMark.attrs.id;
84023
- }
84024
- }
84025
- const cursorCoords = pos ? view.coordsAtPos(pos) : null;
84026
- const cursorPosition = cursorCoords ? {
84027
- x: cursorCoords.left,
84028
- y: cursorCoords.top
84029
- } : null;
83769
+ const clipboardContent = await readFromClipboard(state2);
84030
83770
  return {
84031
- // Selection info
83771
+ editor,
84032
83772
  selectedText,
84033
- hasSelection: !empty2,
84034
- selectionStart: from2,
84035
- selectionEnd: to,
84036
- // Document structure
84037
- isInTable: isInTable2,
84038
- isInList,
84039
- isInSectionNode,
84040
- currentNodeType,
84041
- activeMarks,
84042
- // Document state
84043
- isTrackedChange,
84044
- trackedChangeId,
84045
- documentMode: editor.options?.documentMode || "editing",
84046
- canUndo: computeCanUndo(editor, state2),
84047
- canRedo: computeCanRedo(editor, state2),
84048
- isEditable: editor.isEditable,
84049
- // Clipboard
84050
- clipboardContent,
84051
- // Position and trigger info
84052
- cursorPosition,
84053
83773
  pos,
84054
83774
  node,
84055
83775
  event,
84056
- // Editor reference for advanced use cases
84057
- editor
83776
+ clipboardContent
84058
83777
  };
84059
83778
  }
84060
- function computeCanUndo(editor, state2) {
84061
- if (typeof editor?.can === "function") {
84062
- try {
84063
- const can = editor.can();
84064
- if (can && typeof can.undo === "function") {
84065
- return !!can.undo();
84066
- }
84067
- } catch (error) {
84068
- console.warn("[SlashMenu] Unable to determine undo availability via editor.can():", error);
84069
- }
83779
+ const onMarginClickCursorChange = (event, editor) => {
83780
+ const y2 = event.clientY;
83781
+ const x = event.clientX;
83782
+ const { view } = editor;
83783
+ const editorRect = view.dom.getBoundingClientRect();
83784
+ let coords = {
83785
+ left: 0,
83786
+ top: y2
83787
+ };
83788
+ let isRightMargin = false;
83789
+ if (x > editorRect.right) {
83790
+ coords.left = editorRect.left + editorRect.width - 1;
83791
+ isRightMargin = true;
83792
+ } else if (x < editorRect.left) {
83793
+ coords.left = editorRect.left;
84070
83794
  }
84071
- if (isCollaborationEnabled(editor)) {
84072
- try {
84073
- const undoManager = yUndoPluginKey.getState(state2)?.undoManager;
84074
- return !!undoManager && undoManager.undoStack.length > 0;
84075
- } catch (error) {
84076
- console.warn("[SlashMenu] Unable to determine undo availability via y-prosemirror:", error);
83795
+ const pos = view.posAtCoords(coords)?.pos;
83796
+ if (pos) {
83797
+ let cursorPos = pos;
83798
+ if (isRightMargin) {
83799
+ const $pos = view.state.doc.resolve(pos);
83800
+ const charOffset = $pos.textOffset;
83801
+ const node = view.state.doc.nodeAt(pos);
83802
+ const text = node?.text;
83803
+ const charAtPos = text?.charAt(charOffset);
83804
+ cursorPos = node?.isText && charAtPos !== " " ? pos - 1 : pos;
84077
83805
  }
83806
+ const transaction = view.state.tr.setSelection(TextSelection$1.create(view.state.doc, cursorPos));
83807
+ view.dispatch(transaction);
83808
+ view.focus();
84078
83809
  }
84079
- try {
84080
- return undoDepth(state2) > 0;
84081
- } catch (error) {
84082
- console.warn("[SlashMenu] Unable to determine undo availability via history plugin:", error);
84083
- return false;
83810
+ };
83811
+ const checkNodeSpecificClicks = (editor, event, popoverControls) => {
83812
+ if (!editor) return;
83813
+ if (selectionHasNodeOrMark(editor.view.state, "link", { requireEnds: true })) {
83814
+ popoverControls.component = LinkInput;
83815
+ popoverControls.position = {
83816
+ left: `${event.clientX - editor.element.getBoundingClientRect().left}px`,
83817
+ top: `${event.clientY - editor.element.getBoundingClientRect().top + 15}px`
83818
+ };
83819
+ popoverControls.props = {
83820
+ showInput: true
83821
+ };
83822
+ popoverControls.visible = true;
84084
83823
  }
84085
- }
84086
- function computeCanRedo(editor, state2) {
84087
- if (typeof editor?.can === "function") {
84088
- try {
84089
- const can = editor.can();
84090
- if (can && typeof can.redo === "function") {
84091
- return !!can.redo();
83824
+ };
83825
+ function selectionHasNodeOrMark(state2, name, options = {}) {
83826
+ const { requireEnds = false } = options;
83827
+ const $from = state2.selection.$from;
83828
+ const $to = state2.selection.$to;
83829
+ if (requireEnds) {
83830
+ for (let d2 = $from.depth; d2 > 0; d2--) {
83831
+ if ($from.node(d2).type.name === name) {
83832
+ return true;
84092
83833
  }
84093
- } catch (error) {
84094
- console.warn("[SlashMenu] Unable to determine redo availability via editor.can():", error);
84095
83834
  }
84096
- }
84097
- if (isCollaborationEnabled(editor)) {
84098
- try {
84099
- const undoManager = yUndoPluginKey.getState(state2)?.undoManager;
84100
- return !!undoManager && undoManager.redoStack.length > 0;
84101
- } catch (error) {
84102
- console.warn("[SlashMenu] Unable to determine redo availability via y-prosemirror:", error);
83835
+ for (let d2 = $to.depth; d2 > 0; d2--) {
83836
+ if ($to.node(d2).type.name === name) {
83837
+ return true;
83838
+ }
83839
+ }
83840
+ } else {
83841
+ for (let d2 = $from.depth; d2 > 0; d2--) {
83842
+ if ($from.node(d2).type.name === name) {
83843
+ return true;
83844
+ }
84103
83845
  }
84104
83846
  }
84105
- try {
84106
- return redoDepth(state2) > 0;
84107
- } catch (error) {
84108
- console.warn("[SlashMenu] Unable to determine redo availability via history plugin:", error);
84109
- return false;
83847
+ const markType = state2.schema.marks[name];
83848
+ if (markType) {
83849
+ const { from: from2, to, empty: empty2 } = state2.selection;
83850
+ if (requireEnds) {
83851
+ const fromMarks = markType.isInSet($from.marks());
83852
+ const toMarks = markType.isInSet($to.marks());
83853
+ if (fromMarks || toMarks) {
83854
+ return true;
83855
+ }
83856
+ if (empty2 && markType.isInSet(state2.storedMarks || $from.marks())) {
83857
+ return true;
83858
+ }
83859
+ } else {
83860
+ if (empty2) {
83861
+ if (markType.isInSet(state2.storedMarks || $from.marks())) {
83862
+ return true;
83863
+ }
83864
+ } else {
83865
+ let hasMark = false;
83866
+ state2.doc.nodesBetween(from2, to, (node) => {
83867
+ if (markType.isInSet(node.marks)) {
83868
+ hasMark = true;
83869
+ return false;
83870
+ }
83871
+ });
83872
+ if (hasMark) return true;
83873
+ }
83874
+ }
84110
83875
  }
83876
+ return false;
84111
83877
  }
84112
- function isCollaborationEnabled(editor) {
84113
- return Boolean(editor?.options?.collaborationProvider && editor?.options?.ydoc);
84114
- }
84115
- function getStructureFromResolvedPos(state2, pos) {
84116
- try {
84117
- const $pos = state2.doc.resolve(pos);
84118
- const ancestors = /* @__PURE__ */ new Set();
84119
- for (let depth = $pos.depth; depth > 0; depth--) {
84120
- ancestors.add($pos.node(depth).type.name);
84121
- }
84122
- const isInList = ancestors.has("bulletList") || ancestors.has("orderedList");
84123
- const isInTable2 = ancestors.has("table") || ancestors.has("tableRow") || ancestors.has("tableCell") || ancestors.has("tableHeader");
84124
- const isInSectionNode = ancestors.has("documentSection");
84125
- return {
84126
- isInTable: isInTable2,
84127
- isInList,
84128
- isInSectionNode
84129
- };
84130
- } catch (error) {
84131
- console.warn("[SlashMenu] Unable to resolve position for structural context:", error);
84132
- return null;
83878
+ function moveCursorToMouseEvent(event, editor) {
83879
+ const { view } = editor;
83880
+ const coords = { left: event.clientX, top: event.clientY };
83881
+ const pos = view.posAtCoords(coords)?.pos;
83882
+ if (typeof pos === "number") {
83883
+ const tr = view.state.tr.setSelection(TextSelection$1.create(view.state.doc, pos));
83884
+ view.dispatch(tr);
83885
+ view.focus();
84133
83886
  }
84134
83887
  }
84135
83888
  const isModuleEnabled = (editorOptions, moduleName) => {
@@ -84143,52 +83896,8 @@ const isModuleEnabled = (editorOptions, moduleName) => {
84143
83896
  return true;
84144
83897
  }
84145
83898
  };
84146
- function applyCustomMenuConfiguration(defaultSections, context) {
84147
- const { editor } = context;
84148
- const slashMenuConfig = editor.options?.slashMenuConfig;
84149
- if (!slashMenuConfig) {
84150
- return defaultSections;
84151
- }
84152
- let sections = [];
84153
- if (slashMenuConfig.includeDefaultItems !== false) {
84154
- sections = [...defaultSections];
84155
- }
84156
- if (slashMenuConfig.customItems && Array.isArray(slashMenuConfig.customItems)) {
84157
- sections = [...sections, ...slashMenuConfig.customItems];
84158
- }
84159
- if (typeof slashMenuConfig.menuProvider === "function") {
84160
- try {
84161
- sections = slashMenuConfig.menuProvider(context, sections) || sections;
84162
- } catch (error) {
84163
- console.warn("[SlashMenu] Error in custom menuProvider:", error);
84164
- }
84165
- }
84166
- return sections;
84167
- }
84168
- function filterCustomItems(sections, context) {
84169
- return sections.map((section) => {
84170
- const filteredItems = section.items.filter((item) => {
84171
- if (typeof item.showWhen === "function") {
84172
- try {
84173
- return item.showWhen(context);
84174
- } catch (error) {
84175
- console.warn(`[SlashMenu] Error in showWhen for item ${item.id}:`, error);
84176
- return false;
84177
- }
84178
- }
84179
- return true;
84180
- });
84181
- return {
84182
- ...section,
84183
- items: filteredItems
84184
- };
84185
- }).filter((section) => section.items.length > 0);
84186
- }
84187
83899
  function getItems(context) {
84188
83900
  const { editor, selectedText, trigger: trigger2, clipboardContent } = context;
84189
- const clipboardHasContent = Boolean(
84190
- 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
84191
- );
84192
83901
  const isInTable2 = selectionHasNodeOrMark(editor.view.state, "table", { requireEnds: true });
84193
83902
  const isInSectionNode = selectionHasNodeOrMark(editor.view.state, "documentSection", { requireEnds: true });
84194
83903
  const sections = [
@@ -84325,13 +84034,12 @@ function getItems(context) {
84325
84034
  ]
84326
84035
  }
84327
84036
  ];
84328
- let allSections = applyCustomMenuConfiguration(sections, context);
84329
- const filteredSections = allSections.map((section) => {
84037
+ const filteredSections = sections.map((section) => {
84330
84038
  const filteredItems = section.items.filter((item) => {
84331
84039
  if (item.requiresModule && !isModuleEnabled(editor?.options, item.requiresModule)) return false;
84332
84040
  if (item.requiresSelection && !selectedText) return false;
84333
84041
  if (!item.allowedTriggers.includes(trigger2)) return false;
84334
- if (item.requiresClipboard && !clipboardHasContent) return false;
84042
+ if (item.requiresClipboard && !clipboardContent) return false;
84335
84043
  if (item.requiresTableParent && !isInTable2 || item.id === "insert-table" && isInTable2) return false;
84336
84044
  if (item.requiresSectionParent && !isInSectionNode) return false;
84337
84045
  return true;
@@ -84341,8 +84049,7 @@ function getItems(context) {
84341
84049
  items: filteredItems
84342
84050
  };
84343
84051
  }).filter((section) => section.items.length > 0);
84344
- const finalSections = filterCustomItems(filteredSections, context);
84345
- return finalSections;
84052
+ return filteredSections;
84346
84053
  }
84347
84054
  const _hoisted_1$3 = { class: "slash-menu-items" };
84348
84055
  const _hoisted_2$1 = {
@@ -84377,7 +84084,6 @@ const _sfc_main$4 = {
84377
84084
  const menuRef = ref$1(null);
84378
84085
  const sections = ref$1([]);
84379
84086
  const selectedId = ref$1(null);
84380
- const currentContext = ref$1(null);
84381
84087
  const handleEditorUpdate = () => {
84382
84088
  if (!props.editor?.isEditable && isOpen.value) {
84383
84089
  closeMenu({ restoreCursor: false });
@@ -84423,44 +84129,6 @@ const _sfc_main$4 = {
84423
84129
  selectedId.value = newItems[0].id;
84424
84130
  }
84425
84131
  });
84426
- const customItemRefs = /* @__PURE__ */ new Map();
84427
- const setCustomItemRef = (el, item) => {
84428
- if (el && item.render) {
84429
- customItemRefs.set(item.id, { element: el, item });
84430
- nextTick(() => {
84431
- renderCustomItem(item.id);
84432
- });
84433
- }
84434
- };
84435
- const renderCustomItem = async (itemId) => {
84436
- const refData = customItemRefs.get(itemId);
84437
- if (!refData || refData.element.hasCustomContent) return;
84438
- const { element, item } = refData;
84439
- try {
84440
- if (!currentContext.value) {
84441
- currentContext.value = await getEditorContext(props.editor);
84442
- }
84443
- const context = currentContext.value;
84444
- const customElement = item.render(context);
84445
- if (customElement instanceof HTMLElement) {
84446
- element.innerHTML = "";
84447
- element.appendChild(customElement);
84448
- element.hasCustomContent = true;
84449
- }
84450
- } catch (error) {
84451
- console.warn(`[SlashMenu] Error rendering custom item ${itemId}:`, error);
84452
- element.innerHTML = `<span>${item.label || "Custom Item"}</span>`;
84453
- element.hasCustomContent = true;
84454
- }
84455
- };
84456
- const cleanupCustomItems = () => {
84457
- customItemRefs.forEach((refData) => {
84458
- if (refData.element) {
84459
- refData.element.hasCustomContent = false;
84460
- }
84461
- });
84462
- customItemRefs.clear();
84463
- };
84464
84132
  const handleGlobalKeyDown = (event) => {
84465
84133
  if (event.key === "Escape") {
84466
84134
  event.preventDefault();
@@ -84511,23 +84179,22 @@ const _sfc_main$4 = {
84511
84179
  return;
84512
84180
  }
84513
84181
  event.preventDefault();
84514
- const context = await getEditorContext(props.editor, event);
84515
- currentContext.value = context;
84516
- sections.value = getItems({ ...context, trigger: "click" });
84517
- selectedId.value = flattenedItems.value[0]?.id || null;
84518
- searchQuery.value = "";
84519
84182
  props.editor.view.dispatch(
84520
84183
  props.editor.view.state.tr.setMeta(SlashMenuPluginKey, {
84521
84184
  type: "open",
84522
- pos: context?.pos ?? props.editor.view.state.selection.from,
84185
+ pos: props.editor.view.state.selection.from,
84523
84186
  clientX: event.clientX,
84524
84187
  clientY: event.clientY
84525
84188
  })
84526
84189
  );
84190
+ searchQuery.value = "";
84191
+ const context = await getEditorContext(props.editor, event);
84192
+ sections.value = getItems({ ...context, trigger: "click" });
84193
+ selectedId.value = flattenedItems.value[0]?.id || null;
84527
84194
  };
84528
84195
  const executeCommand = async (item) => {
84529
84196
  if (props.editor) {
84530
- item.action ? await item.action(props.editor, currentContext.value) : null;
84197
+ item.action ? await item.action(props.editor) : null;
84531
84198
  if (item.component) {
84532
84199
  menuRef.value;
84533
84200
  const componentProps = getPropsByItemId(item.id, props);
@@ -84545,7 +84212,7 @@ const _sfc_main$4 = {
84545
84212
  const closeMenu = (options = { restoreCursor: true }) => {
84546
84213
  if (props.editor?.view) {
84547
84214
  const pluginState = SlashMenuPluginKey.getState(props.editor.view.state);
84548
- const anchorPos = pluginState?.anchorPos;
84215
+ const { anchorPos } = pluginState;
84549
84216
  props.editor.view.dispatch(
84550
84217
  props.editor.view.state.tr.setMeta(SlashMenuPluginKey, {
84551
84218
  type: "close"
@@ -84558,8 +84225,6 @@ const _sfc_main$4 = {
84558
84225
  props.editor.view.dispatch(tr);
84559
84226
  props.editor.view.focus();
84560
84227
  }
84561
- cleanupCustomItems();
84562
- currentContext.value = null;
84563
84228
  isOpen.value = false;
84564
84229
  searchQuery.value = "";
84565
84230
  sections.value = [];
@@ -84576,29 +84241,19 @@ const _sfc_main$4 = {
84576
84241
  isOpen.value = true;
84577
84242
  menuPosition.value = event.menuPosition;
84578
84243
  searchQuery.value = "";
84579
- if (!currentContext.value) {
84580
- const context = await getEditorContext(props.editor);
84581
- currentContext.value = context;
84582
- sections.value = getItems({ ...context, trigger: "slash" });
84583
- selectedId.value = flattenedItems.value[0]?.id || null;
84584
- } else if (sections.value.length === 0) {
84585
- const trigger2 = currentContext.value.event?.type === "contextmenu" ? "click" : "slash";
84586
- sections.value = getItems({ ...currentContext.value, trigger: trigger2 });
84587
- selectedId.value = flattenedItems.value[0]?.id || null;
84588
- }
84244
+ const context = await getEditorContext(props.editor);
84245
+ sections.value = getItems({ ...context, trigger: "slash" });
84246
+ selectedId.value = flattenedItems.value[0]?.id || null;
84589
84247
  });
84590
84248
  props.editor.view.dom.addEventListener("contextmenu", handleRightClick);
84591
84249
  props.editor.on("slashMenu:close", () => {
84592
- cleanupCustomItems();
84593
84250
  isOpen.value = false;
84594
84251
  searchQuery.value = "";
84595
- currentContext.value = null;
84596
84252
  });
84597
84253
  });
84598
84254
  onBeforeUnmount(() => {
84599
84255
  document.removeEventListener("keydown", handleGlobalKeyDown);
84600
84256
  document.removeEventListener("mousedown", handleGlobalOutsideClick);
84601
- cleanupCustomItems();
84602
84257
  if (props.editor) {
84603
84258
  try {
84604
84259
  props.editor.off("slashMenu:open");
@@ -84645,19 +84300,12 @@ const _sfc_main$4 = {
84645
84300
  class: normalizeClass(["slash-menu-item", { "is-selected": item.id === selectedId.value }]),
84646
84301
  onClick: ($event) => executeCommand(item)
84647
84302
  }, [
84648
- item.render ? (openBlock(), createElementBlock("div", {
84303
+ item.icon ? (openBlock(), createElementBlock("span", {
84649
84304
  key: 0,
84650
- ref_for: true,
84651
- ref: (el) => setCustomItemRef(el, item),
84652
- class: "slash-menu-custom-item"
84653
- }, null, 512)) : (openBlock(), createElementBlock(Fragment$1, { key: 1 }, [
84654
- item.icon ? (openBlock(), createElementBlock("span", {
84655
- key: 0,
84656
- class: "slash-menu-item-icon",
84657
- innerHTML: item.icon
84658
- }, null, 8, _hoisted_4)) : createCommentVNode("", true),
84659
- createBaseVNode("span", null, toDisplayString(item.label), 1)
84660
- ], 64))
84305
+ class: "slash-menu-item-icon",
84306
+ innerHTML: item.icon
84307
+ }, null, 8, _hoisted_4)) : createCommentVNode("", true),
84308
+ createBaseVNode("span", null, toDisplayString(item.label), 1)
84661
84309
  ], 10, _hoisted_3$1);
84662
84310
  }), 128))
84663
84311
  ], 64);
@@ -85352,76 +85000,34 @@ const _sfc_main = {
85352
85000
  }
85353
85001
  };
85354
85002
  const SuperInput = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-4d5cff52"]]);
85355
- const additionalHandlers = Object.freeze({
85356
- "mc:AlternateContent": translator,
85357
- "w:b": translator$12,
85358
- "w:bidiVisual": translator$F,
85359
- "w:bookmarkEnd": translator$1,
85360
- "w:bookmarkStart": translator$2,
85361
- "w:bottom": translator$s,
85362
- "w:br": translator$16,
85363
- "w:cantSplit": translator$T,
85364
- "w:cnfStyle": translator$S,
85365
- "w:color": translator$_,
85366
- "w:divId": translator$R,
85367
- "w:drawing": translator$4,
85368
- "w:end": translator$q,
85369
- "w:gridAfter": translator$Q,
85370
- "w:gridBefore": translator$P,
85371
- "w:gridCol": translator$b,
85372
- "w:hidden": translator$O,
85373
- "w:highlight": translator$15,
85374
- "w:hyperlink": translator$7,
85375
- "w:i": translator$11,
85376
- "w:insideH": translator$o,
85377
- "w:insideV": translator$n,
85378
- "w:jc": translator$N,
85379
- "w:left": translator$m,
85380
- "w:p": translator$13,
85381
- "w:r": translator$U,
85382
- "w:rFonts": translator$Z,
85383
- "w:rPr": translator$V,
85384
- "w:rStyle": translator$Y,
85385
- "w:right": translator$k,
85386
- "w:sdt": translator$3,
85387
- "w:shd": translator$E,
85388
- "w:start": translator$i,
85389
- "w:strike": translator$$,
85390
- "w:sz": translator$X,
85391
- "w:szCs": translator$W,
85392
- "w:tab": translator$14,
85393
- "w:tbl": translator$9,
85394
- "w:tblBorders": translator$e,
85395
- "w:tblCaption": translator$D,
85396
- "w:tblCellMar": translator$d,
85397
- "w:tblCellSpacing": translator$M,
85398
- "w:tblDescription": translator$C,
85399
- "w:tblGrid": translator$a,
85400
- "w:tblHeader": translator$L,
85401
- "w:tblInd": translator$B,
85402
- "w:tblLayout": translator$A,
85403
- "w:tblLook": translator$z,
85404
- "w:tblOverlap": translator$y,
85405
- "w:tblPr": translator$c,
85406
- "w:tblStyle": translator$x,
85407
- "w:tblStyleColBandSize": translator$w,
85408
- "w:tblStyleRowBandSize": translator$v,
85409
- "w:tblW": translator$u,
85410
- "w:tblpPr": translator$t,
85411
- "w:tc": translator$8,
85412
- "w:top": translator$g,
85413
- "w:tr": translator$G,
85414
- "w:trHeight": translator$K,
85415
- "w:trPr": translator$H,
85416
- "w:u": translator$10,
85417
- "w:wAfter": translator$J,
85418
- "w:wBefore": translator$I,
85419
- "wp:anchor": translator$6,
85420
- "wp:inline": translator$5
85421
- });
85422
85003
  const baseHandlers = {
85423
85004
  ...runPropertyTranslators,
85424
- ...additionalHandlers
85005
+ "w:br": translator$15,
85006
+ "w:cantSplit": translator$S,
85007
+ "w:cnfStyle": translator$R,
85008
+ "w:divId": translator$Q,
85009
+ "w:gridAfter": translator$P,
85010
+ "w:gridBefore": translator$O,
85011
+ "w:hidden": translator$N,
85012
+ "w:hyperlink": translator$6,
85013
+ "w:jc": translator$M,
85014
+ "w:p": translator$12,
85015
+ "w:r": translator$T,
85016
+ "w:rPr": translator$U,
85017
+ "w:sdt": translator$2,
85018
+ "w:tab": translator$13,
85019
+ "w:tblCellSpacing": translator$L,
85020
+ "w:tblHeader": translator$K,
85021
+ "w:tc": translator$7,
85022
+ "w:tr": translator$F,
85023
+ "w:trHeight": translator$J,
85024
+ "w:trPr": translator$G,
85025
+ "w:wAfter": translator$I,
85026
+ "w:wBefore": translator$H,
85027
+ "wp:anchor": translator$5,
85028
+ "wp:inline": translator$4,
85029
+ "w:bookmarkStart": translator$1,
85030
+ "w:bookmarkEnd": translator
85425
85031
  };
85426
85032
  const registeredHandlers = Object.freeze(baseHandlers);
85427
85033
  const Extensions = {