@editorcn/editor 0.1.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.
package/README.md ADDED
@@ -0,0 +1,85 @@
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
+ ### shadcn registry
23
+
24
+ ```bash
25
+ npx shadcn@latest add @editorcn/editor
26
+ ```
27
+
28
+ Make sure your `components.json` includes the editorcn registry:
29
+
30
+ ```json
31
+ {
32
+ "registries": {
33
+ "@editorcn": "https://editorcn.vercel.app/r/{name}.json"
34
+ }
35
+ }
36
+ ```
37
+
38
+ ## Usage
39
+
40
+ ```tsx
41
+ "use client";
42
+
43
+ import { useEditor } from "@tiptap/react";
44
+ import StarterKit from "@tiptap/starter-kit";
45
+ import Underline from "@tiptap/extension-underline";
46
+ import { RichTextEditor, Link } from "@editorcn/editor";
47
+ import "@editorcn/editor/style.css";
48
+
49
+ export function MyEditor() {
50
+ const editor = useEditor({
51
+ extensions: [StarterKit, Link, Underline],
52
+ content: "<p>Start typing...</p>",
53
+ });
54
+
55
+ return (
56
+ <RichTextEditor editor={editor}>
57
+ <RichTextEditor.Toolbar sticky>
58
+ <RichTextEditor.ControlsGroup>
59
+ <RichTextEditor.Bold />
60
+ <RichTextEditor.Italic />
61
+ <RichTextEditor.Underline />
62
+ </RichTextEditor.ControlsGroup>
63
+ <RichTextEditor.ControlsGroup>
64
+ <RichTextEditor.H1 />
65
+ <RichTextEditor.H2 />
66
+ <RichTextEditor.H3 />
67
+ </RichTextEditor.ControlsGroup>
68
+ <RichTextEditor.ControlsGroup>
69
+ <RichTextEditor.Undo />
70
+ <RichTextEditor.Redo />
71
+ </RichTextEditor.ControlsGroup>
72
+ </RichTextEditor.Toolbar>
73
+ <RichTextEditor.Content />
74
+ </RichTextEditor>
75
+ );
76
+ }
77
+ ```
78
+
79
+ ## Documentation
80
+
81
+ Full API reference at [editorcn.vercel.app/docs/editor](https://editorcn.vercel.app/docs/editor).
82
+
83
+ ## License
84
+
85
+ MIT