kordoc 4.2.0 → 4.2.2

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.
Files changed (103) hide show
  1. package/README.md +20 -8
  2. package/dist/{-SXQIZHYA.js → -NFHVGTVM.js} +12 -10
  3. package/dist/{chunk-FSXLSHCW.js → chunk-2L7MIKOM.js} +3 -3
  4. package/dist/chunk-2L7MIKOM.js.map +1 -0
  5. package/dist/{pdf-ocr-2Z7VZIFI.cjs → chunk-DLFZAU4X.cjs} +129 -8
  6. package/dist/chunk-DLFZAU4X.cjs.map +1 -0
  7. package/dist/{chunk-CMN3SYZ3.js → chunk-DSL6EVFJ.js} +6 -4
  8. package/dist/chunk-DSL6EVFJ.js.map +1 -0
  9. package/dist/{chunk-LHROM2BO.cjs → chunk-EFF2JPPA.cjs} +15 -10
  10. package/dist/chunk-EFF2JPPA.cjs.map +1 -0
  11. package/dist/{chunk-V6U6YS5B.js → chunk-FHYLLKIP.js} +3 -3
  12. package/dist/chunk-FHYLLKIP.js.map +1 -0
  13. package/dist/{chunk-6SHO3BNV.js → chunk-GHMVNMUN.js} +3 -3
  14. package/dist/{chunk-JP5YH3Z4.js → chunk-GUYIXVV7.js} +3 -3
  15. package/dist/chunk-GUYIXVV7.js.map +1 -0
  16. package/dist/{chunk-WF2E5P2G.js → chunk-IXHBRMDB.js} +6 -4
  17. package/dist/chunk-IXHBRMDB.js.map +1 -0
  18. package/dist/{chunk-F2HYH62H.cjs → chunk-KKZATKQW.cjs} +3 -3
  19. package/dist/chunk-KKZATKQW.cjs.map +1 -0
  20. package/dist/{chunk-ELOV2GIJ.js → chunk-L5B7PQOP.js} +2 -2
  21. package/dist/{chunk-WQLHPOMJ.js → chunk-LUJN3VFB.js} +3 -3
  22. package/dist/{pdf-ocr-FJFXFADQ.js → chunk-MOOVF6CT.js} +129 -7
  23. package/dist/chunk-MOOVF6CT.js.map +1 -0
  24. package/dist/{chunk-PLIY23LY.js → chunk-MYD3QLBL.js} +2 -2
  25. package/dist/{chunk-26AJJCFF.js → chunk-OLDIDBJ2.js} +9 -4
  26. package/dist/{chunk-26AJJCFF.js.map → chunk-OLDIDBJ2.js.map} +1 -1
  27. package/dist/{pdf-ocr-VYE4DHD4.js → chunk-T4AWY45Q.js} +128 -9
  28. package/dist/chunk-T4AWY45Q.js.map +1 -0
  29. package/dist/{chunk-YOO6ET6M.js → chunk-TCJRGFYY.js} +11 -1
  30. package/dist/chunk-TCJRGFYY.js.map +1 -0
  31. package/dist/{chunk-IGGRLWT5.js → chunk-TXYQJXOV.js} +67 -14
  32. package/dist/chunk-TXYQJXOV.js.map +1 -0
  33. package/dist/{chunk-XTCT6KQ5.cjs → chunk-WMU2KJHF.cjs} +8 -6
  34. package/dist/chunk-WMU2KJHF.cjs.map +1 -0
  35. package/dist/{chunk-4JPPLIIV.js → chunk-X77U36TV.js} +8 -3
  36. package/dist/{chunk-4JPPLIIV.js.map → chunk-X77U36TV.js.map} +1 -1
  37. package/dist/{chunk-4VNLZ2GZ.js → chunk-ZF7QL4IY.js} +1 -1
  38. package/dist/chunk-ZF7QL4IY.js.map +1 -0
  39. package/dist/chunks-N4CWHTJI.js +10 -0
  40. package/dist/cli.js +19 -19
  41. package/dist/cli.js.map +1 -1
  42. package/dist/{detect-YEZX2XCF.js → detect-FX2ZHKZP.js} +4 -2
  43. package/dist/image-ocr-3AFBDDJI.cjs +66 -0
  44. package/dist/image-ocr-3AFBDDJI.cjs.map +1 -0
  45. package/dist/image-ocr-S4REURLR.js +69 -0
  46. package/dist/image-ocr-S4REURLR.js.map +1 -0
  47. package/dist/image-ocr-TGHAMIQL.js +65 -0
  48. package/dist/image-ocr-TGHAMIQL.js.map +1 -0
  49. package/dist/index.cjs +471 -409
  50. package/dist/index.cjs.map +1 -1
  51. package/dist/index.d.cts +7 -2
  52. package/dist/index.d.ts +7 -2
  53. package/dist/index.js +71 -9
  54. package/dist/index.js.map +1 -1
  55. package/dist/mcp.js +19 -19
  56. package/dist/mcp.js.map +1 -1
  57. package/dist/{parser-RBZHA6SY.js → parser-C3APVZGT.js} +6 -6
  58. package/dist/{parser-ND2YGQZR.js → parser-KMC4YOZH.js} +5 -5
  59. package/dist/{parser-WDZOMDG4.cjs → parser-MRM6WICO.cjs} +24 -24
  60. package/dist/{parser-WDZOMDG4.cjs.map → parser-MRM6WICO.cjs.map} +1 -1
  61. package/dist/pdf-ocr-5BRMIJAT.cjs +13 -0
  62. package/dist/pdf-ocr-5BRMIJAT.cjs.map +1 -0
  63. package/dist/pdf-ocr-UDTEQEWA.js +12 -0
  64. package/dist/pdf-ocr-UURMV6FD.js +15 -0
  65. package/dist/{profile-io-TWHDIVPL.js → profile-io-RLQ62KS5.js} +3 -3
  66. package/dist/{rasterize-W2NEZUSW.js → rasterize-LBABF2WI.js} +2 -2
  67. package/dist/render-CYXQEHS7.js +10 -0
  68. package/dist/render-CYXQEHS7.js.map +1 -0
  69. package/dist/seal-SV6PFFYU.js +10 -0
  70. package/dist/seal-SV6PFFYU.js.map +1 -0
  71. package/dist/{watch-VWXJZT2R.js → watch-XEUEGOXW.js} +10 -10
  72. package/package.json +1 -1
  73. package/dist/chunk-4VNLZ2GZ.js.map +0 -1
  74. package/dist/chunk-CMN3SYZ3.js.map +0 -1
  75. package/dist/chunk-F2HYH62H.cjs.map +0 -1
  76. package/dist/chunk-FSXLSHCW.js.map +0 -1
  77. package/dist/chunk-IGGRLWT5.js.map +0 -1
  78. package/dist/chunk-JP5YH3Z4.js.map +0 -1
  79. package/dist/chunk-LHROM2BO.cjs.map +0 -1
  80. package/dist/chunk-V6U6YS5B.js.map +0 -1
  81. package/dist/chunk-WF2E5P2G.js.map +0 -1
  82. package/dist/chunk-XTCT6KQ5.cjs.map +0 -1
  83. package/dist/chunk-YOO6ET6M.js.map +0 -1
  84. package/dist/chunks-ZQEFAZNC.js +0 -10
  85. package/dist/pdf-ocr-2Z7VZIFI.cjs.map +0 -1
  86. package/dist/pdf-ocr-FJFXFADQ.js.map +0 -1
  87. package/dist/pdf-ocr-VYE4DHD4.js.map +0 -1
  88. package/dist/render-4MG5QUDG.js +0 -10
  89. package/dist/seal-D2QNXJVO.js +0 -10
  90. /package/dist/{-SXQIZHYA.js.map → -NFHVGTVM.js.map} +0 -0
  91. /package/dist/{chunk-6SHO3BNV.js.map → chunk-GHMVNMUN.js.map} +0 -0
  92. /package/dist/{chunk-ELOV2GIJ.js.map → chunk-L5B7PQOP.js.map} +0 -0
  93. /package/dist/{chunk-WQLHPOMJ.js.map → chunk-LUJN3VFB.js.map} +0 -0
  94. /package/dist/{chunk-PLIY23LY.js.map → chunk-MYD3QLBL.js.map} +0 -0
  95. /package/dist/{chunks-ZQEFAZNC.js.map → chunks-N4CWHTJI.js.map} +0 -0
  96. /package/dist/{detect-YEZX2XCF.js.map → detect-FX2ZHKZP.js.map} +0 -0
  97. /package/dist/{parser-RBZHA6SY.js.map → parser-C3APVZGT.js.map} +0 -0
  98. /package/dist/{parser-ND2YGQZR.js.map → parser-KMC4YOZH.js.map} +0 -0
  99. /package/dist/{profile-io-TWHDIVPL.js.map → pdf-ocr-UDTEQEWA.js.map} +0 -0
  100. /package/dist/{render-4MG5QUDG.js.map → pdf-ocr-UURMV6FD.js.map} +0 -0
  101. /package/dist/{seal-D2QNXJVO.js.map → profile-io-RLQ62KS5.js.map} +0 -0
  102. /package/dist/{rasterize-W2NEZUSW.js.map → rasterize-LBABF2WI.js.map} +0 -0
  103. /package/dist/{watch-VWXJZT2R.js.map → watch-XEUEGOXW.js.map} +0 -0
package/dist/index.d.cts CHANGED
@@ -15,6 +15,7 @@ interface IRSpan {
15
15
  text: string;
16
16
  bold?: boolean;
17
17
  italic?: boolean;
18
+ strike?: boolean;
18
19
  code?: boolean;
19
20
  }
20
21
  interface IRBlock {
@@ -78,6 +79,8 @@ interface BoundingBox {
78
79
  interface InlineStyle {
79
80
  bold?: boolean;
80
81
  italic?: boolean;
82
+ /** 취소선 — 법령 개정문 등의 삭제 표시. 판정은 취소선 모양 whitelist (비트만 믿으면 오탐) */
83
+ strike?: boolean;
81
84
  fontSize?: number;
82
85
  fontName?: string;
83
86
  }
@@ -203,7 +206,7 @@ interface OutlineItem {
203
206
  }
204
207
  /** 구조화된 에러 코드 — 프로그래밍적 에러 핸들링용 */
205
208
  type ErrorCode = "EMPTY_INPUT" | "UNSUPPORTED_FORMAT" | "ENCRYPTED" | "DRM_PROTECTED" | "CORRUPTED" | "DECOMPRESSION_BOMB" | "ZIP_BOMB" | "IMAGE_BASED_PDF" | "NO_SECTIONS" | "PARSE_ERROR" | "MISSING_DEPENDENCY";
206
- type FileType = "hwpx" | "hwp" | "hwp3" | "hwpml" | "pdf" | "xlsx" | "xls" | "docx" | "unknown";
209
+ type FileType = "hwpx" | "hwp" | "hwp3" | "hwpml" | "pdf" | "xlsx" | "xls" | "docx" | "image" | "unknown";
207
210
  interface ParseResultBase {
208
211
  fileType: FileType;
209
212
  /** 페이지/섹션 수 — PDF: 실제 페이지 수, HWP/HWPX: 섹션 수, XLSX: 시트 수 */
@@ -1609,6 +1612,8 @@ declare const VERSION: string;
1609
1612
  * ```
1610
1613
  */
1611
1614
  declare function parse(input: string | ArrayBuffer | Buffer, options?: ParseOptions): Promise<ParseResult>;
1615
+ /** 이미지(PNG/JPEG/WebP)를 OCR 로 Markdown 변환 — 텍스트층이 없으므로 OCR 상시 적용 */
1616
+ declare function parseImage(buffer: ArrayBuffer, options?: ParseOptions): Promise<ParseResult>;
1612
1617
  /** HWP 3.x (구버전 한컴 워드프로세서) 파일을 Markdown 으로 변환. */
1613
1618
  declare function parseHwp3(buffer: ArrayBuffer, options?: ParseOptions): Promise<ParseResult>;
1614
1619
  /** HWPX 파일을 Markdown으로 변환 */
@@ -1664,4 +1669,4 @@ interface FillFormOutput {
1664
1669
  */
1665
1670
  declare function fillForm(input: string | ArrayBuffer | Buffer, values: Record<string, FillInput>, outputFormat?: FillOutputFormat): Promise<FillFormOutput>;
1666
1671
 
1667
- export { type BlockCapability, type BlockCapabilityInfo, type BlockDiff, type BlockEdit, type BlockSourceRef, type BorderDef, type BorderFillDef, type BoundingBox, type CellCapability, type CellContext, type CellDiff, type CellProfile, type CharPrDef, type ChunkOptions, DEFAULT_REDACT_RULES, type DiffChangeType, type DiffResult, type DocChunk, type DocumentMetadata, type DocumentQualitySummary, type ErrorCode, type ExtractedImage, type FileType, type FillFormOutput, type FillInput, type FillOutputFormat, type FillResult, type FillValue, type FormField, type FormFieldSchema, type FormFieldType, type FormResult, type FormSchemaResult, type FormatProfile, type GongmunFont, type GongmunLintFinding, type GongmunNumbering, type GongmunOptions, type GongmunPreset, type GongmunPresetInput, type HwpxFillResult, HwpxSession, type HwpxTheme, type IRBlock, type IRBlockType, type IRCell, type IRTable, type ImageData, type InlineStyle, type MarkdownToHwpxOptions, type MeasureOptions, type OcrProvider, type OutlineItem, PRESET_ALIAS, type PageMargin, type PageQuality, type ParseFailure, type ParseOptions, type ParseResult, type ParseSuccess, type ParseWarning, type PatchOptions, type PatchResult, type PatchSkip, type PlaceSealResult, type PrintOptions, type PrintPreset, type RedactHit, type RedactOptions, type RedactRule, type RedactTextResult, type RenderSvgOptions, type RenderSvgResult, SPACE_EM_FIXED, SPACE_EM_FONT, type ScanCell, type ScanParaKind, type ScanParagraph, type ScanTable, type SealOp, type SealPlacement, type SectionScan, type SpliceEdit, type TRange, type TableProfile, VERSION, type ValidateIssue, type ValidateResult, ValueCursor, type WarningCode, type WatchOptions, type WrapMode, type WrapResult, applySplices, blocksToChunks, blocksToMarkdown, blocksToPdf, buildParagraphSplices, buildRangeSplices, charWidthEm1000, compare, detectFormat, detectOle2Format, detectZipFormat, diffBlocks, extractFormFields, extractFormSchema, fillForm, fillFormFields, fillHwpx, fillWithUniqueGuard, fitRatioForFewerLines, formatFillValue, gongmunLintWarnings, hwpxToProfile, incompatibleGongmunWarnings, inferFieldType, isHwpxFile, isKnownFont, isLabelCell, isOldHwpFile, isPdfFile, isZipFile, lintGongmunText, markdownToHwpx, markdownToPdf, measureTextWidth, normalizeGongmunPreset, openHwpxDocument, parse, parseDocx, parseHwp, parseHwp3, parseHwpml, parseHwpx, parsePdf, parseXls, parseXlsx, patchHwp, patchHwpx, patchHwpxBlocks, placeSealHwpx, redactMarkdown, redactText, renderHtml, renderHwpxToSvg, scanSectionXml, simulateWrap, simulateWrapKeepWord, unknownFontWarnings, validateHwpx };
1672
+ export { type BlockCapability, type BlockCapabilityInfo, type BlockDiff, type BlockEdit, type BlockSourceRef, type BorderDef, type BorderFillDef, type BoundingBox, type CellCapability, type CellContext, type CellDiff, type CellProfile, type CharPrDef, type ChunkOptions, DEFAULT_REDACT_RULES, type DiffChangeType, type DiffResult, type DocChunk, type DocumentMetadata, type DocumentQualitySummary, type ErrorCode, type ExtractedImage, type FileType, type FillFormOutput, type FillInput, type FillOutputFormat, type FillResult, type FillValue, type FormField, type FormFieldSchema, type FormFieldType, type FormResult, type FormSchemaResult, type FormatProfile, type GongmunFont, type GongmunLintFinding, type GongmunNumbering, type GongmunOptions, type GongmunPreset, type GongmunPresetInput, type HwpxFillResult, HwpxSession, type HwpxTheme, type IRBlock, type IRBlockType, type IRCell, type IRTable, type ImageData, type InlineStyle, type MarkdownToHwpxOptions, type MeasureOptions, type OcrProvider, type OutlineItem, PRESET_ALIAS, type PageMargin, type PageQuality, type ParseFailure, type ParseOptions, type ParseResult, type ParseSuccess, type ParseWarning, type PatchOptions, type PatchResult, type PatchSkip, type PlaceSealResult, type PrintOptions, type PrintPreset, type RedactHit, type RedactOptions, type RedactRule, type RedactTextResult, type RenderSvgOptions, type RenderSvgResult, SPACE_EM_FIXED, SPACE_EM_FONT, type ScanCell, type ScanParaKind, type ScanParagraph, type ScanTable, type SealOp, type SealPlacement, type SectionScan, type SpliceEdit, type TRange, type TableProfile, VERSION, type ValidateIssue, type ValidateResult, ValueCursor, type WarningCode, type WatchOptions, type WrapMode, type WrapResult, applySplices, blocksToChunks, blocksToMarkdown, blocksToPdf, buildParagraphSplices, buildRangeSplices, charWidthEm1000, compare, detectFormat, detectOle2Format, detectZipFormat, diffBlocks, extractFormFields, extractFormSchema, fillForm, fillFormFields, fillHwpx, fillWithUniqueGuard, fitRatioForFewerLines, formatFillValue, gongmunLintWarnings, hwpxToProfile, incompatibleGongmunWarnings, inferFieldType, isHwpxFile, isKnownFont, isLabelCell, isOldHwpFile, isPdfFile, isZipFile, lintGongmunText, markdownToHwpx, markdownToPdf, measureTextWidth, normalizeGongmunPreset, openHwpxDocument, parse, parseDocx, parseHwp, parseHwp3, parseHwpml, parseHwpx, parseImage, parsePdf, parseXls, parseXlsx, patchHwp, patchHwpx, patchHwpxBlocks, placeSealHwpx, redactMarkdown, redactText, renderHtml, renderHwpxToSvg, scanSectionXml, simulateWrap, simulateWrapKeepWord, unknownFontWarnings, validateHwpx };
package/dist/index.d.ts CHANGED
@@ -15,6 +15,7 @@ interface IRSpan {
15
15
  text: string;
16
16
  bold?: boolean;
17
17
  italic?: boolean;
18
+ strike?: boolean;
18
19
  code?: boolean;
19
20
  }
20
21
  interface IRBlock {
@@ -78,6 +79,8 @@ interface BoundingBox {
78
79
  interface InlineStyle {
79
80
  bold?: boolean;
80
81
  italic?: boolean;
82
+ /** 취소선 — 법령 개정문 등의 삭제 표시. 판정은 취소선 모양 whitelist (비트만 믿으면 오탐) */
83
+ strike?: boolean;
81
84
  fontSize?: number;
82
85
  fontName?: string;
83
86
  }
@@ -203,7 +206,7 @@ interface OutlineItem {
203
206
  }
204
207
  /** 구조화된 에러 코드 — 프로그래밍적 에러 핸들링용 */
205
208
  type ErrorCode = "EMPTY_INPUT" | "UNSUPPORTED_FORMAT" | "ENCRYPTED" | "DRM_PROTECTED" | "CORRUPTED" | "DECOMPRESSION_BOMB" | "ZIP_BOMB" | "IMAGE_BASED_PDF" | "NO_SECTIONS" | "PARSE_ERROR" | "MISSING_DEPENDENCY";
206
- type FileType = "hwpx" | "hwp" | "hwp3" | "hwpml" | "pdf" | "xlsx" | "xls" | "docx" | "unknown";
209
+ type FileType = "hwpx" | "hwp" | "hwp3" | "hwpml" | "pdf" | "xlsx" | "xls" | "docx" | "image" | "unknown";
207
210
  interface ParseResultBase {
208
211
  fileType: FileType;
209
212
  /** 페이지/섹션 수 — PDF: 실제 페이지 수, HWP/HWPX: 섹션 수, XLSX: 시트 수 */
@@ -1609,6 +1612,8 @@ declare const VERSION: string;
1609
1612
  * ```
1610
1613
  */
1611
1614
  declare function parse(input: string | ArrayBuffer | Buffer, options?: ParseOptions): Promise<ParseResult>;
1615
+ /** 이미지(PNG/JPEG/WebP)를 OCR 로 Markdown 변환 — 텍스트층이 없으므로 OCR 상시 적용 */
1616
+ declare function parseImage(buffer: ArrayBuffer, options?: ParseOptions): Promise<ParseResult>;
1612
1617
  /** HWP 3.x (구버전 한컴 워드프로세서) 파일을 Markdown 으로 변환. */
1613
1618
  declare function parseHwp3(buffer: ArrayBuffer, options?: ParseOptions): Promise<ParseResult>;
1614
1619
  /** HWPX 파일을 Markdown으로 변환 */
@@ -1664,4 +1669,4 @@ interface FillFormOutput {
1664
1669
  */
1665
1670
  declare function fillForm(input: string | ArrayBuffer | Buffer, values: Record<string, FillInput>, outputFormat?: FillOutputFormat): Promise<FillFormOutput>;
1666
1671
 
1667
- export { type BlockCapability, type BlockCapabilityInfo, type BlockDiff, type BlockEdit, type BlockSourceRef, type BorderDef, type BorderFillDef, type BoundingBox, type CellCapability, type CellContext, type CellDiff, type CellProfile, type CharPrDef, type ChunkOptions, DEFAULT_REDACT_RULES, type DiffChangeType, type DiffResult, type DocChunk, type DocumentMetadata, type DocumentQualitySummary, type ErrorCode, type ExtractedImage, type FileType, type FillFormOutput, type FillInput, type FillOutputFormat, type FillResult, type FillValue, type FormField, type FormFieldSchema, type FormFieldType, type FormResult, type FormSchemaResult, type FormatProfile, type GongmunFont, type GongmunLintFinding, type GongmunNumbering, type GongmunOptions, type GongmunPreset, type GongmunPresetInput, type HwpxFillResult, HwpxSession, type HwpxTheme, type IRBlock, type IRBlockType, type IRCell, type IRTable, type ImageData, type InlineStyle, type MarkdownToHwpxOptions, type MeasureOptions, type OcrProvider, type OutlineItem, PRESET_ALIAS, type PageMargin, type PageQuality, type ParseFailure, type ParseOptions, type ParseResult, type ParseSuccess, type ParseWarning, type PatchOptions, type PatchResult, type PatchSkip, type PlaceSealResult, type PrintOptions, type PrintPreset, type RedactHit, type RedactOptions, type RedactRule, type RedactTextResult, type RenderSvgOptions, type RenderSvgResult, SPACE_EM_FIXED, SPACE_EM_FONT, type ScanCell, type ScanParaKind, type ScanParagraph, type ScanTable, type SealOp, type SealPlacement, type SectionScan, type SpliceEdit, type TRange, type TableProfile, VERSION, type ValidateIssue, type ValidateResult, ValueCursor, type WarningCode, type WatchOptions, type WrapMode, type WrapResult, applySplices, blocksToChunks, blocksToMarkdown, blocksToPdf, buildParagraphSplices, buildRangeSplices, charWidthEm1000, compare, detectFormat, detectOle2Format, detectZipFormat, diffBlocks, extractFormFields, extractFormSchema, fillForm, fillFormFields, fillHwpx, fillWithUniqueGuard, fitRatioForFewerLines, formatFillValue, gongmunLintWarnings, hwpxToProfile, incompatibleGongmunWarnings, inferFieldType, isHwpxFile, isKnownFont, isLabelCell, isOldHwpFile, isPdfFile, isZipFile, lintGongmunText, markdownToHwpx, markdownToPdf, measureTextWidth, normalizeGongmunPreset, openHwpxDocument, parse, parseDocx, parseHwp, parseHwp3, parseHwpml, parseHwpx, parsePdf, parseXls, parseXlsx, patchHwp, patchHwpx, patchHwpxBlocks, placeSealHwpx, redactMarkdown, redactText, renderHtml, renderHwpxToSvg, scanSectionXml, simulateWrap, simulateWrapKeepWord, unknownFontWarnings, validateHwpx };
1672
+ export { type BlockCapability, type BlockCapabilityInfo, type BlockDiff, type BlockEdit, type BlockSourceRef, type BorderDef, type BorderFillDef, type BoundingBox, type CellCapability, type CellContext, type CellDiff, type CellProfile, type CharPrDef, type ChunkOptions, DEFAULT_REDACT_RULES, type DiffChangeType, type DiffResult, type DocChunk, type DocumentMetadata, type DocumentQualitySummary, type ErrorCode, type ExtractedImage, type FileType, type FillFormOutput, type FillInput, type FillOutputFormat, type FillResult, type FillValue, type FormField, type FormFieldSchema, type FormFieldType, type FormResult, type FormSchemaResult, type FormatProfile, type GongmunFont, type GongmunLintFinding, type GongmunNumbering, type GongmunOptions, type GongmunPreset, type GongmunPresetInput, type HwpxFillResult, HwpxSession, type HwpxTheme, type IRBlock, type IRBlockType, type IRCell, type IRTable, type ImageData, type InlineStyle, type MarkdownToHwpxOptions, type MeasureOptions, type OcrProvider, type OutlineItem, PRESET_ALIAS, type PageMargin, type PageQuality, type ParseFailure, type ParseOptions, type ParseResult, type ParseSuccess, type ParseWarning, type PatchOptions, type PatchResult, type PatchSkip, type PlaceSealResult, type PrintOptions, type PrintPreset, type RedactHit, type RedactOptions, type RedactRule, type RedactTextResult, type RenderSvgOptions, type RenderSvgResult, SPACE_EM_FIXED, SPACE_EM_FONT, type ScanCell, type ScanParaKind, type ScanParagraph, type ScanTable, type SealOp, type SealPlacement, type SectionScan, type SpliceEdit, type TRange, type TableProfile, VERSION, type ValidateIssue, type ValidateResult, ValueCursor, type WarningCode, type WatchOptions, type WrapMode, type WrapResult, applySplices, blocksToChunks, blocksToMarkdown, blocksToPdf, buildParagraphSplices, buildRangeSplices, charWidthEm1000, compare, detectFormat, detectOle2Format, detectZipFormat, diffBlocks, extractFormFields, extractFormSchema, fillForm, fillFormFields, fillHwpx, fillWithUniqueGuard, fitRatioForFewerLines, formatFillValue, gongmunLintWarnings, hwpxToProfile, incompatibleGongmunWarnings, inferFieldType, isHwpxFile, isKnownFont, isLabelCell, isOldHwpFile, isPdfFile, isZipFile, lintGongmunText, markdownToHwpx, markdownToPdf, measureTextWidth, normalizeGongmunPreset, openHwpxDocument, parse, parseDocx, parseHwp, parseHwp3, parseHwpml, parseHwpx, parseImage, parsePdf, parseXls, parseXlsx, patchHwp, patchHwpx, patchHwpxBlocks, placeSealHwpx, redactMarkdown, redactText, renderHtml, renderHwpxToSvg, scanSectionXml, simulateWrap, simulateWrapKeepWord, unknownFontWarnings, validateHwpx };
package/dist/index.js CHANGED
@@ -8,7 +8,7 @@ import {
8
8
  flattenLayoutTables,
9
9
  inlineImagesIntoMarkdown,
10
10
  mapPuaText
11
- } from "./chunk-WF2E5P2G.js";
11
+ } from "./chunk-IXHBRMDB.js";
12
12
  import {
13
13
  parsePageRange
14
14
  } from "./chunk-GE43BE46.js";
@@ -27,7 +27,7 @@ import {
27
27
  sanitizeHref,
28
28
  stripDtd,
29
29
  toArrayBuffer
30
- } from "./chunk-JP5YH3Z4.js";
30
+ } from "./chunk-GUYIXVV7.js";
31
31
 
32
32
  // src/index.ts
33
33
  import { readFile } from "fs/promises";
@@ -247,6 +247,14 @@ function isPdfFile(buffer) {
247
247
  const b = magicBytes(buffer);
248
248
  return b[0] === 37 && b[1] === 80 && b[2] === 68 && b[3] === 70;
249
249
  }
250
+ function isImageFile(buffer) {
251
+ if (buffer.byteLength < 12) return false;
252
+ const b = new Uint8Array(buffer, 0, 12);
253
+ if (b[0] === 137 && b[1] === 80 && b[2] === 78 && b[3] === 71) return true;
254
+ if (b[0] === 255 && b[1] === 216 && b[2] === 255) return true;
255
+ if (b[0] === 82 && b[1] === 73 && b[2] === 70 && b[3] === 70 && b[8] === 87 && b[9] === 69 && b[10] === 66 && b[11] === 80) return true;
256
+ return false;
257
+ }
250
258
  function isHwpmlFile(buffer) {
251
259
  const bytes = new Uint8Array(buffer, 0, Math.min(512, buffer.byteLength));
252
260
  const head = new TextDecoder("utf-8", { fatal: false }).decode(bytes).replace(/^\uFEFF/, "");
@@ -259,6 +267,7 @@ function detectFormat(buffer) {
259
267
  if (isOldHwpFile(buffer)) return "hwp";
260
268
  if (isPdfFile(buffer)) return "pdf";
261
269
  if (isHwpmlFile(buffer)) return "hwpml";
270
+ if (isImageFile(buffer)) return "image";
262
271
  return "unknown";
263
272
  }
264
273
  function detectOle2Format(buffer) {
@@ -399,7 +408,7 @@ function comResultToParseResult(pages, pageCount, warnings) {
399
408
 
400
409
  // src/hwpx/parser-shared.ts
401
410
  import { DOMParser } from "@xmldom/xmldom";
402
- var MAX_DECOMPRESS_SIZE = 100 * 1024 * 1024;
411
+ var MAX_DECOMPRESS_SIZE = 256 * 1024 * 1024;
403
412
  var MAX_ZIP_ENTRIES = 500;
404
413
  var ZipBombError = class extends KordocError {
405
414
  constructor(message) {
@@ -456,6 +465,26 @@ function extractTextFromNode(node, depth = 0) {
456
465
  }
457
466
 
458
467
  // src/hwpx/styles.ts
468
+ function isRealStrikeShape(shape) {
469
+ switch (shape) {
470
+ case "SOLID":
471
+ case "DASH":
472
+ case "DOT":
473
+ case "DASH_DOT":
474
+ case "DASH_DOT_DOT":
475
+ case "LONG_DASH":
476
+ case "CIRCLE":
477
+ case "DOUBLE_SLIM":
478
+ case "SLIM_THICK":
479
+ case "THICK_SLIM":
480
+ case "SLIM_THICK_SLIM":
481
+ case "WAVE":
482
+ case "DOUBLE_WAVE":
483
+ return true;
484
+ default:
485
+ return false;
486
+ }
487
+ }
459
488
  async function extractHwpxStyles(zip, decompressed) {
460
489
  const result = {
461
490
  charProperties: /* @__PURE__ */ new Map(),
@@ -520,6 +549,10 @@ function parseCharProperties(doc, map) {
520
549
  const localTag = (k.tagName || "").replace(/^[^:]+:/, "");
521
550
  if (localTag === "bold") prop.bold = true;
522
551
  else if (localTag === "italic") prop.italic = true;
552
+ else if (localTag === "strikeout") {
553
+ const shape = k.getAttribute("shape") || "";
554
+ if (isRealStrikeShape(shape)) prop.strike = true;
555
+ }
523
556
  }
524
557
  const fontFaces = el.getElementsByTagName("*");
525
558
  for (let j = 0; j < fontFaces.length; j++) {
@@ -2734,21 +2767,22 @@ function extractRunSpans(para2, ctx, mode, requireMixed) {
2734
2767
  else {
2735
2768
  if (cp?.bold) span.bold = true;
2736
2769
  if (cp?.italic) span.italic = true;
2770
+ if (cp?.strike) span.strike = true;
2737
2771
  }
2738
- if (span.bold || span.italic || span.code) styled = true;
2772
+ if (span.bold || span.italic || span.strike || span.code) styled = true;
2739
2773
  spans.push(span);
2740
2774
  }
2741
2775
  if (!styled || spans.length === 0) return null;
2742
2776
  const merged = [];
2743
2777
  for (const s of spans) {
2744
2778
  const last = merged[merged.length - 1];
2745
- if (last && !!last.bold === !!s.bold && !!last.italic === !!s.italic && !!last.code === !!s.code) {
2779
+ if (last && !!last.bold === !!s.bold && !!last.italic === !!s.italic && !!last.strike === !!s.strike && !!last.code === !!s.code) {
2746
2780
  last.text += s.text;
2747
2781
  } else {
2748
2782
  merged.push(s);
2749
2783
  }
2750
2784
  }
2751
- if (requireMixed && !merged.some((s) => !(s.bold || s.italic || s.code))) return null;
2785
+ if (requireMixed && !merged.some((s) => s.strike) && !merged.some((s) => !(s.bold || s.italic || s.code))) return null;
2752
2786
  return merged;
2753
2787
  }
2754
2788
  function gongmunDepthFromIndent(para2, left, ctx) {
@@ -5140,7 +5174,10 @@ function parseParagraph(records, start, end, ctx) {
5140
5174
  if (headingLevel > 0) block.level = headingLevel;
5141
5175
  if (ctx.docInfo && charShapeIds.length > 0) {
5142
5176
  const style = resolveCharStyle(charShapeIds, ctx.docInfo);
5143
- if (style) block.style = style;
5177
+ if (style) {
5178
+ block.style = style;
5179
+ if (style.strike) block.text = headMarker ? `${headMarker} ~~${trimmed}~~` : `~~${trimmed}~~`;
5180
+ }
5144
5181
  }
5145
5182
  if (footnotes.length > 0) block.footnoteText = footnotes.join("; ");
5146
5183
  blocks.push(block);
@@ -5531,7 +5568,13 @@ function resolveCharStyle(charShapeIds, docInfo) {
5531
5568
  if (cs.fontSize > 0) style.fontSize = cs.fontSize / 10;
5532
5569
  if (cs.attrFlags & 1) style.italic = true;
5533
5570
  if (cs.attrFlags & 2) style.bold = true;
5534
- return style.fontSize || style.bold || style.italic ? style : void 0;
5571
+ if (hasRealStrike(cs.attrFlags)) style.strike = true;
5572
+ return style.fontSize || style.bold || style.italic || style.strike ? style : void 0;
5573
+ }
5574
+ function hasRealStrike(attrFlags) {
5575
+ const strikeBits = attrFlags >> 18 & 7;
5576
+ const shapeId = attrFlags >> 26 & 15;
5577
+ return strikeBits !== 0 && shapeId <= 12;
5535
5578
  }
5536
5579
 
5537
5580
  // src/hwp3/parser.ts
@@ -30446,10 +30489,28 @@ async function parse(input, options) {
30446
30489
  return parseHwpml(buffer, opts);
30447
30490
  case "pdf":
30448
30491
  return parsePdf(buffer, opts);
30492
+ case "image":
30493
+ return parseImage(buffer, opts);
30449
30494
  default:
30450
30495
  return { success: false, fileType: "unknown", error: "\uC9C0\uC6D0\uD558\uC9C0 \uC54A\uB294 \uD30C\uC77C \uD615\uC2DD\uC785\uB2C8\uB2E4.", code: "UNSUPPORTED_FORMAT" };
30451
30496
  }
30452
30497
  }
30498
+ async function parseImage(buffer, options) {
30499
+ try {
30500
+ const { parseImageDocument } = await import("./image-ocr-TGHAMIQL.js");
30501
+ const { blocks, warnings } = await parseImageDocument(buffer, options);
30502
+ return {
30503
+ success: true,
30504
+ fileType: "image",
30505
+ markdown: blocksToMarkdown(blocks),
30506
+ blocks,
30507
+ warnings: warnings.length ? warnings : void 0,
30508
+ pageCount: 1
30509
+ };
30510
+ } catch (err) {
30511
+ return { success: false, fileType: "image", error: sanitizeError(err), code: classifyError(err) };
30512
+ }
30513
+ }
30453
30514
  async function parseHwp3(buffer, options) {
30454
30515
  try {
30455
30516
  const { markdown, blocks, metadata, outline, warnings } = parseHwp3Document(buffer, options);
@@ -30494,7 +30555,7 @@ async function parseHwp(buffer, options) {
30494
30555
  async function parsePdf(buffer, options) {
30495
30556
  let parsePdfDocument;
30496
30557
  try {
30497
- const mod = await import("./parser-ND2YGQZR.js");
30558
+ const mod = await import("./parser-KMC4YOZH.js");
30498
30559
  parsePdfDocument = mod.parsePdfDocument;
30499
30560
  } catch {
30500
30561
  return {
@@ -30633,6 +30694,7 @@ export {
30633
30694
  parseHwp3,
30634
30695
  parseHwpml,
30635
30696
  parseHwpx,
30697
+ parseImage,
30636
30698
  parsePdf,
30637
30699
  parseXls,
30638
30700
  parseXlsx,