@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.
@@ -353,7 +353,7 @@ var DetailsBlock = function DetailsBlock(_ref) {
353
353
  };
354
354
  var DetailsBlock$1 = /*#__PURE__*/memo(DetailsBlock);
355
355
 
356
- var css = ".neeto-molecules-session-environment-editable-field .neeto-ui-input__wrapper .ant-picker-suffix{display:none}.neeto-molecules-session-environment-editable-field .neeto-ui-input__wrapper .neeto-ui-input__prefix{margin:0;padding:0}.neeto-molecules-session-environment-editable-field .neeto-ui-input__wrapper .neeto-ui-date-input,.neeto-molecules-session-environment-editable-field .neeto-ui-input__wrapper .neeto-ui-input>input{padding:.25rem 2.8125rem .25rem .25rem!important}.neeto-molecules-session-environment-editable-field__actions .neeto-ui-btn{background-color:transparent!important;min-height:0!important;padding:.125rem!important}.neeto-molecules-session-environment-editable-text{border:thin solid rgb(var(--neeto-ui-white));border-radius:var(--neeto-ui-rounded);transition:var(--neeto-ui-transition)}.neeto-molecules-session-environment-editable-text:hover{border:thin solid rgb(var(--neeto-ui-gray-400))}";
356
+ var css = ".neeto-molecules-session-environment-editable-field>div:not([class]){align-items:center;display:flex;flex-grow:1}.neeto-molecules-session-environment-editable-field .neeto-ui-input__wrapper .ant-picker-suffix{display:none}.neeto-molecules-session-environment-editable-field .neeto-ui-input__wrapper .neeto-ui-input__prefix{margin:0;padding:0}.neeto-molecules-session-environment-editable-field .neeto-ui-input__wrapper .neeto-ui-date-input,.neeto-molecules-session-environment-editable-field .neeto-ui-input__wrapper .neeto-ui-input>input{padding:.25rem 2.8125rem .25rem .25rem!important}.neeto-molecules-session-environment-editable-field__actions .neeto-ui-btn{background-color:transparent!important;min-height:0!important;padding:.125rem!important}.neeto-molecules-session-environment-editable-text{border:thin solid rgb(var(--neeto-ui-white));border-radius:var(--neeto-ui-rounded);transition:var(--neeto-ui-transition)}.neeto-molecules-session-environment-editable-text:hover{border:thin solid rgb(var(--neeto-ui-gray-400))}";
357
357
  n(css,{});
358
358
 
359
359
  var SessionEnvironment = function SessionEnvironment(_ref) {
@@ -109,14 +109,11 @@ var inlineEmbedCode$1 = function inlineEmbedCode(_ref3) {
109
109
  id = _ref3.id,
110
110
  embedScriptLink = _ref3.embedScriptLink,
111
111
  extraArgs = _ref3.extraArgs,
112
- inlineWrapperStyle = _ref3.inlineWrapperStyle;
112
+ inlineWrapperStyle = _ref3.inlineWrapperStyle,
113
+ iframeStyle = _ref3.iframeStyle;
113
114
  var elementSelector = customization.elementSelector,
114
- _customization$width = customization.width,
115
- width = _customization$width === void 0 ? 100 : _customization$width,
116
- _customization$height = customization.height,
117
- height = _customization$height === void 0 ? 100 : _customization$height,
118
115
  queryParams = customization.queryParams;
119
- return "\n <!-- ".concat(globalProps.appName, " inline embed code begins -->\n <div style=\"").concat(inlineWrapperStyle || "height: 90vh; width: 100%;", "\" 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: { height: \"").concat(height, "%\", width: \"").concat(width, "%\"},").concat(embedQueryParam$1(queryParams)).concat(embedEnv$1()).concat(parseExtraArgs$1(extraArgs), "\n });\n </script>\n <!-- ").concat(globalProps.appName, " inline embed code ends -->");
116
+ 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 -->");
120
117
  };
121
118
  var floatingPopupEmbedCode$1 = function floatingPopupEmbedCode(_ref4) {
122
119
  var customization = _ref4.customization,
@@ -168,7 +165,7 @@ var parseExtraArgs = function parseExtraArgs(extraArgs) {
168
165
  });
169
166
  };
170
167
  var parseInlineStyle = function parseInlineStyle(styleString) {
171
- return styleString ? styleString.split(";").map(function (rule) {
168
+ return styleString.split(";").map(function (rule) {
172
169
  var _rule$split$map = rule.split(":").map(function (s) {
173
170
  return s.trim();
174
171
  }),
@@ -176,21 +173,18 @@ var parseInlineStyle = function parseInlineStyle(styleString) {
176
173
  key = _rule$split$map2[0],
177
174
  value = _rule$split$map2[1];
178
175
  return key && value ? "".concat(key, ": \"").concat(value, "\"") : null;
179
- }).filter(Boolean).join(", ") : 'height: "90vh", width: "100%"';
176
+ }).filter(Boolean).join(", ");
180
177
  };
181
178
  var inlineEmbedCode = function inlineEmbedCode(_ref3) {
182
179
  var customization = _ref3.customization,
183
180
  id = _ref3.id,
184
181
  embedScriptLink = _ref3.embedScriptLink,
185
182
  extraArgs = _ref3.extraArgs,
186
- inlineWrapperStyle = _ref3.inlineWrapperStyle;
183
+ inlineWrapperStyle = _ref3.inlineWrapperStyle,
184
+ iframeStyle = _ref3.iframeStyle;
187
185
  var elementSelector = customization.elementSelector,
188
- _customization$width = customization.width,
189
- width = _customization$width === void 0 ? 100 : _customization$width,
190
- _customization$height = customization.height,
191
- height = _customization$height === void 0 ? 100 : _customization$height,
192
186
  queryParams = customization.queryParams;
193
- 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: { height: \"").concat(height, "%\", width: \"").concat(width, "%\" },").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 };");
187
+ 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 };");
194
188
  };
195
189
  var floatingPopupEmbedCode = function floatingPopupEmbedCode(_ref4) {
196
190
  var customization = _ref4.customization,
@@ -204,7 +198,7 @@ var floatingPopupEmbedCode = function floatingPopupEmbedCode(_ref4) {
204
198
  btnColor = customization.btnColor,
205
199
  icon = customization.icon,
206
200
  queryParams = customization.queryParams;
207
- 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, " 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 };");
201
+ 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 };");
208
202
  };
209
203
  var elementPopupEmbedCode = function elementPopupEmbedCode(_ref5) {
210
204
  var customization = _ref5.customization,
@@ -494,9 +488,7 @@ var Inline$1 = function Inline(_ref) {
494
488
  };
495
489
  }, shallow.shallow),
496
490
  isQueryParamsEnabled = _useProductEmbedStore.isQueryParamsEnabled;
497
- var height = customization.height,
498
- width = customization.width,
499
- elementSelector = customization.elementSelector;
491
+ var elementSelector = customization.elementSelector;
500
492
  var handleInputChange = function handleInputChange(_ref2, attribute) {
501
493
  var value = _ref2.target.value;
502
494
  return updateCustomization(_defineProperty({}, attribute, value));
@@ -509,41 +501,6 @@ var Inline$1 = function Inline(_ref) {
509
501
  }, []);
510
502
  return /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
511
503
  children: [/*#__PURE__*/jsxRuntime.jsxs("div", {
512
- className: "flex flex-col gap-2",
513
- children: [/*#__PURE__*/jsxRuntime.jsx(Label, {
514
- "data-cy": "window-size-text",
515
- children: t("neetoMolecules.productEmbed.inline.sizeOfEmbedWindow")
516
- }), /*#__PURE__*/jsxRuntime.jsxs("div", {
517
- className: "flex justify-between gap-x-2",
518
- children: [/*#__PURE__*/jsxRuntime.jsx(Input, {
519
- className: "neeto-molecules-product-embed-size-input",
520
- "data-cy": "inline-width-input-field",
521
- "data-testid": "inline-width-input-field",
522
- max: 100,
523
- min: 0,
524
- prefix: "W",
525
- suffix: "%",
526
- type: "number",
527
- value: width,
528
- onChange: function onChange(e) {
529
- return handleInputChange(e, "width");
530
- }
531
- }), /*#__PURE__*/jsxRuntime.jsx(Input, {
532
- className: "neeto-molecules-product-embed-size-input",
533
- "data-cy": "inline-height-input-field",
534
- "data-testid": "inline-height-input-field",
535
- max: 100,
536
- min: 0,
537
- prefix: "H",
538
- suffix: "%",
539
- type: "number",
540
- value: height,
541
- onChange: function onChange(e) {
542
- return handleInputChange(e, "height");
543
- }
544
- })]
545
- })]
546
- }), /*#__PURE__*/jsxRuntime.jsxs("div", {
547
504
  className: "flex flex-col gap-2",
548
505
  children: [/*#__PURE__*/jsxRuntime.jsx(Label, {
549
506
  "data-cy": "inline-element-id-input-label",
@@ -1111,6 +1068,7 @@ var Code = function Code(_ref) {
1111
1068
  embedScriptLink = _ref.embedScriptLink,
1112
1069
  extraArgs = _ref.extraArgs,
1113
1070
  inlineWrapperStyle = _ref.inlineWrapperStyle,
1071
+ iframeStyle = _ref.iframeStyle,
1114
1072
  supportedLanguages = _ref.supportedLanguages,
1115
1073
  customization = _ref.customization;
1116
1074
  var _useTranslation = reactI18next.useTranslation(),
@@ -1131,7 +1089,8 @@ var Code = function Code(_ref) {
1131
1089
  customization: customization,
1132
1090
  embedScriptLink: embedScriptLink,
1133
1091
  extraArgs: extraArgs,
1134
- inlineWrapperStyle: inlineWrapperStyle
1092
+ inlineWrapperStyle: inlineWrapperStyle,
1093
+ iframeStyle: iframeStyle
1135
1094
  });
1136
1095
  return /*#__PURE__*/jsxRuntime.jsxs("div", {
1137
1096
  className: "flex flex-col gap-3",
@@ -1433,6 +1392,7 @@ var EmbedRenderer = function EmbedRenderer(_ref) {
1433
1392
  extraArgs = _ref.extraArgs,
1434
1393
  otherCustomizations = _ref.otherCustomizations,
1435
1394
  inlineWrapperStyle = _ref.inlineWrapperStyle,
1395
+ iframeStyle = _ref.iframeStyle,
1436
1396
  supportedLanguages = _ref.supportedLanguages,
1437
1397
  selectedEmbed = _ref.selectedEmbed;
1438
1398
  var _useTranslation = reactI18next.useTranslation(),
@@ -1503,6 +1463,7 @@ var EmbedRenderer = function EmbedRenderer(_ref) {
1503
1463
  embedScriptLink: embedScriptLink,
1504
1464
  extraArgs: extraArgs,
1505
1465
  id: id,
1466
+ iframeStyle: iframeStyle,
1506
1467
  inlineWrapperStyle: inlineWrapperStyle,
1507
1468
  selectedEmbed: selectedEmbed,
1508
1469
  supportedLanguages: supportedLanguages
@@ -1621,7 +1582,9 @@ var ProductEmbed = function ProductEmbed(_ref) {
1621
1582
  _ref$otherCustomizati = _ref.otherCustomizations,
1622
1583
  otherCustomizations = _ref$otherCustomizati === void 0 ? neetoCist.noop : _ref$otherCustomizati,
1623
1584
  _ref$inlineWrapperSty = _ref.inlineWrapperStyle,
1624
- inlineWrapperStyle = _ref$inlineWrapperSty === void 0 ? "" : _ref$inlineWrapperSty,
1585
+ inlineWrapperStyle = _ref$inlineWrapperSty === void 0 ? "height: 90vh; width: 100%;" : _ref$inlineWrapperSty,
1586
+ _ref$iframeStyle = _ref.iframeStyle,
1587
+ iframeStyle = _ref$iframeStyle === void 0 ? "height: 100%; width: 100%;" : _ref$iframeStyle,
1625
1588
  _ref$supportedLanguag = _ref.supportedLanguages,
1626
1589
  supportedLanguages = _ref$supportedLanguag === void 0 ? ["html"] : _ref$supportedLanguag;
1627
1590
  var _useLocation = reactRouterDom.useLocation(),
@@ -1646,6 +1609,7 @@ var ProductEmbed = function ProductEmbed(_ref) {
1646
1609
  customPreviewIframeUrl: customPreviewIframeUrl,
1647
1610
  extraArgs: extraArgs,
1648
1611
  id: id,
1612
+ iframeStyle: iframeStyle,
1649
1613
  inlineWrapperStyle: inlineWrapperStyle,
1650
1614
  options: options,
1651
1615
  otherCustomizations: otherCustomizations,