braft-utils
Advanced tools
Comparing version 0.0.19 to 0.0.20
@@ -152,9 +152,17 @@ 'use strict'; | ||
}, | ||
toggleSelectionIndent: function toggleSelectionIndent(editorState, indent) { | ||
var max = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 6; | ||
toggleSelectionIndent: function toggleSelectionIndent(editorState, textIndent) { | ||
var maxIndent = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 6; | ||
return this.setSelectionBlockData(editorState, { | ||
textIndent: indent <= 0 || indent > max || isNaN(indent) ? undefined : indent | ||
}); | ||
return textIndent <= 0 || textIndent > maxIndent || isNaN(textIndent) ? editorState : this.setSelectionBlockData(editorState, { textIndent: textIndent }); | ||
}, | ||
increaseSelectionIndent: function increaseSelectionIndent(editorState) { | ||
var maxIndent = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 6; | ||
var currentIndent = this.getSelectionBlockData(editorState, 'textIndent'); | ||
return this.setSelectionBlockData(editorState, currentIndent + 1, maxIndent); | ||
}, | ||
decreaseSelectionIndent: function decreaseSelectionIndent(editorState) { | ||
var currentIndent = this.getSelectionBlockData(editorState, 'textIndent'); | ||
return this.setSelectionBlockData(editorState, currentIndent - 1); | ||
}, | ||
toggleSelectionColor: function toggleSelectionColor(editorState, color) { | ||
@@ -161,0 +169,0 @@ var colorList = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : []; |
{ | ||
"name": "braft-utils", | ||
"version": "0.0.19", | ||
"version": "0.0.20", | ||
"description": "Utils for Braft Editor", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
109842
530