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,6 +1,6 @@
1
1
  import {
2
2
  blocksToMarkdown
3
- } from "./chunk-PDOWSDNM.js";
3
+ } from "./chunk-2UNY7AKC.js";
4
4
 
5
5
  // src/image/transcode.ts
6
6
  import { deflateSync } from "zlib";
@@ -168,4 +168,4 @@ export {
168
168
  inlineImagesIntoMarkdown,
169
169
  blocksToPages
170
170
  };
171
- //# sourceMappingURL=chunk-CPVXUEKF.js.map
171
+ //# sourceMappingURL=chunk-VK3ZZLT7.js.map
@@ -2,11 +2,11 @@
2
2
  import {
3
3
  parseRenderStyles,
4
4
  readZipEntry
5
- } from "./chunk-IZN5BTCW.js";
5
+ } from "./chunk-NBETHWJH.js";
6
6
  import {
7
7
  KordocError,
8
8
  precheckZipSize
9
- } from "./chunk-WQC4XWVT.js";
9
+ } from "./chunk-WTFXQGND.js";
10
10
 
11
11
  // src/form/seal.ts
12
12
  import JSZip from "jszip";
@@ -1858,4 +1858,4 @@ export {
1858
1858
  patchZipEntries,
1859
1859
  placeSealHwpx
1860
1860
  };
1861
- //# sourceMappingURL=chunk-N45RCYBL.js.map
1861
+ //# sourceMappingURL=chunk-VK6S3WGD.js.map
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  KordocError
4
- } from "./chunk-WQC4XWVT.js";
4
+ } from "./chunk-WTFXQGND.js";
5
5
 
6
6
  // src/hwpx/profile-io.ts
7
7
  import { z } from "zod";
@@ -89,4 +89,4 @@ export {
89
89
  formatProfileSchema,
90
90
  parseFormatProfileJson
91
91
  };
92
- //# sourceMappingURL=chunk-Z6ONQ63K.js.map
92
+ //# sourceMappingURL=chunk-VOLDBZDF.js.map
@@ -2,7 +2,7 @@
2
2
 
3
3
  // src/utils.ts
4
4
  import { format } from "util";
5
- var VERSION = true ? "4.24.21" : "0.0.0-dev";
5
+ var VERSION = true ? "4.24.23" : "0.0.0-dev";
6
6
  function toArrayBuffer(buf) {
7
7
  if (buf.byteOffset === 0 && buf.byteLength === buf.buffer.byteLength) {
8
8
  return buf.buffer;
@@ -172,4 +172,4 @@ export {
172
172
  classifyError,
173
173
  partExtension
174
174
  };
175
- //# sourceMappingURL=chunk-WQC4XWVT.js.map
175
+ //# sourceMappingURL=chunk-WTFXQGND.js.map
@@ -5,15 +5,15 @@ import {
5
5
  HEADING_RATIO_H3,
6
6
  tidyScriptTags,
7
7
  toTex
8
- } from "./chunk-PDOWSDNM.js";
8
+ } from "./chunk-2UNY7AKC.js";
9
9
  import {
10
10
  ensureModelsIn,
11
11
  getModelsDir
12
- } from "./chunk-NE75RO62.js";
12
+ } from "./chunk-PG7OI72B.js";
13
13
  import {
14
14
  safeMax,
15
15
  safeMin
16
- } from "./chunk-UNYH6MTO.js";
16
+ } from "./chunk-XLVQUVL4.js";
17
17
 
18
18
  // src/ocr/models.ts
19
19
  import { join } from "path";
@@ -1216,7 +1216,10 @@ function extractLines(fnArray, argsArray) {
1216
1216
  classifyAndAdd(seg, effWidth, horizontals, verticals, fromFill, fromFill ? void 0 : { h: shortH, v: shortV });
1217
1217
  });
1218
1218
  if (from) outs.forEach((o, k) => {
1219
- for (let n = from[k]; n < o.length; n++) if (white || k < 2 && !thinFill.has(o[n])) nonRules.add(o[n]);
1219
+ for (let n = from[k]; n < o.length; n++) if (white || k < 2 && !thinFill.has(o[n])) {
1220
+ nonRules.add(o[n]);
1221
+ if (white) WHITE_EDGES.add(o[n]);
1222
+ }
1220
1223
  });
1221
1224
  currentPath = [];
1222
1225
  }
@@ -1543,8 +1546,15 @@ function preprocessLines(horizontals, verticals, nonRules) {
1543
1546
  let v = verticals.filter((l) => l.lineWidth <= MAX_LINE_WIDTH);
1544
1547
  h = dropShadingStacks(h, "h");
1545
1548
  v = dropShadingStacks(v, "v");
1546
- h = mergeParallelLines(h, "h", nonRules);
1549
+ h = mergeParallelLines(h, "h", nonRules, v);
1547
1550
  v = mergeParallelLines(v, "v", nonRules);
1551
+ if (nonRules) {
1552
+ const visH = h.filter((l) => !nonRules.has(l)), visV = v.filter((l) => !nonRules.has(l));
1553
+ const crossH = (w) => visV.filter((c) => c.x1 > w.x1 + 1 && c.x1 < w.x2 - 1 && Math.min(c.y1, c.y2) < w.y1 - 2 && Math.max(c.y1, c.y2) > w.y1 + 2).length;
1554
+ const crossV = (w) => visH.filter((c) => c.y1 > Math.min(w.y1, w.y2) + 1 && c.y1 < Math.max(w.y1, w.y2) - 1 && Math.min(c.x1, c.x2) < w.x1 - 2 && Math.max(c.x1, c.x2) > w.x1 + 2).length;
1555
+ h = h.filter((l) => !(WHITE_EDGES.has(l) && nonRules.has(l) && crossH(l) >= 2));
1556
+ v = v.filter((l) => !(WHITE_EDGES.has(l) && nonRules.has(l) && crossV(l) >= 2));
1557
+ }
1548
1558
  return { horizontals: h, verticals: v };
1549
1559
  }
1550
1560
  var STACK_GAP = 2;
@@ -1712,7 +1722,8 @@ function closeOpenTableEdges(horizontals, verticals) {
1712
1722
  }
1713
1723
  return synthesized.length ? [...verticals, ...synthesized] : verticals;
1714
1724
  }
1715
- function mergeParallelLines(lines, dir, nonRules) {
1725
+ var WHITE_EDGES = /* @__PURE__ */ new WeakSet();
1726
+ function mergeParallelLines(lines, dir, nonRules, perp) {
1716
1727
  if (lines.length <= 1) return lines;
1717
1728
  const sorted = [...lines].sort((a, b) => {
1718
1729
  const posA = dir === "h" ? a.y1 : a.x1;
@@ -1735,7 +1746,26 @@ function mergeParallelLines(lines, dir, nonRules) {
1735
1746
  const overlap2 = Math.min(prevEnd, currEnd) - Math.max(prevStart, currStart);
1736
1747
  const minLen = Math.min(prevEnd - prevStart, currEnd - currStart);
1737
1748
  if (overlap2 > minLen * 0.3) {
1738
- if (nonRules?.has(prev) && !nonRules.has(curr)) nonRules.delete(prev);
1749
+ const bgPrev = !!nonRules?.has(prev) && !nonRules.has(curr), bgCurr = !!nonRules?.has(curr) && !nonRules.has(prev);
1750
+ const whPrev = bgPrev && WHITE_EDGES.has(prev), whCurr = bgCurr && WHITE_EDGES.has(curr);
1751
+ if (bgPrev) nonRules.delete(prev);
1752
+ const clip = (w, o) => {
1753
+ if (dir !== "h" || !perp) return false;
1754
+ let n = 0;
1755
+ for (const c of perp) {
1756
+ if (nonRules.has(c) || Math.min(c.y1, c.y2) >= w.y1 - 2 || Math.max(c.y1, c.y2) <= w.y1 + 2) continue;
1757
+ if (c.x1 > w.x1 + 1 && c.x1 < o.x1 - 1 || c.x1 > o.x2 + 1 && c.x1 < w.x2 - 1) n++;
1758
+ }
1759
+ return n >= 2;
1760
+ };
1761
+ if (whPrev && clip(prev, curr)) {
1762
+ prev.x1 = curr.x1;
1763
+ prev.x2 = curr.x2;
1764
+ prev.y1 = prev.y2 = curr.y1;
1765
+ prev.lineWidth = curr.lineWidth;
1766
+ continue;
1767
+ }
1768
+ if (whCurr && clip(curr, prev)) continue;
1739
1769
  if (dir === "h") {
1740
1770
  prev.x1 = Math.min(prev.x1, curr.x1);
1741
1771
  prev.x2 = Math.max(prev.x2, curr.x2);
@@ -8636,6 +8666,7 @@ function headerLineAbove(free, colXs, top) {
8636
8666
  if (baseY - top > fs * MAX_GAP_K) return null;
8637
8667
  const text = [...line].sort((a, b) => a.x - b.x).map((it) => it.text).join(" ").trim();
8638
8668
  if (/^(?:Table|Figure|Fig\.|Chart|Exhibit|Diagram|Source|Note|<?표|<?그림)\s*[\dIVX]/i.test(text)) return null;
8669
+ if (/\(단위[::]/.test(text.replace(/\s+/g, ""))) return null;
8639
8670
  if (line.some((it) => it.seq === void 0 || it.x < x1 - EDGE_TOL || it.x + it.w > x2 + EDGE_TOL)) return null;
8640
8671
  if (above.some((it) => !line.includes(it) && Math.abs(it.y - baseY) <= fs * 0.5)) return null;
8641
8672
  const cols = colXs.slice(1).map(() => []);
@@ -10510,4 +10541,4 @@ export {
10510
10541
  UNRULED_REGION_TABLES,
10511
10542
  mergeOcrImageRegions
10512
10543
  };
10513
- //# sourceMappingURL=chunk-BMXWY36E.js.map
10544
+ //# sourceMappingURL=chunk-XEYTPWCF.js.map