@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
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
|
|
3
3
|
// src/utils.ts
|
|
4
|
-
var VERSION = true ? "2.7.
|
|
4
|
+
var VERSION = true ? "2.7.3" : "0.0.0-dev";
|
|
5
5
|
function toArrayBuffer(buf) {
|
|
6
6
|
if (buf.byteOffset === 0 && buf.byteLength === buf.buffer.byteLength) {
|
|
7
7
|
return buf.buffer;
|
|
@@ -105,4 +105,4 @@ export {
|
|
|
105
105
|
classifyError,
|
|
106
106
|
normalizeKordocError
|
|
107
107
|
};
|
|
108
|
-
//# sourceMappingURL=chunk-
|
|
108
|
+
//# sourceMappingURL=chunk-CIR4TB4K.js.map
|
|
@@ -7,7 +7,7 @@ import {
|
|
|
7
7
|
precheckZipSize,
|
|
8
8
|
sanitizeHref,
|
|
9
9
|
toArrayBuffer
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-CIR4TB4K.js";
|
|
11
11
|
import {
|
|
12
12
|
parsePageRange
|
|
13
13
|
} from "./chunk-MOL7MDBG.js";
|
|
@@ -9956,8 +9956,13 @@ async function installForPlatform(pkg, onProgress) {
|
|
|
9956
9956
|
async function installMacOS(pkg, downloadPath) {
|
|
9957
9957
|
const mountPoint = `/Volumes/LibreOffice_${Date.now()}`;
|
|
9958
9958
|
await new Promise((resolve2, reject) => {
|
|
9959
|
-
const
|
|
9960
|
-
child
|
|
9959
|
+
const stderr = [];
|
|
9960
|
+
const child = spawn("hdiutil", ["attach", "-nobrowse", "-noverify", "-mountpoint", mountPoint, downloadPath]);
|
|
9961
|
+
child.stderr?.on("data", (d) => stderr.push(d.toString()));
|
|
9962
|
+
child.on(
|
|
9963
|
+
"close",
|
|
9964
|
+
(code) => code === 0 ? resolve2() : reject(new Error(`dmg \uB9C8\uC6B4\uD2B8 \uC2E4\uD328 (code=${code}): ${stderr.join("").trim()}`))
|
|
9965
|
+
);
|
|
9961
9966
|
});
|
|
9962
9967
|
try {
|
|
9963
9968
|
const appSource = join2(mountPoint, "LibreOffice.app");
|
|
@@ -10085,14 +10090,15 @@ async function resolveSoffice(emitter, autoInstall = true) {
|
|
|
10085
10090
|
|
|
10086
10091
|
// src/convert/libreoffice.ts
|
|
10087
10092
|
var libreConvert = libre.convert;
|
|
10088
|
-
|
|
10093
|
+
var libreConvertWithOptions = libre.convertWithOptions;
|
|
10094
|
+
async function convertBuffer(buffer, targetExt, timeoutMs = 6e4, sofficePath) {
|
|
10089
10095
|
return new Promise((resolve2, reject) => {
|
|
10090
10096
|
const timer = setTimeout(() => {
|
|
10091
10097
|
reject(
|
|
10092
10098
|
new ConvertError("TIMEOUT", `\uBCC0\uD658 \uD0C0\uC784\uC544\uC6C3 (${timeoutMs}ms \uCD08\uACFC)`)
|
|
10093
10099
|
);
|
|
10094
10100
|
}, timeoutMs);
|
|
10095
|
-
|
|
10101
|
+
const cb = (err, done) => {
|
|
10096
10102
|
clearTimeout(timer);
|
|
10097
10103
|
if (err || !done) {
|
|
10098
10104
|
reject(
|
|
@@ -10104,7 +10110,12 @@ async function convertBuffer(buffer, targetExt, timeoutMs = 6e4) {
|
|
|
10104
10110
|
return;
|
|
10105
10111
|
}
|
|
10106
10112
|
resolve2(done);
|
|
10107
|
-
}
|
|
10113
|
+
};
|
|
10114
|
+
if (sofficePath) {
|
|
10115
|
+
libreConvertWithOptions(buffer, targetExt, void 0, { sofficeBinaryPaths: [sofficePath] }, cb);
|
|
10116
|
+
} else {
|
|
10117
|
+
libreConvert(buffer, targetExt, void 0, cb);
|
|
10118
|
+
}
|
|
10108
10119
|
});
|
|
10109
10120
|
}
|
|
10110
10121
|
|
|
@@ -10260,7 +10271,7 @@ async function convertToPdf(input, options) {
|
|
|
10260
10271
|
try {
|
|
10261
10272
|
emitter.convertStart("\uBCC0\uD658 \uC2DC\uC791...");
|
|
10262
10273
|
emitter.progress(10, "\uBCC0\uD658 \uC911...");
|
|
10263
|
-
const pdf = await convertBuffer(buffer, ".pdf", options?.timeoutMs);
|
|
10274
|
+
const pdf = await convertBuffer(buffer, ".pdf", options?.timeoutMs, sofficePath);
|
|
10264
10275
|
emitter.progress(100, "\uBCC0\uD658 \uC644\uB8CC");
|
|
10265
10276
|
emitter.convertDone("\uBCC0\uD658 \uC644\uB8CC");
|
|
10266
10277
|
const result = {
|
|
@@ -10690,4 +10701,4 @@ export {
|
|
|
10690
10701
|
cfb/cfb.js:
|
|
10691
10702
|
(*! crc32.js (C) 2014-present SheetJS -- http://sheetjs.com *)
|
|
10692
10703
|
*/
|
|
10693
|
-
//# sourceMappingURL=chunk-
|
|
10704
|
+
//# sourceMappingURL=chunk-EJZO6DUI.js.map
|