nextgen-block-editor 0.0.0-stage → 0.2.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 +32 -2
- package/dist/index.cjs +7486 -0
- package/dist/index.d.cts +64 -0
- package/dist/index.d.ts +64 -0
- package/dist/index.js +7440 -0
- package/dist/styles.css +4614 -0
- package/package.json +69 -4
package/README.md
CHANGED
|
@@ -1,3 +1,33 @@
|
|
|
1
|
-
#
|
|
1
|
+
# nextgen-block-editor
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
A modular, block-based React + TypeScript rich text editor built on Editor.js with 20+ blocks including Bento grids, Image Carousels, Before/After comparison sliders, Lightbox galleries, Slide decks, Tabs, Accordions, Toggle headings, Pull-quotes, Timelines, Stats, Pros & Cons, Alerts, Badges, Tags, `@mention`, and more.
|
|
4
|
+
|
|
5
|
+
## Installation
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
npm install nextgen-block-editor
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## Usage
|
|
12
|
+
|
|
13
|
+
```tsx
|
|
14
|
+
import { useState } from 'react';
|
|
15
|
+
import { BlockEditor, BlockRenderer, type EditorJSData } from 'nextgen-block-editor';
|
|
16
|
+
import 'nextgen-block-editor/styles.css';
|
|
17
|
+
|
|
18
|
+
export function MyEditorPage() {
|
|
19
|
+
const [data, setData] = useState<EditorJSData>({ blocks: [] });
|
|
20
|
+
|
|
21
|
+
return (
|
|
22
|
+
<div>
|
|
23
|
+
<BlockEditor
|
|
24
|
+
initialData={data}
|
|
25
|
+
onChange={setData}
|
|
26
|
+
linkEndpoint="/api/fetchUrl"
|
|
27
|
+
gifEndpoint="/api/gifs"
|
|
28
|
+
/>
|
|
29
|
+
<BlockRenderer data={data} />
|
|
30
|
+
</div>
|
|
31
|
+
);
|
|
32
|
+
}
|
|
33
|
+
```
|