@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.
- package/dist/CardLayout.js +3 -3
- package/dist/CardLayout.js.map +1 -1
- package/dist/Container.js +1 -1
- package/dist/CopyToClipboardButton.js +3 -2
- package/dist/CopyToClipboardButton.js.map +1 -1
- package/dist/EmailPreview.js +1 -1
- package/dist/EmailPreview.js.map +1 -1
- package/dist/ProductEmbed.js +985 -302
- package/dist/ProductEmbed.js.map +1 -1
- package/dist/ShareViaLink.js +421 -182
- package/dist/ShareViaLink.js.map +1 -1
- package/dist/cjs/CardLayout.js +3 -3
- package/dist/cjs/CardLayout.js.map +1 -1
- package/dist/cjs/Container.js +1 -1
- package/dist/cjs/CopyToClipboardButton.js +3 -2
- package/dist/cjs/CopyToClipboardButton.js.map +1 -1
- package/dist/cjs/EmailPreview.js +1 -1
- package/dist/cjs/EmailPreview.js.map +1 -1
- package/dist/cjs/ProductEmbed.js +984 -301
- package/dist/cjs/ProductEmbed.js.map +1 -1
- package/dist/cjs/ShareViaLink.js +419 -180
- package/dist/cjs/ShareViaLink.js.map +1 -1
- package/package.json +1 -1
- package/src/translations/en.json +48 -40
- package/types/ProductEmbed.d.ts +1 -0
- package/types/ShareViaLink.d.ts +25 -28
package/dist/cjs/ShareViaLink.js
CHANGED
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
var neetoCist = require('@bigbinary/neeto-cist');
|
|
4
|
-
var
|
|
4
|
+
var reactRouterDom = require('react-router-dom');
|
|
5
5
|
var classnames = require('classnames');
|
|
6
6
|
var Typography = require('@bigbinary/neetoui/Typography');
|
|
7
|
+
var ramda = require('ramda');
|
|
7
8
|
var reactI18next = require('react-i18next');
|
|
9
|
+
var Container = require('./Container.js');
|
|
8
10
|
var jsxRuntime = require('react/jsx-runtime');
|
|
9
11
|
var _slicedToArray = require('@babel/runtime/helpers/slicedToArray');
|
|
10
12
|
var React = require('react');
|
|
@@ -21,6 +23,9 @@ var Facebook = require('@bigbinary/neeto-icons/Facebook');
|
|
|
21
23
|
var Linkedin = require('@bigbinary/neeto-icons/Linkedin');
|
|
22
24
|
var Twitter = require('@bigbinary/neeto-icons/Twitter');
|
|
23
25
|
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');
|
|
24
29
|
var general = require('@bigbinary/neeto-commons-frontend/utils/general');
|
|
25
30
|
var injectCss = require('./inject-css-vQvjPR2x.js');
|
|
26
31
|
var utils = require('@bigbinary/neeto-commons-frontend/utils');
|
|
@@ -29,15 +34,28 @@ var Modal = require('@bigbinary/neetoui/Modal');
|
|
|
29
34
|
var Input$1 = require('@bigbinary/neetoui/Input');
|
|
30
35
|
var Select = require('@bigbinary/neetoui/Select');
|
|
31
36
|
var DatePicker = require('@bigbinary/neetoui/DatePicker');
|
|
32
|
-
var
|
|
33
|
-
var
|
|
34
|
-
require('@babel/runtime/helpers/objectWithoutProperties');
|
|
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');
|
|
35
45
|
require('@bigbinary/neeto-icons/Copy');
|
|
36
46
|
require('@bigbinary/neeto-icons/Check');
|
|
37
47
|
require('@bigbinary/neeto-icons/MenuHorizontal');
|
|
38
48
|
require('@bigbinary/neeto-icons/MenuVertical');
|
|
39
49
|
require('@bigbinary/neetoui/Dropdown');
|
|
40
50
|
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');
|
|
41
59
|
|
|
42
60
|
function _interopNamespaceDefault(e) {
|
|
43
61
|
var n = Object.create(null);
|
|
@@ -119,6 +137,49 @@ var downloadCanvas = function downloadCanvas(canvas) {
|
|
|
119
137
|
element.click();
|
|
120
138
|
element.remove();
|
|
121
139
|
};
|
|
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
|
+
}();
|
|
122
183
|
var getPathname = function getPathname(url) {
|
|
123
184
|
return new URL(url).pathname.slice(1);
|
|
124
185
|
};
|
|
@@ -158,8 +219,8 @@ var PATH_VALIDATION_SCHEMA = yup__namespace.object().shape({
|
|
|
158
219
|
path: yup__namespace.string().required(i18next.t("neetoMolecules.shareViaLink.editUrl.validationError")).matches(/^[A-Za-z0-9]([\w/-])*$/, i18next.t("neetoMolecules.shareViaLink.editUrl.validationError"))
|
|
159
220
|
});
|
|
160
221
|
|
|
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,{});
|
|
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,{});
|
|
163
224
|
|
|
164
225
|
var Header = Pane.Header,
|
|
165
226
|
Body = Pane.Body,
|
|
@@ -416,13 +477,13 @@ var Link = function Link(_ref) {
|
|
|
416
477
|
"data-cy": "link-block",
|
|
417
478
|
"data-testid": "link-block",
|
|
418
479
|
children: /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
419
|
-
className: "flex flex-col gap-2 sm:flex-row sm:items-center
|
|
480
|
+
className: "flex flex-col gap-2 sm:flex-row sm:items-center",
|
|
420
481
|
children: [/*#__PURE__*/jsxRuntime.jsx("div", {
|
|
421
|
-
className: "neeto-ui-rounded-md neeto-ui-border-gray-
|
|
482
|
+
className: "neeto-ui-rounded-md neeto-ui-border-gray-300 relative min-w-0 flex-grow truncate border p-2 leading-none",
|
|
422
483
|
"data-cy": "nui-input-field",
|
|
423
484
|
children: url
|
|
424
485
|
}), /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
425
|
-
className: "flex w-full flex-shrink-0 items-center gap-
|
|
486
|
+
className: "flex w-full flex-shrink-0 items-center gap-2 sm:w-auto",
|
|
426
487
|
children: [/*#__PURE__*/jsxRuntime.jsx(CopyToClipboardButton, {
|
|
427
488
|
"data-cy": "link-copy-button",
|
|
428
489
|
"data-testid": "link-copy-button",
|
|
@@ -488,6 +549,187 @@ var Link = function Link(_ref) {
|
|
|
488
549
|
});
|
|
489
550
|
};
|
|
490
551
|
|
|
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
|
+
|
|
491
733
|
var __defProp = Object.defineProperty;
|
|
492
734
|
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
493
735
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
@@ -1349,172 +1591,144 @@ var QRCode$1 = (props) => {
|
|
|
1349
1591
|
|
|
1350
1592
|
var QRCode = function QRCode(_ref) {
|
|
1351
1593
|
var entity = _ref.entity,
|
|
1352
|
-
|
|
1594
|
+
qrCodeProps = _ref.qrCodeProps,
|
|
1595
|
+
url = _ref.url,
|
|
1596
|
+
shareUrl = _ref.shareUrl;
|
|
1597
|
+
var _useTranslation = reactI18next.useTranslation(),
|
|
1598
|
+
t = _useTranslation.t;
|
|
1353
1599
|
if (!entity) return null;
|
|
1354
1600
|
var id = entity.id,
|
|
1355
1601
|
name = entity.name;
|
|
1356
1602
|
var canvasId = "qrcode-share-".concat(id);
|
|
1357
|
-
var
|
|
1603
|
+
var handleDownloadQRCode = function handleDownloadQRCode() {
|
|
1358
1604
|
var canvas = document.getElementById(canvasId);
|
|
1359
1605
|
if (canvas) downloadCanvas(canvas, {
|
|
1360
1606
|
name: neetoCist.slugify(name)
|
|
1361
1607
|
});
|
|
1362
1608
|
};
|
|
1363
|
-
|
|
1364
|
-
|
|
1365
|
-
|
|
1366
|
-
|
|
1367
|
-
|
|
1368
|
-
|
|
1369
|
-
|
|
1370
|
-
|
|
1371
|
-
|
|
1372
|
-
|
|
1373
|
-
|
|
1374
|
-
|
|
1375
|
-
|
|
1376
|
-
|
|
1377
|
-
|
|
1378
|
-
|
|
1379
|
-
|
|
1380
|
-
|
|
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
|
|
1381
1661
|
})
|
|
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
|
|
1394
1662
|
})]
|
|
1395
1663
|
});
|
|
1396
1664
|
};
|
|
1397
1665
|
|
|
1398
|
-
var
|
|
1399
|
-
|
|
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
|
-
};
|
|
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,{});
|
|
1421
1668
|
|
|
1422
|
-
|
|
1423
|
-
|
|
1424
|
-
var ShareBlock = function ShareBlock(_ref) {
|
|
1425
|
-
var entity = _ref.entity,
|
|
1426
|
-
postTitle = _ref.postTitle,
|
|
1669
|
+
var SocialMedia = function SocialMedia(_ref) {
|
|
1670
|
+
var socialMediaProps = _ref.socialMediaProps,
|
|
1427
1671
|
url = _ref.url,
|
|
1428
|
-
|
|
1429
|
-
disableShareSocialMedia = _ref.disableShareSocialMedia,
|
|
1430
|
-
disableQRDownload = _ref.disableQRDownload;
|
|
1672
|
+
shareUrl = _ref.shareUrl;
|
|
1431
1673
|
var _useTranslation = reactI18next.useTranslation(),
|
|
1432
1674
|
t = _useTranslation.t;
|
|
1433
|
-
var
|
|
1434
|
-
var
|
|
1435
|
-
return /*#__PURE__*/jsxRuntime.jsxs(
|
|
1436
|
-
className: "
|
|
1437
|
-
children: [
|
|
1438
|
-
className: "
|
|
1439
|
-
|
|
1440
|
-
|
|
1441
|
-
|
|
1442
|
-
|
|
1443
|
-
|
|
1444
|
-
|
|
1445
|
-
|
|
1446
|
-
|
|
1447
|
-
|
|
1448
|
-
|
|
1449
|
-
|
|
1450
|
-
|
|
1451
|
-
|
|
1452
|
-
|
|
1453
|
-
|
|
1454
|
-
|
|
1455
|
-
|
|
1456
|
-
|
|
1457
|
-
|
|
1458
|
-
|
|
1459
|
-
|
|
1460
|
-
|
|
1461
|
-
|
|
1462
|
-
|
|
1463
|
-
|
|
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,
|
|
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,
|
|
1494
1706
|
"data-cy": "social-media-button-".concat(key),
|
|
1495
1707
|
"data-testid": "social-media-button-".concat(key),
|
|
1496
|
-
|
|
1497
|
-
|
|
1498
|
-
|
|
1499
|
-
}),
|
|
1708
|
+
icon: Icon,
|
|
1709
|
+
iconPosition: "right",
|
|
1710
|
+
key: key,
|
|
1500
1711
|
rel: "noopener noreferrer",
|
|
1712
|
+
style: "tertiary",
|
|
1501
1713
|
target: "_blank",
|
|
1502
|
-
|
|
1503
|
-
|
|
1504
|
-
|
|
1714
|
+
href: generateShareUrl({
|
|
1715
|
+
url: url,
|
|
1716
|
+
title: socialMediaProps === null || socialMediaProps === void 0 ? void 0 : socialMediaProps.postTitle
|
|
1505
1717
|
})
|
|
1506
|
-
},
|
|
1718
|
+
}, /*#__PURE__*/jsxRuntime.jsx(Icon, {
|
|
1719
|
+
size: 24
|
|
1720
|
+
}));
|
|
1507
1721
|
})
|
|
1508
|
-
})
|
|
1509
|
-
}), !disableQRDownload && /*#__PURE__*/jsxRuntime.jsx(QRCode, {
|
|
1510
|
-
entity: entity,
|
|
1511
|
-
url: url
|
|
1722
|
+
})
|
|
1512
1723
|
})]
|
|
1513
1724
|
});
|
|
1514
1725
|
};
|
|
1515
1726
|
|
|
1727
|
+
/* eslint-disable @bigbinary/neeto/use-common-routes */
|
|
1516
1728
|
var ShareViaLink = function ShareViaLink(_ref) {
|
|
1517
|
-
var
|
|
1729
|
+
var title = _ref.title,
|
|
1730
|
+
description = _ref.description,
|
|
1731
|
+
_ref$isLoading = _ref.isLoading,
|
|
1518
1732
|
isLoading = _ref$isLoading === void 0 ? false : _ref$isLoading,
|
|
1519
1733
|
_ref$enabledOptions = _ref.enabledOptions,
|
|
1520
1734
|
enabledOptions = _ref$enabledOptions === void 0 ? {
|
|
@@ -1529,46 +1743,71 @@ var ShareViaLink = function ShareViaLink(_ref) {
|
|
|
1529
1743
|
handleEdit = _ref$handleEdit === void 0 ? neetoCist.noop : _ref$handleEdit,
|
|
1530
1744
|
_ref$handleRegenerate = _ref.handleRegenerate,
|
|
1531
1745
|
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,
|
|
1536
1746
|
_ref$disableShareSoci = _ref.disableShareSocialMedia,
|
|
1537
1747
|
disableShareSocialMedia = _ref$disableShareSoci === void 0 ? false : _ref$disableShareSoci,
|
|
1538
1748
|
_ref$disableQRDownloa = _ref.disableQRDownload,
|
|
1539
1749
|
disableQRDownload = _ref$disableQRDownloa === void 0 ? false : _ref$disableQRDownloa,
|
|
1750
|
+
socialMediaProps = _ref.socialMediaProps,
|
|
1751
|
+
qrCodeProps = _ref.qrCodeProps,
|
|
1752
|
+
moreOptions = _ref.moreOptions,
|
|
1540
1753
|
_ref$publicLinkExpiry = _ref.publicLinkExpiryConfiguration,
|
|
1541
1754
|
publicLinkExpiryConfiguration = _ref$publicLinkExpiry === void 0 ? {} : _ref$publicLinkExpiry;
|
|
1542
|
-
|
|
1543
|
-
|
|
1544
|
-
|
|
1545
|
-
|
|
1546
|
-
|
|
1547
|
-
|
|
1548
|
-
|
|
1549
|
-
|
|
1550
|
-
|
|
1551
|
-
|
|
1552
|
-
|
|
1553
|
-
|
|
1554
|
-
|
|
1555
|
-
|
|
1556
|
-
|
|
1557
|
-
|
|
1558
|
-
|
|
1559
|
-
|
|
1560
|
-
|
|
1561
|
-
|
|
1562
|
-
|
|
1563
|
-
|
|
1564
|
-
|
|
1565
|
-
|
|
1566
|
-
|
|
1567
|
-
|
|
1568
|
-
|
|
1569
|
-
|
|
1570
|
-
|
|
1571
|
-
|
|
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);
|
|
1572
1811
|
})]
|
|
1573
1812
|
});
|
|
1574
1813
|
};
|