@plone/volto 16.10.0 → 16.11.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.draft CHANGED
@@ -1,18 +1,12 @@
1
- ## 16.10.0 (2023-02-06)
1
+ ## 16.11.0 (2023-02-13)
2
2
 
3
3
  ### Feature
4
4
 
5
- - Option for opening /edit with the same vertical offset like the page in view mode before. @ksuess [#3662](https://github.com/plone/volto/issues/3662)
6
- - Add option to add an action button to the top of the toolbar and to add a menu button to the bottom of the toolbar. @ksuess [#4333](https://github.com/plone/volto/issues/4333)
7
- - Update to latest versions in the backend for testing and the convenience api folder @sneridagh [#4361](https://github.com/plone/volto/issues/4361)
8
- - Content Rules: Support server-provided schema for condition and action @ericof [#4368](https://github.com/plone/volto/issues/4368)
5
+ - Add open external link in a new tab config option. @robgietema [#4379](https://github.com/plone/volto/issues/4379)
6
+ - Add scss support in core @sneridagh [#4383](https://github.com/plone/volto/issues/4383)
7
+ - Use open in new tab setting for link types. @robgietema [#4384](https://github.com/plone/volto/issues/4384)
9
8
 
10
9
  ### Bugfix
11
10
 
12
- - Fix react-error-overlay resolution @sneridagh [#4360](https://github.com/plone/volto/issues/4360)
13
-
14
- ### Documentation
15
-
16
- - Add documentation for copy, cut, and paste blocks in Volto. @MAX-786 [#3827](https://github.com/plone/volto/issues/3827)
17
- - Fixed Grammar error @SaiRev0 [#4272](https://github.com/plone/volto/issues/4272)
11
+ - Fix Cannot read properties of undefined (reading 'translations') @avoinea [#4377](https://github.com/plone/volto/issues/4377)
18
12
 
Binary file
package/CHANGELOG.md CHANGED
@@ -8,6 +8,19 @@
8
8
 
9
9
  <!-- towncrier release notes start -->
10
10
 
11
+ ## 16.11.0 (2023-02-13)
12
+
13
+ ### Feature
14
+
15
+ - Add open external link in a new tab config option. @robgietema [#4379](https://github.com/plone/volto/issues/4379)
16
+ - Add scss support in core @sneridagh [#4383](https://github.com/plone/volto/issues/4383)
17
+ - Use open in new tab setting for link types. @robgietema [#4384](https://github.com/plone/volto/issues/4384)
18
+
19
+ ### Bugfix
20
+
21
+ - Fix Cannot read properties of undefined (reading 'translations') @avoinea [#4377](https://github.com/plone/volto/issues/4377)
22
+
23
+
11
24
  ## 16.10.0 (2023-02-06)
12
25
 
13
26
  ### Feature
package/package.json CHANGED
@@ -9,7 +9,7 @@
9
9
  }
10
10
  ],
11
11
  "license": "MIT",
12
- "version": "16.10.0",
12
+ "version": "16.11.0",
13
13
  "repository": {
14
14
  "type": "git",
15
15
  "url": "git@github.com:plone/volto.git"
@@ -137,6 +137,12 @@
137
137
  "stylelint-prettier"
138
138
  ],
139
139
  "overrides": [
140
+ {
141
+ "files": [
142
+ "**/*.scss"
143
+ ],
144
+ "customSyntax": "postcss-scss"
145
+ },
140
146
  {
141
147
  "files": [
142
148
  "**/*.less"
@@ -316,6 +322,7 @@
316
322
  "postcss-load-config": "3.1.4",
317
323
  "postcss-loader": "4.3.0",
318
324
  "postcss-overrides": "3.1.4",
325
+ "postcss-scss": "4.0.6",
319
326
  "prepend-http": "2",
320
327
  "prettier": "2.0.5",
321
328
  "pretty-bytes": "5.3.0",
@@ -326,6 +333,7 @@
326
333
  "razzle": "4.2.17",
327
334
  "razzle-dev-utils": "4.2.17",
328
335
  "razzle-plugin-bundle-analyzer": "4.2.17",
336
+ "razzle-plugin-scss": "4.2.18",
329
337
  "rc-time-picker": "3.7.3",
330
338
  "react": "17.0.2",
331
339
  "react-anchor-link-smooth-scroll": "1.0.12",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@plone/volto-slate",
3
- "version": "16.10.0",
3
+ "version": "16.11.0",
4
4
  "description": "Slate.js integration with Volto",
5
5
  "main": "src/index.js",
6
6
  "author": "European Environment Agency: IDM2 A-Team",
@@ -1,11 +1,16 @@
1
1
  import React from 'react';
2
2
  import { UniversalLink } from '@plone/volto/components';
3
+ import config from '@plone/volto/registry';
4
+ import { isInternalURL } from '@plone/volto/helpers';
3
5
 
4
6
  const ViewLink = ({ url, target, download, children }) => {
7
+ const { openExternalLinkInNewTab } = config.settings;
5
8
  return (
6
9
  <UniversalLink
7
10
  href={url}
8
- openLinkInNewTab={target === '_blank'}
11
+ openLinkInNewTab={
12
+ (openExternalLinkInNewTab && !isInternalURL(url)) || target === '_blank'
13
+ }
9
14
  download={download}
10
15
  >
11
16
  {children}
package/razzle.config.js CHANGED
@@ -330,6 +330,7 @@ const defaultPlugins = [
330
330
  { object: require('./webpack-plugins/webpack-svg-plugin') },
331
331
  { object: require('./webpack-plugins/webpack-bundle-analyze-plugin') },
332
332
  { object: require('./jest-extender-plugin') },
333
+ 'scss',
333
334
  ];
334
335
 
335
336
  const plugins = addonExtenders.reduce(
@@ -510,7 +510,7 @@ class Toolbar extends Component {
510
510
  ((this.props.content.is_folderish &&
511
511
  this.props.types.length > 0) ||
512
512
  (config.settings.isMultilingual &&
513
- this.props.content['@components'].translations)) && (
513
+ this.props.content['@components']?.translations)) && (
514
514
  <button
515
515
  className="add"
516
516
  aria-label={this.props.intl.formatMessage(
@@ -28,6 +28,7 @@ const NavItem = ({ item, lang }) => {
28
28
  key={item.url}
29
29
  className="item"
30
30
  rel="noopener noreferrer"
31
+ target={settings.openExternalLinkInNewTab ? '_blank' : '_self'}
31
32
  >
32
33
  {item.title}
33
34
  </a>
@@ -9,6 +9,7 @@ import { isInternalURL, flattenToAppURL } from '@plone/volto/helpers';
9
9
  import { Container } from 'semantic-ui-react';
10
10
  import { UniversalLink } from '@plone/volto/components';
11
11
  import { FormattedMessage } from 'react-intl';
12
+ import config from '@plone/volto/registry';
12
13
 
13
14
  /**
14
15
  * View container class.
@@ -58,6 +59,7 @@ class LinkView extends Component {
58
59
  */
59
60
  render() {
60
61
  const { remoteUrl } = this.props.content;
62
+ const { openExternalLinkInNewTab } = config.settings;
61
63
  return (
62
64
  <Container id="page-document">
63
65
  <h1 className="documentFirstHeading">{this.props.content.title}</h1>
@@ -72,7 +74,12 @@ class LinkView extends Component {
72
74
  id="The link address is:"
73
75
  defaultMessage="The link address is:"
74
76
  />{' '}
75
- <UniversalLink href={remoteUrl}>
77
+ <UniversalLink
78
+ href={remoteUrl}
79
+ openLinkInNewTab={
80
+ openExternalLinkInNewTab && !isInternalURL(remoteUrl)
81
+ }
82
+ >
76
83
  {flattenToAppURL(remoteUrl)}
77
84
  </UniversalLink>
78
85
  </p>
@@ -111,6 +111,7 @@ let config = {
111
111
  downloadableObjects: ['File'], //list of content-types for which the direct download of the file will be carried out if the user is not authenticated
112
112
  viewableInBrowserObjects: [], //ex: ['File']. List of content-types for which the file will be displayed in browser if the user is not authenticated
113
113
  listingPreviewImageField: 'image', // deprecated from Volto 14 onwards
114
+ openExternalLinkInNewTab: false,
114
115
  notSupportedBrowsers: ['ie'],
115
116
  defaultPageSize: 25,
116
117
  isMultilingual: false,