@plone/volto 18.0.0-alpha.37 → 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 CHANGED
@@ -17,6 +17,19 @@ 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
+
27
+ ## 18.0.0-alpha.38 (2024-06-28)
28
+
29
+ ### Internal
30
+
31
+ - Renamed `constants/Languages.js` to `constants/Languages.cjs` @sneridagh [#6130](https://github.com/plone/volto/issues/6130)
32
+
20
33
  ## 18.0.0-alpha.37 (2024-06-27)
21
34
 
22
35
  ### Feature
package/package.json CHANGED
@@ -9,7 +9,7 @@
9
9
  }
10
10
  ],
11
11
  "license": "MIT",
12
- "version": "18.0.0-alpha.37",
12
+ "version": "18.0.0-alpha.39",
13
13
  "repository": {
14
14
  "type": "git",
15
15
  "url": "git@github.com:plone/volto.git"
@@ -78,7 +78,7 @@
78
78
  },
79
79
  "setupFiles": [
80
80
  "./test-setup-globals.js",
81
- "./test-setup-config.js"
81
+ "./test-setup-config.jsx"
82
82
  ],
83
83
  "globalSetup": "./global-test-setup.js",
84
84
  "setupFilesAfterEnv": [
@@ -237,8 +237,8 @@
237
237
  "use-deep-compare-effect": "1.8.1",
238
238
  "uuid": "^8.3.2",
239
239
  "@plone/registry": "1.7.0",
240
- "@plone/scripts": "3.6.2",
241
- "@plone/volto-slate": "18.0.0-alpha.14"
240
+ "@plone/volto-slate": "18.0.0-alpha.15",
241
+ "@plone/scripts": "3.6.2"
242
242
  },
243
243
  "devDependencies": {
244
244
  "@babel/core": "^7.0.0",
package/razzle.config.js CHANGED
@@ -20,7 +20,7 @@ const AfterBuildPlugin = require('@fiverr/afterbuild-webpack-plugin');
20
20
  const fileLoaderFinder = makeLoaderFinder('file-loader');
21
21
 
22
22
  const projectRootPath = path.resolve('.');
23
- const languages = require('./src/constants/Languages');
23
+ const languages = require('./src/constants/Languages.cjs');
24
24
 
25
25
  const packageJson = require(path.join(projectRootPath, 'package.json'));
26
26
 
@@ -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('@root/../locales/' + langFileName + '.json').then((locale) => {
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 compose(
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('@root/../locales/' + langFileName + '.json').then((locale) => {
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('@root/../locales/' + langFileName + '.json').then((locale) => {
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
  });
@@ -14,7 +14,7 @@ import { toast } from 'react-toastify';
14
14
 
15
15
  import { Toast } from '@plone/volto/components';
16
16
  import { Form } from '@plone/volto/components/manage/Form';
17
- import languages from '@plone/volto/constants/Languages';
17
+ import languages from '@plone/volto/constants/Languages.cjs';
18
18
  import { changeLanguage } from '@plone/volto/actions';
19
19
  import { toGettextLang } from '@plone/volto/helpers';
20
20
  import config from '@plone/volto/registry';
@@ -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('@root/../locales/' + langFileName + '.json').then((locale) => {
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
- url,
209
- { title, image_field, image_scales },
210
- ) => {
211
- onChange(props.id, flattenToAppURL(url), {
212
- title,
213
- image_field,
214
- image_scales,
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('@root/../locales/' + langFileName + '.json').then((locale) => {
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
  }
@@ -20,3 +20,5 @@ module.exports = {
20
20
  pt_BR: 'Português (Brasil)',
21
21
  zh_CN: '中文',
22
22
  };
23
+
24
+ // export default languages;
@@ -102,7 +102,7 @@ export function persistAuthToken(store, req) {
102
102
  handleChange(true);
103
103
  }
104
104
 
105
- if (module.hot) {
105
+ if (module?.hot) {
106
106
  module.hot.dispose((data) => {
107
107
  data.reloaded = true;
108
108
  });
@@ -237,11 +237,11 @@ const apiMiddlewareFactory =
237
237
  config.settings.supportedLanguages.includes(lang)
238
238
  ) {
239
239
  const langFileName = toGettextLang(lang);
240
- import('@root/../locales/' + langFileName + '.json').then(
241
- (locale) => {
242
- dispatch(changeLanguage(lang, locale.default));
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
@@ -36,7 +36,7 @@ import userSession from '@plone/volto/reducers/userSession/userSession';
36
36
 
37
37
  import ErrorPage from '@plone/volto/error';
38
38
 
39
- import languages from '@plone/volto/constants/Languages';
39
+ import languages from '@plone/volto/constants/Languages.cjs';
40
40
 
41
41
  import configureStore from '@plone/volto/store';
42
42
  import { ReduxAsyncConnect, loadOnServer } from './helpers/AsyncConnect';
@@ -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('@root/../locales/' + langFileName + '.json').then((locale) => {
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;
@@ -0,0 +1,15 @@
1
+ export let ca: string;
2
+ export let de: string;
3
+ export let en: string;
4
+ export let es: string;
5
+ export let eu: string;
6
+ export let fi: string;
7
+ export let fr: string;
8
+ export let hi: string;
9
+ export let it: string;
10
+ export let nl: string;
11
+ export let ro: string;
12
+ export let ja: string;
13
+ export let pt: string;
14
+ export let pt_BR: string;
15
+ export let zh_CN: string;
File without changes