@plone/volto 16.21.1 → 16.21.3

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 (42) hide show
  1. package/.changelog.draft +4 -2
  2. package/.yarn/install-state.gz +0 -0
  3. package/CHANGELOG.md +17 -0
  4. package/README.md +8 -11
  5. package/docker-compose.yml +1 -1
  6. package/package.json +1 -1
  7. package/packages/volto-slate/package.json +1 -1
  8. package/packages/volto-slate/src/actions/index.js +1 -1
  9. package/packages/volto-slate/src/blocks/Text/index.js +2 -2
  10. package/packages/volto-slate/src/editor/index.js +4 -4
  11. package/packages/volto-slate/src/editor/ui/SlateContextToolbar.jsx +2 -2
  12. package/packages/volto-slate/src/editor/ui/index.js +15 -15
  13. package/packages/volto-slate/src/index.js +2 -2
  14. package/razzle.config.js +7 -0
  15. package/src/components/manage/AnchorPlugin/index.jsx +2 -2
  16. package/src/components/manage/AnchorPlugin/utils/EditorUtils.js +3 -1
  17. package/src/components/manage/Blocks/Block/Style.jsx +2 -2
  18. package/src/components/manage/Blocks/Listing/getAsyncData.js +7 -2
  19. package/src/components/manage/Blocks/Listing/withQuerystringResults.jsx +3 -4
  20. package/src/components/manage/Blocks/Search/components/index.js +13 -13
  21. package/src/components/manage/Blocks/Search/hocs/index.js +2 -2
  22. package/src/components/manage/Blocks/Search/hocs/withQueryString.jsx +2 -2
  23. package/src/components/manage/Blocks/ToC/variations/index.js +3 -1
  24. package/src/components/manage/Diff/DiffField.jsx +6 -6
  25. package/src/components/theme/FormattedDate/FormattedDate.jsx +3 -3
  26. package/src/config/RichTextEditor/Blocks.jsx +2 -2
  27. package/src/config/RichTextEditor/FromHTML.jsx +2 -2
  28. package/src/config/RichTextEditor/Styles.jsx +1 -1
  29. package/src/constants/Indexes.js +3 -1
  30. package/src/express-middleware/devproxy.js +1 -1
  31. package/src/express-middleware/files.js +3 -3
  32. package/src/express-middleware/images.js +4 -4
  33. package/src/express-middleware/robotstxt.js +1 -1
  34. package/src/express-middleware/sitemap.js +1 -1
  35. package/src/express-middleware/static.js +3 -3
  36. package/src/helpers/Extensions/index.js +2 -1
  37. package/src/helpers/Utils/Date.js +4 -2
  38. package/src/helpers/Utils/Date.test.js +3 -1
  39. package/src/helpers/index.js +9 -10
  40. package/src/middleware/index.js +2 -2
  41. package/src/start-server.js +2 -2
  42. package/theme/themes/pastanaga/extras/blocks.less +3 -1
package/.changelog.draft CHANGED
@@ -1,6 +1,8 @@
1
- ## 16.21.1 (2023-06-23)
1
+ ## 16.21.3 (2023-07-06)
2
2
 
3
3
  ### Bugfix
4
4
 
5
- - Added current page parameter to route in listing and search block pagination - Fix: #3868 @bipoza [#4159](https://github.com/plone/volto/issues/4159)
5
+ - Fix temporary rendering of folder contents while query results are loading. @davisagli [#4351](https://github.com/plone/volto/issues/4351)
6
+ - Remove anonymous function calls. Remove default exports from. @sneridagh [#4917](https://github.com/plone/volto/issues/4917)
7
+ - Fix the experimental add new block button position, compensate the icon width to center it correctly @sneridagh [#4924](https://github.com/plone/volto/issues/4924)
6
8
 
Binary file
package/CHANGELOG.md CHANGED
@@ -8,6 +8,23 @@
8
8
 
9
9
  <!-- towncrier release notes start -->
10
10
 
11
+ ## 16.21.3 (2023-07-06)
12
+
13
+ ### Bugfix
14
+
15
+ - Fix temporary rendering of folder contents while query results are loading. @davisagli [#4351](https://github.com/plone/volto/issues/4351)
16
+ - Remove anonymous function calls. Remove default exports from. @sneridagh [#4917](https://github.com/plone/volto/issues/4917)
17
+ - Fix the experimental add new block button position, compensate the icon width to center it correctly @sneridagh [#4924](https://github.com/plone/volto/issues/4924)
18
+
19
+
20
+ ## 16.21.2 (2023-06-24)
21
+
22
+ ### Bugfix
23
+
24
+ - Update to version 6.0.5 of Plone backend. @davisagli [#4897](https://github.com/plone/volto/issues/4897)
25
+ - Fix "digital envelope routines::unsupported" error when running Volto 16 in Node 17+. @davisagli [#4901](https://github.com/plone/volto/issues/4901)
26
+
27
+
11
28
  ## 16.21.1 (2023-06-23)
12
29
 
13
30
  ### Bugfix
package/README.md CHANGED
@@ -53,20 +53,16 @@ First get all the requirements installed on your system.
53
53
 
54
54
  ### Prerequisites
55
55
 
56
- - [Node.js LTS (16.x)](https://nodejs.org/)
56
+ - [Node.js LTS (16.x or 18.x)](https://nodejs.org/)
57
57
  - [Python](https://python.org/) - See below for specific versions.
58
58
  - [Docker](https://www.docker.com/get-started) (if using the Plone docker images)
59
59
 
60
- *UPDATE 2022-10-25*: Since 2022-10-25, NodeJS 18 is in LTS state (https://github.com/nodejs/release#release-schedule). However, due to changes in internal SSL libraries, some Volto dependencies have been deprecated and need to be updated in order to continue working in NodeJS 18, mainly Webpack 4 (see: https://github.com/webpack/webpack/issues/14532#issuecomment-947525539 for further information). You can still use it, but NodeJS should be run under a special flag: `NODE_OPTIONS=--openssl-legacy-provider`. See also Volto's PR: https://github.com/plone/volto/pull/3699 for more information.
61
-
62
60
  The versions of Python that are supported in Volto depend on the version of Plone that you use.
63
61
 
64
62
  | Plone | Python | Volto |
65
63
  |---|---|---|
66
64
  | 5.2 | 2.7, 3.6-3.8 | 15.0 |
67
- | 6.0 (beta) | 3.8-3.10 | 16.0 (alpha) |
68
-
69
- At the time of this writing, Volto 16 is still in alpha status, and Plone 6 is in beta status.
65
+ | 6.0 | 3.8-3.11 | 16.0 |
70
66
 
71
67
  ### Create a Volto project using the generator
72
68
 
@@ -90,7 +86,7 @@ cd myvoltoproject
90
86
  You can bootstrap a ready Docker Plone container with all the dependencies and ready for Volto use. We recommend to use the Plone docker builds based in `pip` [plone/plone-backend](https://github.com/plone/plone-backend) image:
91
87
 
92
88
  ```shell
93
- docker run -it --rm --name=plone -p 8080:8080 -e SITE=Plone -e PROFILES="plone.volto:default-homepage" plone/plone-backend:6.0.0b3
89
+ docker run -it --rm --name=plone -p 8080:8080 -e SITE=Plone -e PROFILES="plone.volto:default-homepage" plone/plone-backend:6.0.5
94
90
  ```
95
91
 
96
92
  or as an alternative if you have experience with Plone and you have all the
@@ -229,10 +225,11 @@ JavaScript-centered trainings.
229
225
 
230
226
  ## Node Support
231
227
 
228
+ - Node 18: Supported since Volto 16
232
229
  - Node 16: Supported since Volto 14
233
- - Node 14: Supported since Volto 8.8.0
234
- - Node 12: Deprecated from Volto 16 onwards. It was supported since Volto 4
235
- - Node 10: Deprecated from Volto 13 onwards. It was supported since Volto 1 (and its predecessor "plone-react")
230
+ - Node 14: Supported from Volto 8.8.0 - 16
231
+ - Node 12: No longer supported. It was supported from Volto 4 - 15
232
+ - Node 10: No longer supported. It was supported from Volto 1 - 12
236
233
 
237
234
  ## Browser support
238
235
 
@@ -267,7 +264,7 @@ yarn
267
264
  Either using a Docker command:
268
265
 
269
266
  ```shell
270
- docker run -it --rm --name=plone -p 8080:8080 -e SITE=Plone -e PROFILES="plone.volto:default-homepage" plone/plone-backend:6.0.0b3
267
+ docker run -it --rm --name=plone -p 8080:8080 -e SITE=Plone -e PROFILES="plone.volto:default-homepage" plone/plone-backend:6.0.5
271
268
  ```
272
269
 
273
270
  or using the convenience makefile command:
@@ -2,7 +2,7 @@ version: '3.3'
2
2
  services:
3
3
 
4
4
  backend:
5
- image: plone/plone-backend:6.0.0b2
5
+ image: plone/plone-backend:6.0.5
6
6
  # Plone 5.2 series can be used too
7
7
  # image: plone/plone-backend:5.2.9
8
8
  ports:
package/package.json CHANGED
@@ -9,7 +9,7 @@
9
9
  }
10
10
  ],
11
11
  "license": "MIT",
12
- "version": "16.21.1",
12
+ "version": "16.21.3",
13
13
  "repository": {
14
14
  "type": "git",
15
15
  "url": "git@github.com:plone/volto.git"
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@plone/volto-slate",
3
- "version": "16.21.1",
3
+ "version": "16.21.3",
4
4
  "description": "Slate.js integration with Volto",
5
5
  "main": "src/index.js",
6
6
  "author": "European Environment Agency: IDM2 A-Team",
@@ -1,3 +1,3 @@
1
- export saveSlateBlockSelection from './selection';
1
+ export { default as saveSlateBlockSelection } from './selection';
2
2
  export * from './content';
3
3
  export * from './plugins';
@@ -35,7 +35,7 @@ import textSVG from '@plone/volto/icons/subtext.svg';
35
35
 
36
36
  export { TextBlockView, TextBlockEdit, TextBlockSchema };
37
37
 
38
- export default (config) => {
38
+ export default function applyConfig(config) {
39
39
  config.settings.slate = {
40
40
  // TODO: should we inverse order? First here gets executed last
41
41
  textblockExtensions: [
@@ -165,4 +165,4 @@ export default (config) => {
165
165
  restricted: true,
166
166
  };
167
167
  return config;
168
- };
168
+ }
@@ -1,9 +1,9 @@
1
1
  import * as slateConfig from './config';
2
2
  import installDefaultPlugins from './plugins';
3
- export SlateEditor from './SlateEditor';
4
- export EditorReference from './EditorReference';
3
+ export { default as SlateEditor } from './SlateEditor';
4
+ export { default as EditorReference } from './EditorReference';
5
5
 
6
- export default (config) => {
6
+ export default function applyConfig(config) {
7
7
  config.settings.slate = {
8
8
  ...slateConfig,
9
9
  // showExpandedToolbar: false,
@@ -11,4 +11,4 @@ export default (config) => {
11
11
  };
12
12
  config = installDefaultPlugins(config);
13
13
  return config;
14
- };
14
+ }
@@ -3,11 +3,11 @@ import Toolbar from './Toolbar';
3
3
 
4
4
  // A toolbar that conditionally renders itself based on the presense of
5
5
  // children
6
- export default ({ editor, plugins, show }) => {
6
+ export default function SlateContextToolbar({ editor, plugins, show }) {
7
7
  if (!show) {
8
8
  return null;
9
9
  }
10
10
 
11
11
  const components = plugins.map((plug) => plug(editor)).filter((c) => !!c);
12
12
  return components.length ? <Toolbar>{components}</Toolbar> : '';
13
- };
13
+ }
@@ -1,15 +1,15 @@
1
- export BasicToolbar from './BasicToolbar';
2
- export BlockButton from './BlockButton';
3
- export ClearFormattingButton from './ClearFormattingButton';
4
- export ExpandedToolbar from './ExpandedToolbar';
5
- export Expando from './Expando';
6
- export MarkButton from './MarkButton';
7
- export Menu from './Menu';
8
- export Separator from './Separator';
9
- export SlateContextToolbar from './SlateContextToolbar';
10
- export SlateToolbar from './SlateToolbar';
11
- export Toolbar from './Toolbar';
12
- export ToolbarButton from './ToolbarButton';
13
- export MarkElementButton from './MarkElementButton';
14
- export PositionedToolbar from './PositionedToolbar';
15
- export InlineToolbar from './InlineToolbar';
1
+ export { default as BasicToolbar } from './BasicToolbar';
2
+ export { default as BlockButton } from './BlockButton';
3
+ export { default as ClearFormattingButton } from './ClearFormattingButton';
4
+ export { default as ExpandedToolbar } from './ExpandedToolbar';
5
+ export { default as Expando } from './Expando';
6
+ export { default as MarkButton } from './MarkButton';
7
+ export { default as Menu } from './Menu';
8
+ export { default as Separator } from './Separator';
9
+ export { default as SlateContextToolbar } from './SlateContextToolbar';
10
+ export { default as SlateToolbar } from './SlateToolbar';
11
+ export { default as Toolbar } from './Toolbar';
12
+ export { default as ToolbarButton } from './ToolbarButton';
13
+ export { default as MarkElementButton } from './MarkElementButton';
14
+ export { default as PositionedToolbar } from './PositionedToolbar';
15
+ export { default as InlineToolbar } from './InlineToolbar';
@@ -8,7 +8,7 @@ import RichTextWidgetView from './widgets/RichTextWidgetView';
8
8
  import HtmlSlateWidget from './widgets/HtmlSlateWidget';
9
9
  import ObjectByTypeWidget from './widgets/ObjectByTypeWidget';
10
10
 
11
- export default (config) => {
11
+ export default function applyConfig(config) {
12
12
  config = [installSlate, installTextBlock, installTableBlock].reduce(
13
13
  (acc, apply) => apply(acc),
14
14
  config,
@@ -58,4 +58,4 @@ export default (config) => {
58
58
  }
59
59
 
60
60
  return config;
61
- };
61
+ }
package/razzle.config.js CHANGED
@@ -22,6 +22,13 @@ const { poToJson } = require('@plone/scripts/i18n.cjs');
22
22
 
23
23
  const packageJson = require(path.join(projectRootPath, 'package.json'));
24
24
 
25
+ // This is a workaround to support webpack 4 on Node 17+,
26
+ // because the MD4 hash algorithm is no longer supported by Node.
27
+ const crypto = require('crypto');
28
+ const crypto_orig_createHash = crypto.createHash;
29
+ crypto.createHash = (algorithm) =>
30
+ crypto_orig_createHash(algorithm === 'md4' ? 'sha256' : algorithm);
31
+
25
32
  const registry = new AddonConfigurationRegistry(projectRootPath);
26
33
 
27
34
  const defaultModify = ({
@@ -44,7 +44,7 @@ function unboundRemoveEntity(editorState) {
44
44
  return newEditorState;
45
45
  }
46
46
 
47
- export default (config = {}) => {
47
+ export default function AnchorPlugin(config = {}) {
48
48
  // ToDo: Get rif of the remainings of having the original CSS modules
49
49
  const defaultTheme = {};
50
50
 
@@ -79,4 +79,4 @@ export default (config = {}) => {
79
79
  setEditorState(removeEntity(getEditorState())),
80
80
  }),
81
81
  };
82
- };
82
+ }
@@ -1,4 +1,4 @@
1
- export default ({ draftJs }) => ({
1
+ const EditorUtils = ({ draftJs }) => ({
2
2
  createLinkAtSelection(editorState, url) {
3
3
  const contentState = editorState
4
4
  .getCurrentContent()
@@ -43,3 +43,5 @@ export default ({ draftJs }) => ({
43
43
  return entity && entity.getType() === entityType;
44
44
  },
45
45
  });
46
+
47
+ export default EditorUtils;
@@ -1,7 +1,7 @@
1
1
  import React from 'react';
2
2
  import cx from 'classnames';
3
3
 
4
- export default ({ data, detached, children }) => {
4
+ export default function Style({ data, detached, children }) {
5
5
  return (
6
6
  <div
7
7
  className={cx(
@@ -25,4 +25,4 @@ export default ({ data, detached, children }) => {
25
25
  </div>
26
26
  </div>
27
27
  );
28
- };
28
+ }
@@ -1,7 +1,12 @@
1
1
  import { getQueryStringResults } from '@plone/volto/actions';
2
2
  import { resolveBlockExtensions } from '@plone/volto/helpers';
3
3
 
4
- export default ({ dispatch, data, path, blocksConfig }) => {
4
+ export default function getListingBlockAsyncData({
5
+ dispatch,
6
+ data,
7
+ path,
8
+ blocksConfig,
9
+ }) {
5
10
  const { resolvedExtensions } = resolveBlockExtensions(data, blocksConfig);
6
11
 
7
12
  return [
@@ -18,4 +23,4 @@ export default ({ dispatch, data, path, blocksConfig }) => {
18
23
  ),
19
24
  ),
20
25
  ];
21
- };
26
+ }
@@ -54,10 +54,9 @@ export default function withQuerystringResults(WrappedComponent) {
54
54
  const hasQuery = querystring?.query?.length > 0;
55
55
  const hasLoaded = hasQuery ? querystringResults?.[id]?.loaded : true;
56
56
 
57
- const listingItems =
58
- querystring?.query?.length > 0 && querystringResults?.[id]
59
- ? querystringResults?.[id]?.items || []
60
- : folderItems;
57
+ const listingItems = hasQuery
58
+ ? querystringResults?.[id]?.items || []
59
+ : folderItems;
61
60
 
62
61
  const showAsFolderListing = !hasQuery && content?.items_total > b_size;
63
62
  const showAsQueryListing =
@@ -1,13 +1,13 @@
1
- export SearchDetails from './SearchDetails';
2
- export Facets from './Facets';
3
- export SelectFacet from './SelectFacet';
4
- export CheckboxFacet from './CheckboxFacet';
5
- export DateRangeFacet from './DateRangeFacet';
6
- export SearchInput from './SearchInput';
7
- export FilterList from './FilterList';
8
- export SortOn from './SortOn';
9
- export ToggleFacet from './ToggleFacet';
10
- export SelectFacetFilterListEntry from './SelectFacetFilterListEntry';
11
- export ToggleFacetFilterListEntry from './ToggleFacetFilterListEntry';
12
- export DateRangeFacetFilterListEntry from './DateRangeFacetFilterListEntry';
13
- export ViewSwitcher from './ViewSwitcher';
1
+ export { default as SearchDetails } from './SearchDetails';
2
+ export { default as Facets } from './Facets';
3
+ export { default as SelectFacet } from './SelectFacet';
4
+ export { default as CheckboxFacet } from './CheckboxFacet';
5
+ export { default as DateRangeFacet } from './DateRangeFacet';
6
+ export { default as SearchInput } from './SearchInput';
7
+ export { default as FilterList } from './FilterList';
8
+ export { default as SortOn } from './SortOn';
9
+ export { default as ToggleFacet } from './ToggleFacet';
10
+ export { default as SelectFacetFilterListEntry } from './SelectFacetFilterListEntry';
11
+ export { default as ToggleFacetFilterListEntry } from './ToggleFacetFilterListEntry';
12
+ export { default as DateRangeFacetFilterListEntry } from './DateRangeFacetFilterListEntry';
13
+ export { default as ViewSwitcher } from './ViewSwitcher';
@@ -1,2 +1,2 @@
1
- export withQueryString from './withQueryString';
2
- export withSearch from './withSearch';
1
+ export { default as withQueryString } from './withQueryString';
2
+ export { default as withSearch } from './withSearch';
@@ -10,7 +10,7 @@ function getDisplayName(WrappedComponent) {
10
10
  * A HOC that injects querystring metadata information from the backend.
11
11
  *
12
12
  */
13
- export default (WrappedComponent) => {
13
+ export default function withQueryString(WrappedComponent) {
14
14
  function WithQueryString(props) {
15
15
  const dispatch = useDispatch();
16
16
 
@@ -29,4 +29,4 @@ export default (WrappedComponent) => {
29
29
  WrappedComponent,
30
30
  )})`;
31
31
  return WithQueryString;
32
- };
32
+ }
@@ -1,7 +1,7 @@
1
1
  import DefaultTocRenderer from './DefaultTocRenderer';
2
2
  import HorizontalMenu from './HorizontalMenu';
3
3
 
4
- export default [
4
+ const ToCVariations = [
5
5
  {
6
6
  id: 'default',
7
7
  title: 'Listing (default)',
@@ -14,3 +14,5 @@ export default [
14
14
  view: HorizontalMenu,
15
15
  },
16
16
  ];
17
+
18
+ export default ToCVariations;
@@ -61,12 +61,12 @@ const DiffField = ({
61
61
  break;
62
62
  case 'datetime':
63
63
  parts = diffWords(
64
- new Intl.DateTimeFormat(language, readable_date_format).format(
65
- new Date(one),
66
- ),
67
- new Intl.DateTimeFormat(language, readable_date_format).format(
68
- new Date(two),
69
- ),
64
+ new Intl.DateTimeFormat(language, readable_date_format)
65
+ .format(new Date(one))
66
+ .replace('\u202F', ' '),
67
+ new Intl.DateTimeFormat(language, readable_date_format)
68
+ .format(new Date(two))
69
+ .replace('\u202F', ' '),
70
70
  );
71
71
  break;
72
72
  case 'json':
@@ -23,9 +23,9 @@ const FormattedDate = ({
23
23
  <time
24
24
  className={className}
25
25
  dateTime={date}
26
- title={new Intl.DateTimeFormat(language, long_date_format).format(
27
- new Date(toDate(date)),
28
- )}
26
+ title={new Intl.DateTimeFormat(language, long_date_format)
27
+ .format(new Date(toDate(date)))
28
+ .replace('\u202F', ' ')}
29
29
  >
30
30
  {children
31
31
  ? children(
@@ -1,4 +1,4 @@
1
- export default (props) => {
1
+ export default function Blocks(props) {
2
2
  const { draftJs, immutableLib } = props;
3
3
  const { DefaultDraftBlockRenderMap } = draftJs;
4
4
  const { Map } = immutableLib;
@@ -27,4 +27,4 @@ export default (props) => {
27
27
  const listBlockTypes = ['unordered-list-item', 'ordered-list-item'];
28
28
 
29
29
  return { extendedBlockRenderMap, blockStyleFn, listBlockTypes };
30
- };
30
+ }
@@ -1,8 +1,8 @@
1
- export default (element) => {
1
+ export default function FromHTMLCustomBlockFn(element) {
2
2
  if (element.className === 'callout') {
3
3
  return {
4
4
  type: 'callout',
5
5
  };
6
6
  }
7
7
  return null;
8
- };
8
+ }
@@ -13,7 +13,7 @@ import orderedListSVG from '@plone/volto/icons/list-numbered.svg';
13
13
  import blockquoteSVG from '@plone/volto/icons/quote.svg';
14
14
  import calloutSVG from '@plone/volto/icons/megaphone.svg';
15
15
 
16
- export default function (props) {
16
+ export default function Styles(props) {
17
17
  const createInlineStyleButton = props.draftJsCreateInlineStyleButton.default;
18
18
  const createBlockStyleButton = props.draftJsCreateBlockStyleButton.default;
19
19
 
@@ -3,7 +3,7 @@
3
3
  * @module constants/indexes
4
4
  */
5
5
 
6
- export default {
6
+ const Indexes = {
7
7
  sortable_title: { label: 'Title', type: 'string', sort_on: 'sortable_title' },
8
8
  review_state: { label: 'Review state', type: 'string' },
9
9
  ModificationDate: {
@@ -35,6 +35,8 @@ export default {
35
35
  Type: { label: 'Type', type: 'string' },
36
36
  };
37
37
 
38
+ export default Indexes;
39
+
38
40
  export const defaultIndexes = [
39
41
  'review_state',
40
42
  'ModificationDate',
@@ -37,7 +37,7 @@ function getEnv() {
37
37
  return _env;
38
38
  }
39
39
 
40
- export default function () {
40
+ export default function devProxyMiddleware() {
41
41
  const middleware = express.Router();
42
42
  const devProxy = createProxyMiddleware(filter, {
43
43
  selfHandleResponse: true,
@@ -9,7 +9,7 @@ const HEADERS = [
9
9
  'Content-Type',
10
10
  ];
11
11
 
12
- function fileMiddleware(req, res, next) {
12
+ function filesMiddlewareFn(req, res, next) {
13
13
  getAPIResourceWithAuth(req)
14
14
  .then((resource) => {
15
15
  // Just forward the headers that we need
@@ -24,10 +24,10 @@ function fileMiddleware(req, res, next) {
24
24
  .catch(next);
25
25
  }
26
26
 
27
- export default function () {
27
+ export default function filesMiddleware() {
28
28
  const middleware = express.Router();
29
29
 
30
- middleware.all(['**/@@download/*', '**/@@display-file/*'], fileMiddleware);
30
+ middleware.all(['**/@@download/*', '**/@@display-file/*'], filesMiddlewareFn);
31
31
  middleware.id = 'filesResourcesProcessor';
32
32
  return middleware;
33
33
  }
@@ -3,7 +3,7 @@ import { getAPIResourceWithAuth } from '@plone/volto/helpers';
3
3
 
4
4
  const HEADERS = ['content-type', 'content-disposition', 'cache-control'];
5
5
 
6
- function imageMiddleware(req, res, next) {
6
+ function imageMiddlewareFn(req, res, next) {
7
7
  getAPIResourceWithAuth(req)
8
8
  .then((resource) => {
9
9
  // Just forward the headers that we need
@@ -17,11 +17,11 @@ function imageMiddleware(req, res, next) {
17
17
  .catch(next);
18
18
  }
19
19
 
20
- export default function () {
20
+ export default function imagesMiddleware() {
21
21
  const middleware = express.Router();
22
22
 
23
- middleware.all(['**/@@images/*'], imageMiddleware);
24
- middleware.all(['/@portrait/*'], imageMiddleware);
23
+ middleware.all(['**/@@images/*'], imageMiddlewareFn);
24
+ middleware.all(['/@portrait/*'], imageMiddlewareFn);
25
25
  middleware.id = 'imageResourcesProcessor';
26
26
  return middleware;
27
27
  }
@@ -22,7 +22,7 @@ const envRobots = function (req, res, next) {
22
22
  res.send(process.env.VOLTO_ROBOTSTXT);
23
23
  };
24
24
 
25
- export default function () {
25
+ export default function robotstxtMiddleware() {
26
26
  const middleware = express.Router();
27
27
  if (process.env.VOLTO_ROBOTSTXT) {
28
28
  middleware.all('**/robots.txt', envRobots);
@@ -47,7 +47,7 @@ export const sitemapIndex = function (req, res, next) {
47
47
  });
48
48
  };
49
49
 
50
- export default function () {
50
+ export default function sitemapMiddleware() {
51
51
  const middleware = express.Router();
52
52
 
53
53
  middleware.all('**/sitemap.xml.gz', sitemap);
@@ -2,7 +2,7 @@ import express from 'express';
2
2
  import path from 'path';
3
3
  import config from '@plone/volto/registry';
4
4
 
5
- const staticMiddleware = express.static(
5
+ const staticMiddlewareFn = express.static(
6
6
  process.env.BUILD_DIR
7
7
  ? path.join(process.env.BUILD_DIR, 'public')
8
8
  : process.env.RAZZLE_PUBLIC_DIR,
@@ -24,9 +24,9 @@ const staticMiddleware = express.static(
24
24
  },
25
25
  );
26
26
 
27
- export default function () {
27
+ export default function staticsMiddleware() {
28
28
  const middleware = express.Router();
29
- middleware.all('*', staticMiddleware);
29
+ middleware.all('*', staticMiddlewareFn);
30
30
  middleware.id = 'staticResourcesProcessor';
31
31
  return middleware;
32
32
  }
@@ -1,5 +1,6 @@
1
1
  export * from './withBlockSchemaEnhancer';
2
- export withBlockExtensions, {
2
+ export {
3
+ default as withBlockExtensions,
3
4
  resolveExtension,
4
5
  resolveBlockExtensions,
5
6
  } from './withBlockExtensions';
@@ -48,7 +48,9 @@ export function formatDate({
48
48
  : short_date_format;
49
49
 
50
50
  const formatter = new Intl.DateTimeFormat(locale, format);
51
- return formatToParts ? formatter.formatToParts(date) : formatter.format(date);
51
+ return formatToParts
52
+ ? formatter.formatToParts(date)
53
+ : formatter.format(date).replace('\u202F', ' ');
52
54
  }
53
55
 
54
56
  export function formatRelativeDate({
@@ -93,5 +95,5 @@ export function formatRelativeDate({
93
95
  ? ''
94
96
  : formatToParts
95
97
  ? formatter.formatToParts(v, tag)
96
- : formatter.format(v, tag); // use "now" ?
98
+ : formatter.format(v, tag).replace('\u202F', ' '); // use "now" ?
97
99
  }
@@ -192,6 +192,8 @@ describe('formatRelativeDate helper', () => {
192
192
  it('can use alternate style narrow', () => {
193
193
  const now = Date.now();
194
194
  const d = new Date(now + 3 * MONTH);
195
- expect(formatRelativeDate({ date: d, style: 'narrow' })).toBe('in 3 mo.');
195
+ expect(['in 3 mo.', 'in 3mo']).toContain(
196
+ formatRelativeDate({ date: d, style: 'narrow' }),
197
+ );
196
198
  });
197
199
  });
@@ -5,9 +5,9 @@
5
5
  */
6
6
 
7
7
  // export { injectLazyLibs } from './Loadable/Loadable';
8
- export Api from '@plone/volto/helpers/Api/Api';
8
+ export { default as Api } from '@plone/volto/helpers/Api/Api';
9
9
  export { getAPIResourceWithAuth } from '@plone/volto/helpers/Api/APIResourceWithAuth';
10
- export Html from '@plone/volto/helpers/Html/Html';
10
+ export { default as Html } from '@plone/volto/helpers/Html/Html';
11
11
  export {
12
12
  getAuthToken,
13
13
  persistAuthToken,
@@ -59,8 +59,8 @@ export {
59
59
  buildStyleClassNamesExtenders,
60
60
  getPreviousNextBlock,
61
61
  } from '@plone/volto/helpers/Blocks/Blocks';
62
- export BodyClass from '@plone/volto/helpers/BodyClass/BodyClass';
63
- export ScrollToTop from '@plone/volto/helpers/ScrollToTop/ScrollToTop';
62
+ export { default as BodyClass } from '@plone/volto/helpers/BodyClass/BodyClass';
63
+ export { default as ScrollToTop } from '@plone/volto/helpers/ScrollToTop/ScrollToTop';
64
64
  export {
65
65
  getBoolean,
66
66
  getVocabName,
@@ -70,11 +70,10 @@ export {
70
70
  getFieldsVocabulary,
71
71
  } from '@plone/volto/helpers/Vocabularies/Vocabularies';
72
72
 
73
- export langmap from './LanguageMap/LanguageMap';
74
- export Helmet from './Helmet/Helmet';
75
- export FormValidation, {
76
- validateFileUploadSize,
77
- } from './FormValidation/FormValidation';
73
+ export { default as langmap } from './LanguageMap/LanguageMap';
74
+ export { default as Helmet } from './Helmet/Helmet';
75
+ export { default as FormValidation } from './FormValidation/FormValidation';
76
+ export { validateFileUploadSize } from './FormValidation/FormValidation';
78
77
  export {
79
78
  difference,
80
79
  getColor,
@@ -111,7 +110,7 @@ export { useDetectClickOutside } from './Utils/useDetectClickOutside';
111
110
  export { useEvent } from './Utils/useEvent';
112
111
  export { usePrevious } from './Utils/usePrevious';
113
112
  export { usePagination } from './Utils/usePagination';
114
- export useUndoManager from './UndoManager/useUndoManager';
113
+ export { default as useUndoManager } from './UndoManager/useUndoManager';
115
114
  export { getCookieOptions } from './Cookies/cookies';
116
115
  export { getWidgetView } from './Widget/widget';
117
116
  export {
@@ -4,8 +4,8 @@
4
4
  * @example import { api } from 'middleware';
5
5
  */
6
6
 
7
- export api from '@plone/volto/middleware/api';
8
- export blacklistRoutes from './blacklistRoutes';
7
+ export { default as api } from '@plone/volto/middleware/api';
8
+ export { default as blacklistRoutes } from './blacklistRoutes';
9
9
  export {
10
10
  protectLoadStart,
11
11
  protectLoadEnd,
@@ -4,7 +4,7 @@ import http from 'http';
4
4
  import app from './server';
5
5
  import debug from 'debug';
6
6
 
7
- export default () => {
7
+ export default function server() {
8
8
  const server = http.createServer(app);
9
9
  // const host = process.env.HOST || 'localhost';
10
10
  const port = process.env.PORT || 3000;
@@ -46,4 +46,4 @@ export default () => {
46
46
  currentApp = newApp;
47
47
  });
48
48
  };
49
- };
49
+ }
@@ -477,7 +477,9 @@ body.has-toolbar.has-sidebar-collapsed .ui.wrapper > .ui.inner.block.full {
477
477
 
478
478
  &.new-add-block {
479
479
  bottom: -26px;
480
- left: 50%;
480
+ left: calc(
481
+ 50% - 12px
482
+ ); // This is to compensate the width of the icon and center it correctly
481
483
  padding: 0 !important;
482
484
  border: none !important;
483
485
  background: white !important;