@beyondwork/docx-react-component 1.0.129 → 1.0.130

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 (102) hide show
  1. package/dist/api/public-types.cjs +595 -18
  2. package/dist/api/public-types.d.cts +1 -1
  3. package/dist/api/public-types.d.ts +1 -1
  4. package/dist/api/public-types.js +4 -4
  5. package/dist/api/v3.cjs +1164 -332
  6. package/dist/api/v3.d.cts +2 -2
  7. package/dist/api/v3.d.ts +2 -2
  8. package/dist/api/v3.js +13 -13
  9. package/dist/{chunk-OTQIW2TC.js → chunk-35RHOE6I.js} +105 -4
  10. package/dist/{chunk-PGKUJZXV.js → chunk-3YCQM2RV.js} +6 -6
  11. package/dist/{chunk-JJGVE5J7.js → chunk-4YCWECLZ.js} +1 -1
  12. package/dist/{chunk-EZKJXIPH.js → chunk-6TBLDBCL.js} +1 -1
  13. package/dist/{chunk-SKPTKQHF.js → chunk-7G5GR3VV.js} +122 -23
  14. package/dist/{chunk-HUIHBBAQ.js → chunk-A3GSNB4G.js} +17 -6
  15. package/dist/{chunk-5DGKFNQT.js → chunk-A66ZVUAT.js} +150 -1
  16. package/dist/{chunk-YIYM4ZAP.js → chunk-CI2TD3T4.js} +1 -1
  17. package/dist/{chunk-63FYIGCT.js → chunk-DGA7M77X.js} +2 -2
  18. package/dist/{chunk-EB6M3GE6.js → chunk-FM4K4XFJ.js} +100 -97
  19. package/dist/{chunk-VNLDQJ47.js → chunk-HYHCRMR7.js} +1 -1
  20. package/dist/{chunk-DJU2W4E4.js → chunk-KNHMXKC6.js} +2 -2
  21. package/dist/{chunk-Q3QYGKFE.js → chunk-M7YRJX6V.js} +10 -21
  22. package/dist/{chunk-KFCQYZXR.js → chunk-OVLZQ6FZ.js} +61 -0
  23. package/dist/{chunk-W34X3KBR.js → chunk-PHMWH23E.js} +1 -1
  24. package/dist/{chunk-DDN2AIGE.js → chunk-Q7Y57KOK.js} +2 -2
  25. package/dist/{chunk-LJH64PV3.js → chunk-QXKQPUOM.js} +3 -3
  26. package/dist/{chunk-CX42VC67.js → chunk-SYQWQ6FE.js} +1 -1
  27. package/dist/{chunk-5DSHUYSY.js → chunk-T5YYFDZB.js} +1 -1
  28. package/dist/{chunk-RMRTQGW3.js → chunk-THVM6EP5.js} +371 -13
  29. package/dist/{chunk-XMHSGPLN.js → chunk-VRKK2CSZ.js} +111 -90
  30. package/dist/{chunk-OL2UEHRP.js → chunk-WUDSNHWF.js} +1 -1
  31. package/dist/{chunk-XQCAMKIQ.js → chunk-WZDKNF37.js} +250 -106
  32. package/dist/{chunk-PRAZBHNF.js → chunk-YLL7MF5C.js} +15 -15
  33. package/dist/{chunk-YZDZ4FGR.js → chunk-ZVC23LKV.js} +1 -1
  34. package/dist/compare.cjs +100 -97
  35. package/dist/compare.js +3 -3
  36. package/dist/core/commands/formatting-commands.d.cts +1 -1
  37. package/dist/core/commands/formatting-commands.d.ts +1 -1
  38. package/dist/core/commands/image-commands.cjs +16 -5
  39. package/dist/core/commands/image-commands.d.cts +1 -1
  40. package/dist/core/commands/image-commands.d.ts +1 -1
  41. package/dist/core/commands/image-commands.js +5 -5
  42. package/dist/core/commands/section-layout-commands.d.cts +1 -1
  43. package/dist/core/commands/section-layout-commands.d.ts +1 -1
  44. package/dist/core/commands/style-commands.d.cts +1 -1
  45. package/dist/core/commands/style-commands.d.ts +1 -1
  46. package/dist/core/commands/table-structure-commands.cjs +16 -5
  47. package/dist/core/commands/table-structure-commands.d.cts +1 -1
  48. package/dist/core/commands/table-structure-commands.d.ts +1 -1
  49. package/dist/core/commands/table-structure-commands.js +4 -4
  50. package/dist/core/commands/text-commands.cjs +16 -5
  51. package/dist/core/commands/text-commands.d.cts +1 -1
  52. package/dist/core/commands/text-commands.d.ts +1 -1
  53. package/dist/core/commands/text-commands.js +5 -5
  54. package/dist/core/selection/mapping.d.cts +1 -1
  55. package/dist/core/selection/mapping.d.ts +1 -1
  56. package/dist/core/state/editor-state.d.cts +1 -1
  57. package/dist/core/state/editor-state.d.ts +1 -1
  58. package/dist/index.cjs +1280 -347
  59. package/dist/index.d.cts +4 -4
  60. package/dist/index.d.ts +4 -4
  61. package/dist/index.js +24 -24
  62. package/dist/io/docx-session.cjs +216 -203
  63. package/dist/io/docx-session.d.cts +3 -3
  64. package/dist/io/docx-session.d.ts +3 -3
  65. package/dist/io/docx-session.js +6 -6
  66. package/dist/legal.cjs +9 -20
  67. package/dist/legal.js +3 -3
  68. package/dist/{loader-4qsw4eIU.d.ts → loader-B-aL5HGD.d.ts} +2 -2
  69. package/dist/{loader-B8TKhmQi.d.cts → loader-DiY_ZgKl.d.cts} +2 -2
  70. package/dist/{measurement-backend-canvas-Q3MJMEYX.js → measurement-backend-canvas-F7ZYDACK.js} +1 -1
  71. package/dist/{public-types-p9b8rfy8.d.ts → public-types-DyqnxxO9.d.ts} +124 -1
  72. package/dist/{public-types-B5CRoR6f.d.cts → public-types-gvubspUI.d.cts} +124 -1
  73. package/dist/public-types.cjs +595 -18
  74. package/dist/public-types.d.cts +1 -1
  75. package/dist/public-types.d.ts +1 -1
  76. package/dist/public-types.js +4 -4
  77. package/dist/runtime/collab.d.cts +2 -2
  78. package/dist/runtime/collab.d.ts +2 -2
  79. package/dist/runtime/document-runtime.cjs +908 -129
  80. package/dist/runtime/document-runtime.d.cts +1 -1
  81. package/dist/runtime/document-runtime.d.ts +1 -1
  82. package/dist/runtime/document-runtime.js +17 -17
  83. package/dist/{session-BnGIjaex.d.cts → session-BUN6B-Vj.d.cts} +2 -2
  84. package/dist/{session-vEYKf-w3.d.ts → session-CDB0hohT.d.ts} +2 -2
  85. package/dist/session.cjs +216 -203
  86. package/dist/session.d.cts +4 -4
  87. package/dist/session.d.ts +4 -4
  88. package/dist/session.js +7 -7
  89. package/dist/tailwind.cjs +595 -18
  90. package/dist/tailwind.d.cts +1 -1
  91. package/dist/tailwind.d.ts +1 -1
  92. package/dist/tailwind.js +8 -8
  93. package/dist/{types-BLuvZ6cQ.d.cts → types-C4bz3kDU.d.cts} +1 -1
  94. package/dist/{types-Dutlyj0T.d.ts → types-VWH6CRvG.d.ts} +1 -1
  95. package/dist/ui-tailwind/editor-surface/search-plugin.d.cts +2 -2
  96. package/dist/ui-tailwind/editor-surface/search-plugin.d.ts +2 -2
  97. package/dist/ui-tailwind/editor-surface/search-plugin.js +5 -5
  98. package/dist/ui-tailwind.cjs +595 -18
  99. package/dist/ui-tailwind.d.cts +2 -2
  100. package/dist/ui-tailwind.d.ts +2 -2
  101. package/dist/ui-tailwind.js +8 -8
  102. package/package.json +1 -1
@@ -8,7 +8,7 @@ import {
8
8
  getRevisionActionability,
9
9
  normalizeParsedTextDocument,
10
10
  normalizeParsedTextDocumentAsync
11
- } from "./chunk-JJGVE5J7.js";
11
+ } from "./chunk-4YCWECLZ.js";
12
12
  import {
13
13
  OLE_RELATIONSHIP_TYPES,
14
14
  buildFieldRegistry,
@@ -59,7 +59,7 @@ import {
59
59
  resolveHighlightColor,
60
60
  setActiveParseTelemetryBus,
61
61
  toCanonicalNumberingInstanceId
62
- } from "./chunk-Q3QYGKFE.js";
62
+ } from "./chunk-M7YRJX6V.js";
63
63
  import {
64
64
  createPersistedSourcePackage,
65
65
  decodeBytesBase64,
@@ -81,7 +81,7 @@ import {
81
81
  serializeRuntimeRevisionsIntoDocumentXml,
82
82
  serializeRuntimeRevisionsIntoStoryXml,
83
83
  splitDocumentAtReviewBoundaries
84
- } from "./chunk-OL2UEHRP.js";
84
+ } from "./chunk-WUDSNHWF.js";
85
85
  import {
86
86
  DOCX_NULL_NUMBERING_INSTANCE_ID,
87
87
  WORD_NUMBERING_CONTENT_TYPE,
@@ -96,7 +96,7 @@ import {
96
96
  serializeTablePropertiesXml,
97
97
  serializeTableRowPropertiesXml,
98
98
  twip
99
- } from "./chunk-EB6M3GE6.js";
99
+ } from "./chunk-FM4K4XFJ.js";
100
100
  import {
101
101
  localName,
102
102
  parseXml,
@@ -1770,6 +1770,13 @@ function buildParagraphPropertiesXml(paragraph) {
1770
1770
  const frameXml = buildFrameXml(paragraph.frameProperties);
1771
1771
  if (frameXml) parts.push(frameXml);
1772
1772
  }
1773
+ if (paragraph.tabStops && paragraph.tabStops.length > 0) {
1774
+ const tabsXml = paragraph.tabStops.map((tab) => {
1775
+ const leaderAttr = tab.leader ? ` w:leader="${escapeXmlAttribute(tab.leader)}"` : "";
1776
+ return `<w:tab w:val="${escapeXmlAttribute(tab.align)}" w:pos="${twip(tab.position)}"${leaderAttr}/>`;
1777
+ }).join("");
1778
+ parts.push(`<w:tabs>${tabsXml}</w:tabs>`);
1779
+ }
1773
1780
  if (paragraph.spacing) {
1774
1781
  const s = paragraph.spacing;
1775
1782
  const attrs = [];
@@ -1791,13 +1798,6 @@ function buildParagraphPropertiesXml(paragraph) {
1791
1798
  if (paragraph.alignment) {
1792
1799
  parts.push(`<w:jc w:val="${escapeXmlAttribute(paragraph.alignment)}"/>`);
1793
1800
  }
1794
- if (paragraph.tabStops && paragraph.tabStops.length > 0) {
1795
- const tabsXml = paragraph.tabStops.map((tab) => {
1796
- const leaderAttr = tab.leader ? ` w:leader="${escapeXmlAttribute(tab.leader)}"` : "";
1797
- return `<w:tab w:val="${tab.align}" w:pos="${twip(tab.position)}"${leaderAttr}/>`;
1798
- }).join("");
1799
- parts.push(`<w:tabs>${tabsXml}</w:tabs>`);
1800
- }
1801
1801
  return parts.length > 0 ? `<w:pPr>${parts.join("")}</w:pPr>` : "";
1802
1802
  }
1803
1803
  function serializeInlineNode(node) {
@@ -1866,51 +1866,60 @@ function buildRunPropertiesXml(marks) {
1866
1866
  if (!marks || marks.length === 0) {
1867
1867
  return "";
1868
1868
  }
1869
+ const orderedTypes = [
1870
+ "fontFamily",
1871
+ "bold",
1872
+ "italic",
1873
+ "allCaps",
1874
+ "smallCaps",
1875
+ "strikethrough",
1876
+ "doubleStrikethrough",
1877
+ "textColor",
1878
+ "fontSize",
1879
+ "highlight",
1880
+ "underline",
1881
+ "backgroundColor"
1882
+ ];
1869
1883
  const parts = [];
1870
- for (const mark of marks) {
1871
- switch (mark.type) {
1872
- case "bold":
1873
- parts.push("<w:b/>");
1874
- break;
1875
- case "italic":
1876
- parts.push("<w:i/>");
1877
- break;
1878
- case "underline":
1879
- parts.push('<w:u w:val="single"/>');
1880
- break;
1881
- case "strikethrough":
1882
- parts.push("<w:strike/>");
1883
- break;
1884
- case "doubleStrikethrough":
1885
- parts.push("<w:dstrike/>");
1886
- break;
1887
- case "fontFamily":
1888
- parts.push(`<w:rFonts w:ascii="${escapeXmlAttribute(mark.val)}" w:hAnsi="${escapeXmlAttribute(mark.val)}"/>`);
1889
- break;
1890
- case "fontSize":
1891
- parts.push(`<w:sz w:val="${twip(mark.val)}"/>`);
1892
- break;
1893
- case "textColor":
1894
- parts.push(`<w:color w:val="${escapeXmlAttribute(mark.color)}"/>`);
1895
- break;
1896
- case "highlight":
1897
- parts.push(`<w:highlight w:val="${escapeXmlAttribute(mark.val)}"/>`);
1898
- break;
1899
- case "backgroundColor":
1900
- parts.push(`<w:shd w:val="clear" w:color="auto" w:fill="${escapeXmlAttribute(mark.color)}"/>`);
1901
- break;
1902
- case "smallCaps":
1903
- parts.push("<w:smallCaps/>");
1904
- break;
1905
- case "allCaps":
1906
- parts.push("<w:caps/>");
1907
- break;
1908
- default:
1909
- break;
1884
+ for (const type of orderedTypes) {
1885
+ for (const mark of marks) {
1886
+ if (mark.type !== type) continue;
1887
+ const xml = serializeRunPropertyMark(mark);
1888
+ if (xml) parts.push(xml);
1910
1889
  }
1911
1890
  }
1912
1891
  return parts.length > 0 ? `<w:rPr>${parts.join("")}</w:rPr>` : "";
1913
1892
  }
1893
+ function serializeRunPropertyMark(mark) {
1894
+ switch (mark.type) {
1895
+ case "bold":
1896
+ return "<w:b/>";
1897
+ case "italic":
1898
+ return "<w:i/>";
1899
+ case "underline":
1900
+ return `<w:u w:val="single"/>`;
1901
+ case "strikethrough":
1902
+ return "<w:strike/>";
1903
+ case "doubleStrikethrough":
1904
+ return "<w:dstrike/>";
1905
+ case "fontFamily":
1906
+ return `<w:rFonts w:ascii="${escapeXmlAttribute(mark.val)}" w:hAnsi="${escapeXmlAttribute(mark.val)}"/>`;
1907
+ case "fontSize":
1908
+ return `<w:sz w:val="${twip(mark.val)}"/>`;
1909
+ case "textColor":
1910
+ return `<w:color w:val="${escapeXmlAttribute(mark.color)}"/>`;
1911
+ case "highlight":
1912
+ return `<w:highlight w:val="${escapeXmlAttribute(mark.val)}"/>`;
1913
+ case "backgroundColor":
1914
+ return `<w:shd w:val="clear" w:color="auto" w:fill="${escapeXmlAttribute(mark.color)}"/>`;
1915
+ case "smallCaps":
1916
+ return "<w:smallCaps/>";
1917
+ case "allCaps":
1918
+ return "<w:caps/>";
1919
+ default:
1920
+ return "";
1921
+ }
1922
+ }
1914
1923
  function requiresPreservedSpace(text) {
1915
1924
  return text.length > 0 && (text[0] === " " || text[text.length - 1] === " " || text.includes(" "));
1916
1925
  }
@@ -2084,9 +2093,6 @@ function buildParagraphPropertiesXml2(paragraph) {
2084
2093
  const frameXml = buildFrameXml(paragraph.frameProperties);
2085
2094
  if (frameXml) parts.push(frameXml);
2086
2095
  }
2087
- if (paragraph.alignment) {
2088
- parts.push(`<w:jc w:val="${escapeXmlAttribute(paragraph.alignment)}"/>`);
2089
- }
2090
2096
  if (paragraph.spacing) {
2091
2097
  const attrs = [];
2092
2098
  if (paragraph.spacing.before !== void 0) attrs.push(`w:before="${twip(paragraph.spacing.before)}"`);
@@ -2107,6 +2113,9 @@ function buildParagraphPropertiesXml2(paragraph) {
2107
2113
  parts.push(`<w:ind ${attrs.join(" ")}/>`);
2108
2114
  }
2109
2115
  }
2116
+ if (paragraph.alignment) {
2117
+ parts.push(`<w:jc w:val="${escapeXmlAttribute(paragraph.alignment)}"/>`);
2118
+ }
2110
2119
  return parts.length > 0 ? `<w:pPr>${parts.join("")}</w:pPr>` : "";
2111
2120
  }
2112
2121
  function serializeInlineNode2(node) {
@@ -2167,47 +2176,59 @@ function buildRunPropertiesXml2(marks) {
2167
2176
  if (!marks || marks.length === 0) {
2168
2177
  return "";
2169
2178
  }
2170
- const parts = [];
2179
+ const orderedTypes = [
2180
+ "fontFamily",
2181
+ "bold",
2182
+ "italic",
2183
+ "allCaps",
2184
+ "smallCaps",
2185
+ "strikethrough",
2186
+ "doubleStrikethrough",
2187
+ "textColor",
2188
+ "fontSize",
2189
+ "underline"
2190
+ ];
2191
+ const supportedTypes = new Set(orderedTypes);
2171
2192
  for (const mark of marks) {
2172
- switch (mark.type) {
2173
- case "bold":
2174
- parts.push("<w:b/>");
2175
- break;
2176
- case "italic":
2177
- parts.push("<w:i/>");
2178
- break;
2179
- case "underline":
2180
- parts.push('<w:u w:val="single"/>');
2181
- break;
2182
- case "strikethrough":
2183
- parts.push("<w:strike/>");
2184
- break;
2185
- case "doubleStrikethrough":
2186
- parts.push("<w:dstrike/>");
2187
- break;
2188
- case "fontFamily":
2189
- parts.push(
2190
- `<w:rFonts w:ascii="${escapeXmlAttribute(mark.val)}" w:hAnsi="${escapeXmlAttribute(mark.val)}"/>`
2191
- );
2192
- break;
2193
- case "fontSize":
2194
- parts.push(`<w:sz w:val="${twip(mark.val)}"/>`);
2195
- break;
2196
- case "textColor":
2197
- parts.push(`<w:color w:val="${escapeXmlAttribute(mark.color)}"/>`);
2198
- break;
2199
- case "smallCaps":
2200
- parts.push("<w:smallCaps/>");
2201
- break;
2202
- case "allCaps":
2203
- parts.push("<w:caps/>");
2204
- break;
2205
- default:
2206
- throw new Error(`Cannot safely serialize ${mark.type} marks in note sub-parts.`);
2193
+ if (!supportedTypes.has(mark.type)) {
2194
+ throw new Error(`Cannot safely serialize ${mark.type} marks in note sub-parts.`);
2195
+ }
2196
+ }
2197
+ const parts = [];
2198
+ for (const type of orderedTypes) {
2199
+ for (const mark of marks) {
2200
+ if (mark.type !== type) continue;
2201
+ parts.push(serializeRunPropertyMark2(mark));
2207
2202
  }
2208
2203
  }
2209
2204
  return parts.length > 0 ? `<w:rPr>${parts.join("")}</w:rPr>` : "";
2210
2205
  }
2206
+ function serializeRunPropertyMark2(mark) {
2207
+ switch (mark.type) {
2208
+ case "bold":
2209
+ return "<w:b/>";
2210
+ case "italic":
2211
+ return "<w:i/>";
2212
+ case "underline":
2213
+ return `<w:u w:val="single"/>`;
2214
+ case "strikethrough":
2215
+ return "<w:strike/>";
2216
+ case "doubleStrikethrough":
2217
+ return "<w:dstrike/>";
2218
+ case "fontFamily":
2219
+ return `<w:rFonts w:ascii="${escapeXmlAttribute(mark.val)}" w:hAnsi="${escapeXmlAttribute(mark.val)}"/>`;
2220
+ case "fontSize":
2221
+ return `<w:sz w:val="${twip(mark.val)}"/>`;
2222
+ case "textColor":
2223
+ return `<w:color w:val="${escapeXmlAttribute(mark.color)}"/>`;
2224
+ case "smallCaps":
2225
+ return "<w:smallCaps/>";
2226
+ case "allCaps":
2227
+ return "<w:caps/>";
2228
+ default:
2229
+ throw new Error(`Cannot safely serialize ${mark.type} marks in note sub-parts.`);
2230
+ }
2231
+ }
2211
2232
  function compareNoteIds(left, right) {
2212
2233
  return Number.parseInt(left.noteId, 10) - Number.parseInt(right.noteId, 10);
2213
2234
  }
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  escapeXmlAttribute
3
- } from "./chunk-EB6M3GE6.js";
3
+ } from "./chunk-FM4K4XFJ.js";
4
4
  import {
5
5
  localName,
6
6
  parseXmlWithOffsets