design-comuni-plone-theme 8.7.11 → 8.8.0

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,40 @@
1
1
 
2
2
 
3
+ ## [8.8.0](https://github.com/redturtle/design-comuni-plone-theme/compare/v8.7.12...v8.8.0) (2023-10-31)
4
+
5
+
6
+ ### Features
7
+
8
+ * added id and title_it adttrs and handled h2 title_type in Gallery component ([4d5949e](https://github.com/redturtle/design-comuni-plone-theme/commit/4d5949eb2393f442e6541637e89123153606279e))
9
+
10
+
11
+ ### Bug Fixes
12
+
13
+ * fixed image url in Photogallery listing popup ([#383](https://github.com/redturtle/design-comuni-plone-theme/issues/383)) ([b8d2e20](https://github.com/redturtle/design-comuni-plone-theme/commit/b8d2e207cdefd018824229975ac0f5ac0bdb8d0c))
14
+
15
+
16
+ ### Maintenance
17
+
18
+ * preparing release ([2e6d0a5](https://github.com/redturtle/design-comuni-plone-theme/commit/2e6d0a56ddd96ecbf48e68e03fcc3caf061ceb55))
19
+
20
+ ## [8.7.12](https://github.com/RedTurtle/design-comuni-plone-theme/compare/v8.7.11...v8.7.12) (2023-10-27)
21
+
22
+
23
+ ### Bug Fixes
24
+
25
+ * backport white header preset from child themes and fix header mobile ([#380](https://github.com/RedTurtle/design-comuni-plone-theme/issues/380)) ([60276ec](https://github.com/RedTurtle/design-comuni-plone-theme/commit/60276ecc3aa0dc51016f0bc8d1fad2e4a09ccd4e))
26
+ * fixed conditions for rendering + fix title tag ([#371](https://github.com/RedTurtle/design-comuni-plone-theme/issues/371)) ([522774b](https://github.com/RedTurtle/design-comuni-plone-theme/commit/522774bee6dafd21dc09beef2fbc5b70936b7944))
27
+ * icon component for TextSizeButton in RichTextEditor ([#379](https://github.com/RedTurtle/design-comuni-plone-theme/issues/379)) ([d2160ce](https://github.com/RedTurtle/design-comuni-plone-theme/commit/d2160ce95eb8c98f1221c690f019ec42c20c8fcd))
28
+ * overlapping block chooser in small pages/screens ([#372](https://github.com/RedTurtle/design-comuni-plone-theme/issues/372)) ([3035ea2](https://github.com/RedTurtle/design-comuni-plone-theme/commit/3035ea2b2c1e7ddfa3968d3d685614cb3dda097d))
29
+ * release-log class added ([#376](https://github.com/RedTurtle/design-comuni-plone-theme/issues/376)) ([92e5a68](https://github.com/RedTurtle/design-comuni-plone-theme/commit/92e5a680afd15bc25a8b8eb97ab96845f77e8294))
30
+ * release-log text ([#377](https://github.com/RedTurtle/design-comuni-plone-theme/issues/377)) ([46a4d5f](https://github.com/RedTurtle/design-comuni-plone-theme/commit/46a4d5f174d9dedd6cf190466a88ade0d6746d68))
31
+
32
+
33
+ ### Documentation
34
+
35
+ * updated publiccode and release log ([b1e9e81](https://github.com/RedTurtle/design-comuni-plone-theme/commit/b1e9e81c3506851e41b5f35d866353b579358edd))
36
+ * updated publiccode and release log ([276ca06](https://github.com/RedTurtle/design-comuni-plone-theme/commit/276ca0605b13923f2941a9ec843ca7e04dce20a1))
37
+
3
38
  ## [8.7.11](https://github.com/redturtle/design-comuni-plone-theme/compare/v8.7.10...v8.7.11) (2023-10-23)
4
39
 
5
40
 
package/RELEASE.md CHANGED
@@ -41,6 +41,15 @@
41
41
  - ...
42
42
  -->
43
43
 
44
+ ## Versione 8.7.12 (27/10/2023)
45
+
46
+ ### Fix
47
+
48
+ - Migliorato il dimensionamento dell'icona del menù su dispositivi mobile
49
+ - Sistemata dimensione logo e bottone di ricerca su dispositivi mobile
50
+ - Migliorato il comportamento del menu laterale dei contenuti quando si aggiungono file nelle cartelle al loro interno
51
+ - Sistemata sovrapposizione della finestra di selezione blocchi con l'header del sito per alcune dimensioni dello schermo
52
+
44
53
  ## Versione 8.7.10 (19/10/2023)
45
54
 
46
55
  ## Fix
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.7.11",
5
+ "version": "8.8.0",
6
6
  "main": "src/index.js",
7
7
  "keywords": [
8
8
  "volto-addon",
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-10-23'
230
+ releaseDate: '2023-10-31'
231
231
  softwareType: standalone/web
232
- softwareVersion: 8.7.11
232
+ softwareVersion: 8.8.0
233
233
  url: 'https://github.com/italia/design-comuni-plone-theme'
234
234
  usedBy:
235
235
  - ASP Comuni Modenesi Area Nord
@@ -10,8 +10,6 @@ import {
10
10
  } from 'design-comuni-plone-theme/components/ItaliaTheme';
11
11
  import React, { useRef, useState } from 'react';
12
12
  import { defineMessages, useIntl } from 'react-intl';
13
-
14
- import DefaultImageSVG from '@plone/volto/components/manage/Blocks/Listing/default-image.svg';
15
13
  import { GalleryPreview } from 'design-comuni-plone-theme/components/ItaliaTheme';
16
14
  import { Icon } from 'design-comuni-plone-theme/components/ItaliaTheme';
17
15
  import PropTypes from 'prop-types';
@@ -139,12 +137,14 @@ const PhotogalleryTemplate = ({
139
137
 
140
138
  const getCaption = (item) => item.description ?? item.rights ?? null;
141
139
 
142
- const figure = (image, item) => (
143
- <figure className="img-wrapper">
144
- {image ? <>{image}</> : <img src={DefaultImageSVG} alt="" />}
145
- {getCaption(item) && <figcaption>{getCaption(item)}</figcaption>}
146
- </figure>
147
- );
140
+ const figure = (image, item) => {
141
+ return (
142
+ <figure className="img-wrapper">
143
+ {image}
144
+ {getCaption(item) && <figcaption>{getCaption(item)}</figcaption>}
145
+ </figure>
146
+ );
147
+ };
148
148
 
149
149
  return (
150
150
  <div className="photogallery">
@@ -3,7 +3,6 @@ import { defineMessages, useIntl } from 'react-intl';
3
3
  import { flattenToAppURL } from '@plone/volto/helpers';
4
4
 
5
5
  import PropTypes from 'prop-types';
6
-
7
6
  import { Modal, ModalBody, Button, ModalHeader } from 'design-react-kit';
8
7
  import { Icon } from 'design-comuni-plone-theme/components/ItaliaTheme';
9
8
  import DefaultImageSVG from '@plone/volto/components/manage/Blocks/Listing/default-image.svg';
@@ -34,6 +33,10 @@ const GalleryPreview = ({ id, viewIndex, setViewIndex, items }) => {
34
33
  const intl = useIntl();
35
34
  const [modalIsOpen, setModalIsOpen] = useState(false);
36
35
 
36
+ const checkUrlImage =
37
+ items[viewIndex]?.image?.scales?.larger?.download ||
38
+ items[viewIndex]?.image_scales?.image[0]?.scales?.larger?.download;
39
+
37
40
  const closeModal = () => {
38
41
  setViewIndex(null);
39
42
  };
@@ -92,11 +95,9 @@ const GalleryPreview = ({ id, viewIndex, setViewIndex, items }) => {
92
95
  </Button>
93
96
  )}
94
97
  <div className="image">
95
- {items[viewIndex].image ? (
98
+ {checkUrlImage ? (
96
99
  <img
97
- src={flattenToAppURL(
98
- items[viewIndex].image.scales.larger.download,
99
- )}
100
+ src={flattenToAppURL(checkUrlImage)}
100
101
  loading="lazy"
101
102
  alt={items[viewIndex].title}
102
103
  />
@@ -104,17 +104,13 @@ const Attachments = ({
104
104
  <RichTextSection
105
105
  tag_id={article_id}
106
106
  className="it-page-section mb-5"
107
- title={
108
- title ? (
109
- <h2 id={`header-${article_id}`}>{title}</h2>
110
- ) : (
111
- <h2 id={`header-${article_id}`}>
112
- {intl.formatMessage(messages.attachments)}
113
- </h2>
114
- )
115
- }
107
+ title={title ? title : intl.formatMessage(messages.attachments)}
116
108
  >
117
109
  {attachments.length > 0 && attachments_view}
110
+ {/** aggiunte conditions per attendere il render del componente mentre
111
+ * i risultati della query stanno ancora caricando
112
+ */}
113
+ {searchResults?.[key]?.loading && !searchResults?.[key]?.loaded && <></>}
118
114
  </RichTextSection>
119
115
  ) : (
120
116
  <div className="mb-5 mt-3">
@@ -36,8 +36,10 @@ const messages = defineMessages({
36
36
  const Gallery = ({
37
37
  content,
38
38
  folder_name,
39
+ id = '',
39
40
  title,
40
41
  title_type = 'h4',
42
+ title_id = 'galleria',
41
43
  title_video,
42
44
  className = '',
43
45
  reactSlick,
@@ -121,12 +123,23 @@ const Gallery = ({
121
123
  {images?.length > 0 ? (
122
124
  <div
123
125
  className={`it-carousel-wrapper it-carousel-landscape-abstract-three-cols ${className}`}
126
+ id={id}
124
127
  >
125
128
  <div className="slider-container">
126
129
  <div className="it-header-block">
127
130
  <div className="it-header-block-title">
128
- {title_type === 'h4' && <h4 id="galleria">{gallery_title}</h4>}
129
- {title_type === 'h5' && <h5 id="galleria">{gallery_title}</h5>}
131
+ {title_type === 'h2' && (
132
+ <h2 id={title_id} className="mb-3 h4">
133
+ {gallery_title}
134
+ </h2>
135
+ )}
136
+ {title_type === 'h3' && (
137
+ <h3 id={title_id} className="h5">
138
+ {gallery_title}
139
+ </h3>
140
+ )}
141
+ {title_type === 'h4' && <h4 id={title_id}>{gallery_title}</h4>}
142
+ {title_type === 'h5' && <h5 id={title_id}>{gallery_title}</h5>}
130
143
  </div>
131
144
  </div>
132
145
  <div className="it-carousel-all it-card-bg">
@@ -1,4 +1,4 @@
1
- h2 {
1
+ .release-log h2 {
2
2
  border-top: 1px solid grey;
3
3
  font-weight: 600 !important;
4
4
  }
@@ -100,7 +100,7 @@ const ReleaseLog = () => {
100
100
  <Helmet>
101
101
  <meta name="robots" content="noindex" />
102
102
  </Helmet>
103
- <Container className="px-4 my-4">
103
+ <Container className="px-4 my-4 release-log">
104
104
  <h1>Lista degli aggiornamenti</h1>
105
105
  <Nav tabs className="mb-3">
106
106
  {LOGS_TO_VIEW.filter((log) => log.file != null).map((log) => (
@@ -126,11 +126,11 @@ const ReleaseLog = () => {
126
126
  <div
127
127
  dangerouslySetInnerHTML={{
128
128
  __html:
129
- log.name === 'io-comune' ? (
129
+ log.name === 'io-Comune' ? (
130
130
  logDCPT
131
- ) : log.name == 'io-cittadino' ? (
131
+ ) : log.name == 'io-Cittadino' ? (
132
132
  logIoCittadino
133
- ) : log.name == 'io-prenoto' ? (
133
+ ) : log.name == 'io-Prenoto' ? (
134
134
  logIoPrenoto
135
135
  ) : (
136
136
  <div></div>
@@ -59,7 +59,7 @@ const TextSizeButton = (props) => {
59
59
  const createInlineStyleButton = props.draftJsCreateInlineStyleButton.default;
60
60
  return createInlineStyleButton({
61
61
  style: 'TEXT_LARGER',
62
- children: ButtonIcon,
62
+ children: <ButtonIcon />,
63
63
  });
64
64
  };
65
65
  export default TextSizeButton;
@@ -0,0 +1,157 @@
1
+ /* CUSTOMIZATIONS
2
+ - zindex for handling overlapping in small pages
3
+ */
4
+
5
+ import React from 'react';
6
+ import { doesNodeContainClick } from 'semantic-ui-react/dist/commonjs/lib';
7
+ import addSVG from '@plone/volto/icons/circle-plus.svg';
8
+ import { blockHasValue } from '@plone/volto/helpers';
9
+ import { Icon, BlockChooser } from '@plone/volto/components';
10
+ import config from '@plone/volto/registry';
11
+ import { Button, Ref } from 'semantic-ui-react';
12
+ import { defineMessages, useIntl } from 'react-intl';
13
+ import { usePopper } from 'react-popper';
14
+ import { Portal } from 'react-portal';
15
+
16
+ const messages = defineMessages({
17
+ addBlock: {
18
+ id: 'Add block',
19
+ defaultMessage: 'Add block',
20
+ },
21
+ });
22
+
23
+ export const ButtonComponent = (props) => {
24
+ const intl = useIntl();
25
+ const {
26
+ className = `block-add-button${
27
+ config.experimental.addBlockButton.enabled ? ' new-add-block' : ''
28
+ }`,
29
+ size = '19px',
30
+ onShowBlockChooser,
31
+ } = props;
32
+
33
+ return (
34
+ <Button
35
+ icon
36
+ basic
37
+ title={intl.formatMessage(messages.addBlock)}
38
+ onClick={(e) => {
39
+ e.preventDefault();
40
+ e.stopPropagation();
41
+ onShowBlockChooser();
42
+ }}
43
+ className={className}
44
+ >
45
+ <Icon name={addSVG} className={className} size={size} />
46
+ </Button>
47
+ );
48
+ };
49
+
50
+ const BlockChooserButton = (props) => {
51
+ const {
52
+ block,
53
+ allowedBlocks,
54
+ showRestricted,
55
+ data,
56
+ onMutateBlock,
57
+ onInsertBlock,
58
+ blocksConfig,
59
+ buttonComponent,
60
+ properties,
61
+ } = props;
62
+ const { disableNewBlocks } = data;
63
+ const [addNewBlockOpened, setAddNewBlockOpened] = React.useState(false);
64
+
65
+ const blockChooserRef = React.useRef();
66
+
67
+ const handleClickOutside = React.useCallback((e) => {
68
+ if (
69
+ blockChooserRef.current &&
70
+ doesNodeContainClick(blockChooserRef.current, e)
71
+ )
72
+ return;
73
+ setAddNewBlockOpened(false);
74
+ }, []);
75
+
76
+ const Component = buttonComponent || ButtonComponent;
77
+
78
+ React.useEffect(() => {
79
+ document.addEventListener('mousedown', handleClickOutside, false);
80
+ return () => {
81
+ document.removeEventListener('mousedown', handleClickOutside, false);
82
+ };
83
+ }, [handleClickOutside]);
84
+
85
+ const [referenceElement, setReferenceElement] = React.useState(null);
86
+ const [popperElement, setPopperElement] = React.useState(null);
87
+ const { styles, attributes } = usePopper(referenceElement, popperElement, {
88
+ placement: config.experimental.addBlockButton.enabled
89
+ ? 'bottom'
90
+ : 'right-start',
91
+ modifiers: [
92
+ {
93
+ name: 'offset',
94
+ options: {
95
+ offset: [-10, 5],
96
+ },
97
+ },
98
+ {
99
+ name: 'flip',
100
+ options: {
101
+ fallbackPlacements: ['right-end', 'top-start'],
102
+ },
103
+ },
104
+ ],
105
+ });
106
+
107
+ return (
108
+ <>
109
+ {!disableNewBlocks &&
110
+ (config.experimental.addBlockButton.enabled ||
111
+ !blockHasValue(data)) && (
112
+ <Ref innerRef={setReferenceElement}>
113
+ <Component
114
+ {...props}
115
+ onShowBlockChooser={() => setAddNewBlockOpened(true)}
116
+ />
117
+ </Ref>
118
+ )}
119
+ {addNewBlockOpened && (
120
+ <Portal node={document.getElementById('body')}>
121
+ <div
122
+ ref={setPopperElement}
123
+ style={{ ...styles.popper, zIndex: 1000 }}
124
+ {...attributes.popper}
125
+ >
126
+ <BlockChooser
127
+ onMutateBlock={
128
+ onMutateBlock
129
+ ? (id, value) => {
130
+ setAddNewBlockOpened(false);
131
+ onMutateBlock(id, value);
132
+ }
133
+ : null
134
+ }
135
+ onInsertBlock={
136
+ onInsertBlock
137
+ ? (id, value) => {
138
+ setAddNewBlockOpened(false);
139
+ onInsertBlock(id, value);
140
+ }
141
+ : null
142
+ }
143
+ currentBlock={block}
144
+ allowedBlocks={allowedBlocks}
145
+ blocksConfig={blocksConfig}
146
+ properties={properties}
147
+ showRestricted={showRestricted}
148
+ ref={blockChooserRef}
149
+ />
150
+ </div>
151
+ </Portal>
152
+ )}
153
+ </>
154
+ );
155
+ };
156
+
157
+ export default BlockChooserButton;
@@ -294,6 +294,11 @@ div.sticky-wrapper {
294
294
  }
295
295
  }
296
296
 
297
+ #view .it-carousel-wrapper .it-header-block .it-header-block-title h2.h4 {
298
+ border-bottom: none;
299
+ padding-bottom: 0;
300
+ }
301
+
297
302
  form.ui.form.vertical-form fieldset.invisible {
298
303
  min-width: 0;
299
304
  }
@@ -55,10 +55,6 @@ a {
55
55
  color: $secondary-text !important;
56
56
  }
57
57
 
58
- button.custom-navbar-toggler svg.icon {
59
- fill: $secondary-text;
60
- }
61
-
62
58
  ::selection {
63
59
  background-color: default;
64
60
  }
@@ -0,0 +1,62 @@
1
+ @if ($enable-header-white-background) {
2
+ .it-header-wrapper {
3
+ .it-header-center-wrapper {
4
+ .it-header-center-content-wrapper {
5
+ .it-brand-wrapper {
6
+ .it-brand-text,
7
+ .it-brand-text h2,
8
+ .it-brand-text h3 {
9
+ color: $text-color;
10
+ font-weight: 700;
11
+ }
12
+ }
13
+
14
+ .it-right-zone {
15
+ color: $text-color;
16
+
17
+ .it-socials {
18
+ ul {
19
+ .icon {
20
+ color: $primary;
21
+ fill: $primary;
22
+ }
23
+
24
+ a:hover svg {
25
+ fill: darken($primary, 10%);
26
+ }
27
+ }
28
+ }
29
+
30
+ .it-search-wrapper a.rounded-icon {
31
+ background-color: $primary;
32
+ color: white;
33
+
34
+ &:hover {
35
+ background-color: darken($primary, 10%);
36
+ }
37
+ }
38
+ }
39
+ }
40
+ }
41
+
42
+ .it-header-navbar-wrapper {
43
+ background-color: $primary;
44
+ }
45
+
46
+ .navbar .navbar-collapsable {
47
+ .menu-wrapper .it-brand-wrapper {
48
+ .it-brand-text,
49
+ .it-brand-text h2,
50
+ .it-brand-text h3 {
51
+ color: $text-color;
52
+ font-weight: 700;
53
+ }
54
+ }
55
+ }
56
+ @media (max-width: map-get($map: $grid-breakpoints, $key: 'lg') - 1px) {
57
+ button.custom-navbar-toggler svg.icon {
58
+ fill: $primary;
59
+ }
60
+ }
61
+ }
62
+ }
@@ -19,6 +19,12 @@ $tertiary-text: #fff !default;
19
19
  $highlight-search: #ff0 !default;
20
20
  $font-family-monospace-light: Roboto Mono Light !default;
21
21
 
22
+ // Per abilitare l'header bianco impostare a true
23
+ // e impostare "$header-center-bg-color: white" come qui sotto
24
+ $enable-header-white-background: false;
25
+ // $header-center-bg-color: white;
26
+ // $header-slim-bg-color: #3f3f3f;
27
+
22
28
  // GDPR-BANNER RELATED
23
29
  $gdpr-accept-all: #005700 !default;
24
30
  $gdpr-toggle-checked: #005700 !default;
@@ -188,6 +188,7 @@
188
188
  @import 'bootstrap-italia/src/scss/custom/headernavbar';
189
189
  @import 'bootstrap-italia/src/scss/custom/headernavbartheme';
190
190
  @import 'bootstrap-italia/src/scss/custom/header';
191
+ @import './bootstrap-italia/header';
191
192
 
192
193
  // footer
193
194
  @import 'bootstrap-italia/src/scss/custom/footer';
@@ -0,0 +1,19 @@
1
+ .it-header-wrapper {
2
+ @media (max-width: map-get($map: $grid-breakpoints, $key: 'lg') - 1px) {
3
+ .it-header-navbar-wrapper {
4
+ background-color: transparent;
5
+
6
+ > .container {
7
+ padding: 0;
8
+ }
9
+ }
10
+
11
+ .it-nav-wrapper .it-header-navbar-wrapper nav {
12
+ padding-right: 0;
13
+ }
14
+
15
+ .it-nav-wrapper .it-header-navbar-wrapper {
16
+ margin-top: -20px;
17
+ }
18
+ }
19
+ }
@@ -24,4 +24,23 @@
24
24
  }
25
25
  }
26
26
  }
27
+
28
+ @media (max-width: map-get($map: $grid-breakpoints, $key: 'lg') - 1px) {
29
+ .it-header-center-content-wrapper {
30
+ .it-brand-wrapper {
31
+ .header-logo {
32
+ img {
33
+ width: 30px;
34
+ height: 30px;
35
+ }
36
+ }
37
+ }
38
+
39
+ .it-right-zone .it-search-wrapper a.rounded-icon {
40
+ width: 36px;
41
+ height: 36px;
42
+ border-radius: 50%;
43
+ }
44
+ }
45
+ }
27
46
  }
@@ -21,6 +21,7 @@
21
21
  @import 'ItaliaTheme/css_variables';
22
22
  @import 'ItaliaTheme/common';
23
23
  @import 'ItaliaTheme/main';
24
+ @import 'ItaliaTheme/white-header';
24
25
  @import 'ItaliaTheme/ar';
25
26
  @import 'ItaliaTheme/home';
26
27
  @import 'ItaliaTheme/sitemap';