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

braft-utils

Package Overview
Dependencies
Maintainers
1
Versions
40
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

braft-utils - npm Package Compare versions

Comparing version 0.0.13 to 0.0.14

36

dist/content.js

@@ -200,17 +200,2 @@ 'use strict';

},
insertHorizontalLine: function insertHorizontalLine(editorState) {
var selectionState = editorState.getSelection();
var contentState = editorState.getCurrentContent();
if (!selectionState.isCollapsed() || this.getSelectionBlockType(editorState) === 'atomic') {
return editorState;
}
var contentStateWithEntity = contentState.createEntity('HR', 'IMMUTABLE', {});
var entityKey = contentStateWithEntity.getLastCreatedEntityKey();
var newEditorState = _draftJs.AtomicBlockUtils.insertAtomicBlock(editorState, entityKey, ' ');
return newEditorState;
},
toggleSelectionLink: function toggleSelectionLink(editorState, href, target) {

@@ -295,2 +280,23 @@

},
insertAtomicBlock: function insertAtomicBlock(editorState, type) {
var immutable = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;
var data = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
var selectionState = editorState.getSelection();
var contentState = editorState.getCurrentContent();
if (!selectionState.isCollapsed() || this.getSelectionBlockType(editorState) === 'atomic') {
return editorState;
}
var contentStateWithEntity = contentState.createEntity(type, immutable ? 'IMMUTABLE' : 'MUTABLE', data);
var entityKey = contentStateWithEntity.getLastCreatedEntityKey();
var newEditorState = _draftJs.AtomicBlockUtils.insertAtomicBlock(editorState, entityKey, ' ');
return newEditorState;
},
insertHorizontalLine: function insertHorizontalLine(editorState) {
return this.insertAtomicBlock(editorState, 'HR');
},
insertMedias: function insertMedias(editorState) {

@@ -297,0 +303,0 @@ var medias = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];

{
"name": "braft-utils",
"version": "0.0.13",
"version": "0.0.14",
"description": "Utils for Braft Editor",

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

Sorry, the diff of this file is not supported yet

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