kordoc 3.0.0 → 3.0.1

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 (30) hide show
  1. package/README.md +10 -1
  2. package/dist/{-K5SLEFZD.js → -5BWAV4ZY.js} +5 -3
  3. package/dist/{chunk-3WRJQQIO.cjs → chunk-NBJB6TJB.cjs} +2 -2
  4. package/dist/{chunk-3WRJQQIO.cjs.map → chunk-NBJB6TJB.cjs.map} +1 -1
  5. package/dist/{chunk-SA2PERJ5.js → chunk-O5P6EG5L.js} +2 -2
  6. package/dist/{chunk-NHXKJWR7.js → chunk-X3SCCO5Q.js} +2 -2
  7. package/dist/{chunk-326STEDU.js → chunk-X7VQVMXQ.js} +845 -12
  8. package/dist/chunk-X7VQVMXQ.js.map +1 -0
  9. package/dist/cli.js +9 -7
  10. package/dist/cli.js.map +1 -1
  11. package/dist/index.cjs +964 -131
  12. package/dist/index.cjs.map +1 -1
  13. package/dist/index.d.cts +27 -1
  14. package/dist/index.d.ts +27 -1
  15. package/dist/index.js +844 -11
  16. package/dist/index.js.map +1 -1
  17. package/dist/mcp.js +3 -3
  18. package/dist/{parser-AU2NLC44.js → parser-3N6FZSKU.js} +2 -2
  19. package/dist/{parser-5KHU732L.cjs → parser-5FZJVLQL.cjs} +14 -14
  20. package/dist/{parser-5KHU732L.cjs.map → parser-5FZJVLQL.cjs.map} +1 -1
  21. package/dist/{parser-4IVYHKSL.js → parser-LZH7ZELV.js} +2 -2
  22. package/dist/{watch-5DDN4BUI.js → watch-4FMRS7QU.js} +3 -3
  23. package/package.json +1 -1
  24. package/dist/chunk-326STEDU.js.map +0 -1
  25. /package/dist/{-K5SLEFZD.js.map → -5BWAV4ZY.js.map} +0 -0
  26. /package/dist/{chunk-SA2PERJ5.js.map → chunk-O5P6EG5L.js.map} +0 -0
  27. /package/dist/{chunk-NHXKJWR7.js.map → chunk-X3SCCO5Q.js.map} +0 -0
  28. /package/dist/{parser-AU2NLC44.js.map → parser-3N6FZSKU.js.map} +0 -0
  29. /package/dist/{parser-4IVYHKSL.js.map → parser-LZH7ZELV.js.map} +0 -0
  30. /package/dist/{watch-5DDN4BUI.js.map → watch-4FMRS7QU.js.map} +0 -0
package/dist/index.d.cts CHANGED
@@ -433,6 +433,32 @@ declare function markdownToHwpx(markdown: string, options?: MarkdownToHwpxOption
433
433
  */
434
434
  declare function patchHwpx(original: Uint8Array, editedMarkdown: string, options?: PatchOptions): Promise<PatchResult>;
435
435
 
436
+ /**
437
+ * HWP 5.x 바이너리 서식 보존 무손실 라운드트립 패치 — patchHwpx의 HWP5 대응.
438
+ *
439
+ * parse()로 얻은 마크다운을 편집한 뒤 patchHwp()에 넘기면, 원본 HWP의
440
+ * CFB/레코드 구조를 그대로 두고 변경된 문단/표 셀의 PARA_TEXT만 치환한다.
441
+ * 연쇄 갱신: PARA_HEADER nChars, CHAR_SHAPE 위치, LINE_SEG 재구성, 레코드
442
+ * 크기 재계산 → 섹션 스트림 재직렬화 → deflate 재압축 → CFB 재조립.
443
+ *
444
+ * 안전 게이트 (하나라도 깨지면 해당 수정은 graceful skip — 파일 무결성 우선):
445
+ * - 섹션 레코드 재직렬화가 원본과 바이트 동일해야 패치 허용
446
+ * - ctrlMask=0(순수 텍스트) + PARA_TEXT 1개 + 레코드 텍스트 재구성 일치 문단만 수정
447
+ * - 배포용/암호화/DRM 문서는 전체 거부
448
+ *
449
+ * 지원: 본문 문단/헤딩 텍스트 수정, GFM 표 셀 텍스트 수정 (좌표 기반).
450
+ * 미지원(graceful skip): 블록 추가/삭제, 표 구조 변경, HTML 표 셀, 캡션·각주·
451
+ * 머리말/꼬리말, 컨트롤(탭/개체/필드) 포함 문단. skipped[]에 사유 보고.
452
+ */
453
+
454
+ /**
455
+ * 원본 HWP 5.x와 편집된 마크다운으로 서식 보존 패치본을 만든다.
456
+ *
457
+ * @param original 원본 HWP 바이트 (OLE2/CFB)
458
+ * @param editedMarkdown parse(original).markdown을 편집한 마크다운
459
+ */
460
+ declare function patchHwp(original: Uint8Array, editedMarkdown: string, options?: PatchOptions): Promise<PatchResult>;
461
+
436
462
  /**
437
463
  * Print Renderer — Markdown / IRBlock[] → PDF (puppeteer-core 기반).
438
464
  *
@@ -578,4 +604,4 @@ interface FillFormOutput {
578
604
  */
579
605
  declare function fillForm(input: string | ArrayBuffer | Buffer, values: Record<string, string>, outputFormat?: FillOutputFormat): Promise<FillFormOutput>;
580
606
 
581
- export { type BlockDiff, type BoundingBox, type CellContext, type CellDiff, type DiffChangeType, type DiffResult, type DocumentMetadata, type DocumentQualitySummary, type ErrorCode, type ExtractedImage, type FileType, type FillFormOutput, type FillOutputFormat, type FillResult, type FormField, type FormResult, type HwpxFillResult, type HwpxTheme, type IRBlock, type IRBlockType, type IRCell, type IRTable, type ImageData, type InlineStyle, type MarkdownToHwpxOptions, type OcrProvider, type OutlineItem, type PageMargin, type PageQuality, type ParseFailure, type ParseOptions, type ParseResult, type ParseSuccess, type ParseWarning, type PatchOptions, type PatchResult, type PatchSkip, type PrintOptions, type PrintPreset, VERSION, type WarningCode, type WatchOptions, blocksToMarkdown, blocksToPdf, compare, detectFormat, detectOle2Format, detectZipFormat, diffBlocks, extractFormFields, fillForm, fillFormFields, fillHwpx, isHwpxFile, isLabelCell, isOldHwpFile, isPdfFile, isZipFile, markdownToHwpx, markdownToPdf, parse, parseDocx, parseHwp, parseHwp3, parseHwpml, parseHwpx, parsePdf, parseXls, parseXlsx, patchHwpx, renderHtml };
607
+ export { type BlockDiff, type BoundingBox, type CellContext, type CellDiff, type DiffChangeType, type DiffResult, type DocumentMetadata, type DocumentQualitySummary, type ErrorCode, type ExtractedImage, type FileType, type FillFormOutput, type FillOutputFormat, type FillResult, type FormField, type FormResult, type HwpxFillResult, type HwpxTheme, type IRBlock, type IRBlockType, type IRCell, type IRTable, type ImageData, type InlineStyle, type MarkdownToHwpxOptions, type OcrProvider, type OutlineItem, type PageMargin, type PageQuality, type ParseFailure, type ParseOptions, type ParseResult, type ParseSuccess, type ParseWarning, type PatchOptions, type PatchResult, type PatchSkip, type PrintOptions, type PrintPreset, VERSION, type WarningCode, type WatchOptions, blocksToMarkdown, blocksToPdf, compare, detectFormat, detectOle2Format, detectZipFormat, diffBlocks, extractFormFields, fillForm, fillFormFields, fillHwpx, isHwpxFile, isLabelCell, isOldHwpFile, isPdfFile, isZipFile, markdownToHwpx, markdownToPdf, parse, parseDocx, parseHwp, parseHwp3, parseHwpml, parseHwpx, parsePdf, parseXls, parseXlsx, patchHwp, patchHwpx, renderHtml };
package/dist/index.d.ts CHANGED
@@ -433,6 +433,32 @@ declare function markdownToHwpx(markdown: string, options?: MarkdownToHwpxOption
433
433
  */
434
434
  declare function patchHwpx(original: Uint8Array, editedMarkdown: string, options?: PatchOptions): Promise<PatchResult>;
435
435
 
436
+ /**
437
+ * HWP 5.x 바이너리 서식 보존 무손실 라운드트립 패치 — patchHwpx의 HWP5 대응.
438
+ *
439
+ * parse()로 얻은 마크다운을 편집한 뒤 patchHwp()에 넘기면, 원본 HWP의
440
+ * CFB/레코드 구조를 그대로 두고 변경된 문단/표 셀의 PARA_TEXT만 치환한다.
441
+ * 연쇄 갱신: PARA_HEADER nChars, CHAR_SHAPE 위치, LINE_SEG 재구성, 레코드
442
+ * 크기 재계산 → 섹션 스트림 재직렬화 → deflate 재압축 → CFB 재조립.
443
+ *
444
+ * 안전 게이트 (하나라도 깨지면 해당 수정은 graceful skip — 파일 무결성 우선):
445
+ * - 섹션 레코드 재직렬화가 원본과 바이트 동일해야 패치 허용
446
+ * - ctrlMask=0(순수 텍스트) + PARA_TEXT 1개 + 레코드 텍스트 재구성 일치 문단만 수정
447
+ * - 배포용/암호화/DRM 문서는 전체 거부
448
+ *
449
+ * 지원: 본문 문단/헤딩 텍스트 수정, GFM 표 셀 텍스트 수정 (좌표 기반).
450
+ * 미지원(graceful skip): 블록 추가/삭제, 표 구조 변경, HTML 표 셀, 캡션·각주·
451
+ * 머리말/꼬리말, 컨트롤(탭/개체/필드) 포함 문단. skipped[]에 사유 보고.
452
+ */
453
+
454
+ /**
455
+ * 원본 HWP 5.x와 편집된 마크다운으로 서식 보존 패치본을 만든다.
456
+ *
457
+ * @param original 원본 HWP 바이트 (OLE2/CFB)
458
+ * @param editedMarkdown parse(original).markdown을 편집한 마크다운
459
+ */
460
+ declare function patchHwp(original: Uint8Array, editedMarkdown: string, options?: PatchOptions): Promise<PatchResult>;
461
+
436
462
  /**
437
463
  * Print Renderer — Markdown / IRBlock[] → PDF (puppeteer-core 기반).
438
464
  *
@@ -578,4 +604,4 @@ interface FillFormOutput {
578
604
  */
579
605
  declare function fillForm(input: string | ArrayBuffer | Buffer, values: Record<string, string>, outputFormat?: FillOutputFormat): Promise<FillFormOutput>;
580
606
 
581
- export { type BlockDiff, type BoundingBox, type CellContext, type CellDiff, type DiffChangeType, type DiffResult, type DocumentMetadata, type DocumentQualitySummary, type ErrorCode, type ExtractedImage, type FileType, type FillFormOutput, type FillOutputFormat, type FillResult, type FormField, type FormResult, type HwpxFillResult, type HwpxTheme, type IRBlock, type IRBlockType, type IRCell, type IRTable, type ImageData, type InlineStyle, type MarkdownToHwpxOptions, type OcrProvider, type OutlineItem, type PageMargin, type PageQuality, type ParseFailure, type ParseOptions, type ParseResult, type ParseSuccess, type ParseWarning, type PatchOptions, type PatchResult, type PatchSkip, type PrintOptions, type PrintPreset, VERSION, type WarningCode, type WatchOptions, blocksToMarkdown, blocksToPdf, compare, detectFormat, detectOle2Format, detectZipFormat, diffBlocks, extractFormFields, fillForm, fillFormFields, fillHwpx, isHwpxFile, isLabelCell, isOldHwpFile, isPdfFile, isZipFile, markdownToHwpx, markdownToPdf, parse, parseDocx, parseHwp, parseHwp3, parseHwpml, parseHwpx, parsePdf, parseXls, parseXlsx, patchHwpx, renderHtml };
607
+ export { type BlockDiff, type BoundingBox, type CellContext, type CellDiff, type DiffChangeType, type DiffResult, type DocumentMetadata, type DocumentQualitySummary, type ErrorCode, type ExtractedImage, type FileType, type FillFormOutput, type FillOutputFormat, type FillResult, type FormField, type FormResult, type HwpxFillResult, type HwpxTheme, type IRBlock, type IRBlockType, type IRCell, type IRTable, type ImageData, type InlineStyle, type MarkdownToHwpxOptions, type OcrProvider, type OutlineItem, type PageMargin, type PageQuality, type ParseFailure, type ParseOptions, type ParseResult, type ParseSuccess, type ParseWarning, type PatchOptions, type PatchResult, type PatchSkip, type PrintOptions, type PrintPreset, VERSION, type WarningCode, type WatchOptions, blocksToMarkdown, blocksToPdf, compare, detectFormat, detectOle2Format, detectZipFormat, diffBlocks, extractFormFields, fillForm, fillFormFields, fillHwpx, isHwpxFile, isLabelCell, isOldHwpFile, isPdfFile, isZipFile, markdownToHwpx, markdownToPdf, parse, parseDocx, parseHwp, parseHwp3, parseHwpml, parseHwpx, parsePdf, parseXls, parseXlsx, patchHwp, patchHwpx, renderHtml };