design-comuni-plone-theme 8.6.0 → 8.7.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.
Files changed (37) hide show
  1. package/CHANGELOG.md +25 -0
  2. package/RELEASE.md +17 -2
  3. package/locales/de/LC_MESSAGES/volto.po +7 -1
  4. package/locales/en/LC_MESSAGES/volto.po +7 -1
  5. package/locales/es/LC_MESSAGES/volto.po +7 -1
  6. package/locales/fr/LC_MESSAGES/volto.po +7 -1
  7. package/locales/it/LC_MESSAGES/volto.po +7 -1
  8. package/locales/volto.pot +8 -2
  9. package/package.json +1 -1
  10. package/publiccode.yml +3 -3
  11. package/src/components/ItaliaTheme/Blocks/Accordion/Block/EditBlock.jsx +26 -20
  12. package/src/components/ItaliaTheme/Blocks/Accordion/Edit.jsx +9 -1
  13. package/src/components/ItaliaTheme/Blocks/Alert/Edit.jsx +25 -12
  14. package/src/components/ItaliaTheme/Blocks/CTABlock/Block.jsx +28 -10
  15. package/src/components/ItaliaTheme/Blocks/ContactsBlock/Edit.jsx +8 -2
  16. package/src/components/ItaliaTheme/Blocks/ContactsBlock/View.jsx +7 -1
  17. package/src/components/ItaliaTheme/Blocks/Listing/SmallBlockLinksTemplate.jsx +4 -0
  18. package/src/components/ItaliaTheme/Blocks/TextCard/CardWithImage/Block.jsx +25 -52
  19. package/src/components/ItaliaTheme/Blocks/TextCard/CardWithImage/Edit.jsx +3 -1
  20. package/src/components/ItaliaTheme/Blocks/TextCard/CardWithImage/View.jsx +1 -1
  21. package/src/components/ItaliaTheme/Blocks/TextCard/SimpleCard/Block.jsx +27 -51
  22. package/src/components/ItaliaTheme/Blocks/TextCard/SimpleCard/Edit.jsx +3 -1
  23. package/src/components/ItaliaTheme/Blocks/TextCard/SimpleCard/View.jsx +2 -2
  24. package/src/components/ItaliaTheme/Blocks/__tests__/CardWithImage.test.jsx +6 -5
  25. package/src/components/ItaliaTheme/Blocks/__tests__/SimpleCard.test.jsx +1 -1
  26. package/src/components/ItaliaTheme/Search/Search.jsx +6 -1
  27. package/src/components/ItaliaTheme/View/CartellaModulisticaView/DocRow.jsx +2 -2
  28. package/src/components/ItaliaTheme/manage/Widgets/TextEditorWidget.jsx +28 -0
  29. package/src/components/ReleaseLog/ReleaseLog.jsx +1 -0
  30. package/src/components/SelectInput/SelectInput.jsx +5 -1
  31. package/src/config/Blocks/ListingOptions/index.js +1 -0
  32. package/src/config/Blocks/ListingOptions/smallBlockLinksTemplate.js +32 -0
  33. package/src/config/Blocks/listingVariations.js +3 -1
  34. package/src/customizations/volto/components/manage/UniversalLink/UniversalLink.jsx +10 -8
  35. package/src/theme/ItaliaTheme/Blocks/_smallblockLinkstemplate.scss +8 -1
  36. package/src/theme/ItaliaTheme/Widgets/_react-dates-override.scss +15 -0
  37. package/src/theme/site.scss +1 -0
@@ -34,7 +34,7 @@ const Downloads = ({ item, titleDoc }) => {
34
34
  </React.Fragment>
35
35
  ) : (
36
36
  <UniversalLink
37
- href={flattenToAppURL(item['@id'])}
37
+ href={item.remoteUrl || flattenToAppURL(item['@id'])}
38
38
  title={item.title}
39
39
  className="modulistica-link"
40
40
  >
@@ -59,7 +59,7 @@ const DocRow = ({ doc }) => {
59
59
  })}
60
60
  >
61
61
  <div id={`title-${doc.id}`} className="title">
62
- <UniversalLink href={flattenToAppURL(doc['@id'])}>
62
+ <UniversalLink href={doc.remoteUrl || flattenToAppURL(doc['@id'])}>
63
63
  {doc.title}
64
64
  </UniversalLink>
65
65
  {doc?.description && (
@@ -43,6 +43,8 @@ class TextEditorWidgetComponent extends Component {
43
43
  focusOn: PropTypes.func,
44
44
  nextFocus: PropTypes.any,
45
45
  prevFocus: PropTypes.any,
46
+ onFocusNextBlock: PropTypes.any,
47
+ onFocusPreviousBlock: PropTypes.any,
46
48
  showToolbar: PropTypes.bool,
47
49
  onSelectBlock: PropTypes.func,
48
50
  onAddBlock: PropTypes.func,
@@ -219,6 +221,18 @@ class TextEditorWidgetComponent extends Component {
219
221
  } else {
220
222
  if (this.props.disableMoveToNearest) {
221
223
  e.stopPropagation();
224
+ } else {
225
+ if (this.props.onFocusPreviousBlock) {
226
+ const selectionState = this.state.editorState.getSelection();
227
+ const currentCursorPosition = selectionState.getStartOffset();
228
+
229
+ if (currentCursorPosition === 0) {
230
+ this.props.onFocusPreviousBlock(
231
+ this.props.block,
232
+ this.node,
233
+ );
234
+ }
235
+ }
222
236
  }
223
237
  }
224
238
  }}
@@ -229,6 +243,20 @@ class TextEditorWidgetComponent extends Component {
229
243
  } else {
230
244
  if (this.props.disableMoveToNearest) {
231
245
  e.stopPropagation();
246
+ } else {
247
+ if (this.props.onFocusNextBlock) {
248
+ const selectionState = this.state.editorState.getSelection();
249
+ const { editorState } = this.state;
250
+ const currentCursorPosition = selectionState.getStartOffset();
251
+ const blockLength = editorState
252
+ .getCurrentContent()
253
+ .getFirstBlock()
254
+ .getLength();
255
+
256
+ if (currentCursorPosition === blockLength) {
257
+ this.props.onFocusNextBlock(this.props.block, this.node);
258
+ }
259
+ }
232
260
  }
233
261
  }
234
262
  }}
@@ -101,6 +101,7 @@ const ReleaseLog = () => {
101
101
  <meta name="robots" content="noindex" />
102
102
  </Helmet>
103
103
  <Container className="px-4 my-4">
104
+ <h1>Lista degli aggiornamenti</h1>
104
105
  <Nav tabs className="mb-3">
105
106
  {LOGS_TO_VIEW.filter((log) => log.file != null).map((log) => (
106
107
  <NavItem key={log.name}>
@@ -305,6 +305,7 @@ const SelectInput = ({
305
305
  options,
306
306
  components = {},
307
307
  reactSelect,
308
+ defaultValue,
308
309
  }) => {
309
310
  const intl = useIntl();
310
311
  const Select = reactSelect.default;
@@ -332,7 +333,9 @@ const SelectInput = ({
332
333
  isSearchable={isSearchable}
333
334
  isMulti={isMulti}
334
335
  isClearable={isClearable}
335
- aria-label={placeholder}
336
+ aria-label={label}
337
+ aria-live="polite"
338
+ aria-labelledby={id}
336
339
  ariaLiveMessages={getSelectAriaLiveMessages(intl)}
337
340
  noOptionsMessage={() =>
338
341
  intl.formatMessage(messages.select_noOptionsMessage)
@@ -346,6 +349,7 @@ const SelectInput = ({
346
349
  }`
347
350
  }
348
351
  classNamePrefix={'react-select'}
352
+ defaultValue={defaultValue}
349
353
  />
350
354
  </div>
351
355
  );
@@ -21,3 +21,4 @@ export { addSliderTemplateOptions } from 'design-comuni-plone-theme/config/Block
21
21
  export { addSimpleListTemplateOptions } from 'design-comuni-plone-theme/config/Blocks/ListingOptions/simpleListTemplate';
22
22
  export { addCardWithSlideUpTextTemplateOptions } from 'design-comuni-plone-theme/config/Blocks/ListingOptions/cardWithSlideUpTextTemplate';
23
23
  export { addPhotogalleryTemplateOptions } from 'design-comuni-plone-theme/config/Blocks/ListingOptions/photogalleryTemplate';
24
+ export { addSmallBlockLinksTemplateOptions } from 'design-comuni-plone-theme/config/Blocks/ListingOptions/smallBlockLinksTemplate';
@@ -0,0 +1,32 @@
1
+ import { defineMessages } from 'react-intl';
2
+
3
+ import { addSchemaField } from 'design-comuni-plone-theme/config/Blocks/ListingOptions';
4
+
5
+ const messages = defineMessages({
6
+ override_links_accessibility_marker: {
7
+ id: 'override_links_accessibility_marker',
8
+ defaultMessage:
9
+ "Non mostrare l'icona di accessibilità per i link a siti esterni",
10
+ },
11
+ });
12
+
13
+ export const addSmallBlockLinksTemplateOptions = (
14
+ schema,
15
+ formData,
16
+ intl,
17
+ position = 0,
18
+ ) => {
19
+ let pos = position;
20
+
21
+ addSchemaField(
22
+ schema,
23
+ 'override_links_accessibility_marker',
24
+ intl.formatMessage(messages.override_links_accessibility_marker),
25
+ null,
26
+ { type: 'boolean' },
27
+ pos,
28
+ );
29
+ pos++;
30
+
31
+ return pos;
32
+ };
@@ -59,6 +59,7 @@ import {
59
59
  addCardWithSlideUpTextTemplateOptions,
60
60
  addPhotogalleryTemplateOptions,
61
61
  addLinkMoreOptions,
62
+ addSmallBlockLinksTemplateOptions,
62
63
  cloneBlock,
63
64
  } from 'design-comuni-plone-theme/config/Blocks/ListingOptions';
64
65
 
@@ -178,7 +179,8 @@ const italiaListingVariations = [
178
179
  template: SmallBlockLinksTemplate,
179
180
  skeleton: SmallBlockLinksTemplateSkeleton,
180
181
  schemaEnhancer: ({ schema, formData, intl }) => {
181
- /*let pos = */ addDefaultOptions(schema, formData, intl);
182
+ let pos = addDefaultOptions(schema, formData, intl);
183
+ addSmallBlockLinksTemplateOptions(schema, formData, intl, pos);
182
184
  addLinkMoreOptions(schema, formData, intl);
183
185
  return schema;
184
186
  },
@@ -30,6 +30,7 @@ const UniversalLink = ({
30
30
  children,
31
31
  className = null,
32
32
  title = null,
33
+ overrideMarkSpecialLinks = false,
33
34
  ...props
34
35
  }) => {
35
36
  const intl = useIntl();
@@ -116,14 +117,15 @@ const UniversalLink = ({
116
117
  {...props}
117
118
  >
118
119
  {children}
119
- {config.settings.siteProperties.markSpecialLinks && (
120
- <Icon
121
- icon="it-external-link"
122
- title={title}
123
- size="xs"
124
- className="align-top ms-1 external-link"
125
- />
126
- )}
120
+ {!overrideMarkSpecialLinks &&
121
+ config.settings.siteProperties.markSpecialLinks && (
122
+ <Icon
123
+ icon="it-external-link"
124
+ title={title}
125
+ size="xs"
126
+ className="align-top ms-1 external-link"
127
+ />
128
+ )}
127
129
  </a>
128
130
  );
129
131
  } else if (isDownload) {
@@ -15,13 +15,20 @@
15
15
  border: 8px solid $white;
16
16
  background: $white;
17
17
  box-shadow: 0 2px 20px 0 rgba(0, 0, 0, 0.1);
18
+ position: relative;
19
+
20
+ .img-link svg {
21
+ position: absolute;
22
+ top: 4px;
23
+ right: 4px;
24
+ z-index: 2;
25
+ }
18
26
 
19
27
  .volto-image.responsive img,
20
28
  .img-skeleton {
21
29
  width: auto;
22
30
  max-width: 100%;
23
31
  object-fit: contain;
24
-
25
32
  }
26
33
 
27
34
  .img-skeleton {
@@ -0,0 +1,15 @@
1
+ table.CalendarMonth_table {
2
+ border-collapse: separate;
3
+
4
+ td.CalendarDay__selected:focus {
5
+ border: 1px solid white;
6
+ border-radius: 100%;
7
+ outline: 2px solid $focus-outline-color;
8
+ }
9
+
10
+ td.CalendarDay__default:focus {
11
+ border: none !important;
12
+ box-shadow: none !important;
13
+ outline: 2px solid $focus-outline-color !important;
14
+ }
15
+ }
@@ -113,6 +113,7 @@
113
113
  @import 'ItaliaTheme/Widgets/blocksWidget';
114
114
  @import 'ItaliaTheme/Widgets/subsiteSocialLinks';
115
115
  @import 'ItaliaTheme/Widgets/reactSelect';
116
+ @import 'ItaliaTheme/Widgets/react-dates-override';
116
117
  @import 'ItaliaTheme/Widgets/textInput';
117
118
  @import 'ItaliaTheme/Widgets/dataGridWidget';
118
119
  @import 'ItaliaTheme/Widgets/canaleDigitaleWidget';