kordoc 4.22.8 → 4.22.10
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 +7 -5
- package/dist/{-V3MHVWUQ.js → -K6ZEUCPU.js} +11 -11
- package/dist/{chunk-JNHUOGGQ.js → chunk-3HEWZNSJ.js} +2 -2
- package/dist/{chunk-JA4IIIEU.js → chunk-4OZKQ4ET.js} +2 -2
- package/dist/{chunk-TDCHLOY6.cjs → chunk-55JC3WIX.cjs} +3 -3
- package/dist/{chunk-TDCHLOY6.cjs.map → chunk-55JC3WIX.cjs.map} +1 -1
- package/dist/{chunk-GVRCO3KT.js → chunk-5QEVIUXM.js} +2 -2
- package/dist/{chunk-RNBU6S2X.js → chunk-5RBT7L72.js} +2 -2
- package/dist/{chunk-P53VOW4B.js → chunk-5TVTSRHH.js} +3 -3
- package/dist/{chunk-VGRTUHAU.js → chunk-6ZQ47CXH.js} +3 -3
- package/dist/{chunk-YSTWJWOY.js → chunk-7YDXV44H.js} +4 -4
- package/dist/{chunk-ORFDIAP3.js → chunk-A65TQXWP.js} +4 -4
- package/dist/{chunk-XZZ7WOCP.js → chunk-APEYJ6G5.js} +2 -2
- package/dist/{chunk-XZZ7WOCP.js.map → chunk-APEYJ6G5.js.map} +1 -1
- package/dist/{chunk-YBD5XGFC.js → chunk-ATSTJQMI.js} +84 -21
- package/dist/chunk-ATSTJQMI.js.map +1 -0
- package/dist/{chunk-K5UU73BA.js → chunk-AXOFVPF2.js} +2 -2
- package/dist/{chunk-UDB4YKOP.cjs → chunk-D7FPRPEZ.cjs} +2 -2
- package/dist/{chunk-UDB4YKOP.cjs.map → chunk-D7FPRPEZ.cjs.map} +1 -1
- package/dist/{chunk-P7UB5SMI.js → chunk-FMVSQED7.js} +2 -2
- package/dist/{chunk-KZSDBXWS.js → chunk-GWYFJQL7.js} +11 -11
- package/dist/{chunk-LSOFR4R2.cjs → chunk-HRFGBMVO.cjs} +6 -6
- package/dist/{chunk-LSOFR4R2.cjs.map → chunk-HRFGBMVO.cjs.map} +1 -1
- package/dist/{chunk-TVCGPOCE.js → chunk-HTPPDXDH.js} +2 -2
- package/dist/{chunk-YDAGUSKH.js → chunk-JJSSXV55.js} +2 -2
- package/dist/{chunk-DUQJ7EBY.js → chunk-K65R6PB4.js} +2 -2
- package/dist/{chunk-4OMXOT6T.js → chunk-LAZZEGT4.js} +3 -3
- package/dist/{chunk-V7BK7IKP.js → chunk-M4P52HHG.js} +2 -2
- package/dist/{chunk-Z5Z7HOER.js → chunk-M7AXOSY5.js} +4 -4
- package/dist/{chunk-5TYEUZGN.cjs → chunk-MILWFVER.cjs} +3 -3
- package/dist/{chunk-5TYEUZGN.cjs.map → chunk-MILWFVER.cjs.map} +1 -1
- package/dist/{chunk-I6XE7VJQ.js → chunk-NU4IFUHW.js} +2 -2
- package/dist/{chunk-OXVNNCQQ.js → chunk-TUEX7M4N.js} +2 -2
- package/dist/{chunk-LM3PI43Q.js → chunk-VLAYMRFS.js} +2 -2
- package/dist/{chunk-RAZJF5QW.cjs → chunk-WCXPF7PT.cjs} +24 -24
- package/dist/{chunk-RAZJF5QW.cjs.map → chunk-WCXPF7PT.cjs.map} +1 -1
- package/dist/{chunk-5YXW5RLC.cjs → chunk-ZN4BGNYO.cjs} +23 -23
- package/dist/{chunk-5YXW5RLC.cjs.map → chunk-ZN4BGNYO.cjs.map} +1 -1
- package/dist/{chunk-D7A5NKP3.js → chunk-ZWBFTG3T.js} +2 -2
- package/dist/{chunk-D7A5NKP3.js.map → chunk-ZWBFTG3T.js.map} +1 -1
- package/dist/chunks-A4DKG5YP.js +10 -0
- package/dist/cli.js +30 -30
- package/dist/{formula-SPMFPBGU.js → formula-J5DTOYGK.js} +4 -4
- package/dist/{formula-246A2T5B.cjs → formula-SOILYG2T.cjs} +9 -9
- package/dist/{formula-246A2T5B.cjs.map → formula-SOILYG2T.cjs.map} +1 -1
- package/dist/{formula-HO2NNWVN.js → formula-YYMYI32F.js} +3 -3
- package/dist/{image-ocr-YRACG6TO.cjs → image-ocr-2FQTSQAQ.cjs} +17 -17
- package/dist/{image-ocr-YRACG6TO.cjs.map → image-ocr-2FQTSQAQ.cjs.map} +1 -1
- package/dist/{image-ocr-G2UUJPBI.js → image-ocr-EXZCN2Q5.js} +9 -9
- package/dist/{image-ocr-WSRZMXYM.js → image-ocr-HXLPIDJH.js} +6 -6
- package/dist/index.cjs +473 -410
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +84 -21
- package/dist/index.js.map +1 -1
- package/dist/mcp.js +30 -23
- package/dist/mcp.js.map +1 -1
- package/dist/{model-bundle-CJACYVVC.js → model-bundle-L2OLSYAW.js} +5 -5
- package/dist/{models-HGIMOYGX.js → models-A4JR64CR.js} +5 -5
- package/dist/{parse-worker-v2-7GQJ5IGY.js → parse-worker-v2-YCNMSEIB.js} +12 -12
- package/dist/{parser-TW2QXVZR.js → parser-2QCANHDO.js} +9 -9
- package/dist/{parser-Q3W25PYR.cjs → parser-S3IJOFFP.cjs} +157 -157
- package/dist/{parser-Q3W25PYR.cjs.map → parser-S3IJOFFP.cjs.map} +1 -1
- package/dist/{parser-23M44GFD.js → parser-WFLZFNN4.js} +12 -12
- package/dist/pdf-ocr-6S4U4T56.cjs +31 -0
- package/dist/{pdf-ocr-RAJ33NDH.cjs.map → pdf-ocr-6S4U4T56.cjs.map} +1 -1
- package/dist/{pdf-ocr-RZR2VPQD.js → pdf-ocr-MXOMLVFC.js} +6 -6
- package/dist/{pdf-ocr-DHVUQ4H2.js → pdf-ocr-UBQ4K63F.js} +9 -9
- package/dist/{profile-io-TP5LYMSB.js → profile-io-PIHSFGQ6.js} +3 -3
- package/dist/{rasterize-RENNLGB3.js → rasterize-7GBVLJG4.js} +3 -3
- package/dist/{redact-doc-TRBUJ3EL.js → redact-doc-CVJWVNKE.js} +11 -11
- package/dist/{render-3X6FI2WM.js → render-FQN7Y52S.js} +7 -7
- package/dist/seal-FZGFDRBC.js +10 -0
- package/dist/{setup-F7JGWFDW.js → setup-JTVGMAJB.js} +3 -3
- package/dist/visual-SNHWQXSM.js +21 -0
- package/dist/{watch-QYVW2AG6.js → watch-5MU2GVS4.js} +12 -12
- package/package.json +1 -1
- package/dist/chunk-YBD5XGFC.js.map +0 -1
- package/dist/chunks-OV75DVHD.js +0 -10
- package/dist/pdf-ocr-RAJ33NDH.cjs +0 -31
- package/dist/seal-M5GYTAPE.js +0 -10
- package/dist/visual-PZRC23GE.js +0 -21
- /package/dist/{-V3MHVWUQ.js.map → -K6ZEUCPU.js.map} +0 -0
- /package/dist/{chunk-JNHUOGGQ.js.map → chunk-3HEWZNSJ.js.map} +0 -0
- /package/dist/{chunk-JA4IIIEU.js.map → chunk-4OZKQ4ET.js.map} +0 -0
- /package/dist/{chunk-GVRCO3KT.js.map → chunk-5QEVIUXM.js.map} +0 -0
- /package/dist/{chunk-RNBU6S2X.js.map → chunk-5RBT7L72.js.map} +0 -0
- /package/dist/{chunk-P53VOW4B.js.map → chunk-5TVTSRHH.js.map} +0 -0
- /package/dist/{chunk-VGRTUHAU.js.map → chunk-6ZQ47CXH.js.map} +0 -0
- /package/dist/{chunk-YSTWJWOY.js.map → chunk-7YDXV44H.js.map} +0 -0
- /package/dist/{chunk-ORFDIAP3.js.map → chunk-A65TQXWP.js.map} +0 -0
- /package/dist/{chunk-K5UU73BA.js.map → chunk-AXOFVPF2.js.map} +0 -0
- /package/dist/{chunk-P7UB5SMI.js.map → chunk-FMVSQED7.js.map} +0 -0
- /package/dist/{chunk-KZSDBXWS.js.map → chunk-GWYFJQL7.js.map} +0 -0
- /package/dist/{chunk-TVCGPOCE.js.map → chunk-HTPPDXDH.js.map} +0 -0
- /package/dist/{chunk-YDAGUSKH.js.map → chunk-JJSSXV55.js.map} +0 -0
- /package/dist/{chunk-DUQJ7EBY.js.map → chunk-K65R6PB4.js.map} +0 -0
- /package/dist/{chunk-4OMXOT6T.js.map → chunk-LAZZEGT4.js.map} +0 -0
- /package/dist/{chunk-V7BK7IKP.js.map → chunk-M4P52HHG.js.map} +0 -0
- /package/dist/{chunk-Z5Z7HOER.js.map → chunk-M7AXOSY5.js.map} +0 -0
- /package/dist/{chunk-I6XE7VJQ.js.map → chunk-NU4IFUHW.js.map} +0 -0
- /package/dist/{chunk-OXVNNCQQ.js.map → chunk-TUEX7M4N.js.map} +0 -0
- /package/dist/{chunk-LM3PI43Q.js.map → chunk-VLAYMRFS.js.map} +0 -0
- /package/dist/{chunks-OV75DVHD.js.map → chunks-A4DKG5YP.js.map} +0 -0
- /package/dist/{formula-SPMFPBGU.js.map → formula-J5DTOYGK.js.map} +0 -0
- /package/dist/{formula-HO2NNWVN.js.map → formula-YYMYI32F.js.map} +0 -0
- /package/dist/{image-ocr-G2UUJPBI.js.map → image-ocr-EXZCN2Q5.js.map} +0 -0
- /package/dist/{image-ocr-WSRZMXYM.js.map → image-ocr-HXLPIDJH.js.map} +0 -0
- /package/dist/{model-bundle-CJACYVVC.js.map → model-bundle-L2OLSYAW.js.map} +0 -0
- /package/dist/{models-HGIMOYGX.js.map → models-A4JR64CR.js.map} +0 -0
- /package/dist/{parse-worker-v2-7GQJ5IGY.js.map → parse-worker-v2-YCNMSEIB.js.map} +0 -0
- /package/dist/{parser-TW2QXVZR.js.map → parser-2QCANHDO.js.map} +0 -0
- /package/dist/{parser-23M44GFD.js.map → parser-WFLZFNN4.js.map} +0 -0
- /package/dist/{pdf-ocr-DHVUQ4H2.js.map → pdf-ocr-MXOMLVFC.js.map} +0 -0
- /package/dist/{pdf-ocr-RZR2VPQD.js.map → pdf-ocr-UBQ4K63F.js.map} +0 -0
- /package/dist/{profile-io-TP5LYMSB.js.map → profile-io-PIHSFGQ6.js.map} +0 -0
- /package/dist/{rasterize-RENNLGB3.js.map → rasterize-7GBVLJG4.js.map} +0 -0
- /package/dist/{redact-doc-TRBUJ3EL.js.map → redact-doc-CVJWVNKE.js.map} +0 -0
- /package/dist/{render-3X6FI2WM.js.map → render-FQN7Y52S.js.map} +0 -0
- /package/dist/{seal-M5GYTAPE.js.map → seal-FZGFDRBC.js.map} +0 -0
- /package/dist/{setup-F7JGWFDW.js.map → setup-JTVGMAJB.js.map} +0 -0
- /package/dist/{visual-PZRC23GE.js.map → visual-SNHWQXSM.js.map} +0 -0
- /package/dist/{watch-QYVW2AG6.js.map → watch-5MU2GVS4.js.map} +0 -0
package/dist/index.js
CHANGED
|
@@ -2,7 +2,7 @@ import {
|
|
|
2
2
|
blocksToPages,
|
|
3
3
|
bmpToPng,
|
|
4
4
|
inlineImagesIntoMarkdown
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-M4P52HHG.js";
|
|
6
6
|
import {
|
|
7
7
|
parsePageRange
|
|
8
8
|
} from "./chunk-V4BH5SRQ.js";
|
|
@@ -43,7 +43,7 @@ import {
|
|
|
43
43
|
validateOcrOptions,
|
|
44
44
|
visibleText,
|
|
45
45
|
wrapScript
|
|
46
|
-
} from "./chunk-
|
|
46
|
+
} from "./chunk-AXOFVPF2.js";
|
|
47
47
|
import {
|
|
48
48
|
KordocError,
|
|
49
49
|
OPTIONAL_DEP_INSTALL_HINT,
|
|
@@ -61,7 +61,7 @@ import {
|
|
|
61
61
|
toArrayBuffer,
|
|
62
62
|
unescapeHtml,
|
|
63
63
|
unzipLimitBytes
|
|
64
|
-
} from "./chunk-
|
|
64
|
+
} from "./chunk-APEYJ6G5.js";
|
|
65
65
|
|
|
66
66
|
// src/plain-markdown.ts
|
|
67
67
|
function toPlainMarkdown(md2) {
|
|
@@ -24604,7 +24604,7 @@ var MIN_SIDE = 24;
|
|
|
24604
24604
|
async function ocrEmbeddedImages(blocks, options, warnings) {
|
|
24605
24605
|
const ocr = options?.ocr;
|
|
24606
24606
|
if (ocr !== true && ocr !== "force" && typeof ocr !== "function") return false;
|
|
24607
|
-
const { parseImageDocument } = await import("./image-ocr-
|
|
24607
|
+
const { parseImageDocument } = await import("./image-ocr-HXLPIDJH.js");
|
|
24608
24608
|
let inserted = false, unreadable = 0;
|
|
24609
24609
|
let failed = null;
|
|
24610
24610
|
const walk = async (list, depth) => {
|
|
@@ -35086,6 +35086,13 @@ for (const [face, fix] of Object.entries(FACE_WIDTH_FIX)) {
|
|
|
35086
35086
|
}
|
|
35087
35087
|
FONTS[face] = { ...m, ascii, ex };
|
|
35088
35088
|
}
|
|
35089
|
+
var CHE_HALF = "0-1f 7f a0 a2-a3 a5-a6 a9 ab-ac af b5 bb c0-c5 c7-cf d1-d6 d9-dd e0-e5 e7-ef f1-f6 f9-fd ff-110 112-125 128-130 134-137 139-13e 143-148 14c-151 154-165 168-17f 192 1fa-1ff 2c6 2c9 2dc 37e 384-38a 38c 38e-390 3aa-3b0 3c2 3ca-3ce 402-40c 40e-40f 452-45c 45e-45f 490-491 1e80-1e85 1ef2-1ef3 2013-2014 2017 201a-201b 201e 2022 2039-203a 203c 203e 2044 20a3-20a4 20a7 20a9 2105 212e 21a8 2206 2212 2215 2219 221f 2248 2302 2310 2320-2321 2550-256c 2580 2584 2588 258c 2590-2591 2593 25aa-25ac 25ba 25c4 25ca 25d8-25d9 25e6 263a-263c 2666 266b fb01-fb02";
|
|
35090
|
+
var cheEx = { ...FONTS["\uAD74\uB9BC\uCCB4"].ex };
|
|
35091
|
+
for (const r of CHE_HALF.split(" ")) {
|
|
35092
|
+
const [a, b] = r.split("-").map((x) => parseInt(x, 16));
|
|
35093
|
+
for (let c = a; c <= (b ?? a); c++) cheEx[c] = 500;
|
|
35094
|
+
}
|
|
35095
|
+
FONTS["\uAD74\uB9BC\uCCB4"] = FONTS["\uB3CB\uC6C0\uCCB4"] = { ...FONTS["\uAD74\uB9BC\uCCB4"], ex: cheEx };
|
|
35089
35096
|
for (const [face, wm] of Object.entries(seoulFontWidths())) {
|
|
35090
35097
|
const m = FONTS[face], ascii = m ? [...m.ascii] : new Array(95).fill(500), ex = m ? { ...m.ex } : {};
|
|
35091
35098
|
for (const [cp, w] of wm) {
|
|
@@ -35196,7 +35203,7 @@ function isHanja(cp) {
|
|
|
35196
35203
|
function fontWidthFn(face, fallback = true) {
|
|
35197
35204
|
if (!hasFontMetrics(face)) return null;
|
|
35198
35205
|
const m = FONTS[face.trim()];
|
|
35199
|
-
return (cp) => cp >= 32 && cp <= 126 ? m.ascii[cp - 32] : m.ex[cp] ??
|
|
35206
|
+
return (cp) => cp >= 32 && cp <= 126 ? m.ascii[cp - 32] : (fallback ? m.ex[cp] ?? HANCOM_FALLBACK_W[cp] : void 0) ?? (isHalfwidthForm(cp) ? 500 : m.han !== void 0 && isHanja(cp) ? m.han : m.cjk);
|
|
35200
35207
|
}
|
|
35201
35208
|
function isHalfwidthForm(cp) {
|
|
35202
35209
|
return cp >= 65377 && cp <= 65500 || cp >= 65512 && cp <= 65518;
|
|
@@ -49956,7 +49963,30 @@ function solveBoundaries(constraints, count, total) {
|
|
|
49956
49963
|
for (let k = 1; k <= count; k++) if (out[k] < out[k - 1]) out[k] = out[k - 1];
|
|
49957
49964
|
return out;
|
|
49958
49965
|
}
|
|
49959
|
-
function
|
|
49966
|
+
function longestPathBoundaries(constraints, count) {
|
|
49967
|
+
const inner = constraints.filter((c) => c.a >= 0 && c.b <= count && c.a < c.b && !(c.a === 0 && c.b === count));
|
|
49968
|
+
const x = new Array(count + 1).fill(Number.NEGATIVE_INFINITY);
|
|
49969
|
+
x[0] = 0;
|
|
49970
|
+
for (let k = 1; k <= count; k++) {
|
|
49971
|
+
for (const c of inner) if (c.b === k && x[c.a] > Number.NEGATIVE_INFINITY) x[k] = Math.max(x[k], x[c.a] + c.size);
|
|
49972
|
+
if (x[k] === Number.NEGATIVE_INFINITY) return null;
|
|
49973
|
+
x[k] = Math.max(x[k], x[k - 1]);
|
|
49974
|
+
}
|
|
49975
|
+
const y = new Array(count + 1).fill(Number.NEGATIVE_INFINITY);
|
|
49976
|
+
y[count] = 0;
|
|
49977
|
+
for (let k = count - 1; k >= 0; k--) {
|
|
49978
|
+
y[k] = y[k + 1];
|
|
49979
|
+
for (const c of inner) if (c.a === k && y[c.b] > Number.NEGATIVE_INFINITY) y[k] = Math.max(y[k], c.size + y[c.b]);
|
|
49980
|
+
}
|
|
49981
|
+
return { x, tight: x.map((v, k) => Math.abs(v + y[k] - x[count]) <= 2) };
|
|
49982
|
+
}
|
|
49983
|
+
function tableColumnBoundaries(constraints, count, total) {
|
|
49984
|
+
const prop = solveBoundaries(constraints, count, total);
|
|
49985
|
+
if (!total || total <= 0) return prop;
|
|
49986
|
+
const lp = longestPathBoundaries(constraints, count);
|
|
49987
|
+
return lp && Math.abs(lp.x[count] - total) <= 2 && lp.x.every((v, k) => Math.abs(v - prop[k]) <= 2 || lp.tight[k]) ? lp.x : prop;
|
|
49988
|
+
}
|
|
49989
|
+
function solveRowHeights(cells, rowCount, maxTotal = Number.POSITIVE_INFINITY) {
|
|
49960
49990
|
const h = new Array(rowCount).fill(0);
|
|
49961
49991
|
for (const c of cells) {
|
|
49962
49992
|
if (c.rowSpan === 1 && c.rowAddr >= 0 && c.rowAddr < rowCount) {
|
|
@@ -49994,6 +50024,15 @@ function solveRowHeights(cells, rowCount) {
|
|
|
49994
50024
|
for (let k = 0; k < spans.length; k++) if (!done.has(k) && solve(k, true)) again = true;
|
|
49995
50025
|
}
|
|
49996
50026
|
for (let k = 0; k < spans.length; k++) if (!done.has(k)) solve(k, false);
|
|
50027
|
+
let total = h.reduce((s, x) => s + x, 0);
|
|
50028
|
+
for (const { c, rows } of [...spans].sort((a, b) => a.rows[a.rows.length - 1] - b.rows[b.rows.length - 1] || b.rows[0] - a.rows[0])) {
|
|
50029
|
+
const known = rows.reduce((s, r) => s + h[r], 0);
|
|
50030
|
+
const add = Math.min(c.height - known, maxTotal - total);
|
|
50031
|
+
if (rows.length && add > 0) {
|
|
50032
|
+
h[rows[rows.length - 1]] += add;
|
|
50033
|
+
total += add;
|
|
50034
|
+
}
|
|
50035
|
+
}
|
|
49997
50036
|
return h;
|
|
49998
50037
|
}
|
|
49999
50038
|
|
|
@@ -50219,17 +50258,18 @@ function cellContentExtent(cell2, memo) {
|
|
|
50219
50258
|
if (hit !== void 0) return hit;
|
|
50220
50259
|
const cols = cellColumns(cell2.sub);
|
|
50221
50260
|
let ext = 0;
|
|
50222
|
-
let shift = 0, prevV = Number.NEGATIVE_INFINITY, prevEnd = 0;
|
|
50261
|
+
let shift = 0, prevV = Number.NEGATIVE_INFINITY, prevH = 0, prevEnd = 0;
|
|
50223
50262
|
for (const p of elements(cell2.sub)) {
|
|
50224
50263
|
if (ln(p) !== "p") continue;
|
|
50225
50264
|
const m = buildPara(p);
|
|
50226
50265
|
let firstShift = shift;
|
|
50227
50266
|
const lineTops = [];
|
|
50228
50267
|
m.segs.forEach((s, k) => {
|
|
50229
|
-
if (s.vertpos < prevV && !cols) shift = prevEnd - s.vertpos;
|
|
50268
|
+
if ((s.vertpos < prevV || s.vertpos === prevV && s.horzpos <= prevH && prevEnd - shift > s.vertpos) && !cols) shift = prevEnd - s.vertpos;
|
|
50230
50269
|
if (k === 0) firstShift = shift;
|
|
50231
50270
|
lineTops.push(s.vertpos + shift);
|
|
50232
50271
|
prevV = s.vertpos;
|
|
50272
|
+
prevH = s.horzpos;
|
|
50233
50273
|
prevEnd = s.vertpos + shift + s.textheight + (s.spacing ?? 0);
|
|
50234
50274
|
ext = Math.max(ext, s.vertpos + s.textheight + shift);
|
|
50235
50275
|
});
|
|
@@ -50299,7 +50339,8 @@ function measureTableRowHeights(tbl2, memo) {
|
|
|
50299
50339
|
const sp = num2(tbl2, "cellSpacing");
|
|
50300
50340
|
const rows = solveRowHeights(
|
|
50301
50341
|
cells.map((c) => ({ rowAddr: c.ra, rowSpan: c.rs, height: c.h - sp * (c.rs - 1), contentH: c.rs === 1 ? cellContentExtent(c, memo) + c.marginT + c.marginB : void 0 })),
|
|
50302
|
-
nRows
|
|
50342
|
+
nRows,
|
|
50343
|
+
num2(findChildByLocalName(tbl2, "sz"), "height") - (sp > 0 ? sp * (nRows + 1) : 0) || Number.POSITIVE_INFINITY
|
|
50303
50344
|
);
|
|
50304
50345
|
if (sp > 0) {
|
|
50305
50346
|
for (let r = 0; r < rows.length; r++) rows[r] += sp;
|
|
@@ -51666,7 +51707,14 @@ function reflowBlockFlow(container, doc, styles, areaW, mode, counter, bodyH) {
|
|
|
51666
51707
|
const split3 = splitFloatTableRemainder(p, startV, lim, bodyH, styles, true);
|
|
51667
51708
|
const lsa = findChildByLocalName(p, "linesegarray");
|
|
51668
51709
|
const own = lsa ? elements2(lsa).filter((e) => ln2(e) === "lineseg") : [];
|
|
51669
|
-
|
|
51710
|
+
const sq = m0Objs(p), sqPos = sq ? findChildByLocalName(sq, "pos") : null;
|
|
51711
|
+
const sqVo = num3(sqPos, "vertOffset"), sqTop = startV + Math.max(0, sqVo >= 2 ** 31 ? sqVo - 2 ** 32 : sqVo) + num3(sq ? findChildByLocalName(sq, "outMargin") : null, "top");
|
|
51712
|
+
if (split3 !== void 0 && sq && own.length && own.every((sg) => num3(sg, "vertpos") + num3(sg, "vertsize") <= sqTop)) {
|
|
51713
|
+
cursorV = 0;
|
|
51714
|
+
floatFloor = split3;
|
|
51715
|
+
zones.length = 0;
|
|
51716
|
+
splitPage = true;
|
|
51717
|
+
} else if (split3 !== void 0 && own.length) {
|
|
51670
51718
|
const d = split3 - num3(own[0], "vertpos");
|
|
51671
51719
|
for (const sg of own) sg.setAttribute("vertpos", String(num3(sg, "vertpos") + d));
|
|
51672
51720
|
cursorV = res.textBottom + d;
|
|
@@ -52028,17 +52076,19 @@ function stackedFloats(c) {
|
|
|
52028
52076
|
}
|
|
52029
52077
|
function cellLineBoxes(c) {
|
|
52030
52078
|
const out = [];
|
|
52031
|
-
let shift = 0, prevV = Number.NEGATIVE_INFINITY, prevEnd = 0, part = 0;
|
|
52079
|
+
let shift = 0, prevV = Number.NEGATIVE_INFINITY, prevH = 0, prevSavedEnd = 0, prevEnd = 0, part = 0;
|
|
52032
52080
|
const cols = cellColumns(c.sub);
|
|
52033
52081
|
for (const p of c.sub ? elements(c.sub) : []) if (ln(p) === "p") {
|
|
52034
52082
|
const lsa = findChildByLocalName(p, "linesegarray");
|
|
52035
52083
|
for (const sg of lsa ? elements(lsa) : []) if (ln(sg) === "lineseg") {
|
|
52036
|
-
const v = num2(sg, "vertpos");
|
|
52037
|
-
if (v < prevV && !cols) {
|
|
52084
|
+
const v = num2(sg, "vertpos"), hz = num2(sg, "horzpos");
|
|
52085
|
+
if ((v < prevV || v === prevV && hz <= prevH && prevSavedEnd > v) && !cols) {
|
|
52038
52086
|
shift = prevEnd - v;
|
|
52039
52087
|
part++;
|
|
52040
52088
|
}
|
|
52041
52089
|
prevV = v;
|
|
52090
|
+
prevH = hz;
|
|
52091
|
+
prevSavedEnd = v + num2(sg, "vertsize") + num2(sg, "spacing");
|
|
52042
52092
|
const top = v + shift, bottom = top + num2(sg, "vertsize");
|
|
52043
52093
|
prevEnd = bottom + num2(sg, "spacing");
|
|
52044
52094
|
out.push({ seg: sg, top, bottom, part, origin: shift });
|
|
@@ -52071,9 +52121,11 @@ function planTableRows(tbl2, cells, rowH, ty, MT, BODY_H, slack = 0, floatSpan,
|
|
|
52071
52121
|
let hdrRows = 0;
|
|
52072
52122
|
if (tbl2.getAttribute("repeatHeader") === "1") while (hdrRows < nRows && cells.some((c) => c.ra === hdrRows) && cells.filter((c) => c.ra === hdrRows).every((c) => c.el.getAttribute("header") === "1")) hdrRows++;
|
|
52073
52123
|
const contTop = MT + num2(findChildByLocalName(tbl2, "outMargin"), "top") + rowY[hdrRows];
|
|
52124
|
+
const outB = num2(findChildByLocalName(tbl2, "outMargin"), "bottom");
|
|
52074
52125
|
const cellSplit = tbl2.getAttribute("pageBreak") === "CELL";
|
|
52075
52126
|
const out = [];
|
|
52076
|
-
|
|
52127
|
+
const flows = (findChildByLocalName(tbl2, "pos")?.getAttribute("vertRelTo") ?? "PARA") === "PARA";
|
|
52128
|
+
let page = 0, y = ty, first = !flows || ty - MT < 2e3;
|
|
52077
52129
|
for (let r = 0; r < nRows; r++) {
|
|
52078
52130
|
let h = rowH[r];
|
|
52079
52131
|
const pieces = [];
|
|
@@ -52112,6 +52164,7 @@ function planTableRows(tbl2, cells, rowH, ty, MT, BODY_H, slack = 0, floatSpan,
|
|
|
52112
52164
|
if (boxes && hParts > 0) {
|
|
52113
52165
|
const declared = num2(findChildByLocalName(tbl2, "sz"), "height");
|
|
52114
52166
|
const led = /* @__PURE__ */ new Set();
|
|
52167
|
+
let firstPh = 0;
|
|
52115
52168
|
for (let k = 0; k <= hParts; k++) {
|
|
52116
52169
|
if (k > 0 && floatSpan) {
|
|
52117
52170
|
let lead = 0, place;
|
|
@@ -52142,8 +52195,11 @@ function planTableRows(tbl2, cells, rowH, ty, MT, BODY_H, slack = 0, floatSpan,
|
|
|
52142
52195
|
if (inK.length && next) toNext = Math.max(toNext, next.top - from + c.marginT + c.marginB);
|
|
52143
52196
|
}
|
|
52144
52197
|
const last = k === hParts;
|
|
52145
|
-
const
|
|
52146
|
-
const
|
|
52198
|
+
const cellH = Math.max(0, ...rowCells.map((c) => num2(findChildByLocalName(c.el, "cellSz"), "height")));
|
|
52199
|
+
const firstH = Math.min(declared > 0 && ty + declared - y >= ext ? Math.min(pageBottom - y, ty + declared - y) : pageBottom - y, Math.max(ext, cellH));
|
|
52200
|
+
const share = last && k === 1 ? Math.max(0, ...rowCells.filter((c) => tbl2.getAttribute("noAdjust") === "1" || /^(CENTER|BOTTOM)$/.test(c.sub?.getAttribute("vertAlign") ?? "")).map((c) => c.h - firstPh)) : 0;
|
|
52201
|
+
const ph = last ? Math.max(ext, share) : k === 0 ? firstH : toNext > 0 ? Math.min(pageBottom - contTop, toNext) : pageBottom - contTop;
|
|
52202
|
+
if (k === 0) firstPh = ph;
|
|
52147
52203
|
pieces.push({ page, y, h: ph, range });
|
|
52148
52204
|
if (!last) {
|
|
52149
52205
|
let span2 = 0, spanEnd = 0;
|
|
@@ -52247,7 +52303,7 @@ function planTableRows(tbl2, cells, rowH, ty, MT, BODY_H, slack = 0, floatSpan,
|
|
|
52247
52303
|
first = false;
|
|
52248
52304
|
continue;
|
|
52249
52305
|
}
|
|
52250
|
-
if (!first && y + h > pageBottom && r >= hdrRows) {
|
|
52306
|
+
if (!first && y + h + (cellSplit ? 0 : outB) > pageBottom && r >= hdrRows) {
|
|
52251
52307
|
page++;
|
|
52252
52308
|
y = contTop;
|
|
52253
52309
|
first = true;
|
|
@@ -52692,6 +52748,8 @@ function planLines(m, styles, numText = "") {
|
|
|
52692
52748
|
const headW = bu?.useInstWidth === false ? [...bu.ch].reduce((w, ch) => w + glyphWidth(ch, bst, false).w, 0) : bu ? measureTextWidth(bu.ch, bst.height, bst.ratio, { spacingPct: bst.spacing, faceClass: faceClassOf(bst.face) }) : 0;
|
|
52693
52749
|
const bulletW = bu ? paraHeadAdvance(bu, bst.height, headW) : 0;
|
|
52694
52750
|
const plans = [];
|
|
52751
|
+
const inlineW = /* @__PURE__ */ new Map();
|
|
52752
|
+
for (const o of m.objs) if (o.inline) inlineW.set(o.index, o.omL + o.width + o.omR);
|
|
52695
52753
|
for (let i = 0; i < m.segs.length; i++) {
|
|
52696
52754
|
const seg = m.segs[i];
|
|
52697
52755
|
const start = seg.textpos;
|
|
@@ -52703,6 +52761,11 @@ function planLines(m, styles, numText = "") {
|
|
|
52703
52761
|
let fixedW = 0;
|
|
52704
52762
|
for (let k = start; k < end && k < m.chars.length; k++) {
|
|
52705
52763
|
const c = m.chars[k];
|
|
52764
|
+
const ow = inlineW.get(k);
|
|
52765
|
+
if (ow !== void 0) {
|
|
52766
|
+
x += ow;
|
|
52767
|
+
continue;
|
|
52768
|
+
}
|
|
52706
52769
|
if (!c.tab) {
|
|
52707
52770
|
x += charW(c, styles);
|
|
52708
52771
|
continue;
|
|
@@ -53173,7 +53236,7 @@ function drawTable(tbl2, tx, ty, ctx, depth) {
|
|
|
53173
53236
|
const nCols = Math.max(...cells.map((c) => c.ca + c.cs));
|
|
53174
53237
|
const nRows = Math.max(...cells.map((c) => c.ra + c.rs));
|
|
53175
53238
|
const colCons = cells.map((c) => ({ a: c.ca, b: c.ca + c.cs, size: c.w }));
|
|
53176
|
-
const colX =
|
|
53239
|
+
const colX = tableColumnBoundaries(colCons, nCols, num2(tblSz, "width") || void 0);
|
|
53177
53240
|
const rowH = measureTableRowHeights(tbl2, ctx.extentMemo);
|
|
53178
53241
|
const rowY = [0];
|
|
53179
53242
|
for (let r = 0; r < nRows; r++) rowY.push(rowY[r] + rowH[r]);
|
|
@@ -53224,7 +53287,7 @@ function drawTable(tbl2, tx, ty, ctx, depth) {
|
|
|
53224
53287
|
}));
|
|
53225
53288
|
const va2 = c.sub.getAttribute("vertAlign") ?? "TOP";
|
|
53226
53289
|
const pieceOff = g3.pieces.map((pc, k) => {
|
|
53227
|
-
if (va2 === "TOP") return 0;
|
|
53290
|
+
if (va2 === "TOP" || k > 0) return 0;
|
|
53228
53291
|
const from = pc.range?.get(c.el)?.[0] ?? 0;
|
|
53229
53292
|
const bottoms = boxes.filter((b) => pieceOf(b.top) === k).map((b) => b.bottom - from);
|
|
53230
53293
|
if (!bottoms.length) return 0;
|
|
@@ -54905,7 +54968,7 @@ function scriptsOff(r, off) {
|
|
|
54905
54968
|
}
|
|
54906
54969
|
async function parseImage(buffer, options) {
|
|
54907
54970
|
try {
|
|
54908
|
-
const { parseImageDocument } = await import("./image-ocr-
|
|
54971
|
+
const { parseImageDocument } = await import("./image-ocr-HXLPIDJH.js");
|
|
54909
54972
|
const { blocks, warnings, lines } = await parseImageDocument(buffer, options);
|
|
54910
54973
|
stripScriptTags({ blocks });
|
|
54911
54974
|
return {
|
|
@@ -54969,7 +55032,7 @@ async function parseHwp(buffer, options) {
|
|
|
54969
55032
|
async function parsePdf(buffer, options) {
|
|
54970
55033
|
let parsePdfDocument;
|
|
54971
55034
|
try {
|
|
54972
|
-
const mod = await import("./parser-
|
|
55035
|
+
const mod = await import("./parser-2QCANHDO.js");
|
|
54973
55036
|
parsePdfDocument = mod.parsePdfDocument;
|
|
54974
55037
|
} catch {
|
|
54975
55038
|
return {
|