kordoc 4.18.11 → 4.18.13

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 (119) hide show
  1. package/README.md +2 -1
  2. package/dist/{-TUDCOQX6.js → -DC2OO5KO.js} +11 -11
  3. package/dist/{chunk-PF4O626Y.js → chunk-32ZUIHSY.js} +3 -3
  4. package/dist/{chunk-Q5GB73E7.cjs → chunk-3FGHQWJP.cjs} +151 -130
  5. package/dist/chunk-3FGHQWJP.cjs.map +1 -0
  6. package/dist/{chunk-GNXDTPP6.js → chunk-6AYTYTFY.js} +3 -3
  7. package/dist/{chunk-DT5OWHWO.cjs → chunk-6CQZMVXW.cjs} +3 -3
  8. package/dist/{chunk-DT5OWHWO.cjs.map → chunk-6CQZMVXW.cjs.map} +1 -1
  9. package/dist/{chunk-IUOGBCVI.cjs → chunk-6FW3AZWN.cjs} +6 -6
  10. package/dist/{chunk-IUOGBCVI.cjs.map → chunk-6FW3AZWN.cjs.map} +1 -1
  11. package/dist/{chunk-KFB7LHCB.js → chunk-7LOD4IGO.js} +4 -4
  12. package/dist/{chunk-5GVDHHHO.js → chunk-DHEUQXXR.js} +2 -2
  13. package/dist/{chunk-KA2NMWIC.js → chunk-EBXJ45VZ.js} +2 -2
  14. package/dist/{chunk-DU2DV4LO.js → chunk-EZSWBHHI.js} +2 -2
  15. package/dist/{chunk-7H5P475X.cjs → chunk-GGMIPTM5.cjs} +12 -12
  16. package/dist/{chunk-7H5P475X.cjs.map → chunk-GGMIPTM5.cjs.map} +1 -1
  17. package/dist/{chunk-PIRSOTKK.js → chunk-GSW7W7AL.js} +2 -2
  18. package/dist/{chunk-TYIUJKUT.js → chunk-GUH6HYSZ.js} +10 -10
  19. package/dist/{chunk-CNU4NPCC.js → chunk-INESPVEV.js} +26 -5
  20. package/dist/chunk-INESPVEV.js.map +1 -0
  21. package/dist/{chunk-DXRKZWC3.js → chunk-IRN5SDY2.js} +2 -2
  22. package/dist/{chunk-P6GO34IP.js → chunk-ISC2TH24.js} +2 -2
  23. package/dist/{chunk-WP6KG5Z7.js → chunk-JKHU7HID.js} +2 -2
  24. package/dist/{chunk-UAWOYMBR.js → chunk-JPSLMPFI.js} +2 -2
  25. package/dist/{chunk-QK6AJJMJ.js → chunk-JWTZ3OVZ.js} +2 -2
  26. package/dist/{chunk-FS6RCEF6.cjs → chunk-K6WSMTVU.cjs} +2 -2
  27. package/dist/{chunk-FS6RCEF6.cjs.map → chunk-K6WSMTVU.cjs.map} +1 -1
  28. package/dist/{chunk-56QHHRWD.js → chunk-LKA7Z2NH.js} +2 -2
  29. package/dist/{chunk-XJCWMVVY.js → chunk-PHMWSWHJ.js} +2 -2
  30. package/dist/{chunk-JZ3VPASI.js → chunk-PN5WWW56.js} +2 -2
  31. package/dist/{chunk-PC4U3XRK.cjs → chunk-RQEDNI4P.cjs} +3 -3
  32. package/dist/{chunk-PC4U3XRK.cjs.map → chunk-RQEDNI4P.cjs.map} +1 -1
  33. package/dist/{chunk-L7TALZNE.js → chunk-SVIOP7PE.js} +6 -6
  34. package/dist/{chunk-UG4GIJSH.js → chunk-V7LKQNC4.js} +2 -2
  35. package/dist/{chunk-DKVS6CFO.js → chunk-VDEENOPW.js} +2 -2
  36. package/dist/{chunk-UETNJSA7.js → chunk-XVB3PUPJ.js} +2 -2
  37. package/dist/{chunk-CMROXIWJ.js → chunk-ZNY5BRV6.js} +27 -6
  38. package/dist/chunk-ZNY5BRV6.js.map +1 -0
  39. package/dist/chunks-JZW2TXIZ.js +10 -0
  40. package/dist/cli.js +26 -26
  41. package/dist/{formula-5BPY5GQL.js → formula-DAMFHLQO.js} +3 -3
  42. package/dist/{formula-VUI2AJUZ.cjs → formula-HJNQGPRC.cjs} +9 -9
  43. package/dist/{formula-VUI2AJUZ.cjs.map → formula-HJNQGPRC.cjs.map} +1 -1
  44. package/dist/{formula-RA2JV55J.js → formula-YCAO5IVW.js} +4 -4
  45. package/dist/{image-ocr-3LUFXLSS.cjs → image-ocr-AZ25IOC7.cjs} +15 -15
  46. package/dist/{image-ocr-3LUFXLSS.cjs.map → image-ocr-AZ25IOC7.cjs.map} +1 -1
  47. package/dist/{image-ocr-MOGXLPIS.js → image-ocr-PAF76DAW.js} +9 -9
  48. package/dist/{image-ocr-QDNBFOLW.js → image-ocr-VH54SDZ7.js} +6 -6
  49. package/dist/index.cjs +277 -277
  50. package/dist/index.js +5 -5
  51. package/dist/mcp.js +22 -22
  52. package/dist/{model-bundle-PKJUJTPC.js → model-bundle-53CHDYCG.js} +5 -5
  53. package/dist/{models-ZZCRW54N.js → models-UVLAKK3M.js} +5 -5
  54. package/dist/{parser-SL5XDJYU.cjs → parser-HWAOPQYK.cjs} +126 -126
  55. package/dist/{parser-SL5XDJYU.cjs.map → parser-HWAOPQYK.cjs.map} +1 -1
  56. package/dist/{parser-PICN5MDD.js → parser-I4D3TRGU.js} +11 -11
  57. package/dist/{parser-IU4QXSEQ.js → parser-Z6PHB54O.js} +8 -8
  58. package/dist/pdf-ocr-F4ICXO7W.js +20 -0
  59. package/dist/pdf-ocr-HR6CXGTX.cjs +17 -0
  60. package/dist/{pdf-ocr-37GLDHR2.cjs.map → pdf-ocr-HR6CXGTX.cjs.map} +1 -1
  61. package/dist/pdf-ocr-JI3K7JIN.js +16 -0
  62. package/dist/{profile-io-TQXBV4NZ.js → profile-io-WHCWCOPW.js} +3 -3
  63. package/dist/{rasterize-QHUKA2N7.js → rasterize-5DZ3DHGH.js} +3 -3
  64. package/dist/{redact-doc-HHTMXA3E.js → redact-doc-RNJVMFGQ.js} +11 -11
  65. package/dist/{render-RZF6SNSN.js → render-NZ6RA6SW.js} +7 -7
  66. package/dist/seal-WHJ6O5HT.js +10 -0
  67. package/dist/{setup-IUCBBXYG.js → setup-U3EQNK4Z.js} +3 -3
  68. package/dist/visual-JDAS4R43.js +20 -0
  69. package/dist/{watch-G46MOBKP.js → watch-GB2M7XU6.js} +12 -12
  70. package/package.json +1 -1
  71. package/dist/chunk-CMROXIWJ.js.map +0 -1
  72. package/dist/chunk-CNU4NPCC.js.map +0 -1
  73. package/dist/chunk-Q5GB73E7.cjs.map +0 -1
  74. package/dist/chunks-ZZZGBVGM.js +0 -10
  75. package/dist/pdf-ocr-37GLDHR2.cjs +0 -17
  76. package/dist/pdf-ocr-7AWV7MY3.js +0 -20
  77. package/dist/pdf-ocr-UXP4CV6V.js +0 -16
  78. package/dist/seal-TBTMKXLY.js +0 -10
  79. package/dist/visual-I64Z7W3Q.js +0 -20
  80. /package/dist/{-TUDCOQX6.js.map → -DC2OO5KO.js.map} +0 -0
  81. /package/dist/{chunk-PF4O626Y.js.map → chunk-32ZUIHSY.js.map} +0 -0
  82. /package/dist/{chunk-GNXDTPP6.js.map → chunk-6AYTYTFY.js.map} +0 -0
  83. /package/dist/{chunk-KFB7LHCB.js.map → chunk-7LOD4IGO.js.map} +0 -0
  84. /package/dist/{chunk-5GVDHHHO.js.map → chunk-DHEUQXXR.js.map} +0 -0
  85. /package/dist/{chunk-KA2NMWIC.js.map → chunk-EBXJ45VZ.js.map} +0 -0
  86. /package/dist/{chunk-DU2DV4LO.js.map → chunk-EZSWBHHI.js.map} +0 -0
  87. /package/dist/{chunk-PIRSOTKK.js.map → chunk-GSW7W7AL.js.map} +0 -0
  88. /package/dist/{chunk-TYIUJKUT.js.map → chunk-GUH6HYSZ.js.map} +0 -0
  89. /package/dist/{chunk-DXRKZWC3.js.map → chunk-IRN5SDY2.js.map} +0 -0
  90. /package/dist/{chunk-P6GO34IP.js.map → chunk-ISC2TH24.js.map} +0 -0
  91. /package/dist/{chunk-WP6KG5Z7.js.map → chunk-JKHU7HID.js.map} +0 -0
  92. /package/dist/{chunk-UAWOYMBR.js.map → chunk-JPSLMPFI.js.map} +0 -0
  93. /package/dist/{chunk-QK6AJJMJ.js.map → chunk-JWTZ3OVZ.js.map} +0 -0
  94. /package/dist/{chunk-56QHHRWD.js.map → chunk-LKA7Z2NH.js.map} +0 -0
  95. /package/dist/{chunk-XJCWMVVY.js.map → chunk-PHMWSWHJ.js.map} +0 -0
  96. /package/dist/{chunk-JZ3VPASI.js.map → chunk-PN5WWW56.js.map} +0 -0
  97. /package/dist/{chunk-L7TALZNE.js.map → chunk-SVIOP7PE.js.map} +0 -0
  98. /package/dist/{chunk-UG4GIJSH.js.map → chunk-V7LKQNC4.js.map} +0 -0
  99. /package/dist/{chunk-DKVS6CFO.js.map → chunk-VDEENOPW.js.map} +0 -0
  100. /package/dist/{chunk-UETNJSA7.js.map → chunk-XVB3PUPJ.js.map} +0 -0
  101. /package/dist/{chunks-ZZZGBVGM.js.map → chunks-JZW2TXIZ.js.map} +0 -0
  102. /package/dist/{formula-5BPY5GQL.js.map → formula-DAMFHLQO.js.map} +0 -0
  103. /package/dist/{formula-RA2JV55J.js.map → formula-YCAO5IVW.js.map} +0 -0
  104. /package/dist/{image-ocr-MOGXLPIS.js.map → image-ocr-PAF76DAW.js.map} +0 -0
  105. /package/dist/{image-ocr-QDNBFOLW.js.map → image-ocr-VH54SDZ7.js.map} +0 -0
  106. /package/dist/{model-bundle-PKJUJTPC.js.map → model-bundle-53CHDYCG.js.map} +0 -0
  107. /package/dist/{models-ZZCRW54N.js.map → models-UVLAKK3M.js.map} +0 -0
  108. /package/dist/{parser-PICN5MDD.js.map → parser-I4D3TRGU.js.map} +0 -0
  109. /package/dist/{parser-IU4QXSEQ.js.map → parser-Z6PHB54O.js.map} +0 -0
  110. /package/dist/{pdf-ocr-7AWV7MY3.js.map → pdf-ocr-F4ICXO7W.js.map} +0 -0
  111. /package/dist/{pdf-ocr-UXP4CV6V.js.map → pdf-ocr-JI3K7JIN.js.map} +0 -0
  112. /package/dist/{profile-io-TQXBV4NZ.js.map → profile-io-WHCWCOPW.js.map} +0 -0
  113. /package/dist/{rasterize-QHUKA2N7.js.map → rasterize-5DZ3DHGH.js.map} +0 -0
  114. /package/dist/{redact-doc-HHTMXA3E.js.map → redact-doc-RNJVMFGQ.js.map} +0 -0
  115. /package/dist/{render-RZF6SNSN.js.map → render-NZ6RA6SW.js.map} +0 -0
  116. /package/dist/{seal-TBTMKXLY.js.map → seal-WHJ6O5HT.js.map} +0 -0
  117. /package/dist/{setup-IUCBBXYG.js.map → setup-U3EQNK4Z.js.map} +0 -0
  118. /package/dist/{visual-I64Z7W3Q.js.map → visual-JDAS4R43.js.map} +0 -0
  119. /package/dist/{watch-G46MOBKP.js.map → watch-GB2M7XU6.js.map} +0 -0
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  blocksToMarkdown
4
- } from "./chunk-WP6KG5Z7.js";
4
+ } from "./chunk-JKHU7HID.js";
5
5
 
6
6
  // src/chunks.ts
7
7
  var LIST_MARKER_RE = /^(?:[□■◇◆○◎●◦ㅇ•▪▸▶※-]|\d{1,3}[.)]|[가나다라마바사아자차카타파하][.)]|\([가나다라마바사아자차카타파하0-9]{1,3}\)|[①-⑳㉮-㉻㈎-㈛])\s/;
@@ -79,4 +79,4 @@ function blocksToChunks(blocks, options) {
79
79
  export {
80
80
  blocksToChunks
81
81
  };
82
- //# sourceMappingURL=chunk-PIRSOTKK.js.map
82
+ //# sourceMappingURL=chunk-GSW7W7AL.js.map
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  blocksToPages
4
- } from "./chunk-UG4GIJSH.js";
4
+ } from "./chunk-V7LKQNC4.js";
5
5
  import {
6
6
  allLinesegRemovalSplices,
7
7
  applySplices,
@@ -15,7 +15,7 @@ import {
15
15
  paraTextPureT,
16
16
  patchZipEntries,
17
17
  scanSectionXml
18
- } from "./chunk-GNXDTPP6.js";
18
+ } from "./chunk-6AYTYTFY.js";
19
19
  import {
20
20
  CONVERT_MAP,
21
21
  FLAG_COMPRESSED,
@@ -65,7 +65,7 @@ import {
65
65
  romanNumeral,
66
66
  simulateWrap,
67
67
  takeTocLeaders
68
- } from "./chunk-L7TALZNE.js";
68
+ } from "./chunk-SVIOP7PE.js";
69
69
  import {
70
70
  CELL_EDGES,
71
71
  HEADING_RATIO_H1,
@@ -77,7 +77,7 @@ import {
77
77
  tidyScriptTags,
78
78
  unframeLayoutTables,
79
79
  wrapScript
80
- } from "./chunk-UETNJSA7.js";
80
+ } from "./chunk-XVB3PUPJ.js";
81
81
  import {
82
82
  parsePageRange
83
83
  } from "./chunk-VQFA55IC.js";
@@ -96,7 +96,7 @@ import {
96
96
  findChildByLocalName,
97
97
  localName,
98
98
  rawTextContent
99
- } from "./chunk-5GVDHHHO.js";
99
+ } from "./chunk-DHEUQXXR.js";
100
100
  import {
101
101
  MAX_COLS,
102
102
  MAX_ROWS,
@@ -111,7 +111,7 @@ import {
111
111
  hasStructuredCellContent,
112
112
  mapPuaText,
113
113
  noteSuffix
114
- } from "./chunk-WP6KG5Z7.js";
114
+ } from "./chunk-JKHU7HID.js";
115
115
  import {
116
116
  KordocError,
117
117
  classifyError,
@@ -127,7 +127,7 @@ import {
127
127
  toArrayBuffer,
128
128
  unescapeHtml,
129
129
  unzipLimitBytes
130
- } from "./chunk-JZ3VPASI.js";
130
+ } from "./chunk-PN5WWW56.js";
131
131
 
132
132
  // src/table/visual.ts
133
133
  import { readFile as readFile2 } from "fs/promises";
@@ -30157,7 +30157,7 @@ function scriptsOff(r, off) {
30157
30157
  }
30158
30158
  async function parseImage(buffer, options) {
30159
30159
  try {
30160
- const { parseImageDocument } = await import("./image-ocr-MOGXLPIS.js");
30160
+ const { parseImageDocument } = await import("./image-ocr-PAF76DAW.js");
30161
30161
  const { blocks, warnings } = await parseImageDocument(buffer, options);
30162
30162
  stripScriptTags({ blocks });
30163
30163
  return {
@@ -30217,7 +30217,7 @@ async function parseHwp(buffer, options) {
30217
30217
  async function parsePdf(buffer, options) {
30218
30218
  let parsePdfDocument;
30219
30219
  try {
30220
- const mod = await import("./parser-PICN5MDD.js");
30220
+ const mod = await import("./parser-I4D3TRGU.js");
30221
30221
  parsePdfDocument = mod.parsePdfDocument;
30222
30222
  } catch {
30223
30223
  return {
@@ -30440,4 +30440,4 @@ export {
30440
30440
  parseHwpml,
30441
30441
  fillForm
30442
30442
  };
30443
- //# sourceMappingURL=chunk-TYIUJKUT.js.map
30443
+ //# sourceMappingURL=chunk-GUH6HYSZ.js.map
@@ -5,11 +5,11 @@ import {
5
5
  HEADING_RATIO_H2,
6
6
  HEADING_RATIO_H3,
7
7
  tidyScriptTags
8
- } from "./chunk-UETNJSA7.js";
8
+ } from "./chunk-XVB3PUPJ.js";
9
9
  import {
10
10
  safeMax,
11
11
  safeMin
12
- } from "./chunk-JZ3VPASI.js";
12
+ } from "./chunk-PN5WWW56.js";
13
13
 
14
14
  // src/pdf/line-extract.ts
15
15
  import { OPS } from "pdfjs-dist/legacy/build/pdf.mjs";
@@ -2169,8 +2169,15 @@ function wrapJoiner(prevText, nextText, lex) {
2169
2169
  return " ";
2170
2170
  }
2171
2171
  var PARA_LAST_LINE = /* @__PURE__ */ new WeakMap();
2172
+ var PARA_FIRST_LEFT = /* @__PURE__ */ new WeakMap();
2172
2173
  var PAGE_REF_TAIL = /(?:\t|…|·{2}|\.{3})\s*\d{1,4}(?:\s*\/\s*\d{1,4})?\s*$/;
2173
2174
  var PAGE_HEAD_MARK = /^(?:[\u0000-\u001f\ue000-\uf8ff\u25a0-\u25ff\u2750-\u275f<〈《〔\[]|ㅇ\s)/;
2175
+ var PAGE_ITEM_HEAD = /^(?:\S{1,4}\t|\.\d{1,3}\s)/;
2176
+ var SENTENCE_END = /[.?!。][”"’」』)]?$/;
2177
+ var titleLike = (text) => {
2178
+ const t = text.replace(MARKUP, "").trim();
2179
+ return !t.includes("\n") && [...t].length <= 40 && !SENTENCE_END.test(t);
2180
+ };
2174
2181
  var PAGE_BREAK_JOINS = /* @__PURE__ */ new WeakMap();
2175
2182
  function joinPageBreakWraps(blocks, lex) {
2176
2183
  const pageRight = /* @__PURE__ */ new Map();
@@ -2178,14 +2185,26 @@ function joinPageBreakWraps(blocks, lex) {
2178
2185
  if (b.type !== "paragraph" || !b.bbox || !b.pageNumber) continue;
2179
2186
  pageRight.set(b.pageNumber, Math.max(pageRight.get(b.pageNumber) ?? -Infinity, b.bbox.x + b.bbox.width));
2180
2187
  }
2188
+ const pageLeft = /* @__PURE__ */ new Map();
2189
+ for (const b of blocks) {
2190
+ if (b.type !== "paragraph" || !b.bbox || !b.pageNumber) continue;
2191
+ pageLeft.set(b.pageNumber, Math.min(pageLeft.get(b.pageNumber) ?? Infinity, b.bbox.x));
2192
+ }
2181
2193
  for (let i = blocks.length - 1; i > 0; i--) {
2182
2194
  const a = blocks[i - 1], b = blocks[i];
2183
2195
  if (!a.pageNumber || b.pageNumber !== a.pageNumber + 1 || !a.text || !b.text) continue;
2184
2196
  if (a.type !== "paragraph" && a.type !== "list" || b.type !== "paragraph") continue;
2185
2197
  const last = a.bbox && PARA_LAST_LINE.get(a.bbox), fs = last ? last.fontSize : 0;
2186
2198
  if (!last || fs <= 0 || (pageRight.get(a.pageNumber) ?? Infinity) - last.right >= BODY_FULL_TOL * fs) continue;
2187
- if (last.width < BODY_MIN_WIDTH_EM * fs || Math.round(b.style?.fontSize ?? 0) !== Math.round(fs)) continue;
2188
- if (startsNewItem(a.text, b.text) || PAGE_REF_TAIL.test(a.text) || PAGE_HEAD_MARK.test(b.text.replace(MARKUP, ""))) continue;
2199
+ if (last.width < BODY_MIN_WIDTH_EM * fs || Math.abs((b.style?.fontSize ?? 0) - fs) > 0.15 * fs) continue;
2200
+ const bt = b.text.replace(MARKUP, "");
2201
+ if (startsNewItem(a.text, b.text) || PAGE_REF_TAIL.test(a.text) || PAGE_ITEM_HEAD.test(bt)) continue;
2202
+ if (PAGE_HEAD_MARK.test(bt) && !(/^[\u25a0-\u25ff]/.test(bt) && a.text.includes(bt[0]))) continue;
2203
+ const firstLeft = b.bbox && PARA_FIRST_LEFT.get(b.bbox);
2204
+ const indented = firstLeft === void 0 || firstLeft - (pageLeft.get(b.pageNumber) ?? firstLeft) >= 0.3 * fs;
2205
+ if (indented && SENTENCE_END.test(a.text.replace(MARKUP, "").trimEnd())) continue;
2206
+ if (Math.round(b.style?.fontSize ?? 0) !== Math.round(fs) && titleLike(b.text)) continue;
2207
+ if (/\t/.test(a.text.slice(a.text.lastIndexOf("\n") + 1).replace(/^\S{1,8}\t/, "")) && titleLike(bt.trim().split("\n")[0])) continue;
2189
2208
  const head = a.text, joiner = wrapJoiner(a.text, b.text, lex);
2190
2209
  a.text += joiner + b.text;
2191
2210
  const later = b.bbox && PAGE_BREAK_JOINS.get(b.bbox) || [];
@@ -3553,6 +3572,7 @@ function pushLineParagraphs(out, yLines, pageNum, lex) {
3553
3572
  joins[1] = "\n";
3554
3573
  }
3555
3574
  for (let i = 0; i < lines.length; ) {
3575
+ const first2 = i;
3556
3576
  let text = lines[i].text;
3557
3577
  const items = [...lines[i].items];
3558
3578
  const srcLines = [lines[i].items];
@@ -3567,6 +3587,7 @@ function pushLineParagraphs(out, yLines, pageNum, lex) {
3567
3587
  for (const it of items) faces.set(it.fontName, (faces.get(it.fontName) ?? 0) + it.text.length);
3568
3588
  FACE_CHARS.set(block, faces);
3569
3589
  PARA_LAST_LINE.set(block.bbox, { right: geo[i].right, width: geo[i].right - geo[i].left, fontSize: geo[i].fontSize });
3590
+ PARA_FIRST_LEFT.set(block.bbox, geo[first2].left);
3570
3591
  out.push(block);
3571
3592
  i++;
3572
3593
  }
@@ -8277,4 +8298,4 @@ export {
8277
8298
  removeSideTabs,
8278
8299
  extractPageBlocksWithLines
8279
8300
  };
8280
- //# sourceMappingURL=chunk-CNU4NPCC.js.map
8301
+ //# sourceMappingURL=chunk-INESPVEV.js.map