@arc-fusion/pb-editor-wrapper
Advanced tools
Comparing version 0.0.272 to 0.0.273
@@ -30,2 +30,31 @@ "use strict"; | ||
var enterRef = (0, _react.useRef)(); | ||
var previewEvents = { | ||
generateHover: function generateHover(component) { | ||
return new CustomEvent('onFeatureHover', { | ||
detail: { | ||
fingerprint: fingerprint, | ||
component: component, | ||
plugins: plugins | ||
} | ||
}); | ||
}, | ||
generateHoverEnd: function generateHoverEnd(component) { | ||
return new CustomEvent('onFeatureHoverEnd', { | ||
detail: { | ||
fingerprint: fingerprint, | ||
component: component, | ||
plugins: plugins | ||
} | ||
}); | ||
} | ||
}; | ||
var onFeatureHover = function onFeatureHover(component) { | ||
window.dispatchEvent(previewEvents.generateHover(component)); | ||
}; | ||
var onFeatureHoverEnd = function onFeatureHoverEnd(component) { | ||
window.dispatchEvent(previewEvents.generateHoverEnd(component)); | ||
}; | ||
(0, _react.useEffect)(function () { | ||
@@ -45,8 +74,4 @@ if (isChain) return; | ||
siblingNodes.forEach(function (element) { | ||
element === null || element === void 0 ? void 0 : element.addEventListener('mouseenter', function () { | ||
console.log('enter', fingerprint); | ||
}); | ||
element === null || element === void 0 ? void 0 : element.addEventListener('mouseleave', function () { | ||
console.log('leave', fingerprint); | ||
}); | ||
element === null || element === void 0 ? void 0 : element.addEventListener('mouseenter', onFeatureHover); | ||
element === null || element === void 0 ? void 0 : element.addEventListener('mouseleave', onFeatureHoverEnd); | ||
}); | ||
@@ -57,8 +82,4 @@ } | ||
siblingNodes.forEach(function (element) { | ||
element === null || element === void 0 ? void 0 : element.removeEventListener('mouseenter', function () { | ||
console.log('enter', fingerprint); | ||
}); | ||
element === null || element === void 0 ? void 0 : element.removeEventListener('mouseleave', function () { | ||
console.log('leave', fingerprint); | ||
}); | ||
element === null || element === void 0 ? void 0 : element.removeEventListener('mouseenter', onFeatureHover); | ||
element === null || element === void 0 ? void 0 : element.removeEventListener('mouseleave', onFeatureHoverEnd); | ||
}); | ||
@@ -65,0 +86,0 @@ } |
{ | ||
"name": "@arc-fusion/pb-editor-wrapper", | ||
"description": "PageBuilder Preview Wrapper", | ||
"version": "0.0.272", | ||
"version": "0.0.273", | ||
"module": "dist/index.js", | ||
@@ -6,0 +6,0 @@ "files": [ |
7333
114