@plone/volto 18.2.0 → 18.2.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.
Files changed (42) hide show
  1. package/.eslintrc.core.js +1 -0
  2. package/.release-it.json +1 -1
  3. package/CHANGELOG.md +17 -0
  4. package/package.json +2 -2
  5. package/src/components/theme/EventDetails/EventDetails.jsx +2 -2
  6. package/src/config/Blocks.jsx +9 -0
  7. package/src/config/Components.jsx +9 -6
  8. package/src/config/index.js +7 -18
  9. package/src/express-middleware/files.js +4 -1
  10. package/types/config/Components.d.ts +1 -14
  11. /package/src/components/manage/Pluggable/{Pluggable.stories.js → Pluggable.stories.jsx} +0 -0
  12. /package/src/components/manage/Pluggable/{Pluggable.test.js → Pluggable.test.jsx} +0 -0
  13. /package/src/components/manage/UniversalLink/{UniversalLink.stories.js → UniversalLink.stories.jsx} +0 -0
  14. /package/src/components/manage/Widgets/{ObjectBrowserWidget.stories.js → ObjectBrowserWidget.stories.jsx} +0 -0
  15. /package/src/components/manage/Widgets/{ObjectListWidget.stories.js → ObjectListWidget.stories.jsx} +0 -0
  16. /package/src/components/manage/Widgets/{ObjectListWidget.test.js → ObjectListWidget.test.jsx} +0 -0
  17. /package/src/components/manage/Widgets/{VocabularyTermsWidget.stories.js → VocabularyTermsWidget.stories.jsx} +0 -0
  18. /package/src/components/theme/Avatar/{Avatar.stories.js → Avatar.stories.jsx} +0 -0
  19. /package/src/components/theme/Navigation/{ContextNavigation.stories.js → ContextNavigation.stories.jsx} +0 -0
  20. /package/src/components/theme/Navigation/{withContentNavigation.js → withContentNavigation.jsx} +0 -0
  21. /package/src/components/theme/PreviewImage/{PreviewImage.test.js → PreviewImage.test.jsx} +0 -0
  22. /package/src/components/theme/Title/{Title.stories.js → Title.stories.jsx} +0 -0
  23. /package/src/components/theme/Widgets/{ArrayWidget.test.js → ArrayWidget.test.jsx} +0 -0
  24. /package/src/components/theme/Widgets/{BooleanWidget.test.js → BooleanWidget.test.jsx} +0 -0
  25. /package/src/components/theme/Widgets/{DateWidget.test.js → DateWidget.test.jsx} +0 -0
  26. /package/src/components/theme/Widgets/{DatetimeWidget.test.js → DatetimeWidget.test.jsx} +0 -0
  27. /package/src/components/theme/Widgets/{DescriptionWidget.test.js → DescriptionWidget.test.jsx} +0 -0
  28. /package/src/components/theme/Widgets/{EmailWidget.test.js → EmailWidget.test.jsx} +0 -0
  29. /package/src/components/theme/Widgets/{FileWidget.test.js → FileWidget.test.jsx} +0 -0
  30. /package/src/components/theme/Widgets/{ImageWidget.test.js → ImageWidget.test.jsx} +0 -0
  31. /package/src/components/theme/Widgets/{PasswordWidget.test.js → PasswordWidget.test.jsx} +0 -0
  32. /package/src/components/theme/Widgets/{RelationWidget.test.js → RelationWidget.test.jsx} +0 -0
  33. /package/src/components/theme/Widgets/{RelationsWidget.test.js → RelationsWidget.test.jsx} +0 -0
  34. /package/src/components/theme/Widgets/{RichTextWidget.test.js → RichTextWidget.test.jsx} +0 -0
  35. /package/src/components/theme/Widgets/{SelectWidget.test.js → SelectWidget.test.jsx} +0 -0
  36. /package/src/components/theme/Widgets/{TextWidget.test.js → TextWidget.test.jsx} +0 -0
  37. /package/src/components/theme/Widgets/{TitleWidget.test.js → TitleWidget.test.jsx} +0 -0
  38. /package/src/components/theme/Widgets/{TokenWidget.test.js → TokenWidget.test.jsx} +0 -0
  39. /package/src/components/theme/Widgets/{UrlWidget.test.js → UrlWidget.test.jsx} +0 -0
  40. /package/src/helpers/AsyncConnect/{AsyncConnect.test.js → AsyncConnect.test.jsx} +0 -0
  41. /package/src/helpers/Extensions/{withBlockExtensions.test.js → withBlockExtensions.test.jsx} +0 -0
  42. /package/src/helpers/Utils/{Utils.test.js → Utils.test.jsx} +0 -0
package/.eslintrc.core.js CHANGED
@@ -11,6 +11,7 @@ if (process.env.VOLTOCONFIG) {
11
11
  rules = null;
12
12
  } else {
13
13
  rules = {
14
+ 'react/jsx-filename-extension': ['warn', { extensions: ['.tsx', '.jsx'] }],
14
15
  'no-restricted-imports': [
15
16
  'warn',
16
17
  {
package/.release-it.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "../scripts/prepublish.js": {}
4
4
  },
5
5
  "hooks": {
6
- "before:bump": ["pnpm i18n", "pnpm build:types", "git add types"],
6
+ "before:bump": ["pnpm i18n"],
7
7
  "after:bump": [
8
8
  "pipx run towncrier build --draft --yes --version ${version} > .changelog.draft",
9
9
  "pipx run towncrier build --yes --version ${version}",
package/CHANGELOG.md CHANGED
@@ -17,6 +17,23 @@ myst:
17
17
 
18
18
  <!-- towncrier release notes start -->
19
19
 
20
+ ## 18.2.2 (2024-12-09)
21
+
22
+ ### Bugfix
23
+
24
+ - Fixed circular import error in dev with HMR in core Blocks shadow customizations. @sneridagh [#6525](https://github.com/plone/volto/issues/6525)
25
+
26
+ ## 18.2.1 (2024-12-09)
27
+
28
+ ### Bugfix
29
+
30
+ - Fixes ICS download in non-public event content. @sneridagh [#6515](https://github.com/plone/volto/issues/6515)
31
+ - Fixed circular import error in dev with HMR in `App` component when imported in the main default config. @sneridagh [#6524](https://github.com/plone/volto/issues/6524)
32
+
33
+ ### Internal
34
+
35
+ - Fix extension in files containing JSX. @sneridagh [#6520](https://github.com/plone/volto/issues/6520)
36
+
20
37
  ## 18.2.0 (2024-12-08)
21
38
 
22
39
  ### Internal
package/package.json CHANGED
@@ -9,7 +9,7 @@
9
9
  }
10
10
  ],
11
11
  "license": "MIT",
12
- "version": "18.2.0",
12
+ "version": "18.2.2",
13
13
  "repository": {
14
14
  "type": "git",
15
15
  "url": "git@github.com:plone/volto.git"
@@ -237,7 +237,7 @@
237
237
  "use-deep-compare-effect": "1.8.1",
238
238
  "uuid": "^8.3.2",
239
239
  "@plone/registry": "2.1.2",
240
- "@plone/volto-slate": "18.0.2",
240
+ "@plone/volto-slate": "18.0.3",
241
241
  "@plone/scripts": "3.8.1"
242
242
  },
243
243
  "devDependencies": {
@@ -6,7 +6,7 @@ import {
6
6
  Recurrence,
7
7
  } from '@plone/volto/components/theme/View/EventDatesInfo';
8
8
  import Icon from '@plone/volto/components/theme/Icon/Icon';
9
- import { expandToBackendURL } from '@plone/volto/helpers/Url/Url';
9
+ import { flattenToAppURL } from '@plone/volto/helpers/Url/Url';
10
10
 
11
11
  import calendarSVG from '@plone/volto/icons/calendar.svg';
12
12
 
@@ -147,7 +147,7 @@ const EventDetails = ({ content, display_as = 'aside' }) => {
147
147
  className="ics-download"
148
148
  target="_blank"
149
149
  rel="noreferrer"
150
- href={`${expandToBackendURL(content['@id'])}/ics_view`}
150
+ href={`${flattenToAppURL(content['@id'])}/ics_view`}
151
151
  >
152
152
  {intl.formatMessage(messages.downloadEvent)}
153
153
  </a>
@@ -530,6 +530,15 @@ const requiredBlocks = ['title'];
530
530
  const initialBlocks = {};
531
531
  const initialBlocksFocus = {}; //{Document:'title'}
532
532
 
533
+ export function installDefaultBlocks(config) {
534
+ config.blocks.requiredBlocks = requiredBlocks;
535
+ config.blocks.blocksConfig = blocksConfig;
536
+ config.blocks.groupBlocksOrder = groupBlocksOrder;
537
+ config.blocks.initialBlocks = initialBlocks;
538
+ config.blocks.initialBlocksFocus = initialBlocksFocus;
539
+ config.blocks.showEditBlocksInBabelView = false;
540
+ }
541
+
533
542
  export {
534
543
  groupBlocksOrder,
535
544
  requiredBlocks,
@@ -2,9 +2,12 @@ import App from '@plone/volto/components/theme/App/App';
2
2
  import PreviewImage from '@plone/volto/components/theme/PreviewImage/PreviewImage';
3
3
  import Image from '@plone/volto/components/theme/Image/Image';
4
4
 
5
- // Register components.
6
- export const components = {
7
- PreviewImage: { component: PreviewImage },
8
- App: { component: App },
9
- Image: { component: Image },
10
- };
5
+ export function installDefaultComponents(config) {
6
+ config.components = {
7
+ PreviewImage: { component: PreviewImage },
8
+ App: { component: App },
9
+ Image: { component: Image },
10
+ };
11
+
12
+ return config;
13
+ }
@@ -1,3 +1,4 @@
1
+ import ConfigRegistry from '@plone/volto/registry';
1
2
  import { parse as parseUrl } from 'url';
2
3
  import { defaultWidget, widgetMapping } from './Widgets';
3
4
  import {
@@ -9,14 +10,6 @@ import {
9
10
  } from './Views';
10
11
  import { nonContentRoutes } from './NonContentRoutes';
11
12
  import { nonContentRoutesPublic } from './NonContentRoutesPublic';
12
- import {
13
- groupBlocksOrder,
14
- requiredBlocks,
15
- blocksConfig,
16
- initialBlocks,
17
- initialBlocksFocus,
18
- } from './Blocks';
19
- import { components } from './Components';
20
13
  import { loadables } from './Loadables';
21
14
  import { workflowMapping } from './Workflows';
22
15
  import slots from './slots';
@@ -32,7 +25,8 @@ import {
32
25
 
33
26
  import applyAddonConfiguration, { addonsInfo } from 'load-volto-addons';
34
27
 
35
- import ConfigRegistry from '@plone/volto/registry';
28
+ import { installDefaultComponents } from './Components';
29
+ import { installDefaultBlocks } from './Blocks';
36
30
 
37
31
  import { getSiteAsyncPropExtender } from '@plone/volto/helpers/Site';
38
32
  import { registerValidators } from './validation';
@@ -206,17 +200,10 @@ let config = {
206
200
  errorViews,
207
201
  layoutViewsNamesMapping,
208
202
  },
209
- blocks: {
210
- requiredBlocks,
211
- blocksConfig,
212
- groupBlocksOrder,
213
- initialBlocks,
214
- initialBlocksFocus,
215
- showEditBlocksInBabelView: false,
216
- },
203
+ blocks: {},
217
204
  addonRoutes: [],
218
205
  addonReducers: {},
219
- components,
206
+ components: {},
220
207
  slots: {},
221
208
  utilities: {},
222
209
  };
@@ -261,5 +248,7 @@ Object.entries(slots).forEach(([slotName, components]) => {
261
248
  });
262
249
 
263
250
  registerValidators(ConfigRegistry);
251
+ installDefaultComponents(ConfigRegistry);
252
+ installDefaultBlocks(ConfigRegistry);
264
253
 
265
254
  applyAddonConfiguration(ConfigRegistry);
@@ -30,7 +30,10 @@ function filesMiddlewareFn(req, res, next) {
30
30
  export default function filesMiddleware() {
31
31
  const middleware = express.Router();
32
32
 
33
- middleware.all(['**/@@download/*', '**/@@display-file/*'], filesMiddlewareFn);
33
+ middleware.all(
34
+ ['**/@@download/*', '**/@@display-file/*', '**/ics_view'],
35
+ filesMiddlewareFn,
36
+ );
34
37
  middleware.id = 'filesResourcesProcessor';
35
38
  return middleware;
36
39
  }
@@ -1,14 +1 @@
1
- export namespace components {
2
- namespace PreviewImage {
3
- export { PreviewImage as component };
4
- }
5
- namespace App {
6
- export { App as component };
7
- }
8
- namespace Image {
9
- export { Image as component };
10
- }
11
- }
12
- import PreviewImage_1 from '@plone/volto/components/theme/PreviewImage/PreviewImage';
13
- import App_1 from '@plone/volto/components/theme/App/App';
14
- import Image_1 from '@plone/volto/components/theme/Image/Image';
1
+ export function installDefaultComponents(config: any): any;