Commit 59c95f8
Add undo/redo support to editable CodeBlock (#3288)
* Add undo/redo support to editable CodeBlock
Enable CodeMirror's history() extension so existing historyKeymap
keybindings (Cmd+Z / Cmd+Shift+Z) actually work. Annotate
programmatic content replacements with addToHistory: false to keep
prop syncs and blur reformats out of the undo stack.
* Load history() in dynamicExtensions only if code block is editable
* Remove duplicate onblur
---------
Co-authored-by: Laura Whitaker <laura.whitaker@temporal.io>1 parent dce87ac commit 59c95f8
1 file changed
Lines changed: 9 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
5 | | - | |
| 5 | + | |
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
| |||
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
14 | | - | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
15 | 20 | | |
16 | 21 | | |
17 | 22 | | |
| |||
116 | 121 | | |
117 | 122 | | |
118 | 123 | | |
| 124 | + | |
119 | 125 | | |
120 | 126 | | |
121 | 127 | | |
| |||
156 | 162 | | |
157 | 163 | | |
158 | 164 | | |
| 165 | + | |
159 | 166 | | |
160 | 167 | | |
161 | 168 | | |
| |||
285 | 292 | | |
286 | 293 | | |
287 | 294 | | |
288 | | - | |
289 | 295 | | |
290 | 296 | | |
291 | 297 | | |
| |||
0 commit comments