@plone/volto 18.0.0-alpha.38 → 18.0.0-alpha.39
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 +7 -0
- package/package.json +2 -2
- package/src/components/manage/Add/Add.jsx +3 -1
- package/src/components/manage/Blocks/Image/Edit.jsx +1 -28
- package/src/components/manage/Multilingual/CreateTranslation.jsx +3 -1
- package/src/components/manage/Multilingual/TranslationObject.jsx +3 -1
- package/src/components/manage/Preferences/PersonalPreferences.jsx +3 -1
- package/src/components/manage/Widgets/ImageWidget.jsx +10 -10
- package/src/components/theme/MultilingualRedirector/MultilingualRedirector.jsx +3 -1
- package/src/middleware/api.js +5 -5
- package/src/server.jsx +3 -1
- package/types/components/manage/Blocks/Image/Edit.d.ts +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -17,6 +17,13 @@ myst:
|
|
|
17
17
|
|
|
18
18
|
<!-- towncrier release notes start -->
|
|
19
19
|
|
|
20
|
+
## 18.0.0-alpha.39 (2024-06-28)
|
|
21
|
+
|
|
22
|
+
### Bugfix
|
|
23
|
+
|
|
24
|
+
- Cleanup Image widget and pass down onSelectItem prop if any @sneridagh [#6132](https://github.com/plone/volto/issues/6132)
|
|
25
|
+
- Whitelist some dynamic imports to suppress vite warnings in storybook @tomschall [#6133](https://github.com/plone/volto/issues/6133)
|
|
26
|
+
|
|
20
27
|
## 18.0.0-alpha.38 (2024-06-28)
|
|
21
28
|
|
|
22
29
|
### Internal
|
package/package.json
CHANGED
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
}
|
|
10
10
|
],
|
|
11
11
|
"license": "MIT",
|
|
12
|
-
"version": "18.0.0-alpha.
|
|
12
|
+
"version": "18.0.0-alpha.39",
|
|
13
13
|
"repository": {
|
|
14
14
|
"type": "git",
|
|
15
15
|
"url": "git@github.com:plone/volto.git"
|
|
@@ -236,8 +236,8 @@
|
|
|
236
236
|
"url": "^0.11.3",
|
|
237
237
|
"use-deep-compare-effect": "1.8.1",
|
|
238
238
|
"uuid": "^8.3.2",
|
|
239
|
-
"@plone/volto-slate": "18.0.0-alpha.15",
|
|
240
239
|
"@plone/registry": "1.7.0",
|
|
240
|
+
"@plone/volto-slate": "18.0.0-alpha.15",
|
|
241
241
|
"@plone/scripts": "3.6.2"
|
|
242
242
|
},
|
|
243
243
|
"devDependencies": {
|
|
@@ -239,7 +239,9 @@ class Add extends Component {
|
|
|
239
239
|
if (this.props.location?.state?.translationOf) {
|
|
240
240
|
const language = this.props.location.state.languageFrom;
|
|
241
241
|
const langFileName = toGettextLang(language);
|
|
242
|
-
import(
|
|
242
|
+
import(
|
|
243
|
+
/* @vite-ignore */ '@root/../locales/' + langFileName + '.json'
|
|
244
|
+
).then((locale) => {
|
|
243
245
|
this.props.changeLanguage(language, locale.default);
|
|
244
246
|
});
|
|
245
247
|
this.props.history.push(this.props.location?.state?.translationOf);
|
|
@@ -4,13 +4,8 @@
|
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
6
|
import React from 'react';
|
|
7
|
-
import { connect } from 'react-redux';
|
|
8
|
-
import { compose } from 'redux';
|
|
9
|
-
|
|
10
|
-
import { injectIntl } from 'react-intl';
|
|
11
7
|
import cx from 'classnames';
|
|
12
8
|
import { ImageSidebar, SidebarPortal } from '@plone/volto/components';
|
|
13
|
-
import { createContent } from '@plone/volto/actions';
|
|
14
9
|
|
|
15
10
|
import {
|
|
16
11
|
flattenToAppURL,
|
|
@@ -21,18 +16,6 @@ import config from '@plone/volto/registry';
|
|
|
21
16
|
|
|
22
17
|
import { ImageInput } from '@plone/volto/components/manage/Widgets/ImageWidget';
|
|
23
18
|
|
|
24
|
-
/**
|
|
25
|
-
* Edit image block function.
|
|
26
|
-
* @function Edit
|
|
27
|
-
*/
|
|
28
|
-
|
|
29
|
-
// const messages = defineMessages({
|
|
30
|
-
// notImage: {
|
|
31
|
-
// id: 'The provided link does not lead to an image.',
|
|
32
|
-
// defaultMessage: 'The provided link does not lead to an image.',
|
|
33
|
-
// },
|
|
34
|
-
// });
|
|
35
|
-
|
|
36
19
|
function Edit(props) {
|
|
37
20
|
const { data } = props;
|
|
38
21
|
const Image = config.getComponent({ name: 'Image' }).component;
|
|
@@ -120,14 +103,4 @@ function Edit(props) {
|
|
|
120
103
|
);
|
|
121
104
|
}
|
|
122
105
|
|
|
123
|
-
export default
|
|
124
|
-
injectIntl,
|
|
125
|
-
withBlockExtensions,
|
|
126
|
-
connect(
|
|
127
|
-
(state, ownProps) => ({
|
|
128
|
-
request: state.content.subrequests[ownProps.block] || {},
|
|
129
|
-
content: state.content.subrequests[ownProps.block]?.data,
|
|
130
|
-
}),
|
|
131
|
-
{ createContent },
|
|
132
|
-
),
|
|
133
|
-
)(Edit);
|
|
106
|
+
export default withBlockExtensions(Edit);
|
|
@@ -34,7 +34,9 @@ const CreateTranslation = (props) => {
|
|
|
34
34
|
// We change the interface language
|
|
35
35
|
if (config.settings.supportedLanguages.includes(language)) {
|
|
36
36
|
const langFileName = toGettextLang(language);
|
|
37
|
-
import(
|
|
37
|
+
import(
|
|
38
|
+
/* @vite-ignore */ '@root/../locales/' + langFileName + '.json'
|
|
39
|
+
).then((locale) => {
|
|
38
40
|
dispatch(changeLanguage(language, locale.default));
|
|
39
41
|
});
|
|
40
42
|
}
|
|
@@ -48,7 +48,9 @@ const TranslationObject = ({
|
|
|
48
48
|
let lang =
|
|
49
49
|
config.settings.supportedLanguages[Object.keys(locales).length];
|
|
50
50
|
const langFileName = toGettextLang(lang);
|
|
51
|
-
import(
|
|
51
|
+
import(
|
|
52
|
+
/* @vite-ignore */ '@root/../locales/' + langFileName + '.json'
|
|
53
|
+
).then((locale) => {
|
|
52
54
|
setLocales({ ...locales, [toReactIntlLang(lang)]: locale.default });
|
|
53
55
|
setLoadingLocale(false);
|
|
54
56
|
});
|
|
@@ -88,7 +88,9 @@ class PersonalPreferences extends Component {
|
|
|
88
88
|
let language = data.language || 'en';
|
|
89
89
|
if (config.settings.supportedLanguages.includes(language)) {
|
|
90
90
|
const langFileName = toGettextLang(language);
|
|
91
|
-
import(
|
|
91
|
+
import(
|
|
92
|
+
/* @vite-ignore */ '@root/../locales/' + langFileName + '.json'
|
|
93
|
+
).then((locale) => {
|
|
92
94
|
this.props.changeLanguage(language, locale.default);
|
|
93
95
|
});
|
|
94
96
|
}
|
|
@@ -75,6 +75,7 @@ const UnconnectedImageInput = (props) => {
|
|
|
75
75
|
objectBrowserPickerType = 'image',
|
|
76
76
|
description,
|
|
77
77
|
placeholderLinkInput = '',
|
|
78
|
+
onSelectItem,
|
|
78
79
|
} = props;
|
|
79
80
|
|
|
80
81
|
const intl = useIntl();
|
|
@@ -204,16 +205,15 @@ const UnconnectedImageInput = (props) => {
|
|
|
204
205
|
e.preventDefault();
|
|
205
206
|
openObjectBrowser({
|
|
206
207
|
mode: objectBrowserPickerType,
|
|
207
|
-
onSelectItem:
|
|
208
|
-
|
|
209
|
-
{ title, image_field, image_scales }
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
},
|
|
208
|
+
onSelectItem: onSelectItem
|
|
209
|
+
? onSelectItem
|
|
210
|
+
: (url, { title, image_field, image_scales }) => {
|
|
211
|
+
onChange(props.id, flattenToAppURL(url), {
|
|
212
|
+
title,
|
|
213
|
+
image_field,
|
|
214
|
+
image_scales,
|
|
215
|
+
});
|
|
216
|
+
},
|
|
217
217
|
currentPath: contextUrl,
|
|
218
218
|
});
|
|
219
219
|
}}
|
|
@@ -24,7 +24,9 @@ const MultilingualRedirector = (props) => {
|
|
|
24
24
|
let mounted = true;
|
|
25
25
|
if (settings.isMultilingual && pathname === '/') {
|
|
26
26
|
const langFileName = toGettextLang(redirectToLanguage);
|
|
27
|
-
import(
|
|
27
|
+
import(
|
|
28
|
+
/* @vite-ignore */ '@root/../locales/' + langFileName + '.json'
|
|
29
|
+
).then((locale) => {
|
|
28
30
|
if (mounted) {
|
|
29
31
|
dispatch(changeLanguage(redirectToLanguage, locale.default));
|
|
30
32
|
}
|
package/src/middleware/api.js
CHANGED
|
@@ -237,11 +237,11 @@ const apiMiddlewareFactory =
|
|
|
237
237
|
config.settings.supportedLanguages.includes(lang)
|
|
238
238
|
) {
|
|
239
239
|
const langFileName = toGettextLang(lang);
|
|
240
|
-
import(
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
);
|
|
240
|
+
import(
|
|
241
|
+
/* @vite-ignore */ '@root/../locales/' + langFileName + '.json'
|
|
242
|
+
).then((locale) => {
|
|
243
|
+
dispatch(changeLanguage(lang, locale.default));
|
|
244
|
+
});
|
|
245
245
|
}
|
|
246
246
|
}
|
|
247
247
|
if (type === LOGIN && settings.websockets) {
|
package/src/server.jsx
CHANGED
|
@@ -46,7 +46,9 @@ let locales = {};
|
|
|
46
46
|
if (config.settings) {
|
|
47
47
|
config.settings.supportedLanguages.forEach((lang) => {
|
|
48
48
|
const langFileName = toGettextLang(lang);
|
|
49
|
-
import(
|
|
49
|
+
import(
|
|
50
|
+
/* @vite-ignore */ '@root/../locales/' + langFileName + '.json'
|
|
51
|
+
).then((locale) => {
|
|
50
52
|
locales = { ...locales, [toReactIntlLang(lang)]: locale.default };
|
|
51
53
|
});
|
|
52
54
|
});
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare const _default: any;
|
|
1
|
+
declare const _default: (props: any) => import("react/jsx-runtime").JSX.Element;
|
|
2
2
|
export default _default;
|