kordoc 4.24.40 → 4.24.41
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/{-BCZOAUIB.js → -5XLO3RHD.js} +21 -21
- package/dist/{chunk-42GIGYXH.js → chunk-2CHSOHDE.js} +2 -2
- package/dist/{chunk-JZ7S7PH5.js → chunk-2IK2Z6PO.js} +2 -2
- package/dist/{chunk-ATFJODWS.js → chunk-3GJ3CMYS.js} +2 -2
- package/dist/{chunk-SASB4AHF.js → chunk-57LVGVIS.js} +2 -2
- package/dist/{chunk-EQIKF7RR.js → chunk-5QHQ56AK.js} +3 -3
- package/dist/{chunk-M54ERXRI.cjs → chunk-5QMMROCA.cjs} +3 -3
- package/dist/chunk-5QMMROCA.cjs.map +1 -0
- package/dist/chunk-ARVHYL3V.cjs.map +1 -1
- package/dist/{chunk-6O7O4GZS.js → chunk-C2YUJXHB.js} +2 -2
- package/dist/{chunk-OGJSEAII.js → chunk-C5XJDCXW.js} +2 -2
- package/dist/{chunk-LKYLW3WN.js → chunk-CCGGLBHD.js} +111 -34
- package/dist/chunk-CCGGLBHD.js.map +1 -0
- package/dist/chunk-DEVQZTE7.cjs.map +1 -1
- package/dist/{chunk-GZ3AUXCU.js → chunk-EPR3TQS3.js} +2 -2
- package/dist/{chunk-XGCDYSJW.js → chunk-EPZVMBAQ.js} +2 -2
- package/dist/{chunk-EM4H62JN.js → chunk-FVYTDR6E.js} +4 -4
- package/dist/chunk-GS7T56RP.cjs.map +1 -1
- package/dist/{chunk-ZTA7R42I.js → chunk-GYMAGQNQ.js} +6 -6
- package/dist/{chunk-IXC35A5Q.cjs → chunk-HJGKVI7D.cjs} +25 -25
- package/dist/chunk-HJGKVI7D.cjs.map +1 -0
- package/dist/{chunk-4CLLC2HL.cjs → chunk-HR72SA4M.cjs} +182 -106
- package/dist/chunk-HR72SA4M.cjs.map +1 -0
- package/dist/{chunk-B3EQLBCI.cjs → chunk-IHMDGE7Z.cjs} +3 -3
- package/dist/chunk-IHMDGE7Z.cjs.map +1 -0
- package/dist/{chunk-3NO2PYSA.js → chunk-IXFRVO7E.js} +3 -3
- package/dist/chunk-J55UQC5H.cjs.map +1 -1
- package/dist/{chunk-N54IHM64.js → chunk-JBQ5R4VV.js} +2 -2
- package/dist/{chunk-Z4WJNI2B.cjs → chunk-JZEMASGR.cjs} +2 -2
- package/dist/chunk-JZEMASGR.cjs.map +1 -0
- package/dist/{chunk-Y5YELCJQ.js → chunk-K2AVB6ZW.js} +3 -3
- package/dist/{chunk-SJDASJCE.js → chunk-KF6MJIPV.js} +11 -11
- package/dist/{chunk-2U57FX3D.js → chunk-KQDO246G.js} +3 -3
- package/dist/{chunk-TOM4NLMF.js → chunk-KTWCSSNS.js} +10 -10
- package/dist/chunk-LAYKIZOX.cjs.map +1 -1
- package/dist/{chunk-AYSIDGRR.js → chunk-MZ7AGKAN.js} +2 -2
- package/dist/{chunk-HZFZWQN7.js → chunk-NHDOSQZ6.js} +110 -34
- package/dist/chunk-NHDOSQZ6.js.map +1 -0
- package/dist/{chunk-3CEG4237.js → chunk-OPE2XDGY.js} +5 -5
- package/dist/{chunk-I4LD2BEQ.js → chunk-QNXWOUWQ.js} +2 -2
- package/dist/{chunk-DCWMR5QQ.js → chunk-S7TKYRJB.js} +2 -2
- package/dist/{chunk-3TTIN736.js → chunk-SGBD6MTI.js} +2 -2
- package/dist/{chunk-POIRZQ3P.js → chunk-SV462GOK.js} +2 -2
- package/dist/{chunk-S4VJWOH7.js → chunk-TGKYTBQ2.js} +3 -3
- package/dist/{chunk-7MLCHVDC.cjs → chunk-TJARBWAJ.cjs} +98 -98
- package/dist/chunk-TJARBWAJ.cjs.map +1 -0
- package/dist/chunk-TK3FDAEE.cjs.map +1 -1
- package/dist/{chunk-PJFQH7MC.cjs → chunk-TVMNTRPZ.cjs} +80 -80
- package/dist/chunk-TVMNTRPZ.cjs.map +1 -0
- package/dist/{chunk-L3VJUQT2.js → chunk-TWFL7T4K.js} +2 -2
- package/dist/{chunk-5YG5UQNQ.js → chunk-UHN5TULI.js} +4 -4
- package/dist/{chunk-OMWG727Y.js → chunk-UI3SZQXC.js} +6 -6
- package/dist/{chunk-BRGCGIZV.cjs → chunk-WNOSEEBH.cjs} +6 -6
- package/dist/chunk-WNOSEEBH.cjs.map +1 -0
- package/dist/{chunk-GKEUWVGE.js → chunk-WYJWJ7X4.js} +2 -2
- package/dist/chunk-X7RBVVDC.cjs.map +1 -1
- package/dist/{chunk-QTD6ZAFP.js → chunk-XBWP6REN.js} +2 -2
- package/dist/{chunk-MVPRBXWX.js → chunk-XPYC55DA.js} +5 -5
- package/dist/{chunk-S2VVFKSQ.js → chunk-ZDTP5IJU.js} +2 -2
- package/dist/{chunk-SSGMLZ4L.js → chunk-ZOCDODX3.js} +2 -2
- package/dist/chunk-ZTN3T3GH.cjs.map +1 -1
- package/dist/{chunk-SDMMPYPM.js → chunk-ZUFIMOGS.js} +15 -15
- package/dist/chunks-23JEOBIH.js +11 -0
- package/dist/cli.js +43 -43
- package/dist/detect-V75ERMYL.cjs.map +1 -1
- package/dist/{formula-4T2UH2SU.js → formula-3X2Y6F6V.js} +3 -3
- package/dist/{formula-DQ7Z2OHG.cjs → formula-4WGDQBOM.cjs} +9 -9
- package/dist/formula-4WGDQBOM.cjs.map +1 -0
- package/dist/{formula-CRQQYKMF.js → formula-IBE4CZ5R.js} +4 -4
- package/dist/generator-JYJLWH7T.js +17 -0
- package/dist/generator-PGOJNK7D.js +10 -0
- package/dist/generator-ZRVKK7UG.cjs +11 -0
- package/dist/generator-ZRVKK7UG.cjs.map +1 -0
- package/dist/{hancom-7SBCAOEZ.js → hancom-CBYVMPCO.js} +2 -2
- package/dist/{hancom-EDHZ7SBY.js → hancom-UACA2WTF.js} +2 -2
- package/dist/{hancom-HNX2LQ73.cjs → hancom-YR2BB373.cjs} +5 -5
- package/dist/hancom-YR2BB373.cjs.map +1 -0
- package/dist/{image-ocr-6VRL4YR5.js → image-ocr-2CUGPHIK.js} +10 -10
- package/dist/{image-ocr-L5UN7AIS.js → image-ocr-JEHNWQVE.js} +7 -7
- package/dist/{image-ocr-37JGUF74.cjs → image-ocr-RNAJ66EN.cjs} +27 -27
- package/dist/image-ocr-RNAJ66EN.cjs.map +1 -0
- package/dist/index.cjs +1105 -1105
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +9 -9
- package/dist/mcp.js +37 -37
- package/dist/mcp.js.map +1 -1
- package/dist/memo-V24MEWBZ.js +17 -0
- package/dist/{model-bundle-GDPQSFB6.js → model-bundle-HLPWOTCS.js} +5 -5
- package/dist/{models-JUOAMBO5.js → models-AMOW56WP.js} +5 -5
- package/dist/page-range-QHHFTL7X.cjs.map +1 -1
- package/dist/{parse-worker-v2-WRNJYJYP.js → parse-worker-v2-Z4BCWVRX.js} +22 -22
- package/dist/{parser-DH44I6DQ.cjs → parser-D2DQIUP3.cjs} +159 -159
- package/dist/parser-D2DQIUP3.cjs.map +1 -0
- package/dist/{parser-M2JDL5MR.js → parser-Y4GUP7PZ.js} +12 -12
- package/dist/{parser-3QHB4MZG.js → parser-YMNUQBLB.js} +9 -9
- package/dist/{pdf-ocr-54FGTFWV.js → pdf-ocr-3K266ENT.js} +9 -9
- package/dist/{pdf-ocr-GAMAZHIY.js → pdf-ocr-EPIM3YWE.js} +6 -6
- package/dist/pdf-ocr-OX7H7NOU.cjs +40 -0
- package/dist/pdf-ocr-OX7H7NOU.cjs.map +1 -0
- package/dist/{profile-io-SFTAVZJZ.js → profile-io-AW4GEYDQ.js} +3 -3
- package/dist/{rasterize-TQJXG5PE.js → rasterize-75AWRNSO.js} +3 -3
- package/dist/{redact-doc-J3GBRKW3.js → redact-doc-3UUPTXFI.js} +21 -21
- package/dist/{render-7UUZGP34.js → render-JGMRAI2P.js} +12 -12
- package/dist/{rewrite-fallback-TPWEGJAJ.js → rewrite-fallback-UDQAKQN2.js} +13 -13
- package/dist/rewrite-fallback-UDQAKQN2.js.map +1 -0
- package/dist/seal-WFNKTHBW.js +16 -0
- package/dist/{setup-6OBIQ6CT.js → setup-JTHBR676.js} +3 -3
- package/dist/{to-hwpx-PNHVMQS2.js → to-hwpx-GJP66LQS.js} +7 -7
- package/dist/to-hwpx-LKPXAHSQ.cjs +16 -0
- package/dist/to-hwpx-LKPXAHSQ.cjs.map +1 -0
- package/dist/{to-hwpx-PZTHDUIW.js → to-hwpx-ZD7IGU7G.js} +4 -4
- package/dist/visual-666SNQ3Y.js +37 -0
- package/dist/{watch-KIEOCPMD.js → watch-QL4YAMRV.js} +22 -22
- package/package.json +1 -1
- package/dist/chunk-4CLLC2HL.cjs.map +0 -1
- package/dist/chunk-7MLCHVDC.cjs.map +0 -1
- package/dist/chunk-B3EQLBCI.cjs.map +0 -1
- package/dist/chunk-BRGCGIZV.cjs.map +0 -1
- package/dist/chunk-HZFZWQN7.js.map +0 -1
- package/dist/chunk-IXC35A5Q.cjs.map +0 -1
- package/dist/chunk-LKYLW3WN.js.map +0 -1
- package/dist/chunk-M54ERXRI.cjs.map +0 -1
- package/dist/chunk-PJFQH7MC.cjs.map +0 -1
- package/dist/chunk-Z4WJNI2B.cjs.map +0 -1
- package/dist/chunks-XIHXW5KF.js +0 -11
- package/dist/formula-DQ7Z2OHG.cjs.map +0 -1
- package/dist/generator-4W73M27L.js +0 -10
- package/dist/generator-NEW7FGJ5.js +0 -17
- package/dist/generator-SVALWNDD.cjs +0 -11
- package/dist/generator-SVALWNDD.cjs.map +0 -1
- package/dist/hancom-HNX2LQ73.cjs.map +0 -1
- package/dist/image-ocr-37JGUF74.cjs.map +0 -1
- package/dist/memo-PDYKOOVQ.js +0 -17
- package/dist/parser-DH44I6DQ.cjs.map +0 -1
- package/dist/pdf-ocr-HIK5RF27.cjs +0 -40
- package/dist/pdf-ocr-HIK5RF27.cjs.map +0 -1
- package/dist/rewrite-fallback-TPWEGJAJ.js.map +0 -1
- package/dist/seal-2X3GZVKH.js +0 -16
- package/dist/to-hwpx-TY7YLRPV.cjs +0 -16
- package/dist/to-hwpx-TY7YLRPV.cjs.map +0 -1
- package/dist/visual-XBUBP2GE.js +0 -37
- /package/dist/{-BCZOAUIB.js.map → -5XLO3RHD.js.map} +0 -0
- /package/dist/{chunk-42GIGYXH.js.map → chunk-2CHSOHDE.js.map} +0 -0
- /package/dist/{chunk-JZ7S7PH5.js.map → chunk-2IK2Z6PO.js.map} +0 -0
- /package/dist/{chunk-ATFJODWS.js.map → chunk-3GJ3CMYS.js.map} +0 -0
- /package/dist/{chunk-SASB4AHF.js.map → chunk-57LVGVIS.js.map} +0 -0
- /package/dist/{chunk-EQIKF7RR.js.map → chunk-5QHQ56AK.js.map} +0 -0
- /package/dist/{chunk-6O7O4GZS.js.map → chunk-C2YUJXHB.js.map} +0 -0
- /package/dist/{chunk-OGJSEAII.js.map → chunk-C5XJDCXW.js.map} +0 -0
- /package/dist/{chunk-GZ3AUXCU.js.map → chunk-EPR3TQS3.js.map} +0 -0
- /package/dist/{chunk-XGCDYSJW.js.map → chunk-EPZVMBAQ.js.map} +0 -0
- /package/dist/{chunk-EM4H62JN.js.map → chunk-FVYTDR6E.js.map} +0 -0
- /package/dist/{chunk-ZTA7R42I.js.map → chunk-GYMAGQNQ.js.map} +0 -0
- /package/dist/{chunk-3NO2PYSA.js.map → chunk-IXFRVO7E.js.map} +0 -0
- /package/dist/{chunk-N54IHM64.js.map → chunk-JBQ5R4VV.js.map} +0 -0
- /package/dist/{chunk-Y5YELCJQ.js.map → chunk-K2AVB6ZW.js.map} +0 -0
- /package/dist/{chunk-SJDASJCE.js.map → chunk-KF6MJIPV.js.map} +0 -0
- /package/dist/{chunk-2U57FX3D.js.map → chunk-KQDO246G.js.map} +0 -0
- /package/dist/{chunk-TOM4NLMF.js.map → chunk-KTWCSSNS.js.map} +0 -0
- /package/dist/{chunk-AYSIDGRR.js.map → chunk-MZ7AGKAN.js.map} +0 -0
- /package/dist/{chunk-3CEG4237.js.map → chunk-OPE2XDGY.js.map} +0 -0
- /package/dist/{chunk-I4LD2BEQ.js.map → chunk-QNXWOUWQ.js.map} +0 -0
- /package/dist/{chunk-DCWMR5QQ.js.map → chunk-S7TKYRJB.js.map} +0 -0
- /package/dist/{chunk-3TTIN736.js.map → chunk-SGBD6MTI.js.map} +0 -0
- /package/dist/{chunk-POIRZQ3P.js.map → chunk-SV462GOK.js.map} +0 -0
- /package/dist/{chunk-S4VJWOH7.js.map → chunk-TGKYTBQ2.js.map} +0 -0
- /package/dist/{chunk-L3VJUQT2.js.map → chunk-TWFL7T4K.js.map} +0 -0
- /package/dist/{chunk-5YG5UQNQ.js.map → chunk-UHN5TULI.js.map} +0 -0
- /package/dist/{chunk-OMWG727Y.js.map → chunk-UI3SZQXC.js.map} +0 -0
- /package/dist/{chunk-GKEUWVGE.js.map → chunk-WYJWJ7X4.js.map} +0 -0
- /package/dist/{chunk-QTD6ZAFP.js.map → chunk-XBWP6REN.js.map} +0 -0
- /package/dist/{chunk-MVPRBXWX.js.map → chunk-XPYC55DA.js.map} +0 -0
- /package/dist/{chunk-S2VVFKSQ.js.map → chunk-ZDTP5IJU.js.map} +0 -0
- /package/dist/{chunk-SSGMLZ4L.js.map → chunk-ZOCDODX3.js.map} +0 -0
- /package/dist/{chunk-SDMMPYPM.js.map → chunk-ZUFIMOGS.js.map} +0 -0
- /package/dist/{chunks-XIHXW5KF.js.map → chunks-23JEOBIH.js.map} +0 -0
- /package/dist/{formula-4T2UH2SU.js.map → formula-3X2Y6F6V.js.map} +0 -0
- /package/dist/{formula-CRQQYKMF.js.map → formula-IBE4CZ5R.js.map} +0 -0
- /package/dist/{generator-4W73M27L.js.map → generator-JYJLWH7T.js.map} +0 -0
- /package/dist/{generator-NEW7FGJ5.js.map → generator-PGOJNK7D.js.map} +0 -0
- /package/dist/{hancom-7SBCAOEZ.js.map → hancom-CBYVMPCO.js.map} +0 -0
- /package/dist/{hancom-EDHZ7SBY.js.map → hancom-UACA2WTF.js.map} +0 -0
- /package/dist/{image-ocr-6VRL4YR5.js.map → image-ocr-2CUGPHIK.js.map} +0 -0
- /package/dist/{image-ocr-L5UN7AIS.js.map → image-ocr-JEHNWQVE.js.map} +0 -0
- /package/dist/{memo-PDYKOOVQ.js.map → memo-V24MEWBZ.js.map} +0 -0
- /package/dist/{model-bundle-GDPQSFB6.js.map → model-bundle-HLPWOTCS.js.map} +0 -0
- /package/dist/{models-JUOAMBO5.js.map → models-AMOW56WP.js.map} +0 -0
- /package/dist/{parse-worker-v2-WRNJYJYP.js.map → parse-worker-v2-Z4BCWVRX.js.map} +0 -0
- /package/dist/{parser-M2JDL5MR.js.map → parser-Y4GUP7PZ.js.map} +0 -0
- /package/dist/{parser-3QHB4MZG.js.map → parser-YMNUQBLB.js.map} +0 -0
- /package/dist/{pdf-ocr-54FGTFWV.js.map → pdf-ocr-3K266ENT.js.map} +0 -0
- /package/dist/{pdf-ocr-GAMAZHIY.js.map → pdf-ocr-EPIM3YWE.js.map} +0 -0
- /package/dist/{profile-io-SFTAVZJZ.js.map → profile-io-AW4GEYDQ.js.map} +0 -0
- /package/dist/{rasterize-TQJXG5PE.js.map → rasterize-75AWRNSO.js.map} +0 -0
- /package/dist/{redact-doc-J3GBRKW3.js.map → redact-doc-3UUPTXFI.js.map} +0 -0
- /package/dist/{render-7UUZGP34.js.map → render-JGMRAI2P.js.map} +0 -0
- /package/dist/{seal-2X3GZVKH.js.map → seal-WFNKTHBW.js.map} +0 -0
- /package/dist/{setup-6OBIQ6CT.js.map → setup-JTHBR676.js.map} +0 -0
- /package/dist/{to-hwpx-PNHVMQS2.js.map → to-hwpx-GJP66LQS.js.map} +0 -0
- /package/dist/{to-hwpx-PZTHDUIW.js.map → to-hwpx-ZD7IGU7G.js.map} +0 -0
- /package/dist/{visual-XBUBP2GE.js.map → visual-666SNQ3Y.js.map} +0 -0
- /package/dist/{watch-KIEOCPMD.js.map → watch-QL4YAMRV.js.map} +0 -0
|
@@ -5,19 +5,20 @@ import {
|
|
|
5
5
|
readHwp5DocInfoRecords,
|
|
6
6
|
readHwp5SectionRecords,
|
|
7
7
|
readHwp5SectionStreams
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-OPE2XDGY.js";
|
|
9
9
|
import {
|
|
10
|
+
FLAG_TRACK_CHANGES,
|
|
10
11
|
decompressStream,
|
|
11
12
|
fileTimeText,
|
|
12
13
|
readRecords
|
|
13
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-3GJ3CMYS.js";
|
|
14
15
|
import {
|
|
15
16
|
composeDigits
|
|
16
17
|
} from "./chunk-KFF47XZ7.js";
|
|
17
18
|
import {
|
|
18
19
|
KordocError,
|
|
19
20
|
VERSION
|
|
20
|
-
} from "./chunk-
|
|
21
|
+
} from "./chunk-ZOCDODX3.js";
|
|
21
22
|
|
|
22
23
|
// src/hwp5/to-hwpx/index.ts
|
|
23
24
|
import JSZip from "jszip";
|
|
@@ -105,7 +106,7 @@ function color(c) {
|
|
|
105
106
|
c >>>= 0;
|
|
106
107
|
if (c === 4294967295) return "none";
|
|
107
108
|
const a = c >>> 24;
|
|
108
|
-
return "#" + (a ?
|
|
109
|
+
return "#" + (a ? a.toString(16).toUpperCase() : "") + hex2(c & 255) + hex2(c >>> 8 & 255) + hex2(c >>> 16 & 255);
|
|
109
110
|
}
|
|
110
111
|
var bit = (v, n) => v >>> n & 1;
|
|
111
112
|
var bits = (v, from, width) => v >>> from & (1 << width) - 1;
|
|
@@ -590,7 +591,7 @@ function style(r, id, paraIds) {
|
|
|
590
591
|
}
|
|
591
592
|
function memoPr(r, id) {
|
|
592
593
|
const c = new Cur(r.data);
|
|
593
|
-
const width = c.u32(),
|
|
594
|
+
const width = c.u32(), lineType = c.u8(), lineWidth = c.u8(), lineColor = c.u32(), fillColor = c.u32(), activeColor = c.u32(), type = c.u16();
|
|
594
595
|
return el("hh:memoPr", [
|
|
595
596
|
["id", id],
|
|
596
597
|
["width", width],
|
|
@@ -602,6 +603,32 @@ function memoPr(r, id) {
|
|
|
602
603
|
["memoType", pick(MEMO_TYPES, type)]
|
|
603
604
|
]);
|
|
604
605
|
}
|
|
606
|
+
var TRACK_TYPES = { 17: "Delete", 18: "CharShape", 19: "ParaShape" };
|
|
607
|
+
function trackChange(r, id, paraIds) {
|
|
608
|
+
const c = new Cur(r.data);
|
|
609
|
+
const type = c.u32(), y = c.u16(), mo = c.u16(), d = c.u16(), h = c.u16(), mi = c.u16();
|
|
610
|
+
const author = c.u32(), n = c.u32();
|
|
611
|
+
const shape = n >= 4 ? c.u32() : 0;
|
|
612
|
+
c.skip(Math.max(0, n - 4));
|
|
613
|
+
const hide = c.u32();
|
|
614
|
+
const name = TRACK_TYPES[type] ?? "UnKnown";
|
|
615
|
+
return el("hh:trackChange", [
|
|
616
|
+
["type", name],
|
|
617
|
+
["date", new Date(y, mo - 1, d, h, mi).toISOString().replace(/\.\d+Z$/, "Z")],
|
|
618
|
+
["authorID", author],
|
|
619
|
+
["hide", hide],
|
|
620
|
+
["id", id],
|
|
621
|
+
...name === "CharShape" ? [["charshapeID", shape]] : [],
|
|
622
|
+
...name === "ParaShape" ? [["parashapeID", paraIds[shape] ?? shape]] : []
|
|
623
|
+
]);
|
|
624
|
+
}
|
|
625
|
+
function trackChangeAuthor(r, id) {
|
|
626
|
+
const c = new Cur(r.data);
|
|
627
|
+
const n = c.u32();
|
|
628
|
+
const name = r.data.toString("utf16le", Math.min(c.o, r.data.length), Math.min(r.data.length, c.o + n * 2));
|
|
629
|
+
c.skip(n * 2);
|
|
630
|
+
return el("hh:trackChangeAuthor", [["name", name], ["mark", c.u32()], ["id", id]]);
|
|
631
|
+
}
|
|
605
632
|
function docProps(recs) {
|
|
606
633
|
const r = recs.find((x) => x.tagId === TAG.DOCUMENT_PROPERTIES);
|
|
607
634
|
const c = new Cur(r?.data ?? Buffer.alloc(0));
|
|
@@ -654,8 +681,11 @@ function headerXml(recs, linkInfo, ref, secCnt) {
|
|
|
654
681
|
refList += list("hh:paraProperties", of(TAG.PARA_SHAPE).flatMap((r, i) => paraIds.indexOf(paraIds[i]) === i ? [paraPr(r, paraIds[i])] : []));
|
|
655
682
|
refList += list("hh:styles", of(TAG.STYLE).map((r, i) => style(r, i, paraIds)));
|
|
656
683
|
refList += list("hh:memoProperties", of(TAG.MEMO_SHAPE).map((r, i) => memoPr(r, i + 1)));
|
|
684
|
+
refList += list("hh:trackChanges", recs.filter((r) => r.tagId === TAG.TRACK_CHANGE).map((r, i) => trackChange(r, i + 1, paraIds)));
|
|
685
|
+
refList += list("hh:trackChangeAuthors", recs.filter((r) => r.tagId === TAG.TRACK_CHANGE_AUTHOR).map((r, i) => trackChangeAuthor(r, i + 1)));
|
|
657
686
|
const compat = new Cur(recs.find((r) => r.tagId === TAG.COMPATIBLE_DOCUMENT)?.data ?? Buffer.alloc(0)).u32();
|
|
658
|
-
const
|
|
687
|
+
const trackRec = recs.find((r) => r.tagId === TAG.TRACKCHANGE);
|
|
688
|
+
const track = trackRec ? new Cur(trackRec.data).u32() : 56;
|
|
659
689
|
return XML_DECL + `<hh:head ${NS} version="1.5" secCnt="${secCnt}">` + el("hh:beginNum", [["page", bPage], ["footnote", bFoot], ["endnote", bEnd], ["pic", bPic], ["tbl", bTbl], ["equation", bEq]]) + `<hh:refList>${refList}</hh:refList>` + el("hh:compatibleDocument", [["targetProgram", pick(TARGET_PROGRAMS, compat)]], "<hh:layoutCompatibility/>") + el("hh:docOption", [], el("hh:linkinfo", [["path", linkInfo.path], ["pageInherit", linkInfo.pageInherit], ["footnoteInherit", linkInfo.footnoteInherit]])) + el("hh:trackchageConfig", [["flags", track]]) + "</hh:head>";
|
|
660
690
|
}
|
|
661
691
|
|
|
@@ -879,7 +909,13 @@ function drawingStyle(k, ctx) {
|
|
|
879
909
|
const lineAlpha = c.u8(), sAlpha = c.u8();
|
|
880
910
|
const line = lineShapeXml(lineColor, width, a, outline, lineAlpha);
|
|
881
911
|
const shadow = el("hp:shadow", [["type", pick(SHADOW_TYPES2, sType)], ["color", color(sColor)], ["offsetX", sx], ["offsetY", sy], ["alpha", sAlpha]]);
|
|
882
|
-
return { xml: line + fill + shadow, instId };
|
|
912
|
+
return { xml: line + fill + shadow, instId, shadow: [sType, sx, sy] };
|
|
913
|
+
}
|
|
914
|
+
function shadowMargin(m, [type, sx, sy]) {
|
|
915
|
+
if (type < 1 || type > 4) return m;
|
|
916
|
+
const h = sx + (type === 2 || type === 4 ? 600 : -600), v = sy + (type >= 3 ? 600 : -600);
|
|
917
|
+
const cut = (x, d) => d > 0 ? x - d >>> 0 : x;
|
|
918
|
+
return [cut(m[0], -h), cut(m[1], h), cut(m[2], -v), cut(m[3], v)];
|
|
883
919
|
}
|
|
884
920
|
function drawTextXml(comp, ctx) {
|
|
885
921
|
const g = listGroups(comp.kids)[0];
|
|
@@ -907,7 +943,7 @@ function shapeXml(comp, o, description, ctx, caption) {
|
|
|
907
943
|
const sub = (tag) => new Cur(comp.kids.find((x) => x.rec.tagId === tag)?.rec.data ?? Buffer.alloc(0));
|
|
908
944
|
const head = o ? objHeadAttrs(o) : [["id", 0], ["zOrder", 0], ["numberingType", "NONE"], ["textWrap", "TOP_AND_BOTTOM"], ["textFlow", "BOTH_SIDES"], ["lock", 0], ["dropcapstyle", "None"]];
|
|
909
945
|
const comment = o && description ? `<hp:shapeComment>${escText(description)}</hp:shapeComment>` : "";
|
|
910
|
-
|
|
946
|
+
let tail = o ? objPlacementXml(o) + comment + caption : comment;
|
|
911
947
|
const common = componentHeadXml(k);
|
|
912
948
|
const href = shapeHref(comp);
|
|
913
949
|
if (k.kind === "$pic") {
|
|
@@ -949,6 +985,7 @@ function shapeXml(comp, o, description, ctx, caption) {
|
|
|
949
985
|
return el("hp:container", [...head, ["href", href], ["groupLevel", k.groupLevel], ["instid", instId]], common + kids + tail);
|
|
950
986
|
}
|
|
951
987
|
const s = drawingStyle(k, ctx);
|
|
988
|
+
if (o) tail = objPlacementXml({ ...o, margin: shadowMargin(o.margin, s.shadow) }) + comment + caption;
|
|
952
989
|
const text = drawTextXml(comp, ctx);
|
|
953
990
|
const ref = [["href", href], ["groupLevel", k.groupLevel], ["instid", s.instId]];
|
|
954
991
|
switch (k.kind) {
|
|
@@ -1587,7 +1624,7 @@ function paragraphXml(p, ctx) {
|
|
|
1587
1624
|
}
|
|
1588
1625
|
if (!runs.length) runs.push([0, 0]);
|
|
1589
1626
|
const ctrls = p.kids.filter((k) => k.rec.tagId === TAG2.CTRL_HEADER);
|
|
1590
|
-
const ranges = rangeTags(p.kids.find((k) => k.rec.tagId === TAG2.PARA_RANGE_TAG));
|
|
1627
|
+
const ranges = rangeTags(p.kids.find((k) => k.rec.tagId === TAG2.PARA_RANGE_TAG), crPos);
|
|
1591
1628
|
const toks = tokenize(text, ctrls, ctx, /* @__PURE__ */ new Set([...runs.map((r) => r[0]), ...ranges.styles.flatMap((r) => [r[0], r[1]])]), ranges.marks);
|
|
1592
1629
|
for (const k of toks) if (k.t !== "ctrl") k.cs = ranges.styles.find((r) => k.pos >= r[0] && k.pos < r[1])?.[2];
|
|
1593
1630
|
const units = text.length / 2;
|
|
@@ -1596,8 +1633,8 @@ function paragraphXml(p, ctx) {
|
|
|
1596
1633
|
for (let i = 0; i < runs.length; i++) {
|
|
1597
1634
|
const from = runs[i][0], to = i + 1 < runs.length ? runs[i + 1][0] : Math.max(units, nChars);
|
|
1598
1635
|
let seg = toks.filter((t) => t.pos >= from && t.pos < to);
|
|
1599
|
-
if (!seg.length && i > 0 && from >= crPos && hasCtrl) seg = [{ pos: from, t: "text", s: "" }];
|
|
1600
|
-
body += runXml(runs[i][1], seg);
|
|
1636
|
+
if (!seg.length && i > 0 && from >= crPos && (hasCtrl || toks.some((k) => k.t === "inline" && (k.end ?? -1) >= from))) seg = [{ pos: from, t: "text", s: "" }];
|
|
1637
|
+
body += runXml(runs[i][1], seg, ranges.charTc.find((r) => from >= r[0] && from < r[1])?.[2]);
|
|
1601
1638
|
}
|
|
1602
1639
|
const ls = p.kids.find((k) => k.rec.tagId === TAG2.PARA_LINE_SEG);
|
|
1603
1640
|
if (ls) {
|
|
@@ -1623,12 +1660,17 @@ function paragraphXml(p, ctx) {
|
|
|
1623
1660
|
["styleIDRef", styleId],
|
|
1624
1661
|
["pageBreak", bit(breaks, 2)],
|
|
1625
1662
|
["columnBreak", bit(breaks, 3)],
|
|
1626
|
-
["merged", merged]
|
|
1663
|
+
["merged", merged],
|
|
1664
|
+
...ranges.paraTc ? [["paraTcId", ranges.paraTc]] : []
|
|
1627
1665
|
], body);
|
|
1628
1666
|
}
|
|
1629
|
-
|
|
1630
|
-
|
|
1631
|
-
|
|
1667
|
+
var TRACK_RANGES = { 17: "delete" };
|
|
1668
|
+
var TRACK_CHAR_SHAPE = 18;
|
|
1669
|
+
var TRACK_PARA_SHAPE = 19;
|
|
1670
|
+
function rangeTags(node, crPos) {
|
|
1671
|
+
const marks = /* @__PURE__ */ new Map(), styles = [], charTc = [];
|
|
1672
|
+
let paraTc = 0;
|
|
1673
|
+
if (!node) return { marks, styles, charTc, paraTc };
|
|
1632
1674
|
const add = (pos, xml, first) => {
|
|
1633
1675
|
const list = marks.get(pos) ?? [];
|
|
1634
1676
|
if (first) list.unshift(xml);
|
|
@@ -1638,18 +1680,36 @@ function rangeTags(node) {
|
|
|
1638
1680
|
for (const c = new Cur(node.rec.data); c.rest >= 12; ) {
|
|
1639
1681
|
const start = c.u32(), end = c.u32(), tag = c.u32();
|
|
1640
1682
|
if (end <= start) continue;
|
|
1641
|
-
|
|
1642
|
-
if (
|
|
1643
|
-
|
|
1644
|
-
|
|
1683
|
+
const kind = tag >>> 24, data2 = tag & 16777215;
|
|
1684
|
+
if (kind === 1) styles.push([start, end, data2]);
|
|
1685
|
+
if (kind === TRACK_CHAR_SHAPE) charTc.push([start, end, data2]);
|
|
1686
|
+
if (kind === TRACK_PARA_SHAPE) paraTc = data2;
|
|
1687
|
+
if (TRACK_RANGES[kind]) {
|
|
1688
|
+
const range = { name: TRACK_RANGES[kind], tc: data2, paraend: end > crPos ? 1 : 0, id: 0 };
|
|
1689
|
+
add(start, { range, begin: true }, false);
|
|
1690
|
+
add(end, { range, begin: false }, true);
|
|
1691
|
+
}
|
|
1692
|
+
if (kind !== 2) continue;
|
|
1693
|
+
add(start, el("hp:markpenBegin", [["color", color(data2)]]), false);
|
|
1694
|
+
add(end, MARKPEN_END, true);
|
|
1645
1695
|
}
|
|
1646
|
-
return { marks, styles };
|
|
1696
|
+
return { marks, styles, charTc, paraTc };
|
|
1697
|
+
}
|
|
1698
|
+
var MARKPEN_END = "<hp:markpenEnd/>";
|
|
1699
|
+
function markTok(pos, m, ctx) {
|
|
1700
|
+
if (typeof m === "string") return m === MARKPEN_END ? { pos: pos - 1, t: "inline", xml: m, mark: true, end: pos } : { pos, t: "inline", xml: m, mark: true };
|
|
1701
|
+
const r = m.range;
|
|
1702
|
+
if (m.begin) r.id = ++ctx.trackMarks;
|
|
1703
|
+
const xml = m.begin ? el(`hp:${r.name}Begin`, [["Id", r.id], ["TcId", r.tc]]) : el(`hp:${r.name}End`, [["Id", r.id], ["TcId", r.tc], ["paraend", r.paraend]]);
|
|
1704
|
+
return m.begin ? { pos, t: "inline", xml, track: true } : { pos: pos - 1, t: "inline", xml, track: true, end: pos };
|
|
1647
1705
|
}
|
|
1706
|
+
var isTrack = (k) => k?.t === "inline" && !!k.track;
|
|
1648
1707
|
function tokenize(text, ctrls, ctx, cuts, marks) {
|
|
1649
1708
|
const toks = [];
|
|
1650
1709
|
const n = text.length / 2;
|
|
1651
1710
|
let ci = 0;
|
|
1652
1711
|
let buf = "", bufPos = 0;
|
|
1712
|
+
const pageNums = /* @__PURE__ */ new Set();
|
|
1653
1713
|
const flush = () => {
|
|
1654
1714
|
if (buf) toks.push({ pos: bufPos, t: "text", s: buf });
|
|
1655
1715
|
buf = "";
|
|
@@ -1660,7 +1720,7 @@ function tokenize(text, ctrls, ctx, cuts, marks) {
|
|
|
1660
1720
|
const mk = marks.get(i);
|
|
1661
1721
|
if (mk) {
|
|
1662
1722
|
flush();
|
|
1663
|
-
for (const
|
|
1723
|
+
for (const m of mk) toks.push(markTok(i, m, ctx));
|
|
1664
1724
|
}
|
|
1665
1725
|
if (c >= 32) {
|
|
1666
1726
|
if (!buf) bufPos = i;
|
|
@@ -1694,21 +1754,27 @@ function tokenize(text, ctrls, ctx, cuts, marks) {
|
|
|
1694
1754
|
const node = ctrls[ci++];
|
|
1695
1755
|
if (node) {
|
|
1696
1756
|
const r = controlXml(node, ctx);
|
|
1697
|
-
|
|
1757
|
+
const dup = r !== null && ctrlId(node) === "pgnp" && pageNums.has(r.xml);
|
|
1758
|
+
if (r && ctrlId(node) === "pgnp") pageNums.add(r.xml);
|
|
1759
|
+
if (r) toks.push({ pos: i, t: "ctrl", obj: r.obj, xml: dup ? "" : r.xml, def: r.def });
|
|
1698
1760
|
}
|
|
1699
1761
|
i += 8;
|
|
1700
1762
|
}
|
|
1701
1763
|
flush();
|
|
1702
|
-
for (const [pos, list] of marks) if (pos >= n) for (const
|
|
1764
|
+
for (const [pos, list] of marks) if (pos >= n) for (const m of list) toks.push(markTok(n, m, ctx));
|
|
1703
1765
|
for (let k = toks.length - 1; k >= 0; k--) {
|
|
1704
1766
|
const o = toks[k];
|
|
1705
|
-
if (o.t
|
|
1767
|
+
if (o.t !== "ctrl") continue;
|
|
1768
|
+
let j = k + 1;
|
|
1769
|
+
while (isTrack(toks[j]) && toks[j].pos <= o.pos + 8) j++;
|
|
1770
|
+
if (toks[j]?.pos !== o.pos + 8) toks.splice(j, 0, { pos: o.pos + 8, t: "text", s: "", fresh: j > k + 1 });
|
|
1706
1771
|
}
|
|
1707
1772
|
return toks;
|
|
1708
1773
|
}
|
|
1709
|
-
function runXml(charShape, toks) {
|
|
1710
|
-
const
|
|
1711
|
-
|
|
1774
|
+
function runXml(charShape, toks, tcId) {
|
|
1775
|
+
const runAttrs = [["charPrIDRef", charShape], ...tcId ? [["charTcId", tcId]] : []];
|
|
1776
|
+
const open = `<hp:run${attrs(runAttrs)}>`;
|
|
1777
|
+
if (!toks.length) return el("hp:run", runAttrs);
|
|
1712
1778
|
let out = "", t = null, tcs;
|
|
1713
1779
|
const closeT = () => {
|
|
1714
1780
|
if (t !== null) {
|
|
@@ -1718,6 +1784,7 @@ function runXml(charShape, toks) {
|
|
|
1718
1784
|
t = null;
|
|
1719
1785
|
};
|
|
1720
1786
|
toks.forEach((k, i) => {
|
|
1787
|
+
if (k.t === "text" && k.fresh) closeT();
|
|
1721
1788
|
if (k.t !== "ctrl" && t !== null && k.cs !== tcs) closeT();
|
|
1722
1789
|
if (k.t !== "ctrl" && t === null) tcs = k.cs;
|
|
1723
1790
|
if (k.t === "text") t = (t ?? "") + escText(k.s);
|
|
@@ -1733,7 +1800,7 @@ function runXml(charShape, toks) {
|
|
|
1733
1800
|
}
|
|
1734
1801
|
});
|
|
1735
1802
|
closeT();
|
|
1736
|
-
return (open + out + "</hp:run>").replace(`${open}</hp:run>`, el("hp:run",
|
|
1803
|
+
return (open + out + "</hp:run>").replace(`${open}</hp:run>`, el("hp:run", runAttrs));
|
|
1737
1804
|
}
|
|
1738
1805
|
function sectionXml(top, ctx) {
|
|
1739
1806
|
const last = top.filter((n) => n.rec.tagId === TAG2.PARA_HEADER).at(-1);
|
|
@@ -2027,13 +2094,22 @@ function shiftZeroBorderFill(parts) {
|
|
|
2027
2094
|
}
|
|
2028
2095
|
return out;
|
|
2029
2096
|
}
|
|
2097
|
+
function trackChangeSections(c) {
|
|
2098
|
+
if (c.distribution || !(c.header.flags & FLAG_TRACK_CHANGES)) return null;
|
|
2099
|
+
const out = [];
|
|
2100
|
+
for (let i = 0; ; i++) {
|
|
2101
|
+
const s = c.findStream(`/ViewText/Section${i}`);
|
|
2102
|
+
if (!s) break;
|
|
2103
|
+
out.push(s);
|
|
2104
|
+
}
|
|
2105
|
+
return out.length ? out : null;
|
|
2106
|
+
}
|
|
2030
2107
|
var V13_DEFAULT_SCRIPT = "function OnDocument_New()\r\n{\r\n //todo : \r\n}\r\n\r\n";
|
|
2031
2108
|
async function hwpToHwpx(input, options) {
|
|
2032
2109
|
const buffer = Buffer.from(input instanceof ArrayBuffer ? new Uint8Array(input) : input);
|
|
2033
2110
|
const c = openHwp5Container(buffer, options);
|
|
2034
|
-
if (c.distribution) throw new KordocError("\uBC30\uD3EC\uC6A9(\uC77D\uAE30 \uC804\uC6A9) HWP \uBB38\uC11C\uB294 HWPX \uB85C \uBCC0\uD658\uD558\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4 \u2014 \uC791\uC131\uC790\uAC00 \uBCF5\uC0AC\xB7\uD3B8\uC9D1\uC744 \uB9C9\uC740 \uBB38\uC11C\uC785\uB2C8\uB2E4");
|
|
2035
2111
|
const docInfo = readHwp5DocInfoRecords(c) ?? [];
|
|
2036
|
-
const sections = readHwp5SectionRecords(c, readHwp5SectionStreams(c), c.warnings);
|
|
2112
|
+
const sections = readHwp5SectionRecords(c, trackChangeSections(c) ?? readHwp5SectionStreams(c), c.warnings);
|
|
2037
2113
|
const bins = readHwp5BinData(c);
|
|
2038
2114
|
const linkDoc = c.findStream("/DocOptions/_LinkDoc");
|
|
2039
2115
|
const link = { path: "", pageInherit: 0, footnoteInherit: 0 };
|
|
@@ -2060,6 +2136,7 @@ async function hwpToHwpx(input, options) {
|
|
|
2060
2136
|
tailMasters: [],
|
|
2061
2137
|
memos: /* @__PURE__ */ new Map(),
|
|
2062
2138
|
linkedParas: /* @__PURE__ */ new Map(),
|
|
2139
|
+
trackMarks: 0,
|
|
2063
2140
|
chartOf(binId) {
|
|
2064
2141
|
if (chartByBin.has(binId)) return chartByBin.get(binId);
|
|
2065
2142
|
const item = items.find((b) => b.index === binId);
|
|
@@ -2169,15 +2246,15 @@ async function convertToHwpx(input, options) {
|
|
|
2169
2246
|
if (format !== "hwp" && format !== "hwp3" && format !== "hwpml") throw new KordocError(`HWP \uBB38\uC11C\uAC00 \uC544\uB2D9\uB2C8\uB2E4 (${format})`);
|
|
2170
2247
|
const engine = options?.engine ?? "kordoc";
|
|
2171
2248
|
if (engine !== "kordoc") {
|
|
2172
|
-
const { hancomAvailable, hwpToHwpxViaHancom } = await import("./hancom-
|
|
2249
|
+
const { hancomAvailable, hwpToHwpxViaHancom } = await import("./hancom-CBYVMPCO.js");
|
|
2173
2250
|
if (engine === "hancom" || !options?.password && hancomAvailable()) {
|
|
2174
2251
|
if (options?.password) throw new KordocError('\uD55C/\uAE00 \uC800\uC7A5 \uBCC0\uD658\uC740 \uC5F4\uAE30 \uC554\uD638\uB97C \uBC1B\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4 \u2014 engine "kordoc" \uC73C\uB85C \uBC14\uAFB8\uC138\uC694');
|
|
2175
2252
|
return { data: hwpToHwpxViaHancom(bytes, format === "hwpml" ? "hml" : "hwp"), mode: "preserve", engine: "hancom", warnings: [] };
|
|
2176
2253
|
}
|
|
2177
2254
|
}
|
|
2178
2255
|
if (format === "hwp") return { data: await hwpToHwpx(bytes, options), mode: "preserve", engine: "kordoc", warnings: [] };
|
|
2179
|
-
const { parse } = await import("./-
|
|
2180
|
-
const { markdownToHwpx } = await import("./generator-
|
|
2256
|
+
const { parse } = await import("./-5XLO3RHD.js");
|
|
2257
|
+
const { markdownToHwpx } = await import("./generator-JYJLWH7T.js");
|
|
2181
2258
|
const parsed = await parse(ab, { password: options?.password });
|
|
2182
2259
|
if (!parsed.success) throw new KordocError(parsed.error ?? "\uBB38\uC11C\uB97C \uC77D\uC9C0 \uBABB\uD588\uC2B5\uB2C8\uB2E4");
|
|
2183
2260
|
return {
|
|
@@ -2192,4 +2269,4 @@ export {
|
|
|
2192
2269
|
hwpToHwpx,
|
|
2193
2270
|
convertToHwpx
|
|
2194
2271
|
};
|
|
2195
|
-
//# sourceMappingURL=chunk-
|
|
2272
|
+
//# sourceMappingURL=chunk-CCGGLBHD.js.map
|