kordoc 3.5.2 → 3.5.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/{-LYUGJZQG.js → -KX7VLNW5.js} +3 -3
- package/dist/chunk-DCZVOIEO.cjs.map +1 -1
- package/dist/{chunk-DN5LTND6.js → chunk-DK2IE43H.js} +40 -27
- package/dist/{chunk-DN5LTND6.js.map → chunk-DK2IE43H.js.map} +1 -1
- package/dist/chunk-GS7T56RP.cjs.map +1 -1
- package/dist/{chunk-QXXQIZBH.js → chunk-VEB43O2L.js} +2 -2
- package/dist/{chunk-NOIHZQWC.js → chunk-WEAP42T3.js} +2 -2
- package/dist/{chunk-G44XLS26.cjs → chunk-XZTDYOZV.cjs} +2 -2
- package/dist/chunk-XZTDYOZV.cjs.map +1 -0
- package/dist/cli.js +4 -4
- package/dist/formula-5NKVS2LR.cjs.map +1 -1
- package/dist/index.cjs +149 -136
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +39 -26
- package/dist/index.js.map +1 -1
- package/dist/mcp.js +3 -3
- package/dist/page-range-P7SDW6LR.cjs.map +1 -1
- package/dist/{parser-2O276TRF.cjs → parser-CPTBEGQP.cjs} +14 -14
- package/dist/parser-CPTBEGQP.cjs.map +1 -0
- package/dist/{parser-KDF76UCB.js → parser-W5TBEAVX.js} +2 -2
- package/dist/{parser-4FFTFIYL.js → parser-XT65AEDJ.js} +2 -2
- package/dist/provider-G4C2V2PD.cjs.map +1 -1
- package/dist/{watch-MF7JFR7S.js → watch-VOSNRZAY.js} +3 -3
- package/package.json +1 -1
- package/dist/chunk-G44XLS26.cjs.map +0 -1
- package/dist/parser-2O276TRF.cjs.map +0 -1
- /package/dist/{-LYUGJZQG.js.map → -KX7VLNW5.js.map} +0 -0
- /package/dist/{chunk-QXXQIZBH.js.map → chunk-VEB43O2L.js.map} +0 -0
- /package/dist/{chunk-NOIHZQWC.js.map → chunk-WEAP42T3.js.map} +0 -0
- /package/dist/{parser-KDF76UCB.js.map → parser-W5TBEAVX.js.map} +0 -0
- /package/dist/{parser-4FFTFIYL.js.map → parser-XT65AEDJ.js.map} +0 -0
- /package/dist/{watch-MF7JFR7S.js.map → watch-VOSNRZAY.js.map} +0 -0
|
@@ -33,7 +33,7 @@ import {
|
|
|
33
33
|
patchHwpxBlocks,
|
|
34
34
|
renderHtml,
|
|
35
35
|
scanSectionXml
|
|
36
|
-
} from "./chunk-
|
|
36
|
+
} from "./chunk-DK2IE43H.js";
|
|
37
37
|
import {
|
|
38
38
|
detectFormat,
|
|
39
39
|
detectOle2Format,
|
|
@@ -46,7 +46,7 @@ import {
|
|
|
46
46
|
import {
|
|
47
47
|
VERSION,
|
|
48
48
|
blocksToMarkdown
|
|
49
|
-
} from "./chunk-
|
|
49
|
+
} from "./chunk-WEAP42T3.js";
|
|
50
50
|
import "./chunk-MOL7MDBG.js";
|
|
51
51
|
export {
|
|
52
52
|
HwpxSession,
|
|
@@ -92,4 +92,4 @@ export {
|
|
|
92
92
|
renderHtml,
|
|
93
93
|
scanSectionXml
|
|
94
94
|
};
|
|
95
|
-
//# sourceMappingURL=-
|
|
95
|
+
//# sourceMappingURL=-KX7VLNW5.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["/Users/
|
|
1
|
+
{"version":3,"sources":["/Users/mong-e/workspace/kordoc/dist/chunk-DCZVOIEO.cjs","../src/page-range.ts"],"names":[],"mappings":"AAAA;ACSO,SAAS,cAAA,CAAe,IAAA,EAAyB,QAAA,EAA+B;AACrF,EAAA,MAAM,OAAA,kBAAS,IAAI,GAAA,CAAY,CAAA;AAC/B,EAAA,GAAA,CAAI,SAAA,GAAY,CAAA,EAAG,OAAO,MAAA;AAE1B,EAAA,GAAA,CAAI,KAAA,CAAM,OAAA,CAAQ,IAAI,CAAA,EAAG;AACvB,IAAA,IAAA,CAAA,MAAW,EAAA,GAAK,IAAA,EAAM;AACpB,MAAA,MAAM,KAAA,EAAO,IAAA,CAAK,K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GAAA,CAAI,IAAI,CAAA;AAAA,IACpE;AAAA,EACF;AAEA,EAAA,OAAO,MAAA;AACT;ADZA;AACA;AACE;AACF,wCAAC","file":"/Users/mong-e/workspace/kordoc/dist/chunk-DCZVOIEO.cjs","sourcesContent":[null,"/** 페이지/섹션 범위 파싱 유틸리티 */\n\n/**\n * 페이지 범위 지정을 1-based Set<number>로 변환.\n *\n * @param spec - [1,2,3] 또는 \"1-3\" 또는 \"1,3,5-7\"\n * @param maxPages - 최대 페이지 수 (클램핑 상한)\n * @returns 1-based 페이지 번호 Set\n */\nexport function parsePageRange(spec: number[] | string, maxPages: number): Set<number> {\n const result = new Set<number>()\n if (maxPages <= 0) return result\n\n if (Array.isArray(spec)) {\n for (const n of spec) {\n const page = Math.round(n)\n if (page >= 1 && page <= maxPages) result.add(page)\n }\n return result\n }\n\n if (typeof spec !== \"string\" || spec.trim() === \"\") return result\n\n const parts = spec.split(\",\")\n for (const part of parts) {\n const trimmed = part.trim()\n if (!trimmed) continue\n\n const rangeMatch = trimmed.match(/^(\\d+)\\s*-\\s*(\\d+)$/)\n if (rangeMatch) {\n const start = Math.max(1, parseInt(rangeMatch[1], 10))\n const end = Math.min(maxPages, parseInt(rangeMatch[2], 10))\n for (let i = start; i <= end; i++) result.add(i)\n } else {\n const page = parseInt(trimmed, 10)\n if (!isNaN(page) && page >= 1 && page <= maxPages) result.add(page)\n }\n }\n\n return result\n}\n"]}
|
|
@@ -25,7 +25,7 @@ import {
|
|
|
25
25
|
sanitizeHref,
|
|
26
26
|
stripDtd,
|
|
27
27
|
toArrayBuffer
|
|
28
|
-
} from "./chunk-
|
|
28
|
+
} from "./chunk-WEAP42T3.js";
|
|
29
29
|
import {
|
|
30
30
|
parsePageRange
|
|
31
31
|
} from "./chunk-MOL7MDBG.js";
|
|
@@ -19880,11 +19880,21 @@ function standardMarker(depth, n) {
|
|
|
19880
19880
|
function reportMarker(depth) {
|
|
19881
19881
|
return REPORT_BULLETS[Math.min(depth, REPORT_BULLETS.length - 1)];
|
|
19882
19882
|
}
|
|
19883
|
-
|
|
19883
|
+
var MARKER_FULLWIDTH = "\u2460\u2461\u2462\u2463\u2464\u2465\u2466\u2467\u2468\u2469\u246A\u246B\u246C\u246D\u246E\u246F\u2470\u2471\u2472\u2473\u326E\u326F\u3270\u3271\u3272\u3273\u3274\u3275\u3276\u3277\u3278\u3279\u327A\u327B\u25A1\u25CB\u25E6\u25AA\u25C7\u25B3\u25B6\u318D";
|
|
19884
|
+
function markerWidth(marker, bodyHeight) {
|
|
19884
19885
|
const ta = bodyHeight / 2;
|
|
19885
|
-
|
|
19886
|
-
const
|
|
19887
|
-
|
|
19886
|
+
let w = 0;
|
|
19887
|
+
for (const c of marker) {
|
|
19888
|
+
if (/[가-힣]/.test(c) || MARKER_FULLWIDTH.includes(c)) w += bodyHeight;
|
|
19889
|
+
else if (c === "." || c === ",") w += Math.round(bodyHeight * 0.25);
|
|
19890
|
+
else if (c === "(" || c === ")") w += Math.round(bodyHeight * 0.45);
|
|
19891
|
+
else w += Math.round(ta);
|
|
19892
|
+
}
|
|
19893
|
+
return Math.round(w + ta);
|
|
19894
|
+
}
|
|
19895
|
+
function levelIndent(depth, bodyHeight, numbering) {
|
|
19896
|
+
const marker = numbering === "report" ? reportMarker(depth) : standardMarker(depth, 0);
|
|
19897
|
+
return { left: Math.round(depth * bodyHeight), indent: -markerWidth(marker, bodyHeight) };
|
|
19888
19898
|
}
|
|
19889
19899
|
function computeSuppression(depths) {
|
|
19890
19900
|
const counts = /* @__PURE__ */ new Map();
|
|
@@ -20151,24 +20161,26 @@ function generateManifest() {
|
|
|
20151
20161
|
</opf:spine>
|
|
20152
20162
|
</opf:package>`;
|
|
20153
20163
|
}
|
|
20154
|
-
function charPr(id, height, bold, italic, fontId = 0, textColor = DEFAULT_TEXT_COLOR) {
|
|
20164
|
+
function charPr(id, height, bold, italic, fontId = 0, textColor = DEFAULT_TEXT_COLOR, ratioPct = 100) {
|
|
20155
20165
|
const boldAttr = bold ? ` bold="1"` : "";
|
|
20156
20166
|
const italicAttr = italic ? ` italic="1"` : "";
|
|
20157
20167
|
const effFont = bold ? 2 : fontId;
|
|
20158
20168
|
return ` <hh:charPr id="${id}" height="${height}" textColor="${textColor}" shadeColor="none" useFontSpace="0" useKerning="0" symMark="NONE" borderFillIDRef="0"${boldAttr}${italicAttr}>
|
|
20159
20169
|
<hh:fontRef hangul="${effFont}" latin="${effFont}" hanja="${effFont}" japanese="${effFont}" other="${effFont}" symbol="${effFont}" user="${effFont}"/>
|
|
20160
|
-
<hh:ratio hangul="
|
|
20170
|
+
<hh:ratio hangul="${ratioPct}" latin="${ratioPct}" hanja="${ratioPct}" japanese="100" other="100" symbol="100" user="100"/>
|
|
20161
20171
|
<hh:spacing hangul="0" latin="0" hanja="0" japanese="0" other="0" symbol="0" user="0"/>
|
|
20162
20172
|
<hh:relSz hangul="100" latin="100" hanja="100" japanese="100" other="100" symbol="100" user="100"/>
|
|
20163
20173
|
<hh:offset hangul="0" latin="0" hanja="0" japanese="0" other="0" symbol="0" user="0"/>
|
|
20164
20174
|
</hh:charPr>`;
|
|
20165
20175
|
}
|
|
20166
20176
|
function paraPr(id, opts = {}) {
|
|
20167
|
-
const { align = "JUSTIFY", spaceBefore = 0, spaceAfter = 0, lineSpacing = 160, indent = 0, left = 0 } = opts;
|
|
20168
|
-
|
|
20177
|
+
const { align = "JUSTIFY", spaceBefore = 0, spaceAfter = 0, lineSpacing = 160, indent = 0, left = 0, keepWord = false } = opts;
|
|
20178
|
+
const breakNonLatin = keepWord ? "KEEP_WORD" : "BREAK_WORD";
|
|
20179
|
+
const snapGrid = keepWord ? "0" : "1";
|
|
20180
|
+
return ` <hh:paraPr id="${id}" tabPrIDRef="0" condense="0" fontLineHeight="0" snapToGrid="${snapGrid}" suppressLineNumbers="0" checked="0" textDir="AUTO">
|
|
20169
20181
|
<hh:align horizontal="${align}" vertical="BASELINE"/>
|
|
20170
20182
|
<hh:heading type="NONE" idRef="0" level="0"/>
|
|
20171
|
-
<hh:breakSetting breakLatinWord="KEEP_WORD" breakNonLatinWord="
|
|
20183
|
+
<hh:breakSetting breakLatinWord="KEEP_WORD" breakNonLatinWord="${breakNonLatin}" widowOrphan="0" keepWithNext="0" keepLines="0" pageBreakBefore="0" lineWrap="BREAK"/>
|
|
20172
20184
|
<hh:autoSpacing eAsianEng="0" eAsianNum="0"/>
|
|
20173
20185
|
<hh:margin><hc:intent value="${indent}" unit="HWPUNIT"/><hc:left value="${left}" unit="HWPUNIT"/><hc:right value="0" unit="HWPUNIT"/><hc:prev value="${spaceBefore}" unit="HWPUNIT"/><hc:next value="${spaceAfter}" unit="HWPUNIT"/></hh:margin>
|
|
20174
20186
|
<hh:lineSpacing type="PERCENT" value="${lineSpacing}"/>
|
|
@@ -20188,11 +20200,12 @@ function buildCharProperties(theme, gongmun) {
|
|
|
20188
20200
|
h3 = body;
|
|
20189
20201
|
h4 = Math.max(body - 100, 1300);
|
|
20190
20202
|
}
|
|
20203
|
+
const bodyRatio = gongmun ? 95 : 100;
|
|
20191
20204
|
const rows = [
|
|
20192
|
-
charPr(0, body, false, false, 0, theme.body),
|
|
20193
|
-
charPr(1, body, true, false, 0, theme.body),
|
|
20194
|
-
charPr(2, body, false, true, 0, theme.body),
|
|
20195
|
-
charPr(3, body, true, true, 0, theme.body),
|
|
20205
|
+
charPr(0, body, false, false, 0, theme.body, bodyRatio),
|
|
20206
|
+
charPr(1, body, true, false, 0, theme.body, bodyRatio),
|
|
20207
|
+
charPr(2, body, false, true, 0, theme.body, bodyRatio),
|
|
20208
|
+
charPr(3, body, true, true, 0, theme.body, bodyRatio),
|
|
20196
20209
|
charPr(4, code, false, false, 1),
|
|
20197
20210
|
charPr(5, h1, true, false, 1, theme.h1),
|
|
20198
20211
|
charPr(6, h2, true, false, 1, theme.h2),
|
|
@@ -20224,21 +20237,21 @@ ${base2.join("\n")}
|
|
|
20224
20237
|
const ls = gongmun.lineSpacing;
|
|
20225
20238
|
const titleAlign = gongmun.centerTitle ? "CENTER" : "LEFT";
|
|
20226
20239
|
const base = [
|
|
20227
|
-
paraPr(0, { lineSpacing: ls }),
|
|
20228
|
-
paraPr(1, { align: titleAlign, spaceBefore: 400, spaceAfter: 400, lineSpacing: ls }),
|
|
20229
|
-
paraPr(2, { align: "LEFT", spaceBefore: 600, spaceAfter: 150, lineSpacing: ls }),
|
|
20230
|
-
paraPr(3, { align: "LEFT", spaceBefore: 400, spaceAfter: 100, lineSpacing: ls }),
|
|
20231
|
-
paraPr(4, { align: "LEFT", spaceBefore: 300, spaceAfter: 100, lineSpacing: ls }),
|
|
20232
|
-
paraPr(5, { align: "LEFT", lineSpacing: 130, indent: 400 }),
|
|
20233
|
-
paraPr(6, { align: "LEFT", lineSpacing: ls, indent: 600 }),
|
|
20234
|
-
paraPr(7, { align: "LEFT", lineSpacing: ls, indent: 600 })
|
|
20240
|
+
paraPr(0, { lineSpacing: ls, keepWord: true }),
|
|
20241
|
+
paraPr(1, { align: titleAlign, spaceBefore: 400, spaceAfter: 400, lineSpacing: ls, keepWord: true }),
|
|
20242
|
+
paraPr(2, { align: "LEFT", spaceBefore: 600, spaceAfter: 150, lineSpacing: ls, keepWord: true }),
|
|
20243
|
+
paraPr(3, { align: "LEFT", spaceBefore: 400, spaceAfter: 100, lineSpacing: ls, keepWord: true }),
|
|
20244
|
+
paraPr(4, { align: "LEFT", spaceBefore: 300, spaceAfter: 100, lineSpacing: ls, keepWord: true }),
|
|
20245
|
+
paraPr(5, { align: "LEFT", lineSpacing: 130, indent: 400, keepWord: true }),
|
|
20246
|
+
paraPr(6, { align: "LEFT", lineSpacing: ls, indent: 600, keepWord: true }),
|
|
20247
|
+
paraPr(7, { align: "LEFT", lineSpacing: ls, indent: 600, keepWord: true })
|
|
20235
20248
|
];
|
|
20236
20249
|
for (let d = 0; d < GONGMUN_LIST_LEVELS; d++) {
|
|
20237
20250
|
const { left, indent } = levelIndent(d, gongmun.bodyHeight, gongmun.numbering);
|
|
20238
20251
|
const sectionGap = gongmun.numbering === "report" && d === 0 ? Math.round(gongmun.bodyHeight * 0.5) : 0;
|
|
20239
|
-
base.push(paraPr(GONGMUN_LIST_BASE + d, { align: "JUSTIFY", lineSpacing: ls, left, indent, spaceBefore: sectionGap }));
|
|
20252
|
+
base.push(paraPr(GONGMUN_LIST_BASE + d, { align: "JUSTIFY", lineSpacing: ls, left, indent, spaceBefore: sectionGap, keepWord: true }));
|
|
20240
20253
|
}
|
|
20241
|
-
base.push(paraPr(GONGMUN_CENTER, { align: "CENTER", lineSpacing: ls }));
|
|
20254
|
+
base.push(paraPr(GONGMUN_CENTER, { align: "CENTER", lineSpacing: ls, keepWord: true }));
|
|
20242
20255
|
return `<hh:paraProperties itemCnt="${base.length}">
|
|
20243
20256
|
${base.join("\n")}
|
|
20244
20257
|
</hh:paraProperties>`;
|
|
@@ -20331,7 +20344,7 @@ function generateHeaderXml(theme, gongmun) {
|
|
|
20331
20344
|
<hh:style id="0" type="PARA" name="\uBC14\uD0D5\uAE00" engName="Normal" paraPrIDRef="0" charPrIDRef="0" nextStyleIDRef="0" langIDRef="1042" lockForm="0"/>
|
|
20332
20345
|
</hh:styles>
|
|
20333
20346
|
</hh:refList>
|
|
20334
|
-
<hh:compatibleDocument targetProgram="HWP2018"
|
|
20347
|
+
<hh:compatibleDocument targetProgram="HWP2018"><hh:layoutCompatibility/></hh:compatibleDocument>
|
|
20335
20348
|
</hh:head>`;
|
|
20336
20349
|
}
|
|
20337
20350
|
function generateSecPr(gongmun) {
|
|
@@ -23297,7 +23310,7 @@ async function parseHwp(buffer, options) {
|
|
|
23297
23310
|
async function parsePdf(buffer, options) {
|
|
23298
23311
|
let parsePdfDocument;
|
|
23299
23312
|
try {
|
|
23300
|
-
const mod = await import("./parser-
|
|
23313
|
+
const mod = await import("./parser-W5TBEAVX.js");
|
|
23301
23314
|
parsePdfDocument = mod.parsePdfDocument;
|
|
23302
23315
|
} catch {
|
|
23303
23316
|
return {
|
|
@@ -23424,4 +23437,4 @@ export {
|
|
|
23424
23437
|
parseHwpml,
|
|
23425
23438
|
fillForm
|
|
23426
23439
|
};
|
|
23427
|
-
//# sourceMappingURL=chunk-
|
|
23440
|
+
//# sourceMappingURL=chunk-DK2IE43H.js.map
|