@bigbinary/neeto-molecules 3.16.1-beta → 3.16.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.
@@ -1,19 +1,17 @@
1
- import { filterBy, hyphenate, noop } from '@bigbinary/neeto-cist';
2
- import { useLocation, useHistory } from 'react-router-dom';
3
1
  import _defineProperty from '@babel/runtime/helpers/defineProperty';
4
2
  import _slicedToArray from '@babel/runtime/helpers/slicedToArray';
5
- import { useState, useEffect } from 'react';
3
+ import { useState, useEffect, createElement } from 'react';
6
4
  import classnames from 'classnames';
5
+ import { filterBy, noop } from '@bigbinary/neeto-cist';
7
6
  import LeftArrow from '@bigbinary/neeto-icons/LeftArrow';
8
7
  import Button from '@bigbinary/neetoui/Button';
9
8
  import Typography from '@bigbinary/neetoui/Typography';
10
9
  import { toPairs, mergeDeepLeft, isEmpty, mergeLeft } from 'ramda';
11
10
  import { useTranslation } from 'react-i18next';
12
- import Container from './Container.js';
13
- import Header from './Header.js';
14
- import Select from '@bigbinary/neetoui/Select';
15
11
  import Codeblock from './Codeblock.js';
12
+ import { jsx, jsxs } from 'react/jsx-runtime';
16
13
  import { t } from 'i18next';
14
+ import Code$1 from '@bigbinary/neeto-icons/Code';
17
15
  import Input from '@bigbinary/neetoui/Input';
18
16
  import Callout from '@bigbinary/neetoui/Callout';
19
17
  import _toConsumableArray from '@babel/runtime/helpers/toConsumableArray';
@@ -21,43 +19,73 @@ import Delete from '@bigbinary/neeto-icons/Delete';
21
19
  import Plus from '@bigbinary/neeto-icons/Plus';
22
20
  import Label from '@bigbinary/neetoui/Label';
23
21
  import _objectWithoutProperties from '@babel/runtime/helpers/objectWithoutProperties';
24
- import { jsxs, jsx, Fragment } from 'react/jsx-runtime';
25
22
  import Checkbox from '@bigbinary/neetoui/Checkbox';
23
+ import Select from '@bigbinary/neetoui/Select';
26
24
  import ColorPicker from '@bigbinary/neetoui/ColorPicker';
27
- import _objectDestructuringEmpty from '@babel/runtime/helpers/objectDestructuringEmpty';
25
+ import Tab from '@bigbinary/neetoui/Tab';
26
+ import Radio from '@bigbinary/neetoui/Radio';
28
27
  import Spinner from '@bigbinary/neetoui/Spinner';
29
28
  import BrowserPreview from './BrowserPreview.js';
30
29
  import { n } from './inject-css-DmrvuTKK.js';
31
- import { handleMetaClick } from '@bigbinary/neeto-commons-frontend/react-utils';
32
- import './index-DAYCJu79.js';
33
- import './_commonjsHelpers-BFTU3MAI.js';
34
- import './Breadcrumbs.js';
35
- import '@bigbinary/neeto-commons-frontend/utils/general';
36
- import './HelpPopover.js';
37
- import '@bigbinary/neeto-icons/Help';
38
- import '@bigbinary/neetoui/Popover';
39
- import './MoreDropdown.js';
40
- import '@bigbinary/neeto-icons/MenuHorizontal';
41
- import '@bigbinary/neeto-icons/MenuVertical';
42
- import '@bigbinary/neetoui/Dropdown';
43
- import '@bigbinary/neetoui/Tooltip';
44
- import './Search.js';
45
- import '@bigbinary/neeto-commons-frontend/react-utils/useFuncDebounce';
46
- import '@bigbinary/neeto-commons-frontend/react-utils/useQueryParams';
47
- import '@bigbinary/neeto-commons-frontend/react-utils/useUpdateEffect';
48
- import '@bigbinary/neeto-icons/Search';
49
- import '@bigbinary/neeto-commons-frontend/utils';
50
30
  import 'react-syntax-highlighter/dist/esm/prism-light.js';
51
31
  import 'react-syntax-highlighter/dist/esm/styles/prism';
52
32
  import './CopyToClipboardButton.js';
33
+ import '@bigbinary/neeto-commons-frontend/utils/general';
53
34
  import '@bigbinary/neeto-icons/Copy';
54
35
  import '@bigbinary/neeto-icons/Check';
55
36
 
37
+ var Code = function Code(_ref) {
38
+ var code = _ref.code,
39
+ tab = _ref.tab;
40
+ return /*#__PURE__*/jsx("div", {
41
+ className: "neeto-molecules-embed__code-block relative w-full overflow-y-auto",
42
+ "data-cy": "embed-code-block",
43
+ "data-testid": "".concat(tab, "-code-block"),
44
+ children: /*#__PURE__*/jsx(Codeblock, {
45
+ code: code
46
+ })
47
+ });
48
+ };
49
+
50
+ var TAB_KEYS = {
51
+ HTML: "html",
52
+ REACT: "react"
53
+ };
54
+ var TABS = [{
55
+ key: TAB_KEYS.HTML,
56
+ label: t("neetoMolecules.productEmbed.tab.html"),
57
+ icon: Code$1
58
+ }, {
59
+ key: TAB_KEYS.REACT,
60
+ label: t("neetoMolecules.productEmbed.tab.react"),
61
+ icon: Code$1
62
+ }];
63
+ var EMBED_OPTIONS = {
64
+ INLINE: "inline",
65
+ FLOATING_POPUP: "floatingPopup",
66
+ ELEMENT_POPUP: "elementPopup"
67
+ };
68
+ var DEFAULT_CUSTOMIZATION = _defineProperty(_defineProperty(_defineProperty({}, EMBED_OPTIONS.INLINE, {
69
+ width: 100,
70
+ height: 100,
71
+ elementSelector: "inline-embed-container"
72
+ }), EMBED_OPTIONS.FLOATING_POPUP, {
73
+ showIcon: false,
74
+ btnText: "Open",
75
+ btnColor: "#008068",
76
+ btnTextColor: "#fff",
77
+ btnPosition: "bottomRight"
78
+ }), EMBED_OPTIONS.ELEMENT_POPUP, {
79
+ elementSelector: "open-popup-button"
80
+ });
81
+ var SCRIPT_ID = "embed-script";
82
+ var TAB_STRING = " ";
83
+
56
84
  var FLOATING_BUTTON_POSITIONS = [{
57
- label: t("neetoMolecules.productEmbed.floatingPopup.position.bottomLeft"),
85
+ label: t("neetoMolecules.productEmbed.customization.position.bottomLeft"),
58
86
  value: "bottomLeft"
59
87
  }, {
60
- label: t("neetoMolecules.productEmbed.floatingPopup.position.bottomRight"),
88
+ label: t("neetoMolecules.productEmbed.customization.position.bottomRight"),
61
89
  value: "bottomRight"
62
90
  }];
63
91
  var INITIAL_QUERY_PARAM = {
@@ -201,13 +229,13 @@ var reactCodeGenerators = {
201
229
  elementPopup: elementPopupEmbedCode
202
230
  };
203
231
 
204
- var _excluded = ["selectedLanguage", "type"];
232
+ var _excluded = ["tab", "type"];
205
233
  var generateCode = function generateCode(options) {
206
234
  var _reactCodeGenerators$, _htmlCodeGenerators$t;
207
- var selectedLanguage = options.selectedLanguage,
235
+ var tab = options.tab,
208
236
  type = options.type,
209
237
  embeddedCodeOptions = _objectWithoutProperties(options, _excluded);
210
- return selectedLanguage === "react" ? (_reactCodeGenerators$ = reactCodeGenerators[type]) === null || _reactCodeGenerators$ === void 0 ? void 0 : _reactCodeGenerators$.call(reactCodeGenerators, embeddedCodeOptions) : (_htmlCodeGenerators$t = htmlCodeGenerators[type]) === null || _htmlCodeGenerators$t === void 0 ? void 0 : _htmlCodeGenerators$t.call(htmlCodeGenerators, embeddedCodeOptions);
238
+ return tab === "react" ? (_reactCodeGenerators$ = reactCodeGenerators[type]) === null || _reactCodeGenerators$ === void 0 ? void 0 : _reactCodeGenerators$.call(reactCodeGenerators, embeddedCodeOptions) : (_htmlCodeGenerators$t = htmlCodeGenerators[type]) === null || _htmlCodeGenerators$t === void 0 ? void 0 : _htmlCodeGenerators$t.call(htmlCodeGenerators, embeddedCodeOptions);
211
239
  };
212
240
  var buildDefaultCustomization = function buildDefaultCustomization(defaultCustomizations) {
213
241
  return mergeDeepLeft(defaultCustomizations, DEFAULT_CUSTOMIZATION);
@@ -228,14 +256,9 @@ var buildQueryParamsFromInputFields = function buildQueryParamsFromInputFields(i
228
256
  var queryParamJsonString = JSON.stringify(queryParams, null, 2);
229
257
  return queryParamJsonString.replace(/\n/g, " ").replace(/\s\s+/g, " ");
230
258
  };
231
- var toCamelCasedString = function toCamelCasedString(string) {
232
- return string === null || string === void 0 ? void 0 : string.replace(/[_-]+(\w)/g, function (_, nextChar) {
233
- return nextChar.toUpperCase();
234
- });
235
- };
236
259
 
237
- 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; }
238
- 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), !0).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; }
260
+ function ownKeys$1(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; }
261
+ function _objectSpread$1(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$1(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$1(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
239
262
  var DynamicQueryParams = function DynamicQueryParams(_ref) {
240
263
  var updateCustomization = _ref.updateCustomization;
241
264
  var _useTranslation = useTranslation(),
@@ -255,7 +278,7 @@ var DynamicQueryParams = function DynamicQueryParams(_ref) {
255
278
  };
256
279
  var handleInputChange = function handleInputChange(index, field, value) {
257
280
  var newQueryParams = queryParams.map(function (param, i) {
258
- return i === index ? _objectSpread$3(_objectSpread$3({}, param), {}, _defineProperty({}, field, value)) : param;
281
+ return i === index ? _objectSpread$1(_objectSpread$1({}, param), {}, _defineProperty({}, field, value)) : param;
259
282
  });
260
283
  setQueryParams(newQueryParams);
261
284
  };
@@ -268,16 +291,16 @@ var DynamicQueryParams = function DynamicQueryParams(_ref) {
268
291
  children: [/*#__PURE__*/jsx(Label, {
269
292
  className: "mb-2",
270
293
  "data-cy": "dynamic-query-params-label",
271
- children: t("neetoMolecules.productEmbed.queryParam.label")
294
+ children: t("neetoMolecules.productEmbed.customization.queryParam.label")
272
295
  }), queryParams.map(function (param, index) {
273
296
  return /*#__PURE__*/jsxs("div", {
274
- className: "mb-2 flex gap-1",
297
+ className: "mb-1 flex gap-1",
275
298
  children: [/*#__PURE__*/jsx(Input, {
276
299
  "data-cy": "dynamic-query-key-name-input",
277
300
  "data-testid": "dynamic-query-key-name-input",
278
301
  name: "queryParams.".concat(index, ".name"),
279
302
  value: param.name,
280
- placeholder: t("neetoMolecules.productEmbed.queryParam.keyNamePlaceholder"),
303
+ placeholder: t("neetoMolecules.productEmbed.customization.queryParam.keyNamePlaceholder"),
281
304
  onChange: function onChange(e) {
282
305
  return handleInputChange(index, "name", e.target.value);
283
306
  }
@@ -286,7 +309,7 @@ var DynamicQueryParams = function DynamicQueryParams(_ref) {
286
309
  "data-testid": "dynamic-query-key-value-input",
287
310
  name: "queryParams.".concat(index, ".value"),
288
311
  value: param.value,
289
- placeholder: t("neetoMolecules.productEmbed.queryParam.keyValuePlaceholder"),
312
+ placeholder: t("neetoMolecules.productEmbed.customization.queryParam.keyValuePlaceholder"),
290
313
  onChange: function onChange(e) {
291
314
  return handleInputChange(index, "value", e.target.value);
292
315
  }
@@ -304,8 +327,8 @@ var DynamicQueryParams = function DynamicQueryParams(_ref) {
304
327
  "data-cy": "dynamic-query-add-new-button",
305
328
  icon: Plus,
306
329
  iconPosition: "left",
307
- label: t("neetoMolecules.productEmbed.queryParam.addQueryParam"),
308
330
  style: "link",
331
+ label: t("neetoMolecules.productEmbed.customization.queryParam.addQueryParam"),
309
332
  onClick: handleAddQueryParam
310
333
  })]
311
334
  });
@@ -325,17 +348,22 @@ var ElementPopup$1 = function ElementPopup(_ref) {
325
348
  queryParams: undefined
326
349
  });
327
350
  }, []);
328
- return /*#__PURE__*/jsxs(Fragment, {
329
- children: [/*#__PURE__*/jsx(Callout, {
330
- "data-cy": "element-popup-callout",
331
- children: t("neetoMolecules.productEmbed.elementPopup.callout")
351
+ return /*#__PURE__*/jsxs("div", {
352
+ className: "space-y-6",
353
+ children: [/*#__PURE__*/jsx(Typography, {
354
+ "data-cy": "element-popup-header",
355
+ style: "h4",
356
+ children: t("neetoMolecules.productEmbed.customization.elementPopup.title")
357
+ }), /*#__PURE__*/jsx(Callout, {
358
+ "data-cy": "element-popup-description",
359
+ children: t("neetoMolecules.productEmbed.customization.elementPopup.description")
332
360
  }), /*#__PURE__*/jsx(Input, {
333
361
  className: "w-full",
334
362
  "data-cy": "element-id-input-field",
335
363
  "data-testid": "element-id-input-field",
336
- label: t("neetoMolecules.productEmbed.elementPopup.elementId"),
337
364
  value: elementSelector,
338
- error: !elementSelector && t("neetoMolecules.productEmbed.elementPopup.warning"),
365
+ error: !elementSelector && t("neetoMolecules.productEmbed.customization.elementPopup.warning"),
366
+ label: t("neetoMolecules.productEmbed.customization.elementPopup.elementId"),
339
367
  onChange: function onChange(e) {
340
368
  return updateCustomization({
341
369
  elementSelector: e.target.value
@@ -367,14 +395,28 @@ var FloatingPopup$1 = function FloatingPopup(_ref) {
367
395
  });
368
396
  }, []);
369
397
  return /*#__PURE__*/jsxs("div", {
370
- className: "flex w-full flex-col gap-y-4",
371
- children: [/*#__PURE__*/jsx("div", {
398
+ className: "space-y-6",
399
+ children: [/*#__PURE__*/jsx(Typography, {
400
+ "data-cy": "popup-customization-header",
401
+ style: "h4",
402
+ children: t("neetoMolecules.productEmbed.customization.floatingPopup.title")
403
+ }), icon && /*#__PURE__*/jsx(Checkbox, {
404
+ checked: showIcon,
405
+ "data-cy": "show-icon-checkbox",
406
+ "data-testid": "show-icon-checkbox",
407
+ label: t("neetoMolecules.productEmbed.customization.floatingPopup.showCalIcon"),
408
+ onChange: function onChange(e) {
409
+ return updateCustomization({
410
+ showIcon: e.target.checked
411
+ });
412
+ }
413
+ }), /*#__PURE__*/jsx("div", {
372
414
  className: "space-y-2",
373
415
  children: /*#__PURE__*/jsx(Input, {
374
416
  "data-cy": "button-text-input-field",
375
417
  "data-testid": "button-text-input-field",
376
- label: t("neetoMolecules.productEmbed.floatingPopup.button.text"),
377
418
  value: btnText,
419
+ label: t("neetoMolecules.productEmbed.customization.floatingPopup.button.text"),
378
420
  onChange: function onChange(e) {
379
421
  return updateCustomization({
380
422
  btnText: e.target.value
@@ -386,12 +428,12 @@ var FloatingPopup$1 = function FloatingPopup(_ref) {
386
428
  children: /*#__PURE__*/jsx(Select, {
387
429
  "data-cy": "button-position-select-field",
388
430
  "data-testid": "button-position-select-field",
389
- label: t("neetoMolecules.productEmbed.floatingPopup.button.pos"),
390
431
  options: FLOATING_BUTTON_POSITIONS,
391
432
  value: btnPosition,
392
433
  getOptionValue: function getOptionValue(option) {
393
434
  return typeof option === "string" ? option : option.value;
394
435
  },
436
+ label: t("neetoMolecules.productEmbed.customization.floatingPopup.button.pos"),
395
437
  onChange: function onChange(e) {
396
438
  return updateCustomization({
397
439
  btnPosition: e.value
@@ -399,13 +441,12 @@ var FloatingPopup$1 = function FloatingPopup(_ref) {
399
441
  }
400
442
  })
401
443
  }), /*#__PURE__*/jsxs("div", {
402
- className: "flex items-center justify-between gap-2",
444
+ className: "flex items-center justify-between gap-x-2",
403
445
  "data-cy": "button-color-label",
404
446
  children: [/*#__PURE__*/jsx(Label, {
405
- children: t("neetoMolecules.productEmbed.floatingPopup.button.color")
447
+ children: t("neetoMolecules.productEmbed.customization.floatingPopup.button.color")
406
448
  }), /*#__PURE__*/jsx(ColorPicker, {
407
449
  color: btnColor,
408
- size: "medium",
409
450
  onChange: function onChange(e) {
410
451
  return updateCustomization({
411
452
  btnColor: e.hex
@@ -413,29 +454,18 @@ var FloatingPopup$1 = function FloatingPopup(_ref) {
413
454
  }
414
455
  })]
415
456
  }), /*#__PURE__*/jsxs("div", {
416
- className: "flex items-center justify-between gap-2",
457
+ className: "flex items-center justify-between gap-x-2",
417
458
  "data-cy": "button-text-color-label",
418
459
  children: [/*#__PURE__*/jsx(Label, {
419
- children: t("neetoMolecules.productEmbed.floatingPopup.button.textColor")
460
+ children: t("neetoMolecules.productEmbed.customization.floatingPopup.button.textColor")
420
461
  }), /*#__PURE__*/jsx(ColorPicker, {
421
462
  color: btnTextColor,
422
- size: "medium",
423
463
  onChange: function onChange(e) {
424
464
  return updateCustomization({
425
465
  btnTextColor: e.hex
426
466
  });
427
467
  }
428
468
  })]
429
- }), icon && /*#__PURE__*/jsx(Checkbox, {
430
- checked: showIcon,
431
- "data-cy": "show-icon-checkbox",
432
- "data-testid": "show-icon-checkbox",
433
- label: t("neetoMolecules.productEmbed.floatingPopup.showCalIcon"),
434
- onChange: function onChange(e) {
435
- return updateCustomization({
436
- showIcon: e.target.checked
437
- });
438
- }
439
469
  }), otherCustomizations(), isQueryParamsEnabled && /*#__PURE__*/jsx(DynamicQueryParams, {
440
470
  updateCustomization: updateCustomization
441
471
  })]
@@ -462,12 +492,17 @@ var Inline$1 = function Inline(_ref) {
462
492
  queryParams: undefined
463
493
  });
464
494
  }, []);
465
- return /*#__PURE__*/jsxs(Fragment, {
466
- children: [/*#__PURE__*/jsxs("div", {
495
+ return /*#__PURE__*/jsxs("div", {
496
+ className: "flex flex-col gap-y-6",
497
+ children: [/*#__PURE__*/jsx(Typography, {
498
+ "data-cy": "customization-text",
499
+ style: "h4",
500
+ children: t("neetoMolecules.productEmbed.customization.inline.title")
501
+ }), /*#__PURE__*/jsxs("div", {
467
502
  className: "flex flex-col gap-2",
468
503
  children: [/*#__PURE__*/jsx(Label, {
469
504
  "data-cy": "window-size-text",
470
- children: t("neetoMolecules.productEmbed.inline.sizeOfEmbedWindow")
505
+ children: t("neetoMolecules.productEmbed.customization.inline.sizeOfEmbedWindow")
471
506
  }), /*#__PURE__*/jsxs("div", {
472
507
  className: "flex justify-between gap-x-2",
473
508
  children: [/*#__PURE__*/jsx(Input, {
@@ -502,7 +537,7 @@ var Inline$1 = function Inline(_ref) {
502
537
  className: "flex flex-col gap-2",
503
538
  children: [/*#__PURE__*/jsx(Label, {
504
539
  "data-cy": "inline-element-id-input-label",
505
- children: t("neetoMolecules.productEmbed.inline.elementId")
540
+ children: t("neetoMolecules.productEmbed.customization.inline.elementId")
506
541
  }), /*#__PURE__*/jsx(Input, {
507
542
  "data-cy": "inline-element-id-input-field",
508
543
  "data-testid": "inline-element-id-input-field",
@@ -517,725 +552,93 @@ var Inline$1 = function Inline(_ref) {
517
552
  });
518
553
  };
519
554
 
520
- function ownKeys$2(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; }
521
- function _objectSpread$2(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$2(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$2(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
522
- var InlineEmbedIcon = function InlineEmbedIcon(_ref) {
523
- var other = Object.assign({}, (_objectDestructuringEmpty(_ref), _ref));
524
- return /*#__PURE__*/jsxs("svg", _objectSpread$2(_objectSpread$2({
525
- fill: "none",
526
- height: "163",
527
- viewBox: "0 0 278 163",
528
- width: "278",
529
- xmlns: "http://www.w3.org/2000/svg"
530
- }, other), {}, {
531
- children: [/*#__PURE__*/jsxs("g", {
532
- clipPath: "url(#clip0_8605_6776)",
533
- children: [/*#__PURE__*/jsx("rect", {
534
- fill: "rgb(var(--neeto-ui-white))",
535
- height: "163",
536
- rx: "6",
537
- width: "278"
538
- }), /*#__PURE__*/jsx("mask", {
539
- fill: "rgb(var(--neeto-ui-white))",
540
- id: "path-3-inside-1_8605_6776",
541
- children: /*#__PURE__*/jsx("path", {
542
- d: "M0 0h305v20H0z"
543
- })
544
- }), /*#__PURE__*/jsx("path", {
545
- d: "M0 0h305v20H0z",
546
- fill: "rgb(var(--neeto-ui-white))"
547
- }), /*#__PURE__*/jsx("path", {
548
- d: "M305 19H0v2h305z",
549
- fill: "currentColor",
550
- mask: "url(#path-3-inside-1_8605_6776)"
551
- }), /*#__PURE__*/jsx("circle", {
552
- cx: "10.596",
553
- cy: "10.432",
554
- fill: "#FD5350",
555
- r: "2.307"
556
- }), /*#__PURE__*/jsx("circle", {
557
- cx: "18.143",
558
- cy: "10.432",
559
- fill: "#FEB33A",
560
- r: "2.307"
561
- }), /*#__PURE__*/jsx("circle", {
562
- cx: "25.69",
563
- cy: "10.432",
564
- fill: "#2CC146",
565
- r: "2.307"
566
- }), /*#__PURE__*/jsx("path", {
567
- d: "M36 20h206v10H36zM36 150h206v12H36z",
568
- fill: "currentColor"
569
- }), /*#__PURE__*/jsx("rect", {
570
- height: "103.55",
571
- rx: "5.217",
572
- stroke: "rgb(var(--neeto-ui-gray-300))",
573
- strokeWidth: "0.45",
574
- width: "205.55",
575
- x: "36.225",
576
- y: "38.225"
577
- }), /*#__PURE__*/jsx("rect", {
578
- fill: "currentColor",
579
- height: "2.311",
580
- rx: "1.156",
581
- width: "36.079",
582
- x: "45.32",
583
- y: "81.914"
584
- }), /*#__PURE__*/jsx("rect", {
585
- fill: "currentColor",
586
- height: "2.311",
587
- rx: "1.156",
588
- width: "20.949",
589
- x: "45.32",
590
- y: "87.688"
591
- }), /*#__PURE__*/jsx("rect", {
592
- fill: "#008068",
593
- height: "7.988",
594
- rx: "1",
595
- width: "23.183",
596
- x: "203.539",
597
- y: "61.109"
598
- }), /*#__PURE__*/jsx("rect", {
599
- fill: "currentColor",
600
- height: "7.728",
601
- rx: "1",
602
- width: "23.183",
603
- x: "203.539",
604
- y: "73.57"
605
- }), /*#__PURE__*/jsx("rect", {
606
- fill: "currentColor",
607
- height: "8.134",
608
- rx: "1",
609
- width: "23.183",
610
- x: "203.539",
611
- y: "85.773"
612
- }), /*#__PURE__*/jsx("rect", {
613
- fill: "currentColor",
614
- height: "8.134",
615
- rx: "1",
616
- width: "23.183",
617
- x: "203.539",
618
- y: "98.383"
619
- }), /*#__PURE__*/jsx("rect", {
620
- fill: "currentColor",
621
- height: "8.134",
622
- rx: "1",
623
- width: "23.183",
624
- x: "203.539",
625
- y: "110.992"
626
- }), /*#__PURE__*/jsx("circle", {
627
- cx: "52.077",
628
- cy: "67.819",
629
- fill: "currentColor",
630
- r: "6.733"
631
- }), /*#__PURE__*/jsx("circle", {
632
- cx: "120.314",
633
- cy: "74.322",
634
- fill: "currentColor",
635
- r: "2.65"
636
- }), /*#__PURE__*/jsx("circle", {
637
- cx: "120.322",
638
- cy: "84.876",
639
- fill: "currentColor",
640
- r: "2.65"
641
- }), /*#__PURE__*/jsx("circle", {
642
- cx: "120.322",
643
- cy: "95.439",
644
- fill: "currentColor",
645
- r: "2.65"
646
- }), /*#__PURE__*/jsx("circle", {
647
- cx: "130.954",
648
- cy: "63.767",
649
- fill: "currentColor",
650
- r: "2.65"
651
- }), /*#__PURE__*/jsx("circle", {
652
- cx: "130.954",
653
- cy: "74.322",
654
- fill: "currentColor",
655
- r: "2.65"
656
- }), /*#__PURE__*/jsx("circle", {
657
- cx: "130.954",
658
- cy: "84.876",
659
- fill: "currentColor",
660
- r: "2.65"
661
- }), /*#__PURE__*/jsx("circle", {
662
- cx: "130.954",
663
- cy: "95.439",
664
- fill: "currentColor",
665
- r: "2.65"
666
- }), /*#__PURE__*/jsx("circle", {
667
- cx: "141.572",
668
- cy: "63.767",
669
- fill: "currentColor",
670
- r: "2.65"
671
- }), /*#__PURE__*/jsx("circle", {
672
- cx: "141.572",
673
- cy: "74.322",
674
- fill: "currentColor",
675
- r: "2.65"
676
- }), /*#__PURE__*/jsx("circle", {
677
- cx: "141.572",
678
- cy: "84.876",
679
- fill: "currentColor",
680
- r: "2.65"
681
- }), /*#__PURE__*/jsx("circle", {
682
- cx: "141.572",
683
- cy: "95.439",
684
- fill: "currentColor",
685
- r: "2.65"
686
- }), /*#__PURE__*/jsx("circle", {
687
- cx: "152.181",
688
- cy: "63.767",
689
- fill: "currentColor",
690
- r: "2.65"
691
- }), /*#__PURE__*/jsx("circle", {
692
- cx: "152.181",
693
- cy: "74.322",
694
- fill: "currentColor",
695
- r: "2.65"
696
- }), /*#__PURE__*/jsx("circle", {
697
- cx: "152.181",
698
- cy: "84.876",
699
- fill: "currentColor",
700
- r: "2.65"
701
- }), /*#__PURE__*/jsx("circle", {
702
- cx: "162.806",
703
- cy: "63.767",
704
- fill: "currentColor",
705
- r: "2.65"
706
- }), /*#__PURE__*/jsx("circle", {
707
- cx: "162.806",
708
- cy: "74.322",
709
- fill: "#008068",
710
- r: "2.65"
711
- }), /*#__PURE__*/jsx("circle", {
712
- cx: "162.806",
713
- cy: "84.876",
714
- fill: "currentColor",
715
- r: "2.65"
716
- }), /*#__PURE__*/jsx("circle", {
717
- cx: "173.439",
718
- cy: "63.767",
719
- fill: "currentColor",
720
- r: "2.65"
721
- }), /*#__PURE__*/jsx("circle", {
722
- cx: "173.439",
723
- cy: "74.322",
724
- fill: "currentColor",
725
- r: "2.65"
726
- }), /*#__PURE__*/jsx("circle", {
727
- cx: "173.439",
728
- cy: "84.876",
729
- fill: "currentColor",
730
- r: "2.65"
731
- }), /*#__PURE__*/jsx("circle", {
732
- cx: "184.064",
733
- cy: "63.767",
734
- fill: "currentColor",
735
- r: "2.65"
736
- }), /*#__PURE__*/jsx("circle", {
737
- cx: "184.064",
738
- cy: "74.322",
739
- fill: "currentColor",
740
- r: "2.65"
741
- }), /*#__PURE__*/jsx("circle", {
742
- cx: "184.075",
743
- cy: "84.876",
744
- fill: "currentColor",
745
- r: "2.65"
746
- }), /*#__PURE__*/jsx("path", {
747
- d: "M93.023 38v104",
748
- stroke: "#E7E7E7",
749
- strokeWidth: "0.454"
750
- })]
751
- }), /*#__PURE__*/jsx("rect", {
752
- height: "162",
753
- rx: "5.5",
754
- stroke: "rgb(var(--neeto-ui-gray-300))",
755
- width: "277",
756
- x: "0.5",
757
- y: "0.5"
758
- }), /*#__PURE__*/jsx("defs", {
759
- children: /*#__PURE__*/jsx("clipPath", {
760
- id: "clip0_8605_6776",
761
- children: /*#__PURE__*/jsx("rect", {
762
- fill: "rgb(var(--neeto-ui-white))",
763
- height: "163",
764
- rx: "6",
765
- width: "278"
766
- })
767
- })
768
- })]
769
- }));
770
- };
771
- var FloatingPopupIcon = function FloatingPopupIcon(_ref2) {
772
- var other = Object.assign({}, (_objectDestructuringEmpty(_ref2), _ref2));
773
- return /*#__PURE__*/jsxs("svg", _objectSpread$2(_objectSpread$2({
774
- fill: "none",
775
- height: "163",
776
- viewBox: "0 0 278 163",
777
- width: "278",
778
- xmlns: "http://www.w3.org/2000/svg"
779
- }, other), {}, {
780
- children: [/*#__PURE__*/jsxs("g", {
781
- clipPath: "url(#clip0_9047_10870)",
782
- children: [/*#__PURE__*/jsx("rect", {
783
- fill: "rgb(var(--neeto-ui-white))",
784
- height: "163",
785
- rx: "6",
786
- width: "278"
787
- }), /*#__PURE__*/jsx("mask", {
788
- fill: "rgb(var(--neeto-ui-white))",
789
- id: "path-3-inside-1_9047_10870",
790
- children: /*#__PURE__*/jsx("path", {
791
- d: "M0 0H305V20H0V0Z"
792
- })
793
- }), /*#__PURE__*/jsx("path", {
794
- d: "M0 0H305V20H0V0Z",
795
- fill: "rgb(var(--neeto-ui-white))"
796
- }), /*#__PURE__*/jsx("path", {
797
- d: "M305 19H0V21H305V19Z",
798
- fill: "currentColor",
799
- mask: "url(#path-3-inside-1_9047_10870)"
800
- }), /*#__PURE__*/jsx("circle", {
801
- cx: "10.5963",
802
- cy: "10.4322",
803
- fill: "#FD5350",
804
- r: "2.30723"
805
- }), /*#__PURE__*/jsx("circle", {
806
- cx: "18.1432",
807
- cy: "10.4322",
808
- fill: "#FEB33A",
809
- r: "2.30723"
810
- }), /*#__PURE__*/jsx("circle", {
811
- cx: "25.69",
812
- cy: "10.4322",
813
- fill: "#2CC146",
814
- r: "2.30723"
815
- }), /*#__PURE__*/jsx("rect", {
816
- fill: "currentColor",
817
- height: "3",
818
- opacity: "0.78",
819
- rx: "1.5",
820
- width: "84.6936",
821
- x: "145",
822
- y: "63"
823
- }), /*#__PURE__*/jsx("rect", {
824
- fill: "currentColor",
825
- height: "3",
826
- opacity: "0.78",
827
- rx: "1.5",
828
- width: "89",
829
- x: "145",
830
- y: "70"
831
- }), /*#__PURE__*/jsx("rect", {
832
- fill: "currentColor",
833
- height: "3",
834
- opacity: "0.78",
835
- rx: "1.5",
836
- width: "49",
837
- x: "145",
838
- y: "77"
839
- }), /*#__PURE__*/jsx("rect", {
840
- fill: "currentColor",
841
- height: "3",
842
- opacity: "0.78",
843
- rx: "1.5",
844
- width: "84.6936",
845
- x: "36",
846
- y: "111"
847
- }), /*#__PURE__*/jsx("rect", {
848
- fill: "currentColor",
849
- height: "3",
850
- opacity: "0.78",
851
- rx: "1.5",
852
- width: "89",
853
- x: "36",
854
- y: "118"
855
- }), /*#__PURE__*/jsx("rect", {
856
- fill: "currentColor",
857
- height: "3",
858
- opacity: "0.78",
859
- rx: "1.5",
860
- width: "25.8387",
861
- x: "36",
862
- y: "125"
863
- }), /*#__PURE__*/jsx("rect", {
864
- fill: "currentColor",
865
- height: "35",
866
- width: "96",
867
- x: "36",
868
- y: "57"
869
- }), /*#__PURE__*/jsx("rect", {
870
- fill: "currentColor",
871
- height: "35",
872
- width: "95",
873
- x: "145",
874
- y: "102"
875
- }), /*#__PURE__*/jsx("rect", {
876
- fill: "currentColor",
877
- height: "26",
878
- width: "204",
879
- x: "36",
880
- y: "20"
881
- }), /*#__PURE__*/jsx("rect", {
882
- fill: "currentColor",
883
- height: "14",
884
- width: "204",
885
- x: "36",
886
- y: "148"
887
- })]
888
- }), /*#__PURE__*/jsx("rect", {
889
- height: "162",
890
- rx: "5.5",
891
- stroke: "rgb(var(--neeto-ui-gray-300))",
892
- width: "277",
893
- x: "0.5",
894
- y: "0.5"
895
- }), /*#__PURE__*/jsx("rect", {
896
- fill: "#008068",
897
- height: "18",
898
- rx: "9",
899
- width: "69",
900
- x: "194",
901
- y: "134"
902
- }), /*#__PURE__*/jsx("defs", {
903
- children: /*#__PURE__*/jsx("clipPath", {
904
- id: "clip0_9047_10870",
905
- children: /*#__PURE__*/jsx("rect", {
906
- fill: "rgb(var(--neeto-ui-white))",
907
- height: "163",
908
- rx: "6",
909
- width: "278"
910
- })
911
- })
912
- })]
913
- }));
914
- };
915
- var ElementPopupIcon = function ElementPopupIcon(_ref3) {
916
- var other = Object.assign({}, (_objectDestructuringEmpty(_ref3), _ref3));
917
- return /*#__PURE__*/jsxs("svg", _objectSpread$2(_objectSpread$2({
918
- fill: "none",
919
- height: "163",
920
- viewBox: "0 0 278 163",
921
- width: "278",
922
- xmlns: "http://www.w3.org/2000/svg"
923
- }, other), {}, {
924
- children: [/*#__PURE__*/jsxs("g", {
925
- clipPath: "url(#clip0_9047_10869)",
926
- children: [/*#__PURE__*/jsx("rect", {
927
- fill: "rgb(var(--neeto-ui-white))",
928
- height: "163",
929
- rx: "6",
930
- width: "278"
931
- }), /*#__PURE__*/jsx("mask", {
932
- fill: "rgb(var(--neeto-ui-white))",
933
- id: "path-3-inside-1_9047_10869",
934
- children: /*#__PURE__*/jsx("path", {
935
- d: "M0 0h305v20H0z"
936
- })
937
- }), /*#__PURE__*/jsx("path", {
938
- d: "M0 0h305v20H0z",
939
- fill: "rgb(var(--neeto-ui-white))"
940
- }), /*#__PURE__*/jsx("path", {
941
- d: "M305 19H0v2h305z",
942
- fill: "currentColor",
943
- mask: "url(#path-3-inside-1_9047_10869)"
944
- }), /*#__PURE__*/jsx("circle", {
945
- cx: "10.596",
946
- cy: "10.432",
947
- fill: "#FD5350",
948
- r: "2.307"
949
- }), /*#__PURE__*/jsx("circle", {
950
- cx: "18.143",
951
- cy: "10.432",
952
- fill: "#FEB33A",
953
- r: "2.307"
954
- }), /*#__PURE__*/jsx("circle", {
955
- cx: "25.69",
956
- cy: "10.432",
957
- fill: "#2CC146",
958
- r: "2.307"
959
- })]
960
- }), /*#__PURE__*/jsx("rect", {
961
- height: "162",
962
- rx: "5.5",
963
- stroke: "rgb(var(--neeto-ui-gray-300))",
964
- width: "277",
965
- x: "0.5",
966
- y: "0.5"
967
- }), /*#__PURE__*/jsx("rect", {
968
- fill: "currentColor",
969
- height: "3.944",
970
- opacity: "0.78",
971
- rx: "1.972",
972
- width: "85",
973
- x: "135",
974
- y: "58.461"
975
- }), /*#__PURE__*/jsx("rect", {
976
- fill: "currentColor",
977
- height: "3.944",
978
- opacity: "0.78",
979
- rx: "1.972",
980
- width: "89",
981
- x: "135",
982
- y: "66.352"
983
- }), /*#__PURE__*/jsx("rect", {
984
- fill: "#008068",
985
- height: "7",
986
- rx: "3.5",
987
- width: "38",
988
- x: "135",
989
- y: "74"
990
- }), /*#__PURE__*/jsx("rect", {
991
- fill: "currentColor",
992
- height: "3.944",
993
- opacity: "0.78",
994
- rx: "1.972",
995
- width: "85",
996
- x: "135",
997
- y: "100.859"
998
- }), /*#__PURE__*/jsx("rect", {
999
- fill: "currentColor",
1000
- height: "3.944",
1001
- opacity: "0.78",
1002
- rx: "1.972",
1003
- width: "89",
1004
- x: "135",
1005
- y: "108.75"
1006
- }), /*#__PURE__*/jsx("rect", {
1007
- fill: "currentColor",
1008
- height: "3.944",
1009
- opacity: "0.78",
1010
- rx: "1.972",
1011
- width: "26",
1012
- x: "135",
1013
- y: "116.641"
1014
- }), /*#__PURE__*/jsx("path", {
1015
- d: "M36 52h88v34H36zM36 20h204v28H36zM240 162H36v-28h204zM36 90h88v41H36z",
1016
- fill: "currentColor"
1017
- }), /*#__PURE__*/jsx("defs", {
1018
- children: /*#__PURE__*/jsx("clipPath", {
1019
- id: "clip0_9047_10869",
1020
- children: /*#__PURE__*/jsx("rect", {
1021
- fill: "rgb(var(--neeto-ui-white))",
1022
- height: "163",
1023
- rx: "6",
1024
- width: "278"
1025
- })
1026
- })
1027
- })]
1028
- }));
1029
- };
1030
-
1031
- var EMBED_OPTIONS = {
1032
- INLINE: "inline",
1033
- FLOATING_POPUP: "floatingPopup",
1034
- ELEMENT_POPUP: "elementPopup"
1035
- };
1036
- var EMBED_ICONS = _defineProperty(_defineProperty(_defineProperty({}, EMBED_OPTIONS.INLINE, InlineEmbedIcon), EMBED_OPTIONS.FLOATING_POPUP, FloatingPopupIcon), EMBED_OPTIONS.ELEMENT_POPUP, ElementPopupIcon);
1037
- var DEFAULT_CUSTOMIZATION = _defineProperty(_defineProperty(_defineProperty({}, EMBED_OPTIONS.INLINE, {
1038
- width: 100,
1039
- height: 100,
1040
- elementSelector: "inline-embed-container"
1041
- }), EMBED_OPTIONS.FLOATING_POPUP, {
1042
- showIcon: false,
1043
- btnText: "Open",
1044
- btnColor: "#008068",
1045
- btnTextColor: "#fff",
1046
- btnPosition: "bottomRight"
1047
- }), EMBED_OPTIONS.ELEMENT_POPUP, {
1048
- elementSelector: "open-popup-button"
1049
- });
1050
- var EMBED_CUSTOMIZATION_COMPONENTS = _defineProperty(_defineProperty(_defineProperty({}, EMBED_OPTIONS.INLINE, Inline$1), EMBED_OPTIONS.FLOATING_POPUP, FloatingPopup$1), EMBED_OPTIONS.ELEMENT_POPUP, ElementPopup$1);
1051
- var EMBED_TITLES = _defineProperty(_defineProperty(_defineProperty({}, EMBED_OPTIONS.INLINE, t("neetoMolecules.productEmbed.inline.title")), EMBED_OPTIONS.FLOATING_POPUP, t("neetoMolecules.productEmbed.floatingPopup.title")), EMBED_OPTIONS.ELEMENT_POPUP, t("neetoMolecules.productEmbed.elementPopup.title"));
1052
- var SUPPORTED_LANGUAGES = [{
1053
- value: "html",
1054
- label: t("neetoMolecules.productEmbed.language.html")
1055
- }, {
1056
- value: "react",
1057
- label: t("neetoMolecules.productEmbed.language.react")
1058
- }];
1059
- var SCRIPT_ID = "embed-script";
1060
- var TAB_STRING = " ";
1061
-
1062
- var Code = function Code(_ref) {
1063
- var id = _ref.id,
1064
- selectedEmbed = _ref.selectedEmbed,
1065
- embedScriptLink = _ref.embedScriptLink,
1066
- extraArgs = _ref.extraArgs,
1067
- inlineWrapperStyle = _ref.inlineWrapperStyle,
1068
- supportedLanguages = _ref.supportedLanguages,
1069
- customization = _ref.customization;
1070
- var _useTranslation = useTranslation(),
1071
- t = _useTranslation.t;
1072
- var supportedLanguagesOptions = filterBy({
1073
- value: function value(_value) {
1074
- return supportedLanguages === null || supportedLanguages === void 0 ? void 0 : supportedLanguages.includes(_value);
1075
- }
1076
- }, SUPPORTED_LANGUAGES);
1077
- var _useState = useState(supportedLanguagesOptions[0]),
1078
- _useState2 = _slicedToArray(_useState, 2),
1079
- selectedLanguage = _useState2[0],
1080
- setSelectedLanguage = _useState2[1];
1081
- var code = generateCode({
1082
- id: id,
1083
- selectedLanguage: selectedLanguage.value,
1084
- type: selectedEmbed,
555
+ var Customization = function Customization(_ref) {
556
+ var option = _ref.option,
557
+ customization = _ref.customization,
558
+ updateCustomization = _ref.updateCustomization,
559
+ isQueryParamsEnabled = _ref.isQueryParamsEnabled,
560
+ otherCustomizations = _ref.otherCustomizations;
561
+ var type = _defineProperty(_defineProperty(_defineProperty({}, EMBED_OPTIONS.INLINE, Inline$1), EMBED_OPTIONS.FLOATING_POPUP, FloatingPopup$1), EMBED_OPTIONS.ELEMENT_POPUP, ElementPopup$1);
562
+ var Component = type[option];
563
+ return /*#__PURE__*/jsx(Component, {
1085
564
  customization: customization,
1086
- embedScriptLink: embedScriptLink,
1087
- extraArgs: extraArgs,
1088
- inlineWrapperStyle: inlineWrapperStyle
565
+ isQueryParamsEnabled: isQueryParamsEnabled,
566
+ otherCustomizations: otherCustomizations,
567
+ updateCustomization: updateCustomization
1089
568
  });
1090
- return /*#__PURE__*/jsxs("div", {
1091
- className: "flex flex-col gap-3",
1092
- children: [/*#__PURE__*/jsxs("div", {
1093
- className: "flex items-center justify-between",
1094
- children: [/*#__PURE__*/jsx(Typography, {
1095
- style: "h4",
1096
- children: t("neetoMolecules.productEmbed.embedCode")
1097
- }), /*#__PURE__*/jsx(Select, {
1098
- className: "w-28 flex-grow-0",
1099
- options: supportedLanguagesOptions,
1100
- size: "small",
1101
- strategy: "fixed",
1102
- value: selectedLanguage,
1103
- onChange: setSelectedLanguage
1104
- })]
1105
- }), /*#__PURE__*/jsx("div", {
1106
- className: "neeto-molecules-embed__code-block relative w-full overflow-y-auto",
1107
- "data-cy": "embed-code-block",
1108
- "data-testid": "embed-code-block",
1109
- children: /*#__PURE__*/jsx(Codeblock, {
1110
- code: code,
1111
- codeblockProps: {
1112
- "data-testid": "".concat(selectedLanguage.value, "-code-block")
1113
- },
1114
- copyButtonProps: {
1115
- style: "primary",
1116
- label: t("neetoMolecules.productEmbed.copyCode")
1117
- }
569
+ };
570
+
571
+ var Header = function Header(_ref) {
572
+ var supportedLanguagesTabs = _ref.supportedLanguagesTabs,
573
+ setTab = _ref.setTab,
574
+ tab = _ref.tab;
575
+ return /*#__PURE__*/jsx("div", {
576
+ className: "flex w-full",
577
+ children: /*#__PURE__*/jsx(Tab, {
578
+ noUnderline: true,
579
+ className: "neeto-molecules-product-embed-tab",
580
+ children: supportedLanguagesTabs.map(function (_ref2) {
581
+ var key = _ref2.key,
582
+ label = _ref2.label,
583
+ icon = _ref2.icon;
584
+ return /*#__PURE__*/createElement(Tab.Item, {
585
+ icon: icon,
586
+ active: tab === key,
587
+ "data-cy": "".concat(key, "-tab"),
588
+ "data-testid": "".concat(key, "-tab"),
589
+ key: key,
590
+ onClick: function onClick() {
591
+ return setTab(key);
592
+ }
593
+ }, label);
1118
594
  })
1119
- })]
595
+ })
1120
596
  });
1121
597
  };
1122
598
 
1123
- function ownKeys$1(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; }
1124
- function _objectSpread$1(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$1(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$1(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
1125
- var FloatingPopupPlaceholderImage = function FloatingPopupPlaceholderImage(_ref) {
1126
- var other = Object.assign({}, (_objectDestructuringEmpty(_ref), _ref));
1127
- return /*#__PURE__*/jsxs("svg", _objectSpread$1(_objectSpread$1({
1128
- fill: "none",
1129
- height: "518",
1130
- viewBox: "0 0 796 518",
1131
- width: "796",
1132
- xmlns: "http://www.w3.org/2000/svg"
1133
- }, other), {}, {
1134
- children: [/*#__PURE__*/jsx("rect", {
1135
- fill: "currentColor",
1136
- height: "12.706",
1137
- opacity: "0.78",
1138
- rx: "6.353",
1139
- width: "358.702",
1140
- x: "406.645",
1141
- y: "152.109"
1142
- }), /*#__PURE__*/jsx("rect", {
1143
- fill: "currentColor",
1144
- height: "12.706",
1145
- opacity: "0.78",
1146
- rx: "6.353",
1147
- width: "376.941",
1148
- x: "406.645",
1149
- y: "181.758"
1150
- }), /*#__PURE__*/jsx("rect", {
1151
- fill: "currentColor",
1152
- height: "12.706",
1153
- opacity: "0.78",
1154
- rx: "6.353",
1155
- width: "207.529",
1156
- x: "406.645",
1157
- y: "211.406"
1158
- }), /*#__PURE__*/jsx("rect", {
1159
- fill: "currentColor",
1160
- height: "12.706",
1161
- opacity: "0.78",
1162
- rx: "6.353",
1163
- width: "358.702",
1164
- y: "333.414"
1165
- }), /*#__PURE__*/jsx("rect", {
1166
- fill: "currentColor",
1167
- height: "12.706",
1168
- opacity: "0.78",
1169
- rx: "6.353",
1170
- width: "376.941",
1171
- y: "363.062"
1172
- }), /*#__PURE__*/jsx("rect", {
1173
- fill: "currentColor",
1174
- height: "12.706",
1175
- opacity: "0.78",
1176
- rx: "6.353",
1177
- width: "109.435",
1178
- y: "392.711"
1179
- }), /*#__PURE__*/jsx("path", {
1180
- d: "M0 127.203h374v148H0zM407 295h389v149H407zM0 .203h796v110H0zM0 460.203h796v59H0z",
1181
- fill: "currentColor"
1182
- })]
1183
- }));
1184
- };
1185
- var ElementPopupPlaceholderImage = function ElementPopupPlaceholderImage(_ref2) {
1186
- var other = Object.assign({}, (_objectDestructuringEmpty(_ref2), _ref2));
1187
- return /*#__PURE__*/jsxs("svg", _objectSpread$1(_objectSpread$1({
1188
- fill: "none",
1189
- height: "518",
1190
- viewBox: "0 0 748 518",
1191
- width: "748",
1192
- xmlns: "http://www.w3.org/2000/svg"
1193
- }, other), {}, {
1194
- children: [/*#__PURE__*/jsx("rect", {
1195
- fill: "currentColor",
1196
- height: "14.463",
1197
- opacity: "0.78",
1198
- rx: "7.231",
1199
- width: "311.667",
1200
- x: "363",
1201
- y: "142.688"
1202
- }), /*#__PURE__*/jsx("rect", {
1203
- fill: "currentColor",
1204
- height: "14.463",
1205
- opacity: "0.78",
1206
- rx: "7.231",
1207
- width: "326.333",
1208
- x: "363",
1209
- y: "171.617"
1210
- }), /*#__PURE__*/jsx("rect", {
1211
- fill: "currentColor",
1212
- height: "14.463",
1213
- opacity: "0.78",
1214
- rx: "7.231",
1215
- width: "311.667",
1216
- x: "363",
1217
- y: "298.141"
1218
- }), /*#__PURE__*/jsx("rect", {
1219
- fill: "currentColor",
1220
- height: "14.463",
1221
- opacity: "0.78",
1222
- rx: "7.231",
1223
- width: "326.333",
1224
- x: "363",
1225
- y: "327.07"
1226
- }), /*#__PURE__*/jsx("rect", {
1227
- fill: "currentColor",
1228
- height: "14.463",
1229
- opacity: "0.78",
1230
- rx: "7.231",
1231
- width: "95.333",
1232
- x: "363",
1233
- y: "356"
1234
- }), /*#__PURE__*/jsx("path", {
1235
- d: "M0 119h322.667v124.667H0zM0 0h748v104H0zM748 522.336H0V419.669h748zM0 258.328h322.667v150.333H0z",
1236
- fill: "currentColor"
1237
- })]
1238
- }));
599
+ var Options = function Options(_ref) {
600
+ var options = _ref.options,
601
+ selectedOption = _ref.selectedOption,
602
+ setSelectedOption = _ref.setSelectedOption;
603
+ return /*#__PURE__*/jsx(Radio, {
604
+ stacked: true,
605
+ containerClassName: "w-full flex flex-col gap-y-4",
606
+ name: "options",
607
+ children: Object.entries(options).map(function (_ref2) {
608
+ var _ref3 = _slicedToArray(_ref2, 2),
609
+ key = _ref3[0],
610
+ _ref3$ = _ref3[1],
611
+ label = _ref3$.label,
612
+ description = _ref3$.description;
613
+ return /*#__PURE__*/jsxs("label", {
614
+ className: "neeto-ui-border-gray-300 neeto-ui-bg-white neeto-ui-rounded-lg w-full cursor-pointer border p-4",
615
+ "data-cy": "".concat(key, "-embed-option-label"),
616
+ "data-testid": "".concat(key, "-embed-option-label"),
617
+ htmlFor: key,
618
+ children: [/*#__PURE__*/jsx("div", {
619
+ className: "flex items-center",
620
+ children: /*#__PURE__*/jsx(Radio.Item, {
621
+ label: label,
622
+ checked: key === selectedOption,
623
+ className: "mb-0",
624
+ "data-cy": "".concat(key, "-embed-radio-button"),
625
+ "data-testid": "".concat(key, "-embed-radio-button"),
626
+ id: key,
627
+ name: "options",
628
+ value: key,
629
+ onChange: function onChange(event) {
630
+ return setSelectedOption(event.target.value);
631
+ }
632
+ })
633
+ }), /*#__PURE__*/jsx(Typography, {
634
+ className: "w-full pl-6 pt-1",
635
+ "data-cy": "".concat(key, "-embed-option-description"),
636
+ style: "body2",
637
+ children: description
638
+ })]
639
+ }, key);
640
+ })
641
+ });
1239
642
  };
1240
643
 
1241
644
  var ElementPopup = function ElementPopup(_ref) {
@@ -1251,17 +654,14 @@ var ElementPopup = function ElementPopup(_ref) {
1251
654
  (_window$globalProps$a = window[globalProps.appName.replace(/^neeto/i, "neeto")]) === null || _window$globalProps$a === void 0 || _window$globalProps$a.embed(element, iframeURL);
1252
655
  }
1253
656
  }, []);
1254
- return /*#__PURE__*/jsxs("div", {
1255
- className: "relative h-full w-full overflow-hidden",
1256
- children: [/*#__PURE__*/jsx(ElementPopupPlaceholderImage, {
1257
- className: "neeto-ui-text-gray-100 absolute inset-0 h-auto w-full p-10"
1258
- }), /*#__PURE__*/jsx(Button, {
1259
- className: "absolute left-[48.5294117647%] top-[39.0804597701%]",
657
+ return /*#__PURE__*/jsx("div", {
658
+ className: "relative flex h-full w-full items-center justify-center p-6",
659
+ children: /*#__PURE__*/jsx(Button, {
1260
660
  "data-cy": "preview-element-popup-button",
1261
661
  "data-testid": "preview-element-popup-button",
1262
662
  id: elementSelector,
1263
- label: t("neetoMolecules.productEmbed.elementPopup.label")
1264
- })]
663
+ label: t("neetoMolecules.productEmbed.customization.elementPopup.label")
664
+ })
1265
665
  });
1266
666
  };
1267
667
 
@@ -1284,11 +684,9 @@ var FloatingPopup = function FloatingPopup(_ref) {
1284
684
  btn.style.backgroundColor = btnColor;
1285
685
  btn.style.color = btnTextColor;
1286
686
  }, [btnColor, btnTextColor]);
1287
- return /*#__PURE__*/jsxs("div", {
1288
- className: "relative h-full w-full overflow-hidden",
1289
- children: [/*#__PURE__*/jsx(FloatingPopupPlaceholderImage, {
1290
- className: "neeto-ui-text-gray-100 h-auto w-full p-10"
1291
- }), /*#__PURE__*/jsx(Button, {
687
+ return /*#__PURE__*/jsx("div", {
688
+ className: "relative h-full w-full",
689
+ children: /*#__PURE__*/jsx(Button, {
1292
690
  "data-cy": "popup-preview-button",
1293
691
  icon: icon && showIcon ? icon : null,
1294
692
  iconPosition: "left",
@@ -1298,7 +696,7 @@ var FloatingPopup = function FloatingPopup(_ref) {
1298
696
  "left-0": btnPosition === "bottomLeft",
1299
697
  "right-0": btnPosition === "bottomRight"
1300
698
  })
1301
- })]
699
+ })
1302
700
  });
1303
701
  };
1304
702
 
@@ -1317,14 +715,14 @@ var Inline = function Inline(_ref) {
1317
715
 
1318
716
  var Preview = function Preview(_ref) {
1319
717
  var isScriptLoading = _ref.isScriptLoading,
1320
- selectedEmbed = _ref.selectedEmbed,
718
+ selectedOption = _ref.selectedOption,
1321
719
  id = _ref.id,
1322
720
  customization = _ref.customization,
1323
721
  _ref$customPreviewIfr = _ref.customPreviewIframeUrl,
1324
722
  customPreviewIframeUrl = _ref$customPreviewIfr === void 0 ? "" : _ref$customPreviewIfr;
1325
723
  var preview = _defineProperty(_defineProperty(_defineProperty({}, EMBED_OPTIONS.INLINE, Inline), EMBED_OPTIONS.FLOATING_POPUP, FloatingPopup), EMBED_OPTIONS.ELEMENT_POPUP, ElementPopup);
1326
724
  var iframeURL = customPreviewIframeUrl || "".concat(location.origin, "/embed/").concat(id);
1327
- var Component = preview[selectedEmbed];
725
+ var Component = preview[selectedOption];
1328
726
  if (isScriptLoading) {
1329
727
  return /*#__PURE__*/jsx("div", {
1330
728
  className: "flex min-h-0 flex-grow items-center justify-center overflow-y-auto",
@@ -1341,40 +739,68 @@ var Preview = function Preview(_ref) {
1341
739
  });
1342
740
  };
1343
741
 
1344
- var css = ".neeto-molecules-product-embed-size-input.neeto-ui-input__wrapper .neeto-ui-input__prefix{align-self:stretch;background-color:rgb(var(--neeto-ui-gray-200));margin-left:0!important;padding-left:.75rem;padding-right:.75rem}.neeto-molecules-product-embed-tab{gap:.5rem}.neeto-molecules-product-embed-tab .neeto-ui-tab{border-radius:var(--neeto-ui-btn-border-radius);color:rgb(var(--neeto-ui-gray-800))}.neeto-molecules-product-embed-tab .neeto-ui-tab:not(.active):hover{background-color:rgb(var(--neeto-ui-gray-100))}.neeto-molecules-product-embed-tab .neeto-ui-tab.active{background-color:rgb(var(--neeto-ui-gray-200))}.neeto-molecules-embed__left-sidebar{align-items:flex-start;display:flex;flex-direction:column;flex-shrink:0;overflow-y:auto;width:100%}@media (min-width:768px){.neeto-molecules-embed__left-sidebar{border-right:1px solid rgb(var(--neeto-ui-gray-200));max-width:25rem}}@media (min-width:1024px){.neeto-molecules-embed__left-sidebar{max-width:30.3125rem}}.neeto-molecules-embed__code-block .neeto-molecules-code-block{font-size:.875rem;height:13.4375rem;margin-top:0!important}.neeto-molecules-embed__browser-preview{height:100%;min-height:18.75rem}.neeto-molecules-embed__browser-preview .neeto-molecules-browser-preview__body{position:relative}.neeto-molecules-embed__browser-preview .neeto-molecules-browser-preview__body iframe{height:100%;left:0;position:absolute;top:0;width:100%}.neeto-molecules-embed-landing-page__card{background-color:rgb(var(--neeto-ui-white))!important;border:1px solid rgb(var(--neeto-ui-gray-300))!important;border-radius:.75rem!important;outline:1px solid rgb(var(--neeto-ui-white))!important;padding:1.5rem!important;text-align:left!important;transition:all .3s!important}.neeto-molecules-embed-landing-page__card:hover{border-color:rgb(var(--neeto-ui-primary-500))!important;outline:1px solid rgb(var(--neeto-ui-primary-500))!important}";
742
+ var css = ".neeto-molecules-product-embed-size-input.neeto-ui-input__wrapper .neeto-ui-input__prefix{align-self:stretch;background-color:rgb(var(--neeto-ui-gray-200));margin-left:0!important;padding-left:.75rem;padding-right:.75rem}.neeto-molecules-product-embed-tab{gap:.5rem}.neeto-molecules-product-embed-tab .neeto-ui-tab{border-radius:var(--neeto-ui-btn-border-radius);color:rgb(var(--neeto-ui-gray-800))}.neeto-molecules-product-embed-tab .neeto-ui-tab:not(.active):hover{background-color:rgb(var(--neeto-ui-gray-100))}.neeto-molecules-product-embed-tab .neeto-ui-tab.active{background-color:rgb(var(--neeto-ui-gray-200))}.neeto-molecules-embed__left-sidebar{align-items:flex-start;display:flex;flex-direction:column;flex-shrink:0;overflow-y:auto;padding:1.5rem;width:100%}@media (min-width:768px){.neeto-molecules-embed__left-sidebar{border-right:1px solid rgb(var(--neeto-ui-gray-200));max-width:25rem}}@media (min-width:1024px){.neeto-molecules-embed__left-sidebar{max-width:27.5rem}}.neeto-molecules-embed__code-block .neeto-molecules-code-block{font-size:.875rem;height:15.625rem;margin-top:0!important}.neeto-molecules-embed__browser-preview{height:100%;min-height:18.75rem}.neeto-molecules-embed__browser-preview .neeto-molecules-browser-preview__body{position:relative}.neeto-molecules-embed__browser-preview .neeto-molecules-browser-preview__body iframe{height:100%;left:0;position:absolute;top:0;width:100%}";
1345
743
  n(css,{});
1346
744
 
1347
745
  function ownKeys(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; }
1348
746
  function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
1349
- var EmbedRenderer = function EmbedRenderer(_ref) {
1350
- var className = _ref.className,
1351
- customEmbedScriptPath = _ref.customEmbedScriptPath,
1352
- customPreviewIframeUrl = _ref.customPreviewIframeUrl,
747
+ var ProductEmbed = function ProductEmbed(_ref) {
748
+ var _ref$className = _ref.className,
749
+ className = _ref$className === void 0 ? "" : _ref$className,
750
+ _ref$customEmbedScrip = _ref.customEmbedScriptPath,
751
+ customEmbedScriptPath = _ref$customEmbedScrip === void 0 ? "" : _ref$customEmbedScrip,
752
+ _ref$customPreviewIfr = _ref.customPreviewIframeUrl,
753
+ customPreviewIframeUrl = _ref$customPreviewIfr === void 0 ? "" : _ref$customPreviewIfr,
754
+ _ref$goBackLink = _ref.goBackLink,
755
+ goBackLink = _ref$goBackLink === void 0 ? "" : _ref$goBackLink,
1353
756
  id = _ref.id,
1354
- isQueryParamsEnabled = _ref.isQueryParamsEnabled,
1355
- options = _ref.options,
1356
- extraArgs = _ref.extraArgs,
1357
- otherCustomizations = _ref.otherCustomizations,
1358
- inlineWrapperStyle = _ref.inlineWrapperStyle,
1359
- supportedLanguages = _ref.supportedLanguages,
1360
- selectedEmbed = _ref.selectedEmbed;
1361
- var _useTranslation = useTranslation(),
1362
- t = _useTranslation.t;
1363
- var location = useLocation();
757
+ _ref$isQueryParamsEna = _ref.isQueryParamsEnabled,
758
+ isQueryParamsEnabled = _ref$isQueryParamsEna === void 0 ? false : _ref$isQueryParamsEna,
759
+ _ref$options = _ref.options,
760
+ options = _ref$options === void 0 ? {} : _ref$options,
761
+ _ref$extraArgs = _ref.extraArgs,
762
+ extraArgs = _ref$extraArgs === void 0 ? {} : _ref$extraArgs,
763
+ _ref$otherCustomizati = _ref.otherCustomizations,
764
+ otherCustomizations = _ref$otherCustomizati === void 0 ? noop : _ref$otherCustomizati,
765
+ _ref$inlineWrapperSty = _ref.inlineWrapperStyle,
766
+ inlineWrapperStyle = _ref$inlineWrapperSty === void 0 ? "" : _ref$inlineWrapperSty,
767
+ _ref$supportedLanguag = _ref.supportedLanguages,
768
+ supportedLanguages = _ref$supportedLanguag === void 0 ? ["html"] : _ref$supportedLanguag;
769
+ var supportedLanguagesTabs = filterBy({
770
+ key: function key(_key) {
771
+ return supportedLanguages === null || supportedLanguages === void 0 ? void 0 : supportedLanguages.includes(_key);
772
+ }
773
+ }, TABS);
1364
774
  var _useState = useState(true),
1365
775
  _useState2 = _slicedToArray(_useState, 2),
1366
776
  isScriptLoading = _useState2[0],
1367
777
  setIsScriptLoading = _useState2[1];
1368
- var _useState3 = useState(function () {
778
+ var _useState3 = useState(supportedLanguagesTabs[0].key),
779
+ _useState4 = _slicedToArray(_useState3, 2),
780
+ tab = _useState4[0],
781
+ setTab = _useState4[1];
782
+ var _useState5 = useState(EMBED_OPTIONS.INLINE),
783
+ _useState6 = _slicedToArray(_useState5, 2),
784
+ selectedOption = _useState6[0],
785
+ setSelectedOption = _useState6[1];
786
+ var _useState7 = useState(function () {
1369
787
  return buildDefaultCustomization(options);
1370
788
  }),
1371
- _useState4 = _slicedToArray(_useState3, 2),
1372
- customizations = _useState4[0],
1373
- setCustomizations = _useState4[1];
1374
- var description = customizations[selectedEmbed].description;
1375
- var customization = customizations[selectedEmbed];
1376
- var CustomizationComponent = EMBED_CUSTOMIZATION_COMPONENTS[selectedEmbed];
789
+ _useState8 = _slicedToArray(_useState7, 2),
790
+ customizations = _useState8[0],
791
+ setCustomizations = _useState8[1];
792
+ var _useTranslation = useTranslation(),
793
+ t = _useTranslation.t;
1377
794
  var embedScriptLink = customEmbedScriptPath || "".concat(window.location.protocol, "//").concat(window.location.host, "/javascript/embed.js");
795
+ var code = generateCode({
796
+ id: id,
797
+ tab: tab,
798
+ type: selectedOption,
799
+ customization: customizations[selectedOption],
800
+ embedScriptLink: embedScriptLink,
801
+ extraArgs: extraArgs,
802
+ inlineWrapperStyle: inlineWrapperStyle
803
+ });
1378
804
  var loadScript = function loadScript() {
1379
805
  var script = document.createElement("script");
1380
806
  script.id = SCRIPT_ID;
@@ -1384,184 +810,75 @@ var EmbedRenderer = function EmbedRenderer(_ref) {
1384
810
  };
1385
811
  var updateCustomization = function updateCustomization(props) {
1386
812
  return setCustomizations(function (prevState) {
1387
- return _objectSpread(_objectSpread({}, prevState), {}, _defineProperty({}, selectedEmbed, mergeLeft(props, prevState[selectedEmbed])));
813
+ return _objectSpread(_objectSpread({}, prevState), {}, _defineProperty({}, selectedOption, mergeLeft(props, prevState[selectedOption])));
1388
814
  });
1389
815
  };
1390
816
  useEffect(function () {
1391
817
  var isScriptLoaded = document.getElementById(SCRIPT_ID);
1392
818
  if (isScriptLoaded) setIsScriptLoading(false);else loadScript();
1393
819
  }, []);
1394
- return /*#__PURE__*/jsxs(Container, {
820
+ return /*#__PURE__*/jsxs("div", {
1395
821
  "data-testid": "embed-product",
1396
- className: classnames("neeto-molecules-embed flex w-full flex-grow flex-col p-0 md:flex-row", className),
822
+ className: classnames("neeto-molecules-embed flex w-full flex-grow flex-col md:flex-row", className),
1397
823
  children: [/*#__PURE__*/jsxs("div", {
1398
- className: "neeto-molecules-embed__left-sidebar px-5 py-8 md:h-full md:overflow-y-auto md:px-10",
1399
- children: [/*#__PURE__*/jsx(Button, {
824
+ className: "neeto-molecules-embed__left-sidebar",
825
+ children: [goBackLink && /*#__PURE__*/jsx(Button, {
1400
826
  className: "mb-4",
1401
- "data-cy": "back-to-embed-selection-button",
1402
- "data-testid": "back-to-embed-selection-button",
827
+ "data-cy": "back-button",
828
+ "data-testid": "back-button",
1403
829
  icon: LeftArrow,
1404
830
  iconPosition: "left",
1405
- label: t("neetoMolecules.productEmbed.backToEmbedSelection"),
831
+ label: t("neetoMolecules.productEmbed.backToShare"),
1406
832
  size: "small",
1407
833
  style: "link",
1408
- to: location.pathname
1409
- }), /*#__PURE__*/jsx(Header, {
1410
- className: "py-0",
1411
- "data-testid": "".concat(hyphenate(selectedEmbed), "-embed-title"),
1412
- title: EMBED_TITLES[selectedEmbed]
1413
- }), description && /*#__PURE__*/jsx(Typography, {
1414
- className: "mt-2",
1415
- "data-cy": "".concat(hyphenate(selectedEmbed), "-description"),
1416
- style: "body2",
1417
- children: description
1418
- }), /*#__PURE__*/jsx("div", {
1419
- className: "mt-4 flex w-full flex-col gap-y-6",
1420
- children: /*#__PURE__*/jsxs("div", {
1421
- className: "space-y-6",
1422
- children: [/*#__PURE__*/jsx(Code, {
1423
- customization: customization,
1424
- embedScriptLink: embedScriptLink,
1425
- extraArgs: extraArgs,
1426
- id: id,
1427
- inlineWrapperStyle: inlineWrapperStyle,
1428
- selectedEmbed: selectedEmbed,
1429
- supportedLanguages: supportedLanguages
1430
- }), /*#__PURE__*/jsx(CustomizationComponent, {
1431
- customization: customization,
1432
- isQueryParamsEnabled: isQueryParamsEnabled,
1433
- otherCustomizations: otherCustomizations,
1434
- updateCustomization: updateCustomization
1435
- })]
1436
- })
834
+ to: goBackLink
835
+ }), /*#__PURE__*/jsx(Typography, {
836
+ "data-cy": "embed-options-header-title",
837
+ style: "h3",
838
+ children: t("neetoMolecules.productEmbed.embedOptions.title")
839
+ }), /*#__PURE__*/jsxs("div", {
840
+ className: "mt-6 flex w-full flex-col gap-y-6 md:pb-20",
841
+ children: [/*#__PURE__*/jsx(Options, {
842
+ options: options,
843
+ selectedOption: selectedOption,
844
+ setSelectedOption: setSelectedOption
845
+ }), /*#__PURE__*/jsx(Customization, {
846
+ isQueryParamsEnabled: isQueryParamsEnabled,
847
+ otherCustomizations: otherCustomizations,
848
+ updateCustomization: updateCustomization,
849
+ customization: customizations[selectedOption],
850
+ option: selectedOption
851
+ })]
1437
852
  })]
1438
- }), /*#__PURE__*/jsx("div", {
1439
- className: "neeto-molecules-embed__preview neeto-ui-bg-gray-50 flex min-h-screen w-full min-w-0 flex-col gap-3 overflow-y-auto p-6 md:h-full md:min-h-0 md:flex-grow",
1440
- children: /*#__PURE__*/jsx(Preview, {
1441
- customPreviewIframeUrl: customPreviewIframeUrl,
1442
- customization: customization,
1443
- id: id,
1444
- isScriptLoading: isScriptLoading,
1445
- selectedEmbed: selectedEmbed
1446
- })
1447
- })]
1448
- });
1449
- };
1450
-
1451
- var EmbedSelector = function EmbedSelector(_ref) {
1452
- var options = _ref.options,
1453
- goBackLink = _ref.goBackLink,
1454
- title = _ref.title;
1455
- var _useTranslation = useTranslation(),
1456
- t = _useTranslation.t;
1457
- var history = useHistory();
1458
- var location = useLocation();
1459
- return /*#__PURE__*/jsxs(Container, {
1460
- className: "neeto-molecules-embed-landing-page py-8",
1461
- children: [goBackLink && /*#__PURE__*/jsx(Button, {
1462
- className: "mb-4",
1463
- "data-cy": "back-button",
1464
- "data-testid": "back-button",
1465
- icon: LeftArrow,
1466
- iconPosition: "left",
1467
- label: t("neetoMolecules.productEmbed.backToShare"),
1468
- size: "small",
1469
- style: "link",
1470
- to: goBackLink
1471
- }), /*#__PURE__*/jsx(Header, {
1472
- className: "py-0",
1473
- "data-testid": "embed-selector-header",
1474
- title: t("neetoMolecules.productEmbed.title")
1475
853
  }), /*#__PURE__*/jsxs("div", {
1476
- className: "neeto-molecules-embed-landing-page__container mx-auto w-full max-w-5xl py-6 md:py-10",
1477
- children: [/*#__PURE__*/jsx(Typography, {
1478
- className: "mb-2",
1479
- style: "h2",
1480
- children: title || t("neetoMolecules.productEmbed.embedSelectionTitle", {
1481
- productName: globalProps.appName
1482
- })
1483
- }), /*#__PURE__*/jsx(Typography, {
1484
- className: "mb-8",
1485
- style: "body1",
1486
- children: t("neetoMolecules.productEmbed.embedSelectionDescription")
1487
- }), /*#__PURE__*/jsx("div", {
1488
- className: "neeto-molecules-embed-landing-page__cards-wrapper grid w-full grid-cols-1 flex-wrap gap-6 md:grid-cols-3",
1489
- children: Object.entries(options).map(function (_ref2) {
1490
- var _ref3 = _slicedToArray(_ref2, 2),
1491
- key = _ref3[0],
1492
- _ref3$ = _ref3[1],
1493
- label = _ref3$.label,
1494
- description = _ref3$.description;
1495
- var EmbedIcon = EMBED_ICONS[key];
1496
- return /*#__PURE__*/jsxs("button", {
1497
- className: "neeto-molecules-embed-landing-page__card w-full",
1498
- "data-testid": "embed-selector-card-".concat(hyphenate(key)),
1499
- onClick: handleMetaClick(history, "".concat(location.pathname, "?type=").concat(hyphenate(key))),
1500
- children: [/*#__PURE__*/jsx("span", {
1501
- className: "neeto-molecules-embed-landing-page__card-icon mb-6 block",
1502
- children: /*#__PURE__*/jsx(EmbedIcon, {
1503
- className: "neeto-ui-text-gray-200 h-auto w-full max-w-72"
1504
- })
1505
- }), /*#__PURE__*/jsx(Typography, {
1506
- className: "mb-2",
1507
- style: "h4",
1508
- children: label
1509
- }), /*#__PURE__*/jsx(Typography, {
1510
- style: "body2",
1511
- children: description
1512
- })]
1513
- }, key);
1514
- })
854
+ className: "neeto-molecules-embed__preview neeto-ui-bg-white flex min-h-screen w-full min-w-0 flex-col gap-3 overflow-y-auto p-6 md:min-h-0 md:flex-grow",
855
+ children: [/*#__PURE__*/jsx(Header, {
856
+ setTab: setTab,
857
+ supportedLanguagesTabs: supportedLanguagesTabs,
858
+ tab: tab
859
+ }), /*#__PURE__*/jsxs("div", {
860
+ className: "flex min-h-0 flex-grow flex-col gap-3",
861
+ children: [/*#__PURE__*/jsx("div", {
862
+ className: "flex-shrink-0",
863
+ "data-testid": "embed-code-block",
864
+ children: /*#__PURE__*/jsx(Code, {
865
+ code: code,
866
+ tab: tab
867
+ })
868
+ }), /*#__PURE__*/jsx("div", {
869
+ className: "flex-grow",
870
+ children: /*#__PURE__*/jsx(Preview, {
871
+ customPreviewIframeUrl: customPreviewIframeUrl,
872
+ id: id,
873
+ isScriptLoading: isScriptLoading,
874
+ selectedOption: selectedOption,
875
+ customization: customizations[selectedOption]
876
+ })
877
+ })]
1515
878
  })]
1516
879
  })]
1517
880
  });
1518
881
  };
1519
882
 
1520
- var ProductEmbed = function ProductEmbed(_ref) {
1521
- var title = _ref.title,
1522
- _ref$className = _ref.className,
1523
- className = _ref$className === void 0 ? "" : _ref$className,
1524
- _ref$customEmbedScrip = _ref.customEmbedScriptPath,
1525
- customEmbedScriptPath = _ref$customEmbedScrip === void 0 ? "" : _ref$customEmbedScrip,
1526
- _ref$customPreviewIfr = _ref.customPreviewIframeUrl,
1527
- customPreviewIframeUrl = _ref$customPreviewIfr === void 0 ? "" : _ref$customPreviewIfr,
1528
- _ref$goBackLink = _ref.goBackLink,
1529
- goBackLink = _ref$goBackLink === void 0 ? "" : _ref$goBackLink,
1530
- id = _ref.id,
1531
- _ref$isQueryParamsEna = _ref.isQueryParamsEnabled,
1532
- isQueryParamsEnabled = _ref$isQueryParamsEna === void 0 ? false : _ref$isQueryParamsEna,
1533
- _ref$options = _ref.options,
1534
- options = _ref$options === void 0 ? {} : _ref$options,
1535
- _ref$extraArgs = _ref.extraArgs,
1536
- extraArgs = _ref$extraArgs === void 0 ? {} : _ref$extraArgs,
1537
- _ref$otherCustomizati = _ref.otherCustomizations,
1538
- otherCustomizations = _ref$otherCustomizati === void 0 ? noop : _ref$otherCustomizati,
1539
- _ref$inlineWrapperSty = _ref.inlineWrapperStyle,
1540
- inlineWrapperStyle = _ref$inlineWrapperSty === void 0 ? "" : _ref$inlineWrapperSty,
1541
- _ref$supportedLanguag = _ref.supportedLanguages,
1542
- supportedLanguages = _ref$supportedLanguag === void 0 ? ["html"] : _ref$supportedLanguag;
1543
- var _useLocation = useLocation(),
1544
- search = _useLocation.search;
1545
- var queryParams = new URLSearchParams(search);
1546
- var selectedEmbed = toCamelCasedString(queryParams.get("type"));
1547
- return selectedEmbed ? /*#__PURE__*/jsx(EmbedRenderer, {
1548
- className: className,
1549
- customEmbedScriptPath: customEmbedScriptPath,
1550
- customPreviewIframeUrl: customPreviewIframeUrl,
1551
- extraArgs: extraArgs,
1552
- id: id,
1553
- inlineWrapperStyle: inlineWrapperStyle,
1554
- isQueryParamsEnabled: isQueryParamsEnabled,
1555
- options: options,
1556
- otherCustomizations: otherCustomizations,
1557
- selectedEmbed: selectedEmbed,
1558
- supportedLanguages: supportedLanguages
1559
- }) : /*#__PURE__*/jsx(EmbedSelector, {
1560
- goBackLink: goBackLink,
1561
- options: options,
1562
- title: title
1563
- });
1564
- };
1565
-
1566
883
  export { ProductEmbed as default };
1567
884
  //# sourceMappingURL=ProductEmbed.js.map