@bigbinary/neeto-site-blocks 1.13.5 → 1.13.6
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 +25 -0
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.js +25 -0
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs.js
CHANGED
|
@@ -7141,6 +7141,8 @@ var Button = function Button(_ref) {
|
|
|
7141
7141
|
className = _ref$className === void 0 ? "" : _ref$className,
|
|
7142
7142
|
_ref$action = _ref.action,
|
|
7143
7143
|
action = _ref$action === void 0 ? "" : _ref$action,
|
|
7144
|
+
_ref$popupCode = _ref.popupCode,
|
|
7145
|
+
popupCode = _ref$popupCode === void 0 ? "" : _ref$popupCode,
|
|
7144
7146
|
_ref$draftMode = _ref.draftMode,
|
|
7145
7147
|
draftMode = _ref$draftMode === void 0 ? false : _ref$draftMode,
|
|
7146
7148
|
_ref$baseUrl = _ref.baseUrl,
|
|
@@ -7171,6 +7173,27 @@ var Button = function Button(_ref) {
|
|
|
7171
7173
|
id: id,
|
|
7172
7174
|
"aria-label": label
|
|
7173
7175
|
};
|
|
7176
|
+
React.useEffect(function () {
|
|
7177
|
+
if (!popupCode && !document && disableButtonAndLinks) return;
|
|
7178
|
+
var tempDiv = document.createElement("div");
|
|
7179
|
+
tempDiv.innerHTML = popupCode;
|
|
7180
|
+
var nodes = Array.from(tempDiv.childNodes);
|
|
7181
|
+
if (ramda.isEmpty(nodes)) return;
|
|
7182
|
+
nodes.forEach(function (node) {
|
|
7183
|
+
if (node.tagName === "SCRIPT") {
|
|
7184
|
+
var script = document.createElement("script");
|
|
7185
|
+
if (node.src) {
|
|
7186
|
+
script.src = node.src;
|
|
7187
|
+
script.async = node.async || false;
|
|
7188
|
+
} else {
|
|
7189
|
+
script.textContent = node.textContent;
|
|
7190
|
+
}
|
|
7191
|
+
document.body.appendChild(script);
|
|
7192
|
+
} else {
|
|
7193
|
+
document.body.appendChild(node);
|
|
7194
|
+
}
|
|
7195
|
+
});
|
|
7196
|
+
}, [popupCode]);
|
|
7174
7197
|
if (action === "external") {
|
|
7175
7198
|
return /*#__PURE__*/jsxRuntime.jsx(StyledAnchor, _objectSpread$B(_objectSpread$B({}, commonProps), {}, {
|
|
7176
7199
|
target: "_blank",
|
|
@@ -7188,6 +7211,8 @@ var Button = function Button(_ref) {
|
|
|
7188
7211
|
}));
|
|
7189
7212
|
}
|
|
7190
7213
|
return /*#__PURE__*/jsxRuntime.jsx(StyledAnchor, _objectSpread$B(_objectSpread$B({}, commonProps), {}, {
|
|
7214
|
+
as: "button",
|
|
7215
|
+
href: action === "embed" && "",
|
|
7191
7216
|
children: label
|
|
7192
7217
|
}));
|
|
7193
7218
|
};
|