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

Remove value from operation.fromJSON (#1451)

* Remove `value` from `operation.fromJSON`

Value is only used for local undo / redo, so it shouldn't be
serialized along with the rest of the data.

* Continue to parse a specified `value` into an Operation
This commit is contained in:
Justin Weiss 2017-12-12 15:09:15 -08:00 committed by Ian Storm Taylor
parent a3d91b6daa
commit 8be1f9f3a1

View File

@ -103,6 +103,7 @@ class Operation extends Record(DEFAULTS) {
// for providing the local-only invert behavior for the history stack. // for providing the local-only invert behavior for the history stack.
if (key == 'document') continue if (key == 'document') continue
if (key == 'selection') continue if (key == 'selection') continue
if (key == 'value') continue
if (key == 'node' && type != 'insert_node') continue if (key == 'node' && type != 'insert_node') continue
throw new Error(`\`Operation.fromJSON\` was passed a "${type}" operation without the required "${key}" attribute.`) throw new Error(`\`Operation.fromJSON\` was passed a "${type}" operation without the required "${key}" attribute.`)