design-comuni-plone-theme 8.5.0 → 8.5.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 (24) hide show
  1. package/CHANGELOG.md +19 -0
  2. package/package.json +2 -2
  3. package/publiccode.yml +2 -2
  4. package/src/components/ItaliaTheme/Blocks/ContactsBlock/Block/ViewBlock.jsx +1 -1
  5. package/src/components/ItaliaTheme/Blocks/ContactsBlock/Edit.jsx +2 -2
  6. package/src/components/ItaliaTheme/Blocks/ContactsBlock/View.jsx +2 -2
  7. package/src/components/ItaliaTheme/Blocks/Listing/BandiInEvidenceTemplate.jsx +7 -4
  8. package/src/components/ItaliaTheme/Blocks/Listing/Commons/utils.js +9 -2
  9. package/src/components/ItaliaTheme/Blocks/Listing/SliderTemplate.jsx +5 -5
  10. package/src/components/ItaliaTheme/View/Commons/LocationsMap.jsx +1 -6
  11. package/src/components/ItaliaTheme/View/Commons/Metadata.jsx +2 -2
  12. package/src/components/ItaliaTheme/View/Commons/RichText.jsx +1 -1
  13. package/src/components/ItaliaTheme/View/EventoView/EventoCosE.jsx +3 -1
  14. package/src/components/ItaliaTheme/View/EventoView/EventoUlterioriInformazioni.jsx +0 -3
  15. package/src/config/Blocks/blocks.js +3 -4
  16. package/src/customizations/volto/components/manage/Blocks/Grid/Edit.jsx +55 -0
  17. package/src/theme/ItaliaTheme/Blocks/_contentInEvidenceTemplate.scss +1 -1
  18. package/src/theme/ItaliaTheme/Blocks/_gridBlock.scss +27 -0
  19. package/src/theme/ItaliaTheme/Blocks/_iconBlocks.scss +2 -2
  20. package/src/theme/ItaliaTheme/Components/_cmp-timeline.scss +1 -0
  21. package/src/theme/ItaliaTheme/Views/_evento.scss +4 -0
  22. package/src/theme/ItaliaTheme/_common.scss +12 -0
  23. package/src/theme/ItaliaTheme/_main.scss +1 -0
  24. package/src/theme/site.scss +1 -0
package/CHANGELOG.md CHANGED
@@ -1,5 +1,24 @@
1
1
 
2
2
 
3
+ ## [8.5.1](https://github.com/RedTurtle/design-comuni-plone-theme/compare/v8.5.0...v8.5.1) (2023-09-18)
4
+
5
+
6
+ ### Bug Fixes
7
+
8
+ * added clear float to page sections ([#324](https://github.com/RedTurtle/design-comuni-plone-theme/issues/324)) ([7f1e46d](https://github.com/RedTurtle/design-comuni-plone-theme/commit/7f1e46d42b8cae11b04f68b3a01988c3e9226db7))
9
+ * fix cContacts block horizontal alignment ([#329](https://github.com/RedTurtle/design-comuni-plone-theme/issues/329)) ([b68ee5e](https://github.com/RedTurtle/design-comuni-plone-theme/commit/b68ee5e9901c81db0048dc2eb29f9611cdc3fb5a))
10
+ * fix Content in Evidence template when there's more than one item ([#327](https://github.com/RedTurtle/design-comuni-plone-theme/issues/327)) ([049f520](https://github.com/RedTurtle/design-comuni-plone-theme/commit/049f5205685d2010982cf4a990479f719142fadf))
11
+ * fix height of icons in Icons Block ([#330](https://github.com/RedTurtle/design-comuni-plone-theme/issues/330)) ([c77ada8](https://github.com/RedTurtle/design-comuni-plone-theme/commit/c77ada86763de62060f95b2fec52a824cbe76011))
12
+ * gridBlock edit overlapping when using 4 columns and adding image block ([#322](https://github.com/RedTurtle/design-comuni-plone-theme/issues/322)) ([018deb7](https://github.com/RedTurtle/design-comuni-plone-theme/commit/018deb7081b3830df526304330349855e5b79d4d))
13
+ * load of locations data in LocationsMap ([#323](https://github.com/RedTurtle/design-comuni-plone-theme/issues/323)) ([093f08b](https://github.com/RedTurtle/design-comuni-plone-theme/commit/093f08bcdb92c46053ec78878b1ed2e375efd2ff))
14
+ * slider a11y ([3d5bcc4](https://github.com/RedTurtle/design-comuni-plone-theme/commit/3d5bcc485c6d280647712ad2d0e3ccf6b8c4974a))
15
+ * updated volto-dropdownmenu to remove upload image when editing dropdownmenu blocks ([#331](https://github.com/RedTurtle/design-comuni-plone-theme/issues/331)) ([2c5605f](https://github.com/RedTurtle/design-comuni-plone-theme/commit/2c5605f3be09632c923196eedc166485c15b04a3))
16
+
17
+
18
+ ### Documentation
19
+
20
+ * updated publiccode ([55e59c7](https://github.com/RedTurtle/design-comuni-plone-theme/commit/55e59c7822ca93330c4d509461d0cd32a9b2ea0b))
21
+
3
22
  ## [8.5.0](https://github.com/RedTurtle/design-comuni-plone-theme/compare/v8.4.6...v8.5.0) (2023-09-05)
4
23
 
5
24
 
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": "8.5.0",
5
+ "version": "8.5.1",
6
6
  "main": "src/index.js",
7
7
  "keywords": [
8
8
  "volto-addon",
@@ -130,7 +130,7 @@
130
130
  "typeface-titillium-web": "0.0.72",
131
131
  "volto-blocks-widget": "3.1.0",
132
132
  "volto-data-grid-widget": "2.2.1",
133
- "volto-dropdownmenu": "4.0.0",
133
+ "volto-dropdownmenu": "4.1.0",
134
134
  "volto-editablefooter": "5.0.1",
135
135
  "volto-feedback": "0.1.5",
136
136
  "volto-form-block": "3.1.0",
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-09-05'
230
+ releaseDate: '2023-09-18'
231
231
  softwareType: standalone/web
232
- softwareVersion: 8.5.0
232
+ softwareVersion: 8.5.1
233
233
  url: 'https://github.com/italia/design-comuni-plone-theme'
234
234
  usedBy:
235
235
  - ASP Comuni Modenesi Area Nord
@@ -20,7 +20,7 @@ import { checkRedraftHasContent } from 'design-comuni-plone-theme/helpers';
20
20
  const ViewBlock = ({ data, isOpen, toggle, id, index }) => {
21
21
  return (
22
22
  <Card
23
- className="card-bg rounded subblock-view"
23
+ className="card-bg rounded subblock-view "
24
24
  noWrapper={false}
25
25
  space
26
26
  tag="div"
@@ -106,7 +106,7 @@ class Edit extends SubblocksEdit {
106
106
  </div>
107
107
 
108
108
  <SubblocksWrapper node={this.node}>
109
- <Row>
109
+ <Row className="justify-content-center">
110
110
  {this.state.subblocks.map((subblock, subindex) => (
111
111
  <Col lg="4" key={subblock.id}>
112
112
  <EditBlock
@@ -120,7 +120,7 @@ class Edit extends SubblocksEdit {
120
120
  ))}
121
121
 
122
122
  {this.props.selected && (
123
- <Col lg={4}>
123
+ <Col lg={12} className="text-center pb-3">
124
124
  {this.renderAddBlockButton(
125
125
  this.props.intl.formatMessage(messages.addItem),
126
126
  )}
@@ -42,9 +42,9 @@ const AccordionView = ({ data, block }) => {
42
42
  )}
43
43
  </div>
44
44
  </div>
45
- <Row>
45
+ <Row className="justify-content-center">
46
46
  {data.subblocks.map((subblock, index) => (
47
- <Col lg="4" key={subblock.id}>
47
+ <Col lg="4" key={subblock.id} className="pb-3">
48
48
  <ViewBlock
49
49
  data={subblock}
50
50
  key={index}
@@ -137,6 +137,7 @@ const BandiInEvidenceTemplate = ({
137
137
  )}
138
138
 
139
139
  {/* Tipologia */}
140
+
140
141
  {show_tipologia && item.tipologia_bando?.title?.length > 0 && (
141
142
  <span className="d-flex flex-wrap align-items-baseline bando-dati-info">
142
143
  <div className="bando-dati-label me-2">
@@ -206,10 +207,12 @@ const BandiInEvidenceTemplate = ({
206
207
  className={cx('bando-state', {
207
208
  open: item.bando_state?.includes('open'),
208
209
  closed: item.bando_state?.includes('closed'),
209
- scheduled:
210
- item.bando_state?.includes('scheduled'),
211
- 'in-progress':
212
- item.bando_state?.includes('inProgress'),
210
+ scheduled: item.bando_state?.includes(
211
+ 'scheduled',
212
+ ),
213
+ 'in-progress': item.bando_state?.includes(
214
+ 'inProgress',
215
+ ),
213
216
  })}
214
217
  >
215
218
  {intl.formatMessage(messages[item.bando_state[0]])}
@@ -61,7 +61,7 @@ export const useSlider = (userAutoplay) => {
61
61
 
62
62
  if ((userAutoplay && !slide) || (userAutoplay && !slide.length > 0)) return;
63
63
 
64
- // Custom handling of focus as per Arter a11y audit and request
64
+ // Custom handling of focus for a11y
65
65
  const link = visibleSlideTitle(
66
66
  `a.slide-link[data-slide="${currentSlide}"]`,
67
67
  );
@@ -70,7 +70,14 @@ export const useSlider = (userAutoplay) => {
70
70
  return;
71
71
  }
72
72
  // eslint-disable-next-line no-unused-expressions
73
- else link.focus();
73
+ else if (
74
+ // if the focus was already on a slide, move it to the current one
75
+ Array.from(document.querySelectorAll('.slick-slide')).some((el) =>
76
+ el.contains(document.activeElement),
77
+ )
78
+ ) {
79
+ link.focus();
80
+ }
74
81
  };
75
82
 
76
83
  return {
@@ -50,7 +50,7 @@ const messages = defineMessages({
50
50
  });
51
51
 
52
52
  function NextArrow(props) {
53
- // Custom handling of focus as per Arter a11y audit and request
53
+ // Custom handling of focus for a11y
54
54
  const { className, style, onClick, intl, currentSlide } = props;
55
55
  const handleClick = (options) => {
56
56
  onClick(options, false);
@@ -85,7 +85,7 @@ function NextArrow(props) {
85
85
  }
86
86
 
87
87
  function PrevArrow(props) {
88
- // Custom handling of focus as per Arter a11y audit and request
88
+ // Custom handling of focus for a11y
89
89
  const {
90
90
  className,
91
91
  style,
@@ -225,7 +225,7 @@ const SliderTemplate = ({
225
225
  };
226
226
 
227
227
  const renderCustomDots = (props) => {
228
- // Custom handling of focus as per Arter a11y audit and request
228
+ // Custom handling of focus for a11y
229
229
  return (
230
230
  <ul
231
231
  className="slick-dots"
@@ -281,13 +281,13 @@ const SliderTemplate = ({
281
281
  pauseOnDotsHover: true,
282
282
  swipe: true,
283
283
  swipeToSlide: true,
284
- focusOnSelect: true,
284
+ focusOnSelect: false,
285
285
  draggable: true,
286
286
  accessibility: true,
287
287
  nextArrow: <NextArrow intl={intl} focusNext={focusNext} />,
288
288
  prevArrow: <PrevArrow intl={intl} focusNext={focusNext} />,
289
289
  appendDots: renderCustomDots,
290
- // Custom handling of focus as per Arter a11y audit and request
290
+ // Custom handling of focus for a11y
291
291
  afterChange: focusNext,
292
292
  responsive: [
293
293
  {
@@ -43,12 +43,7 @@ const LocationsMap = ({ center, locations }) => {
43
43
 
44
44
  useEffect(() => {
45
45
  venues.forEach((loc) => {
46
- if (
47
- !fetchedLocations?.[loc.key]?.loading &&
48
- !fetchedLocations?.[loc.key]?.loaded
49
- ) {
50
- dispatch(getContent(loc.url, null, loc.key));
51
- }
46
+ dispatch(getContent(loc.url, null, loc.key));
52
47
  });
53
48
 
54
49
  return () =>
@@ -48,13 +48,13 @@ const Metadata = ({
48
48
  </h4>
49
49
  )}
50
50
  {children}
51
- <p className="font-serif mb-0 mt-4">
51
+ <p className="font-serif mb-0 mt-4 last-modified">
52
52
  <strong>{intl.formatMessage(messages.modified)}:</strong>{' '}
53
53
  {viewDate(intl.locale, content.modified, 'DD-MM-Y, HH:MM')}
54
54
  </p>
55
55
  {content.rights && (
56
56
  <>
57
- <p className="font-serif mb-0 mt-4">
57
+ <p className="font-serif mb-0 mt-4 metadata">
58
58
  {intl.formatMessage(messages.rights)}
59
59
  </p>
60
60
  <strong>{content.rights}</strong>
@@ -31,7 +31,7 @@ const RichText = ({
31
31
  <>
32
32
  {title && (
33
33
  <Tag
34
- className={cx('mt-4', {
34
+ className={cx('mt-4 it-page-subsection', {
35
35
  'fw-bold': title_size === 'h6',
36
36
  })}
37
37
  >
@@ -45,7 +45,9 @@ const EventoCosE = ({ content }) => {
45
45
  >
46
46
  {content?.persone_amministrazione?.length > 0 && (
47
47
  <>
48
- <h5>{intl.formatMessage(messages.parteciperanno)}</h5>
48
+ <h5 className="parteciperanno-section">
49
+ {intl.formatMessage(messages.parteciperanno)}
50
+ </h5>
49
51
  {content.persone_amministrazione.map((item, i) => (
50
52
  <UniversalLink
51
53
  href={flattenToAppURL(item['@id'])}
@@ -43,7 +43,6 @@ const EventoUlterioriInformazioni = ({ content }) => {
43
43
  {richTextHasContent(content?.ulteriori_informazioni) && (
44
44
  <HelpBox text={content?.ulteriori_informazioni} />
45
45
  )}
46
-
47
46
  {content?.event_url && (
48
47
  <div className="mt-4">
49
48
  <h5>{intl.formatMessage(messages.event_url)}</h5>
@@ -52,7 +51,6 @@ const EventoUlterioriInformazioni = ({ content }) => {
52
51
  </UniversalLink>
53
52
  </div>
54
53
  )}
55
-
56
54
  {richTextHasContent(content?.patrocinato_da) && (
57
55
  <div className="mt-4">
58
56
  {richTextHasContent(content?.patrocinato_da) && (
@@ -66,7 +64,6 @@ const EventoUlterioriInformazioni = ({ content }) => {
66
64
  )}
67
65
  </div>
68
66
  )}
69
-
70
67
  {content?.strutture_politiche.length > 0 && (
71
68
  <div className="mt-4">
72
69
  <h5>{intl.formatMessage(messages.strutture_politiche)}</h5>
@@ -364,10 +364,9 @@ const italiaBlocks = {
364
364
 
365
365
  const getItaliaBlocks = (config) => {
366
366
  delete config.blocks.blocksConfig.teaser;
367
- config.blocks.blocksConfig.gridBlock.allowedBlocks =
368
- config.blocks.blocksConfig.gridBlock.allowedBlocks
369
- .filter((item) => !['slate', 'teaser'].includes(item))
370
- .concat(['text']);
367
+ config.blocks.blocksConfig.gridBlock.allowedBlocks = config.blocks.blocksConfig.gridBlock.allowedBlocks
368
+ .filter((item) => !['slate', 'teaser'].includes(item))
369
+ .concat(['text']);
371
370
  return italiaBlocks;
372
371
  };
373
372
  export default getItaliaBlocks;
@@ -0,0 +1,55 @@
1
+ /**
2
+ * Customizations:
3
+ * - make the block full-width and fix overlapping ui for
4
+ * some inner blocks like image using custom class
5
+ */
6
+
7
+ import PropTypes from 'prop-types';
8
+ import cx from 'classnames';
9
+ import { useState } from 'react';
10
+ import ContainerEdit from '@plone/volto/components/manage/Blocks/Container/Edit';
11
+
12
+ const GridBlockEdit = (props) => {
13
+ const { data } = props;
14
+
15
+ const columnsLength = data?.blocks_layout?.items?.length || 0;
16
+ const [selectedBlock, setSelectedBlock] = useState(null);
17
+
18
+ return (
19
+ <div
20
+ className={cx({
21
+ one: columnsLength === 1,
22
+ two: columnsLength === 2,
23
+ three: columnsLength === 3,
24
+ four: columnsLength >= 4,
25
+ 'grid-items': true,
26
+ 'full-width': true,
27
+ })}
28
+ // This is required to enabling a small "in-between" clickable area
29
+ // for bringing the Grid sidebar alive once you have selected an inner block
30
+ onClick={(e) => {
31
+ if (!e.block) setSelectedBlock(null);
32
+ }}
33
+ role="presentation"
34
+ >
35
+ <div className="gridBlock-container">
36
+ <ContainerEdit
37
+ {...props}
38
+ selectedBlock={selectedBlock}
39
+ setSelectedBlock={setSelectedBlock}
40
+ direction="horizontal"
41
+ />
42
+ </div>
43
+ </div>
44
+ );
45
+ };
46
+
47
+ GridBlockEdit.propTypes = {
48
+ block: PropTypes.string.isRequired,
49
+ onChangeBlock: PropTypes.func.isRequired,
50
+ pathname: PropTypes.string.isRequired,
51
+ selected: PropTypes.bool.isRequired,
52
+ manage: PropTypes.bool.isRequired,
53
+ };
54
+
55
+ export default GridBlockEdit;
@@ -44,7 +44,7 @@
44
44
  @media (min-width: #{map-get($grid-breakpoints, lg)}) {
45
45
  .content-in-evidence:nth-of-type(2n) {
46
46
  .order-lg-2 {
47
- order: 1;
47
+ order: 1 !important;
48
48
 
49
49
  &.offset-lg-1 {
50
50
  margin-left: 0;
@@ -0,0 +1,27 @@
1
+ .block.gridBlock {
2
+ margin-top: 2rem;
3
+ .full-width {
4
+ height: unset !important;
5
+ }
6
+ .gridBlock-container {
7
+ max-width: 1320px;
8
+ padding: 0 4px;
9
+ margin: auto;
10
+ position: relative;
11
+ .toolbar {
12
+ left: 16px !important;
13
+ }
14
+ .block {
15
+ .image {
16
+ .ui.message {
17
+ padding-left: 8px;
18
+ padding-right: 8px;
19
+ }
20
+ .ui.input {
21
+ font-size: 14px;
22
+ margin-left: 16px;
23
+ }
24
+ }
25
+ }
26
+ }
27
+ }
@@ -167,8 +167,8 @@
167
167
  }
168
168
 
169
169
  .icon {
170
- width: 3.35rem;
171
- height: auto;
170
+ width: auto;
171
+ height: 4rem;
172
172
  color: $tertiary;
173
173
  }
174
174
  }
@@ -26,6 +26,7 @@
26
26
 
27
27
  .calendar-vertical {
28
28
  color: $link-color;
29
+ clear: both;
29
30
 
30
31
  &::after {
31
32
  display: block;
@@ -1,4 +1,8 @@
1
1
  body.contenttype-event {
2
+ .parteciperanno-section {
3
+ clear: both;
4
+ }
5
+
2
6
  .supported-by {
3
7
  margin-bottom: 1rem;
4
8
  }
@@ -3,6 +3,7 @@
3
3
  .text-justify {
4
4
  text-align: justify;
5
5
  }
6
+
6
7
  button.btn,
7
8
  button.rounded-right {
8
9
  &:focus {
@@ -30,6 +31,7 @@
30
31
 
31
32
  a.btn-tertiary {
32
33
  color: $tertiary-text !important;
34
+
33
35
  &:focus {
34
36
  border-color: $focus-outline-color;
35
37
  box-shadow: inset 0 1px 0 $focus-outline-color,
@@ -58,6 +60,7 @@
58
60
  }
59
61
  }
60
62
  }
63
+
61
64
  .btn-primary,
62
65
  .btn-secondary,
63
66
  .btn-tertiary,
@@ -66,12 +69,15 @@
66
69
  fill: $external-link-fill-buttons !important;
67
70
  }
68
71
  }
72
+
69
73
  .external-link {
70
74
  fill: $link-color !important;
75
+
71
76
  &:hover {
72
77
  fill: #004080 !important;
73
78
  }
74
79
  }
80
+
75
81
  .it-footer-small-prints-list .external-link {
76
82
  fill: $external-link-fill-subfooter !important;
77
83
  }
@@ -80,3 +86,9 @@
80
86
  .icon.external-link.icon-xs {
81
87
  height: 1rem;
82
88
  }
89
+
90
+ section.it-page-section,
91
+ .last-modified,
92
+ .it-page-subsection {
93
+ clear: both;
94
+ }
@@ -143,6 +143,7 @@ iframe {
143
143
 
144
144
  .draftjs-buttons {
145
145
  margin: 0;
146
+ clear: both;
146
147
 
147
148
  a {
148
149
  display: inline-block;
@@ -88,6 +88,7 @@
88
88
  @import 'ItaliaTheme/Blocks/HTML';
89
89
  @import 'ItaliaTheme/Blocks/simpleCardTemplate';
90
90
  @import 'ItaliaTheme/Blocks/search';
91
+ @import 'ItaliaTheme/Blocks/gridBlock';
91
92
 
92
93
  @import 'ItaliaTheme/Views/uo';
93
94
  @import 'ItaliaTheme/Views/evento';