io-sanita-theme 2.23.0 → 2.23.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.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,16 @@
1
1
  # Changelog
2
2
 
3
+ ## [2.23.1](https://github.com/RedTurtle/io-sanita-theme/compare/2.23.0...2.23.1) (2026-03-20)
4
+
5
+ ### Bug Fixes
6
+
7
+ * alert block height in view mode ([#120](https://github.com/RedTurtle/io-sanita-theme/issues/120)) ([58c969e](https://github.com/RedTurtle/io-sanita-theme/commit/58c969eda0d02e76b6535863eda7230db2808b14))
8
+ * uridecode filename ([#119](https://github.com/RedTurtle/io-sanita-theme/issues/119)) ([eea9e68](https://github.com/RedTurtle/io-sanita-theme/commit/eea9e681fc78a29ee50167191e1f558984da5bda))
9
+
10
+ ### Changes
11
+
12
+ * make codebase more flexible for addons ([#116](https://github.com/RedTurtle/io-sanita-theme/issues/116)) ([3e1b034](https://github.com/RedTurtle/io-sanita-theme/commit/3e1b034df7b0556ec6cb94cf7f29b0d92dba9788))
13
+
3
14
  ## [2.23.0](https://github.com/RedTurtle/io-sanita-theme/compare/2.22.1...2.23.0) (2026-03-19)
4
15
 
5
16
  ### Features
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "io-sanita-theme",
3
- "version": "2.23.0",
3
+ "version": "2.23.1",
4
4
  "description": "io-sanita-theme: Volto add-on",
5
5
  "main": "src/index.js",
6
6
  "license": "MIT",
@@ -56,6 +56,17 @@
56
56
  }
57
57
 
58
58
  .block.alert_block {
59
+ h1,
60
+ h2,
61
+ h3,
62
+ h4,
63
+ h5,
64
+ h6 {
65
+ margin-top: 0;
66
+ margin-bottom: 0.5rem;
67
+ line-height: 1.2;
68
+ }
69
+
59
70
  .full-width {
60
71
  height: auto;
61
72
  }
@@ -1,3 +1,11 @@
1
+ import './cardFile.scss';
2
+
3
+ import { Card, CardBody, CardText, CardTitle } from 'design-react-kit';
4
+ import { defineMessages, useIntl } from 'react-intl';
5
+
6
+ import { FileIcon } from 'io-sanita-theme/helpers';
7
+ import { Icon } from 'io-sanita-theme/components';
8
+ import Module from 'io-sanita-theme/components/Cards/CardFile/Module';
1
9
  /*
2
10
  Usa la Card File per
3
11
  - allegare documenti o
@@ -21,17 +29,10 @@ In caso di download diretto, è suggerito l’utilizzo dell’icona con il forma
21
29
  In caso di collegamento a una pagina foglia di tipo documento, è suggerito l’utilizzo di un’icona file generica e non è necessario specificare estensione e peso nel titolo.
22
30
  */
23
31
  import React from 'react';
24
- import { useIntl, defineMessages } from 'react-intl';
32
+ import UniversalLink from '@plone/volto/components/manage/UniversalLink/UniversalLink';
25
33
  import cx from 'classnames';
26
- import { Card, CardBody, CardTitle, CardText } from 'design-react-kit';
27
34
  import { flattenToAppURL } from '@plone/volto/helpers/Url/Url';
28
- import UniversalLink from '@plone/volto/components/manage/UniversalLink/UniversalLink';
29
35
  import { viewDate } from 'io-sanita-theme/helpers';
30
- import { Icon } from 'io-sanita-theme/components';
31
- import { FileIcon } from 'io-sanita-theme/helpers';
32
- import Module from 'io-sanita-theme/components/Cards/CardFile/Module';
33
-
34
- import './cardFile.scss';
35
36
 
36
37
  const messages = defineMessages({
37
38
  attachment: {
@@ -154,12 +155,12 @@ export const CardFile = ({
154
155
  <a
155
156
  className="card-title-link flex-grow-1 pe-4"
156
157
  href={flattenToAppURL(file.download)}
157
- title={file.filename}
158
+ title={decodeURI(file.filename)}
158
159
  target={pdfFile ? '_blank' : '_self'}
159
160
  rel={pdfFile ? 'noopener noreferrer' : ''}
160
161
  data-element={titleDataElement}
161
162
  >
162
- {file.filename}
163
+ {decodeURI(file.filename)}
163
164
  </a>
164
165
  )}
165
166
 
@@ -0,0 +1,65 @@
1
+ import type { ConfigType } from '@plone/registry';
2
+ import { FeedbackForm } from 'volto-feedback-italia';
3
+ import Icon from 'io-sanita-theme/components/Icon/Icon';
4
+ import ImageWithErrors from 'io-sanita-theme/components/ImageWithErrors/ImageWithErrors';
5
+ import Pagination from 'io-sanita-theme/components/Pagination/Pagination';
6
+ import RichTextSection from 'io-sanita-theme/helpers/RichText/RichTextSection';
7
+ import SelectInput from 'io-sanita-theme/components/Widgets/SelectInput/SelectInput';
8
+ import SideMenu from 'io-sanita-theme/components/View/commons/SideMenu/SideMenu';
9
+ import SiteSettingsExtras from 'io-sanita-theme/components/AppExtras/SiteSettingsExtras';
10
+ import SkipToMainContent from 'io-sanita-theme/components/View/commons/SkipToMainContent';
11
+
12
+ export default function applyComponentConfig(config: ConfigType) {
13
+ config.components = {
14
+ ...config.components,
15
+ BlockExtraTags: { component: () => null },
16
+ Image: {
17
+ // @ts-expect-error
18
+ component: ImageWithErrors,
19
+ },
20
+ };
21
+
22
+ config.registerComponent({
23
+ name: 'FeedbackForm',
24
+ component: FeedbackForm,
25
+ });
26
+
27
+ config.registerComponent({
28
+ name: 'Icon',
29
+ component: Icon,
30
+ });
31
+
32
+ config.registerComponent({
33
+ name: 'Pagination',
34
+ component: Pagination,
35
+ });
36
+
37
+ config.registerComponent({
38
+ name: 'RichTextSection',
39
+ // @ts-expect-error
40
+ component: RichTextSection,
41
+ });
42
+
43
+ config.registerComponent({
44
+ name: 'SelectInput',
45
+ component: SelectInput,
46
+ });
47
+
48
+ config.registerComponent({
49
+ name: 'SideMenu',
50
+ // @ts-expect-error
51
+ component: SideMenu,
52
+ });
53
+
54
+ config.registerComponent({
55
+ name: 'SiteSettingsExtras',
56
+ component: SiteSettingsExtras,
57
+ });
58
+
59
+ config.registerComponent({
60
+ name: 'SkipToMainContent',
61
+ component: SkipToMainContent,
62
+ });
63
+
64
+ return config;
65
+ }
@@ -1,6 +1,5 @@
1
1
  import loadable from '@loadable/component';
2
2
  import { defineMessages } from 'react-intl';
3
- import ImageWithErrors from 'io-sanita-theme/components/ImageWithErrors/ImageWithErrors';
4
3
 
5
4
  import menuSVG from '@plone/volto/icons/menu.svg';
6
5
  import menuAltSVG from '@plone/volto/icons/menu-alt.svg';
@@ -43,6 +42,7 @@ import TrackFocus from 'io-sanita-theme/components/AppExtras/TrackFocus';
43
42
  import HandleAnchor from 'io-sanita-theme/components/AppExtras/HandleAnchor';
44
43
  import SiteSettingsExtras from 'io-sanita-theme/components/AppExtras/SiteSettingsExtras';
45
44
  import GenericAppExtras from 'io-sanita-theme/components/AppExtras/GenericAppExtras';
45
+ import applyComponentConfig from 'io-sanita-theme/config/components';
46
46
  import { loadables as IoSanitaLoadables } from 'io-sanita-theme/config/loadables';
47
47
  import { registerIOSanitaValidators } from 'io-sanita-theme/config/validators';
48
48
 
@@ -58,6 +58,7 @@ import applyIoSanitaViews from 'io-sanita-theme/config/views/views';
58
58
  import { SideMenu } from 'io-sanita-theme/components/View/commons';
59
59
  import AggregationPage from 'io-sanita-theme/components/View/AggregationPage/AggregationPage';
60
60
  import { applyFarmacieConfig } from './farmacie';
61
+ import applyUtilitiesConfig from 'io-sanita-theme/config/utilities';
61
62
 
62
63
  import getIoSanitaWidgets from 'io-sanita-theme/config/widgets/widgets';
63
64
  import { component } from 'design-react-kit/dist/types/Icon/assets/ItAndroidSquare';
@@ -321,19 +322,10 @@ export default function applyConfig(config) {
321
322
  removeListingVariation(config, 'summary'); // removes summary volto template, because is unused
322
323
  removeListingVariation(config, 'imageGallery'); // removes imageGallery volto template, because we have our photoGallery template
323
324
 
324
- // COMPONENTS
325
- config.components = {
326
- ...config.components,
327
- BlockExtraTags: { component: () => null },
328
- Image: {
329
- component: ImageWithErrors,
330
- },
331
- };
332
-
333
- config.registerComponent({
334
- name: 'SiteSettingsExtras',
335
- component: SiteSettingsExtras,
336
- });
325
+ // /******************************************************************************
326
+ // * COMPONENTS
327
+ // ******************************************************************************/
328
+ applyComponentConfig(config);
337
329
 
338
330
  // REDUCERS
339
331
  config.addonReducers = {
@@ -341,6 +333,11 @@ export default function applyConfig(config) {
341
333
  ...reducers,
342
334
  };
343
335
 
336
+ // /******************************************************************************
337
+ // * UTILITIES
338
+ // ******************************************************************************/
339
+ applyUtilitiesConfig(config);
340
+
344
341
  // VALIDATORS
345
342
  registerIOSanitaValidators(config);
346
343
 
@@ -0,0 +1,18 @@
1
+ import type { ConfigType } from '@plone/registry';
2
+ import { viewDate } from 'io-sanita-theme/helpers';
3
+
4
+ export default function applyUtilitiesConfig(config: ConfigType) {
5
+ config.registerUtility({
6
+ name: 'viewDate',
7
+ type: 'italia-viewDate',
8
+ method: viewDate,
9
+ });
10
+
11
+ return config;
12
+ }
13
+
14
+ declare module '@plone/types' {
15
+ interface UtilityTypeMap {
16
+ 'italia-viewDate': typeof viewDate;
17
+ }
18
+ }
@@ -32,7 +32,7 @@ const Footer = ({ intl }) => {
32
32
  contentType = null;
33
33
  }
34
34
 
35
- const NoFeedbackFormFor =
35
+ const noFeedbackFormFor =
36
36
  config.settings.siteProperties.noFeedbackFormFor || [];
37
37
  const showFeedbackForm = config.settings.siteProperties
38
38
  ?.enableNoFeedbackFormFor
@@ -2,12 +2,14 @@
2
2
  * File view component.
3
3
  * @module components/theme/View/FileView
4
4
  * - changed card layout
5
+ * - decodeURI filename
5
6
  */
6
7
 
7
- import React from 'react';
8
- import PropTypes from 'prop-types';
9
- import { Container, Row, Col } from 'design-react-kit';
8
+ import { Col, Container, Row } from 'design-react-kit';
9
+
10
10
  import { DownloadFileFormat } from 'io-sanita-theme/helpers';
11
+ import PropTypes from 'prop-types';
12
+ import React from 'react';
11
13
 
12
14
  /**
13
15
  * File view component class.
@@ -35,7 +37,7 @@ const FileView = ({ content }) => (
35
37
  <Col className="card-wrapper card-teaser-wrapper">
36
38
  <div className="genericcard card card-teaser shadow p-4 mt-3 rounded">
37
39
  <div className="card-body">
38
- <h2 className="card-title h5">{content.file.filename}</h2>
40
+ <h2 className="card-title h5">{decodeURI(content.file.filename)}</h2>
39
41
  <DownloadFileFormat file={content.file} iconSize="2x" />
40
42
  </div>
41
43
  </div>
@@ -1,10 +1,8 @@
1
- import React from 'react';
1
+ import { FileIcon } from 'io-sanita-theme/helpers';
2
2
  import PropTypes from 'prop-types';
3
-
3
+ import React from 'react';
4
4
  import { flattenToAppURL } from '@plone/volto/helpers/Url/Url';
5
5
 
6
- import { FileIcon } from 'io-sanita-theme/helpers';
7
-
8
6
  const DownloadFileFormat = ({
9
7
  file,
10
8
  formatsize = '2x',
@@ -16,7 +14,7 @@ const DownloadFileFormat = ({
16
14
  return file ? (
17
15
  <a
18
16
  href={flattenToAppURL(file.download)}
19
- title={file.filename}
17
+ title={decodeURI(file.filename)}
20
18
  className={className}
21
19
  target={pdfFile ? '_blank' : '_self'}
22
20
  rel={pdfFile ? 'noopener noreferrer' : ''}
package/tsconfig.json CHANGED
@@ -17,7 +17,9 @@
17
17
  "noFallthroughCasesInSwitch": true,
18
18
  "downlevelIteration": true,
19
19
  "incremental": true,
20
- "paths": {}
20
+ "paths": {
21
+ "io-sanita-theme/*": ["./src/*"]
22
+ }
21
23
  },
22
24
  "include": ["src"],
23
25
  "exclude": ["node_modules"]