@bigbinary/neeto-molecules 3.16.51 → 3.16.53
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 +19 -55
- package/dist/ProductEmbed.js.map +1 -1
- package/dist/SessionEnvironment.js +1 -1
- package/dist/cjs/ProductEmbed.js +19 -55
- package/dist/cjs/ProductEmbed.js.map +1 -1
- package/dist/cjs/SessionEnvironment.js +1 -1
- package/package.json +1 -1
- package/types/ProductEmbed.d.ts +1 -0
package/dist/ProductEmbed.js
CHANGED
|
@@ -107,14 +107,11 @@ var inlineEmbedCode$1 = function inlineEmbedCode(_ref3) {
|
|
|
107
107
|
id = _ref3.id,
|
|
108
108
|
embedScriptLink = _ref3.embedScriptLink,
|
|
109
109
|
extraArgs = _ref3.extraArgs,
|
|
110
|
-
inlineWrapperStyle = _ref3.inlineWrapperStyle
|
|
110
|
+
inlineWrapperStyle = _ref3.inlineWrapperStyle,
|
|
111
|
+
iframeStyle = _ref3.iframeStyle;
|
|
111
112
|
var elementSelector = customization.elementSelector,
|
|
112
|
-
_customization$width = customization.width,
|
|
113
|
-
width = _customization$width === void 0 ? 100 : _customization$width,
|
|
114
|
-
_customization$height = customization.height,
|
|
115
|
-
height = _customization$height === void 0 ? 100 : _customization$height,
|
|
116
113
|
queryParams = customization.queryParams;
|
|
117
|
-
return "\n <!-- ".concat(globalProps.appName, " inline embed code begins -->\n <div style=\"").concat(inlineWrapperStyle
|
|
114
|
+
return "\n <!-- ".concat(globalProps.appName, " inline embed code begins -->\n <div style=\"").concat(inlineWrapperStyle, "\" 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 -->");
|
|
118
115
|
};
|
|
119
116
|
var floatingPopupEmbedCode$1 = function floatingPopupEmbedCode(_ref4) {
|
|
120
117
|
var customization = _ref4.customization,
|
|
@@ -166,7 +163,7 @@ var parseExtraArgs = function parseExtraArgs(extraArgs) {
|
|
|
166
163
|
});
|
|
167
164
|
};
|
|
168
165
|
var parseInlineStyle = function parseInlineStyle(styleString) {
|
|
169
|
-
return styleString
|
|
166
|
+
return styleString.split(";").map(function (rule) {
|
|
170
167
|
var _rule$split$map = rule.split(":").map(function (s) {
|
|
171
168
|
return s.trim();
|
|
172
169
|
}),
|
|
@@ -174,21 +171,18 @@ var parseInlineStyle = function parseInlineStyle(styleString) {
|
|
|
174
171
|
key = _rule$split$map2[0],
|
|
175
172
|
value = _rule$split$map2[1];
|
|
176
173
|
return key && value ? "".concat(key, ": \"").concat(value, "\"") : null;
|
|
177
|
-
}).filter(Boolean).join(", ")
|
|
174
|
+
}).filter(Boolean).join(", ");
|
|
178
175
|
};
|
|
179
176
|
var inlineEmbedCode = function inlineEmbedCode(_ref3) {
|
|
180
177
|
var customization = _ref3.customization,
|
|
181
178
|
id = _ref3.id,
|
|
182
179
|
embedScriptLink = _ref3.embedScriptLink,
|
|
183
180
|
extraArgs = _ref3.extraArgs,
|
|
184
|
-
inlineWrapperStyle = _ref3.inlineWrapperStyle
|
|
181
|
+
inlineWrapperStyle = _ref3.inlineWrapperStyle,
|
|
182
|
+
iframeStyle = _ref3.iframeStyle;
|
|
185
183
|
var elementSelector = customization.elementSelector,
|
|
186
|
-
_customization$width = customization.width,
|
|
187
|
-
width = _customization$width === void 0 ? 100 : _customization$width,
|
|
188
|
-
_customization$height = customization.height,
|
|
189
|
-
height = _customization$height === void 0 ? 100 : _customization$height,
|
|
190
184
|
queryParams = customization.queryParams;
|
|
191
|
-
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:
|
|
185
|
+
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(inlineWrapperStyle), " }}\n />\n );\n };");
|
|
192
186
|
};
|
|
193
187
|
var floatingPopupEmbedCode = function floatingPopupEmbedCode(_ref4) {
|
|
194
188
|
var customization = _ref4.customization,
|
|
@@ -202,7 +196,7 @@ var floatingPopupEmbedCode = function floatingPopupEmbedCode(_ref4) {
|
|
|
202
196
|
btnColor = customization.btnColor,
|
|
203
197
|
icon = customization.icon,
|
|
204
198
|
queryParams = customization.queryParams;
|
|
205
|
-
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, "
|
|
199
|
+
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 };");
|
|
206
200
|
};
|
|
207
201
|
var elementPopupEmbedCode = function elementPopupEmbedCode(_ref5) {
|
|
208
202
|
var customization = _ref5.customization,
|
|
@@ -492,9 +486,7 @@ var Inline$1 = function Inline(_ref) {
|
|
|
492
486
|
};
|
|
493
487
|
}, shallow),
|
|
494
488
|
isQueryParamsEnabled = _useProductEmbedStore.isQueryParamsEnabled;
|
|
495
|
-
var
|
|
496
|
-
width = customization.width,
|
|
497
|
-
elementSelector = customization.elementSelector;
|
|
489
|
+
var elementSelector = customization.elementSelector;
|
|
498
490
|
var handleInputChange = function handleInputChange(_ref2, attribute) {
|
|
499
491
|
var value = _ref2.target.value;
|
|
500
492
|
return updateCustomization(_defineProperty({}, attribute, value));
|
|
@@ -507,41 +499,6 @@ var Inline$1 = function Inline(_ref) {
|
|
|
507
499
|
}, []);
|
|
508
500
|
return /*#__PURE__*/jsxs(Fragment, {
|
|
509
501
|
children: [/*#__PURE__*/jsxs("div", {
|
|
510
|
-
className: "flex flex-col gap-2",
|
|
511
|
-
children: [/*#__PURE__*/jsx(Label, {
|
|
512
|
-
"data-cy": "window-size-text",
|
|
513
|
-
children: t("neetoMolecules.productEmbed.inline.sizeOfEmbedWindow")
|
|
514
|
-
}), /*#__PURE__*/jsxs("div", {
|
|
515
|
-
className: "flex justify-between gap-x-2",
|
|
516
|
-
children: [/*#__PURE__*/jsx(Input, {
|
|
517
|
-
className: "neeto-molecules-product-embed-size-input",
|
|
518
|
-
"data-cy": "inline-width-input-field",
|
|
519
|
-
"data-testid": "inline-width-input-field",
|
|
520
|
-
max: 100,
|
|
521
|
-
min: 0,
|
|
522
|
-
prefix: "W",
|
|
523
|
-
suffix: "%",
|
|
524
|
-
type: "number",
|
|
525
|
-
value: width,
|
|
526
|
-
onChange: function onChange(e) {
|
|
527
|
-
return handleInputChange(e, "width");
|
|
528
|
-
}
|
|
529
|
-
}), /*#__PURE__*/jsx(Input, {
|
|
530
|
-
className: "neeto-molecules-product-embed-size-input",
|
|
531
|
-
"data-cy": "inline-height-input-field",
|
|
532
|
-
"data-testid": "inline-height-input-field",
|
|
533
|
-
max: 100,
|
|
534
|
-
min: 0,
|
|
535
|
-
prefix: "H",
|
|
536
|
-
suffix: "%",
|
|
537
|
-
type: "number",
|
|
538
|
-
value: height,
|
|
539
|
-
onChange: function onChange(e) {
|
|
540
|
-
return handleInputChange(e, "height");
|
|
541
|
-
}
|
|
542
|
-
})]
|
|
543
|
-
})]
|
|
544
|
-
}), /*#__PURE__*/jsxs("div", {
|
|
545
502
|
className: "flex flex-col gap-2",
|
|
546
503
|
children: [/*#__PURE__*/jsx(Label, {
|
|
547
504
|
"data-cy": "inline-element-id-input-label",
|
|
@@ -1109,6 +1066,7 @@ var Code = function Code(_ref) {
|
|
|
1109
1066
|
embedScriptLink = _ref.embedScriptLink,
|
|
1110
1067
|
extraArgs = _ref.extraArgs,
|
|
1111
1068
|
inlineWrapperStyle = _ref.inlineWrapperStyle,
|
|
1069
|
+
iframeStyle = _ref.iframeStyle,
|
|
1112
1070
|
supportedLanguages = _ref.supportedLanguages,
|
|
1113
1071
|
customization = _ref.customization;
|
|
1114
1072
|
var _useTranslation = useTranslation(),
|
|
@@ -1129,7 +1087,8 @@ var Code = function Code(_ref) {
|
|
|
1129
1087
|
customization: customization,
|
|
1130
1088
|
embedScriptLink: embedScriptLink,
|
|
1131
1089
|
extraArgs: extraArgs,
|
|
1132
|
-
inlineWrapperStyle: inlineWrapperStyle
|
|
1090
|
+
inlineWrapperStyle: inlineWrapperStyle,
|
|
1091
|
+
iframeStyle: iframeStyle
|
|
1133
1092
|
});
|
|
1134
1093
|
return /*#__PURE__*/jsxs("div", {
|
|
1135
1094
|
className: "flex flex-col gap-3",
|
|
@@ -1431,6 +1390,7 @@ var EmbedRenderer = function EmbedRenderer(_ref) {
|
|
|
1431
1390
|
extraArgs = _ref.extraArgs,
|
|
1432
1391
|
otherCustomizations = _ref.otherCustomizations,
|
|
1433
1392
|
inlineWrapperStyle = _ref.inlineWrapperStyle,
|
|
1393
|
+
iframeStyle = _ref.iframeStyle,
|
|
1434
1394
|
supportedLanguages = _ref.supportedLanguages,
|
|
1435
1395
|
selectedEmbed = _ref.selectedEmbed;
|
|
1436
1396
|
var _useTranslation = useTranslation(),
|
|
@@ -1501,6 +1461,7 @@ var EmbedRenderer = function EmbedRenderer(_ref) {
|
|
|
1501
1461
|
embedScriptLink: embedScriptLink,
|
|
1502
1462
|
extraArgs: extraArgs,
|
|
1503
1463
|
id: id,
|
|
1464
|
+
iframeStyle: iframeStyle,
|
|
1504
1465
|
inlineWrapperStyle: inlineWrapperStyle,
|
|
1505
1466
|
selectedEmbed: selectedEmbed,
|
|
1506
1467
|
supportedLanguages: supportedLanguages
|
|
@@ -1619,7 +1580,9 @@ var ProductEmbed = function ProductEmbed(_ref) {
|
|
|
1619
1580
|
_ref$otherCustomizati = _ref.otherCustomizations,
|
|
1620
1581
|
otherCustomizations = _ref$otherCustomizati === void 0 ? noop : _ref$otherCustomizati,
|
|
1621
1582
|
_ref$inlineWrapperSty = _ref.inlineWrapperStyle,
|
|
1622
|
-
inlineWrapperStyle = _ref$inlineWrapperSty === void 0 ? "" : _ref$inlineWrapperSty,
|
|
1583
|
+
inlineWrapperStyle = _ref$inlineWrapperSty === void 0 ? "height: 90vh; width: 100%;" : _ref$inlineWrapperSty,
|
|
1584
|
+
_ref$iframeStyle = _ref.iframeStyle,
|
|
1585
|
+
iframeStyle = _ref$iframeStyle === void 0 ? "height: 100%; width: 100%;" : _ref$iframeStyle,
|
|
1623
1586
|
_ref$supportedLanguag = _ref.supportedLanguages,
|
|
1624
1587
|
supportedLanguages = _ref$supportedLanguag === void 0 ? ["html"] : _ref$supportedLanguag;
|
|
1625
1588
|
var _useLocation = useLocation(),
|
|
@@ -1644,6 +1607,7 @@ var ProductEmbed = function ProductEmbed(_ref) {
|
|
|
1644
1607
|
customPreviewIframeUrl: customPreviewIframeUrl,
|
|
1645
1608
|
extraArgs: extraArgs,
|
|
1646
1609
|
id: id,
|
|
1610
|
+
iframeStyle: iframeStyle,
|
|
1647
1611
|
inlineWrapperStyle: inlineWrapperStyle,
|
|
1648
1612
|
options: options,
|
|
1649
1613
|
otherCustomizations: otherCustomizations,
|