1
0
mirror of https://github.com/ianstormtaylor/slate.git synced 2025-09-01 19:22:35 +02:00

Expose transforms (#836)

* 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
This commit is contained in:
Ian Storm Taylor
2017-09-05 18:03:41 -07:00
committed by GitHub
parent 786050f732
commit 7470a6dd53
1635 changed files with 5963 additions and 5968 deletions

View File

@@ -18,15 +18,15 @@ class PlainText extends React.Component {
state = {
state: Plain.deserialize('This is editable plain text, just like a <textarea>!')
};
}
/**
* On change.
*
* @param {State} state
* @param {Change} change
*/
onChange = (state) => {
onChange = ({ state }) => {
this.setState({ state })
}