@zm-editor/react 0.1.2 → 0.1.5
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.ko.md +260 -260
- package/README.md +300 -300
- package/dist/index.js +147 -84
- package/dist/styles.css +8078 -8078
- package/dist/variables.css +480 -480
- package/package.json +8 -8
- package/LICENSE +0 -21
package/README.ko.md
CHANGED
|
@@ -1,260 +1,260 @@
|
|
|
1
|
-
# @zm-editor/react
|
|
2
|
-
|
|
3
|
-
[Tiptap](https://tiptap.dev) 기반의 Notion 스타일 리치 텍스트 에디터 React 컴포넌트입니다.
|
|
4
|
-
|
|
5
|
-
[](https://www.npmjs.com/package/@zm-editor/react)
|
|
6
|
-
[](https://opensource.org/licenses/MIT)
|
|
7
|
-
|
|
8
|
-
[English](./README.md) | **한국어**
|
|
9
|
-
|
|
10
|
-
## 주요 기능
|
|
11
|
-
|
|
12
|
-
- **Notion 스타일 UX** - 슬래시 명령어, 버블 메뉴, 드래그 앤 드롭 블록
|
|
13
|
-
- **35+ 슬래시 명령어** - 제목, 목록, 코드 블록, 테이블 등
|
|
14
|
-
- **28+ 커스텀 블록** - 이미지, 임베드, 콜아웃, 다이어그램, API 블록 등
|
|
15
|
-
- **구문 강조** - 26개 이상 언어 지원 (GitHub Dark 테마)
|
|
16
|
-
- **Mermaid 다이어그램** - 플로우차트, 시퀀스 다이어그램, 마인드맵
|
|
17
|
-
- **수학 수식** - KaTeX LaTeX 렌더링
|
|
18
|
-
- **다국어 지원** - 한국어 & 영어 내장
|
|
19
|
-
- **다크 모드** - 완전한 다크 모드 지원
|
|
20
|
-
- **TypeScript** - 완전한 타입 정의 포함
|
|
21
|
-
|
|
22
|
-
## 설치
|
|
23
|
-
|
|
24
|
-
```bash
|
|
25
|
-
npm install @zm-editor/core @zm-editor/react
|
|
26
|
-
```
|
|
27
|
-
|
|
28
|
-
### 필수 의존성
|
|
29
|
-
|
|
30
|
-
```bash
|
|
31
|
-
npm install react react-dom
|
|
32
|
-
```
|
|
33
|
-
|
|
34
|
-
### 선택적 의존성
|
|
35
|
-
|
|
36
|
-
```bash
|
|
37
|
-
# Mermaid 다이어그램 (플로우차트, 시퀀스 다이어그램 등)
|
|
38
|
-
npm install mermaid
|
|
39
|
-
|
|
40
|
-
# 수학 수식 (LaTeX 렌더링)
|
|
41
|
-
npm install katex
|
|
42
|
-
|
|
43
|
-
# 파일 첨부의 PDF 미리보기
|
|
44
|
-
npm install pdfjs-dist
|
|
45
|
-
|
|
46
|
-
# HTML 새니타이징
|
|
47
|
-
npm install dompurify
|
|
48
|
-
```
|
|
49
|
-
|
|
50
|
-
> **참고:** Mermaid와 KaTeX는 선택 사항입니다. 설치하지 않은 경우, 다이어그램이나 수식 블록 사용 시 설치 안내가 표시됩니다.
|
|
51
|
-
|
|
52
|
-
## 빠른 시작
|
|
53
|
-
|
|
54
|
-
```tsx
|
|
55
|
-
'use client'; // Next.js App Router 필수
|
|
56
|
-
|
|
57
|
-
import { ZmEditor } from '@zm-editor/react';
|
|
58
|
-
|
|
59
|
-
export default function MyEditor() {
|
|
60
|
-
return (
|
|
61
|
-
<ZmEditor
|
|
62
|
-
initialContent="<p>안녕하세요!</p>"
|
|
63
|
-
onChange={(editor) => {
|
|
64
|
-
console.log(editor.getJSON());
|
|
65
|
-
}}
|
|
66
|
-
/>
|
|
67
|
-
);
|
|
68
|
-
}
|
|
69
|
-
```
|
|
70
|
-
|
|
71
|
-
## Next.js 사용법
|
|
72
|
-
|
|
73
|
-
Next.js App Router에서는 SSR 문제를 피하기 위해 동적 import를 사용하세요:
|
|
74
|
-
|
|
75
|
-
```tsx
|
|
76
|
-
'use client';
|
|
77
|
-
|
|
78
|
-
import dynamic from 'next/dynamic';
|
|
79
|
-
|
|
80
|
-
const ZmEditor = dynamic(
|
|
81
|
-
() => import('@zm-editor/react').then((mod) => mod.ZmEditor),
|
|
82
|
-
{ ssr: false }
|
|
83
|
-
);
|
|
84
|
-
|
|
85
|
-
export default function EditorWrapper() {
|
|
86
|
-
return <ZmEditor />;
|
|
87
|
-
}
|
|
88
|
-
```
|
|
89
|
-
|
|
90
|
-
## Props
|
|
91
|
-
|
|
92
|
-
| Prop | 타입 | 기본값 | 설명 |
|
|
93
|
-
|------|------|--------|------|
|
|
94
|
-
| `initialContent` | `string \| JSONContent` | `''` | 초기 에디터 콘텐츠 (HTML 또는 JSON) |
|
|
95
|
-
| `onChange` | `(editor: Editor) => void` | - | 콘텐츠 변경 시 콜백 |
|
|
96
|
-
| `onImageUpload` | `(file: File) => Promise<string>` | - | 커스텀 이미지 업로드 핸들러 |
|
|
97
|
-
| `locale` | `ZmEditorLocale` | `enLocale` | 다국어 설정 |
|
|
98
|
-
| `editable` | `boolean` | `true` | 편집 가능/불가 설정 |
|
|
99
|
-
| `placeholder` | `string` | - | 플레이스홀더 텍스트 |
|
|
100
|
-
| `className` | `string` | - | 추가 CSS 클래스 |
|
|
101
|
-
|
|
102
|
-
## 슬래시 명령어
|
|
103
|
-
|
|
104
|
-
`/`를 입력하면 명령어 메뉴가 열립니다:
|
|
105
|
-
|
|
106
|
-
| 명령어 | 설명 |
|
|
107
|
-
|--------|------|
|
|
108
|
-
| `/text` | 일반 텍스트 |
|
|
109
|
-
| `/h1`, `/h2`, `/h3` | 제목 |
|
|
110
|
-
| `/bullet` | 글머리 기호 목록 |
|
|
111
|
-
| `/number` | 번호 목록 |
|
|
112
|
-
| `/task` | 할 일 목록 (체크리스트) |
|
|
113
|
-
| `/quote` | 인용문 |
|
|
114
|
-
| `/code` | 구문 강조 코드 블록 |
|
|
115
|
-
| `/table` | 테이블 (3x3) |
|
|
116
|
-
| `/image` | 이미지 업로드 |
|
|
117
|
-
| `/file` | 파일 첨부 |
|
|
118
|
-
| `/embed` | 임베드 (YouTube, CodeSandbox, StackBlitz, Replit) |
|
|
119
|
-
| `/callout` | 콜아웃 (info, warning, error, success, tip, note) |
|
|
120
|
-
| `/toggle` | 토글 (접기/펼치기) |
|
|
121
|
-
| `/mermaid` | Mermaid 다이어그램 |
|
|
122
|
-
| `/math` | 수학 수식 (LaTeX) |
|
|
123
|
-
| `/terminal` | 터미널 블록 |
|
|
124
|
-
| `/api` | API 요청/응답 블록 |
|
|
125
|
-
| `/divider` | 구분선 |
|
|
126
|
-
| `/toc` | 목차 |
|
|
127
|
-
| ... | 그 외 15개 이상 |
|
|
128
|
-
|
|
129
|
-
## 다국어 설정 (i18n)
|
|
130
|
-
|
|
131
|
-
```tsx
|
|
132
|
-
import { ZmEditor, koLocale, enLocale } from '@zm-editor/react';
|
|
133
|
-
|
|
134
|
-
// 한국어
|
|
135
|
-
<ZmEditor locale={koLocale} />
|
|
136
|
-
|
|
137
|
-
// 영어 (기본값)
|
|
138
|
-
<ZmEditor locale={enLocale} />
|
|
139
|
-
|
|
140
|
-
// 커스텀
|
|
141
|
-
<ZmEditor
|
|
142
|
-
locale={{
|
|
143
|
-
...koLocale,
|
|
144
|
-
editor: {
|
|
145
|
-
placeholder: '내용을 입력하세요...',
|
|
146
|
-
},
|
|
147
|
-
}}
|
|
148
|
-
/>
|
|
149
|
-
```
|
|
150
|
-
|
|
151
|
-
## 커스텀 이미지 업로드
|
|
152
|
-
|
|
153
|
-
```tsx
|
|
154
|
-
<ZmEditor
|
|
155
|
-
onImageUpload={async (file) => {
|
|
156
|
-
const formData = new FormData();
|
|
157
|
-
formData.append('file', file);
|
|
158
|
-
|
|
159
|
-
const response = await fetch('/api/upload', {
|
|
160
|
-
method: 'POST',
|
|
161
|
-
body: formData,
|
|
162
|
-
});
|
|
163
|
-
|
|
164
|
-
const { url } = await response.json();
|
|
165
|
-
return url;
|
|
166
|
-
}}
|
|
167
|
-
/>
|
|
168
|
-
```
|
|
169
|
-
|
|
170
|
-
## 콘텐츠 내보내기
|
|
171
|
-
|
|
172
|
-
```tsx
|
|
173
|
-
import { useRef } from 'react';
|
|
174
|
-
import { ZmEditor, type ZmEditorRef } from '@zm-editor/react';
|
|
175
|
-
|
|
176
|
-
function MyEditor() {
|
|
177
|
-
const editorRef = useRef<ZmEditorRef>(null);
|
|
178
|
-
|
|
179
|
-
const handleExport = () => {
|
|
180
|
-
const editor = editorRef.current?.editor;
|
|
181
|
-
if (!editor) return;
|
|
182
|
-
|
|
183
|
-
const json = editor.getJSON(); // JSON 형식
|
|
184
|
-
const html = editor.getHTML(); // HTML 형식
|
|
185
|
-
const text = editor.getText(); // 텍스트 형식
|
|
186
|
-
};
|
|
187
|
-
|
|
188
|
-
return (
|
|
189
|
-
<>
|
|
190
|
-
<ZmEditor ref={editorRef} />
|
|
191
|
-
<button onClick={handleExport}>내보내기</button>
|
|
192
|
-
</>
|
|
193
|
-
);
|
|
194
|
-
}
|
|
195
|
-
```
|
|
196
|
-
|
|
197
|
-
## 테마 커스터마이징
|
|
198
|
-
|
|
199
|
-
### 스타일 가져오기
|
|
200
|
-
|
|
201
|
-
```tsx
|
|
202
|
-
import '@zm-editor/react/styles.css';
|
|
203
|
-
```
|
|
204
|
-
|
|
205
|
-
### CSS 변수로 커스터마이징
|
|
206
|
-
|
|
207
|
-
```css
|
|
208
|
-
:root {
|
|
209
|
-
/* 기본 색상 */
|
|
210
|
-
--zm-colors-primary: #8b5cf6;
|
|
211
|
-
--zm-colors-primary-hover: #7c3aed;
|
|
212
|
-
|
|
213
|
-
/* 에디터 배경 & 텍스트 */
|
|
214
|
-
--zm-colors-editor-background: #ffffff;
|
|
215
|
-
--zm-colors-editor-text: #374151;
|
|
216
|
-
--zm-colors-editor-border: #e5e7eb;
|
|
217
|
-
}
|
|
218
|
-
|
|
219
|
-
/* 다크 모드 */
|
|
220
|
-
.dark,
|
|
221
|
-
[data-theme='dark'] {
|
|
222
|
-
--zm-colors-primary: #a78bfa;
|
|
223
|
-
--zm-colors-editor-background: #1f2937;
|
|
224
|
-
--zm-colors-editor-text: #d1d5db;
|
|
225
|
-
}
|
|
226
|
-
```
|
|
227
|
-
|
|
228
|
-
### 다크 모드 지원
|
|
229
|
-
|
|
230
|
-
zm-editor는 다음 방식의 다크 모드를 자동 지원합니다:
|
|
231
|
-
- `.dark` 클래스 (Tailwind CSS / next-themes)
|
|
232
|
-
- `[data-theme="dark"]` 속성
|
|
233
|
-
- `@media (prefers-color-scheme: dark)` 시스템 설정
|
|
234
|
-
|
|
235
|
-
## 브라우저 지원
|
|
236
|
-
|
|
237
|
-
- Chrome (최신)
|
|
238
|
-
- Firefox (최신)
|
|
239
|
-
- Safari (최신)
|
|
240
|
-
- Edge (최신)
|
|
241
|
-
|
|
242
|
-
## 요구 사항
|
|
243
|
-
|
|
244
|
-
- React 18+
|
|
245
|
-
- Node.js 18+
|
|
246
|
-
|
|
247
|
-
## 관련 패키지
|
|
248
|
-
|
|
249
|
-
| 패키지 | 설명 |
|
|
250
|
-
|--------|------|
|
|
251
|
-
| [@zm-editor/core](https://www.npmjs.com/package/@zm-editor/core) | 코어 Tiptap 확장 및 유틸리티 |
|
|
252
|
-
|
|
253
|
-
## 링크
|
|
254
|
-
|
|
255
|
-
- [GitHub 저장소](https://github.com/hanumoka/zm-editor)
|
|
256
|
-
- [문서](https://github.com/hanumoka/zm-editor#readme)
|
|
257
|
-
|
|
258
|
-
## 라이선스
|
|
259
|
-
|
|
260
|
-
[MIT](https://github.com/hanumoka/zm-editor/blob/main/LICENSE)
|
|
1
|
+
# @zm-editor/react
|
|
2
|
+
|
|
3
|
+
[Tiptap](https://tiptap.dev) 기반의 Notion 스타일 리치 텍스트 에디터 React 컴포넌트입니다.
|
|
4
|
+
|
|
5
|
+
[](https://www.npmjs.com/package/@zm-editor/react)
|
|
6
|
+
[](https://opensource.org/licenses/MIT)
|
|
7
|
+
|
|
8
|
+
[English](./README.md) | **한국어**
|
|
9
|
+
|
|
10
|
+
## 주요 기능
|
|
11
|
+
|
|
12
|
+
- **Notion 스타일 UX** - 슬래시 명령어, 버블 메뉴, 드래그 앤 드롭 블록
|
|
13
|
+
- **35+ 슬래시 명령어** - 제목, 목록, 코드 블록, 테이블 등
|
|
14
|
+
- **28+ 커스텀 블록** - 이미지, 임베드, 콜아웃, 다이어그램, API 블록 등
|
|
15
|
+
- **구문 강조** - 26개 이상 언어 지원 (GitHub Dark 테마)
|
|
16
|
+
- **Mermaid 다이어그램** - 플로우차트, 시퀀스 다이어그램, 마인드맵
|
|
17
|
+
- **수학 수식** - KaTeX LaTeX 렌더링
|
|
18
|
+
- **다국어 지원** - 한국어 & 영어 내장
|
|
19
|
+
- **다크 모드** - 완전한 다크 모드 지원
|
|
20
|
+
- **TypeScript** - 완전한 타입 정의 포함
|
|
21
|
+
|
|
22
|
+
## 설치
|
|
23
|
+
|
|
24
|
+
```bash
|
|
25
|
+
npm install @zm-editor/core @zm-editor/react
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
### 필수 의존성
|
|
29
|
+
|
|
30
|
+
```bash
|
|
31
|
+
npm install react react-dom
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
### 선택적 의존성
|
|
35
|
+
|
|
36
|
+
```bash
|
|
37
|
+
# Mermaid 다이어그램 (플로우차트, 시퀀스 다이어그램 등)
|
|
38
|
+
npm install mermaid
|
|
39
|
+
|
|
40
|
+
# 수학 수식 (LaTeX 렌더링)
|
|
41
|
+
npm install katex
|
|
42
|
+
|
|
43
|
+
# 파일 첨부의 PDF 미리보기
|
|
44
|
+
npm install pdfjs-dist
|
|
45
|
+
|
|
46
|
+
# HTML 새니타이징
|
|
47
|
+
npm install dompurify
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
> **참고:** Mermaid와 KaTeX는 선택 사항입니다. 설치하지 않은 경우, 다이어그램이나 수식 블록 사용 시 설치 안내가 표시됩니다.
|
|
51
|
+
|
|
52
|
+
## 빠른 시작
|
|
53
|
+
|
|
54
|
+
```tsx
|
|
55
|
+
'use client'; // Next.js App Router 필수
|
|
56
|
+
|
|
57
|
+
import { ZmEditor } from '@zm-editor/react';
|
|
58
|
+
|
|
59
|
+
export default function MyEditor() {
|
|
60
|
+
return (
|
|
61
|
+
<ZmEditor
|
|
62
|
+
initialContent="<p>안녕하세요!</p>"
|
|
63
|
+
onChange={(editor) => {
|
|
64
|
+
console.log(editor.getJSON());
|
|
65
|
+
}}
|
|
66
|
+
/>
|
|
67
|
+
);
|
|
68
|
+
}
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
## Next.js 사용법
|
|
72
|
+
|
|
73
|
+
Next.js App Router에서는 SSR 문제를 피하기 위해 동적 import를 사용하세요:
|
|
74
|
+
|
|
75
|
+
```tsx
|
|
76
|
+
'use client';
|
|
77
|
+
|
|
78
|
+
import dynamic from 'next/dynamic';
|
|
79
|
+
|
|
80
|
+
const ZmEditor = dynamic(
|
|
81
|
+
() => import('@zm-editor/react').then((mod) => mod.ZmEditor),
|
|
82
|
+
{ ssr: false }
|
|
83
|
+
);
|
|
84
|
+
|
|
85
|
+
export default function EditorWrapper() {
|
|
86
|
+
return <ZmEditor />;
|
|
87
|
+
}
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
## Props
|
|
91
|
+
|
|
92
|
+
| Prop | 타입 | 기본값 | 설명 |
|
|
93
|
+
|------|------|--------|------|
|
|
94
|
+
| `initialContent` | `string \| JSONContent` | `''` | 초기 에디터 콘텐츠 (HTML 또는 JSON) |
|
|
95
|
+
| `onChange` | `(editor: Editor) => void` | - | 콘텐츠 변경 시 콜백 |
|
|
96
|
+
| `onImageUpload` | `(file: File) => Promise<string>` | - | 커스텀 이미지 업로드 핸들러 |
|
|
97
|
+
| `locale` | `ZmEditorLocale` | `enLocale` | 다국어 설정 |
|
|
98
|
+
| `editable` | `boolean` | `true` | 편집 가능/불가 설정 |
|
|
99
|
+
| `placeholder` | `string` | - | 플레이스홀더 텍스트 |
|
|
100
|
+
| `className` | `string` | - | 추가 CSS 클래스 |
|
|
101
|
+
|
|
102
|
+
## 슬래시 명령어
|
|
103
|
+
|
|
104
|
+
`/`를 입력하면 명령어 메뉴가 열립니다:
|
|
105
|
+
|
|
106
|
+
| 명령어 | 설명 |
|
|
107
|
+
|--------|------|
|
|
108
|
+
| `/text` | 일반 텍스트 |
|
|
109
|
+
| `/h1`, `/h2`, `/h3` | 제목 |
|
|
110
|
+
| `/bullet` | 글머리 기호 목록 |
|
|
111
|
+
| `/number` | 번호 목록 |
|
|
112
|
+
| `/task` | 할 일 목록 (체크리스트) |
|
|
113
|
+
| `/quote` | 인용문 |
|
|
114
|
+
| `/code` | 구문 강조 코드 블록 |
|
|
115
|
+
| `/table` | 테이블 (3x3) |
|
|
116
|
+
| `/image` | 이미지 업로드 |
|
|
117
|
+
| `/file` | 파일 첨부 |
|
|
118
|
+
| `/embed` | 임베드 (YouTube, CodeSandbox, StackBlitz, Replit) |
|
|
119
|
+
| `/callout` | 콜아웃 (info, warning, error, success, tip, note) |
|
|
120
|
+
| `/toggle` | 토글 (접기/펼치기) |
|
|
121
|
+
| `/mermaid` | Mermaid 다이어그램 |
|
|
122
|
+
| `/math` | 수학 수식 (LaTeX) |
|
|
123
|
+
| `/terminal` | 터미널 블록 |
|
|
124
|
+
| `/api` | API 요청/응답 블록 |
|
|
125
|
+
| `/divider` | 구분선 |
|
|
126
|
+
| `/toc` | 목차 |
|
|
127
|
+
| ... | 그 외 15개 이상 |
|
|
128
|
+
|
|
129
|
+
## 다국어 설정 (i18n)
|
|
130
|
+
|
|
131
|
+
```tsx
|
|
132
|
+
import { ZmEditor, koLocale, enLocale } from '@zm-editor/react';
|
|
133
|
+
|
|
134
|
+
// 한국어
|
|
135
|
+
<ZmEditor locale={koLocale} />
|
|
136
|
+
|
|
137
|
+
// 영어 (기본값)
|
|
138
|
+
<ZmEditor locale={enLocale} />
|
|
139
|
+
|
|
140
|
+
// 커스텀
|
|
141
|
+
<ZmEditor
|
|
142
|
+
locale={{
|
|
143
|
+
...koLocale,
|
|
144
|
+
editor: {
|
|
145
|
+
placeholder: '내용을 입력하세요...',
|
|
146
|
+
},
|
|
147
|
+
}}
|
|
148
|
+
/>
|
|
149
|
+
```
|
|
150
|
+
|
|
151
|
+
## 커스텀 이미지 업로드
|
|
152
|
+
|
|
153
|
+
```tsx
|
|
154
|
+
<ZmEditor
|
|
155
|
+
onImageUpload={async (file) => {
|
|
156
|
+
const formData = new FormData();
|
|
157
|
+
formData.append('file', file);
|
|
158
|
+
|
|
159
|
+
const response = await fetch('/api/upload', {
|
|
160
|
+
method: 'POST',
|
|
161
|
+
body: formData,
|
|
162
|
+
});
|
|
163
|
+
|
|
164
|
+
const { url } = await response.json();
|
|
165
|
+
return url;
|
|
166
|
+
}}
|
|
167
|
+
/>
|
|
168
|
+
```
|
|
169
|
+
|
|
170
|
+
## 콘텐츠 내보내기
|
|
171
|
+
|
|
172
|
+
```tsx
|
|
173
|
+
import { useRef } from 'react';
|
|
174
|
+
import { ZmEditor, type ZmEditorRef } from '@zm-editor/react';
|
|
175
|
+
|
|
176
|
+
function MyEditor() {
|
|
177
|
+
const editorRef = useRef<ZmEditorRef>(null);
|
|
178
|
+
|
|
179
|
+
const handleExport = () => {
|
|
180
|
+
const editor = editorRef.current?.editor;
|
|
181
|
+
if (!editor) return;
|
|
182
|
+
|
|
183
|
+
const json = editor.getJSON(); // JSON 형식
|
|
184
|
+
const html = editor.getHTML(); // HTML 형식
|
|
185
|
+
const text = editor.getText(); // 텍스트 형식
|
|
186
|
+
};
|
|
187
|
+
|
|
188
|
+
return (
|
|
189
|
+
<>
|
|
190
|
+
<ZmEditor ref={editorRef} />
|
|
191
|
+
<button onClick={handleExport}>내보내기</button>
|
|
192
|
+
</>
|
|
193
|
+
);
|
|
194
|
+
}
|
|
195
|
+
```
|
|
196
|
+
|
|
197
|
+
## 테마 커스터마이징
|
|
198
|
+
|
|
199
|
+
### 스타일 가져오기
|
|
200
|
+
|
|
201
|
+
```tsx
|
|
202
|
+
import '@zm-editor/react/styles.css';
|
|
203
|
+
```
|
|
204
|
+
|
|
205
|
+
### CSS 변수로 커스터마이징
|
|
206
|
+
|
|
207
|
+
```css
|
|
208
|
+
:root {
|
|
209
|
+
/* 기본 색상 */
|
|
210
|
+
--zm-colors-primary: #8b5cf6;
|
|
211
|
+
--zm-colors-primary-hover: #7c3aed;
|
|
212
|
+
|
|
213
|
+
/* 에디터 배경 & 텍스트 */
|
|
214
|
+
--zm-colors-editor-background: #ffffff;
|
|
215
|
+
--zm-colors-editor-text: #374151;
|
|
216
|
+
--zm-colors-editor-border: #e5e7eb;
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
/* 다크 모드 */
|
|
220
|
+
.dark,
|
|
221
|
+
[data-theme='dark'] {
|
|
222
|
+
--zm-colors-primary: #a78bfa;
|
|
223
|
+
--zm-colors-editor-background: #1f2937;
|
|
224
|
+
--zm-colors-editor-text: #d1d5db;
|
|
225
|
+
}
|
|
226
|
+
```
|
|
227
|
+
|
|
228
|
+
### 다크 모드 지원
|
|
229
|
+
|
|
230
|
+
zm-editor는 다음 방식의 다크 모드를 자동 지원합니다:
|
|
231
|
+
- `.dark` 클래스 (Tailwind CSS / next-themes)
|
|
232
|
+
- `[data-theme="dark"]` 속성
|
|
233
|
+
- `@media (prefers-color-scheme: dark)` 시스템 설정
|
|
234
|
+
|
|
235
|
+
## 브라우저 지원
|
|
236
|
+
|
|
237
|
+
- Chrome (최신)
|
|
238
|
+
- Firefox (최신)
|
|
239
|
+
- Safari (최신)
|
|
240
|
+
- Edge (최신)
|
|
241
|
+
|
|
242
|
+
## 요구 사항
|
|
243
|
+
|
|
244
|
+
- React 18+
|
|
245
|
+
- Node.js 18+
|
|
246
|
+
|
|
247
|
+
## 관련 패키지
|
|
248
|
+
|
|
249
|
+
| 패키지 | 설명 |
|
|
250
|
+
|--------|------|
|
|
251
|
+
| [@zm-editor/core](https://www.npmjs.com/package/@zm-editor/core) | 코어 Tiptap 확장 및 유틸리티 |
|
|
252
|
+
|
|
253
|
+
## 링크
|
|
254
|
+
|
|
255
|
+
- [GitHub 저장소](https://github.com/hanumoka/zm-editor)
|
|
256
|
+
- [문서](https://github.com/hanumoka/zm-editor#readme)
|
|
257
|
+
|
|
258
|
+
## 라이선스
|
|
259
|
+
|
|
260
|
+
[MIT](https://github.com/hanumoka/zm-editor/blob/main/LICENSE)
|