design-comuni-plone-theme 8.3.2 → 8.4.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 +32 -0
- package/locales/de/LC_MESSAGES/volto.po +31 -16
- package/locales/en/LC_MESSAGES/volto.po +36 -21
- package/locales/es/LC_MESSAGES/volto.po +31 -16
- package/locales/fr/LC_MESSAGES/volto.po +31 -16
- package/locales/it/LC_MESSAGES/volto.po +32 -17
- package/locales/volto.pot +32 -17
- package/package.json +1 -1
- package/publiccode.yml +2 -2
- package/src/components/ItaliaTheme/Blocks/Listing/Commons/utils.js +63 -0
- package/src/components/ItaliaTheme/Blocks/Listing/SliderTemplate.jsx +235 -65
- package/src/components/ItaliaTheme/Breadcrumbs/Breadcrumbs.jsx +2 -2
- package/src/components/ItaliaTheme/CustomerSatisfaction/FeedbackForm.jsx +11 -7
- package/src/components/ItaliaTheme/Footer/FooterPNRRLogo.jsx +2 -2
- package/src/components/ItaliaTheme/Footer/logo-eu-inverted.svg +1 -17
- package/src/components/ItaliaTheme/Header/HeaderSearch/SearchModal.jsx +38 -11
- package/src/components/ItaliaTheme/Search/Search.jsx +7 -3
- package/src/components/ItaliaTheme/Search/utils.js +5 -3
- package/src/components/ItaliaTheme/Unauthorized/Unauthorized.jsx +3 -1
- package/src/components/ItaliaTheme/View/PersonaView/PersonaRuolo.jsx +108 -8
- package/src/components/ItaliaTheme/manage/Widgets/SubFooterConfigurationForm.jsx +1 -0
- package/src/customizations/volto/components/manage/Blocks/ToC/View.jsx +2 -0
- package/src/customizations/volto/components/manage/Blocks/ToC/variations/DefaultTocRenderer.jsx +99 -0
- package/src/customizations/volto/components/theme/Breadcrumbs/Breadcrumbs.jsx +3 -3
- package/src/customizations/volto/components/theme/View/View.jsx +308 -0
- package/src/customizations/volto/helpers/Api/Api.jsx +131 -0
- package/src/customizations/volto/middleware/api.js +362 -0
- package/src/customizations/volto/middleware/blacklistRoutes.js +47 -0
- package/src/theme/ItaliaTheme/Blocks/_imageBlock.scss +4 -0
- package/src/theme/ItaliaTheme/Blocks/_sliderTemplate.scss +18 -4
- package/src/theme/ItaliaTheme/Components/_search.scss +6 -0
- package/src/theme/ItaliaTheme/_common.scss +15 -0
- package/src/theme/ItaliaTheme/_css_variables.scss +3 -0
- package/src/theme/_cms-ui.scss +9 -0
- package/src/theme/bootstrap-override/bootstrap-italia/_footer.scss +3 -3
- package/src/theme/extras/_search.scss +31 -0
- package/src/theme/site.scss +1 -0
package/locales/volto.pot
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
msgid ""
|
|
2
2
|
msgstr ""
|
|
3
3
|
"Project-Id-Version: Plone\n"
|
|
4
|
-
"POT-Creation-Date: 2023-
|
|
4
|
+
"POT-Creation-Date: 2023-08-24T08:14:25.576Z\n"
|
|
5
5
|
"Last-Translator: Plone i18n <plone-i18n@lists.sourceforge.net>\n"
|
|
6
6
|
"Language-Team: Plone i18n <plone-i18n@lists.sourceforge.net>\n"
|
|
7
7
|
"MIME-Version: 1.0\n"
|
|
@@ -291,11 +291,6 @@ msgstr ""
|
|
|
291
291
|
msgid "Icons placeholder"
|
|
292
292
|
msgstr ""
|
|
293
293
|
|
|
294
|
-
#: components/ItaliaTheme/Unauthorized/Unauthorized
|
|
295
|
-
# defaultMessage: If you are certain you have the correct web address but are encountering an error, please contact the {site_admin}.
|
|
296
|
-
msgid "If you are certain you have the correct web address but are encountering an error, please contact the {site_admin}."
|
|
297
|
-
msgstr ""
|
|
298
|
-
|
|
299
294
|
#: components/ItaliaTheme/Blocks/Alert/Sidebar
|
|
300
295
|
# defaultMessage: Immagine
|
|
301
296
|
msgid "Image"
|
|
@@ -570,11 +565,6 @@ msgstr ""
|
|
|
570
565
|
msgid "Show all content types"
|
|
571
566
|
msgstr ""
|
|
572
567
|
|
|
573
|
-
#: components/ItaliaTheme/Unauthorized/Unauthorized
|
|
574
|
-
# defaultMessage: Site Administration
|
|
575
|
-
msgid "Site Administration"
|
|
576
|
-
msgstr ""
|
|
577
|
-
|
|
578
568
|
#: components/ItaliaTheme/Search/Search
|
|
579
569
|
# defaultMessage: Sono occorsi degli errori
|
|
580
570
|
msgid "Sono occorsi degli errori"
|
|
@@ -689,7 +679,6 @@ msgid "Vedi"
|
|
|
689
679
|
msgstr ""
|
|
690
680
|
|
|
691
681
|
#: components/ItaliaTheme/Blocks/Listing/PhotogalleryTemplate
|
|
692
|
-
#: components/ItaliaTheme/Blocks/Listing/SliderTemplate
|
|
693
682
|
# defaultMessage: Vedi l'immagine
|
|
694
683
|
msgid "Vedi l'immagine"
|
|
695
684
|
msgstr ""
|
|
@@ -1708,6 +1697,11 @@ msgstr ""
|
|
|
1708
1697
|
msgid "done_edit_social_links"
|
|
1709
1698
|
msgstr ""
|
|
1710
1699
|
|
|
1700
|
+
#: components/ItaliaTheme/Blocks/Listing/SliderTemplate
|
|
1701
|
+
# defaultMessage: Navigazione elementi slider
|
|
1702
|
+
msgid "dots"
|
|
1703
|
+
msgstr ""
|
|
1704
|
+
|
|
1711
1705
|
#: components/ItaliaTheme/View/VenueView/VenueWhere
|
|
1712
1706
|
# defaultMessage: Indirizzo
|
|
1713
1707
|
msgid "dove"
|
|
@@ -2185,6 +2179,7 @@ msgid "imageBackground"
|
|
|
2185
2179
|
msgstr ""
|
|
2186
2180
|
|
|
2187
2181
|
#: components/ItaliaTheme/View/PersonaView/PersonaDocumenti
|
|
2182
|
+
#: components/ItaliaTheme/View/PersonaView/PersonaRuolo
|
|
2188
2183
|
# defaultMessage: Importi di viaggio e/o servizi
|
|
2189
2184
|
msgid "importi_di_viaggio_e_o_servizi"
|
|
2190
2185
|
msgstr ""
|
|
@@ -2603,11 +2598,6 @@ msgstr ""
|
|
|
2603
2598
|
msgid "organizzato_da"
|
|
2604
2599
|
msgstr ""
|
|
2605
2600
|
|
|
2606
|
-
#: components/ItaliaTheme/View/PersonaView/PersonaRuolo
|
|
2607
|
-
# defaultMessage: Organizzazione
|
|
2608
|
-
msgid "organizzazione_riferimento"
|
|
2609
|
-
msgstr ""
|
|
2610
|
-
|
|
2611
2601
|
#: components/ItaliaTheme/View/Commons/TrasparenzaFields
|
|
2612
2602
|
#: components/ItaliaTheme/View/TrasparenzaView/DettagliProcedimentiView
|
|
2613
2603
|
# defaultMessage: Organo competente adozione provvedimento finale
|
|
@@ -2666,6 +2656,11 @@ msgstr ""
|
|
|
2666
2656
|
msgid "persona"
|
|
2667
2657
|
msgstr ""
|
|
2668
2658
|
|
|
2659
|
+
#: components/ItaliaTheme/View/PersonaView/PersonaRuolo
|
|
2660
|
+
# defaultMessage: Fa parte di
|
|
2661
|
+
msgid "persona_strutture_correlate"
|
|
2662
|
+
msgstr ""
|
|
2663
|
+
|
|
2669
2664
|
#: components/ItaliaTheme/View/PuntoDiContattoView/RelatedItemsChipsPDC
|
|
2670
2665
|
# defaultMessage: Persone correlate
|
|
2671
2666
|
msgid "persone_correlate"
|
|
@@ -2691,6 +2686,11 @@ msgstr ""
|
|
|
2691
2686
|
msgid "playStoreLink"
|
|
2692
2687
|
msgstr ""
|
|
2693
2688
|
|
|
2689
|
+
#: components/ItaliaTheme/Blocks/Listing/SliderTemplate
|
|
2690
|
+
# defaultMessage: Precedente
|
|
2691
|
+
msgid "precedente"
|
|
2692
|
+
msgstr ""
|
|
2693
|
+
|
|
2694
2694
|
#: components/ItaliaTheme/manage/Widgets/IconPreviewWidget
|
|
2695
2695
|
# defaultMessage: Anteprima dell'icona scelta
|
|
2696
2696
|
msgid "previewIconSelected"
|
|
@@ -3525,6 +3525,11 @@ msgstr ""
|
|
|
3525
3525
|
msgid "skype"
|
|
3526
3526
|
msgstr ""
|
|
3527
3527
|
|
|
3528
|
+
#: components/ItaliaTheme/Blocks/Listing/SliderTemplate
|
|
3529
|
+
# defaultMessage: Vai alla slide {index}
|
|
3530
|
+
msgid "slideDot"
|
|
3531
|
+
msgstr ""
|
|
3532
|
+
|
|
3528
3533
|
#: config/Blocks/ListingOptions/sliderTemplate
|
|
3529
3534
|
# defaultMessage: N° slide da mostrare
|
|
3530
3535
|
msgid "slidesToShow"
|
|
@@ -3665,6 +3670,11 @@ msgstr ""
|
|
|
3665
3670
|
msgid "subjects"
|
|
3666
3671
|
msgstr ""
|
|
3667
3672
|
|
|
3673
|
+
#: components/ItaliaTheme/Blocks/Listing/SliderTemplate
|
|
3674
|
+
# defaultMessage: Successivo
|
|
3675
|
+
msgid "successivo"
|
|
3676
|
+
msgstr ""
|
|
3677
|
+
|
|
3668
3678
|
#: components/ItaliaTheme/View/EventoView/EventoContatti
|
|
3669
3679
|
# defaultMessage: Con il supporto di
|
|
3670
3680
|
msgid "supported_by"
|
|
@@ -3874,6 +3884,11 @@ msgstr ""
|
|
|
3874
3884
|
msgid "venues"
|
|
3875
3885
|
msgstr ""
|
|
3876
3886
|
|
|
3887
|
+
#: components/ItaliaTheme/Blocks/Listing/SliderTemplate
|
|
3888
|
+
# defaultMessage: Sei attualmente in un carosello, per navigare usa le frecce sinistra e destra
|
|
3889
|
+
msgid "viewImage"
|
|
3890
|
+
msgstr ""
|
|
3891
|
+
|
|
3877
3892
|
#: components/ItaliaTheme/Blocks/ArgumentsInEvidence/BottomBody
|
|
3878
3893
|
# defaultMessage: Vedi tutti
|
|
3879
3894
|
msgid "view_all"
|
package/package.json
CHANGED
package/publiccode.yml
CHANGED
|
@@ -227,9 +227,9 @@ maintenance:
|
|
|
227
227
|
name: io-Comune - Il sito AgID per Comuni ed Enti Pubblici
|
|
228
228
|
platforms:
|
|
229
229
|
- web
|
|
230
|
-
releaseDate: '2023-08-
|
|
230
|
+
releaseDate: '2023-08-24'
|
|
231
231
|
softwareType: standalone/web
|
|
232
|
-
softwareVersion: 8.
|
|
232
|
+
softwareVersion: 8.4.0
|
|
233
233
|
url: 'https://github.com/italia/design-comuni-plone-theme'
|
|
234
234
|
usedBy:
|
|
235
235
|
- ASP Comuni Modenesi Area Nord
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { useRef, useEffect } from 'react';
|
|
2
|
+
|
|
1
3
|
export const getCategory = (item, show_type, show_section, props) => {
|
|
2
4
|
let cat = [];
|
|
3
5
|
|
|
@@ -15,3 +17,64 @@ export const getCategory = (item, show_type, show_section, props) => {
|
|
|
15
17
|
}
|
|
16
18
|
return null;
|
|
17
19
|
};
|
|
20
|
+
export const visibleSlideTitle = (selector) => {
|
|
21
|
+
// Needed to deal with react-slick duplicating a lot of slides
|
|
22
|
+
// when used in infinite mode. It's an useless and counterproductive
|
|
23
|
+
// thing to do on their part, there are multiple issues opened.
|
|
24
|
+
// The lib is not actually mantained so...
|
|
25
|
+
return Array.from(document.querySelectorAll(selector)).find((e) => {
|
|
26
|
+
const rect = e.getBoundingClientRect();
|
|
27
|
+
return rect.left >= 0 && rect.right <= window.innerWidth;
|
|
28
|
+
});
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
export const useSlider = (userAutoplay) => {
|
|
32
|
+
const slider = useRef(null);
|
|
33
|
+
const onIntersection = (entries, opt) => {
|
|
34
|
+
entries.forEach((entry) =>
|
|
35
|
+
entry.target.classList.toggle('visible', entry.isIntersecting),
|
|
36
|
+
);
|
|
37
|
+
};
|
|
38
|
+
const observer = new IntersectionObserver(onIntersection, {
|
|
39
|
+
root: null,
|
|
40
|
+
threshold: 0.5,
|
|
41
|
+
});
|
|
42
|
+
if (document.querySelector('.block.listing.slider'))
|
|
43
|
+
observer.observe(document.querySelector('.block.listing.slider'));
|
|
44
|
+
useEffect(() => {
|
|
45
|
+
return () => observer.disconnect();
|
|
46
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
47
|
+
}, []);
|
|
48
|
+
|
|
49
|
+
const focusNext = (currentSlide) => {
|
|
50
|
+
const sliderElement = document.querySelector('.block.listing.slider');
|
|
51
|
+
if (!sliderElement) return;
|
|
52
|
+
const sliderIsVisible = sliderElement.classList.contains('visible');
|
|
53
|
+
|
|
54
|
+
if (!sliderIsVisible) {
|
|
55
|
+
slider.current.slickPause();
|
|
56
|
+
return;
|
|
57
|
+
}
|
|
58
|
+
const slide = sliderElement.querySelectorAll(
|
|
59
|
+
`a.slide-link[data-slide="${currentSlide}"]`,
|
|
60
|
+
);
|
|
61
|
+
|
|
62
|
+
if ((userAutoplay && !slide) || (userAutoplay && !slide.length > 0)) return;
|
|
63
|
+
|
|
64
|
+
// Custom handling of focus as per Arter a11y audit and request
|
|
65
|
+
const link = visibleSlideTitle(
|
|
66
|
+
`a.slide-link[data-slide="${currentSlide}"]`,
|
|
67
|
+
);
|
|
68
|
+
|
|
69
|
+
if (!link || document.activeElement === link) {
|
|
70
|
+
return;
|
|
71
|
+
}
|
|
72
|
+
// eslint-disable-next-line no-unused-expressions
|
|
73
|
+
else link.focus();
|
|
74
|
+
};
|
|
75
|
+
|
|
76
|
+
return {
|
|
77
|
+
slider,
|
|
78
|
+
focusNext,
|
|
79
|
+
};
|
|
80
|
+
};
|
|
@@ -1,20 +1,17 @@
|
|
|
1
1
|
import 'slick-carousel/slick/slick.css';
|
|
2
2
|
import 'design-comuni-plone-theme/components/slick-carousel/slick/slick-theme.css';
|
|
3
|
-
|
|
4
3
|
import { Col, Container, Row } from 'design-react-kit';
|
|
5
4
|
import {
|
|
6
5
|
Icon,
|
|
7
6
|
ListingImage,
|
|
8
7
|
ListingLinkMore,
|
|
9
|
-
NextArrow,
|
|
10
|
-
PrevArrow,
|
|
11
8
|
} from 'design-comuni-plone-theme/components/ItaliaTheme';
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
9
|
+
import {
|
|
10
|
+
useSlider,
|
|
11
|
+
visibleSlideTitle,
|
|
12
|
+
} from 'design-comuni-plone-theme/components/ItaliaTheme/Blocks/Listing/Commons/utils';
|
|
13
|
+
import React, { useState } from 'react';
|
|
16
14
|
import { defineMessages, useIntl } from 'react-intl';
|
|
17
|
-
|
|
18
15
|
import PropTypes from 'prop-types';
|
|
19
16
|
import { UniversalLink } from '@plone/volto/components';
|
|
20
17
|
import cx from 'classnames';
|
|
@@ -22,25 +19,185 @@ import { injectLazyLibs } from '@plone/volto/helpers/Loadable/Loadable';
|
|
|
22
19
|
|
|
23
20
|
const messages = defineMessages({
|
|
24
21
|
viewImage: {
|
|
25
|
-
id:
|
|
26
|
-
defaultMessage:
|
|
22
|
+
id: 'viewImage',
|
|
23
|
+
defaultMessage:
|
|
24
|
+
'Sei attualmente in un carosello, per navigare usa le frecce sinistra e destra',
|
|
27
25
|
},
|
|
28
26
|
play: {
|
|
29
27
|
id: 'Play slider',
|
|
30
|
-
defaultMessage: '
|
|
28
|
+
defaultMessage: 'Seleziona per riprodurre',
|
|
31
29
|
},
|
|
32
30
|
pause: {
|
|
33
31
|
id: 'Pause slider',
|
|
34
|
-
defaultMessage: '
|
|
32
|
+
defaultMessage: 'Seleziona per mettere in pausa',
|
|
33
|
+
},
|
|
34
|
+
precedente: {
|
|
35
|
+
id: 'precedente',
|
|
36
|
+
defaultMessage: 'Precedente',
|
|
37
|
+
},
|
|
38
|
+
successivo: {
|
|
39
|
+
id: 'successivo',
|
|
40
|
+
defaultMessage: 'Successivo',
|
|
41
|
+
},
|
|
42
|
+
dots: {
|
|
43
|
+
id: 'dots',
|
|
44
|
+
defaultMessage: 'Navigazione elementi slider',
|
|
45
|
+
},
|
|
46
|
+
slideDot: {
|
|
47
|
+
id: 'slideDot',
|
|
48
|
+
defaultMessage: 'Vai alla slide {index}',
|
|
35
49
|
},
|
|
36
50
|
});
|
|
37
51
|
|
|
52
|
+
function NextArrow(props) {
|
|
53
|
+
// Custom handling of focus as per Arter a11y audit and request
|
|
54
|
+
const { className, style, onClick, intl, currentSlide } = props;
|
|
55
|
+
const handleClick = (options) => {
|
|
56
|
+
onClick(options, false);
|
|
57
|
+
};
|
|
58
|
+
const handleKeyboardUsers = (e) => {
|
|
59
|
+
if (e.key === 'Tab' && e.shiftKey) {
|
|
60
|
+
e.stopPropagation();
|
|
61
|
+
e.preventDefault();
|
|
62
|
+
|
|
63
|
+
const link = visibleSlideTitle(
|
|
64
|
+
`a.slide-link[data-slide="${currentSlide}"]`,
|
|
65
|
+
);
|
|
66
|
+
link && link.focus();
|
|
67
|
+
}
|
|
68
|
+
};
|
|
69
|
+
|
|
70
|
+
return (
|
|
71
|
+
<button
|
|
72
|
+
className={className}
|
|
73
|
+
style={{ ...style }}
|
|
74
|
+
onClick={handleClick}
|
|
75
|
+
title={intl.formatMessage(messages.successivo)}
|
|
76
|
+
aria-label={intl.formatMessage(messages.successivo)}
|
|
77
|
+
aria-hidden={true}
|
|
78
|
+
onKeyDown={handleKeyboardUsers}
|
|
79
|
+
id="sliderNextArrow"
|
|
80
|
+
>
|
|
81
|
+
<Icon icon="chevron-right" key="chevron-right" />
|
|
82
|
+
<span class="sr-only">{intl.formatMessage(messages.successivo)}</span>
|
|
83
|
+
</button>
|
|
84
|
+
);
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
function PrevArrow(props) {
|
|
88
|
+
// Custom handling of focus as per Arter a11y audit and request
|
|
89
|
+
const {
|
|
90
|
+
className,
|
|
91
|
+
style,
|
|
92
|
+
onClick,
|
|
93
|
+
intl,
|
|
94
|
+
focusNext,
|
|
95
|
+
currentSlide,
|
|
96
|
+
slideCount,
|
|
97
|
+
} = props;
|
|
98
|
+
const handleClick = (options) => {
|
|
99
|
+
onClick(options, false);
|
|
100
|
+
};
|
|
101
|
+
const handleKeyboardUsers = (e) => {
|
|
102
|
+
if (e.key === 'Tab' && !e.shiftKey) {
|
|
103
|
+
e.stopPropagation();
|
|
104
|
+
e.preventDefault();
|
|
105
|
+
if (currentSlide < slideCount) {
|
|
106
|
+
const link = visibleSlideTitle(
|
|
107
|
+
`a.slide-link[data-slide="${currentSlide}"]`,
|
|
108
|
+
);
|
|
109
|
+
link && link.focus();
|
|
110
|
+
} else focusNext(0);
|
|
111
|
+
}
|
|
112
|
+
};
|
|
113
|
+
return (
|
|
114
|
+
<button
|
|
115
|
+
className={className}
|
|
116
|
+
style={{ ...style }}
|
|
117
|
+
onClick={handleClick}
|
|
118
|
+
title={intl.formatMessage(messages.precedente)}
|
|
119
|
+
aria-label={intl.formatMessage(messages.precedente)}
|
|
120
|
+
aria-hidden={true}
|
|
121
|
+
id="sliderPrevArrow"
|
|
122
|
+
onKeyDown={handleKeyboardUsers}
|
|
123
|
+
>
|
|
124
|
+
<Icon icon="chevron-left" key="chevron-left-prev" />
|
|
125
|
+
<span class="sr-only">{intl.formatMessage(messages.precedente)}</span>
|
|
126
|
+
</button>
|
|
127
|
+
);
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
const Slide = ({
|
|
131
|
+
item,
|
|
132
|
+
index,
|
|
133
|
+
image,
|
|
134
|
+
show_image_title,
|
|
135
|
+
full_width,
|
|
136
|
+
intl,
|
|
137
|
+
setUserAutoplay,
|
|
138
|
+
userAutoplay,
|
|
139
|
+
slider,
|
|
140
|
+
}) => {
|
|
141
|
+
const handleKeyboardUsers = (e) => {
|
|
142
|
+
const { key, shiftKey } = e;
|
|
143
|
+
if (key === 'Tab') {
|
|
144
|
+
e.stopPropagation();
|
|
145
|
+
e.preventDefault();
|
|
146
|
+
// Keeping auto pause off for now
|
|
147
|
+
// if (userAutoplay) setUserAutoplay(false);
|
|
148
|
+
// slider.current.slickPause();
|
|
149
|
+
let elementToFocus;
|
|
150
|
+
if (shiftKey) {
|
|
151
|
+
elementToFocus = document.getElementById('sliderPrevArrow');
|
|
152
|
+
} else elementToFocus = document.getElementById('sliderNextArrow');
|
|
153
|
+
elementToFocus.focus();
|
|
154
|
+
}
|
|
155
|
+
};
|
|
156
|
+
|
|
157
|
+
return (
|
|
158
|
+
<div
|
|
159
|
+
className="it-single-slide-wrapper"
|
|
160
|
+
key={item['@id'] + index}
|
|
161
|
+
data-slide={index}
|
|
162
|
+
>
|
|
163
|
+
<div className="slide-wrapper">
|
|
164
|
+
{image ? (
|
|
165
|
+
<figure className="img-wrapper">{image}</figure>
|
|
166
|
+
) : (
|
|
167
|
+
<div className="img-placeholder"></div>
|
|
168
|
+
)}
|
|
169
|
+
{show_image_title && (
|
|
170
|
+
<div className="slide-title">
|
|
171
|
+
<UniversalLink
|
|
172
|
+
item={item}
|
|
173
|
+
title={intl.formatMessage(messages.viewImage)}
|
|
174
|
+
tabIndex={0}
|
|
175
|
+
data-slide={index}
|
|
176
|
+
className={'slide-link no-external-if-link'}
|
|
177
|
+
onKeyDown={handleKeyboardUsers}
|
|
178
|
+
>
|
|
179
|
+
{full_width ? (
|
|
180
|
+
<Container>
|
|
181
|
+
{item.title} <Icon icon="arrow-right" key="arrow-right-fw" />
|
|
182
|
+
</Container>
|
|
183
|
+
) : (
|
|
184
|
+
<>
|
|
185
|
+
{item.title} <Icon icon="arrow-right" key="arrow-right" />
|
|
186
|
+
</>
|
|
187
|
+
)}
|
|
188
|
+
</UniversalLink>
|
|
189
|
+
</div>
|
|
190
|
+
)}
|
|
191
|
+
</div>
|
|
192
|
+
</div>
|
|
193
|
+
);
|
|
194
|
+
};
|
|
195
|
+
|
|
38
196
|
const SliderTemplate = ({
|
|
39
197
|
items,
|
|
40
198
|
title,
|
|
41
199
|
isEditMode,
|
|
42
200
|
show_block_bg,
|
|
43
|
-
linkAlign,
|
|
44
201
|
linkTitle,
|
|
45
202
|
linkHref,
|
|
46
203
|
slidesToShow = '1',
|
|
@@ -50,15 +207,12 @@ const SliderTemplate = ({
|
|
|
50
207
|
autoplay = false,
|
|
51
208
|
autoplay_speed = 2, //seconds
|
|
52
209
|
reactSlick,
|
|
53
|
-
titleLine,
|
|
54
|
-
linkmore_id_lighthouse,
|
|
55
210
|
}) => {
|
|
56
211
|
const intl = useIntl();
|
|
57
|
-
const slider = useRef(null);
|
|
58
212
|
const [userAutoplay, setUserAutoplay] = useState(autoplay);
|
|
59
213
|
const nSlidesToShow = parseInt(slidesToShow);
|
|
60
214
|
const Slider = reactSlick.default;
|
|
61
|
-
|
|
215
|
+
const { slider, focusNext } = useSlider(userAutoplay);
|
|
62
216
|
const toggleAutoplay = () => {
|
|
63
217
|
if (!slider?.current) return;
|
|
64
218
|
if (userAutoplay) {
|
|
@@ -70,6 +224,50 @@ const SliderTemplate = ({
|
|
|
70
224
|
}
|
|
71
225
|
};
|
|
72
226
|
|
|
227
|
+
const renderCustomDots = (props) => {
|
|
228
|
+
// Custom handling of focus as per Arter a11y audit and request
|
|
229
|
+
return (
|
|
230
|
+
<ul
|
|
231
|
+
className="slick-dots"
|
|
232
|
+
aria-label={intl.formatMessage(messages.dots)}
|
|
233
|
+
title={intl.formatMessage(messages.dots)}
|
|
234
|
+
>
|
|
235
|
+
{props.map((item, index) => {
|
|
236
|
+
const El = item.type;
|
|
237
|
+
const children = item.props.children;
|
|
238
|
+
// Justified assumption: children is an Object and not an Array here
|
|
239
|
+
const Child =
|
|
240
|
+
children.type ||
|
|
241
|
+
function () {
|
|
242
|
+
return null;
|
|
243
|
+
};
|
|
244
|
+
return (
|
|
245
|
+
<El
|
|
246
|
+
className={`${item.props.className} slick-dot`}
|
|
247
|
+
tabIndex={-1}
|
|
248
|
+
title={intl.formatMessage(messages.slideDot, {
|
|
249
|
+
index: index + 1,
|
|
250
|
+
})}
|
|
251
|
+
aria-hidden={true}
|
|
252
|
+
>
|
|
253
|
+
<Child
|
|
254
|
+
{...children.props}
|
|
255
|
+
tabIndex={-1}
|
|
256
|
+
style={{ padding: 0 }}
|
|
257
|
+
title={intl.formatMessage(messages.slideDot, {
|
|
258
|
+
index: index + 1,
|
|
259
|
+
})}
|
|
260
|
+
aria-label={intl.formatMessage(messages.slideDot, {
|
|
261
|
+
index: index + 1,
|
|
262
|
+
})}
|
|
263
|
+
/>
|
|
264
|
+
</El>
|
|
265
|
+
);
|
|
266
|
+
})}
|
|
267
|
+
</ul>
|
|
268
|
+
);
|
|
269
|
+
};
|
|
270
|
+
|
|
73
271
|
const settings = {
|
|
74
272
|
dots: show_dots,
|
|
75
273
|
infinite: true,
|
|
@@ -86,8 +284,11 @@ const SliderTemplate = ({
|
|
|
86
284
|
focusOnSelect: true,
|
|
87
285
|
draggable: true,
|
|
88
286
|
accessibility: true,
|
|
89
|
-
nextArrow: <NextArrow />,
|
|
90
|
-
prevArrow: <PrevArrow />,
|
|
287
|
+
nextArrow: <NextArrow intl={intl} focusNext={focusNext} />,
|
|
288
|
+
prevArrow: <PrevArrow intl={intl} focusNext={focusNext} />,
|
|
289
|
+
appendDots: renderCustomDots,
|
|
290
|
+
// Custom handling of focus as per Arter a11y audit and request
|
|
291
|
+
afterChange: focusNext,
|
|
91
292
|
responsive: [
|
|
92
293
|
{
|
|
93
294
|
breakpoint: 980,
|
|
@@ -99,7 +300,6 @@ const SliderTemplate = ({
|
|
|
99
300
|
],
|
|
100
301
|
};
|
|
101
302
|
|
|
102
|
-
//const getCaption = (item) => item.description ?? item.rights ?? null;
|
|
103
303
|
return (
|
|
104
304
|
<div
|
|
105
305
|
className={cx(`sliderTemplate slidesToShow-${nSlidesToShow || 1}`, {
|
|
@@ -110,9 +310,7 @@ const SliderTemplate = ({
|
|
|
110
310
|
{title && (
|
|
111
311
|
<Row>
|
|
112
312
|
<Col>
|
|
113
|
-
<h2 className=
|
|
114
|
-
{title}
|
|
115
|
-
</h2>
|
|
313
|
+
<h2 className="mb-4">{title}</h2>
|
|
116
314
|
</Col>
|
|
117
315
|
</Row>
|
|
118
316
|
)}
|
|
@@ -126,12 +324,13 @@ const SliderTemplate = ({
|
|
|
126
324
|
{items?.length > nSlidesToShow && (
|
|
127
325
|
<div className="play-pause-wrapper">
|
|
128
326
|
<button
|
|
129
|
-
onClick={
|
|
327
|
+
onClick={toggleAutoplay}
|
|
130
328
|
title={
|
|
131
329
|
userAutoplay
|
|
132
330
|
? intl.formatMessage(messages.pause)
|
|
133
331
|
: intl.formatMessage(messages.play)
|
|
134
332
|
}
|
|
333
|
+
tabIndex={0}
|
|
135
334
|
>
|
|
136
335
|
<Icon
|
|
137
336
|
key={userAutoplay ? 'pause' : 'play'}
|
|
@@ -150,53 +349,24 @@ const SliderTemplate = ({
|
|
|
150
349
|
maxSize: 1600,
|
|
151
350
|
critical: true,
|
|
152
351
|
});
|
|
153
|
-
//if (!image) return null;
|
|
154
352
|
return (
|
|
155
|
-
<
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
<UniversalLink
|
|
167
|
-
item={item}
|
|
168
|
-
title={intl.formatMessage(messages.viewImage)}
|
|
169
|
-
className={'no-external-if-link'}
|
|
170
|
-
>
|
|
171
|
-
<div className="slide-title">
|
|
172
|
-
{full_width ? (
|
|
173
|
-
<Container>
|
|
174
|
-
{item.title}{' '}
|
|
175
|
-
<Icon icon="arrow-right" key="arrow-right-fw" />
|
|
176
|
-
</Container>
|
|
177
|
-
) : (
|
|
178
|
-
<>
|
|
179
|
-
{item.title}{' '}
|
|
180
|
-
<Icon icon="arrow-right" key="arrow-right" />
|
|
181
|
-
</>
|
|
182
|
-
)}
|
|
183
|
-
</div>
|
|
184
|
-
</UniversalLink>
|
|
185
|
-
)}
|
|
186
|
-
</div>
|
|
187
|
-
</div>
|
|
353
|
+
<Slide
|
|
354
|
+
image={image}
|
|
355
|
+
index={index}
|
|
356
|
+
full_width={full_width}
|
|
357
|
+
item={item}
|
|
358
|
+
show_image_title={show_image_title}
|
|
359
|
+
intl={intl}
|
|
360
|
+
setUserAutoplay={setUserAutoplay}
|
|
361
|
+
userAutoplay={userAutoplay}
|
|
362
|
+
slider={slider}
|
|
363
|
+
/>
|
|
188
364
|
);
|
|
189
365
|
})}
|
|
190
366
|
</Slider>
|
|
191
367
|
</div>
|
|
192
368
|
</div>
|
|
193
|
-
<ListingLinkMore
|
|
194
|
-
title={linkTitle}
|
|
195
|
-
href={linkHref}
|
|
196
|
-
linkAlign={linkAlign}
|
|
197
|
-
className="my-4"
|
|
198
|
-
linkmoreIdLighthouse={linkmore_id_lighthouse}
|
|
199
|
-
/>
|
|
369
|
+
<ListingLinkMore title={linkTitle} href={linkHref} className="my-4" />
|
|
200
370
|
</Container>
|
|
201
371
|
</div>
|
|
202
372
|
);
|
|
@@ -12,7 +12,7 @@ import { getBreadcrumbs } from '@plone/volto/actions';
|
|
|
12
12
|
import { getBaseUrl, flattenToAppURL } from '@plone/volto/helpers';
|
|
13
13
|
|
|
14
14
|
import { UniversalLink } from '@plone/volto/components';
|
|
15
|
-
import { Row, Col,
|
|
15
|
+
import { Row, Col, BreadcrumbItem } from 'design-react-kit';
|
|
16
16
|
import GoogleBreadcrumbs from 'design-comuni-plone-theme/components/ItaliaTheme/Breadcrumbs/GoogleBreadcrumbs';
|
|
17
17
|
|
|
18
18
|
const messages = defineMessages({
|
|
@@ -57,7 +57,7 @@ const Breadcrumbs = ({ pathname }) => {
|
|
|
57
57
|
</UniversalLink>
|
|
58
58
|
<span className="separator">/</span>
|
|
59
59
|
</BreadcrumbItem>
|
|
60
|
-
{items.
|
|
60
|
+
{items.map((item, index, items) => (
|
|
61
61
|
<BreadcrumbItem tag="li" key={item.url}>
|
|
62
62
|
<UniversalLink href={item.url}>{item.title}</UniversalLink>
|
|
63
63
|
{index < items.length - 1 && (
|
|
@@ -25,6 +25,7 @@ import cx from 'classnames';
|
|
|
25
25
|
import AnswersStep from './Steps/AnswersStep';
|
|
26
26
|
import CommentsStep from './Steps/CommentsStep';
|
|
27
27
|
import Rating from './Steps/Commons/Rating';
|
|
28
|
+
import { PropTypes } from 'prop-types';
|
|
28
29
|
|
|
29
30
|
const messages = defineMessages({
|
|
30
31
|
title: {
|
|
@@ -111,10 +112,10 @@ const messages = defineMessages({
|
|
|
111
112
|
},
|
|
112
113
|
});
|
|
113
114
|
|
|
114
|
-
const FeedbackForm = ({ contentType }) => {
|
|
115
|
+
const FeedbackForm = ({ contentType, pathname }) => {
|
|
115
116
|
const intl = useIntl();
|
|
116
117
|
const location = useLocation();
|
|
117
|
-
const path = location.pathname ?? '/';
|
|
118
|
+
const path = pathname ?? location.pathname ?? '/';
|
|
118
119
|
const dispatch = useDispatch();
|
|
119
120
|
const [satisfaction, setSatisfaction] = useState(null);
|
|
120
121
|
const [step, setStep] = useState(0);
|
|
@@ -124,11 +125,9 @@ const FeedbackForm = ({ contentType }) => {
|
|
|
124
125
|
const submitResults = useSelector((state) => state.submitFeedback);
|
|
125
126
|
const [validToken, setValidToken] = useState(null);
|
|
126
127
|
const threshold = getFeedbackThreshold();
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
fieldHoney = window.env.RAZZLE_HONEYPOT_FIELD;
|
|
131
|
-
}
|
|
128
|
+
const fieldHoney = __CLIENT__
|
|
129
|
+
? window.env.RAZZLE_HONEYPOT_FIELD
|
|
130
|
+
: process.env.RAZZLE_HONEYPOT_FIELD;
|
|
132
131
|
|
|
133
132
|
const numberOfSteps = useMemo(() => getNumberOfSteps(), []);
|
|
134
133
|
|
|
@@ -359,4 +358,9 @@ const FeedbackForm = ({ contentType }) => {
|
|
|
359
358
|
);
|
|
360
359
|
};
|
|
361
360
|
|
|
361
|
+
FeedbackForm.propTypes = {
|
|
362
|
+
contentType: PropTypes.string,
|
|
363
|
+
pathname: PropTypes.string,
|
|
364
|
+
};
|
|
365
|
+
|
|
362
366
|
export default FeedbackForm;
|