@lexical/history 0.2.0 → 0.2.1
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 +6 -4
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -18,11 +18,13 @@ function registerHistory(
|
|
|
18
18
|
|
|
19
19
|
### Commands
|
|
20
20
|
|
|
21
|
-
History package handles `
|
|
21
|
+
History package handles `UNDO_COMMAND`, `REDO_COMMAND` and `CLEAR_HISTORY_COMMAND` commands. It also triggers `CAN_UNDO_COMMAND` and `CAN_REDO_COMMAND` commands when history state is changed. These commands could be used to work with history state:
|
|
22
22
|
|
|
23
23
|
```jsx
|
|
24
|
+
import {UNDO_COMMAND, REDO_COMMAND} from 'lexical';
|
|
25
|
+
|
|
24
26
|
<Toolbar>
|
|
25
|
-
<Button onClick={() => editor.dispatchCommand(
|
|
26
|
-
<Button onClick={() => editor.dispatchCommand(
|
|
27
|
-
</Toolbar
|
|
27
|
+
<Button onClick={() => editor.dispatchCommand(UNDO_COMMAND)}>Undo</Button>
|
|
28
|
+
<Button onClick={() => editor.dispatchCommand(REDO_COMMAND)}>Redo</Button>
|
|
29
|
+
</Toolbar>;
|
|
28
30
|
```
|
package/package.json
CHANGED
|
@@ -8,13 +8,13 @@
|
|
|
8
8
|
"history"
|
|
9
9
|
],
|
|
10
10
|
"license": "MIT",
|
|
11
|
-
"version": "0.2.
|
|
11
|
+
"version": "0.2.1",
|
|
12
12
|
"main": "LexicalHistory.js",
|
|
13
13
|
"peerDependencies": {
|
|
14
|
-
"lexical": "0.2.
|
|
14
|
+
"lexical": "0.2.1"
|
|
15
15
|
},
|
|
16
16
|
"dependencies": {
|
|
17
|
-
"@lexical/utils": "0.2.
|
|
17
|
+
"@lexical/utils": "0.2.1"
|
|
18
18
|
},
|
|
19
19
|
"repository": {
|
|
20
20
|
"type": "git",
|