* Convert Non-strict to strict equality checking
Convert non-strict equality checking, using `==`, to the strict version, using `===`.
* Convert Non-strict to strict equality checking
Convert non-strict equality checking, using `==`, to the strict version, using `===`.
* Convert Non-strict to strict equality checking
Convert non-strict equality checking, using `==`, to the strict version, using `===`.
* Convert Non-strict to strict equality checking
Convert non-strict equality checking, using `==`, to the strict version, using `===`.
* Convert Non-strict to strict equality checking
Convert non-strict equality checking, using `==`, to the strict version, using `===`.
* Convert Non-strict to strict equality checking
Convert non-strict equality checking, using `==`, to the strict version, using `===`.
* Convert Non-strict to strict equality checking
Convert non-strict equality checking, using `==`, to the strict version, using `===`.
* Convert Non-strict to strict equality checking
Convert non-strict equality checking, using `==`, to the strict version, using `===`.
* Convert Non-strict to strict equality checking
Convert non-strict equality checking, using `==`, to the strict version, using `===`.
* Convert Non-strict to strict equality checking
Convert non-strict equality checking, using `==`, to the strict version, using `===`.
* Convert Non-strict to strict equality checking
Convert non-strict equality checking, using `==`, to the strict version, using `===`.
* Convert Non-strict to strict equality checking
Convert non-strict equality checking, using `==`, to the strict version, using `===`.
* Convert Non-strict to strict equality checking
Convert non-strict equality checking, using `==`, to the strict version, using `===`.
* Convert Non-strict to strict equality checking
Convert non-strict equality checking, using `==`, to the strict version, using `===`.
* Convert Non-strict to strict equality checking
Convert non-strict equality checking, using `==`, to the strict version, using `===`.
* Convert Non-strict to strict equality checking
Convert non-strict equality checking, using `==`, to the strict version, using `===`.
* Convert Non-strict to strict equality checking
Convert non-strict equality checking, using `==`, to the strict version, using `===`.
* Convert Non-strict to strict equality checking
Convert non-strict equality checking, using `==`, to the strict version, using `===`.
* Convert Non-strict to strict equality checking
Convert non-strict equality checking, using `==`, to the strict version, using `===`.
* Convert Non-strict to strict equality checking
Convert non-strict equality checking, using `==`, to the strict version, using `===`.
* Convert Non-strict to strict equality checking
Convert non-strict equality checking, using `==`, to the strict version, using `===`.
* Convert Non-strict to strict equality checking
Convert non-strict equality checking, using `==`, to the strict version, using `===`.
* Convert Non-strict to strict equality checking
Convert non-strict equality checking, using `==`, to the strict version, using `===`.
* Convert Non-strict to strict equality checking
Convert non-strict equality checking, using `==`, to the strict version, using `===`.
* Convert Non-strict to strict equality checking
Convert non-strict equality checking, using `==`, to the strict version, using `===`.
* Convert Non-strict to strict equality checking
Convert non-strict equality checking, using `==`, to the strict version, using `===`.
* Convert Non-strict to strict equality checking
Convert non-strict equality checking, using `==`, to the strict version, using `===`.
* Convert Non-strict to strict equality checking
Convert non-strict equality checking, using `==`, to the strict version, using `===`.
* Convert Non-strict to strict equality checking
Convert non-strict equality checking, using `==`, to the strict version, using `===`.
* Convert Non-strict to strict equality checking
Convert non-strict equality checking, using `==`, to the strict version, using `===`.
* Convert Non-strict to strict equality checking
Convert non-strict equality checking, using `==`, to the strict version, using `===`.
* Convert Non-strict to strict equality checking
Convert non-strict equality checking, using `==`, to the strict version, using `===`.
* Convert Non-strict to strict equality checking
Convert non-strict equality checking, using `==`, to the strict version, using `===`.
* Convert Non-strict to strict equality checking
Convert non-strict equality checking, using `==`, to the strict version, using `===`.
* Convert Non-strict to strict equality checking
Convert non-strict equality checking, using `==`, to the strict version, using `===`.
* Convert Non-strict to strict equality checking
Convert non-strict equality checking, using `==`, to the strict version, using `===`.
* Convert Non-strict to strict equality checking
Convert non-strict equality checking, using `==`, to the strict version, using `===`.
* Convert Non-strict to strict equality checking
Convert non-strict equality checking, using `==`, to the strict version, using `===`.
* Convert Non-strict to strict equality checking
Convert non-strict equality checking, using `==`, to the strict version, using `===`.
* Convert Non-strict to strict equality checking
Convert non-strict equality checking, using `==`, to the strict version, using `===`.
* undo strict null checking
* remove added semicolons
* Prettier Formatting Changes
* Update .eslintrc
add smart strict equality rule
* Convert Non-strict to strict equality checking
Convert non-strict equality checking, using `==`, to the strict version, using `===`.
* Convert Non-strict to strict equality checking
Convert non-strict equality checking, using `==`, to the strict version, using `===`.
* Convert Non-strict to strict equality checking
Convert non-strict equality checking, using `==`, to the strict version, using `===`.
* Convert Non-strict to strict equality checking
Convert non-strict equality checking, using `==`, to the strict version, using `===`.
* Convert files to use strict equality
* fix prettier eslint errors
* fix remaining prettier complaints
* use strict null equality in serializer
* Add `defaultValue` prop to `Editor` component
* Use `defaultValue` prop in the `Read Only` example
* Use `defaultValue` prop in the `Check Lists` example
* Use `defaultValue` prop in the `Code Highlighting` example
* Use `defaultValue` prop in the `Embeds` example
* Use `defaultValue` prop in the `Emojis` example
* Use `defaultValue` prop in the `Forced Layout` example
* Use `defaultValue` prop in the `Huge Document` example
* Use `defaultValue` prop in the `Images` example
* Use `defaultValue` prop in the `Input Tester` example
* Use `defaultValue` prop in the `Markdown Preview` example
* Use `defaultValue` prop in the `Markdown Shortcuts` example
* Use `defaultValue` prop in the `Paste HTML` example
* Use `defaultValue` prop in the `Plain Text` example
* Use `defaultValue` prop in the `Plugins` example
* Use `defaultValue` prop in the `RTL` example
* Use `defaultValue` prop in the `Search Highlighting` example
* Use `defaultValue` prop in the `Tables` example
#### Is this adding or improving a _feature_ or fixing a _bug_?
Improvement / debt.
#### What's the new behavior?
This pull request removes the `Change` object as we know it, and folds all of its behaviors into the new `Editor` controller instead, simplifying a lot of the confusion around what is a "change vs. editor" and when to use which. It makes the standard API a **lot** nicer to use I think.
---
###### NEW
**The `editor.command` and `editor.query` methods can take functions.** Previously they only accepted a `type` string and would look up the command or query by type. Now, they also accept a custom function. This is helpful for plugin authors, who want to accept a "command option", since it gives users more flexibility to write one-off commands or queries. For example a plugin could be passed either:
```js
Hotkey({
hotkey: 'cmd+b',
command: 'addBoldMark',
})
```
Or a custom command function:
```js
Hotkey({
hotkey: 'cmd+b',
command: editor => editor.addBoldMark().moveToEnd()
})
```
###### BREAKING
**The `Change` object has been removed.** The `Change` object as we know it previously has been removed, and all of its behaviors have been folded into the `Editor` controller. This includes the top-level commands and queries methods, as well as methods like `applyOperation` and `normalize`. _All places that used to receive `change` now receive `editor`, which is API equivalent._
**Changes are now flushed to `onChange` asynchronously.** Previously this was done synchronously, which resulted in some strange race conditions in React environments. Now they will always be flushed asynchronously, just like `setState`.
**The `render*` and `decorate*` middleware signatures have changed!** Previously the `render*` and `decorate*` middleware was passed `(props, next)`. However now, for consistency with the other middleware they are all passed `(props, editor, next)`. This way, all middleware always receive `editor` and `next` as their final two arguments.
**The `normalize*` and `validate*` middleware signatures have changed!** Previously the `normalize*` and `validate*` middleware was passed `(node, next)`. However now, for consistency with the other middleware they are all passed `(node, editor, next)`. This way, all middleware always receive `editor` and `next` as their final two arguments.
**The `editor.event` method has been removed.** Previously this is what you'd use when writing tests to simulate events being fired—which were slightly different to other running other middleware. With the simplification to the editor and to the newly-consistent middleware signatures, you can now use `editor.run` directly to simulate events:
```js
editor.run('onKeyDown', { key: 'Tab', ... })
```
###### DEPRECATED
**The `editor.change` method is deprecated.** With the removal of the `Change` object, there's no need anymore to create the small closures with `editor.change()`. Instead you can directly invoke commands on the editor in series, and all of the changes will be emitted asynchronously on the next tick.
```js
editor
.insertText('word')
.moveFocusForward(10)
.addMark('bold')
```
**The `applyOperations` method is deprecated.** Instead you can loop a set of operations and apply each one using `applyOperation`. This is to reduce the number of methods exposed on the `Editor` to keep it simpler.
**The `change.call` method is deprecated.** Previously this was used to call a one-off function as a change method. Now this behavior is equivalent to calling `editor.command(fn)` instead.
---
Fixes: https://github.com/ianstormtaylor/slate/issues/2334
Fixes: https://github.com/ianstormtaylor/slate/issues/2282
* Fix spell check bug by add data-text:true
* Fix spell check bug by spell check add length to a leaf
* Fix tests to use data-text:true for marks
* Rename data-text to data-slate-leaf; Remove setRef; unlift attributes in leaf
* Update examples with data-*
* Add attributes to document
* Fix renderMark in all documents
* Prettier markdown
* 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
* 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
* rename state to value in slate core, as deprecation
* rename all references to state to value in slate core
* migrate slate-base64-serializer
* migrate slate-html-serializer
* migrate slate-hyperscript
* migrate slate-plain-serializer
* migrate slate-prop-types
* migrate slate-simulator
* fix change.setState compat
* deprecate references to state in slate-react
* remove all references to state in slate-react
* remove `value` and `schema` from props to all components
* fix default renderPlaceholder
* fix tests
* update examples
* update walkthroughs
* update guides
* update reference
* remove data from event handler signatures
* standardize known transfer types
* add setEventTransfer to docs
* update examples, fix drag/drop
* fix tests and draggable attribute setting
* refactor to extract applyOperation util
* change handlers to receive transform instead of state
* change onChange to receive a transform, update rich-text example
* fix stack iterationg, convert check-list example
* convert code-highlighting, embeds, emojis examples
* change operations to use full paths, not indexes
* switch split and join to be recursive
* fix linter
* fix onChange calls
* make all operations invertable, add src/operations/* logic
* rename "join" to "merge"
* remove .length property of nodes
* fix node.getFragmentAtRange logic
* convert remaining examples, fix existing changes
* fix .apply() calls and tests
* change setSave and setIsNative transforms
* fix insert_text operations to include marks always
* cleanup and fixes
* fix node inheritance
* fix core onCut handler
* skip constructor in node inheritance
* cleanup
* change updateDescendant to updateNode
* add and update docs
* eliminate need for .apply(), change history to mutable
* add missing file
* add deprecation support to Transform objects
* rename "transform" to "change"
* update benchmark
* add deprecation util to logger
* update transform isNative attr
* fix remaining warn use
* simplify history checkpointing logic
* fix tests
* revert history to being immutable
* fix history
* fix normalize
* fix syntax error from merge
* Fix typo
just a minor typo in the docs!
* Fix typo in API docs
* Update focus-blur example readme to reflect the correct example
* Remove extra newline
* Correct Readme on the plugins example as well
* Correct readme for RTL example
* Fix own typo.
* Adding a Readme for the tables example