@aeriz/wysiwyg 1.0.5 → 2.0.0

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 (129) hide show
  1. package/LICENSE +201 -201
  2. package/README.md +82 -573
  3. package/angular/README.md +10 -4
  4. package/angular/aeriz-editor.directive.ts +40 -18
  5. package/dist/adapters/jquery.cjs +1 -1
  6. package/dist/adapters/jquery.js +14 -14
  7. package/dist/adapters/shared.cjs +1 -1
  8. package/dist/adapters/shared.js +59 -56
  9. package/dist/adapters/vue.cjs +1 -1
  10. package/dist/adapters/vue.js +64 -56
  11. package/dist/adapters/vue2.cjs +1 -1
  12. package/dist/adapters/vue2.js +24 -17
  13. package/dist/adapters/wc.cjs +1 -1
  14. package/dist/adapters/wc.js +108 -72
  15. package/dist/aeriz-wysiwyg-adapter.js +24 -32
  16. package/dist/aeriz-wysiwyg-adapter.min.js +1 -1
  17. package/dist/aeriz-wysiwyg-highlight.js +964 -0
  18. package/dist/aeriz-wysiwyg-highlight.min.js +5 -0
  19. package/dist/aeriz-wysiwyg-jquery.js +25 -32
  20. package/dist/aeriz-wysiwyg-jquery.min.js +1 -1
  21. package/dist/aeriz-wysiwyg-wc.js +80 -43
  22. package/dist/aeriz-wysiwyg-wc.min.js +1 -1
  23. package/dist/aeriz-wysiwyg.cjs +3525 -1744
  24. package/dist/aeriz-wysiwyg.css +2104 -1904
  25. package/dist/aeriz-wysiwyg.esm.js +3525 -1744
  26. package/dist/aeriz-wysiwyg.esm.min.js +4840 -3581
  27. package/dist/aeriz-wysiwyg.js +3525 -1744
  28. package/dist/aeriz-wysiwyg.min.cjs +51 -46
  29. package/dist/aeriz-wysiwyg.min.css +1 -1
  30. package/dist/aeriz-wysiwyg.min.js +51 -46
  31. package/dist/highlight.cjs +5 -0
  32. package/dist/highlight.js +895 -0
  33. package/dist/server.cjs +24 -19
  34. package/dist/server.js +612 -251
  35. package/dist-types/adapters/shared.d.ts +0 -8
  36. package/dist-types/adapters/shared.d.ts.map +1 -1
  37. package/dist-types/adapters/vue.d.ts +62 -21
  38. package/dist-types/adapters/vue.d.ts.map +1 -1
  39. package/dist-types/adapters/vue2.d.ts +33 -14
  40. package/dist-types/adapters/vue2.d.ts.map +1 -1
  41. package/dist-types/adapters/wc.d.ts +15 -6
  42. package/dist-types/adapters/wc.d.ts.map +1 -1
  43. package/dist-types/cjs/adapters/shared.d.cts +0 -8
  44. package/dist-types/cjs/adapters/vue.d.cts +62 -21
  45. package/dist-types/cjs/adapters/vue2.d.cts +33 -14
  46. package/dist-types/cjs/adapters/wc.d.cts +15 -6
  47. package/dist-types/cjs/core/AerizEditor.d.cts +204 -48
  48. package/dist-types/cjs/core/AerizViewer.d.cts +7 -0
  49. package/dist-types/cjs/core/block-meta.d.cts +40 -0
  50. package/dist-types/cjs/core/block-tracker.d.cts +64 -0
  51. package/dist-types/cjs/core/blocks.d.cts +39 -4
  52. package/dist-types/cjs/core/fonts.d.cts +33 -46
  53. package/dist-types/cjs/core/history.d.cts +28 -10
  54. package/dist-types/cjs/core/html-to-blocks.d.cts +10 -0
  55. package/dist-types/cjs/core/i18n.d.cts +44 -0
  56. package/dist-types/cjs/core/import-html.d.cts +0 -13
  57. package/dist-types/cjs/core/insert-fragment.d.cts +21 -0
  58. package/dist-types/cjs/core/paste-clean.d.cts +36 -0
  59. package/dist-types/cjs/core/sanitize-dom.d.cts +21 -0
  60. package/dist-types/cjs/core/sanitize-html.d.cts +8 -0
  61. package/dist-types/cjs/core/sanitize-policy.d.cts +22 -0
  62. package/dist-types/cjs/core/selection.d.cts +5 -0
  63. package/dist-types/cjs/core/table-grid.d.cts +87 -0
  64. package/dist-types/cjs/core/table-ops.d.cts +2 -22
  65. package/dist-types/cjs/highlight/index.d.cts +5 -0
  66. package/dist-types/cjs/index.d.cts +19 -11
  67. package/dist-types/cjs/server/index.d.cts +4 -5
  68. package/dist-types/cjs/types/index.d.cts +63 -15
  69. package/dist-types/cjs/ui/Toolbar.d.cts +10 -0
  70. package/dist-types/cjs/ui/doc-tools.d.cts +58 -0
  71. package/dist-types/cjs/ui/popovers.d.cts +14 -25
  72. package/dist-types/core/AerizEditor.d.ts +204 -48
  73. package/dist-types/core/AerizEditor.d.ts.map +1 -1
  74. package/dist-types/core/AerizViewer.d.ts +7 -0
  75. package/dist-types/core/AerizViewer.d.ts.map +1 -1
  76. package/dist-types/core/block-meta.d.ts +40 -0
  77. package/dist-types/core/block-meta.d.ts.map +1 -1
  78. package/dist-types/core/block-policy.d.ts.map +1 -1
  79. package/dist-types/core/block-tracker.d.ts +64 -0
  80. package/dist-types/core/block-tracker.d.ts.map +1 -0
  81. package/dist-types/core/blocks.d.ts +39 -4
  82. package/dist-types/core/blocks.d.ts.map +1 -1
  83. package/dist-types/core/fonts.d.ts +33 -46
  84. package/dist-types/core/fonts.d.ts.map +1 -1
  85. package/dist-types/core/history.d.ts +28 -10
  86. package/dist-types/core/history.d.ts.map +1 -1
  87. package/dist-types/core/html-mini.d.ts.map +1 -1
  88. package/dist-types/core/html-to-blocks.d.ts +10 -0
  89. package/dist-types/core/html-to-blocks.d.ts.map +1 -0
  90. package/dist-types/core/i18n.d.ts +44 -0
  91. package/dist-types/core/i18n.d.ts.map +1 -1
  92. package/dist-types/core/import-html.d.ts +0 -13
  93. package/dist-types/core/import-html.d.ts.map +1 -1
  94. package/dist-types/core/import-markdown.d.ts.map +1 -1
  95. package/dist-types/core/insert-fragment.d.ts +21 -0
  96. package/dist-types/core/insert-fragment.d.ts.map +1 -0
  97. package/dist-types/core/markdown-export.d.ts.map +1 -1
  98. package/dist-types/core/paste-clean.d.ts +36 -0
  99. package/dist-types/core/paste-clean.d.ts.map +1 -0
  100. package/dist-types/core/render-string.d.ts.map +1 -1
  101. package/dist-types/core/sanitize-dom.d.ts +21 -0
  102. package/dist-types/core/sanitize-dom.d.ts.map +1 -0
  103. package/dist-types/core/sanitize-html.d.ts +8 -0
  104. package/dist-types/core/sanitize-html.d.ts.map +1 -0
  105. package/dist-types/core/sanitize-policy.d.ts +22 -0
  106. package/dist-types/core/sanitize-policy.d.ts.map +1 -0
  107. package/dist-types/core/selection.d.ts +5 -0
  108. package/dist-types/core/selection.d.ts.map +1 -1
  109. package/dist-types/core/snapshot.d.ts.map +1 -1
  110. package/dist-types/core/table-grid.d.ts +87 -0
  111. package/dist-types/core/table-grid.d.ts.map +1 -0
  112. package/dist-types/core/table-ops.d.ts +2 -22
  113. package/dist-types/core/table-ops.d.ts.map +1 -1
  114. package/dist-types/highlight/index.d.ts +5 -0
  115. package/dist-types/highlight/index.d.ts.map +1 -0
  116. package/dist-types/index.d.ts +19 -11
  117. package/dist-types/index.d.ts.map +1 -1
  118. package/dist-types/server/index.d.ts +4 -5
  119. package/dist-types/server/index.d.ts.map +1 -1
  120. package/dist-types/types/index.d.ts +63 -15
  121. package/dist-types/types/index.d.ts.map +1 -1
  122. package/dist-types/ui/Toolbar.d.ts +10 -0
  123. package/dist-types/ui/Toolbar.d.ts.map +1 -1
  124. package/dist-types/ui/doc-tools.d.ts +58 -0
  125. package/dist-types/ui/doc-tools.d.ts.map +1 -0
  126. package/dist-types/ui/icons.d.ts.map +1 -1
  127. package/dist-types/ui/popovers.d.ts +14 -25
  128. package/dist-types/ui/popovers.d.ts.map +1 -1
  129. package/package.json +70 -5
@@ -1,60 +1,47 @@
1
1
  /**
2
- * 글꼴 라이브러리 — 한국어 본문에 친화적인 무료 / 상용 가능 글꼴만 큐레이션.
3
- * 모두 SIL Open Font License 또는 자체 무제한 상용 라이선스.
2
+ * 글꼴 · 글자 크기 목록.
4
3
  *
5
- * 로딩 정책:
6
- * - 모든 글꼴은 글꼴 드롭다운이 처음 열릴 때 1회 일괄 lazy 로드.
7
- * - Google Fonts CSS2 endpoint 한 번 + 외부 CDN(Pretendard) 별도 1 회.
8
- * - 실패해도 stack 의 fallback 글꼴이 자동 적용되므로 graceful degradation.
4
+ * ## 기본 목록은 "이미 깔려 있는 글꼴" 이다
5
+ *
6
+ * 1.x 는 글꼴 드롭다운을 열 때 Google Fonts 와 jsDelivr 에서 웹폰트를 받았다.
7
+ * 그 때문에 (1) 망이 막힌 공공 · 금융 환경에서는 목록이 비고, (2) 열 때마다
8
+ * 외부로 요청이 나가 개인정보 · 보안 심사에서 걸리고, (3) 받은 글꼴로 쓴 문서가
9
+ * 다른 PC 에서는 다른 글꼴로 보였다.
10
+ *
11
+ * 2.0 의 기본값은 한국 문서에서 실제로 쓰는 시스템 글꼴(맑은 고딕 · 굴림 · 돋움 ·
12
+ * 바탕 · 궁서 …) 이고, 네트워크를 쓰지 않는다. 웹폰트가 필요하면 `fonts`
13
+ * 옵션에 `cssUrl` 과 함께 넘긴다 — 그 글꼴만, 드롭다운을 처음 열 때 받는다.
14
+ *
15
+ * 이 PC 에 없는 글꼴(맥의 굴림 등) 은 목록에서 뺀다. 골라도 적용되지 않는
16
+ * 항목은 없느니만 못하다.
9
17
  */
10
18
  export interface FontFamily {
11
- /** 안정 식별자 — 직렬화 / 다음 선택 비교에 사용. */
12
- id: string;
13
- /** 드롭다운에 표시되는 한국어 라벨. */
19
+ /** 드롭다운에 보이는 이름. */
14
20
  label: string;
15
- /** CSS font-family 스택 — execCommand fontName 의 인자로 들어간다. */
21
+ /** CSS font-family 값. 첫 글꼴이 "그 글꼴" 이고 나머지는 대체 글꼴이다. */
16
22
  stack: string;
17
- /** Google Fonts CSS2 family 파라미터 (예: "Noto+Sans+KR:wght@400;700"). */
18
- googleFonts?: string;
19
- /** 외부 CDN 의 전체 CSS URL (Google Fonts 가 아닌 글꼴용). */
23
+ /** 웹폰트 스타일시트 주소. 있으면 드롭다운을 처음 열 때 한 번 받는다. */
20
24
  cssUrl?: string;
21
25
  }
22
- /** "시스템 기본" 항목의 id. clearFormat / 초기화 분기에 사용. */
23
- export declare const SYSTEM_FONT_ID = "system";
24
- export declare const FONT_FAMILIES: ReadonlyArray<FontFamily>;
25
- /** id → FontFamily lookup. */
26
- export declare const FONT_FAMILY_BY_ID: Readonly<Record<string, FontFamily>>;
27
- /**
28
- * 글자 크기 프리셋 (px). 본문 기본은 16px.
29
- * 12 ~ 48px 범위에서 자주 쓰이는 단계만 큐레이션.
30
- */
31
- export declare const FONT_SIZES: ReadonlyArray<number>;
32
- /**
33
- * Computed CSS font-size 문자열(예: "16px", "1.125rem")을 px 정수로 변환.
34
- * 매칭 실패 시 null. 활성 toolbar 크기 표시에 사용.
35
- */
36
- export declare function pxFromCss(css: string | null | undefined): number | null;
26
+ /** 목록 맨 위 "기본 글꼴" — 서식을 지워 본문 글꼴로 돌아간다. stack 이 빈 문자열이다. */
27
+ export declare const DEFAULT_FONT: FontFamily;
28
+ export declare const DEFAULT_FONTS: ReadonlyArray<FontFamily>;
37
29
  /**
38
- * 현재 실제로 쓸 수 있는 글꼴만 반환한다. 드롭다운은 이 목록으로 그린다.
39
- *
40
- * `FONT_FAMILIES` 전체는 그대로 남겨 둔다 — 이미 그 글꼴로 저장된 본문의
41
- * 라벨을 표시하려면(`findFontIdFromCss`) 실패한 항목도 알고 있어야 한다.
30
+ * 글자 크기(pt). 한글 · 워드와 같은 단위다 — 붙여넣은 문서의 10pt 가 목록의
31
+ * 10 과 그대로 맞는다. 에디터 본문 기본 크기 16px 는 12pt 다.
42
32
  */
43
- export declare function getAvailableFontFamilies(): ReadonlyArray<FontFamily>;
44
- /** 사용 가능 목록이 바뀌면 호출된다. 반환값을 부르면 구독이 해제된다. */
33
+ export declare const DEFAULT_FONT_SIZES: ReadonlyArray<number>;
34
+ /** CSS 글자 크기(computed 값은 px) → pt, 0.5 단위로 반올림. */
35
+ export declare function ptFromCss(css: string | null | undefined): number | null;
36
+ /** `fonts` 중 지금 쓸 수 있는 것. 드롭다운은 이 목록으로 그린다. */
37
+ export declare function availableFonts(fonts: ReadonlyArray<FontFamily>): FontFamily[];
38
+ /** 쓸 수 있는 목록이 바뀌면 호출된다. 반환값을 부르면 구독이 해제된다. */
45
39
  export declare function subscribeFontAvailability(listener: () => void): () => void;
46
40
  /**
47
- * 모든 글꼴의 CSS 를 1 회만 lazy 로드한다. 글꼴 드롭다운이 열릴 때 호출.
48
- * 두 번째 이후 호출은 즉시 반환.
49
- *
50
- * 실패는 조용히 넘어가지 않는다 — 받지 못한 글꼴은 목록에서 빠진다.
51
- */
52
- export declare function ensureFontFamiliesLoaded(): void;
53
- /**
54
- * 임의의 CSS font-family 문자열에 대해 FONT_FAMILIES 중 가장 비슷한 항목을
55
- * 찾아 id 를 반환. 매칭 실패 시 null. 활성 toolbar 표시에 사용.
56
- *
57
- * 비교는 stack 의 첫 family 토큰을 추출해 case-insensitive 비교.
41
+ * 드롭다운을 열 때 부른다. 웹폰트(`cssUrl`) 는 그때 한 번 받고, 시스템 글꼴은
42
+ * 이 PC 에 있는지 확인한다. 같은 글꼴은 두 번 확인하지 않는다.
58
43
  */
59
- export declare function findFontIdFromCss(css: string | null | undefined): string | null;
44
+ export declare function prepareFonts(fonts: ReadonlyArray<FontFamily>): void;
45
+ /** CSS font-family 값이 목록의 어느 글꼴인지 (첫 글꼴 이름으로 비교). */
46
+ export declare function findFont(fonts: ReadonlyArray<FontFamily>, css: string | null | undefined): FontFamily | null;
60
47
  // (소스맵은 CJS 선언 사본에서 제외됨 — scripts/finalize-types.mjs)
@@ -11,13 +11,13 @@
11
11
  *
12
12
  * ## 무엇을 저장하는가
13
13
  *
14
- * 본문 HTML 전체와 캐럿 위치를 한 항목으로 저장하는 스냅샷 방식이다.
14
+ * 본문 블록별 HTML 과 캐럿 위치를 한 항목으로 저장하는 스냅샷 방식이다.
15
15
  * 조작 단위 이력(operation log) 이 메모리는 덜 쓰지만, 되돌리기가 **정확히**
16
16
  * 원래 화면으로 돌아간다는 보장을 얻기가 훨씬 어렵다. 스냅샷은 그 보장이
17
17
  * 공짜다 — 문자열을 도로 넣기만 하면 된다.
18
18
  *
19
- * 캐럿은 문자 오프셋으로 저장한다. HTML 을 통째로 갈아끼우면 노드 참조는
20
- * 전부 무효가 되지만, "본문 시작에서 몇 번째 글자" 는 그대로 살아남는다.
19
+ * 캐럿은 "몇 번째 블록의 몇 번째 글자" 로 저장한다. 블록을 갈아끼우면 노드
20
+ * 참조는 무효가 되지만 이 좌표는 그대로 살아남는다.
21
21
  *
22
22
  * ## 언제 한 항목으로 묶는가
23
23
  *
@@ -26,15 +26,33 @@
26
26
  * 유형 변경처럼 **구조가 바뀌는 조작**은 합치지 않는다 — 그건 사용자가 한
27
27
  * 번에 하나씩 되돌리길 기대하는 단위다.
28
28
  */
29
- /** 이력 한 항목 — 그 순간의 본문 전체와 캐럿. */
29
+ /**
30
+ * 문서 안 캐럿 위치. 블록 순번 + 그 블록 안의 글자 오프셋.
31
+ *
32
+ * 문서 맨 앞부터의 글자 수로 적으면 기록할 때마다 문서 전체 텍스트를 읽어야
33
+ * 한다 (190쪽 문서에서 키 하나에 수 ms). 블록 단위로 적으면 그 블록만 읽는다.
34
+ */
35
+ export interface DocSelection {
36
+ startBlock: number;
37
+ start: number;
38
+ endBlock: number;
39
+ end: number;
40
+ }
41
+ /**
42
+ * 이력 한 칸. 본문 직계 블록마다 HTML 문자열 하나.
43
+ *
44
+ * 블록 단위로 나눠 두는 이유 — 타이핑 한 번에 바뀌는 블록은 보통 하나라서,
45
+ * 나머지 블록의 문자열은 **이전 칸과 같은 문자열 객체를 그대로 공유한다.**
46
+ * 문서 전체를 한 문자열로 저장하면 190쪽 문서에서 이력 200칸이 수십 MB 가 된다.
47
+ */
30
48
  export interface HistoryEntry {
31
- html: string;
32
- /** 본문 시작 기준 캐럿 시작/끝 문자 오프셋. 셀렉션이 없으면 null. */
33
- selection: {
34
- start: number;
35
- end: number;
36
- } | null;
49
+ blocks: readonly string[];
50
+ /** 모든 블록 문자열 길이의 합. 대량 변경 판정에 쓴다. */
51
+ size: number;
52
+ selection: DocSelection | null;
37
53
  }
54
+ /** 두 칸의 내용이 같은지. 공유된 문자열은 참조 비교로 바로 끝난다. */
55
+ export declare function sameContent(a: HistoryEntry, b: HistoryEntry): boolean;
38
56
  /**
39
57
  * 이 시간 안에 이어지는 타이핑은 한 항목으로 합친다.
40
58
  * 사람이 문장 하나를 치는 동안의 간격보다 짧게, 생각하고 다시 치기 시작하는
@@ -0,0 +1,10 @@
1
+ import type { BlockSnapshot } from './blocks.cjs';
2
+ /**
3
+ * HTML 문자열을 `BlockSnapshot[]` 로 변환한다 (브라우저 전용).
4
+ *
5
+ * 에디터 본문과 같은 정화 · 정규화 경로를 타므로, 같은 HTML 을 에디터에 넣고
6
+ * `getSnapshots()` 한 결과와 블록 구성이 같다. 편집용 꼬리 단락은 붙이지
7
+ * 않는다 — 뷰어에 넘길 목록에 원본에 없던 빈 단락이 생기면 여백이 늘어난다.
8
+ */
9
+ export declare function htmlToBlocks(html: string): BlockSnapshot[];
10
+ // (소스맵은 CJS 선언 사본에서 제외됨 — scripts/finalize-types.mjs)
@@ -21,6 +21,8 @@ export interface Strings {
21
21
  italic: string;
22
22
  underline: string;
23
23
  strike: string;
24
+ superscript: string;
25
+ subscript: string;
24
26
  color: string;
25
27
  backgroundColor: string;
26
28
  align: string;
@@ -36,6 +38,13 @@ export interface Strings {
36
38
  table: string;
37
39
  hr: string;
38
40
  clearFormat: string;
41
+ lineHeight: string;
42
+ letterSpacing: string;
43
+ specialChar: string;
44
+ findReplace: string;
45
+ source: string;
46
+ print: string;
47
+ fullscreen: string;
39
48
  blockTypeChangeTooltip: string;
40
49
  blockMoveTooltip: string;
41
50
  addBelowTooltip: string;
@@ -49,6 +58,8 @@ export interface Strings {
49
58
  taskList: string;
50
59
  blockquote: string;
51
60
  codeBlock: string;
61
+ toggle: string;
62
+ callout: string;
52
63
  image: string;
53
64
  table: string;
54
65
  hr: string;
@@ -68,6 +79,8 @@ export interface Strings {
68
79
  orderedList: string;
69
80
  blockquote: string;
70
81
  codeBlock: string;
82
+ toggle: string;
83
+ callout: string;
71
84
  hr: string;
72
85
  link: string;
73
86
  image: string;
@@ -95,6 +108,37 @@ export interface Strings {
95
108
  colRight: string;
96
109
  deleteRow: string;
97
110
  deleteCol: string;
111
+ mergeCells: string;
112
+ splitCell: string;
113
+ };
114
+ docTools: {
115
+ /** 본문 편집 영역의 접근성 이름. `ariaLabel` 옵션이 없을 때 쓴다. */
116
+ editorLabel: string;
117
+ find: string;
118
+ replaceWith: string;
119
+ previous: string;
120
+ next: string;
121
+ replace: string;
122
+ replaceAll: string;
123
+ close: string;
124
+ /** `{current}` / `{total}`. */
125
+ matchCount: string;
126
+ noMatch: string;
127
+ /** `{count}` 건을 바꿨을 때. */
128
+ replaced: string;
129
+ matchCase: string;
130
+ sourceLabel: string;
131
+ letterSpacingNormal: string;
132
+ /** `{size}` — 올릴 수 있는 최대 크기. */
133
+ tooLarge: string;
134
+ specialGroups: {
135
+ symbols: string;
136
+ arrows: string;
137
+ numbers: string;
138
+ units: string;
139
+ brackets: string;
140
+ math: string;
141
+ };
98
142
  };
99
143
  fontFamily: {
100
144
  systemDefault: string;
@@ -1,16 +1,3 @@
1
- /**
2
- * 외부 HTML 문서를 가져와 모든 스타일을 인라인으로 베이크한다.
3
- *
4
- * 흐름:
5
- * 1. 숨김 iframe 을 만들고 srcdoc 으로 HTML 주입
6
- * 2. iframe load 이벤트(=body 의 마지막 동기 스크립트까지 실행 완료) +
7
- * 추가 RAF/idle 대기 → setTimeout(0) 류 비동기 스타일 적용까지 안정화
8
- * 3. body 트리 전체를 walk 하면서 각 element 의 computed style 중
9
- * "캐스케이드로 채워지지 않을" 속성만 인라인 style 속성으로 베이크
10
- * 4. iframe 제거 후 변환된 element 들의 outerHTML 배열 반환
11
- *
12
- * 다른 origin / iframe contentDocument 접근 제한이 발생하면 reject.
13
- */
14
1
  export declare function isBlockLevelTag(tagName: string): boolean;
15
2
  export interface ImportHtmlOptions {
16
3
  /** iframe load 후 추가 idle 대기(ms). Tailwind CDN 등 런타임 스타일 주입을
@@ -0,0 +1,21 @@
1
+ /**
2
+ * 붙여넣기 · 끌어 놓기로 들어온 조각을 캐럿 자리에 넣는다.
3
+ *
4
+ * `document.execCommand('insertHTML')` 을 쓰지 않는 이유 — 크롬은 넣는 순간
5
+ * 주변 글자의 계산된 스타일을 `<span style>` 으로 덧입혀, 깨끗하게 다듬은 조각을
6
+ * 다시 지저분하게 만든다. 표를 문단 안에 넣으면 문단을 이상하게 쪼개기도 한다.
7
+ * 이 에디터는 이력을 직접 관리하므로 브라우저 undo 스택이 필요 없다.
8
+ *
9
+ * 규칙은 워드프로세서와 같다.
10
+ * - 글자만 있는 조각은 캐럿 자리에 그대로 끼운다.
11
+ * - 문단 · 표 같은 블록이 있으면 지금 문단을 캐럿에서 둘로 나누고 그 사이에
12
+ * 넣는다. 첫 문단은 앞 조각에, 마지막 문단은 뒤 조각에 이어 붙인다.
13
+ * - 표 칸 · 목록 항목 · 코드 안처럼 블록을 둘 수 없는 자리에는 줄바꿈으로
14
+ * 이은 글로 넣는다.
15
+ */
16
+ /**
17
+ * `range` 자리에 조각을 넣고, 넣은 내용의 **끝** 을 가리키는 [노드, 오프셋]
18
+ * 을 돌려준다 (캐럿을 둘 곳). `root` 는 본문 element.
19
+ */
20
+ export declare function insertFragment(root: HTMLElement, range: Range, frag: DocumentFragment): [Node, number] | null;
21
+ // (소스맵은 CJS 선언 사본에서 제외됨 — scripts/finalize-types.mjs)
@@ -0,0 +1,36 @@
1
+ /**
2
+ * 붙여넣은 HTML 을 에디터 문서로 다듬는다 — 워드 · 한글 · 엑셀 · 웹.
3
+ *
4
+ * ## 왜 필요한가
5
+ *
6
+ * 오피스 프로그램이 클립보드에 올리는 HTML 은 문서가 아니라 "그 프로그램이
7
+ * 다시 읽을 수 있는 덤프" 다. 서식 대부분이 `<style>` 의 클래스 규칙
8
+ * (`.xl65`, `p.MsoNormal`, `P.HStyle0`) 에 들어 있고, 본문에는 `mso-*` 속성 ·
9
+ * `<o:p>` · 조건부 주석 · 목록 기호를 흉내 낸 글자가 섞여 있다. 그대로 넣으면
10
+ *
11
+ * - 엑셀 머리글의 배경 · 테두리 · 굵기가 사라지고(클래스에만 있으므로),
12
+ * - 워드 글머리 목록이 "§ 신규 고객" 같은 글자 문단이 되고,
13
+ * - 저장한 HTML 이 몇 배로 부풀어 서버 · 뷰어에서도 같은 쓰레기를 끌고 다닌다.
14
+ *
15
+ * ## 무엇을 하는가
16
+ *
17
+ * 1. `DOMParser` 로 **비활성 문서** 에 읽는다 — 스크립트가 돌지 않고 이미지도
18
+ * 내려받지 않는다. 보안 거름은 이 다음 단계(`parseSafeFragment`) 가 맡는다.
19
+ * 2. `<style>` 의 클래스 규칙에서 **눈에 보이는 서식만**(굵기 · 기울임 · 색 ·
20
+ * 배경 · 정렬 · 테두리) 골라 요소의 style 로 옮긴다. 글꼴 · 크기 · 줄 간격 같은
21
+ * "문서 기본값" 은 옮기지 않는다 — 붙여넣은 글이 주변 글과 다른 글꼴로 박히는
22
+ * 것이 사용자가 가장 싫어하는 결과다. 요소에 **직접** 쓴 글꼴 · 크기는 남긴다.
23
+ * 3. 워드의 `mso-list` 문단을 진짜 `<ul>/<ol>` 로 묶는다(수준별 중첩 포함).
24
+ * 4. `mso-*` · 클래스 · `lang` · `<o:p>` · 빈 `<span>` 을 걷어 낸다. 길이 단위 pt 는
25
+ * px 로 (글자 크기는 에디터 목록과 같은 pt 로 둔다).
26
+ * 5. 표 칸 안의 문단 하나짜리 `<p>` 는 풀어 칸에 글만 남긴다.
27
+ */
28
+ export type PasteSource = 'word' | 'excel' | 'hwp' | 'web';
29
+ /** 클립보드 HTML 이 어느 프로그램에서 왔는지. */
30
+ export declare function detectSource(html: string): PasteSource;
31
+ /**
32
+ * 붙여넣을 HTML 을 다듬어 돌려준다. 결과는 아직 **신뢰할 수 없는** HTML 이다
33
+ * — 호출하는 쪽이 반드시 sanitize 를 거쳐 문서에 넣는다.
34
+ */
35
+ export declare function cleanPastedHtml(html: string): string;
36
+ // (소스맵은 CJS 선언 사본에서 제외됨 — scripts/finalize-types.mjs)
@@ -0,0 +1,21 @@
1
+ /** 신뢰할 수 없는 HTML 을 정화한 DocumentFragment 로 만든다. `doc` 의 노드다. */
2
+ export declare function parseSafeFragment(html: string, doc?: Document): DocumentFragment;
3
+ /**
4
+ * `root` 아래를 제자리에서 정화한다. `root` 자신의 속성은 건드리지 않는다.
5
+ *
6
+ * 이미 문서에 붙어 있는 트리에도 쓸 수 있다 (붙여넣기 뒤 방어선 등). 다만
7
+ * 그때는 이미 로드가 시작됐을 수 있으므로 들어오는 길목에서는
8
+ * {@link parseSafeFragment} 를 쓴다.
9
+ */
10
+ export declare function sanitizeTree(root: ParentNode): void;
11
+ /**
12
+ * 이미 본문에 붙은 트리의 방어선 — **실행 경로만** 끊는다.
13
+ *
14
+ * 들어오는 길목은 {@link parseSafeFragment} 가 맡는다. 이 함수는 그 길목을
15
+ * 거치지 않고 브라우저가 직접 넣은 HTML(끌어다 놓기 등) 을 위해 타이핑마다
16
+ * 바뀐 블록에만 돈다. 그래서 가볍게 유지한다 — 모르는 태그를 벗기거나
17
+ * 속성 허용 목록을 적용하지 않는다(에디터의 편집 보조 버튼도 이 트리 안에
18
+ * 있다). 스크립트 · 임베드 · 이벤트 핸들러 · 위험한 URL 만 지운다.
19
+ */
20
+ export declare function guardLiveTree(root: Element): void;
21
+ // (소스맵은 CJS 선언 사본에서 제외됨 — scripts/finalize-types.mjs)
@@ -0,0 +1,8 @@
1
+ /**
2
+ * 신뢰할 수 없는 HTML 을 허용 목록으로 정화해 문자열로 돌려준다.
3
+ *
4
+ * 에디터의 `getHTML()` 출력은 이미 이 규칙을 만족하므로 그대로 통과한다
5
+ * (정화는 멱등이다 — 두 번 거쳐도 결과가 같다).
6
+ */
7
+ export declare function sanitizeHTML(html: string): string;
8
+ // (소스맵은 CJS 선언 사본에서 제외됨 — scripts/finalize-types.mjs)
@@ -0,0 +1,22 @@
1
+ export type TagAction = 'keep' | 'unwrap' | 'drop';
2
+ export declare function tagAction(tag: string): TagAction;
3
+ /**
4
+ * 속성 하나를 판정한다. 남길 값(필요하면 고친 값) 또는 버리라는 뜻의 `null`.
5
+ *
6
+ * `tag` · `name` 은 소문자로 넘긴다.
7
+ */
8
+ export declare function cleanAttr(tag: string, name: string, value: string): string | null;
9
+ export declare function safeId(value: string): string | null;
10
+ /**
11
+ * 인라인 `style` 값을 정화한다. 위험한 선언만 빼고 나머지는 그대로 둔다.
12
+ *
13
+ * `url(...)` 은 이미지 URL 로 안전한 것(http(s), data:image, 상대 경로) 만
14
+ * 남긴다. `url(javascript:…)` 는 오래된 브라우저에서 실행된다.
15
+ */
16
+ export declare function cleanStyle(css: string): string;
17
+ /**
18
+ * 새 창으로 여는 링크에 `rel="noopener noreferrer"` 를 보장한다.
19
+ * 열린 페이지가 `window.opener` 로 원래 페이지를 바꿔치기하는 것을 막는다.
20
+ */
21
+ export declare function relForTarget(target: string | null, rel: string | null): string | null;
22
+ // (소스맵은 CJS 선언 사본에서 제외됨 — scripts/finalize-types.mjs)
@@ -20,6 +20,11 @@ export declare function captureSelectionOffsets(root: HTMLElement): SelectionOff
20
20
  * 문서가 짧아져 오프셋이 넘치면 가장 가까운 위치(문서 끝) 에 둔다.
21
21
  */
22
22
  export declare function restoreSelectionOffsets(root: HTMLElement, saved: SelectionOffsets): void;
23
+ /** 문자 오프셋에 해당하는 (텍스트 노드, 노드 안 offset). */
24
+ export declare function pointAtTextOffset(root: HTMLElement, offset: number): {
25
+ node: Node;
26
+ offset: number;
27
+ };
23
28
  /**
24
29
  * 캐럿이 블록의 맨 끝에 있는지.
25
30
  *
@@ -0,0 +1,87 @@
1
+ /**
2
+ * 표 격자 모델 — 병합 셀(`rowspan` · `colspan`) 을 반영한 좌표.
3
+ *
4
+ * ## 왜 필요한가
5
+ *
6
+ * DOM 의 `<tr>` 안 셀 순번은 **열 번호가 아니다.** 위 행의 `rowspan` 이 내려와
7
+ * 자리를 차지하면 그 행의 첫 `<td>` 가 2열일 수 있고, `colspan="2"` 셀 다음
8
+ * 셀은 3열이다. 1.0 은 셀 순번을 열 번호로 써서, 엑셀 · 한글에서 가져온 병합
9
+ * 표에 열을 넣으면 머리글과 데이터가 어긋났다.
10
+ *
11
+ * 여기서는 표를 한 번 훑어 "몇 행 몇 열 칸을 어느 셀이 차지하는가" 를 담은
12
+ * 격자를 만들고, 행 · 열 삽입과 삭제 · 병합 · 분할을 모두 그 격자 위에서
13
+ * 계산한다. 모든 조작은 끝난 뒤에도 표가 **직사각형**(모든 행의 칸 수가 같음)
14
+ * 이도록 유지한다.
15
+ */
16
+ /** 격자 위 셀 하나. `row` · `col` 은 셀이 시작하는 칸(왼쪽 위) 이다. */
17
+ export interface GridCell {
18
+ el: HTMLTableCellElement;
19
+ row: number;
20
+ col: number;
21
+ rowSpan: number;
22
+ colSpan: number;
23
+ }
24
+ export interface TableGrid {
25
+ /** 표의 모든 행 (thead · tbody · tfoot 순서 그대로). */
26
+ rows: HTMLTableRowElement[];
27
+ /** `slots[r][c]` = 그 칸을 차지하는 셀. 빈 칸(모양이 깨진 표) 은 null. */
28
+ slots: (GridCell | null)[][];
29
+ /** 열 수. */
30
+ width: number;
31
+ /** 셀 element → 격자 정보. */
32
+ cells: Map<HTMLTableCellElement, GridCell>;
33
+ }
34
+ /** 직사각형 범위. 양 끝 포함. */
35
+ export interface GridRect {
36
+ top: number;
37
+ left: number;
38
+ bottom: number;
39
+ right: number;
40
+ }
41
+ /** 표를 훑어 격자를 만든다. */
42
+ export declare function buildGrid(table: HTMLTableElement): TableGrid;
43
+ /** 셀이 덮는 범위. */
44
+ export declare function rectOf(cell: GridCell): GridRect;
45
+ /**
46
+ * 두 셀을 모서리로 하는 직사각형. 걸치는 병합 셀이 있으면 그 셀이 통째로
47
+ * 들어오도록 범위를 넓힌다 — 병합 셀의 일부만 고르는 일은 없다.
48
+ */
49
+ export declare function expandRect(grid: TableGrid, rect: GridRect): GridRect;
50
+ /** 직사각형 안의 셀들 (문서 순서, 중복 없음). */
51
+ export declare function cellsInRect(grid: TableGrid, rect: GridRect): HTMLTableCellElement[];
52
+ /** 두 셀을 모서리로 한 선택 범위의 셀들 (병합 셀을 통째로 포함). */
53
+ export declare function cellsBetween(table: HTMLTableElement, a: HTMLTableCellElement, b: HTMLTableCellElement): HTMLTableCellElement[];
54
+ /** `cell` 이 있는 행의 위/아래에 행을 넣는다. 새 행의 첫 셀을 돌려준다. */
55
+ export declare function insertRow(table: HTMLTableElement, cell: HTMLTableCellElement, where: 'above' | 'below'): HTMLTableCellElement | null;
56
+ /** `cell` 이 덮는 행들을 지운다. 표에 행이 하나뿐이면 아무 것도 하지 않는다. */
57
+ export declare function deleteRow(table: HTMLTableElement, cell: HTMLTableCellElement): boolean;
58
+ /** `cell` 이 있는 열의 왼쪽/오른쪽에 열을 넣는다. */
59
+ export declare function insertColumn(table: HTMLTableElement, cell: HTMLTableCellElement, where: 'left' | 'right'): void;
60
+ /** `cell` 이 덮는 열들을 지운다. 열이 하나뿐이면 아무 것도 하지 않는다. */
61
+ export declare function deleteColumn(table: HTMLTableElement, cell: HTMLTableCellElement): boolean;
62
+ /** 고른 셀들을 하나로 합칠 수 있는지 (두 칸 이상을 덮어야 한다). */
63
+ export declare function canMerge(table: HTMLTableElement, cells: readonly HTMLTableCellElement[]): boolean;
64
+ /**
65
+ * 고른 셀들을 감싸는 직사각형을 셀 하나로 합친다. 합쳐진 셀(왼쪽 위) 을
66
+ * 돌려준다. 다른 셀의 내용은 줄을 바꿔 뒤에 이어 붙인다 — 한글 · 워드와 같다.
67
+ */
68
+ export declare function mergeCells(table: HTMLTableElement, cells: readonly HTMLTableCellElement[]): HTMLTableCellElement | null;
69
+ /** 병합 셀을 1×1 칸들로 나눈다. 나눌 것이 없으면 false. */
70
+ export declare function splitCell(table: HTMLTableElement, cell: HTMLTableCellElement): boolean;
71
+ /** 셀이 병합 셀인지. */
72
+ export declare function isMerged(cell: HTMLTableCellElement): boolean;
73
+ /** 격자 순서(행 우선) 로 다음 셀. 마지막 셀이면 null. */
74
+ export declare function gridNextCell(table: HTMLTableElement, cell: HTMLTableCellElement): HTMLTableCellElement | null;
75
+ /** 격자 순서로 이전 셀. 첫 셀이면 null. */
76
+ export declare function gridPreviousCell(table: HTMLTableElement, cell: HTMLTableCellElement): HTMLTableCellElement | null;
77
+ /**
78
+ * 행 · 열을 지운 뒤 캐럿을 둘 셀. 지워지는 범위 바로 아래(오른쪽) 셀, 없으면
79
+ * 바로 위(왼쪽) 셀. 지우기 **전에** 부른다.
80
+ */
81
+ export declare function neighborAfterDelete(table: HTMLTableElement, cell: HTMLTableCellElement, axis: 'row' | 'col'): HTMLTableCellElement | null;
82
+ /**
83
+ * 열 너비를 끌어 바꿀 때 너비를 줄 셀들 — `cell` 의 오른쪽 경계 열에 있는
84
+ * 1칸짜리 셀. 병합 셀의 너비는 그 열들의 합이라 브라우저가 맞춘다.
85
+ */
86
+ export declare function columnCells(table: HTMLTableElement, cell: HTMLTableCellElement): HTMLTableCellElement[];
87
+ // (소스맵은 CJS 선언 사본에서 제외됨 — scripts/finalize-types.mjs)
@@ -1,30 +1,10 @@
1
1
  /**
2
- * 표 셀의 기하와 이동.
2
+ * 표 셀 하나에 대한 판정 — 노드가 속한 셀, 포인터가 셀 가장자리에 있는지.
3
3
  *
4
- * 표 편집은 "지금 어느 셀인가" 를 계속 되묻는 일이다 — 캐럿이 놓인 셀, 드래그
5
- * 로 걸친 셀 범위, 마우스가 가장자리에 닿았는지, Tab 을 눌렀을 때 다음 셀.
6
- * 그 판정들만 여기 모은다. 에디터 인스턴스 상태를 보지 않는 순수 계산이라
7
- * 따로 두면 표 동작을 고칠 때 에디터 본체를 읽지 않아도 된다.
8
- *
9
- * **rowspan / colspan 은 고려하지 않는다.** 이 에디터는 둘 다 만들지 않으며,
10
- * 병합 셀을 지원하게 되면 여기 있는 인덱스 계산은 전부 다시 짜야 한다.
4
+ * 행 · 열 · 병합처럼 표 전체 모양을 따지는 계산은 `table-grid` 에 있다.
11
5
  */
12
6
  /** 임의의 노드에서 가장 가까운 td/th element. 없으면 null. */
13
7
  export declare function nearestCell(node: Node): HTMLTableCellElement | null;
14
- /**
15
- * 다음 표 셀. 행 끝이면 다음 행의 첫 셀, 표의 마지막 셀이면 **새 행을 만들어**
16
- * 그 첫 셀을 돌려준다 — Tab 만으로 표를 끝까지 채울 수 있도록.
17
- */
18
- export declare function nextTableCell(cell: HTMLTableCellElement, table: HTMLTableElement): HTMLTableCellElement | null;
19
- /** 이전 표 셀. 첫 셀이면 null. */
20
- export declare function previousTableCell(cell: HTMLTableCellElement): HTMLTableCellElement | null;
21
- /**
22
- * `startCell` 과 `endCell` 을 모서리로 하는 사각 영역의 모든 td/th.
23
- *
24
- * thead 와 tbody 가 섞여 있어도 `querySelectorAll('tr')` 의 document order 로
25
- * 단일 행 인덱스를 매긴다 — 사용자 눈에 보이는 순서와 같다.
26
- */
27
- export declare function cellsInRectangle(table: HTMLTableElement, startCell: HTMLTableCellElement, endCell: HTMLTableCellElement): HTMLTableCellElement[];
28
8
  /** 셀의 우/하 가장자리에 포인터가 있으면 'right' / 'bottom'. 아니면 null. */
29
9
  export declare function detectCellEdge(cell: HTMLTableCellElement, x: number, y: number): 'right' | 'bottom' | null;
30
10
  // (소스맵은 CJS 선언 사본에서 제외됨 — scripts/finalize-types.mjs)
@@ -0,0 +1,5 @@
1
+ import type { CodeHighlighter } from '../types/index.cjs';
2
+ export type { CodeHighlighter } from '../types/index.cjs';
3
+ /** 기본 제공 언어 16 종(Plain Text 포함) 의 색칠기. */
4
+ export declare const highlighter: CodeHighlighter;
5
+ // (소스맵은 CJS 선언 사본에서 제외됨 — scripts/finalize-types.mjs)
@@ -1,22 +1,30 @@
1
+ /**
2
+ * `@aeriz/wysiwyg` — 브라우저 진입점. 스타일시트를 부수 효과로 불러온다.
3
+ *
4
+ * 여기서 내보내는 것이 공개 API 의 전부다. 에디터 내부(블록 레지스트리 ·
5
+ * 정규화 · HTML 파서 · 로케일 사전) 는 내보내지 않는다 — 내보내면 고칠 때마다
6
+ * 호환이 깨진다. 서버(Node · workerd · Deno) 에서는 CSS 를 끌어오지 않는
7
+ * `@aeriz/wysiwyg/server` 를 쓴다.
8
+ */
1
9
  // (CSS 부수 효과 import 는 타입 선언에서 제거됨 — scripts/strip-css-imports.mjs)
2
10
  export { AerizEditor } from './core/AerizEditor.cjs';
3
- export type { EditorState, EditorStateListener, InlineState, } from './core/AerizEditor.cjs';
11
+ export type { EditorState, EditorStateListener, InlineState } from './core/AerizEditor.cjs';
4
12
  export { AerizViewer } from './core/AerizViewer.cjs';
5
13
  export type { ViewerOptions } from './core/AerizViewer.cjs';
6
- export { ALIGN_CLASS_BY_VALUE, ALL_INLINE_MARKS, BLOCK_ID_ATTR, BLOCK_TYPES, BLOCK_TYPE_BY_KIND, BlockIdRegistry, applyBlockClassNames, applyBlockInlineStyles, assignMissingIds, classifyBlockElement, extractInlineContent, fillInlineContent, findBlockFrom, getBlockLabel, isElementBlank, listBlocks, normalizeContent, placeCaretAtStart, readBlockStyleTheme, renderBlock, renderBlocks, serializeBlock, serializeBlocks, restoreAlignFromClasses, stripEditorOnlyAttrs, stripEditorOnlyNodes, } from './core/blocks.cjs';
7
- export type { BlockStyleTheme } from './core/blocks.cjs';
8
- export type { Block, BlockAttrs, BlockAttrsByKind, BlockIdResolver, BlockKind, BlockMatch, BlockSnapshot, BlockType, BlockquoteAttrs, BulletListAttrs, ClassifyResult, CodeBlockAttrs, FileAttrs, HeadingAttrs, HeadingLevel, HrAttrs, ImageAttrs, ImportedHtmlAttrs, InlineMarkName, LinkCardAttrs, OrderedListAttrs, ParagraphAttrs, Snapshot, TableAttrs, UnknownAttrs, YoutubeAttrs, } from './core/blocks.cjs';
9
- export { getLocale, setLocale, t } from './core/i18n.cjs';
10
- export type { Locale, Strings } from './core/i18n.cjs';
11
- export type { EditorOptions, HtmlStyleMode, SerializeHtmlOptions, ToolbarConfig, ToolbarItem, ToolbarItemName, } from './types/index.cjs';
14
+ export type { EditorErrorCode, EditorOptions, HtmlStyleMode, SerializeHtmlOptions, ToolbarConfig, ToolbarItem, ToolbarItemName, UploadOptions, CodeHighlighter, } from './types/index.cjs';
12
15
  export { DEFAULT_TOOLBAR } from './types/index.cjs';
13
- export { SNAPSHOT_VERSION, snapshotVersionOf, upgradeSnapshot, upgradeSnapshots, } from './core/snapshot.cjs';
14
- export { renderBlockToHTML, renderBlocksToHTML } from './core/render-string.cjs';
16
+ export { DEFAULT_FONTS, DEFAULT_FONT_SIZES } from './core/fonts.cjs';
17
+ export type { FontFamily } from './core/fonts.cjs';
18
+ export type { Locale } from './core/i18n.cjs';
19
+ export { SNAPSHOT_VERSION, upgradeSnapshots } from './core/snapshot.cjs';
20
+ export { renderBlocksToHTML } from './core/render-string.cjs';
15
21
  export type { RenderHtmlOptions } from './core/render-string.cjs';
22
+ export { sanitizeHTML } from './core/sanitize-html.cjs';
23
+ export { htmlToBlocks } from './core/html-to-blocks.cjs';
16
24
  export { blocksToMarkdown } from './core/markdown-export.cjs';
17
25
  export type { MarkdownOptions } from './core/markdown-export.cjs';
26
+ export { markdownToBlocks, markdownToHtml } from './core/import-markdown.cjs';
18
27
  export { blocksToPlainText } from './core/plain-text.cjs';
19
28
  export type { PlainTextOptions } from './core/plain-text.cjs';
20
- export { decodeEntities, escapeAttr, escapeHtml, parseHtmlFragment, serializeNodes, textOf, textWithBlockBreaks, } from './core/html-mini.cjs';
21
- export type { HtmlElementNode, HtmlNode, HtmlText } from './core/html-mini.cjs';
29
+ export type { Block, BlockAttrs, BlockAttrsByKind, BlockKind, BlockSnapshot, BlockquoteAttrs, BulletListAttrs, CodeBlockAttrs, FileAttrs, HeadingAttrs, HeadingLevel, HrAttrs, ImageAttrs, ImportedHtmlAttrs, InlineMarkName, LinkCardAttrs, OrderedListAttrs, ParagraphAttrs, Snapshot, TableAttrs, UnknownAttrs, YoutubeAttrs, } from './core/blocks.cjs';
22
30
  // (소스맵은 CJS 선언 사본에서 제외됨 — scripts/finalize-types.mjs)
@@ -24,14 +24,13 @@
24
24
  * },
25
25
  * };
26
26
  */
27
- export { renderBlockToHTML, renderBlocksToHTML, } from '../core/render-string.cjs';
27
+ export { renderBlocksToHTML } from '../core/render-string.cjs';
28
28
  export type { RenderHtmlOptions } from '../core/render-string.cjs';
29
+ export { sanitizeHTML } from '../core/sanitize-html.cjs';
29
30
  export { blocksToMarkdown } from '../core/markdown-export.cjs';
30
31
  export type { MarkdownOptions } from '../core/markdown-export.cjs';
31
32
  export { blocksToPlainText } from '../core/plain-text.cjs';
32
33
  export type { PlainTextOptions } from '../core/plain-text.cjs';
33
- export { SNAPSHOT_VERSION, snapshotVersionOf, upgradeSnapshot, upgradeSnapshots, } from '../core/snapshot.cjs';
34
- export type { Block, BlockAttrs, BlockAttrsByKind, BlockKind, BlockSnapshot, BlockquoteAttrs, BulletListAttrs, CodeBlockAttrs, FileAttrs, HeadingAttrs, HeadingLevel, HrAttrs, ImageAttrs, ImportedHtmlAttrs, InlineMarkName, LinkCardAttrs, OrderedListAttrs, ParagraphAttrs, Snapshot, TableAttrs, UnknownAttrs, YoutubeAttrs, } from '../core/blocks.cjs';
35
- export { decodeEntities, escapeAttr, escapeHtml, parseHtmlFragment, serializeNodes, textOf, textWithBlockBreaks, } from '../core/html-mini.cjs';
36
- export type { HtmlElementNode, HtmlNode, HtmlText } from '../core/html-mini.cjs';
34
+ export { SNAPSHOT_VERSION, upgradeSnapshots } from '../core/snapshot.cjs';
35
+ export type { BlockAttrs, BlockAttrsByKind, BlockKind, BlockSnapshot, BlockquoteAttrs, BulletListAttrs, CodeBlockAttrs, FileAttrs, HeadingAttrs, HeadingLevel, HrAttrs, ImageAttrs, ImportedHtmlAttrs, InlineMarkName, LinkCardAttrs, OrderedListAttrs, ParagraphAttrs, Snapshot, TableAttrs, UnknownAttrs, YoutubeAttrs, } from '../core/blocks.cjs';
37
36
  // (소스맵은 CJS 선언 사본에서 제외됨 — scripts/finalize-types.mjs)