design-comuni-plone-theme 11.9.0 → 11.10.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.
Files changed (96) hide show
  1. package/.github/workflows/performance.yml +47 -0
  2. package/.yarn/cache/minipass-npm-5.0.0-c64fb63c92-425dab2887.zip +0 -0
  3. package/.yarn/cache/tar-npm-6.2.1-237800bb20-f1322768c9.zip +0 -0
  4. package/.yarn/cache/{volto-gdpr-privacy-npm-2.1.1-414b7e6a62-2246b94027.zip → volto-gdpr-privacy-npm-2.2.0-6be0f74d53-8a93254251.zip} +0 -0
  5. package/.yarn/cache/volto-slimheader-npm-0.1.1-6c4a32fae4-94bafa197c.zip +0 -0
  6. package/.yarn/install-state.gz +0 -0
  7. package/CHANGELOG.md +60 -0
  8. package/RELEASE.md +33 -0
  9. package/locales/de/LC_MESSAGES/volto.po +61 -36
  10. package/locales/en/LC_MESSAGES/volto.po +63 -38
  11. package/locales/es/LC_MESSAGES/volto.po +61 -36
  12. package/locales/fr/LC_MESSAGES/volto.po +62 -37
  13. package/locales/it/LC_MESSAGES/volto.po +61 -36
  14. package/locales/volto.pot +62 -37
  15. package/package.json +5 -3
  16. package/publiccode.yml +2 -2
  17. package/src/components/ItaliaTheme/AppExtras/TrackFocus.jsx +47 -0
  18. package/src/components/ItaliaTheme/Blocks/Accordion/View.jsx +1 -1
  19. package/src/components/ItaliaTheme/Blocks/ArgumentsInEvidence/BodyWrapper.jsx +8 -3
  20. package/src/components/ItaliaTheme/Blocks/ArgumentsInEvidence/BottomBody.jsx +25 -16
  21. package/src/components/ItaliaTheme/Blocks/ArgumentsInEvidence/Edit.jsx +10 -2
  22. package/src/components/ItaliaTheme/Blocks/ArgumentsInEvidence/Sidebar.jsx +39 -3
  23. package/src/components/ItaliaTheme/Blocks/ArgumentsInEvidence/View.jsx +31 -16
  24. package/src/components/ItaliaTheme/Blocks/Calendar/Body.jsx +23 -59
  25. package/src/components/ItaliaTheme/Blocks/Common/SearchFilters/SelectFilter.jsx +9 -1
  26. package/src/components/ItaliaTheme/Blocks/EventSearch/DefaultFilters.js +5 -0
  27. package/src/components/ItaliaTheme/Blocks/IconBlocks/Block/ViewBlock.jsx +17 -0
  28. package/src/components/ItaliaTheme/Blocks/Listing/CardWithImage/CardWithImageDefault.jsx +182 -0
  29. package/src/components/ItaliaTheme/Blocks/Listing/CardWithImageTemplate.jsx +7 -173
  30. package/src/components/ItaliaTheme/Blocks/Listing/Commons/utils.js +0 -70
  31. package/src/components/ItaliaTheme/Blocks/Listing/PhotogalleryTemplate.jsx +24 -36
  32. package/src/components/ItaliaTheme/Blocks/Listing/SimpleCard/Card/SimpleCardDefault.jsx +177 -0
  33. package/src/components/ItaliaTheme/Blocks/Listing/SimpleCard/SimpleCardTemplateDefault.jsx +8 -170
  34. package/src/components/ItaliaTheme/Blocks/Listing/Slider/SlideItemDefault.jsx +65 -0
  35. package/src/components/ItaliaTheme/Blocks/Listing/SliderTemplate.jsx +62 -212
  36. package/src/components/ItaliaTheme/Blocks/VideoGallery/Body.jsx +10 -48
  37. package/src/components/ItaliaTheme/Blocks/VideoGallery/Edit.jsx +3 -2
  38. package/src/components/ItaliaTheme/Blocks/VideoGallery/View.jsx +3 -2
  39. package/src/components/ItaliaTheme/Footer/FooterNavigation.jsx +6 -0
  40. package/src/components/ItaliaTheme/Header/HeaderSlim/TertiaryMenu.jsx +34 -5
  41. package/src/components/ItaliaTheme/Icons/FontAwesomeIcon.jsx +2 -0
  42. package/src/components/ItaliaTheme/MegaMenu/MegaMenu.jsx +8 -2
  43. package/src/components/ItaliaTheme/MenuSecondary/MenuSecondary.jsx +3 -0
  44. package/src/components/ItaliaTheme/Slider/ButtonPlayPause.jsx +48 -0
  45. package/src/components/ItaliaTheme/Slider/CarouselWrapper.jsx +23 -0
  46. package/src/components/ItaliaTheme/Slider/NextArrow.jsx +31 -0
  47. package/src/components/ItaliaTheme/Slider/PrevArrow.jsx +33 -0
  48. package/src/components/ItaliaTheme/Slider/SingleSlideWrapper.jsx +39 -0
  49. package/src/components/ItaliaTheme/Slider/slider.js +203 -0
  50. package/src/components/ItaliaTheme/View/Commons/ContactLink.jsx +3 -2
  51. package/src/components/ItaliaTheme/View/Commons/Dates.jsx +12 -4
  52. package/src/components/ItaliaTheme/View/Commons/Gallery.jsx +13 -9
  53. package/src/components/ItaliaTheme/View/Commons/Metadata.jsx +1 -1
  54. package/src/components/ItaliaTheme/View/Commons/RenderBlocks.jsx +20 -7
  55. package/src/components/ItaliaTheme/View/DocumentoView/DocumentoDescrizione.jsx +15 -7
  56. package/src/components/ItaliaTheme/View/EventoView/EventoContattiOrganizzatoreEsterno.jsx +12 -1
  57. package/src/components/ItaliaTheme/View/EventoView/EventoLuoghi.jsx +7 -7
  58. package/src/components/ItaliaTheme/View/UOView/UOServices.jsx +1 -1
  59. package/src/components/ItaliaTheme/View/__tests__/ServizioMetadati.test.jsx +1 -1
  60. package/src/components/ItaliaTheme/index.js +7 -2
  61. package/src/config/Blocks/ListingOptions/cardWithImageTemplate.js +18 -2
  62. package/src/config/Blocks/ListingOptions/simpleCardTemplate.js +34 -17
  63. package/src/config/Blocks/ListingOptions/sliderTemplate.js +68 -11
  64. package/src/config/Blocks/listingVariations.js +8 -0
  65. package/src/config/italiaConfig.js +13 -2
  66. package/src/customizations/volto/components/manage/Blocks/Listing/ListingBody.jsx +5 -0
  67. package/src/customizations/volto/components/manage/Blocks/Search/components/SelectFacetFilterListEntry.jsx +43 -36
  68. package/src/customizations/volto/components/manage/UniversalLink/UniversalLink.jsx +8 -3
  69. package/src/customizations/volto/components/manage/Widgets/FileWidget.jsx +2 -2
  70. package/src/customizations/volto/components/theme/Navigation/Navigation.jsx +5 -1
  71. package/src/customizations/volto/components/theme/Sitemap/Sitemap.jsx +126 -0
  72. package/src/helpers/config.js +1 -1
  73. package/src/theme/ItaliaTheme/Blocks/_argumentsInEvidence.scss +4 -4
  74. package/src/theme/ItaliaTheme/Blocks/{_cardWithImageAndInEvidence.scss → _cardWithImage.scss} +63 -38
  75. package/src/theme/ItaliaTheme/Blocks/_iconBlocks.scss +7 -6
  76. package/src/theme/ItaliaTheme/Blocks/_inEvidenceTemplate.scss +123 -0
  77. package/src/theme/ItaliaTheme/Blocks/_simpleCardTemplate.scss +65 -67
  78. package/src/theme/ItaliaTheme/Blocks/_sliderTemplate.scss +81 -0
  79. package/src/theme/ItaliaTheme/Blocks/common/_searchBlockFilters.scss +16 -0
  80. package/src/theme/ItaliaTheme/Components/_cardPersona.scss +1 -1
  81. package/src/theme/ItaliaTheme/Components/_mobileMenu.scss +1 -1
  82. package/src/theme/ItaliaTheme/Components/_navigation.scss +15 -0
  83. package/src/theme/ItaliaTheme/Components/_tertiaryMenu.scss +6 -0
  84. package/src/theme/ItaliaTheme/Print/_all_pages.scss +33 -0
  85. package/src/theme/ItaliaTheme/Print/_page.scss +21 -0
  86. package/src/theme/ItaliaTheme/Print/_uo.scss +7 -2
  87. package/src/theme/ItaliaTheme/Views/_common.scss +4 -0
  88. package/src/theme/bootstrap-override/bootstrap-italia/_chips.scss +16 -1
  89. package/src/theme/bootstrap-override/bootstrap-italia/_footer.scss +2 -0
  90. package/src/theme/site.scss +4 -2
  91. package/.yarn/cache/nanoid-npm-3.3.4-3d250377d6-2fddd6dee9.zip +0 -0
  92. package/.yarn/cache/postcss-npm-8.4.16-7367383579-10eee25efd.zip +0 -0
  93. package/.yarn/cache/tar-npm-6.1.11-e6ac3cba9c-a04c07bb9e.zip +0 -0
  94. package/src/components/ItaliaTheme/Blocks/Listing/Commons/NextArrow.jsx +0 -10
  95. package/src/components/ItaliaTheme/Blocks/Listing/Commons/PrevArrow.jsx +0 -10
  96. package/src/theme/ItaliaTheme/Blocks/_inevidencetemplate.scss +0 -34
@@ -5,43 +5,26 @@ import 'slick-carousel/slick/slick.css';
5
5
  import 'design-comuni-plone-theme/components/slick-carousel/slick/slick-theme.css';
6
6
  import { Col, Container, Row } from 'design-react-kit';
7
7
  import {
8
- Icon,
9
8
  ListingImage,
10
9
  ListingLinkMore,
10
+ SingleSlideWrapper,
11
+ CarouselWrapper,
12
+ ButtonPlayPause,
11
13
  } from 'design-comuni-plone-theme/components/ItaliaTheme';
12
- import {
13
- useSlider,
14
- visibleSlideTitle,
15
- } from 'design-comuni-plone-theme/components/ItaliaTheme/Blocks/Listing/Commons/utils';
14
+ import { useSlider } from 'design-comuni-plone-theme/components/ItaliaTheme/Slider/slider';
16
15
  import React, { useState } from 'react';
17
16
  import { defineMessages, useIntl } from 'react-intl';
18
17
  import PropTypes from 'prop-types';
19
- import { UniversalLink } from '@plone/volto/components';
20
18
  import cx from 'classnames';
21
19
  import { injectLazyLibs } from '@plone/volto/helpers/Loadable/Loadable';
20
+ import config from '@plone/volto/registry';
22
21
 
23
22
  const messages = defineMessages({
24
- viewImage: {
25
- id: 'viewImage',
23
+ carouselItemAriaLabel: {
24
+ id: 'carousel-item-aria-label',
26
25
  defaultMessage:
27
26
  'Sei attualmente in un carosello, per navigare usa le frecce sinistra e destra',
28
27
  },
29
- play: {
30
- id: 'Play slider',
31
- defaultMessage: 'Seleziona per riprodurre',
32
- },
33
- pause: {
34
- id: 'Pause slider',
35
- defaultMessage: 'Seleziona per mettere in pausa',
36
- },
37
- precedente: {
38
- id: 'precedente',
39
- defaultMessage: 'Precedente',
40
- },
41
- successivo: {
42
- id: 'successivo',
43
- defaultMessage: 'Successivo',
44
- },
45
28
  dots: {
46
29
  id: 'dots',
47
30
  defaultMessage: 'Navigazione elementi slider',
@@ -56,169 +39,29 @@ const messages = defineMessages({
56
39
  },
57
40
  });
58
41
 
59
- function NextArrow(props) {
60
- // Custom handling of focus for a11y
61
- const { className, style, onClick, intl, currentSlide } = props;
62
- const handleClick = (options) => {
63
- onClick(options, false);
64
- };
65
- const handleKeyboardUsers = (e) => {
66
- if (e.key === 'Tab' && e.shiftKey) {
67
- e.stopPropagation();
68
- e.preventDefault();
69
-
70
- const link = visibleSlideTitle(
71
- `a.slide-link[data-slide="${currentSlide}"]`,
72
- );
73
- link && link.focus();
74
- }
75
- };
76
-
77
- return (
78
- <button
79
- className={className}
80
- style={{ ...style }}
81
- onClick={handleClick}
82
- title={intl.formatMessage(messages.successivo)}
83
- aria-label={intl.formatMessage(messages.successivo)}
84
- aria-hidden={true}
85
- onKeyDown={handleKeyboardUsers}
86
- id="sliderNextArrow"
87
- >
88
- <Icon
89
- icon="chevron-right"
90
- key="chevron-right"
91
- title={intl.formatMessage(messages.successivo)}
92
- />
93
- <span class="visually-hidden">
94
- {intl.formatMessage(messages.successivo)}
95
- </span>
96
- </button>
97
- );
98
- }
99
-
100
- function PrevArrow(props) {
101
- // Custom handling of focus for a11y
102
- const {
103
- className,
104
- style,
105
- onClick,
106
- intl,
107
- focusNext,
108
- currentSlide,
109
- slideCount,
110
- } = props;
111
- const handleClick = (options) => {
112
- onClick(options, false);
113
- };
114
- const handleKeyboardUsers = (e) => {
115
- if (e.key === 'Tab' && !e.shiftKey) {
116
- e.stopPropagation();
117
- e.preventDefault();
118
- if (currentSlide < slideCount) {
119
- const link = visibleSlideTitle(
120
- `a.slide-link[data-slide="${currentSlide}"]`,
121
- );
122
- link && link.focus();
123
- } else focusNext(0);
124
- }
125
- };
126
- return (
127
- <button
128
- className={className}
129
- style={{ ...style }}
130
- onClick={handleClick}
131
- title={intl.formatMessage(messages.precedente)}
132
- aria-label={intl.formatMessage(messages.precedente)}
133
- aria-hidden={true}
134
- id="sliderPrevArrow"
135
- onKeyDown={handleKeyboardUsers}
136
- >
137
- <Icon
138
- icon="chevron-left"
139
- key="chevron-left-prev"
140
- title={intl.formatMessage(messages.precedente)}
141
- />
142
- <span class="visually-hidden">
143
- {intl.formatMessage(messages.precedente)}
144
- </span>
145
- </button>
146
- );
147
- }
42
+ const Slide = (props) => {
43
+ const intl = useIntl();
44
+ const { item, index, appearance, appearanceProp, onKeyDown } = props;
148
45
 
149
- const Slide = ({
150
- item,
151
- index,
152
- image,
153
- show_image_title,
154
- full_width,
155
- intl,
156
- setUserAutoplay,
157
- userAutoplay,
158
- slider,
159
- }) => {
160
- const handleKeyboardUsers = (e) => {
161
- const { key, shiftKey } = e;
162
- if (key === 'Tab') {
163
- e.stopPropagation();
164
- e.preventDefault();
165
- // Keeping auto pause off for now
166
- // if (userAutoplay) setUserAutoplay(false);
167
- // slider.current.slickPause();
168
- let elementToFocus;
169
- if (shiftKey) {
170
- elementToFocus = document.getElementById('sliderPrevArrow');
171
- } else elementToFocus = document.getElementById('sliderNextArrow');
172
- elementToFocus.focus();
173
- }
174
- };
46
+ const appearances = config.blocks.blocksConfig.listing.variations.filter(
47
+ (v) => v.id === 'slider',
48
+ )[0]?.appearance;
49
+ const SlideItemAppearance = appearances[appearance] ?? appearances['default'];
175
50
 
176
51
  return (
177
- <div
178
- className="it-single-slide-wrapper"
52
+ <SingleSlideWrapper
179
53
  key={item['@id'] + index}
180
- data-slide={index}
54
+ index={index}
55
+ onKeyDown={onKeyDown}
56
+ aria-label={
57
+ (props['aria-label'] ? props['aria-label'] + ' - ' : '') +
58
+ intl.formatMessage(messages.carouselItemAriaLabel)
59
+ }
181
60
  >
182
- <div className="slide-wrapper">
183
- {image ? (
184
- <figure className="img-wrapper">{image}</figure>
185
- ) : (
186
- <div className="img-placeholder"></div>
187
- )}
188
- {show_image_title && (
189
- <div className="slide-title">
190
- <UniversalLink
191
- item={item}
192
- title={intl.formatMessage(messages.viewImage)}
193
- tabIndex={0}
194
- data-slide={index}
195
- className={'slide-link no-external-if-link'}
196
- onKeyDown={handleKeyboardUsers}
197
- >
198
- {full_width ? (
199
- <Container>
200
- {item.title}{' '}
201
- <Icon
202
- icon="arrow-right"
203
- key="arrow-right-fw"
204
- title={intl.formatMessage(messages.openLink)}
205
- />
206
- </Container>
207
- ) : (
208
- <>
209
- {item.title}{' '}
210
- <Icon
211
- icon="arrow-right"
212
- key="arrow-right"
213
- title={intl.formatMessage(messages.openLink)}
214
- />
215
- </>
216
- )}
217
- </UniversalLink>
218
- </div>
219
- )}
61
+ <div className={'slide-wrapper'} role="presentation">
62
+ <SlideItemAppearance {...props} {...appearanceProp} intl={intl} />
220
63
  </div>
221
- </div>
64
+ </SingleSlideWrapper>
222
65
  );
223
66
  };
224
67
 
@@ -235,13 +78,28 @@ const SliderTemplate = ({
235
78
  show_dots = true,
236
79
  autoplay = false,
237
80
  autoplay_speed = 2, //seconds
81
+ slide_appearance = 'default',
238
82
  reactSlick,
83
+ block,
84
+ ...otherProps
239
85
  }) => {
86
+ const block_id = block;
240
87
  const intl = useIntl();
88
+
241
89
  const [userAutoplay, setUserAutoplay] = useState(autoplay);
242
- const nSlidesToShow = parseInt(slidesToShow);
90
+ const nSlidesToShow =
91
+ items.length < parseInt(slidesToShow)
92
+ ? items.length
93
+ : parseInt(slidesToShow);
243
94
  const Slider = reactSlick.default;
244
- const { slider, focusNext } = useSlider(userAutoplay);
95
+ const {
96
+ slider,
97
+ focusSlide,
98
+ SliderNextArrow,
99
+ SliderPrevArrow,
100
+ handleSlideKeydown,
101
+ } = useSlider(userAutoplay, setUserAutoplay, block_id);
102
+
245
103
  const toggleAutoplay = () => {
246
104
  if (!slider?.current) return;
247
105
  if (userAutoplay) {
@@ -313,11 +171,11 @@ const SliderTemplate = ({
313
171
  focusOnSelect: false,
314
172
  draggable: true,
315
173
  accessibility: true,
316
- nextArrow: <NextArrow intl={intl} focusNext={focusNext} />,
317
- prevArrow: <PrevArrow intl={intl} focusNext={focusNext} />,
174
+ nextArrow: <SliderNextArrow intl={intl} />,
175
+ prevArrow: <SliderPrevArrow intl={intl} />,
318
176
  appendDots: renderCustomDots,
319
177
  // Custom handling of focus for a11y
320
- afterChange: focusNext,
178
+ afterChange: focusSlide,
321
179
  responsive: [
322
180
  {
323
181
  breakpoint: 980,
@@ -333,7 +191,9 @@ const SliderTemplate = ({
333
191
  <div
334
192
  className={cx(`sliderTemplate slidesToShow-${nSlidesToShow || 1}`, {
335
193
  'no-margin': full_width,
194
+ ['appearance_' + slide_appearance]: slide_appearance,
336
195
  })}
196
+ id={'slider_' + block_id}
337
197
  >
338
198
  <Container className="px-4">
339
199
  {title && (
@@ -349,30 +209,11 @@ const SliderTemplate = ({
349
209
  'full-width': full_width,
350
210
  })}
351
211
  >
352
- <div className="it-carousel-all it-card-bg">
212
+ <CarouselWrapper className="it-card-bg">
353
213
  {items?.length > nSlidesToShow && (
354
- <div className="play-pause-wrapper">
355
- <button
356
- onClick={toggleAutoplay}
357
- title={
358
- userAutoplay
359
- ? intl.formatMessage(messages.pause)
360
- : intl.formatMessage(messages.play)
361
- }
362
- tabIndex={0}
363
- >
364
- <Icon
365
- key={userAutoplay ? 'pause' : 'play'}
366
- icon={userAutoplay ? 'pause' : 'play'}
367
- title={
368
- userAutoplay
369
- ? intl.formatMessage(messages.pause)
370
- : intl.formatMessage(messages.play)
371
- }
372
- />
373
- <span>{userAutoplay ? 'pause' : 'play'}</span>
374
- </button>
375
- </div>
214
+ <ButtonPlayPause onClick={toggleAutoplay} autoplay={userAutoplay}>
215
+ <span>{userAutoplay ? 'pause' : 'play'}</span>
216
+ </ButtonPlayPause>
376
217
  )}
377
218
 
378
219
  <Slider {...settings} ref={slider}>
@@ -383,6 +224,8 @@ const SliderTemplate = ({
383
224
  sizes: `max-width(991px) 620px, ${1300 / nSlidesToShow}px`,
384
225
  critical: true,
385
226
  });
227
+ const nextIndex = index < items.length - 1 ? index + 1 : null;
228
+ const prevIndex = index > 0 ? index - 1 : null;
386
229
  return (
387
230
  <Slide
388
231
  image={image}
@@ -390,15 +233,22 @@ const SliderTemplate = ({
390
233
  full_width={full_width}
391
234
  item={item}
392
235
  show_image_title={show_image_title}
393
- intl={intl}
394
- setUserAutoplay={setUserAutoplay}
395
236
  userAutoplay={userAutoplay}
396
237
  slider={slider}
238
+ appearance={slide_appearance}
239
+ appearanceProp={otherProps}
240
+ block_id={block_id}
241
+ aria-label={
242
+ !show_image_title && slide_appearance === 'default'
243
+ ? item.title
244
+ : null
245
+ }
246
+ onKeyDown={handleSlideKeydown(index, prevIndex, nextIndex)}
397
247
  />
398
248
  );
399
249
  })}
400
250
  </Slider>
401
- </div>
251
+ </CarouselWrapper>
402
252
  </div>
403
253
  <ListingLinkMore title={linkTitle} href={linkHref} className="my-4" />
404
254
  </Container>
@@ -7,10 +7,14 @@ import React from 'react';
7
7
  import PropTypes from 'prop-types';
8
8
 
9
9
  import { injectLazyLibs } from '@plone/volto/helpers/Loadable/Loadable';
10
- import { useIntl, defineMessages } from 'react-intl';
11
- import { Icon } from 'design-comuni-plone-theme/components/ItaliaTheme';
12
- import { FontAwesomeIcon } from 'design-comuni-plone-theme/components/ItaliaTheme';
13
- import { Button, Container } from 'design-react-kit';
10
+
11
+ import {
12
+ Icon,
13
+ CarouselWrapper,
14
+ NextArrow,
15
+ PrevArrow,
16
+ } from 'design-comuni-plone-theme/components/ItaliaTheme';
17
+ import { Container } from 'design-react-kit';
14
18
  import { UniversalLink } from '@plone/volto/components';
15
19
 
16
20
  /**
@@ -19,49 +23,7 @@ import { UniversalLink } from '@plone/volto/components';
19
23
  * @extends Component
20
24
  */
21
25
 
22
- const messages = defineMessages({
23
- videogallery_next_arrow: {
24
- id: 'videogallery_next_arrow',
25
- defaultMessage: 'Prossimo video',
26
- },
27
- videogallery_prev_arrow: {
28
- id: 'videogallery_prev_arrow',
29
- defaultMessage: 'Video precedente',
30
- },
31
- });
32
-
33
26
  const Body = ({ data, children, nItems = 0, reactSlick }) => {
34
- const intl = useIntl();
35
-
36
- const NextArrow = (props) => {
37
- const { onClick, className } = props;
38
- return (
39
- <Button
40
- outline
41
- color={'unset'}
42
- className={className}
43
- onClick={onClick}
44
- aria-label={intl.formatMessage(messages.videogallery_next_arrow)}
45
- >
46
- <FontAwesomeIcon icon={['fas', 'chevron-right']} />
47
- </Button>
48
- );
49
- };
50
- const PrevArrow = (props) => {
51
- const { onClick, className } = props;
52
- return (
53
- <Button
54
- outline
55
- color={'unset'}
56
- className={className}
57
- onClick={onClick}
58
- aria-label={intl.formatMessage(messages.videogallery_prev_arrow)}
59
- >
60
- <FontAwesomeIcon icon={['fas', 'chevron-left']} />
61
- </Button>
62
- );
63
- };
64
-
65
27
  const Slider = reactSlick.default;
66
28
 
67
29
  const settings = {
@@ -127,9 +89,9 @@ const Body = ({ data, children, nItems = 0, reactSlick }) => {
127
89
  )}
128
90
 
129
91
  <div className="slider-container">
130
- <div className="it-carousel-all">
92
+ <CarouselWrapper>
131
93
  <Slider {...settings}>{children}</Slider>
132
- </div>
94
+ </CarouselWrapper>
133
95
  </div>
134
96
  </Container>
135
97
  </div>
@@ -14,6 +14,7 @@ import {
14
14
  import Sidebar from 'design-comuni-plone-theme/components/ItaliaTheme/Blocks/VideoGallery/Sidebar';
15
15
  import Body from 'design-comuni-plone-theme/components/ItaliaTheme/Blocks/VideoGallery/Body';
16
16
  import EditBlock from 'design-comuni-plone-theme/components/ItaliaTheme/Blocks/VideoGallery/Block/EditBlock';
17
+ import { SingleSlideWrapper } from 'design-comuni-plone-theme/components/ItaliaTheme';
17
18
 
18
19
  const messages = defineMessages({
19
20
  addItem: {
@@ -51,14 +52,14 @@ class Edit extends SubblocksEdit {
51
52
  <SubblocksWrapper node={this.node}>
52
53
  <Body {...this.props} nItems={this.state.subblocks?.length}>
53
54
  {this.state.subblocks.map((subblock, subindex) => (
54
- <div className="it-single-slide-wrapper" key={subblock.id}>
55
+ <SingleSlideWrapper key={subblock.id} index={subindex}>
55
56
  <EditBlock
56
57
  data={subblock}
57
58
  index={subindex}
58
59
  selected={this.isSubblockSelected(subindex)}
59
60
  {...this.subblockProps}
60
61
  />
61
- </div>
62
+ </SingleSlideWrapper>
62
63
  ))}
63
64
  {this.state.subblocks.length === 0 && (
64
65
  <div>{this.props.intl.formatMessage(messages.noVideos)}</div>
@@ -7,6 +7,7 @@ import React from 'react';
7
7
  import PropTypes from 'prop-types';
8
8
  import Body from './Body';
9
9
  import ViewBlock from './Block/ViewBlock';
10
+ import { SingleSlideWrapper } from 'design-comuni-plone-theme/components/ItaliaTheme';
10
11
 
11
12
  /**
12
13
  * View icons blocks class.
@@ -18,9 +19,9 @@ const View = ({ data, block }) => {
18
19
  <div className="block video_gallery">
19
20
  <Body data={data} nItems={data.subblocks?.length}>
20
21
  {data.subblocks.map((subblock, subindex) => (
21
- <div className="it-single-slide-wrapper" key={subindex}>
22
+ <SingleSlideWrapper key={subindex} index={subindex}>
22
23
  <ViewBlock data={subblock} />
23
- </div>
24
+ </SingleSlideWrapper>
24
25
  ))}
25
26
  </Body>
26
27
  </div>
@@ -11,6 +11,7 @@ import { isEqual } from 'lodash';
11
11
  import { UniversalLink } from '@plone/volto/components';
12
12
  import { Row, Col, LinkList, LinkListItem } from 'design-react-kit';
13
13
  import { SectionIcon } from 'design-comuni-plone-theme/components/ItaliaTheme';
14
+ import { Icon } from 'design-comuni-plone-theme/components/ItaliaTheme';
14
15
  import config from '@plone/volto/registry';
15
16
 
16
17
  const messages = defineMessages({
@@ -35,6 +36,8 @@ const FooterNavigation = () => {
35
36
  );
36
37
  }
37
38
 
39
+ const markFooterLinks = config.settings.siteProperties.markFooterLinks;
40
+
38
41
  return show_navigation ? (
39
42
  <>
40
43
  {items && (
@@ -65,6 +68,9 @@ const FooterNavigation = () => {
65
68
  }
66
69
  >
67
70
  {item.title}
71
+ {markFooterLinks && (
72
+ <Icon icon="it-arrow-right" color="white" size="sm" />
73
+ )}
68
74
  </Link>
69
75
  </h4>
70
76
  {/* DEPRECATED: isFooterCollapsed to be removed in version 12 */}
@@ -3,21 +3,50 @@
3
3
  * @module components/ItaliaTheme/Header/HeaderSlim/TertiaryMenu
4
4
  */
5
5
 
6
- import React from 'react';
6
+ import React, { useEffect } from 'react';
7
+ import cx from 'classnames';
8
+ import { useDispatch, useSelector } from 'react-redux';
9
+ import { useLocation } from 'react-router-dom';
7
10
  import { Nav, NavItem, NavLink } from 'design-react-kit';
8
11
  import { UniversalLink } from '@plone/volto/components';
12
+ import { flattenToAppURL } from '@plone/volto/helpers';
9
13
  import { useIntl } from 'react-intl';
10
- import config from '@plone/volto/registry';
14
+ import { getSiteProperty } from 'design-comuni-plone-theme/helpers';
15
+ import { getSlimHeader, getItemsByPath } from 'volto-slimheader';
11
16
 
12
17
  const TertiaryMenu = () => {
13
18
  const intl = useIntl();
14
- let menu = config.settings.siteProperties.headerslimTertiaryMenu;
15
- const items = menu[intl.locale];
19
+ const pathname = useLocation().pathname;
20
+ const dispatch = useDispatch();
21
+
22
+ const slimHeader = useSelector((state) => state.slimHeader?.result);
23
+ const slimHeaderItems = getItemsByPath(slimHeader, pathname)
24
+ ?.filter((item) => item.visible)
25
+ .map((item) => {
26
+ return {
27
+ url: item.href || flattenToAppURL(item.linkUrl?.[0]?.['@id']) || '/',
28
+ title: item.title,
29
+ inEvidence:item.inEvidence
30
+ };
31
+ });
32
+
33
+ const staticMenu =
34
+ getSiteProperty('headerslimTertiaryMenu', intl.locale) ?? [];
35
+
36
+ useEffect(() => {
37
+ dispatch(getSlimHeader());
38
+ }, [dispatch]);
39
+
40
+ const items = slimHeaderItems?.length > 0 ? slimHeaderItems : staticMenu;
16
41
 
17
42
  return items?.length > 0 ? (
18
43
  <Nav vertical={false} className="tertiary-menu">
19
44
  {items.map((navitem, id) => (
20
- <NavItem tag="li" key={id}>
45
+ <NavItem
46
+ tag="li"
47
+ key={id}
48
+ className={cx('', { 'in-evidence': navitem.inEvidence })}
49
+ >
21
50
  <NavLink href={navitem.url} tag={UniversalLink}>
22
51
  <span>{navitem.title}</span>
23
52
  </NavLink>
@@ -37,6 +37,8 @@ const FontAwesomeIcon = (props) => {
37
37
  ? 'brands'
38
38
  : prefixKey === 'far'
39
39
  ? 'regular'
40
+ : prefixKey != null
41
+ ? prefixKey
40
42
  : 'solid',
41
43
  iconName,
42
44
  ];
@@ -114,11 +114,12 @@ const MegaMenu = ({ item, pathname }) => {
114
114
  return item.linkUrl?.length > 0 ? (
115
115
  <NavItem tag="li" active={isItemActive} role="none">
116
116
  <NavLink
117
+ className={isItemActive ? 'focus--mouse' : ''}
117
118
  href={item.linkUrl === '' ? '/' : null}
118
119
  item={item.linkUrl[0]?.['@id'] ? item.linkUrl[0] : '#'}
119
120
  tag={UniversalLink}
120
- active={isItemActive}
121
121
  data-element={item.id_lighthouse}
122
+ active={isItemActive}
122
123
  role="menuitem"
123
124
  >
124
125
  <span dangerouslySetInnerHTML={{ __html: item.title }}></span>
@@ -239,7 +240,12 @@ const MegaMenu = ({ item, pathname }) => {
239
240
  }
240
241
 
241
242
  return (
242
- <NavItem tag="li" className="megamenu" active={isItemActive} role="none">
243
+ <NavItem
244
+ tag="li"
245
+ className={isItemActive ? 'focus--mouse megamenu' : 'megamenu'}
246
+ active={isItemActive}
247
+ role="none"
248
+ >
243
249
  <UncontrolledDropdown
244
250
  nav
245
251
  inNavbar
@@ -53,6 +53,9 @@ const MenuSecondary = ({ pathname }) => {
53
53
  <NavLink
54
54
  href={url === '' ? '/' : flattenToAppURL(url)}
55
55
  tag={UniversalLink}
56
+ className={
57
+ isMenuActive(url) ? 'focus--mouse megamenu' : 'megamenu'
58
+ }
56
59
  active={isMenuActive(url)}
57
60
  data-element={item.id_lighthouse}
58
61
  role="menuitem"
@@ -0,0 +1,48 @@
1
+ import React from 'react';
2
+ import { defineMessages, useIntl } from 'react-intl';
3
+ import { Icon } from 'design-comuni-plone-theme/components/ItaliaTheme';
4
+ const messages = defineMessages({
5
+ play: {
6
+ id: 'Play slider',
7
+ defaultMessage: 'Seleziona per riprodurre lo slider',
8
+ },
9
+ pause: {
10
+ id: 'Pause slider',
11
+ defaultMessage: 'Seleziona per mettere in pausa lo slider',
12
+ },
13
+ });
14
+ const ButtonPlayPause = ({ onClick, autoplay, showLabel = true, children }) => {
15
+ const intl = useIntl();
16
+
17
+ return (
18
+ <div className="play-pause-wrapper">
19
+ <button
20
+ onClick={onClick}
21
+ title={
22
+ autoplay
23
+ ? intl.formatMessage(messages.pause)
24
+ : intl.formatMessage(messages.play)
25
+ }
26
+ aria-label={
27
+ autoplay
28
+ ? intl.formatMessage(messages.pause)
29
+ : intl.formatMessage(messages.play)
30
+ }
31
+ tabIndex={0}
32
+ >
33
+ <Icon
34
+ key={autoplay ? 'pause' : 'play'}
35
+ icon={autoplay ? 'pause' : 'play'}
36
+ title={
37
+ autoplay
38
+ ? intl.formatMessage(messages.pause)
39
+ : intl.formatMessage(messages.play)
40
+ }
41
+ />
42
+ {showLabel && <span>{autoplay ? 'pause' : 'play'}</span>}
43
+ </button>
44
+ </div>
45
+ );
46
+ };
47
+
48
+ export default ButtonPlayPause;