@bigbinary/neeto-molecules 3.16.1 → 3.16.2-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,189 @@ 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
+ customTopContent = _ref.customTopContent,
652
+ customBottomContent = _ref.customBottomContent;
653
+ var _useTranslation = useTranslation(),
654
+ t = _useTranslation.t;
655
+ var shouldShowShareBlock = !disableQRDownload || !disableShareSocialMedia || isPresent(moreOptions);
656
+ return /*#__PURE__*/jsx(Container, {
657
+ className: "neeto-ui-bg-gray-100 neeto-molecule-share-landing-page",
658
+ children: /*#__PURE__*/jsxs("div", {
659
+ className: "mx-auto w-full max-w-5xl py-10",
660
+ children: [customTopContent, /*#__PURE__*/jsx(Typography, {
661
+ "data-cy": "share-your-meeting-heading",
662
+ lineHeight: "tight",
663
+ style: "h2",
664
+ className: classnames({
665
+ "mb-2": isPresent(description),
666
+ "mb-6": !isPresent(description)
667
+ }),
668
+ children: title || t("neetoMolecules.shareViaLink.title", {
669
+ productName: globalProps.appName
670
+ })
671
+ }), description && /*#__PURE__*/jsx(Typography, {
672
+ className: "mb-6",
673
+ "data-cy": "share-your-meeting-heading",
674
+ lineHeight: "normal",
675
+ style: "body1",
676
+ children: description
677
+ }), /*#__PURE__*/jsxs("div", {
678
+ className: "neeto-ui-rounded-lg neeto-ui-bg-white p-6 sm:p-8",
679
+ "data-testid": "share-via-link",
680
+ children: [/*#__PURE__*/jsxs("div", {
681
+ className: "space-y-1",
682
+ children: [/*#__PURE__*/jsx("div", {
683
+ className: "space-y-4",
684
+ children: urls.map(function (urlOption) {
685
+ return /*#__PURE__*/createElement(Link, {
686
+ enabledOptions: enabledOptions,
687
+ entityName: entityName,
688
+ handleEdit: handleEdit,
689
+ handleRegenerate: handleRegenerate,
690
+ isLoading: isLoading,
691
+ editUrlProps: omit(["url"], urlOption),
692
+ key: urlOption.url,
693
+ previewUrl: urlOption.previewUrl,
694
+ url: urlOption.url
695
+ });
696
+ })
697
+ }), isPresent(publicLinkExpiryConfiguration) && /*#__PURE__*/jsx(ExpiryNotice, {
698
+ expiryConfiguration: publicLinkExpiryConfiguration
699
+ })]
700
+ }), shouldShowShareBlock && /*#__PURE__*/jsx(ShareBlock, {
701
+ disableQRDownload: disableQRDownload,
702
+ disableShareSocialMedia: disableShareSocialMedia,
703
+ entity: entity,
704
+ moreOptions: moreOptions,
705
+ qrCodeProps: qrCodeProps,
706
+ socialMediaProps: socialMediaProps,
707
+ url: urls[0].url
708
+ })]
709
+ }), customBottomContent]
710
+ })
711
+ });
712
+ };
713
+
470
714
  var __defProp = Object.defineProperty;
471
715
  var __getOwnPropSymbols = Object.getOwnPropertySymbols;
472
716
  var __hasOwnProp = Object.prototype.hasOwnProperty;
@@ -1328,172 +1572,144 @@ var QRCode$1 = (props) => {
1328
1572
 
1329
1573
  var QRCode = function QRCode(_ref) {
1330
1574
  var entity = _ref.entity,
1331
- url = _ref.url;
1575
+ qrCodeProps = _ref.qrCodeProps,
1576
+ url = _ref.url,
1577
+ shareUrl = _ref.shareUrl;
1578
+ var _useTranslation = useTranslation(),
1579
+ t = _useTranslation.t;
1332
1580
  if (!entity) return null;
1333
1581
  var id = entity.id,
1334
1582
  name = entity.name;
1335
1583
  var canvasId = "qrcode-share-".concat(id);
1336
- var handleDownload = function handleDownload() {
1584
+ var handleDownloadQRCode = function handleDownloadQRCode() {
1337
1585
  var canvas = document.getElementById(canvasId);
1338
1586
  if (canvas) downloadCanvas(canvas, {
1339
1587
  name: slugify(name)
1340
1588
  });
1341
1589
  };
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
- }
1590
+ var handleCopyQRCode = function handleCopyQRCode() {
1591
+ var canvas = document.getElementById(canvasId);
1592
+ if (canvas) copyCanvasToClipboard(canvas, handleDownloadQRCode);
1593
+ };
1594
+ 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");
1595
+ 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");
1596
+ return /*#__PURE__*/jsxs(Container, {
1597
+ className: "neeto-molecules-embed-qr-code-landing-page py-8",
1598
+ children: [/*#__PURE__*/jsx(Button, {
1599
+ className: "mb-4",
1600
+ "data-cy": "back-button",
1601
+ "data-testid": "back-button",
1602
+ icon: LeftArrow,
1603
+ iconPosition: "left",
1604
+ label: t("neetoMolecules.productEmbed.backToShare"),
1605
+ size: "small",
1606
+ style: "link",
1607
+ to: shareUrl
1608
+ }), /*#__PURE__*/jsx(Header$1, {
1609
+ className: "py-0",
1610
+ title: t("neetoMolecules.shareViaLink.qrCode.title")
1611
+ }), /*#__PURE__*/jsx(CardLayout, {
1612
+ description: description,
1613
+ title: title,
1614
+ actionBlock: /*#__PURE__*/jsxs("div", {
1615
+ className: "flex flex-wrap items-center gap-3",
1616
+ children: [/*#__PURE__*/jsx(Button, {
1617
+ "data-cy": "qr-code-download-button",
1618
+ "data-testid": "qr-code-download-button",
1619
+ label: t("neetoMolecules.shareViaLink.qrCode.download"),
1620
+ style: "primary",
1621
+ onClick: handleDownloadQRCode
1622
+ }), /*#__PURE__*/jsx(CopyToClipboardButton, {
1623
+ "data-cy": "qr-code-copy-button",
1624
+ "data-testid": "qr-code-copy-button",
1625
+ label: t("neetoMolecules.shareViaLink.qrCode.copy"),
1626
+ style: "secondary",
1627
+ onClick: handleCopyQRCode
1628
+ })]
1629
+ }),
1630
+ children: /*#__PURE__*/jsx(QRCode$1, {
1631
+ className: "mt-6 cursor-pointer",
1632
+ "data-cy": "qr-code-image",
1633
+ "data-testid": "qr-code-image",
1634
+ id: canvasId,
1635
+ size: 160,
1636
+ style: {
1637
+ width: 160,
1638
+ height: 160
1639
+ },
1640
+ value: url,
1641
+ onClick: handleDownloadQRCode
1360
1642
  })
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
1643
  })]
1374
1644
  });
1375
1645
  };
1376
1646
 
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
- };
1647
+ 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}";
1648
+ n(css,{});
1400
1649
 
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,
1650
+ var SocialMedia = function SocialMedia(_ref) {
1651
+ var socialMediaProps = _ref.socialMediaProps,
1406
1652
  url = _ref.url,
1407
- moreOptions = _ref.moreOptions,
1408
- disableShareSocialMedia = _ref.disableShareSocialMedia,
1409
- disableQRDownload = _ref.disableQRDownload;
1653
+ shareUrl = _ref.shareUrl;
1410
1654
  var _useTranslation = useTranslation(),
1411
1655
  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,
1656
+ 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");
1657
+ 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");
1658
+ return /*#__PURE__*/jsxs(Container, {
1659
+ className: "neeto-molecules-social-share-landing-page py-8",
1660
+ children: [/*#__PURE__*/jsx(Button, {
1661
+ className: "mb-4",
1662
+ "data-cy": "back-button",
1663
+ "data-testid": "back-button",
1664
+ icon: LeftArrow,
1665
+ iconPosition: "left",
1666
+ label: t("neetoMolecules.productEmbed.backToShare"),
1667
+ size: "small",
1668
+ style: "link",
1669
+ to: shareUrl
1670
+ }), /*#__PURE__*/jsx(Header$1, {
1671
+ className: "py-0",
1672
+ title: t("neetoMolecules.shareViaLink.socialMediaShare.title")
1673
+ }), /*#__PURE__*/jsx(CardLayout, {
1674
+ description: description,
1675
+ title: title,
1676
+ actionBlock: /*#__PURE__*/jsx("div", {
1677
+ className: "flex flex-wrap items-center gap-3",
1678
+ children: Object.entries(SOCIAL_MEDIA_OPTIONS).map(function (_ref2) {
1679
+ var _ref3 = _slicedToArray(_ref2, 2),
1680
+ key = _ref3[0],
1681
+ _ref3$ = _ref3[1],
1682
+ label = _ref3$.label,
1683
+ Icon = _ref3$.icon,
1684
+ generateShareUrl = _ref3$.generateShareUrl;
1685
+ return /*#__PURE__*/createElement(Button, {
1686
+ label: label,
1473
1687
  "data-cy": "social-media-button-".concat(key),
1474
1688
  "data-testid": "social-media-button-".concat(key),
1475
- href: generateShareUrl({
1476
- url: url,
1477
- title: postTitle
1478
- }),
1689
+ icon: Icon,
1690
+ iconPosition: "right",
1691
+ key: key,
1479
1692
  rel: "noopener noreferrer",
1693
+ style: "tertiary",
1480
1694
  target: "_blank",
1481
- title: label,
1482
- children: /*#__PURE__*/jsx(Icon, {
1483
- size: 24
1695
+ href: generateShareUrl({
1696
+ url: url,
1697
+ title: socialMediaProps === null || socialMediaProps === void 0 ? void 0 : socialMediaProps.postTitle
1484
1698
  })
1485
- }, key);
1699
+ }, /*#__PURE__*/jsx(Icon, {
1700
+ size: 24
1701
+ }));
1486
1702
  })
1487
- })]
1488
- }), !disableQRDownload && /*#__PURE__*/jsx(QRCode, {
1489
- entity: entity,
1490
- url: url
1703
+ })
1491
1704
  })]
1492
1705
  });
1493
1706
  };
1494
1707
 
1708
+ /* eslint-disable @bigbinary/neeto/use-common-routes */
1495
1709
  var ShareViaLink = function ShareViaLink(_ref) {
1496
- var _ref$isLoading = _ref.isLoading,
1710
+ var title = _ref.title,
1711
+ description = _ref.description,
1712
+ _ref$isLoading = _ref.isLoading,
1497
1713
  isLoading = _ref$isLoading === void 0 ? false : _ref$isLoading,
1498
1714
  _ref$enabledOptions = _ref.enabledOptions,
1499
1715
  enabledOptions = _ref$enabledOptions === void 0 ? {
@@ -1508,46 +1724,75 @@ var ShareViaLink = function ShareViaLink(_ref) {
1508
1724
  handleEdit = _ref$handleEdit === void 0 ? noop : _ref$handleEdit,
1509
1725
  _ref$handleRegenerate = _ref.handleRegenerate,
1510
1726
  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
1727
  _ref$disableShareSoci = _ref.disableShareSocialMedia,
1516
1728
  disableShareSocialMedia = _ref$disableShareSoci === void 0 ? false : _ref$disableShareSoci,
1517
1729
  _ref$disableQRDownloa = _ref.disableQRDownload,
1518
1730
  disableQRDownload = _ref$disableQRDownloa === void 0 ? false : _ref$disableQRDownloa,
1731
+ socialMediaProps = _ref.socialMediaProps,
1732
+ qrCodeProps = _ref.qrCodeProps,
1733
+ moreOptions = _ref.moreOptions,
1519
1734
  _ref$publicLinkExpiry = _ref.publicLinkExpiryConfiguration,
1520
- 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
1735
+ publicLinkExpiryConfiguration = _ref$publicLinkExpiry === void 0 ? {} : _ref$publicLinkExpiry,
1736
+ customTopContent = _ref.customTopContent,
1737
+ customBottomContent = _ref.customBottomContent;
1738
+ var _useRouteMatch = useRouteMatch(),
1739
+ sharePath = _useRouteMatch.path,
1740
+ shareUrl = _useRouteMatch.url;
1741
+ return /*#__PURE__*/jsxs(Switch, {
1742
+ children: [/*#__PURE__*/jsx(Route, {
1743
+ exact: true,
1744
+ path: sharePath,
1745
+ render: function render() {
1746
+ return /*#__PURE__*/jsx(MainPanel, {
1747
+ customBottomContent: customBottomContent,
1748
+ customTopContent: customTopContent,
1749
+ description: description,
1750
+ disableQRDownload: disableQRDownload,
1751
+ disableShareSocialMedia: disableShareSocialMedia,
1752
+ enabledOptions: enabledOptions,
1753
+ entity: entity,
1754
+ entityName: entityName,
1755
+ handleEdit: handleEdit,
1756
+ handleRegenerate: handleRegenerate,
1757
+ isLoading: isLoading,
1758
+ moreOptions: moreOptions,
1759
+ publicLinkExpiryConfiguration: publicLinkExpiryConfiguration,
1760
+ qrCodeProps: qrCodeProps,
1761
+ socialMediaProps: socialMediaProps,
1762
+ title: title,
1763
+ urls: urls
1764
+ });
1765
+ }
1766
+ }), /*#__PURE__*/jsx(Route, {
1767
+ exact: true,
1768
+ path: "".concat(sharePath, "/qrcode"),
1769
+ render: function render() {
1770
+ return /*#__PURE__*/jsx(QRCode, {
1771
+ entity: entity,
1772
+ qrCodeProps: qrCodeProps,
1773
+ shareUrl: shareUrl,
1774
+ url: urls[0].url
1775
+ });
1776
+ }
1777
+ }), /*#__PURE__*/jsx(Route, {
1778
+ exact: true,
1779
+ path: "".concat(sharePath, "/social-media"),
1780
+ render: function render() {
1781
+ return /*#__PURE__*/jsx(SocialMedia, {
1782
+ shareUrl: shareUrl,
1783
+ socialMediaProps: socialMediaProps,
1784
+ url: urls[0].url
1785
+ });
1786
+ }
1787
+ }), isPresent(moreOptions) && moreOptions.map(function (_ref2) {
1788
+ var link = _ref2.link,
1789
+ element = _ref2.element;
1790
+ if (!isPresent(link)) return null;
1791
+ return /*#__PURE__*/jsx(Route, {
1792
+ exact: true,
1793
+ path: link,
1794
+ children: element
1795
+ }, link);
1551
1796
  })]
1552
1797
  });
1553
1798
  };