design-comuni-plone-theme 12.3.0 → 12.3.1

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 (22) hide show
  1. package/.yarn/install-state.gz +0 -0
  2. package/CHANGELOG.md +17 -0
  3. package/RELEASE.md +11 -0
  4. package/package.json +1 -1
  5. package/publiccode.yml +2 -2
  6. package/src/components/ItaliaTheme/Blocks/Common/SearchFilters/DateFilter.jsx +27 -2
  7. package/src/components/ItaliaTheme/Blocks/Listing/BandiInEvidenceTemplate.jsx +1 -1
  8. package/src/components/ItaliaTheme/Blocks/Listing/CardWithImage/CardWithImageDefault.jsx +9 -8
  9. package/src/components/ItaliaTheme/Blocks/Listing/CardWithSlideUpTextTemplate.jsx +9 -6
  10. package/src/components/ItaliaTheme/Blocks/Listing/Commons/ListingImage.jsx +2 -3
  11. package/src/components/ItaliaTheme/Blocks/Listing/CompleteBlockLinksTemplate.jsx +6 -1
  12. package/src/components/ItaliaTheme/Blocks/Listing/InEvidenceTemplate.jsx +5 -4
  13. package/src/components/ItaliaTheme/Blocks/Listing/RibbonCardTemplate.jsx +5 -4
  14. package/src/components/ItaliaTheme/Blocks/Listing/SimpleCard/Card/SimpleCardDefault.jsx +6 -4
  15. package/src/components/ItaliaTheme/Blocks/Listing/SimpleCard/SimpleCardTemplateCompact.jsx +6 -1
  16. package/src/components/ItaliaTheme/Blocks/Listing/SimpleCard/SimpleCardTemplateOneForRow.jsx +6 -1
  17. package/src/components/ItaliaTheme/Blocks/TextCard/SimpleCard/Edit.jsx +1 -1
  18. package/src/components/ItaliaTheme/Blocks/TextCard/SimpleCard/View.jsx +1 -1
  19. package/src/config/Slate/Link/deserializer.js +5 -1
  20. package/src/theme/ItaliaTheme/Blocks/_completeBlockLinkstemplate.scss +5 -8
  21. package/src/theme/ItaliaTheme/Blocks/_listing.scss +18 -0
  22. package/src/theme/ItaliaTheme/Components/_card.scss +1 -1
Binary file
package/CHANGELOG.md CHANGED
@@ -1,5 +1,22 @@
1
1
  # Changelog
2
2
 
3
+ ## [12.3.1](https://github.com/RedTurtle/design-comuni-plone-theme/compare/v12.3.0...v12.3.1) (2025-08-08)
4
+
5
+
6
+ ### Bug Fixes
7
+
8
+ * **a11y:** fixed titles and images attributes ([#973](https://github.com/RedTurtle/design-comuni-plone-theme/issues/973)) ([bd4cdd6](https://github.com/RedTurtle/design-comuni-plone-theme/commit/bd4cdd6bc4b417d1f0f1f6848e08ba346e0e4240))
9
+ * added state to close the date picker modal after endDate loses focus (Tab exit) ([#981](https://github.com/RedTurtle/design-comuni-plone-theme/issues/981)) ([9329f0e](https://github.com/RedTurtle/design-comuni-plone-theme/commit/9329f0e0ecf8b2588e2b44aecd81f541b3333df4))
10
+ * contentHasImage function + showImage conditions ([#985](https://github.com/RedTurtle/design-comuni-plone-theme/issues/985)) ([855779b](https://github.com/RedTurtle/design-comuni-plone-theme/commit/855779bfdae49d87c87842a5632ef067d471c6f2))
11
+ * image in template "Blocco link completo" ([#971](https://github.com/RedTurtle/design-comuni-plone-theme/issues/971)) ([3622357](https://github.com/RedTurtle/design-comuni-plone-theme/commit/3622357abdb17821cad69a17b7110b28db34ce2d))
12
+ * improved link visibility on images within listing blocks ([#978](https://github.com/RedTurtle/design-comuni-plone-theme/issues/978)) ([2beaedc](https://github.com/RedTurtle/design-comuni-plone-theme/commit/2beaedce9c176f81cc399fb938835192b1aa90c9))
13
+ * slate link deserializer convert <a> without href attribute into simple text ([#982](https://github.com/RedTurtle/design-comuni-plone-theme/issues/982)) ([f7acb30](https://github.com/RedTurtle/design-comuni-plone-theme/commit/f7acb30b3513ff5e4c3dbbb16ba924eb2ef486c4))
14
+
15
+
16
+ ### Documentation
17
+
18
+ * updated publiccode and release log ([598e3e2](https://github.com/RedTurtle/design-comuni-plone-theme/commit/598e3e281838d3bd5124009ffbde811783281dc0))
19
+
3
20
  ## [12.3.0](https://github.com/RedTurtle/design-comuni-plone-theme/compare/v12.2.3...v12.3.0) (2025-07-31)
4
21
 
5
22
 
package/RELEASE.md CHANGED
@@ -41,6 +41,17 @@
41
41
  - ...
42
42
  -->
43
43
 
44
+ ## Versione 12.3.1 (08/08/2025)
45
+
46
+ ### Fix
47
+
48
+ - Migliorata l'accessibilità rimuovendo la visibilità delle immagini di presentazione nei blocchi elenco.
49
+ - Sistemata la semantica dei titoli nei blocchi elenco migliorando così l'accessibilità della pagina.
50
+ - Sistemata la visualizzazione delle immagini all’interno della card del blocco Link completo quando sono in landscape.
51
+ - Ripristinata la funzionalità per mostrare tutte le immagini del blocco elenco o solo quelle della prima fila, se presenti.
52
+ - Ora il calendario si chiude automaticamente quando si passa al campo successivo dopo aver selezionato la data di fine, nei blocchi di ricerca dove è possibile indicare una data di inizio e fine.
53
+ - Migliorata la visualizzazione dei link sulle immagini nei blocchi elenco, rimosso testo non necessario con tipo e dimensione dei file
54
+
44
55
  ## Versione 12.3.0 (31/07/2025)
45
56
 
46
57
  ### Novità
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "design-comuni-plone-theme",
3
3
  "description": "Volto Theme for Italia design guidelines",
4
4
  "license": "GPL-v3",
5
- "version": "12.3.0",
5
+ "version": "12.3.1",
6
6
  "main": "src/index.js",
7
7
  "repository": {
8
8
  "type": "git",
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: '2025-07-31'
230
+ releaseDate: '2025-08-08'
231
231
  softwareType: standalone/web
232
- softwareVersion: 12.3.0
232
+ softwareVersion: 12.3.1
233
233
  url: 'https://github.com/italia/design-comuni-plone-theme'
234
234
  usedBy:
235
235
  - ASP Comuni Modenesi Area Nord
@@ -1,4 +1,4 @@
1
- import React, { useState, useEffect } from 'react';
1
+ import React, { useState, useEffect, useRef } from 'react';
2
2
  import { useIntl, defineMessages } from 'react-intl';
3
3
  import { Icon } from 'design-comuni-plone-theme/components/ItaliaTheme';
4
4
 
@@ -226,6 +226,31 @@ const DateFilter = (props) => {
226
226
  }
227
227
  }, []);
228
228
 
229
+ const endDateInputRef = useRef(null);
230
+
231
+ useEffect(() => {
232
+ const interval = setInterval(() => {
233
+ const endDateInput = document.querySelector(
234
+ `#end-date-filter-${blockID}`,
235
+ );
236
+ if (endDateInput && !endDateInputRef.current) {
237
+ endDateInputRef.current = endDateInput;
238
+ endDateInput.addEventListener('blur', handleEndDateBlur);
239
+ }
240
+ }, 100);
241
+
242
+ return () => {
243
+ clearInterval(interval);
244
+ if (endDateInputRef.current) {
245
+ endDateInputRef.current.removeEventListener('blur', handleEndDateBlur);
246
+ }
247
+ };
248
+ }, []);
249
+
250
+ const handleEndDateBlur = () => {
251
+ setFocusedDateInput(null);
252
+ };
253
+
229
254
  return (
230
255
  <div className="me-lg-3 my-2 my-lg-1 filter-wrapper date-filter">
231
256
  <DateRangePicker
@@ -264,7 +289,7 @@ const DateFilter = (props) => {
264
289
  customCloseIcon={
265
290
  <Icon
266
291
  icon="it-close"
267
- color="white"
292
+ color="black"
268
293
  title={intl.formatMessage(messages.clearDates)}
269
294
  />
270
295
  }
@@ -92,7 +92,7 @@ const BandiInEvidenceTemplate = ({
92
92
  <Col lg={4} sm={6} xs={12} key={index} className="pb-3">
93
93
  <Card key={index} className="listing-item card-bg mt-2">
94
94
  <CardBody>
95
- <CardTitle tag="h3" className="title">
95
+ <CardTitle tag={title ? 'h3' : 'h2'} className="title">
96
96
  <UniversalLink
97
97
  className="bando-title"
98
98
  item={!isEditMode ? item : null}
@@ -51,6 +51,7 @@ const CardWithImageDefault = (props) => {
51
51
  natural_image_size = false,
52
52
  id_lighthouse,
53
53
  rrule,
54
+ title, // title of entire block
54
55
  } = props;
55
56
 
56
57
  const imagesToShow = set_four_columns ? 4 : 3;
@@ -62,10 +63,9 @@ const CardWithImageDefault = (props) => {
62
63
  : getEventRecurrenceMore(item, isEditMode);
63
64
  const listingText = show_description ? <ListingText item={item} /> : null;
64
65
 
65
- const showImage = contentHasImage(
66
- item,
67
- index < imagesToShow || always_show_image,
68
- );
66
+ const showImage =
67
+ contentHasImage(item) && (index < imagesToShow || always_show_image);
68
+
69
69
  const category = getCategory(item, show_type, show_section, props);
70
70
  const topics = show_topics ? item.tassonomia_argomenti : null;
71
71
 
@@ -124,10 +124,11 @@ const CardWithImageDefault = (props) => {
124
124
  </CardCategory>
125
125
  )}
126
126
  <CardTitle
127
- tag="h3"
128
- className={`${
129
- isEventAppointment ? 'rassegna-appointment-title' : ''
130
- }`}
127
+ tag={title ? 'h3' : 'h2'}
128
+ className={cx('', {
129
+ 'rassegna-appointment-title': isEventAppointment,
130
+ h3: !title,
131
+ })}
131
132
  >
132
133
  <UniversalLink
133
134
  item={!isEditMode ? item : null}
@@ -45,6 +45,8 @@ const CardWithSlideUpTextTemplate = (props) => {
45
45
  rrule,
46
46
  } = props;
47
47
 
48
+ const TitleTag = title ? 'h3' : 'h2';
49
+
48
50
  return (
49
51
  <div className="card-slide-text-template">
50
52
  <Container className="px-4 mt-3">
@@ -62,7 +64,7 @@ const CardWithSlideUpTextTemplate = (props) => {
62
64
  const date = hide_dates
63
65
  ? null
64
66
  : getCalendarDate(item, rrule.rrulestr);
65
- const title = item?.title || '';
67
+ const itemTitle = item?.title || '';
66
68
 
67
69
  const BlockExtraTags = getComponentWithFallback({
68
70
  name: 'BlockExtraTags',
@@ -95,14 +97,15 @@ const CardWithSlideUpTextTemplate = (props) => {
95
97
  'auto-margin-link': !category && !date,
96
98
  })}
97
99
  >
98
- <h3
100
+ <TitleTag
99
101
  className={cx('title', {
100
- ellipsis: title.length > 50,
102
+ h3: !title,
103
+ ellipsis: itemTitle.length > 50,
101
104
  })}
102
- title={title.length > 50 ? title : undefined}
105
+ title={itemTitle.length > 50 ? itemTitle : undefined}
103
106
  >
104
- {title.substring(0, 50)}
105
- </h3>
107
+ {itemTitle.substring(0, 50)}
108
+ </TitleTag>
106
109
  </UniversalLink>
107
110
  <div className="box-slide-up">
108
111
  {show_description && item.description && (
@@ -32,7 +32,6 @@ const ListingImage = ({
32
32
  src={DefaultImageSVG}
33
33
  alt=""
34
34
  sizes={sizes}
35
- aria-hidden={true}
36
35
  role="presentation"
37
36
  className="listing-image responsive"
38
37
  style={{
@@ -55,9 +54,9 @@ const ListingImage = ({
55
54
 
56
55
  let commonImageProps = {
57
56
  item,
58
- 'aria-hidden': imageProps.alt || item.title ? false : true,
57
+ 'aria-hidden': imageProps.alt || imageCaption ? '' : true,
59
58
  alt: imageProps.alt ?? imageCaption ?? '',
60
- role: imageProps.alt || item.title ? '' : 'presentation',
59
+ role: imageProps.alt || imageCaption ? '' : 'presentation',
61
60
  className,
62
61
  loading,
63
62
  responsive,
@@ -92,7 +92,12 @@ const CompleteBlockLinksTemplate = (props) => {
92
92
  )}
93
93
  <div>
94
94
  <CardBody>
95
- <CardTitle tag="h3" className="text-secondary">
95
+ <CardTitle
96
+ tag={title ? 'h3' : 'h2'}
97
+ className={cx('text-secondary', {
98
+ h3: !title,
99
+ })}
100
+ >
96
101
  {item.title}
97
102
  {item['@type'] === 'Link' &&
98
103
  !isInternalURL(
@@ -130,10 +130,11 @@ const InEvidenceTemplate = (props) => {
130
130
  </CardCategory>
131
131
  )}
132
132
  <CardTitle
133
- tag="h3"
134
- className={`${
135
- isEventAppointment ? 'rassegna-appointment-title' : ''
136
- }`}
133
+ tag={title ? 'h3' : 'h2'}
134
+ className={cx('', {
135
+ 'rassegna-appointment-title': isEventAppointment,
136
+ h3: !title,
137
+ })}
137
138
  >
138
139
  <UniversalLink
139
140
  item={!isEditMode ? item : null}
@@ -140,10 +140,11 @@ const RibbonCardTemplate = (props) => {
140
140
  >
141
141
  {date && <div className="dates">{date}</div>}
142
142
  <CardTitle
143
- tag="h3"
144
- className={`${
145
- isEventAppointment ? 'rassegna-appointment-title' : ''
146
- }`}
143
+ tag={title ? 'h3' : 'h2'}
144
+ className={cx('', {
145
+ 'rassegna-appointment-title': isEventAppointment,
146
+ h3: !title,
147
+ })}
147
148
  >
148
149
  <UniversalLink
149
150
  item={!isEditMode ? item : null}
@@ -58,6 +58,7 @@ const SimpleCardDefault = (props) => {
58
58
  id_lighthouse,
59
59
  rrule,
60
60
  index,
61
+ title,
61
62
  } = props;
62
63
 
63
64
  const getItemClass = (item) => {
@@ -123,10 +124,11 @@ const SimpleCardDefault = (props) => {
123
124
  </CardCategory>
124
125
  )}
125
126
  <CardTitle
126
- tag="h3"
127
- className={`${
128
- isEventAppointment ? 'rassegna-appointment-title' : ''
129
- }`}
127
+ tag={title ? 'h3' : 'h2'}
128
+ className={cx('', {
129
+ 'rassegna-appointment-title': isEventAppointment,
130
+ h3: !title,
131
+ })}
130
132
  >
131
133
  <UniversalLink
132
134
  item={!isEditMode ? item : null}
@@ -67,7 +67,12 @@ const SimpleCardTemplateCompact = ({
67
67
  </div>
68
68
  )}
69
69
  <CardBody>
70
- <CardTitle tag="h3">
70
+ <CardTitle
71
+ tag={title ? 'h3' : 'h2'}
72
+ className={cx('', {
73
+ h3: !title,
74
+ })}
75
+ >
71
76
  <UniversalLink
72
77
  item={!isEditMode ? item : null}
73
78
  href={isEditMode ? '#' : null}
@@ -218,7 +218,12 @@ const SimpleCardTemplateDefaultOneForRow = (props) => {
218
218
  )}
219
219
  </CardCategory>
220
220
  )}
221
- <CardTitle tag="h3">
221
+ <CardTitle
222
+ tag={title ? 'h3' : 'h2'}
223
+ className={cx('', {
224
+ h3: !title,
225
+ })}
226
+ >
222
227
  <UniversalLink
223
228
  item={!isEditMode ? item : null}
224
229
  href={isEditMode ? '#' : null}
@@ -55,7 +55,7 @@ const Edit = (props) => {
55
55
  >
56
56
  <CardBody>
57
57
  <div className="simple-text-card cms-ui">
58
- <CardTitle tag="h3" className="h4">
58
+ <CardTitle tag="h2" className="h4">
59
59
  <TextEditorWidget
60
60
  {...otherProps}
61
61
  showToolbar={false}
@@ -27,7 +27,7 @@ const TextCardView = ({ data, id, block }) => {
27
27
  tag="div"
28
28
  >
29
29
  <CardBody>
30
- <CardTitle tag="h3" className="h4" id={id + '-title'}>
30
+ <CardTitle tag="h2" className="h4" id={id + '-title'}>
31
31
  {data.simple_card_title}
32
32
  </CardTitle>
33
33
  <hr />
@@ -4,12 +4,16 @@ import { SIMPLELINK } from '@plone/volto-slate/constants';
4
4
 
5
5
  export const simpleLinkDeserializer = (editor, el) => {
6
6
  let parent = el;
7
-
8
7
  let children = Array.from(parent.childNodes)
9
8
  .map((el) => deserialize(editor, el))
10
9
  .flat();
11
10
 
12
11
  if (!children.length) children = [{ text: '' }];
12
+
13
+ if (el.getAttribute('href') === null) {
14
+ return jsx('text', {}, children);
15
+ }
16
+
13
17
  const attrs = {
14
18
  type: SIMPLELINK,
15
19
  data: {
@@ -17,14 +17,6 @@
17
17
  margin: 18px 0px 0px 18px;
18
18
 
19
19
  background-color: $white;
20
-
21
- .volto-image {
22
- img {
23
- width: 100%;
24
- height: 100%;
25
- object-fit: cover;
26
- }
27
- }
28
20
  }
29
21
 
30
22
  .card.card-bg {
@@ -52,4 +44,9 @@
52
44
  .no-external-if-link > .external-link {
53
45
  display: none;
54
46
  }
47
+
48
+ img.responsive {
49
+ height: 100%;
50
+ object-fit: cover;
51
+ }
55
52
  }
@@ -30,4 +30,22 @@
30
30
  padding-bottom: 15px;
31
31
  border-bottom: 1px solid #455b71;
32
32
  }
33
+
34
+ //* customizzazione: nascondere enhance-link quando è un'immagine
35
+ .card-with-image-template,
36
+ .in-evidence,
37
+ .contentInEvidenceTemplate,
38
+ .list-template {
39
+ .img-responsive-wrapper {
40
+ .enhance-link {
41
+ display: none;
42
+ }
43
+ }
44
+ }
45
+ .small-block-links,
46
+ .contentInEvidenceTemplate {
47
+ .enhance-link {
48
+ display: none;
49
+ }
50
+ }
33
51
  }
@@ -188,9 +188,9 @@
188
188
  }
189
189
 
190
190
  .rassegna-info {
191
- font-size: 0.9rem;
192
191
  display: inline-flex;
193
192
  column-gap: 0.3rem;
193
+ font-size: 0.9rem;
194
194
 
195
195
  a {
196
196
  text-decoration: none;