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 1/6] 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 2/6] 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 3/6] 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 4/6] 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 5/6] 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 6/6] 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 && ( -