* change normalization can be set with setOperationFlag, and changes can be executed in sequence with automatic suppression with guaranteed document normalization at the end.
* responded to developer feedback by renaming execute to withMutations (to mirror immutable JS), implemented tests, updated documentation
* fixed typos discovered in review.
* fixed missing normalize flag usages and added withMutations to the schemas guide
* responded to developer feedback
* fixed lint errors and cleaned up code
* readd missing tests
* getFlag now allows options to override the change flags
* removed normalize restoration asserts from unit tests
* unit test cleanup
* added export constant enum for schema violations
* updated examples to use the schema violations enum
* use SchemaViolations enum in tests and docs
* fixed path for schema violations import
If selection is inside a block of text that's removed, the part of the
selection that's inside the bounds should clamp to the offset of the
removed text. So if your cursor is at offset 5, and you're deleting
from 2-10, your cursor should end up at offset 2.
* Fix iOS autocorrect issues with Backspace and Return
Handling Backspace and Return keystrokes in `onNativeBeforeInput`
ensures that iOS recognizes word and paragraph breaks and generates
appropriate autocorrect suggestions.
Fixes#1471
* Cleaner `onKeyDown` iOS check courtesy of @davidlibland
Propose to flush change immediately instead of delaying it using `setTimeout()`.
- Flushing change is only use for `props.onChange()` callback and invoked at the end of render lifecycle (didMount/didUpdate), can't find the rationale for delaying it.
- `setTimeout()` delay are not dependable for a predictive behaviour
- `onChange()` is an important callback for a controlled component, delaying it can cause race condition. e.g. any changes outside of the component lifecycle that happen between the delay of flushing change will be overridden
```
<IFrameComponent>
<SlateEditor {...props} />
</IFrameComponent>
```
Since react unmounts from top down, `IFrameComponent` will unmount first (destroying its window), then `SlateEditor` will unmount and attempt to access the iframe window (which no longer exists) throwing `Uncaught TypeError: Cannot read property 'document' of undefined`.
It should be safe to skip removing event listeners from windows that no longer exist since they will be garbage collected upon destruction of the window anyway
* Remove `value` from `operation.fromJSON`
Value is only used for local undo / redo, so it shouldn't be
serialized along with the rest of the data.
* Continue to parse a specified `value` into an Operation
* fix(at-range): forward deletion now stays with next block.
* fix(at-range): use select instead of moveToRangeOf
* Revert "fix(at-range): use select instead of moveToRangeOf"
This reverts commit 43bf33e29daeaa609bf92196df1b25de42c12d96.
* fix(at-range): moveOffsetsTo
* fix(at-range): change to change.moveToStartOf(nextBlock)
* fix(scroll-to-selection): use getClientRects when startContainer.length is 1
* fix(scroll-to-selection): rewrite and check if selectionRect.top/height still 0, use getClientRects
* fix(scroll-to-selection): identation whoopsie
* fix(scroll-to-selection): tabs !== spaces
* fix(scroll-to-selection): check for getClientRects length
* feat(scroll-to-selection): add IS_SAFARI check