design-comuni-plone-theme 10.4.0 → 10.4.2
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/.eslintrc.js +1 -1
- package/CHANGELOG.md +39 -0
- package/RELEASE.md +18 -0
- package/error-503.html +52 -50
- package/package.json +40 -24
- package/publiccode.yml +2 -2
- package/src/actions/getDettagliProcedimento.js +1 -2
- package/src/components/ItaliaTheme/Blocks/Listing/BandiInEvidenceTemplate.jsx +108 -104
- package/src/components/ItaliaTheme/Blocks/Listing/CardWithSlideUpTextTemplate.jsx +8 -10
- package/src/components/ItaliaTheme/Blocks/TextCard/SimpleCard/Block.jsx +1 -7
- package/src/components/ItaliaTheme/Blocks/__tests__/Alert.test.jsx +1 -2
- package/src/components/ItaliaTheme/Blocks/__tests__/CardWithImage.test.jsx +1 -2
- package/src/components/ItaliaTheme/Header/HeaderSlim/UserLoggedMenu.jsx +0 -1
- package/src/components/ItaliaTheme/Icons/FontAwesomeIcon.jsx +2 -2
- package/src/components/ItaliaTheme/Pagination/PaginationItem.jsx +2 -8
- package/src/components/ItaliaTheme/Pagination/createPaginationItems/itemFactories.js +4 -4
- package/src/components/ItaliaTheme/Search/utils.js +5 -3
- package/src/components/ItaliaTheme/View/Commons/ContactsCard.jsx +4 -4
- package/src/components/ItaliaTheme/View/Commons/DownloadFileFormat.jsx +1 -0
- package/src/components/ItaliaTheme/View/__tests__/PersonaView.test.jsx +928 -932
- package/src/components/ItaliaTheme/manage/Widgets/TextEditorWidget.jsx +12 -8
- package/src/components/SelectInput/SelectInput.jsx +16 -21
- package/src/components/SelectInput/select-styles.css +1 -1
- package/src/config/Blocks/blocks.js +4 -3
- package/src/config/Blocks/listingVariations.js +4 -3
- package/src/config/Subsites/index.js +16 -16
- package/src/config/italiaConfig.js +6 -5
- package/src/customizations/volto/components/manage/Blocks/HeroImageLeft/Edit.jsx +31 -26
- package/src/customizations/volto/components/manage/Blocks/Listing/ListingBody.jsx +2 -2
- package/src/customizations/volto/components/manage/Blocks/Listing/withQuerystringResults.jsx +6 -6
- package/src/customizations/volto/components/manage/Blocks/Search/components/CheckboxFacet.jsx +2 -2
- package/src/customizations/volto/components/manage/Blocks/Search/components/FilterList.jsx +15 -20
- package/src/customizations/volto/components/manage/Blocks/Search/components/ToggleFacetFilterListEntry.jsx +2 -9
- package/src/customizations/volto/components/manage/Diff/DiffField.jsx +2 -9
- package/src/customizations/volto/components/manage/Sidebar/ObjectBrowserBody.jsx +10 -10
- package/src/customizations/volto/components/manage/Widgets/DatetimeWidget.jsx +4 -10
- package/src/customizations/volto/components/manage/Widgets/ObjectBrowserWidget.jsx +2 -9
- package/src/customizations/volto/components/manage/Widgets/RecurrenceWidget/RecurrenceWidget.jsx +2 -2
- package/src/customizations/volto/helpers/FormValidation/FormValidation.js +7 -6
- package/src/customizations/volto/helpers/Html/Html.jsx +2 -2
- package/src/customizations/volto/middleware/api.js +194 -190
- package/src/customizations/volto/middleware/blacklistRoutes.js +36 -34
- package/src/helpers/dates.js +2 -2
- package/src/theme/ItaliaTheme/Addons/volto-gdpr-privacy.scss +12 -5
- package/src/theme/ItaliaTheme/Blocks/_accordion.scss +2 -0
- package/src/theme/ItaliaTheme/Blocks/_alert.scss +1 -1
- package/src/theme/ItaliaTheme/Blocks/_bandiInEvidenceTemplate.scss +6 -1
- package/src/theme/ItaliaTheme/Blocks/_calendar.scss +8 -6
- package/src/theme/ItaliaTheme/Blocks/_cardWithImageAndInEvidence.scss +7 -7
- package/src/theme/ItaliaTheme/Blocks/_cardWithSlideUpTextTemplate.scss +5 -4
- package/src/theme/ItaliaTheme/Blocks/_completeBlockLinkstemplate.scss +4 -2
- package/src/theme/ItaliaTheme/Blocks/_countdown.scss +2 -2
- package/src/theme/ItaliaTheme/Blocks/_ctaBlock.scss +7 -5
- package/src/theme/ItaliaTheme/Blocks/_gridBlock.scss +8 -3
- package/src/theme/ItaliaTheme/Blocks/_gridGalleryTemplate.scss +1 -0
- package/src/theme/ItaliaTheme/Blocks/_hero.scss +1 -0
- package/src/theme/ItaliaTheme/Blocks/_iconBlocks.scss +2 -2
- package/src/theme/ItaliaTheme/Blocks/_imageBlock.scss +1 -0
- package/src/theme/ItaliaTheme/Blocks/_listing.scss +1 -1
- package/src/theme/ItaliaTheme/Blocks/_photogallerytemplate.scss +1 -0
- package/src/theme/ItaliaTheme/Blocks/_ribbonCardTemplate.scss +5 -4
- package/src/theme/ItaliaTheme/Blocks/_rssBlock.scss +3 -2
- package/src/theme/ItaliaTheme/Blocks/_search.scss +72 -36
- package/src/theme/ItaliaTheme/Blocks/_searchSections.scss +4 -3
- package/src/theme/ItaliaTheme/Blocks/_simpleCardTemplate.scss +6 -3
- package/src/theme/ItaliaTheme/Blocks/_sliderTemplate.scss +1 -1
- package/src/theme/ItaliaTheme/Blocks/_smallblockLinkstemplate.scss +3 -3
- package/src/theme/ItaliaTheme/Blocks/_subblocks-edit.scss +1 -1
- package/src/theme/ItaliaTheme/Blocks/_tableOfContents.scss +17 -7
- package/src/theme/ItaliaTheme/Blocks/_video.scss +1 -1
- package/src/theme/ItaliaTheme/Blocks/_videoGallery.scss +7 -6
- package/src/theme/ItaliaTheme/Components/_card.scss +14 -7
- package/src/theme/ItaliaTheme/Components/_cardPersona.scss +2 -2
- package/src/theme/ItaliaTheme/Components/_cmp-timeline.scss +16 -14
- package/src/theme/ItaliaTheme/Components/_contactsCard.scss +3 -3
- package/src/theme/ItaliaTheme/Components/_customerSatisfaction.scss +31 -11
- package/src/theme/ItaliaTheme/Components/_diffField.scss +25 -14
- package/src/theme/ItaliaTheme/Components/_galleryPreview.scss +10 -10
- package/src/theme/ItaliaTheme/Components/_mobileMenu.scss +1 -1
- package/src/theme/ItaliaTheme/Components/_navscroll.scss +2 -0
- package/src/theme/ItaliaTheme/Components/_pageHeader.scss +5 -4
- package/src/theme/ItaliaTheme/Components/_scrollToTop.scss +1 -0
- package/src/theme/ItaliaTheme/Components/_sharing.scss +1 -1
- package/src/theme/ItaliaTheme/Components/_sideMenu.scss +9 -5
- package/src/theme/ItaliaTheme/Components/_subsiteFooter.scss +1 -1
- package/src/theme/ItaliaTheme/Print/_all_pages.scss +5 -2
- package/src/theme/ItaliaTheme/Print/_bandi.scss +8 -8
- package/src/theme/ItaliaTheme/Print/_event.scss +11 -10
- package/src/theme/ItaliaTheme/Print/_news_items.scss +17 -17
- package/src/theme/ItaliaTheme/Print/_persona.scss +8 -8
- package/src/theme/ItaliaTheme/Print/_servizio.scss +8 -8
- package/src/theme/ItaliaTheme/Views/_bando.scss +1 -0
- package/src/theme/ItaliaTheme/Views/_cartellaModulistica.scss +20 -8
- package/src/theme/ItaliaTheme/Views/_common.scss +4 -3
- package/src/theme/ItaliaTheme/Views/_embeddedVideo.scss +1 -1
- package/src/theme/ItaliaTheme/Views/_evento.scss +1 -0
- package/src/theme/ItaliaTheme/Views/_faqFolder.scss +1 -0
- package/src/theme/ItaliaTheme/Views/_paginaArgomento.scss +1 -0
- package/src/theme/ItaliaTheme/Views/_puntoDiContatto.scss +1 -0
- package/src/theme/ItaliaTheme/Views/_servizio.scss +4 -1
- package/src/theme/ItaliaTheme/Views/_slider.scss +3 -3
- package/src/theme/ItaliaTheme/Views/_trasparenzaView.scss +2 -0
- package/src/theme/ItaliaTheme/Views/_uo.scss +3 -1
- package/src/theme/ItaliaTheme/Views/_venue.scss +3 -2
- package/src/theme/ItaliaTheme/Widgets/_canaleDigitaleWidget.scss +2 -1
- package/src/theme/ItaliaTheme/Widgets/_dataGridWidget.scss +24 -8
- package/src/theme/ItaliaTheme/Widgets/_iconWidget.scss +1 -1
- package/src/theme/ItaliaTheme/_common.scss +9 -4
- package/src/theme/ItaliaTheme/_main.scss +11 -8
- package/src/theme/_cms-ui.scss +46 -23
- package/src/theme/_cms-ui_container.scss +8 -3
- package/src/theme/_site-variables.scss +4 -2
- package/src/theme/bootstrap-override/bootstrap-italia/_breadcrumb.scss +1 -1
- package/src/theme/bootstrap-override/bootstrap-italia/_footer.scss +9 -4
- package/src/theme/bootstrap-override/bootstrap-italia/_linklist.scss +2 -0
- package/src/theme/bootstrap-override/bootstrap-italia/_megamenu.scss +1 -0
- package/src/theme/bootstrap-override/bootstrap-italia/_point-list.scss +4 -3
- package/src/theme/extras/_checkbox.scss +1 -1
- package/src/theme/extras/_modals.scss +5 -3
- package/src/theme/extras/_search.scss +14 -4
- package/src/theme/extras/_sidebar.scss +3 -0
|
@@ -198,10 +198,10 @@ class TextEditorWidgetComponent extends Component {
|
|
|
198
198
|
) {
|
|
199
199
|
const selectionState = this.state.editorState.getSelection();
|
|
200
200
|
const anchorKey = selectionState.getAnchorKey();
|
|
201
|
-
const currentContent =
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
201
|
+
const currentContent =
|
|
202
|
+
this.state.editorState.getCurrentContent();
|
|
203
|
+
const currentContentBlock =
|
|
204
|
+
currentContent.getBlockForKey(anchorKey);
|
|
205
205
|
const blockType = currentContentBlock.getType();
|
|
206
206
|
if (!includes(this.draftConfig.listBlockTypes, blockType)) {
|
|
207
207
|
this.props.onSelectBlock(
|
|
@@ -223,8 +223,10 @@ class TextEditorWidgetComponent extends Component {
|
|
|
223
223
|
e.stopPropagation();
|
|
224
224
|
} else {
|
|
225
225
|
if (this.props.onFocusPreviousBlock) {
|
|
226
|
-
const selectionState =
|
|
227
|
-
|
|
226
|
+
const selectionState =
|
|
227
|
+
this.state.editorState.getSelection();
|
|
228
|
+
const currentCursorPosition =
|
|
229
|
+
selectionState.getStartOffset();
|
|
228
230
|
|
|
229
231
|
if (currentCursorPosition === 0) {
|
|
230
232
|
this.props.onFocusPreviousBlock(
|
|
@@ -245,9 +247,11 @@ class TextEditorWidgetComponent extends Component {
|
|
|
245
247
|
e.stopPropagation();
|
|
246
248
|
} else {
|
|
247
249
|
if (this.props.onFocusNextBlock) {
|
|
248
|
-
const selectionState =
|
|
250
|
+
const selectionState =
|
|
251
|
+
this.state.editorState.getSelection();
|
|
249
252
|
const { editorState } = this.state;
|
|
250
|
-
const currentCursorPosition =
|
|
253
|
+
const currentCursorPosition =
|
|
254
|
+
selectionState.getStartOffset();
|
|
251
255
|
const blockLength = editorState
|
|
252
256
|
.getCurrentContent()
|
|
253
257
|
.getFirstBlock()
|
|
@@ -47,8 +47,7 @@ const messages = defineMessages({
|
|
|
47
47
|
'premi la freccia a sinistra per evidenziare i valori selezionati',
|
|
48
48
|
},
|
|
49
49
|
ay11_toggle_values: {
|
|
50
|
-
id:
|
|
51
|
-
'ay11_select_Use left and right to toggle between focused values, press Backspace to remove the currently focused value',
|
|
50
|
+
id: 'ay11_select_Use left and right to toggle between focused values, press Backspace to remove the currently focused value',
|
|
52
51
|
defaultMessage:
|
|
53
52
|
'Usa le frecce destra e sinistra per attivare o disattivare i valori evidenziati, premi Backspace per rimuovere il valore corrente evidenziato',
|
|
54
53
|
},
|
|
@@ -91,18 +90,19 @@ const messages = defineMessages({
|
|
|
91
90
|
},
|
|
92
91
|
});
|
|
93
92
|
|
|
94
|
-
const SelectContainer = injectLazyLibs('reactSelect')(
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
);
|
|
93
|
+
const SelectContainer = injectLazyLibs('reactSelect')(({
|
|
94
|
+
children,
|
|
95
|
+
...props
|
|
96
|
+
}) => {
|
|
97
|
+
const components = props.reactSelect.components;
|
|
98
|
+
return (
|
|
99
|
+
<div>
|
|
100
|
+
<components.SelectContainer {...props}>
|
|
101
|
+
{children}
|
|
102
|
+
</components.SelectContainer>
|
|
103
|
+
</div>
|
|
104
|
+
);
|
|
105
|
+
});
|
|
106
106
|
|
|
107
107
|
SelectContainer.propTypes = {
|
|
108
108
|
children: PropTypes.node,
|
|
@@ -179,13 +179,8 @@ ClearIndicator.propTypes = {
|
|
|
179
179
|
const getSelectAriaLiveMessages = (intl) => {
|
|
180
180
|
return {
|
|
181
181
|
guidance: (props) => {
|
|
182
|
-
const {
|
|
183
|
-
|
|
184
|
-
isMulti,
|
|
185
|
-
isDisabled,
|
|
186
|
-
tabSelectsValue,
|
|
187
|
-
context,
|
|
188
|
-
} = props;
|
|
182
|
+
const { isSearchable, isMulti, isDisabled, tabSelectsValue, context } =
|
|
183
|
+
props;
|
|
189
184
|
switch (context) {
|
|
190
185
|
case 'menu':
|
|
191
186
|
return `${intl.formatMessage(messages.ay11_up_down)}${
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
.react-select__control {
|
|
2
|
+
border-radius: 0px !important;
|
|
2
3
|
border-top: none !important;
|
|
3
4
|
border-right: none !important;
|
|
4
5
|
border-bottom: solid #435a70 1px !important;
|
|
5
6
|
border-left: none !important;
|
|
6
|
-
border-radius: 0px !important;
|
|
7
7
|
}
|
|
8
8
|
|
|
9
9
|
.react-select__control:focus {
|
|
@@ -364,9 +364,10 @@ const italiaBlocks = {
|
|
|
364
364
|
|
|
365
365
|
const getItaliaBlocks = (config) => {
|
|
366
366
|
delete config.blocks.blocksConfig.teaser;
|
|
367
|
-
config.blocks.blocksConfig.gridBlock.allowedBlocks =
|
|
368
|
-
.
|
|
369
|
-
|
|
367
|
+
config.blocks.blocksConfig.gridBlock.allowedBlocks =
|
|
368
|
+
config.blocks.blocksConfig.gridBlock.allowedBlocks
|
|
369
|
+
.filter((item) => !['slate', 'teaser'].includes(item))
|
|
370
|
+
.concat(['text']);
|
|
370
371
|
return italiaBlocks;
|
|
371
372
|
};
|
|
372
373
|
export default getItaliaBlocks;
|
|
@@ -300,9 +300,10 @@ export const getItaliaListingVariations = (config) => {
|
|
|
300
300
|
};
|
|
301
301
|
export const removeListingVariation = (config, id) => {
|
|
302
302
|
let indexOfVariation = -1;
|
|
303
|
-
indexOfVariation =
|
|
304
|
-
(
|
|
305
|
-
|
|
303
|
+
indexOfVariation =
|
|
304
|
+
config.blocks?.blocksConfig?.listing?.variations?.findIndex(
|
|
305
|
+
(x) => x.id === id,
|
|
306
|
+
);
|
|
306
307
|
if (indexOfVariation >= 0) {
|
|
307
308
|
config.blocks.blocksConfig.listing.variations.splice(indexOfVariation, 1);
|
|
308
309
|
}
|
|
@@ -1,28 +1,28 @@
|
|
|
1
1
|
import loadable from '@loadable/component';
|
|
2
2
|
|
|
3
3
|
export const loadables = {
|
|
4
|
-
'subsite-light-blue': loadable.lib(
|
|
5
|
-
import('design-comuni-plone-theme/config/Subsites/light-blue'),
|
|
4
|
+
'subsite-light-blue': loadable.lib(
|
|
5
|
+
() => import('design-comuni-plone-theme/config/Subsites/light-blue'),
|
|
6
6
|
),
|
|
7
|
-
'subsite-light-pink': loadable.lib(
|
|
8
|
-
import('design-comuni-plone-theme/config/Subsites/light-pink'),
|
|
7
|
+
'subsite-light-pink': loadable.lib(
|
|
8
|
+
() => import('design-comuni-plone-theme/config/Subsites/light-pink'),
|
|
9
9
|
),
|
|
10
|
-
'subsite-light-teal': loadable.lib(
|
|
11
|
-
import('design-comuni-plone-theme/config/Subsites/light-teal'),
|
|
10
|
+
'subsite-light-teal': loadable.lib(
|
|
11
|
+
() => import('design-comuni-plone-theme/config/Subsites/light-teal'),
|
|
12
12
|
),
|
|
13
|
-
'subsite-light-yellow': loadable.lib(
|
|
14
|
-
import('design-comuni-plone-theme/config/Subsites/light-yellow'),
|
|
13
|
+
'subsite-light-yellow': loadable.lib(
|
|
14
|
+
() => import('design-comuni-plone-theme/config/Subsites/light-yellow'),
|
|
15
15
|
),
|
|
16
|
-
'subsite-magenta': loadable.lib(
|
|
17
|
-
import('design-comuni-plone-theme/config/Subsites/magenta'),
|
|
16
|
+
'subsite-magenta': loadable.lib(
|
|
17
|
+
() => import('design-comuni-plone-theme/config/Subsites/magenta'),
|
|
18
18
|
),
|
|
19
|
-
'subsite-teal': loadable.lib(
|
|
20
|
-
import('design-comuni-plone-theme/config/Subsites/teal'),
|
|
19
|
+
'subsite-teal': loadable.lib(
|
|
20
|
+
() => import('design-comuni-plone-theme/config/Subsites/teal'),
|
|
21
21
|
),
|
|
22
|
-
'subsite-white': loadable.lib(
|
|
23
|
-
import('design-comuni-plone-theme/config/Subsites/white'),
|
|
22
|
+
'subsite-white': loadable.lib(
|
|
23
|
+
() => import('design-comuni-plone-theme/config/Subsites/white'),
|
|
24
24
|
),
|
|
25
|
-
'subsite-yellow': loadable.lib(
|
|
26
|
-
import('design-comuni-plone-theme/config/Subsites/yellow'),
|
|
25
|
+
'subsite-yellow': loadable.lib(
|
|
26
|
+
() => import('design-comuni-plone-theme/config/Subsites/yellow'),
|
|
27
27
|
),
|
|
28
28
|
};
|
|
@@ -65,8 +65,8 @@ import { schemaListing } from 'design-comuni-plone-theme/components/ItaliaTheme/
|
|
|
65
65
|
|
|
66
66
|
import reducers from 'design-comuni-plone-theme/reducers';
|
|
67
67
|
|
|
68
|
-
const ReleaseLog = loadable(
|
|
69
|
-
import('design-comuni-plone-theme/components/ReleaseLog/ReleaseLog'),
|
|
68
|
+
const ReleaseLog = loadable(
|
|
69
|
+
() => import('design-comuni-plone-theme/components/ReleaseLog/ReleaseLog'),
|
|
70
70
|
);
|
|
71
71
|
|
|
72
72
|
export default function applyConfig(voltoConfig) {
|
|
@@ -479,9 +479,10 @@ export default function applyConfig(voltoConfig) {
|
|
|
479
479
|
},
|
|
480
480
|
};
|
|
481
481
|
// Remove Horizontal Menu variation of TOC Block
|
|
482
|
-
config.blocks.blocksConfig.toc.variations =
|
|
483
|
-
(
|
|
484
|
-
|
|
482
|
+
config.blocks.blocksConfig.toc.variations =
|
|
483
|
+
config.blocks.blocksConfig.toc.variations.filter(
|
|
484
|
+
(v) => v.id !== 'horizontalMenu',
|
|
485
|
+
);
|
|
485
486
|
|
|
486
487
|
// REDUCERS
|
|
487
488
|
config.addonReducers = {
|
|
@@ -25,7 +25,7 @@ import {
|
|
|
25
25
|
validateFileUploadSize,
|
|
26
26
|
} from '@plone/volto/helpers';
|
|
27
27
|
import { createContent } from '@plone/volto/actions';
|
|
28
|
-
import { Icon, SidebarPortal
|
|
28
|
+
import { Icon, SidebarPortal } from '@plone/volto/components';
|
|
29
29
|
|
|
30
30
|
import clearSVG from '@plone/volto/icons/clear.svg';
|
|
31
31
|
|
|
@@ -132,9 +132,8 @@ class EditComponent extends Component {
|
|
|
132
132
|
},
|
|
133
133
|
});
|
|
134
134
|
|
|
135
|
-
this.extendedBlockRenderMap =
|
|
136
|
-
blockTitleRenderMap
|
|
137
|
-
);
|
|
135
|
+
this.extendedBlockRenderMap =
|
|
136
|
+
DefaultDraftBlockRenderMap.merge(blockTitleRenderMap);
|
|
138
137
|
|
|
139
138
|
this.extendedDescripBlockRenderMap = DefaultDraftBlockRenderMap.merge(
|
|
140
139
|
blockDescriptionRenderMap,
|
|
@@ -328,24 +327,26 @@ class EditComponent extends Component {
|
|
|
328
327
|
selected: this.props.selected,
|
|
329
328
|
})}
|
|
330
329
|
>
|
|
331
|
-
{this.props.selected &&
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
330
|
+
{this.props.selected &&
|
|
331
|
+
this.props.editable &&
|
|
332
|
+
!!this.props.data.url && (
|
|
333
|
+
<div className="toolbar">
|
|
334
|
+
<Button.Group>
|
|
335
|
+
<Button
|
|
336
|
+
icon
|
|
337
|
+
basic
|
|
338
|
+
onClick={() =>
|
|
339
|
+
this.props.onChangeBlock(this.props.block, {
|
|
340
|
+
...this.props.data,
|
|
341
|
+
url: '',
|
|
342
|
+
})
|
|
343
|
+
}
|
|
344
|
+
>
|
|
345
|
+
<Icon name={clearSVG} size="24px" color="#e40166" />
|
|
346
|
+
</Button>
|
|
347
|
+
</Button.Group>
|
|
348
|
+
</div>
|
|
349
|
+
)}
|
|
349
350
|
<div className="block-inner-wrapper">
|
|
350
351
|
{this.props.data.url ? (
|
|
351
352
|
<div className="hero-image">
|
|
@@ -403,7 +404,8 @@ class EditComponent extends Component {
|
|
|
403
404
|
placeholder={this.props.intl.formatMessage(messages.title)}
|
|
404
405
|
blockStyleFn={() => 'title-editor'}
|
|
405
406
|
onUpArrow={() => {
|
|
406
|
-
const selectionState =
|
|
407
|
+
const selectionState =
|
|
408
|
+
this.state.titleEditorState.getSelection();
|
|
407
409
|
const { titleEditorState } = this.state;
|
|
408
410
|
if (
|
|
409
411
|
titleEditorState
|
|
@@ -419,7 +421,8 @@ class EditComponent extends Component {
|
|
|
419
421
|
}
|
|
420
422
|
}}
|
|
421
423
|
onDownArrow={() => {
|
|
422
|
-
const selectionState =
|
|
424
|
+
const selectionState =
|
|
425
|
+
this.state.titleEditorState.getSelection();
|
|
423
426
|
const { titleEditorState } = this.state;
|
|
424
427
|
if (
|
|
425
428
|
titleEditorState
|
|
@@ -448,7 +451,8 @@ class EditComponent extends Component {
|
|
|
448
451
|
)}
|
|
449
452
|
blockStyleFn={() => 'description-editor'}
|
|
450
453
|
onUpArrow={() => {
|
|
451
|
-
const selectionState =
|
|
454
|
+
const selectionState =
|
|
455
|
+
this.state.descriptionEditorState.getSelection();
|
|
452
456
|
const currentCursorPosition = selectionState.getStartOffset();
|
|
453
457
|
|
|
454
458
|
if (currentCursorPosition === 0) {
|
|
@@ -457,7 +461,8 @@ class EditComponent extends Component {
|
|
|
457
461
|
}
|
|
458
462
|
}}
|
|
459
463
|
onDownArrow={() => {
|
|
460
|
-
const selectionState =
|
|
464
|
+
const selectionState =
|
|
465
|
+
this.state.descriptionEditorState.getSelection();
|
|
461
466
|
const { descriptionEditorState } = this.state;
|
|
462
467
|
const currentCursorPosition = selectionState.getStartOffset();
|
|
463
468
|
const blockLength = descriptionEditorState
|
|
@@ -97,8 +97,8 @@ const ListingBody = React.memo(
|
|
|
97
97
|
// Need to know if data-element is "service-link"
|
|
98
98
|
// to add data-element="pager-link" to pagination links
|
|
99
99
|
const isServiceLink =
|
|
100
|
-
data
|
|
101
|
-
variation
|
|
100
|
+
data?.id_lighthouse === 'service-link' ||
|
|
101
|
+
variation?.id_lighthouse === 'service-link';
|
|
102
102
|
|
|
103
103
|
return (
|
|
104
104
|
<div className="public-ui">
|
package/src/customizations/volto/components/manage/Blocks/Listing/withQuerystringResults.jsx
CHANGED
|
@@ -117,19 +117,19 @@ export default function withQuerystringResults(WrappedComponent) {
|
|
|
117
117
|
const totalPages = showAsFolderListing
|
|
118
118
|
? Math.ceil(content.items_total / b_size)
|
|
119
119
|
: showAsQueryListing
|
|
120
|
-
|
|
121
|
-
|
|
120
|
+
? Math.ceil(querystringResults[subrequestID].total / b_size)
|
|
121
|
+
: 0;
|
|
122
122
|
|
|
123
123
|
const prevBatch = showAsFolderListing
|
|
124
124
|
? content.batching?.prev
|
|
125
125
|
: showAsQueryListing
|
|
126
|
-
|
|
127
|
-
|
|
126
|
+
? querystringResults[subrequestID].batching?.prev
|
|
127
|
+
: null;
|
|
128
128
|
const nextBatch = showAsFolderListing
|
|
129
129
|
? content.batching?.next
|
|
130
130
|
: showAsQueryListing
|
|
131
|
-
|
|
132
|
-
|
|
131
|
+
? querystringResults[subrequestID].batching?.next
|
|
132
|
+
: null;
|
|
133
133
|
|
|
134
134
|
function handleContentPaginationChange(e, { activePage }) {
|
|
135
135
|
!isEditMode && listingRef.current.scrollIntoView({ behavior: 'smooth' });
|
|
@@ -30,23 +30,20 @@ const messages = defineMessages({
|
|
|
30
30
|
*/
|
|
31
31
|
const FilterList = (props) => {
|
|
32
32
|
const { data = {}, facets = {}, setFacets, isEditMode, intl } = props;
|
|
33
|
-
const definedFacets = data.facets || [];
|
|
34
33
|
const [isOpened, setIsOpened] = React.useState(false);
|
|
35
|
-
const totalFilters = useMemo(
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
types: facetWidgetTypes,
|
|
49
|
-
} = config.blocks.blocksConfig.search.extensions.facetWidgets;
|
|
34
|
+
const totalFilters = useMemo(() => {
|
|
35
|
+
const definedFacets = data.facets || [];
|
|
36
|
+
return definedFacets.filter(
|
|
37
|
+
({ field, type }) =>
|
|
38
|
+
field &&
|
|
39
|
+
Object.keys(facets).includes(field.value) &&
|
|
40
|
+
(type !== 'toggleFacet'
|
|
41
|
+
? !isEmpty(facets[field.value])
|
|
42
|
+
: facets[field.value]),
|
|
43
|
+
).length;
|
|
44
|
+
}, [data.facets, facets]);
|
|
45
|
+
const { types: facetWidgetTypes } =
|
|
46
|
+
config.blocks.blocksConfig.search.extensions.facetWidgets;
|
|
50
47
|
const closeFilters = () => setIsOpened(false);
|
|
51
48
|
const ref = useRef();
|
|
52
49
|
useClickOutside(ref, closeFilters);
|
|
@@ -85,16 +82,14 @@ const FilterList = (props) => {
|
|
|
85
82
|
'bg-white': isOpened,
|
|
86
83
|
'bg-transparent': !isOpened,
|
|
87
84
|
})}
|
|
88
|
-
role="region"
|
|
89
85
|
aria-labelledby="headingAccordion"
|
|
90
86
|
aria-expanded={isOpened}
|
|
91
87
|
aria-hidden={!isOpened}
|
|
92
88
|
>
|
|
93
89
|
<div className="filter-list accordion-inner bg-white py-4">
|
|
94
90
|
{data.facets?.map((facetSettings, i) => {
|
|
95
|
-
const {
|
|
96
|
-
|
|
97
|
-
} = resolveExtension('type', facetWidgetTypes, facetSettings);
|
|
91
|
+
const { filterListComponent: FilterListComponent } =
|
|
92
|
+
resolveExtension('type', facetWidgetTypes, facetSettings);
|
|
98
93
|
const facet = facetSettings?.field?.value;
|
|
99
94
|
|
|
100
95
|
if (!facet) return null;
|
|
@@ -18,15 +18,8 @@ const messages = defineMessages({
|
|
|
18
18
|
});
|
|
19
19
|
|
|
20
20
|
function ToggleFacetFilterListEntry(props) {
|
|
21
|
-
const {
|
|
22
|
-
|
|
23
|
-
isEditMode,
|
|
24
|
-
setFacets,
|
|
25
|
-
facets,
|
|
26
|
-
intl,
|
|
27
|
-
data,
|
|
28
|
-
facetSettings,
|
|
29
|
-
} = props;
|
|
21
|
+
const { facet, isEditMode, setFacets, facets, intl, data, facetSettings } =
|
|
22
|
+
props;
|
|
30
23
|
const entrySettings = useMemo(() => {
|
|
31
24
|
return data.facets?.find((f) => f?.field?.value === facet)?.field;
|
|
32
25
|
}, [data, facet]);
|
|
@@ -19,13 +19,6 @@ import {
|
|
|
19
19
|
blockIsNotEmptyPlaceholder,
|
|
20
20
|
SSRRenderHtml,
|
|
21
21
|
} from 'design-comuni-plone-theme/helpers';
|
|
22
|
-
import {
|
|
23
|
-
getBaseUrl,
|
|
24
|
-
getBlocksFieldname,
|
|
25
|
-
getBlocksLayoutFieldname,
|
|
26
|
-
hasBlocksData,
|
|
27
|
-
} from '@plone/volto/helpers';
|
|
28
|
-
import content from '../../../../../../omelette/src/reducers/content/content';
|
|
29
22
|
|
|
30
23
|
/**
|
|
31
24
|
* Enhanced diff words utility
|
|
@@ -157,8 +150,8 @@ const DiffField = ({
|
|
|
157
150
|
schema?.type === 'boolean'
|
|
158
151
|
? booleanMapping[!!one]
|
|
159
152
|
: schema?.widget === 'json'
|
|
160
|
-
|
|
161
|
-
|
|
153
|
+
? contentOne
|
|
154
|
+
: one,
|
|
162
155
|
schema?.widget ??
|
|
163
156
|
(schema?.type === 'object' && field.includes('image')
|
|
164
157
|
? field
|
|
@@ -114,27 +114,27 @@ class ObjectBrowserBody extends Component {
|
|
|
114
114
|
this.props.mode === 'multiple'
|
|
115
115
|
? '/'
|
|
116
116
|
: this.props.mode === 'image' && this.props.data?.url
|
|
117
|
-
|
|
118
|
-
|
|
117
|
+
? getParentURL(this.props.data.url)
|
|
118
|
+
: '/',
|
|
119
119
|
currentLinkFolder:
|
|
120
120
|
this.props.mode === 'multiple'
|
|
121
121
|
? '/'
|
|
122
122
|
: this.props.mode === 'link' && this.props.data?.href
|
|
123
|
-
|
|
124
|
-
|
|
123
|
+
? getParentURL(this.props.data.href)
|
|
124
|
+
: '/',
|
|
125
125
|
parentFolder: '',
|
|
126
126
|
selectedImage:
|
|
127
127
|
this.props.mode === 'multiple'
|
|
128
128
|
? ''
|
|
129
129
|
: this.props.mode === 'image' && this.props.data?.url
|
|
130
|
-
|
|
131
|
-
|
|
130
|
+
? flattenToAppURL(this.props.data.url)
|
|
131
|
+
: '',
|
|
132
132
|
selectedHref:
|
|
133
133
|
this.props.mode === 'multiple'
|
|
134
134
|
? ''
|
|
135
135
|
: this.props.mode === 'link' && this.props.data?.href
|
|
136
|
-
|
|
137
|
-
|
|
136
|
+
? flattenToAppURL(this.props.data.href)
|
|
137
|
+
: '',
|
|
138
138
|
showSearchInput: false,
|
|
139
139
|
// In image mode, the searchable types default to the image types which
|
|
140
140
|
// can be overridden with the property if specified.
|
|
@@ -161,8 +161,8 @@ class ObjectBrowserBody extends Component {
|
|
|
161
161
|
mode === 'multiple'
|
|
162
162
|
? ''
|
|
163
163
|
: mode === 'image'
|
|
164
|
-
|
|
165
|
-
|
|
164
|
+
? this.state.selectedImage
|
|
165
|
+
: this.state.selectedHref;
|
|
166
166
|
if (currentSelected && isInternalURL(currentSelected)) {
|
|
167
167
|
this.props.searchContent(
|
|
168
168
|
getParentURL(currentSelected),
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
*
|
|
5
5
|
* https://github.com/plone/volto/blob/16.x.x/src/components/manage/Widgets/DatetimeWidget.jsx
|
|
6
6
|
* https://github.com/plone/volto/blob/7ec45f7b4d46233236c651f39a951bad8e389184/src/components/manage/Widgets/DatetimeWidget.jsx
|
|
7
|
-
*
|
|
7
|
+
*
|
|
8
8
|
* CUSTOMIZATIONS:
|
|
9
9
|
* - accept calendar `openDirection` prop and use it in SingleDatePicker,
|
|
10
10
|
* default to down if no openDirection is given
|
|
@@ -190,14 +190,8 @@ export class DatetimeWidgetComponent extends Component {
|
|
|
190
190
|
onFocusChange = ({ focused }) => this.setState({ focused });
|
|
191
191
|
|
|
192
192
|
render() {
|
|
193
|
-
const {
|
|
194
|
-
|
|
195
|
-
resettable,
|
|
196
|
-
intl,
|
|
197
|
-
reactDates,
|
|
198
|
-
widgetOptions,
|
|
199
|
-
lang,
|
|
200
|
-
} = this.props;
|
|
193
|
+
const { id, resettable, intl, reactDates, widgetOptions, lang } =
|
|
194
|
+
this.props;
|
|
201
195
|
const noPastDates =
|
|
202
196
|
this.props.noPastDates || widgetOptions?.pattern_options?.noPastDates;
|
|
203
197
|
const moment = this.props.moment.default;
|
|
@@ -313,4 +307,4 @@ export default compose(
|
|
|
313
307
|
lang: state.intl.locale,
|
|
314
308
|
})),
|
|
315
309
|
injectIntl,
|
|
316
|
-
)(DatetimeWidgetComponent);
|
|
310
|
+
)(DatetimeWidgetComponent);
|
|
@@ -321,15 +321,8 @@ export class ObjectBrowserWidgetComponent extends Component {
|
|
|
321
321
|
* @returns {string} Markup for the component.
|
|
322
322
|
*/
|
|
323
323
|
render() {
|
|
324
|
-
const {
|
|
325
|
-
|
|
326
|
-
description,
|
|
327
|
-
fieldSet,
|
|
328
|
-
value,
|
|
329
|
-
mode,
|
|
330
|
-
onChange,
|
|
331
|
-
isDisabled,
|
|
332
|
-
} = this.props;
|
|
324
|
+
const { id, description, fieldSet, value, mode, onChange, isDisabled } =
|
|
325
|
+
this.props;
|
|
333
326
|
|
|
334
327
|
let items = compact(!isArray(value) && value ? [value] : value || []);
|
|
335
328
|
|
package/src/customizations/volto/components/manage/Widgets/RecurrenceWidget/RecurrenceWidget.jsx
CHANGED
|
@@ -443,8 +443,8 @@ class RecurrenceWidget extends Component {
|
|
|
443
443
|
field === 'dtstart'
|
|
444
444
|
? value
|
|
445
445
|
: rruleSet.dtstart()
|
|
446
|
-
|
|
447
|
-
|
|
446
|
+
? rruleSet.dtstart()
|
|
447
|
+
: moment().utc().toDate();
|
|
448
448
|
var exdates =
|
|
449
449
|
field === 'exdates' ? value : Object.assign([], rruleSet.exdates());
|
|
450
450
|
|
|
@@ -77,7 +77,8 @@ const widgetValidation = {
|
|
|
77
77
|
isValidEmail: (emailValue, emailObj, intlFunc) => {
|
|
78
78
|
// Email Regex taken from from WHATWG living standard:
|
|
79
79
|
// https://html.spec.whatwg.org/multipage/input.html#e-mail-state-(type=email)
|
|
80
|
-
const emailRegex =
|
|
80
|
+
const emailRegex =
|
|
81
|
+
/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/;
|
|
81
82
|
const isValid = emailRegex.test(emailValue);
|
|
82
83
|
return !isValid ? intlFunc(messages.isValidEmail) : null;
|
|
83
84
|
},
|
|
@@ -100,11 +101,11 @@ const widgetValidation = {
|
|
|
100
101
|
isValidURL: (urlValue, urlObj, intlFunc) => {
|
|
101
102
|
var urlRegex = new RegExp(
|
|
102
103
|
'^(https?:\\/\\/)?' + // validate protocol
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
104
|
+
'((([a-z\\d]([a-z\\d-]*[a-z\\d])*)\\.)+[a-z]{2,}|' + // validate domain name
|
|
105
|
+
'((\\d{1,3}\\.){3}\\d{1,3}))|' + // validate OR ip (v4) address
|
|
106
|
+
'(localhost)' + // validate OR localhost address
|
|
107
|
+
'(\\:\\d+)?(\\/[-a-z\\d%_.~+]*)*' + // validate port and path
|
|
108
|
+
'(\\?[;&a-z\\d%_.~+=-]*)?' + // validate query string
|
|
108
109
|
'(\\#[-a-z\\d_]*)?$', // validate fragment locator
|
|
109
110
|
'i',
|
|
110
111
|
);
|
|
@@ -143,8 +143,8 @@ class Html extends Component {
|
|
|
143
143
|
rel: !criticalCss
|
|
144
144
|
? elem.props.rel
|
|
145
145
|
: elem.props.as === 'style'
|
|
146
|
-
|
|
147
|
-
|
|
146
|
+
? 'prefetch'
|
|
147
|
+
: elem.props.rel,
|
|
148
148
|
}),
|
|
149
149
|
)}
|
|
150
150
|
{/* Styles in development are loaded with Webpack's style-loader, in production,
|