braft-utils
Advanced tools
Comparing version 0.0.18 to 0.0.19
@@ -65,4 +65,10 @@ 'use strict'; | ||
}, | ||
setSelectionBlockData: function setSelectionBlockData(editorState, blockData) { | ||
return (0, _draftjsUtils.setBlockData)(editorState, blockData); | ||
setSelectionBlockData: function setSelectionBlockData(editorState, blockData, override) { | ||
if (override) { | ||
return (0, _draftjsUtils.setBlockData)(editorState, blockData); | ||
} else { | ||
var allBlockData = this.getSelectionBlockData(editorState).toJS(); | ||
return (0, _draftjsUtils.setBlockData)(editorState, Object.assign({}, allBlockData, blockData)); | ||
} | ||
}, | ||
@@ -148,4 +154,6 @@ getSelectionBlockData: function getSelectionBlockData(editorState, name) { | ||
toggleSelectionIndent: function toggleSelectionIndent(editorState, indent) { | ||
var max = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 6; | ||
return this.setSelectionBlockData(editorState, { | ||
textIndent: indent <= 0 || indent >= 6 || isNaN(indent) ? undefined : indent | ||
textIndent: indent <= 0 || indent > max || isNaN(indent) ? undefined : indent | ||
}); | ||
@@ -152,0 +160,0 @@ }, |
{ | ||
"name": "braft-utils", | ||
"version": "0.0.18", | ||
"version": "0.0.19", | ||
"description": "Utils for Braft Editor", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
108362
523