raydit-editor 0.0.15 → 0.0.16
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 +8 -55
- package/package.json +1 -1
- package/dist/index.css +0 -1
package/README.md
CHANGED
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
# @
|
|
1
|
+
# @raydit-editor
|
|
2
2
|
|
|
3
|
-
A powerful
|
|
3
|
+
A powerful rich text editor built with TipTap and React.
|
|
4
4
|
|
|
5
5
|
## Installation
|
|
6
6
|
|
|
7
7
|
\`\`\`bash
|
|
8
|
-
npm install @
|
|
8
|
+
npm install @raydit-editor
|
|
9
9
|
|
|
10
10
|
# or
|
|
11
11
|
|
|
12
|
-
yarn add @
|
|
12
|
+
yarn add @raydit-editor
|
|
13
13
|
|
|
14
14
|
# or
|
|
15
15
|
|
|
16
|
-
pnpm add @
|
|
16
|
+
pnpm add @raydit-editor
|
|
17
17
|
\`\`\`
|
|
18
18
|
|
|
19
19
|
**Note:** This package requires Tailwind CSS to be set up in your project.
|
|
@@ -21,13 +21,14 @@ pnpm add @omnics/notion-editor
|
|
|
21
21
|
## Usage
|
|
22
22
|
|
|
23
23
|
\`\`\`tsx
|
|
24
|
-
import {
|
|
24
|
+
import { RayditEditor } from '@raydit-editor';
|
|
25
|
+
import "RayditEditor/dist/index.css";
|
|
25
26
|
|
|
26
27
|
function App() {
|
|
27
28
|
const [content, setContent] = useState('');
|
|
28
29
|
|
|
29
30
|
return (
|
|
30
|
-
<
|
|
31
|
+
<RayditEditor
|
|
31
32
|
content={content}
|
|
32
33
|
onChange={(html) => setContent(html)}
|
|
33
34
|
onBlur={(html) => console.log('Saved:', html)}
|
|
@@ -56,17 +57,6 @@ autoFocus
|
|
|
56
57
|
|
|
57
58
|
This package uses Tailwind CSS. Make sure your Tailwind config includes:
|
|
58
59
|
|
|
59
|
-
\`\`\`js
|
|
60
|
-
// tailwind.config.js
|
|
61
|
-
module.exports = {
|
|
62
|
-
content: [
|
|
63
|
-
'./node_modules/@yourorg/notion-editor/dist/**/*.{js,jsx}',
|
|
64
|
-
// ... your other paths
|
|
65
|
-
],
|
|
66
|
-
// ... rest of config
|
|
67
|
-
}
|
|
68
|
-
\`\`\`
|
|
69
|
-
|
|
70
60
|
## License
|
|
71
61
|
|
|
72
62
|
MIT
|
|
@@ -92,25 +82,6 @@ You need to decide how to handle styles:
|
|
|
92
82
|
- **Option B:** Require users to have Tailwind (current approach)
|
|
93
83
|
- **Option C:** Provide vanilla CSS alternative
|
|
94
84
|
|
|
95
|
-
### 2. Missing Components
|
|
96
|
-
|
|
97
|
-
You need to create/fix these files:
|
|
98
|
-
|
|
99
|
-
- `SlashExtension.ts`
|
|
100
|
-
- `SelectionToolbar.tsx`
|
|
101
|
-
- `RowAddButton.tsx`
|
|
102
|
-
- `ColumnAddButton.tsx`
|
|
103
|
-
- `useRowHover.ts`
|
|
104
|
-
- `useColumnHover.ts`
|
|
105
|
-
|
|
106
|
-
### 3. Testing
|
|
107
|
-
|
|
108
|
-
Add tests before publishing:
|
|
109
|
-
|
|
110
|
-
```bash
|
|
111
|
-
npm install --save-dev @testing-library/react @testing-library/jest-dom vitest
|
|
112
|
-
```
|
|
113
|
-
|
|
114
85
|
### 4. Publishing Checklist
|
|
115
86
|
|
|
116
87
|
- [ ] All TypeScript errors resolved
|
|
@@ -120,21 +91,3 @@ npm install --save-dev @testing-library/react @testing-library/jest-dom vitest
|
|
|
120
91
|
- [ ] Version number set correctly
|
|
121
92
|
- [ ] Test in a separate project before publishing
|
|
122
93
|
- [ ] Set up npm account and organization
|
|
123
|
-
|
|
124
|
-
## 🚀 Publishing Steps
|
|
125
|
-
|
|
126
|
-
```bash
|
|
127
|
-
# Build the package
|
|
128
|
-
npm run build
|
|
129
|
-
|
|
130
|
-
# Test locally first
|
|
131
|
-
npm link
|
|
132
|
-
cd /path/to/test-project
|
|
133
|
-
npm link @yourorg/notion-editor
|
|
134
|
-
|
|
135
|
-
# When ready to publish
|
|
136
|
-
npm login
|
|
137
|
-
npm publish --access public
|
|
138
|
-
```
|
|
139
|
-
|
|
140
|
-
Your code is definitely usable as a package foundation, but needs these structural improvements to be production-ready!
|
package/package.json
CHANGED
package/dist/index.css
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
.ProseMirror{outline:none;min-height:300px;line-height:1.6;font-size:16px}.ProseMirror p{margin:.4rem 0}.ProseMirror h1{font-size:1.875rem;font-weight:700;margin:1.2rem 0 .6rem}.ProseMirror h2{font-size:1.5rem;font-weight:600;margin:1rem 0 .5rem}.ProseMirror h3{font-size:1.25rem;font-weight:600;margin:.8rem 0 .4rem}.ProseMirror ul{list-style-type:disc;padding-left:1.5rem}.ProseMirror ol{list-style-type:decimal;padding-left:1.5rem}.ProseMirror li{margin:.25rem 0}.ProseMirror ul[data-type=taskList]{list-style:none;padding-left:0}.ProseMirror li[data-type=taskItem]{display:flex;align-items:flex-start}.ProseMirror li[data-type=taskItem]>label{margin-right:.5rem}.ProseMirror blockquote{border-left:4px solid #e5e7eb;padding-left:1rem;color:#4b5563;margin:.75rem 0}.ProseMirror code{background-color:#f3f4f6;padding:.15rem .3rem;border-radius:4px;font-size:.875rem}.ProseMirror pre{background:#0f172a;color:#e5e7eb;padding:1rem;border-radius:8px;overflow-x:auto;margin:.75rem 0}.ProseMirror pre code{background:none;padding:0;color:inherit}.ProseMirror table{border-collapse:collapse;width:100%;table-layout:fixed;margin:.75rem 0}.ProseMirror th,.ProseMirror td{border:1px solid #e5e7eb;padding:.5rem;vertical-align:top}.ProseMirror th{background-color:#f9fafb;font-weight:600}.ProseMirror td p,.ProseMirror th p{margin:0}.ProseMirror .column-resize-handle{position:absolute;right:-2px;top:0;bottom:0;width:4px;background-color:#3b82f6;pointer-events:none}.ProseMirror.resize-cursor{cursor:col-resize}.ProseMirror hr{border:none;border-top:1px solid #e5e7eb;margin:1.5rem 0}.mention{background-color:#eef2ff;color:#4338ca;padding:.1rem .4rem;border-radius:.375rem;font-weight:500}.ProseMirror a{color:#2563eb;text-decoration:underline}.ProseMirror img{max-width:100%;border-radius:8px;margin:.75rem 0}.ProseMirror ::selection{background:#c7d2fe}.ProseMirror table{border-collapse:collapse;width:100%;table-layout:fixed;margin:1rem 0}.ProseMirror th,.ProseMirror td{border:1px solid #e5e7eb;padding:8px;vertical-align:top;position:relative}.ProseMirror th{background-color:#f9fafb;font-weight:600}.ProseMirror .selectedCell{background:rgba(59,130,246,.08)}.ProseMirror .column-resize-handle{position:absolute;right:-2px;top:0;bottom:0;width:4px;background-color:#3b82f6;pointer-events:none}.ProseMirror table p{margin:0}.table-menu button{padding:4px 8px;border-radius:4px;font-size:12px}.table-menu button:hover{background:#f3f4f6}.ProseMirror ol{list-style-type:decimal;padding-left:1.5rem}.ProseMirror ol ol{list-style-type:lower-alpha}.ProseMirror ol ol ol{list-style-type:lower-roman}.ProseMirror ol ol ol ol{list-style-type:decimal}.ProseMirror li{margin:.25rem 0}.ProseMirror li>ol,.ProseMirror li>ul{margin-top:.25rem}.ProseMirror p{position:relative}.ProseMirror p.is-empty::before{content:attr(data-placeholder);color:#9ca3af;pointer-events:none;position:absolute;left:0;top:0;font-style:italic}.ProseMirror:not(.ProseMirror-focused) p.is-empty::before{content:""}.mention{color:#2563eb;background-color:#e0e7ff;padding:2px 6px;border-radius:6px;font-weight:500}.mention{color:#2563eb;cursor:pointer;border-radius:4px;padding:0 2px}.mention:hover{background:#eff6ff}.tiptap p.is-empty::before,.tiptap h1.is-empty::before,.tiptap h2.is-empty::before,.tiptap h3.is-empty::before{content:attr(data-placeholder);float:left;color:#9ca3af;pointer-events:none;height:0}.tiptap h1{border-left:3px solid rgba(0,0,0,0);padding-left:8px}.tiptap h1.is-active{border-left-color:#6366f1}.tiptap .is-empty::before{content:attr(data-placeholder);color:#9ca3af;float:left;pointer-events:none;height:0}.tiptap li.is-empty::before{position:absolute}ul[data-type=taskList]{list-style:none;padding-left:0}ul[data-type=taskList] li{display:flex;align-items:flex-start;gap:.5rem}ul[data-type=taskList] li>label{flex-shrink:0;margin-top:.55rem;user-select:none}ul[data-type=taskList] li>label input[type=checkbox]{cursor:pointer;width:1rem;height:1rem}ul[data-type=taskList] li>div{flex:1}ul[data-type=taskList] ul[data-type=taskList]{margin:.5rem 0 0 1.5rem}
|