#### Is this adding or improving a _feature_ or fixing a _bug_?
Feature.
#### What's the new behavior?
This pull request adds paths to `Range` objects, including the selection. The paths and keys are kept in sync automatically, so that you can use whichever is ideal for your use case.
This should allow us to use paths for lots of the internal logic, which are much quicker to work with than keys since they avoid having to lookup the key in the document and can just traverse right to the node in question.
#### How does this change work?
`Range` objects have two new properties:
```js
range.anchorPath
range.focusPath
```
(Eventually these will be `range.anchor.path` and `range.focus.path` when points are introduced.)
When operations occur and whenever ranges are created/normalized, the paths are updated and kept in sync with the keys.
#### Have you checked that...?
<!--
Please run through this checklist for your pull request:
-->
* [x] The new code matches the existing patterns and styles.
* [x] The tests pass with `yarn test`.
* [x] The linter passes with `yarn lint`. (Fix errors with `yarn prettier`.)
* [x] The relevant examples still work. (Run examples with `yarn watch`.)
#### Does this fix any issues or need any specific reviewers?
Fixes: https://github.com/ianstormtaylor/slate/issues/1408
Fixes: https://github.com/ianstormtaylor/slate/issues/1567
When inserting a block, we shouldn't split void inlines -- otherwise,
they're duplicated. Instead, move the insert to either before or after
the void node.
* allow fromJSON to restore history
* allow History.toJSON to be passed operations in Arrays instead of Lists
(for example when they have been serialized and deserialized)
* tweak if condition to not make a new List from a List, waste of perf
* s/createList/createOperationsList/ in history.js
* Use slate rather than relative path
* Move benchmark to one dir
* Use slate-* instead of relative path
* Before and After Function
* Remove un-necessary cross-env
* Hard fix
* Lint the hard fix
* Reset memory in bench()
* Working on Benchmark Frameworks
* Rename to slate-dev-benchmark
* Add packages
* Fix prettier bug
* Benchmark framework is in working
* Do not log in test
* max times test
* mute logger in test
* add hr time
* Better support for maxTime; add support of split runs to save memory space
* Fix maxTries
* Add global.gc
* Global gc for each bench
* Better test interface
* Test max-time
* Test max-time done
* Add Benchmark among packages
* Starting to get benchmark running
* Pure Node lib
* Change babelrc for pure Node benchmark
* Moving Benchmarks
* Get benchmark and test running
* Get benchmark for slate-html-serializer
* add slate-react
* add slate/changes
* all benchmarks are converted
* Run benchmark by yarn
* Run benchmark with expose-gc
* Annotate Bench.js
* Do not bundle slate-dev-benchmark in rollup
* Add annotation
* Allow config file to enable part benchmark compare
* Add config for compare
* support compare.js
* Do not re-allocate memory; due to a large heap taken influence result
* Render with Decorations
* get active marks at range
* Fix bug in showing percents
* Fix percent showing bug
* chore: add more benches
* Better output of benchmark
* Fix linting
* decoration and normal as different benchmark test
* Fix deserialize benchmark
* README.md
* Fix Readme.md
* README.md
* block-spacing config
* safer user config loading
* use package.json to load package in test
* Consistent linting
* move components to parent directory
* Annotation styling in package
* margin line before multi-line block
* Fix naive bug
* Fix naive bug
* Fix a blank line
* only log user and hr
* Better name
* Better annotation for runBundleTasks
* Fix typo
* Better logger
* Move async to test
* Omit skip
* Only log the user space time
* Single line async sleep
* file name fix
* Fix annotation
* Better output of compare
* Remove get-characters(-at-range) benchmarks
* Restore emoji
* Capitalize types
* Remove compare to another area
* Add grep and config interface
* Linting files
* Linting benchmarks
* Linting benchmarks
* Update yarn.lock
* Initial fixes for IE compat of cloneFragment
* Used prettier to fix styling
* Removed solutions that can be polyfilled; added COMPAT comment
* Updated FAQ to reflect ideology towards IE
* Update faq.md
* Update faq.md
* Update faq.md
* Added failing test for #1463
* wip
* test passing
* cleaned up, more tests
* lint
* inside inlines working with marks
* lint
* working with leaves
* tidy
* lint issues
* lint - spacing
* using splitText
Right clicks aren't handled by onClick in a content-editable component. So we need access to a onContextMenu handler to handle these events properly.
My use case is to be able to open a context menu with actions when the user right-clicks a specific inline node.
There were three problems preventing drag-and-drop in IE:
* IE [doesn't consider contentEditables as inputs](https://developer.microsoft.com/en-us/microsoft-edge/platform/issues/913982/) when it comes to calling `onDrop`.
* Setting `dropEffect` causes an `unspecified error`.
* You can only get a cursor position from a point with `createTextRange` and `moveToPoint`. Also, `moveToPoint` raises an error if it's called during a dropEvent.
* Preparing tests
* splitNode replacement
* Remove slow splice; replace mergeNode
* normalize Leaves
* Partially remove characters
* Partially remove characters
* styling
* Fix bugs; almost all characters are replaced
* Fixes almost existing tests; preparing adding tests for text
* Remove un-necessary check
* Empty leaf
* fix characters in getMarks
* Faster fromJSON
* Some corner cases for empty text
* Fix naive bug
* Supporting empty text with marks
* Supporting empty text with marks in hyperscript
* changes tests for marks in empty text
* Support splitNode marks with empty text
* Add tests for splitNode->insert
* Faster removeText
* Add warning ; remove getMarksAtIndex cache
* Remove characters in getInsertMarkAtRange
* Adding tests
* Change names of tests
* Update marks test
* Add a test confirm for invalid offsets:
* Add test for get active marks between offsets
* Fix document
* Add testing for insert-text
* Better remove text
* More sensible marks in empty text
* Allow marks of empty text after deleting partially marked text
* Add test for removing on partially marked text
* chnage test structure
* Add test for removeText
* Add test for removeText
* Avoid conflict between empty marked text and cursor
* Simple style fixes
* Simple style fixes
* Line break fixes
* Line break fixes
* Annotate the createLeaves
* Line breaks in test
* Line breaks fix
* add add-marks test
* add merge test
* Fix version update
* Remove empty_leaf optimization; optimize of that will be other PRs
* Clean up getMarksAtPosition
* Fix get-insert-marks-at-range
* clean up get-marks-at-position
* Fix spaces
* initial simple decorations (mark-like), many tests added
* allow decorators to be set by focus, anchor tags - add tests
* handle one more edge case with decorations in hyperscript
* apply prettier cleanup
* apply linting rules
* update changelog
* ensure always normalize decoration ranges
* reapply prettier after latest adjustments
* all operations apply now update decorations with selection
* ranges can now be 'atomic', will invalidate if contents change
* lint, prettier cleanups
* add atomic invalidation tests, update hyperscript usage
* fix linter errors
* minor cleanup
* slight refactor for simplicity
* remove a couple superfluous lines
* update in response to review
* drop unnecessarily committed add'l file
* remove the need for explicit anchor, focus prop on decoration tags
* update hyperscript use to match latest syntax in #1777
* atomic -> isAtomic
* Fix issue with pasting in IE11
Fixing the issue where dataTransfer or clipboardData are not populated,
in IE 11 under event.NativeEvent. Instead, if we are using IE11, use
the base event object instead which contains a valid dataTrasnfer/clipboardData object.
* Run prettier on code changes
* add contentEditable=false to void block wrapper
* put contentEditable fals on inline void
fix from https://github.com/ianstormtaylor/slate/pull/1734 works for block but inline void have a cursor which shouldn’t be there as typing inside inline void won’t work. so only removing contentEditable on blocks but not inline
* update test