@crashbytes/contentful-richtext-editor 1.0.5 → 1.0.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.
- package/README.md +10 -10
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -24,13 +24,13 @@ A modern, Tiptap-based rich text editor that's fully compatible with Contentful'
|
|
|
24
24
|
|
|
25
25
|
## Installation
|
|
26
26
|
|
|
27
|
-
```
|
|
27
|
+
```bash
|
|
28
28
|
npm install @crashbytes/contentful-richtext-editor
|
|
29
29
|
```
|
|
30
30
|
|
|
31
31
|
## Basic Usage
|
|
32
32
|
|
|
33
|
-
```
|
|
33
|
+
```jsx
|
|
34
34
|
import React, { useState } from 'react';
|
|
35
35
|
import { ContentfulRichTextEditor } from '@crashbytes/contentful-richtext-editor';
|
|
36
36
|
import '@crashbytes/contentful-richtext-editor/dist/index.css';
|
|
@@ -63,7 +63,7 @@ export default App;
|
|
|
63
63
|
|
|
64
64
|
### With Contentful Entry/Asset Embedding
|
|
65
65
|
|
|
66
|
-
```
|
|
66
|
+
```jsx
|
|
67
67
|
import { ContentfulRichTextEditor } from '@crashbytes/contentful-richtext-editor';
|
|
68
68
|
import '@crashbytes/contentful-richtext-editor/dist/index.css';
|
|
69
69
|
|
|
@@ -94,7 +94,7 @@ function ContentfulEditor() {
|
|
|
94
94
|
|
|
95
95
|
### Customizing Features
|
|
96
96
|
|
|
97
|
-
```
|
|
97
|
+
```jsx
|
|
98
98
|
<ContentfulRichTextEditor
|
|
99
99
|
placeholder="Simple editor..."
|
|
100
100
|
disabledFeatures={['table', 'embed', 'quote']}
|
|
@@ -106,7 +106,7 @@ function ContentfulEditor() {
|
|
|
106
106
|
|
|
107
107
|
### Controlling Available Headings and Formatting
|
|
108
108
|
|
|
109
|
-
```
|
|
109
|
+
```jsx
|
|
110
110
|
<ContentfulRichTextEditor
|
|
111
111
|
placeholder="Limited editor..."
|
|
112
112
|
availableHeadings={[1, 2, 3]} // Only H1, H2, H3
|
|
@@ -117,7 +117,7 @@ function ContentfulEditor() {
|
|
|
117
117
|
|
|
118
118
|
### With Initial Content
|
|
119
119
|
|
|
120
|
-
```
|
|
120
|
+
```jsx
|
|
121
121
|
import { createEmptyDocument } from '@crashbytes/contentful-richtext-editor';
|
|
122
122
|
|
|
123
123
|
const initialContent = {
|
|
@@ -179,7 +179,7 @@ You can disable specific features by passing them in the `disabledFeatures` arra
|
|
|
179
179
|
|
|
180
180
|
### Utility Functions
|
|
181
181
|
|
|
182
|
-
```
|
|
182
|
+
```jsx
|
|
183
183
|
import {
|
|
184
184
|
contentfulToTiptap,
|
|
185
185
|
tiptapToContentful,
|
|
@@ -202,7 +202,7 @@ const emptyDoc = createEmptyDocument();
|
|
|
202
202
|
|
|
203
203
|
The editor comes with default styles that match Contentful's design. Import the CSS:
|
|
204
204
|
|
|
205
|
-
```
|
|
205
|
+
```jsx
|
|
206
206
|
import '@crashbytes/contentful-richtext-editor/dist/index.css';
|
|
207
207
|
```
|
|
208
208
|
|
|
@@ -237,7 +237,7 @@ Standard rich text editor appearance with serif fonts.
|
|
|
237
237
|
|
|
238
238
|
## Integration with Next.js
|
|
239
239
|
|
|
240
|
-
```
|
|
240
|
+
```jsx
|
|
241
241
|
// pages/editor.tsx or app/editor/page.tsx
|
|
242
242
|
import dynamic from 'next/dynamic';
|
|
243
243
|
|
|
@@ -262,7 +262,7 @@ export default function EditorPage() {
|
|
|
262
262
|
|
|
263
263
|
This package is written in TypeScript and includes full type definitions. All Contentful rich text types are re-exported for convenience:
|
|
264
264
|
|
|
265
|
-
```
|
|
265
|
+
```tsx
|
|
266
266
|
import type {
|
|
267
267
|
Document,
|
|
268
268
|
Block,
|
package/package.json
CHANGED