@storybook/addon-measure
Advanced tools
Comparing version 1.3.0--canary.17.d15bbc2.0 to 1.3.0
@@ -0,1 +1,13 @@ | ||
# v1.3.0 (Thu Jun 24 2021) | ||
#### 🚀 Enhancement | ||
- update deps, prevent multi key combo trigger and measure on enable [#17](https://github.com/storybookjs/addon-measure/pull/17) ([@winkerVSbecks](https://github.com/winkerVSbecks)) | ||
#### Authors: 1 | ||
- Varun Vachhar ([@winkerVSbecks](https://github.com/winkerVSbecks)) | ||
--- | ||
# v1.2.4 (Tue Jun 15 2021) | ||
@@ -2,0 +14,0 @@ |
@@ -12,4 +12,6 @@ "use strict"; | ||
function useHotKey(updateGlobals, measureEnabled) { | ||
function useHotKey(updateGlobals) { | ||
var onKeyDown = function onKeyDown(event) { | ||
event.stopPropagation(); | ||
if (!focusInInput(event) && event.altKey) { | ||
@@ -30,2 +32,3 @@ if (event.key === "Alt") { | ||
if (event.key === "Alt") { | ||
event.stopPropagation(); | ||
updateGlobals({ | ||
@@ -32,0 +35,0 @@ measureEnabled: false |
@@ -53,5 +53,3 @@ "use strict"; | ||
document.addEventListener("mousemove", onMouseMove); | ||
console.log("addEventListener — mousemove"); | ||
return function () { | ||
console.log("removeEventListener — mousemove"); | ||
document.removeEventListener("mousemove", onMouseMove); | ||
@@ -77,3 +75,3 @@ }; | ||
(0, _canvas.init)(); | ||
window.addEventListener("resize", onResize); // Draw the element below the point when first enabled | ||
window.addEventListener("resize", onResize); // Draw the element below the pointer when first enabled | ||
@@ -80,0 +78,0 @@ findAndDrawElement(pointer.x, pointer.y); |
@@ -5,4 +5,6 @@ function focusInInput(event) { | ||
export function useHotKey(updateGlobals, measureEnabled) { | ||
export function useHotKey(updateGlobals) { | ||
var onKeyDown = function onKeyDown(event) { | ||
event.stopPropagation(); | ||
if (!focusInInput(event) && event.altKey) { | ||
@@ -23,2 +25,3 @@ if (event.key === "Alt") { | ||
if (event.key === "Alt") { | ||
event.stopPropagation(); | ||
updateGlobals({ | ||
@@ -25,0 +28,0 @@ measureEnabled: false |
@@ -40,5 +40,3 @@ /* eslint-env browser */ | ||
document.addEventListener("mousemove", onMouseMove); | ||
console.log("addEventListener — mousemove"); | ||
return function () { | ||
console.log("removeEventListener — mousemove"); | ||
document.removeEventListener("mousemove", onMouseMove); | ||
@@ -64,3 +62,3 @@ }; | ||
init(); | ||
window.addEventListener("resize", onResize); // Draw the element below the point when first enabled | ||
window.addEventListener("resize", onResize); // Draw the element below the pointer when first enabled | ||
@@ -67,0 +65,0 @@ findAndDrawElement(pointer.x, pointer.y); |
{ | ||
"name": "@storybook/addon-measure", | ||
"version": "1.3.0--canary.17.d15bbc2.0", | ||
"version": "1.3.0", | ||
"description": "Inspect layouts by visualizing the box model", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
70895
2