@editorcn/editor 0.3.9 → 0.4.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.
- package/README.md +87 -87
- package/dist/index.cjs +377 -518
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +1 -4
- package/dist/index.d.ts +1 -4
- package/dist/index.js +332 -472
- package/dist/index.js.map +1 -1
- package/dist/style.css +1314 -1415
- package/package.json +62 -67
package/README.md
CHANGED
|
@@ -1,87 +1,87 @@
|
|
|
1
|
-
# @editorcn/editor
|
|
2
|
-
|
|
3
|
-
A **toolbar-style** rich text editor built on [Tiptap](https://tiptap.dev/) with shadcn/ui design tokens. Part of the [editorcn](https://editorcn.vercel.app) editor suite.
|
|
4
|
-
|
|
5
|
-
## Features
|
|
6
|
-
|
|
7
|
-
- Compound component API (`RichTextEditor`, `RichTextEditor.Toolbar`, `RichTextEditor.Content`, etc.)
|
|
8
|
-
- 20+ built-in toolbar controls (Bold, H1, Link, Undo, etc.)
|
|
9
|
-
- Sticky toolbar with configurable control groups
|
|
10
|
-
- Fully typed with TypeScript
|
|
11
|
-
- Extensible via Tiptap extensions
|
|
12
|
-
- Built with shadcn/ui CSS variables — matches your theme
|
|
13
|
-
|
|
14
|
-
## Installation
|
|
15
|
-
|
|
16
|
-
### npm
|
|
17
|
-
|
|
18
|
-
```bash
|
|
19
|
-
npm install @editorcn/editor @tiptap/react @tiptap/pm @tiptap/starter-kit @tiptap/extension-link
|
|
20
|
-
```
|
|
21
|
-
|
|
22
|
-
> **Tiptap v3 required.** `@editorcn/editor` is built against Tiptap **v3**. Make sure your `@tiptap/*` packages are on v3, and import `BubbleMenu`/`FloatingMenu` from `@tiptap/react/menus` (not the `@tiptap/react` root) if you use them directly.
|
|
23
|
-
|
|
24
|
-
### shadcn registry
|
|
25
|
-
|
|
26
|
-
```bash
|
|
27
|
-
npx shadcn@latest add @editorcn/editor
|
|
28
|
-
```
|
|
29
|
-
|
|
30
|
-
Make sure your `components.json` includes the editorcn registry:
|
|
31
|
-
|
|
32
|
-
```json
|
|
33
|
-
{
|
|
34
|
-
"registries": {
|
|
35
|
-
"@editorcn": "https://editorcn.vercel.app/r/{name}.json"
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
```
|
|
39
|
-
|
|
40
|
-
## Usage
|
|
41
|
-
|
|
42
|
-
```tsx
|
|
43
|
-
"use client";
|
|
44
|
-
|
|
45
|
-
import { useEditor } from "@tiptap/react";
|
|
46
|
-
import { StarterKit } from "@tiptap/starter-kit";
|
|
47
|
-
import { Underline } from "@tiptap/extension-underline";
|
|
48
|
-
import { RichTextEditor, Link } from "@editorcn/editor";
|
|
49
|
-
import "@editorcn/editor/style.css";
|
|
50
|
-
|
|
51
|
-
export function MyEditor() {
|
|
52
|
-
const editor = useEditor({
|
|
53
|
-
extensions: [StarterKit, Link, Underline],
|
|
54
|
-
content: "<p>Start typing...</p>",
|
|
55
|
-
});
|
|
56
|
-
|
|
57
|
-
return (
|
|
58
|
-
<RichTextEditor editor={editor}>
|
|
59
|
-
<RichTextEditor.Toolbar sticky>
|
|
60
|
-
<RichTextEditor.ControlsGroup>
|
|
61
|
-
<RichTextEditor.Bold />
|
|
62
|
-
<RichTextEditor.Italic />
|
|
63
|
-
<RichTextEditor.Underline />
|
|
64
|
-
</RichTextEditor.ControlsGroup>
|
|
65
|
-
<RichTextEditor.ControlsGroup>
|
|
66
|
-
<RichTextEditor.H1 />
|
|
67
|
-
<RichTextEditor.H2 />
|
|
68
|
-
<RichTextEditor.H3 />
|
|
69
|
-
</RichTextEditor.ControlsGroup>
|
|
70
|
-
<RichTextEditor.ControlsGroup>
|
|
71
|
-
<RichTextEditor.Undo />
|
|
72
|
-
<RichTextEditor.Redo />
|
|
73
|
-
</RichTextEditor.ControlsGroup>
|
|
74
|
-
</RichTextEditor.Toolbar>
|
|
75
|
-
<RichTextEditor.Content />
|
|
76
|
-
</RichTextEditor>
|
|
77
|
-
);
|
|
78
|
-
}
|
|
79
|
-
```
|
|
80
|
-
|
|
81
|
-
## Documentation
|
|
82
|
-
|
|
83
|
-
Full API reference at [editorcn.vercel.app/docs/editor](https://editorcn.vercel.app/docs/editor).
|
|
84
|
-
|
|
85
|
-
## License
|
|
86
|
-
|
|
87
|
-
MIT
|
|
1
|
+
# @editorcn/editor
|
|
2
|
+
|
|
3
|
+
A **toolbar-style** rich text editor built on [Tiptap](https://tiptap.dev/) with shadcn/ui design tokens. Part of the [editorcn](https://editorcn.vercel.app) editor suite.
|
|
4
|
+
|
|
5
|
+
## Features
|
|
6
|
+
|
|
7
|
+
- Compound component API (`RichTextEditor`, `RichTextEditor.Toolbar`, `RichTextEditor.Content`, etc.)
|
|
8
|
+
- 20+ built-in toolbar controls (Bold, H1, Link, Undo, etc.)
|
|
9
|
+
- Sticky toolbar with configurable control groups
|
|
10
|
+
- Fully typed with TypeScript
|
|
11
|
+
- Extensible via Tiptap extensions
|
|
12
|
+
- Built with shadcn/ui CSS variables — matches your theme
|
|
13
|
+
|
|
14
|
+
## Installation
|
|
15
|
+
|
|
16
|
+
### npm
|
|
17
|
+
|
|
18
|
+
```bash
|
|
19
|
+
npm install @editorcn/editor @tiptap/react @tiptap/pm @tiptap/starter-kit @tiptap/extension-link
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
> **Tiptap v3 required.** `@editorcn/editor` is built against Tiptap **v3**. Make sure your `@tiptap/*` packages are on v3, and import `BubbleMenu`/`FloatingMenu` from `@tiptap/react/menus` (not the `@tiptap/react` root) if you use them directly.
|
|
23
|
+
|
|
24
|
+
### shadcn registry
|
|
25
|
+
|
|
26
|
+
```bash
|
|
27
|
+
npx shadcn@latest add @editorcn/editor
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
Make sure your `components.json` includes the editorcn registry:
|
|
31
|
+
|
|
32
|
+
```json
|
|
33
|
+
{
|
|
34
|
+
"registries": {
|
|
35
|
+
"@editorcn": "https://editorcn.vercel.app/r/{name}.json"
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
## Usage
|
|
41
|
+
|
|
42
|
+
```tsx
|
|
43
|
+
"use client";
|
|
44
|
+
|
|
45
|
+
import { useEditor } from "@tiptap/react";
|
|
46
|
+
import { StarterKit } from "@tiptap/starter-kit";
|
|
47
|
+
import { Underline } from "@tiptap/extension-underline";
|
|
48
|
+
import { RichTextEditor, Link } from "@editorcn/editor";
|
|
49
|
+
import "@editorcn/editor/style.css";
|
|
50
|
+
|
|
51
|
+
export function MyEditor() {
|
|
52
|
+
const editor = useEditor({
|
|
53
|
+
extensions: [StarterKit, Link, Underline],
|
|
54
|
+
content: "<p>Start typing...</p>",
|
|
55
|
+
});
|
|
56
|
+
|
|
57
|
+
return (
|
|
58
|
+
<RichTextEditor editor={editor}>
|
|
59
|
+
<RichTextEditor.Toolbar sticky>
|
|
60
|
+
<RichTextEditor.ControlsGroup>
|
|
61
|
+
<RichTextEditor.Bold />
|
|
62
|
+
<RichTextEditor.Italic />
|
|
63
|
+
<RichTextEditor.Underline />
|
|
64
|
+
</RichTextEditor.ControlsGroup>
|
|
65
|
+
<RichTextEditor.ControlsGroup>
|
|
66
|
+
<RichTextEditor.H1 />
|
|
67
|
+
<RichTextEditor.H2 />
|
|
68
|
+
<RichTextEditor.H3 />
|
|
69
|
+
</RichTextEditor.ControlsGroup>
|
|
70
|
+
<RichTextEditor.ControlsGroup>
|
|
71
|
+
<RichTextEditor.Undo />
|
|
72
|
+
<RichTextEditor.Redo />
|
|
73
|
+
</RichTextEditor.ControlsGroup>
|
|
74
|
+
</RichTextEditor.Toolbar>
|
|
75
|
+
<RichTextEditor.Content />
|
|
76
|
+
</RichTextEditor>
|
|
77
|
+
);
|
|
78
|
+
}
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
## Documentation
|
|
82
|
+
|
|
83
|
+
Full API reference at [editorcn.vercel.app/docs/editor](https://editorcn.vercel.app/docs/editor).
|
|
84
|
+
|
|
85
|
+
## License
|
|
86
|
+
|
|
87
|
+
MIT
|