@arc-fusion/pb-editor-wrapper
Advanced tools
Comparing version 0.0.121 to 0.0.122
@@ -56,2 +56,7 @@ "use strict"; | ||
var _useState3 = (0, _react2.useState)(false), | ||
_useState4 = _slicedToArray(_useState3, 2), | ||
isSelected = _useState4[0], | ||
setSelectedItem = _useState4[1]; | ||
var styles = { | ||
@@ -132,3 +137,11 @@ wrapper: { | ||
var onFeatureHover = function onFeatureHover() { | ||
var onFeatureHover = function onFeatureHover(event) { | ||
var _event$target; | ||
var selectedItem = event === null || event === void 0 ? void 0 : (_event$target = event.target) === null || _event$target === void 0 ? void 0 : _event$target.classList.contains('pb__feature__selected'); | ||
if (selectedItem) { | ||
setSelectedItem(true); | ||
} | ||
setHover(true); | ||
@@ -138,3 +151,12 @@ onHover && onHover(fingerprint); | ||
var onFeatureHoverEnd = function onFeatureHoverEnd() { | ||
var onFeatureHoverEnd = function onFeatureHoverEnd(event) { | ||
var _event$target2; | ||
var selectedItem = event === null || event === void 0 ? void 0 : (_event$target2 = event.target) === null || _event$target2 === void 0 ? void 0 : _event$target2.classList.contains('pb__feature__selected'); | ||
console.log('hello world', event, selectedItem); | ||
if (selectedItem) { | ||
setSelectedItem(true); | ||
} | ||
setHover(false); | ||
@@ -148,3 +170,3 @@ onHoverEnd && onHoverEnd(fingerprint); | ||
}, children) : (0, _react.jsx)("div", { | ||
css: [styles.wrapper, isHovered && styles.wrapper.highlighted], | ||
className: "".concat(styles.wrapper, " ").concat(isHovered ? styles.wrapper.highlighted : '', " ").concat(isSelected ? 'pb__feature__selected' : ''), | ||
onMouseEnter: onFeatureHover, | ||
@@ -151,0 +173,0 @@ onMouseLeave: onFeatureHoverEnd, |
{ | ||
"name": "@arc-fusion/pb-editor-wrapper", | ||
"description": "PageBuilder Preview Wrapper", | ||
"version": "0.0.121", | ||
"version": "0.0.122", | ||
"module": "dist/index.js", | ||
@@ -6,0 +6,0 @@ "files": [ |
13035
214