@bigbinary/neeto-molecules 5.1.25 → 5.1.27
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/ShareViaLink.js +2 -1127
- package/dist/ShareViaLink.js.map +1 -1
- package/dist/cjs/ShareViaLink.js +2 -1127
- package/dist/cjs/ShareViaLink.js.map +1 -1
- package/dist/cjs/external-link-C7Cbtssd.js +21 -0
- package/dist/cjs/external-link-C7Cbtssd.js.map +1 -0
- package/dist/cjs/index-Dzzs5KSc.js +1132 -0
- package/dist/cjs/index-Dzzs5KSc.js.map +1 -0
- package/dist/cjs/info-CpwCcUWd.js +21 -0
- package/dist/cjs/info-CpwCcUWd.js.map +1 -0
- package/dist/cjs/v2/DndTable.js +194 -0
- package/dist/cjs/v2/DndTable.js.map +1 -0
- package/dist/cjs/v2/NavigationHeader.js +1 -0
- package/dist/cjs/v2/NavigationHeader.js.map +1 -1
- package/dist/cjs/v2/PublishBlock.js +5 -19
- package/dist/cjs/v2/PublishBlock.js.map +1 -1
- package/dist/cjs/v2/ShareViaLink.js +1041 -0
- package/dist/cjs/v2/ShareViaLink.js.map +1 -0
- package/dist/cjs/v2/SuffixedInput.js +3 -17
- package/dist/cjs/v2/SuffixedInput.js.map +1 -1
- package/dist/cjs/v2/Taxonomy.js +546 -0
- package/dist/cjs/v2/Taxonomy.js.map +1 -0
- package/dist/external-link-Bqki-W-9.js +19 -0
- package/dist/external-link-Bqki-W-9.js.map +1 -0
- package/dist/index-c-mrzXSg.js +1130 -0
- package/dist/index-c-mrzXSg.js.map +1 -0
- package/dist/info-DpOFLPLx.js +19 -0
- package/dist/info-DpOFLPLx.js.map +1 -0
- package/dist/v2/DndTable.js +189 -0
- package/dist/v2/DndTable.js.map +1 -0
- package/dist/v2/NavigationHeader.js +1 -0
- package/dist/v2/NavigationHeader.js.map +1 -1
- package/dist/v2/PublishBlock.js +3 -17
- package/dist/v2/PublishBlock.js.map +1 -1
- package/dist/v2/ShareViaLink.js +1020 -0
- package/dist/v2/ShareViaLink.js.map +1 -0
- package/dist/v2/SuffixedInput.js +2 -16
- package/dist/v2/SuffixedInput.js.map +1 -1
- package/dist/v2/Taxonomy.js +525 -0
- package/dist/v2/Taxonomy.js.map +1 -0
- package/package.json +3 -3
- package/src/translations/ar.json +10 -3
- package/src/translations/bg.json +10 -3
- package/src/translations/ca.json +10 -3
- package/src/translations/cs.json +10 -3
- package/src/translations/da.json +10 -3
- package/src/translations/de.json +10 -3
- package/src/translations/es-MX.json +10 -3
- package/src/translations/es.json +10 -3
- package/src/translations/et.json +10 -3
- package/src/translations/fi.json +10 -3
- package/src/translations/fil.json +10 -3
- package/src/translations/fr.json +10 -3
- package/src/translations/he.json +10 -3
- package/src/translations/hi.json +10 -3
- package/src/translations/hr.json +10 -3
- package/src/translations/hu.json +10 -3
- package/src/translations/id.json +10 -3
- package/src/translations/it.json +10 -3
- package/src/translations/ja.json +9 -2
- package/src/translations/ko.json +9 -2
- package/src/translations/nl.json +10 -3
- package/src/translations/pl.json +10 -3
- package/src/translations/pt-BR.json +10 -3
- package/src/translations/pt.json +10 -3
- package/src/translations/ro.json +10 -3
- package/src/translations/ru.json +10 -3
- package/src/translations/sk.json +10 -3
- package/src/translations/sl.json +10 -3
- package/src/translations/sv.json +10 -3
- package/src/translations/th.json +9 -2
- package/src/translations/tr.json +10 -3
- package/src/translations/uk.json +10 -3
- package/src/translations/vi.json +10 -3
- package/src/translations/zh-CN.json +10 -3
- package/src/translations/zh-TW.json +10 -3
- package/types/v2/DndTable.d.ts +23 -0
- package/types/v2/ShareViaLink.d.ts +61 -0
- package/types/v2/Taxonomy.d.ts +16 -0
|
@@ -0,0 +1,1020 @@
|
|
|
1
|
+
import { isPresent, noop, isNotPresent, isNotEmpty, slugify } from '@bigbinary/neeto-cist';
|
|
2
|
+
import PrivateRoute from '@bigbinary/neeto-commons-frontend/v2/react-utils/PrivateRoute';
|
|
3
|
+
import { Link as Link$2, useLocation, useHistory, useRouteMatch, Switch, Route } from 'react-router-dom';
|
|
4
|
+
import { Typography, Sheet, Input, Tooltip, Dialog, Select, DatePicker, Button } from '@bigbinary/neeto-atoms';
|
|
5
|
+
import classnames from 'classnames';
|
|
6
|
+
import { globalProps } from '@bigbinary/neeto-commons-frontend/v2/initializers';
|
|
7
|
+
import { replace, includes, __, omit } from 'ramda';
|
|
8
|
+
import { useTranslation } from 'react-i18next';
|
|
9
|
+
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
10
|
+
import _slicedToArray from '@babel/runtime/helpers/slicedToArray';
|
|
11
|
+
import { useRef, useState, useCallback, useEffect, createElement } from 'react';
|
|
12
|
+
import useBreakpoints from '@bigbinary/neeto-commons-frontend/v2/react-utils/useBreakpoints';
|
|
13
|
+
import { ActionBlock } from '@bigbinary/neeto-atoms/formik';
|
|
14
|
+
import { Formik, Form, Field } from 'formik';
|
|
15
|
+
import { t } from 'i18next';
|
|
16
|
+
import { RESERVED_PATHS } from '@bigbinary/neeto-commons-frontend/v2/constants';
|
|
17
|
+
import Facebook from '@bigbinary/neeto-icons/Facebook';
|
|
18
|
+
import Linkedin from '@bigbinary/neeto-icons/Linkedin';
|
|
19
|
+
import Twitter from '@bigbinary/neeto-icons/Twitter';
|
|
20
|
+
import * as yup from 'yup';
|
|
21
|
+
import _defineProperty from '@babel/runtime/helpers/defineProperty';
|
|
22
|
+
import _asyncToGenerator from '@babel/runtime/helpers/asyncToGenerator';
|
|
23
|
+
import { buildUrl } from '@bigbinary/neeto-commons-frontend/v2/utils/general';
|
|
24
|
+
import { dayjs } from '@bigbinary/neeto-commons-frontend/v2/utils';
|
|
25
|
+
import { I as Info } from '../info-DpOFLPLx.js';
|
|
26
|
+
import CopyToClipboardButton from './CopyToClipboardButton.js';
|
|
27
|
+
import MoreDropdown from './MoreDropdown.js';
|
|
28
|
+
import { c as createLucideIcon } from '../createLucideIcon-mNMhCCpf.js';
|
|
29
|
+
import { E as ExternalLink } from '../external-link-Bqki-W-9.js';
|
|
30
|
+
import _objectWithoutProperties from '@babel/runtime/helpers/objectWithoutProperties';
|
|
31
|
+
import HelpPopover from './HelpPopover.js';
|
|
32
|
+
import Container from './Container.js';
|
|
33
|
+
import { Q as QRCodeCanvas } from '../index-c-mrzXSg.js';
|
|
34
|
+
import CardLayout from './CardLayout.js';
|
|
35
|
+
import Header from './Header.js';
|
|
36
|
+
import { A as ArrowLeft } from '../arrow-left-B-s28MD1.js';
|
|
37
|
+
import ErrorPage from './ErrorPage.js';
|
|
38
|
+
import '../check-DvxzqR83.js';
|
|
39
|
+
import '../copy-DhbOoOav.js';
|
|
40
|
+
import '@bigbinary/neeto-commons-frontend/v2/react-utils';
|
|
41
|
+
import '../ellipsis-DpI9xqUK.js';
|
|
42
|
+
import '../circle-question-mark-Dib48f5Z.js';
|
|
43
|
+
import '../index-DAYCJu79.js';
|
|
44
|
+
import '../_commonjsHelpers-BFTU3MAI.js';
|
|
45
|
+
import './Breadcrumbs.js';
|
|
46
|
+
import '@bigbinary/neeto-atoms/primitives';
|
|
47
|
+
import './Search.js';
|
|
48
|
+
import '@bigbinary/neeto-commons-frontend/v2/react-utils/useFuncDebounce';
|
|
49
|
+
import '@bigbinary/neeto-commons-frontend/v2/react-utils/useQueryParams';
|
|
50
|
+
import '@bigbinary/neeto-commons-frontend/v2/react-utils/useUpdateEffect';
|
|
51
|
+
import '../search-DCgpNjip.js';
|
|
52
|
+
import 'zustand/shallow';
|
|
53
|
+
import '../purify.es-CRFzu7ib.js';
|
|
54
|
+
import '@bigbinary/neeto-commons-frontend/v2/react-utils/useDisplayErrorPage';
|
|
55
|
+
import 'react-helmet';
|
|
56
|
+
import '../triangle-alert-Pkh6pc42.js';
|
|
57
|
+
import '../chevron-left-BTVCxPw8.js';
|
|
58
|
+
import '../house-BkoJwC3b.js';
|
|
59
|
+
|
|
60
|
+
/**
|
|
61
|
+
* @license lucide-react v1.7.0 - ISC
|
|
62
|
+
*
|
|
63
|
+
* This source code is licensed under the ISC license.
|
|
64
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
65
|
+
*/
|
|
66
|
+
|
|
67
|
+
|
|
68
|
+
const __iconNode$2 = [
|
|
69
|
+
["path", { d: "M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71", key: "1cjeqo" }],
|
|
70
|
+
["path", { d: "M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71", key: "19qd67" }]
|
|
71
|
+
];
|
|
72
|
+
const Link$1 = createLucideIcon("link", __iconNode$2);
|
|
73
|
+
|
|
74
|
+
/**
|
|
75
|
+
* @license lucide-react v1.7.0 - ISC
|
|
76
|
+
*
|
|
77
|
+
* This source code is licensed under the ISC license.
|
|
78
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
79
|
+
*/
|
|
80
|
+
|
|
81
|
+
|
|
82
|
+
const __iconNode$1 = [
|
|
83
|
+
["rect", { width: "5", height: "5", x: "3", y: "3", rx: "1", key: "1tu5fj" }],
|
|
84
|
+
["rect", { width: "5", height: "5", x: "16", y: "3", rx: "1", key: "1v8r4q" }],
|
|
85
|
+
["rect", { width: "5", height: "5", x: "3", y: "16", rx: "1", key: "1x03jg" }],
|
|
86
|
+
["path", { d: "M21 16h-3a2 2 0 0 0-2 2v3", key: "177gqh" }],
|
|
87
|
+
["path", { d: "M21 21v.01", key: "ents32" }],
|
|
88
|
+
["path", { d: "M12 7v3a2 2 0 0 1-2 2H7", key: "8crl2c" }],
|
|
89
|
+
["path", { d: "M3 12h.01", key: "nlz23k" }],
|
|
90
|
+
["path", { d: "M12 3h.01", key: "n36tog" }],
|
|
91
|
+
["path", { d: "M12 16v.01", key: "133mhm" }],
|
|
92
|
+
["path", { d: "M16 12h1", key: "1slzba" }],
|
|
93
|
+
["path", { d: "M21 12v.01", key: "1lwtk9" }],
|
|
94
|
+
["path", { d: "M12 21v-1", key: "1880an" }]
|
|
95
|
+
];
|
|
96
|
+
const QrCode = createLucideIcon("qr-code", __iconNode$1);
|
|
97
|
+
|
|
98
|
+
/**
|
|
99
|
+
* @license lucide-react v1.7.0 - ISC
|
|
100
|
+
*
|
|
101
|
+
* This source code is licensed under the ISC license.
|
|
102
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
103
|
+
*/
|
|
104
|
+
|
|
105
|
+
|
|
106
|
+
const __iconNode = [
|
|
107
|
+
["circle", { cx: "18", cy: "5", r: "3", key: "gq8acd" }],
|
|
108
|
+
["circle", { cx: "6", cy: "12", r: "3", key: "w7nqdw" }],
|
|
109
|
+
["circle", { cx: "18", cy: "19", r: "3", key: "1xt0gg" }],
|
|
110
|
+
["line", { x1: "8.59", x2: "15.42", y1: "13.51", y2: "17.49", key: "47mynk" }],
|
|
111
|
+
["line", { x1: "15.41", x2: "8.59", y1: "6.51", y2: "10.49", key: "1n3mei" }]
|
|
112
|
+
];
|
|
113
|
+
const Share2 = createLucideIcon("share-2", __iconNode);
|
|
114
|
+
|
|
115
|
+
var ExpiryNotice = function ExpiryNotice(_ref) {
|
|
116
|
+
var expiryConfiguration = _ref.expiryConfiguration;
|
|
117
|
+
var _useTranslation = useTranslation(),
|
|
118
|
+
t = _useTranslation.t;
|
|
119
|
+
var daysBeforeExpiry = expiryConfiguration.daysBeforeExpiry;
|
|
120
|
+
var notice = t("neetoMolecules.shareViaLink.expiryNotice.daysRemaining", {
|
|
121
|
+
count: daysBeforeExpiry
|
|
122
|
+
});
|
|
123
|
+
if (daysBeforeExpiry < 1) {
|
|
124
|
+
notice = t("neetoMolecules.shareViaLink.expiryNotice.expiresToday");
|
|
125
|
+
}
|
|
126
|
+
if (daysBeforeExpiry <= 0) {
|
|
127
|
+
notice = t("neetoMolecules.shareViaLink.expiryNotice.expired");
|
|
128
|
+
}
|
|
129
|
+
return /*#__PURE__*/jsx(Typography, {
|
|
130
|
+
as: "span",
|
|
131
|
+
"data-testid": "expiry-notice",
|
|
132
|
+
variant: "body3",
|
|
133
|
+
className: classnames("ms-1", {
|
|
134
|
+
"text-destructive": daysBeforeExpiry <= 1,
|
|
135
|
+
"text-muted-foreground": daysBeforeExpiry > 1
|
|
136
|
+
}),
|
|
137
|
+
children: notice
|
|
138
|
+
});
|
|
139
|
+
};
|
|
140
|
+
|
|
141
|
+
function _regenerator() { /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */ var e, t, r = "function" == typeof Symbol ? Symbol : {}, n = r.iterator || "@@iterator", o = r.toStringTag || "@@toStringTag"; function i(r, n, o, i) { var c = n && n.prototype instanceof Generator ? n : Generator, u = Object.create(c.prototype); return _regeneratorDefine2(u, "_invoke", function (r, n, o) { var i, c, u, f = 0, p = o || [], y = false, G = { p: 0, n: 0, v: e, a: d, f: d.bind(e, 4), d: function d(t, r) { return i = t, c = 0, u = e, G.n = r, a; } }; function d(r, n) { for (c = r, u = n, t = 0; !y && f && !o && t < p.length; t++) { var o, i = p[t], d = G.p, l = i[2]; r > 3 ? (o = l === n) && (u = i[(c = i[4]) ? 5 : (c = 3, 3)], i[4] = i[5] = e) : i[0] <= d && ((o = r < 2 && d < i[1]) ? (c = 0, G.v = n, G.n = i[1]) : d < l && (o = r < 3 || i[0] > n || n > l) && (i[4] = r, i[5] = n, G.n = l, c = 0)); } if (o || r > 1) return a; throw y = true, n; } return function (o, p, l) { if (f > 1) throw TypeError("Generator is already running"); for (y && 1 === p && d(p, l), c = p, u = l; (t = c < 2 ? e : u) || !y;) { i || (c ? c < 3 ? (c > 1 && (G.n = -1), d(c, u)) : G.n = u : G.v = u); try { if (f = 2, i) { if (c || (o = "next"), t = i[o]) { if (!(t = t.call(i, u))) throw TypeError("iterator result is not an object"); if (!t.done) return t; u = t.value, c < 2 && (c = 0); } else 1 === c && (t = i["return"]) && t.call(i), c < 2 && (u = TypeError("The iterator does not provide a '" + o + "' method"), c = 1); i = e; } else if ((t = (y = G.n < 0) ? u : r.call(n, G)) !== a) break; } catch (t) { i = e, c = 1, u = t; } finally { f = 1; } } return { value: t, done: y }; }; }(r, o, i), true), u; } var a = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} t = Object.getPrototypeOf; var c = [][n] ? t(t([][n]())) : (_regeneratorDefine2(t = {}, n, function () { return this; }), t), u = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(c); function f(e) { return Object.setPrototypeOf ? Object.setPrototypeOf(e, GeneratorFunctionPrototype) : (e.__proto__ = GeneratorFunctionPrototype, _regeneratorDefine2(e, o, "GeneratorFunction")), e.prototype = Object.create(u), e; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, _regeneratorDefine2(u, "constructor", GeneratorFunctionPrototype), _regeneratorDefine2(GeneratorFunctionPrototype, "constructor", GeneratorFunction), GeneratorFunction.displayName = "GeneratorFunction", _regeneratorDefine2(GeneratorFunctionPrototype, o, "GeneratorFunction"), _regeneratorDefine2(u), _regeneratorDefine2(u, o, "Generator"), _regeneratorDefine2(u, n, function () { return this; }), _regeneratorDefine2(u, "toString", function () { return "[object Generator]"; }), (_regenerator = function _regenerator() { return { w: i, m: f }; })(); }
|
|
142
|
+
function _regeneratorDefine2(e, r, n, t) { var i = Object.defineProperty; try { i({}, "", {}); } catch (e) { i = 0; } _regeneratorDefine2 = function _regeneratorDefine(e, r, n, t) { function o(r, n) { _regeneratorDefine2(e, r, function (e) { return this._invoke(r, n, e); }); } r ? i ? i(e, r, { value: n, enumerable: !t, configurable: !t, writable: !t }) : e[r] = n : (o("next", 0), o("throw", 1), o("return", 2)); }, _regeneratorDefine2(e, r, n, t); }
|
|
143
|
+
var facebookShareLink = function facebookShareLink(_ref) {
|
|
144
|
+
var url = _ref.url;
|
|
145
|
+
return buildUrl("https://www.facebook.com/sharer/sharer.php", {
|
|
146
|
+
u: url
|
|
147
|
+
});
|
|
148
|
+
};
|
|
149
|
+
var linkedInShareLink = function linkedInShareLink(_ref2) {
|
|
150
|
+
var url = _ref2.url,
|
|
151
|
+
title = _ref2.title;
|
|
152
|
+
return buildUrl("https://www.linkedin.com/sharing/share-offsite", {
|
|
153
|
+
mini: true,
|
|
154
|
+
text: "".concat(title, " ").concat(url)
|
|
155
|
+
});
|
|
156
|
+
};
|
|
157
|
+
var twitterShareLink = function twitterShareLink(_ref3) {
|
|
158
|
+
var url = _ref3.url,
|
|
159
|
+
title = _ref3.title;
|
|
160
|
+
return buildUrl("http://twitter.com/share", {
|
|
161
|
+
text: title,
|
|
162
|
+
url: url
|
|
163
|
+
});
|
|
164
|
+
};
|
|
165
|
+
var downloadCanvas = function downloadCanvas(canvas) {
|
|
166
|
+
var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
167
|
+
var _options$name = options.name,
|
|
168
|
+
name = _options$name === void 0 ? "image" : _options$name,
|
|
169
|
+
_options$extension = options.extension,
|
|
170
|
+
extension = _options$extension === void 0 ? "png" : _options$extension;
|
|
171
|
+
var canvasUrl = canvas.toDataURL("image/".concat(extension));
|
|
172
|
+
var element = document.createElement("a");
|
|
173
|
+
element.href = canvasUrl;
|
|
174
|
+
element.download = "".concat(name, ".").concat(extension);
|
|
175
|
+
element.click();
|
|
176
|
+
element.remove();
|
|
177
|
+
};
|
|
178
|
+
var copyCanvasToClipboard = /*#__PURE__*/function () {
|
|
179
|
+
var _ref4 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee(canvas, handleDownloadQRCode) {
|
|
180
|
+
var blob, clipboardItem;
|
|
181
|
+
return _regenerator().w(function (_context) {
|
|
182
|
+
while (1) switch (_context.p = _context.n) {
|
|
183
|
+
case 0:
|
|
184
|
+
if (canvas) {
|
|
185
|
+
_context.n = 1;
|
|
186
|
+
break;
|
|
187
|
+
}
|
|
188
|
+
return _context.a(2);
|
|
189
|
+
case 1:
|
|
190
|
+
_context.p = 1;
|
|
191
|
+
_context.n = 2;
|
|
192
|
+
return new Promise(function (resolve) {
|
|
193
|
+
return canvas.toBlob(resolve);
|
|
194
|
+
});
|
|
195
|
+
case 2:
|
|
196
|
+
blob = _context.v;
|
|
197
|
+
if (blob) {
|
|
198
|
+
_context.n = 3;
|
|
199
|
+
break;
|
|
200
|
+
}
|
|
201
|
+
return _context.a(2);
|
|
202
|
+
case 3:
|
|
203
|
+
clipboardItem = new ClipboardItem(_defineProperty({}, blob.type, blob));
|
|
204
|
+
navigator.clipboard.write([clipboardItem]);
|
|
205
|
+
_context.n = 5;
|
|
206
|
+
break;
|
|
207
|
+
case 4:
|
|
208
|
+
_context.p = 4;
|
|
209
|
+
_context.v;
|
|
210
|
+
handleDownloadQRCode();
|
|
211
|
+
case 5:
|
|
212
|
+
return _context.a(2);
|
|
213
|
+
}
|
|
214
|
+
}, _callee, null, [[1, 4]]);
|
|
215
|
+
}));
|
|
216
|
+
return function copyCanvasToClipboard(_x, _x2) {
|
|
217
|
+
return _ref4.apply(this, arguments);
|
|
218
|
+
};
|
|
219
|
+
}();
|
|
220
|
+
var getPathname = function getPathname(url) {
|
|
221
|
+
return new URL(url).pathname.slice(1);
|
|
222
|
+
};
|
|
223
|
+
var getPrefixFromUrl = function getPrefixFromUrl(url) {
|
|
224
|
+
return "".concat(new URL(url).origin, "/");
|
|
225
|
+
};
|
|
226
|
+
var normalizeEditablePath = replace(/[^a-z0-9&?=._-]/gi, "");
|
|
227
|
+
|
|
228
|
+
var SOCIAL_MEDIA_OPTIONS = {
|
|
229
|
+
FACEBOOK: {
|
|
230
|
+
label: t("neetoMolecules.shareViaLink.socialMediaShare.facebook"),
|
|
231
|
+
icon: Facebook,
|
|
232
|
+
generateShareUrl: facebookShareLink
|
|
233
|
+
},
|
|
234
|
+
LINKEDIN: {
|
|
235
|
+
label: t("neetoMolecules.shareViaLink.socialMediaShare.linkedIn"),
|
|
236
|
+
icon: Linkedin,
|
|
237
|
+
generateShareUrl: linkedInShareLink
|
|
238
|
+
},
|
|
239
|
+
TWITTER: {
|
|
240
|
+
label: t("neetoMolecules.shareViaLink.socialMediaShare.twitter"),
|
|
241
|
+
icon: Twitter,
|
|
242
|
+
generateShareUrl: twitterShareLink
|
|
243
|
+
}
|
|
244
|
+
};
|
|
245
|
+
var PATH_VALIDATION_SCHEMA = yup.object().shape({
|
|
246
|
+
path: yup.string().required(t("neetoMolecules.shareViaLink.editUrl.validationError")).matches(/^[A-Za-z0-9]([\w/-])*$/, t("neetoMolecules.shareViaLink.editUrl.validationError")).test("reserved-path", t("neetoMolecules.shareViaLink.editUrl.reservedPathError"), function (value) {
|
|
247
|
+
return !RESERVED_PATHS.includes(value === null || value === void 0 ? void 0 : value.toLowerCase());
|
|
248
|
+
})
|
|
249
|
+
});
|
|
250
|
+
|
|
251
|
+
var EditURL = function EditURL(_ref) {
|
|
252
|
+
var editUrlProps = _ref.editUrlProps,
|
|
253
|
+
isOpen = _ref.isOpen,
|
|
254
|
+
onClose = _ref.onClose,
|
|
255
|
+
url = _ref.url,
|
|
256
|
+
isLoading = _ref.isLoading,
|
|
257
|
+
handleEdit = _ref.handleEdit;
|
|
258
|
+
var _useTranslation = useTranslation(),
|
|
259
|
+
t = _useTranslation.t;
|
|
260
|
+
var focusRef = useRef(null);
|
|
261
|
+
var prevIsLoadingRef = useRef(isLoading);
|
|
262
|
+
var observerRef = useRef(null);
|
|
263
|
+
var prefixText = (editUrlProps === null || editUrlProps === void 0 ? void 0 : editUrlProps.prefix) || getPrefixFromUrl(url);
|
|
264
|
+
var _useState = useState(prefixText),
|
|
265
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
266
|
+
displayedPrefix = _useState2[0],
|
|
267
|
+
setDisplayedPrefix = _useState2[1];
|
|
268
|
+
var updateDisplayedPrefix = useCallback(function (inputElement) {
|
|
269
|
+
if (!inputElement) return;
|
|
270
|
+
var parentElement = inputElement.parentElement;
|
|
271
|
+
var _getComputedStyle = getComputedStyle(inputElement),
|
|
272
|
+
fontSize = _getComputedStyle.fontSize;
|
|
273
|
+
var averageCharWidth = parseFloat(fontSize) * 0.6;
|
|
274
|
+
var requiredInputWidth = inputElement.value.length * averageCharWidth;
|
|
275
|
+
var prefixWidth = parentElement.offsetWidth - requiredInputWidth;
|
|
276
|
+
var maxPrefixChars = Math.max(Math.floor(prefixWidth / averageCharWidth), 5);
|
|
277
|
+
setDisplayedPrefix(maxPrefixChars < prefixText.length ? "...".concat(prefixText.slice(-maxPrefixChars)) : prefixText);
|
|
278
|
+
}, [prefixText]);
|
|
279
|
+
var setInputRef = useCallback(function (inputElement) {
|
|
280
|
+
focusRef.current = inputElement;
|
|
281
|
+
if (observerRef.current) {
|
|
282
|
+
observerRef.current.disconnect();
|
|
283
|
+
observerRef.current = null;
|
|
284
|
+
}
|
|
285
|
+
if (inputElement) {
|
|
286
|
+
observerRef.current = new ResizeObserver(function () {
|
|
287
|
+
return requestAnimationFrame(function () {
|
|
288
|
+
return updateDisplayedPrefix(inputElement);
|
|
289
|
+
});
|
|
290
|
+
});
|
|
291
|
+
observerRef.current.observe(inputElement);
|
|
292
|
+
}
|
|
293
|
+
}, [updateDisplayedPrefix]);
|
|
294
|
+
useEffect(function () {
|
|
295
|
+
if (prevIsLoadingRef.current && !isLoading) onClose();
|
|
296
|
+
prevIsLoadingRef.current = isLoading;
|
|
297
|
+
}, [isLoading]);
|
|
298
|
+
return /*#__PURE__*/jsxs(Sheet, {
|
|
299
|
+
isOpen: isOpen,
|
|
300
|
+
onClose: onClose,
|
|
301
|
+
"aria-describedby": undefined,
|
|
302
|
+
size: "large",
|
|
303
|
+
children: [/*#__PURE__*/jsx(Sheet.Header, {
|
|
304
|
+
children: /*#__PURE__*/jsx(Sheet.Title, {
|
|
305
|
+
children: t("neetoMolecules.shareViaLink.editUrl.title")
|
|
306
|
+
})
|
|
307
|
+
}), /*#__PURE__*/jsx(Formik, {
|
|
308
|
+
enableReinitialize: true,
|
|
309
|
+
initialValues: {
|
|
310
|
+
path: (editUrlProps === null || editUrlProps === void 0 ? void 0 : editUrlProps.editablePath) || getPathname(url)
|
|
311
|
+
},
|
|
312
|
+
validationSchema: PATH_VALIDATION_SCHEMA,
|
|
313
|
+
onSubmit: function onSubmit(_ref2) {
|
|
314
|
+
var path = _ref2.path;
|
|
315
|
+
return handleEdit(path);
|
|
316
|
+
},
|
|
317
|
+
children: function children() {
|
|
318
|
+
return /*#__PURE__*/jsxs(Form, {
|
|
319
|
+
children: [/*#__PURE__*/jsxs(Sheet.Body, {
|
|
320
|
+
className: "flex flex-col gap-y-6",
|
|
321
|
+
children: [/*#__PURE__*/jsx(Field, {
|
|
322
|
+
name: "path",
|
|
323
|
+
children: function children(_ref3) {
|
|
324
|
+
var field = _ref3.field,
|
|
325
|
+
meta = _ref3.meta,
|
|
326
|
+
form = _ref3.form;
|
|
327
|
+
return /*#__PURE__*/jsx(Input, {
|
|
328
|
+
"data-testid": "edit-url-input",
|
|
329
|
+
error: meta.touched ? meta.error : undefined,
|
|
330
|
+
label: t("neetoMolecules.shareViaLink.editUrl.inputLabel"),
|
|
331
|
+
maxLength: editUrlProps === null || editUrlProps === void 0 ? void 0 : editUrlProps.maxLength,
|
|
332
|
+
name: "path",
|
|
333
|
+
prefix: displayedPrefix,
|
|
334
|
+
ref: setInputRef,
|
|
335
|
+
value: field.value,
|
|
336
|
+
onBlur: field.onBlur,
|
|
337
|
+
onChange: function onChange(event) {
|
|
338
|
+
return form.setFieldValue("path", normalizeEditablePath(event.target.value));
|
|
339
|
+
}
|
|
340
|
+
});
|
|
341
|
+
}
|
|
342
|
+
}), /*#__PURE__*/jsx(Typography, {
|
|
343
|
+
variant: "body2",
|
|
344
|
+
children: t("neetoMolecules.shareViaLink.editUrl.description")
|
|
345
|
+
})]
|
|
346
|
+
}), /*#__PURE__*/jsx(Sheet.Footer, {
|
|
347
|
+
className: "flex items-center gap-x-2",
|
|
348
|
+
children: /*#__PURE__*/jsx(ActionBlock, {
|
|
349
|
+
cancelButtonProps: {
|
|
350
|
+
onClick: onClose,
|
|
351
|
+
"data-testid": "edit-url-cancel-button"
|
|
352
|
+
},
|
|
353
|
+
submitButtonProps: {
|
|
354
|
+
loading: isLoading,
|
|
355
|
+
"data-testid": "edit-url-confirm-button"
|
|
356
|
+
}
|
|
357
|
+
})
|
|
358
|
+
})]
|
|
359
|
+
});
|
|
360
|
+
}
|
|
361
|
+
})]
|
|
362
|
+
});
|
|
363
|
+
};
|
|
364
|
+
|
|
365
|
+
var RegenerateURL = function RegenerateURL(_ref) {
|
|
366
|
+
var _regenerateConfig$exp;
|
|
367
|
+
var isOpen = _ref.isOpen,
|
|
368
|
+
onClose = _ref.onClose,
|
|
369
|
+
url = _ref.url,
|
|
370
|
+
isLoading = _ref.isLoading,
|
|
371
|
+
handleRegenerate = _ref.handleRegenerate,
|
|
372
|
+
_ref$regenerateConfig = _ref.regenerateConfig,
|
|
373
|
+
regenerateConfig = _ref$regenerateConfig === void 0 ? {
|
|
374
|
+
expiresInOptions: [],
|
|
375
|
+
helpUrl: null
|
|
376
|
+
} : _ref$regenerateConfig;
|
|
377
|
+
var _useTranslation = useTranslation(),
|
|
378
|
+
t = _useTranslation.t;
|
|
379
|
+
var prevIsLoadingRef = useRef(isLoading);
|
|
380
|
+
var regenerateStrategy = isPresent(regenerateConfig === null || regenerateConfig === void 0 ? void 0 : regenerateConfig.expiresInOptions) ? "expiryBased" : "basic";
|
|
381
|
+
var defaultExpiresInOption = regenerateConfig === null || regenerateConfig === void 0 || (_regenerateConfig$exp = regenerateConfig.expiresInOptions) === null || _regenerateConfig$exp === void 0 || (_regenerateConfig$exp = _regenerateConfig$exp[0]) === null || _regenerateConfig$exp === void 0 ? void 0 : _regenerateConfig$exp.value;
|
|
382
|
+
var _useState = useState(defaultExpiresInOption),
|
|
383
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
384
|
+
selectedExpiresInOption = _useState2[0],
|
|
385
|
+
setSelectedExpiresInOption = _useState2[1];
|
|
386
|
+
var defaultExpiresOnDate = dayjs().add(10, "day").toDate();
|
|
387
|
+
var _useState3 = useState(defaultExpiresOnDate),
|
|
388
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
389
|
+
selectedExpiresOnDate = _useState4[0],
|
|
390
|
+
setSelectedExpiresOnDate = _useState4[1];
|
|
391
|
+
var isSelectedExpiresInOptionNever = selectedExpiresInOption === "never";
|
|
392
|
+
var isSelectedExpiresInOptionCustom = selectedExpiresInOption === "custom";
|
|
393
|
+
var isSelectedExpiresInOptionValidNumberOfDays = isPresent(selectedExpiresInOption) && !isSelectedExpiresInOptionCustom && !isSelectedExpiresInOptionNever;
|
|
394
|
+
var isValidExpiryConfig = isSelectedExpiresInOptionNever || isSelectedExpiresInOptionCustom && isPresent(selectedExpiresOnDate) || isSelectedExpiresInOptionValidNumberOfDays;
|
|
395
|
+
var expiryConfigPayload = isSelectedExpiresInOptionValidNumberOfDays ? {
|
|
396
|
+
expiresInDays: selectedExpiresInOption
|
|
397
|
+
} : {
|
|
398
|
+
expiresOnDate: selectedExpiresOnDate
|
|
399
|
+
};
|
|
400
|
+
var onSubmit = function onSubmit() {
|
|
401
|
+
return regenerateStrategy === "basic" || isSelectedExpiresInOptionNever ? handleRegenerate() : handleRegenerate({
|
|
402
|
+
payload: expiryConfigPayload
|
|
403
|
+
});
|
|
404
|
+
};
|
|
405
|
+
useEffect(function () {
|
|
406
|
+
if (prevIsLoadingRef.current && !isLoading) onClose();
|
|
407
|
+
prevIsLoadingRef.current = isLoading;
|
|
408
|
+
}, [isLoading]);
|
|
409
|
+
useEffect(function () {
|
|
410
|
+
if (!isOpen) return;
|
|
411
|
+
setSelectedExpiresInOption(defaultExpiresInOption);
|
|
412
|
+
setSelectedExpiresOnDate(defaultExpiresOnDate);
|
|
413
|
+
}, [isOpen]);
|
|
414
|
+
var expiresInLabel = isPresent(regenerateConfig === null || regenerateConfig === void 0 ? void 0 : regenerateConfig.helpUrl) ? /*#__PURE__*/jsxs("span", {
|
|
415
|
+
className: "inline-flex items-center gap-1",
|
|
416
|
+
children: [t("neetoMolecules.shareViaLink.regenerateUrl.expiresInLabel"), /*#__PURE__*/jsx(Tooltip, {
|
|
417
|
+
position: "top",
|
|
418
|
+
content: t("neetoMolecules.shareViaLink.regenerateUrl.expiresInHelpTitle"),
|
|
419
|
+
children: /*#__PURE__*/jsx("button", {
|
|
420
|
+
className: "cursor-pointer opacity-75 transition-opacity duration-300 ease-in-out hover:opacity-100",
|
|
421
|
+
type: "button",
|
|
422
|
+
onClick: function onClick() {
|
|
423
|
+
return window.open(regenerateConfig === null || regenerateConfig === void 0 ? void 0 : regenerateConfig.helpUrl, "_blank");
|
|
424
|
+
},
|
|
425
|
+
children: /*#__PURE__*/jsx(Info, {
|
|
426
|
+
size: 14
|
|
427
|
+
})
|
|
428
|
+
})
|
|
429
|
+
})]
|
|
430
|
+
}) : t("neetoMolecules.shareViaLink.regenerateUrl.expiresInLabel");
|
|
431
|
+
return /*#__PURE__*/jsxs(Dialog, {
|
|
432
|
+
isOpen: isOpen,
|
|
433
|
+
onClose: onClose,
|
|
434
|
+
"aria-describedby": undefined,
|
|
435
|
+
size: regenerateStrategy === "basic" ? "medium" : "large",
|
|
436
|
+
children: [/*#__PURE__*/jsx(Dialog.Header, {
|
|
437
|
+
children: /*#__PURE__*/jsx(Dialog.Title, {
|
|
438
|
+
children: regenerateStrategy === "expiryBased" ? t("neetoMolecules.shareViaLink.regenerateUrl.titleForExpiryBasedRegeneration") : t("neetoMolecules.shareViaLink.regenerateUrl.title")
|
|
439
|
+
})
|
|
440
|
+
}), /*#__PURE__*/jsx(Dialog.Body, {
|
|
441
|
+
children: /*#__PURE__*/jsxs("div", {
|
|
442
|
+
className: "flex w-full flex-col gap-y-6",
|
|
443
|
+
children: [regenerateStrategy === "basic" && /*#__PURE__*/jsx(Input, {
|
|
444
|
+
disabled: true,
|
|
445
|
+
label: t("neetoMolecules.shareViaLink.regenerateUrl.inputLabel"),
|
|
446
|
+
value: url
|
|
447
|
+
}), regenerateStrategy === "expiryBased" && /*#__PURE__*/jsxs("div", {
|
|
448
|
+
className: "flex flex-row gap-2",
|
|
449
|
+
children: [/*#__PURE__*/jsx(Select, {
|
|
450
|
+
dataTestId: "expires-in-select",
|
|
451
|
+
label: expiresInLabel,
|
|
452
|
+
options: regenerateConfig.expiresInOptions,
|
|
453
|
+
value: selectedExpiresInOption,
|
|
454
|
+
className: classnames({
|
|
455
|
+
"w-1/2": isSelectedExpiresInOptionCustom,
|
|
456
|
+
"w-full": !isSelectedExpiresInOptionCustom
|
|
457
|
+
}),
|
|
458
|
+
onChange: setSelectedExpiresInOption
|
|
459
|
+
}), isSelectedExpiresInOptionCustom && /*#__PURE__*/jsx("div", {
|
|
460
|
+
className: "w-1/2",
|
|
461
|
+
"data-testid": "expires-on-date-picker",
|
|
462
|
+
children: /*#__PURE__*/jsx(DatePicker, {
|
|
463
|
+
disabledDate: function disabledDate(d) {
|
|
464
|
+
return !d || dayjs(d).isBefore(dayjs());
|
|
465
|
+
},
|
|
466
|
+
value: selectedExpiresOnDate,
|
|
467
|
+
label: t("neetoMolecules.shareViaLink.regenerateUrl.expiresOnLabel"),
|
|
468
|
+
onChange: setSelectedExpiresOnDate
|
|
469
|
+
})
|
|
470
|
+
})]
|
|
471
|
+
}), /*#__PURE__*/jsx(Typography, {
|
|
472
|
+
variant: "body2",
|
|
473
|
+
children: t("neetoMolecules.shareViaLink.regenerateUrl.description")
|
|
474
|
+
})]
|
|
475
|
+
})
|
|
476
|
+
}), /*#__PURE__*/jsxs(Dialog.Footer, {
|
|
477
|
+
className: "flex items-center gap-x-2",
|
|
478
|
+
children: [/*#__PURE__*/jsx(Button, {
|
|
479
|
+
"data-testid": "regenerate-url-confirm-button",
|
|
480
|
+
loading: isLoading,
|
|
481
|
+
disabled: regenerateStrategy === "expiryBased" && !isValidExpiryConfig,
|
|
482
|
+
label: t("neetoMolecules.shareViaLink.regenerateUrl.submitButtonLabel"),
|
|
483
|
+
onClick: onSubmit
|
|
484
|
+
}), /*#__PURE__*/jsx(Button, {
|
|
485
|
+
"data-testid": "regenerate-url-cancel-button",
|
|
486
|
+
variant: "ghost",
|
|
487
|
+
label: t("neetoMolecules.shareViaLink.regenerateUrl.cancelButtonLabel"),
|
|
488
|
+
onClick: onClose
|
|
489
|
+
})]
|
|
490
|
+
})]
|
|
491
|
+
});
|
|
492
|
+
};
|
|
493
|
+
|
|
494
|
+
var Link = function Link(_ref) {
|
|
495
|
+
var editUrlProps = _ref.editUrlProps,
|
|
496
|
+
enabledOptions = _ref.enabledOptions,
|
|
497
|
+
entityName = _ref.entityName,
|
|
498
|
+
handleEdit = _ref.handleEdit,
|
|
499
|
+
handleRegenerate = _ref.handleRegenerate,
|
|
500
|
+
isLoading = _ref.isLoading,
|
|
501
|
+
previewUrl = _ref.previewUrl,
|
|
502
|
+
url = _ref.url;
|
|
503
|
+
var _useState = useState(false),
|
|
504
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
505
|
+
isRegenerateURLModalOpen = _useState2[0],
|
|
506
|
+
setIsRegenerateURLModalOpen = _useState2[1];
|
|
507
|
+
var _useState3 = useState(false),
|
|
508
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
509
|
+
isEditURLModalOpen = _useState4[0],
|
|
510
|
+
setIsEditURLModalOpen = _useState4[1];
|
|
511
|
+
var _useTranslation = useTranslation(),
|
|
512
|
+
t = _useTranslation.t;
|
|
513
|
+
var _useBreakpoints = useBreakpoints(),
|
|
514
|
+
isSize = _useBreakpoints.isSize;
|
|
515
|
+
var isMobile = isSize("mobile");
|
|
516
|
+
var isDropdownEnabled = enabledOptions.regenerate || enabledOptions.edit;
|
|
517
|
+
return /*#__PURE__*/jsx("div", {
|
|
518
|
+
className: "flex flex-col gap-y-4",
|
|
519
|
+
"data-testid": "link-block",
|
|
520
|
+
children: /*#__PURE__*/jsxs("div", {
|
|
521
|
+
className: "flex items-center gap-1 sm:gap-2",
|
|
522
|
+
children: [/*#__PURE__*/jsxs("div", {
|
|
523
|
+
className: "relative flex min-w-0 flex-grow items-stretch truncate leading-none",
|
|
524
|
+
"data-testid": "nui-input-field",
|
|
525
|
+
children: [/*#__PURE__*/jsx("div", {
|
|
526
|
+
className: "border-border bg-muted relative flex min-w-0 flex-grow items-center truncate rounded-l-md rounded-r-none border leading-none rtl:rounded-l-none rtl:rounded-r-md",
|
|
527
|
+
children: /*#__PURE__*/jsx(Button, {
|
|
528
|
+
className: "relative min-w-0 flex-grow flex-row justify-start truncate px-2 py-1 leading-none",
|
|
529
|
+
href: url,
|
|
530
|
+
icon: Link$1,
|
|
531
|
+
iconPosition: "left",
|
|
532
|
+
label: url,
|
|
533
|
+
target: "_blank",
|
|
534
|
+
variant: "link"
|
|
535
|
+
})
|
|
536
|
+
}), /*#__PURE__*/jsx(CopyToClipboardButton, {
|
|
537
|
+
className: "rounded-l-none rtl:rounded-l-md rtl:rounded-r-none",
|
|
538
|
+
"data-testid": "link-copy-button",
|
|
539
|
+
label: !isMobile ? t("neetoMolecules.shareViaLink.copyLink") : null,
|
|
540
|
+
value: url
|
|
541
|
+
})]
|
|
542
|
+
}), /*#__PURE__*/jsxs("div", {
|
|
543
|
+
className: "flex flex-shrink-0 items-center gap-1 sm:gap-2",
|
|
544
|
+
children: [/*#__PURE__*/jsx(Button, {
|
|
545
|
+
"data-testid": "preview-button",
|
|
546
|
+
href: previewUrl || url,
|
|
547
|
+
icon: ExternalLink,
|
|
548
|
+
target: "_blank",
|
|
549
|
+
variant: "outline",
|
|
550
|
+
tooltipProps: {
|
|
551
|
+
content: t("neetoMolecules.shareViaLink.view", {
|
|
552
|
+
entity: entityName
|
|
553
|
+
}),
|
|
554
|
+
position: "top",
|
|
555
|
+
touch: ["hold", 500]
|
|
556
|
+
}
|
|
557
|
+
}), isDropdownEnabled && /*#__PURE__*/jsxs(Fragment, {
|
|
558
|
+
children: [/*#__PURE__*/jsx(MoreDropdown, {
|
|
559
|
+
menuItems: [{
|
|
560
|
+
isVisible: enabledOptions.regenerate || isPresent(enabledOptions.regenerate),
|
|
561
|
+
"data-testid": "regenerate-url-button",
|
|
562
|
+
onClick: function onClick() {
|
|
563
|
+
return setIsRegenerateURLModalOpen(true);
|
|
564
|
+
},
|
|
565
|
+
label: t("neetoMolecules.shareViaLink.regenerateUrl.title"),
|
|
566
|
+
key: "regenerate-url-option"
|
|
567
|
+
}, {
|
|
568
|
+
isVisible: enabledOptions.edit,
|
|
569
|
+
"data-testid": "edit-url-button",
|
|
570
|
+
onClick: function onClick() {
|
|
571
|
+
return setIsEditURLModalOpen(true);
|
|
572
|
+
},
|
|
573
|
+
label: t("neetoMolecules.shareViaLink.editUrl.title"),
|
|
574
|
+
key: "edit-url-option"
|
|
575
|
+
}]
|
|
576
|
+
}), /*#__PURE__*/jsx(RegenerateURL, {
|
|
577
|
+
handleRegenerate: handleRegenerate,
|
|
578
|
+
isLoading: isLoading,
|
|
579
|
+
url: url,
|
|
580
|
+
isOpen: isRegenerateURLModalOpen,
|
|
581
|
+
regenerateConfig: enabledOptions.regenerate,
|
|
582
|
+
onClose: function onClose() {
|
|
583
|
+
return setIsRegenerateURLModalOpen(false);
|
|
584
|
+
}
|
|
585
|
+
}), /*#__PURE__*/jsx(EditURL, {
|
|
586
|
+
editUrlProps: editUrlProps,
|
|
587
|
+
handleEdit: handleEdit,
|
|
588
|
+
isLoading: isLoading,
|
|
589
|
+
url: url,
|
|
590
|
+
isOpen: isEditURLModalOpen,
|
|
591
|
+
onClose: function onClose() {
|
|
592
|
+
return setIsEditURLModalOpen(false);
|
|
593
|
+
}
|
|
594
|
+
})]
|
|
595
|
+
})]
|
|
596
|
+
})]
|
|
597
|
+
})
|
|
598
|
+
});
|
|
599
|
+
};
|
|
600
|
+
|
|
601
|
+
var _excluded = ["title", "link", "description", "Icon", "onClick", "helpPopoverProps"];
|
|
602
|
+
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; }
|
|
603
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), true).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; }
|
|
604
|
+
var Card = function Card(_ref) {
|
|
605
|
+
var title = _ref.title,
|
|
606
|
+
link = _ref.link,
|
|
607
|
+
description = _ref.description,
|
|
608
|
+
Icon = _ref.Icon,
|
|
609
|
+
_ref$onClick = _ref.onClick,
|
|
610
|
+
onClick = _ref$onClick === void 0 ? noop : _ref$onClick,
|
|
611
|
+
helpPopoverProps = _ref.helpPopoverProps,
|
|
612
|
+
otherProps = _objectWithoutProperties(_ref, _excluded);
|
|
613
|
+
var Component = isPresent(link) ? Link$2 : "div";
|
|
614
|
+
return /*#__PURE__*/jsxs(Component, _objectSpread(_objectSpread({
|
|
615
|
+
onClick: onClick,
|
|
616
|
+
className: "border-border hover:border-primary flex cursor-pointer flex-col gap-3 rounded-lg border p-3 transition-all duration-300",
|
|
617
|
+
to: link
|
|
618
|
+
}, otherProps), {}, {
|
|
619
|
+
children: [/*#__PURE__*/jsxs("div", {
|
|
620
|
+
className: "flex items-center gap-2",
|
|
621
|
+
children: [Icon && /*#__PURE__*/jsx(Icon, {
|
|
622
|
+
className: "text-muted-foreground flex-shrink-0",
|
|
623
|
+
size: 24
|
|
624
|
+
}), /*#__PURE__*/jsxs(Typography, {
|
|
625
|
+
className: "min-w-0 flex-grow break-words",
|
|
626
|
+
"data-testid": "share-card-title",
|
|
627
|
+
variant: "h4",
|
|
628
|
+
children: [title, helpPopoverProps && /*#__PURE__*/jsxs(Fragment, {
|
|
629
|
+
children: [" ", /*#__PURE__*/jsx(HelpPopover, _objectSpread({}, helpPopoverProps))]
|
|
630
|
+
})]
|
|
631
|
+
})]
|
|
632
|
+
}), description && /*#__PURE__*/jsx(Typography, {
|
|
633
|
+
className: "break-words",
|
|
634
|
+
"data-testid": "share-card-description",
|
|
635
|
+
variant: "body2",
|
|
636
|
+
children: description
|
|
637
|
+
})]
|
|
638
|
+
}));
|
|
639
|
+
};
|
|
640
|
+
|
|
641
|
+
var ShareBlock = function ShareBlock(_ref) {
|
|
642
|
+
var moreOptions = _ref.moreOptions,
|
|
643
|
+
disableShareSocialMedia = _ref.disableShareSocialMedia,
|
|
644
|
+
disableQRDownload = _ref.disableQRDownload,
|
|
645
|
+
socialMediaProps = _ref.socialMediaProps,
|
|
646
|
+
qrCodeProps = _ref.qrCodeProps,
|
|
647
|
+
entity = _ref.entity,
|
|
648
|
+
urls = _ref.urls;
|
|
649
|
+
var location = useLocation();
|
|
650
|
+
var history = useHistory();
|
|
651
|
+
var _useTranslation = useTranslation(),
|
|
652
|
+
t = _useTranslation.t;
|
|
653
|
+
var handleNavigate = function handleNavigate(subPath) {
|
|
654
|
+
// eslint-disable-next-line @bigbinary/neeto/use-common-routes
|
|
655
|
+
history.push("".concat(location.pathname, "/").concat(subPath));
|
|
656
|
+
};
|
|
657
|
+
var hasMoreOptions = isPresent(moreOptions);
|
|
658
|
+
return /*#__PURE__*/jsxs("div", {
|
|
659
|
+
className: classnames("grid grid-cols-1 gap-4 sm:grid-cols-2 md:grid-cols-3", {
|
|
660
|
+
"border-border mt-8 border-t pt-8": isNotEmpty(urls)
|
|
661
|
+
}),
|
|
662
|
+
children: [hasMoreOptions && moreOptions.filter(function (_ref2) {
|
|
663
|
+
var permissions = _ref2.permissions;
|
|
664
|
+
return isNotPresent(permissions) || globalProps.permissions.some(includes(__, permissions));
|
|
665
|
+
}).map(function (_ref3) {
|
|
666
|
+
var title = _ref3.title,
|
|
667
|
+
link = _ref3.link,
|
|
668
|
+
Icon = _ref3.icon,
|
|
669
|
+
onClick = _ref3.onClick,
|
|
670
|
+
dataTestid = _ref3.dataTestid,
|
|
671
|
+
description = _ref3.description,
|
|
672
|
+
helpPopoverProps = _ref3.helpPopoverProps;
|
|
673
|
+
return /*#__PURE__*/createElement(Card, {
|
|
674
|
+
Icon: Icon,
|
|
675
|
+
description: description,
|
|
676
|
+
helpPopoverProps: helpPopoverProps,
|
|
677
|
+
link: link,
|
|
678
|
+
onClick: onClick,
|
|
679
|
+
title: title,
|
|
680
|
+
"data-testid": dataTestid,
|
|
681
|
+
key: link
|
|
682
|
+
});
|
|
683
|
+
}), !disableShareSocialMedia && /*#__PURE__*/jsx(Card, {
|
|
684
|
+
Icon: Share2,
|
|
685
|
+
"data-testid": "social-share-card",
|
|
686
|
+
description: (socialMediaProps === null || socialMediaProps === void 0 ? void 0 : socialMediaProps.cardDescription) || t("neetoMolecules.shareViaLink.socialMediaShare.description"),
|
|
687
|
+
title: (socialMediaProps === null || socialMediaProps === void 0 ? void 0 : socialMediaProps.cardTitle) || t("neetoMolecules.shareViaLink.socialMediaShare.title"),
|
|
688
|
+
onClick: function onClick() {
|
|
689
|
+
return handleNavigate("social-media");
|
|
690
|
+
}
|
|
691
|
+
}), !disableQRDownload && entity && /*#__PURE__*/jsx(Card, {
|
|
692
|
+
Icon: QrCode,
|
|
693
|
+
"data-testid": "qr-code-card",
|
|
694
|
+
description: (qrCodeProps === null || qrCodeProps === void 0 ? void 0 : qrCodeProps.cardDescription) || t("neetoMolecules.shareViaLink.qrCode.description"),
|
|
695
|
+
title: (qrCodeProps === null || qrCodeProps === void 0 ? void 0 : qrCodeProps.cardTitle) || t("neetoMolecules.shareViaLink.qrCode.title"),
|
|
696
|
+
onClick: function onClick() {
|
|
697
|
+
return handleNavigate("qrcode");
|
|
698
|
+
}
|
|
699
|
+
})]
|
|
700
|
+
});
|
|
701
|
+
};
|
|
702
|
+
|
|
703
|
+
var MainPanel = function MainPanel(_ref) {
|
|
704
|
+
var _urls$;
|
|
705
|
+
var title = _ref.title,
|
|
706
|
+
description = _ref.description,
|
|
707
|
+
qrCodeProps = _ref.qrCodeProps,
|
|
708
|
+
socialMediaProps = _ref.socialMediaProps,
|
|
709
|
+
_ref$isLoading = _ref.isLoading,
|
|
710
|
+
isLoading = _ref$isLoading === void 0 ? false : _ref$isLoading,
|
|
711
|
+
_ref$enabledOptions = _ref.enabledOptions,
|
|
712
|
+
enabledOptions = _ref$enabledOptions === void 0 ? {
|
|
713
|
+
regenerate: false,
|
|
714
|
+
edit: false
|
|
715
|
+
} : _ref$enabledOptions,
|
|
716
|
+
_ref$urls = _ref.urls,
|
|
717
|
+
urls = _ref$urls === void 0 ? [] : _ref$urls,
|
|
718
|
+
entity = _ref.entity,
|
|
719
|
+
entityName = _ref.entityName,
|
|
720
|
+
_ref$handleEdit = _ref.handleEdit,
|
|
721
|
+
handleEdit = _ref$handleEdit === void 0 ? noop : _ref$handleEdit,
|
|
722
|
+
_ref$handleRegenerate = _ref.handleRegenerate,
|
|
723
|
+
handleRegenerate = _ref$handleRegenerate === void 0 ? noop : _ref$handleRegenerate,
|
|
724
|
+
moreOptions = _ref.moreOptions,
|
|
725
|
+
_ref$disableShareSoci = _ref.disableShareSocialMedia,
|
|
726
|
+
disableShareSocialMedia = _ref$disableShareSoci === void 0 ? false : _ref$disableShareSoci,
|
|
727
|
+
_ref$disableQRDownloa = _ref.disableQRDownload,
|
|
728
|
+
disableQRDownload = _ref$disableQRDownloa === void 0 ? false : _ref$disableQRDownloa,
|
|
729
|
+
_ref$publicLinkExpiry = _ref.publicLinkExpiryConfiguration,
|
|
730
|
+
publicLinkExpiryConfiguration = _ref$publicLinkExpiry === void 0 ? {} : _ref$publicLinkExpiry,
|
|
731
|
+
customTopContent = _ref.customTopContent,
|
|
732
|
+
customBottomContent = _ref.customBottomContent;
|
|
733
|
+
var _useTranslation = useTranslation(),
|
|
734
|
+
t = _useTranslation.t;
|
|
735
|
+
var shouldShowShareBlock = !disableQRDownload || !disableShareSocialMedia || isPresent(moreOptions);
|
|
736
|
+
return /*#__PURE__*/jsx(Container, {
|
|
737
|
+
className: "bg-muted",
|
|
738
|
+
children: /*#__PURE__*/jsxs("div", {
|
|
739
|
+
className: "mx-auto w-full max-w-5xl py-10",
|
|
740
|
+
children: [customTopContent, /*#__PURE__*/jsx(Typography, {
|
|
741
|
+
"data-testid": "share-your-meeting-heading",
|
|
742
|
+
variant: "h2",
|
|
743
|
+
className: classnames({
|
|
744
|
+
"mb-2": isPresent(description),
|
|
745
|
+
"mb-6": !isPresent(description)
|
|
746
|
+
}),
|
|
747
|
+
children: title || t("neetoMolecules.shareViaLink.title", {
|
|
748
|
+
productName: globalProps.appName
|
|
749
|
+
})
|
|
750
|
+
}), description && /*#__PURE__*/jsx(Typography, {
|
|
751
|
+
className: "mb-6",
|
|
752
|
+
"data-testid": "share-your-meeting-heading",
|
|
753
|
+
variant: "body1",
|
|
754
|
+
children: description
|
|
755
|
+
}), /*#__PURE__*/jsxs("div", {
|
|
756
|
+
className: "bg-background rounded-lg p-6 sm:p-8",
|
|
757
|
+
"data-testid": "share-via-link",
|
|
758
|
+
children: [isNotEmpty(urls) && /*#__PURE__*/jsxs("div", {
|
|
759
|
+
className: "flex flex-col gap-y-1",
|
|
760
|
+
children: [/*#__PURE__*/jsx("div", {
|
|
761
|
+
className: "inline-flex max-w-full flex-col gap-y-4",
|
|
762
|
+
children: urls === null || urls === void 0 ? void 0 : urls.map(function (urlOption) {
|
|
763
|
+
return /*#__PURE__*/createElement(Link, {
|
|
764
|
+
enabledOptions: enabledOptions,
|
|
765
|
+
entityName: entityName,
|
|
766
|
+
handleEdit: handleEdit,
|
|
767
|
+
handleRegenerate: handleRegenerate,
|
|
768
|
+
isLoading: isLoading,
|
|
769
|
+
editUrlProps: omit(["url"], urlOption),
|
|
770
|
+
key: urlOption.url,
|
|
771
|
+
previewUrl: urlOption.previewUrl,
|
|
772
|
+
url: urlOption.url
|
|
773
|
+
});
|
|
774
|
+
})
|
|
775
|
+
}), isPresent(publicLinkExpiryConfiguration) && /*#__PURE__*/jsx(ExpiryNotice, {
|
|
776
|
+
expiryConfiguration: publicLinkExpiryConfiguration
|
|
777
|
+
})]
|
|
778
|
+
}), shouldShowShareBlock && /*#__PURE__*/jsx(ShareBlock, {
|
|
779
|
+
disableQRDownload: disableQRDownload,
|
|
780
|
+
disableShareSocialMedia: disableShareSocialMedia,
|
|
781
|
+
entity: entity,
|
|
782
|
+
moreOptions: moreOptions,
|
|
783
|
+
qrCodeProps: qrCodeProps,
|
|
784
|
+
socialMediaProps: socialMediaProps,
|
|
785
|
+
urls: urls,
|
|
786
|
+
url: (_urls$ = urls[0]) === null || _urls$ === void 0 ? void 0 : _urls$.url
|
|
787
|
+
})]
|
|
788
|
+
}), customBottomContent]
|
|
789
|
+
})
|
|
790
|
+
});
|
|
791
|
+
};
|
|
792
|
+
|
|
793
|
+
var QRCode = function QRCode(_ref) {
|
|
794
|
+
var entity = _ref.entity,
|
|
795
|
+
qrCodeProps = _ref.qrCodeProps,
|
|
796
|
+
url = _ref.url,
|
|
797
|
+
shareUrl = _ref.shareUrl;
|
|
798
|
+
var _useTranslation = useTranslation(),
|
|
799
|
+
t = _useTranslation.t;
|
|
800
|
+
if (!entity) return null;
|
|
801
|
+
var id = entity.id,
|
|
802
|
+
name = entity.name;
|
|
803
|
+
var canvasId = "qrcode-share-".concat(id);
|
|
804
|
+
var handleDownloadQRCode = function handleDownloadQRCode() {
|
|
805
|
+
var canvas = document.getElementById(canvasId);
|
|
806
|
+
if (canvas) downloadCanvas(canvas, {
|
|
807
|
+
name: slugify(name)
|
|
808
|
+
});
|
|
809
|
+
};
|
|
810
|
+
var handleCopyQRCode = function handleCopyQRCode() {
|
|
811
|
+
var canvas = document.getElementById(canvasId);
|
|
812
|
+
if (canvas) copyCanvasToClipboard(canvas, handleDownloadQRCode);
|
|
813
|
+
};
|
|
814
|
+
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");
|
|
815
|
+
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");
|
|
816
|
+
return /*#__PURE__*/jsxs(Container, {
|
|
817
|
+
className: "py-8",
|
|
818
|
+
children: [/*#__PURE__*/jsx(Button, {
|
|
819
|
+
className: "mb-4",
|
|
820
|
+
"data-testid": "back-button",
|
|
821
|
+
icon: ArrowLeft,
|
|
822
|
+
iconPosition: "left",
|
|
823
|
+
label: t("neetoMolecules.productEmbed.backToShare"),
|
|
824
|
+
size: "sm",
|
|
825
|
+
to: shareUrl,
|
|
826
|
+
variant: "link"
|
|
827
|
+
}), /*#__PURE__*/jsx(Header, {
|
|
828
|
+
className: "py-0",
|
|
829
|
+
title: t("neetoMolecules.shareViaLink.qrCode.title")
|
|
830
|
+
}), /*#__PURE__*/jsx(CardLayout, {
|
|
831
|
+
description: description,
|
|
832
|
+
title: title,
|
|
833
|
+
actionBlock: /*#__PURE__*/jsxs("div", {
|
|
834
|
+
className: "flex flex-wrap items-center gap-3",
|
|
835
|
+
children: [/*#__PURE__*/jsx(Button, {
|
|
836
|
+
"data-testid": "qr-code-download-button",
|
|
837
|
+
label: t("neetoMolecules.shareViaLink.qrCode.download"),
|
|
838
|
+
onClick: handleDownloadQRCode
|
|
839
|
+
}), /*#__PURE__*/jsx(CopyToClipboardButton, {
|
|
840
|
+
"data-testid": "qr-code-copy-button",
|
|
841
|
+
label: t("neetoMolecules.shareViaLink.qrCode.copy"),
|
|
842
|
+
variant: "outline",
|
|
843
|
+
onClick: handleCopyQRCode
|
|
844
|
+
})]
|
|
845
|
+
}),
|
|
846
|
+
children: /*#__PURE__*/jsx(QRCodeCanvas, {
|
|
847
|
+
className: "mt-6 cursor-pointer",
|
|
848
|
+
"data-testid": "qr-code-image",
|
|
849
|
+
id: canvasId,
|
|
850
|
+
size: 160,
|
|
851
|
+
style: {
|
|
852
|
+
width: 160,
|
|
853
|
+
height: 160
|
|
854
|
+
},
|
|
855
|
+
value: url,
|
|
856
|
+
onClick: handleDownloadQRCode
|
|
857
|
+
})
|
|
858
|
+
})]
|
|
859
|
+
});
|
|
860
|
+
};
|
|
861
|
+
|
|
862
|
+
var SocialMedia = function SocialMedia(_ref) {
|
|
863
|
+
var socialMediaProps = _ref.socialMediaProps,
|
|
864
|
+
url = _ref.url,
|
|
865
|
+
shareUrl = _ref.shareUrl;
|
|
866
|
+
var _useTranslation = useTranslation(),
|
|
867
|
+
t = _useTranslation.t;
|
|
868
|
+
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");
|
|
869
|
+
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");
|
|
870
|
+
return /*#__PURE__*/jsxs(Container, {
|
|
871
|
+
className: "py-8",
|
|
872
|
+
children: [/*#__PURE__*/jsx(Button, {
|
|
873
|
+
className: "mb-4",
|
|
874
|
+
"data-testid": "back-button",
|
|
875
|
+
icon: ArrowLeft,
|
|
876
|
+
iconPosition: "left",
|
|
877
|
+
label: t("neetoMolecules.productEmbed.backToShare"),
|
|
878
|
+
size: "sm",
|
|
879
|
+
to: shareUrl,
|
|
880
|
+
variant: "link"
|
|
881
|
+
}), /*#__PURE__*/jsx(Header, {
|
|
882
|
+
className: "py-0",
|
|
883
|
+
title: t("neetoMolecules.shareViaLink.socialMediaShare.title")
|
|
884
|
+
}), /*#__PURE__*/jsx(CardLayout, {
|
|
885
|
+
description: description,
|
|
886
|
+
title: title,
|
|
887
|
+
actionBlock: /*#__PURE__*/jsx("div", {
|
|
888
|
+
className: "flex flex-wrap items-center gap-3",
|
|
889
|
+
children: Object.entries(SOCIAL_MEDIA_OPTIONS).map(function (_ref2) {
|
|
890
|
+
var _ref3 = _slicedToArray(_ref2, 2),
|
|
891
|
+
key = _ref3[0],
|
|
892
|
+
_ref3$ = _ref3[1],
|
|
893
|
+
label = _ref3$.label,
|
|
894
|
+
Icon = _ref3$.icon,
|
|
895
|
+
generateShareUrl = _ref3$.generateShareUrl;
|
|
896
|
+
return /*#__PURE__*/createElement(Button, {
|
|
897
|
+
label: label,
|
|
898
|
+
"data-testid": "social-media-button-".concat(key),
|
|
899
|
+
icon: Icon,
|
|
900
|
+
iconPosition: "right",
|
|
901
|
+
key: key,
|
|
902
|
+
rel: "noopener noreferrer",
|
|
903
|
+
target: "_blank",
|
|
904
|
+
variant: "outline",
|
|
905
|
+
href: generateShareUrl({
|
|
906
|
+
url: url,
|
|
907
|
+
title: socialMediaProps === null || socialMediaProps === void 0 ? void 0 : socialMediaProps.postTitle
|
|
908
|
+
})
|
|
909
|
+
});
|
|
910
|
+
})
|
|
911
|
+
})
|
|
912
|
+
})]
|
|
913
|
+
});
|
|
914
|
+
};
|
|
915
|
+
|
|
916
|
+
/* eslint-disable @bigbinary/neeto/use-common-routes */
|
|
917
|
+
var ShareViaLink = function ShareViaLink(_ref) {
|
|
918
|
+
var title = _ref.title,
|
|
919
|
+
description = _ref.description,
|
|
920
|
+
_ref$isLoading = _ref.isLoading,
|
|
921
|
+
isLoading = _ref$isLoading === void 0 ? false : _ref$isLoading,
|
|
922
|
+
_ref$enabledOptions = _ref.enabledOptions,
|
|
923
|
+
enabledOptions = _ref$enabledOptions === void 0 ? {
|
|
924
|
+
regenerate: false,
|
|
925
|
+
edit: false
|
|
926
|
+
} : _ref$enabledOptions,
|
|
927
|
+
_ref$urls = _ref.urls,
|
|
928
|
+
urls = _ref$urls === void 0 ? [] : _ref$urls,
|
|
929
|
+
entity = _ref.entity,
|
|
930
|
+
entityName = _ref.entityName,
|
|
931
|
+
_ref$handleEdit = _ref.handleEdit,
|
|
932
|
+
handleEdit = _ref$handleEdit === void 0 ? noop : _ref$handleEdit,
|
|
933
|
+
_ref$handleRegenerate = _ref.handleRegenerate,
|
|
934
|
+
handleRegenerate = _ref$handleRegenerate === void 0 ? noop : _ref$handleRegenerate,
|
|
935
|
+
_ref$disableShareSoci = _ref.disableShareSocialMedia,
|
|
936
|
+
disableShareSocialMedia = _ref$disableShareSoci === void 0 ? false : _ref$disableShareSoci,
|
|
937
|
+
_ref$disableQRDownloa = _ref.disableQRDownload,
|
|
938
|
+
disableQRDownload = _ref$disableQRDownloa === void 0 ? false : _ref$disableQRDownloa,
|
|
939
|
+
socialMediaProps = _ref.socialMediaProps,
|
|
940
|
+
qrCodeProps = _ref.qrCodeProps,
|
|
941
|
+
moreOptions = _ref.moreOptions,
|
|
942
|
+
_ref$publicLinkExpiry = _ref.publicLinkExpiryConfiguration,
|
|
943
|
+
publicLinkExpiryConfiguration = _ref$publicLinkExpiry === void 0 ? {} : _ref$publicLinkExpiry,
|
|
944
|
+
customTopContent = _ref.customTopContent,
|
|
945
|
+
customBottomContent = _ref.customBottomContent;
|
|
946
|
+
var _useRouteMatch = useRouteMatch(),
|
|
947
|
+
sharePath = _useRouteMatch.path,
|
|
948
|
+
shareUrl = _useRouteMatch.url;
|
|
949
|
+
return /*#__PURE__*/jsxs(Switch, {
|
|
950
|
+
children: [/*#__PURE__*/jsx(Route, {
|
|
951
|
+
exact: true,
|
|
952
|
+
path: sharePath,
|
|
953
|
+
render: function render() {
|
|
954
|
+
return /*#__PURE__*/jsx(MainPanel, {
|
|
955
|
+
customBottomContent: customBottomContent,
|
|
956
|
+
customTopContent: customTopContent,
|
|
957
|
+
description: description,
|
|
958
|
+
disableQRDownload: disableQRDownload,
|
|
959
|
+
disableShareSocialMedia: disableShareSocialMedia,
|
|
960
|
+
enabledOptions: enabledOptions,
|
|
961
|
+
entity: entity,
|
|
962
|
+
entityName: entityName,
|
|
963
|
+
handleEdit: handleEdit,
|
|
964
|
+
handleRegenerate: handleRegenerate,
|
|
965
|
+
isLoading: isLoading,
|
|
966
|
+
moreOptions: moreOptions,
|
|
967
|
+
publicLinkExpiryConfiguration: publicLinkExpiryConfiguration,
|
|
968
|
+
qrCodeProps: qrCodeProps,
|
|
969
|
+
socialMediaProps: socialMediaProps,
|
|
970
|
+
title: title,
|
|
971
|
+
urls: urls
|
|
972
|
+
});
|
|
973
|
+
}
|
|
974
|
+
}), /*#__PURE__*/jsx(Route, {
|
|
975
|
+
exact: true,
|
|
976
|
+
path: "".concat(sharePath, "/qrcode"),
|
|
977
|
+
render: function render() {
|
|
978
|
+
var _urls$;
|
|
979
|
+
return /*#__PURE__*/jsx(QRCode, {
|
|
980
|
+
entity: entity,
|
|
981
|
+
qrCodeProps: qrCodeProps,
|
|
982
|
+
shareUrl: shareUrl,
|
|
983
|
+
url: (_urls$ = urls[0]) === null || _urls$ === void 0 ? void 0 : _urls$.url
|
|
984
|
+
});
|
|
985
|
+
}
|
|
986
|
+
}), /*#__PURE__*/jsx(Route, {
|
|
987
|
+
exact: true,
|
|
988
|
+
path: "".concat(sharePath, "/social-media"),
|
|
989
|
+
render: function render() {
|
|
990
|
+
var _urls$2;
|
|
991
|
+
return /*#__PURE__*/jsx(SocialMedia, {
|
|
992
|
+
shareUrl: shareUrl,
|
|
993
|
+
socialMediaProps: socialMediaProps,
|
|
994
|
+
url: (_urls$2 = urls[0]) === null || _urls$2 === void 0 ? void 0 : _urls$2.url
|
|
995
|
+
});
|
|
996
|
+
}
|
|
997
|
+
}), isPresent(moreOptions) && moreOptions.map(function (_ref2) {
|
|
998
|
+
var link = _ref2.link,
|
|
999
|
+
element = _ref2.element,
|
|
1000
|
+
path = _ref2.path,
|
|
1001
|
+
permissions = _ref2.permissions;
|
|
1002
|
+
if (!link && !path) return null;
|
|
1003
|
+
return /*#__PURE__*/createElement(PrivateRoute, {
|
|
1004
|
+
permissions: permissions,
|
|
1005
|
+
exact: true,
|
|
1006
|
+
key: link,
|
|
1007
|
+
path: path || link,
|
|
1008
|
+
render: function render() {
|
|
1009
|
+
return element;
|
|
1010
|
+
}
|
|
1011
|
+
});
|
|
1012
|
+
}), /*#__PURE__*/jsx(Route, {
|
|
1013
|
+
component: ErrorPage,
|
|
1014
|
+
path: "*"
|
|
1015
|
+
})]
|
|
1016
|
+
});
|
|
1017
|
+
};
|
|
1018
|
+
|
|
1019
|
+
export { ShareViaLink as default };
|
|
1020
|
+
//# sourceMappingURL=ShareViaLink.js.map
|