{"_id":"@chetjainn/wetext","_rev":"3-6e6235ad5d887c844d7c0ad394c699df","name":"@chetjainn/wetext","dist-tags":{"latest":"1.0.2"},"versions":{"1.0.0":{"name":"@chetjainn/wetext","version":"1.0.0","keywords":["editor","tiptap","react","rich-text","wysiwyg","react-text-editor","text-editor","rich-text-editor","wysiwyg-editor","react-wysiwyg-editor","react-rich-text-editor"],"author":{"name":"chetjainn"},"license":"MIT","_id":"@chetjainn/wetext@1.0.0","maintainers":[{"name":"chetjainn","email":"chet@wejain.com"}],"homepage":"https://github.com/Wejain/We-text","bugs":{"url":"https://github.com/Wejain/We-text/issues"},"dist":{"shasum":"152fa7ef8aff1d34cea9972bbcc6892e11371901","tarball":"https://registry.npmjs.org/@chetjainn/wetext/-/wetext-1.0.0.tgz","fileCount":10,"integrity":"sha512-ZDs0VfaL82zyt2J3oCof7BjsxOGhfmL0wAQjxDI5DND5GFpc9XmTu7upER2dN6VMRPq4U4+nWtymUCcvI3HUig==","signatures":[{"sig":"MEQCIF8WCywBVrEBzdRuf9hvt/j5M8dL/e8yFWVLjchkD3SXAiAr1L3kHeAsEOwx+wPF96U/o8LVfCiPiY2/IBNx9M2+dw==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":6193445},"main":"./dist/wetext.cjs","type":"module","types":"./dist/index.d.ts","module":"./dist/wetext.js","engines":{"node":">=20"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/wetext.js","require":"./dist/wetext.cjs"}},"gitHead":"5171f7ad1dbc9be1694bd2f8800b8ac0f220a6e9","private":false,"scripts":{"dev":"vite","lint":"eslint .","build":"tsc -b && vite build","preview":"vite preview","build:lib":"tsc -b && vite build --config vite.config.lib.ts","prepare:npm":"npm run build:lib && node scripts/prepare-npm.js"},"_npmUser":{"name":"chetjainn","email":"chet@wejain.com"},"repository":{"url":"git+https://github.com/Wejain/We-text.git","type":"git"},"_npmVersion":"10.8.2","description":"Rich text editor toolkit built with React and Tiptap","directories":{},"_nodeVersion":"20.19.1","dependencies":{"react":"^19.2.0","stripe":"^20.3.1","firebase":"^12.9.0","react-dom":"^19.2.0","@tiptap/pm":"^3.18.0","@tiptap/react":"^3.18.0","@floating-ui/dom":"^1.7.5","react-router-dom":"^7.13.0","@stripe/stripe-js":"^8.7.0","@tiptap/starter-kit":"^3.18.0","@tiptap/extension-link":"^3.18.0","@tiptap/extension-color":"^3.18.0","@tiptap/extension-image":"^3.18.0","@tiptap/extension-table":"^3.20.0","@tiptap/extension-youtube":"^3.18.0","@tiptap/extension-highlight":"^3.18.0","@tiptap/extension-subscript":"^3.20.0","@tiptap/extension-table-row":"^3.20.0","@tiptap/extension-underline":"^3.18.0","@tiptap/extension-table-cell":"^3.20.0","@tiptap/extension-text-align":"^3.18.0","@tiptap/extension-text-style":"^3.18.0","@tiptap/extension-font-family":"^3.20.0","@tiptap/extension-placeholder":"^3.18.0","@tiptap/extension-superscript":"^3.20.0","@tiptap/extension-table-header":"^3.20.0"},"_hasShrinkwrap":false,"devDependencies":{"vite":"^7.2.4","eslint":"^9.39.1","globals":"^16.5.0","@eslint/js":"^9.39.1","typescript":"~5.9.3","@types/node":"^24.10.1","@types/react":"^19.2.5","@types/react-dom":"^19.2.3","typescript-eslint":"^8.46.4","@vitejs/plugin-react":"^5.1.1","eslint-plugin-react-hooks":"^7.0.1","eslint-plugin-react-refresh":"^0.4.24"},"_npmOperationalInternal":{"tmp":"tmp/wetext_1.0.0_1778907266368_0.5014962021485956","host":"s3://npm-registry-packages-npm-production"}},"1.0.1":{"name":"@chetjainn/wetext","version":"1.0.1","keywords":["editor","tiptap","react","rich-text","wysiwyg","react-text-editor","text-editor","rich-text-editor","wysiwyg-editor","react-wysiwyg-editor","react-rich-text-editor"],"author":{"name":"chetjainn"},"license":"MIT","_id":"@chetjainn/wetext@1.0.1","maintainers":[{"name":"chetjainn","email":"chet@wejain.com"}],"homepage":"https://github.com/Wejain/We-text","bugs":{"url":"https://github.com/Wejain/We-text/issues"},"dist":{"shasum":"3900d370c093836a7bd508d6ae7685613343e8ba","tarball":"https://registry.npmjs.org/@chetjainn/wetext/-/wetext-1.0.1.tgz","fileCount":10,"integrity":"sha512-gKyoBwN4360GQh+CtpQyn270tPcH63eh0MCYCYvlMqh/JRALevUD/XQ5uK1CSMaHs/SkHGKVk0ldnZV9s7DyZQ==","signatures":[{"sig":"MEYCIQDIrKwSy6dQALxeVwDLHM2d8vcmSjgEfDXzhdwRh33iIgIhAJocQAAY3qhTWqvivSbB2X2axyKKShE3T6JMR7OA/8E1","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":6193545},"main":"./dist/wetext-editor.umd.js","type":"module","types":"./dist/types/index.d.ts","module":"./dist/wetext-editor.es.js","engines":{"node":">=20"},"exports":{".":{"types":"./dist/types/index.d.ts","import":"./dist/wetext-editor.es.js","require":"./dist/wetext-editor.umd.js"},"./style.css":"./dist/wetext-editor.css"},"gitHead":"dc233b155c8b2cea4258fa00361238cb414e95ab","private":false,"scripts":{"dev":"vite","lint":"eslint .","build":"tsc -b && vite build","preview":"vite preview","build:lib":"tsc -b && vite build --config vite.config.lib.ts","prepare:npm":"npm run build:lib && node scripts/prepare-npm.js"},"_npmUser":{"name":"chetjainn","email":"chet@wejain.com"},"repository":{"url":"git+https://github.com/Wejain/We-text.git","type":"git"},"_npmVersion":"10.8.2","description":"Rich text editor toolkit built with React and Tiptap","directories":{},"_nodeVersion":"20.19.1","dependencies":{"react":"^19.2.0","stripe":"^20.3.1","firebase":"^12.9.0","react-dom":"^19.2.0","@tiptap/pm":"^3.18.0","@tiptap/react":"^3.18.0","@floating-ui/dom":"^1.7.5","react-router-dom":"^7.13.0","@stripe/stripe-js":"^8.7.0","@tiptap/starter-kit":"^3.18.0","@tiptap/extension-link":"^3.18.0","@tiptap/extension-color":"^3.18.0","@tiptap/extension-image":"^3.18.0","@tiptap/extension-table":"^3.20.0","@tiptap/extension-youtube":"^3.18.0","@tiptap/extension-highlight":"^3.18.0","@tiptap/extension-subscript":"^3.20.0","@tiptap/extension-table-row":"^3.20.0","@tiptap/extension-underline":"^3.18.0","@tiptap/extension-table-cell":"^3.20.0","@tiptap/extension-text-align":"^3.18.0","@tiptap/extension-text-style":"^3.18.0","@tiptap/extension-font-family":"^3.20.0","@tiptap/extension-placeholder":"^3.18.0","@tiptap/extension-superscript":"^3.20.0","@tiptap/extension-table-header":"^3.20.0"},"_hasShrinkwrap":false,"devDependencies":{"vite":"^7.2.4","eslint":"^9.39.1","globals":"^16.5.0","@eslint/js":"^9.39.1","typescript":"~5.9.3","@types/node":"^24.10.1","@types/react":"^19.2.5","@types/react-dom":"^19.2.3","typescript-eslint":"^8.46.4","@vitejs/plugin-react":"^5.1.1","eslint-plugin-react-hooks":"^7.0.1","eslint-plugin-react-refresh":"^0.4.24"},"_npmOperationalInternal":{"tmp":"tmp/wetext_1.0.1_1778908604303_0.6580423333042642","host":"s3://npm-registry-packages-npm-production"}},"1.0.2":{"name":"@chetjainn/wetext","private":false,"version":"1.0.2","type":"module","description":"Rich text editor toolkit built with React and Tiptap","license":"MIT","author":{"name":"chetjainn"},"homepage":"https://github.com/Wejain/We-text","repository":{"type":"git","url":"git+https://github.com/Wejain/We-text.git"},"keywords":["editor","tiptap","react","rich-text","wysiwyg","react-text-editor","text-editor","rich-text-editor","wysiwyg-editor","react-wysiwyg-editor","react-rich-text-editor"],"main":"./dist/wetext-editor.umd.js","module":"./dist/wetext-editor.es.js","types":"./dist/types/index.d.ts","exports":{".":{"types":"./dist/types/index.d.ts","import":"./dist/wetext-editor.es.js","require":"./dist/wetext-editor.umd.js"},"./style.css":"./dist/wetext.css"},"engines":{"node":">=20"},"scripts":{"dev":"vite","build":"tsc -b && vite build","build:lib":"tsc -b && vite build --config vite.config.lib.ts","lint":"eslint .","preview":"vite preview","prepare:npm":"npm run build:lib && node scripts/prepare-npm.js"},"dependencies":{"@floating-ui/dom":"^1.7.5","@stripe/stripe-js":"^8.7.0","@tiptap/extension-color":"^3.18.0","@tiptap/extension-font-family":"^3.20.0","@tiptap/extension-highlight":"^3.18.0","@tiptap/extension-image":"^3.18.0","@tiptap/extension-link":"^3.18.0","@tiptap/extension-placeholder":"^3.18.0","@tiptap/extension-subscript":"^3.20.0","@tiptap/extension-superscript":"^3.20.0","@tiptap/extension-table":"^3.20.0","@tiptap/extension-table-cell":"^3.20.0","@tiptap/extension-table-header":"^3.20.0","@tiptap/extension-table-row":"^3.20.0","@tiptap/extension-text-align":"^3.18.0","@tiptap/extension-text-style":"^3.18.0","@tiptap/extension-underline":"^3.18.0","@tiptap/extension-youtube":"^3.18.0","@tiptap/pm":"^3.18.0","@tiptap/react":"^3.18.0","@tiptap/starter-kit":"^3.18.0","firebase":"^12.9.0","react":"^19.2.0","react-dom":"^19.2.0","react-router-dom":"^7.13.0","stripe":"^20.3.1"},"devDependencies":{"@eslint/js":"^9.39.1","@types/node":"^24.10.1","@types/react":"^19.2.5","@types/react-dom":"^19.2.3","@vitejs/plugin-react":"^5.1.1","eslint":"^9.39.1","eslint-plugin-react-hooks":"^7.0.1","eslint-plugin-react-refresh":"^0.4.24","globals":"^16.5.0","typescript":"~5.9.3","typescript-eslint":"^8.46.4","vite":"^7.2.4"},"_id":"@chetjainn/wetext@1.0.2","gitHead":"71ac7b659b9bc2f8190f33b19b16341dc2a5b24f","bugs":{"url":"https://github.com/Wejain/We-text/issues"},"_nodeVersion":"20.19.1","_npmVersion":"10.8.2","dist":{"integrity":"sha512-uGqnYyJJBmhOoNgusIBi13loxlLnqv2tV6tNGX8WUJCarg/IIxhflqrNtoQu1yx0d/pXP5clIu0Pt3fpCF835g==","shasum":"c3f1a6c116601ffb463cd0898b7bdfd016c781cc","tarball":"https://registry.npmjs.org/@chetjainn/wetext/-/wetext-1.0.2.tgz","fileCount":10,"unpackedSize":6193538,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIETjLab8zUpkzfpcs/ZAZNGZ7cCrn8YkflH+LBum3dq+AiEAwJl2tR9YVIralKlxqWcPSkNiAIGVH6dLLS/uz7jLnh4="}]},"_npmUser":{"name":"chetjainn","email":"chet@wejain.com"},"directories":{},"maintainers":[{"name":"chetjainn","email":"chet@wejain.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/wetext_1.0.2_1778909656725_0.3147892530553231"},"_hasShrinkwrap":false}},"time":{"created":"2026-05-16T04:54:26.293Z","modified":"2026-05-16T05:34:17.067Z","1.0.0":"2026-05-16T04:54:26.566Z","1.0.1":"2026-05-16T05:16:44.541Z","1.0.2":"2026-05-16T05:34:16.946Z"},"bugs":{"url":"https://github.com/Wejain/We-text/issues"},"author":{"name":"chetjainn"},"license":"MIT","homepage":"https://github.com/Wejain/We-text","keywords":["editor","tiptap","react","rich-text","wysiwyg","react-text-editor","text-editor","rich-text-editor","wysiwyg-editor","react-wysiwyg-editor","react-rich-text-editor"],"repository":{"type":"git","url":"git+https://github.com/Wejain/We-text.git"},"description":"Rich text editor toolkit built with React and Tiptap","maintainers":[{"name":"chetjainn","email":"chet@wejain.com"}],"readme":"# Universal Text Editor\r\n\r\nA production-ready, feature-rich text editor component built with React, TypeScript, and TipTap. Designed to be easily integrated into any application with comprehensive text formatting and video embedding support.\r\n\r\n## Features\r\n\r\n- **Rich Text Formatting** - Bold, italic, underline, strikethrough, highlight, and code\r\n- **Headings** - Support for H1-H6 headings\r\n- **Lists** - Bullet lists, numbered lists, and blockquotes\r\n- **Text Alignment** - Left, center, right, and justify\r\n- **Links** - Insert and edit hyperlinks with auto-detection\r\n- **Images** - Insert images via URL\r\n- **Video Embedding** - YouTube, Vimeo, and custom video files\r\n- **Colors** - Text color picker and highlighting\r\n- **History** - Full undo/redo support\r\n- **Error Handling** - Comprehensive error boundaries with recovery\r\n- **Accessibility** - ARIA labels and keyboard navigation\r\n- **Dark Mode** - Automatic dark mode support\r\n- **TypeScript** - Fully typed with exported type definitions\r\n- **Responsive** - Works on all screen sizes\r\n\r\n## Installation\r\n\r\n```bash\r\nnpm install\r\n```\r\n\r\n## Usage\r\n\r\n### Basic Usage\r\n\r\n```tsx\r\nimport { UniversalEditor, UniversalEditorRef } from './components/UniversalEditor';\r\n\r\nfunction MyComponent() {\r\n  const editorRef = useRef<UniversalEditorRef>(null);\r\n\r\n  return (\r\n    <UniversalEditor\r\n      ref={editorRef}\r\n      placeholder=\"Start typing...\"\r\n      minHeight=\"300px\"\r\n    />\r\n  );\r\n}\r\n```\r\n\r\n### With Event Handlers\r\n\r\n```tsx\r\nimport { UniversalEditor, EditorContent, EditorError } from './components/UniversalEditor';\r\n\r\nfunction MyComponent() {\r\n  const handleChange = (content: EditorContent) => {\r\n    console.log('HTML:', content.html);\r\n    console.log('Text:', content.text);\r\n    console.log('JSON:', content.json);\r\n  };\r\n\r\n  const handleError = (error: EditorError) => {\r\n    console.error('Editor error:', error.message);\r\n  };\r\n\r\n  return (\r\n    <UniversalEditor\r\n      placeholder=\"Write something amazing...\"\r\n      events={{\r\n        onChange: handleChange,\r\n        onError: handleError,\r\n        onVideoEmbed: (config) => console.log('Video embedded:', config),\r\n        onReady: (editor) => console.log('Editor ready!'),\r\n      }}\r\n    />\r\n  );\r\n}\r\n```\r\n\r\n### With Character Count\r\n\r\n```tsx\r\n<UniversalEditor\r\n  showCharacterCount\r\n  maxCharacters={5000}\r\n/>\r\n```\r\n\r\n### Custom Toolbar Configuration\r\n\r\n```tsx\r\n<UniversalEditor\r\n  toolbar={{\r\n    formatting: true,\r\n    headings: true,\r\n    lists: true,\r\n    alignment: true,\r\n    links: true,\r\n    images: true,\r\n    videos: true,\r\n    colors: true,\r\n    history: true,\r\n  }}\r\n/>\r\n```\r\n\r\n### Read-Only Mode\r\n\r\n```tsx\r\n<UniversalEditor\r\n  initialContent=\"<p>This content is read-only.</p>\"\r\n  readOnly\r\n  toolbar={false}\r\n/>\r\n```\r\n\r\n### Programmatic Control\r\n\r\n```tsx\r\nfunction MyComponent() {\r\n  const editorRef = useRef<UniversalEditorRef>(null);\r\n\r\n  const handleInsertVideo = () => {\r\n    editorRef.current?.insertVideo({\r\n      url: 'https://www.youtube.com/watch?v=dQw4w9WgXcQ',\r\n      source: 'youtube',\r\n      title: 'My Video',\r\n    });\r\n  };\r\n\r\n  const handleGetContent = () => {\r\n    const content = editorRef.current?.getContent();\r\n    console.log(content);\r\n  };\r\n\r\n  const handleClear = () => {\r\n    editorRef.current?.clear();\r\n  };\r\n\r\n  return (\r\n    <>\r\n      <UniversalEditor ref={editorRef} />\r\n      <button onClick={handleInsertVideo}>Insert Video</button>\r\n      <button onClick={handleGetContent}>Get Content</button>\r\n      <button onClick={handleClear}>Clear</button>\r\n    </>\r\n  );\r\n}\r\n```\r\n\r\n## API Reference\r\n\r\n### UniversalEditorProps\r\n\r\n| Prop | Type | Default | Description |\r\n|------|------|---------|-------------|\r\n| `initialContent` | `string \\| object` | `''` | Initial HTML or JSON content |\r\n| `placeholder` | `string` | `'Start typing...'` | Placeholder text |\r\n| `readOnly` | `boolean` | `false` | Make editor read-only |\r\n| `disabled` | `boolean` | `false` | Disable the editor |\r\n| `autoFocus` | `boolean` | `false` | Auto-focus on mount |\r\n| `minHeight` | `string \\| number` | `'200px'` | Minimum editor height |\r\n| `maxHeight` | `string \\| number` | - | Maximum editor height |\r\n| `toolbar` | `ToolbarConfig \\| false` | `{}` | Toolbar configuration |\r\n| `className` | `string` | `''` | Custom CSS class |\r\n| `style` | `CSSProperties` | `{}` | Custom inline styles |\r\n| `events` | `EditorEvents` | `{}` | Event handlers |\r\n| `showCharacterCount` | `boolean` | `false` | Show character count |\r\n| `maxCharacters` | `number` | - | Maximum character limit |\r\n| `allowedVideoSources` | `VideoSource[]` | `['youtube', 'vimeo', 'custom', 'upload']` | Allowed video sources |\r\n| `errorFallback` | `ReactNode \\| Function` | - | Custom error fallback |\r\n| `debounceDelay` | `number` | `300` | Debounce delay for onChange |\r\n\r\n### UniversalEditorRef Methods\r\n\r\n| Method | Description |\r\n|--------|-------------|\r\n| `getEditor()` | Get the TipTap editor instance |\r\n| `getContent()` | Get current content as `{ html, json, text }` |\r\n| `setContent(content)` | Set content programmatically |\r\n| `clear()` | Clear the editor |\r\n| `focus()` | Focus the editor |\r\n| `blur()` | Blur the editor |\r\n| `insertVideo(config)` | Insert a video |\r\n| `insertImage(url, alt)` | Insert an image |\r\n| `isEmpty()` | Check if editor is empty |\r\n| `getCharacterCount()` | Get character count |\r\n| `undo()` | Undo last action |\r\n| `redo()` | Redo last undone action |\r\n\r\n### EditorEvents\r\n\r\n| Event | Type | Description |\r\n|-------|------|-------------|\r\n| `onChange` | `(content: EditorContent) => void` | Content changed |\r\n| `onFocus` | `(editor: Editor) => void` | Editor focused |\r\n| `onBlur` | `(editor: Editor) => void` | Editor blurred |\r\n| `onSelectionChange` | `(editor: Editor) => void` | Selection changed |\r\n| `onVideoEmbed` | `(config: VideoEmbedConfig) => void` | Video embedded |\r\n| `onError` | `(error: EditorError) => void` | Error occurred |\r\n| `onReady` | `(editor: Editor) => void` | Editor initialized |\r\n\r\n### VideoEmbedConfig\r\n\r\n| Property | Type | Description |\r\n|----------|------|-------------|\r\n| `url` | `string` | Video URL |\r\n| `source` | `VideoSource` | Source type (youtube, vimeo, custom, upload) |\r\n| `width` | `string \\| number` | Width |\r\n| `height` | `string \\| number` | Height |\r\n| `autoplay` | `boolean` | Auto-play video |\r\n| `controls` | `boolean` | Show controls |\r\n| `loop` | `boolean` | Loop video |\r\n| `muted` | `boolean` | Mute video |\r\n| `start` | `number` | Start time in seconds |\r\n| `title` | `string` | Caption/title |\r\n\r\n## Development\r\n\r\n```bash\r\n# Install dependencies\r\nnpm install\r\n\r\n# Start development server\r\nnpm run dev\r\n\r\n# Build for production\r\nnpm run build\r\n\r\n# Preview production build\r\nnpm run preview\r\n\r\n# Type check\r\nnpm run type-check\r\n\r\n# Lint\r\nnpm run lint\r\n```\r\n\r\n## Project Structure\r\n\r\n```\r\nsrc/\r\n├── components/\r\n│   └── UniversalEditor/\r\n│       ├── index.ts              # Main exports\r\n│       ├── UniversalEditor.tsx   # Main component\r\n│       ├── EditorToolbar.tsx     # Toolbar component\r\n│       ├── VideoDialog.tsx       # Video embed dialog\r\n│       ├── extensions/\r\n│       │   └── VideoEmbed.ts     # Custom video extension\r\n│       ├── styles/\r\n│       │   └── editor.css        # Editor styles\r\n│       ├── types/\r\n│       │   └── index.ts          # TypeScript definitions\r\n│       └── utils/\r\n│           ├── errorBoundary.tsx # Error handling\r\n│           └── videoUtils.ts     # Video utilities\r\n├── App.tsx                       # Demo application\r\n├── App.css                       # Demo styles\r\n├── main.tsx                      # Entry point\r\n└── index.css                     # Global styles\r\n```\r\n\r\n## Browser Support\r\n\r\n- Chrome (latest)\r\n- Firefox (latest)\r\n- Safari (latest)\r\n- Edge (latest)\r\n\r\n## License\r\n\r\nMIT\r\n","readmeFilename":"README.md"}