kordoc 4.25.5 → 4.25.6
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 +2 -2
- package/dist/{chunk-MSJ5PNU4.js → chunk-24J4EDVI.js} +2 -2
- package/dist/{chunk-LQECKSFZ.js → chunk-2RBIZALD.js} +8 -8
- package/dist/{chunk-BIYXEAPB.js → chunk-2VNL3FDS.js} +2 -2
- package/dist/{chunk-RVUTLW55.js → chunk-3URB7DI4.js} +2 -2
- package/dist/{chunk-M3XF63R2.js → chunk-3Y76RPK3.js} +6 -6
- package/dist/{chunk-WTYZ3ZF7.js → chunk-6L3VEOCI.js} +5 -5
- package/dist/{chunk-GKL5HC5U.js → chunk-6ZUQ6D3B.js} +6 -6
- package/dist/{chunk-FBIEJV6U.js → chunk-767ACEVN.js} +10 -4
- package/dist/{chunk-FBIEJV6U.js.map → chunk-767ACEVN.js.map} +2 -2
- package/dist/{chunk-QHDWV25F.js → chunk-D2WQC6ME.js} +18 -18
- package/dist/{chunk-TQ4ZM66H.js → chunk-D6MGUFRQ.js} +10 -10
- package/dist/{chunk-JKMM5YUX.js → chunk-DTUCE7H2.js} +2 -2
- package/dist/{chunk-6FQA6PD4.js → chunk-EDCNR6QZ.js} +2 -2
- package/dist/{chunk-KFRDHQU4.js → chunk-HMTLJJEC.js} +2 -2
- package/dist/{chunk-E6YEEM7Y.js → chunk-I7MD3WQR.js} +2 -2
- package/dist/{chunk-RXK3FHS5.js → chunk-IKQMEXGU.js} +4 -4
- package/dist/{chunk-KQBDAHB6.js → chunk-ILUYLDIW.js} +4 -4
- package/dist/{chunk-VL6BCOLO.js → chunk-IOADEIUV.js} +3 -3
- package/dist/{chunk-NAP746KZ.js → chunk-O4XRI7EC.js} +6 -6
- package/dist/{chunk-HP75SCKB.js → chunk-QQVTLNLV.js} +2 -2
- package/dist/{chunk-6HPTFECA.js → chunk-S4NQTGXD.js} +2 -2
- package/dist/{chunk-RTA4WJAJ.js → chunk-TH7SIDYM.js} +2 -2
- package/dist/{chunk-NY7DTOFT.js → chunk-VDF7ZVNW.js} +2 -2
- package/dist/{chunk-DYABE3CS.js → chunk-VHZYGCS4.js} +3 -3
- package/dist/{chunk-757KBA3R.js → chunk-VLOQQJ2D.js} +2 -2
- package/dist/{chunk-K42C2JMM.js → chunk-XI47ZEQB.js} +2 -2
- package/dist/{chunk-ZFL2PG3Z.js → chunk-ZEJCW4XP.js} +2 -2
- package/dist/chunks-GPCDFBSF.js +10 -0
- package/dist/cli.js +37 -37
- package/dist/{formula-PKUDP63D.js → formula-R6LXXMAS.js} +4 -4
- package/dist/{generator-IKCVYTYF.js → generator-ERKQ7LUN.js} +7 -7
- package/dist/{hancom-7PU6XSBN.js → hancom-VQUG46NV.js} +2 -2
- package/dist/{image-ocr-JKHVLMSE.js → image-ocr-MWQ6UDGP.js} +11 -11
- package/dist/index.cjs +113 -9
- package/dist/index.cjs.map +4 -4
- package/dist/index.js +21 -21
- package/dist/mcp.js +33 -33
- package/dist/memo-7UFH4MNW.js +15 -0
- package/dist/{model-bundle-2H5JXIGE.js → model-bundle-3F33HOS2.js} +5 -5
- package/dist/{models-LAZ7DT2W.js → models-PD6EQIHL.js} +5 -5
- package/dist/{page-images-EQRGLULC.js → page-images-MZECTCSJ.js} +2 -2
- package/dist/{parse-worker-v2-YUJFOQGN.js → parse-worker-v2-ZXURNYJZ.js} +23 -23
- package/dist/{parser-V4CJLGOF.js → parser-WAJNO5VU.js} +108 -18
- package/dist/parser-WAJNO5VU.js.map +7 -0
- package/dist/{pdf-ocr-VTZZKVN4.js → pdf-ocr-GTVOOQNV.js} +9 -9
- package/dist/{profile-io-Q3KPUBIU.js → profile-io-UQSLXMWG.js} +3 -3
- package/dist/{rasterize-FXMAWFFL.js → rasterize-3QDKNJC3.js} +3 -3
- package/dist/{redact-doc-MB3MJUGW.js → redact-doc-IBLP55CI.js} +22 -22
- package/dist/{render-3Q3CUSNA.js → render-EPOTL6LB.js} +10 -10
- package/dist/{rewrite-fallback-G7TPY7GG.js → rewrite-fallback-5GPUDXDK.js} +12 -12
- package/dist/seal-7YV46Q77.js +14 -0
- package/dist/{setup-AO3MYKJN.js → setup-CTWIURYW.js} +3 -3
- package/dist/{to-hwpx-JY5PXKO5.js → to-hwpx-OJNCWBXT.js} +7 -7
- package/dist/visual-U7X4QE2V.js +42 -0
- package/dist/{watch-ACKPD7EP.js → watch-NXUTGUPA.js} +22 -22
- package/package.json +1 -1
- package/dist/chunks-NCKJSFGF.js +0 -10
- package/dist/memo-XPC6DDIZ.js +0 -15
- package/dist/parser-V4CJLGOF.js.map +0 -7
- package/dist/seal-TNKVQBKP.js +0 -14
- package/dist/visual-HTAI7YR4.js +0 -42
- /package/dist/{chunk-MSJ5PNU4.js.map → chunk-24J4EDVI.js.map} +0 -0
- /package/dist/{chunk-LQECKSFZ.js.map → chunk-2RBIZALD.js.map} +0 -0
- /package/dist/{chunk-BIYXEAPB.js.map → chunk-2VNL3FDS.js.map} +0 -0
- /package/dist/{chunk-RVUTLW55.js.map → chunk-3URB7DI4.js.map} +0 -0
- /package/dist/{chunk-M3XF63R2.js.map → chunk-3Y76RPK3.js.map} +0 -0
- /package/dist/{chunk-WTYZ3ZF7.js.map → chunk-6L3VEOCI.js.map} +0 -0
- /package/dist/{chunk-GKL5HC5U.js.map → chunk-6ZUQ6D3B.js.map} +0 -0
- /package/dist/{chunk-QHDWV25F.js.map → chunk-D2WQC6ME.js.map} +0 -0
- /package/dist/{chunk-TQ4ZM66H.js.map → chunk-D6MGUFRQ.js.map} +0 -0
- /package/dist/{chunk-JKMM5YUX.js.map → chunk-DTUCE7H2.js.map} +0 -0
- /package/dist/{chunk-6FQA6PD4.js.map → chunk-EDCNR6QZ.js.map} +0 -0
- /package/dist/{chunk-KFRDHQU4.js.map → chunk-HMTLJJEC.js.map} +0 -0
- /package/dist/{chunk-E6YEEM7Y.js.map → chunk-I7MD3WQR.js.map} +0 -0
- /package/dist/{chunk-RXK3FHS5.js.map → chunk-IKQMEXGU.js.map} +0 -0
- /package/dist/{chunk-KQBDAHB6.js.map → chunk-ILUYLDIW.js.map} +0 -0
- /package/dist/{chunk-VL6BCOLO.js.map → chunk-IOADEIUV.js.map} +0 -0
- /package/dist/{chunk-NAP746KZ.js.map → chunk-O4XRI7EC.js.map} +0 -0
- /package/dist/{chunk-HP75SCKB.js.map → chunk-QQVTLNLV.js.map} +0 -0
- /package/dist/{chunk-6HPTFECA.js.map → chunk-S4NQTGXD.js.map} +0 -0
- /package/dist/{chunk-RTA4WJAJ.js.map → chunk-TH7SIDYM.js.map} +0 -0
- /package/dist/{chunk-NY7DTOFT.js.map → chunk-VDF7ZVNW.js.map} +0 -0
- /package/dist/{chunk-DYABE3CS.js.map → chunk-VHZYGCS4.js.map} +0 -0
- /package/dist/{chunk-757KBA3R.js.map → chunk-VLOQQJ2D.js.map} +0 -0
- /package/dist/{chunk-K42C2JMM.js.map → chunk-XI47ZEQB.js.map} +0 -0
- /package/dist/{chunk-ZFL2PG3Z.js.map → chunk-ZEJCW4XP.js.map} +0 -0
- /package/dist/{chunks-NCKJSFGF.js.map → chunks-GPCDFBSF.js.map} +0 -0
- /package/dist/{formula-PKUDP63D.js.map → formula-R6LXXMAS.js.map} +0 -0
- /package/dist/{generator-IKCVYTYF.js.map → generator-ERKQ7LUN.js.map} +0 -0
- /package/dist/{hancom-7PU6XSBN.js.map → hancom-VQUG46NV.js.map} +0 -0
- /package/dist/{image-ocr-JKHVLMSE.js.map → image-ocr-MWQ6UDGP.js.map} +0 -0
- /package/dist/{memo-XPC6DDIZ.js.map → memo-7UFH4MNW.js.map} +0 -0
- /package/dist/{model-bundle-2H5JXIGE.js.map → model-bundle-3F33HOS2.js.map} +0 -0
- /package/dist/{models-LAZ7DT2W.js.map → models-PD6EQIHL.js.map} +0 -0
- /package/dist/{page-images-EQRGLULC.js.map → page-images-MZECTCSJ.js.map} +0 -0
- /package/dist/{parse-worker-v2-YUJFOQGN.js.map → parse-worker-v2-ZXURNYJZ.js.map} +0 -0
- /package/dist/{pdf-ocr-VTZZKVN4.js.map → pdf-ocr-GTVOOQNV.js.map} +0 -0
- /package/dist/{profile-io-Q3KPUBIU.js.map → profile-io-UQSLXMWG.js.map} +0 -0
- /package/dist/{rasterize-FXMAWFFL.js.map → rasterize-3QDKNJC3.js.map} +0 -0
- /package/dist/{redact-doc-MB3MJUGW.js.map → redact-doc-IBLP55CI.js.map} +0 -0
- /package/dist/{render-3Q3CUSNA.js.map → render-EPOTL6LB.js.map} +0 -0
- /package/dist/{rewrite-fallback-G7TPY7GG.js.map → rewrite-fallback-5GPUDXDK.js.map} +0 -0
- /package/dist/{seal-TNKVQBKP.js.map → seal-7YV46Q77.js.map} +0 -0
- /package/dist/{setup-AO3MYKJN.js.map → setup-CTWIURYW.js.map} +0 -0
- /package/dist/{to-hwpx-JY5PXKO5.js.map → to-hwpx-OJNCWBXT.js.map} +0 -0
- /package/dist/{visual-HTAI7YR4.js.map → visual-U7X4QE2V.js.map} +0 -0
- /package/dist/{watch-ACKPD7EP.js.map → watch-NXUTGUPA.js.map} +0 -0
package/dist/cli.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import {
|
|
3
3
|
parseWorkerFile
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-IOADEIUV.js";
|
|
5
5
|
import {
|
|
6
6
|
parseFormatProfileJson
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-VLOQQJ2D.js";
|
|
8
8
|
import {
|
|
9
9
|
BODY_FONTS,
|
|
10
10
|
BULLET2_CHARS,
|
|
@@ -50,14 +50,14 @@ import {
|
|
|
50
50
|
unknownFontWarnings,
|
|
51
51
|
usesGaejosikMunche,
|
|
52
52
|
usesLogicStructure
|
|
53
|
-
} from "./chunk-
|
|
54
|
-
import "./chunk-
|
|
55
|
-
import "./chunk-
|
|
56
|
-
import "./chunk-
|
|
53
|
+
} from "./chunk-D2WQC6ME.js";
|
|
54
|
+
import "./chunk-2RBIZALD.js";
|
|
55
|
+
import "./chunk-TH7SIDYM.js";
|
|
56
|
+
import "./chunk-DTUCE7H2.js";
|
|
57
57
|
import {
|
|
58
58
|
extractClickHereFields
|
|
59
|
-
} from "./chunk-
|
|
60
|
-
import "./chunk-
|
|
59
|
+
} from "./chunk-D6MGUFRQ.js";
|
|
60
|
+
import "./chunk-HMTLJJEC.js";
|
|
61
61
|
import "./chunk-3UIIEZBT.js";
|
|
62
62
|
import {
|
|
63
63
|
PRESET_ALIAS,
|
|
@@ -66,11 +66,11 @@ import {
|
|
|
66
66
|
markdownToHwpx,
|
|
67
67
|
parseLeadingMarker,
|
|
68
68
|
resolveSectionPaths
|
|
69
|
-
} from "./chunk-
|
|
70
|
-
import "./chunk-
|
|
71
|
-
import "./chunk-
|
|
72
|
-
import "./chunk-
|
|
73
|
-
import "./chunk-
|
|
69
|
+
} from "./chunk-3Y76RPK3.js";
|
|
70
|
+
import "./chunk-VHZYGCS4.js";
|
|
71
|
+
import "./chunk-6ZUQ6D3B.js";
|
|
72
|
+
import "./chunk-IKQMEXGU.js";
|
|
73
|
+
import "./chunk-S4NQTGXD.js";
|
|
74
74
|
import {
|
|
75
75
|
extractFormFields,
|
|
76
76
|
fillPlan,
|
|
@@ -79,20 +79,20 @@ import {
|
|
|
79
79
|
import {
|
|
80
80
|
createXmlParser,
|
|
81
81
|
readZipEntry
|
|
82
|
-
} from "./chunk-
|
|
82
|
+
} from "./chunk-QQVTLNLV.js";
|
|
83
83
|
import "./chunk-HVXDD6QZ.js";
|
|
84
84
|
import {
|
|
85
85
|
hwpToHwpx
|
|
86
|
-
} from "./chunk-
|
|
86
|
+
} from "./chunk-O4XRI7EC.js";
|
|
87
87
|
import {
|
|
88
88
|
detectImageMime
|
|
89
|
-
} from "./chunk-
|
|
89
|
+
} from "./chunk-6L3VEOCI.js";
|
|
90
90
|
import "./chunk-T3CW5OXA.js";
|
|
91
91
|
import "./chunk-CG6DUPWU.js";
|
|
92
|
-
import "./chunk-
|
|
92
|
+
import "./chunk-XI47ZEQB.js";
|
|
93
93
|
import "./chunk-63UKHBUV.js";
|
|
94
94
|
import "./chunk-K4YTD6RG.js";
|
|
95
|
-
import "./chunk-
|
|
95
|
+
import "./chunk-VDF7ZVNW.js";
|
|
96
96
|
import "./chunk-W5CMIZUB.js";
|
|
97
97
|
import {
|
|
98
98
|
detectFormat,
|
|
@@ -102,14 +102,14 @@ import "./chunk-O5YMQ22P.js";
|
|
|
102
102
|
import "./chunk-ZVBVGSXC.js";
|
|
103
103
|
import "./chunk-M3E5NYSN.js";
|
|
104
104
|
import "./chunk-G5XEBGZD.js";
|
|
105
|
-
import "./chunk-
|
|
105
|
+
import "./chunk-I7MD3WQR.js";
|
|
106
106
|
import {
|
|
107
107
|
blocksToMarkdown
|
|
108
|
-
} from "./chunk-
|
|
108
|
+
} from "./chunk-24J4EDVI.js";
|
|
109
109
|
import "./chunk-RJCXOE4N.js";
|
|
110
110
|
import "./chunk-AY66PEUP.js";
|
|
111
|
-
import "./chunk-
|
|
112
|
-
import "./chunk-
|
|
111
|
+
import "./chunk-2VNL3FDS.js";
|
|
112
|
+
import "./chunk-EDCNR6QZ.js";
|
|
113
113
|
import {
|
|
114
114
|
KordocError,
|
|
115
115
|
VERSION,
|
|
@@ -119,7 +119,7 @@ import {
|
|
|
119
119
|
sanitizeError,
|
|
120
120
|
stripDtd,
|
|
121
121
|
toArrayBuffer
|
|
122
|
-
} from "./chunk-
|
|
122
|
+
} from "./chunk-3URB7DI4.js";
|
|
123
123
|
|
|
124
124
|
// src/cli.ts
|
|
125
125
|
import { Command, Option } from "commander";
|
|
@@ -270,7 +270,7 @@ async function convertFiles(files, opts, writeOutput = (text) => {
|
|
|
270
270
|
`);
|
|
271
271
|
}
|
|
272
272
|
} else if (opts.format === "chunks") {
|
|
273
|
-
const { blocksToChunks } = await import("./chunks-
|
|
273
|
+
const { blocksToChunks } = await import("./chunks-GPCDFBSF.js");
|
|
274
274
|
const chunks = blocksToChunks(result.blocks, { tableFormat: parseOptions.tableFormat }).map((c) => {
|
|
275
275
|
let text = c.text;
|
|
276
276
|
if (opts.plain) text = toPlainMarkdown(text);
|
|
@@ -454,7 +454,7 @@ function registerDocCommands(program2) {
|
|
|
454
454
|
if (command.getOptionValueSource("format") === "default" && program2.getOptionValueSource("format") === "cli") {
|
|
455
455
|
opts.format = rootOpts.format;
|
|
456
456
|
}
|
|
457
|
-
const { watchDirectory } = await import("./watch-
|
|
457
|
+
const { watchDirectory } = await import("./watch-NXUTGUPA.js");
|
|
458
458
|
await watchDirectory({
|
|
459
459
|
dir,
|
|
460
460
|
outDir: opts.outDir,
|
|
@@ -853,7 +853,7 @@ function registerDocCommands(program2) {
|
|
|
853
853
|
const result = format === "hwp" ? await patchHwp(originalBuf, editedMarkdown, { verify: opts.verify !== false, keepLineseg: opts.keepLineseg === true }) : await patchHwpx(originalBuf, editedMarkdown, { verify: opts.verify !== false, structure: opts.structure !== false });
|
|
854
854
|
const ext = format === "hwp" ? ".hwp" : ".hwpx";
|
|
855
855
|
const outPath = resolve3(output ?? original.replace(/\.hwpx?$/i, "") + ".patched" + ext);
|
|
856
|
-
const { needsRewrite, rewriteEdited, rewritePath } = await import("./rewrite-fallback-
|
|
856
|
+
const { needsRewrite, rewriteEdited, rewritePath } = await import("./rewrite-fallback-5GPUDXDK.js");
|
|
857
857
|
const rewrite = needsRewrite(result) ? await rewriteEdited(originalBuf, format !== "hwp", editedMarkdown, result.success) : null;
|
|
858
858
|
const rewriteOut = rewrite ? rewritePath(outPath) : void 0;
|
|
859
859
|
if (rewrite && rewriteOut) {
|
|
@@ -1737,7 +1737,7 @@ function registerGenerateCommands(program2) {
|
|
|
1737
1737
|
});
|
|
1738
1738
|
program2.command("redact <files...>").description("\uAC1C\uC778\uC815\uBCF4 \uC11C\uC2DD \uBCF4\uC874 \uB9C8\uC2A4\uD0B9 \u2014 \uC8FC\uBBFC\xB7\uC678\uAD6D\uC778\uB4F1\uB85D\uBC88\uD638\xB7\uC804\uD654\xB7\uC774\uBA54\uC77C\xB7\uCE74\uB4DC\xB7\uACC4\uC88C\xB7\uC0AC\uC5C5\uC790\uB4F1\uB85D\uBC88\uD638\xB7\uC5EC\uAD8C\xB7\uC6B4\uC804\uBA74\uD5C8(--rules \uB85C \uC778\uBA85\xB7\uC8FC\uC18C opt-in)\uB97C \uD0D0\uC9C0\uD574 HWPX/HWP\uB294 \uC6D0\uBCF8 \uC11C\uC2DD \uADF8\uB300\uB85C \uAC19\uC740 \uAE38\uC774\uB85C \uAC00\uB9B0 \uD30C\uC77C(\uBCF8\uBB38\xB7\uD45C\xB7\uBA38\uB9AC\uB9D0/\uAF2C\uB9AC\uB9D0\xB7\uAC01\uC8FC\xB7\uAE00\uC0C1\uC790\xB7\uBBF8\uB9AC\uBCF4\uAE30\xB7\uBA54\uD0C0\uB370\uC774\uD130 \uD3EC\uD568), \uADF8 \uC678 \uD3EC\uB9F7(PDF \uB4F1)\uC740 \uC6D0\uBCF8\uC744 \uAC74\uB4DC\uB9AC\uC9C0 \uC54A\uACE0 \uB9C8\uC2A4\uD0B9\uB41C \uB9C8\uD06C\uB2E4\uC6B4\uB9CC \uCD9C\uB825. \uC790\uB3D9 \uAC80\uCD9C \uBCF4\uC870 \uB3C4\uAD6C\uC774\uBBC0\uB85C \uACB0\uACFC\uB294 \uBC18\uB4DC\uC2DC \uC0AC\uB78C\uC774 \uCD5C\uC885 \uD655\uC778\uD558\uC138\uC694 (\uC774\uBBF8\uC9C0 \uC18D \uAE00\uC790\uB294 \uD0D0\uC9C0 \uBD88\uAC00)").option("--rules <csv>", "\uC801\uC6A9 \uB8F0 (\uAE30\uBCF8: rrn,phone,email,card,account,brn,passport,driver \u2014 crn(\uBC95\uC778\uB4F1\uB85D\uBC88\uD638),ip,name(\uC778\uBA85),address(\uC8FC\uC18C)\uB294 opt-in)").option("--model [variant]", "\uC778\uBA85\xB7\uC8FC\uC18C\uB97C \uD559\uC2B5 \uBAA8\uB378(schift-ko-pii-ax-v1)\uB85C\uB3C4 \uD0D0\uC9C0 \u2014 name\xB7address \uB8F0\uC744 \uD568\uAED8 \uCF2C. variant: int8(\uAE30\uBCF8, \uCC98\uC74C 151MB \uBC1B\uC74C)\xB7q4(81MB). onnxruntime-node \uD544\uC694, \uBAA8\uB378\uC740 Schift License v2.0").option("--mask-char <ch>", "\uB9C8\uC2A4\uD06C \uBB38\uC790 1\uAE00\uC790 (\uAE30\uBCF8: \u25CF)").option("-o, --output <path>", "\uCD9C\uB825 \uACBD\uB85C (\uB2E8\uC77C \uD30C\uC77C \uC2DC)").option("-d, --out-dir <dir>", "\uCD9C\uB825 \uB514\uB809\uD1A0\uB9AC (\uB2E4\uC911 \uD30C\uC77C \uC2DC)").option("--dry-run", "\uD0D0\uC9C0 \uB9AC\uD3EC\uD2B8\uB9CC \uCD9C\uB825, \uD30C\uC77C \uBBF8\uC0DD\uC131").option("--json", "\uB9AC\uD3EC\uD2B8\uB97C JSON\uC73C\uB85C stdout \uCD9C\uB825").option("--silent", "\uC9C4\uD589 \uBA54\uC2DC\uC9C0 \uC228\uAE30\uAE30").action(async (files, opts) => {
|
|
1739
1739
|
const { ALL_REDACT_RULES, DEFAULT_REDACT_RULES, redactText } = await import("./redact-M5UJUA23.js");
|
|
1740
|
-
const { redactDocument } = await import("./redact-doc-
|
|
1740
|
+
const { redactDocument } = await import("./redact-doc-IBLP55CI.js");
|
|
1741
1741
|
const rootOpts = program2.opts();
|
|
1742
1742
|
const output = opts.output ?? rootOpts.output;
|
|
1743
1743
|
const outDir = opts.outDir ?? rootOpts.outDir;
|
|
@@ -1958,7 +1958,7 @@ function registerRenderCommands(program2) {
|
|
|
1958
1958
|
const absPath = resolve7(file);
|
|
1959
1959
|
const stem = file.replace(/\.hwpx?$/i, "");
|
|
1960
1960
|
if (fmt === "svg" && !outDir && !pages && !/\.hwp$/i.test(absPath)) {
|
|
1961
|
-
const { renderHwpxToSvg } = await import("./render-
|
|
1961
|
+
const { renderHwpxToSvg } = await import("./render-EPOTL6LB.js");
|
|
1962
1962
|
const buffer = readFileSync6(absPath);
|
|
1963
1963
|
const result = await renderHwpxToSvg(toArrayBuffer(buffer), { highlights, reflow: opts.reflow, reflowMode: opts.reflowMode, password: rootOpts.password });
|
|
1964
1964
|
const outPath = resolve7(output ?? stem + ".svg");
|
|
@@ -1972,7 +1972,7 @@ function registerRenderCommands(program2) {
|
|
|
1972
1972
|
}
|
|
1973
1973
|
return;
|
|
1974
1974
|
}
|
|
1975
|
-
const { renderDocument } = await import("./render-
|
|
1975
|
+
const { renderDocument } = await import("./render-EPOTL6LB.js");
|
|
1976
1976
|
const { scene, assets } = await renderDocument(absPath, {
|
|
1977
1977
|
format: fmt,
|
|
1978
1978
|
pages,
|
|
@@ -2023,7 +2023,7 @@ function registerRenderCommands(program2) {
|
|
|
2023
2023
|
if (!outDir) throw new KordocError("--out-dir \uC774 \uD544\uC694\uD569\uB2C8\uB2E4 (crop \uC740 \uD30C\uC77C \uC5EC\uB7EC \uAC1C\uB97C \uB0C5\uB2C8\uB2E4)");
|
|
2024
2024
|
const types = String(opts.target).split(",").map((t) => t.trim()).filter(Boolean);
|
|
2025
2025
|
for (const t of types) if (!["table", "image", "paragraph", "shape"].includes(t)) throw new KordocError(`--target \uC720\uD615 \uC624\uB958: ${t}`);
|
|
2026
|
-
const { extractRenderedRegions } = await import("./render-
|
|
2026
|
+
const { extractRenderedRegions } = await import("./render-EPOTL6LB.js");
|
|
2027
2027
|
const regions = await extractRenderedRegions(resolve7(file), {
|
|
2028
2028
|
types,
|
|
2029
2029
|
format: fmt,
|
|
@@ -2061,7 +2061,7 @@ function registerRenderCommands(program2) {
|
|
|
2061
2061
|
if (policy !== "none" && !outDir) throw new KordocError("--visual \uC740 crop \uD30C\uC77C\uC744 \uB0B4\uBBC0\uB85C --out-dir \uC774 \uD544\uC694\uD569\uB2C8\uB2E4");
|
|
2062
2062
|
const cropFmt = String(opts.cropFormat);
|
|
2063
2063
|
if (!["png", "jpeg"].includes(cropFmt)) throw new KordocError(`--crop-format \uC740 png|jpeg: ${cropFmt}`);
|
|
2064
|
-
const { extractTables } = await import("./visual-
|
|
2064
|
+
const { extractTables } = await import("./visual-U7X4QE2V.js");
|
|
2065
2065
|
const tables = await extractTables(resolve7(file), { policy, format: cropFmt, paddingPt: Number(opts.padding) || 0 });
|
|
2066
2066
|
const dir = outDir ? resolve7(outDir) : void 0;
|
|
2067
2067
|
if (dir) mkdirSync6(dir, { recursive: true });
|
|
@@ -2105,7 +2105,7 @@ function registerRenderCommands(program2) {
|
|
|
2105
2105
|
});
|
|
2106
2106
|
program2.command("render-worker").description("persistent \uB80C\uB354 \uC6CC\uCEE4 \u2014 stdin NDJSON \uC694\uCCAD \u2192 \uC870\uD310 SVG \uD30C\uC77C \uCD9C\uB825 (\uD504\uB85C\uC138\uC2A4 \uC720\uC9C0, \uCF5C\uB4DC\uC2A4\uD0C0\uD2B8 \uC81C\uAC70)").action(async () => {
|
|
2107
2107
|
const { createInterface } = await import("node:readline");
|
|
2108
|
-
const { renderHwpxToSvg } = await import("./render-
|
|
2108
|
+
const { renderHwpxToSvg } = await import("./render-EPOTL6LB.js");
|
|
2109
2109
|
const rl = createInterface({ input: process.stdin });
|
|
2110
2110
|
const write = (o) => void process.stdout.write(JSON.stringify(o) + "\n");
|
|
2111
2111
|
write({ ready: true, version: VERSION });
|
|
@@ -2154,12 +2154,12 @@ function registerSystemCommands(program2) {
|
|
|
2154
2154
|
await startMcpServer();
|
|
2155
2155
|
});
|
|
2156
2156
|
program2.command("setup").description("\uB300\uD654\uD615 \uC124\uCE58 \uB9C8\uBC95\uC0AC \u2014 AI \uD074\uB77C\uC774\uC5B8\uD2B8 \uC790\uB3D9 \uB4F1\uB85D (Mac/Win/Linux)").action(async () => {
|
|
2157
|
-
const { runSetup } = await import("./setup-
|
|
2157
|
+
const { runSetup } = await import("./setup-CTWIURYW.js");
|
|
2158
2158
|
await runSetup();
|
|
2159
2159
|
});
|
|
2160
2160
|
program2.command("check-formula-models").description("PDF \uC218\uC2DD OCR \uBAA8\uB378(MFD + MFR + tokenizer, ~155MB) \uC0C1\uD0DC \uD655\uC778 \u2014 \uC5C6\uAC70\uB098 SHA \uBD88\uC77C\uCE58\uBA74 \uB2E4\uC6B4\uB85C\uB4DC").option("--status-only", "\uC0C1\uD0DC\uB9CC JSON \uC73C\uB85C \uCD9C\uB825 (\uB2E4\uC6B4\uB85C\uB4DC \uC548 \uD568)").action(async (opts) => {
|
|
2161
2161
|
try {
|
|
2162
|
-
const { getFormulaModelStatus, ensureFormulaModels, getFormulaModelsDir } = await import("./formula-
|
|
2162
|
+
const { getFormulaModelStatus, ensureFormulaModels, getFormulaModelsDir } = await import("./formula-R6LXXMAS.js");
|
|
2163
2163
|
const dir = getFormulaModelsDir();
|
|
2164
2164
|
if (opts.statusOnly) {
|
|
2165
2165
|
const status = await getFormulaModelStatus();
|
|
@@ -2213,7 +2213,7 @@ function registerSystemCommands(program2) {
|
|
|
2213
2213
|
});
|
|
2214
2214
|
program2.command("check-ocr-models").description("\uD14D\uC2A4\uD2B8 OCR \uBAA8\uB378(PP-OCRv5 korean det+rec, ~18MB) \uC0C1\uD0DC \uD655\uC778 \u2014 \uC5C6\uAC70\uB098 SHA \uBD88\uC77C\uCE58\uBA74 \uB2E4\uC6B4\uB85C\uB4DC").option("--status-only", "\uC0C1\uD0DC\uB9CC JSON \uC73C\uB85C \uCD9C\uB825 (\uB2E4\uC6B4\uB85C\uB4DC \uC548 \uD568)").action(async (opts) => {
|
|
2215
2215
|
try {
|
|
2216
|
-
const { getOcrModelStatus, ensureOcrModels, getOcrModelsDir } = await import("./models-
|
|
2216
|
+
const { getOcrModelStatus, ensureOcrModels, getOcrModelsDir } = await import("./models-PD6EQIHL.js");
|
|
2217
2217
|
const dir = getOcrModelsDir();
|
|
2218
2218
|
if (opts.statusOnly) {
|
|
2219
2219
|
const status = await getOcrModelStatus();
|
|
@@ -2267,7 +2267,7 @@ function registerSystemCommands(program2) {
|
|
|
2267
2267
|
});
|
|
2268
2268
|
program2.command("models").description("OCR/\uC218\uC2DD \uBAA8\uB378 \uC624\uD504\uB77C\uC778 \uC0AC\uC774\uB4DC\uB85C\uB4DC \u2014 \uD3D0\uC1C4\uB9DD \uBC18\uC785\uC6A9 \uB0B4\uBCF4\uB0B4\uAE30/\uAC00\uC838\uC624\uAE30 (SHA-256 \uAC80\uC99D)").option("--status", "\uCE90\uC2DC\uC5D0 \uC124\uCE58\uB41C \uBAA8\uB378 \uC0C1\uD0DC\uB97C JSON \uC73C\uB85C \uCD9C\uB825").option("--export <dir>", "\uB85C\uCEEC \uCE90\uC2DC \u2192 \uBC88\uB4E4 \uB514\uB809\uD1A0\uB9AC\uB85C \uB0B4\uBCF4\uB0B4\uAE30 (\uC628\uB77C\uC778 PC\uC5D0\uC11C \uC2E4\uD589)").option("--import <dir>", "\uBC88\uB4E4 \uB514\uB809\uD1A0\uB9AC \u2192 \uB85C\uCEEC \uCE90\uC2DC\uB85C \uC124\uCE58 (\uB0B4\uBD80\uB9DD PC\uC5D0\uC11C \uC2E4\uD589)").action(async (opts) => {
|
|
2269
2269
|
try {
|
|
2270
|
-
const { exportModels, importModels, modelCacheStatus } = await import("./model-bundle-
|
|
2270
|
+
const { exportModels, importModels, modelCacheStatus } = await import("./model-bundle-3F33HOS2.js");
|
|
2271
2271
|
if (opts.status) {
|
|
2272
2272
|
process.stdout.write(JSON.stringify(await modelCacheStatus(), null, 2) + "\n");
|
|
2273
2273
|
return;
|
|
@@ -2333,7 +2333,7 @@ function registerWorkerCommands(program2) {
|
|
|
2333
2333
|
const maxRequestBytes = limit(opts.maxRequestBytes, "--max-request-bytes");
|
|
2334
2334
|
const maxResponseBytes = limit(opts.maxResponseBytes, "--max-response-bytes");
|
|
2335
2335
|
routeConsoleToStderr();
|
|
2336
|
-
const { runParseWorkerV2 } = await import("./parse-worker-v2-
|
|
2336
|
+
const { runParseWorkerV2 } = await import("./parse-worker-v2-ZXURNYJZ.js");
|
|
2337
2337
|
await runParseWorkerV2({ maxRequestBytes, maxResponseBytes });
|
|
2338
2338
|
process.exit(0);
|
|
2339
2339
|
}
|
|
@@ -11,9 +11,9 @@ import {
|
|
|
11
11
|
ensureSingleModel,
|
|
12
12
|
getFormulaModelStatus,
|
|
13
13
|
getFormulaModelsDir
|
|
14
|
-
} from "./chunk-
|
|
15
|
-
import "./chunk-
|
|
16
|
-
import "./chunk-
|
|
14
|
+
} from "./chunk-2VNL3FDS.js";
|
|
15
|
+
import "./chunk-EDCNR6QZ.js";
|
|
16
|
+
import "./chunk-3URB7DI4.js";
|
|
17
17
|
|
|
18
18
|
// src/pdf/formula/postprocess.ts
|
|
19
19
|
var TRAILING_WHITESPACE_CMDS = [
|
|
@@ -1176,4 +1176,4 @@ export {
|
|
|
1176
1176
|
getFormulaModelsDir,
|
|
1177
1177
|
postProcessLatex
|
|
1178
1178
|
};
|
|
1179
|
-
//# sourceMappingURL=formula-
|
|
1179
|
+
//# sourceMappingURL=formula-R6LXXMAS.js.map
|
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
import {
|
|
2
2
|
markdownToHwpx
|
|
3
|
-
} from "./chunk-
|
|
4
|
-
import "./chunk-
|
|
3
|
+
} from "./chunk-3Y76RPK3.js";
|
|
4
|
+
import "./chunk-VHZYGCS4.js";
|
|
5
5
|
import "./chunk-OP4EPPXU.js";
|
|
6
|
-
import "./chunk-
|
|
6
|
+
import "./chunk-QQVTLNLV.js";
|
|
7
7
|
import "./chunk-HVXDD6QZ.js";
|
|
8
8
|
import "./chunk-CG6DUPWU.js";
|
|
9
9
|
import "./chunk-63UKHBUV.js";
|
|
10
10
|
import "./chunk-G5XEBGZD.js";
|
|
11
|
-
import "./chunk-
|
|
12
|
-
import "./chunk-
|
|
11
|
+
import "./chunk-I7MD3WQR.js";
|
|
12
|
+
import "./chunk-24J4EDVI.js";
|
|
13
13
|
import "./chunk-RJCXOE4N.js";
|
|
14
|
-
import "./chunk-
|
|
14
|
+
import "./chunk-3URB7DI4.js";
|
|
15
15
|
export {
|
|
16
16
|
markdownToHwpx
|
|
17
17
|
};
|
|
18
|
-
//# sourceMappingURL=generator-
|
|
18
|
+
//# sourceMappingURL=generator-ERKQ7LUN.js.map
|
|
@@ -5,7 +5,7 @@ import {
|
|
|
5
5
|
} from "./chunk-HVXDD6QZ.js";
|
|
6
6
|
import {
|
|
7
7
|
KordocError
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-3URB7DI4.js";
|
|
9
9
|
|
|
10
10
|
// src/hwp5/to-hwpx/hancom.ts
|
|
11
11
|
import { execFileSync } from "child_process";
|
|
@@ -87,4 +87,4 @@ export {
|
|
|
87
87
|
hancomSaveInvocation,
|
|
88
88
|
hwpToHwpxViaHancom
|
|
89
89
|
};
|
|
90
|
-
//# sourceMappingURL=hancom-
|
|
90
|
+
//# sourceMappingURL=hancom-VQUG46NV.js.map
|
|
@@ -2,7 +2,7 @@ import {
|
|
|
2
2
|
dcxPages,
|
|
3
3
|
heicToRgba,
|
|
4
4
|
pcxToRgba
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-HMTLJJEC.js";
|
|
6
6
|
import {
|
|
7
7
|
flushHeifCache
|
|
8
8
|
} from "./chunk-3UIIEZBT.js";
|
|
@@ -30,30 +30,30 @@ import {
|
|
|
30
30
|
rescueEmptyCells,
|
|
31
31
|
rotateQuarter,
|
|
32
32
|
rulingToPdfLines
|
|
33
|
-
} from "./chunk-
|
|
34
|
-
import "./chunk-
|
|
33
|
+
} from "./chunk-ILUYLDIW.js";
|
|
34
|
+
import "./chunk-767ACEVN.js";
|
|
35
35
|
import "./chunk-ZVBVGSXC.js";
|
|
36
36
|
import "./chunk-M3E5NYSN.js";
|
|
37
37
|
import "./chunk-G5XEBGZD.js";
|
|
38
|
-
import "./chunk-
|
|
39
|
-
import "./chunk-
|
|
38
|
+
import "./chunk-I7MD3WQR.js";
|
|
39
|
+
import "./chunk-24J4EDVI.js";
|
|
40
40
|
import "./chunk-RJCXOE4N.js";
|
|
41
41
|
import {
|
|
42
42
|
ensureOcrModelsFor
|
|
43
|
-
} from "./chunk-
|
|
43
|
+
} from "./chunk-ZEJCW4XP.js";
|
|
44
44
|
import "./chunk-AY66PEUP.js";
|
|
45
|
-
import "./chunk-
|
|
46
|
-
import "./chunk-
|
|
45
|
+
import "./chunk-2VNL3FDS.js";
|
|
46
|
+
import "./chunk-EDCNR6QZ.js";
|
|
47
47
|
import {
|
|
48
48
|
KordocError,
|
|
49
49
|
OPTIONAL_DEP_INSTALL_HINT
|
|
50
|
-
} from "./chunk-
|
|
50
|
+
} from "./chunk-3URB7DI4.js";
|
|
51
51
|
|
|
52
52
|
// src/ocr/image-formula.ts
|
|
53
53
|
async function applyImageFormulas(items, rgba, width, height, warnings) {
|
|
54
54
|
let regions;
|
|
55
55
|
try {
|
|
56
|
-
const { FormulaPipeline, ensureFormulaModels } = await import("./formula-
|
|
56
|
+
const { FormulaPipeline, ensureFormulaModels } = await import("./formula-R6LXXMAS.js");
|
|
57
57
|
await ensureFormulaModels();
|
|
58
58
|
const pipeline = await FormulaPipeline.create();
|
|
59
59
|
try {
|
|
@@ -287,4 +287,4 @@ export {
|
|
|
287
287
|
imageScale,
|
|
288
288
|
parseImageDocument
|
|
289
289
|
};
|
|
290
|
-
//# sourceMappingURL=image-ocr-
|
|
290
|
+
//# sourceMappingURL=image-ocr-MWQ6UDGP.js.map
|
package/dist/index.cjs
CHANGED
|
@@ -381,7 +381,7 @@ var VERSION, KordocError, MAX_UNZIP_ENV_MB, SAFE_HREF_RE, HREF_ESCAPE, BARE_URL,
|
|
|
381
381
|
var init_utils = __esm({
|
|
382
382
|
"src/utils.ts"() {
|
|
383
383
|
"use strict";
|
|
384
|
-
VERSION = true ? "4.25.
|
|
384
|
+
VERSION = true ? "4.25.6" : "0.0.0-dev";
|
|
385
385
|
KordocError = class extends Error {
|
|
386
386
|
constructor(message) {
|
|
387
387
|
super(message);
|
|
@@ -40615,7 +40615,7 @@ function xyCutOrder(items, gapThreshold, depth = 0, wrapped, columnGap = 0, lex)
|
|
|
40615
40615
|
const vMinGap = Math.max(minGap, columnGap);
|
|
40616
40616
|
const vCut = findVerticalCutWithOutlierFilter(items, vMinGap);
|
|
40617
40617
|
const hValid = hCut.gap >= minGap;
|
|
40618
|
-
const vValid = (vCut.gap >= vMinGap || vCut.gap >= PROSE_GUTTER_MIN_GAP && isProseGutter(items, vCut.position)) && !splitsSpacedLabel(items, vCut.position) && !splitsLoneRowTail(items, vCut.position);
|
|
40618
|
+
const vValid = (vCut.gap >= vMinGap || vCut.gap >= PROSE_GUTTER_MIN_GAP && isProseGutter(items, vCut.position)) && !splitsSpacedLabel(items, vCut.position) && !splitsLoneRowTail(items, vCut.position) && !splitsEmptyFieldRows(items, vCut.position);
|
|
40619
40619
|
let useHorizontal;
|
|
40620
40620
|
if (hValid && vValid) useHorizontal = (vCut.gap <= hCut.gap * 1.5 || staggeredSides(items, vCut.position)) && !gapInsideLongerColumn(items, hCut.position, hCut.gap, vCut.position);
|
|
40621
40621
|
else if (hValid) useHorizontal = true;
|
|
@@ -40782,6 +40782,12 @@ function splitsLoneRowTail(items, x) {
|
|
|
40782
40782
|
const text = [...head, ...tail].map((i) => i.text).join("");
|
|
40783
40783
|
return !/[가-힣]/.test(text) && /[\u3040-\u30ff\u3400-\u9fff]/.test(text) && gap <= fs * 4 && fills && headBox.x <= box.x + fs;
|
|
40784
40784
|
}
|
|
40785
|
+
function splitsEmptyFieldRows(items, x) {
|
|
40786
|
+
const left = groupByY(items.filter((i) => i.x + i.w / 2 < x)), right = groupByY(items.filter((i) => i.x + i.w / 2 >= x));
|
|
40787
|
+
const field = (row) => /[::]$/.test([...row].sort((a, b) => a.x - b.x).map((i) => i.text).join("").trim());
|
|
40788
|
+
if (left.length < 2 || !left.every(field)) return false;
|
|
40789
|
+
return right.filter((r) => field(r) && left.some((l) => Math.abs(l[0].y - r[0].y) <= 2)).length >= 2;
|
|
40790
|
+
}
|
|
40785
40791
|
function wrappedLineBands(items, inherited, lex) {
|
|
40786
40792
|
const rows = groupByY(items);
|
|
40787
40793
|
const records = tocRecordBoundaries(rows);
|
|
@@ -78159,7 +78165,7 @@ function spaceMappedDots(fnArray, argsArray, fontObj) {
|
|
|
78159
78165
|
const cache = /* @__PURE__ */ new Map();
|
|
78160
78166
|
let ctm = [1, 0, 0, 1, 0, 0], tm = null, font = "", size = 0;
|
|
78161
78167
|
const stack = [];
|
|
78162
|
-
const
|
|
78168
|
+
const mul4 = (m, t) => [
|
|
78163
78169
|
m[0] * t[0] + m[2] * t[1],
|
|
78164
78170
|
m[1] * t[0] + m[3] * t[1],
|
|
78165
78171
|
m[0] * t[2] + m[2] * t[3],
|
|
@@ -78173,7 +78179,7 @@ function spaceMappedDots(fnArray, argsArray, fontObj) {
|
|
|
78173
78179
|
else if (fn === OPS.restore) {
|
|
78174
78180
|
const s = stack.pop();
|
|
78175
78181
|
if (s) ({ ctm, font, size } = s);
|
|
78176
|
-
} else if (fn === OPS.transform) ctm =
|
|
78182
|
+
} else if (fn === OPS.transform) ctm = mul4(ctm, args);
|
|
78177
78183
|
else if (fn === OPS.setFont) {
|
|
78178
78184
|
font = String(args[0]);
|
|
78179
78185
|
size = Number(args[1]) || 0;
|
|
@@ -78202,7 +78208,7 @@ function spaceMappedDots(fnArray, argsArray, fontObj) {
|
|
|
78202
78208
|
cache.set(key3, dot);
|
|
78203
78209
|
}
|
|
78204
78210
|
if (!cache.get(key3)) continue;
|
|
78205
|
-
const m =
|
|
78211
|
+
const m = mul4(ctm, at);
|
|
78206
78212
|
const fs = size * Math.hypot(m[2], m[3]);
|
|
78207
78213
|
out.push({ str: "\xB7", transform: [fs, 0, 0, fs, m[4], m[5]], width: (Number(g3.width) || 0) / 1e3 * fs, height: fs });
|
|
78208
78214
|
}
|
|
@@ -90389,6 +90395,16 @@ function outlineOnly(pairs, cell2) {
|
|
|
90389
90395
|
const filled = pairs.filter(([, d]) => hasContent(d.cell));
|
|
90390
90396
|
return filled.length === 1 && outlineContinues(cell2(filled[0][0]), cell2(filled[0][1]));
|
|
90391
90397
|
}
|
|
90398
|
+
function joinNestedParts(u, d) {
|
|
90399
|
+
const prev = u.blocks?.[u.blocks.length - 1], curr = d.blocks?.[0];
|
|
90400
|
+
if (!prev?.table || !curr?.table || !prev.pageNumber || curr.pageNumber !== prev.pageNumber + 1) return null;
|
|
90401
|
+
const px = TABLE_COLXS.get(prev.table), cx = TABLE_COLXS.get(curr.table);
|
|
90402
|
+
if (!px || !cx || !shiftedSame(px, cx, false) || curr.table.cells[0].filter((c) => c.text.trim()).length < 2 || repeatedHeaderRows(prev.table, curr.table) <= 0) return null;
|
|
90403
|
+
const table2 = joinClipParts(prev, curr);
|
|
90404
|
+
if (!table2 || table2.rows >= prev.table.rows + curr.table.rows) return null;
|
|
90405
|
+
markJoinedPages(table2, prev, curr);
|
|
90406
|
+
return { ...prev, table: table2 };
|
|
90407
|
+
}
|
|
90392
90408
|
function mergeSplitRow(table2, owner, first, colXs, textOnly2 = false, cut = NO_CUT) {
|
|
90393
90409
|
const last = first - 1;
|
|
90394
90410
|
const pairs = [];
|
|
@@ -90432,8 +90448,9 @@ function mergeSplitRow(table2, owner, first, colXs, textOnly2 = false, cut = NO_
|
|
|
90432
90448
|
if (cut.ruled && hasNumberedRowSequence(table2, owner, first)) return false;
|
|
90433
90449
|
if (cut.ruled && matchesIndependentRowPair(table2, owner, first)) return false;
|
|
90434
90450
|
const contentPairs = pairs.filter(([u, d]) => hasContent(u.cell) && hasContent(d.cell));
|
|
90451
|
+
const nested = !textOnly2 && pairs.length === 1 ? joinNestedParts(cell2(pairs[0][0]), cell2(pairs[0][1])) : null;
|
|
90435
90452
|
const carriedSplit = !textOnly2 && carried && !newCell && (contentPairs.length <= 1 || contentPairs.every(([, d]) => d.rs > 1) || !cut.ruled && contentPairs.some(([u, d]) => wordOverflows(cell2(u), cell2(d), colXs[u.c], colXs[u.c + u.cs])));
|
|
90436
|
-
if (!carriedSplit && !band) {
|
|
90453
|
+
if (!nested && !carriedSplit && !band) {
|
|
90437
90454
|
const norm2 = (c) => flowText(c.text).replace(/\s+/g, "");
|
|
90438
90455
|
const openCut = cut.open && !newCell;
|
|
90439
90456
|
if (!openCut && pairs.some(([u, d]) => hasContent(d.cell) && norm2(cell2(d)) !== norm2(cell2(u)) && lineEnded(cell2(u), colXs[u.c], colXs[u.c + u.cs], cell2(d)))) return false;
|
|
@@ -90451,6 +90468,10 @@ function mergeSplitRow(table2, owner, first, colXs, textOnly2 = false, cut = NO_
|
|
|
90451
90468
|
appendCell(table2.cells[u.r][u.c], table2.cells[d.r][d.c]);
|
|
90452
90469
|
if (d.rs > 1) table2.cells[u.r][u.c].rowSpan = u.rs + d.rs;
|
|
90453
90470
|
}
|
|
90471
|
+
if (nested) {
|
|
90472
|
+
const blocks = cell2(pairs[0][0]).blocks;
|
|
90473
|
+
blocks.splice(blocks.indexOf(cell2(pairs[0][1]).blocks[0]) - 1, 2, nested);
|
|
90474
|
+
}
|
|
90454
90475
|
for (let r = 0; r < first; r++) for (let c = 0; c < table2.cols; c++) {
|
|
90455
90476
|
const o = owner[r][c];
|
|
90456
90477
|
if (o && o.r === r && o.c === c && r + table2.cells[r][c].rowSpan > first) table2.cells[r][c].rowSpan--;
|
|
@@ -91008,6 +91029,87 @@ var init_selection_context = __esm({
|
|
|
91008
91029
|
}
|
|
91009
91030
|
});
|
|
91010
91031
|
|
|
91032
|
+
// src/pdf/vector-bullets.ts
|
|
91033
|
+
function filledDots(fnArray, argsArray) {
|
|
91034
|
+
const dots = [];
|
|
91035
|
+
let ctm = [1, 0, 0, 1, 0, 0];
|
|
91036
|
+
const stack = [];
|
|
91037
|
+
let path = null;
|
|
91038
|
+
for (let i = 0; i < fnArray.length; i++) {
|
|
91039
|
+
const op = fnArray[i], args = argsArray[i];
|
|
91040
|
+
if (op === OPS.save) stack.push(ctm);
|
|
91041
|
+
else if (op === OPS.restore) ctm = stack.pop() ?? [1, 0, 0, 1, 0, 0];
|
|
91042
|
+
else if (op === OPS.paintFormXObjectBegin) {
|
|
91043
|
+
stack.push(ctm);
|
|
91044
|
+
const m = args?.[0];
|
|
91045
|
+
if (Array.isArray(m) && m.length >= 6) ctm = mul2(ctm, m);
|
|
91046
|
+
} else if (op === OPS.paintFormXObjectEnd) ctm = stack.pop() ?? [1, 0, 0, 1, 0, 0];
|
|
91047
|
+
else if (op === OPS.transform && Array.isArray(args) && args.length >= 6) ctm = mul2(ctm, args);
|
|
91048
|
+
else if (op === OPS.constructPath) {
|
|
91049
|
+
const [subOps, coords] = args;
|
|
91050
|
+
path = null;
|
|
91051
|
+
if (!Array.isArray(subOps) || subOps.length < 6 || subOps[0] !== OPS.moveTo || subOps[subOps.length - 1] !== OPS.closePath || subOps.slice(1, -1).some((s) => s !== OPS.curveTo)) continue;
|
|
91052
|
+
let x1 = Infinity, y1 = Infinity, x2 = -Infinity, y2 = -Infinity;
|
|
91053
|
+
for (let k = 0; k + 1 < coords.length; k += 2) {
|
|
91054
|
+
const x = ctm[0] * coords[k] + ctm[2] * coords[k + 1] + ctm[4], y = ctm[1] * coords[k] + ctm[3] * coords[k + 1] + ctm[5];
|
|
91055
|
+
x1 = Math.min(x1, x);
|
|
91056
|
+
x2 = Math.max(x2, x);
|
|
91057
|
+
y1 = Math.min(y1, y);
|
|
91058
|
+
y2 = Math.max(y2, y);
|
|
91059
|
+
}
|
|
91060
|
+
path = { x1, y1, x2, y2 };
|
|
91061
|
+
} else if (op === OPS.fill || op === OPS.eoFill) {
|
|
91062
|
+
if (path) {
|
|
91063
|
+
const w = path.x2 - path.x1, h = path.y2 - path.y1;
|
|
91064
|
+
if (w >= 1.2 && w <= 6 && h >= 1.2 && h <= 6 && Math.abs(w - h) <= Math.max(w, h) * 0.15) dots.push(path);
|
|
91065
|
+
}
|
|
91066
|
+
path = null;
|
|
91067
|
+
}
|
|
91068
|
+
}
|
|
91069
|
+
return dots;
|
|
91070
|
+
}
|
|
91071
|
+
function restoreVectorBullets(items, fnArray, argsArray) {
|
|
91072
|
+
const found = [];
|
|
91073
|
+
for (const dot of filledDots(fnArray, argsArray)) {
|
|
91074
|
+
const cy = (dot.y1 + dot.y2) / 2;
|
|
91075
|
+
const line = items.filter((it) => !it.isHidden && it.fontSize > 0 && it.text.trim() && it.x >= dot.x2 && it.x - dot.x2 <= it.fontSize * 1.2 && cy >= it.y - it.fontSize * 0.1 && cy <= it.y + it.fontSize * 0.7 && dot.y2 - dot.y1 <= it.fontSize * 0.6).sort((a, b) => a.x - b.x)[0];
|
|
91076
|
+
if (!line || !new RegExp("^\\p{L}", "u").test(line.text.trim())) continue;
|
|
91077
|
+
if (items.some((it) => it !== line && !it.isHidden && it.text.trim() && Math.abs(it.y - line.y) <= line.fontSize * 0.3 && it.x < dot.x2 && it.x + it.w > dot.x1 - line.fontSize * 2)) continue;
|
|
91078
|
+
found.push({ dot, line, lx: line.x });
|
|
91079
|
+
}
|
|
91080
|
+
let restored = 0;
|
|
91081
|
+
const used = /* @__PURE__ */ new Set();
|
|
91082
|
+
for (const f of found) {
|
|
91083
|
+
const w = f.dot.x2 - f.dot.x1;
|
|
91084
|
+
const repeated = found.some((o) => o !== f && o.line !== f.line && Math.abs(o.dot.x1 - f.dot.x1) <= 1 && Math.abs(o.dot.x2 - o.dot.x1 - w) <= 0.5 && Math.abs(o.lx - f.lx) <= 1);
|
|
91085
|
+
if (!repeated || used.has(f.line)) continue;
|
|
91086
|
+
used.add(f.line);
|
|
91087
|
+
const line = f.line;
|
|
91088
|
+
line.w += line.x - f.dot.x1;
|
|
91089
|
+
line.x = f.dot.x1;
|
|
91090
|
+
line.text = "\u2022 " + line.text;
|
|
91091
|
+
line.fx = void 0;
|
|
91092
|
+
line.fw = void 0;
|
|
91093
|
+
restored++;
|
|
91094
|
+
}
|
|
91095
|
+
return restored;
|
|
91096
|
+
}
|
|
91097
|
+
var mul2;
|
|
91098
|
+
var init_vector_bullets = __esm({
|
|
91099
|
+
"src/pdf/vector-bullets.ts"() {
|
|
91100
|
+
"use strict";
|
|
91101
|
+
init_ops();
|
|
91102
|
+
mul2 = (m, t) => [
|
|
91103
|
+
m[0] * t[0] + m[2] * t[1],
|
|
91104
|
+
m[1] * t[0] + m[3] * t[1],
|
|
91105
|
+
m[0] * t[2] + m[2] * t[3],
|
|
91106
|
+
m[1] * t[2] + m[3] * t[3],
|
|
91107
|
+
m[0] * t[4] + m[2] * t[5] + m[4],
|
|
91108
|
+
m[1] * t[4] + m[3] * t[5] + m[5]
|
|
91109
|
+
];
|
|
91110
|
+
}
|
|
91111
|
+
});
|
|
91112
|
+
|
|
91011
91113
|
// src/pdf/symbol-fonts.ts
|
|
91012
91114
|
function symbolFontTable(fontName) {
|
|
91013
91115
|
if (!fontName) return void 0;
|
|
@@ -91335,7 +91437,7 @@ function occludedTextItems(items, fnArray, argsArray) {
|
|
|
91335
91437
|
if (fn === OPS.save || fn === OPS.paintFormXObjectBegin) {
|
|
91336
91438
|
stack.push({ ctm: ctm.slice(), alpha, normalBlend, clip });
|
|
91337
91439
|
const m = fn === OPS.paintFormXObjectBegin ? args[0] : null;
|
|
91338
|
-
if (Array.isArray(m) && m.length >= 6) ctm =
|
|
91440
|
+
if (Array.isArray(m) && m.length >= 6) ctm = mul3(ctm, m);
|
|
91339
91441
|
const bbox = fn === OPS.paintFormXObjectBegin ? args[1] : null;
|
|
91340
91442
|
if (Array.isArray(bbox) && bbox.length === 4 && clip !== null) {
|
|
91341
91443
|
const axisAligned = ctm[1] === 0 && ctm[2] === 0 || ctm[0] === 0 && ctm[3] === 0;
|
|
@@ -91345,7 +91447,7 @@ function occludedTextItems(items, fnArray, argsArray) {
|
|
|
91345
91447
|
} else if (fn === OPS.restore || fn === OPS.paintFormXObjectEnd) {
|
|
91346
91448
|
const s = stack.pop();
|
|
91347
91449
|
if (s) ({ ctm, alpha, normalBlend, clip } = s);
|
|
91348
|
-
} else if (fn === OPS.transform) ctm =
|
|
91450
|
+
} else if (fn === OPS.transform) ctm = mul3(ctm, args);
|
|
91349
91451
|
else if (fn === OPS.setGState) {
|
|
91350
91452
|
const entries = args[0];
|
|
91351
91453
|
if (Array.isArray(entries)) for (const e of entries) {
|
|
@@ -91403,7 +91505,7 @@ function occludedTextItems(items, fnArray, argsArray) {
|
|
|
91403
91505
|
}
|
|
91404
91506
|
return hidden;
|
|
91405
91507
|
}
|
|
91406
|
-
function
|
|
91508
|
+
function mul3(m, t) {
|
|
91407
91509
|
return [
|
|
91408
91510
|
m[0] * t[0] + m[2] * t[1],
|
|
91409
91511
|
m[1] * t[0] + m[3] * t[1],
|
|
@@ -92750,6 +92852,7 @@ async function parsePdfDocument(buffer, options) {
|
|
|
92750
92852
|
remapSymbolFontItems(visible, (loadedName) => fontObj(loadedName)?.name);
|
|
92751
92853
|
remapControlGlyphs(visible, differencesOf);
|
|
92752
92854
|
await restoreImageBullets(visible, imagePage2, opList.fnArray, opList.argsArray, imageBulletShapes);
|
|
92855
|
+
restoreVectorBullets(visible, opList.fnArray, opList.argsArray);
|
|
92753
92856
|
const faces = /* @__PURE__ */ new Map();
|
|
92754
92857
|
for (const it of visible) {
|
|
92755
92858
|
if (!it.fontName) continue;
|
|
@@ -93129,6 +93232,7 @@ var init_parser9 = __esm({
|
|
|
93129
93232
|
init_table_trim();
|
|
93130
93233
|
init_selection_context();
|
|
93131
93234
|
init_image_bullets();
|
|
93235
|
+
init_vector_bullets();
|
|
93132
93236
|
init_flow_boxes();
|
|
93133
93237
|
init_symbol_fonts2();
|
|
93134
93238
|
init_equation_runs();
|