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

cm-page-builder

Package Overview
Dependencies
Maintainers
4
Versions
90
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

cm-page-builder - npm Package Compare versions

Comparing version 1.2.15 to 1.2.17

8

lib/components/ContentEditable.js

@@ -110,3 +110,5 @@ 'use strict';

onFocus: this.handleFocus,
onBlur: this.emitUpdate,
onBlur: function onBlur(e) {
return _this2.emitChange(e, context);
},
contentEditable: context.status === 'Edit',

@@ -116,4 +118,4 @@ placeholder: content || context.status === 'Edit' ? placeholder : '',

styles: styles,
'data-gramm_editor': 'false'
// onSelect={context.handleSelection}
'data-gramm_editor': 'false',
onSelect: context.handleSelection
})

@@ -120,0 +122,0 @@ );

@@ -129,13 +129,15 @@ 'use strict';

_this.handleSelection = function (e) {
var selection = window.getSelection();
if (selection && selection.rangeCount > 0) {
var dimensions = selection.getRangeAt(0).getBoundingClientRect();
_this.currentElemSelection = { elemId: e.target.dataset.id, selection: selection };
if (dimensions.width > 1) {
var scrollOffsets = _this.getScrollOffsets();
var actionDomRect = { top: dimensions.top + scrollOffsets.y - dimensions.height - 10, left: dimensions.left + scrollOffsets.x };
_this.setState({ actionDomRect: actionDomRect });
if (e.target.getAttribute('placeholder') !== 'Title of the page') {
var selection = window.getSelection();
if (selection && selection.rangeCount > 0) {
var dimensions = selection.getRangeAt(0).getBoundingClientRect();
_this.currentElemSelection = { elemId: e.target.dataset.id, selection: selection };
if (dimensions.width > 1) {
var scrollOffsets = _this.getScrollOffsets();
var actionDomRect = { top: dimensions.top + scrollOffsets.y - dimensions.height - 10, left: dimensions.left + scrollOffsets.x };
_this.setState({ actionDomRect: actionDomRect });
}
} else {
_this.currentElemSelection = null;
}
} else {
_this.currentElemSelection = null;
}

@@ -295,4 +297,2 @@ _this.handleRangeSelection(e);

var isEdit = this.props.status === 'Edit';
console.log('current', currentType);
return _react2.default.createElement(

@@ -299,0 +299,0 @@ 'div',

{
"name": "cm-page-builder",
"version": "1.2.15",
"version": "1.2.17",
"description": "Awesome react starter kit",

@@ -5,0 +5,0 @@ "main": "lib/page/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