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
@@ -4,22 +4,26 @@
4
4
  import 'slick-carousel/slick/slick.css';
5
5
  import 'design-comuni-plone-theme/components/slick-carousel/slick/slick-theme.css';
6
6
 
7
+ import React, { useRef, useState } from 'react';
8
+ import { defineMessages, useIntl } from 'react-intl';
9
+ import cx from 'classnames';
10
+ import PropTypes from 'prop-types';
7
11
  import { Col, Container, Row } from 'design-react-kit';
12
+
13
+ import { UniversalLink } from '@plone/volto/components';
14
+ import { flattenToAppURL } from '@plone/volto/helpers';
15
+ import { injectLazyLibs } from '@plone/volto/helpers/Loadable/Loadable';
16
+
8
17
  import {
9
18
  ListingImage,
10
19
  ListingLinkMore,
11
20
  NextArrow,
12
21
  PrevArrow,
22
+ SingleSlideWrapper,
23
+ CarouselWrapper,
24
+ ButtonPlayPause,
13
25
  } from 'design-comuni-plone-theme/components/ItaliaTheme';
14
- import React, { useRef, useState } from 'react';
15
- import { defineMessages, useIntl } from 'react-intl';
16
26
  import { GalleryPreview } from 'design-comuni-plone-theme/components/ItaliaTheme';
17
- import { Icon } from 'design-comuni-plone-theme/components/ItaliaTheme';
18
- import PropTypes from 'prop-types';
19
- import { UniversalLink } from '@plone/volto/components';
20
- import cx from 'classnames';
21
- import { flattenToAppURL } from '@plone/volto/helpers';
22
- import { injectLazyLibs } from '@plone/volto/helpers/Loadable/Loadable';
23
27
 
24
28
  const messages = defineMessages({
25
29
  viewImage: {
@@ -30,14 +34,6 @@ const messages = defineMessages({
30
34
  id: 'gallery_viewPreview',
31
35
  defaultMessage: "Vedi l'anteprima di",
32
36
  },
33
- play: {
34
- id: 'Play slider',
35
- defaultMessage: 'Play',
36
- },
37
- pause: {
38
- id: 'Pause slider',
39
- defaultMessage: 'Metti in pausa',
40
- },
41
37
  });
42
38
 
43
39
  const PhotogalleryTemplate = ({
@@ -116,21 +112,12 @@ const PhotogalleryTemplate = ({
116
112
  prevArrow: <PrevArrow />,
117
113
  appendDots: (dots) => (
118
114
  <div>
119
- <div className="play-pause-wrapper">
120
- <button
121
- onClick={() => toggleAutoplay()}
122
- title={
123
- autoplay
124
- ? intl.formatMessage(messages.pause)
125
- : intl.formatMessage(messages.play)
126
- }
127
- >
128
- <Icon
129
- key={autoplay ? 'pause' : 'play'}
130
- icon={autoplay ? 'pause' : 'play'}
131
- />
132
- </button>
133
- </div>
115
+ <ButtonPlayPause
116
+ onClick={toggleAutoplay}
117
+ autoplay={autoplay}
118
+ showLabel={false}
119
+ />
120
+
134
121
  <ul className="slick-dots" style={{ margin: '0px' }}>
135
122
  {dots}
136
123
  </ul>
@@ -162,7 +149,7 @@ const PhotogalleryTemplate = ({
162
149
  </Row>
163
150
  )}
164
151
  <div className="slider-container px-4 px-md-0">
165
- <div className="it-carousel-all it-card-bg">
152
+ <CarouselWrapper className="it-card-bg">
166
153
  <Slider {...settings} ref={slider}>
167
154
  {items.map((item, i) => {
168
155
  const image = ListingImage({
@@ -178,11 +165,12 @@ const PhotogalleryTemplate = ({
178
165
  }px`,
179
166
  });
180
167
  return (
181
- <div
182
- className={cx('it-single-slide-wrapper', {
168
+ <SingleSlideWrapper
169
+ className={cx('', {
183
170
  'single-slide': items.length === 1,
184
171
  })}
185
172
  key={item['@id']}
173
+ index={i}
186
174
  >
187
175
  {!show_image_popup ? (
188
176
  <UniversalLink
@@ -218,7 +206,7 @@ const PhotogalleryTemplate = ({
218
206
  {figure(image, item)}
219
207
  </a>
220
208
  )}
221
- </div>
209
+ </SingleSlideWrapper>
222
210
  );
223
211
  })}
224
212
  </Slider>
@@ -231,7 +219,7 @@ const PhotogalleryTemplate = ({
231
219
  items={items}
232
220
  />
233
221
  ) : null}
234
- </div>
222
+ </CarouselWrapper>
235
223
  </div>
236
224
  <ListingLinkMore
237
225
  title={linkTitle}
@@ -0,0 +1,177 @@
1
+ import React from 'react';
2
+ import PropTypes from 'prop-types';
3
+ import { defineMessages, useIntl } from 'react-intl';
4
+ import moment from 'moment';
5
+ import cx from 'classnames';
6
+ import {
7
+ Card,
8
+ CardBody,
9
+ CardTitle,
10
+ CardText,
11
+ CardReadMore,
12
+ } from 'design-react-kit';
13
+ import { injectLazyLibs } from '@plone/volto/helpers/Loadable/Loadable';
14
+ import { UniversalLink } from '@plone/volto/components';
15
+
16
+ import { CardCategory } from 'design-comuni-plone-theme/components/ItaliaTheme';
17
+ import { getCategory } from 'design-comuni-plone-theme/components/ItaliaTheme/Blocks/Listing/Commons/utils';
18
+ import {
19
+ getItemIcon,
20
+ ListingCategory,
21
+ ListingText,
22
+ } from 'design-comuni-plone-theme/components/ItaliaTheme';
23
+ import {
24
+ getCalendarDate,
25
+ getEventRecurrenceMore,
26
+ getComponentWithFallback,
27
+ } from 'design-comuni-plone-theme/helpers';
28
+
29
+ const messages = defineMessages({
30
+ card_detail_label: { id: 'Card detail label', defaultMessage: 'Vedi' },
31
+ publication_date: {
32
+ id: 'publication_date',
33
+ defaultMessage: 'Data di pubblicazione',
34
+ },
35
+ update_date: {
36
+ id: 'update_date',
37
+ defaultMessage: 'Data di aggiornamento',
38
+ },
39
+ });
40
+
41
+ const SimpleCardDefault = (props) => {
42
+ const intl = useIntl();
43
+
44
+ moment.locale(intl.locale);
45
+
46
+ const {
47
+ item,
48
+ isEditMode,
49
+ show_icon = true,
50
+ show_section = true,
51
+ show_type,
52
+ show_description = true,
53
+ show_detail_link,
54
+ detail_link_label,
55
+ hide_dates,
56
+ id_lighthouse,
57
+ rrule,
58
+ index,
59
+ } = props;
60
+
61
+ const getItemClass = (item) => {
62
+ let className = null;
63
+ switch (item['@type']) {
64
+ case 'News Item':
65
+ className =
66
+ item.tipologia_notizia
67
+ ?.map?.((tipologia) =>
68
+ tipologia.token.toLowerCase().replace(' ', '_'),
69
+ )
70
+ .join(' ') ?? '';
71
+ break;
72
+ default:
73
+ className = null;
74
+ break;
75
+ }
76
+ return className;
77
+ };
78
+
79
+ const icon = show_icon ? getItemIcon(item) : null;
80
+ const itemTitle = item.title || item.id;
81
+ const date = hide_dates ? null : getCalendarDate(item, rrule.rrulestr);
82
+ const eventRecurrenceMore = hide_dates
83
+ ? null
84
+ : getEventRecurrenceMore(item, isEditMode);
85
+ const listingText = show_description ? <ListingText item={item} /> : null;
86
+ const category = getCategory(item, show_type, show_section, props);
87
+ const type = item['@type'];
88
+
89
+ const BlockExtraTags = getComponentWithFallback({
90
+ name: 'BlockExtraTags',
91
+ dependencies: ['SimpleCardDefault', type],
92
+ }).component;
93
+
94
+ return (
95
+ <Card
96
+ className={`align-items-top rounded shadow no-after ${getItemClass(
97
+ item,
98
+ )} simple-card-default-item`}
99
+ noWrapper
100
+ teaser
101
+ key={index}
102
+ >
103
+ <CardBody
104
+ className={cx('', {
105
+ 'pb-5': show_detail_link || eventRecurrenceMore,
106
+ })}
107
+ >
108
+ {(icon || category || date) && (
109
+ <CardCategory iconName={icon} date={date}>
110
+ {category && (
111
+ <span className="text fw-bold">
112
+ <ListingCategory category={category} item={item} />
113
+ </span>
114
+ )}
115
+ </CardCategory>
116
+ )}
117
+ <CardTitle tag="h3">
118
+ <UniversalLink
119
+ item={!isEditMode ? item : null}
120
+ href={isEditMode ? '#' : null}
121
+ data-element={id_lighthouse}
122
+ tabIndex={0}
123
+ >
124
+ {itemTitle}
125
+ </UniversalLink>
126
+ </CardTitle>
127
+ {listingText && (
128
+ <CardText className={cx('', { 'mb-5': eventRecurrenceMore })}>
129
+ {listingText}
130
+ {(type === 'Modulo' || type === 'Documento') && !hide_dates && (
131
+ <div className="document-date mt-3">
132
+ {item?.effective && (
133
+ <p className="mb-0">
134
+ <strong>
135
+ {intl.formatMessage(messages.publication_date)}:{' '}
136
+ </strong>
137
+ {moment(item.effective).format('DD-MM-YYYY')}
138
+ </p>
139
+ )}
140
+ {item?.modified && (
141
+ <p className="mb-0">
142
+ <strong>
143
+ {intl.formatMessage(messages.update_date)}:{' '}
144
+ </strong>
145
+ {moment(item.modified).format('DD-MM-YYYY')}
146
+ </p>
147
+ )}
148
+ </div>
149
+ )}
150
+ </CardText>
151
+ )}
152
+ <BlockExtraTags {...props} item={item} itemIndex={index} />
153
+ {eventRecurrenceMore}
154
+ {show_detail_link && (
155
+ <CardReadMore
156
+ iconName="it-arrow-right"
157
+ tag={UniversalLink}
158
+ item={!isEditMode ? item : null}
159
+ href={isEditMode ? '#' : null}
160
+ text={
161
+ detail_link_label ||
162
+ intl.formatMessage(messages.card_detail_label)
163
+ }
164
+ aria-hidden="true"
165
+ />
166
+ )}
167
+ </CardBody>
168
+ </Card>
169
+ );
170
+ };
171
+
172
+ SimpleCardDefault.propTypes = {
173
+ item: PropTypes.any.isRequired,
174
+ isEditMode: PropTypes.bool,
175
+ };
176
+
177
+ export default injectLazyLibs(['rrule'])(SimpleCardDefault);
@@ -1,76 +1,25 @@
1
1
  import React, { useState } from 'react';
2
2
  import PropTypes from 'prop-types';
3
- import { defineMessages, useIntl } from 'react-intl';
4
- import moment from 'moment';
5
- import { v4 as uuid } from 'uuid';
6
3
  import cx from 'classnames';
7
- import {
8
- Card,
9
- CardBody,
10
- CardTitle,
11
- CardText,
12
- CardReadMore,
13
- Button,
14
- Row,
15
- Col,
16
- } from 'design-react-kit';
17
- import { injectLazyLibs } from '@plone/volto/helpers/Loadable/Loadable';
18
- import { UniversalLink } from '@plone/volto/components';
19
-
20
- import { CardCategory } from 'design-comuni-plone-theme/components/ItaliaTheme';
21
- import { getCategory } from 'design-comuni-plone-theme/components/ItaliaTheme/Blocks/Listing/Commons/utils';
22
- import {
23
- getItemIcon,
24
- ListingCategory,
25
- ListingText,
26
- ListingLinkMore,
27
- } from 'design-comuni-plone-theme/components/ItaliaTheme';
28
- import {
29
- getCalendarDate,
30
- getEventRecurrenceMore,
31
- getComponentWithFallback,
32
- } from 'design-comuni-plone-theme/helpers';
33
-
34
- const messages = defineMessages({
35
- card_detail_label: { id: 'Card detail label', defaultMessage: 'Vedi' },
36
- publication_date: {
37
- id: 'publication_date',
38
- defaultMessage: 'Data di pubblicazione',
39
- },
40
- update_date: {
41
- id: 'update_date',
42
- defaultMessage: 'Data di aggiornamento',
43
- },
44
- });
4
+ import { Button, Row, Col } from 'design-react-kit';
5
+ import { v4 as uuid } from 'uuid';
6
+ import SimpleCardDefault from 'design-comuni-plone-theme/components/ItaliaTheme/Blocks/Listing/SimpleCard/Card/SimpleCardDefault';
7
+ import { ListingLinkMore } from 'design-comuni-plone-theme/components/ItaliaTheme';
45
8
 
46
9
  const SimpleCardTemplateDefault = (props) => {
47
- const intl = useIntl();
48
-
49
- moment.locale(intl.locale);
50
-
51
10
  const {
52
11
  items,
53
- isEditMode,
54
12
  linkTitle,
55
13
  linkHref,
56
14
  linkAlign,
57
15
  titleLine,
58
- show_icon = true,
59
- show_section = true,
60
- show_type,
61
- show_description = true,
62
- show_detail_link,
63
- detail_link_label,
64
16
  title,
65
17
  show_block_bg,
66
- hide_dates,
67
18
  path_filters,
68
19
  show_path_filters,
69
20
  addFilters,
70
21
  additionalFilters = [],
71
- id_lighthouse,
72
22
  linkmore_id_lighthouse,
73
- rrule,
74
23
  } = props;
75
24
 
76
25
  const resultsUID = uuid();
@@ -85,24 +34,6 @@ const SimpleCardTemplateDefault = (props) => {
85
34
 
86
35
  const [pathFilter, setPathFilter] = useState(currentPathFilter?.[0] || null);
87
36
 
88
- const getItemClass = (item) => {
89
- let className = null;
90
- switch (item['@type']) {
91
- case 'News Item':
92
- className =
93
- item.tipologia_notizia
94
- ?.map?.((tipologia) =>
95
- tipologia.token.toLowerCase().replace(' ', '_'),
96
- )
97
- .join(' ') ?? '';
98
- break;
99
- default:
100
- className = null;
101
- break;
102
- }
103
- return className;
104
- };
105
-
106
37
  const path_filters_buttons =
107
38
  show_path_filters && path_filters
108
39
  ? Object.keys(path_filters)
@@ -185,101 +116,9 @@ const SimpleCardTemplateDefault = (props) => {
185
116
  className="card-wrapper card-teaser-wrapper card-teaser-wrapper-equal card-teaser-block-3 mb-3"
186
117
  id={resultsUID + '_results'}
187
118
  >
188
- {items.map((item, index) => {
189
- const icon = show_icon ? getItemIcon(item) : null;
190
- const itemTitle = item.title || item.id;
191
- const date = hide_dates
192
- ? null
193
- : getCalendarDate(item, rrule.rrulestr);
194
- const eventRecurrenceMore = hide_dates
195
- ? null
196
- : getEventRecurrenceMore(item, isEditMode);
197
- const listingText = show_description ? (
198
- <ListingText item={item} />
199
- ) : null;
200
- const category = getCategory(item, show_type, show_section, props);
201
- const type = item['@type'];
202
-
203
- const BlockExtraTags = getComponentWithFallback({
204
- name: 'BlockExtraTags',
205
- dependencies: ['SimpleCardTemplateDefault', type],
206
- }).component;
207
-
208
- return (
209
- <Card
210
- className={`align-items-top rounded shadow ${getItemClass(item)}`}
211
- noWrapper
212
- teaser
213
- key={index}
214
- >
215
- <CardBody
216
- className={cx('', {
217
- 'pb-5': show_detail_link || eventRecurrenceMore,
218
- })}
219
- >
220
- {(icon || category || date) && (
221
- <CardCategory iconName={icon} date={date}>
222
- {category && (
223
- <span className="text fw-bold">
224
- <ListingCategory category={category} item={item} />
225
- </span>
226
- )}
227
- </CardCategory>
228
- )}
229
- <CardTitle tag="h3">
230
- <UniversalLink
231
- item={!isEditMode ? item : null}
232
- href={isEditMode ? '#' : null}
233
- data-element={id_lighthouse}
234
- >
235
- {itemTitle}
236
- </UniversalLink>
237
- </CardTitle>
238
- {listingText && (
239
- <CardText className={cx('', { 'mb-5': eventRecurrenceMore })}>
240
- {listingText}
241
- {(type === 'Modulo' || type === 'Documento') &&
242
- !hide_dates && (
243
- <div className="document-date mt-3">
244
- {item?.effective && (
245
- <p className="mb-0">
246
- <strong>
247
- {intl.formatMessage(messages.publication_date)}:{' '}
248
- </strong>
249
- {moment(item.effective).format('DD-MM-YYYY')}
250
- </p>
251
- )}
252
- {item?.modified && (
253
- <p className="mb-0">
254
- <strong>
255
- {intl.formatMessage(messages.update_date)}:{' '}
256
- </strong>
257
- {moment(item.modified).format('DD-MM-YYYY')}
258
- </p>
259
- )}
260
- </div>
261
- )}
262
- </CardText>
263
- )}
264
- <BlockExtraTags {...props} item={item} itemIndex={index} />
265
- {eventRecurrenceMore}
266
- {show_detail_link && (
267
- <CardReadMore
268
- iconName="it-arrow-right"
269
- tag={UniversalLink}
270
- item={!isEditMode ? item : null}
271
- href={isEditMode ? '#' : null}
272
- text={
273
- detail_link_label ||
274
- intl.formatMessage(messages.card_detail_label)
275
- }
276
- aria-hidden="true"
277
- />
278
- )}
279
- </CardBody>
280
- </Card>
281
- );
282
- })}
119
+ {items.map((item, index) => (
120
+ <SimpleCardDefault {...props} item={item} index={index} key={index} />
121
+ ))}
283
122
  </div>
284
123
 
285
124
  <ListingLinkMore
@@ -295,9 +134,8 @@ const SimpleCardTemplateDefault = (props) => {
295
134
 
296
135
  SimpleCardTemplateDefault.propTypes = {
297
136
  items: PropTypes.arrayOf(PropTypes.any).isRequired,
298
- isEditMode: PropTypes.bool,
299
137
  linkTitle: PropTypes.any,
300
138
  linkHref: PropTypes.any,
301
139
  };
302
140
 
303
- export default injectLazyLibs(['rrule'])(SimpleCardTemplateDefault);
141
+ export default SimpleCardTemplateDefault;
@@ -0,0 +1,65 @@
1
+ import React from 'react';
2
+ import { defineMessages } from 'react-intl';
3
+ import { UniversalLink } from '@plone/volto/components';
4
+ import { Container } from 'design-react-kit';
5
+ import { Icon } from 'design-comuni-plone-theme/components/ItaliaTheme';
6
+
7
+ const messages = defineMessages({
8
+ openLink: {
9
+ id: 'openLink',
10
+ defaultMessage: 'Apri il link',
11
+ },
12
+ });
13
+ const SlideItemDefault = ({
14
+ item,
15
+ index,
16
+ image,
17
+ show_image_title,
18
+ full_width,
19
+ intl,
20
+ setUserAutoplay,
21
+ userAutoplay,
22
+ slider,
23
+ }) => {
24
+ return (
25
+ <React.Fragment>
26
+ {image ? (
27
+ <figure className="img-wrapper">{image}</figure>
28
+ ) : (
29
+ <div className="img-placeholder"></div>
30
+ )}
31
+ {show_image_title && (
32
+ <div className="slide-title">
33
+ <UniversalLink
34
+ item={item}
35
+ tabIndex={0}
36
+ data-slide={index}
37
+ className={'slide-link no-external-if-link'}
38
+ >
39
+ {full_width ? (
40
+ <Container>
41
+ {item.title}{' '}
42
+ <Icon
43
+ icon="arrow-right"
44
+ key="arrow-right-fw"
45
+ title={intl.formatMessage(messages.openLink)}
46
+ />
47
+ </Container>
48
+ ) : (
49
+ <>
50
+ {item.title}{' '}
51
+ <Icon
52
+ icon="arrow-right"
53
+ key="arrow-right"
54
+ title={intl.formatMessage(messages.openLink)}
55
+ />
56
+ </>
57
+ )}
58
+ </UniversalLink>
59
+ </div>
60
+ )}
61
+ </React.Fragment>
62
+ );
63
+ };
64
+
65
+ export default SlideItemDefault;