md-editor-lite 0.1.0 → 0.1.3
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.md +32 -6
- package/package.json +12 -3
- package/playground/App.tsx +0 -19
- package/playground/index.html +0 -12
- package/playground/main.tsx +0 -9
- package/playground/package-lock.json +0 -970
- package/playground/package.json +0 -14
- package/playground/tsconfig.app.json +0 -31
- package/playground/tsconfig.json +0 -7
- package/playground/tsconfig.node.json +0 -24
- package/playground/vite.config.ts +0 -6
- package/src/components/EditorHeader.tsx +0 -21
- package/src/components/EditorTab.tsx +0 -27
- package/src/components/EditorTextarea.tsx +0 -39
- package/src/components/IconDropdown.tsx +0 -90
- package/src/components/MarkdownEditor.tsx +0 -42
- package/src/components/Preview.tsx +0 -16
- package/src/components/Toolbar.tsx +0 -25
- package/src/components/ToolbarDropdown.tsx +0 -35
- package/src/components/index.ts +0 -7
- package/src/constants/index.ts +0 -1
- package/src/constants/toolbar.ts +0 -36
- package/src/css/dropdown.css +0 -101
- package/src/css/editor.css +0 -67
- package/src/css/preview.css +0 -11
- package/src/css/toolbar.css +0 -25
- package/src/hooks/index.ts +0 -1
- package/src/hooks/useMarkdownEditor.ts +0 -39
- package/src/index.ts +0 -4
- package/src/utils/cx.ts +0 -3
- package/src/utils/index.ts +0 -2
- package/src/utils/markdown.ts +0 -89
- package/tsconfig.build.json +0 -18
package/README.md
CHANGED
|
@@ -11,6 +11,7 @@ Built with **TypeScript**, designed for **library-friendly usage**, and has **no
|
|
|
11
11
|
|
|
12
12
|
- ⚡ **Minimal dependencies**
|
|
13
13
|
→ No heavy editor engines, no unnecessary packages
|
|
14
|
+
→ Regex-based parsing for predictable behavior
|
|
14
15
|
|
|
15
16
|
- 🔁 **Controlled & Uncontrolled modes**
|
|
16
17
|
→ Works well with forms and external state management
|
|
@@ -26,15 +27,22 @@ Built with **TypeScript**, designed for **library-friendly usage**, and has **no
|
|
|
26
27
|
|
|
27
28
|
## 🧠 Supported Markdown Syntax
|
|
28
29
|
|
|
29
|
-
-
|
|
30
|
-
-
|
|
31
|
-
-
|
|
32
|
-
-
|
|
33
|
-
-
|
|
34
|
-
-
|
|
30
|
+
- Bold: **bold**
|
|
31
|
+
- Italic: _italic_
|
|
32
|
+
- <u>Underline</u>: **underline**
|
|
33
|
+
- Strikethrough: ~~strike~~
|
|
34
|
+
- Inline code: `code`
|
|
35
|
+
- Blockquote: > quote
|
|
36
|
+
- Headings:`#`, `##`, `###`
|
|
37
|
+
- Ordered / Unordered lists:
|
|
38
|
+
- `- item`
|
|
39
|
+
- `1. item`
|
|
35
40
|
- Images: ``
|
|
36
41
|
- Links: `[text](url)`
|
|
37
42
|
|
|
43
|
+
> ⚠️ This editor intentionally does not support fenced code blocks
|
|
44
|
+
> (code) to keep parsing logic lightweight and predictable.
|
|
45
|
+
|
|
38
46
|
---
|
|
39
47
|
|
|
40
48
|
## 📦 Installation
|
|
@@ -117,6 +125,19 @@ Make sure the following meta tag exists in your HTML document:
|
|
|
117
125
|
|
|
118
126
|
---
|
|
119
127
|
|
|
128
|
+
## 🚫 Non-goals
|
|
129
|
+
|
|
130
|
+
md-editor-lite intentionally does NOT aim to be:
|
|
131
|
+
|
|
132
|
+
- A full CommonMark implementation
|
|
133
|
+
- A WYSIWYG editor
|
|
134
|
+
- A syntax-highlighting code editor
|
|
135
|
+
|
|
136
|
+
This library focuses on **simple text input with markdown preview**,
|
|
137
|
+
not complex document authoring.
|
|
138
|
+
|
|
139
|
+
---
|
|
140
|
+
|
|
120
141
|
<details>
|
|
121
142
|
<summary>🇰🇷 한국어 설명</summary>
|
|
122
143
|
|
|
@@ -172,4 +193,9 @@ Make sure the following meta tag exists in your HTML document:
|
|
|
172
193
|
- 관리자 페이지에 **심플한 마크다운 입력 UI**가 필요할 때
|
|
173
194
|
- 디자인 시스템 안에 자연스럽게 녹아드는 에디터가 필요할 때
|
|
174
195
|
|
|
196
|
+
---
|
|
197
|
+
|
|
198
|
+
> md-editor-lite는 CommonMark 전체를 구현하는 것을 목표로 하지 않습니다.
|
|
199
|
+
> 문법 충돌과 예외 처리가 많은 기능(code block, table 등)은 의도적으로 제외했습니다.
|
|
200
|
+
|
|
175
201
|
</details>
|
package/package.json
CHANGED
|
@@ -2,13 +2,15 @@
|
|
|
2
2
|
"name": "md-editor-lite",
|
|
3
3
|
"description": "A lightweight, dependency-minimal React markdown editor",
|
|
4
4
|
"keywords": [
|
|
5
|
+
"react",
|
|
5
6
|
"markdown",
|
|
6
7
|
"editor",
|
|
7
|
-
"
|
|
8
|
+
"markdown-editor",
|
|
9
|
+
"react-editor",
|
|
8
10
|
"lightweight",
|
|
9
11
|
"textarea"
|
|
10
12
|
],
|
|
11
|
-
"version": "0.1.
|
|
13
|
+
"version": "0.1.3",
|
|
12
14
|
"main": "dist/index.js",
|
|
13
15
|
"module": "dist/index.mjs",
|
|
14
16
|
"types": "dist/index.d.ts",
|
|
@@ -26,5 +28,12 @@
|
|
|
26
28
|
},
|
|
27
29
|
"dependencies": {
|
|
28
30
|
"lucide-react": "^0.562.0"
|
|
29
|
-
}
|
|
31
|
+
},
|
|
32
|
+
"files": [
|
|
33
|
+
"dist",
|
|
34
|
+
"README.md"
|
|
35
|
+
],
|
|
36
|
+
"sideEffects": [
|
|
37
|
+
"*.css"
|
|
38
|
+
]
|
|
30
39
|
}
|
package/playground/App.tsx
DELETED
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { useState } from "react";
|
|
2
|
-
import { MarkdownEditor } from "../src";
|
|
3
|
-
|
|
4
|
-
export default function App() {
|
|
5
|
-
const [value, setValue] = useState("");
|
|
6
|
-
|
|
7
|
-
return (
|
|
8
|
-
<div
|
|
9
|
-
style={{
|
|
10
|
-
padding: 40,
|
|
11
|
-
height: "100vh",
|
|
12
|
-
width: "100vw",
|
|
13
|
-
boxSizing: "border-box",
|
|
14
|
-
}}
|
|
15
|
-
>
|
|
16
|
-
<MarkdownEditor value={value} onChange={setValue} />
|
|
17
|
-
</div>
|
|
18
|
-
);
|
|
19
|
-
}
|
package/playground/index.html
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
<!DOCTYPE html>
|
|
2
|
-
<html lang="en">
|
|
3
|
-
<head>
|
|
4
|
-
<meta charset="UTF-8" />
|
|
5
|
-
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
|
6
|
-
<title>md-editor-lite playground</title>
|
|
7
|
-
</head>
|
|
8
|
-
<body>
|
|
9
|
-
<div id="root"></div>
|
|
10
|
-
<script type="module" src="/main.tsx"></script>
|
|
11
|
-
</body>
|
|
12
|
-
</html>
|