New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@draft-js-plugins/drag-n-drop-upload

Package Overview
Dependencies
Maintainers
4
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@draft-js-plugins/drag-n-drop-upload - npm Package Compare versions

Comparing version 4.2.2 to 4.2.3

12

lib/index.cjs.js

@@ -67,10 +67,12 @@ 'use strict';

var newEditorState = draftJs.AtomicBlockUtils.insertAtomicBlock(editorState, entityKey, ' ');
var insertedAtomicBlock = newEditorState.getCurrentContent().getBlockBefore(newEditorState.getSelection().getAnchorKey());
if (insertedAtomicBlock === undefined) {
throw new Error('Unable to locate the block-key of inserted-atomic-block.');
}
var stateSelected = draftJs.EditorState.forceSelection(newEditorState, newEditorState.getCurrentContent().getSelectionAfter());
var blockArrayMap = newEditorState.getCurrentContent().getBlocksAsArray().map(function (b) {
return b.getKey();
});
var nextToLastBlock = newEditorState.getCurrentContent().getBlockForKey(blockArrayMap[blockArrayMap.length - 2]);
return {
state: stateSelected,
blockKey: nextToLastBlock.getKey(),
blockKey: insertedAtomicBlock.getKey(),
key: entityKey,

@@ -77,0 +79,0 @@ text: text

@@ -59,10 +59,12 @@ import React from 'react';

var newEditorState = AtomicBlockUtils.insertAtomicBlock(editorState, entityKey, ' ');
var insertedAtomicBlock = newEditorState.getCurrentContent().getBlockBefore(newEditorState.getSelection().getAnchorKey());
if (insertedAtomicBlock === undefined) {
throw new Error('Unable to locate the block-key of inserted-atomic-block.');
}
var stateSelected = EditorState.forceSelection(newEditorState, newEditorState.getCurrentContent().getSelectionAfter());
var blockArrayMap = newEditorState.getCurrentContent().getBlocksAsArray().map(function (b) {
return b.getKey();
});
var nextToLastBlock = newEditorState.getCurrentContent().getBlockForKey(blockArrayMap[blockArrayMap.length - 2]);
return {
state: stateSelected,
blockKey: nextToLastBlock.getKey(),
blockKey: insertedAtomicBlock.getKey(),
key: entityKey,

@@ -69,0 +71,0 @@ text: text

{
"name": "@draft-js-plugins/drag-n-drop-upload",
"version": "4.2.2",
"version": "4.2.3",
"sideEffects": [

@@ -5,0 +5,0 @@ "*.css"

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