@bigbinary/neeto-molecules 3.16.0 → 3.16.1-beta

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,8 +1,10 @@
1
- import { isPresent, slugify, noop } from '@bigbinary/neeto-cist';
2
- import { omit } from 'ramda';
1
+ import { isPresent, noop, slugify } from '@bigbinary/neeto-cist';
2
+ import { Link as Link$1, useLocation, useHistory, useRouteMatch, Switch, Route } from 'react-router-dom';
3
3
  import classnames from 'classnames';
4
4
  import Typography from '@bigbinary/neetoui/Typography';
5
- import { useTranslation, Trans } from 'react-i18next';
5
+ import { omit } from 'ramda';
6
+ import { useTranslation } from 'react-i18next';
7
+ import Container from './Container.js';
6
8
  import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
7
9
  import _slicedToArray from '@babel/runtime/helpers/slicedToArray';
8
10
  import React__default, { useRef, useCallback, useEffect, useState, createElement } from 'react';
@@ -19,6 +21,9 @@ import Facebook from '@bigbinary/neeto-icons/Facebook';
19
21
  import Linkedin from '@bigbinary/neeto-icons/Linkedin';
20
22
  import Twitter from '@bigbinary/neeto-icons/Twitter';
21
23
  import * as yup from 'yup';
24
+ import _defineProperty from '@babel/runtime/helpers/defineProperty';
25
+ import _asyncToGenerator from '@babel/runtime/helpers/asyncToGenerator';
26
+ import _regeneratorRuntime from '@babel/runtime/regenerator';
22
27
  import { buildUrl } from '@bigbinary/neeto-commons-frontend/utils/general';
23
28
  import { n } from './inject-css-DmrvuTKK.js';
24
29
  import { dayjs } from '@bigbinary/neeto-commons-frontend/utils';
@@ -27,15 +32,28 @@ import Modal from '@bigbinary/neetoui/Modal';
27
32
  import Input$1 from '@bigbinary/neetoui/Input';
28
33
  import Select from '@bigbinary/neetoui/Select';
29
34
  import DatePicker from '@bigbinary/neetoui/DatePicker';
30
- import _defineProperty from '@babel/runtime/helpers/defineProperty';
31
- import { Link as Link$1 } from 'react-router-dom';
32
- import '@babel/runtime/helpers/objectWithoutProperties';
35
+ import Share from '@bigbinary/neeto-icons/Share';
36
+ import QrCode from '@bigbinary/neeto-icons/QrCode';
37
+ import _objectWithoutProperties from '@babel/runtime/helpers/objectWithoutProperties';
38
+ import LeftArrow from '@bigbinary/neeto-icons/LeftArrow';
39
+ import CardLayout from './CardLayout.js';
40
+ import Header$1 from './Header.js';
41
+ import './index-DAYCJu79.js';
42
+ import './_commonjsHelpers-BFTU3MAI.js';
33
43
  import '@bigbinary/neeto-icons/Copy';
34
44
  import '@bigbinary/neeto-icons/Check';
35
45
  import '@bigbinary/neeto-icons/MenuHorizontal';
36
46
  import '@bigbinary/neeto-icons/MenuVertical';
37
47
  import '@bigbinary/neetoui/Dropdown';
38
48
  import '@bigbinary/neetoui/Tooltip';
49
+ import './Breadcrumbs.js';
50
+ import './HelpPopover.js';
51
+ import '@bigbinary/neetoui/Popover';
52
+ import './Search.js';
53
+ import '@bigbinary/neeto-commons-frontend/react-utils/useFuncDebounce';
54
+ import '@bigbinary/neeto-commons-frontend/react-utils/useQueryParams';
55
+ import '@bigbinary/neeto-commons-frontend/react-utils/useUpdateEffect';
56
+ import '@bigbinary/neeto-icons/Search';
39
57
 
40
58
  var ExpiryNotice = function ExpiryNotice(_ref) {
41
59
  var expiryConfiguration = _ref.expiryConfiguration;
@@ -98,6 +116,49 @@ var downloadCanvas = function downloadCanvas(canvas) {
98
116
  element.click();
99
117
  element.remove();
100
118
  };
119
+ var copyCanvasToClipboard = /*#__PURE__*/function () {
120
+ var _ref4 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee(canvas, handleDownloadQRCode) {
121
+ var blob, clipboardItem;
122
+ return _regeneratorRuntime.wrap(function _callee$(_context) {
123
+ while (1) switch (_context.prev = _context.next) {
124
+ case 0:
125
+ if (canvas) {
126
+ _context.next = 2;
127
+ break;
128
+ }
129
+ return _context.abrupt("return");
130
+ case 2:
131
+ _context.prev = 2;
132
+ _context.next = 5;
133
+ return new Promise(function (resolve) {
134
+ return canvas.toBlob(resolve);
135
+ });
136
+ case 5:
137
+ blob = _context.sent;
138
+ if (blob) {
139
+ _context.next = 8;
140
+ break;
141
+ }
142
+ return _context.abrupt("return");
143
+ case 8:
144
+ clipboardItem = new ClipboardItem(_defineProperty({}, blob.type, blob));
145
+ navigator.clipboard.write([clipboardItem]);
146
+ _context.next = 15;
147
+ break;
148
+ case 12:
149
+ _context.prev = 12;
150
+ _context.t0 = _context["catch"](2);
151
+ handleDownloadQRCode();
152
+ case 15:
153
+ case "end":
154
+ return _context.stop();
155
+ }
156
+ }, _callee, null, [[2, 12]]);
157
+ }));
158
+ return function copyCanvasToClipboard(_x, _x2) {
159
+ return _ref4.apply(this, arguments);
160
+ };
161
+ }();
101
162
  var getPathname = function getPathname(url) {
102
163
  return new URL(url).pathname.slice(1);
103
164
  };
@@ -137,8 +198,8 @@ var PATH_VALIDATION_SCHEMA = yup.object().shape({
137
198
  path: yup.string().required(t("neetoMolecules.shareViaLink.editUrl.validationError")).matches(/^[A-Za-z0-9]([\w/-])*$/, t("neetoMolecules.shareViaLink.editUrl.validationError"))
138
199
  });
139
200
 
140
- 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}";
141
- n(css,{});
201
+ 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}";
202
+ n(css$1,{});
142
203
 
143
204
  var Header = Pane.Header,
144
205
  Body = Pane.Body,
@@ -395,13 +456,13 @@ var Link = function Link(_ref) {
395
456
  "data-cy": "link-block",
396
457
  "data-testid": "link-block",
397
458
  children: /*#__PURE__*/jsxs("div", {
398
- className: "flex flex-col gap-2 sm:flex-row sm:items-center sm:gap-1",
459
+ className: "flex flex-col gap-2 sm:flex-row sm:items-center",
399
460
  children: [/*#__PURE__*/jsx("div", {
400
- className: "neeto-ui-rounded-md neeto-ui-border-gray-200 relative min-w-0 flex-grow truncate border p-2 leading-none",
461
+ className: "neeto-ui-rounded-md neeto-ui-border-gray-300 relative min-w-0 flex-grow truncate border p-2 leading-none",
401
462
  "data-cy": "nui-input-field",
402
463
  children: url
403
464
  }), /*#__PURE__*/jsxs("div", {
404
- className: "flex w-full flex-shrink-0 items-center gap-1 sm:w-auto",
465
+ className: "flex w-full flex-shrink-0 items-center gap-2 sm:w-auto",
405
466
  children: [/*#__PURE__*/jsx(CopyToClipboardButton, {
406
467
  "data-cy": "link-copy-button",
407
468
  "data-testid": "link-copy-button",
@@ -467,6 +528,187 @@ var Link = function Link(_ref) {
467
528
  });
468
529
  };
469
530
 
531
+ var _excluded = ["title", "link", "description", "Icon", "onClick"];
532
+ 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; }
533
+ 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; }
534
+ var Card = function Card(_ref) {
535
+ var title = _ref.title,
536
+ link = _ref.link,
537
+ description = _ref.description,
538
+ Icon = _ref.Icon,
539
+ _ref$onClick = _ref.onClick,
540
+ onClick = _ref$onClick === void 0 ? noop : _ref$onClick,
541
+ otherProps = _objectWithoutProperties(_ref, _excluded);
542
+ var Component = isPresent(link) ? Link$1 : "div";
543
+ return /*#__PURE__*/jsxs(Component, _objectSpread(_objectSpread({
544
+ onClick: onClick,
545
+ 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",
546
+ to: link
547
+ }, otherProps), {}, {
548
+ children: [/*#__PURE__*/jsxs("div", {
549
+ className: "flex items-center gap-2",
550
+ children: [Icon && /*#__PURE__*/jsx(Icon, {
551
+ className: "neeto-ui-text-gray-500 flex-shrink-0",
552
+ size: 24
553
+ }), /*#__PURE__*/jsx(Typography, {
554
+ className: "min-w-0 flex-grow break-words",
555
+ style: "h5",
556
+ children: title
557
+ })]
558
+ }), description && /*#__PURE__*/jsx(Typography, {
559
+ className: "break-words",
560
+ lineHeight: "normal",
561
+ style: "body2",
562
+ children: description
563
+ })]
564
+ }));
565
+ };
566
+
567
+ var ShareBlock = function ShareBlock(_ref) {
568
+ var moreOptions = _ref.moreOptions,
569
+ disableShareSocialMedia = _ref.disableShareSocialMedia,
570
+ disableQRDownload = _ref.disableQRDownload,
571
+ socialMediaProps = _ref.socialMediaProps,
572
+ qrCodeProps = _ref.qrCodeProps,
573
+ entity = _ref.entity;
574
+ var location = useLocation();
575
+ var history = useHistory();
576
+ var _useTranslation = useTranslation(),
577
+ t = _useTranslation.t;
578
+ var handleNavigate = function handleNavigate(subPath) {
579
+ // eslint-disable-next-line @bigbinary/neeto/use-common-routes
580
+ history.push("".concat(location.pathname, "/").concat(subPath));
581
+ };
582
+ var hasMoreOptions = isPresent(moreOptions);
583
+ return /*#__PURE__*/jsxs("div", {
584
+ 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",
585
+ children: [hasMoreOptions && moreOptions.map(function (_ref2) {
586
+ var title = _ref2.title,
587
+ link = _ref2.link,
588
+ Icon = _ref2.icon,
589
+ onClick = _ref2.onClick,
590
+ dataCy = _ref2.dataCy,
591
+ description = _ref2.description;
592
+ return /*#__PURE__*/createElement(Card, {
593
+ Icon: Icon,
594
+ description: description,
595
+ link: link,
596
+ onClick: onClick,
597
+ title: title,
598
+ "data-cy": dataCy,
599
+ "data-testid": dataCy,
600
+ key: link
601
+ });
602
+ }), !disableShareSocialMedia && /*#__PURE__*/jsx(Card, {
603
+ Icon: Share,
604
+ "data-cy": "social-share-card",
605
+ "data-testid": "social-share-card",
606
+ description: (socialMediaProps === null || socialMediaProps === void 0 ? void 0 : socialMediaProps.cardDescription) || t("neetoMolecules.shareViaLink.socialMediaShare.description"),
607
+ title: (socialMediaProps === null || socialMediaProps === void 0 ? void 0 : socialMediaProps.cardTitle) || t("neetoMolecules.shareViaLink.socialMediaShare.title"),
608
+ onClick: function onClick() {
609
+ return handleNavigate("social-media");
610
+ }
611
+ }), !disableQRDownload && entity && /*#__PURE__*/jsx(Card, {
612
+ Icon: QrCode,
613
+ "data-cy": "qr-code-card",
614
+ "data-testid": "qr-code-card",
615
+ description: (qrCodeProps === null || qrCodeProps === void 0 ? void 0 : qrCodeProps.cardDescription) || t("neetoMolecules.shareViaLink.qrCode.description"),
616
+ title: (qrCodeProps === null || qrCodeProps === void 0 ? void 0 : qrCodeProps.cardTitle) || t("neetoMolecules.shareViaLink.qrCode.title"),
617
+ onClick: function onClick() {
618
+ return handleNavigate("qrcode");
619
+ }
620
+ })]
621
+ });
622
+ };
623
+
624
+ var MainPanel = function MainPanel(_ref) {
625
+ var title = _ref.title,
626
+ description = _ref.description,
627
+ qrCodeProps = _ref.qrCodeProps,
628
+ socialMediaProps = _ref.socialMediaProps,
629
+ _ref$isLoading = _ref.isLoading,
630
+ isLoading = _ref$isLoading === void 0 ? false : _ref$isLoading,
631
+ _ref$enabledOptions = _ref.enabledOptions,
632
+ enabledOptions = _ref$enabledOptions === void 0 ? {
633
+ regenerate: false,
634
+ edit: false
635
+ } : _ref$enabledOptions,
636
+ _ref$urls = _ref.urls,
637
+ urls = _ref$urls === void 0 ? [] : _ref$urls,
638
+ entity = _ref.entity,
639
+ entityName = _ref.entityName,
640
+ _ref$handleEdit = _ref.handleEdit,
641
+ handleEdit = _ref$handleEdit === void 0 ? noop : _ref$handleEdit,
642
+ _ref$handleRegenerate = _ref.handleRegenerate,
643
+ handleRegenerate = _ref$handleRegenerate === void 0 ? noop : _ref$handleRegenerate,
644
+ moreOptions = _ref.moreOptions,
645
+ _ref$disableShareSoci = _ref.disableShareSocialMedia,
646
+ disableShareSocialMedia = _ref$disableShareSoci === void 0 ? false : _ref$disableShareSoci,
647
+ _ref$disableQRDownloa = _ref.disableQRDownload,
648
+ disableQRDownload = _ref$disableQRDownloa === void 0 ? false : _ref$disableQRDownloa,
649
+ _ref$publicLinkExpiry = _ref.publicLinkExpiryConfiguration,
650
+ publicLinkExpiryConfiguration = _ref$publicLinkExpiry === void 0 ? {} : _ref$publicLinkExpiry;
651
+ var _useTranslation = useTranslation(),
652
+ t = _useTranslation.t;
653
+ var shouldShowShareBlock = !disableQRDownload || !disableShareSocialMedia || isPresent(moreOptions);
654
+ return /*#__PURE__*/jsx(Container, {
655
+ className: "neeto-ui-bg-gray-100 neeto-molecule-share-landing-page",
656
+ children: /*#__PURE__*/jsxs("div", {
657
+ className: "mx-auto w-full max-w-5xl py-10",
658
+ children: [/*#__PURE__*/jsx(Typography, {
659
+ "data-cy": "share-your-meeting-heading",
660
+ lineHeight: "tight",
661
+ style: "h2",
662
+ className: classnames({
663
+ "mb-2": isPresent(description),
664
+ "mb-6": !isPresent(description)
665
+ }),
666
+ children: title || t("neetoMolecules.shareViaLink.title", {
667
+ productName: globalProps.appName
668
+ })
669
+ }), description && /*#__PURE__*/jsx(Typography, {
670
+ className: "mb-6",
671
+ "data-cy": "share-your-meeting-heading",
672
+ lineHeight: "normal",
673
+ style: "body1",
674
+ children: description
675
+ }), /*#__PURE__*/jsxs("div", {
676
+ className: "neeto-ui-rounded-lg neeto-ui-bg-white p-6 sm:p-8",
677
+ "data-testid": "share-via-link",
678
+ children: [/*#__PURE__*/jsxs("div", {
679
+ className: "space-y-1",
680
+ children: [/*#__PURE__*/jsx("div", {
681
+ className: "space-y-4",
682
+ children: urls.map(function (urlOption) {
683
+ return /*#__PURE__*/createElement(Link, {
684
+ enabledOptions: enabledOptions,
685
+ entityName: entityName,
686
+ handleEdit: handleEdit,
687
+ handleRegenerate: handleRegenerate,
688
+ isLoading: isLoading,
689
+ editUrlProps: omit(["url"], urlOption),
690
+ key: urlOption.url,
691
+ previewUrl: urlOption.previewUrl,
692
+ url: urlOption.url
693
+ });
694
+ })
695
+ }), isPresent(publicLinkExpiryConfiguration) && /*#__PURE__*/jsx(ExpiryNotice, {
696
+ expiryConfiguration: publicLinkExpiryConfiguration
697
+ })]
698
+ }), shouldShowShareBlock && /*#__PURE__*/jsx(ShareBlock, {
699
+ disableQRDownload: disableQRDownload,
700
+ disableShareSocialMedia: disableShareSocialMedia,
701
+ entity: entity,
702
+ moreOptions: moreOptions,
703
+ qrCodeProps: qrCodeProps,
704
+ socialMediaProps: socialMediaProps,
705
+ url: urls[0].url
706
+ })]
707
+ })]
708
+ })
709
+ });
710
+ };
711
+
470
712
  var __defProp = Object.defineProperty;
471
713
  var __getOwnPropSymbols = Object.getOwnPropertySymbols;
472
714
  var __hasOwnProp = Object.prototype.hasOwnProperty;
@@ -1328,172 +1570,144 @@ var QRCode$1 = (props) => {
1328
1570
 
1329
1571
  var QRCode = function QRCode(_ref) {
1330
1572
  var entity = _ref.entity,
1331
- url = _ref.url;
1573
+ qrCodeProps = _ref.qrCodeProps,
1574
+ url = _ref.url,
1575
+ shareUrl = _ref.shareUrl;
1576
+ var _useTranslation = useTranslation(),
1577
+ t = _useTranslation.t;
1332
1578
  if (!entity) return null;
1333
1579
  var id = entity.id,
1334
1580
  name = entity.name;
1335
1581
  var canvasId = "qrcode-share-".concat(id);
1336
- var handleDownload = function handleDownload() {
1582
+ var handleDownloadQRCode = function handleDownloadQRCode() {
1337
1583
  var canvas = document.getElementById(canvasId);
1338
1584
  if (canvas) downloadCanvas(canvas, {
1339
1585
  name: slugify(name)
1340
1586
  });
1341
1587
  };
1342
- return /*#__PURE__*/jsxs("div", {
1343
- 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",
1344
- "data-cy": "qr-download-block",
1345
- "data-testid": "qr-download-block",
1346
- children: [/*#__PURE__*/jsx(Typography, {
1347
- lineHeight: "normal",
1348
- style: "body2",
1349
- weight: "medium",
1350
- children: /*#__PURE__*/jsx(Trans, {
1351
- i18nKey: "neetoMolecules.shareViaLink.socialMediaShare.qrCodeInfo",
1352
- components: {
1353
- button: /*#__PURE__*/jsx(Button, {
1354
- "data-cy": "qr-code-download-button",
1355
- "data-testid": "qr-code-download-button",
1356
- style: "link",
1357
- onClick: handleDownload
1358
- })
1359
- }
1588
+ var handleCopyQRCode = function handleCopyQRCode() {
1589
+ var canvas = document.getElementById(canvasId);
1590
+ if (canvas) copyCanvasToClipboard(canvas, handleDownloadQRCode);
1591
+ };
1592
+ 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");
1593
+ 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");
1594
+ return /*#__PURE__*/jsxs(Container, {
1595
+ className: "neeto-molecules-embed-qr-code-landing-page py-8",
1596
+ children: [/*#__PURE__*/jsx(Button, {
1597
+ className: "mb-4",
1598
+ "data-cy": "back-button",
1599
+ "data-testid": "back-button",
1600
+ icon: LeftArrow,
1601
+ iconPosition: "left",
1602
+ label: t("neetoMolecules.productEmbed.backToShare"),
1603
+ size: "small",
1604
+ style: "link",
1605
+ to: shareUrl
1606
+ }), /*#__PURE__*/jsx(Header$1, {
1607
+ className: "py-0",
1608
+ title: t("neetoMolecules.shareViaLink.qrCode.title")
1609
+ }), /*#__PURE__*/jsx(CardLayout, {
1610
+ description: description,
1611
+ title: title,
1612
+ actionBlock: /*#__PURE__*/jsxs("div", {
1613
+ className: "flex flex-wrap items-center gap-3",
1614
+ children: [/*#__PURE__*/jsx(Button, {
1615
+ "data-cy": "qr-code-download-button",
1616
+ "data-testid": "qr-code-download-button",
1617
+ label: t("neetoMolecules.shareViaLink.qrCode.download"),
1618
+ style: "primary",
1619
+ onClick: handleDownloadQRCode
1620
+ }), /*#__PURE__*/jsx(CopyToClipboardButton, {
1621
+ "data-cy": "qr-code-copy-button",
1622
+ "data-testid": "qr-code-copy-button",
1623
+ label: t("neetoMolecules.shareViaLink.qrCode.copy"),
1624
+ style: "secondary",
1625
+ onClick: handleCopyQRCode
1626
+ })]
1627
+ }),
1628
+ children: /*#__PURE__*/jsx(QRCode$1, {
1629
+ className: "mt-6 cursor-pointer",
1630
+ "data-cy": "qr-code-image",
1631
+ "data-testid": "qr-code-image",
1632
+ id: canvasId,
1633
+ size: 160,
1634
+ style: {
1635
+ width: 160,
1636
+ height: 160
1637
+ },
1638
+ value: url,
1639
+ onClick: handleDownloadQRCode
1360
1640
  })
1361
- }), /*#__PURE__*/jsx(QRCode$1, {
1362
- className: "cursor-pointer",
1363
- "data-cy": "qr-code-image",
1364
- "data-testid": canvasId,
1365
- id: canvasId,
1366
- size: 256,
1367
- style: {
1368
- width: 80,
1369
- height: 80
1370
- },
1371
- value: url,
1372
- onClick: handleDownload
1373
1641
  })]
1374
1642
  });
1375
1643
  };
1376
1644
 
1377
- var Subtitle = function Subtitle(_ref) {
1378
- var link = _ref.link,
1379
- dataCy = _ref.dataCy,
1380
- _onClick = _ref.onClick,
1381
- subtitle = _ref.subtitle;
1382
- var Component = isPresent(link) ? Link$1 : "div";
1383
- return /*#__PURE__*/jsx(Component, {
1384
- "data-cy": dataCy,
1385
- to: link,
1386
- onClick: function onClick(event) {
1387
- event.preventDefault();
1388
- _onClick === null || _onClick === void 0 || _onClick(event);
1389
- },
1390
- children: /*#__PURE__*/jsx(Typography, {
1391
- style: "body3",
1392
- weight: "medium",
1393
- className: classnames("break-words", {
1394
- "neeto-ui-text-accent-800": isPresent(_onClick) || isPresent(link)
1395
- }),
1396
- children: subtitle
1397
- })
1398
- });
1399
- };
1645
+ 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}";
1646
+ n(css,{});
1400
1647
 
1401
- 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; }
1402
- 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; }
1403
- var ShareBlock = function ShareBlock(_ref) {
1404
- var entity = _ref.entity,
1405
- postTitle = _ref.postTitle,
1648
+ var SocialMedia = function SocialMedia(_ref) {
1649
+ var socialMediaProps = _ref.socialMediaProps,
1406
1650
  url = _ref.url,
1407
- moreOptions = _ref.moreOptions,
1408
- disableShareSocialMedia = _ref.disableShareSocialMedia,
1409
- disableQRDownload = _ref.disableQRDownload;
1651
+ shareUrl = _ref.shareUrl;
1410
1652
  var _useTranslation = useTranslation(),
1411
1653
  t = _useTranslation.t;
1412
- 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";
1413
- var hasMoreOptions = isPresent(moreOptions);
1414
- return /*#__PURE__*/jsxs("div", {
1415
- className: "flex flex-col divide-y sm:flex-row sm:gap-6 sm:divide-x sm:divide-y-0",
1416
- children: [hasMoreOptions && /*#__PURE__*/jsx("div", {
1417
- className: "max-w-md divide-y",
1418
- children: moreOptions.map(function (_ref2, index) {
1419
- var title = _ref2.title,
1420
- link = _ref2.link,
1421
- Icon = _ref2.icon,
1422
- onClick = _ref2.onClick,
1423
- dataCy = _ref2.dataCy,
1424
- subtitleProps = _ref2.subtitleProps;
1425
- var Component = isPresent(link) ? Link$1 : "div";
1426
- return /*#__PURE__*/createElement(Component, {
1427
- onClick: onClick,
1428
- "data-cy": dataCy,
1429
- key: link,
1430
- to: link,
1431
- className: classnames("neeto-ui-border-gray-200 flex cursor-pointer items-center gap-x-2 border-t py-3", {
1432
- "border-none": index === 0
1433
- })
1434
- }, /*#__PURE__*/jsxs("div", {
1435
- className: "flex flex-row gap-2",
1436
- children: [/*#__PURE__*/jsx(Icon, {
1437
- className: "neeto-ui-text-gray-500 flex-shrink-0",
1438
- size: 24
1439
- }), /*#__PURE__*/jsxs("div", {
1440
- className: "flex flex-col gap-1",
1441
- children: [/*#__PURE__*/jsx(Typography, {
1442
- className: "group-hover:underline",
1443
- style: "body2",
1444
- weight: "medium",
1445
- children: title
1446
- }), subtitleProps && /*#__PURE__*/jsx(Subtitle, _objectSpread({}, subtitleProps))]
1447
- })]
1448
- }));
1449
- })
1450
- }), !disableShareSocialMedia && /*#__PURE__*/jsxs("div", {
1451
- "data-cy": "social-media-block",
1452
- "data-testid": "social-media-block",
1453
- className: classnames("neeto-ui-border-gray-200 space-y-2 border-t py-3 sm:space-y-4 sm:border-l sm:py-2", {
1454
- "pl-8 sm:pl-6": hasMoreOptions
1455
- }),
1456
- children: [/*#__PURE__*/jsx(Typography, {
1457
- className: "neeto-ui-text-gray-800",
1458
- lineHeight: "normal",
1459
- style: "body2",
1460
- weight: "medium",
1461
- children: t("neetoMolecules.shareViaLink.socialMediaShare.title")
1462
- }), /*#__PURE__*/jsx("div", {
1463
- className: "flex gap-4",
1464
- children: Object.entries(SOCIAL_MEDIA_OPTIONS).map(function (_ref3) {
1465
- var _ref4 = _slicedToArray(_ref3, 2),
1466
- key = _ref4[0],
1467
- _ref4$ = _ref4[1],
1468
- label = _ref4$.label,
1469
- Icon = _ref4$.icon,
1470
- generateShareUrl = _ref4$.generateShareUrl;
1471
- return /*#__PURE__*/jsx("a", {
1472
- className: socialMediaButtonClasses,
1654
+ 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");
1655
+ 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");
1656
+ return /*#__PURE__*/jsxs(Container, {
1657
+ className: "neeto-molecules-social-share-landing-page py-8",
1658
+ children: [/*#__PURE__*/jsx(Button, {
1659
+ className: "mb-4",
1660
+ "data-cy": "back-button",
1661
+ "data-testid": "back-button",
1662
+ icon: LeftArrow,
1663
+ iconPosition: "left",
1664
+ label: t("neetoMolecules.productEmbed.backToShare"),
1665
+ size: "small",
1666
+ style: "link",
1667
+ to: shareUrl
1668
+ }), /*#__PURE__*/jsx(Header$1, {
1669
+ className: "py-0",
1670
+ title: t("neetoMolecules.shareViaLink.socialMediaShare.title")
1671
+ }), /*#__PURE__*/jsx(CardLayout, {
1672
+ description: description,
1673
+ title: title,
1674
+ actionBlock: /*#__PURE__*/jsx("div", {
1675
+ className: "flex flex-wrap items-center gap-3",
1676
+ children: Object.entries(SOCIAL_MEDIA_OPTIONS).map(function (_ref2) {
1677
+ var _ref3 = _slicedToArray(_ref2, 2),
1678
+ key = _ref3[0],
1679
+ _ref3$ = _ref3[1],
1680
+ label = _ref3$.label,
1681
+ Icon = _ref3$.icon,
1682
+ generateShareUrl = _ref3$.generateShareUrl;
1683
+ return /*#__PURE__*/createElement(Button, {
1684
+ label: label,
1473
1685
  "data-cy": "social-media-button-".concat(key),
1474
1686
  "data-testid": "social-media-button-".concat(key),
1475
- href: generateShareUrl({
1476
- url: url,
1477
- title: postTitle
1478
- }),
1687
+ icon: Icon,
1688
+ iconPosition: "right",
1689
+ key: key,
1479
1690
  rel: "noopener noreferrer",
1691
+ style: "tertiary",
1480
1692
  target: "_blank",
1481
- title: label,
1482
- children: /*#__PURE__*/jsx(Icon, {
1483
- size: 24
1693
+ href: generateShareUrl({
1694
+ url: url,
1695
+ title: socialMediaProps === null || socialMediaProps === void 0 ? void 0 : socialMediaProps.postTitle
1484
1696
  })
1485
- }, key);
1697
+ }, /*#__PURE__*/jsx(Icon, {
1698
+ size: 24
1699
+ }));
1486
1700
  })
1487
- })]
1488
- }), !disableQRDownload && /*#__PURE__*/jsx(QRCode, {
1489
- entity: entity,
1490
- url: url
1701
+ })
1491
1702
  })]
1492
1703
  });
1493
1704
  };
1494
1705
 
1706
+ /* eslint-disable @bigbinary/neeto/use-common-routes */
1495
1707
  var ShareViaLink = function ShareViaLink(_ref) {
1496
- var _ref$isLoading = _ref.isLoading,
1708
+ var title = _ref.title,
1709
+ description = _ref.description,
1710
+ _ref$isLoading = _ref.isLoading,
1497
1711
  isLoading = _ref$isLoading === void 0 ? false : _ref$isLoading,
1498
1712
  _ref$enabledOptions = _ref.enabledOptions,
1499
1713
  enabledOptions = _ref$enabledOptions === void 0 ? {
@@ -1508,46 +1722,71 @@ var ShareViaLink = function ShareViaLink(_ref) {
1508
1722
  handleEdit = _ref$handleEdit === void 0 ? noop : _ref$handleEdit,
1509
1723
  _ref$handleRegenerate = _ref.handleRegenerate,
1510
1724
  handleRegenerate = _ref$handleRegenerate === void 0 ? noop : _ref$handleRegenerate,
1511
- socialMediaPostTitle = _ref.socialMediaPostTitle,
1512
- moreOptions = _ref.moreOptions,
1513
- _ref$isOtherShareOpti = _ref.isOtherShareOptionsEnabled,
1514
- isOtherShareOptionsEnabled = _ref$isOtherShareOpti === void 0 ? true : _ref$isOtherShareOpti,
1515
1725
  _ref$disableShareSoci = _ref.disableShareSocialMedia,
1516
1726
  disableShareSocialMedia = _ref$disableShareSoci === void 0 ? false : _ref$disableShareSoci,
1517
1727
  _ref$disableQRDownloa = _ref.disableQRDownload,
1518
1728
  disableQRDownload = _ref$disableQRDownloa === void 0 ? false : _ref$disableQRDownloa,
1729
+ socialMediaProps = _ref.socialMediaProps,
1730
+ qrCodeProps = _ref.qrCodeProps,
1731
+ moreOptions = _ref.moreOptions,
1519
1732
  _ref$publicLinkExpiry = _ref.publicLinkExpiryConfiguration,
1520
1733
  publicLinkExpiryConfiguration = _ref$publicLinkExpiry === void 0 ? {} : _ref$publicLinkExpiry;
1521
- return /*#__PURE__*/jsxs("div", {
1522
- 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",
1523
- "data-testid": "share-via-link",
1524
- children: [/*#__PURE__*/jsxs("div", {
1525
- className: "space-y-1",
1526
- children: [/*#__PURE__*/jsx("div", {
1527
- className: "space-y-4",
1528
- children: urls.map(function (urlOption) {
1529
- return /*#__PURE__*/createElement(Link, {
1530
- enabledOptions: enabledOptions,
1531
- entityName: entityName,
1532
- handleEdit: handleEdit,
1533
- handleRegenerate: handleRegenerate,
1534
- isLoading: isLoading,
1535
- editUrlProps: omit(["url"], urlOption),
1536
- key: urlOption.url,
1537
- previewUrl: urlOption.previewUrl,
1538
- url: urlOption.url
1539
- });
1540
- })
1541
- }), isPresent(publicLinkExpiryConfiguration) && /*#__PURE__*/jsx(ExpiryNotice, {
1542
- expiryConfiguration: publicLinkExpiryConfiguration
1543
- })]
1544
- }), isOtherShareOptionsEnabled && /*#__PURE__*/jsx(ShareBlock, {
1545
- disableQRDownload: disableQRDownload,
1546
- disableShareSocialMedia: disableShareSocialMedia,
1547
- entity: entity,
1548
- moreOptions: moreOptions,
1549
- postTitle: socialMediaPostTitle,
1550
- url: urls[0].url
1734
+ var _useRouteMatch = useRouteMatch(),
1735
+ sharePath = _useRouteMatch.path,
1736
+ shareUrl = _useRouteMatch.url;
1737
+ return /*#__PURE__*/jsxs(Switch, {
1738
+ children: [/*#__PURE__*/jsx(Route, {
1739
+ exact: true,
1740
+ path: sharePath,
1741
+ render: function render() {
1742
+ return /*#__PURE__*/jsx(MainPanel, {
1743
+ description: description,
1744
+ disableQRDownload: disableQRDownload,
1745
+ disableShareSocialMedia: disableShareSocialMedia,
1746
+ enabledOptions: enabledOptions,
1747
+ entity: entity,
1748
+ entityName: entityName,
1749
+ handleEdit: handleEdit,
1750
+ handleRegenerate: handleRegenerate,
1751
+ isLoading: isLoading,
1752
+ moreOptions: moreOptions,
1753
+ publicLinkExpiryConfiguration: publicLinkExpiryConfiguration,
1754
+ qrCodeProps: qrCodeProps,
1755
+ socialMediaProps: socialMediaProps,
1756
+ title: title,
1757
+ urls: urls
1758
+ });
1759
+ }
1760
+ }), /*#__PURE__*/jsx(Route, {
1761
+ exact: true,
1762
+ path: "".concat(sharePath, "/qrcode"),
1763
+ render: function render() {
1764
+ return /*#__PURE__*/jsx(QRCode, {
1765
+ entity: entity,
1766
+ qrCodeProps: qrCodeProps,
1767
+ shareUrl: shareUrl,
1768
+ url: urls[0].url
1769
+ });
1770
+ }
1771
+ }), /*#__PURE__*/jsx(Route, {
1772
+ exact: true,
1773
+ path: "".concat(sharePath, "/social-media"),
1774
+ render: function render() {
1775
+ return /*#__PURE__*/jsx(SocialMedia, {
1776
+ shareUrl: shareUrl,
1777
+ socialMediaProps: socialMediaProps,
1778
+ url: urls[0].url
1779
+ });
1780
+ }
1781
+ }), isPresent(moreOptions) && moreOptions.map(function (_ref2) {
1782
+ var link = _ref2.link,
1783
+ element = _ref2.element;
1784
+ if (!isPresent(link)) return null;
1785
+ return /*#__PURE__*/jsx(Route, {
1786
+ exact: true,
1787
+ path: link,
1788
+ children: element
1789
+ }, link);
1551
1790
  })]
1552
1791
  });
1553
1792
  };