Sometimes, I have nodes that only make sense temporarily, so it
doesn't make sense to serialize them. Following the pattern in React,
explicitly returning `null` from a serialzation rule should result in
that node (and its children) not making it into the serialized document.
Summary:
We mirrored the fix in PR #1278 (meant for #1277) but for drop event.
This fixed an issue I faced with Slate swallowing drop event, kind of breaking compatibility with react-dnd.
/cc @AlbertHilb
* add test for normalization of nested empty inlines
* fix normalization of nested empty inlines
* add test for normalization of inlines with empty void
* fix normalization of inlines containing empty void
* fix linting errors
* Fix node.isEmpty to work properly with void nodes of zero text length
* Take adavantage of fixed node.isEmpty to simplify normalization of empty inlines
* Fix linting errors
* Perhaps faster normalization: Never visit a descendant twice in normalizaton
* Change getFirstInvalidaDescendantKey to getFirstInvalidaDescendant
* Add from-JSON-big in benchmark
* Better annotation
* Remove un-used test change
* Fix skip this in getFurtherstLonelyAncestor
* export runTest in models/
* Change the path of test getOnlyChildAncestor
* Update index.js
* Update get-furthest-only-child.js
* Fix for linting
* add test for normalization of nested empty inlines
* fix normalization of nested empty inlines
* add test for normalization of inlines with empty void
* fix normalization of inlines containing empty void
* fix linting errors
* Remove memoization from node.getKeys
* Remove memoization from methods that are directly backed by AsArray variants
* Remove memoization from hasChild/Descendant/Node
These are thin wrappers on top of functions that are themselves
memoized.
When drag and dropping a node to a position earlier in the document,
the node is inserted and then removed right after.
Regenerate the key to make sure the old node is removed instead of the
new one.
* Fix triple selection extending to next block
* Remove unused startOffset
* Add Iscollapsed check to prevent failing setBlock on initial block position
* Fix across-blocks.js test
* Test new hanging selection behaviour
* Lint
* Revert e902fa1acbbcec94a82474b5fea86923c8f2c5ad
* Lint
* Use ternary operator instead of if/else
* 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