@plone/volto 17.18.0 → 17.18.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/CHANGELOG.md +12 -0
- package/package.json +3 -2
- package/packages/volto-slate/package.json +1 -1
- package/packages/volto-slate/src/constants.js +3 -0
- package/packages/volto-slate/src/editor/plugins/Markdown/constants.js +4 -4
- package/packages/volto-slate/src/editor/plugins/Markdown/extensions.js +1 -0
- package/src/components/theme/View/View.jsx +4 -2
- package/src/components/theme/View/View.test.jsx +1 -0
- package/src/helpers/Api/Api.js +12 -0
- package/src/helpers/Api/Api.plone.rest.test.js +1 -0
- package/src/helpers/Api/Api.test.js +1 -0
package/CHANGELOG.md
CHANGED
|
@@ -17,6 +17,18 @@ myst:
|
|
|
17
17
|
|
|
18
18
|
<!-- towncrier release notes start -->
|
|
19
19
|
|
|
20
|
+
## 17.18.2 (2024-07-10)
|
|
21
|
+
|
|
22
|
+
### Bugfix
|
|
23
|
+
|
|
24
|
+
- Return a redirect response from Volto server-side rendering if the API request was redirected. @JeffersonBledsoe @mamico [#4854](https://github.com/plone/volto/issues/4854)
|
|
25
|
+
|
|
26
|
+
## 17.18.1 (2024-06-29)
|
|
27
|
+
|
|
28
|
+
### Bugfix
|
|
29
|
+
|
|
30
|
+
- In the Slate text block, the markup shortcuts for heading and blockquote work again. @kHAPPY2004 [#5452](https://github.com/plone/volto/issues/5452)
|
|
31
|
+
|
|
20
32
|
## 17.18.0 (2024-06-28)
|
|
21
33
|
|
|
22
34
|
### Feature
|
package/package.json
CHANGED
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
}
|
|
10
10
|
],
|
|
11
11
|
"license": "MIT",
|
|
12
|
-
"version": "17.18.
|
|
12
|
+
"version": "17.18.2",
|
|
13
13
|
"repository": {
|
|
14
14
|
"type": "git",
|
|
15
15
|
"url": "git@github.com:plone/volto.git"
|
|
@@ -187,7 +187,8 @@
|
|
|
187
187
|
"hooks": {
|
|
188
188
|
"before:bump": [
|
|
189
189
|
"yarn i18n",
|
|
190
|
-
"yarn build:types"
|
|
190
|
+
"yarn build:types",
|
|
191
|
+
"git add types"
|
|
191
192
|
],
|
|
192
193
|
"after:bump": [
|
|
193
194
|
"pipx run towncrier build --draft --yes --version ${version} > .changelog.draft && pipx run towncrier build --yes --version ${version}",
|
|
@@ -22,6 +22,9 @@ export const P = 'p';
|
|
|
22
22
|
export const LI = 'li';
|
|
23
23
|
export const UL = 'ul';
|
|
24
24
|
export const OL = 'ol';
|
|
25
|
+
export const H2 = 'h2';
|
|
26
|
+
export const H3 = 'h3';
|
|
27
|
+
export const BLOCKQUOTE = 'blockquote';
|
|
25
28
|
|
|
26
29
|
// dom parsing node information
|
|
27
30
|
export const TEXT_NODE = 3;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { toggleList, unwrapList } from './utils';
|
|
2
2
|
import { isBlockActive } from '@plone/volto-slate/utils';
|
|
3
|
-
import { UL, OL, LI } from '@plone/volto-slate/constants';
|
|
3
|
+
import { UL, OL, LI, H2, H3, BLOCKQUOTE } from '@plone/volto-slate/constants';
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* Uses the old toggleList function to toggle lists on or off or from a type to another.
|
|
@@ -22,11 +22,11 @@ export const localToggleList = (editor, format) => {
|
|
|
22
22
|
*/
|
|
23
23
|
export const autoformatRules = [
|
|
24
24
|
{
|
|
25
|
-
type:
|
|
25
|
+
type: H2,
|
|
26
26
|
markup: '#',
|
|
27
27
|
},
|
|
28
28
|
{
|
|
29
|
-
type:
|
|
29
|
+
type: H3,
|
|
30
30
|
markup: '##',
|
|
31
31
|
},
|
|
32
32
|
{
|
|
@@ -44,7 +44,7 @@ export const autoformatRules = [
|
|
|
44
44
|
},
|
|
45
45
|
},
|
|
46
46
|
{
|
|
47
|
-
type:
|
|
47
|
+
type: BLOCKQUOTE,
|
|
48
48
|
markup: ['>'],
|
|
49
49
|
// preFormat,
|
|
50
50
|
},
|
|
@@ -205,8 +205,10 @@ class View extends Component {
|
|
|
205
205
|
*/
|
|
206
206
|
render() {
|
|
207
207
|
const { views } = config;
|
|
208
|
-
if (
|
|
209
|
-
const redirect = flattenToAppURL(this.props.error.url)
|
|
208
|
+
if ([301, 302].includes(this.props.error?.code)) {
|
|
209
|
+
const redirect = flattenToAppURL(this.props.error.url)
|
|
210
|
+
.split('?')[0]
|
|
211
|
+
.replace('/++api++', '');
|
|
210
212
|
return <Redirect to={`${redirect}${this.props.location.search}`} />;
|
|
211
213
|
} else if (this.props.error && !this.props.connectionRefused) {
|
|
212
214
|
let FoundView;
|
package/src/helpers/Api/Api.js
CHANGED
|
@@ -80,6 +80,10 @@ class Api {
|
|
|
80
80
|
|
|
81
81
|
Object.keys(headers).forEach((key) => request.set(key, headers[key]));
|
|
82
82
|
|
|
83
|
+
if (__SERVER__ && checkUrl && ['get', 'head'].includes(method)) {
|
|
84
|
+
request.redirects(0);
|
|
85
|
+
}
|
|
86
|
+
|
|
83
87
|
if (data) {
|
|
84
88
|
request.send(data);
|
|
85
89
|
}
|
|
@@ -104,6 +108,14 @@ class Api {
|
|
|
104
108
|
url: request.xhr.responseURL,
|
|
105
109
|
});
|
|
106
110
|
}
|
|
111
|
+
|
|
112
|
+
if ([301, 302].includes(err?.status)) {
|
|
113
|
+
return reject({
|
|
114
|
+
code: err.status,
|
|
115
|
+
url: err.response.headers.location,
|
|
116
|
+
});
|
|
117
|
+
}
|
|
118
|
+
|
|
107
119
|
return err ? reject(err) : resolve(response.body || response.text);
|
|
108
120
|
});
|
|
109
121
|
});
|