* Add Prettier, with basic config and ESLint integration
* Apply Prettier to all files using `yarn lint --fix`
* Tell Prettier to ignore an empty text in a test output.
* Run Prettier on JS files not handled by ESLint, and lint them too
* fixed build for windows
* fixed issue where undo of merge node does not restore the node back to its original properties
* fixed lint issue
* updated operation docs for additional property on split_node and merge_node
* finished incomplete sentence in the docs.
* updated test to also verify data is restored
* renamed the 'original' property to 'properties' to be more consistent with similar operation interfaces, updated docs
* got rid of extra operations property.
* deserializing properties in merge_node and split_node, passing properties object in splitNodeByKey
* missed committing operations modles.
* updated operations.toJSON for new properties on merge_node and split_node
* fix linting error
* remove outdated comment.
* expanded check for split node inverse to include inline nodes
* partially revert update to test with deletion across inlines
* Implement first working rollup config for main slate pkg
* Convert slate-base64-serializer to rollup
* Convert slate-dev-logger to rollup
* Convert slate-html-serializer to rollup
* Convert slate-hyperscript to rollup
* Convert slate-plain-serializer to rollup
* Convert slate-prop-types to rollup
* Convert (mostly) slate-react to rollup
* Convert slate-simulator to rollup
* Misc cleanup and configuration tweaks/fixes
* Convert slate-schema-violations to rollup
* Successful rollup build for top-level examples
* Add plugin to replace process.env.NODE_ENV
* Only rebuild modules and dev examples in watch mode
* Enable sourcemaps for development builds
* Force debug to use browser version, remove builtins plugin
* Remove is-image from example
It relies on node `path` and wouldn't work well in-browser anyway
* Use browser version of react-dom/server
* Move stray require to import
* Configure examples to watch child package output
* Fix tests
* Remove unneeded preferBuiltins from resolve config
* Use more precise files array to ensure sourcemaps aren't included
* Use lodash instead of lodash.throttle
It's pulled in anyway since slate-react needs slate, so using the
minipackage actually causes code duplication
* Improve naming/fix UMD builds, update UMD doc
* Add rollup configs to linting, add a missing dep to package.json
* Use longform rollup CLI flags
* Add rollup-plugin-auto-external to reduce external module configuration
* Combine rollup config into a unioned helper
* Centralize to a single rollup configuration
* Update dist structure and package field naming for PR feedback
* Add comments and address PR feedback on rollup config
* i.e. -> e.g.
* Add some spacing to the configuration to improve readability
* Add a bit more spacing
* Remove umd from example Slate unpkg link
* fix range.moveToRangeOf when isBackward
* add test for unwrapBlock with backward selection
* Always return isBackward:false in moveToRangeOf
* Update range.js
* Account for zero-width whitespace chars when selecting with arrow keys
* Change the correct line 😳
* Remove unused const
* Fix lint error
* Proper fix for shift select towards void nodes
* Continue normalize next child when and only when the node exists still
* use the refindNode and refindPath provided
* Use Array.includes instead of Array.indexOf
* 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