Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@arc-fusion/pb-editor-wrapper

Package Overview
Dependencies
Maintainers
11
Versions
166
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@arc-fusion/pb-editor-wrapper - npm Package Compare versions

Comparing version 0.0.405 to 0.0.406

60

dist/FeatureWrapper/index.js

@@ -12,8 +12,4 @@ "use strict";

var _reactDom = _interopRequireDefault(require("react-dom"));
var _propTypes = _interopRequireDefault(require("prop-types"));
var _getSiblingNodes = require("./getSiblingNodes");
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

@@ -28,60 +24,4 @@

plugins = _ref.plugins,
isChain = _ref.isChain,
children = _ref.children;
var enterRef = (0, _react.useRef)();
(0, _react.useEffect)(function () {
if (isChain) return;
var enterNode = _reactDom.default === null || _reactDom.default === void 0 ? void 0 : _reactDom.default.findDOMNode(enterRef.current);
addMouseEventsToSiblings(enterNode);
return function () {
removeMouseEventsFromSiblings(enterNode);
};
});
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));
};
function addMouseEventsToSiblings(enterNode) {
var siblingNodes = (0, _getSiblingNodes.getSiblingNodes)(fingerprint, enterNode);
console.log('ADD EVENTS V2', siblingNodes);
siblingNodes === null || siblingNodes === void 0 ? void 0 : siblingNodes.forEach(function (element) {
element === null || element === void 0 ? void 0 : element.addEventListener('mouseenter', onFeatureHover);
element === null || element === void 0 ? void 0 : element.addEventListener('mouseleave', onFeatureHoverEnd);
});
}
function removeMouseEventsFromSiblings(enterNode) {
var siblingNodes = (0, _getSiblingNodes.getSiblingNodes)(fingerprint, enterNode);
console.log('REMOVE EVENTS V2', siblingNodes);
siblingNodes === null || siblingNodes === void 0 ? void 0 : siblingNodes.forEach(function (element) {
element === null || element === void 0 ? void 0 : element.removeEventListener('mouseenter', onFeatureHover);
element === null || element === void 0 ? void 0 : element.removeEventListener('mouseleave', onFeatureHoverEnd);
});
}
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement("fusion-enter", {

@@ -88,0 +28,0 @@ id: "fusion-enter-".concat(fingerprint),

2

package.json
{
"name": "@arc-fusion/pb-editor-wrapper",
"description": "PageBuilder Preview Wrapper",
"version": "0.0.405",
"version": "0.0.406",
"module": "dist/index.js",

@@ -6,0 +6,0 @@ "files": [

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc