Commit 382ffa6
SD-1695 - add flag for text selection in viewing mode (#1891)
* chore(release): 1.9.0-next.7 [skip ci]
* **export:** prefix Relationship IDs with rId for valid xsd:ID ([#1855](#1855)) ([11e67e1](11e67e1))
* feat(editor): add flag for text selection in viewing mode
* fix(super-editor): expand keyboard allowlist and block IME in selection-only view mode (SD-1695)
- Allow navigation keys (arrows, Home/End, PageUp/PageDown), Cmd+A, and
Shift+Arrow in addition to Cmd+C for keyboard accessibility
- Block composition events (compositionstart/update/end) to prevent IME
input from mutating the document when view.editable is true due to
allowSelectionInViewMode
- Add unit tests for keyboard allowlist and composition blocking
* fix(superdoc): fix RAF callback missing selection guard and clean up editable extension (SD-1695)
- Fix missed allowSelectionInViewMode guard in RAF callback that was
clearing selection on the next animation frame, defeating the feature
- Extract isFullyBlocked() and blockWhenNotEditable() helpers to
deduplicate guard logic in editable.js
- Hoist navigation keys to module-level NAVIGATION_KEYS Set
- Collapse composition event tests into it.each
* test(behavior): add behavior tests for selection in viewing mode (SD-1695)
- Add allowSelectionInViewMode and documentMode params to behavior
test harness and fixture config
- Add behavior tests verifying: mouse click + keyboard navigation,
Shift+Arrow selection extending, Select All, typing/paste/delete
blocked, and selection cleared without the flag
* feat(editor): add flag for text selection in viewing mode - addressed review
* fix(test): adjust behavior tests for PresentationEditor keyboard limitations (SD-1695)
Keyboard selection extending (Shift+Arrow, Cmd+A) doesn't work in
PresentationEditor mode because view.editable is false and PM's
editHandlers.keydown doesn't run. Replace those tests with
triple-click selection (mouse-based) which works correctly.
* fix(super-editor): expand keyboard allowlist and block IME in selection-only view mode (SD-1695)
- Allow navigation keys (arrows, Home/End, PageUp/PageDown), Cmd+A, and
Shift+Arrow in addition to Cmd+C for keyboard accessibility
- Block composition events (compositionstart/update/end) to prevent IME
input from mutating the document when view.editable is true due to
allowSelectionInViewMode
- Add unit tests for keyboard allowlist and composition blocking
* fix(superdoc): fix RAF callback missing selection guard and clean up editable extension (SD-1695)
- Fix missed allowSelectionInViewMode guard in RAF callback that was
clearing selection on the next animation frame, defeating the feature
- Extract isFullyBlocked() and blockWhenNotEditable() helpers to
deduplicate guard logic in editable.js
- Hoist navigation keys to module-level NAVIGATION_KEYS Set
- Collapse composition event tests into it.each
* test(behavior): add behavior tests for selection in viewing mode (SD-1695)
- Add allowSelectionInViewMode and documentMode params to behavior
test harness and fixture config
- Add behavior tests verifying: mouse click + keyboard navigation,
Shift+Arrow selection extending, Select All, typing/paste/delete
blocked, and selection cleared without the flag
* fix(test): adjust behavior tests for PresentationEditor keyboard limitations (SD-1695)
Keyboard selection extending (Shift+Arrow, Cmd+A) doesn't work in
PresentationEditor mode because view.editable is false and PM's
editHandlers.keydown doesn't run. Replace those tests with
triple-click selection (mouse-based) which works correctly.
* fix(test): use someProp to test handleKeyDown directly
---------
Co-authored-by: semantic-release-bot <semantic-release-bot@martynus.net>
Co-authored-by: Nick Bernal <nick@superdoc.dev>
Co-authored-by: Caio Pizzol <caio@harbourshare.com>1 parent 9714ffb commit 382ffa6
15 files changed
Lines changed: 618 additions & 18 deletions
File tree
- packages
- super-editor/src
- assets/styles/elements
- core
- extensions
- presentation-editor
- types
- superdoc
- src
- core
- dev/components
- tests/behavior
- fixtures
- harness
- tests/selection
Lines changed: 14 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
82 | 82 | | |
83 | 83 | | |
84 | 84 | | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
85 | 99 | | |
86 | 100 | | |
87 | 101 | | |
| |||
Lines changed: 241 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
27 | 27 | | |
28 | 28 | | |
29 | 29 | | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
30 | 41 | | |
31 | 42 | | |
32 | 43 | | |
33 | 44 | | |
34 | 45 | | |
35 | | - | |
36 | | - | |
37 | | - | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
38 | 49 | | |
39 | 50 | | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
40 | 59 | | |
41 | 60 | | |
42 | 61 | | |
43 | 62 | | |
44 | 63 | | |
45 | 64 | | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
46 | 78 | | |
47 | 79 | | |
48 | 80 | | |
| |||
62 | 94 | | |
63 | 95 | | |
64 | 96 | | |
65 | | - | |
| 97 | + | |
66 | 98 | | |
67 | 99 | | |
68 | 100 | | |
69 | 101 | | |
70 | 102 | | |
71 | 103 | | |
72 | | - | |
| 104 | + | |
73 | 105 | | |
74 | 106 | | |
75 | 107 | | |
76 | 108 | | |
77 | 109 | | |
78 | 110 | | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
79 | 133 | | |
80 | | - | |
81 | | - | |
82 | | - | |
83 | | - | |
84 | 134 | | |
85 | 135 | | |
86 | 136 | | |
| |||
0 commit comments