@clazic/kordoc 2.7.2 → 2.7.4
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/dist/{chunk-WMQBWE6H.js → chunk-CIR4TB4K.js} +2 -2
- package/dist/{chunk-OF2YI3AC.js → chunk-EJZO6DUI.js} +19 -8
- package/dist/{chunk-OF2YI3AC.js.map → chunk-EJZO6DUI.js.map} +1 -1
- package/dist/cli.js +6 -6
- package/dist/index.cjs +22 -9
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +22 -9
- package/dist/index.js.map +1 -1
- package/dist/mcp.js +2 -2
- package/dist/{utils-CJPB6YNH.js → utils-LYW4Z2Z6.js} +2 -2
- package/dist/{watch-MMYT64UO.js → watch-CVSZKJE3.js} +3 -3
- package/package.json +1 -1
- /package/dist/{chunk-WMQBWE6H.js.map → chunk-CIR4TB4K.js.map} +0 -0
- /package/dist/{utils-CJPB6YNH.js.map → utils-LYW4Z2Z6.js.map} +0 -0
- /package/dist/{watch-MMYT64UO.js.map → watch-CVSZKJE3.js.map} +0 -0
package/dist/index.js
CHANGED
|
@@ -3112,7 +3112,7 @@ import JSZip2 from "jszip";
|
|
|
3112
3112
|
import { DOMParser } from "@xmldom/xmldom";
|
|
3113
3113
|
|
|
3114
3114
|
// src/utils.ts
|
|
3115
|
-
var VERSION = true ? "2.7.
|
|
3115
|
+
var VERSION = true ? "2.7.3" : "0.0.0-dev";
|
|
3116
3116
|
function toArrayBuffer(buf) {
|
|
3117
3117
|
if (buf.byteOffset === 0 && buf.byteLength === buf.buffer.byteLength) {
|
|
3118
3118
|
return buf.buffer;
|
|
@@ -11343,8 +11343,13 @@ async function installForPlatform(pkg, onProgress) {
|
|
|
11343
11343
|
async function installMacOS(pkg, downloadPath) {
|
|
11344
11344
|
const mountPoint = `/Volumes/LibreOffice_${Date.now()}`;
|
|
11345
11345
|
await new Promise((resolve4, reject) => {
|
|
11346
|
-
const
|
|
11347
|
-
child
|
|
11346
|
+
const stderr = [];
|
|
11347
|
+
const child = spawn2("hdiutil", ["attach", "-nobrowse", "-noverify", "-mountpoint", mountPoint, downloadPath]);
|
|
11348
|
+
child.stderr?.on("data", (d) => stderr.push(d.toString()));
|
|
11349
|
+
child.on(
|
|
11350
|
+
"close",
|
|
11351
|
+
(code) => code === 0 ? resolve4() : reject(new Error(`dmg \uB9C8\uC6B4\uD2B8 \uC2E4\uD328 (code=${code}): ${stderr.join("").trim()}`))
|
|
11352
|
+
);
|
|
11348
11353
|
});
|
|
11349
11354
|
try {
|
|
11350
11355
|
const appSource = join4(mountPoint, "LibreOffice.app");
|
|
@@ -11472,14 +11477,15 @@ async function resolveSoffice(emitter, autoInstall = true) {
|
|
|
11472
11477
|
|
|
11473
11478
|
// src/convert/libreoffice.ts
|
|
11474
11479
|
var libreConvert = libre.convert;
|
|
11475
|
-
|
|
11480
|
+
var libreConvertWithOptions = libre.convertWithOptions;
|
|
11481
|
+
async function convertBuffer(buffer, targetExt, timeoutMs = 6e4, sofficePath) {
|
|
11476
11482
|
return new Promise((resolve4, reject) => {
|
|
11477
11483
|
const timer = setTimeout(() => {
|
|
11478
11484
|
reject(
|
|
11479
11485
|
new ConvertError("TIMEOUT", `\uBCC0\uD658 \uD0C0\uC784\uC544\uC6C3 (${timeoutMs}ms \uCD08\uACFC)`)
|
|
11480
11486
|
);
|
|
11481
11487
|
}, timeoutMs);
|
|
11482
|
-
|
|
11488
|
+
const cb = (err, done) => {
|
|
11483
11489
|
clearTimeout(timer);
|
|
11484
11490
|
if (err || !done) {
|
|
11485
11491
|
reject(
|
|
@@ -11491,7 +11497,12 @@ async function convertBuffer(buffer, targetExt, timeoutMs = 6e4) {
|
|
|
11491
11497
|
return;
|
|
11492
11498
|
}
|
|
11493
11499
|
resolve4(done);
|
|
11494
|
-
}
|
|
11500
|
+
};
|
|
11501
|
+
if (sofficePath) {
|
|
11502
|
+
libreConvertWithOptions(buffer, targetExt, void 0, { sofficeBinaryPaths: [sofficePath] }, cb);
|
|
11503
|
+
} else {
|
|
11504
|
+
libreConvert(buffer, targetExt, void 0, cb);
|
|
11505
|
+
}
|
|
11495
11506
|
});
|
|
11496
11507
|
}
|
|
11497
11508
|
|
|
@@ -11647,7 +11658,7 @@ async function convertToPdf(input, options) {
|
|
|
11647
11658
|
try {
|
|
11648
11659
|
emitter.convertStart("\uBCC0\uD658 \uC2DC\uC791...");
|
|
11649
11660
|
emitter.progress(10, "\uBCC0\uD658 \uC911...");
|
|
11650
|
-
const pdf = await convertBuffer(buffer, ".pdf", options?.timeoutMs);
|
|
11661
|
+
const pdf = await convertBuffer(buffer, ".pdf", options?.timeoutMs, sofficePath);
|
|
11651
11662
|
emitter.progress(100, "\uBCC0\uD658 \uC644\uB8CC");
|
|
11652
11663
|
emitter.convertDone("\uBCC0\uD658 \uC644\uB8CC");
|
|
11653
11664
|
const result = {
|
|
@@ -12000,16 +12011,18 @@ async function runUnifiedOcrPipeline(inputPath, options = {}) {
|
|
|
12000
12011
|
}
|
|
12001
12012
|
});
|
|
12002
12013
|
}
|
|
12014
|
+
let resolvedSofficePath;
|
|
12003
12015
|
if (options.sofficePath) {
|
|
12004
12016
|
const sofficeDir = dirname3(options.sofficePath);
|
|
12005
12017
|
process.env.PATH = `${sofficeDir}${delimiter2}${process.env.PATH ?? ""}`;
|
|
12006
12018
|
convertEmitter.validate("soffice_found", "\uC9C1\uC811 \uC9C0\uC815\uB41C LibreOffice \uACBD\uB85C \uC0AC\uC6A9", { sofficePath: options.sofficePath });
|
|
12019
|
+
resolvedSofficePath = options.sofficePath;
|
|
12007
12020
|
} else {
|
|
12008
|
-
await resolveSoffice(convertEmitter, options.autoInstallLibreOffice ?? false);
|
|
12021
|
+
resolvedSofficePath = await resolveSoffice(convertEmitter, options.autoInstallLibreOffice ?? false);
|
|
12009
12022
|
}
|
|
12010
12023
|
workingPdfPath = join5(workspaceDir, `${stem}.pdf`);
|
|
12011
12024
|
const inputBuffer = await readFile2(absInput);
|
|
12012
|
-
const out = await convertBuffer(inputBuffer, ".pdf");
|
|
12025
|
+
const out = await convertBuffer(inputBuffer, ".pdf", 5 * 6e4, resolvedSofficePath);
|
|
12013
12026
|
await writeFile2(workingPdfPath, out);
|
|
12014
12027
|
}
|
|
12015
12028
|
timingsMs.convert = elapsedMs(convertStart);
|