@arc-fusion/pb-editor-wrapper
Advanced tools
Comparing version 1.0.6 to 1.0.7
@@ -8,10 +8,14 @@ "use strict"; | ||
var _react = require("@emotion/react"); | ||
var _propTypes = _interopRequireDefault(require("prop-types")); | ||
var _react2 = require("react"); | ||
var _react = require("react"); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; } | ||
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; } | ||
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } | ||
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); } | ||
@@ -25,3 +29,3 @@ | ||
function _iterableToArrayLimit(arr, i) { if (typeof Symbol === "undefined" || !(Symbol.iterator in Object(arr))) return; var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } | ||
function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } | ||
@@ -31,3 +35,3 @@ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; } | ||
var PlusIcon = function PlusIcon() { | ||
return (0, _react.jsx)("svg", { | ||
return /*#__PURE__*/React.createElement("svg", { | ||
"aria-hidden": "true", | ||
@@ -39,3 +43,3 @@ width: "10", | ||
viewBox: "0 0 448 512" | ||
}, (0, _react.jsx)("path", { | ||
}, /*#__PURE__*/React.createElement("path", { | ||
fill: "#ffffff", | ||
@@ -47,3 +51,3 @@ d: "M416 208H272V64c0-17.67-14.33-32-32-32h-32c-17.67 0-32 14.33-32 32v144H32c-17.67 0-32 14.33-32 32v32c0 17.67 14.33 32 32 32h144v144c0 17.67 14.33 32 32 32h32c17.67 0 32-14.33 32-32V304h144c17.67 0 32-14.33 32-32v-32c0-17.67-14.33-32-32-32z" | ||
var EditIcon = function EditIcon() { | ||
return (0, _react.jsx)("svg", { | ||
return /*#__PURE__*/React.createElement("svg", { | ||
"aria-hidden": "true", | ||
@@ -55,3 +59,3 @@ width: "12", | ||
viewBox: "0 0 512 512" | ||
}, (0, _react.jsx)("path", { | ||
}, /*#__PURE__*/React.createElement("path", { | ||
fill: "#ffffff", | ||
@@ -63,3 +67,3 @@ d: "M497.9 142.1l-46.1 46.1c-4.7 4.7-12.3 4.7-17 0l-111-111c-4.7-4.7-4.7-12.3 0-17l46.1-46.1c18.7-18.7 49.1-18.7 67.9 0l60.1 60.1c18.8 18.7 18.8 49.1 0 67.9zM284.2 99.8L21.6 362.4.4 483.9c-2.9 16.4 11.4 30.6 27.8 27.8l121.5-21.3 262.6-262.6c4.7-4.7 4.7-12.3 0-17l-111-111c-4.8-4.7-12.4-4.7-17.1 0zM124.1 339.9c-5.5-5.5-5.5-14.3 0-19.8l154-154c5.5-5.5 14.3-5.5 19.8 0s5.5 14.3 0 19.8l-154 154c-5.5 5.5-14.3 5.5-19.8 0zM88 424h48v36.3l-64.5 11.3-31.1-31.1L51.7 376H88v48z" | ||
var TrashIcon = function TrashIcon() { | ||
return (0, _react.jsx)("svg", { | ||
return /*#__PURE__*/React.createElement("svg", { | ||
"aria-hidden": "true", | ||
@@ -71,3 +75,3 @@ width: "12", | ||
viewBox: "0 0 448 512" | ||
}, (0, _react.jsx)("path", { | ||
}, /*#__PURE__*/React.createElement("path", { | ||
fill: "#ffffff", | ||
@@ -79,3 +83,3 @@ d: "M0 84V56c0-13.3 10.7-24 24-24h112l9.4-18.7c4-8.2 12.3-13.3 21.4-13.3h114.3c9.1 0 17.4 5.1 21.5 13.3L312 32h112c13.3 0 24 10.7 24 24v28c0 6.6-5.4 12-12 12H12C5.4 96 0 90.6 0 84zm416 56v324c0 26.5-21.5 48-48 48H80c-26.5 0-48-21.5-48-48V140c0-6.6 5.4-12 12-12h360c6.6 0 12 5.4 12 12zm-272 68c0-8.8-7.2-16-16-16s-16 7.2-16 16v224c0 8.8 7.2 16 16 16s16-7.2 16-16V208zm96 0c0-8.8-7.2-16-16-16s-16 7.2-16 16v224c0 8.8 7.2 16 16 16s16-7.2 16-16V208zm96 0c0-8.8-7.2-16-16-16s-16 7.2-16 16v224c0 8.8 7.2 16 16 16s16-7.2 16-16V208z" | ||
var LocatorIcon = function LocatorIcon() { | ||
return (0, _react.jsx)("svg", { | ||
return /*#__PURE__*/React.createElement("svg", { | ||
"aria-hidden": "true", | ||
@@ -90,6 +94,6 @@ width: "13", | ||
viewBox: "0 0 512 512" | ||
}, (0, _react.jsx)("path", { | ||
}, /*#__PURE__*/React.createElement("path", { | ||
fill: "#999999", | ||
d: "M496 288H304a16 16 0 0 0-16 16v32a16 16 0 0 0 16 16h192a16 16 0 0 0 16-16v-32a16 16 0 0 0-16-16zm0 128H304a16 16 0 0 0-16 16v32a16 16 0 0 0 16 16h192a16 16 0 0 0 16-16v-32a16 16 0 0 0-16-16zm0-256H304a16 16 0 0 0-16 16v32a16 16 0 0 0 16 16h192a16 16 0 0 0 16-16v-32a16 16 0 0 0-16-16zm0-128H304a16 16 0 0 0-16 16v32a16 16 0 0 0 16 16h192a16 16 0 0 0 16-16V48a16 16 0 0 0-16-16z" | ||
}), (0, _react.jsx)("path", { | ||
}), /*#__PURE__*/React.createElement("path", { | ||
fill: "#ffffff", | ||
@@ -101,3 +105,3 @@ d: "M208 288H16a16 16 0 0 0-16 16v32a16 16 0 0 0 16 16h192a16 16 0 0 0 16-16v-32a16 16 0 0 0-16-16zm0 128H16a16 16 0 0 0-16 16v32a16 16 0 0 0 16 16h192a16 16 0 0 0 16-16v-32a16 16 0 0 0-16-16zm0-384H16A16 16 0 0 0 0 48v32a16 16 0 0 0 16 16h192a16 16 0 0 0 16-16V48a16 16 0 0 0-16-16zm0 128H16a16 16 0 0 0-16 16v32a16 16 0 0 0 16 16h192a16 16 0 0 0 16-16v-32a16 16 0 0 0-16-16z" | ||
var PluginIcon = function PluginIcon() { | ||
return (0, _react.jsx)("svg", { | ||
return /*#__PURE__*/React.createElement("svg", { | ||
"aria-hidden": "true", | ||
@@ -108,3 +112,3 @@ width: "12", | ||
viewBox: "0 0 384 512" | ||
}, (0, _react.jsx)("path", { | ||
}, /*#__PURE__*/React.createElement("path", { | ||
fill: "#ffffff", | ||
@@ -117,72 +121,67 @@ d: "M256 144V32c0-17.673 14.327-32 32-32s32 14.327 32 32v112h-64zm112 16H16c-8.837 0-16 7.163-16 16v32c0 8.837 7.163 16 16 16h16v32c0 77.406 54.969 141.971 128 156.796V512h64v-99.204c73.031-14.825 128-79.39 128-156.796v-32h16c8.837 0 16-7.163 16-16v-32c0-8.837-7.163-16-16-16zm-240-16V32c0-17.673-14.327-32-32-32S64 14.327 64 32v112h64z" | ||
wrapper: { | ||
position: 'relative' | ||
}, | ||
highlightedWrapper: { | ||
position: 'relative', | ||
highlighted: { | ||
zIndex: 2147483646, | ||
boxShadow: '2px -2px 0px #3760ff, -2px -2px 0px #3760ff, -2px 2px 0px #3760ff, 2px 2px 0px #3760ff', | ||
transition: 'all 0.2s cubic-bezier(0.25, 0.8, 0.25, 1)' | ||
}, | ||
actions: { | ||
display: 'flex', | ||
justifyContent: 'center', | ||
backgroundColor: '#0e181b', | ||
color: '#ffffff', | ||
cursor: 'pointer', | ||
position: 'absolute', | ||
zIndex: 2147483646, | ||
top: 5, | ||
right: 5, | ||
padding: 5, | ||
width: 'initial', | ||
borderRadius: 5, | ||
'& i': { | ||
padding: 6 | ||
}, | ||
'& i:hover': { | ||
opacity: 0.85 | ||
} | ||
}, | ||
button: { | ||
fontFamily: 'OutputSans', | ||
fontSize: 13, | ||
zIndex: 2147483646, | ||
textAlign: 'center', | ||
backgroundColor: '#3760FF', | ||
color: '#FFFFFF', | ||
cursor: 'pointer', | ||
boxShadow: 'none', | ||
border: 'none', | ||
':hover': { | ||
backgroundColor: '#5272f3' | ||
} | ||
}, | ||
buttonTop: { | ||
position: 'absolute', | ||
top: '-20px', | ||
borderTopLeftRadius: 5, | ||
borderTopRightRadius: 5, | ||
width: 65, | ||
height: 20, | ||
right: 0, | ||
left: 0, | ||
marginLeft: 'auto', | ||
marginRight: 'auto' | ||
}, | ||
buttonBottom: { | ||
position: 'absolute', | ||
bottom: '-20px', | ||
borderBottomLeftRadius: 5, | ||
borderBottomRightRadius: 5, | ||
width: 65, | ||
height: 20, | ||
right: 0, | ||
left: 0, | ||
marginLeft: 'auto', | ||
marginRight: 'auto', | ||
'svg': { | ||
width: 10, | ||
display: 'inline', | ||
margin: 0, | ||
padding: 0 | ||
} | ||
} | ||
zIndex: 2147483646, | ||
boxShadow: '2px -2px 0px #3760ff, -2px -2px 0px #3760ff, -2px 2px 0px #3760ff, 2px 2px 0px #3760ff', | ||
transition: 'all 0.2s cubic-bezier(0.25, 0.8, 0.25, 1)' | ||
}, | ||
actions: { | ||
display: 'flex', | ||
justifyContent: 'center', | ||
backgroundColor: '#0e181b', | ||
color: '#ffffff', | ||
cursor: 'pointer', | ||
position: 'absolute', | ||
zIndex: 2147483646, | ||
top: 5, | ||
right: 5, | ||
padding: 5, | ||
width: 'initial', | ||
borderRadius: 5 | ||
}, | ||
actionIcon: { | ||
padding: 6 | ||
}, | ||
button: { | ||
fontFamily: 'OutputSans', | ||
fontSize: 13, | ||
zIndex: 2147483646, | ||
textAlign: 'center', | ||
backgroundColor: '#3760FF', | ||
color: '#FFFFFF', | ||
cursor: 'pointer', | ||
boxShadow: 'none', | ||
border: 'none' | ||
}, | ||
buttonTop: { | ||
position: 'absolute', | ||
top: '-20px', | ||
borderTopLeftRadius: 5, | ||
borderTopRightRadius: 5, | ||
width: 65, | ||
height: 20, | ||
right: 0, | ||
left: 0, | ||
marginLeft: 'auto', | ||
marginRight: 'auto' | ||
}, | ||
buttonBottom: { | ||
position: 'absolute', | ||
bottom: '-20px', | ||
borderBottomLeftRadius: 5, | ||
borderBottomRightRadius: 5, | ||
width: 65, | ||
height: 20, | ||
right: 0, | ||
left: 0, | ||
marginLeft: 'auto', | ||
marginRight: 'auto' | ||
}, | ||
buttonIcon: { | ||
width: 10, | ||
display: 'inline', | ||
margin: 0, | ||
padding: 0 | ||
} | ||
@@ -205,3 +204,3 @@ }; | ||
var _useState = (0, _react2.useState)(false), | ||
var _useState = (0, _react.useState)(false), | ||
_useState2 = _slicedToArray(_useState, 2), | ||
@@ -211,3 +210,3 @@ isHovered = _useState2[0], | ||
(0, _react2.useEffect)(function () { | ||
(0, _react.useEffect)(function () { | ||
return isHovered ? onHover && onHover() : onHoverEnd && onHoverEnd(); | ||
@@ -224,27 +223,35 @@ }, [isHovered]); | ||
return isChain ? (0, _react.jsx)("div", { | ||
return isChain ? /*#__PURE__*/React.createElement("div", { | ||
"data-fusion-component": fingerprint, | ||
"data-fusion-plugins": plugins | ||
}, children) : (0, _react.jsx)("div", { | ||
css: [styles.wrapper, isHovered && styles.wrapper.highlighted], | ||
}, children) : /*#__PURE__*/React.createElement("div", { | ||
style: isHovered ? styles.highlightedWrapper : styles.wrapper, | ||
onMouseEnter: onFeatureHover, | ||
onMouseLeave: onFeatureHoverEnd, | ||
"data-fusion-component": fingerprint | ||
}, isHovered && (0, _react.jsx)(React.Fragment, null, (0, _react.jsx)("button", { | ||
css: styles.wrapper.buttonTop, | ||
}, isHovered && /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("button", { | ||
style: _objectSpread(_objectSpread({}, styles.button), styles.buttonTop), | ||
onClick: onAddTop | ||
}, (0, _react.jsx)("i", null, (0, _react.jsx)(PlusIcon, null))), (0, _react.jsx)("button", { | ||
css: styles.wrapper.buttonBottom, | ||
}, /*#__PURE__*/React.createElement("i", { | ||
style: styles.buttonIcon | ||
}, /*#__PURE__*/React.createElement(PlusIcon, null))), /*#__PURE__*/React.createElement("button", { | ||
style: _objectSpread(_objectSpread({}, styles.button), styles.buttonBottom), | ||
onClick: onAddBottom | ||
}, (0, _react.jsx)("i", null, (0, _react.jsx)(PlusIcon, null))), (0, _react.jsx)("div", { | ||
css: styles.wrapper.actions | ||
}, plugins && (0, _react.jsx)("i", { | ||
}, /*#__PURE__*/React.createElement("i", { | ||
style: styles.buttonIcon | ||
}, /*#__PURE__*/React.createElement(PlusIcon, null))), /*#__PURE__*/React.createElement("div", { | ||
style: styles.actions | ||
}, plugins && /*#__PURE__*/React.createElement("i", { | ||
style: styles.actionIcon, | ||
onClick: onPluginLoad | ||
}, (0, _react.jsx)(PluginIcon, null)), (0, _react.jsx)("i", { | ||
}, /*#__PURE__*/React.createElement(PluginIcon, null)), /*#__PURE__*/React.createElement("i", { | ||
style: styles.actionIcon, | ||
onClick: onEdit | ||
}, (0, _react.jsx)(EditIcon, null)), (0, _react.jsx)("i", { | ||
}, /*#__PURE__*/React.createElement(EditIcon, null)), /*#__PURE__*/React.createElement("i", { | ||
style: styles.actionIcon, | ||
onClick: onLocate | ||
}, (0, _react.jsx)(LocatorIcon, null)), (0, _react.jsx)("i", { | ||
}, /*#__PURE__*/React.createElement(LocatorIcon, null)), /*#__PURE__*/React.createElement("i", { | ||
style: styles.actionIcon, | ||
onClick: onDelete | ||
}, (0, _react.jsx)(TrashIcon, null)))), children); | ||
}, /*#__PURE__*/React.createElement(TrashIcon, null)))), children); | ||
}; | ||
@@ -251,0 +258,0 @@ |
{ | ||
"name": "@arc-fusion/pb-editor-wrapper", | ||
"description": "PageBuilder Preview Wrapper", | ||
"version": "1.0.6", | ||
"version": "1.0.7", | ||
"module": "dist/index.js", | ||
@@ -24,3 +24,2 @@ "files": [ | ||
"devDependencies": { | ||
"@emotion/babel-plugin": "^11.3.0", | ||
"@babel/cli": "^7.14.5", | ||
@@ -31,6 +30,3 @@ "@babel/preset-env": "^7.14.5", | ||
"watch": "^1.0.2" | ||
}, | ||
"dependencies": { | ||
"@emotion/react": "^11.4.0" | ||
} | ||
} |
12780
2
5
248
- Removed@emotion/react@^11.4.0