kordoc 4.24.21 → 4.24.23

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 (127) hide show
  1. package/README.md +7 -7
  2. package/dist/{-IS4RXPEZ.js → -POV3PVKW.js} +11 -11
  3. package/dist/{chunk-3RVASM4C.js → chunk-2NINEUJ5.js} +4 -4
  4. package/dist/{chunk-MMZUWRH6.js → chunk-2Q4ZLQQJ.js} +11 -11
  5. package/dist/{chunk-BV2YG7M6.js → chunk-2S4WERRK.js} +2 -2
  6. package/dist/{chunk-PDOWSDNM.js → chunk-2UNY7AKC.js} +2 -2
  7. package/dist/{chunk-F4GZFIUJ.js → chunk-3QWZCQI6.js} +2 -2
  8. package/dist/{chunk-E6G4B457.js → chunk-5L32QFLQ.js} +2 -2
  9. package/dist/{chunk-MYDHNNPA.js → chunk-6OG6WPA3.js} +43 -8
  10. package/dist/chunk-6OG6WPA3.js.map +1 -0
  11. package/dist/{chunk-NRCG3ASU.js → chunk-7JFJPFME.js} +2 -2
  12. package/dist/{chunk-WVZSTMCZ.cjs → chunk-7OZLM5MR.cjs} +3 -3
  13. package/dist/{chunk-WVZSTMCZ.cjs.map → chunk-7OZLM5MR.cjs.map} +1 -1
  14. package/dist/{chunk-V7S36XCU.cjs → chunk-AABI2ELF.cjs} +3 -3
  15. package/dist/{chunk-V7S36XCU.cjs.map → chunk-AABI2ELF.cjs.map} +1 -1
  16. package/dist/{chunk-O5ZCJEZ4.js → chunk-AXBEO5NB.js} +2 -2
  17. package/dist/{chunk-L556KKBU.cjs → chunk-HJ5YI5E6.cjs} +79 -79
  18. package/dist/{chunk-L556KKBU.cjs.map → chunk-HJ5YI5E6.cjs.map} +1 -1
  19. package/dist/{chunk-B3POEH7X.js → chunk-JDDKQD7W.js} +2 -2
  20. package/dist/{chunk-IZN5BTCW.js → chunk-NBETHWJH.js} +2 -2
  21. package/dist/{chunk-4OF7DHIT.js → chunk-NRPLZ4NO.js} +4 -4
  22. package/dist/{chunk-F6OHQLN7.js → chunk-NWNL5YYK.js} +38 -7
  23. package/dist/chunk-NWNL5YYK.js.map +1 -0
  24. package/dist/{chunk-NE75RO62.js → chunk-PG7OI72B.js} +2 -2
  25. package/dist/{chunk-BNEKESI4.js → chunk-QMAWEM4N.js} +2 -2
  26. package/dist/{chunk-MGCIQ43Y.js → chunk-SLS65M44.js} +3 -3
  27. package/dist/{chunk-BTBFKDPH.js → chunk-SYJZYHBB.js} +2 -2
  28. package/dist/{chunk-B5M676H3.cjs → chunk-T7Z554HT.cjs} +6 -6
  29. package/dist/{chunk-B5M676H3.cjs.map → chunk-T7Z554HT.cjs.map} +1 -1
  30. package/dist/{chunk-BUFGW3UJ.cjs → chunk-TBGNGQ2O.cjs} +213 -182
  31. package/dist/chunk-TBGNGQ2O.cjs.map +1 -0
  32. package/dist/{chunk-CPVXUEKF.js → chunk-VK3ZZLT7.js} +2 -2
  33. package/dist/{chunk-N45RCYBL.js → chunk-VK6S3WGD.js} +3 -3
  34. package/dist/{chunk-Z6ONQ63K.js → chunk-VOLDBZDF.js} +2 -2
  35. package/dist/{chunk-WQC4XWVT.js → chunk-WTFXQGND.js} +2 -2
  36. package/dist/{chunk-BMXWY36E.js → chunk-XEYTPWCF.js} +39 -8
  37. package/dist/chunk-XEYTPWCF.js.map +1 -0
  38. package/dist/{chunk-UNYH6MTO.js → chunk-XLVQUVL4.js} +2 -2
  39. package/dist/{chunk-OMGCVZ4W.cjs → chunk-YOLFNCQQ.cjs} +2 -2
  40. package/dist/{chunk-OMGCVZ4W.cjs.map → chunk-YOLFNCQQ.cjs.map} +1 -1
  41. package/dist/chunks-SGEDTBKI.js +10 -0
  42. package/dist/cli.js +30 -30
  43. package/dist/{formula-DHBBWQLC.js → formula-7YKP7MFB.js} +3 -3
  44. package/dist/{formula-G3FQTUOY.cjs → formula-IIPZAHPY.cjs} +9 -9
  45. package/dist/{formula-G3FQTUOY.cjs.map → formula-IIPZAHPY.cjs.map} +1 -1
  46. package/dist/{formula-I4EA7ULD.js → formula-TI6JRF6D.js} +4 -4
  47. package/dist/{image-ocr-THUO6YRG.cjs → image-ocr-4FIFSQ5E.cjs} +17 -17
  48. package/dist/{image-ocr-THUO6YRG.cjs.map → image-ocr-4FIFSQ5E.cjs.map} +1 -1
  49. package/dist/{image-ocr-QUVBGNWD.js → image-ocr-JQ65V7NG.js} +9 -9
  50. package/dist/{image-ocr-5YWVBRY6.js → image-ocr-Q7ZPUDKM.js} +6 -6
  51. package/dist/index.cjs +463 -428
  52. package/dist/index.cjs.map +1 -1
  53. package/dist/index.js +43 -8
  54. package/dist/index.js.map +1 -1
  55. package/dist/mcp.js +23 -23
  56. package/dist/{model-bundle-6RG5PO3R.js → model-bundle-RHZIWRK3.js} +5 -5
  57. package/dist/{models-CGYIGN6D.js → models-IX2U5E2X.js} +5 -5
  58. package/dist/{parse-worker-v2-F5NXYBU6.js → parse-worker-v2-WH2ZU73A.js} +12 -12
  59. package/dist/{parser-GJ4PKW7I.cjs → parser-HZI6SSX5.cjs} +172 -161
  60. package/dist/parser-HZI6SSX5.cjs.map +1 -0
  61. package/dist/{parser-G5QTRKII.js → parser-OSH4JPYU.js} +22 -11
  62. package/dist/parser-OSH4JPYU.js.map +1 -0
  63. package/dist/{parser-I2C5DUXC.js → parser-U2WRX53G.js} +25 -14
  64. package/dist/parser-U2WRX53G.js.map +1 -0
  65. package/dist/{pdf-ocr-U3I74Q4O.js → pdf-ocr-HUQ2RFMY.js} +9 -9
  66. package/dist/{pdf-ocr-TNW6YOPX.js → pdf-ocr-NPFRBGWJ.js} +6 -6
  67. package/dist/pdf-ocr-OA57HOVS.cjs +35 -0
  68. package/dist/{pdf-ocr-LJKCUXTE.cjs.map → pdf-ocr-OA57HOVS.cjs.map} +1 -1
  69. package/dist/{profile-io-5YZCFK7B.js → profile-io-MVJHVB5K.js} +3 -3
  70. package/dist/{rasterize-7VRHPOQX.js → rasterize-MBQRUDTT.js} +3 -3
  71. package/dist/{redact-doc-VK6VGBK3.js → redact-doc-Y6DPTTVM.js} +11 -11
  72. package/dist/{render-Y7J6DPRL.js → render-CSVVMX6Y.js} +7 -7
  73. package/dist/seal-Y7I5CXGZ.js +10 -0
  74. package/dist/{setup-4XTUDU4X.js → setup-BU2VPWG4.js} +3 -3
  75. package/dist/visual-OAJU373I.js +21 -0
  76. package/dist/{watch-SPZRLTKG.js → watch-RLLW3NTH.js} +12 -12
  77. package/package.json +1 -1
  78. package/dist/chunk-BMXWY36E.js.map +0 -1
  79. package/dist/chunk-BUFGW3UJ.cjs.map +0 -1
  80. package/dist/chunk-F6OHQLN7.js.map +0 -1
  81. package/dist/chunk-MYDHNNPA.js.map +0 -1
  82. package/dist/chunks-FYCQOIWO.js +0 -10
  83. package/dist/parser-G5QTRKII.js.map +0 -1
  84. package/dist/parser-GJ4PKW7I.cjs.map +0 -1
  85. package/dist/parser-I2C5DUXC.js.map +0 -1
  86. package/dist/pdf-ocr-LJKCUXTE.cjs +0 -35
  87. package/dist/seal-4QIZ3ZNI.js +0 -10
  88. package/dist/visual-VEMQJ52W.js +0 -21
  89. /package/dist/{-IS4RXPEZ.js.map → -POV3PVKW.js.map} +0 -0
  90. /package/dist/{chunk-3RVASM4C.js.map → chunk-2NINEUJ5.js.map} +0 -0
  91. /package/dist/{chunk-MMZUWRH6.js.map → chunk-2Q4ZLQQJ.js.map} +0 -0
  92. /package/dist/{chunk-BV2YG7M6.js.map → chunk-2S4WERRK.js.map} +0 -0
  93. /package/dist/{chunk-PDOWSDNM.js.map → chunk-2UNY7AKC.js.map} +0 -0
  94. /package/dist/{chunk-F4GZFIUJ.js.map → chunk-3QWZCQI6.js.map} +0 -0
  95. /package/dist/{chunk-E6G4B457.js.map → chunk-5L32QFLQ.js.map} +0 -0
  96. /package/dist/{chunk-NRCG3ASU.js.map → chunk-7JFJPFME.js.map} +0 -0
  97. /package/dist/{chunk-O5ZCJEZ4.js.map → chunk-AXBEO5NB.js.map} +0 -0
  98. /package/dist/{chunk-B3POEH7X.js.map → chunk-JDDKQD7W.js.map} +0 -0
  99. /package/dist/{chunk-IZN5BTCW.js.map → chunk-NBETHWJH.js.map} +0 -0
  100. /package/dist/{chunk-4OF7DHIT.js.map → chunk-NRPLZ4NO.js.map} +0 -0
  101. /package/dist/{chunk-NE75RO62.js.map → chunk-PG7OI72B.js.map} +0 -0
  102. /package/dist/{chunk-BNEKESI4.js.map → chunk-QMAWEM4N.js.map} +0 -0
  103. /package/dist/{chunk-MGCIQ43Y.js.map → chunk-SLS65M44.js.map} +0 -0
  104. /package/dist/{chunk-BTBFKDPH.js.map → chunk-SYJZYHBB.js.map} +0 -0
  105. /package/dist/{chunk-CPVXUEKF.js.map → chunk-VK3ZZLT7.js.map} +0 -0
  106. /package/dist/{chunk-N45RCYBL.js.map → chunk-VK6S3WGD.js.map} +0 -0
  107. /package/dist/{chunk-Z6ONQ63K.js.map → chunk-VOLDBZDF.js.map} +0 -0
  108. /package/dist/{chunk-WQC4XWVT.js.map → chunk-WTFXQGND.js.map} +0 -0
  109. /package/dist/{chunk-UNYH6MTO.js.map → chunk-XLVQUVL4.js.map} +0 -0
  110. /package/dist/{chunks-FYCQOIWO.js.map → chunks-SGEDTBKI.js.map} +0 -0
  111. /package/dist/{formula-DHBBWQLC.js.map → formula-7YKP7MFB.js.map} +0 -0
  112. /package/dist/{formula-I4EA7ULD.js.map → formula-TI6JRF6D.js.map} +0 -0
  113. /package/dist/{image-ocr-QUVBGNWD.js.map → image-ocr-JQ65V7NG.js.map} +0 -0
  114. /package/dist/{image-ocr-5YWVBRY6.js.map → image-ocr-Q7ZPUDKM.js.map} +0 -0
  115. /package/dist/{model-bundle-6RG5PO3R.js.map → model-bundle-RHZIWRK3.js.map} +0 -0
  116. /package/dist/{models-CGYIGN6D.js.map → models-IX2U5E2X.js.map} +0 -0
  117. /package/dist/{parse-worker-v2-F5NXYBU6.js.map → parse-worker-v2-WH2ZU73A.js.map} +0 -0
  118. /package/dist/{pdf-ocr-TNW6YOPX.js.map → pdf-ocr-HUQ2RFMY.js.map} +0 -0
  119. /package/dist/{pdf-ocr-U3I74Q4O.js.map → pdf-ocr-NPFRBGWJ.js.map} +0 -0
  120. /package/dist/{profile-io-5YZCFK7B.js.map → profile-io-MVJHVB5K.js.map} +0 -0
  121. /package/dist/{rasterize-7VRHPOQX.js.map → rasterize-MBQRUDTT.js.map} +0 -0
  122. /package/dist/{redact-doc-VK6VGBK3.js.map → redact-doc-Y6DPTTVM.js.map} +0 -0
  123. /package/dist/{render-Y7J6DPRL.js.map → render-CSVVMX6Y.js.map} +0 -0
  124. /package/dist/{seal-4QIZ3ZNI.js.map → seal-Y7I5CXGZ.js.map} +0 -0
  125. /package/dist/{setup-4XTUDU4X.js.map → setup-BU2VPWG4.js.map} +0 -0
  126. /package/dist/{visual-VEMQJ52W.js.map → visual-OAJU373I.js.map} +0 -0
  127. /package/dist/{watch-SPZRLTKG.js.map → watch-RLLW3NTH.js.map} +0 -0
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  blocksToPages
4
- } from "./chunk-BTBFKDPH.js";
4
+ } from "./chunk-SYJZYHBB.js";
5
5
  import {
6
6
  encodePng
7
7
  } from "./chunk-VKVDMH7X.js";
@@ -62,7 +62,7 @@ import {
62
62
  stripAbsorbedRunningLines,
63
63
  trimTrailingEmptyTableCols,
64
64
  wrapJoiner
65
- } from "./chunk-F6OHQLN7.js";
65
+ } from "./chunk-NWNL5YYK.js";
66
66
  import {
67
67
  validateOcrOptions
68
68
  } from "./chunk-IQJKLIJV.js";
@@ -75,7 +75,7 @@ import {
75
75
  stripScriptTags,
76
76
  toTex,
77
77
  unframeLayoutTables
78
- } from "./chunk-F4GZFIUJ.js";
78
+ } from "./chunk-3QWZCQI6.js";
79
79
  import {
80
80
  WINGDINGS,
81
81
  assignTableIds,
@@ -84,17 +84,17 @@ import {
84
84
  escapeLiteralDollar,
85
85
  mapPuaText,
86
86
  pairedNumber
87
- } from "./chunk-B3POEH7X.js";
87
+ } from "./chunk-JDDKQD7W.js";
88
88
  import {
89
89
  ocrModelsCached,
90
90
  resolveOcrModels
91
- } from "./chunk-E6G4B457.js";
92
- import "./chunk-O5ZCJEZ4.js";
93
- import "./chunk-BV2YG7M6.js";
91
+ } from "./chunk-5L32QFLQ.js";
92
+ import "./chunk-AXBEO5NB.js";
93
+ import "./chunk-2S4WERRK.js";
94
94
  import {
95
95
  KordocError,
96
96
  sanitizeHref
97
- } from "./chunk-WQC4XWVT.js";
97
+ } from "./chunk-WTFXQGND.js";
98
98
 
99
99
  // src/pdf/image-extract.ts
100
100
  import { createHash } from "crypto";
@@ -1512,6 +1512,17 @@ function mergeSplitRow(table, owner, first, colXs, textOnly = false, cut = NO_CU
1512
1512
  const last = first - 1;
1513
1513
  const pairs = [];
1514
1514
  let carried = false;
1515
+ const starts = [];
1516
+ for (let c = 0; c < table.cols; ) {
1517
+ const b = owner[first][c];
1518
+ if (b && b.r === first) starts.push(b);
1519
+ c = b ? b.c + b.cs : c + 1;
1520
+ }
1521
+ const tall = starts.filter((b) => b.rs > 1 && hasContent(b.cell));
1522
+ const band = !textOnly && tall.length > 0 && starts.every((b) => b.rs > 1 || !hasContent(b.cell)) && tall.every((b) => {
1523
+ const a = owner[last][b.c];
1524
+ return !!a && a.rs > 1 && a.c === b.c && a.cs === b.cs && a.r + a.rs - 1 === last && hasContent(a.cell);
1525
+ });
1515
1526
  for (let c = 0; c < table.cols; ) {
1516
1527
  const a = owner[last][c], b = owner[first][c];
1517
1528
  if (!a && !b) {
@@ -1522,7 +1533,7 @@ function mergeSplitRow(table, owner, first, colXs, textOnly = false, cut = NO_CU
1522
1533
  if (!a || !b) return false;
1523
1534
  if (a !== b) {
1524
1535
  if (a.c !== b.c || a.cs !== b.cs || a.r + a.rs - 1 !== last || b.r !== first) return false;
1525
- if (b.rs > 1 && (a.rs > 1 || !hasContent(a.cell))) return false;
1536
+ if (b.rs > 1 && (a.rs > 1 || !hasContent(a.cell)) && !band) return false;
1526
1537
  pairs.push([a, b]);
1527
1538
  } else if (a.r === last && a.rs === 2) carried = true;
1528
1539
  c = a.c + a.cs;
@@ -1541,7 +1552,7 @@ function mergeSplitRow(table, owner, first, colXs, textOnly = false, cut = NO_CU
1541
1552
  if (cut.ruled && matchesIndependentRowPair(table, owner, first)) return false;
1542
1553
  const contentPairs = pairs.filter(([u, d]) => hasContent(u.cell) && hasContent(d.cell));
1543
1554
  const carriedSplit = !textOnly && carried && !newCell && (contentPairs.length <= 1 || contentPairs.every(([, d]) => d.rs > 1) || !cut.ruled && contentPairs.some(([u, d]) => wordOverflows(cell(u), cell(d), colXs[u.c], colXs[u.c + u.cs])));
1544
- if (!carriedSplit) {
1555
+ if (!carriedSplit && !band) {
1545
1556
  const norm = (c) => flowText(c.text).replace(/\s+/g, "");
1546
1557
  if (pairs.some(([u, d]) => hasContent(d.cell) && norm(cell(d)) !== norm(cell(u)) && lineEnded(cell(u), colXs[u.c], colXs[u.c + u.cs], cell(d)))) return false;
1547
1558
  const oneLine = (c) => CELL_LINES.get(c)?.length === 1;
@@ -4147,7 +4158,7 @@ function mergeLinkRuns(markdown) {
4147
4158
 
4148
4159
  // src/pdf/formula-ocr.ts
4149
4160
  async function applyFormulaOcr(buffer, blocks, pageFilter, effectivePageCount, warnings, _onProgress) {
4150
- const formulaMod = await import("./formula-I4EA7ULD.js");
4161
+ const formulaMod = await import("./formula-TI6JRF6D.js");
4151
4162
  const { FormulaPipeline, ensureFormulaModels } = formulaMod;
4152
4163
  await ensureFormulaModels((p) => {
4153
4164
  if (p.phase === "download" && p.total) {
@@ -4577,10 +4588,10 @@ async function parsePdfDocument(buffer, options) {
4577
4588
  }
4578
4589
  if (targets.size > 0) {
4579
4590
  try {
4580
- const { runPdfOcr } = await import("./pdf-ocr-U3I74Q4O.js");
4591
+ const { runPdfOcr } = await import("./pdf-ocr-HUQ2RFMY.js");
4581
4592
  const mode = typeof options?.ocr === "function" ? options.ocr : "builtin";
4582
4593
  const regionPages = new Map([...ocrRegions].filter(([p]) => options?.ocr !== "force" && !isImageBased && !pageQuality.find((q) => q.page === p)?.needsOcr));
4583
- const { builtinOcrConfig } = await import("./pdf-ocr-U3I74Q4O.js");
4594
+ const { builtinOcrConfig } = await import("./pdf-ocr-HUQ2RFMY.js");
4584
4595
  const ocrPageBlocks = await runPdfOcr(ocrBuffer, targets, mode, warnings, options?.onProgress, options?.tables !== false, vectorPageOps, regionPages, builtinOcrConfig(options), ocrLinesOut);
4585
4596
  for (const obs of ocrPageBlocks.values()) stripScriptTags({ blocks: obs });
4586
4597
  if (ocrPageBlocks.size > 0) {
@@ -4825,4 +4836,4 @@ export {
4825
4836
  parsePdfDocument,
4826
4837
  removeHeaderFooterBlocks
4827
4838
  };
4828
- //# sourceMappingURL=parser-I2C5DUXC.js.map
4839
+ //# sourceMappingURL=parser-U2WRX53G.js.map