@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.
- 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/OptionFields.js +1 -1
- package/dist/OptionFields.js.map +1 -1
- package/dist/ProductEmbed.js +985 -302
- package/dist/ProductEmbed.js.map +1 -1
- package/dist/ShareViaLink.js +428 -183
- 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/OptionFields.js +1 -1
- package/dist/cjs/OptionFields.js.map +1 -1
- package/dist/cjs/ProductEmbed.js +984 -301
- package/dist/cjs/ProductEmbed.js.map +1 -1
- package/dist/cjs/ShareViaLink.js +426 -181
- 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 +27 -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,189 @@ 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
|
+
customTopContent = _ref.customTopContent,
|
|
673
|
+
customBottomContent = _ref.customBottomContent;
|
|
674
|
+
var _useTranslation = reactI18next.useTranslation(),
|
|
675
|
+
t = _useTranslation.t;
|
|
676
|
+
var shouldShowShareBlock = !disableQRDownload || !disableShareSocialMedia || neetoCist.isPresent(moreOptions);
|
|
677
|
+
return /*#__PURE__*/jsxRuntime.jsx(Container, {
|
|
678
|
+
className: "neeto-ui-bg-gray-100 neeto-molecule-share-landing-page",
|
|
679
|
+
children: /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
680
|
+
className: "mx-auto w-full max-w-5xl py-10",
|
|
681
|
+
children: [customTopContent, /*#__PURE__*/jsxRuntime.jsx(Typography, {
|
|
682
|
+
"data-cy": "share-your-meeting-heading",
|
|
683
|
+
lineHeight: "tight",
|
|
684
|
+
style: "h2",
|
|
685
|
+
className: classnames({
|
|
686
|
+
"mb-2": neetoCist.isPresent(description),
|
|
687
|
+
"mb-6": !neetoCist.isPresent(description)
|
|
688
|
+
}),
|
|
689
|
+
children: title || t("neetoMolecules.shareViaLink.title", {
|
|
690
|
+
productName: globalProps.appName
|
|
691
|
+
})
|
|
692
|
+
}), description && /*#__PURE__*/jsxRuntime.jsx(Typography, {
|
|
693
|
+
className: "mb-6",
|
|
694
|
+
"data-cy": "share-your-meeting-heading",
|
|
695
|
+
lineHeight: "normal",
|
|
696
|
+
style: "body1",
|
|
697
|
+
children: description
|
|
698
|
+
}), /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
699
|
+
className: "neeto-ui-rounded-lg neeto-ui-bg-white p-6 sm:p-8",
|
|
700
|
+
"data-testid": "share-via-link",
|
|
701
|
+
children: [/*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
702
|
+
className: "space-y-1",
|
|
703
|
+
children: [/*#__PURE__*/jsxRuntime.jsx("div", {
|
|
704
|
+
className: "space-y-4",
|
|
705
|
+
children: urls.map(function (urlOption) {
|
|
706
|
+
return /*#__PURE__*/React.createElement(Link, {
|
|
707
|
+
enabledOptions: enabledOptions,
|
|
708
|
+
entityName: entityName,
|
|
709
|
+
handleEdit: handleEdit,
|
|
710
|
+
handleRegenerate: handleRegenerate,
|
|
711
|
+
isLoading: isLoading,
|
|
712
|
+
editUrlProps: ramda.omit(["url"], urlOption),
|
|
713
|
+
key: urlOption.url,
|
|
714
|
+
previewUrl: urlOption.previewUrl,
|
|
715
|
+
url: urlOption.url
|
|
716
|
+
});
|
|
717
|
+
})
|
|
718
|
+
}), neetoCist.isPresent(publicLinkExpiryConfiguration) && /*#__PURE__*/jsxRuntime.jsx(ExpiryNotice, {
|
|
719
|
+
expiryConfiguration: publicLinkExpiryConfiguration
|
|
720
|
+
})]
|
|
721
|
+
}), shouldShowShareBlock && /*#__PURE__*/jsxRuntime.jsx(ShareBlock, {
|
|
722
|
+
disableQRDownload: disableQRDownload,
|
|
723
|
+
disableShareSocialMedia: disableShareSocialMedia,
|
|
724
|
+
entity: entity,
|
|
725
|
+
moreOptions: moreOptions,
|
|
726
|
+
qrCodeProps: qrCodeProps,
|
|
727
|
+
socialMediaProps: socialMediaProps,
|
|
728
|
+
url: urls[0].url
|
|
729
|
+
})]
|
|
730
|
+
}), customBottomContent]
|
|
731
|
+
})
|
|
732
|
+
});
|
|
733
|
+
};
|
|
734
|
+
|
|
491
735
|
var __defProp = Object.defineProperty;
|
|
492
736
|
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
493
737
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
@@ -1349,172 +1593,144 @@ var QRCode$1 = (props) => {
|
|
|
1349
1593
|
|
|
1350
1594
|
var QRCode = function QRCode(_ref) {
|
|
1351
1595
|
var entity = _ref.entity,
|
|
1352
|
-
|
|
1596
|
+
qrCodeProps = _ref.qrCodeProps,
|
|
1597
|
+
url = _ref.url,
|
|
1598
|
+
shareUrl = _ref.shareUrl;
|
|
1599
|
+
var _useTranslation = reactI18next.useTranslation(),
|
|
1600
|
+
t = _useTranslation.t;
|
|
1353
1601
|
if (!entity) return null;
|
|
1354
1602
|
var id = entity.id,
|
|
1355
1603
|
name = entity.name;
|
|
1356
1604
|
var canvasId = "qrcode-share-".concat(id);
|
|
1357
|
-
var
|
|
1605
|
+
var handleDownloadQRCode = function handleDownloadQRCode() {
|
|
1358
1606
|
var canvas = document.getElementById(canvasId);
|
|
1359
1607
|
if (canvas) downloadCanvas(canvas, {
|
|
1360
1608
|
name: neetoCist.slugify(name)
|
|
1361
1609
|
});
|
|
1362
1610
|
};
|
|
1363
|
-
|
|
1364
|
-
|
|
1365
|
-
|
|
1366
|
-
|
|
1367
|
-
|
|
1368
|
-
|
|
1369
|
-
|
|
1370
|
-
|
|
1371
|
-
|
|
1372
|
-
|
|
1373
|
-
|
|
1374
|
-
|
|
1375
|
-
|
|
1376
|
-
|
|
1377
|
-
|
|
1378
|
-
|
|
1379
|
-
|
|
1380
|
-
|
|
1611
|
+
var handleCopyQRCode = function handleCopyQRCode() {
|
|
1612
|
+
var canvas = document.getElementById(canvasId);
|
|
1613
|
+
if (canvas) copyCanvasToClipboard(canvas, handleDownloadQRCode);
|
|
1614
|
+
};
|
|
1615
|
+
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");
|
|
1616
|
+
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");
|
|
1617
|
+
return /*#__PURE__*/jsxRuntime.jsxs(Container, {
|
|
1618
|
+
className: "neeto-molecules-embed-qr-code-landing-page py-8",
|
|
1619
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(Button, {
|
|
1620
|
+
className: "mb-4",
|
|
1621
|
+
"data-cy": "back-button",
|
|
1622
|
+
"data-testid": "back-button",
|
|
1623
|
+
icon: LeftArrow,
|
|
1624
|
+
iconPosition: "left",
|
|
1625
|
+
label: t("neetoMolecules.productEmbed.backToShare"),
|
|
1626
|
+
size: "small",
|
|
1627
|
+
style: "link",
|
|
1628
|
+
to: shareUrl
|
|
1629
|
+
}), /*#__PURE__*/jsxRuntime.jsx(Header$1, {
|
|
1630
|
+
className: "py-0",
|
|
1631
|
+
title: t("neetoMolecules.shareViaLink.qrCode.title")
|
|
1632
|
+
}), /*#__PURE__*/jsxRuntime.jsx(CardLayout, {
|
|
1633
|
+
description: description,
|
|
1634
|
+
title: title,
|
|
1635
|
+
actionBlock: /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
1636
|
+
className: "flex flex-wrap items-center gap-3",
|
|
1637
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(Button, {
|
|
1638
|
+
"data-cy": "qr-code-download-button",
|
|
1639
|
+
"data-testid": "qr-code-download-button",
|
|
1640
|
+
label: t("neetoMolecules.shareViaLink.qrCode.download"),
|
|
1641
|
+
style: "primary",
|
|
1642
|
+
onClick: handleDownloadQRCode
|
|
1643
|
+
}), /*#__PURE__*/jsxRuntime.jsx(CopyToClipboardButton, {
|
|
1644
|
+
"data-cy": "qr-code-copy-button",
|
|
1645
|
+
"data-testid": "qr-code-copy-button",
|
|
1646
|
+
label: t("neetoMolecules.shareViaLink.qrCode.copy"),
|
|
1647
|
+
style: "secondary",
|
|
1648
|
+
onClick: handleCopyQRCode
|
|
1649
|
+
})]
|
|
1650
|
+
}),
|
|
1651
|
+
children: /*#__PURE__*/jsxRuntime.jsx(QRCode$1, {
|
|
1652
|
+
className: "mt-6 cursor-pointer",
|
|
1653
|
+
"data-cy": "qr-code-image",
|
|
1654
|
+
"data-testid": "qr-code-image",
|
|
1655
|
+
id: canvasId,
|
|
1656
|
+
size: 160,
|
|
1657
|
+
style: {
|
|
1658
|
+
width: 160,
|
|
1659
|
+
height: 160
|
|
1660
|
+
},
|
|
1661
|
+
value: url,
|
|
1662
|
+
onClick: handleDownloadQRCode
|
|
1381
1663
|
})
|
|
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
1664
|
})]
|
|
1395
1665
|
});
|
|
1396
1666
|
};
|
|
1397
1667
|
|
|
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
|
-
};
|
|
1668
|
+
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}";
|
|
1669
|
+
injectCss.n(css,{});
|
|
1421
1670
|
|
|
1422
|
-
|
|
1423
|
-
|
|
1424
|
-
var ShareBlock = function ShareBlock(_ref) {
|
|
1425
|
-
var entity = _ref.entity,
|
|
1426
|
-
postTitle = _ref.postTitle,
|
|
1671
|
+
var SocialMedia = function SocialMedia(_ref) {
|
|
1672
|
+
var socialMediaProps = _ref.socialMediaProps,
|
|
1427
1673
|
url = _ref.url,
|
|
1428
|
-
|
|
1429
|
-
disableShareSocialMedia = _ref.disableShareSocialMedia,
|
|
1430
|
-
disableQRDownload = _ref.disableQRDownload;
|
|
1674
|
+
shareUrl = _ref.shareUrl;
|
|
1431
1675
|
var _useTranslation = reactI18next.useTranslation(),
|
|
1432
1676
|
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,
|
|
1677
|
+
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");
|
|
1678
|
+
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");
|
|
1679
|
+
return /*#__PURE__*/jsxRuntime.jsxs(Container, {
|
|
1680
|
+
className: "neeto-molecules-social-share-landing-page py-8",
|
|
1681
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(Button, {
|
|
1682
|
+
className: "mb-4",
|
|
1683
|
+
"data-cy": "back-button",
|
|
1684
|
+
"data-testid": "back-button",
|
|
1685
|
+
icon: LeftArrow,
|
|
1686
|
+
iconPosition: "left",
|
|
1687
|
+
label: t("neetoMolecules.productEmbed.backToShare"),
|
|
1688
|
+
size: "small",
|
|
1689
|
+
style: "link",
|
|
1690
|
+
to: shareUrl
|
|
1691
|
+
}), /*#__PURE__*/jsxRuntime.jsx(Header$1, {
|
|
1692
|
+
className: "py-0",
|
|
1693
|
+
title: t("neetoMolecules.shareViaLink.socialMediaShare.title")
|
|
1694
|
+
}), /*#__PURE__*/jsxRuntime.jsx(CardLayout, {
|
|
1695
|
+
description: description,
|
|
1696
|
+
title: title,
|
|
1697
|
+
actionBlock: /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
1698
|
+
className: "flex flex-wrap items-center gap-3",
|
|
1699
|
+
children: Object.entries(SOCIAL_MEDIA_OPTIONS).map(function (_ref2) {
|
|
1700
|
+
var _ref3 = _slicedToArray(_ref2, 2),
|
|
1701
|
+
key = _ref3[0],
|
|
1702
|
+
_ref3$ = _ref3[1],
|
|
1703
|
+
label = _ref3$.label,
|
|
1704
|
+
Icon = _ref3$.icon,
|
|
1705
|
+
generateShareUrl = _ref3$.generateShareUrl;
|
|
1706
|
+
return /*#__PURE__*/React.createElement(Button, {
|
|
1707
|
+
label: label,
|
|
1494
1708
|
"data-cy": "social-media-button-".concat(key),
|
|
1495
1709
|
"data-testid": "social-media-button-".concat(key),
|
|
1496
|
-
|
|
1497
|
-
|
|
1498
|
-
|
|
1499
|
-
}),
|
|
1710
|
+
icon: Icon,
|
|
1711
|
+
iconPosition: "right",
|
|
1712
|
+
key: key,
|
|
1500
1713
|
rel: "noopener noreferrer",
|
|
1714
|
+
style: "tertiary",
|
|
1501
1715
|
target: "_blank",
|
|
1502
|
-
|
|
1503
|
-
|
|
1504
|
-
|
|
1716
|
+
href: generateShareUrl({
|
|
1717
|
+
url: url,
|
|
1718
|
+
title: socialMediaProps === null || socialMediaProps === void 0 ? void 0 : socialMediaProps.postTitle
|
|
1505
1719
|
})
|
|
1506
|
-
},
|
|
1720
|
+
}, /*#__PURE__*/jsxRuntime.jsx(Icon, {
|
|
1721
|
+
size: 24
|
|
1722
|
+
}));
|
|
1507
1723
|
})
|
|
1508
|
-
})
|
|
1509
|
-
}), !disableQRDownload && /*#__PURE__*/jsxRuntime.jsx(QRCode, {
|
|
1510
|
-
entity: entity,
|
|
1511
|
-
url: url
|
|
1724
|
+
})
|
|
1512
1725
|
})]
|
|
1513
1726
|
});
|
|
1514
1727
|
};
|
|
1515
1728
|
|
|
1729
|
+
/* eslint-disable @bigbinary/neeto/use-common-routes */
|
|
1516
1730
|
var ShareViaLink = function ShareViaLink(_ref) {
|
|
1517
|
-
var
|
|
1731
|
+
var title = _ref.title,
|
|
1732
|
+
description = _ref.description,
|
|
1733
|
+
_ref$isLoading = _ref.isLoading,
|
|
1518
1734
|
isLoading = _ref$isLoading === void 0 ? false : _ref$isLoading,
|
|
1519
1735
|
_ref$enabledOptions = _ref.enabledOptions,
|
|
1520
1736
|
enabledOptions = _ref$enabledOptions === void 0 ? {
|
|
@@ -1529,46 +1745,75 @@ var ShareViaLink = function ShareViaLink(_ref) {
|
|
|
1529
1745
|
handleEdit = _ref$handleEdit === void 0 ? neetoCist.noop : _ref$handleEdit,
|
|
1530
1746
|
_ref$handleRegenerate = _ref.handleRegenerate,
|
|
1531
1747
|
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
1748
|
_ref$disableShareSoci = _ref.disableShareSocialMedia,
|
|
1537
1749
|
disableShareSocialMedia = _ref$disableShareSoci === void 0 ? false : _ref$disableShareSoci,
|
|
1538
1750
|
_ref$disableQRDownloa = _ref.disableQRDownload,
|
|
1539
1751
|
disableQRDownload = _ref$disableQRDownloa === void 0 ? false : _ref$disableQRDownloa,
|
|
1752
|
+
socialMediaProps = _ref.socialMediaProps,
|
|
1753
|
+
qrCodeProps = _ref.qrCodeProps,
|
|
1754
|
+
moreOptions = _ref.moreOptions,
|
|
1540
1755
|
_ref$publicLinkExpiry = _ref.publicLinkExpiryConfiguration,
|
|
1541
|
-
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
|
-
|
|
1756
|
+
publicLinkExpiryConfiguration = _ref$publicLinkExpiry === void 0 ? {} : _ref$publicLinkExpiry,
|
|
1757
|
+
customTopContent = _ref.customTopContent,
|
|
1758
|
+
customBottomContent = _ref.customBottomContent;
|
|
1759
|
+
var _useRouteMatch = reactRouterDom.useRouteMatch(),
|
|
1760
|
+
sharePath = _useRouteMatch.path,
|
|
1761
|
+
shareUrl = _useRouteMatch.url;
|
|
1762
|
+
return /*#__PURE__*/jsxRuntime.jsxs(reactRouterDom.Switch, {
|
|
1763
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(reactRouterDom.Route, {
|
|
1764
|
+
exact: true,
|
|
1765
|
+
path: sharePath,
|
|
1766
|
+
render: function render() {
|
|
1767
|
+
return /*#__PURE__*/jsxRuntime.jsx(MainPanel, {
|
|
1768
|
+
customBottomContent: customBottomContent,
|
|
1769
|
+
customTopContent: customTopContent,
|
|
1770
|
+
description: description,
|
|
1771
|
+
disableQRDownload: disableQRDownload,
|
|
1772
|
+
disableShareSocialMedia: disableShareSocialMedia,
|
|
1773
|
+
enabledOptions: enabledOptions,
|
|
1774
|
+
entity: entity,
|
|
1775
|
+
entityName: entityName,
|
|
1776
|
+
handleEdit: handleEdit,
|
|
1777
|
+
handleRegenerate: handleRegenerate,
|
|
1778
|
+
isLoading: isLoading,
|
|
1779
|
+
moreOptions: moreOptions,
|
|
1780
|
+
publicLinkExpiryConfiguration: publicLinkExpiryConfiguration,
|
|
1781
|
+
qrCodeProps: qrCodeProps,
|
|
1782
|
+
socialMediaProps: socialMediaProps,
|
|
1783
|
+
title: title,
|
|
1784
|
+
urls: urls
|
|
1785
|
+
});
|
|
1786
|
+
}
|
|
1787
|
+
}), /*#__PURE__*/jsxRuntime.jsx(reactRouterDom.Route, {
|
|
1788
|
+
exact: true,
|
|
1789
|
+
path: "".concat(sharePath, "/qrcode"),
|
|
1790
|
+
render: function render() {
|
|
1791
|
+
return /*#__PURE__*/jsxRuntime.jsx(QRCode, {
|
|
1792
|
+
entity: entity,
|
|
1793
|
+
qrCodeProps: qrCodeProps,
|
|
1794
|
+
shareUrl: shareUrl,
|
|
1795
|
+
url: urls[0].url
|
|
1796
|
+
});
|
|
1797
|
+
}
|
|
1798
|
+
}), /*#__PURE__*/jsxRuntime.jsx(reactRouterDom.Route, {
|
|
1799
|
+
exact: true,
|
|
1800
|
+
path: "".concat(sharePath, "/social-media"),
|
|
1801
|
+
render: function render() {
|
|
1802
|
+
return /*#__PURE__*/jsxRuntime.jsx(SocialMedia, {
|
|
1803
|
+
shareUrl: shareUrl,
|
|
1804
|
+
socialMediaProps: socialMediaProps,
|
|
1805
|
+
url: urls[0].url
|
|
1806
|
+
});
|
|
1807
|
+
}
|
|
1808
|
+
}), neetoCist.isPresent(moreOptions) && moreOptions.map(function (_ref2) {
|
|
1809
|
+
var link = _ref2.link,
|
|
1810
|
+
element = _ref2.element;
|
|
1811
|
+
if (!neetoCist.isPresent(link)) return null;
|
|
1812
|
+
return /*#__PURE__*/jsxRuntime.jsx(reactRouterDom.Route, {
|
|
1813
|
+
exact: true,
|
|
1814
|
+
path: link,
|
|
1815
|
+
children: element
|
|
1816
|
+
}, link);
|
|
1572
1817
|
})]
|
|
1573
1818
|
});
|
|
1574
1819
|
};
|