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

draftmirror

Package Overview
Dependencies
Maintainers
1
Versions
16
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

draftmirror - npm Package Compare versions

Comparing version 0.1.0 to 0.2.0

34

lib/modifiers/selection.js

@@ -88,8 +88,32 @@ var SelectionContext = require('../models/selectionContext');

/**
* Remove the selected content
* @param {EditorState} editorState
* @param {Selection} selection
*/
function remove(editorState, selection) {
return editorState.applyTransform(function (editor) {
editor.tr.deleteSelection().apply();
});
}
/**
* Remove the selected content
* @param {EditorState} editorState
* @param {String} text
*/
function replaceWithText(editorState, text) {
return editorState.applyTransform(function (editor) {
editor.tr.typeText(text).apply();
});
}
module.exports = {
nodeAtSelection: nodeAtSelection,
contextAtSelection: contextAtSelection,
removeAt: removeAt,
getText: getText,
getParentText: getParentText
nodeAtSelection: nodeAtSelection,
contextAtSelection: contextAtSelection,
removeAt: removeAt,
getText: getText,
getParentText: getParentText,
remove: remove,
replaceWithText: replaceWithText
};

2

package.json
{
"name": "draftmirror",
"version": "0.1.0",
"version": "0.2.0",
"description": "React component for ProseMirror providing a Draft.js like API",

@@ -5,0 +5,0 @@ "main": "./lib/index.js",

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