@arc-fusion/pb-editor-wrapper
Advanced tools
Comparing version 0.0.99 to 0.0.101
@@ -78,36 +78,46 @@ "use strict"; | ||
var ChainWrapper = function ChainWrapper() { | ||
return (0, _react.jsx)("editor-wrapper", { | ||
"data-fusion-component": fingerprint, | ||
"data-fusion-plugins": plugins | ||
}, children); | ||
}; | ||
var FeatureWrapper = function FeatureWrapper(_ref2) { | ||
var className = _ref2.className; | ||
return (0, _react.jsx)("editor-wrapper", { | ||
class: className, | ||
onMouseEnter: onFeatureHover, | ||
onMouseLeave: function onMouseLeave() { | ||
return setHover(false); | ||
}, | ||
"data-fusion-component": fingerprint, | ||
"data-fusion-plugins": plugins | ||
}, isHovered && (0, _react.jsx)("div", { | ||
css: styles.wrapper.actions | ||
}, (0, _react.jsx)("i", { | ||
onClick: function onClick() { | ||
return onEdit(fingerprint); | ||
} | ||
}, (0, _react.jsx)("img", { | ||
src: _pencil.default, | ||
alt: "edit" | ||
})), (0, _react.jsx)("i", { | ||
onClick: function onClick() { | ||
return onDelete(fingerprint); | ||
} | ||
}, (0, _react.jsx)("img", { | ||
src: _trash.default, | ||
alt: "remove" | ||
}))), children); | ||
}; | ||
var onFeatureHover = function onFeatureHover() { | ||
setHover(true); | ||
console.log('hover', isHovered); | ||
onHover && onHover(fingerprint); | ||
}; | ||
return isChain ? (0, _react.jsx)("editor-wrapper", { | ||
"data-fusion-component": fingerprint, | ||
"data-fusion-plugins": plugins | ||
}, children) : (0, _react.jsx)("div", { | ||
css: [styles.wrapper, isHovered && styles.wrapper.highlighted], | ||
onMouseEnter: onFeatureHover, | ||
onMouseLeave: function onMouseLeave() { | ||
return setHover(false); | ||
}, | ||
"data-fusion-component": fingerprint, | ||
"data-fusion-plugins": plugins | ||
}, isHovered && (0, _react.jsx)("div", { | ||
css: styles.wrapper.actions | ||
}, (0, _react.jsx)("i", { | ||
onClick: function onClick() { | ||
return onEdit(fingerprint); | ||
} | ||
}, (0, _react.jsx)("img", { | ||
src: _pencil.default, | ||
alt: "edit" | ||
})), (0, _react.jsx)("i", { | ||
onClick: function onClick() { | ||
return onDelete(fingerprint); | ||
} | ||
}, (0, _react.jsx)("img", { | ||
src: _trash.default, | ||
alt: "remove" | ||
}))), children); | ||
return isChain ? (0, _react.jsx)(ChainWrapper, null) : (0, _react.jsx)(FeatureWrapper, { | ||
css: [styles.wrapper, isHovered && styles.wrapper.highlighted] | ||
}); | ||
}; | ||
@@ -114,0 +124,0 @@ |
{ | ||
"name": "@arc-fusion/pb-editor-wrapper", | ||
"description": "PageBuilder Preview Wrapper", | ||
"version": "0.0.99", | ||
"version": "0.0.101", | ||
"module": "dist/index.js", | ||
@@ -6,0 +6,0 @@ "files": [ |
8846
123