@botmock/editor
Advanced tools
Comparing version 0.1.1 to 0.1.2
@@ -35,9 +35,8 @@ import "../../styling/block.less"; | ||
if (this.contentRef.current) { | ||
this.observer = new MutationObserver((mutationsList) => { | ||
this.observer = new MutationObserver(() => { | ||
this.recalculateDimensions(); | ||
for (let mutation of mutationsList) { | ||
if (mutation.target.nodeName === 'IMG') { | ||
mutation.target.onload = () => { | ||
this.recalculateDimensions(); | ||
} | ||
let imgChildren = this.contentRef.current.getElementsByTagName('IMG'); | ||
for (let img of imgChildren) { | ||
img.onload = () => { | ||
this.recalculateDimensions(); | ||
} | ||
@@ -44,0 +43,0 @@ } |
@@ -28,3 +28,3 @@ import "../../styling/connector.less"; | ||
shouldComponentUpdate(nextProps, nextState) { | ||
return ( | ||
return nextProps.points && ( | ||
nextProps.highlightedMidPoints.length !== | ||
@@ -36,3 +36,3 @@ this.props.highlightedMidPoints.length || | ||
).length || | ||
nextProps.points.length !== this.props.points.length || | ||
nextProps.points.length !== (this.props.points && this.props.points.length) || | ||
nextProps.points.filter( | ||
@@ -74,2 +74,6 @@ (p, i) => !pointsAreEqual(p, this.props.points[i]) | ||
let segmentEndPoints = []; | ||
if (!this.props.points) { | ||
return []; | ||
} | ||
if (this.props.points.filter(point => !!point).length < 2) { | ||
@@ -469,3 +473,3 @@ return this.props.points.filter(point => !!point); | ||
let label; | ||
if (this.props.label && this.props.to) { | ||
if (this.props.label && this.props.label.text && this.props.to) { | ||
label = ( | ||
@@ -472,0 +476,0 @@ <Label |
@@ -77,3 +77,3 @@ ## Botmock Editor | ||
`setTransform(transform:Transform)` - Sets the transform (pan and zoom) | ||
`setTransform(transform:Transform, callback:Function)` - Sets the transform (pan and zoom) | ||
@@ -88,2 +88,4 @@ `getTransform():Transform` - Gets the transform (pan and zoom) | ||
`deselectConnector()` - Deselect the connector that is selected | ||
`pageToPosition(pageX:Number, pageY:Number):Point` - Turns a pageX and pageY to a point in the editor | ||
@@ -90,0 +92,0 @@ |
{ | ||
"name": "@botmock/editor", | ||
"version": "0.1.1", | ||
"version": "0.1.2", | ||
"description": "Botmock Editor", | ||
@@ -5,0 +5,0 @@ "main": "output/editor.esm.js", |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
386984
9662
1