@bigbinary/neeto-site-blocks 1.17.0 → 1.17.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs.js +23 -16
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.js +23 -16
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs.js
CHANGED
|
@@ -7181,24 +7181,31 @@ var Button = function Button(_ref) {
|
|
|
7181
7181
|
};
|
|
7182
7182
|
React.useEffect(function () {
|
|
7183
7183
|
if (!popupCode && !document && disableButtonAndLinks) return;
|
|
7184
|
-
|
|
7185
|
-
|
|
7186
|
-
|
|
7187
|
-
|
|
7188
|
-
|
|
7189
|
-
|
|
7190
|
-
var
|
|
7191
|
-
if (node.
|
|
7192
|
-
script
|
|
7193
|
-
|
|
7184
|
+
try {
|
|
7185
|
+
var tempDiv = document.createElement("div");
|
|
7186
|
+
tempDiv.innerHTML = popupCode;
|
|
7187
|
+
var nodes = Array.from(tempDiv.childNodes);
|
|
7188
|
+
if (ramda.isEmpty(nodes)) return;
|
|
7189
|
+
nodes.forEach(function () {
|
|
7190
|
+
var node = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
7191
|
+
if (node.tagName === "SCRIPT") {
|
|
7192
|
+
var script = document.createElement("script");
|
|
7193
|
+
if (node.src) {
|
|
7194
|
+
script.src = node.src;
|
|
7195
|
+
script.async = node.async || false;
|
|
7196
|
+
} else {
|
|
7197
|
+
script.textContent = node.textContent;
|
|
7198
|
+
}
|
|
7199
|
+
document.body.appendChild(script);
|
|
7194
7200
|
} else {
|
|
7195
|
-
|
|
7201
|
+
document.body.appendChild(node);
|
|
7196
7202
|
}
|
|
7197
|
-
|
|
7198
|
-
|
|
7199
|
-
|
|
7200
|
-
|
|
7201
|
-
|
|
7203
|
+
});
|
|
7204
|
+
} catch (_unused) {
|
|
7205
|
+
// NOTE: An error can occur while the user is typing out the embed code.
|
|
7206
|
+
// It could also throw an error if the embed code is invalid. These errors
|
|
7207
|
+
// are ignored since these cannot be handled by NeetoSite.
|
|
7208
|
+
}
|
|
7202
7209
|
}, [popupCode]);
|
|
7203
7210
|
if (action === "external") {
|
|
7204
7211
|
return /*#__PURE__*/jsxRuntime.jsx(StyledAnchor, _objectSpread$B(_objectSpread$B({}, commonProps), {}, {
|