kordoc 4.25.2 → 4.25.3

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 (110) hide show
  1. package/NOTICE +14 -8
  2. package/README.md +2 -2
  3. package/dist/{chunk-QJWSNET3.js → chunk-44JOWCSX.js} +8 -8
  4. package/dist/{chunk-CEYITKNO.js → chunk-7LVAULK7.js} +2 -2
  5. package/dist/{chunk-AHJOET62.js → chunk-ATOUJ2QT.js} +5 -5
  6. package/dist/{chunk-6VSEMZ2J.js → chunk-BAYK74RD.js} +10 -10
  7. package/dist/{chunk-EWUBFEPZ.js → chunk-BP54NHUP.js} +2 -2
  8. package/dist/{chunk-EWUBFEPZ.js.map → chunk-BP54NHUP.js.map} +2 -2
  9. package/dist/{chunk-ZMLZVD3J.js → chunk-CKRFG6QS.js} +2 -2
  10. package/dist/{chunk-BDBVGJW3.js → chunk-EL3TM6NH.js} +2 -2
  11. package/dist/{chunk-PE2Z234F.js → chunk-FZNY4DWZ.js} +2 -2
  12. package/dist/{chunk-NXDACGEH.js → chunk-G6HRSHV2.js} +39 -4
  13. package/dist/{chunk-NXDACGEH.js.map → chunk-G6HRSHV2.js.map} +2 -2
  14. package/dist/{chunk-NRHDHCJN.js → chunk-GRKTIXRO.js} +2 -2
  15. package/dist/{chunk-N4WIRSNW.js → chunk-H5JMMJSH.js} +2 -2
  16. package/dist/{chunk-ZHVSRDVF.js → chunk-H76I34IS.js} +6 -6
  17. package/dist/{chunk-A36NOLXN.js → chunk-HUN4CRUL.js} +6 -6
  18. package/dist/{chunk-GUOXYUMU.js → chunk-HWUAMWA2.js} +2 -2
  19. package/dist/{chunk-4X5R5EKL.js → chunk-JYZGHREO.js} +6 -6
  20. package/dist/{chunk-UMWSG2SJ.js → chunk-MJDPJ5XQ.js} +3 -3
  21. package/dist/{chunk-RWWLUT3Z.js → chunk-MLGR4AJ6.js} +25 -6
  22. package/dist/chunk-MLGR4AJ6.js.map +7 -0
  23. package/dist/{chunk-OQKYJVLL.js → chunk-NCZRKC5G.js} +4 -4
  24. package/dist/{chunk-RR7F4MV7.js → chunk-NOKFHQ6K.js} +2 -2
  25. package/dist/{chunk-GEWICG46.js → chunk-PEN2SUJQ.js} +2 -2
  26. package/dist/{chunk-OE76DPYB.js → chunk-Q4YOIJQF.js} +3 -3
  27. package/dist/{chunk-KK3ADW4V.js → chunk-Q525ZJZK.js} +28 -10
  28. package/dist/{chunk-KK3ADW4V.js.map → chunk-Q525ZJZK.js.map} +3 -3
  29. package/dist/{chunk-RCFCHOMY.js → chunk-S2DA7IZJ.js} +2 -2
  30. package/dist/{chunk-HS4V42R5.js → chunk-WYH2DSPZ.js} +2 -2
  31. package/dist/{chunk-BVJX756H.js → chunk-YJ6ZL7O2.js} +16 -16
  32. package/dist/{chunk-IK3FDYOE.js → chunk-ZD2KWXR2.js} +2 -2
  33. package/dist/chunks-EBMYAFDM.js +10 -0
  34. package/dist/cli.js +35 -35
  35. package/dist/{formula-6DMQSBFW.js → formula-3QN7DVFM.js} +4 -4
  36. package/dist/{generator-ORDTMIQM.js → generator-O5RTSTX6.js} +7 -7
  37. package/dist/{hancom-KN5SQMKT.js → hancom-ZJR546EJ.js} +2 -2
  38. package/dist/{image-ocr-LVJFXGL4.js → image-ocr-LA3LCRXK.js} +11 -11
  39. package/dist/index.cjs +87 -15
  40. package/dist/index.cjs.map +3 -3
  41. package/dist/index.d.cts +6 -5
  42. package/dist/index.d.ts +6 -5
  43. package/dist/index.js +19 -19
  44. package/dist/mcp.js +33 -33
  45. package/dist/mcp.js.map +2 -2
  46. package/dist/memo-ZKU7B66X.js +15 -0
  47. package/dist/{model-bundle-VWCZDFFG.js → model-bundle-HEEEA6YP.js} +5 -5
  48. package/dist/{models-R67ZWDF4.js → models-BS5CBYRY.js} +9 -5
  49. package/dist/{parse-worker-v2-6WBBR7Z2.js → parse-worker-v2-J4OWXPNE.js} +21 -21
  50. package/dist/{parser-TCYP5RBA.js → parser-OGWIHRB7.js} +14 -13
  51. package/dist/{parser-TCYP5RBA.js.map → parser-OGWIHRB7.js.map} +2 -2
  52. package/dist/{pdf-ocr-DVCI7AAR.js → pdf-ocr-DLE7J6MD.js} +9 -9
  53. package/dist/{profile-io-4XUVQIFE.js → profile-io-3RT4KWON.js} +3 -3
  54. package/dist/{rasterize-WUSJNYMZ.js → rasterize-UBAGOEIC.js} +3 -3
  55. package/dist/{redact-doc-HCXNHJUZ.js → redact-doc-7CKGFON7.js} +20 -20
  56. package/dist/{render-NGSGUNWX.js → render-HOLN6Y7J.js} +10 -10
  57. package/dist/{rewrite-fallback-S7F2TP4G.js → rewrite-fallback-O6TBXS3M.js} +12 -12
  58. package/dist/seal-EYDUKV3T.js +14 -0
  59. package/dist/{setup-ECJK3FIE.js → setup-HVPORSZU.js} +3 -3
  60. package/dist/{to-hwpx-PSJYFTDW.js → to-hwpx-VPK7TIL6.js} +7 -7
  61. package/dist/visual-IWW6J4I4.js +38 -0
  62. package/dist/{watch-CTPPLNO4.js → watch-LSDUKNBM.js} +21 -21
  63. package/package.json +1 -1
  64. package/dist/chunk-RWWLUT3Z.js.map +0 -7
  65. package/dist/chunks-JNZ2WBME.js +0 -10
  66. package/dist/memo-UJ4UYP5C.js +0 -15
  67. package/dist/seal-BB7STCXD.js +0 -14
  68. package/dist/visual-QQC436MI.js +0 -38
  69. /package/dist/{chunk-QJWSNET3.js.map → chunk-44JOWCSX.js.map} +0 -0
  70. /package/dist/{chunk-CEYITKNO.js.map → chunk-7LVAULK7.js.map} +0 -0
  71. /package/dist/{chunk-AHJOET62.js.map → chunk-ATOUJ2QT.js.map} +0 -0
  72. /package/dist/{chunk-6VSEMZ2J.js.map → chunk-BAYK74RD.js.map} +0 -0
  73. /package/dist/{chunk-ZMLZVD3J.js.map → chunk-CKRFG6QS.js.map} +0 -0
  74. /package/dist/{chunk-BDBVGJW3.js.map → chunk-EL3TM6NH.js.map} +0 -0
  75. /package/dist/{chunk-PE2Z234F.js.map → chunk-FZNY4DWZ.js.map} +0 -0
  76. /package/dist/{chunk-NRHDHCJN.js.map → chunk-GRKTIXRO.js.map} +0 -0
  77. /package/dist/{chunk-N4WIRSNW.js.map → chunk-H5JMMJSH.js.map} +0 -0
  78. /package/dist/{chunk-ZHVSRDVF.js.map → chunk-H76I34IS.js.map} +0 -0
  79. /package/dist/{chunk-A36NOLXN.js.map → chunk-HUN4CRUL.js.map} +0 -0
  80. /package/dist/{chunk-GUOXYUMU.js.map → chunk-HWUAMWA2.js.map} +0 -0
  81. /package/dist/{chunk-4X5R5EKL.js.map → chunk-JYZGHREO.js.map} +0 -0
  82. /package/dist/{chunk-UMWSG2SJ.js.map → chunk-MJDPJ5XQ.js.map} +0 -0
  83. /package/dist/{chunk-OQKYJVLL.js.map → chunk-NCZRKC5G.js.map} +0 -0
  84. /package/dist/{chunk-RR7F4MV7.js.map → chunk-NOKFHQ6K.js.map} +0 -0
  85. /package/dist/{chunk-GEWICG46.js.map → chunk-PEN2SUJQ.js.map} +0 -0
  86. /package/dist/{chunk-OE76DPYB.js.map → chunk-Q4YOIJQF.js.map} +0 -0
  87. /package/dist/{chunk-RCFCHOMY.js.map → chunk-S2DA7IZJ.js.map} +0 -0
  88. /package/dist/{chunk-HS4V42R5.js.map → chunk-WYH2DSPZ.js.map} +0 -0
  89. /package/dist/{chunk-BVJX756H.js.map → chunk-YJ6ZL7O2.js.map} +0 -0
  90. /package/dist/{chunk-IK3FDYOE.js.map → chunk-ZD2KWXR2.js.map} +0 -0
  91. /package/dist/{chunks-JNZ2WBME.js.map → chunks-EBMYAFDM.js.map} +0 -0
  92. /package/dist/{formula-6DMQSBFW.js.map → formula-3QN7DVFM.js.map} +0 -0
  93. /package/dist/{generator-ORDTMIQM.js.map → generator-O5RTSTX6.js.map} +0 -0
  94. /package/dist/{hancom-KN5SQMKT.js.map → hancom-ZJR546EJ.js.map} +0 -0
  95. /package/dist/{image-ocr-LVJFXGL4.js.map → image-ocr-LA3LCRXK.js.map} +0 -0
  96. /package/dist/{memo-UJ4UYP5C.js.map → memo-ZKU7B66X.js.map} +0 -0
  97. /package/dist/{model-bundle-VWCZDFFG.js.map → model-bundle-HEEEA6YP.js.map} +0 -0
  98. /package/dist/{models-R67ZWDF4.js.map → models-BS5CBYRY.js.map} +0 -0
  99. /package/dist/{parse-worker-v2-6WBBR7Z2.js.map → parse-worker-v2-J4OWXPNE.js.map} +0 -0
  100. /package/dist/{pdf-ocr-DVCI7AAR.js.map → pdf-ocr-DLE7J6MD.js.map} +0 -0
  101. /package/dist/{profile-io-4XUVQIFE.js.map → profile-io-3RT4KWON.js.map} +0 -0
  102. /package/dist/{rasterize-WUSJNYMZ.js.map → rasterize-UBAGOEIC.js.map} +0 -0
  103. /package/dist/{redact-doc-HCXNHJUZ.js.map → redact-doc-7CKGFON7.js.map} +0 -0
  104. /package/dist/{render-NGSGUNWX.js.map → render-HOLN6Y7J.js.map} +0 -0
  105. /package/dist/{rewrite-fallback-S7F2TP4G.js.map → rewrite-fallback-O6TBXS3M.js.map} +0 -0
  106. /package/dist/{seal-BB7STCXD.js.map → seal-EYDUKV3T.js.map} +0 -0
  107. /package/dist/{setup-ECJK3FIE.js.map → setup-HVPORSZU.js.map} +0 -0
  108. /package/dist/{to-hwpx-PSJYFTDW.js.map → to-hwpx-VPK7TIL6.js.map} +0 -0
  109. /package/dist/{visual-QQC436MI.js.map → visual-IWW6J4I4.js.map} +0 -0
  110. /package/dist/{watch-CTPPLNO4.js.map → watch-LSDUKNBM.js.map} +0 -0
@@ -9,11 +9,11 @@ import {
9
9
  HEADING_RATIO_H3,
10
10
  tidyScriptTags,
11
11
  toTex
12
- } from "./chunk-EWUBFEPZ.js";
12
+ } from "./chunk-BP54NHUP.js";
13
13
  import {
14
14
  safeMax,
15
15
  safeMin
16
- } from "./chunk-CEYITKNO.js";
16
+ } from "./chunk-7LVAULK7.js";
17
17
 
18
18
  // src/ocr/line-split.ts
19
19
  function grayCrop(rgba, pageW, box) {
@@ -7807,6 +7807,7 @@ var TABLE_TAIL = /* @__PURE__ */ new WeakMap();
7807
7807
  var PART_COLXS = /* @__PURE__ */ new WeakMap();
7808
7808
  var EMPTY_PARTS = /* @__PURE__ */ new WeakSet();
7809
7809
  var IMAGE_CELLS = /* @__PURE__ */ new WeakSet();
7810
+ var IMAGE_CELL_BOXES = /* @__PURE__ */ new WeakMap();
7810
7811
  var FILLER_CELLS = /* @__PURE__ */ new WeakSet();
7811
7812
  var CONT_PARTS = /* @__PURE__ */ new WeakMap();
7812
7813
  var CELL_LINES = /* @__PURE__ */ new WeakMap();
@@ -10517,6 +10518,7 @@ function extractBlocksWithGrids(items, pageNum, pageWidth, pageHeight, grids, ho
10517
10518
  return cx > b.x1 && cx < b.x2 && cy > b.y1 && cy < b.y2 && !isBackdrop(r);
10518
10519
  })) {
10519
10520
  markImageCell(irGrid[cell.row][cell.col]);
10521
+ IMAGE_CELL_BOXES.set(irGrid[cell.row][cell.col], { x1: b.x1, y1: b.y1, x2: b.x2, y2: b.y2 });
10520
10522
  }
10521
10523
  if (cell.filler && !cellItems.length) FILLER_CELLS.add(irGrid[cell.row][cell.col]);
10522
10524
  if (cellItems.length) recordCellLines(irGrid[cell.row][cell.col], cellItems);
@@ -11280,7 +11282,17 @@ function mergeOcrImageRegions(blocks, page, regions, ocrBlocks) {
11280
11282
  const frame = FRAME_READING_UNITS.get(block);
11281
11283
  const source = frame?.blocks.every((member) => selectedSet.has(member)) ? frame.blocks : [block];
11282
11284
  source.forEach((member) => seen2.add(member));
11283
- const available = source.filter((member) => !hasOriginal(member));
11285
+ const outside = [];
11286
+ for (const member of source) {
11287
+ const cell = imageCellAt(before, page, member.bbox);
11288
+ if (!cell) {
11289
+ outside.push(member);
11290
+ continue;
11291
+ }
11292
+ addToCell(cell, { ...member, style: void 0, bbox: void 0 });
11293
+ added++;
11294
+ }
11295
+ const available = outside.filter((member) => !hasOriginal(member));
11284
11296
  const units = frame && available.length === source.length && source === frame.blocks ? [{ blocks: available, bbox: frame.bbox, atomic: true }] : available.map((member) => ({ blocks: [member], bbox: member.bbox, atomic: false }));
11285
11297
  for (const unit of units) {
11286
11298
  const b = unit.bbox;
@@ -11301,6 +11313,29 @@ function mergeOcrImageRegions(blocks, page, regions, ocrBlocks) {
11301
11313
  }
11302
11314
  return added;
11303
11315
  }
11316
+ function imageCellAt(blocks, page, b) {
11317
+ const cx = b.x + b.width / 2, cy = b.y + b.height / 2;
11318
+ const walk = (list, depth) => {
11319
+ if (depth > 8) return null;
11320
+ for (const block of list) {
11321
+ if (!block.table || block.pageNumber !== void 0 && block.pageNumber !== page) continue;
11322
+ for (const row of block.table.cells) for (const cell of row) {
11323
+ const box = IMAGE_CELL_BOXES.get(cell);
11324
+ if (box && IMAGE_CELLS.has(cell) && cx > box.x1 && cx < box.x2 && cy > box.y1 && cy < box.y2) return cell;
11325
+ const inner = cell.blocks ? walk(cell.blocks, depth + 1) : null;
11326
+ if (inner) return inner;
11327
+ }
11328
+ }
11329
+ return null;
11330
+ };
11331
+ return walk(blocks, 0);
11332
+ }
11333
+ function addToCell(cell, block) {
11334
+ if (!cell.blocks?.length && cell.text.trim()) cell.blocks = [{ type: "paragraph", text: cell.text }];
11335
+ cell.blocks = [...cell.blocks ?? [], block];
11336
+ const text = block.type === "table" && block.table ? block.table.cells.map((row) => row.map((c) => c.text.trim()).filter(Boolean).join(" ")).join("\n") : block.text ?? "";
11337
+ cell.text = [cell.text, text].filter((t) => t.trim()).join("\n");
11338
+ }
11304
11339
  function axisTick(block, candidates) {
11305
11340
  const b = block.bbox;
11306
11341
  if (!/^\d$/u.test(block.text?.trim() ?? "")) return false;
@@ -11454,4 +11489,4 @@ export {
11454
11489
  UNRULED_REGION_TABLES,
11455
11490
  mergeOcrImageRegions
11456
11491
  };
11457
- //# sourceMappingURL=chunk-NXDACGEH.js.map
11492
+ //# sourceMappingURL=chunk-G6HRSHV2.js.map