@harbour-enterprises/superdoc 0.21.0-next.8 → 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 (43) hide show
  1. package/dist/chunks/{PdfViewer-CwVW7MVJ.es.js → PdfViewer-D3zo7tPo.es.js} +1 -1
  2. package/dist/chunks/{PdfViewer-BR9iwva-.cjs → PdfViewer-OZDJ7gwT.cjs} +1 -1
  3. package/dist/chunks/{index-BNA5J__D.cjs → index-CfYf4T_z.cjs} +3 -4
  4. package/dist/chunks/{index-CjQDYBP2.es.js → index-MzW5BVNd.es.js} +3 -4
  5. package/dist/chunks/{super-editor.es-C5dhT0uU.es.js → super-editor.es-Bntob7Wd.es.js} +763 -1178
  6. package/dist/chunks/{super-editor.es-Ct59l8tt.cjs → super-editor.es-U-GVCd_F.cjs} +763 -1178
  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-B1W7AdgQ.js → editor-BqYH4kDD.js} +2 -18
  14. package/dist/super-editor/chunks/{toolbar-CCvglB_X.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/custom-selection/custom-selection.d.ts +0 -1
  22. package/dist/super-editor/src/extensions/run-item/index.d.ts +1 -0
  23. package/dist/super-editor/src/extensions/run-item/run-item.d.ts +26 -0
  24. package/dist/super-editor/src/tests/helpers/helpers.d.ts +0 -1
  25. package/dist/super-editor/style.css +0 -5
  26. package/dist/super-editor/super-editor.es.js +153 -461
  27. package/dist/super-editor/toolbar.es.js +2 -2
  28. package/dist/super-editor.cjs +1 -1
  29. package/dist/super-editor.es.js +1 -1
  30. package/dist/superdoc.cjs +2 -2
  31. package/dist/superdoc.es.js +2 -2
  32. package/dist/superdoc.umd.js +764 -1180
  33. package/dist/superdoc.umd.js.map +1 -1
  34. package/package.json +1 -1
  35. package/dist/super-editor/src/components/slash-menu/contextmenu-helpers.d.ts +0 -1
  36. package/dist/super-editor/src/components/slash-menu/tests/testHelpers.d.ts +0 -466
  37. package/dist/super-editor/src/core/commands/__tests__/schemaWithLists.d.ts +0 -2
  38. package/dist/super-editor/src/core/commands/__tests__/testHelpers.d.ts +0 -4
  39. package/dist/super-editor/src/core/commands/__tests__/testSchema.d.ts +0 -2
  40. package/dist/super-editor/src/core/commands/tests/commandTestUtils.d.ts +0 -7
  41. package/dist/super-editor/src/core/commands/tests/test-schema.d.ts +0 -2
  42. package/dist/super-editor/src/core/super-converter/v3/handlers/mc/altermateContent/alternate-content-translator.d.ts +0 -6
  43. package/dist/super-editor/src/core/super-converter/v3/handlers/mc/altermateContent/index.d.ts +0 -1
@@ -32058,37 +32058,37 @@ Please report this to https://github.com/markedjs/marked.`, e) {
32058
32058
  };
32059
32059
  __publicField$2(_NodeTranslator, "translatorTypes", TranslatorTypes);
32060
32060
  let NodeTranslator = _NodeTranslator;
32061
- const encode$18 = (attributes) => {
32061
+ const encode$17 = (attributes) => {
32062
32062
  return attributes["w:type"];
32063
32063
  };
32064
- const decode$$ = (attrs) => {
32064
+ const decode$_ = (attrs) => {
32065
32065
  const { lineBreakType } = attrs;
32066
32066
  return lineBreakType;
32067
32067
  };
32068
32068
  const attrConfig$F = Object.freeze({
32069
32069
  xmlName: "w:type",
32070
32070
  sdName: "lineBreakType",
32071
- encode: encode$18,
32072
- decode: decode$$
32071
+ encode: encode$17,
32072
+ decode: decode$_
32073
32073
  });
32074
- const encode$17 = (attributes) => {
32074
+ const encode$16 = (attributes) => {
32075
32075
  const xmlAttrValue = attributes["w:clear"];
32076
32076
  return xmlAttrValue;
32077
32077
  };
32078
- const decode$_ = (attrs) => {
32078
+ const decode$Z = (attrs) => {
32079
32079
  const { clear } = attrs;
32080
32080
  return clear;
32081
32081
  };
32082
32082
  const attrConfig$E = Object.freeze({
32083
32083
  xmlName: "w:clear",
32084
32084
  sdName: "clear",
32085
- encode: encode$17,
32086
- decode: decode$_
32085
+ encode: encode$16,
32086
+ decode: decode$Z
32087
32087
  });
32088
- const validXmlAttributes$m = [attrConfig$F, attrConfig$E];
32089
- const XML_NODE_NAME$u = "w:br";
32090
- const SD_NODE_NAME$d = "lineBreak";
32091
- const encode$16 = (_2, encodedAttrs) => {
32088
+ const validXmlAttributes$l = [attrConfig$F, attrConfig$E];
32089
+ const XML_NODE_NAME$t = "w:br";
32090
+ const SD_NODE_NAME$c = "lineBreak";
32091
+ const encode$15 = (_2, encodedAttrs) => {
32092
32092
  const isPageBreak = encodedAttrs?.lineBreakType === "page";
32093
32093
  const translated = {
32094
32094
  type: isPageBreak ? "hardBreak" : "lineBreak"
@@ -32098,7 +32098,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
32098
32098
  }
32099
32099
  return translated;
32100
32100
  };
32101
- const decode$Z = (params2, decodedAttrs) => {
32101
+ const decode$Y = (params2, decodedAttrs) => {
32102
32102
  const { node } = params2;
32103
32103
  if (!node) return;
32104
32104
  const wBreak = { name: "w:br" };
@@ -32115,39 +32115,39 @@ Please report this to https://github.com/markedjs/marked.`, e) {
32115
32115
  };
32116
32116
  return translated;
32117
32117
  };
32118
- const config$s = {
32119
- xmlName: XML_NODE_NAME$u,
32120
- sdNodeOrKeyName: SD_NODE_NAME$d,
32118
+ const config$r = {
32119
+ xmlName: XML_NODE_NAME$t,
32120
+ sdNodeOrKeyName: SD_NODE_NAME$c,
32121
32121
  type: NodeTranslator.translatorTypes.NODE,
32122
- encode: encode$16,
32123
- decode: decode$Z,
32124
- attributes: validXmlAttributes$m
32122
+ encode: encode$15,
32123
+ decode: decode$Y,
32124
+ attributes: validXmlAttributes$l
32125
32125
  };
32126
- const translator$16 = NodeTranslator.from(config$s);
32127
- const encode$15 = (attributes) => attributes?.["w:val"];
32128
- const decode$Y = (attrs) => attrs?.highlight;
32126
+ const translator$15 = NodeTranslator.from(config$r);
32127
+ const encode$14 = (attributes) => attributes?.["w:val"];
32128
+ const decode$X = (attrs) => attrs?.highlight;
32129
32129
  const attrConfig$D = Object.freeze({
32130
32130
  xmlName: "w:val",
32131
32131
  sdName: "highlight",
32132
- encode: encode$15,
32133
- decode: decode$Y
32132
+ encode: encode$14,
32133
+ decode: decode$X
32134
32134
  });
32135
- const validXmlAttributes$l = [attrConfig$D];
32136
- const XML_NODE_NAME$t = "w:highlight";
32135
+ const validXmlAttributes$k = [attrConfig$D];
32136
+ const XML_NODE_NAME$s = "w:highlight";
32137
32137
  const SD_ATTR_KEY$f = "highlight";
32138
32138
  const DISABLED_TOKENS = /* @__PURE__ */ new Set(["transparent", "none", "inherit"]);
32139
- const encode$14 = (params2, encodedAttrs = {}) => {
32139
+ const encode$13 = (params2, encodedAttrs = {}) => {
32140
32140
  const { nodes } = params2;
32141
32141
  const node = nodes?.[0];
32142
32142
  const value = encodedAttrs.highlight ?? node?.attributes?.["w:val"];
32143
32143
  return {
32144
32144
  type: "attr",
32145
- xmlName: XML_NODE_NAME$t,
32145
+ xmlName: XML_NODE_NAME$s,
32146
32146
  sdNodeOrKeyName: SD_ATTR_KEY$f,
32147
32147
  attributes: { "w:val": value ?? null }
32148
32148
  };
32149
32149
  };
32150
- const decode$X = (params2) => {
32150
+ const decode$W = (params2) => {
32151
32151
  const attrs = params2?.node?.attrs || {};
32152
32152
  const highlightValue = attrs.highlight ?? attrs.color ?? null;
32153
32153
  if (!highlightValue) return void 0;
@@ -32155,14 +32155,14 @@ Please report this to https://github.com/markedjs/marked.`, e) {
32155
32155
  if (!normalizedValue) return void 0;
32156
32156
  if (DISABLED_TOKENS.has(normalizedValue)) {
32157
32157
  return {
32158
- name: XML_NODE_NAME$t,
32158
+ name: XML_NODE_NAME$s,
32159
32159
  attributes: { "w:val": "none" }
32160
32160
  };
32161
32161
  }
32162
32162
  const keyword = getDocxHighlightKeywordFromHex(highlightValue);
32163
32163
  if (keyword) {
32164
32164
  return {
32165
- name: XML_NODE_NAME$t,
32165
+ name: XML_NODE_NAME$s,
32166
32166
  attributes: { "w:val": keyword }
32167
32167
  };
32168
32168
  }
@@ -32177,63 +32177,63 @@ Please report this to https://github.com/markedjs/marked.`, e) {
32177
32177
  }
32178
32178
  };
32179
32179
  };
32180
- const config$r = {
32181
- xmlName: XML_NODE_NAME$t,
32180
+ const config$q = {
32181
+ xmlName: XML_NODE_NAME$s,
32182
32182
  sdNodeOrKeyName: SD_ATTR_KEY$f,
32183
32183
  type: NodeTranslator.translatorTypes.ATTRIBUTE,
32184
- encode: encode$14,
32185
- decode: decode$X,
32186
- attributes: validXmlAttributes$l
32184
+ encode: encode$13,
32185
+ decode: decode$W,
32186
+ attributes: validXmlAttributes$k
32187
32187
  };
32188
- const translator$15 = NodeTranslator.from(config$r);
32189
- const encode$13 = (attributes) => {
32188
+ const translator$14 = NodeTranslator.from(config$q);
32189
+ const encode$12 = (attributes) => {
32190
32190
  return attributes["w:val"];
32191
32191
  };
32192
- const decode$W = (attrs) => {
32192
+ const decode$V = (attrs) => {
32193
32193
  const { tabSize } = attrs || {};
32194
32194
  return tabSize;
32195
32195
  };
32196
32196
  const attrConfig$C = Object.freeze({
32197
32197
  xmlName: "w:val",
32198
32198
  sdName: "tabSize",
32199
- encode: encode$13,
32200
- decode: decode$W
32199
+ encode: encode$12,
32200
+ decode: decode$V
32201
32201
  });
32202
- const encode$12 = (attributes) => {
32202
+ const encode$11 = (attributes) => {
32203
32203
  return attributes["w:leader"];
32204
32204
  };
32205
- const decode$V = (attrs) => {
32205
+ const decode$U = (attrs) => {
32206
32206
  const { leader } = attrs || {};
32207
32207
  return leader;
32208
32208
  };
32209
32209
  const attrConfig$B = Object.freeze({
32210
32210
  xmlName: "w:leader",
32211
32211
  sdName: "leader",
32212
- encode: encode$12,
32213
- decode: decode$V
32212
+ encode: encode$11,
32213
+ decode: decode$U
32214
32214
  });
32215
- const encode$11 = (attributes) => {
32215
+ const encode$10 = (attributes) => {
32216
32216
  return attributes["w:pos"];
32217
32217
  };
32218
- const decode$U = (attrs) => {
32218
+ const decode$T = (attrs) => {
32219
32219
  const { pos } = attrs || {};
32220
32220
  return pos;
32221
32221
  };
32222
32222
  const attrConfig$A = Object.freeze({
32223
32223
  xmlName: "w:pos",
32224
32224
  sdName: "pos",
32225
- encode: encode$11,
32226
- decode: decode$U
32225
+ encode: encode$10,
32226
+ decode: decode$T
32227
32227
  });
32228
- const validXmlAttributes$k = [attrConfig$C, attrConfig$A, attrConfig$B];
32229
- const XML_NODE_NAME$s = "w:tab";
32230
- const SD_NODE_NAME$c = "tab";
32231
- const encode$10 = (_2, encodedAttrs = {}) => {
32228
+ const validXmlAttributes$j = [attrConfig$C, attrConfig$A, attrConfig$B];
32229
+ const XML_NODE_NAME$r = "w:tab";
32230
+ const SD_NODE_NAME$b = "tab";
32231
+ const encode$$ = (_2, encodedAttrs = {}) => {
32232
32232
  const translated = { type: "tab" };
32233
32233
  if (encodedAttrs) translated.attrs = { ...encodedAttrs };
32234
32234
  return translated;
32235
32235
  };
32236
- const decode$T = (params2, decodedAttrs = {}) => {
32236
+ const decode$S = (params2, decodedAttrs = {}) => {
32237
32237
  const { node } = params2 || {};
32238
32238
  if (!node) return;
32239
32239
  const wTab = { name: "w:tab" };
@@ -32249,15 +32249,15 @@ Please report this to https://github.com/markedjs/marked.`, e) {
32249
32249
  }
32250
32250
  return translated;
32251
32251
  };
32252
- const config$q = {
32253
- xmlName: XML_NODE_NAME$s,
32254
- sdNodeOrKeyName: SD_NODE_NAME$c,
32252
+ const config$p = {
32253
+ xmlName: XML_NODE_NAME$r,
32254
+ sdNodeOrKeyName: SD_NODE_NAME$b,
32255
32255
  type: NodeTranslator.translatorTypes.NODE,
32256
- encode: encode$10,
32257
- decode: decode$T,
32258
- attributes: validXmlAttributes$k
32256
+ encode: encode$$,
32257
+ decode: decode$S,
32258
+ attributes: validXmlAttributes$j
32259
32259
  };
32260
- const translator$14 = NodeTranslator.from(config$q);
32260
+ const translator$13 = NodeTranslator.from(config$p);
32261
32261
  const mergeTextNodes = (nodes) => {
32262
32262
  if (!nodes || !Array.isArray(nodes)) {
32263
32263
  return nodes;
@@ -32872,91 +32872,91 @@ Please report this to https://github.com/markedjs/marked.`, e) {
32872
32872
  }
32873
32873
  return schemaNode;
32874
32874
  };
32875
- const encode$$ = (attributes) => {
32875
+ const encode$_ = (attributes) => {
32876
32876
  return attributes["w:rsidDel"];
32877
32877
  };
32878
- const decode$S = (attrs) => {
32878
+ const decode$R = (attrs) => {
32879
32879
  return attrs.rsidDel;
32880
32880
  };
32881
32881
  const attrConfig$z = Object.freeze({
32882
32882
  xmlName: "w:rsidDel",
32883
32883
  sdName: "rsidDel",
32884
- encode: encode$$,
32885
- decode: decode$S
32884
+ encode: encode$_,
32885
+ decode: decode$R
32886
32886
  });
32887
- const encode$_ = (attributes) => {
32887
+ const encode$Z = (attributes) => {
32888
32888
  return attributes["w:rsidP"];
32889
32889
  };
32890
- const decode$R = (attrs) => {
32890
+ const decode$Q = (attrs) => {
32891
32891
  return attrs.rsidP;
32892
32892
  };
32893
32893
  const attrConfig$y = Object.freeze({
32894
32894
  xmlName: "w:rsidP",
32895
32895
  sdName: "rsidP",
32896
- encode: encode$_,
32897
- decode: decode$R
32896
+ encode: encode$Z,
32897
+ decode: decode$Q
32898
32898
  });
32899
- const encode$Z = (attributes) => {
32899
+ const encode$Y = (attributes) => {
32900
32900
  return attributes["w:rsidR"];
32901
32901
  };
32902
- const decode$Q = (attrs) => {
32902
+ const decode$P = (attrs) => {
32903
32903
  return attrs.rsidR;
32904
32904
  };
32905
32905
  const attrConfig$x = Object.freeze({
32906
32906
  xmlName: "w:rsidR",
32907
32907
  sdName: "rsidR",
32908
- encode: encode$Z,
32909
- decode: decode$Q
32908
+ encode: encode$Y,
32909
+ decode: decode$P
32910
32910
  });
32911
- const encode$Y = (attributes) => {
32911
+ const encode$X = (attributes) => {
32912
32912
  return attributes["w:rsidRPr"];
32913
32913
  };
32914
- const decode$P = (attrs) => {
32914
+ const decode$O = (attrs) => {
32915
32915
  return attrs.rsidRPr;
32916
32916
  };
32917
32917
  const attrConfig$w = Object.freeze({
32918
32918
  xmlName: "w:rsidRPr",
32919
32919
  sdName: "rsidRPr",
32920
- encode: encode$Y,
32921
- decode: decode$P
32920
+ encode: encode$X,
32921
+ decode: decode$O
32922
32922
  });
32923
- const encode$X = (attributes) => {
32923
+ const encode$W = (attributes) => {
32924
32924
  return attributes["w:rsidRDefault"];
32925
32925
  };
32926
- const decode$O = (attrs) => {
32926
+ const decode$N = (attrs) => {
32927
32927
  return attrs.rsidRDefault;
32928
32928
  };
32929
32929
  const attrConfig$v = Object.freeze({
32930
32930
  xmlName: "w:rsidRDefault",
32931
32931
  sdName: "rsidRDefault",
32932
- encode: encode$X,
32933
- decode: decode$O
32932
+ encode: encode$W,
32933
+ decode: decode$N
32934
32934
  });
32935
- const encode$W = (attributes) => {
32935
+ const encode$V = (attributes) => {
32936
32936
  return attributes["w14:paraId"];
32937
32937
  };
32938
- const decode$N = (attrs) => {
32938
+ const decode$M = (attrs) => {
32939
32939
  return attrs.paraId;
32940
32940
  };
32941
32941
  const attrConfig$u = Object.freeze({
32942
32942
  xmlName: "w14:paraId",
32943
32943
  sdName: "paraId",
32944
- encode: encode$W,
32945
- decode: decode$N
32944
+ encode: encode$V,
32945
+ decode: decode$M
32946
32946
  });
32947
- const encode$V = (attributes) => {
32947
+ const encode$U = (attributes) => {
32948
32948
  return attributes["w14:textId"];
32949
32949
  };
32950
- const decode$M = (attrs) => {
32950
+ const decode$L = (attrs) => {
32951
32951
  return attrs.textId;
32952
32952
  };
32953
32953
  const attrConfig$t = Object.freeze({
32954
32954
  xmlName: "w14:textId",
32955
32955
  sdName: "textId",
32956
- encode: encode$V,
32957
- decode: decode$M
32956
+ encode: encode$U,
32957
+ decode: decode$L
32958
32958
  });
32959
- const validXmlAttributes$j = [
32959
+ const validXmlAttributes$i = [
32960
32960
  attrConfig$u,
32961
32961
  attrConfig$t,
32962
32962
  attrConfig$x,
@@ -32965,9 +32965,9 @@ Please report this to https://github.com/markedjs/marked.`, e) {
32965
32965
  attrConfig$w,
32966
32966
  attrConfig$z
32967
32967
  ];
32968
- const XML_NODE_NAME$r = "w:p";
32969
- const SD_NODE_NAME$b = "paragraph";
32970
- const encode$U = (params2, encodedAttrs = {}) => {
32968
+ const XML_NODE_NAME$q = "w:p";
32969
+ const SD_NODE_NAME$a = "paragraph";
32970
+ const encode$T = (params2, encodedAttrs = {}) => {
32971
32971
  const node = handleParagraphNode$1(params2);
32972
32972
  if (!node) return void 0;
32973
32973
  if (encodedAttrs && Object.keys(encodedAttrs).length) {
@@ -32975,7 +32975,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
32975
32975
  }
32976
32976
  return node;
32977
32977
  };
32978
- const decode$L = (params2, decodedAttrs = {}) => {
32978
+ const decode$K = (params2, decodedAttrs = {}) => {
32979
32979
  const translated = translateParagraphNode(params2);
32980
32980
  if (!translated) return void 0;
32981
32981
  if (decodedAttrs && Object.keys(decodedAttrs).length) {
@@ -32983,16 +32983,16 @@ Please report this to https://github.com/markedjs/marked.`, e) {
32983
32983
  }
32984
32984
  return translated;
32985
32985
  };
32986
- const config$p = {
32987
- xmlName: XML_NODE_NAME$r,
32988
- sdNodeOrKeyName: SD_NODE_NAME$b,
32986
+ const config$o = {
32987
+ xmlName: XML_NODE_NAME$q,
32988
+ sdNodeOrKeyName: SD_NODE_NAME$a,
32989
32989
  type: NodeTranslator.translatorTypes.NODE,
32990
- encode: encode$U,
32991
- decode: decode$L,
32992
- attributes: validXmlAttributes$j
32990
+ encode: encode$T,
32991
+ decode: decode$K,
32992
+ attributes: validXmlAttributes$i
32993
32993
  };
32994
- const translator$13 = NodeTranslator.from(config$p);
32995
- const encode$T = (attributes) => {
32994
+ const translator$12 = NodeTranslator.from(config$o);
32995
+ const encode$S = (attributes) => {
32996
32996
  const raw = attributes?.["w:val"];
32997
32997
  if (raw === void 0 || raw === null) return void 0;
32998
32998
  if (typeof raw === "boolean") return raw;
@@ -33002,20 +33002,20 @@ Please report this to https://github.com/markedjs/marked.`, e) {
33002
33002
  if (val === "1" || val === "true" || val === "on") return true;
33003
33003
  return void 0;
33004
33004
  };
33005
- const decode$K = (runProps) => {
33005
+ const decode$J = (runProps) => {
33006
33006
  if (runProps?.bold === false) return "0";
33007
33007
  return void 0;
33008
33008
  };
33009
33009
  const attrConfig$s = Object.freeze({
33010
33010
  xmlName: "w:val",
33011
33011
  sdName: "bold",
33012
- encode: encode$T,
33013
- decode: decode$K
33012
+ encode: encode$S,
33013
+ decode: decode$J
33014
33014
  });
33015
- const validXmlAttributes$i = [attrConfig$s];
33016
- const XML_NODE_NAME$q = "w:b";
33015
+ const validXmlAttributes$h = [attrConfig$s];
33016
+ const XML_NODE_NAME$p = "w:b";
33017
33017
  const SD_ATTR_KEY$e = "bold";
33018
- const encode$S = (params2, encodedAttrs = {}) => {
33018
+ const encode$R = (params2, encodedAttrs = {}) => {
33019
33019
  const { nodes } = params2;
33020
33020
  const node = nodes[0];
33021
33021
  if (!node) return void 0;
@@ -33027,85 +33027,85 @@ Please report this to https://github.com/markedjs/marked.`, e) {
33027
33027
  else attributes = node.attributes || {};
33028
33028
  return {
33029
33029
  type: "attr",
33030
- xmlName: XML_NODE_NAME$q,
33030
+ xmlName: XML_NODE_NAME$p,
33031
33031
  sdNodeOrKeyName: SD_ATTR_KEY$e,
33032
33032
  attributes
33033
33033
  };
33034
33034
  };
33035
- const config$o = {
33036
- xmlName: XML_NODE_NAME$q,
33035
+ const config$n = {
33036
+ xmlName: XML_NODE_NAME$p,
33037
33037
  sdNodeOrKeyName: SD_ATTR_KEY$e,
33038
33038
  type: NodeTranslator.translatorTypes.ATTRIBUTE,
33039
- encode: encode$S,
33040
- attributes: validXmlAttributes$i
33039
+ encode: encode$R,
33040
+ attributes: validXmlAttributes$h
33041
33041
  };
33042
- const translator$12 = NodeTranslator.from(config$o);
33043
- const XML_NODE_NAME$p = "w:i";
33042
+ const translator$11 = NodeTranslator.from(config$n);
33043
+ const XML_NODE_NAME$o = "w:i";
33044
33044
  const SD_ATTR_KEY$d = "italic";
33045
- const encode$R = (params2) => {
33045
+ const encode$Q = (params2) => {
33046
33046
  const { nodes } = params2;
33047
33047
  const node = nodes?.[0];
33048
33048
  if (!node) return void 0;
33049
33049
  return {
33050
33050
  type: "attr",
33051
- xmlName: XML_NODE_NAME$p,
33051
+ xmlName: XML_NODE_NAME$o,
33052
33052
  sdNodeOrKeyName: SD_ATTR_KEY$d,
33053
33053
  attributes: {
33054
33054
  "w:val": node.attributes?.["w:val"] ?? null
33055
33055
  }
33056
33056
  };
33057
33057
  };
33058
- const config$n = {
33059
- xmlName: XML_NODE_NAME$p,
33058
+ const config$m = {
33059
+ xmlName: XML_NODE_NAME$o,
33060
33060
  sdNodeOrKeyName: SD_ATTR_KEY$d,
33061
33061
  type: NodeTranslator.translatorTypes.ATTRIBUTE,
33062
- encode: encode$R
33062
+ encode: encode$Q
33063
33063
  };
33064
- const translator$11 = NodeTranslator.from(config$n);
33065
- const encode$Q = (attributes) => attributes?.["w:val"];
33066
- const decode$J = (attrs) => attrs?.underline;
33064
+ const translator$10 = NodeTranslator.from(config$m);
33065
+ const encode$P = (attributes) => attributes?.["w:val"];
33066
+ const decode$I = (attrs) => attrs?.underline;
33067
33067
  const attrConfig$r = Object.freeze({
33068
33068
  xmlName: "w:val",
33069
33069
  sdName: "underline",
33070
- encode: encode$Q,
33071
- decode: decode$J
33070
+ encode: encode$P,
33071
+ decode: decode$I
33072
33072
  });
33073
- const encode$P = (attributes) => attributes?.["w:color"];
33074
- const decode$I = (attrs) => attrs?.color;
33073
+ const encode$O = (attributes) => attributes?.["w:color"];
33074
+ const decode$H = (attrs) => attrs?.color;
33075
33075
  const attrConfig$q = Object.freeze({
33076
33076
  xmlName: "w:color",
33077
33077
  sdName: "color",
33078
- encode: encode$P,
33079
- decode: decode$I
33078
+ encode: encode$O,
33079
+ decode: decode$H
33080
33080
  });
33081
- const encode$O = (attributes) => attributes?.["w:themeColor"];
33082
- const decode$H = (attrs) => attrs?.themeColor;
33081
+ const encode$N = (attributes) => attributes?.["w:themeColor"];
33082
+ const decode$G = (attrs) => attrs?.themeColor;
33083
33083
  const attrConfig$p = Object.freeze({
33084
33084
  xmlName: "w:themeColor",
33085
33085
  sdName: "themeColor",
33086
- encode: encode$O,
33087
- decode: decode$H
33086
+ encode: encode$N,
33087
+ decode: decode$G
33088
33088
  });
33089
- const encode$N = (attributes) => attributes?.["w:themeTint"];
33090
- const decode$G = (attrs) => attrs?.themeTint;
33089
+ const encode$M = (attributes) => attributes?.["w:themeTint"];
33090
+ const decode$F = (attrs) => attrs?.themeTint;
33091
33091
  const attrConfig$o = Object.freeze({
33092
33092
  xmlName: "w:themeTint",
33093
33093
  sdName: "themeTint",
33094
- encode: encode$N,
33095
- decode: decode$G
33094
+ encode: encode$M,
33095
+ decode: decode$F
33096
33096
  });
33097
- const encode$M = (attributes) => attributes?.["w:themeShade"];
33098
- const decode$F = (attrs) => attrs?.themeShade;
33097
+ const encode$L = (attributes) => attributes?.["w:themeShade"];
33098
+ const decode$E = (attrs) => attrs?.themeShade;
33099
33099
  const attrConfig$n = Object.freeze({
33100
33100
  xmlName: "w:themeShade",
33101
33101
  sdName: "themeShade",
33102
- encode: encode$M,
33103
- decode: decode$F
33102
+ encode: encode$L,
33103
+ decode: decode$E
33104
33104
  });
33105
- const validXmlAttributes$h = [attrConfig$r, attrConfig$q, attrConfig$p, attrConfig$o, attrConfig$n];
33106
- const XML_NODE_NAME$o = "w:u";
33105
+ const validXmlAttributes$g = [attrConfig$r, attrConfig$q, attrConfig$p, attrConfig$o, attrConfig$n];
33106
+ const XML_NODE_NAME$n = "w:u";
33107
33107
  const SD_ATTR_KEY$c = "underline";
33108
- const encode$L = (params2, encodedAttrs = {}) => {
33108
+ const encode$K = (params2, encodedAttrs = {}) => {
33109
33109
  const { nodes } = params2;
33110
33110
  const node = nodes?.[0];
33111
33111
  const sourceAttrs = node?.attributes || {};
@@ -33121,12 +33121,12 @@ Please report this to https://github.com/markedjs/marked.`, e) {
33121
33121
  if (themeShade !== void 0 && themeShade !== null) attributes["w:themeShade"] = themeShade;
33122
33122
  return {
33123
33123
  type: "attr",
33124
- xmlName: XML_NODE_NAME$o,
33124
+ xmlName: XML_NODE_NAME$n,
33125
33125
  sdNodeOrKeyName: SD_ATTR_KEY$c,
33126
33126
  attributes
33127
33127
  };
33128
33128
  };
33129
- const decode$E = (params2) => {
33129
+ const decode$D = (params2) => {
33130
33130
  const attrs = params2?.node?.attrs || {};
33131
33131
  const underlineType = attrs.underlineType ?? attrs.underline ?? null;
33132
33132
  const color = attrs.underlineColor ?? attrs.color ?? null;
@@ -33144,20 +33144,20 @@ Please report this to https://github.com/markedjs/marked.`, e) {
33144
33144
  if (themeTint) attributes["w:themeTint"] = themeTint;
33145
33145
  if (themeShade) attributes["w:themeShade"] = themeShade;
33146
33146
  return {
33147
- name: XML_NODE_NAME$o,
33147
+ name: XML_NODE_NAME$n,
33148
33148
  attributes
33149
33149
  };
33150
33150
  };
33151
- const config$m = {
33152
- xmlName: XML_NODE_NAME$o,
33151
+ const config$l = {
33152
+ xmlName: XML_NODE_NAME$n,
33153
33153
  sdNodeOrKeyName: SD_ATTR_KEY$c,
33154
33154
  type: NodeTranslator.translatorTypes.ATTRIBUTE,
33155
- encode: encode$L,
33156
- decode: decode$E,
33157
- attributes: validXmlAttributes$h
33155
+ encode: encode$K,
33156
+ decode: decode$D,
33157
+ attributes: validXmlAttributes$g
33158
33158
  };
33159
- const translator$10 = NodeTranslator.from(config$m);
33160
- const encode$K = (attributes) => {
33159
+ const translator$$ = NodeTranslator.from(config$l);
33160
+ const encode$J = (attributes) => {
33161
33161
  const raw = attributes?.["w:val"];
33162
33162
  if (raw === void 0 || raw === null) return void 0;
33163
33163
  if (typeof raw === "boolean") return raw;
@@ -33167,20 +33167,20 @@ Please report this to https://github.com/markedjs/marked.`, e) {
33167
33167
  if (val === "1" || val === "true" || val === "on") return true;
33168
33168
  return void 0;
33169
33169
  };
33170
- const decode$D = (attrs) => {
33170
+ const decode$C = (attrs) => {
33171
33171
  if (attrs?.strike === false) return "0";
33172
33172
  return void 0;
33173
33173
  };
33174
33174
  const attrConfig$m = Object.freeze({
33175
33175
  xmlName: "w:val",
33176
33176
  sdName: "strike",
33177
- encode: encode$K,
33178
- decode: decode$D
33177
+ encode: encode$J,
33178
+ decode: decode$C
33179
33179
  });
33180
- const validXmlAttributes$g = [attrConfig$m];
33181
- const XML_NODE_NAME$n = "w:strike";
33180
+ const validXmlAttributes$f = [attrConfig$m];
33181
+ const XML_NODE_NAME$m = "w:strike";
33182
33182
  const SD_ATTR_KEY$b = "strike";
33183
- const encode$J = (params2, encodedAttrs = {}) => {
33183
+ const encode$I = (params2, encodedAttrs = {}) => {
33184
33184
  const { nodes } = params2;
33185
33185
  const node = nodes?.[0];
33186
33186
  if (!node) return void 0;
@@ -33193,55 +33193,55 @@ Please report this to https://github.com/markedjs/marked.`, e) {
33193
33193
  else if (val === true && attributes["w:val"] === void 0) delete attributes["w:val"];
33194
33194
  return {
33195
33195
  type: "attr",
33196
- xmlName: XML_NODE_NAME$n,
33196
+ xmlName: XML_NODE_NAME$m,
33197
33197
  sdNodeOrKeyName: SD_ATTR_KEY$b,
33198
33198
  attributes
33199
33199
  };
33200
33200
  };
33201
- const config$l = {
33202
- xmlName: XML_NODE_NAME$n,
33201
+ const config$k = {
33202
+ xmlName: XML_NODE_NAME$m,
33203
33203
  sdNodeOrKeyName: SD_ATTR_KEY$b,
33204
33204
  type: NodeTranslator.translatorTypes.ATTRIBUTE,
33205
- encode: encode$J,
33206
- attributes: validXmlAttributes$g
33205
+ encode: encode$I,
33206
+ attributes: validXmlAttributes$f
33207
33207
  };
33208
- const translator$$ = NodeTranslator.from(config$l);
33209
- const encode$I = (attributes) => attributes?.["w:val"];
33210
- const decode$C = (attrs) => attrs?.color;
33208
+ const translator$_ = NodeTranslator.from(config$k);
33209
+ const encode$H = (attributes) => attributes?.["w:val"];
33210
+ const decode$B = (attrs) => attrs?.color;
33211
33211
  const attrConfig$l = Object.freeze({
33212
33212
  xmlName: "w:val",
33213
33213
  sdName: "color",
33214
- encode: encode$I,
33215
- decode: decode$C
33214
+ encode: encode$H,
33215
+ decode: decode$B
33216
33216
  });
33217
- const encode$H = (attributes) => attributes?.["w:themeColor"];
33218
- const decode$B = (attrs) => attrs?.themeColor;
33217
+ const encode$G = (attributes) => attributes?.["w:themeColor"];
33218
+ const decode$A = (attrs) => attrs?.themeColor;
33219
33219
  const attrConfig$k = Object.freeze({
33220
33220
  xmlName: "w:themeColor",
33221
33221
  sdName: "themeColor",
33222
- encode: encode$H,
33223
- decode: decode$B
33222
+ encode: encode$G,
33223
+ decode: decode$A
33224
33224
  });
33225
- const encode$G = (attributes) => attributes?.["w:themeTint"];
33226
- const decode$A = (attrs) => attrs?.themeTint;
33225
+ const encode$F = (attributes) => attributes?.["w:themeTint"];
33226
+ const decode$z = (attrs) => attrs?.themeTint;
33227
33227
  const attrConfig$j = Object.freeze({
33228
33228
  xmlName: "w:themeTint",
33229
33229
  sdName: "themeTint",
33230
- encode: encode$G,
33231
- decode: decode$A
33230
+ encode: encode$F,
33231
+ decode: decode$z
33232
33232
  });
33233
- const encode$F = (attributes) => attributes?.["w:themeShade"];
33234
- const decode$z = (attrs) => attrs?.themeShade;
33233
+ const encode$E = (attributes) => attributes?.["w:themeShade"];
33234
+ const decode$y = (attrs) => attrs?.themeShade;
33235
33235
  const attrConfig$i = Object.freeze({
33236
33236
  xmlName: "w:themeShade",
33237
33237
  sdName: "themeShade",
33238
- encode: encode$F,
33239
- decode: decode$z
33238
+ encode: encode$E,
33239
+ decode: decode$y
33240
33240
  });
33241
- const validXmlAttributes$f = [attrConfig$l, attrConfig$k, attrConfig$j, attrConfig$i];
33242
- const XML_NODE_NAME$m = "w:color";
33241
+ const validXmlAttributes$e = [attrConfig$l, attrConfig$k, attrConfig$j, attrConfig$i];
33242
+ const XML_NODE_NAME$l = "w:color";
33243
33243
  const SD_ATTR_KEY$a = "color";
33244
- const encode$E = (params2, encodedAttrs = {}) => {
33244
+ const encode$D = (params2, encodedAttrs = {}) => {
33245
33245
  const { nodes } = params2;
33246
33246
  const node = nodes?.[0];
33247
33247
  const sourceAttrs = node?.attributes || {};
@@ -33256,63 +33256,63 @@ Please report this to https://github.com/markedjs/marked.`, e) {
33256
33256
  if (themeShade !== void 0 && themeShade !== null) attributes["w:themeShade"] = themeShade;
33257
33257
  return {
33258
33258
  type: "attr",
33259
- xmlName: XML_NODE_NAME$m,
33259
+ xmlName: XML_NODE_NAME$l,
33260
33260
  sdNodeOrKeyName: SD_ATTR_KEY$a,
33261
33261
  attributes
33262
33262
  };
33263
33263
  };
33264
- const config$k = {
33265
- xmlName: XML_NODE_NAME$m,
33264
+ const config$j = {
33265
+ xmlName: XML_NODE_NAME$l,
33266
33266
  sdNodeOrKeyName: SD_ATTR_KEY$a,
33267
33267
  type: NodeTranslator.translatorTypes.ATTRIBUTE,
33268
- encode: encode$E,
33269
- attributes: validXmlAttributes$f
33268
+ encode: encode$D,
33269
+ attributes: validXmlAttributes$e
33270
33270
  };
33271
- const translator$_ = NodeTranslator.from(config$k);
33272
- const encode$D = (attributes) => attributes?.["w:eastAsia"];
33273
- const decode$y = (attrs) => attrs?.eastAsia;
33271
+ const translator$Z = NodeTranslator.from(config$j);
33272
+ const encode$C = (attributes) => attributes?.["w:eastAsia"];
33273
+ const decode$x = (attrs) => attrs?.eastAsia;
33274
33274
  const attrConfig$h = Object.freeze({
33275
33275
  xmlName: "w:eastAsia",
33276
33276
  sdName: "eastAsia",
33277
- encode: encode$D,
33278
- decode: decode$y
33277
+ encode: encode$C,
33278
+ decode: decode$x
33279
33279
  });
33280
- const encode$C = (attributes) => attributes?.["w:ascii"];
33281
- const decode$x = (attrs) => attrs?.ascii;
33280
+ const encode$B = (attributes) => attributes?.["w:ascii"];
33281
+ const decode$w = (attrs) => attrs?.ascii;
33282
33282
  const attrConfig$g = Object.freeze({
33283
33283
  xmlName: "w:ascii",
33284
33284
  sdName: "ascii",
33285
- encode: encode$C,
33286
- decode: decode$x
33285
+ encode: encode$B,
33286
+ decode: decode$w
33287
33287
  });
33288
- const encode$B = (attributes) => attributes?.["w:hAnsi"];
33289
- const decode$w = (attrs) => attrs?.hAnsi;
33288
+ const encode$A = (attributes) => attributes?.["w:hAnsi"];
33289
+ const decode$v = (attrs) => attrs?.hAnsi;
33290
33290
  const attrConfig$f = Object.freeze({
33291
33291
  xmlName: "w:hAnsi",
33292
33292
  sdName: "hAnsi",
33293
- encode: encode$B,
33294
- decode: decode$w
33293
+ encode: encode$A,
33294
+ decode: decode$v
33295
33295
  });
33296
- const encode$A = (attributes) => attributes?.["w:cs"];
33297
- const decode$v = (attrs) => attrs?.cs;
33296
+ const encode$z = (attributes) => attributes?.["w:cs"];
33297
+ const decode$u = (attrs) => attrs?.cs;
33298
33298
  const attrConfig$e = Object.freeze({
33299
33299
  xmlName: "w:cs",
33300
33300
  sdName: "cs",
33301
- encode: encode$A,
33302
- decode: decode$v
33301
+ encode: encode$z,
33302
+ decode: decode$u
33303
33303
  });
33304
- const encode$z = (attributes) => attributes?.["w:val"];
33305
- const decode$u = (attrs) => attrs?.value;
33304
+ const encode$y = (attributes) => attributes?.["w:val"];
33305
+ const decode$t = (attrs) => attrs?.value;
33306
33306
  const attrConfig$d = Object.freeze({
33307
33307
  xmlName: "w:val",
33308
33308
  sdName: "value",
33309
- encode: encode$z,
33310
- decode: decode$u
33309
+ encode: encode$y,
33310
+ decode: decode$t
33311
33311
  });
33312
- const validXmlAttributes$e = [attrConfig$h, attrConfig$g, attrConfig$f, attrConfig$e, attrConfig$d];
33313
- const XML_NODE_NAME$l = "w:rFonts";
33312
+ const validXmlAttributes$d = [attrConfig$h, attrConfig$g, attrConfig$f, attrConfig$e, attrConfig$d];
33313
+ const XML_NODE_NAME$k = "w:rFonts";
33314
33314
  const SD_ATTR_KEY$9 = "fontFamily";
33315
- const encode$y = (params2, encodedAttrs = {}) => {
33315
+ const encode$x = (params2, encodedAttrs = {}) => {
33316
33316
  const { nodes } = params2;
33317
33317
  const node = nodes?.[0];
33318
33318
  const sourceAttrs = node?.attributes || {};
@@ -33338,120 +33338,120 @@ Please report this to https://github.com/markedjs/marked.`, e) {
33338
33338
  if (attributes["w:val"] === void 0) delete attributes["w:val"];
33339
33339
  return {
33340
33340
  type: "attr",
33341
- xmlName: XML_NODE_NAME$l,
33341
+ xmlName: XML_NODE_NAME$k,
33342
33342
  sdNodeOrKeyName: SD_ATTR_KEY$9,
33343
33343
  attributes
33344
33344
  };
33345
33345
  };
33346
- const config$j = {
33347
- xmlName: XML_NODE_NAME$l,
33346
+ const config$i = {
33347
+ xmlName: XML_NODE_NAME$k,
33348
33348
  sdNodeOrKeyName: SD_ATTR_KEY$9,
33349
33349
  type: NodeTranslator.translatorTypes.ATTRIBUTE,
33350
- encode: encode$y,
33351
- attributes: validXmlAttributes$e
33350
+ encode: encode$x,
33351
+ attributes: validXmlAttributes$d
33352
33352
  };
33353
- const translator$Z = NodeTranslator.from(config$j);
33354
- const encode$x = (attributes) => attributes?.["w:val"];
33355
- const decode$t = (attrs) => attrs?.styleId;
33353
+ const translator$Y = NodeTranslator.from(config$i);
33354
+ const encode$w = (attributes) => attributes?.["w:val"];
33355
+ const decode$s = (attrs) => attrs?.styleId;
33356
33356
  const attrConfig$c = Object.freeze({
33357
33357
  xmlName: "w:val",
33358
33358
  sdName: "styleId",
33359
- encode: encode$x,
33360
- decode: decode$t
33359
+ encode: encode$w,
33360
+ decode: decode$s
33361
33361
  });
33362
- const validXmlAttributes$d = [attrConfig$c];
33363
- const XML_NODE_NAME$k = "w:rStyle";
33362
+ const validXmlAttributes$c = [attrConfig$c];
33363
+ const XML_NODE_NAME$j = "w:rStyle";
33364
33364
  const SD_ATTR_KEY$8 = "styleId";
33365
- const encode$w = (params2, encodedAttrs = {}) => {
33365
+ const encode$v = (params2, encodedAttrs = {}) => {
33366
33366
  const { nodes } = params2;
33367
33367
  const node = nodes?.[0];
33368
33368
  const value = encodedAttrs.styleId ?? node?.attributes?.["w:val"];
33369
33369
  return {
33370
33370
  type: "attr",
33371
- xmlName: XML_NODE_NAME$k,
33371
+ xmlName: XML_NODE_NAME$j,
33372
33372
  sdNodeOrKeyName: SD_ATTR_KEY$8,
33373
33373
  attributes: { "w:val": value ?? null }
33374
33374
  };
33375
33375
  };
33376
- const config$i = {
33377
- xmlName: XML_NODE_NAME$k,
33376
+ const config$h = {
33377
+ xmlName: XML_NODE_NAME$j,
33378
33378
  sdNodeOrKeyName: SD_ATTR_KEY$8,
33379
33379
  type: NodeTranslator.translatorTypes.ATTRIBUTE,
33380
- encode: encode$w,
33381
- attributes: validXmlAttributes$d
33380
+ encode: encode$v,
33381
+ attributes: validXmlAttributes$c
33382
33382
  };
33383
- const translator$Y = NodeTranslator.from(config$i);
33384
- const encode$v = (attributes) => attributes?.["w:val"];
33385
- const decode$s = (attrs) => attrs?.fontSize;
33383
+ const translator$X = NodeTranslator.from(config$h);
33384
+ const encode$u = (attributes) => attributes?.["w:val"];
33385
+ const decode$r = (attrs) => attrs?.fontSize;
33386
33386
  const attrConfig$b = Object.freeze({
33387
33387
  xmlName: "w:val",
33388
33388
  sdName: "fontSize",
33389
- encode: encode$v,
33390
- decode: decode$s
33389
+ encode: encode$u,
33390
+ decode: decode$r
33391
33391
  });
33392
- const validXmlAttributes$c = [attrConfig$b];
33393
- const XML_NODE_NAME$j = "w:sz";
33392
+ const validXmlAttributes$b = [attrConfig$b];
33393
+ const XML_NODE_NAME$i = "w:sz";
33394
33394
  const SD_ATTR_KEY$7 = "fontSize";
33395
- const encode$u = (params2, encodedAttrs = {}) => {
33395
+ const encode$t = (params2, encodedAttrs = {}) => {
33396
33396
  const { nodes } = params2;
33397
33397
  const node = nodes?.[0];
33398
33398
  const value = encodedAttrs.fontSize ?? node?.attributes?.["w:val"];
33399
33399
  return {
33400
33400
  type: "attr",
33401
- xmlName: XML_NODE_NAME$j,
33401
+ xmlName: XML_NODE_NAME$i,
33402
33402
  sdNodeOrKeyName: SD_ATTR_KEY$7,
33403
33403
  attributes: { "w:val": value ?? null }
33404
33404
  };
33405
33405
  };
33406
- const config$h = {
33407
- xmlName: XML_NODE_NAME$j,
33406
+ const config$g = {
33407
+ xmlName: XML_NODE_NAME$i,
33408
33408
  sdNodeOrKeyName: SD_ATTR_KEY$7,
33409
33409
  type: NodeTranslator.translatorTypes.ATTRIBUTE,
33410
- encode: encode$u,
33411
- attributes: validXmlAttributes$c
33410
+ encode: encode$t,
33411
+ attributes: validXmlAttributes$b
33412
33412
  };
33413
- const translator$X = NodeTranslator.from(config$h);
33414
- const encode$t = (attributes) => attributes?.["w:val"];
33415
- const decode$r = (attrs) => attrs?.fontSizeCs;
33413
+ const translator$W = NodeTranslator.from(config$g);
33414
+ const encode$s = (attributes) => attributes?.["w:val"];
33415
+ const decode$q = (attrs) => attrs?.fontSizeCs;
33416
33416
  const attrConfig$a = Object.freeze({
33417
33417
  xmlName: "w:val",
33418
33418
  sdName: "fontSizeCs",
33419
- encode: encode$t,
33420
- decode: decode$r
33419
+ encode: encode$s,
33420
+ decode: decode$q
33421
33421
  });
33422
- const validXmlAttributes$b = [attrConfig$a];
33423
- const XML_NODE_NAME$i = "w:szCs";
33422
+ const validXmlAttributes$a = [attrConfig$a];
33423
+ const XML_NODE_NAME$h = "w:szCs";
33424
33424
  const SD_ATTR_KEY$6 = "fontSizeCs";
33425
- const encode$s = (params2, encodedAttrs = {}) => {
33425
+ const encode$r = (params2, encodedAttrs = {}) => {
33426
33426
  const { nodes } = params2;
33427
33427
  const node = nodes?.[0];
33428
33428
  const value = encodedAttrs.fontSizeCs ?? node?.attributes?.["w:val"];
33429
33429
  return {
33430
33430
  type: "attr",
33431
- xmlName: XML_NODE_NAME$i,
33431
+ xmlName: XML_NODE_NAME$h,
33432
33432
  sdNodeOrKeyName: SD_ATTR_KEY$6,
33433
33433
  attributes: { "w:val": value ?? null }
33434
33434
  };
33435
33435
  };
33436
- const config$g = {
33437
- xmlName: XML_NODE_NAME$i,
33436
+ const config$f = {
33437
+ xmlName: XML_NODE_NAME$h,
33438
33438
  sdNodeOrKeyName: SD_ATTR_KEY$6,
33439
33439
  type: NodeTranslator.translatorTypes.ATTRIBUTE,
33440
- encode: encode$s,
33441
- attributes: validXmlAttributes$b
33440
+ encode: encode$r,
33441
+ attributes: validXmlAttributes$a
33442
33442
  };
33443
- const translator$W = NodeTranslator.from(config$g);
33443
+ const translator$V = NodeTranslator.from(config$f);
33444
33444
  const runPropertyTranslators = Object.freeze({
33445
- "w:b": translator$12,
33446
- "w:i": translator$11,
33447
- "w:u": translator$10,
33448
- "w:strike": translator$$,
33449
- "w:color": translator$_,
33450
- "w:highlight": translator$15,
33451
- "w:rFonts": translator$Z,
33452
- "w:rStyle": translator$Y,
33453
- "w:sz": translator$X,
33454
- "w:szCs": translator$W
33445
+ "w:b": translator$11,
33446
+ "w:i": translator$10,
33447
+ "w:u": translator$$,
33448
+ "w:strike": translator$_,
33449
+ "w:color": translator$Z,
33450
+ "w:highlight": translator$14,
33451
+ "w:rFonts": translator$Y,
33452
+ "w:rStyle": translator$X,
33453
+ "w:sz": translator$W,
33454
+ "w:szCs": translator$V
33455
33455
  });
33456
33456
  const rawRunPropertyXmlNames = Object.freeze(["w:lang", "w:shd"]);
33457
33457
  const RAW_CHILD_NAME_SET = new Set(rawRunPropertyXmlNames);
@@ -33465,9 +33465,9 @@ Please report this to https://github.com/markedjs/marked.`, e) {
33465
33465
  attributes: { ...candidate.attributes || {} }
33466
33466
  };
33467
33467
  };
33468
- const XML_NODE_NAME$h = "w:rPr";
33468
+ const XML_NODE_NAME$g = "w:rPr";
33469
33469
  const SD_ATTR_KEY$5 = "runProperties";
33470
- const encode$r = (params2) => {
33470
+ const encode$q = (params2) => {
33471
33471
  const { nodes } = params2;
33472
33472
  const node = nodes?.[0] || {};
33473
33473
  const contents = Array.isArray(node.elements) ? node.elements : [];
@@ -33501,16 +33501,16 @@ Please report this to https://github.com/markedjs/marked.`, e) {
33501
33501
  attributes: runPropsArray
33502
33502
  };
33503
33503
  };
33504
- const config$f = {
33505
- xmlName: XML_NODE_NAME$h,
33504
+ const config$e = {
33505
+ xmlName: XML_NODE_NAME$g,
33506
33506
  sdNodeOrKeyName: SD_ATTR_KEY$5,
33507
33507
  type: NodeTranslator.translatorTypes.ATTRIBUTE,
33508
- encode: encode$r
33508
+ encode: encode$q
33509
33509
  };
33510
- const translator$V = NodeTranslator.from(config$f);
33510
+ const translator$U = NodeTranslator.from(config$e);
33511
33511
  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;
33512
33512
  const containsEastAsianCharacters = (text) => EAST_ASIAN_CHARACTER_REGEX.test(text);
33513
- const collectRunProperties = (params2, rPrNode, translator2 = translator$V) => {
33513
+ const collectRunProperties = (params2, rPrNode, translator2 = translator$U) => {
33514
33514
  if (!rPrNode) return { entries: [], hadRPr: false, styleChangeMarks: [] };
33515
33515
  const result = translator2.encode({ ...params2, nodes: [rPrNode] }) || {};
33516
33516
  let entries = [];
@@ -33972,46 +33972,46 @@ Please report this to https://github.com/markedjs/marked.`, e) {
33972
33972
  }
33973
33973
  return runs;
33974
33974
  };
33975
- const encode$q = (attributes) => {
33975
+ const encode$p = (attributes) => {
33976
33976
  return attributes["w:rsidR"];
33977
33977
  };
33978
- const decode$q = (attrs) => {
33978
+ const decode$p = (attrs) => {
33979
33979
  return attrs.rsidR;
33980
33980
  };
33981
33981
  const attrConfig$9 = Object.freeze({
33982
33982
  xmlName: "w:rsidR",
33983
33983
  sdName: "rsidR",
33984
- encode: encode$q,
33985
- decode: decode$q
33984
+ encode: encode$p,
33985
+ decode: decode$p
33986
33986
  });
33987
- const encode$p = (attributes) => {
33987
+ const encode$o = (attributes) => {
33988
33988
  return attributes["w:rsidRPr"];
33989
33989
  };
33990
- const decode$p = (attrs) => {
33990
+ const decode$o = (attrs) => {
33991
33991
  return attrs.rsidRPr;
33992
33992
  };
33993
33993
  const attrConfig$8 = Object.freeze({
33994
33994
  xmlName: "w:rsidRPr",
33995
33995
  sdName: "rsidRPr",
33996
- encode: encode$p,
33997
- decode: decode$p
33996
+ encode: encode$o,
33997
+ decode: decode$o
33998
33998
  });
33999
- const encode$o = (attributes) => {
33999
+ const encode$n = (attributes) => {
34000
34000
  return attributes["w:rsidDel"];
34001
34001
  };
34002
- const decode$o = (attrs) => {
34002
+ const decode$n = (attrs) => {
34003
34003
  return attrs.rsidDel;
34004
34004
  };
34005
34005
  const attrConfig$7 = Object.freeze({
34006
34006
  xmlName: "w:rsidDel",
34007
34007
  sdName: "rsidDel",
34008
- encode: encode$o,
34009
- decode: decode$o
34008
+ encode: encode$n,
34009
+ decode: decode$n
34010
34010
  });
34011
- const validXmlAttributes$a = [attrConfig$9, attrConfig$8, attrConfig$7];
34012
- const XML_NODE_NAME$g = "w:r";
34011
+ const validXmlAttributes$9 = [attrConfig$9, attrConfig$8, attrConfig$7];
34012
+ const XML_NODE_NAME$f = "w:r";
34013
34013
  const SD_KEY_NAME = "run";
34014
- const encode$n = (params2, encodedAttrs = {}) => {
34014
+ const encode$m = (params2, encodedAttrs = {}) => {
34015
34015
  const { nodes = [], nodeListHandler } = params2 || {};
34016
34016
  const runNode = nodes[0];
34017
34017
  if (!runNode) return void 0;
@@ -34059,7 +34059,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
34059
34059
  }
34060
34060
  return runNodeResult;
34061
34061
  };
34062
- const decode$n = (params2, decodedAttrs = {}) => {
34062
+ const decode$m = (params2, decodedAttrs = {}) => {
34063
34063
  const { node } = params2 || {};
34064
34064
  if (!node) return void 0;
34065
34065
  const { runNode: runNodeForExport, trackingMarksByType } = prepareRunTrackingContext(node);
@@ -34116,7 +34116,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
34116
34116
  runs.push(trackedClone);
34117
34117
  return;
34118
34118
  }
34119
- const runWrapper = { name: XML_NODE_NAME$g, elements: [] };
34119
+ const runWrapper = { name: XML_NODE_NAME$f, elements: [] };
34120
34120
  applyBaseRunProps(runWrapper);
34121
34121
  if (!Array.isArray(runWrapper.elements)) runWrapper.elements = [];
34122
34122
  runWrapper.elements.push(cloneXmlNode(child));
@@ -34124,7 +34124,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
34124
34124
  });
34125
34125
  const trackedRuns = ensureTrackedWrapper(runs, trackingMarksByType);
34126
34126
  if (!trackedRuns.length) {
34127
- const emptyRun = { name: XML_NODE_NAME$g, elements: [] };
34127
+ const emptyRun = { name: XML_NODE_NAME$f, elements: [] };
34128
34128
  applyBaseRunProps(emptyRun);
34129
34129
  trackedRuns.push(emptyRun);
34130
34130
  }
@@ -34138,15 +34138,15 @@ Please report this to https://github.com/markedjs/marked.`, e) {
34138
34138
  }
34139
34139
  return trackedRuns;
34140
34140
  };
34141
- const config$e = {
34142
- xmlName: XML_NODE_NAME$g,
34141
+ const config$d = {
34142
+ xmlName: XML_NODE_NAME$f,
34143
34143
  sdNodeOrKeyName: SD_KEY_NAME,
34144
34144
  type: NodeTranslator.translatorTypes.NODE,
34145
- encode: encode$n,
34146
- decode: decode$n,
34147
- attributes: validXmlAttributes$a
34145
+ encode: encode$m,
34146
+ decode: decode$m,
34147
+ attributes: validXmlAttributes$9
34148
34148
  };
34149
- const translator$U = NodeTranslator.from(config$e);
34149
+ const translator$T = NodeTranslator.from(config$d);
34150
34150
  const generateV2HandlerEntity = (handlerName, translator2) => ({
34151
34151
  handlerName,
34152
34152
  handler: (params2) => {
@@ -34320,13 +34320,13 @@ Please report this to https://github.com/markedjs/marked.`, e) {
34320
34320
  }
34321
34321
  return table;
34322
34322
  }
34323
- const translator$T = NodeTranslator.from({
34323
+ const translator$S = NodeTranslator.from({
34324
34324
  xmlName: "w:cantSplit",
34325
34325
  sdNodeOrKeyName: "cantSplit",
34326
34326
  encode: ({ nodes }) => ["1", "true"].includes(nodes[0].attributes?.["w:val"] ?? "1"),
34327
34327
  decode: ({ node }) => node.attrs?.cantSplit ? { attributes: {} } : void 0
34328
34328
  });
34329
- const translator$S = NodeTranslator.from({
34329
+ const translator$R = NodeTranslator.from({
34330
34330
  xmlName: "w:cnfStyle",
34331
34331
  sdNodeOrKeyName: "cnfStyle",
34332
34332
  attributes: [
@@ -34352,8 +34352,8 @@ Please report this to https://github.com/markedjs/marked.`, e) {
34352
34352
  return Object.keys(decodedAttrs).length > 0 ? { attributes: decodedAttrs } : void 0;
34353
34353
  }
34354
34354
  });
34355
- const translator$R = NodeTranslator.from(createSingleAttrPropertyHandler("w:divId"));
34356
- const translator$Q = NodeTranslator.from(
34355
+ const translator$Q = NodeTranslator.from(createSingleAttrPropertyHandler("w:divId"));
34356
+ const translator$P = NodeTranslator.from(
34357
34357
  createSingleAttrPropertyHandler(
34358
34358
  "w:gridAfter",
34359
34359
  null,
@@ -34362,7 +34362,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
34362
34362
  (v2) => integerToString(v2)
34363
34363
  )
34364
34364
  );
34365
- const translator$P = NodeTranslator.from(
34365
+ const translator$O = NodeTranslator.from(
34366
34366
  createSingleAttrPropertyHandler(
34367
34367
  "w:gridBefore",
34368
34368
  null,
@@ -34371,21 +34371,21 @@ Please report this to https://github.com/markedjs/marked.`, e) {
34371
34371
  (v2) => integerToString(v2)
34372
34372
  )
34373
34373
  );
34374
- const translator$O = NodeTranslator.from({
34374
+ const translator$N = NodeTranslator.from({
34375
34375
  xmlName: "w:hidden",
34376
34376
  sdNodeOrKeyName: "hidden",
34377
34377
  encode: ({ nodes }) => parseBoolean(nodes[0].attributes?.["w:val"] ?? "1"),
34378
34378
  decode: ({ node }) => node.attrs.hidden ? { attributes: {} } : void 0
34379
34379
  });
34380
- const translator$N = NodeTranslator.from(createSingleAttrPropertyHandler("w:jc", "justification"));
34381
- const translator$M = NodeTranslator.from(createMeasurementPropertyHandler("w:tblCellSpacing", "tableCellSpacing"));
34382
- const translator$L = NodeTranslator.from({
34380
+ const translator$M = NodeTranslator.from(createSingleAttrPropertyHandler("w:jc", "justification"));
34381
+ const translator$L = NodeTranslator.from(createMeasurementPropertyHandler("w:tblCellSpacing", "tableCellSpacing"));
34382
+ const translator$K = NodeTranslator.from({
34383
34383
  xmlName: "w:tblHeader",
34384
34384
  sdNodeOrKeyName: "repeatHeader",
34385
34385
  encode: ({ nodes }) => parseBoolean(nodes[0].attributes?.["w:val"] ?? "1"),
34386
34386
  decode: ({ node }) => node.attrs.repeatHeader ? { attributes: {} } : void 0
34387
34387
  });
34388
- const translator$K = NodeTranslator.from({
34388
+ const translator$J = NodeTranslator.from({
34389
34389
  xmlName: "w:trHeight",
34390
34390
  sdNodeOrKeyName: "rowHeight",
34391
34391
  encode: ({ nodes }) => {
@@ -34412,11 +34412,11 @@ Please report this to https://github.com/markedjs/marked.`, e) {
34412
34412
  return Object.keys(heightAttrs).length > 0 ? { attributes: heightAttrs } : void 0;
34413
34413
  }
34414
34414
  });
34415
- const translator$J = NodeTranslator.from(createMeasurementPropertyHandler("w:wAfter"));
34416
- const translator$I = NodeTranslator.from(createMeasurementPropertyHandler("w:wBefore"));
34417
- const XML_NODE_NAME$f = "w:trPr";
34415
+ const translator$I = NodeTranslator.from(createMeasurementPropertyHandler("w:wAfter"));
34416
+ const translator$H = NodeTranslator.from(createMeasurementPropertyHandler("w:wBefore"));
34417
+ const XML_NODE_NAME$e = "w:trPr";
34418
34418
  const SD_ATTR_KEY$4 = "tableRowProperties";
34419
- const encode$m = (params2) => {
34419
+ const encode$l = (params2) => {
34420
34420
  const { nodes } = params2;
34421
34421
  const node = nodes[0];
34422
34422
  let attributes = {
@@ -34430,12 +34430,12 @@ Please report this to https://github.com/markedjs/marked.`, e) {
34430
34430
  };
34431
34431
  return {
34432
34432
  type: NodeTranslator.translatorTypes.ATTRIBUTE,
34433
- xmlName: XML_NODE_NAME$f,
34433
+ xmlName: XML_NODE_NAME$e,
34434
34434
  sdNodeOrKeyName: SD_ATTR_KEY$4,
34435
34435
  attributes
34436
34436
  };
34437
34437
  };
34438
- const decode$m = (params2) => {
34438
+ const decode$l = (params2) => {
34439
34439
  const { tableRowProperties = {} } = params2.node.attrs || {};
34440
34440
  const elements = decodeProperties(propertyTranslatorsBySdName$2, tableRowProperties);
34441
34441
  const newNode = {
@@ -34447,7 +34447,6 @@ Please report this to https://github.com/markedjs/marked.`, e) {
34447
34447
  return newNode;
34448
34448
  };
34449
34449
  const propertyTranslators$3 = [
34450
- translator$T,
34451
34450
  translator$S,
34452
34451
  translator$R,
34453
34452
  translator$Q,
@@ -34458,7 +34457,8 @@ Please report this to https://github.com/markedjs/marked.`, e) {
34458
34457
  translator$L,
34459
34458
  translator$K,
34460
34459
  translator$J,
34461
- translator$I
34460
+ translator$I,
34461
+ translator$H
34462
34462
  ];
34463
34463
  const propertyTranslatorsByXmlName$2 = {};
34464
34464
  propertyTranslators$3.forEach((translator2) => {
@@ -34468,25 +34468,25 @@ Please report this to https://github.com/markedjs/marked.`, e) {
34468
34468
  propertyTranslators$3.forEach((translator2) => {
34469
34469
  propertyTranslatorsBySdName$2[translator2.sdNodeOrKeyName] = translator2;
34470
34470
  });
34471
- const config$d = {
34472
- xmlName: XML_NODE_NAME$f,
34471
+ const config$c = {
34472
+ xmlName: XML_NODE_NAME$e,
34473
34473
  sdNodeOrKeyName: SD_ATTR_KEY$4,
34474
34474
  type: NodeTranslator.translatorTypes.ATTRIBUTE,
34475
- encode: encode$m,
34476
- decode: decode$m
34475
+ encode: encode$l,
34476
+ decode: decode$l
34477
34477
  };
34478
- const translator$H = NodeTranslator.from(config$d);
34479
- const XML_NODE_NAME$e = "w:tr";
34480
- const SD_NODE_NAME$a = "tableRow";
34481
- const validXmlAttributes$9 = ["w:rsidDel", "w:rsidR", "w:rsidRPr", "w:rsidTr", "w14:paraId", "w14:textId"].map(
34478
+ const translator$G = NodeTranslator.from(config$c);
34479
+ const XML_NODE_NAME$d = "w:tr";
34480
+ const SD_NODE_NAME$9 = "tableRow";
34481
+ const validXmlAttributes$8 = ["w:rsidDel", "w:rsidR", "w:rsidRPr", "w:rsidTr", "w14:paraId", "w14:textId"].map(
34482
34482
  (xmlName) => createAttributeHandler(xmlName)
34483
34483
  );
34484
- const encode$l = (params2, encodedAttrs) => {
34484
+ const encode$k = (params2, encodedAttrs) => {
34485
34485
  const { row } = params2.extraParams;
34486
34486
  let tableRowProperties = {};
34487
34487
  const tPr = row.elements.find((el) => el.name === "w:trPr");
34488
34488
  if (tPr) {
34489
- ({ attributes: tableRowProperties } = translator$H.encode({
34489
+ ({ attributes: tableRowProperties } = translator$G.encode({
34490
34490
  ...params2,
34491
34491
  nodes: [tPr]
34492
34492
  }));
@@ -34499,7 +34499,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
34499
34499
  let currentColumnIndex = 0;
34500
34500
  const content = cellNodes?.map((n) => {
34501
34501
  let columnWidth = gridColumnWidths?.[currentColumnIndex] || null;
34502
- const result = translator$8.encode({
34502
+ const result = translator$7.encode({
34503
34503
  ...params2,
34504
34504
  extraParams: {
34505
34505
  ...params2.extraParams,
@@ -34521,7 +34521,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
34521
34521
  };
34522
34522
  return newNode;
34523
34523
  };
34524
- const decode$l = (params2, decodedAttrs) => {
34524
+ const decode$k = (params2, decodedAttrs) => {
34525
34525
  const { node } = params2;
34526
34526
  const elements = translateChildNodes(params2);
34527
34527
  if (node.attrs?.tableRowProperties) {
@@ -34533,7 +34533,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
34533
34533
  }
34534
34534
  }
34535
34535
  tableRowProperties["cantSplit"] = node.attrs["cantSplit"];
34536
- const trPr = translator$H.decode({
34536
+ const trPr = translator$G.decode({
34537
34537
  ...params2,
34538
34538
  node: { ...node, attrs: { ...node.attrs, tableRowProperties } }
34539
34539
  });
@@ -34545,22 +34545,22 @@ Please report this to https://github.com/markedjs/marked.`, e) {
34545
34545
  elements
34546
34546
  };
34547
34547
  };
34548
- const config$c = {
34549
- xmlName: XML_NODE_NAME$e,
34550
- sdNodeOrKeyName: SD_NODE_NAME$a,
34548
+ const config$b = {
34549
+ xmlName: XML_NODE_NAME$d,
34550
+ sdNodeOrKeyName: SD_NODE_NAME$9,
34551
34551
  type: NodeTranslator.translatorTypes.NODE,
34552
- encode: encode$l,
34553
- decode: decode$l,
34554
- attributes: validXmlAttributes$9
34552
+ encode: encode$k,
34553
+ decode: decode$k,
34554
+ attributes: validXmlAttributes$8
34555
34555
  };
34556
- const translator$G = NodeTranslator.from(config$c);
34557
- const translator$F = NodeTranslator.from({
34556
+ const translator$F = NodeTranslator.from(config$b);
34557
+ const translator$E = NodeTranslator.from({
34558
34558
  xmlName: "w:bidiVisual",
34559
34559
  sdNodeOrKeyName: "rightToLeft",
34560
34560
  encode: ({ nodes }) => parseBoolean(nodes[0].attributes?.["w:val"] ?? "1"),
34561
34561
  decode: ({ node }) => node.attrs.rightToLeft ? { attributes: {} } : void 0
34562
34562
  });
34563
- const translator$E = NodeTranslator.from({
34563
+ const translator$D = NodeTranslator.from({
34564
34564
  xmlName: "w:shd",
34565
34565
  sdNodeOrKeyName: "shading",
34566
34566
  attributes: [
@@ -34582,11 +34582,11 @@ Please report this to https://github.com/markedjs/marked.`, e) {
34582
34582
  return Object.keys(decodedAttrs).length > 0 ? { attributes: decodedAttrs } : void 0;
34583
34583
  }
34584
34584
  });
34585
- const translator$D = NodeTranslator.from(createSingleAttrPropertyHandler("w:tblCaption", "caption"));
34586
- const translator$C = NodeTranslator.from(createSingleAttrPropertyHandler("w:tblDescription", "description"));
34587
- const translator$B = NodeTranslator.from(createMeasurementPropertyHandler("w:tblInd", "tableIndent"));
34588
- const translator$A = NodeTranslator.from(createSingleAttrPropertyHandler("w:tblLayout", "tableLayout", "w:type"));
34589
- const translator$z = NodeTranslator.from({
34585
+ const translator$C = NodeTranslator.from(createSingleAttrPropertyHandler("w:tblCaption", "caption"));
34586
+ const translator$B = NodeTranslator.from(createSingleAttrPropertyHandler("w:tblDescription", "description"));
34587
+ const translator$A = NodeTranslator.from(createMeasurementPropertyHandler("w:tblInd", "tableIndent"));
34588
+ const translator$z = NodeTranslator.from(createSingleAttrPropertyHandler("w:tblLayout", "tableLayout", "w:type"));
34589
+ const translator$y = NodeTranslator.from({
34590
34590
  xmlName: "w:tblLook",
34591
34591
  sdNodeOrKeyName: "tblLook",
34592
34592
  attributes: ["w:firstColumn", "w:firstRow", "w:lastColumn", "w:lastRow", "w:noHBand", "w:noVBand"].map((attr) => createAttributeHandler(attr, null, parseBoolean, booleanToString)).concat([createAttributeHandler("w:val")]),
@@ -34598,16 +34598,16 @@ Please report this to https://github.com/markedjs/marked.`, e) {
34598
34598
  return Object.keys(decodedAttrs).length > 0 ? { attributes: decodedAttrs } : void 0;
34599
34599
  }
34600
34600
  });
34601
- const translator$y = NodeTranslator.from(createSingleAttrPropertyHandler("w:tblOverlap", "overlap"));
34602
- const translator$x = NodeTranslator.from(createSingleAttrPropertyHandler("w:tblStyle", "tableStyleId"));
34603
- const translator$w = NodeTranslator.from(
34601
+ const translator$x = NodeTranslator.from(createSingleAttrPropertyHandler("w:tblOverlap", "overlap"));
34602
+ const translator$w = NodeTranslator.from(createSingleAttrPropertyHandler("w:tblStyle", "tableStyleId"));
34603
+ const translator$v = NodeTranslator.from(
34604
34604
  createSingleAttrPropertyHandler("w:tblStyleColBandSize", "tableStyleColBandSize")
34605
34605
  );
34606
- const translator$v = NodeTranslator.from(
34606
+ const translator$u = NodeTranslator.from(
34607
34607
  createSingleAttrPropertyHandler("w:tblStyleRowBandSize", "tableStyleRowBandSize")
34608
34608
  );
34609
- const translator$u = NodeTranslator.from(createMeasurementPropertyHandler("w:tblW", "tableWidth"));
34610
- const translator$t = NodeTranslator.from({
34609
+ const translator$t = NodeTranslator.from(createMeasurementPropertyHandler("w:tblW", "tableWidth"));
34610
+ const translator$s = NodeTranslator.from({
34611
34611
  xmlName: "w:tblpPr",
34612
34612
  sdNodeOrKeyName: "floatingTableProperties",
34613
34613
  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))),
@@ -34619,29 +34619,29 @@ Please report this to https://github.com/markedjs/marked.`, e) {
34619
34619
  return Object.keys(decodedAttrs).length > 0 ? { attributes: decodedAttrs } : void 0;
34620
34620
  }
34621
34621
  });
34622
- const translator$s = NodeTranslator.from(createBorderPropertyHandler("w:bottom"));
34623
- const translator$r = NodeTranslator.from(createMeasurementPropertyHandler("w:bottom", "marginBottom"));
34624
- const translator$q = NodeTranslator.from(createBorderPropertyHandler("w:end"));
34625
- const translator$p = NodeTranslator.from(createMeasurementPropertyHandler("w:end", "marginEnd"));
34626
- const translator$o = NodeTranslator.from(createBorderPropertyHandler("w:insideH"));
34627
- const translator$n = NodeTranslator.from(createBorderPropertyHandler("w:insideV"));
34628
- const translator$m = NodeTranslator.from(createBorderPropertyHandler("w:left"));
34629
- const translator$l = NodeTranslator.from(createMeasurementPropertyHandler("w:left", "marginLeft"));
34630
- const translator$k = NodeTranslator.from(createBorderPropertyHandler("w:right"));
34631
- const translator$j = NodeTranslator.from(createMeasurementPropertyHandler("w:right", "marginRight"));
34632
- const translator$i = NodeTranslator.from(createBorderPropertyHandler("w:start"));
34633
- const translator$h = NodeTranslator.from(createMeasurementPropertyHandler("w:start", "marginStart"));
34634
- const translator$g = NodeTranslator.from(createBorderPropertyHandler("w:top"));
34635
- const translator$f = NodeTranslator.from(createMeasurementPropertyHandler("w:top", "marginTop"));
34636
- const XML_NODE_NAME$d = "w:tblBorders";
34622
+ const translator$r = NodeTranslator.from(createBorderPropertyHandler("w:bottom"));
34623
+ const translator$q = NodeTranslator.from(createMeasurementPropertyHandler("w:bottom", "marginBottom"));
34624
+ const translator$p = NodeTranslator.from(createBorderPropertyHandler("w:end"));
34625
+ const translator$o = NodeTranslator.from(createMeasurementPropertyHandler("w:end", "marginEnd"));
34626
+ const translator$n = NodeTranslator.from(createBorderPropertyHandler("w:insideH"));
34627
+ const translator$m = NodeTranslator.from(createBorderPropertyHandler("w:insideV"));
34628
+ const translator$l = NodeTranslator.from(createBorderPropertyHandler("w:left"));
34629
+ const translator$k = NodeTranslator.from(createMeasurementPropertyHandler("w:left", "marginLeft"));
34630
+ const translator$j = NodeTranslator.from(createBorderPropertyHandler("w:right"));
34631
+ const translator$i = NodeTranslator.from(createMeasurementPropertyHandler("w:right", "marginRight"));
34632
+ const translator$h = NodeTranslator.from(createBorderPropertyHandler("w:start"));
34633
+ const translator$g = NodeTranslator.from(createMeasurementPropertyHandler("w:start", "marginStart"));
34634
+ const translator$f = NodeTranslator.from(createBorderPropertyHandler("w:top"));
34635
+ const translator$e = NodeTranslator.from(createMeasurementPropertyHandler("w:top", "marginTop"));
34636
+ const XML_NODE_NAME$c = "w:tblBorders";
34637
34637
  const SD_ATTR_KEY$3 = "borders";
34638
- const encode$k = (params2) => {
34638
+ const encode$j = (params2) => {
34639
34639
  const { nodes } = params2;
34640
34640
  const node = nodes[0];
34641
34641
  const attributes = encodeProperties(node, tblBordersTranslatorsByXmlName);
34642
34642
  return Object.keys(attributes).length > 0 ? attributes : void 0;
34643
34643
  };
34644
- const decode$k = (params2) => {
34644
+ const decode$j = (params2) => {
34645
34645
  const { borders = {} } = params2.node.attrs || {};
34646
34646
  const elements = decodeProperties(tblBordersTranslatorsBySdName, borders);
34647
34647
  const newNode = {
@@ -34653,14 +34653,14 @@ Please report this to https://github.com/markedjs/marked.`, e) {
34653
34653
  return newNode;
34654
34654
  };
34655
34655
  const propertyTranslators$2 = [
34656
- translator$s,
34657
- translator$q,
34658
- translator$o,
34656
+ translator$r,
34657
+ translator$p,
34659
34658
  translator$n,
34660
34659
  translator$m,
34661
- translator$k,
34662
- translator$i,
34663
- translator$g
34660
+ translator$l,
34661
+ translator$j,
34662
+ translator$h,
34663
+ translator$f
34664
34664
  ];
34665
34665
  const tblBordersTranslatorsByXmlName = {};
34666
34666
  const tblBordersTranslatorsBySdName = {};
@@ -34668,27 +34668,27 @@ Please report this to https://github.com/markedjs/marked.`, e) {
34668
34668
  tblBordersTranslatorsByXmlName[translator2.xmlName] = translator2;
34669
34669
  tblBordersTranslatorsBySdName[translator2.sdNodeOrKeyName] = translator2;
34670
34670
  });
34671
- const translator$e = NodeTranslator.from({
34672
- xmlName: XML_NODE_NAME$d,
34671
+ const translator$d = NodeTranslator.from({
34672
+ xmlName: XML_NODE_NAME$c,
34673
34673
  sdNodeOrKeyName: SD_ATTR_KEY$3,
34674
34674
  type: NodeTranslator.translatorTypes.NODE,
34675
34675
  attributes: [],
34676
- encode: encode$k,
34677
- decode: decode$k
34676
+ encode: encode$j,
34677
+ decode: decode$j
34678
34678
  });
34679
- const XML_NODE_NAME$c = "w:tblCellMar";
34679
+ const XML_NODE_NAME$b = "w:tblCellMar";
34680
34680
  const SD_ATTR_KEY$2 = "cellMargins";
34681
- const encode$j = (params2) => {
34681
+ const encode$i = (params2) => {
34682
34682
  const { nodes } = params2;
34683
34683
  const node = nodes[0];
34684
34684
  const attributes = encodeProperties(node, propertyTranslatorsByXmlName$1);
34685
34685
  return Object.keys(attributes).length > 0 ? attributes : void 0;
34686
34686
  };
34687
- const decode$j = (params2) => {
34687
+ const decode$i = (params2) => {
34688
34688
  const { cellMargins = {} } = params2.node.attrs || {};
34689
34689
  const elements = decodeProperties(propertyTranslatorsBySdName$1, cellMargins);
34690
34690
  const newNode = {
34691
- name: XML_NODE_NAME$c,
34691
+ name: XML_NODE_NAME$b,
34692
34692
  type: "element",
34693
34693
  attributes: {},
34694
34694
  elements
@@ -34696,12 +34696,12 @@ Please report this to https://github.com/markedjs/marked.`, e) {
34696
34696
  return newNode;
34697
34697
  };
34698
34698
  const propertyTranslators$1 = [
34699
- translator$r,
34700
- translator$p,
34701
- translator$l,
34702
- translator$j,
34703
- translator$h,
34704
- translator$f
34699
+ translator$q,
34700
+ translator$o,
34701
+ translator$k,
34702
+ translator$i,
34703
+ translator$g,
34704
+ translator$e
34705
34705
  ];
34706
34706
  const propertyTranslatorsByXmlName$1 = {};
34707
34707
  const propertyTranslatorsBySdName$1 = {};
@@ -34709,27 +34709,27 @@ Please report this to https://github.com/markedjs/marked.`, e) {
34709
34709
  propertyTranslatorsByXmlName$1[translator2.xmlName] = translator2;
34710
34710
  propertyTranslatorsBySdName$1[translator2.sdNodeOrKeyName] = translator2;
34711
34711
  });
34712
- const translator$d = NodeTranslator.from({
34713
- xmlName: XML_NODE_NAME$c,
34712
+ const translator$c = NodeTranslator.from({
34713
+ xmlName: XML_NODE_NAME$b,
34714
34714
  sdNodeOrKeyName: SD_ATTR_KEY$2,
34715
34715
  type: NodeTranslator.translatorTypes.NODE,
34716
34716
  attributes: [],
34717
- encode: encode$j,
34718
- decode: decode$j
34717
+ encode: encode$i,
34718
+ decode: decode$i
34719
34719
  });
34720
- const XML_NODE_NAME$b = "w:tblPr";
34720
+ const XML_NODE_NAME$a = "w:tblPr";
34721
34721
  const SD_ATTR_KEY$1 = "tableProperties";
34722
- const encode$i = (params2) => {
34722
+ const encode$h = (params2) => {
34723
34723
  const { nodes } = params2;
34724
34724
  const node = nodes[0];
34725
34725
  const attributes = encodeProperties(node, propertyTranslatorsByXmlName);
34726
34726
  return {
34727
- xmlName: XML_NODE_NAME$b,
34727
+ xmlName: XML_NODE_NAME$a,
34728
34728
  sdNodeOrKeyName: SD_ATTR_KEY$1,
34729
34729
  attributes
34730
34730
  };
34731
34731
  };
34732
- const decode$i = (params2) => {
34732
+ const decode$h = (params2) => {
34733
34733
  const { tableProperties = {} } = params2.node.attrs || {};
34734
34734
  const elements = decodeProperties(propertyTranslatorsBySdName, tableProperties);
34735
34735
  const newNode = {
@@ -34741,12 +34741,11 @@ Please report this to https://github.com/markedjs/marked.`, e) {
34741
34741
  return newNode;
34742
34742
  };
34743
34743
  const propertyTranslators = [
34744
- translator$F,
34745
- translator$N,
34746
34744
  translator$E,
34747
- translator$D,
34748
34745
  translator$M,
34746
+ translator$D,
34749
34747
  translator$C,
34748
+ translator$L,
34750
34749
  translator$B,
34751
34750
  translator$A,
34752
34751
  translator$z,
@@ -34756,8 +34755,9 @@ Please report this to https://github.com/markedjs/marked.`, e) {
34756
34755
  translator$v,
34757
34756
  translator$u,
34758
34757
  translator$t,
34759
- translator$e,
34760
- translator$d
34758
+ translator$s,
34759
+ translator$d,
34760
+ translator$c
34761
34761
  ];
34762
34762
  const propertyTranslatorsByXmlName = {};
34763
34763
  const propertyTranslatorsBySdName = {};
@@ -34765,14 +34765,14 @@ Please report this to https://github.com/markedjs/marked.`, e) {
34765
34765
  propertyTranslatorsByXmlName[translator2.xmlName] = translator2;
34766
34766
  propertyTranslatorsBySdName[translator2.sdNodeOrKeyName] = translator2;
34767
34767
  });
34768
- const config$b = {
34769
- xmlName: XML_NODE_NAME$b,
34768
+ const config$a = {
34769
+ xmlName: XML_NODE_NAME$a,
34770
34770
  sdNodeOrKeyName: SD_ATTR_KEY$1,
34771
- encode: encode$i,
34772
- decode: decode$i
34771
+ encode: encode$h,
34772
+ decode: decode$h
34773
34773
  };
34774
- const translator$c = NodeTranslator.from(config$b);
34775
- const translator$b = NodeTranslator.from(
34774
+ const translator$b = NodeTranslator.from(config$a);
34775
+ const translator$a = NodeTranslator.from(
34776
34776
  createSingleAttrPropertyHandler("w:gridCol", "col", "w:w", parseInteger, integerToString)
34777
34777
  );
34778
34778
  const DEFAULT_COLUMN_WIDTH_PX = 100;
@@ -34822,20 +34822,20 @@ Please report this to https://github.com/markedjs/marked.`, e) {
34822
34822
  }
34823
34823
  return Math.max(fallbackWidthTwips, cellMinWidthTwips);
34824
34824
  };
34825
- const XML_NODE_NAME$a = "w:tblGrid";
34825
+ const XML_NODE_NAME$9 = "w:tblGrid";
34826
34826
  const SD_ATTR_KEY = "grid";
34827
34827
  const cellMinWidth = pixelsToTwips(10);
34828
- const encode$h = (params2) => {
34828
+ const encode$g = (params2) => {
34829
34829
  const { nodes } = params2;
34830
34830
  const node = nodes[0];
34831
- const attributes = encodeProperties(node, { [translator$b.xmlName]: translator$b }, true);
34831
+ const attributes = encodeProperties(node, { [translator$a.xmlName]: translator$a }, true);
34832
34832
  return {
34833
- xmlName: XML_NODE_NAME$a,
34833
+ xmlName: XML_NODE_NAME$9,
34834
34834
  sdNodeOrKeyName: SD_ATTR_KEY,
34835
34835
  attributes
34836
34836
  };
34837
34837
  };
34838
- const decode$h = (params2) => {
34838
+ const decode$g = (params2) => {
34839
34839
  const { grid: rawGrid } = params2.node.attrs || {};
34840
34840
  const grid = Array.isArray(rawGrid) ? rawGrid : [];
34841
34841
  const { firstRow = {} } = params2.extraParams || {};
@@ -34854,10 +34854,10 @@ Please report this to https://github.com/markedjs/marked.`, e) {
34854
34854
  numericWidth = fallbackColumnWidthTwips;
34855
34855
  }
34856
34856
  numericWidth = Math.max(numericWidth, cellMinWidth);
34857
- const decoded = translator$b.decode({
34857
+ const decoded = translator$a.decode({
34858
34858
  node: { type: (
34859
34859
  /** @type {string} */
34860
- translator$b.sdNodeOrKeyName
34860
+ translator$a.sdNodeOrKeyName
34861
34861
  ), attrs: { col: numericWidth } }
34862
34862
  });
34863
34863
  if (decoded) elements.push(decoded);
@@ -34892,32 +34892,32 @@ Please report this to https://github.com/markedjs/marked.`, e) {
34892
34892
  columnIndex++;
34893
34893
  }
34894
34894
  const newNode = {
34895
- name: XML_NODE_NAME$a,
34895
+ name: XML_NODE_NAME$9,
34896
34896
  attributes: {},
34897
34897
  elements
34898
34898
  };
34899
34899
  return newNode;
34900
34900
  };
34901
- const config$a = {
34902
- xmlName: XML_NODE_NAME$a,
34901
+ const config$9 = {
34902
+ xmlName: XML_NODE_NAME$9,
34903
34903
  sdNodeOrKeyName: SD_ATTR_KEY,
34904
- encode: encode$h,
34905
- decode: decode$h
34904
+ encode: encode$g,
34905
+ decode: decode$g
34906
34906
  };
34907
- const translator$a = NodeTranslator.from(config$a);
34908
- const XML_NODE_NAME$9 = "w:tbl";
34909
- const SD_NODE_NAME$9 = "table";
34910
- const encode$g = (params2, encodedAttrs) => {
34907
+ const translator$9 = NodeTranslator.from(config$9);
34908
+ const XML_NODE_NAME$8 = "w:tbl";
34909
+ const SD_NODE_NAME$8 = "table";
34910
+ const encode$f = (params2, encodedAttrs) => {
34911
34911
  const { nodes } = params2;
34912
34912
  const node = nodes[0];
34913
34913
  const tblPr = node.elements.find((el) => el.name === "w:tblPr");
34914
34914
  if (tblPr) {
34915
- const encodedProperties = translator$c.encode({ ...params2, nodes: [tblPr] });
34915
+ const encodedProperties = translator$b.encode({ ...params2, nodes: [tblPr] });
34916
34916
  encodedAttrs["tableProperties"] = encodedProperties?.attributes || {};
34917
34917
  }
34918
34918
  const tblGrid = node.elements.find((el) => el.name === "w:tblGrid");
34919
34919
  if (tblGrid) {
34920
- encodedAttrs["grid"] = translator$a.encode({ ...params2, nodes: [tblGrid] }).attributes;
34920
+ encodedAttrs["grid"] = translator$9.encode({ ...params2, nodes: [tblGrid] }).attributes;
34921
34921
  }
34922
34922
  [
34923
34923
  "tableStyleId",
@@ -34958,7 +34958,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
34958
34958
  const columnWidths = (encodedAttrs["grid"] ?? []).map((item) => twipsToPixels(item.col));
34959
34959
  const content = [];
34960
34960
  rows.forEach((row) => {
34961
- const result = translator$G.encode({
34961
+ const result = translator$F.encode({
34962
34962
  ...params2,
34963
34963
  nodes: [row],
34964
34964
  extraParams: {
@@ -34977,13 +34977,13 @@ Please report this to https://github.com/markedjs/marked.`, e) {
34977
34977
  attrs: encodedAttrs
34978
34978
  };
34979
34979
  };
34980
- const decode$g = (params2, decodedAttrs) => {
34980
+ const decode$f = (params2, decodedAttrs) => {
34981
34981
  params2.node = preProcessVerticalMergeCells(params2.node, params2);
34982
34982
  const { node } = params2;
34983
34983
  const elements = translateChildNodes(params2);
34984
34984
  const firstRow = node.content?.find((n) => n.type === "tableRow");
34985
34985
  const properties = node.attrs.grid;
34986
- const element = translator$a.decode({
34986
+ const element = translator$9.decode({
34987
34987
  ...params2,
34988
34988
  node: { ...node, attrs: { ...node.attrs, grid: properties } },
34989
34989
  extraParams: {
@@ -34993,7 +34993,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
34993
34993
  if (element) elements.unshift(element);
34994
34994
  if (node.attrs?.tableProperties) {
34995
34995
  const properties2 = { ...node.attrs.tableProperties };
34996
- const element2 = translator$c.decode({
34996
+ const element2 = translator$b.decode({
34997
34997
  ...params2,
34998
34998
  node: { ...node, attrs: { ...node.attrs, tableProperties: properties2 } }
34999
34999
  });
@@ -35059,7 +35059,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
35059
35059
  if (baseTblPr && baseTblPr.elements) {
35060
35060
  tblPr.elements.push(...baseTblPr.elements);
35061
35061
  }
35062
- const tableProperties = translator$c.encode({ ...params2, nodes: [tblPr] }).attributes;
35062
+ const tableProperties = translator$b.encode({ ...params2, nodes: [tblPr] }).attributes;
35063
35063
  const { borders, rowBorders } = _processTableBorders(tableProperties.borders || {});
35064
35064
  if (borders) stylesToReturn.borders = borders;
35065
35065
  if (rowBorders) stylesToReturn.rowBorders = rowBorders;
@@ -35076,16 +35076,16 @@ Please report this to https://github.com/markedjs/marked.`, e) {
35076
35076
  }
35077
35077
  return stylesToReturn;
35078
35078
  }
35079
- const config$9 = {
35080
- xmlName: XML_NODE_NAME$9,
35081
- sdNodeOrKeyName: SD_NODE_NAME$9,
35079
+ const config$8 = {
35080
+ xmlName: XML_NODE_NAME$8,
35081
+ sdNodeOrKeyName: SD_NODE_NAME$8,
35082
35082
  type: NodeTranslator.translatorTypes.NODE,
35083
- encode: encode$g,
35084
- decode: decode$g,
35083
+ encode: encode$f,
35084
+ decode: decode$f,
35085
35085
  attributes: []
35086
35086
  };
35087
- const translator$9 = NodeTranslator.from(config$9);
35088
- const tableNodeHandlerEntity = generateV2HandlerEntity("tableNodeHandler", translator$9);
35087
+ const translator$8 = NodeTranslator.from(config$8);
35088
+ const tableNodeHandlerEntity = generateV2HandlerEntity("tableNodeHandler", translator$8);
35089
35089
  function getReferencedTableStyles(tblStyleTag, docx) {
35090
35090
  if (!tblStyleTag) return null;
35091
35091
  const stylesToReturn = {};
@@ -35447,10 +35447,10 @@ Please report this to https://github.com/markedjs/marked.`, e) {
35447
35447
  if (left2 != null) elements.push({ name: "w:left", attributes: { "w:w": pixelsToTwips(left2) } });
35448
35448
  return elements;
35449
35449
  }
35450
- const XML_NODE_NAME$8 = "w:tc";
35451
- const SD_NODE_NAME$8 = "tableCell";
35452
- const validXmlAttributes$8 = [];
35453
- function encode$f(params2, encodedAttrs) {
35450
+ const XML_NODE_NAME$7 = "w:tc";
35451
+ const SD_NODE_NAME$7 = "tableCell";
35452
+ const validXmlAttributes$7 = [];
35453
+ function encode$e(params2, encodedAttrs) {
35454
35454
  const {
35455
35455
  node,
35456
35456
  table,
@@ -35477,31 +35477,31 @@ Please report this to https://github.com/markedjs/marked.`, e) {
35477
35477
  }
35478
35478
  return schemaNode;
35479
35479
  }
35480
- function decode$f(params2, decodedAttrs) {
35480
+ function decode$e(params2, decodedAttrs) {
35481
35481
  const translated = translateTableCell(params2);
35482
35482
  if (decodedAttrs && Object.keys(decodedAttrs).length) {
35483
35483
  translated.attributes = { ...translated.attributes || {}, ...decodedAttrs };
35484
35484
  }
35485
35485
  return translated;
35486
35486
  }
35487
- const config$8 = {
35488
- xmlName: XML_NODE_NAME$8,
35489
- sdNodeOrKeyName: SD_NODE_NAME$8,
35487
+ const config$7 = {
35488
+ xmlName: XML_NODE_NAME$7,
35489
+ sdNodeOrKeyName: SD_NODE_NAME$7,
35490
35490
  type: NodeTranslator.translatorTypes.NODE,
35491
- encode: encode$f,
35492
- decode: decode$f,
35493
- attributes: validXmlAttributes$8
35491
+ encode: encode$e,
35492
+ decode: decode$e,
35493
+ attributes: validXmlAttributes$7
35494
35494
  };
35495
- const translator$8 = NodeTranslator.from(config$8);
35496
- const XML_NODE_NAME$7 = "w:hyperlink";
35497
- const SD_NODE_NAME$7 = "link";
35495
+ const translator$7 = NodeTranslator.from(config$7);
35496
+ const XML_NODE_NAME$6 = "w:hyperlink";
35497
+ const SD_NODE_NAME$6 = "link";
35498
35498
  const _createAttributeHandler = (xmlName, sdName) => ({
35499
35499
  xmlName,
35500
35500
  sdName,
35501
35501
  encode: (attributes) => attributes[xmlName],
35502
35502
  decode: (attributes) => attributes[sdName]
35503
35503
  });
35504
- const validXmlAttributes$7 = [
35504
+ const validXmlAttributes$6 = [
35505
35505
  _createAttributeHandler("w:anchor", "anchor"),
35506
35506
  _createAttributeHandler("w:docLocation", "docLocation"),
35507
35507
  {
@@ -35514,7 +35514,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
35514
35514
  _createAttributeHandler("r:id", "rId"),
35515
35515
  _createAttributeHandler("w:tgtFrame", "target")
35516
35516
  ];
35517
- const encode$e = (params2, encodedAttrs) => {
35517
+ const encode$d = (params2, encodedAttrs) => {
35518
35518
  const { nodes, docx, nodeListHandler } = params2;
35519
35519
  const node = nodes[0];
35520
35520
  let href = _resolveHref(docx, encodedAttrs);
@@ -35580,7 +35580,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
35580
35580
  }
35581
35581
  return href;
35582
35582
  };
35583
- function decode$e(params2) {
35583
+ function decode$d(params2) {
35584
35584
  const { node } = params2;
35585
35585
  const linkMark = node.marks.find((m2) => m2.type === "link");
35586
35586
  const linkAttrs = this.decodeAttributes({ ...params2, node: linkMark });
@@ -35624,15 +35624,15 @@ Please report this to https://github.com/markedjs/marked.`, e) {
35624
35624
  });
35625
35625
  return rId;
35626
35626
  }
35627
- const config$7 = {
35628
- xmlName: XML_NODE_NAME$7,
35629
- sdNodeOrKeyName: SD_NODE_NAME$7,
35627
+ const config$6 = {
35628
+ xmlName: XML_NODE_NAME$6,
35629
+ sdNodeOrKeyName: SD_NODE_NAME$6,
35630
35630
  type: NodeTranslator.translatorTypes.NODE,
35631
- encode: encode$e,
35632
- decode: decode$e,
35633
- attributes: validXmlAttributes$7
35631
+ encode: encode$d,
35632
+ decode: decode$d,
35633
+ attributes: validXmlAttributes$6
35634
35634
  };
35635
- const translator$7 = NodeTranslator.from(config$7);
35635
+ const translator$6 = NodeTranslator.from(config$6);
35636
35636
  function parseTagValueJSON(json) {
35637
35637
  if (typeof json !== "string") {
35638
35638
  return {};
@@ -36427,32 +36427,32 @@ Please report this to https://github.com/markedjs/marked.`, e) {
36427
36427
  elements: [...anchorElements, ...elementsWithWrap]
36428
36428
  };
36429
36429
  }
36430
- const XML_NODE_NAME$6 = "wp:anchor";
36431
- const SD_NODE_NAME$6 = ["image"];
36432
- const validXmlAttributes$6 = ["distT", "distB", "distL", "distR"].map((xmlName) => createAttributeHandler(xmlName));
36433
- function encode$d(params2) {
36430
+ const XML_NODE_NAME$5 = "wp:anchor";
36431
+ const SD_NODE_NAME$5 = ["image"];
36432
+ const validXmlAttributes$5 = ["distT", "distB", "distL", "distR"].map((xmlName) => createAttributeHandler(xmlName));
36433
+ function encode$c(params2) {
36434
36434
  const { node } = params2.extraParams;
36435
36435
  if (!node || !node.type) {
36436
36436
  return null;
36437
36437
  }
36438
36438
  return handleAnchorNode(params2);
36439
36439
  }
36440
- function decode$d(params2) {
36440
+ function decode$c(params2) {
36441
36441
  const { node } = params2;
36442
36442
  if (!node || !node.type) {
36443
36443
  return null;
36444
36444
  }
36445
36445
  return translateAnchorNode(params2);
36446
36446
  }
36447
- const config$6 = {
36448
- xmlName: XML_NODE_NAME$6,
36449
- sdNodeOrKeyName: SD_NODE_NAME$6,
36447
+ const config$5 = {
36448
+ xmlName: XML_NODE_NAME$5,
36449
+ sdNodeOrKeyName: SD_NODE_NAME$5,
36450
36450
  type: NodeTranslator.translatorTypes.NODE,
36451
- encode: encode$d,
36452
- decode: decode$d,
36453
- attributes: validXmlAttributes$6
36451
+ encode: encode$c,
36452
+ decode: decode$c,
36453
+ attributes: validXmlAttributes$5
36454
36454
  };
36455
- const translator$6 = NodeTranslator.from(config$6);
36455
+ const translator$5 = NodeTranslator.from(config$5);
36456
36456
  function handleInlineNode(params2) {
36457
36457
  const { node } = params2.extraParams;
36458
36458
  if (node.name !== "wp:inline") {
@@ -36468,41 +36468,41 @@ Please report this to https://github.com/markedjs/marked.`, e) {
36468
36468
  elements: nodeElements.elements
36469
36469
  };
36470
36470
  }
36471
- const XML_NODE_NAME$5 = "wp:inline";
36472
- const SD_NODE_NAME$5 = ["image"];
36473
- const validXmlAttributes$5 = ["distT", "distB", "distL", "distR"].map((xmlName) => createAttributeHandler(xmlName));
36474
- function encode$c(params2) {
36471
+ const XML_NODE_NAME$4 = "wp:inline";
36472
+ const SD_NODE_NAME$4 = ["image"];
36473
+ const validXmlAttributes$4 = ["distT", "distB", "distL", "distR"].map((xmlName) => createAttributeHandler(xmlName));
36474
+ function encode$b(params2) {
36475
36475
  const { node } = params2.extraParams;
36476
36476
  if (!node || !node.type) {
36477
36477
  return null;
36478
36478
  }
36479
36479
  return handleInlineNode(params2);
36480
36480
  }
36481
- function decode$c(params2) {
36481
+ function decode$b(params2) {
36482
36482
  const { node } = params2;
36483
36483
  if (!node || !node.type) {
36484
36484
  return null;
36485
36485
  }
36486
36486
  return translateInlineNode(params2);
36487
36487
  }
36488
- const config$5 = {
36489
- xmlName: XML_NODE_NAME$5,
36490
- sdNodeOrKeyName: SD_NODE_NAME$5,
36488
+ const config$4 = {
36489
+ xmlName: XML_NODE_NAME$4,
36490
+ sdNodeOrKeyName: SD_NODE_NAME$4,
36491
36491
  type: NodeTranslator.translatorTypes.NODE,
36492
- encode: encode$c,
36493
- decode: decode$c,
36494
- attributes: validXmlAttributes$5
36492
+ encode: encode$b,
36493
+ decode: decode$b,
36494
+ attributes: validXmlAttributes$4
36495
36495
  };
36496
- const translator$5 = NodeTranslator.from(config$5);
36497
- const XML_NODE_NAME$4 = "w:drawing";
36498
- const SD_NODE_NAME$4 = [];
36499
- const validXmlAttributes$4 = [];
36500
- function encode$b(params2) {
36496
+ const translator$4 = NodeTranslator.from(config$4);
36497
+ const XML_NODE_NAME$3 = "w:drawing";
36498
+ const SD_NODE_NAME$3 = [];
36499
+ const validXmlAttributes$3 = [];
36500
+ function encode$a(params2) {
36501
36501
  const nodes = params2.nodes;
36502
36502
  const node = nodes[0];
36503
36503
  const translatorByChildName = {
36504
- "wp:anchor": translator$6,
36505
- "wp:inline": translator$5
36504
+ "wp:anchor": translator$5,
36505
+ "wp:inline": translator$4
36506
36506
  };
36507
36507
  return node.elements.reduce((acc, child) => {
36508
36508
  if (acc) return acc;
@@ -36511,12 +36511,12 @@ Please report this to https://github.com/markedjs/marked.`, e) {
36511
36511
  return translator2.encode({ ...params2, extraParams: { node: child } }) || acc;
36512
36512
  }, null);
36513
36513
  }
36514
- function decode$b(params2) {
36514
+ function decode$a(params2) {
36515
36515
  const { node } = params2;
36516
36516
  if (!node || !node.type) {
36517
36517
  return null;
36518
36518
  }
36519
- const childTranslator = node.attrs.isAnchor ? translator$6 : translator$5;
36519
+ const childTranslator = node.attrs.isAnchor ? translator$5 : translator$4;
36520
36520
  const resultNode = childTranslator.decode(params2);
36521
36521
  return wrapTextInRun(
36522
36522
  {
@@ -36526,15 +36526,15 @@ Please report this to https://github.com/markedjs/marked.`, e) {
36526
36526
  []
36527
36527
  );
36528
36528
  }
36529
- const config$4 = {
36530
- xmlName: XML_NODE_NAME$4,
36531
- sdNodeOrKeyName: SD_NODE_NAME$4,
36529
+ const config$3 = {
36530
+ xmlName: XML_NODE_NAME$3,
36531
+ sdNodeOrKeyName: SD_NODE_NAME$3,
36532
36532
  type: NodeTranslator.translatorTypes.NODE,
36533
- encode: encode$b,
36534
- decode: decode$b,
36535
- attributes: validXmlAttributes$4
36533
+ encode: encode$a,
36534
+ decode: decode$a,
36535
+ attributes: validXmlAttributes$3
36536
36536
  };
36537
- const translator$4 = NodeTranslator.from(config$4);
36537
+ const translator$3 = NodeTranslator.from(config$3);
36538
36538
  class CommandService {
36539
36539
  /**
36540
36540
  * @param {import('./commands/types/index.js').CommandServiceOptions} props
@@ -37872,7 +37872,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
37872
37872
  return getTextNodeForExport(attrs.displayLabel, [...marks, ...marksFromAttrs], params2);
37873
37873
  }
37874
37874
  function prepareImageAnnotation(params2, imageSize) {
37875
- return translator$4.decode({
37875
+ return translator$3.decode({
37876
37876
  ...params2,
37877
37877
  imageSize
37878
37878
  });
@@ -38109,10 +38109,10 @@ Please report this to https://github.com/markedjs/marked.`, e) {
38109
38109
  };
38110
38110
  return result;
38111
38111
  }
38112
- const XML_NODE_NAME$3 = "w:sdt";
38113
- const SD_NODE_NAME$3 = ["fieldAnnotation", "structuredContent", "structuredContentBlock", "documentSection"];
38114
- const validXmlAttributes$3 = [];
38115
- function encode$a(params2) {
38112
+ const XML_NODE_NAME$2 = "w:sdt";
38113
+ const SD_NODE_NAME$2 = ["fieldAnnotation", "structuredContent", "structuredContentBlock", "documentSection"];
38114
+ const validXmlAttributes$2 = [];
38115
+ function encode$9(params2) {
38116
38116
  const nodes = params2.nodes;
38117
38117
  const node = nodes[0];
38118
38118
  const { type: sdtType, handler: handler2 } = sdtNodeTypeStrategy(node);
@@ -38122,7 +38122,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
38122
38122
  const result = handler2(params2);
38123
38123
  return result;
38124
38124
  }
38125
- function decode$a(params2) {
38125
+ function decode$9(params2) {
38126
38126
  const { node } = params2;
38127
38127
  if (!node || !node.type) {
38128
38128
  return null;
@@ -38138,85 +38138,85 @@ Please report this to https://github.com/markedjs/marked.`, e) {
38138
38138
  const result = decoder();
38139
38139
  return result;
38140
38140
  }
38141
- const config$3 = {
38142
- xmlName: XML_NODE_NAME$3,
38143
- sdNodeOrKeyName: SD_NODE_NAME$3,
38141
+ const config$2 = {
38142
+ xmlName: XML_NODE_NAME$2,
38143
+ sdNodeOrKeyName: SD_NODE_NAME$2,
38144
38144
  type: NodeTranslator.translatorTypes.NODE,
38145
- encode: encode$a,
38146
- decode: decode$a,
38147
- attributes: validXmlAttributes$3
38145
+ encode: encode$9,
38146
+ decode: decode$9,
38147
+ attributes: validXmlAttributes$2
38148
38148
  };
38149
- const translator$3 = NodeTranslator.from(config$3);
38150
- const encode$9 = (attributes) => {
38149
+ const translator$2 = NodeTranslator.from(config$2);
38150
+ const encode$8 = (attributes) => {
38151
38151
  return attributes["w:id"];
38152
38152
  };
38153
- const decode$9 = (attrs) => {
38153
+ const decode$8 = (attrs) => {
38154
38154
  return attrs.id;
38155
38155
  };
38156
38156
  const attrConfig$6 = Object.freeze({
38157
38157
  xmlName: "w:id",
38158
38158
  sdName: "id",
38159
- encode: encode$9,
38160
- decode: decode$9
38159
+ encode: encode$8,
38160
+ decode: decode$8
38161
38161
  });
38162
- const encode$8 = (attributes) => {
38162
+ const encode$7 = (attributes) => {
38163
38163
  return attributes["w:name"];
38164
38164
  };
38165
- const decode$8 = (attrs) => {
38165
+ const decode$7 = (attrs) => {
38166
38166
  return attrs.name;
38167
38167
  };
38168
38168
  const attrConfig$5 = Object.freeze({
38169
38169
  xmlName: "w:name",
38170
38170
  sdName: "name",
38171
- encode: encode$8,
38172
- decode: decode$8
38171
+ encode: encode$7,
38172
+ decode: decode$7
38173
38173
  });
38174
- const encode$7 = (attributes) => {
38174
+ const encode$6 = (attributes) => {
38175
38175
  return attributes["w:colFirst"];
38176
38176
  };
38177
- const decode$7 = (attrs) => {
38177
+ const decode$6 = (attrs) => {
38178
38178
  return attrs.colFirst;
38179
38179
  };
38180
38180
  const attrConfig$4 = Object.freeze({
38181
38181
  xmlName: "w:colFirst",
38182
38182
  sdName: "colFirst",
38183
- encode: encode$7,
38184
- decode: decode$7
38183
+ encode: encode$6,
38184
+ decode: decode$6
38185
38185
  });
38186
- const encode$6 = (attributes) => {
38186
+ const encode$5 = (attributes) => {
38187
38187
  return attributes["w:colLast"];
38188
38188
  };
38189
- const decode$6 = (attrs) => {
38189
+ const decode$5 = (attrs) => {
38190
38190
  return attrs.colLast;
38191
38191
  };
38192
38192
  const attrConfig$3 = Object.freeze({
38193
38193
  xmlName: "w:colLast",
38194
38194
  sdName: "colLast",
38195
- encode: encode$6,
38196
- decode: decode$6
38195
+ encode: encode$5,
38196
+ decode: decode$5
38197
38197
  });
38198
- const encode$5 = (attributes) => {
38198
+ const encode$4 = (attributes) => {
38199
38199
  return attributes["w:displacedByCustomXml"];
38200
38200
  };
38201
- const decode$5 = (attrs) => {
38201
+ const decode$4 = (attrs) => {
38202
38202
  return attrs.displacedByCustomXml;
38203
38203
  };
38204
38204
  const attrConfig$2 = Object.freeze({
38205
38205
  xmlName: "w:displacedByCustomXml",
38206
38206
  sdName: "displacedByCustomXml",
38207
- encode: encode$5,
38208
- decode: decode$5
38207
+ encode: encode$4,
38208
+ decode: decode$4
38209
38209
  });
38210
- const validXmlAttributes$2 = [attrConfig$6, attrConfig$5, attrConfig$4, attrConfig$3, attrConfig$2];
38211
- const XML_NODE_NAME$2 = "w:bookmarkStart";
38212
- const SD_NODE_NAME$2 = "bookmarkStart";
38213
- const encode$4 = (params2, encodedAttrs = {}) => {
38210
+ const validXmlAttributes$1 = [attrConfig$6, attrConfig$5, attrConfig$4, attrConfig$3, attrConfig$2];
38211
+ const XML_NODE_NAME$1 = "w:bookmarkStart";
38212
+ const SD_NODE_NAME$1 = "bookmarkStart";
38213
+ const encode$3 = (params2, encodedAttrs = {}) => {
38214
38214
  return {
38215
38215
  type: "bookmarkStart",
38216
38216
  attrs: encodedAttrs
38217
38217
  };
38218
38218
  };
38219
- const decode$4 = (params2, decodedAttrs = {}) => {
38219
+ const decode$3 = (params2, decodedAttrs = {}) => {
38220
38220
  const result = {
38221
38221
  name: "w:bookmarkStart",
38222
38222
  elements: []
@@ -38226,49 +38226,49 @@ Please report this to https://github.com/markedjs/marked.`, e) {
38226
38226
  }
38227
38227
  return result;
38228
38228
  };
38229
- const config$2 = {
38230
- xmlName: XML_NODE_NAME$2,
38231
- sdNodeOrKeyName: SD_NODE_NAME$2,
38229
+ const config$1 = {
38230
+ xmlName: XML_NODE_NAME$1,
38231
+ sdNodeOrKeyName: SD_NODE_NAME$1,
38232
38232
  type: NodeTranslator.translatorTypes.NODE,
38233
- encode: encode$4,
38234
- decode: decode$4,
38235
- attributes: validXmlAttributes$2
38233
+ encode: encode$3,
38234
+ decode: decode$3,
38235
+ attributes: validXmlAttributes$1
38236
38236
  };
38237
- const translator$2 = NodeTranslator.from(config$2);
38238
- const encode$3 = (attributes) => {
38237
+ const translator$1 = NodeTranslator.from(config$1);
38238
+ const encode$2 = (attributes) => {
38239
38239
  return attributes["w:id"];
38240
38240
  };
38241
- const decode$3 = (attrs) => {
38241
+ const decode$2 = (attrs) => {
38242
38242
  return attrs.id;
38243
38243
  };
38244
38244
  const attrConfig$1 = Object.freeze({
38245
38245
  xmlName: "w:id",
38246
38246
  sdName: "id",
38247
- encode: encode$3,
38248
- decode: decode$3
38247
+ encode: encode$2,
38248
+ decode: decode$2
38249
38249
  });
38250
- const encode$2 = (attributes) => {
38250
+ const encode$1 = (attributes) => {
38251
38251
  return attributes["w:displacedByCustomXml"];
38252
38252
  };
38253
- const decode$2 = (attrs) => {
38253
+ const decode$1 = (attrs) => {
38254
38254
  return attrs.displacedByCustomXml;
38255
38255
  };
38256
38256
  const attrConfig = Object.freeze({
38257
38257
  xmlName: "w:displacedByCustomXml",
38258
38258
  sdName: "displacedByCustomXml",
38259
- encode: encode$2,
38260
- decode: decode$2
38259
+ encode: encode$1,
38260
+ decode: decode$1
38261
38261
  });
38262
- const validXmlAttributes$1 = [attrConfig$1, attrConfig];
38263
- const XML_NODE_NAME$1 = "w:bookmarkEnd";
38264
- const SD_NODE_NAME$1 = "bookmarkEnd";
38265
- const encode$1 = (params2, encodedAttrs = {}) => {
38262
+ const validXmlAttributes = [attrConfig$1, attrConfig];
38263
+ const XML_NODE_NAME = "w:bookmarkEnd";
38264
+ const SD_NODE_NAME = "bookmarkEnd";
38265
+ const encode$18 = (params2, encodedAttrs = {}) => {
38266
38266
  return {
38267
38267
  type: "bookmarkEnd",
38268
38268
  attrs: encodedAttrs
38269
38269
  };
38270
38270
  };
38271
- const decode$1 = (params2, decodedAttrs = {}) => {
38271
+ const decode = (params2, decodedAttrs = {}) => {
38272
38272
  const result = {
38273
38273
  name: "w:bookmarkEnd",
38274
38274
  elements: []
@@ -38278,60 +38278,11 @@ Please report this to https://github.com/markedjs/marked.`, e) {
38278
38278
  }
38279
38279
  return result;
38280
38280
  };
38281
- const config$1 = {
38282
- xmlName: XML_NODE_NAME$1,
38283
- sdNodeOrKeyName: SD_NODE_NAME$1,
38284
- type: NodeTranslator.translatorTypes.NODE,
38285
- encode: encode$1,
38286
- decode: decode$1,
38287
- attributes: validXmlAttributes$1
38288
- };
38289
- const translator$1 = NodeTranslator.from(config$1);
38290
- const XML_NODE_NAME = "mc:AlternateContent";
38291
- const SD_NODE_NAME = [];
38292
- const validXmlAttributes = [];
38293
- function encode$19(params2) {
38294
- const { nodeListHandler } = params2;
38295
- const { node } = params2.extraParams;
38296
- if (!node || !node.type) {
38297
- return null;
38298
- }
38299
- const allowedNamespaces = ["wps", "wp14", "w14", "w15"];
38300
- const wpsNode = node.elements.find(
38301
- (el) => el.name === "mc:Choice" && allowedNamespaces.includes(el.attributes["Requires"])
38302
- );
38303
- if (!wpsNode) {
38304
- return null;
38305
- }
38306
- const contents = wpsNode.elements;
38307
- return nodeListHandler.handler({
38308
- ...params2,
38309
- nodes: contents,
38310
- path: [...params2.path || [], wpsNode]
38311
- });
38312
- }
38313
- function decode(params2) {
38314
- const { node } = params2;
38315
- const { drawingContent } = node.attrs;
38316
- const drawing = {
38317
- name: "w:drawing",
38318
- elements: [...drawingContent ? [...drawingContent.elements || []] : []]
38319
- };
38320
- const choice = {
38321
- name: "mc:Choice",
38322
- attributes: { Requires: "wps" },
38323
- elements: [drawing]
38324
- };
38325
- return {
38326
- name: "mc:AlternateContent",
38327
- elements: [choice]
38328
- };
38329
- }
38330
38281
  const config = {
38331
38282
  xmlName: XML_NODE_NAME,
38332
38283
  sdNodeOrKeyName: SD_NODE_NAME,
38333
38284
  type: NodeTranslator.translatorTypes.NODE,
38334
- encode: encode$19,
38285
+ encode: encode$18,
38335
38286
  decode,
38336
38287
  attributes: validXmlAttributes
38337
38288
  };
@@ -38350,30 +38301,30 @@ Please report this to https://github.com/markedjs/marked.`, e) {
38350
38301
  doc: translateDocumentNode,
38351
38302
  body: translateBodyNode,
38352
38303
  heading: translateHeadingNode,
38353
- paragraph: translator$13,
38354
- run: translator$U,
38304
+ paragraph: translator$12,
38305
+ run: translator$T,
38355
38306
  text: translateTextNode,
38356
38307
  bulletList: translateList,
38357
38308
  orderedList: translateList,
38358
- lineBreak: translator$16,
38359
- table: translator$9,
38360
- tableRow: translator$G,
38361
- tableCell: translator$8,
38362
- bookmarkStart: translator$2,
38363
- bookmarkEnd: translator$1,
38364
- fieldAnnotation: translator$3,
38365
- tab: translator$14,
38366
- image: translator$4,
38367
- hardBreak: translator$16,
38309
+ lineBreak: translator$15,
38310
+ table: translator$8,
38311
+ tableRow: translator$F,
38312
+ tableCell: translator$7,
38313
+ bookmarkStart: translator$1,
38314
+ bookmarkEnd: translator,
38315
+ fieldAnnotation: translator$2,
38316
+ tab: translator$13,
38317
+ image: translator$3,
38318
+ hardBreak: translator$15,
38368
38319
  commentRangeStart: () => translateCommentNode(params2, "Start"),
38369
38320
  commentRangeEnd: () => translateCommentNode(params2, "End"),
38370
38321
  commentReference: () => null,
38371
38322
  shapeContainer: translateShapeContainer,
38372
38323
  shapeTextbox: translateShapeTextbox,
38373
38324
  contentBlock: translateContentBlock,
38374
- structuredContent: translator$3,
38375
- structuredContentBlock: translator$3,
38376
- documentSection: translator$3,
38325
+ structuredContent: translator$2,
38326
+ structuredContentBlock: translator$2,
38327
+ documentSection: translator$2,
38377
38328
  "page-number": translatePageNumberNode,
38378
38329
  "total-page-number": translateTotalPageNumberNode
38379
38330
  };
@@ -38712,7 +38663,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
38712
38663
  const isTrackedNode = node.marks?.some((m2) => trackedMarks.includes(m2.type));
38713
38664
  if (isTrackedNode) return translateTrackedNode(params2);
38714
38665
  const isLinkNode = node.marks?.some((m2) => m2.type === "link");
38715
- if (isLinkNode) return translator$7.decode(params2);
38666
+ if (isLinkNode) return translator$6.decode(params2);
38716
38667
  const { text, marks = [] } = node;
38717
38668
  return getTextNodeForExport(text, marks, params2);
38718
38669
  }
@@ -39018,7 +38969,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
39018
38969
  markElement.type = "element";
39019
38970
  break;
39020
38971
  case "underline": {
39021
- const translated = translator$10.decode({
38972
+ const translated = translator$$.decode({
39022
38973
  node: {
39023
38974
  attrs: {
39024
38975
  underlineType: attrs.underlineType ?? attrs.underline ?? null,
@@ -39082,7 +39033,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
39082
39033
  break;
39083
39034
  case "highlight": {
39084
39035
  const highlightValue = attrs.color ?? attrs.highlight ?? null;
39085
- const translated = translator$15.decode({ node: { attrs: { highlight: highlightValue } } });
39036
+ const translated = translator$14.decode({ node: { attrs: { highlight: highlightValue } } });
39086
39037
  return translated || {};
39087
39038
  }
39088
39039
  }
@@ -39138,11 +39089,23 @@ Please report this to https://github.com/markedjs/marked.`, e) {
39138
39089
  }
39139
39090
  function translateContentBlock(params2) {
39140
39091
  const { node } = params2;
39141
- const { vmlAttributes, horizontalRule } = node.attrs;
39092
+ const { drawingContent, vmlAttributes, horizontalRule } = node.attrs;
39142
39093
  if (vmlAttributes || horizontalRule) {
39143
39094
  return translateVRectContentBlock(params2);
39144
39095
  }
39145
- const alternateContent = translator.decode(params2);
39096
+ const drawing = {
39097
+ name: "w:drawing",
39098
+ elements: [...drawingContent ? [...drawingContent.elements || []] : []]
39099
+ };
39100
+ const choice = {
39101
+ name: "mc:Choice",
39102
+ attributes: { Requires: "wps" },
39103
+ elements: [drawing]
39104
+ };
39105
+ const alternateContent = {
39106
+ name: "mc:AlternateContent",
39107
+ elements: [choice]
39108
+ };
39146
39109
  return wrapTextInRun(alternateContent);
39147
39110
  }
39148
39111
  function translateVRectContentBlock(params2) {
@@ -39346,7 +39309,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
39346
39309
  if (mainNode.name === "w:drawing") node = mainNode;
39347
39310
  else node = mainNode.elements.find((el) => el.name === "w:drawing");
39348
39311
  if (!node) return { nodes: [], consumed: 0 };
39349
- const schemaNode = translator$4.encode(params2);
39312
+ const schemaNode = translator$3.encode(params2);
39350
39313
  const newNodes = schemaNode ? [schemaNode] : [];
39351
39314
  return { nodes: newNodes, consumed: 1 };
39352
39315
  };
@@ -39448,8 +39411,8 @@ Please report this to https://github.com/markedjs/marked.`, e) {
39448
39411
  handlerName: "trackChangeNodeHandler",
39449
39412
  handler: handleTrackChangeNode
39450
39413
  };
39451
- const hyperlinkNodeHandlerEntity = generateV2HandlerEntity("hyperlinkNodeHandler", translator$7);
39452
- const runNodeHandlerEntity = generateV2HandlerEntity("runNodeHandler", translator$U);
39414
+ const hyperlinkNodeHandlerEntity = generateV2HandlerEntity("hyperlinkNodeHandler", translator$6);
39415
+ const runNodeHandlerEntity = generateV2HandlerEntity("runNodeHandler", translator$T);
39453
39416
  const handleTextNode = (params2) => {
39454
39417
  const { nodes, insideTrackChange } = params2;
39455
39418
  if (nodes.length === 0 || !(nodes[0].name === "w:t" || insideTrackChange && nodes[0].name === "w:delText")) {
@@ -39490,7 +39453,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
39490
39453
  if (nodes.length === 0 || nodes[0].name !== "w:p") {
39491
39454
  return { nodes: [], consumed: 0 };
39492
39455
  }
39493
- const schemaNode = translator$13.encode(params2);
39456
+ const schemaNode = translator$12.encode(params2);
39494
39457
  const newNodes = schemaNode ? [schemaNode] : [];
39495
39458
  return { nodes: newNodes, consumed: 1 };
39496
39459
  };
@@ -39503,7 +39466,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
39503
39466
  if (nodes.length === 0 || nodes[0].name !== "w:sdt") {
39504
39467
  return { nodes: [], consumed: 0 };
39505
39468
  }
39506
- const result = translator$3.encode(params2);
39469
+ const result = translator$2.encode(params2);
39507
39470
  if (!result) {
39508
39471
  return { nodes: [], consumed: 0 };
39509
39472
  }
@@ -39593,7 +39556,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
39593
39556
  if (nodes.length === 0 || nodes[0].name !== "w:br") {
39594
39557
  return { nodes: [], consumed: 0 };
39595
39558
  }
39596
- const result = translator$16.encode(params2);
39559
+ const result = translator$15.encode(params2);
39597
39560
  if (!result) return { nodes: [], consumed: 0 };
39598
39561
  return {
39599
39562
  nodes: [result],
@@ -39665,7 +39628,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
39665
39628
  if (isCustomMarkBookmark(nodes[0], params2.editor)) {
39666
39629
  return handleBookmarkNode(params2);
39667
39630
  }
39668
- const node = translator$2.encode(params2);
39631
+ const node = translator$1.encode(params2);
39669
39632
  if (!node) return { nodes: [], consumed: 0 };
39670
39633
  return { nodes: [node], consumed: 1 };
39671
39634
  };
@@ -39697,7 +39660,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
39697
39660
  if (!nodes.length || nodes[0].name !== "w:bookmarkEnd") {
39698
39661
  return { nodes: [], consumed: 0 };
39699
39662
  }
39700
- const node = translator$1.encode(params2);
39663
+ const node = translator.encode(params2);
39701
39664
  if (!node) return { nodes: [], consumed: 0 };
39702
39665
  return { nodes: [node], consumed: 1 };
39703
39666
  };
@@ -39705,86 +39668,32 @@ Please report this to https://github.com/markedjs/marked.`, e) {
39705
39668
  handlerName: "w:bookmarkEndTranslator",
39706
39669
  handler: handleBookmarkEndNode
39707
39670
  };
39708
- const ALTERNATE_CONTENT_NODE = "mc:AlternateContent";
39709
- const SUPPORTED_REQUIRES = /* @__PURE__ */ new Set([
39710
- "wps",
39711
- "wp14",
39712
- "w14",
39713
- "w15",
39714
- "w16",
39715
- "w16cex",
39716
- "w16cid",
39717
- "w16du",
39718
- "w16sdtdh",
39719
- "w16sdtfl",
39720
- "w16se"
39721
- ]);
39722
- const skipHandlerResponse = { nodes: [], consumed: 0 };
39723
- const isAlternateContentNode = (node) => node?.name === ALTERNATE_CONTENT_NODE;
39724
- const isSupportedChoice = (choice) => {
39725
- if (!choice?.attributes) return false;
39726
- const requires = choice.attributes.Requires || choice.attributes.requires;
39727
- if (!requires) return false;
39728
- return requires.split(/\s+/).filter(Boolean).some((namespace2) => SUPPORTED_REQUIRES.has(namespace2));
39729
- };
39730
- const resolveAlternateContentElements = (alternateContent) => {
39731
- if (!alternateContent?.elements?.length) return null;
39732
- const choices = alternateContent.elements.filter((el) => el.name === "mc:Choice");
39733
- const fallback = alternateContent.elements.find((el) => el.name === "mc:Fallback");
39734
- const supportedChoice = choices.find(isSupportedChoice);
39735
- const selectedElements = supportedChoice?.elements || fallback?.elements || choices[0]?.elements;
39736
- if (!selectedElements) return null;
39737
- return carbonCopy(selectedElements);
39738
- };
39739
- const buildNodeWithoutAlternateContent = (node) => {
39740
- const { elements } = node || {};
39741
- if (!elements?.length) return null;
39742
- let replaced = false;
39743
- const updatedElements = [];
39744
- elements.forEach((element) => {
39745
- if (isAlternateContentNode(element)) {
39746
- const resolved = resolveAlternateContentElements(element);
39747
- if (resolved) {
39748
- updatedElements.push(...resolved);
39749
- replaced = true;
39750
- return;
39751
- }
39752
- updatedElements.push(carbonCopy(element));
39753
- return;
39754
- }
39755
- updatedElements.push(carbonCopy(element));
39756
- });
39757
- if (!replaced) return null;
39758
- const clone = carbonCopy(node);
39759
- clone.elements = updatedElements;
39760
- return clone;
39761
- };
39762
39671
  const handleAlternateChoice = (params2) => {
39672
+ const skipHandlerResponse = { nodes: [], consumed: 0 };
39763
39673
  const { nodes, nodeListHandler } = params2;
39764
- if (!nodes?.length) {
39674
+ if (nodes.length === 0 || nodes[0].name !== "w:p") {
39765
39675
  return skipHandlerResponse;
39766
39676
  }
39767
- const [currentNode] = nodes;
39768
- if (isAlternateContentNode(currentNode)) {
39769
- const resolvedElements = resolveAlternateContentElements(currentNode);
39770
- if (!resolvedElements) {
39771
- return skipHandlerResponse;
39772
- }
39773
- const result2 = nodeListHandler.handler({
39774
- ...params2,
39775
- nodes: resolvedElements,
39776
- path: [...params2.path || [], currentNode]
39777
- });
39778
- return { nodes: result2, consumed: 1 };
39677
+ const mainNode = nodes[0];
39678
+ const node = mainNode?.elements?.find((el) => el.name === "w:r");
39679
+ const hasAltChoice = node?.elements?.some((el) => el.name === "mc:AlternateContent");
39680
+ if (!hasAltChoice) {
39681
+ return skipHandlerResponse;
39779
39682
  }
39780
- const sanitizedNode = buildNodeWithoutAlternateContent(currentNode);
39781
- if (!sanitizedNode) {
39683
+ const altChoiceNode = node.elements.find((el) => el.name === "mc:AlternateContent");
39684
+ node.elements.findIndex((el) => el.name === "mc:AlternateContent");
39685
+ const allowedNamespaces = ["wps", "wp14", "w14", "w15"];
39686
+ const wpsNode = altChoiceNode.elements.find(
39687
+ (el) => el.name === "mc:Choice" && allowedNamespaces.includes(el.attributes["Requires"])
39688
+ );
39689
+ if (!wpsNode) {
39782
39690
  return skipHandlerResponse;
39783
39691
  }
39692
+ const contents = wpsNode.elements;
39784
39693
  const result = nodeListHandler.handler({
39785
39694
  ...params2,
39786
- nodes: [sanitizedNode],
39787
- path: [...params2.path || [], sanitizedNode]
39695
+ nodes: contents,
39696
+ path: [...params2.path || [], wpsNode]
39788
39697
  });
39789
39698
  return { nodes: result, consumed: 1 };
39790
39699
  };
@@ -40363,7 +40272,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
40363
40272
  if (!nodes.length || nodes[0].name !== "w:tab") {
40364
40273
  return { nodes: [], consumed: 0 };
40365
40274
  }
40366
- const node = translator$14.encode(params2);
40275
+ const node = translator$13.encode(params2);
40367
40276
  return { nodes: [node], consumed: 1 };
40368
40277
  };
40369
40278
  const tabNodeEntityHandler = {
@@ -58488,8 +58397,6 @@ Please report this to https://github.com/markedjs/marked.`, e) {
58488
58397
  element.style.isolation = "isolate";
58489
58398
  proseMirror.style.outline = "none";
58490
58399
  proseMirror.style.border = "none";
58491
- element.style.backgroundColor = "#fff";
58492
- proseMirror.style.backgroundColor = "#fff";
58493
58400
  const { typeface, fontSizePt, fontFamilyCss } = this.converter.getDocumentDefaultStyles() ?? {};
58494
58401
  const resolvedFontFamily = fontFamilyCss || typeface;
58495
58402
  if (resolvedFontFamily) {
@@ -61290,14 +61197,6 @@ Please report this to https://github.com/markedjs/marked.`, e) {
61290
61197
  return result;
61291
61198
  };
61292
61199
  const CustomSelectionPluginKey = new PluginKey("CustomSelection");
61293
- const shouldAllowNativeContextMenu = (event) => {
61294
- if (!event) return false;
61295
- if (event.ctrlKey || event.metaKey) {
61296
- return true;
61297
- }
61298
- const isKeyboardInvocation = event.type === "contextmenu" && typeof event.detail === "number" && event.detail === 0 && (event.button === 0 || event.button === void 0) && event.clientX === 0 && event.clientY === 0;
61299
- return Boolean(isKeyboardInvocation);
61300
- };
61301
61200
  const handleClickOutside = (event, editor) => {
61302
61201
  const editorElem = editor?.options?.element;
61303
61202
  if (!editorElem) return;
@@ -61359,9 +61258,6 @@ Please report this to https://github.com/markedjs/marked.`, e) {
61359
61258
  props: {
61360
61259
  handleDOMEvents: {
61361
61260
  contextmenu: (view, event) => {
61362
- if (shouldAllowNativeContextMenu(event)) {
61363
- return false;
61364
- }
61365
61261
  event.preventDefault();
61366
61262
  const { selection } = view.state;
61367
61263
  if (!selection.empty) {
@@ -61380,9 +61276,6 @@ Please report this to https://github.com/markedjs/marked.`, e) {
61380
61276
  },
61381
61277
  mousedown: (view, event) => {
61382
61278
  if (event.button === 2) {
61383
- if (shouldAllowNativeContextMenu(event)) {
61384
- return false;
61385
- }
61386
61279
  event.preventDefault();
61387
61280
  const { selection: selection2 } = view.state;
61388
61281
  if (!selection2.empty) {
@@ -91374,115 +91267,6 @@ ${style2}
91374
91267
  this.updateToolbarState();
91375
91268
  }
91376
91269
  };
91377
- const onMarginClickCursorChange = (event, editor) => {
91378
- const y2 = event.clientY;
91379
- const x = event.clientX;
91380
- const { view } = editor;
91381
- const editorRect = view.dom.getBoundingClientRect();
91382
- let coords = {
91383
- left: 0,
91384
- top: y2
91385
- };
91386
- let isRightMargin = false;
91387
- if (x > editorRect.right) {
91388
- coords.left = editorRect.left + editorRect.width - 1;
91389
- isRightMargin = true;
91390
- } else if (x < editorRect.left) {
91391
- coords.left = editorRect.left;
91392
- }
91393
- const pos = view.posAtCoords(coords)?.pos;
91394
- if (pos) {
91395
- let cursorPos = pos;
91396
- if (isRightMargin) {
91397
- const $pos = view.state.doc.resolve(pos);
91398
- const charOffset = $pos.textOffset;
91399
- const node = view.state.doc.nodeAt(pos);
91400
- const text = node?.text;
91401
- const charAtPos = text?.charAt(charOffset);
91402
- cursorPos = node?.isText && charAtPos !== " " ? pos - 1 : pos;
91403
- }
91404
- const transaction = view.state.tr.setSelection(TextSelection$1.create(view.state.doc, cursorPos));
91405
- view.dispatch(transaction);
91406
- view.focus();
91407
- }
91408
- };
91409
- const checkNodeSpecificClicks = (editor, event, popoverControls) => {
91410
- if (!editor) return;
91411
- if (selectionHasNodeOrMark(editor.view.state, "link", { requireEnds: true })) {
91412
- popoverControls.component = LinkInput;
91413
- popoverControls.position = {
91414
- left: `${event.clientX - editor.element.getBoundingClientRect().left}px`,
91415
- top: `${event.clientY - editor.element.getBoundingClientRect().top + 15}px`
91416
- };
91417
- popoverControls.props = {
91418
- showInput: true
91419
- };
91420
- popoverControls.visible = true;
91421
- }
91422
- };
91423
- function selectionHasNodeOrMark(state2, name, options = {}) {
91424
- const { requireEnds = false } = options;
91425
- const $from = state2.selection.$from;
91426
- const $to = state2.selection.$to;
91427
- if (requireEnds) {
91428
- for (let d2 = $from.depth; d2 > 0; d2--) {
91429
- if ($from.node(d2).type.name === name) {
91430
- return true;
91431
- }
91432
- }
91433
- for (let d2 = $to.depth; d2 > 0; d2--) {
91434
- if ($to.node(d2).type.name === name) {
91435
- return true;
91436
- }
91437
- }
91438
- } else {
91439
- for (let d2 = $from.depth; d2 > 0; d2--) {
91440
- if ($from.node(d2).type.name === name) {
91441
- return true;
91442
- }
91443
- }
91444
- }
91445
- const markType = state2.schema.marks[name];
91446
- if (markType) {
91447
- const { from: from2, to, empty: empty2 } = state2.selection;
91448
- if (requireEnds) {
91449
- const fromMarks = markType.isInSet($from.marks());
91450
- const toMarks = markType.isInSet($to.marks());
91451
- if (fromMarks || toMarks) {
91452
- return true;
91453
- }
91454
- if (empty2 && markType.isInSet(state2.storedMarks || $from.marks())) {
91455
- return true;
91456
- }
91457
- } else {
91458
- if (empty2) {
91459
- if (markType.isInSet(state2.storedMarks || $from.marks())) {
91460
- return true;
91461
- }
91462
- } else {
91463
- let hasMark = false;
91464
- state2.doc.nodesBetween(from2, to, (node) => {
91465
- if (markType.isInSet(node.marks)) {
91466
- hasMark = true;
91467
- return false;
91468
- }
91469
- });
91470
- if (hasMark) return true;
91471
- }
91472
- }
91473
- }
91474
- return false;
91475
- }
91476
- function moveCursorToMouseEvent(event, editor) {
91477
- const { view } = editor;
91478
- const coords = { left: event.clientX, top: event.clientY };
91479
- const pos = view.posAtCoords(coords)?.pos;
91480
- if (typeof pos === "number") {
91481
- const tr = view.state.tr.setSelection(TextSelection$1.create(view.state.doc, pos));
91482
- view.dispatch(tr);
91483
- view.focus();
91484
- }
91485
- }
91486
91270
  const ICONS = {
91487
91271
  addRowBefore: plusIconSvg,
91488
91272
  addRowAfter: plusIconSvg,
@@ -91682,30 +91466,6 @@ ${style2}
91682
91466
  return baseProps;
91683
91467
  }
91684
91468
  };
91685
- function normalizeClipboardContent(rawClipboardContent) {
91686
- if (!rawClipboardContent) {
91687
- return {
91688
- html: null,
91689
- text: null,
91690
- hasContent: false,
91691
- raw: null
91692
- };
91693
- }
91694
- const html = typeof rawClipboardContent.html === "string" ? rawClipboardContent.html : null;
91695
- const text = typeof rawClipboardContent.text === "string" ? rawClipboardContent.text : null;
91696
- const hasHtml = !!html && html.trim().length > 0;
91697
- const hasText = !!text && text.length > 0;
91698
- const isObject2 = typeof rawClipboardContent === "object" && rawClipboardContent !== null;
91699
- const fragmentSize = typeof rawClipboardContent.size === "number" ? rawClipboardContent.size : null;
91700
- const nestedSize = isObject2 && rawClipboardContent.content && typeof rawClipboardContent.content.size === "number" ? rawClipboardContent.content.size : null;
91701
- const hasFragmentContent = (fragmentSize ?? nestedSize ?? 0) > 0;
91702
- return {
91703
- html,
91704
- text,
91705
- hasContent: hasHtml || hasText || hasFragmentContent,
91706
- raw: rawClipboardContent
91707
- };
91708
- }
91709
91469
  async function getEditorContext(editor, event) {
91710
91470
  const { view } = editor;
91711
91471
  const { state: state2 } = view;
@@ -91721,154 +91481,125 @@ ${style2}
91721
91481
  pos = from2;
91722
91482
  node = state2.doc.nodeAt(pos);
91723
91483
  }
91724
- const rawClipboardContent = await readFromClipboard(state2);
91725
- const clipboardContent = normalizeClipboardContent(rawClipboardContent);
91726
- const structureFromResolvedPos = pos !== null ? getStructureFromResolvedPos(state2, pos) : null;
91727
- const isInTable2 = structureFromResolvedPos?.isInTable ?? selectionHasNodeOrMark(state2, "table", { requireEnds: true });
91728
- const isInList = structureFromResolvedPos?.isInList ?? (selectionHasNodeOrMark(state2, "bulletList", { requireEnds: false }) || selectionHasNodeOrMark(state2, "orderedList", { requireEnds: false }));
91729
- const isInSectionNode = structureFromResolvedPos?.isInSectionNode ?? selectionHasNodeOrMark(state2, "documentSection", { requireEnds: true });
91730
- const currentNodeType = node?.type?.name || null;
91731
- const activeMarks = [];
91732
- if (event && pos !== null) {
91733
- const $pos = state2.doc.resolve(pos);
91734
- if ($pos.marks && typeof $pos.marks === "function") {
91735
- $pos.marks().forEach((mark) => activeMarks.push(mark.type.name));
91736
- }
91737
- if (node && node.marks) {
91738
- node.marks.forEach((mark) => activeMarks.push(mark.type.name));
91739
- }
91740
- } else {
91741
- state2.storedMarks?.forEach((mark) => activeMarks.push(mark.type.name));
91742
- state2.selection.$head.marks().forEach((mark) => activeMarks.push(mark.type.name));
91743
- }
91744
- const isTrackedChange = activeMarks.includes("trackInsert") || activeMarks.includes("trackDelete");
91745
- let trackedChangeId = null;
91746
- if (isTrackedChange && event && pos !== null) {
91747
- const $pos = state2.doc.resolve(pos);
91748
- const marksAtPos = $pos.marks();
91749
- const trackedMark = marksAtPos.find((mark) => mark.type.name === "trackInsert" || mark.type.name === "trackDelete");
91750
- if (trackedMark) {
91751
- trackedChangeId = trackedMark.attrs.id;
91752
- }
91753
- }
91754
- const cursorCoords = pos ? view.coordsAtPos(pos) : null;
91755
- const cursorPosition = cursorCoords ? {
91756
- x: cursorCoords.left,
91757
- y: cursorCoords.top
91758
- } : null;
91484
+ const clipboardContent = await readFromClipboard(state2);
91759
91485
  return {
91760
- // Selection info
91486
+ editor,
91761
91487
  selectedText,
91762
- hasSelection: !empty2,
91763
- selectionStart: from2,
91764
- selectionEnd: to,
91765
- // Document structure
91766
- isInTable: isInTable2,
91767
- isInList,
91768
- isInSectionNode,
91769
- currentNodeType,
91770
- activeMarks,
91771
- // Document state
91772
- isTrackedChange,
91773
- trackedChangeId,
91774
- documentMode: editor.options?.documentMode || "editing",
91775
- canUndo: computeCanUndo(editor, state2),
91776
- canRedo: computeCanRedo(editor, state2),
91777
- isEditable: editor.isEditable,
91778
- // Clipboard
91779
- clipboardContent,
91780
- // Position and trigger info
91781
- cursorPosition,
91782
91488
  pos,
91783
91489
  node,
91784
91490
  event,
91785
- // Editor reference for advanced use cases
91786
- editor
91491
+ clipboardContent
91787
91492
  };
91788
91493
  }
91789
- function computeCanUndo(editor, state2) {
91790
- if (typeof editor?.can === "function") {
91791
- try {
91792
- const can = editor.can();
91793
- if (can && typeof can.undo === "function") {
91794
- return !!can.undo();
91795
- }
91796
- } catch (error) {
91797
- console.warn("[SlashMenu] Unable to determine undo availability via editor.can():", error);
91798
- }
91494
+ const onMarginClickCursorChange = (event, editor) => {
91495
+ const y2 = event.clientY;
91496
+ const x = event.clientX;
91497
+ const { view } = editor;
91498
+ const editorRect = view.dom.getBoundingClientRect();
91499
+ let coords = {
91500
+ left: 0,
91501
+ top: y2
91502
+ };
91503
+ let isRightMargin = false;
91504
+ if (x > editorRect.right) {
91505
+ coords.left = editorRect.left + editorRect.width - 1;
91506
+ isRightMargin = true;
91507
+ } else if (x < editorRect.left) {
91508
+ coords.left = editorRect.left;
91799
91509
  }
91800
- if (isCollaborationEnabled(editor)) {
91801
- try {
91802
- const undoManager = yUndoPluginKey.getState(state2)?.undoManager;
91803
- return !!undoManager && undoManager.undoStack.length > 0;
91804
- } catch (error) {
91805
- console.warn("[SlashMenu] Unable to determine undo availability via y-prosemirror:", error);
91510
+ const pos = view.posAtCoords(coords)?.pos;
91511
+ if (pos) {
91512
+ let cursorPos = pos;
91513
+ if (isRightMargin) {
91514
+ const $pos = view.state.doc.resolve(pos);
91515
+ const charOffset = $pos.textOffset;
91516
+ const node = view.state.doc.nodeAt(pos);
91517
+ const text = node?.text;
91518
+ const charAtPos = text?.charAt(charOffset);
91519
+ cursorPos = node?.isText && charAtPos !== " " ? pos - 1 : pos;
91806
91520
  }
91521
+ const transaction = view.state.tr.setSelection(TextSelection$1.create(view.state.doc, cursorPos));
91522
+ view.dispatch(transaction);
91523
+ view.focus();
91807
91524
  }
91808
- try {
91809
- return undoDepth(state2) > 0;
91810
- } catch (error) {
91811
- console.warn("[SlashMenu] Unable to determine undo availability via history plugin:", error);
91812
- return false;
91525
+ };
91526
+ const checkNodeSpecificClicks = (editor, event, popoverControls) => {
91527
+ if (!editor) return;
91528
+ if (selectionHasNodeOrMark(editor.view.state, "link", { requireEnds: true })) {
91529
+ popoverControls.component = LinkInput;
91530
+ popoverControls.position = {
91531
+ left: `${event.clientX - editor.element.getBoundingClientRect().left}px`,
91532
+ top: `${event.clientY - editor.element.getBoundingClientRect().top + 15}px`
91533
+ };
91534
+ popoverControls.props = {
91535
+ showInput: true
91536
+ };
91537
+ popoverControls.visible = true;
91813
91538
  }
91814
- }
91815
- function computeCanRedo(editor, state2) {
91816
- if (typeof editor?.can === "function") {
91817
- try {
91818
- const can = editor.can();
91819
- if (can && typeof can.redo === "function") {
91820
- return !!can.redo();
91539
+ };
91540
+ function selectionHasNodeOrMark(state2, name, options = {}) {
91541
+ const { requireEnds = false } = options;
91542
+ const $from = state2.selection.$from;
91543
+ const $to = state2.selection.$to;
91544
+ if (requireEnds) {
91545
+ for (let d2 = $from.depth; d2 > 0; d2--) {
91546
+ if ($from.node(d2).type.name === name) {
91547
+ return true;
91821
91548
  }
91822
- } catch (error) {
91823
- console.warn("[SlashMenu] Unable to determine redo availability via editor.can():", error);
91824
91549
  }
91825
- }
91826
- if (isCollaborationEnabled(editor)) {
91827
- try {
91828
- const undoManager = yUndoPluginKey.getState(state2)?.undoManager;
91829
- return !!undoManager && undoManager.redoStack.length > 0;
91830
- } catch (error) {
91831
- console.warn("[SlashMenu] Unable to determine redo availability via y-prosemirror:", error);
91550
+ for (let d2 = $to.depth; d2 > 0; d2--) {
91551
+ if ($to.node(d2).type.name === name) {
91552
+ return true;
91553
+ }
91554
+ }
91555
+ } else {
91556
+ for (let d2 = $from.depth; d2 > 0; d2--) {
91557
+ if ($from.node(d2).type.name === name) {
91558
+ return true;
91559
+ }
91832
91560
  }
91833
91561
  }
91834
- try {
91835
- return redoDepth(state2) > 0;
91836
- } catch (error) {
91837
- console.warn("[SlashMenu] Unable to determine redo availability via history plugin:", error);
91838
- return false;
91839
- }
91840
- }
91841
- function isCollaborationEnabled(editor) {
91842
- return Boolean(editor?.options?.collaborationProvider && editor?.options?.ydoc);
91843
- }
91844
- function getStructureFromResolvedPos(state2, pos) {
91845
- try {
91846
- const $pos = state2.doc.resolve(pos);
91847
- const ancestors = /* @__PURE__ */ new Set();
91848
- for (let depth = $pos.depth; depth > 0; depth--) {
91849
- ancestors.add($pos.node(depth).type.name);
91562
+ const markType = state2.schema.marks[name];
91563
+ if (markType) {
91564
+ const { from: from2, to, empty: empty2 } = state2.selection;
91565
+ if (requireEnds) {
91566
+ const fromMarks = markType.isInSet($from.marks());
91567
+ const toMarks = markType.isInSet($to.marks());
91568
+ if (fromMarks || toMarks) {
91569
+ return true;
91570
+ }
91571
+ if (empty2 && markType.isInSet(state2.storedMarks || $from.marks())) {
91572
+ return true;
91573
+ }
91574
+ } else {
91575
+ if (empty2) {
91576
+ if (markType.isInSet(state2.storedMarks || $from.marks())) {
91577
+ return true;
91578
+ }
91579
+ } else {
91580
+ let hasMark = false;
91581
+ state2.doc.nodesBetween(from2, to, (node) => {
91582
+ if (markType.isInSet(node.marks)) {
91583
+ hasMark = true;
91584
+ return false;
91585
+ }
91586
+ });
91587
+ if (hasMark) return true;
91588
+ }
91850
91589
  }
91851
- const isInList = ancestors.has("bulletList") || ancestors.has("orderedList");
91852
- const isInTable2 = ancestors.has("table") || ancestors.has("tableRow") || ancestors.has("tableCell") || ancestors.has("tableHeader");
91853
- const isInSectionNode = ancestors.has("documentSection");
91854
- return {
91855
- isInTable: isInTable2,
91856
- isInList,
91857
- isInSectionNode
91858
- };
91859
- } catch (error) {
91860
- console.warn("[SlashMenu] Unable to resolve position for structural context:", error);
91861
- return null;
91862
91590
  }
91591
+ return false;
91863
91592
  }
91864
- const shouldBypassContextMenu = (event) => {
91865
- if (!event) return false;
91866
- if (event.ctrlKey || event.metaKey) {
91867
- return true;
91593
+ function moveCursorToMouseEvent(event, editor) {
91594
+ const { view } = editor;
91595
+ const coords = { left: event.clientX, top: event.clientY };
91596
+ const pos = view.posAtCoords(coords)?.pos;
91597
+ if (typeof pos === "number") {
91598
+ const tr = view.state.tr.setSelection(TextSelection$1.create(view.state.doc, pos));
91599
+ view.dispatch(tr);
91600
+ view.focus();
91868
91601
  }
91869
- const isKeyboardInvocation = event.type === "contextmenu" && typeof event.detail === "number" && event.detail === 0 && (event.button === 0 || event.button === void 0) && event.clientX === 0 && event.clientY === 0;
91870
- return Boolean(isKeyboardInvocation);
91871
- };
91602
+ }
91872
91603
  const isModuleEnabled = (editorOptions, moduleName) => {
91873
91604
  switch (moduleName) {
91874
91605
  case "ai":
@@ -91880,52 +91611,8 @@ ${style2}
91880
91611
  return true;
91881
91612
  }
91882
91613
  };
91883
- function applyCustomMenuConfiguration(defaultSections, context) {
91884
- const { editor } = context;
91885
- const slashMenuConfig = editor.options?.slashMenuConfig;
91886
- if (!slashMenuConfig) {
91887
- return defaultSections;
91888
- }
91889
- let sections = [];
91890
- if (slashMenuConfig.includeDefaultItems !== false) {
91891
- sections = [...defaultSections];
91892
- }
91893
- if (slashMenuConfig.customItems && Array.isArray(slashMenuConfig.customItems)) {
91894
- sections = [...sections, ...slashMenuConfig.customItems];
91895
- }
91896
- if (typeof slashMenuConfig.menuProvider === "function") {
91897
- try {
91898
- sections = slashMenuConfig.menuProvider(context, sections) || sections;
91899
- } catch (error) {
91900
- console.warn("[SlashMenu] Error in custom menuProvider:", error);
91901
- }
91902
- }
91903
- return sections;
91904
- }
91905
- function filterCustomItems(sections, context) {
91906
- return sections.map((section) => {
91907
- const filteredItems = section.items.filter((item) => {
91908
- if (typeof item.showWhen === "function") {
91909
- try {
91910
- return item.showWhen(context);
91911
- } catch (error) {
91912
- console.warn(`[SlashMenu] Error in showWhen for item ${item.id}:`, error);
91913
- return false;
91914
- }
91915
- }
91916
- return true;
91917
- });
91918
- return {
91919
- ...section,
91920
- items: filteredItems
91921
- };
91922
- }).filter((section) => section.items.length > 0);
91923
- }
91924
91614
  function getItems(context) {
91925
91615
  const { editor, selectedText, trigger: trigger2, clipboardContent } = context;
91926
- const clipboardHasContent = Boolean(
91927
- 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
91928
- );
91929
91616
  const isInTable2 = selectionHasNodeOrMark(editor.view.state, "table", { requireEnds: true });
91930
91617
  const isInSectionNode = selectionHasNodeOrMark(editor.view.state, "documentSection", { requireEnds: true });
91931
91618
  const sections = [
@@ -92062,13 +91749,12 @@ ${style2}
92062
91749
  ]
92063
91750
  }
92064
91751
  ];
92065
- let allSections = applyCustomMenuConfiguration(sections, context);
92066
- const filteredSections = allSections.map((section) => {
91752
+ const filteredSections = sections.map((section) => {
92067
91753
  const filteredItems = section.items.filter((item) => {
92068
91754
  if (item.requiresModule && !isModuleEnabled(editor?.options, item.requiresModule)) return false;
92069
91755
  if (item.requiresSelection && !selectedText) return false;
92070
91756
  if (!item.allowedTriggers.includes(trigger2)) return false;
92071
- if (item.requiresClipboard && !clipboardHasContent) return false;
91757
+ if (item.requiresClipboard && !clipboardContent) return false;
92072
91758
  if (item.requiresTableParent && !isInTable2 || item.id === "insert-table" && isInTable2) return false;
92073
91759
  if (item.requiresSectionParent && !isInSectionNode) return false;
92074
91760
  return true;
@@ -92078,8 +91764,7 @@ ${style2}
92078
91764
  items: filteredItems
92079
91765
  };
92080
91766
  }).filter((section) => section.items.length > 0);
92081
- const finalSections = filterCustomItems(filteredSections, context);
92082
- return finalSections;
91767
+ return filteredSections;
92083
91768
  }
92084
91769
  const _hoisted_1$3$1 = { class: "slash-menu-items" };
92085
91770
  const _hoisted_2$1$1 = {
@@ -92114,7 +91799,6 @@ ${style2}
92114
91799
  const menuRef = ref$1(null);
92115
91800
  const sections = ref$1([]);
92116
91801
  const selectedId = ref$1(null);
92117
- const currentContext = ref$1(null);
92118
91802
  const handleEditorUpdate = () => {
92119
91803
  if (!props.editor?.isEditable && isOpen.value) {
92120
91804
  closeMenu({ restoreCursor: false });
@@ -92160,44 +91844,6 @@ ${style2}
92160
91844
  selectedId.value = newItems[0].id;
92161
91845
  }
92162
91846
  });
92163
- const customItemRefs = /* @__PURE__ */ new Map();
92164
- const setCustomItemRef = (el, item) => {
92165
- if (el && item.render) {
92166
- customItemRefs.set(item.id, { element: el, item });
92167
- nextTick(() => {
92168
- renderCustomItem(item.id);
92169
- });
92170
- }
92171
- };
92172
- const renderCustomItem = async (itemId) => {
92173
- const refData = customItemRefs.get(itemId);
92174
- if (!refData || refData.element.hasCustomContent) return;
92175
- const { element, item } = refData;
92176
- try {
92177
- if (!currentContext.value) {
92178
- currentContext.value = await getEditorContext(props.editor);
92179
- }
92180
- const context = currentContext.value;
92181
- const customElement = item.render(context);
92182
- if (customElement instanceof HTMLElement) {
92183
- element.innerHTML = "";
92184
- element.appendChild(customElement);
92185
- element.hasCustomContent = true;
92186
- }
92187
- } catch (error) {
92188
- console.warn(`[SlashMenu] Error rendering custom item ${itemId}:`, error);
92189
- element.innerHTML = `<span>${item.label || "Custom Item"}</span>`;
92190
- element.hasCustomContent = true;
92191
- }
92192
- };
92193
- const cleanupCustomItems = () => {
92194
- customItemRefs.forEach((refData) => {
92195
- if (refData.element) {
92196
- refData.element.hasCustomContent = false;
92197
- }
92198
- });
92199
- customItemRefs.clear();
92200
- };
92201
91847
  const handleGlobalKeyDown = (event) => {
92202
91848
  if (event.key === "Escape") {
92203
91849
  event.preventDefault();
@@ -92243,27 +91889,27 @@ ${style2}
92243
91889
  };
92244
91890
  const handleRightClick = async (event) => {
92245
91891
  const readOnly = !props.editor?.isEditable;
92246
- if (readOnly || shouldBypassContextMenu(event)) {
91892
+ const isHoldingCtrl = event.ctrlKey;
91893
+ if (readOnly || isHoldingCtrl) {
92247
91894
  return;
92248
91895
  }
92249
91896
  event.preventDefault();
92250
- const context = await getEditorContext(props.editor, event);
92251
- currentContext.value = context;
92252
- sections.value = getItems({ ...context, trigger: "click" });
92253
- selectedId.value = flattenedItems.value[0]?.id || null;
92254
- searchQuery.value = "";
92255
91897
  props.editor.view.dispatch(
92256
91898
  props.editor.view.state.tr.setMeta(SlashMenuPluginKey, {
92257
91899
  type: "open",
92258
- pos: context?.pos ?? props.editor.view.state.selection.from,
91900
+ pos: props.editor.view.state.selection.from,
92259
91901
  clientX: event.clientX,
92260
91902
  clientY: event.clientY
92261
91903
  })
92262
91904
  );
91905
+ searchQuery.value = "";
91906
+ const context = await getEditorContext(props.editor, event);
91907
+ sections.value = getItems({ ...context, trigger: "click" });
91908
+ selectedId.value = flattenedItems.value[0]?.id || null;
92263
91909
  };
92264
91910
  const executeCommand = async (item) => {
92265
91911
  if (props.editor) {
92266
- item.action ? await item.action(props.editor, currentContext.value) : null;
91912
+ item.action ? await item.action(props.editor) : null;
92267
91913
  if (item.component) {
92268
91914
  menuRef.value;
92269
91915
  const componentProps = getPropsByItemId(item.id, props);
@@ -92281,7 +91927,7 @@ ${style2}
92281
91927
  const closeMenu = (options = { restoreCursor: true }) => {
92282
91928
  if (props.editor?.view) {
92283
91929
  const pluginState = SlashMenuPluginKey.getState(props.editor.view.state);
92284
- const anchorPos = pluginState?.anchorPos;
91930
+ const { anchorPos } = pluginState;
92285
91931
  props.editor.view.dispatch(
92286
91932
  props.editor.view.state.tr.setMeta(SlashMenuPluginKey, {
92287
91933
  type: "close"
@@ -92294,8 +91940,6 @@ ${style2}
92294
91940
  props.editor.view.dispatch(tr);
92295
91941
  props.editor.view.focus();
92296
91942
  }
92297
- cleanupCustomItems();
92298
- currentContext.value = null;
92299
91943
  isOpen.value = false;
92300
91944
  searchQuery.value = "";
92301
91945
  sections.value = [];
@@ -92312,29 +91956,19 @@ ${style2}
92312
91956
  isOpen.value = true;
92313
91957
  menuPosition.value = event.menuPosition;
92314
91958
  searchQuery.value = "";
92315
- if (!currentContext.value) {
92316
- const context = await getEditorContext(props.editor);
92317
- currentContext.value = context;
92318
- sections.value = getItems({ ...context, trigger: "slash" });
92319
- selectedId.value = flattenedItems.value[0]?.id || null;
92320
- } else if (sections.value.length === 0) {
92321
- const trigger2 = currentContext.value.event?.type === "contextmenu" ? "click" : "slash";
92322
- sections.value = getItems({ ...currentContext.value, trigger: trigger2 });
92323
- selectedId.value = flattenedItems.value[0]?.id || null;
92324
- }
91959
+ const context = await getEditorContext(props.editor);
91960
+ sections.value = getItems({ ...context, trigger: "slash" });
91961
+ selectedId.value = flattenedItems.value[0]?.id || null;
92325
91962
  });
92326
91963
  props.editor.view.dom.addEventListener("contextmenu", handleRightClick);
92327
91964
  props.editor.on("slashMenu:close", () => {
92328
- cleanupCustomItems();
92329
91965
  isOpen.value = false;
92330
91966
  searchQuery.value = "";
92331
- currentContext.value = null;
92332
91967
  });
92333
91968
  });
92334
91969
  onBeforeUnmount(() => {
92335
91970
  document.removeEventListener("keydown", handleGlobalKeyDown);
92336
91971
  document.removeEventListener("mousedown", handleGlobalOutsideClick);
92337
- cleanupCustomItems();
92338
91972
  if (props.editor) {
92339
91973
  try {
92340
91974
  props.editor.off("slashMenu:open");
@@ -92381,19 +92015,12 @@ ${style2}
92381
92015
  class: normalizeClass(["slash-menu-item", { "is-selected": item.id === selectedId.value }]),
92382
92016
  onClick: ($event) => executeCommand(item)
92383
92017
  }, [
92384
- item.render ? (openBlock(), createElementBlock("div", {
92018
+ item.icon ? (openBlock(), createElementBlock("span", {
92385
92019
  key: 0,
92386
- ref_for: true,
92387
- ref: (el) => setCustomItemRef(el, item),
92388
- class: "slash-menu-custom-item"
92389
- }, null, 512)) : (openBlock(), createElementBlock(Fragment$1, { key: 1 }, [
92390
- item.icon ? (openBlock(), createElementBlock("span", {
92391
- key: 0,
92392
- class: "slash-menu-item-icon",
92393
- innerHTML: item.icon
92394
- }, null, 8, _hoisted_4$5)) : createCommentVNode("", true),
92395
- createBaseVNode("span", null, toDisplayString(item.label), 1)
92396
- ], 64))
92020
+ class: "slash-menu-item-icon",
92021
+ innerHTML: item.icon
92022
+ }, null, 8, _hoisted_4$5)) : createCommentVNode("", true),
92023
+ createBaseVNode("span", null, toDisplayString(item.label), 1)
92397
92024
  ], 10, _hoisted_3$1$1);
92398
92025
  }), 128))
92399
92026
  ], 64);
@@ -93088,76 +92715,34 @@ ${style2}
93088
92715
  }
93089
92716
  };
93090
92717
  const SuperInput = /* @__PURE__ */ _export_sfc$1(_sfc_main$i, [["__scopeId", "data-v-4d5cff52"]]);
93091
- const additionalHandlers = Object.freeze({
93092
- "mc:AlternateContent": translator,
93093
- "w:b": translator$12,
93094
- "w:bidiVisual": translator$F,
93095
- "w:bookmarkEnd": translator$1,
93096
- "w:bookmarkStart": translator$2,
93097
- "w:bottom": translator$s,
93098
- "w:br": translator$16,
93099
- "w:cantSplit": translator$T,
93100
- "w:cnfStyle": translator$S,
93101
- "w:color": translator$_,
93102
- "w:divId": translator$R,
93103
- "w:drawing": translator$4,
93104
- "w:end": translator$q,
93105
- "w:gridAfter": translator$Q,
93106
- "w:gridBefore": translator$P,
93107
- "w:gridCol": translator$b,
93108
- "w:hidden": translator$O,
93109
- "w:highlight": translator$15,
93110
- "w:hyperlink": translator$7,
93111
- "w:i": translator$11,
93112
- "w:insideH": translator$o,
93113
- "w:insideV": translator$n,
93114
- "w:jc": translator$N,
93115
- "w:left": translator$m,
93116
- "w:p": translator$13,
93117
- "w:r": translator$U,
93118
- "w:rFonts": translator$Z,
93119
- "w:rPr": translator$V,
93120
- "w:rStyle": translator$Y,
93121
- "w:right": translator$k,
93122
- "w:sdt": translator$3,
93123
- "w:shd": translator$E,
93124
- "w:start": translator$i,
93125
- "w:strike": translator$$,
93126
- "w:sz": translator$X,
93127
- "w:szCs": translator$W,
93128
- "w:tab": translator$14,
93129
- "w:tbl": translator$9,
93130
- "w:tblBorders": translator$e,
93131
- "w:tblCaption": translator$D,
93132
- "w:tblCellMar": translator$d,
93133
- "w:tblCellSpacing": translator$M,
93134
- "w:tblDescription": translator$C,
93135
- "w:tblGrid": translator$a,
93136
- "w:tblHeader": translator$L,
93137
- "w:tblInd": translator$B,
93138
- "w:tblLayout": translator$A,
93139
- "w:tblLook": translator$z,
93140
- "w:tblOverlap": translator$y,
93141
- "w:tblPr": translator$c,
93142
- "w:tblStyle": translator$x,
93143
- "w:tblStyleColBandSize": translator$w,
93144
- "w:tblStyleRowBandSize": translator$v,
93145
- "w:tblW": translator$u,
93146
- "w:tblpPr": translator$t,
93147
- "w:tc": translator$8,
93148
- "w:top": translator$g,
93149
- "w:tr": translator$G,
93150
- "w:trHeight": translator$K,
93151
- "w:trPr": translator$H,
93152
- "w:u": translator$10,
93153
- "w:wAfter": translator$J,
93154
- "w:wBefore": translator$I,
93155
- "wp:anchor": translator$6,
93156
- "wp:inline": translator$5
93157
- });
93158
92718
  const baseHandlers = {
93159
92719
  ...runPropertyTranslators,
93160
- ...additionalHandlers
92720
+ "w:br": translator$15,
92721
+ "w:cantSplit": translator$S,
92722
+ "w:cnfStyle": translator$R,
92723
+ "w:divId": translator$Q,
92724
+ "w:gridAfter": translator$P,
92725
+ "w:gridBefore": translator$O,
92726
+ "w:hidden": translator$N,
92727
+ "w:hyperlink": translator$6,
92728
+ "w:jc": translator$M,
92729
+ "w:p": translator$12,
92730
+ "w:r": translator$T,
92731
+ "w:rPr": translator$U,
92732
+ "w:sdt": translator$2,
92733
+ "w:tab": translator$13,
92734
+ "w:tblCellSpacing": translator$L,
92735
+ "w:tblHeader": translator$K,
92736
+ "w:tc": translator$7,
92737
+ "w:tr": translator$F,
92738
+ "w:trHeight": translator$J,
92739
+ "w:trPr": translator$G,
92740
+ "w:wAfter": translator$I,
92741
+ "w:wBefore": translator$H,
92742
+ "wp:anchor": translator$5,
92743
+ "wp:inline": translator$4,
92744
+ "w:bookmarkStart": translator$1,
92745
+ "w:bookmarkEnd": translator
93161
92746
  };
93162
92747
  const registeredHandlers = Object.freeze(baseHandlers);
93163
92748
  const Extensions = {
@@ -109997,7 +109582,6 @@ ${style2}
109997
109582
  annotations: proxy.$superdoc.config.annotations,
109998
109583
  isCommentsEnabled: proxy.$superdoc.config.modules?.comments,
109999
109584
  isAiEnabled: proxy.$superdoc.config.modules?.ai,
110000
- slashMenuConfig: proxy.$superdoc.config.modules?.slashMenu,
110001
109585
  onBeforeCreate: onEditorBeforeCreate,
110002
109586
  onCreate: onEditorCreate,
110003
109587
  onDestroy: onEditorDestroy,
@@ -110359,7 +109943,7 @@ ${style2}
110359
109943
  };
110360
109944
  }
110361
109945
  };
110362
- const App = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["__scopeId", "data-v-dbfba5b9"]]);
109946
+ const App = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["__scopeId", "data-v-07532c12"]]);
110363
109947
  const createSuperdocVueApp = () => {
110364
109948
  const app = createApp(App);
110365
109949
  const pinia = createPinia();