@bigbinary/neeto-site-blocks 1.17.1 → 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 CHANGED
@@ -7181,25 +7181,31 @@ var Button = function Button(_ref) {
7181
7181
  };
7182
7182
  React.useEffect(function () {
7183
7183
  if (!popupCode && !document && disableButtonAndLinks) return;
7184
- var tempDiv = document.createElement("div");
7185
- tempDiv.innerHTML = popupCode;
7186
- var nodes = Array.from(tempDiv.childNodes);
7187
- if (ramda.isEmpty(nodes)) return;
7188
- nodes.forEach(function () {
7189
- var node = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
7190
- if (node.tagName === "SCRIPT") {
7191
- var script = document.createElement("script");
7192
- if (node.src) {
7193
- script.src = node.src;
7194
- script.async = node.async || false;
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);
7195
7200
  } else {
7196
- script.textContent = node.textContent;
7201
+ document.body.appendChild(node);
7197
7202
  }
7198
- document.body.appendChild(script);
7199
- } else {
7200
- document.body.appendChild(node);
7201
- }
7202
- });
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
+ }
7203
7209
  }, [popupCode]);
7204
7210
  if (action === "external") {
7205
7211
  return /*#__PURE__*/jsxRuntime.jsx(StyledAnchor, _objectSpread$B(_objectSpread$B({}, commonProps), {}, {