kordoc 4.12.1 → 4.12.2
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.
- package/README.md +11 -0
- package/dist/{-BUYIUNW3.js → -EZH6NKTE.js} +8 -8
- package/dist/{chunk-WGUVKNBX.js → chunk-2B7OIEJJ.js} +6 -3
- package/dist/chunk-2B7OIEJJ.js.map +1 -0
- package/dist/{chunk-CJPVVR2Y.js → chunk-2HBYWA5X.js} +2 -2
- package/dist/{chunk-EOGPRO3U.cjs → chunk-2LKYJ4G3.cjs} +6 -6
- package/dist/{chunk-EOGPRO3U.cjs.map → chunk-2LKYJ4G3.cjs.map} +1 -1
- package/dist/{chunk-FNCBOTM5.js → chunk-2LO525TL.js} +2 -2
- package/dist/{chunk-WJOWM27X.cjs → chunk-2LPBIW2B.cjs} +3 -3
- package/dist/{chunk-WJOWM27X.cjs.map → chunk-2LPBIW2B.cjs.map} +1 -1
- package/dist/{chunk-6MF7JRG3.cjs → chunk-62IU4NV3.cjs} +2 -2
- package/dist/{chunk-6MF7JRG3.cjs.map → chunk-62IU4NV3.cjs.map} +1 -1
- package/dist/{chunk-BPKJTQAW.js → chunk-7XUXSDH5.js} +89 -25
- package/dist/chunk-7XUXSDH5.js.map +1 -0
- package/dist/{chunk-ST3JBCIL.js → chunk-DBGEUDBY.js} +2 -2
- package/dist/{chunk-E37VAV46.js → chunk-FBLMVHDK.js} +2 -2
- package/dist/{chunk-EWSH6O6S.js → chunk-FVBR7SC3.js} +2 -2
- package/dist/{chunk-F2KL5Z5T.js → chunk-IOJX4Q63.js} +3 -3
- package/dist/{chunk-L5DNHSX4.js → chunk-JCMBQC5N.js} +2 -2
- package/dist/{chunk-JD4H6Y33.js → chunk-KX7IYCCZ.js} +3 -3
- package/dist/{chunk-VO37BVAH.js → chunk-LD2K4K5V.js} +40 -19
- package/dist/chunk-LD2K4K5V.js.map +1 -0
- package/dist/{chunk-D2XNLIFU.js → chunk-MUYU4JI5.js} +2 -2
- package/dist/{chunk-OS2IOI3W.js → chunk-OEYECZGV.js} +89 -25
- package/dist/chunk-OEYECZGV.js.map +1 -0
- package/dist/{chunk-MXZXZTKW.cjs → chunk-ONNAHSPV.cjs} +104 -40
- package/dist/chunk-ONNAHSPV.cjs.map +1 -0
- package/dist/{chunk-JQBF4PSF.js → chunk-Q6ETEJFK.js} +6 -3
- package/dist/chunk-Q6ETEJFK.js.map +1 -0
- package/dist/{chunk-ELCPCTJ6.js → chunk-QBCMFNHS.js} +2 -2
- package/dist/{chunk-DXKNPBXX.js → chunk-QM2RSJ2S.js} +3 -3
- package/dist/{chunk-L6FIUSD2.js → chunk-UL2MDA5C.js} +3 -3
- package/dist/{chunk-CBPO5IZZ.cjs → chunk-V5BUPZ6I.cjs} +20 -17
- package/dist/chunk-V5BUPZ6I.cjs.map +1 -0
- package/dist/{chunk-7U34YNFR.js → chunk-XXDZ2KTW.js} +2 -2
- package/dist/chunks-TT7ZE5QQ.js +10 -0
- package/dist/cli.js +20 -20
- package/dist/{formula-7TN26AKF.js → formula-6RQX4NMJ.js} +4 -4
- package/dist/{formula-XKRMKGAW.cjs → formula-NBEO6CFC.cjs} +9 -9
- package/dist/{formula-XKRMKGAW.cjs.map → formula-NBEO6CFC.cjs.map} +1 -1
- package/dist/{formula-RZNSECGO.js → formula-NW33S4TA.js} +3 -3
- package/dist/{image-ocr-3O34O7XS.js → image-ocr-CAVU2TNZ.js} +5 -5
- package/dist/{image-ocr-TNU4ILLU.js → image-ocr-SO56VETS.js} +7 -7
- package/dist/{image-ocr-XDZONLD6.cjs → image-ocr-V4KY373B.cjs} +11 -11
- package/dist/{image-ocr-XDZONLD6.cjs.map → image-ocr-V4KY373B.cjs.map} +1 -1
- package/dist/index.cjs +419 -398
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +36 -15
- package/dist/index.js.map +1 -1
- package/dist/mcp.js +15 -15
- package/dist/{model-bundle-NCYN375I.js → model-bundle-EIJF34DR.js} +5 -5
- package/dist/{models-J4G4VZMU.js → models-6V4CPQXC.js} +5 -5
- package/dist/{parser-6IH62P6U.js → parser-GIREMEPD.js} +6 -6
- package/dist/{parser-5WZBCP7H.js → parser-OBHNXEQM.js} +6 -6
- package/dist/{parser-LVMTVO2N.cjs → parser-OMT25WH2.cjs} +26 -26
- package/dist/{parser-LVMTVO2N.cjs.map → parser-OMT25WH2.cjs.map} +1 -1
- package/dist/pdf-ocr-IRXQ5GBM.js +13 -0
- package/dist/pdf-ocr-SL4GCOGS.js +16 -0
- package/dist/pdf-ocr-TFYVK4FI.cjs +14 -0
- package/dist/{pdf-ocr-IAO273AQ.cjs.map → pdf-ocr-TFYVK4FI.cjs.map} +1 -1
- package/dist/{profile-io-ANPS7DTT.js → profile-io-PZVMM66V.js} +3 -3
- package/dist/{rasterize-FKXCEFHV.js → rasterize-NRWP2C6L.js} +2 -2
- package/dist/render-V5ZPTZQ7.js +10 -0
- package/dist/seal-LVG2DGAB.js +10 -0
- package/dist/{setup-DEAFODGI.js → setup-V55AJP6H.js} +3 -3
- package/dist/{watch-B5X7IAMK.js → watch-7CQSMDDP.js} +9 -9
- package/package.json +1 -1
- package/dist/chunk-BPKJTQAW.js.map +0 -1
- package/dist/chunk-CBPO5IZZ.cjs.map +0 -1
- package/dist/chunk-JQBF4PSF.js.map +0 -1
- package/dist/chunk-MXZXZTKW.cjs.map +0 -1
- package/dist/chunk-OS2IOI3W.js.map +0 -1
- package/dist/chunk-VO37BVAH.js.map +0 -1
- package/dist/chunk-WGUVKNBX.js.map +0 -1
- package/dist/chunks-G2U2XUZU.js +0 -10
- package/dist/pdf-ocr-5PLJOKGI.js +0 -13
- package/dist/pdf-ocr-7FPCZCV7.js +0 -16
- package/dist/pdf-ocr-IAO273AQ.cjs +0 -14
- package/dist/render-NWQI3AXU.js +0 -10
- package/dist/seal-N3GCBTVA.js +0 -10
- /package/dist/{-BUYIUNW3.js.map → -EZH6NKTE.js.map} +0 -0
- /package/dist/{chunk-CJPVVR2Y.js.map → chunk-2HBYWA5X.js.map} +0 -0
- /package/dist/{chunk-FNCBOTM5.js.map → chunk-2LO525TL.js.map} +0 -0
- /package/dist/{chunk-ST3JBCIL.js.map → chunk-DBGEUDBY.js.map} +0 -0
- /package/dist/{chunk-E37VAV46.js.map → chunk-FBLMVHDK.js.map} +0 -0
- /package/dist/{chunk-EWSH6O6S.js.map → chunk-FVBR7SC3.js.map} +0 -0
- /package/dist/{chunk-F2KL5Z5T.js.map → chunk-IOJX4Q63.js.map} +0 -0
- /package/dist/{chunk-L5DNHSX4.js.map → chunk-JCMBQC5N.js.map} +0 -0
- /package/dist/{chunk-JD4H6Y33.js.map → chunk-KX7IYCCZ.js.map} +0 -0
- /package/dist/{chunk-D2XNLIFU.js.map → chunk-MUYU4JI5.js.map} +0 -0
- /package/dist/{chunk-ELCPCTJ6.js.map → chunk-QBCMFNHS.js.map} +0 -0
- /package/dist/{chunk-DXKNPBXX.js.map → chunk-QM2RSJ2S.js.map} +0 -0
- /package/dist/{chunk-L6FIUSD2.js.map → chunk-UL2MDA5C.js.map} +0 -0
- /package/dist/{chunk-7U34YNFR.js.map → chunk-XXDZ2KTW.js.map} +0 -0
- /package/dist/{chunks-G2U2XUZU.js.map → chunks-TT7ZE5QQ.js.map} +0 -0
- /package/dist/{formula-7TN26AKF.js.map → formula-6RQX4NMJ.js.map} +0 -0
- /package/dist/{formula-RZNSECGO.js.map → formula-NW33S4TA.js.map} +0 -0
- /package/dist/{image-ocr-3O34O7XS.js.map → image-ocr-CAVU2TNZ.js.map} +0 -0
- /package/dist/{image-ocr-TNU4ILLU.js.map → image-ocr-SO56VETS.js.map} +0 -0
- /package/dist/{model-bundle-NCYN375I.js.map → model-bundle-EIJF34DR.js.map} +0 -0
- /package/dist/{models-J4G4VZMU.js.map → models-6V4CPQXC.js.map} +0 -0
- /package/dist/{parser-6IH62P6U.js.map → parser-GIREMEPD.js.map} +0 -0
- /package/dist/{parser-5WZBCP7H.js.map → parser-OBHNXEQM.js.map} +0 -0
- /package/dist/{pdf-ocr-5PLJOKGI.js.map → pdf-ocr-IRXQ5GBM.js.map} +0 -0
- /package/dist/{pdf-ocr-7FPCZCV7.js.map → pdf-ocr-SL4GCOGS.js.map} +0 -0
- /package/dist/{profile-io-ANPS7DTT.js.map → profile-io-PZVMM66V.js.map} +0 -0
- /package/dist/{rasterize-FKXCEFHV.js.map → rasterize-NRWP2C6L.js.map} +0 -0
- /package/dist/{render-NWQI3AXU.js.map → render-V5ZPTZQ7.js.map} +0 -0
- /package/dist/{seal-N3GCBTVA.js.map → seal-LVG2DGAB.js.map} +0 -0
- /package/dist/{setup-DEAFODGI.js.map → setup-V55AJP6H.js.map} +0 -0
- /package/dist/{watch-B5X7IAMK.js.map → watch-7CQSMDDP.js.map} +0 -0
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// src/utils.ts
|
|
2
|
-
var VERSION = true ? "4.12.
|
|
2
|
+
var VERSION = true ? "4.12.2" : "0.0.0-dev";
|
|
3
3
|
function toArrayBuffer(buf) {
|
|
4
4
|
if (buf.byteOffset === 0 && buf.byteLength === buf.buffer.byteLength) {
|
|
5
5
|
return buf.buffer;
|
|
@@ -121,4 +121,4 @@ export {
|
|
|
121
121
|
safeMax,
|
|
122
122
|
classifyError
|
|
123
123
|
};
|
|
124
|
-
//# sourceMappingURL=chunk-
|
|
124
|
+
//# sourceMappingURL=chunk-MUYU4JI5.js.map
|
|
@@ -7,7 +7,7 @@ import {
|
|
|
7
7
|
import {
|
|
8
8
|
safeMax,
|
|
9
9
|
safeMin
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-FBLMVHDK.js";
|
|
11
11
|
|
|
12
12
|
// src/pdf/image-regions.ts
|
|
13
13
|
import { OPS } from "pdfjs-dist/legacy/build/pdf.mjs";
|
|
@@ -1010,8 +1010,14 @@ function edgeStroked(lines, dir, pos, a1, a2) {
|
|
|
1010
1010
|
}
|
|
1011
1011
|
function buildClipCellGrids(rects, strokedH, strokedV, pageWidth, pageHeight) {
|
|
1012
1012
|
const pageArea = pageWidth * pageHeight;
|
|
1013
|
-
const
|
|
1014
|
-
|
|
1013
|
+
const sameRect = (a, b) => Math.abs(a.x1 - b.x1) <= CLIP_EDGE_TOL && Math.abs(a.x2 - b.x2) <= CLIP_EDGE_TOL && Math.abs(a.y1 - b.y1) <= CLIP_EDGE_TOL && Math.abs(a.y2 - b.y2) <= CLIP_EDGE_TOL;
|
|
1014
|
+
const cells = [];
|
|
1015
|
+
for (const r of rects) {
|
|
1016
|
+
if (r.x2 - r.x1 < CLIP_MIN_W2 || r.y2 - r.y1 < CLIP_MIN_H2) continue;
|
|
1017
|
+
if (pageArea > 0 && (r.x2 - r.x1) * (r.y2 - r.y1) >= pageArea * CLIP_MAX_PAGE_FRAC) continue;
|
|
1018
|
+
if (!cells.some((c) => sameRect(c, r))) cells.push(r);
|
|
1019
|
+
}
|
|
1020
|
+
if (cells.length < 1) return { grids: [], containers: [] };
|
|
1015
1021
|
const parent = new Array(cells.length).fill(-1);
|
|
1016
1022
|
for (let i = 0; i < cells.length; i++) {
|
|
1017
1023
|
for (let j = 0; j < cells.length; j++) {
|
|
@@ -1046,15 +1052,30 @@ function buildClipCellGrids(rects, strokedH, strokedV, pageWidth, pageHeight) {
|
|
|
1046
1052
|
if (g) g.push(i);
|
|
1047
1053
|
else groups.set(r, [i]);
|
|
1048
1054
|
}
|
|
1049
|
-
const containers = [];
|
|
1050
|
-
|
|
1051
|
-
|
|
1052
|
-
|
|
1053
|
-
|
|
1054
|
-
|
|
1055
|
+
const containers = cells.filter((_, i) => isContainer[i]);
|
|
1056
|
+
const groupSize = (i) => groups.get(find(i))?.length ?? 0;
|
|
1057
|
+
const isGridMember = (i) => groupSize(i) >= CLIP_MIN_GROUP;
|
|
1058
|
+
const framed = (r) => edgeStroked(strokedH, "h", r.y1, r.x1, r.x2) && edgeStroked(strokedH, "h", r.y2, r.x1, r.x2) && edgeStroked(strokedV, "v", r.x1, r.y1, r.y2) && edgeStroked(strokedV, "v", r.x2, r.y1, r.y2);
|
|
1059
|
+
const loneFrame = (i) => isContainer[i] && !isGridMember(i) && framed(cells[i]);
|
|
1060
|
+
const parentAttachable = (i) => parent[i] >= 0 && (isGridMember(parent[i]) || loneFrame(parent[i]));
|
|
1061
|
+
const onlyChild = (i) => parent[i] >= 0 && parent.filter((p) => p === parent[i]).length === 1;
|
|
1055
1062
|
const grids = [];
|
|
1056
1063
|
for (const idxs of groups.values()) {
|
|
1057
|
-
|
|
1064
|
+
const first = idxs[0];
|
|
1065
|
+
const parentRect = parentAttachable(first) ? cells[parent[first]] : void 0;
|
|
1066
|
+
if (idxs.length < CLIP_MIN_GROUP) {
|
|
1067
|
+
if (!loneFrame(first) && !((parentRect || onlyChild(first)) && framed(cells[first]))) continue;
|
|
1068
|
+
const r = cells[first];
|
|
1069
|
+
grids.push({
|
|
1070
|
+
rowYs: [r.y2, r.y1],
|
|
1071
|
+
colXs: [r.x1, r.x2],
|
|
1072
|
+
bbox: { x1: r.x1, y1: r.y1, x2: r.x2, y2: r.y2 },
|
|
1073
|
+
vertexRadius: 1,
|
|
1074
|
+
cells: [{ row: 0, col: 0, rowSpan: 1, colSpan: 1, bbox: { x1: r.x1, y1: r.y1, x2: r.x2, y2: r.y2 } }],
|
|
1075
|
+
...parentRect ? { clipParent: parentRect } : {}
|
|
1076
|
+
});
|
|
1077
|
+
continue;
|
|
1078
|
+
}
|
|
1058
1079
|
const members = idxs.map((i) => cells[i]);
|
|
1059
1080
|
let edges = 0, invisible = 0;
|
|
1060
1081
|
for (const r of members) {
|
|
@@ -1095,7 +1116,8 @@ function buildClipCellGrids(rects, strokedH, strokedV, pageWidth, pageHeight) {
|
|
|
1095
1116
|
colXs,
|
|
1096
1117
|
bbox: { x1: colXs[0], y1: rowYs[numRows], x2: colXs[numCols], y2: rowYs[0] },
|
|
1097
1118
|
vertexRadius: 1,
|
|
1098
|
-
cells: out
|
|
1119
|
+
cells: out,
|
|
1120
|
+
...parentRect ? { clipParent: parentRect } : {}
|
|
1099
1121
|
});
|
|
1100
1122
|
}
|
|
1101
1123
|
return { grids, containers };
|
|
@@ -3464,9 +3486,47 @@ function isProseBoxGrid(grid, verticals, table) {
|
|
|
3464
3486
|
if (longCells < PROSEBOX_LONG_CELL_MIN || longCells < texts.length * PROSEBOX_LONG_CELL_RATIO) return false;
|
|
3465
3487
|
return true;
|
|
3466
3488
|
}
|
|
3489
|
+
function cleanCellText(text) {
|
|
3490
|
+
const stripped = text.replace(/^[\s]*[-–—]\s*\d+\s*[-–—][\s]*$/gm, "").trim();
|
|
3491
|
+
return stripped.split("\n").map((line) => collapseEvenSpacing(line)).join("\n");
|
|
3492
|
+
}
|
|
3493
|
+
var FRAME_RECT_TOL = 1.5;
|
|
3494
|
+
function takePendingNested(pending, cellBox) {
|
|
3495
|
+
const out = [];
|
|
3496
|
+
for (let i = pending.length - 1; i >= 0; i--) {
|
|
3497
|
+
const p = pending[i].parent;
|
|
3498
|
+
if (Math.abs(p.x1 - cellBox.x1) <= FRAME_RECT_TOL && Math.abs(p.x2 - cellBox.x2) <= FRAME_RECT_TOL && Math.abs(p.y1 - cellBox.y1) <= FRAME_RECT_TOL && Math.abs(p.y2 - cellBox.y2) <= FRAME_RECT_TOL) {
|
|
3499
|
+
out.push(pending[i].block);
|
|
3500
|
+
pending.splice(i, 1);
|
|
3501
|
+
}
|
|
3502
|
+
}
|
|
3503
|
+
return out;
|
|
3504
|
+
}
|
|
3505
|
+
function buildFrameCellBlocks(cellItems, nested, pageNum) {
|
|
3506
|
+
const tables = [...nested].sort((a, b) => b.bbox.y + b.bbox.height - (a.bbox.y + a.bbox.height));
|
|
3507
|
+
const blocks = [];
|
|
3508
|
+
let rest = [...cellItems];
|
|
3509
|
+
const pushParagraphs = (items) => {
|
|
3510
|
+
if (items.length === 0) return;
|
|
3511
|
+
for (const line of cleanCellText(cellTextToString(items)).split("\n")) {
|
|
3512
|
+
const t = line.trim();
|
|
3513
|
+
if (t) blocks.push({ type: "paragraph", text: t, pageNumber: pageNum });
|
|
3514
|
+
}
|
|
3515
|
+
};
|
|
3516
|
+
for (const tb of tables) {
|
|
3517
|
+
const bottom = tb.bbox.y;
|
|
3518
|
+
pushParagraphs(rest.filter((it) => it.y >= bottom));
|
|
3519
|
+
rest = rest.filter((it) => it.y < bottom);
|
|
3520
|
+
blocks.push(tb);
|
|
3521
|
+
}
|
|
3522
|
+
pushParagraphs(rest);
|
|
3523
|
+
const text = blocks.map((b) => b.type === "table" && b.table ? b.table.cells.flat().map((c) => c.text).filter(Boolean).join("\n") : b.text ?? "").filter(Boolean).join("\n");
|
|
3524
|
+
return { blocks, text };
|
|
3525
|
+
}
|
|
3467
3526
|
function extractBlocksWithGrids(items, pageNum, grids, horizontals, verticals) {
|
|
3468
3527
|
const blocks = [];
|
|
3469
3528
|
const usedItems = /* @__PURE__ */ new Set();
|
|
3529
|
+
const pendingNested = [];
|
|
3470
3530
|
const gridArea = (g) => (g.bbox.x2 - g.bbox.x1) * (g.bbox.y2 - g.bbox.y1);
|
|
3471
3531
|
const sortedGrids = [...grids].sort((a, b) => (b.cells ? 1 : 0) - (a.cells ? 1 : 0) || (a.cells && b.cells ? gridArea(a) - gridArea(b) : 0) || b.bbox.y2 - a.bbox.y2);
|
|
3472
3532
|
for (const grid of sortedGrids) {
|
|
@@ -3506,13 +3566,18 @@ function extractBlocksWithGrids(items, pageNum, grids, horizontals, verticals) {
|
|
|
3506
3566
|
{ length: numRows },
|
|
3507
3567
|
() => Array.from({ length: numCols }, () => ({ text: "", colSpan: 1, rowSpan: 1 }))
|
|
3508
3568
|
);
|
|
3569
|
+
let nestedAttached = false;
|
|
3509
3570
|
for (const cell of cells) {
|
|
3510
3571
|
const cellItems = cellTextMap.get(cell) || [];
|
|
3511
|
-
|
|
3512
|
-
|
|
3513
|
-
|
|
3572
|
+
const nested = grid.cells ? takePendingNested(pendingNested, cell.bbox) : [];
|
|
3573
|
+
if (nested.length > 0) {
|
|
3574
|
+
nestedAttached = true;
|
|
3575
|
+
const built = buildFrameCellBlocks(cellItems, nested, pageNum);
|
|
3576
|
+
irGrid[cell.row][cell.col] = { text: built.text, colSpan: cell.colSpan, rowSpan: cell.rowSpan, blocks: built.blocks };
|
|
3577
|
+
continue;
|
|
3578
|
+
}
|
|
3514
3579
|
irGrid[cell.row][cell.col] = {
|
|
3515
|
-
text,
|
|
3580
|
+
text: cleanCellText(cellTextToString(cellItems)),
|
|
3516
3581
|
colSpan: cell.colSpan,
|
|
3517
3582
|
rowSpan: cell.rowSpan
|
|
3518
3583
|
};
|
|
@@ -3520,18 +3585,11 @@ function extractBlocksWithGrids(items, pageNum, grids, horizontals, verticals) {
|
|
|
3520
3585
|
let finalGrid = irGrid;
|
|
3521
3586
|
let finalRows = numRows;
|
|
3522
3587
|
let rebuiltUsed = false;
|
|
3523
|
-
if (numRows <= 2 && numCols >= 3) {
|
|
3588
|
+
if (numRows <= 2 && numCols >= 3 && !nestedAttached) {
|
|
3524
3589
|
const rebuilt = normalizeUndersegmentedTable(irGrid, grid.colXs, textItems);
|
|
3525
3590
|
if (rebuilt) {
|
|
3526
3591
|
rebuiltUsed = true;
|
|
3527
|
-
finalGrid = rebuilt.map((row) => row.map((rawText) => {
|
|
3528
|
-
const cleaned = rawText.replace(/^[\s]*[-–—]\s*\d+\s*[-–—][\s]*$/gm, "").trim();
|
|
3529
|
-
return {
|
|
3530
|
-
text: cleaned.split("\n").map((line) => collapseEvenSpacing(line)).join("\n"),
|
|
3531
|
-
colSpan: 1,
|
|
3532
|
-
rowSpan: 1
|
|
3533
|
-
};
|
|
3534
|
-
}));
|
|
3592
|
+
finalGrid = rebuilt.map((row) => row.map((rawText) => ({ text: cleanCellText(rawText), colSpan: 1, rowSpan: 1 })));
|
|
3535
3593
|
finalRows = finalGrid.length;
|
|
3536
3594
|
}
|
|
3537
3595
|
}
|
|
@@ -3548,6 +3606,11 @@ function extractBlocksWithGrids(items, pageNum, grids, horizontals, verticals) {
|
|
|
3548
3606
|
};
|
|
3549
3607
|
const hasContent = finalGrid.some((row) => row.some((cell) => cell.text.trim() !== ""));
|
|
3550
3608
|
if (!hasContent) continue;
|
|
3609
|
+
if (grid.clipParent) {
|
|
3610
|
+
const nb = { page: pageNum, x: grid.bbox.x1, y: grid.bbox.y1, width: grid.bbox.x2 - grid.bbox.x1, height: grid.bbox.y2 - grid.bbox.y1 };
|
|
3611
|
+
pendingNested.push({ parent: grid.clipParent, block: { type: "table", table: irTable, pageNumber: pageNum, bbox: nb } });
|
|
3612
|
+
continue;
|
|
3613
|
+
}
|
|
3551
3614
|
if (!grid.cells && isProseBoxGrid(grid, verticals, irTable)) {
|
|
3552
3615
|
for (const it of tableItems) usedItems.delete(it);
|
|
3553
3616
|
continue;
|
|
@@ -3569,6 +3632,7 @@ function extractBlocksWithGrids(items, pageNum, grids, horizontals, verticals) {
|
|
|
3569
3632
|
}
|
|
3570
3633
|
blocks.push({ type: "table", table: irTable, pageNumber: pageNum, bbox: tableBbox });
|
|
3571
3634
|
}
|
|
3635
|
+
for (const p of pendingNested) blocks.push(p.block);
|
|
3572
3636
|
let remaining = items.filter((i) => !usedItems.has(i));
|
|
3573
3637
|
const groupSizes = [];
|
|
3574
3638
|
let finalTextBlocks = [];
|
|
@@ -3878,4 +3942,4 @@ export {
|
|
|
3878
3942
|
extractPageBlocksWithLines,
|
|
3879
3943
|
mergeCrossPageTables
|
|
3880
3944
|
};
|
|
3881
|
-
//# sourceMappingURL=chunk-
|
|
3945
|
+
//# sourceMappingURL=chunk-OEYECZGV.js.map
|