@arc-fusion/pb-editor-wrapper
Advanced tools
Comparing version 0.0.106 to 0.0.107
@@ -50,10 +50,6 @@ "use strict"; | ||
position: 'relative', | ||
display: 'block', | ||
highlighted: { | ||
margin: '2px', | ||
position: 'relative', | ||
zIndex: 99999, | ||
boxShadow: '0 0 0 2px #3760ff', | ||
transition: 'all 0.2s cubic-bezier(0.25, 0.8, 0.25, 1)', | ||
display: 'block' | ||
transition: 'all 0.2s cubic-bezier(0.25, 0.8, 0.25, 1)' | ||
}, | ||
@@ -83,40 +79,2 @@ actions: { | ||
var ChainWrapper = function ChainWrapper(_ref2) { | ||
var className = _ref2.className; | ||
return (0, _react.jsx)("editor-wrapper", { | ||
class: className, | ||
"data-fusion-component": fingerprint, | ||
"data-fusion-plugins": plugins | ||
}, children); | ||
}; | ||
var FeatureWrapper = function FeatureWrapper(_ref3) { | ||
var className = _ref3.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", { | ||
style: 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() { | ||
@@ -127,7 +85,31 @@ setHover(true); | ||
return isChain ? (0, _react.jsx)(ChainWrapper, { | ||
css: isHovered ? styles.wrapper.highlighted : styles.wrapper | ||
}) : (0, _react.jsx)(FeatureWrapper, { | ||
css: isHovered ? styles.wrapper.highlighted : styles.wrapper | ||
}); | ||
return isChain ? (0, _react.jsx)("div", { | ||
css: [styles.wrapper, isHovered && styles.wrapper.highlighted], | ||
"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); | ||
}; | ||
@@ -134,0 +116,0 @@ |
{ | ||
"name": "@arc-fusion/pb-editor-wrapper", | ||
"description": "PageBuilder Preview Wrapper", | ||
"version": "0.0.106", | ||
"version": "0.0.107", | ||
"module": "dist/index.js", | ||
@@ -6,0 +6,0 @@ "files": [ |
8566
115