@plone/volto 15.5.0 → 15.6.0
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/CHANGELOG.md +10 -0
- package/dist/assets.json +1 -1
- package/dist/chunks.json +3 -3
- package/dist/loadable-stats.json +18 -18
- package/dist/public/static/css/{client.d1eef743.chunk.css → client.936795fd.chunk.css} +2 -2
- package/dist/public/static/js/client.936795fd.chunk.js +2 -0
- package/dist/server.js +1 -1
- package/package.json +1 -1
- package/src/components/manage/AnchorPlugin/components/LinkButton/AddLinkForm.jsx +5 -13
- package/src/components/manage/Blocks/Image/View.jsx +9 -20
- package/src/components/manage/Blocks/Image/View.test.jsx +27 -7
- package/src/components/manage/Blocks/LeadImage/View.jsx +9 -24
- package/src/components/manage/UniversalLink/UniversalLink.jsx +9 -1
- package/src/components/manage/Widgets/UrlWidget.jsx +4 -9
- package/src/components/theme/Footer/Footer.jsx +11 -10
- package/src/components/theme/Logo/Logo.jsx +4 -5
- package/src/components/theme/Search/Search.jsx +6 -6
- package/src/components/theme/View/AlbumView.jsx +19 -17
- package/src/components/theme/View/LinkView.jsx +5 -38
- package/src/components/theme/View/LinkView.test.jsx +26 -10
- package/src/components/theme/View/ListingView.jsx +9 -8
- package/src/components/theme/View/SummaryView.jsx +13 -12
- package/src/components/theme/View/TabularView.jsx +4 -4
- package/src/helpers/Url/Url.js +28 -0
- package/theme/themes/pastanaga/extras/main.less +1 -0
- package/theme/themes/pastanaga/extras/views.less +5 -0
- package/dist/public/static/js/client.d1eef743.chunk.js +0 -2
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
|
|
6
6
|
import React from 'react';
|
|
7
7
|
import PropTypes from 'prop-types';
|
|
8
|
-
import {
|
|
8
|
+
import { UniversalLink } from '@plone/volto/components';
|
|
9
9
|
import { Container, Table } from 'semantic-ui-react';
|
|
10
10
|
import { FormattedMessage } from 'react-intl';
|
|
11
11
|
|
|
@@ -49,13 +49,13 @@ const TabularView = ({ content }) => (
|
|
|
49
49
|
{content.items.map((item) => (
|
|
50
50
|
<Table.Row key={item.url}>
|
|
51
51
|
<Table.Cell>
|
|
52
|
-
<
|
|
53
|
-
|
|
52
|
+
<UniversalLink
|
|
53
|
+
item={item}
|
|
54
54
|
className="summary url"
|
|
55
55
|
title={item['@type']}
|
|
56
56
|
>
|
|
57
57
|
{item.title}
|
|
58
|
-
</
|
|
58
|
+
</UniversalLink>
|
|
59
59
|
</Table.Cell>
|
|
60
60
|
<Table.Cell>{item.description}</Table.Cell>
|
|
61
61
|
<Table.Cell>{item['@type']}</Table.Cell>
|
package/src/helpers/Url/Url.js
CHANGED
|
@@ -246,6 +246,33 @@ export function normalizeTelephone(tel) {
|
|
|
246
246
|
return `tel:${tel}`;
|
|
247
247
|
}
|
|
248
248
|
|
|
249
|
+
export function checkAndNormalizeUrl(url) {
|
|
250
|
+
let res = {
|
|
251
|
+
isMail: false,
|
|
252
|
+
isTelephone: false,
|
|
253
|
+
url: url,
|
|
254
|
+
isValid: true,
|
|
255
|
+
};
|
|
256
|
+
if (URLUtils.isMail(URLUtils.normaliseMail(url))) {
|
|
257
|
+
//Mail
|
|
258
|
+
res.isMail = true;
|
|
259
|
+
res.url = URLUtils.normaliseMail(url);
|
|
260
|
+
} else if (URLUtils.isTelephone(url)) {
|
|
261
|
+
//Phone
|
|
262
|
+
res.isTelephone = true;
|
|
263
|
+
res.url = URLUtils.normalizeTelephone(url);
|
|
264
|
+
} else {
|
|
265
|
+
//url
|
|
266
|
+
if (!res.url.startsWith('/') && !res.url.startsWith('#')) {
|
|
267
|
+
res.url = URLUtils.normalizeUrl(url);
|
|
268
|
+
if (!URLUtils.isUrl(res.url)) {
|
|
269
|
+
res.isValid = false;
|
|
270
|
+
}
|
|
271
|
+
}
|
|
272
|
+
}
|
|
273
|
+
return res;
|
|
274
|
+
}
|
|
275
|
+
|
|
249
276
|
export const URLUtils = {
|
|
250
277
|
normalizeTelephone,
|
|
251
278
|
normaliseMail,
|
|
@@ -253,4 +280,5 @@ export const URLUtils = {
|
|
|
253
280
|
isTelephone,
|
|
254
281
|
isMail,
|
|
255
282
|
isUrl,
|
|
283
|
+
checkAndNormalizeUrl,
|
|
256
284
|
};
|