@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,12 +1,10 @@
1
1
  'use strict';
2
2
 
3
3
  var neetoCist = require('@bigbinary/neeto-cist');
4
- var reactRouterDom = require('react-router-dom');
4
+ var ramda = require('ramda');
5
5
  var classnames = require('classnames');
6
6
  var Typography = require('@bigbinary/neetoui/Typography');
7
- var ramda = require('ramda');
8
7
  var reactI18next = require('react-i18next');
9
- var Container = require('./Container.js');
10
8
  var jsxRuntime = require('react/jsx-runtime');
11
9
  var _slicedToArray = require('@babel/runtime/helpers/slicedToArray');
12
10
  var React = require('react');
@@ -23,9 +21,6 @@ var Facebook = require('@bigbinary/neeto-icons/Facebook');
23
21
  var Linkedin = require('@bigbinary/neeto-icons/Linkedin');
24
22
  var Twitter = require('@bigbinary/neeto-icons/Twitter');
25
23
  var yup = require('yup');
26
- var _defineProperty = require('@babel/runtime/helpers/defineProperty');
27
- var _asyncToGenerator = require('@babel/runtime/helpers/asyncToGenerator');
28
- var _regeneratorRuntime = require('@babel/runtime/regenerator');
29
24
  var general = require('@bigbinary/neeto-commons-frontend/utils/general');
30
25
  var injectCss = require('./inject-css-vQvjPR2x.js');
31
26
  var utils = require('@bigbinary/neeto-commons-frontend/utils');
@@ -34,28 +29,15 @@ var Modal = require('@bigbinary/neetoui/Modal');
34
29
  var Input$1 = require('@bigbinary/neetoui/Input');
35
30
  var Select = require('@bigbinary/neetoui/Select');
36
31
  var DatePicker = require('@bigbinary/neetoui/DatePicker');
37
- var Share = require('@bigbinary/neeto-icons/Share');
38
- var QrCode = require('@bigbinary/neeto-icons/QrCode');
39
- var _objectWithoutProperties = require('@babel/runtime/helpers/objectWithoutProperties');
40
- var LeftArrow = require('@bigbinary/neeto-icons/LeftArrow');
41
- var CardLayout = require('./CardLayout.js');
42
- var Header$1 = require('./Header.js');
43
- require('./index-JY2zVpnv.js');
44
- require('./_commonjsHelpers-BJu3ubxk.js');
32
+ var _defineProperty = require('@babel/runtime/helpers/defineProperty');
33
+ var reactRouterDom = require('react-router-dom');
34
+ require('@babel/runtime/helpers/objectWithoutProperties');
45
35
  require('@bigbinary/neeto-icons/Copy');
46
36
  require('@bigbinary/neeto-icons/Check');
47
37
  require('@bigbinary/neeto-icons/MenuHorizontal');
48
38
  require('@bigbinary/neeto-icons/MenuVertical');
49
39
  require('@bigbinary/neetoui/Dropdown');
50
40
  require('@bigbinary/neetoui/Tooltip');
51
- require('./Breadcrumbs.js');
52
- require('./HelpPopover.js');
53
- require('@bigbinary/neetoui/Popover');
54
- require('./Search.js');
55
- require('@bigbinary/neeto-commons-frontend/react-utils/useFuncDebounce');
56
- require('@bigbinary/neeto-commons-frontend/react-utils/useQueryParams');
57
- require('@bigbinary/neeto-commons-frontend/react-utils/useUpdateEffect');
58
- require('@bigbinary/neeto-icons/Search');
59
41
 
60
42
  function _interopNamespaceDefault(e) {
61
43
  var n = Object.create(null);
@@ -137,49 +119,6 @@ var downloadCanvas = function downloadCanvas(canvas) {
137
119
  element.click();
138
120
  element.remove();
139
121
  };
140
- var copyCanvasToClipboard = /*#__PURE__*/function () {
141
- var _ref4 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee(canvas, handleDownloadQRCode) {
142
- var blob, clipboardItem;
143
- return _regeneratorRuntime.wrap(function _callee$(_context) {
144
- while (1) switch (_context.prev = _context.next) {
145
- case 0:
146
- if (canvas) {
147
- _context.next = 2;
148
- break;
149
- }
150
- return _context.abrupt("return");
151
- case 2:
152
- _context.prev = 2;
153
- _context.next = 5;
154
- return new Promise(function (resolve) {
155
- return canvas.toBlob(resolve);
156
- });
157
- case 5:
158
- blob = _context.sent;
159
- if (blob) {
160
- _context.next = 8;
161
- break;
162
- }
163
- return _context.abrupt("return");
164
- case 8:
165
- clipboardItem = new ClipboardItem(_defineProperty({}, blob.type, blob));
166
- navigator.clipboard.write([clipboardItem]);
167
- _context.next = 15;
168
- break;
169
- case 12:
170
- _context.prev = 12;
171
- _context.t0 = _context["catch"](2);
172
- handleDownloadQRCode();
173
- case 15:
174
- case "end":
175
- return _context.stop();
176
- }
177
- }, _callee, null, [[2, 12]]);
178
- }));
179
- return function copyCanvasToClipboard(_x, _x2) {
180
- return _ref4.apply(this, arguments);
181
- };
182
- }();
183
122
  var getPathname = function getPathname(url) {
184
123
  return new URL(url).pathname.slice(1);
185
124
  };
@@ -219,8 +158,8 @@ var PATH_VALIDATION_SCHEMA = yup__namespace.object().shape({
219
158
  path: yup__namespace.string().required(i18next.t("neetoMolecules.shareViaLink.editUrl.validationError")).matches(/^[A-Za-z0-9]([\w/-])*$/, i18next.t("neetoMolecules.shareViaLink.editUrl.validationError"))
220
159
  });
221
160
 
222
- var css$1 = ".no-padding .neeto-ui-input.neeto-ui-input--medium input{padding:0}.no-padding .neeto-ui-input__prefix{color:rgb(var(--neeto-ui-gray-600))!important}";
223
- injectCss.n(css$1,{});
161
+ var css = ".no-padding .neeto-ui-input.neeto-ui-input--medium input{padding:0}.no-padding .neeto-ui-input__prefix{color:rgb(var(--neeto-ui-gray-600))!important}";
162
+ injectCss.n(css,{});
224
163
 
225
164
  var Header = Pane.Header,
226
165
  Body = Pane.Body,
@@ -477,13 +416,13 @@ var Link = function Link(_ref) {
477
416
  "data-cy": "link-block",
478
417
  "data-testid": "link-block",
479
418
  children: /*#__PURE__*/jsxRuntime.jsxs("div", {
480
- className: "flex flex-col gap-2 sm:flex-row sm:items-center",
419
+ className: "flex flex-col gap-2 sm:flex-row sm:items-center sm:gap-1",
481
420
  children: [/*#__PURE__*/jsxRuntime.jsx("div", {
482
- className: "neeto-ui-rounded-md neeto-ui-border-gray-300 relative min-w-0 flex-grow truncate border p-2 leading-none",
421
+ className: "neeto-ui-rounded-md neeto-ui-border-gray-200 relative min-w-0 flex-grow truncate border p-2 leading-none",
483
422
  "data-cy": "nui-input-field",
484
423
  children: url
485
424
  }), /*#__PURE__*/jsxRuntime.jsxs("div", {
486
- className: "flex w-full flex-shrink-0 items-center gap-2 sm:w-auto",
425
+ className: "flex w-full flex-shrink-0 items-center gap-1 sm:w-auto",
487
426
  children: [/*#__PURE__*/jsxRuntime.jsx(CopyToClipboardButton, {
488
427
  "data-cy": "link-copy-button",
489
428
  "data-testid": "link-copy-button",
@@ -549,187 +488,6 @@ var Link = function Link(_ref) {
549
488
  });
550
489
  };
551
490
 
552
- var _excluded = ["title", "link", "description", "Icon", "onClick"];
553
- 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; }
554
- 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; }
555
- var Card = function Card(_ref) {
556
- var title = _ref.title,
557
- link = _ref.link,
558
- description = _ref.description,
559
- Icon = _ref.Icon,
560
- _ref$onClick = _ref.onClick,
561
- onClick = _ref$onClick === void 0 ? neetoCist.noop : _ref$onClick,
562
- otherProps = _objectWithoutProperties(_ref, _excluded);
563
- var Component = neetoCist.isPresent(link) ? reactRouterDom.Link : "div";
564
- return /*#__PURE__*/jsxRuntime.jsxs(Component, _objectSpread(_objectSpread({
565
- onClick: onClick,
566
- className: "neeto-ui-border-gray-300 neeto-ui-rounded-lg neeto-molecules-share-landing__card flex cursor-pointer flex-col gap-3 border p-3",
567
- to: link
568
- }, otherProps), {}, {
569
- children: [/*#__PURE__*/jsxRuntime.jsxs("div", {
570
- className: "flex items-center gap-2",
571
- children: [Icon && /*#__PURE__*/jsxRuntime.jsx(Icon, {
572
- className: "neeto-ui-text-gray-500 flex-shrink-0",
573
- size: 24
574
- }), /*#__PURE__*/jsxRuntime.jsx(Typography, {
575
- className: "min-w-0 flex-grow break-words",
576
- style: "h5",
577
- children: title
578
- })]
579
- }), description && /*#__PURE__*/jsxRuntime.jsx(Typography, {
580
- className: "break-words",
581
- lineHeight: "normal",
582
- style: "body2",
583
- children: description
584
- })]
585
- }));
586
- };
587
-
588
- var ShareBlock = function ShareBlock(_ref) {
589
- var moreOptions = _ref.moreOptions,
590
- disableShareSocialMedia = _ref.disableShareSocialMedia,
591
- disableQRDownload = _ref.disableQRDownload,
592
- socialMediaProps = _ref.socialMediaProps,
593
- qrCodeProps = _ref.qrCodeProps,
594
- entity = _ref.entity;
595
- var location = reactRouterDom.useLocation();
596
- var history = reactRouterDom.useHistory();
597
- var _useTranslation = reactI18next.useTranslation(),
598
- t = _useTranslation.t;
599
- var handleNavigate = function handleNavigate(subPath) {
600
- // eslint-disable-next-line @bigbinary/neeto/use-common-routes
601
- history.push("".concat(location.pathname, "/").concat(subPath));
602
- };
603
- var hasMoreOptions = neetoCist.isPresent(moreOptions);
604
- return /*#__PURE__*/jsxRuntime.jsxs("div", {
605
- className: "neeto-ui-border-gray-200 mt-8 grid grid-cols-1 gap-4 border-t pt-8 sm:grid-cols-2 md:grid-cols-3 lg:grid-cols-4",
606
- children: [hasMoreOptions && moreOptions.map(function (_ref2) {
607
- var title = _ref2.title,
608
- link = _ref2.link,
609
- Icon = _ref2.icon,
610
- onClick = _ref2.onClick,
611
- dataCy = _ref2.dataCy,
612
- description = _ref2.description;
613
- return /*#__PURE__*/React.createElement(Card, {
614
- Icon: Icon,
615
- description: description,
616
- link: link,
617
- onClick: onClick,
618
- title: title,
619
- "data-cy": dataCy,
620
- "data-testid": dataCy,
621
- key: link
622
- });
623
- }), !disableShareSocialMedia && /*#__PURE__*/jsxRuntime.jsx(Card, {
624
- Icon: Share,
625
- "data-cy": "social-share-card",
626
- "data-testid": "social-share-card",
627
- description: (socialMediaProps === null || socialMediaProps === void 0 ? void 0 : socialMediaProps.cardDescription) || t("neetoMolecules.shareViaLink.socialMediaShare.description"),
628
- title: (socialMediaProps === null || socialMediaProps === void 0 ? void 0 : socialMediaProps.cardTitle) || t("neetoMolecules.shareViaLink.socialMediaShare.title"),
629
- onClick: function onClick() {
630
- return handleNavigate("social-media");
631
- }
632
- }), !disableQRDownload && entity && /*#__PURE__*/jsxRuntime.jsx(Card, {
633
- Icon: QrCode,
634
- "data-cy": "qr-code-card",
635
- "data-testid": "qr-code-card",
636
- description: (qrCodeProps === null || qrCodeProps === void 0 ? void 0 : qrCodeProps.cardDescription) || t("neetoMolecules.shareViaLink.qrCode.description"),
637
- title: (qrCodeProps === null || qrCodeProps === void 0 ? void 0 : qrCodeProps.cardTitle) || t("neetoMolecules.shareViaLink.qrCode.title"),
638
- onClick: function onClick() {
639
- return handleNavigate("qrcode");
640
- }
641
- })]
642
- });
643
- };
644
-
645
- var MainPanel = function MainPanel(_ref) {
646
- var title = _ref.title,
647
- description = _ref.description,
648
- qrCodeProps = _ref.qrCodeProps,
649
- socialMediaProps = _ref.socialMediaProps,
650
- _ref$isLoading = _ref.isLoading,
651
- isLoading = _ref$isLoading === void 0 ? false : _ref$isLoading,
652
- _ref$enabledOptions = _ref.enabledOptions,
653
- enabledOptions = _ref$enabledOptions === void 0 ? {
654
- regenerate: false,
655
- edit: false
656
- } : _ref$enabledOptions,
657
- _ref$urls = _ref.urls,
658
- urls = _ref$urls === void 0 ? [] : _ref$urls,
659
- entity = _ref.entity,
660
- entityName = _ref.entityName,
661
- _ref$handleEdit = _ref.handleEdit,
662
- handleEdit = _ref$handleEdit === void 0 ? neetoCist.noop : _ref$handleEdit,
663
- _ref$handleRegenerate = _ref.handleRegenerate,
664
- handleRegenerate = _ref$handleRegenerate === void 0 ? neetoCist.noop : _ref$handleRegenerate,
665
- moreOptions = _ref.moreOptions,
666
- _ref$disableShareSoci = _ref.disableShareSocialMedia,
667
- disableShareSocialMedia = _ref$disableShareSoci === void 0 ? false : _ref$disableShareSoci,
668
- _ref$disableQRDownloa = _ref.disableQRDownload,
669
- disableQRDownload = _ref$disableQRDownloa === void 0 ? false : _ref$disableQRDownloa,
670
- _ref$publicLinkExpiry = _ref.publicLinkExpiryConfiguration,
671
- publicLinkExpiryConfiguration = _ref$publicLinkExpiry === void 0 ? {} : _ref$publicLinkExpiry;
672
- var _useTranslation = reactI18next.useTranslation(),
673
- t = _useTranslation.t;
674
- var shouldShowShareBlock = !disableQRDownload || !disableShareSocialMedia || neetoCist.isPresent(moreOptions);
675
- return /*#__PURE__*/jsxRuntime.jsx(Container, {
676
- className: "neeto-ui-bg-gray-100 neeto-molecule-share-landing-page",
677
- children: /*#__PURE__*/jsxRuntime.jsxs("div", {
678
- className: "mx-auto w-full max-w-5xl py-10",
679
- children: [/*#__PURE__*/jsxRuntime.jsx(Typography, {
680
- "data-cy": "share-your-meeting-heading",
681
- lineHeight: "tight",
682
- style: "h2",
683
- className: classnames({
684
- "mb-2": neetoCist.isPresent(description),
685
- "mb-6": !neetoCist.isPresent(description)
686
- }),
687
- children: title || t("neetoMolecules.shareViaLink.title", {
688
- productName: globalProps.appName
689
- })
690
- }), description && /*#__PURE__*/jsxRuntime.jsx(Typography, {
691
- className: "mb-6",
692
- "data-cy": "share-your-meeting-heading",
693
- lineHeight: "normal",
694
- style: "body1",
695
- children: description
696
- }), /*#__PURE__*/jsxRuntime.jsxs("div", {
697
- className: "neeto-ui-rounded-lg neeto-ui-bg-white p-6 sm:p-8",
698
- "data-testid": "share-via-link",
699
- children: [/*#__PURE__*/jsxRuntime.jsxs("div", {
700
- className: "space-y-1",
701
- children: [/*#__PURE__*/jsxRuntime.jsx("div", {
702
- className: "space-y-4",
703
- children: urls.map(function (urlOption) {
704
- return /*#__PURE__*/React.createElement(Link, {
705
- enabledOptions: enabledOptions,
706
- entityName: entityName,
707
- handleEdit: handleEdit,
708
- handleRegenerate: handleRegenerate,
709
- isLoading: isLoading,
710
- editUrlProps: ramda.omit(["url"], urlOption),
711
- key: urlOption.url,
712
- previewUrl: urlOption.previewUrl,
713
- url: urlOption.url
714
- });
715
- })
716
- }), neetoCist.isPresent(publicLinkExpiryConfiguration) && /*#__PURE__*/jsxRuntime.jsx(ExpiryNotice, {
717
- expiryConfiguration: publicLinkExpiryConfiguration
718
- })]
719
- }), shouldShowShareBlock && /*#__PURE__*/jsxRuntime.jsx(ShareBlock, {
720
- disableQRDownload: disableQRDownload,
721
- disableShareSocialMedia: disableShareSocialMedia,
722
- entity: entity,
723
- moreOptions: moreOptions,
724
- qrCodeProps: qrCodeProps,
725
- socialMediaProps: socialMediaProps,
726
- url: urls[0].url
727
- })]
728
- })]
729
- })
730
- });
731
- };
732
-
733
491
  var __defProp = Object.defineProperty;
734
492
  var __getOwnPropSymbols = Object.getOwnPropertySymbols;
735
493
  var __hasOwnProp = Object.prototype.hasOwnProperty;
@@ -1591,144 +1349,172 @@ var QRCode$1 = (props) => {
1591
1349
 
1592
1350
  var QRCode = function QRCode(_ref) {
1593
1351
  var entity = _ref.entity,
1594
- qrCodeProps = _ref.qrCodeProps,
1595
- url = _ref.url,
1596
- shareUrl = _ref.shareUrl;
1597
- var _useTranslation = reactI18next.useTranslation(),
1598
- t = _useTranslation.t;
1352
+ url = _ref.url;
1599
1353
  if (!entity) return null;
1600
1354
  var id = entity.id,
1601
1355
  name = entity.name;
1602
1356
  var canvasId = "qrcode-share-".concat(id);
1603
- var handleDownloadQRCode = function handleDownloadQRCode() {
1357
+ var handleDownload = function handleDownload() {
1604
1358
  var canvas = document.getElementById(canvasId);
1605
1359
  if (canvas) downloadCanvas(canvas, {
1606
1360
  name: neetoCist.slugify(name)
1607
1361
  });
1608
1362
  };
1609
- var handleCopyQRCode = function handleCopyQRCode() {
1610
- var canvas = document.getElementById(canvasId);
1611
- if (canvas) copyCanvasToClipboard(canvas, handleDownloadQRCode);
1612
- };
1613
- var title = (qrCodeProps === null || qrCodeProps === void 0 ? void 0 : qrCodeProps.pageTitle) || (qrCodeProps === null || qrCodeProps === void 0 ? void 0 : qrCodeProps.cardTitle) || t("neetoMolecules.shareViaLink.qrCode.title");
1614
- var description = (qrCodeProps === null || qrCodeProps === void 0 ? void 0 : qrCodeProps.pageDescription) || (qrCodeProps === null || qrCodeProps === void 0 ? void 0 : qrCodeProps.cardDescription) || t("neetoMolecules.shareViaLink.qrCode.description");
1615
- return /*#__PURE__*/jsxRuntime.jsxs(Container, {
1616
- className: "neeto-molecules-embed-qr-code-landing-page py-8",
1617
- children: [/*#__PURE__*/jsxRuntime.jsx(Button, {
1618
- className: "mb-4",
1619
- "data-cy": "back-button",
1620
- "data-testid": "back-button",
1621
- icon: LeftArrow,
1622
- iconPosition: "left",
1623
- label: t("neetoMolecules.productEmbed.backToShare"),
1624
- size: "small",
1625
- style: "link",
1626
- to: shareUrl
1627
- }), /*#__PURE__*/jsxRuntime.jsx(Header$1, {
1628
- className: "py-0",
1629
- title: t("neetoMolecules.shareViaLink.qrCode.title")
1630
- }), /*#__PURE__*/jsxRuntime.jsx(CardLayout, {
1631
- description: description,
1632
- title: title,
1633
- actionBlock: /*#__PURE__*/jsxRuntime.jsxs("div", {
1634
- className: "flex flex-wrap items-center gap-3",
1635
- children: [/*#__PURE__*/jsxRuntime.jsx(Button, {
1636
- "data-cy": "qr-code-download-button",
1637
- "data-testid": "qr-code-download-button",
1638
- label: t("neetoMolecules.shareViaLink.qrCode.download"),
1639
- style: "primary",
1640
- onClick: handleDownloadQRCode
1641
- }), /*#__PURE__*/jsxRuntime.jsx(CopyToClipboardButton, {
1642
- "data-cy": "qr-code-copy-button",
1643
- "data-testid": "qr-code-copy-button",
1644
- label: t("neetoMolecules.shareViaLink.qrCode.copy"),
1645
- style: "secondary",
1646
- onClick: handleCopyQRCode
1647
- })]
1648
- }),
1649
- children: /*#__PURE__*/jsxRuntime.jsx(QRCode$1, {
1650
- className: "mt-6 cursor-pointer",
1651
- "data-cy": "qr-code-image",
1652
- "data-testid": "qr-code-image",
1653
- id: canvasId,
1654
- size: 160,
1655
- style: {
1656
- width: 160,
1657
- height: 160
1658
- },
1659
- value: url,
1660
- onClick: handleDownloadQRCode
1363
+ return /*#__PURE__*/jsxRuntime.jsxs("div", {
1364
+ className: "neeto-ui-border-gray-200 flex flex-col justify-start space-y-2 border-t py-3 pl-8 sm:space-y-4 sm:border-l sm:py-2 sm:pl-6",
1365
+ "data-cy": "qr-download-block",
1366
+ "data-testid": "qr-download-block",
1367
+ children: [/*#__PURE__*/jsxRuntime.jsx(Typography, {
1368
+ lineHeight: "normal",
1369
+ style: "body2",
1370
+ weight: "medium",
1371
+ children: /*#__PURE__*/jsxRuntime.jsx(reactI18next.Trans, {
1372
+ i18nKey: "neetoMolecules.shareViaLink.socialMediaShare.qrCodeInfo",
1373
+ components: {
1374
+ button: /*#__PURE__*/jsxRuntime.jsx(Button, {
1375
+ "data-cy": "qr-code-download-button",
1376
+ "data-testid": "qr-code-download-button",
1377
+ style: "link",
1378
+ onClick: handleDownload
1379
+ })
1380
+ }
1661
1381
  })
1382
+ }), /*#__PURE__*/jsxRuntime.jsx(QRCode$1, {
1383
+ className: "cursor-pointer",
1384
+ "data-cy": "qr-code-image",
1385
+ "data-testid": canvasId,
1386
+ id: canvasId,
1387
+ size: 256,
1388
+ style: {
1389
+ width: 80,
1390
+ height: 80
1391
+ },
1392
+ value: url,
1393
+ onClick: handleDownload
1662
1394
  })]
1663
1395
  });
1664
1396
  };
1665
1397
 
1666
- var css = ".neeto-molecules-share-landing__card{outline:1px solid rgb(var(--neeto-ui-white))!important;transition:all .3s!important}.neeto-molecules-share-landing__card:hover{border-color:rgb(var(--neeto-ui-primary-500))!important;outline:1px solid rgb(var(--neeto-ui-primary-500))!important}";
1667
- injectCss.n(css,{});
1398
+ var Subtitle = function Subtitle(_ref) {
1399
+ var link = _ref.link,
1400
+ dataCy = _ref.dataCy,
1401
+ _onClick = _ref.onClick,
1402
+ subtitle = _ref.subtitle;
1403
+ var Component = neetoCist.isPresent(link) ? reactRouterDom.Link : "div";
1404
+ return /*#__PURE__*/jsxRuntime.jsx(Component, {
1405
+ "data-cy": dataCy,
1406
+ to: link,
1407
+ onClick: function onClick(event) {
1408
+ event.preventDefault();
1409
+ _onClick === null || _onClick === void 0 || _onClick(event);
1410
+ },
1411
+ children: /*#__PURE__*/jsxRuntime.jsx(Typography, {
1412
+ style: "body3",
1413
+ weight: "medium",
1414
+ className: classnames("break-words", {
1415
+ "neeto-ui-text-accent-800": neetoCist.isPresent(_onClick) || neetoCist.isPresent(link)
1416
+ }),
1417
+ children: subtitle
1418
+ })
1419
+ });
1420
+ };
1668
1421
 
1669
- var SocialMedia = function SocialMedia(_ref) {
1670
- var socialMediaProps = _ref.socialMediaProps,
1422
+ 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; }
1423
+ 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; }
1424
+ var ShareBlock = function ShareBlock(_ref) {
1425
+ var entity = _ref.entity,
1426
+ postTitle = _ref.postTitle,
1671
1427
  url = _ref.url,
1672
- shareUrl = _ref.shareUrl;
1428
+ moreOptions = _ref.moreOptions,
1429
+ disableShareSocialMedia = _ref.disableShareSocialMedia,
1430
+ disableQRDownload = _ref.disableQRDownload;
1673
1431
  var _useTranslation = reactI18next.useTranslation(),
1674
1432
  t = _useTranslation.t;
1675
- var title = (socialMediaProps === null || socialMediaProps === void 0 ? void 0 : socialMediaProps.pageTitle) || (socialMediaProps === null || socialMediaProps === void 0 ? void 0 : socialMediaProps.cardTitle) || t("neetoMolecules.shareViaLink.socialMediaShare.title");
1676
- var description = (socialMediaProps === null || socialMediaProps === void 0 ? void 0 : socialMediaProps.pageDescription) || (socialMediaProps === null || socialMediaProps === void 0 ? void 0 : socialMediaProps.cardDescription) || t("neetoMolecules.shareViaLink.socialMediaShare.description");
1677
- return /*#__PURE__*/jsxRuntime.jsxs(Container, {
1678
- className: "neeto-molecules-social-share-landing-page py-8",
1679
- children: [/*#__PURE__*/jsxRuntime.jsx(Button, {
1680
- className: "mb-4",
1681
- "data-cy": "back-button",
1682
- "data-testid": "back-button",
1683
- icon: LeftArrow,
1684
- iconPosition: "left",
1685
- label: t("neetoMolecules.productEmbed.backToShare"),
1686
- size: "small",
1687
- style: "link",
1688
- to: shareUrl
1689
- }), /*#__PURE__*/jsxRuntime.jsx(Header$1, {
1690
- className: "py-0",
1691
- title: t("neetoMolecules.shareViaLink.socialMediaShare.title")
1692
- }), /*#__PURE__*/jsxRuntime.jsx(CardLayout, {
1693
- description: description,
1694
- title: title,
1695
- actionBlock: /*#__PURE__*/jsxRuntime.jsx("div", {
1696
- className: "flex flex-wrap items-center gap-3",
1697
- children: Object.entries(SOCIAL_MEDIA_OPTIONS).map(function (_ref2) {
1698
- var _ref3 = _slicedToArray(_ref2, 2),
1699
- key = _ref3[0],
1700
- _ref3$ = _ref3[1],
1701
- label = _ref3$.label,
1702
- Icon = _ref3$.icon,
1703
- generateShareUrl = _ref3$.generateShareUrl;
1704
- return /*#__PURE__*/React.createElement(Button, {
1705
- label: label,
1433
+ var socialMediaButtonClasses = "neeto-ui-bg-gray-200 hover:neeto-ui-bg-gray-300 flex h-10 w-10 cursor-pointer items-center justify-center neeto-ui-rounded-md transition-colors duration-300 ease-in-out";
1434
+ var hasMoreOptions = neetoCist.isPresent(moreOptions);
1435
+ return /*#__PURE__*/jsxRuntime.jsxs("div", {
1436
+ className: "flex flex-col divide-y sm:flex-row sm:gap-6 sm:divide-x sm:divide-y-0",
1437
+ children: [hasMoreOptions && /*#__PURE__*/jsxRuntime.jsx("div", {
1438
+ className: "max-w-md divide-y",
1439
+ children: moreOptions.map(function (_ref2, index) {
1440
+ var title = _ref2.title,
1441
+ link = _ref2.link,
1442
+ Icon = _ref2.icon,
1443
+ onClick = _ref2.onClick,
1444
+ dataCy = _ref2.dataCy,
1445
+ subtitleProps = _ref2.subtitleProps;
1446
+ var Component = neetoCist.isPresent(link) ? reactRouterDom.Link : "div";
1447
+ return /*#__PURE__*/React.createElement(Component, {
1448
+ onClick: onClick,
1449
+ "data-cy": dataCy,
1450
+ key: link,
1451
+ to: link,
1452
+ className: classnames("neeto-ui-border-gray-200 flex cursor-pointer items-center gap-x-2 border-t py-3", {
1453
+ "border-none": index === 0
1454
+ })
1455
+ }, /*#__PURE__*/jsxRuntime.jsxs("div", {
1456
+ className: "flex flex-row gap-2",
1457
+ children: [/*#__PURE__*/jsxRuntime.jsx(Icon, {
1458
+ className: "neeto-ui-text-gray-500 flex-shrink-0",
1459
+ size: 24
1460
+ }), /*#__PURE__*/jsxRuntime.jsxs("div", {
1461
+ className: "flex flex-col gap-1",
1462
+ children: [/*#__PURE__*/jsxRuntime.jsx(Typography, {
1463
+ className: "group-hover:underline",
1464
+ style: "body2",
1465
+ weight: "medium",
1466
+ children: title
1467
+ }), subtitleProps && /*#__PURE__*/jsxRuntime.jsx(Subtitle, _objectSpread({}, subtitleProps))]
1468
+ })]
1469
+ }));
1470
+ })
1471
+ }), !disableShareSocialMedia && /*#__PURE__*/jsxRuntime.jsxs("div", {
1472
+ "data-cy": "social-media-block",
1473
+ "data-testid": "social-media-block",
1474
+ className: classnames("neeto-ui-border-gray-200 space-y-2 border-t py-3 sm:space-y-4 sm:border-l sm:py-2", {
1475
+ "pl-8 sm:pl-6": hasMoreOptions
1476
+ }),
1477
+ children: [/*#__PURE__*/jsxRuntime.jsx(Typography, {
1478
+ className: "neeto-ui-text-gray-800",
1479
+ lineHeight: "normal",
1480
+ style: "body2",
1481
+ weight: "medium",
1482
+ children: t("neetoMolecules.shareViaLink.socialMediaShare.title")
1483
+ }), /*#__PURE__*/jsxRuntime.jsx("div", {
1484
+ className: "flex gap-4",
1485
+ children: Object.entries(SOCIAL_MEDIA_OPTIONS).map(function (_ref3) {
1486
+ var _ref4 = _slicedToArray(_ref3, 2),
1487
+ key = _ref4[0],
1488
+ _ref4$ = _ref4[1],
1489
+ label = _ref4$.label,
1490
+ Icon = _ref4$.icon,
1491
+ generateShareUrl = _ref4$.generateShareUrl;
1492
+ return /*#__PURE__*/jsxRuntime.jsx("a", {
1493
+ className: socialMediaButtonClasses,
1706
1494
  "data-cy": "social-media-button-".concat(key),
1707
1495
  "data-testid": "social-media-button-".concat(key),
1708
- icon: Icon,
1709
- iconPosition: "right",
1710
- key: key,
1711
- rel: "noopener noreferrer",
1712
- style: "tertiary",
1713
- target: "_blank",
1714
1496
  href: generateShareUrl({
1715
1497
  url: url,
1716
- title: socialMediaProps === null || socialMediaProps === void 0 ? void 0 : socialMediaProps.postTitle
1498
+ title: postTitle
1499
+ }),
1500
+ rel: "noopener noreferrer",
1501
+ target: "_blank",
1502
+ title: label,
1503
+ children: /*#__PURE__*/jsxRuntime.jsx(Icon, {
1504
+ size: 24
1717
1505
  })
1718
- }, /*#__PURE__*/jsxRuntime.jsx(Icon, {
1719
- size: 24
1720
- }));
1506
+ }, key);
1721
1507
  })
1722
- })
1508
+ })]
1509
+ }), !disableQRDownload && /*#__PURE__*/jsxRuntime.jsx(QRCode, {
1510
+ entity: entity,
1511
+ url: url
1723
1512
  })]
1724
1513
  });
1725
1514
  };
1726
1515
 
1727
- /* eslint-disable @bigbinary/neeto/use-common-routes */
1728
1516
  var ShareViaLink = function ShareViaLink(_ref) {
1729
- var title = _ref.title,
1730
- description = _ref.description,
1731
- _ref$isLoading = _ref.isLoading,
1517
+ var _ref$isLoading = _ref.isLoading,
1732
1518
  isLoading = _ref$isLoading === void 0 ? false : _ref$isLoading,
1733
1519
  _ref$enabledOptions = _ref.enabledOptions,
1734
1520
  enabledOptions = _ref$enabledOptions === void 0 ? {
@@ -1743,71 +1529,46 @@ var ShareViaLink = function ShareViaLink(_ref) {
1743
1529
  handleEdit = _ref$handleEdit === void 0 ? neetoCist.noop : _ref$handleEdit,
1744
1530
  _ref$handleRegenerate = _ref.handleRegenerate,
1745
1531
  handleRegenerate = _ref$handleRegenerate === void 0 ? neetoCist.noop : _ref$handleRegenerate,
1532
+ socialMediaPostTitle = _ref.socialMediaPostTitle,
1533
+ moreOptions = _ref.moreOptions,
1534
+ _ref$isOtherShareOpti = _ref.isOtherShareOptionsEnabled,
1535
+ isOtherShareOptionsEnabled = _ref$isOtherShareOpti === void 0 ? true : _ref$isOtherShareOpti,
1746
1536
  _ref$disableShareSoci = _ref.disableShareSocialMedia,
1747
1537
  disableShareSocialMedia = _ref$disableShareSoci === void 0 ? false : _ref$disableShareSoci,
1748
1538
  _ref$disableQRDownloa = _ref.disableQRDownload,
1749
1539
  disableQRDownload = _ref$disableQRDownloa === void 0 ? false : _ref$disableQRDownloa,
1750
- socialMediaProps = _ref.socialMediaProps,
1751
- qrCodeProps = _ref.qrCodeProps,
1752
- moreOptions = _ref.moreOptions,
1753
1540
  _ref$publicLinkExpiry = _ref.publicLinkExpiryConfiguration,
1754
1541
  publicLinkExpiryConfiguration = _ref$publicLinkExpiry === void 0 ? {} : _ref$publicLinkExpiry;
1755
- var _useRouteMatch = reactRouterDom.useRouteMatch(),
1756
- sharePath = _useRouteMatch.path,
1757
- shareUrl = _useRouteMatch.url;
1758
- return /*#__PURE__*/jsxRuntime.jsxs(reactRouterDom.Switch, {
1759
- children: [/*#__PURE__*/jsxRuntime.jsx(reactRouterDom.Route, {
1760
- exact: true,
1761
- path: sharePath,
1762
- render: function render() {
1763
- return /*#__PURE__*/jsxRuntime.jsx(MainPanel, {
1764
- description: description,
1765
- disableQRDownload: disableQRDownload,
1766
- disableShareSocialMedia: disableShareSocialMedia,
1767
- enabledOptions: enabledOptions,
1768
- entity: entity,
1769
- entityName: entityName,
1770
- handleEdit: handleEdit,
1771
- handleRegenerate: handleRegenerate,
1772
- isLoading: isLoading,
1773
- moreOptions: moreOptions,
1774
- publicLinkExpiryConfiguration: publicLinkExpiryConfiguration,
1775
- qrCodeProps: qrCodeProps,
1776
- socialMediaProps: socialMediaProps,
1777
- title: title,
1778
- urls: urls
1779
- });
1780
- }
1781
- }), /*#__PURE__*/jsxRuntime.jsx(reactRouterDom.Route, {
1782
- exact: true,
1783
- path: "".concat(sharePath, "/qrcode"),
1784
- render: function render() {
1785
- return /*#__PURE__*/jsxRuntime.jsx(QRCode, {
1786
- entity: entity,
1787
- qrCodeProps: qrCodeProps,
1788
- shareUrl: shareUrl,
1789
- url: urls[0].url
1790
- });
1791
- }
1792
- }), /*#__PURE__*/jsxRuntime.jsx(reactRouterDom.Route, {
1793
- exact: true,
1794
- path: "".concat(sharePath, "/social-media"),
1795
- render: function render() {
1796
- return /*#__PURE__*/jsxRuntime.jsx(SocialMedia, {
1797
- shareUrl: shareUrl,
1798
- socialMediaProps: socialMediaProps,
1799
- url: urls[0].url
1800
- });
1801
- }
1802
- }), neetoCist.isPresent(moreOptions) && moreOptions.map(function (_ref2) {
1803
- var link = _ref2.link,
1804
- element = _ref2.element;
1805
- if (!neetoCist.isPresent(link)) return null;
1806
- return /*#__PURE__*/jsxRuntime.jsx(reactRouterDom.Route, {
1807
- exact: true,
1808
- path: link,
1809
- children: element
1810
- }, link);
1542
+ return /*#__PURE__*/jsxRuntime.jsxs("div", {
1543
+ className: "neeto-ui-border-gray-300 neeto-ui-rounded-lg neeto-ui-bg-white col-span-2 space-y-4 border p-6 sm:p-8",
1544
+ "data-testid": "share-via-link",
1545
+ children: [/*#__PURE__*/jsxRuntime.jsxs("div", {
1546
+ className: "space-y-1",
1547
+ children: [/*#__PURE__*/jsxRuntime.jsx("div", {
1548
+ className: "space-y-4",
1549
+ children: urls.map(function (urlOption) {
1550
+ return /*#__PURE__*/React.createElement(Link, {
1551
+ enabledOptions: enabledOptions,
1552
+ entityName: entityName,
1553
+ handleEdit: handleEdit,
1554
+ handleRegenerate: handleRegenerate,
1555
+ isLoading: isLoading,
1556
+ editUrlProps: ramda.omit(["url"], urlOption),
1557
+ key: urlOption.url,
1558
+ previewUrl: urlOption.previewUrl,
1559
+ url: urlOption.url
1560
+ });
1561
+ })
1562
+ }), neetoCist.isPresent(publicLinkExpiryConfiguration) && /*#__PURE__*/jsxRuntime.jsx(ExpiryNotice, {
1563
+ expiryConfiguration: publicLinkExpiryConfiguration
1564
+ })]
1565
+ }), isOtherShareOptionsEnabled && /*#__PURE__*/jsxRuntime.jsx(ShareBlock, {
1566
+ disableQRDownload: disableQRDownload,
1567
+ disableShareSocialMedia: disableShareSocialMedia,
1568
+ entity: entity,
1569
+ moreOptions: moreOptions,
1570
+ postTitle: socialMediaPostTitle,
1571
+ url: urls[0].url
1811
1572
  })]
1812
1573
  });
1813
1574
  };