Skip to content

Commit

Permalink
Merge branch 'main' into fix_videogallery_us50330
Browse files Browse the repository at this point in the history
  • Loading branch information
pnicolli authored Jan 9, 2024
2 parents e0bc31e + 6d956dd commit 51f8ecb
Show file tree
Hide file tree
Showing 8 changed files with 48 additions and 83 deletions.
1 change: 1 addition & 0 deletions RELEASE.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@

### 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 (05/01/2024)
Expand Down
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
45 changes: 30 additions & 15 deletions src/components/ItaliaTheme/Search/ResultItem.jsx
Original file line number Diff line number Diff line change
@@ -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) ? (
<mark className="highlighted-text">{part}</mark>
) : (
part
),
)}
</>
);
};

const ResultItem = ({ item, index, section, searchableText }) => {
return (
<Card noWrapper={true} className="mt-3 mb-3">
<CardBody className="shadow-sm px-4 pt-4 pb-4 rounded">
{section}
<h4 className="card-title">
<UniversalLink item={item}>
<Highlighter
highlightClassName="highlighted-text"
searchWords={filteredWords}
autoEscape={true}
textToHighlight={item.title}
/>
<Marker highlight={searchableText} text={item.title} />
</UniversalLink>
</h4>
<p className="text-paragraph">
<Highlighter
highlightClassName="highlighted-text"
searchWords={filteredWords}
autoEscape={true}
textToHighlight={item.description}
/>
<Marker highlight={searchableText} text={item.description} />
</p>
</CardBody>
</Card>
Expand Down
2 changes: 1 addition & 1 deletion src/theme/ItaliaTheme/Components/_card.scss
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@
}

&.card-teaser .card-body {
flex: 1 0 75%;
flex: 1 0 74%;
}
}

Expand Down
1 change: 1 addition & 0 deletions src/theme/ItaliaTheme/Components/_search.scss
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}
1 change: 1 addition & 0 deletions src/theme/bootstrap-override/_bootstrap-italia-site.scss
Original file line number Diff line number Diff line change
Expand Up @@ -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';
}
3 changes: 3 additions & 0 deletions src/theme/bootstrap-override/bootstrap-italia/_focus.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
.skiplinks a:focus:not(.focus--mouse) {
border: 2px solid;
}
77 changes: 11 additions & 66 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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"
Expand Down Expand Up @@ -8503,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
Expand Down Expand Up @@ -10110,13 +10095,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"
Expand Down Expand Up @@ -11856,19 +11834,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"
Expand Down Expand Up @@ -12769,11 +12734,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

Expand All @@ -12788,7 +12753,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:
Expand All @@ -12799,7 +12764,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:
Expand All @@ -12810,16 +12775,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:
Expand All @@ -12828,17 +12784,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"
Expand Down Expand Up @@ -12985,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

Expand Down

0 comments on commit 51f8ecb

Please sign in to comment.