draftjs-utils
Advanced tools
Comparing version 0.3.1 to 0.3.2
@@ -36,2 +36,4 @@ /* @flow */ | ||
CODE: true, | ||
SUPERSCRIPT: true, | ||
SUBSCRIPT: true, | ||
}; | ||
@@ -50,3 +52,3 @@ for (let i = 0; i < selectedBlocks.size; i += 1) { | ||
const inlineStylesAtOffset = selectedBlocks.get(i).getInlineStyleAt(j); | ||
['BOLD', 'ITALIC', 'UNDERLINE', 'STRIKETHROUGH', 'CODE'].forEach((style) => { | ||
['BOLD', 'ITALIC', 'UNDERLINE', 'STRIKETHROUGH', 'CODE', 'SUPERSCRIPT', 'SUBSCRIPT'].forEach((style) => { | ||
inlineStyles[style] = inlineStyles[style] && inlineStylesAtOffset.get(style) === style; | ||
@@ -145,2 +147,14 @@ }); | ||
fontFamily: {}, | ||
SUPERSCRIPT: { | ||
fontSize: 11, | ||
position: 'relative', | ||
top: -8, | ||
display: 'inline-flex', | ||
}, | ||
SUBSCRIPT: { | ||
fontSize: 11, | ||
position: 'relative', | ||
bottom: -8, | ||
display: 'inline-flex', | ||
}, | ||
}; | ||
@@ -174,2 +188,4 @@ colors.forEach((color) => { | ||
...customInlineStylesMap.fontFamily, | ||
SUPERSCRIPT: customInlineStylesMap.SUPERSCRIPT, | ||
SUBSCRIPT: customInlineStylesMap.SUBSCRIPT, | ||
}; | ||
@@ -176,0 +192,0 @@ |
{ | ||
"name": "draftjs-utils", | ||
"version": "0.3.1", | ||
"version": "0.3.2", | ||
"description": "Collection of utility function for use with Draftjs.", | ||
@@ -5,0 +5,0 @@ "main": "lib/draftjs-utils.js", |
Sorry, the diff of this file is too big to display
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
4074859
2820