From d81b3a9f34822242e10942a4acccb5978996a06b Mon Sep 17 00:00:00 2001 From: sabrina-bongiovanni <116291154+sabrina-bongiovanni@users.noreply.github.com> Date: Mon, 8 Jan 2024 17:38:42 +0100 Subject: [PATCH 01/13] fix(a11y): a11y - colore sfondo opzione con focus in tendina "ordina per" (#457) * fix: changed background color for focused choice for greater contrast * Revert "fix: changed background color for focused choice for greater contrast" This reverts commit 00cab84958991b0f900406ffbf7ac4a64ed76a64. * fix: changed background color for focused choice for greater contrast --- src/theme/ItaliaTheme/Components/_search.scss | 1 + 1 file changed, 1 insertion(+) diff --git a/src/theme/ItaliaTheme/Components/_search.scss b/src/theme/ItaliaTheme/Components/_search.scss index ea88018be..eb2d2dc1a 100644 --- a/src/theme/ItaliaTheme/Components/_search.scss +++ b/src/theme/ItaliaTheme/Components/_search.scss @@ -7,5 +7,6 @@ border-color: var(--focus-outline-color) !important; box-shadow: 0 0 0 2px var(--focus-outline-color) !important; outline: none !important; + background-color: #0062e2; } } From 697f54c9f81947898caa27f4aa76dee0b16d0616 Mon Sep 17 00:00:00 2001 From: sabrina-bongiovanni <116291154+sabrina-bongiovanni@users.noreply.github.com> Date: Mon, 8 Jan 2024 17:46:47 +0100 Subject: [PATCH 02/13] fix: lowered flex basis of card-body in LocationItem cards (#460) --- RELEASE.md | 6 ++++++ src/theme/ItaliaTheme/Components/_card.scss | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/RELEASE.md b/RELEASE.md index c63ef5003..1b8403e0e 100644 --- a/RELEASE.md +++ b/RELEASE.md @@ -41,6 +41,12 @@ - ... --> +## Versione X.X.X (dd/mm/yyyy) + +### Fix + +- Diminuita la larghezza del testo nelle card che indicano i luoghi. + ## Versione 11.1.4 (dd/mm/yyyy) ### Fix diff --git a/src/theme/ItaliaTheme/Components/_card.scss b/src/theme/ItaliaTheme/Components/_card.scss index 9656bb18a..5ae2e71ec 100644 --- a/src/theme/ItaliaTheme/Components/_card.scss +++ b/src/theme/ItaliaTheme/Components/_card.scss @@ -60,7 +60,7 @@ } &.card-teaser .card-body { - flex: 1 0 75%; + flex: 1 0 74%; } } From 809e92e647a23dfcfb2d3c15616e17fc32388984 Mon Sep 17 00:00:00 2001 From: Mauro Amico Date: Tue, 9 Jan 2024 09:48:40 +0100 Subject: [PATCH 03/13] chore: replace react-highlight-words with simple custom code (#463) * fix: replace react-highlight-words with simple custom code * Apply suggestions from code review --------- Co-authored-by: Piero Nicolli --- package.json | 1 - .../ItaliaTheme/Search/ResultItem.jsx | 45 ++++++++++++------- yarn.lock | 28 ------------ 3 files changed, 30 insertions(+), 44 deletions(-) diff --git a/package.json b/package.json index 37c7bf6a7..90db87504 100644 --- a/package.json +++ b/package.json @@ -132,7 +132,6 @@ "marked": "9.0.0", "react-dropzone": "11.0.1", "react-google-recaptcha-v3": "1.7.0", - "react-highlight-words": "0.18.0", "react-select": "^4.3.1", "react-slick": "^0.29.0", "slick-carousel": "1.8.1", diff --git a/src/components/ItaliaTheme/Search/ResultItem.jsx b/src/components/ItaliaTheme/Search/ResultItem.jsx index 1517e2e92..33dac396e 100644 --- a/src/components/ItaliaTheme/Search/ResultItem.jsx +++ b/src/components/ItaliaTheme/Search/ResultItem.jsx @@ -1,32 +1,47 @@ import React from 'react'; import { Card, CardBody } from 'design-react-kit'; import { UniversalLink } from '@plone/volto/components'; -import Highlighter from 'react-highlight-words'; -const ResultItem = ({ item, index, section, searchableText }) => { - const filteredWords = searchableText.split(' '); +const Marker = ({ text = '', highlight = '' }) => { + if (!highlight.trim()) { + return text; + } + const regex = new RegExp( + `(${highlight + .split(' ') + // remove any characters not in these ranges + .map((s) => s.replace(/[^a-zA-Z0-9À-ÖØ-öø-ÿ]/g, '')) + .filter((s) => s !== '') + .join('|')})`, + 'gi', + ); + // Split on highlight term and include term into parts, ignore case + const parts = text.split(regex); + return ( + <> + {parts.map((part, i) => + part.match(regex) ? ( + {part} + ) : ( + part + ), + )} + + ); +}; +const ResultItem = ({ item, index, section, searchableText }) => { return ( {section}

- +

- +

diff --git a/yarn.lock b/yarn.lock index d615c908a..7233f0758 100644 --- a/yarn.lock +++ b/yarn.lock @@ -6558,7 +6558,6 @@ __metadata: prettier: 3.1.0 react-dropzone: 11.0.1 react-google-recaptcha-v3: 1.7.0 - react-highlight-words: 0.18.0 react-select: ^4.3.1 react-slick: ^0.29.0 release-it: 16.1.3 @@ -8450,13 +8449,6 @@ __metadata: languageName: node linkType: hard -"highlight-words-core@npm:^1.2.0": - version: 1.2.2 - resolution: "highlight-words-core@npm:1.2.2" - checksum: 737758a8a572c82919552b031df300016164b7d0db6a819d24bc6c7ca2279d3cd6d03497728930d6402423c7a3fc2f42c628a9b01b025c704a0b56a635377511 - languageName: node - linkType: hard - "hoist-non-react-statics@npm:3.3.2, hoist-non-react-statics@npm:^3.3.1, hoist-non-react-statics@npm:^3.3.2": version: 3.3.2 resolution: "hoist-non-react-statics@npm:3.3.2" @@ -10110,13 +10102,6 @@ __metadata: languageName: node linkType: hard -"memoize-one@npm:^4.0.0": - version: 4.0.3 - resolution: "memoize-one@npm:4.0.3" - checksum: addd18c046542f57440ba70bf8ebd48663d17626cade681f777522ef70900a87ec72c5041bed8ece4f6d40a2cb58803bae388b50a4b740d64f36bcda20c147b7 - languageName: node - linkType: hard - "memoize-one@npm:^5.0.0, memoize-one@npm:^5.1.1": version: 5.2.1 resolution: "memoize-one@npm:5.2.1" @@ -11856,19 +11841,6 @@ __metadata: languageName: node linkType: hard -"react-highlight-words@npm:0.18.0": - version: 0.18.0 - resolution: "react-highlight-words@npm:0.18.0" - dependencies: - highlight-words-core: ^1.2.0 - memoize-one: ^4.0.0 - prop-types: ^15.5.8 - peerDependencies: - react: ^0.14.0 || ^15.0.0 || ^16.0.0-0 || ^17.0.0-0 || ^18.0.0-0 - checksum: ff9759e7ebeb140067854d8cad3021123ba0e3b78bda14d35d9b21dd7890986c858955885ddbcb537e9f88472aebe4a23a1841b7af190989efb0a8ecf7dc2a57 - languageName: node - linkType: hard - "react-input-autosize@npm:^3.0.0": version: 3.0.0 resolution: "react-input-autosize@npm:3.0.0" From 94e5cca0b671aa5bfc1febf4f51b306f71de43be Mon Sep 17 00:00:00 2001 From: sabrina-bongiovanni <116291154+sabrina-bongiovanni@users.noreply.github.com> Date: Tue, 9 Jan 2024 09:53:27 +0100 Subject: [PATCH 04/13] fix: added focus style for skiplinks for a11y (#458) --- src/theme/bootstrap-override/_bootstrap-italia-site.scss | 1 + src/theme/bootstrap-override/bootstrap-italia/_focus.scss | 3 +++ 2 files changed, 4 insertions(+) create mode 100644 src/theme/bootstrap-override/bootstrap-italia/_focus.scss diff --git a/src/theme/bootstrap-override/_bootstrap-italia-site.scss b/src/theme/bootstrap-override/_bootstrap-italia-site.scss index 0e57b65cd..94c5450fe 100644 --- a/src/theme/bootstrap-override/_bootstrap-italia-site.scss +++ b/src/theme/bootstrap-override/_bootstrap-italia-site.scss @@ -203,4 +203,5 @@ // gestione dei focus @import 'bootstrap-italia/src/scss/utilities/focus'; @import 'bootstrap-italia/src/scss/utilities/icons'; + @import './bootstrap-italia/focus'; } diff --git a/src/theme/bootstrap-override/bootstrap-italia/_focus.scss b/src/theme/bootstrap-override/bootstrap-italia/_focus.scss new file mode 100644 index 000000000..1e28e48c8 --- /dev/null +++ b/src/theme/bootstrap-override/bootstrap-italia/_focus.scss @@ -0,0 +1,3 @@ +.skiplinks a:focus:not(.focus--mouse) { + border: 2px solid; +} From 49a6e2f217b779ba4f57ca030335af12b91b7337 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 9 Jan 2024 09:56:02 +0100 Subject: [PATCH 05/13] chore(deps): bump semver from 5.7.1 to 5.7.2 (#446) Bumps [semver](https://github.com/npm/node-semver) from 5.7.1 to 5.7.2. - [Release notes](https://github.com/npm/node-semver/releases) - [Changelog](https://github.com/npm/node-semver/blob/v5.7.2/CHANGELOG.md) - [Commits](https://github.com/npm/node-semver/compare/v5.7.1...v5.7.2) --- updated-dependencies: - dependency-name: semver dependency-type: indirect ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- yarn.lock | 34 +++++++--------------------------- 1 file changed, 7 insertions(+), 27 deletions(-) diff --git a/yarn.lock b/yarn.lock index 7233f0758..df03b5929 100644 --- a/yarn.lock +++ b/yarn.lock @@ -12741,11 +12741,11 @@ __metadata: linkType: hard "semver@npm:2 || 3 || 4 || 5, semver@npm:^5.4.1": - version: 5.7.1 - resolution: "semver@npm:5.7.1" + version: 5.7.2 + resolution: "semver@npm:5.7.2" bin: - semver: ./bin/semver - checksum: 57fd0acfd0bac382ee87cd52cd0aaa5af086a7dc8d60379dfe65fea491fb2489b6016400813930ecd61fd0952dae75c115287a1b16c234b1550887117744dfaf + semver: bin/semver + checksum: fb4ab5e0dd1c22ce0c937ea390b4a822147a9c53dbd2a9a0132f12fe382902beef4fbf12cf51bb955248d8d15874ce8cd89532569756384f994309825f10b686 languageName: node linkType: hard @@ -12760,7 +12760,7 @@ __metadata: languageName: node linkType: hard -"semver@npm:7.5.2, semver@npm:^7.3.7": +"semver@npm:7.5.2": version: 7.5.2 resolution: "semver@npm:7.5.2" dependencies: @@ -12771,7 +12771,7 @@ __metadata: languageName: node linkType: hard -"semver@npm:7.5.4, semver@npm:^7.3.8": +"semver@npm:7.5.4, semver@npm:^7.3.4, semver@npm:^7.3.5, semver@npm:^7.3.7, semver@npm:^7.3.8": version: 7.5.4 resolution: "semver@npm:7.5.4" dependencies: @@ -12782,16 +12782,7 @@ __metadata: languageName: node linkType: hard -"semver@npm:^6.0.0, semver@npm:^6.1.1, semver@npm:^6.1.2, semver@npm:^6.3.0": - version: 6.3.0 - resolution: "semver@npm:6.3.0" - bin: - semver: ./bin/semver.js - checksum: 1b26ecf6db9e8292dd90df4e781d91875c0dcc1b1909e70f5d12959a23c7eebb8f01ea581c00783bbee72ceeaad9505797c381756326073850dc36ed284b21b9 - languageName: node - linkType: hard - -"semver@npm:^6.3.1": +"semver@npm:^6.0.0, semver@npm:^6.1.1, semver@npm:^6.1.2, semver@npm:^6.3.0, semver@npm:^6.3.1": version: 6.3.1 resolution: "semver@npm:6.3.1" bin: @@ -12800,17 +12791,6 @@ __metadata: languageName: node linkType: hard -"semver@npm:^7.3.4, semver@npm:^7.3.5": - version: 7.3.7 - resolution: "semver@npm:7.3.7" - dependencies: - lru-cache: ^6.0.0 - bin: - semver: bin/semver.js - checksum: 2fa3e877568cd6ce769c75c211beaed1f9fce80b28338cadd9d0b6c40f2e2862bafd62c19a6cff42f3d54292b7c623277bcab8816a2b5521cf15210d43e75232 - languageName: node - linkType: hard - "set-blocking@npm:^2.0.0, set-blocking@npm:~2.0.0": version: 2.0.0 resolution: "set-blocking@npm:2.0.0" From 88d5d2c8423ea3052ad2a4ea54623e072a86e0e8 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 9 Jan 2024 10:02:41 +0100 Subject: [PATCH 06/13] chore(deps): bump http-cache-semantics from 4.1.0 to 4.1.1 (#464) Bumps [http-cache-semantics](https://github.com/kornelski/http-cache-semantics) from 4.1.0 to 4.1.1. - [Commits](https://github.com/kornelski/http-cache-semantics/compare/v4.1.0...v4.1.1) --- updated-dependencies: - dependency-name: http-cache-semantics dependency-type: indirect ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- yarn.lock | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/yarn.lock b/yarn.lock index df03b5929..d11d74f73 100644 --- a/yarn.lock +++ b/yarn.lock @@ -8495,14 +8495,7 @@ __metadata: languageName: node linkType: hard -"http-cache-semantics@npm:^4.1.0": - version: 4.1.0 - resolution: "http-cache-semantics@npm:4.1.0" - checksum: 974de94a81c5474be07f269f9fd8383e92ebb5a448208223bfb39e172a9dbc26feff250192ecc23b9593b3f92098e010406b0f24bd4d588d631f80214648ed42 - languageName: node - linkType: hard - -"http-cache-semantics@npm:^4.1.1": +"http-cache-semantics@npm:^4.1.0, http-cache-semantics@npm:^4.1.1": version: 4.1.1 resolution: "http-cache-semantics@npm:4.1.1" checksum: 83ac0bc60b17a3a36f9953e7be55e5c8f41acc61b22583060e8dedc9dd5e3607c823a88d0926f9150e571f90946835c7fe150732801010845c72cd8bbff1a236 From 6d956dda6575f6acd5321b223b67c593db27d1e1 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 9 Jan 2024 10:13:10 +0100 Subject: [PATCH 07/13] chore(deps): bump simple-git from 3.14.1 to 3.22.0 (#465) Bumps [simple-git](https://github.com/steveukx/git-js/tree/HEAD/simple-git) from 3.14.1 to 3.22.0. - [Release notes](https://github.com/steveukx/git-js/releases) - [Changelog](https://github.com/steveukx/git-js/blob/main/simple-git/CHANGELOG.md) - [Commits](https://github.com/steveukx/git-js/commits/simple-git@3.22.0/simple-git) --- updated-dependencies: - dependency-name: simple-git dependency-type: indirect ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- yarn.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/yarn.lock b/yarn.lock index d11d74f73..eb9981f9e 100644 --- a/yarn.lock +++ b/yarn.lock @@ -12930,13 +12930,13 @@ __metadata: linkType: hard "simple-git@npm:^3.3.0": - version: 3.14.1 - resolution: "simple-git@npm:3.14.1" + version: 3.22.0 + resolution: "simple-git@npm:3.22.0" dependencies: "@kwsites/file-exists": ^1.1.1 "@kwsites/promise-deferred": ^1.1.1 debug: ^4.3.4 - checksum: f9d2282e1483f8f42325a7e80803389eb540101a88968bf9fd277c1eade8621d4c24dcf2677be5d611df8716934fb4c9676356052ac03e2fcec7517b4b922e8b + checksum: 118c43a3e1e27aecd8487205ed509acf925112de6edf1feb304d180c673f6e08279a13bcfae33c948de8b0809f2b929f9263fa7033ec7ef84908904eda0c3e2d languageName: node linkType: hard From e9776738df702dd915e1dab45f3cdbb227fa4a6a Mon Sep 17 00:00:00 2001 From: Mauro Amico Date: Tue, 9 Jan 2024 10:46:58 +0100 Subject: [PATCH 08/13] fix: broken videos in Video Gallery block (#461) * fix: fixed broken videos in Video Gallery block * chore: updated RELEASE.md * fix: file RELEASE.md --------- Co-authored-by: Giulia Ghisini Co-authored-by: Piero Nicolli --- RELEASE.md | 5 +- .../Blocks/VideoGallery/Block/ViewBlock.jsx | 70 +++++++++---------- 2 files changed, 36 insertions(+), 39 deletions(-) diff --git a/RELEASE.md b/RELEASE.md index 1b8403e0e..c1378f4e3 100644 --- a/RELEASE.md +++ b/RELEASE.md @@ -41,13 +41,14 @@ - ... --> -## Versione X.X.X (dd/mm/yyyy) +## Versione x.x.x (dd/mm/yyyy) ### Fix - Diminuita la larghezza del testo nelle card che indicano i luoghi. +- Risolto un problema nel blocco Video Gallery, per cui alcuni video di youtube non erano riproducibili. -## Versione 11.1.4 (dd/mm/yyyy) +## Versione 11.1.4 (05/01/2024) ### Fix diff --git a/src/components/ItaliaTheme/Blocks/VideoGallery/Block/ViewBlock.jsx b/src/components/ItaliaTheme/Blocks/VideoGallery/Block/ViewBlock.jsx index 19eeafa25..f28b3448c 100644 --- a/src/components/ItaliaTheme/Blocks/VideoGallery/Block/ViewBlock.jsx +++ b/src/components/ItaliaTheme/Blocks/VideoGallery/Block/ViewBlock.jsx @@ -6,13 +6,10 @@ import React from 'react'; import PropTypes from 'prop-types'; import { Embed } from 'semantic-ui-react'; -import { - isInternalURL, - getParentUrl, - flattenToAppURL, -} from '@plone/volto/helpers'; +import { isInternalURL, getParentUrl } from '@plone/volto/helpers'; import { ConditionalEmbed } from 'volto-gdpr-privacy'; import { FontAwesomeIcon } from 'design-comuni-plone-theme/components/ItaliaTheme'; +import { videoUrlHelper } from 'design-comuni-plone-theme/helpers'; import { useIntl, defineMessages } from 'react-intl'; import config from '@plone/volto/registry'; @@ -34,23 +31,36 @@ const messages = defineMessages({ */ const ViewBlock = ({ data, index, isEditMode = false }) => { const intl = useIntl(); - let placeholder = data.preview_image - ? isInternalURL(data.preview_image) - ? `${flattenToAppURL(data.preview_image)}/@@images/image` - : data.preview_image - : null; - if (!placeholder && data.url) { - if (data.url.match('youtu')) { - //load video preview image from youtube + let placeholder = null; + let videoID = null; + let listID = null; - const videoID = data.url.match(/.be\//) - ? data.url.match(/^.*\.be\/(.*)/)?.[1] - : data.url.match(/^.*\?v=(.*)$/)?.[1]; - placeholder = 'https://img.youtube.com/vi/' + videoID + '/hqdefault.jpg'; - } else if (data.url.match('vimeo')) { - const videoID = data.url.match(/^.*\.com\/(.*)/)[1]; - placeholder = 'https://vumbnail.com/' + videoID + '.jpg'; + if (data.url) { + const [computedID, computedPlaceholder] = videoUrlHelper( + data.url, + data?.preview_image, + ); + if (computedID) { + videoID = computedID; + } + if (computedPlaceholder) { + placeholder = computedPlaceholder; + } + + if (data.url.match('list')) { + const matches = data.url.match(/^.*\?list=(.*)|^.*&list=(.*)$/); + listID = matches[1] || matches[2]; + + let thumbnailID = null; + if (data.url.match(/\?v=(.*)&list/)) { + thumbnailID = data.url.match(/^.*\?v=(.*)&list(.*)/)[1]; + } + if (data.url.match(/\?v=(.*)\?list/)) { + thumbnailID = data.url.match(/^.*\?v=(.*)\?list(.*)/)[1]; + } + placeholder = + 'https://img.youtube.com/vi/' + thumbnailID + '/hqdefault.jpg'; } } @@ -90,31 +100,17 @@ const ViewBlock = ({ data, index, isEditMode = false }) => { <> {data.url.match('list') ? ( ) : ( - + )} ) : ( <> {data.url.match('vimeo') ? ( - + ) : ( <> {data.url.match('.mp4') ? ( From 1dbc9582e49866edc74ff65ce4b96c8218e713d9 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 9 Jan 2024 10:57:54 +0100 Subject: [PATCH 09/13] chore(deps): bump json5 from 1.0.1 to 1.0.2 (#467) Bumps [json5](https://github.com/json5/json5) from 1.0.1 to 1.0.2. - [Release notes](https://github.com/json5/json5/releases) - [Changelog](https://github.com/json5/json5/blob/main/CHANGELOG.md) - [Commits](https://github.com/json5/json5/compare/v1.0.1...v1.0.2) --- updated-dependencies: - dependency-name: json5 dependency-type: indirect ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- yarn.lock | 24 ++---------------------- 1 file changed, 2 insertions(+), 22 deletions(-) diff --git a/yarn.lock b/yarn.lock index eb9981f9e..60836d081 100644 --- a/yarn.lock +++ b/yarn.lock @@ -9447,18 +9447,7 @@ __metadata: languageName: node linkType: hard -"json5@npm:^1.0.1": - version: 1.0.1 - resolution: "json5@npm:1.0.1" - dependencies: - minimist: ^1.2.0 - bin: - json5: lib/cli.js - checksum: e76ea23dbb8fc1348c143da628134a98adf4c5a4e8ea2adaa74a80c455fc2cdf0e2e13e6398ef819bfe92306b610ebb2002668ed9fc1af386d593691ef346fc3 - languageName: node - linkType: hard - -"json5@npm:^1.0.2": +"json5@npm:^1.0.1, json5@npm:^1.0.2": version: 1.0.2 resolution: "json5@npm:1.0.2" dependencies: @@ -9469,16 +9458,7 @@ __metadata: languageName: node linkType: hard -"json5@npm:^2.1.2, json5@npm:^2.2.1": - version: 2.2.1 - resolution: "json5@npm:2.2.1" - bin: - json5: lib/cli.js - checksum: 74b8a23b102a6f2bf2d224797ae553a75488b5adbaee9c9b6e5ab8b510a2fc6e38f876d4c77dea672d4014a44b2399e15f2051ac2b37b87f74c0c7602003543b - languageName: node - linkType: hard - -"json5@npm:^2.2.3": +"json5@npm:^2.1.2, json5@npm:^2.2.1, json5@npm:^2.2.3": version: 2.2.3 resolution: "json5@npm:2.2.3" bin: From 4aa6f7607be0ac8a76f1d519eee82483d9320a05 Mon Sep 17 00:00:00 2001 From: Giulia Ghisini <51911425+giuliaghisini@users.noreply.github.com> Date: Thu, 11 Jan 2024 10:38:44 +0100 Subject: [PATCH 10/13] feat: customizable Alert block colors and text color (#470) * feat: customizable Alert block colors and text color * fix: color danger alert * fix: color text of alert --- src/theme/ItaliaTheme/Blocks/_alert.scss | 10 ++++++---- src/theme/_site-variables.scss | 15 ++++++++------- 2 files changed, 14 insertions(+), 11 deletions(-) diff --git a/src/theme/ItaliaTheme/Blocks/_alert.scss b/src/theme/ItaliaTheme/Blocks/_alert.scss index a56de95a5..fefc23a71 100644 --- a/src/theme/ItaliaTheme/Blocks/_alert.scss +++ b/src/theme/ItaliaTheme/Blocks/_alert.scss @@ -17,26 +17,28 @@ .bg-alert-danger { background-color: $alert-danger; - color: $white; + color: $alert-danger-text; a { - color: $white; + color: $alert-danger-text; } } .bg-alert-warning { background-color: $alert-warning; + color: $alert-warning-text; a { - color: $body-color; + color: $alert-warning-text; } } .bg-alert-info { background-color: $alert-info; + color: $alert-info-text; a { - color: $body-color; + color: $alert-info-text; } } diff --git a/src/theme/_site-variables.scss b/src/theme/_site-variables.scss index dd82b17ce..c3e96cfcb 100644 --- a/src/theme/_site-variables.scss +++ b/src/theme/_site-variables.scss @@ -32,19 +32,20 @@ $gdpr-toggle: #b22515 !default; $gdpr-toggle-border: #000 !default; $gdpr-focus-color: #ff9800 !default; $gdpr-link-color: #004285 !default; -$gdpr-focus-shadow: - inset 0 1px 0 rgba(255, 255, 255, 0.15), - 0 1px 1px rgba(0, 0, 0, 0.075), - 0 0 0 0.2rem $gdpr-focus-color !default; +$gdpr-focus-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.15), + 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 0 0.2rem $gdpr-focus-color !default; $caption-text: #455b71 !default; $primary-a0: hsl($primary-h, 62%, 97%) !default; // ALERT-BLOCK CUSTOM COLORS -$alert-danger: #a32219; -$alert-warning: #eb973f; -$alert-info: #f0c250; +$alert-danger: #a32219 !default; +$alert-danger-text: #fff !default; +$alert-warning: #eb973f !default; +$alert-warning-text: #000 !default; +$alert-info: #f0c250 !default; +$alert-info-text: #000 !default; $argument-icon-color: $tertiary !default; $argument-icon-bg: #f5f6f7 !default; From 3194ab8139edfadff747494c9609e7b2fa79b057 Mon Sep 17 00:00:00 2001 From: Piero Nicolli Date: Thu, 11 Jan 2024 10:41:08 +0100 Subject: [PATCH 11/13] fix: default in white header scss variable --- src/theme/_site-variables.scss | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/theme/_site-variables.scss b/src/theme/_site-variables.scss index c3e96cfcb..ba08dcaaa 100644 --- a/src/theme/_site-variables.scss +++ b/src/theme/_site-variables.scss @@ -21,7 +21,7 @@ $font-family-monospace-light: Roboto Mono Light !default; // Per abilitare l'header bianco impostare a true // e impostare "$header-center-bg-color: white" come qui sotto -$enable-header-white-background: false; +$enable-header-white-background: false !default; // $header-center-bg-color: white; // $header-slim-bg-color: #3f3f3f; @@ -32,8 +32,10 @@ $gdpr-toggle: #b22515 !default; $gdpr-toggle-border: #000 !default; $gdpr-focus-color: #ff9800 !default; $gdpr-link-color: #004285 !default; -$gdpr-focus-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.15), - 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 0 0.2rem $gdpr-focus-color !default; +$gdpr-focus-shadow: + inset 0 1px 0 rgba(255, 255, 255, 0.15), + 0 1px 1px rgba(0, 0, 0, 0.075), + 0 0 0 0.2rem $gdpr-focus-color !default; $caption-text: #455b71 !default; From 6e4c1efbf96c372bf78a67ecf86ade64b7b2bb6a Mon Sep 17 00:00:00 2001 From: sabrina-bongiovanni <116291154+sabrina-bongiovanni@users.noreply.github.com> Date: Thu, 11 Jan 2024 10:45:12 +0100 Subject: [PATCH 12/13] fix: a11y for navigation in megamenu and mobile menu (#456) * fix: added FocusLock for mobile navbar menu * fix: porting of v2 accessibility for megamenu * fix: changed classname into visually-hidden * fix: added condition for rendering close button * chore: cleaned up code --- package.json | 1 + src/components/Collapse.jsx | 27 +++-- .../ItaliaTheme/MegaMenu/MegaMenu.jsx | 22 ++-- .../MenuSecondary/MenuSecondary.jsx | 5 +- .../theme/Navigation/Navigation.jsx | 101 +++++++++++------- yarn.lock | 1 + 6 files changed, 102 insertions(+), 55 deletions(-) diff --git a/package.json b/package.json index 90db87504..40da639b4 100644 --- a/package.json +++ b/package.json @@ -131,6 +131,7 @@ "htmldiff-js": "1.0.5", "marked": "9.0.0", "react-dropzone": "11.0.1", + "react-focus-lock": "2.9.4", "react-google-recaptcha-v3": "1.7.0", "react-select": "^4.3.1", "react-slick": "^0.29.0", diff --git a/src/components/Collapse.jsx b/src/components/Collapse.jsx index 86f21de0d..26a1d1446 100644 --- a/src/components/Collapse.jsx +++ b/src/components/Collapse.jsx @@ -39,10 +39,10 @@ const Collapse = ({ children, isOpen, onOverlayClick, + showCloseButton = true, // deprecato da v12.0.0 ...attributes }) => { const intl = useIntl(); - if (navbar && header) { const classes = classNames(className, 'navbar-collapse', { expanded: isOpen, @@ -60,16 +60,21 @@ const Collapse = ({ style={{ display: isOpen ? 'block' : 'none' }} onClick={onOverlayClick} > -
- -
+ {/* Deprecato - non viene più utilizzato da v12.0.0 per ragioni di accessibilità + Close button ora presente in Navigation.jsx + */} + {showCloseButton && ( +
+ +
+ )} {children} ); diff --git a/src/components/ItaliaTheme/MegaMenu/MegaMenu.jsx b/src/components/ItaliaTheme/MegaMenu/MegaMenu.jsx index 7a17726ac..e55aede9d 100644 --- a/src/components/ItaliaTheme/MegaMenu/MegaMenu.jsx +++ b/src/components/ItaliaTheme/MegaMenu/MegaMenu.jsx @@ -112,13 +112,14 @@ const MegaMenu = ({ item, pathname }) => { if (item.mode === 'simpleLink') { return item.linkUrl?.length > 0 ? ( - + {isItemActive && ( @@ -238,7 +239,7 @@ const MegaMenu = ({ item, pathname }) => { } return ( - + { } }} title={intl.formatMessage(messages.closeMenu)} + // APG spec: on Tab menu closes, so remove it from focusable elements + // https://www.w3.org/WAI/ARIA/apg/patterns/menubar/examples/menubar-navigation/ + tabIndex="-1" > @@ -278,10 +282,14 @@ const MegaMenu = ({ item, pathname }) => { {childrenGroups.map((group, index) => ( - + {group.map((child, idx) => { return ( -
  • +
  • {child.showAsHeader ? (

    { key={child['@id']} onClick={() => setMenuStatus(false)} role="menuitem" + aria-current="page" > {child.title} @@ -362,12 +371,13 @@ const MegaMenu = ({ item, pathname }) => { - -
  • + +
  • setMenuStatus(false)} + role="menuitem" > {item.showMoreText?.length > 0 diff --git a/src/components/ItaliaTheme/MenuSecondary/MenuSecondary.jsx b/src/components/ItaliaTheme/MenuSecondary/MenuSecondary.jsx index 4dfd91056..c596d944d 100644 --- a/src/components/ItaliaTheme/MenuSecondary/MenuSecondary.jsx +++ b/src/components/ItaliaTheme/MenuSecondary/MenuSecondary.jsx @@ -44,17 +44,18 @@ const MenuSecondary = ({ pathname }) => { return ( items?.length > 0 && ( -