Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

draftjs-utils

Package Overview
Dependencies
Maintainers
1
Versions
48
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

draftjs-utils - npm Package Compare versions

Comparing version 0.7.3 to 0.7.4

2

js/index.js

@@ -8,2 +8,3 @@ /* @flow */

getSelectionEntity,
extractInlineStyle,
removeAllInlineStyles,

@@ -52,2 +53,3 @@ getSelectionInlineStyle,

getSelectionEntity,
extractInlineStyle,
removeAllInlineStyles,

@@ -54,0 +56,0 @@ getSelectionInlineStyle,

@@ -234,2 +234,22 @@ /* @flow */

/**
*
*/
export function extractInlineStyle(editorState) {
if(editorState) {
const styleList = editorState.getCurrentContent().getBlockMap().map(block => block.get('characterList')).toList().flatten();
styleList.forEach(style => {
if (style && style.indexOf('color-') === 0) {
addToCustomStyleMap('color', 'color', style.substr(6));
} else if (style && style.indexOf('bgcolor-') === 0) {
addToCustomStyleMap('bgcolor', 'backgroundColor', style.substr(8));
} else if (style && style.indexOf('fontsize-') === 0) {
addToCustomStyleMap('fontSize', 'fontsize', style.substr(9));
} else if (style && style.indexOf('fontfamily-') === 0) {
addToCustomStyleMap('fontFamily', 'fontfamily', style.substr(11));
}
});
}
}
/**
* Function returns size at a offset.

@@ -236,0 +256,0 @@ */

2

package.json
{
"name": "draftjs-utils",
"version": "0.7.3",
"version": "0.7.4",
"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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc