@lexion-rte/next 0.1.1 → 0.1.2

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/CHANGELOG.md CHANGED
@@ -1,5 +1,13 @@
1
1
  # @lexion-rte/next
2
2
 
3
+ ## 0.1.2
4
+
5
+ ### Patch Changes
6
+
7
+ - Refresh package metadata links and expand package-level README documentation.
8
+ - Updated dependencies
9
+ - @lexion-rte/react@0.1.2
10
+
3
11
  ## 0.1.1
4
12
 
5
13
  ### Patch Changes
package/README.md CHANGED
@@ -2,9 +2,11 @@
2
2
 
3
3
  Next.js adapter for Lexion.
4
4
 
5
- ## What It Is
5
+ ## Overview
6
6
 
7
- `@lexion-rte/next` exports `LexionNextEditorView`, a client component wrapper around the React adapter.
7
+ `@lexion-rte/next` exports `LexionNextEditorView`, which wraps the React adapter as a client component.
8
+
9
+ This package is ideal for Next App Router and can also be used in Pages Router client components.
8
10
 
9
11
  ## Install
10
12
 
@@ -12,7 +14,7 @@ Next.js adapter for Lexion.
12
14
  pnpm add @lexion-rte/next next react react-dom
13
15
  ```
14
16
 
15
- ## Usage
17
+ ## Basic Example
16
18
 
17
19
  ```tsx
18
20
  "use client";
@@ -24,3 +26,28 @@ export default function EditorPage() {
24
26
  }
25
27
  ```
26
28
 
29
+ ## Controlled Example
30
+
31
+ ```tsx
32
+ "use client";
33
+
34
+ import { useState } from "react";
35
+ import type { JSONDocument } from "@lexion-rte/core";
36
+ import { LexionNextEditorView } from "@lexion-rte/next";
37
+
38
+ export default function EditorPage() {
39
+ const [value, setValue] = useState<JSONDocument | undefined>(undefined);
40
+
41
+ return (
42
+ <LexionNextEditorView
43
+ value={value}
44
+ onChange={(nextValue) => setValue(nextValue)}
45
+ />
46
+ );
47
+ }
48
+ ```
49
+
50
+ ## Notes
51
+
52
+ - Keep `"use client"` at the top of files that render the component.
53
+ - Component props are the same as `@lexion-rte/react` `LexionEditorViewProps`.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lexion-rte/next",
3
- "version": "0.1.1",
3
+ "version": "0.1.2",
4
4
  "description": "Next.js adapter for the Lexion editor.",
5
5
  "private": false,
6
6
  "type": "module",
@@ -39,7 +39,7 @@
39
39
  "react-dom": "^18.2.0 || ^19.0.0"
40
40
  },
41
41
  "dependencies": {
42
- "@lexion-rte/react": "0.1.1"
42
+ "@lexion-rte/react": "0.1.2"
43
43
  },
44
44
  "scripts": {
45
45
  "build": "tsc -p tsconfig.json",