design-comuni-plone-theme 12.0.0 → 12.1.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.
@@ -0,0 +1,30 @@
1
+ /*
2
+ Customizations:
3
+ - remove unnecessary hasType check and hasType value in dependencies, supported content type is ALL for our use case
4
+ - fix relative import
5
+ */
6
+
7
+ import React from 'react';
8
+ import PropTypes from 'prop-types';
9
+ import DefaultBody from '@plone/volto/components/manage/Blocks/Teaser/DefaultBody';
10
+ import config from '@plone/volto/registry';
11
+
12
+ const TeaserBody = (props) => {
13
+ const { variation } = props;
14
+
15
+ // Compatible with the previous version of the component registry
16
+ // and the Volto 16 one.
17
+ const BodyComponent =
18
+ config.getComponent({ name: 'Teaser' }).component ||
19
+ variation?.template ||
20
+ DefaultBody;
21
+
22
+ return <BodyComponent {...props} />;
23
+ };
24
+
25
+ TeaserBody.propTypes = {
26
+ data: PropTypes.objectOf(PropTypes.any).isRequired,
27
+ isEditMode: PropTypes.bool,
28
+ };
29
+
30
+ export default TeaserBody;
@@ -184,7 +184,7 @@ export class ObjectBrowserWidgetComponent extends Component {
184
184
  // add item
185
185
  // Check if we want to filter the attributes of the selected item
186
186
  let resultantItem = item;
187
- if (this.props.selectedItemAttrs) {
187
+ if (this.props.selectedItemAttrs?.length > 0) {
188
188
  const allowedItemKeys = [
189
189
  ...this.props.selectedItemAttrs,
190
190
  // Add the required attributes for the widget to work
@@ -628,7 +628,9 @@ class RecurrenceWidget extends Component {
628
628
  const byweekday =
629
629
  this.state?.rruleSet?.rrules().length > 0
630
630
  ? this.state.rruleSet.rrules()[0].origOptions.byweekday
631
- : null;
631
+ : formValues.byweekday
632
+ ? formValues.byweekday
633
+ : null;
632
634
  const currWeekday = this.getWeekday(moment().day() - 1);
633
635
  const currMonth = moment().month() + 1;
634
636
 
@@ -109,7 +109,7 @@ const widgetValidation = {
109
109
  '(\\:\\d+)?' + // optional port
110
110
  '(\\/[-a-z\\d%_.~+]*)*' + // path
111
111
  '(\\?[;&a-z\\d%_.~+\\/=-]*)?' + // validate query string
112
- '(\\#[-a-z\\d_]*)?$', // validate fragment locator
112
+ '(\\#[-a-z\\d\\/_]*)?$', // validate fragment locator
113
113
  'i',
114
114
  );
115
115
  const isValid = urlRegex.test(urlValue);
@@ -2,6 +2,7 @@ import React from 'react';
2
2
  import prettybytes from 'pretty-bytes';
3
3
  import cx from 'classnames';
4
4
  import { getFileViewFormat } from 'design-comuni-plone-theme/helpers';
5
+ import { useIntl } from 'react-intl';
5
6
 
6
7
  const EnhanceLink = ({
7
8
  enhanced_link_infos,
@@ -9,11 +10,15 @@ const EnhanceLink = ({
9
10
  className,
10
11
  aria_label,
11
12
  }) => {
13
+ const intl = useIntl();
12
14
  let children = <></>;
13
15
  let aria_label_extended = null;
16
+
14
17
  let size =
15
- enhanced_link_infos.getObjSize ??
16
- prettybytes(enhanced_link_infos.size)?.toUpperCase();
18
+ enhanced_link_infos.getObjSize?.replaceAll('.', ',') ??
19
+ prettybytes(enhanced_link_infos.size, {
20
+ locale: intl.locale,
21
+ })?.toUpperCase();
17
22
 
18
23
  if (enhanced_link_infos) {
19
24
  const viewFormat = getFileViewFormat(enhanced_link_infos);
@@ -77,11 +77,11 @@ export const FILE_FORMATS = {
77
77
  format_name: 'Excel',
78
78
  },
79
79
  'application/vnd.ms-powerpoint': {
80
- icon: { lib: 'far', name: 'file-ppt' },
80
+ icon: { lib: 'far', name: 'file-powerpoint' },
81
81
  format_name: 'PowerPoint',
82
82
  },
83
83
  'application/vnd.openxmlformats-officedocument.presentationml.presentation': {
84
- icon: { lib: 'far', name: 'file-ppt' },
84
+ icon: { lib: 'far', name: 'file-powerpoint' },
85
85
  format_name: 'PowerPoint',
86
86
  },
87
87
  'text/xml': {
@@ -128,4 +128,9 @@ defineMessages({
128
128
  id: 'Divide each row into separate cells',
129
129
  defaultMessage: 'Add border to inner columns',
130
130
  },
131
+ // teaser block
132
+ teaser: {
133
+ id: 'Teaser',
134
+ defaultMessage: 'Teaser',
135
+ },
131
136
  });