@arc-fusion/pb-editor-wrapper
Advanced tools
Comparing version 0.0.342 to 0.0.343
@@ -16,3 +16,3 @@ "use strict"; | ||
var _useMutationObserver = _interopRequireDefault(require("@rooks/use-mutation-observer")); | ||
var _rooks = require("rooks"); | ||
@@ -44,3 +44,2 @@ var _getSiblingNodes = require("./getSiblingNodes"); | ||
children = _ref.children; | ||
var enterRef = (0, _react.useRef)(); | ||
@@ -52,2 +51,11 @@ var _useState = (0, _react.useState)(0), | ||
var incrementMutationCount = function incrementMutationCount() { | ||
console.log('HELLO WORLD', mutationCount); | ||
return setMutationCount(mutationCount + 1); | ||
}; | ||
var _useMutationObserverR = (0, _rooks.useMutationObserverRef)(incrementMutationCount), | ||
_useMutationObserverR2 = _slicedToArray(_useMutationObserverR, 1), | ||
myRef = _useMutationObserverR2[0]; | ||
var previewEvents = { | ||
@@ -85,3 +93,3 @@ generateHover: function generateHover(component) { | ||
var enterNode = _reactDom.default.findDOMNode(enterRef.current); | ||
var enterNode = _reactDom.default.findDOMNode(myRef.current); | ||
@@ -95,14 +103,2 @@ var siblingNodes = (0, _getSiblingNodes.getSiblingNodes)(fingerprint, enterNode); | ||
var incrementMutationCount = function incrementMutationCount() { | ||
console.log('HELLO WORLD', mutationCount); | ||
return setMutationCount(mutationCount + 1); | ||
}; | ||
(0, _useMutationObserver.default)(enterRef, incrementMutationCount, { | ||
attributes: false, | ||
characterData: false, | ||
childList: true, | ||
subtree: false | ||
}); | ||
function addMouseEvents(siblingNodes) { | ||
@@ -129,3 +125,3 @@ siblingNodes.forEach(function (element) { | ||
}, | ||
ref: enterRef | ||
ref: myRef | ||
}), children, /*#__PURE__*/_react.default.createElement("fusion-exit", { | ||
@@ -132,0 +128,0 @@ id: "fusion-exit-".concat(fingerprint), |
{ | ||
"name": "@arc-fusion/pb-editor-wrapper", | ||
"description": "PageBuilder Preview Wrapper", | ||
"version": "0.0.342", | ||
"version": "0.0.343", | ||
"module": "dist/index.js", | ||
@@ -6,0 +6,0 @@ "files": [ |
9553
135