utopia-ui 3.0.17 → 3.0.19
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,5 +1,6 @@
|
|
1
1
|
import { Item } from '../../../types';
|
2
|
-
export declare const GroupSubHeaderView: ({ item, shareBaseUrl, }: {
|
2
|
+
export declare const GroupSubHeaderView: ({ item, shareBaseUrl, platforms, }: {
|
3
3
|
item: Item;
|
4
4
|
shareBaseUrl: string;
|
5
|
+
platforms?: string[] | undefined;
|
5
6
|
}) => import("react/jsx-runtime").JSX.Element;
|
package/dist/index.js
CHANGED
@@ -4892,10 +4892,15 @@ var platformConfigs = {
|
|
4892
4892
|
icon: (jsx("svg", __assign({ xmlns: 'http://www.w3.org/2000/svg', viewBox: '0 0 24 24', fill: 'white' }, { children: jsx("path", { d: 'M18.188 0c-.517 0-.741.325-.927.66 0 0-7.455 13.224-7.702 13.657.015.024 4.919 9.023 4.919 9.023.17.308.436.66.967.66h3.454c.211 0 .375-.078.463-.22.089-.151.089-.346-.009-.536l-4.879-8.916c-.004-.006-.004-.016 0-.022L22.139.756c.095-.191.097-.387.006-.535C22.056.078 21.894 0 21.686 0h-3.498zM3.648 4.74c-.211 0-.385.074-.473.216-.09.149-.078.339.02.531l2.34 4.05c.004.01.004.016 0 .021L1.86 16.051c-.099.188-.093.381 0 .529.085.142.239.234.45.234h3.461c.518 0 .766-.348.945-.667l3.734-6.609-2.378-4.155c-.172-.315-.434-.659-.962-.659H3.648v.016z' }) }))),
|
4893
4893
|
bgColor: '#026466',
|
4894
4894
|
},
|
4895
|
-
|
4896
|
-
shareUrl: '
|
4897
|
-
icon: (jsx("svg", __assign({
|
4898
|
-
bgColor: '#
|
4895
|
+
whatsapp: {
|
4896
|
+
shareUrl: 'https://api.whatsapp.com/send?text={title}%20{url}',
|
4897
|
+
icon: (jsx("svg", __assign({ stroke: 'currentColor', fill: 'currentColor', strokeWidth: '0', viewBox: '0 0 512 512', xmlns: 'http://www.w3.org/2000/svg' }, { children: jsx("path", { d: 'M497.39 361.8l-112-48a24 24 0 0 0-28 6.9l-49.6 60.6A370.66 370.66 0 0 1 130.6 204.11l60.6-49.6a23.94 23.94 0 0 0 6.9-28l-48-112A24.16 24.16 0 0 0 122.6.61l-104 24A24 24 0 0 0 0 48c0 256.5 207.9 464 464 464a24 24 0 0 0 23.4-18.6l24-104a24.29 24.29 0 0 0-14.01-27.6z' }) }))),
|
4898
|
+
bgColor: '#25D366',
|
4899
|
+
},
|
4900
|
+
telegram: {
|
4901
|
+
shareUrl: 'https://t.me/share/url?url={url}&text={title}',
|
4902
|
+
icon: (jsx("svg", __assign({ stroke: 'white', fill: 'white', strokeWidth: '0', viewBox: '0 0 448 512', xmlns: 'http://www.w3.org/2000/svg' }, { children: jsx("path", { d: 'M446.7 98.6l-67.6 318.8c-5.1 22.5-18.4 28.1-37.3 17.5l-103-75.9-49.7 47.8c-5.5 5.5-10.1 10.1-20.7 10.1l7.4-104.9 190.9-172.5c8.3-7.4-1.8-11.5-12.9-4.1L117.8 284 16.2 252.2c-22.1-6.9-22.5-22.1 4.6-32.7L418.2 66.4c18.4-6.9 34.5 4.1 28.5 32.2z' }) }))),
|
4903
|
+
bgColor: '#0088cc',
|
4899
4904
|
},
|
4900
4905
|
};
|
4901
4906
|
// eslint-disable-next-line react/prop-types
|
@@ -4912,7 +4917,7 @@ var SocialShareButton = function (_a) {
|
|
4912
4917
|
return (jsx("a", __assign({ href: finalShareUrl, target: '_blank', rel: 'noopener noreferrer', className: 'tw-w-8 tw-h-8 tw-mt-2 tw-rounded-full tw-flex tw-items-center tw-justify-center tw-text-white', style: {
|
4913
4918
|
color: 'white',
|
4914
4919
|
backgroundColor: bgColor,
|
4915
|
-
} }, { children: React.cloneElement(icon, { className: 'tw-w-4 tw-h-4 tw-fill-current' }) })));
|
4920
|
+
}, title: "share link on ".concat(platform) }, { children: React.cloneElement(icon, { className: 'tw-w-4 tw-h-4 tw-fill-current' }) })));
|
4916
4921
|
};
|
4917
4922
|
|
4918
4923
|
var SocialShareBar = function (_a) {
|
@@ -4925,14 +4930,30 @@ var SocialShareBar = function (_a) {
|
|
4925
4930
|
_b = _a.platforms,
|
4926
4931
|
// eslint-disable-next-line react/prop-types
|
4927
4932
|
platforms = _b === void 0 ? ['facebook', 'twitter', 'linkedin', 'xing', 'email'] : _b;
|
4928
|
-
|
4933
|
+
var copyLink = function () {
|
4934
|
+
navigator.clipboard
|
4935
|
+
.writeText(url)
|
4936
|
+
.then(function () {
|
4937
|
+
toast.success('link copied to clipboard');
|
4938
|
+
})
|
4939
|
+
.catch(function (error) {
|
4940
|
+
toast.error('Fehler beim Kopieren des Links: ', error);
|
4941
|
+
});
|
4942
|
+
};
|
4943
|
+
return (jsxs("div", __assign({ className: 'tw-flex tw-place-content-end tw-justify-end tw-space-x-2 tw-grow tw-min-w-fit tw-pl-2' }, { children: [platforms.map(function (platform) { return (jsx(SocialShareButton, { platform: platform, url: url, title: title }, platform)); }), platforms.includes('email') && (jsx("a", __assign({ href: "mailto:?subject=".concat(title, "&body=").concat(url), target: '_blank', rel: 'noopener noreferrer', className: 'tw-w-8 tw-h-8 tw-mt-2 tw-rounded-full tw-flex tw-items-center tw-justify-center tw-text-white hover:tw-cursor-pointer', style: {
|
4944
|
+
color: 'white',
|
4945
|
+
backgroundColor: '#444',
|
4946
|
+
}, onClick: function () { return copyLink(); }, title: 'share link via email' }, { children: jsx("svg", __assign({ xmlns: 'http://www.w3.org/2000/svg', viewBox: '0 0 24 24', fill: 'white', className: 'tw-h-4 tw-w-4' }, { children: jsx("path", { d: 'M20 4H4c-1.1 0-1.99.9-1.99 2L2 18c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zm0 4l-8 5-8-5V6l8 5 8-5v2z' }) })) }))), platforms.includes('clipboard') && (jsx("div", __assign({ rel: 'noopener noreferrer', className: 'tw-w-8 tw-h-8 tw-mt-2 tw-rounded-full tw-flex tw-items-center tw-justify-center tw-text-white hover:tw-cursor-pointer', style: {
|
4947
|
+
color: 'white',
|
4948
|
+
backgroundColor: '#888',
|
4949
|
+
}, onClick: function () { return copyLink(); }, title: 'copy Link' }, { children: jsx("svg", __assign({ stroke: 'currentColor', fill: 'currentColor', strokeWidth: '0', viewBox: '0 0 256 256', height: '1.5em', width: '1.5em', xmlns: 'http://www.w3.org/2000/svg' }, { children: jsx("path", { d: 'M180,64H40A12,12,0,0,0,28,76V216a12,12,0,0,0,12,12H180a12,12,0,0,0,12-12V76A12,12,0,0,0,180,64ZM168,204H52V88H168ZM228,40V180a12,12,0,0,1-24,0V52H76a12,12,0,0,1,0-24H216A12,12,0,0,1,228,40Z' }) })) })))] })));
|
4929
4950
|
};
|
4930
4951
|
|
4931
4952
|
var GroupSubHeaderView = function (_a) {
|
4932
|
-
var item = _a.item, shareBaseUrl = _a.shareBaseUrl;
|
4953
|
+
var item = _a.item, shareBaseUrl = _a.shareBaseUrl, platforms = _a.platforms;
|
4933
4954
|
return (jsxs("div", __assign({ className: 'tw-px-6' }, { children: [jsxs("div", __assign({ className: 'tw-float-left tw-mt-2 tw-mb-4 tw-flex tw-items-center' }, { children: [item.status && (jsx("div", __assign({ className: 'tw-mt-1.5' }, { children: jsx("span", __assign({ className: 'tw-text-sm tw-text-current tw-bg-base-300 tw-rounded tw-py-0.5 tw-px-2 tw-inline-flex tw-items-center tw-mr-2' }, { children: item.status })) }))), item.group_type && (jsx("div", __assign({ className: 'tw-mt-1.5' }, { children: jsx("span", __assign({ className: 'tw-text-sm tw-text-current tw-bg-base-300 tw-rounded tw-py-1 tw-px-2' }, { children: item.group_type })) })))] })), jsx("div", { children: jsx(SocialShareBar, { url: shareBaseUrl && item.slug
|
4934
4955
|
? shareBaseUrl + item.slug
|
4935
|
-
: window.location.protocol + '//' + window.location.host + '/item/' + item.id, title: item.name }) })] })));
|
4956
|
+
: window.location.protocol + '//' + window.location.host + '/item/' + item.id, title: item.name, platforms: platforms }) })] })));
|
4936
4957
|
};
|
4937
4958
|
|
4938
4959
|
var OnepagerView = function (_a) {
|
@@ -5352,7 +5373,7 @@ var GroupSubheaderForm = function (_a) {
|
|
5352
5373
|
|
5353
5374
|
var ContactInfoForm = function (_a) {
|
5354
5375
|
var state = _a.state, setState = _a.setState;
|
5355
|
-
return (jsxs("div", __assign({ className: 'tw-mt-4 tw-space-y-4' }, { children: [jsxs("div", { children: [jsx("label", __assign({ htmlFor: 'email', className: 'tw-block tw-text-sm tw-font-medium tw-text-gray-500 tw-mb-1' }, { children: "Email-Adresse (Kontakt):" })), jsx(TextInput, { placeholder: 'Email', defaultValue: state.contact, updateFormValue: function (v) {
|
5376
|
+
return (jsxs("div", __assign({ className: 'tw-mt-4 tw-space-y-4' }, { children: [jsxs("div", { children: [jsx("label", __assign({ htmlFor: 'email', className: 'tw-block tw-text-sm tw-font-medium tw-text-gray-500 tw-mb-1' }, { children: "Email-Adresse (Kontakt):" })), jsx(TextInput, { placeholder: 'Email', type: 'email', defaultValue: state.contact, updateFormValue: function (v) {
|
5356
5377
|
return setState(function (prevState) { return (__assign(__assign({}, prevState), { contact: v })); });
|
5357
5378
|
} })] }), jsxs("div", { children: [jsx("label", __assign({ htmlFor: 'telephone', className: 'tw-block tw-text-sm tw-font-medium tw-text-gray-500 tw-mb-1' }, { children: "Telefonnummer (Kontakt):" })), jsx(TextInput, { placeholder: 'Telefonnummer', defaultValue: state.telephone, updateFormValue: function (v) {
|
5358
5379
|
return setState(function (prevState) { return (__assign(__assign({}, prevState), { telephone: v })); });
|