@bigbinary/neeto-molecules 5.1.0 → 5.1.1
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/ProductEmbed.js +100 -78
- package/dist/ProductEmbed.js.map +1 -1
- package/dist/cjs/ProductEmbed.js +100 -78
- package/dist/cjs/ProductEmbed.js.map +1 -1
- package/package.json +1 -1
- package/types/ProductEmbed.d.ts +1 -0
package/dist/cjs/ProductEmbed.js
CHANGED
|
@@ -109,25 +109,33 @@ var parseExtraArgs$1 = function parseExtraArgs(extraArgs) {
|
|
|
109
109
|
return "\n".concat(TAB_STRING, " ").concat(key, ": \"").concat(value, "\"");
|
|
110
110
|
});
|
|
111
111
|
};
|
|
112
|
-
var
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
112
|
+
var formatIframeAttributes$1 = function formatIframeAttributes(attributes) {
|
|
113
|
+
return ramda.toPairs(attributes).map(function (_ref3) {
|
|
114
|
+
var _ref4 = _slicedToArray(_ref3, 2),
|
|
115
|
+
key = _ref4[0],
|
|
116
|
+
value = _ref4[1];
|
|
117
|
+
return "\n".concat(TAB_STRING).concat(key, "=\"").concat(value, "\"");
|
|
118
|
+
}).join("");
|
|
119
|
+
};
|
|
120
|
+
var inlineEmbedCode$1 = function inlineEmbedCode(_ref5) {
|
|
121
|
+
var customization = _ref5.customization,
|
|
122
|
+
id = _ref5.id,
|
|
123
|
+
embedScriptLink = _ref5.embedScriptLink,
|
|
124
|
+
extraArgs = _ref5.extraArgs,
|
|
125
|
+
inlineWrapperStyle = _ref5.inlineWrapperStyle,
|
|
126
|
+
iframeStyle = _ref5.iframeStyle,
|
|
127
|
+
queryParams = _ref5.queryParams;
|
|
120
128
|
var elementSelector = customization.elementSelector,
|
|
121
129
|
dynamicHeight = customization.dynamicHeight;
|
|
122
130
|
var processedInlineWrapperStyle = dynamicHeight !== null && dynamicHeight !== void 0 && dynamicHeight.value ? removeHeightFromStyle(inlineWrapperStyle) : inlineWrapperStyle;
|
|
123
131
|
return "\n <!-- ".concat(globalProps.appName, " inline embed code begins -->\n <div style=\"").concat(processedInlineWrapperStyle, "\" id=\"").concat(elementSelector, "\">\n <!-- ").concat(globalProps.appName, " widget will be added here -->\n </div>\n ").concat(embedBaseScript(embedScriptLink), "\n <script>\n ").concat(camelCasedAppName$1, ".embed({\n type: \"inline\",\n id: \"").concat(id, "\",\n organization: \"").concat(globalProps.organization.subdomain, "\",\n elementSelector: \"#").concat(elementSelector, "\",\n styles: \"").concat(iframeStyle, "\", ").concat(embedQueryParam$1(queryParams)).concat(embedEnv$1()).concat(parseExtraArgs$1(extraArgs), "\n });\n </script>\n <!-- ").concat(globalProps.appName, " inline embed code ends -->");
|
|
124
132
|
};
|
|
125
|
-
var floatingPopupEmbedCode$1 = function floatingPopupEmbedCode(
|
|
126
|
-
var customization =
|
|
127
|
-
id =
|
|
128
|
-
embedScriptLink =
|
|
129
|
-
extraArgs =
|
|
130
|
-
queryParams =
|
|
133
|
+
var floatingPopupEmbedCode$1 = function floatingPopupEmbedCode(_ref6) {
|
|
134
|
+
var customization = _ref6.customization,
|
|
135
|
+
id = _ref6.id,
|
|
136
|
+
embedScriptLink = _ref6.embedScriptLink,
|
|
137
|
+
extraArgs = _ref6.extraArgs,
|
|
138
|
+
queryParams = _ref6.queryParams;
|
|
131
139
|
var btnTextColor = customization.btnTextColor,
|
|
132
140
|
showIcon = customization.showIcon,
|
|
133
141
|
btnText = customization.btnText,
|
|
@@ -136,32 +144,33 @@ var floatingPopupEmbedCode$1 = function floatingPopupEmbedCode(_ref4) {
|
|
|
136
144
|
icon = customization.icon;
|
|
137
145
|
return "\n <!-- ".concat(globalProps.appName, " floating-popup embed code begins -->\n ").concat(embedBaseScript(embedScriptLink), "\n <script>\n ").concat(camelCasedAppName$1, ".embed({\n type: \"floatingPopup\",\n id: \"").concat(id, "\",\n organization: \"").concat(globalProps.organization.subdomain, "\",\n styles: {\n btnTextColor: \"").concat(btnTextColor, "\",\n btnPosition: \"").concat(btnPosition, "\",\n btnColor: \"").concat(btnColor, "\",\n btnText: \"").concat(btnText, "\", ").concat(icon ? "\n".concat(TAB_STRING).concat(TAB_STRING, "showIcon: ").concat(showIcon, ",") : "", "\n },").concat(embedQueryParam$1(queryParams)).concat(embedEnv$1()).concat(parseExtraArgs$1(extraArgs), "\n });\n </script>\n <!-- ").concat(globalProps.appName, " floating-popup embed code ends -->");
|
|
138
146
|
};
|
|
139
|
-
var elementPopupEmbedCode$1 = function elementPopupEmbedCode(
|
|
140
|
-
var customization =
|
|
141
|
-
id =
|
|
142
|
-
embedScriptLink =
|
|
143
|
-
extraArgs =
|
|
144
|
-
queryParams =
|
|
147
|
+
var elementPopupEmbedCode$1 = function elementPopupEmbedCode(_ref7) {
|
|
148
|
+
var customization = _ref7.customization,
|
|
149
|
+
id = _ref7.id,
|
|
150
|
+
embedScriptLink = _ref7.embedScriptLink,
|
|
151
|
+
extraArgs = _ref7.extraArgs,
|
|
152
|
+
queryParams = _ref7.queryParams;
|
|
145
153
|
var elementSelector = customization.elementSelector;
|
|
146
154
|
return "\n <!-- This is a demo button, you can use any element on your website instead. -->\n <!-- <button id=\"".concat(elementSelector, "\">Click to open popup</button> -->\n\n <!-- ").concat(globalProps.appName, " element-click embed code begins -->\n ").concat(embedBaseScript(embedScriptLink), "\n <script>\n ").concat(camelCasedAppName$1, ".embed({\n type: \"elementClick\",\n id: \"").concat(id, "\",\n organization: \"").concat(globalProps.organization.subdomain, "\",\n elementSelector: \"#").concat(elementSelector, "\",").concat(embedQueryParam$1(queryParams)).concat(embedEnv$1()).concat(parseExtraArgs$1(extraArgs), "\n });\n </script>\n <!-- ").concat(globalProps.appName, " element-click embed code ends -->");
|
|
147
155
|
};
|
|
148
|
-
var iframeEmbedCode$1 = function iframeEmbedCode(
|
|
149
|
-
var id =
|
|
150
|
-
customization =
|
|
151
|
-
queryParams =
|
|
152
|
-
embedScriptLink =
|
|
156
|
+
var iframeEmbedCode$1 = function iframeEmbedCode(_ref8) {
|
|
157
|
+
var id = _ref8.id,
|
|
158
|
+
customization = _ref8.customization,
|
|
159
|
+
queryParams = _ref8.queryParams,
|
|
160
|
+
embedScriptLink = _ref8.embedScriptLink;
|
|
153
161
|
var height = customization.height,
|
|
154
162
|
width = customization.width,
|
|
155
163
|
iframeTitle = customization.iframeTitle,
|
|
156
164
|
iframeUrl = customization.iframeUrl,
|
|
157
|
-
dynamicHeight = customization.dynamicHeight
|
|
165
|
+
dynamicHeight = customization.dynamicHeight,
|
|
166
|
+
iframeAttributes = customization.iframeAttributes;
|
|
158
167
|
var iframeSrc = buildIframeURL$1({
|
|
159
168
|
id: id,
|
|
160
169
|
iframeUrl: iframeUrl,
|
|
161
170
|
queryParams: queryParams
|
|
162
171
|
});
|
|
163
172
|
var heightAttribute = dynamicHeight !== null && dynamicHeight !== void 0 && dynamicHeight.value ? "" : "\n".concat(TAB_STRING, "height=\"").concat(height, "\"");
|
|
164
|
-
return "\n <!-- ".concat(globalProps.appName, " iframe embed code begins -->\n ").concat(dynamicHeight !== null && dynamicHeight !== void 0 && dynamicHeight.value && embedScriptLink ? embedBaseScript(embedScriptLink) : "", "\n <iframe\n allowfullscreen").concat(heightAttribute, "\n width=\"").concat(width, "\"\n frameborder=\"0\"\n title=\"").concat(iframeTitle, "\"\n src=\"").concat(iframeSrc, "\"\n ></iframe>\n <!-- ").concat(globalProps.appName, " iframe embed code ends -->");
|
|
173
|
+
return "\n <!-- ".concat(globalProps.appName, " iframe embed code begins -->\n ").concat(dynamicHeight !== null && dynamicHeight !== void 0 && dynamicHeight.value && embedScriptLink ? embedBaseScript(embedScriptLink) : "", "\n <iframe\n allowfullscreen").concat(heightAttribute, "\n width=\"").concat(width, "\"\n frameborder=\"0\"\n title=\"").concat(iframeTitle, "\"\n src=\"").concat(iframeSrc, "\"").concat(formatIframeAttributes$1(iframeAttributes), "\n ></iframe>\n <!-- ").concat(globalProps.appName, " iframe embed code ends -->");
|
|
165
174
|
};
|
|
166
175
|
var htmlCodeGenerators = {
|
|
167
176
|
inline: inlineEmbedCode$1,
|
|
@@ -190,6 +199,14 @@ var parseExtraArgs = function parseExtraArgs(extraArgs) {
|
|
|
190
199
|
return "\n".concat(TAB_STRING).concat(TAB_STRING).concat(key, ": \"").concat(value, "\"");
|
|
191
200
|
});
|
|
192
201
|
};
|
|
202
|
+
var formatIframeAttributes = function formatIframeAttributes(attributes) {
|
|
203
|
+
return ramda.toPairs(attributes).map(function (_ref3) {
|
|
204
|
+
var _ref4 = _slicedToArray(_ref3, 2),
|
|
205
|
+
key = _ref4[0],
|
|
206
|
+
value = _ref4[1];
|
|
207
|
+
return "\n".concat(TAB_STRING).concat(TAB_STRING, " ").concat(key, "=\"").concat(value, "\"");
|
|
208
|
+
}).join("");
|
|
209
|
+
};
|
|
193
210
|
var parseInlineStyle = function parseInlineStyle(styleString) {
|
|
194
211
|
return styleString.split(";").map(function (rule) {
|
|
195
212
|
var _rule$split$map = rule.split(":").map(function (s) {
|
|
@@ -201,25 +218,25 @@ var parseInlineStyle = function parseInlineStyle(styleString) {
|
|
|
201
218
|
return key && value ? "".concat(key, ": \"").concat(value, "\"") : null;
|
|
202
219
|
}).filter(Boolean).join(", ");
|
|
203
220
|
};
|
|
204
|
-
var inlineEmbedCode = function inlineEmbedCode(
|
|
205
|
-
var customization =
|
|
206
|
-
id =
|
|
207
|
-
embedScriptLink =
|
|
208
|
-
extraArgs =
|
|
209
|
-
inlineWrapperStyle =
|
|
210
|
-
iframeStyle =
|
|
211
|
-
queryParams =
|
|
221
|
+
var inlineEmbedCode = function inlineEmbedCode(_ref5) {
|
|
222
|
+
var customization = _ref5.customization,
|
|
223
|
+
id = _ref5.id,
|
|
224
|
+
embedScriptLink = _ref5.embedScriptLink,
|
|
225
|
+
extraArgs = _ref5.extraArgs,
|
|
226
|
+
inlineWrapperStyle = _ref5.inlineWrapperStyle,
|
|
227
|
+
iframeStyle = _ref5.iframeStyle,
|
|
228
|
+
queryParams = _ref5.queryParams;
|
|
212
229
|
var elementSelector = customization.elementSelector,
|
|
213
230
|
dynamicHeight = customization.dynamicHeight;
|
|
214
231
|
var processedInlineWrapperStyle = dynamicHeight !== null && dynamicHeight !== void 0 && dynamicHeight.value ? removeHeightFromStyle(inlineWrapperStyle) : inlineWrapperStyle;
|
|
215
232
|
return "\n import { useEffect } from \"react\";\n\n const App = () => {\n const ".concat(embedFunctionName, " = () => {\n ").concat(embedScript(embedScriptLink), "\n embedScript.onload = () => {\n window.").concat(camelCasedAppName, ".embed({\n type: \"inline\",\n id: \"").concat(id, "\",\n organization: \"").concat(globalProps.organization.subdomain, "\",\n elementSelector: \"#").concat(elementSelector, "\",\n styles: \"").concat(iframeStyle, "\",").concat(embedQueryParam(queryParams)).concat(embedEnv()).concat(parseExtraArgs(extraArgs), "\n });\n };\n\n document.body.appendChild(embedScript);\n ").concat(cleanupFunction, "\n };\n\n useEffect(() => ").concat(embedFunctionName, "(), []);\n\n return (\n <div\n id=\"inline-embed-container\"\n style={{ ").concat(parseInlineStyle(processedInlineWrapperStyle), " }}\n />\n );\n };");
|
|
216
233
|
};
|
|
217
|
-
var floatingPopupEmbedCode = function floatingPopupEmbedCode(
|
|
218
|
-
var customization =
|
|
219
|
-
id =
|
|
220
|
-
embedScriptLink =
|
|
221
|
-
extraArgs =
|
|
222
|
-
queryParams =
|
|
234
|
+
var floatingPopupEmbedCode = function floatingPopupEmbedCode(_ref6) {
|
|
235
|
+
var customization = _ref6.customization,
|
|
236
|
+
id = _ref6.id,
|
|
237
|
+
embedScriptLink = _ref6.embedScriptLink,
|
|
238
|
+
extraArgs = _ref6.extraArgs,
|
|
239
|
+
queryParams = _ref6.queryParams;
|
|
223
240
|
var btnTextColor = customization.btnTextColor,
|
|
224
241
|
showIcon = customization.showIcon,
|
|
225
242
|
btnText = customization.btnText,
|
|
@@ -228,31 +245,32 @@ var floatingPopupEmbedCode = function floatingPopupEmbedCode(_ref4) {
|
|
|
228
245
|
icon = customization.icon;
|
|
229
246
|
return "\n import { useEffect } from \"react\";\n\n const App = () => {\n const ".concat(embedFunctionName, " = () => {\n ").concat(embedScript(embedScriptLink), "\n embedScript.onload = () => {\n window.").concat(camelCasedAppName, ".embed({\n type: \"floatingPopup\",\n id: \"").concat(id, "\",\n organization: \"").concat(globalProps.organization.subdomain, "\",\n styles: {\n btnTextColor: \"").concat(btnTextColor, "\",\n btnPosition: \"").concat(btnPosition, "\",\n btnColor: \"").concat(btnColor, "\",\n btnText: \"").concat(btnText, "\",").concat(icon ? "\n".concat(TAB_STRING).concat(TAB_STRING).concat(TAB_STRING, "showIcon: ").concat(showIcon, ",") : "", "\n },").concat(embedQueryParam(queryParams)).concat(embedEnv()).concat(parseExtraArgs(extraArgs), "\n });\n };\n\n document.body.appendChild(embedScript);\n ").concat(cleanupFunction, "\n };\n\n useEffect(() => ").concat(embedFunctionName, "(), []);\n\n return <div />;\n };");
|
|
230
247
|
};
|
|
231
|
-
var elementPopupEmbedCode = function elementPopupEmbedCode(
|
|
232
|
-
var customization =
|
|
233
|
-
id =
|
|
234
|
-
embedScriptLink =
|
|
235
|
-
extraArgs =
|
|
236
|
-
queryParams =
|
|
248
|
+
var elementPopupEmbedCode = function elementPopupEmbedCode(_ref7) {
|
|
249
|
+
var customization = _ref7.customization,
|
|
250
|
+
id = _ref7.id,
|
|
251
|
+
embedScriptLink = _ref7.embedScriptLink,
|
|
252
|
+
extraArgs = _ref7.extraArgs,
|
|
253
|
+
queryParams = _ref7.queryParams;
|
|
237
254
|
var elementSelector = customization.elementSelector;
|
|
238
255
|
return "\n import { useEffect } from \"react\";\n\n const App = () => {\n const ".concat(embedFunctionName, " = () => {\n ").concat(embedScript(embedScriptLink), "\n embedScript.onload = () => {\n window.").concat(camelCasedAppName, ".embed({\n type: \"elementClick\",\n id: \"").concat(id, "\",\n organization: \"").concat(globalProps.organization.subdomain, "\",\n elementSelector: \"#").concat(elementSelector, "\",").concat(embedQueryParam(queryParams)).concat(embedEnv()).concat(parseExtraArgs(extraArgs), "\n });\n };\n\n document.body.appendChild(embedScript);\n ").concat(cleanupFunction, "\n };\n\n useEffect(() => ").concat(embedFunctionName, "(), []);\n\n return <button id=\"").concat(elementSelector, "\">Click to open popup</button>;\n };");
|
|
239
256
|
};
|
|
240
|
-
var iframeEmbedCode = function iframeEmbedCode(
|
|
241
|
-
var customization =
|
|
242
|
-
id =
|
|
243
|
-
queryParams =
|
|
257
|
+
var iframeEmbedCode = function iframeEmbedCode(_ref8) {
|
|
258
|
+
var customization = _ref8.customization,
|
|
259
|
+
id = _ref8.id,
|
|
260
|
+
queryParams = _ref8.queryParams;
|
|
244
261
|
var height = customization.height,
|
|
245
262
|
width = customization.width,
|
|
246
263
|
iframeTitle = customization.iframeTitle,
|
|
247
264
|
iframeUrl = customization.iframeUrl,
|
|
248
|
-
dynamicHeight = customization.dynamicHeight
|
|
265
|
+
dynamicHeight = customization.dynamicHeight,
|
|
266
|
+
iframeAttributes = customization.iframeAttributes;
|
|
249
267
|
var iframeSrc = buildIframeURL$1({
|
|
250
268
|
id: id,
|
|
251
269
|
iframeUrl: iframeUrl,
|
|
252
270
|
queryParams: queryParams
|
|
253
271
|
});
|
|
254
272
|
var heightAttribute = dynamicHeight !== null && dynamicHeight !== void 0 && dynamicHeight.value ? "" : "\n".concat(TAB_STRING).concat(TAB_STRING, " height=\"").concat(height, "\"");
|
|
255
|
-
return "\n const App = () => {\n return (\n <>\n {/* ".concat(globalProps.appName, " iframe embed code begins */}\n <iframe\n allowFullScreen").concat(heightAttribute, "\n width=\"").concat(width, "\"\n frameBorder=\"0\"\n title=\"").concat(iframeTitle, "\"\n src=\"").concat(iframeSrc, "\"\n ></iframe>\n {/* ").concat(globalProps.appName, " iframe embed code ends */}\n </>\n );\n };\n");
|
|
273
|
+
return "\n const App = () => {\n return (\n <>\n {/* ".concat(globalProps.appName, " iframe embed code begins */}\n <iframe\n allowFullScreen").concat(heightAttribute, "\n width=\"").concat(width, "\"\n frameBorder=\"0\"\n title=\"").concat(iframeTitle, "\"\n src=\"").concat(iframeSrc, "\"").concat(formatIframeAttributes(iframeAttributes), "\n ></iframe>\n {/* ").concat(globalProps.appName, " iframe embed code ends */}\n </>\n );\n };\n");
|
|
256
274
|
};
|
|
257
275
|
var reactCodeGenerators = {
|
|
258
276
|
inline: inlineEmbedCode,
|
|
@@ -262,8 +280,8 @@ var reactCodeGenerators = {
|
|
|
262
280
|
};
|
|
263
281
|
|
|
264
282
|
var _excluded$1 = ["selectedLanguage", "type"];
|
|
265
|
-
function ownKeys$
|
|
266
|
-
function _objectSpread$
|
|
283
|
+
function ownKeys$8(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
284
|
+
function _objectSpread$8(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$8(Object(t), true).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$8(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
267
285
|
var buildQueryParams$1 = function buildQueryParams() {
|
|
268
286
|
var customization = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
269
287
|
var existingQueryParams = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
@@ -273,7 +291,7 @@ var buildQueryParams$1 = function buildQueryParams() {
|
|
|
273
291
|
if (value) acc[key] = value;
|
|
274
292
|
return acc;
|
|
275
293
|
}, {});
|
|
276
|
-
var mergedQueryParams = _objectSpread$
|
|
294
|
+
var mergedQueryParams = _objectSpread$8(_objectSpread$8({}, existingQueryParams), activeOptions);
|
|
277
295
|
if (ramda.isEmpty(mergedQueryParams)) return "";
|
|
278
296
|
return JSON.stringify(mergedQueryParams, null, 2).replace(/\n/g, " ").replace(/\s\s+/g, " ");
|
|
279
297
|
};
|
|
@@ -284,7 +302,7 @@ var generateCode = function generateCode(options) {
|
|
|
284
302
|
embeddedCodeOptions = _objectWithoutProperties(options, _excluded$1);
|
|
285
303
|
var queryParams = ((_embeddedCodeOptions$ = embeddedCodeOptions.customization) === null || _embeddedCodeOptions$ === void 0 ? void 0 : _embeddedCodeOptions$.queryParams) || {};
|
|
286
304
|
var customization = embeddedCodeOptions.customization || {};
|
|
287
|
-
var codeOptions = _objectSpread$
|
|
305
|
+
var codeOptions = _objectSpread$8(_objectSpread$8({}, embeddedCodeOptions), {}, {
|
|
288
306
|
queryParams: buildQueryParams$1(customization, queryParams)
|
|
289
307
|
});
|
|
290
308
|
return selectedLanguage === "react" ? (_reactCodeGenerators$ = reactCodeGenerators[type]) === null || _reactCodeGenerators$ === void 0 ? void 0 : _reactCodeGenerators$.call(reactCodeGenerators, codeOptions) : (_htmlCodeGenerators$t = htmlCodeGenerators[type]) === null || _htmlCodeGenerators$t === void 0 ? void 0 : _htmlCodeGenerators$t.call(htmlCodeGenerators, codeOptions);
|
|
@@ -329,8 +347,8 @@ var removeHeightFromStyle = function removeHeightFromStyle(style) {
|
|
|
329
347
|
return style.replace(/height\s*:\s*[^;]+;?\s*/g, "").trim();
|
|
330
348
|
};
|
|
331
349
|
|
|
332
|
-
function ownKeys$
|
|
333
|
-
function _objectSpread$
|
|
350
|
+
function ownKeys$7(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
351
|
+
function _objectSpread$7(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$7(Object(t), true).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$7(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
334
352
|
var DynamicQueryParams = function DynamicQueryParams(_ref) {
|
|
335
353
|
var updateCustomization = _ref.updateCustomization;
|
|
336
354
|
var _useTranslation = reactI18next.useTranslation(),
|
|
@@ -356,7 +374,7 @@ var DynamicQueryParams = function DynamicQueryParams(_ref) {
|
|
|
356
374
|
};
|
|
357
375
|
var handleInputChange = function handleInputChange(index, field, value) {
|
|
358
376
|
var newQueryParams = queryParams.map(function (param, i) {
|
|
359
|
-
return i === index ? _objectSpread$
|
|
377
|
+
return i === index ? _objectSpread$7(_objectSpread$7({}, param), {}, _defineProperty({}, field, value)) : param;
|
|
360
378
|
});
|
|
361
379
|
setQueryParams(newQueryParams);
|
|
362
380
|
};
|
|
@@ -372,7 +390,7 @@ var DynamicQueryParams = function DynamicQueryParams(_ref) {
|
|
|
372
390
|
children: [/*#__PURE__*/jsxRuntime.jsx(Label, {
|
|
373
391
|
"data-testid": "dynamic-query-params-label",
|
|
374
392
|
children: queryParamsProps.label || t("neetoMolecules.productEmbed.queryParam.label")
|
|
375
|
-
}), neetoCist.isPresent(queryParamsProps.helpPopoverProps) && /*#__PURE__*/jsxRuntime.jsx(HelpPopover, _objectSpread$
|
|
393
|
+
}), neetoCist.isPresent(queryParamsProps.helpPopoverProps) && /*#__PURE__*/jsxRuntime.jsx(HelpPopover, _objectSpread$7({
|
|
376
394
|
className: "ms-1"
|
|
377
395
|
}, queryParamsProps.helpPopoverProps))]
|
|
378
396
|
}), queryParams.map(function (param, index) {
|
|
@@ -552,8 +570,8 @@ var FloatingPopup$1 = function FloatingPopup(_ref) {
|
|
|
552
570
|
};
|
|
553
571
|
|
|
554
572
|
var _excluded = ["value", "label", "helpIconProps"];
|
|
555
|
-
function ownKeys$
|
|
556
|
-
function _objectSpread$
|
|
573
|
+
function ownKeys$6(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
574
|
+
function _objectSpread$6(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$6(Object(t), true).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$6(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
557
575
|
var SwitchOptions = function SwitchOptions(_ref) {
|
|
558
576
|
var _ref$customization = _ref.customization,
|
|
559
577
|
customization = _ref$customization === void 0 ? {} : _ref$customization,
|
|
@@ -578,12 +596,12 @@ var SwitchOptions = function SwitchOptions(_ref) {
|
|
|
578
596
|
checked: value,
|
|
579
597
|
label: label || SWITCH_OPTIONS[option].label,
|
|
580
598
|
labelProps: helpIconProps && {
|
|
581
|
-
helpIconProps: _objectSpread$
|
|
599
|
+
helpIconProps: _objectSpread$6({
|
|
582
600
|
"data-testid": "help-icon-button"
|
|
583
601
|
}, helpIconProps)
|
|
584
602
|
},
|
|
585
603
|
onChange: function onChange(e) {
|
|
586
|
-
return updateCustomization(_defineProperty({}, option, _objectSpread$
|
|
604
|
+
return updateCustomization(_defineProperty({}, option, _objectSpread$6(_objectSpread$6({}, rest), {}, {
|
|
587
605
|
label: label,
|
|
588
606
|
helpIconProps: helpIconProps,
|
|
589
607
|
value: e.target.checked
|
|
@@ -666,11 +684,11 @@ var Inline$1 = function Inline(_ref) {
|
|
|
666
684
|
});
|
|
667
685
|
};
|
|
668
686
|
|
|
669
|
-
function ownKeys$
|
|
670
|
-
function _objectSpread$
|
|
687
|
+
function ownKeys$5(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
688
|
+
function _objectSpread$5(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$5(Object(t), true).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$5(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
671
689
|
var InlineEmbedIcon = function InlineEmbedIcon(_ref) {
|
|
672
690
|
var other = Object.assign({}, (_objectDestructuringEmpty(_ref), _ref));
|
|
673
|
-
return /*#__PURE__*/jsxRuntime.jsxs("svg", _objectSpread$
|
|
691
|
+
return /*#__PURE__*/jsxRuntime.jsxs("svg", _objectSpread$5(_objectSpread$5({
|
|
674
692
|
fill: "none",
|
|
675
693
|
height: "163",
|
|
676
694
|
viewBox: "0 0 278 163",
|
|
@@ -919,7 +937,7 @@ var InlineEmbedIcon = function InlineEmbedIcon(_ref) {
|
|
|
919
937
|
};
|
|
920
938
|
var FloatingPopupIcon = function FloatingPopupIcon(_ref2) {
|
|
921
939
|
var other = Object.assign({}, (_objectDestructuringEmpty(_ref2), _ref2));
|
|
922
|
-
return /*#__PURE__*/jsxRuntime.jsxs("svg", _objectSpread$
|
|
940
|
+
return /*#__PURE__*/jsxRuntime.jsxs("svg", _objectSpread$5(_objectSpread$5({
|
|
923
941
|
fill: "none",
|
|
924
942
|
height: "163",
|
|
925
943
|
viewBox: "0 0 278 163",
|
|
@@ -1063,7 +1081,7 @@ var FloatingPopupIcon = function FloatingPopupIcon(_ref2) {
|
|
|
1063
1081
|
};
|
|
1064
1082
|
var ElementPopupIcon = function ElementPopupIcon(_ref3) {
|
|
1065
1083
|
var other = Object.assign({}, (_objectDestructuringEmpty(_ref3), _ref3));
|
|
1066
|
-
return /*#__PURE__*/jsxRuntime.jsxs("svg", _objectSpread$
|
|
1084
|
+
return /*#__PURE__*/jsxRuntime.jsxs("svg", _objectSpread$5(_objectSpread$5({
|
|
1067
1085
|
fill: "none",
|
|
1068
1086
|
height: "163",
|
|
1069
1087
|
viewBox: "0 0 278 163",
|
|
@@ -1289,11 +1307,11 @@ var Code = function Code(_ref) {
|
|
|
1289
1307
|
});
|
|
1290
1308
|
};
|
|
1291
1309
|
|
|
1292
|
-
function ownKeys$
|
|
1293
|
-
function _objectSpread$
|
|
1310
|
+
function ownKeys$4(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
1311
|
+
function _objectSpread$4(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$4(Object(t), true).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$4(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
1294
1312
|
var FloatingPopupPlaceholderImage = function FloatingPopupPlaceholderImage(_ref) {
|
|
1295
1313
|
var other = Object.assign({}, (_objectDestructuringEmpty(_ref), _ref));
|
|
1296
|
-
return /*#__PURE__*/jsxRuntime.jsxs("svg", _objectSpread$
|
|
1314
|
+
return /*#__PURE__*/jsxRuntime.jsxs("svg", _objectSpread$4(_objectSpread$4({
|
|
1297
1315
|
fill: "none",
|
|
1298
1316
|
height: "518",
|
|
1299
1317
|
viewBox: "0 0 796 518",
|
|
@@ -1353,7 +1371,7 @@ var FloatingPopupPlaceholderImage = function FloatingPopupPlaceholderImage(_ref)
|
|
|
1353
1371
|
};
|
|
1354
1372
|
var ElementPopupPlaceholderImage = function ElementPopupPlaceholderImage(_ref2) {
|
|
1355
1373
|
var other = Object.assign({}, (_objectDestructuringEmpty(_ref2), _ref2));
|
|
1356
|
-
return /*#__PURE__*/jsxRuntime.jsxs("svg", _objectSpread$
|
|
1374
|
+
return /*#__PURE__*/jsxRuntime.jsxs("svg", _objectSpread$4(_objectSpread$4({
|
|
1357
1375
|
fill: "none",
|
|
1358
1376
|
height: "518",
|
|
1359
1377
|
viewBox: "0 0 748 518",
|
|
@@ -1496,24 +1514,28 @@ function useIframeHeightReset(iframeRef, dynamicHeight) {
|
|
|
1496
1514
|
}, [dynamicHeight === null || dynamicHeight === void 0 ? void 0 : dynamicHeight.value, iframeRef]);
|
|
1497
1515
|
}
|
|
1498
1516
|
|
|
1517
|
+
function ownKeys$3(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
1518
|
+
function _objectSpread$3(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$3(Object(t), true).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$3(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
1499
1519
|
var Iframe = function Iframe(_ref) {
|
|
1500
1520
|
var iframeURL = _ref.iframeURL,
|
|
1501
1521
|
customization = _ref.customization;
|
|
1502
1522
|
var height = customization.height,
|
|
1503
1523
|
width = customization.width,
|
|
1504
1524
|
iframeTitle = customization.iframeTitle,
|
|
1505
|
-
dynamicHeight = customization.dynamicHeight
|
|
1525
|
+
dynamicHeight = customization.dynamicHeight,
|
|
1526
|
+
iframeAttributes = customization.iframeAttributes;
|
|
1506
1527
|
var iframeRef = React.useRef(null);
|
|
1507
1528
|
useIframeHeightReset(iframeRef, dynamicHeight);
|
|
1508
|
-
return /*#__PURE__*/jsxRuntime.jsx("iframe", {
|
|
1529
|
+
return /*#__PURE__*/jsxRuntime.jsx("iframe", _objectSpread$3(_objectSpread$3({}, _objectSpread$3(_objectSpread$3({}, iframeAttributes), {}, {
|
|
1509
1530
|
height: height,
|
|
1510
|
-
width: width
|
|
1531
|
+
width: width
|
|
1532
|
+
})), {}, {
|
|
1511
1533
|
allowFullScreen: true,
|
|
1512
1534
|
className: "m-auto border-0",
|
|
1513
1535
|
ref: iframeRef,
|
|
1514
1536
|
src: iframeURL,
|
|
1515
1537
|
title: iframeTitle
|
|
1516
|
-
});
|
|
1538
|
+
}));
|
|
1517
1539
|
};
|
|
1518
1540
|
|
|
1519
1541
|
var Inline = function Inline(_ref) {
|