tiptap-editor-codeveda 0.1.5 → 0.1.6

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.
Files changed (2) hide show
  1. package/README.md +89 -0
  2. package/package.json +9 -4
package/README.md CHANGED
@@ -41,12 +41,58 @@ _Image and video upload functionality with Firebase integration_
41
41
  npm install tiptap-editor-codeveda
42
42
  ```
43
43
 
44
+ ## 🎨 CSS Import (Required)
45
+
46
+ **Important:** You must import the CSS styles for the editor to display correctly. Choose one of the following methods:
47
+
48
+ ### Method 1: Import from styles export (Recommended)
49
+
50
+ ```tsx
51
+ import {
52
+ TiptapEditor,
53
+ TiptapViewer,
54
+ useEditorContent,
55
+ } from "tiptap-editor-codeveda";
56
+ import "tiptap-editor-codeveda/styles"; // Import CSS styles
57
+ ```
58
+
59
+ ### Method 2: Import CSS directly from dist
60
+
61
+ ```tsx
62
+ import {
63
+ TiptapEditor,
64
+ TiptapViewer,
65
+ useEditorContent,
66
+ } from "tiptap-editor-codeveda";
67
+ import "tiptap-editor-codeveda/dist/tiptap-editor-codeveda.css"; // Import CSS directly
68
+ ```
69
+
70
+ ### Method 3: Import in your main CSS file
71
+
72
+ ```css
73
+ /* In your main CSS file (e.g., index.css, App.css) */
74
+ @import "tiptap-editor-codeveda/styles";
75
+ ```
76
+
77
+ ### Method 4: Import in HTML
78
+
79
+ ```html
80
+ <!-- In your index.html -->
81
+ <link
82
+ rel="stylesheet"
83
+ href="node_modules/tiptap-editor-codeveda/dist/tiptap-editor-codeveda.css"
84
+ />
85
+ ```
86
+
87
+ **Note:** Without importing the CSS, the editor will function but won't have proper styling for extensions like tables, code blocks, accordions, etc.
88
+
44
89
  ## 🔧 Basic Usage
45
90
 
46
91
  ### Simple Editor
47
92
 
48
93
  ```tsx
49
94
  import { TiptapEditor, useEditorContent } from "tiptap-editor-codeveda";
95
+ import "tiptap-editor-codeveda/styles"; // Don't forget to import CSS!
50
96
 
51
97
  function MyApp() {
52
98
  const { content, html, json, setContent } = useEditorContent();
@@ -69,6 +115,7 @@ function MyApp() {
69
115
 
70
116
  ```tsx
71
117
  import { TiptapEditor, useEditorContent } from "tiptap-editor-codeveda";
118
+ import "tiptap-editor-codeveda/styles"; // Don't forget to import CSS!
72
119
 
73
120
  function EditorWithUploads() {
74
121
  const { content, setContent } = useEditorContent();
@@ -115,6 +162,7 @@ function EditorWithUploads() {
115
162
 
116
163
  ```tsx
117
164
  import { TiptapViewer } from "tiptap-editor-codeveda";
165
+ import "tiptap-editor-codeveda/styles"; // Don't forget to import CSS!
118
166
 
119
167
  function ContentViewer({ htmlContent }: { htmlContent: string }) {
120
168
  return (
@@ -286,6 +334,47 @@ Contributions are welcome! Please feel free to submit a Pull Request.
286
334
 
287
335
  MIT License - feel free to use this in your projects.
288
336
 
337
+ ## 🔧 Troubleshooting
338
+
339
+ ### Styles Not Working
340
+
341
+ If the editor appears unstyled or extensions don't look correct:
342
+
343
+ 1. **Make sure you've imported the CSS:**
344
+
345
+ ```tsx
346
+ import "tiptap-editor-codeveda/styles";
347
+ ```
348
+
349
+ 2. **Check your build configuration** - ensure CSS files are being processed by your bundler
350
+
351
+ 3. **Verify the CSS file exists** in `node_modules/tiptap-editor-codeveda/dist/tiptap-editor-codeveda.css`
352
+
353
+ 4. **Try importing CSS directly:**
354
+ ```tsx
355
+ import "tiptap-editor-codeveda/dist/tiptap-editor-codeveda.css";
356
+ ```
357
+
358
+ ### TypeScript Errors
359
+
360
+ If you get TypeScript errors about missing module declarations:
361
+
362
+ 1. **Update to the latest version** of the package
363
+ 2. **Restart your TypeScript server** in your IDE
364
+ 3. **Clear your node_modules** and reinstall:
365
+ ```bash
366
+ rm -rf node_modules package-lock.json
367
+ npm install
368
+ ```
369
+
370
+ ### Build Issues
371
+
372
+ If you encounter build issues:
373
+
374
+ 1. **Check your bundler configuration** supports CSS imports
375
+ 2. **Ensure you're using a modern bundler** (Vite, Webpack 5+, Parcel, etc.)
376
+ 3. **Try the HTML import method** as a fallback
377
+
289
378
  ## 🐛 Issues
290
379
 
291
380
  If you encounter any issues, please report them on the GitHub repository.
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "tiptap-editor-codeveda",
3
3
  "private": false,
4
- "version": "0.1.5",
4
+ "version": "0.1.6",
5
5
  "type": "module",
6
6
  "description": "A powerful, feature-rich WYSIWYG editor built with Tiptap, React, and TypeScript",
7
7
  "keywords": [
@@ -19,7 +19,7 @@
19
19
  "license": "MIT",
20
20
  "repository": {
21
21
  "type": "git",
22
- "url": "https://github.com/bhaskardas090/tiptap-editor-codeveda"
22
+ "url": "git+https://github.com/bhaskardas090/tiptap-editor-codeveda.git"
23
23
  },
24
24
  "homepage": "https://github.com/bhaskardas090/tiptap-editor-codeveda",
25
25
  "bugs": {
@@ -27,6 +27,7 @@
27
27
  },
28
28
  "scripts": {
29
29
  "dev": "vite",
30
+ "start": "vite",
30
31
  "build": "tsc -b && vite build",
31
32
  "lint": "eslint .",
32
33
  "preview": "vite preview"
@@ -45,7 +46,10 @@
45
46
  "import": "./dist/tiptap-editor-codeveda.es.js",
46
47
  "require": "./dist/tiptap-editor-codeveda.umd.js"
47
48
  },
48
- "./styles": "./dist/tiptap-editor-codeveda.css"
49
+ "./styles": {
50
+ "types": "./dist/styles.d.ts",
51
+ "default": "./dist/tiptap-editor-codeveda.css"
52
+ }
49
53
  },
50
54
  "dependencies": {
51
55
  "@floating-ui/react": "^0.27.16",
@@ -77,7 +81,8 @@
77
81
  "react-dom": "^19.1.1",
78
82
  "react-tabs": "^6.1.0",
79
83
  "tailwind-merge": "^3.3.1",
80
- "tailwindcss": "^4.1.12"
84
+ "tailwindcss": "^4.1.12",
85
+ "tiptap-editor-codeveda": "^0.1.5"
81
86
  },
82
87
  "devDependencies": {
83
88
  "@eslint/js": "^9.33.0",