From 7c853ee3bb44c7698ba5eaf39e8803bb70404a4e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Fern=C3=A1ndez=20de=20Alba?= Date: Sun, 8 Dec 2024 11:12:06 +0100 Subject: [PATCH 01/11] Fixes ICS download in non-public event content (#6515) --- packages/volto/news/6515.bugfix | 1 + .../src/components/theme/EventDetails/EventDetails.jsx | 4 ++-- .../EventDetails/__snapshots__/EventDetails.test.jsx.snap | 6 +++--- .../theme/View/__snapshots__/EventView.test.jsx.snap | 6 +++--- packages/volto/src/express-middleware/files.js | 5 ++++- 5 files changed, 13 insertions(+), 9 deletions(-) create mode 100644 packages/volto/news/6515.bugfix diff --git a/packages/volto/news/6515.bugfix b/packages/volto/news/6515.bugfix new file mode 100644 index 0000000000..c55ab658d9 --- /dev/null +++ b/packages/volto/news/6515.bugfix @@ -0,0 +1 @@ +Fixes ICS download in non-public event content. @sneridagh diff --git a/packages/volto/src/components/theme/EventDetails/EventDetails.jsx b/packages/volto/src/components/theme/EventDetails/EventDetails.jsx index e1ba3dfb89..bbc7964c77 100644 --- a/packages/volto/src/components/theme/EventDetails/EventDetails.jsx +++ b/packages/volto/src/components/theme/EventDetails/EventDetails.jsx @@ -6,7 +6,7 @@ import { Recurrence, } from '@plone/volto/components/theme/View/EventDatesInfo'; import Icon from '@plone/volto/components/theme/Icon/Icon'; -import { expandToBackendURL } from '@plone/volto/helpers/Url/Url'; +import { flattenToAppURL } from '@plone/volto/helpers/Url/Url'; import calendarSVG from '@plone/volto/icons/calendar.svg'; @@ -147,7 +147,7 @@ const EventDetails = ({ content, display_as = 'aside' }) => { className="ics-download" target="_blank" rel="noreferrer" - href={`${expandToBackendURL(content['@id'])}/ics_view`} + href={`${flattenToAppURL(content['@id'])}/ics_view`} > {intl.formatMessage(messages.downloadEvent)} diff --git a/packages/volto/src/components/theme/EventDetails/__snapshots__/EventDetails.test.jsx.snap b/packages/volto/src/components/theme/EventDetails/__snapshots__/EventDetails.test.jsx.snap index 1d605e546b..a7fad6aa2f 100644 --- a/packages/volto/src/components/theme/EventDetails/__snapshots__/EventDetails.test.jsx.snap +++ b/packages/volto/src/components/theme/EventDetails/__snapshots__/EventDetails.test.jsx.snap @@ -127,7 +127,7 @@ exports[`renders event details component with all props 1`] = ` /> @@ -169,7 +169,7 @@ exports[`renders event details component with only required props 1`] = ` /> @@ -211,7 +211,7 @@ exports[`renders event details component without links to api in the text 1`] = /> diff --git a/packages/volto/src/components/theme/View/__snapshots__/EventView.test.jsx.snap b/packages/volto/src/components/theme/View/__snapshots__/EventView.test.jsx.snap index acf53acafc..269d255c4b 100644 --- a/packages/volto/src/components/theme/View/__snapshots__/EventView.test.jsx.snap +++ b/packages/volto/src/components/theme/View/__snapshots__/EventView.test.jsx.snap @@ -251,7 +251,7 @@ exports[`renders an event view component with all props 1`] = ` /> @@ -357,7 +357,7 @@ exports[`renders an event view component with only required props 1`] = ` /> @@ -458,7 +458,7 @@ exports[`renders an event view component without links to api in the text 1`] = /> diff --git a/packages/volto/src/express-middleware/files.js b/packages/volto/src/express-middleware/files.js index 40f3f5d71a..547165f201 100644 --- a/packages/volto/src/express-middleware/files.js +++ b/packages/volto/src/express-middleware/files.js @@ -30,7 +30,10 @@ function filesMiddlewareFn(req, res, next) { export default function filesMiddleware() { const middleware = express.Router(); - middleware.all(['**/@@download/*', '**/@@display-file/*'], filesMiddlewareFn); + middleware.all( + ['**/@@download/*', '**/@@display-file/*', '**/ics_view'], + filesMiddlewareFn, + ); middleware.id = 'filesResourcesProcessor'; return middleware; } From 48fbd0189b4d338704da9edef5841e9d385a4474 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Fern=C3=A1ndez=20de=20Alba?= Date: Sun, 8 Dec 2024 12:52:20 +0100 Subject: [PATCH 02/11] Fix extension in JSX files (#6520) --- packages/volto-slate/news/6520.internal | 1 + .../volto-slate/src/blocks/Table/{Cell.test.js => Cell.test.jsx} | 0 .../Table/{TableBlockEdit.test.js => TableBlockEdit.test.jsx} | 0 .../Table/{TableBlockView.test.js => TableBlockView.test.jsx} | 0 .../Text/{TextBlockEdit.test.js => TextBlockEdit.test.jsx} | 0 .../editor/ui/{ToolbarButton.test.js => ToolbarButton.test.jsx} | 0 .../{makeInlineElementPlugin.js => makeInlineElementPlugin.jsx} | 0 packages/volto/.eslintrc.core.js | 1 + packages/volto/news/6520.internal | 1 + .../Pluggable/{Pluggable.stories.js => Pluggable.stories.jsx} | 0 .../manage/Pluggable/{Pluggable.test.js => Pluggable.test.jsx} | 0 .../{Pluggable.test.js.snap => Pluggable.test.jsx.snap} | 0 .../{UniversalLink.stories.js => UniversalLink.stories.jsx} | 0 ...tBrowserWidget.stories.js => ObjectBrowserWidget.stories.jsx} | 0 ...{ObjectListWidget.stories.js => ObjectListWidget.stories.jsx} | 0 .../{ObjectListWidget.test.js => ObjectListWidget.test.jsx} | 0 ...yTermsWidget.stories.js => VocabularyTermsWidget.stories.jsx} | 0 ...ectListWidget.test.js.snap => ObjectListWidget.test.jsx.snap} | 0 .../theme/Avatar/{Avatar.stories.js => Avatar.stories.jsx} | 0 ...ontextNavigation.stories.js => ContextNavigation.stories.jsx} | 0 .../{withContentNavigation.js => withContentNavigation.jsx} | 0 .../PreviewImage/{PreviewImage.test.js => PreviewImage.test.jsx} | 0 .../{PreviewImage.test.js.snap => PreviewImage.test.jsx.snap} | 0 .../theme/Title/{Title.stories.js => Title.stories.jsx} | 0 .../theme/Widgets/{ArrayWidget.test.js => ArrayWidget.test.jsx} | 0 .../Widgets/{BooleanWidget.test.js => BooleanWidget.test.jsx} | 0 .../theme/Widgets/{DateWidget.test.js => DateWidget.test.jsx} | 0 .../Widgets/{DatetimeWidget.test.js => DatetimeWidget.test.jsx} | 0 .../{DescriptionWidget.test.js => DescriptionWidget.test.jsx} | 0 .../theme/Widgets/{EmailWidget.test.js => EmailWidget.test.jsx} | 0 .../theme/Widgets/{FileWidget.test.js => FileWidget.test.jsx} | 0 .../theme/Widgets/{ImageWidget.test.js => ImageWidget.test.jsx} | 0 .../Widgets/{PasswordWidget.test.js => PasswordWidget.test.jsx} | 0 .../Widgets/{RelationWidget.test.js => RelationWidget.test.jsx} | 0 .../{RelationsWidget.test.js => RelationsWidget.test.jsx} | 0 .../Widgets/{RichTextWidget.test.js => RichTextWidget.test.jsx} | 0 .../Widgets/{SelectWidget.test.js => SelectWidget.test.jsx} | 0 .../theme/Widgets/{TextWidget.test.js => TextWidget.test.jsx} | 0 .../theme/Widgets/{TitleWidget.test.js => TitleWidget.test.jsx} | 0 .../theme/Widgets/{TokenWidget.test.js => TokenWidget.test.jsx} | 0 .../theme/Widgets/{UrlWidget.test.js => UrlWidget.test.jsx} | 0 .../{ArrayWidget.test.js.snap => ArrayWidget.test.jsx.snap} | 0 .../{BooleanWidget.test.js.snap => BooleanWidget.test.jsx.snap} | 0 .../{DateWidget.test.js.snap => DateWidget.test.jsx.snap} | 0 ...{DatetimeWidget.test.js.snap => DatetimeWidget.test.jsx.snap} | 0 ...iptionWidget.test.js.snap => DescriptionWidget.test.jsx.snap} | 0 .../{EmailWidget.test.js.snap => EmailWidget.test.jsx.snap} | 0 .../{FileWidget.test.js.snap => FileWidget.test.jsx.snap} | 0 .../{ImageWidget.test.js.snap => ImageWidget.test.jsx.snap} | 0 ...{PasswordWidget.test.js.snap => PasswordWidget.test.jsx.snap} | 0 ...{RelationWidget.test.js.snap => RelationWidget.test.jsx.snap} | 0 ...elationsWidget.test.js.snap => RelationsWidget.test.jsx.snap} | 0 ...{RichTextWidget.test.js.snap => RichTextWidget.test.jsx.snap} | 0 .../{SelectWidget.test.js.snap => SelectWidget.test.jsx.snap} | 0 .../{TextWidget.test.js.snap => TextWidget.test.jsx.snap} | 0 .../{TitleWidget.test.js.snap => TitleWidget.test.jsx.snap} | 0 .../{TokenWidget.test.js.snap => TokenWidget.test.jsx.snap} | 0 .../{UrlWidget.test.js.snap => UrlWidget.test.jsx.snap} | 0 .../AsyncConnect/{AsyncConnect.test.js => AsyncConnect.test.jsx} | 0 ...Extensions.test.js.snap => withBlockExtensions.test.jsx.snap} | 0 ...{withBlockExtensions.test.js => withBlockExtensions.test.jsx} | 0 .../volto/src/helpers/Utils/{Utils.test.js => Utils.test.jsx} | 0 62 files changed, 3 insertions(+) create mode 100644 packages/volto-slate/news/6520.internal rename packages/volto-slate/src/blocks/Table/{Cell.test.js => Cell.test.jsx} (100%) rename packages/volto-slate/src/blocks/Table/{TableBlockEdit.test.js => TableBlockEdit.test.jsx} (100%) rename packages/volto-slate/src/blocks/Table/{TableBlockView.test.js => TableBlockView.test.jsx} (100%) rename packages/volto-slate/src/blocks/Text/{TextBlockEdit.test.js => TextBlockEdit.test.jsx} (100%) rename packages/volto-slate/src/editor/ui/{ToolbarButton.test.js => ToolbarButton.test.jsx} (100%) rename packages/volto-slate/src/elementEditor/{makeInlineElementPlugin.js => makeInlineElementPlugin.jsx} (100%) create mode 100644 packages/volto/news/6520.internal rename packages/volto/src/components/manage/Pluggable/{Pluggable.stories.js => Pluggable.stories.jsx} (100%) rename packages/volto/src/components/manage/Pluggable/{Pluggable.test.js => Pluggable.test.jsx} (100%) rename packages/volto/src/components/manage/Pluggable/__snapshots__/{Pluggable.test.js.snap => Pluggable.test.jsx.snap} (100%) rename packages/volto/src/components/manage/UniversalLink/{UniversalLink.stories.js => UniversalLink.stories.jsx} (100%) rename packages/volto/src/components/manage/Widgets/{ObjectBrowserWidget.stories.js => ObjectBrowserWidget.stories.jsx} (100%) rename packages/volto/src/components/manage/Widgets/{ObjectListWidget.stories.js => ObjectListWidget.stories.jsx} (100%) rename packages/volto/src/components/manage/Widgets/{ObjectListWidget.test.js => ObjectListWidget.test.jsx} (100%) rename packages/volto/src/components/manage/Widgets/{VocabularyTermsWidget.stories.js => VocabularyTermsWidget.stories.jsx} (100%) rename packages/volto/src/components/manage/Widgets/__snapshots__/{ObjectListWidget.test.js.snap => ObjectListWidget.test.jsx.snap} (100%) rename packages/volto/src/components/theme/Avatar/{Avatar.stories.js => Avatar.stories.jsx} (100%) rename packages/volto/src/components/theme/Navigation/{ContextNavigation.stories.js => ContextNavigation.stories.jsx} (100%) rename packages/volto/src/components/theme/Navigation/{withContentNavigation.js => withContentNavigation.jsx} (100%) rename packages/volto/src/components/theme/PreviewImage/{PreviewImage.test.js => PreviewImage.test.jsx} (100%) rename packages/volto/src/components/theme/PreviewImage/__snapshots__/{PreviewImage.test.js.snap => PreviewImage.test.jsx.snap} (100%) rename packages/volto/src/components/theme/Title/{Title.stories.js => Title.stories.jsx} (100%) rename packages/volto/src/components/theme/Widgets/{ArrayWidget.test.js => ArrayWidget.test.jsx} (100%) rename packages/volto/src/components/theme/Widgets/{BooleanWidget.test.js => BooleanWidget.test.jsx} (100%) rename packages/volto/src/components/theme/Widgets/{DateWidget.test.js => DateWidget.test.jsx} (100%) rename packages/volto/src/components/theme/Widgets/{DatetimeWidget.test.js => DatetimeWidget.test.jsx} (100%) rename packages/volto/src/components/theme/Widgets/{DescriptionWidget.test.js => DescriptionWidget.test.jsx} (100%) rename packages/volto/src/components/theme/Widgets/{EmailWidget.test.js => EmailWidget.test.jsx} (100%) rename packages/volto/src/components/theme/Widgets/{FileWidget.test.js => FileWidget.test.jsx} (100%) rename packages/volto/src/components/theme/Widgets/{ImageWidget.test.js => ImageWidget.test.jsx} (100%) rename packages/volto/src/components/theme/Widgets/{PasswordWidget.test.js => PasswordWidget.test.jsx} (100%) rename packages/volto/src/components/theme/Widgets/{RelationWidget.test.js => RelationWidget.test.jsx} (100%) rename packages/volto/src/components/theme/Widgets/{RelationsWidget.test.js => RelationsWidget.test.jsx} (100%) rename packages/volto/src/components/theme/Widgets/{RichTextWidget.test.js => RichTextWidget.test.jsx} (100%) rename packages/volto/src/components/theme/Widgets/{SelectWidget.test.js => SelectWidget.test.jsx} (100%) rename packages/volto/src/components/theme/Widgets/{TextWidget.test.js => TextWidget.test.jsx} (100%) rename packages/volto/src/components/theme/Widgets/{TitleWidget.test.js => TitleWidget.test.jsx} (100%) rename packages/volto/src/components/theme/Widgets/{TokenWidget.test.js => TokenWidget.test.jsx} (100%) rename packages/volto/src/components/theme/Widgets/{UrlWidget.test.js => UrlWidget.test.jsx} (100%) rename packages/volto/src/components/theme/Widgets/__snapshots__/{ArrayWidget.test.js.snap => ArrayWidget.test.jsx.snap} (100%) rename packages/volto/src/components/theme/Widgets/__snapshots__/{BooleanWidget.test.js.snap => BooleanWidget.test.jsx.snap} (100%) rename packages/volto/src/components/theme/Widgets/__snapshots__/{DateWidget.test.js.snap => DateWidget.test.jsx.snap} (100%) rename packages/volto/src/components/theme/Widgets/__snapshots__/{DatetimeWidget.test.js.snap => DatetimeWidget.test.jsx.snap} (100%) rename packages/volto/src/components/theme/Widgets/__snapshots__/{DescriptionWidget.test.js.snap => DescriptionWidget.test.jsx.snap} (100%) rename packages/volto/src/components/theme/Widgets/__snapshots__/{EmailWidget.test.js.snap => EmailWidget.test.jsx.snap} (100%) rename packages/volto/src/components/theme/Widgets/__snapshots__/{FileWidget.test.js.snap => FileWidget.test.jsx.snap} (100%) rename packages/volto/src/components/theme/Widgets/__snapshots__/{ImageWidget.test.js.snap => ImageWidget.test.jsx.snap} (100%) rename packages/volto/src/components/theme/Widgets/__snapshots__/{PasswordWidget.test.js.snap => PasswordWidget.test.jsx.snap} (100%) rename packages/volto/src/components/theme/Widgets/__snapshots__/{RelationWidget.test.js.snap => RelationWidget.test.jsx.snap} (100%) rename packages/volto/src/components/theme/Widgets/__snapshots__/{RelationsWidget.test.js.snap => RelationsWidget.test.jsx.snap} (100%) rename packages/volto/src/components/theme/Widgets/__snapshots__/{RichTextWidget.test.js.snap => RichTextWidget.test.jsx.snap} (100%) rename packages/volto/src/components/theme/Widgets/__snapshots__/{SelectWidget.test.js.snap => SelectWidget.test.jsx.snap} (100%) rename packages/volto/src/components/theme/Widgets/__snapshots__/{TextWidget.test.js.snap => TextWidget.test.jsx.snap} (100%) rename packages/volto/src/components/theme/Widgets/__snapshots__/{TitleWidget.test.js.snap => TitleWidget.test.jsx.snap} (100%) rename packages/volto/src/components/theme/Widgets/__snapshots__/{TokenWidget.test.js.snap => TokenWidget.test.jsx.snap} (100%) rename packages/volto/src/components/theme/Widgets/__snapshots__/{UrlWidget.test.js.snap => UrlWidget.test.jsx.snap} (100%) rename packages/volto/src/helpers/AsyncConnect/{AsyncConnect.test.js => AsyncConnect.test.jsx} (100%) rename packages/volto/src/helpers/Extensions/__snapshots__/{withBlockExtensions.test.js.snap => withBlockExtensions.test.jsx.snap} (100%) rename packages/volto/src/helpers/Extensions/{withBlockExtensions.test.js => withBlockExtensions.test.jsx} (100%) rename packages/volto/src/helpers/Utils/{Utils.test.js => Utils.test.jsx} (100%) diff --git a/packages/volto-slate/news/6520.internal b/packages/volto-slate/news/6520.internal new file mode 100644 index 0000000000..611bdb0abd --- /dev/null +++ b/packages/volto-slate/news/6520.internal @@ -0,0 +1 @@ +Fix extension in files containing JSX. @sneridagh diff --git a/packages/volto-slate/src/blocks/Table/Cell.test.js b/packages/volto-slate/src/blocks/Table/Cell.test.jsx similarity index 100% rename from packages/volto-slate/src/blocks/Table/Cell.test.js rename to packages/volto-slate/src/blocks/Table/Cell.test.jsx diff --git a/packages/volto-slate/src/blocks/Table/TableBlockEdit.test.js b/packages/volto-slate/src/blocks/Table/TableBlockEdit.test.jsx similarity index 100% rename from packages/volto-slate/src/blocks/Table/TableBlockEdit.test.js rename to packages/volto-slate/src/blocks/Table/TableBlockEdit.test.jsx diff --git a/packages/volto-slate/src/blocks/Table/TableBlockView.test.js b/packages/volto-slate/src/blocks/Table/TableBlockView.test.jsx similarity index 100% rename from packages/volto-slate/src/blocks/Table/TableBlockView.test.js rename to packages/volto-slate/src/blocks/Table/TableBlockView.test.jsx diff --git a/packages/volto-slate/src/blocks/Text/TextBlockEdit.test.js b/packages/volto-slate/src/blocks/Text/TextBlockEdit.test.jsx similarity index 100% rename from packages/volto-slate/src/blocks/Text/TextBlockEdit.test.js rename to packages/volto-slate/src/blocks/Text/TextBlockEdit.test.jsx diff --git a/packages/volto-slate/src/editor/ui/ToolbarButton.test.js b/packages/volto-slate/src/editor/ui/ToolbarButton.test.jsx similarity index 100% rename from packages/volto-slate/src/editor/ui/ToolbarButton.test.js rename to packages/volto-slate/src/editor/ui/ToolbarButton.test.jsx diff --git a/packages/volto-slate/src/elementEditor/makeInlineElementPlugin.js b/packages/volto-slate/src/elementEditor/makeInlineElementPlugin.jsx similarity index 100% rename from packages/volto-slate/src/elementEditor/makeInlineElementPlugin.js rename to packages/volto-slate/src/elementEditor/makeInlineElementPlugin.jsx diff --git a/packages/volto/.eslintrc.core.js b/packages/volto/.eslintrc.core.js index 41cf953afe..a6b04e24c1 100644 --- a/packages/volto/.eslintrc.core.js +++ b/packages/volto/.eslintrc.core.js @@ -11,6 +11,7 @@ if (process.env.VOLTOCONFIG) { rules = null; } else { rules = { + 'react/jsx-filename-extension': ['warn', { extensions: ['.tsx', '.jsx'] }], 'no-restricted-imports': [ 'warn', { diff --git a/packages/volto/news/6520.internal b/packages/volto/news/6520.internal new file mode 100644 index 0000000000..611bdb0abd --- /dev/null +++ b/packages/volto/news/6520.internal @@ -0,0 +1 @@ +Fix extension in files containing JSX. @sneridagh diff --git a/packages/volto/src/components/manage/Pluggable/Pluggable.stories.js b/packages/volto/src/components/manage/Pluggable/Pluggable.stories.jsx similarity index 100% rename from packages/volto/src/components/manage/Pluggable/Pluggable.stories.js rename to packages/volto/src/components/manage/Pluggable/Pluggable.stories.jsx diff --git a/packages/volto/src/components/manage/Pluggable/Pluggable.test.js b/packages/volto/src/components/manage/Pluggable/Pluggable.test.jsx similarity index 100% rename from packages/volto/src/components/manage/Pluggable/Pluggable.test.js rename to packages/volto/src/components/manage/Pluggable/Pluggable.test.jsx diff --git a/packages/volto/src/components/manage/Pluggable/__snapshots__/Pluggable.test.js.snap b/packages/volto/src/components/manage/Pluggable/__snapshots__/Pluggable.test.jsx.snap similarity index 100% rename from packages/volto/src/components/manage/Pluggable/__snapshots__/Pluggable.test.js.snap rename to packages/volto/src/components/manage/Pluggable/__snapshots__/Pluggable.test.jsx.snap diff --git a/packages/volto/src/components/manage/UniversalLink/UniversalLink.stories.js b/packages/volto/src/components/manage/UniversalLink/UniversalLink.stories.jsx similarity index 100% rename from packages/volto/src/components/manage/UniversalLink/UniversalLink.stories.js rename to packages/volto/src/components/manage/UniversalLink/UniversalLink.stories.jsx diff --git a/packages/volto/src/components/manage/Widgets/ObjectBrowserWidget.stories.js b/packages/volto/src/components/manage/Widgets/ObjectBrowserWidget.stories.jsx similarity index 100% rename from packages/volto/src/components/manage/Widgets/ObjectBrowserWidget.stories.js rename to packages/volto/src/components/manage/Widgets/ObjectBrowserWidget.stories.jsx diff --git a/packages/volto/src/components/manage/Widgets/ObjectListWidget.stories.js b/packages/volto/src/components/manage/Widgets/ObjectListWidget.stories.jsx similarity index 100% rename from packages/volto/src/components/manage/Widgets/ObjectListWidget.stories.js rename to packages/volto/src/components/manage/Widgets/ObjectListWidget.stories.jsx diff --git a/packages/volto/src/components/manage/Widgets/ObjectListWidget.test.js b/packages/volto/src/components/manage/Widgets/ObjectListWidget.test.jsx similarity index 100% rename from packages/volto/src/components/manage/Widgets/ObjectListWidget.test.js rename to packages/volto/src/components/manage/Widgets/ObjectListWidget.test.jsx diff --git a/packages/volto/src/components/manage/Widgets/VocabularyTermsWidget.stories.js b/packages/volto/src/components/manage/Widgets/VocabularyTermsWidget.stories.jsx similarity index 100% rename from packages/volto/src/components/manage/Widgets/VocabularyTermsWidget.stories.js rename to packages/volto/src/components/manage/Widgets/VocabularyTermsWidget.stories.jsx diff --git a/packages/volto/src/components/manage/Widgets/__snapshots__/ObjectListWidget.test.js.snap b/packages/volto/src/components/manage/Widgets/__snapshots__/ObjectListWidget.test.jsx.snap similarity index 100% rename from packages/volto/src/components/manage/Widgets/__snapshots__/ObjectListWidget.test.js.snap rename to packages/volto/src/components/manage/Widgets/__snapshots__/ObjectListWidget.test.jsx.snap diff --git a/packages/volto/src/components/theme/Avatar/Avatar.stories.js b/packages/volto/src/components/theme/Avatar/Avatar.stories.jsx similarity index 100% rename from packages/volto/src/components/theme/Avatar/Avatar.stories.js rename to packages/volto/src/components/theme/Avatar/Avatar.stories.jsx diff --git a/packages/volto/src/components/theme/Navigation/ContextNavigation.stories.js b/packages/volto/src/components/theme/Navigation/ContextNavigation.stories.jsx similarity index 100% rename from packages/volto/src/components/theme/Navigation/ContextNavigation.stories.js rename to packages/volto/src/components/theme/Navigation/ContextNavigation.stories.jsx diff --git a/packages/volto/src/components/theme/Navigation/withContentNavigation.js b/packages/volto/src/components/theme/Navigation/withContentNavigation.jsx similarity index 100% rename from packages/volto/src/components/theme/Navigation/withContentNavigation.js rename to packages/volto/src/components/theme/Navigation/withContentNavigation.jsx diff --git a/packages/volto/src/components/theme/PreviewImage/PreviewImage.test.js b/packages/volto/src/components/theme/PreviewImage/PreviewImage.test.jsx similarity index 100% rename from packages/volto/src/components/theme/PreviewImage/PreviewImage.test.js rename to packages/volto/src/components/theme/PreviewImage/PreviewImage.test.jsx diff --git a/packages/volto/src/components/theme/PreviewImage/__snapshots__/PreviewImage.test.js.snap b/packages/volto/src/components/theme/PreviewImage/__snapshots__/PreviewImage.test.jsx.snap similarity index 100% rename from packages/volto/src/components/theme/PreviewImage/__snapshots__/PreviewImage.test.js.snap rename to packages/volto/src/components/theme/PreviewImage/__snapshots__/PreviewImage.test.jsx.snap diff --git a/packages/volto/src/components/theme/Title/Title.stories.js b/packages/volto/src/components/theme/Title/Title.stories.jsx similarity index 100% rename from packages/volto/src/components/theme/Title/Title.stories.js rename to packages/volto/src/components/theme/Title/Title.stories.jsx diff --git a/packages/volto/src/components/theme/Widgets/ArrayWidget.test.js b/packages/volto/src/components/theme/Widgets/ArrayWidget.test.jsx similarity index 100% rename from packages/volto/src/components/theme/Widgets/ArrayWidget.test.js rename to packages/volto/src/components/theme/Widgets/ArrayWidget.test.jsx diff --git a/packages/volto/src/components/theme/Widgets/BooleanWidget.test.js b/packages/volto/src/components/theme/Widgets/BooleanWidget.test.jsx similarity index 100% rename from packages/volto/src/components/theme/Widgets/BooleanWidget.test.js rename to packages/volto/src/components/theme/Widgets/BooleanWidget.test.jsx diff --git a/packages/volto/src/components/theme/Widgets/DateWidget.test.js b/packages/volto/src/components/theme/Widgets/DateWidget.test.jsx similarity index 100% rename from packages/volto/src/components/theme/Widgets/DateWidget.test.js rename to packages/volto/src/components/theme/Widgets/DateWidget.test.jsx diff --git a/packages/volto/src/components/theme/Widgets/DatetimeWidget.test.js b/packages/volto/src/components/theme/Widgets/DatetimeWidget.test.jsx similarity index 100% rename from packages/volto/src/components/theme/Widgets/DatetimeWidget.test.js rename to packages/volto/src/components/theme/Widgets/DatetimeWidget.test.jsx diff --git a/packages/volto/src/components/theme/Widgets/DescriptionWidget.test.js b/packages/volto/src/components/theme/Widgets/DescriptionWidget.test.jsx similarity index 100% rename from packages/volto/src/components/theme/Widgets/DescriptionWidget.test.js rename to packages/volto/src/components/theme/Widgets/DescriptionWidget.test.jsx diff --git a/packages/volto/src/components/theme/Widgets/EmailWidget.test.js b/packages/volto/src/components/theme/Widgets/EmailWidget.test.jsx similarity index 100% rename from packages/volto/src/components/theme/Widgets/EmailWidget.test.js rename to packages/volto/src/components/theme/Widgets/EmailWidget.test.jsx diff --git a/packages/volto/src/components/theme/Widgets/FileWidget.test.js b/packages/volto/src/components/theme/Widgets/FileWidget.test.jsx similarity index 100% rename from packages/volto/src/components/theme/Widgets/FileWidget.test.js rename to packages/volto/src/components/theme/Widgets/FileWidget.test.jsx diff --git a/packages/volto/src/components/theme/Widgets/ImageWidget.test.js b/packages/volto/src/components/theme/Widgets/ImageWidget.test.jsx similarity index 100% rename from packages/volto/src/components/theme/Widgets/ImageWidget.test.js rename to packages/volto/src/components/theme/Widgets/ImageWidget.test.jsx diff --git a/packages/volto/src/components/theme/Widgets/PasswordWidget.test.js b/packages/volto/src/components/theme/Widgets/PasswordWidget.test.jsx similarity index 100% rename from packages/volto/src/components/theme/Widgets/PasswordWidget.test.js rename to packages/volto/src/components/theme/Widgets/PasswordWidget.test.jsx diff --git a/packages/volto/src/components/theme/Widgets/RelationWidget.test.js b/packages/volto/src/components/theme/Widgets/RelationWidget.test.jsx similarity index 100% rename from packages/volto/src/components/theme/Widgets/RelationWidget.test.js rename to packages/volto/src/components/theme/Widgets/RelationWidget.test.jsx diff --git a/packages/volto/src/components/theme/Widgets/RelationsWidget.test.js b/packages/volto/src/components/theme/Widgets/RelationsWidget.test.jsx similarity index 100% rename from packages/volto/src/components/theme/Widgets/RelationsWidget.test.js rename to packages/volto/src/components/theme/Widgets/RelationsWidget.test.jsx diff --git a/packages/volto/src/components/theme/Widgets/RichTextWidget.test.js b/packages/volto/src/components/theme/Widgets/RichTextWidget.test.jsx similarity index 100% rename from packages/volto/src/components/theme/Widgets/RichTextWidget.test.js rename to packages/volto/src/components/theme/Widgets/RichTextWidget.test.jsx diff --git a/packages/volto/src/components/theme/Widgets/SelectWidget.test.js b/packages/volto/src/components/theme/Widgets/SelectWidget.test.jsx similarity index 100% rename from packages/volto/src/components/theme/Widgets/SelectWidget.test.js rename to packages/volto/src/components/theme/Widgets/SelectWidget.test.jsx diff --git a/packages/volto/src/components/theme/Widgets/TextWidget.test.js b/packages/volto/src/components/theme/Widgets/TextWidget.test.jsx similarity index 100% rename from packages/volto/src/components/theme/Widgets/TextWidget.test.js rename to packages/volto/src/components/theme/Widgets/TextWidget.test.jsx diff --git a/packages/volto/src/components/theme/Widgets/TitleWidget.test.js b/packages/volto/src/components/theme/Widgets/TitleWidget.test.jsx similarity index 100% rename from packages/volto/src/components/theme/Widgets/TitleWidget.test.js rename to packages/volto/src/components/theme/Widgets/TitleWidget.test.jsx diff --git a/packages/volto/src/components/theme/Widgets/TokenWidget.test.js b/packages/volto/src/components/theme/Widgets/TokenWidget.test.jsx similarity index 100% rename from packages/volto/src/components/theme/Widgets/TokenWidget.test.js rename to packages/volto/src/components/theme/Widgets/TokenWidget.test.jsx diff --git a/packages/volto/src/components/theme/Widgets/UrlWidget.test.js b/packages/volto/src/components/theme/Widgets/UrlWidget.test.jsx similarity index 100% rename from packages/volto/src/components/theme/Widgets/UrlWidget.test.js rename to packages/volto/src/components/theme/Widgets/UrlWidget.test.jsx diff --git a/packages/volto/src/components/theme/Widgets/__snapshots__/ArrayWidget.test.js.snap b/packages/volto/src/components/theme/Widgets/__snapshots__/ArrayWidget.test.jsx.snap similarity index 100% rename from packages/volto/src/components/theme/Widgets/__snapshots__/ArrayWidget.test.js.snap rename to packages/volto/src/components/theme/Widgets/__snapshots__/ArrayWidget.test.jsx.snap diff --git a/packages/volto/src/components/theme/Widgets/__snapshots__/BooleanWidget.test.js.snap b/packages/volto/src/components/theme/Widgets/__snapshots__/BooleanWidget.test.jsx.snap similarity index 100% rename from packages/volto/src/components/theme/Widgets/__snapshots__/BooleanWidget.test.js.snap rename to packages/volto/src/components/theme/Widgets/__snapshots__/BooleanWidget.test.jsx.snap diff --git a/packages/volto/src/components/theme/Widgets/__snapshots__/DateWidget.test.js.snap b/packages/volto/src/components/theme/Widgets/__snapshots__/DateWidget.test.jsx.snap similarity index 100% rename from packages/volto/src/components/theme/Widgets/__snapshots__/DateWidget.test.js.snap rename to packages/volto/src/components/theme/Widgets/__snapshots__/DateWidget.test.jsx.snap diff --git a/packages/volto/src/components/theme/Widgets/__snapshots__/DatetimeWidget.test.js.snap b/packages/volto/src/components/theme/Widgets/__snapshots__/DatetimeWidget.test.jsx.snap similarity index 100% rename from packages/volto/src/components/theme/Widgets/__snapshots__/DatetimeWidget.test.js.snap rename to packages/volto/src/components/theme/Widgets/__snapshots__/DatetimeWidget.test.jsx.snap diff --git a/packages/volto/src/components/theme/Widgets/__snapshots__/DescriptionWidget.test.js.snap b/packages/volto/src/components/theme/Widgets/__snapshots__/DescriptionWidget.test.jsx.snap similarity index 100% rename from packages/volto/src/components/theme/Widgets/__snapshots__/DescriptionWidget.test.js.snap rename to packages/volto/src/components/theme/Widgets/__snapshots__/DescriptionWidget.test.jsx.snap diff --git a/packages/volto/src/components/theme/Widgets/__snapshots__/EmailWidget.test.js.snap b/packages/volto/src/components/theme/Widgets/__snapshots__/EmailWidget.test.jsx.snap similarity index 100% rename from packages/volto/src/components/theme/Widgets/__snapshots__/EmailWidget.test.js.snap rename to packages/volto/src/components/theme/Widgets/__snapshots__/EmailWidget.test.jsx.snap diff --git a/packages/volto/src/components/theme/Widgets/__snapshots__/FileWidget.test.js.snap b/packages/volto/src/components/theme/Widgets/__snapshots__/FileWidget.test.jsx.snap similarity index 100% rename from packages/volto/src/components/theme/Widgets/__snapshots__/FileWidget.test.js.snap rename to packages/volto/src/components/theme/Widgets/__snapshots__/FileWidget.test.jsx.snap diff --git a/packages/volto/src/components/theme/Widgets/__snapshots__/ImageWidget.test.js.snap b/packages/volto/src/components/theme/Widgets/__snapshots__/ImageWidget.test.jsx.snap similarity index 100% rename from packages/volto/src/components/theme/Widgets/__snapshots__/ImageWidget.test.js.snap rename to packages/volto/src/components/theme/Widgets/__snapshots__/ImageWidget.test.jsx.snap diff --git a/packages/volto/src/components/theme/Widgets/__snapshots__/PasswordWidget.test.js.snap b/packages/volto/src/components/theme/Widgets/__snapshots__/PasswordWidget.test.jsx.snap similarity index 100% rename from packages/volto/src/components/theme/Widgets/__snapshots__/PasswordWidget.test.js.snap rename to packages/volto/src/components/theme/Widgets/__snapshots__/PasswordWidget.test.jsx.snap diff --git a/packages/volto/src/components/theme/Widgets/__snapshots__/RelationWidget.test.js.snap b/packages/volto/src/components/theme/Widgets/__snapshots__/RelationWidget.test.jsx.snap similarity index 100% rename from packages/volto/src/components/theme/Widgets/__snapshots__/RelationWidget.test.js.snap rename to packages/volto/src/components/theme/Widgets/__snapshots__/RelationWidget.test.jsx.snap diff --git a/packages/volto/src/components/theme/Widgets/__snapshots__/RelationsWidget.test.js.snap b/packages/volto/src/components/theme/Widgets/__snapshots__/RelationsWidget.test.jsx.snap similarity index 100% rename from packages/volto/src/components/theme/Widgets/__snapshots__/RelationsWidget.test.js.snap rename to packages/volto/src/components/theme/Widgets/__snapshots__/RelationsWidget.test.jsx.snap diff --git a/packages/volto/src/components/theme/Widgets/__snapshots__/RichTextWidget.test.js.snap b/packages/volto/src/components/theme/Widgets/__snapshots__/RichTextWidget.test.jsx.snap similarity index 100% rename from packages/volto/src/components/theme/Widgets/__snapshots__/RichTextWidget.test.js.snap rename to packages/volto/src/components/theme/Widgets/__snapshots__/RichTextWidget.test.jsx.snap diff --git a/packages/volto/src/components/theme/Widgets/__snapshots__/SelectWidget.test.js.snap b/packages/volto/src/components/theme/Widgets/__snapshots__/SelectWidget.test.jsx.snap similarity index 100% rename from packages/volto/src/components/theme/Widgets/__snapshots__/SelectWidget.test.js.snap rename to packages/volto/src/components/theme/Widgets/__snapshots__/SelectWidget.test.jsx.snap diff --git a/packages/volto/src/components/theme/Widgets/__snapshots__/TextWidget.test.js.snap b/packages/volto/src/components/theme/Widgets/__snapshots__/TextWidget.test.jsx.snap similarity index 100% rename from packages/volto/src/components/theme/Widgets/__snapshots__/TextWidget.test.js.snap rename to packages/volto/src/components/theme/Widgets/__snapshots__/TextWidget.test.jsx.snap diff --git a/packages/volto/src/components/theme/Widgets/__snapshots__/TitleWidget.test.js.snap b/packages/volto/src/components/theme/Widgets/__snapshots__/TitleWidget.test.jsx.snap similarity index 100% rename from packages/volto/src/components/theme/Widgets/__snapshots__/TitleWidget.test.js.snap rename to packages/volto/src/components/theme/Widgets/__snapshots__/TitleWidget.test.jsx.snap diff --git a/packages/volto/src/components/theme/Widgets/__snapshots__/TokenWidget.test.js.snap b/packages/volto/src/components/theme/Widgets/__snapshots__/TokenWidget.test.jsx.snap similarity index 100% rename from packages/volto/src/components/theme/Widgets/__snapshots__/TokenWidget.test.js.snap rename to packages/volto/src/components/theme/Widgets/__snapshots__/TokenWidget.test.jsx.snap diff --git a/packages/volto/src/components/theme/Widgets/__snapshots__/UrlWidget.test.js.snap b/packages/volto/src/components/theme/Widgets/__snapshots__/UrlWidget.test.jsx.snap similarity index 100% rename from packages/volto/src/components/theme/Widgets/__snapshots__/UrlWidget.test.js.snap rename to packages/volto/src/components/theme/Widgets/__snapshots__/UrlWidget.test.jsx.snap diff --git a/packages/volto/src/helpers/AsyncConnect/AsyncConnect.test.js b/packages/volto/src/helpers/AsyncConnect/AsyncConnect.test.jsx similarity index 100% rename from packages/volto/src/helpers/AsyncConnect/AsyncConnect.test.js rename to packages/volto/src/helpers/AsyncConnect/AsyncConnect.test.jsx diff --git a/packages/volto/src/helpers/Extensions/__snapshots__/withBlockExtensions.test.js.snap b/packages/volto/src/helpers/Extensions/__snapshots__/withBlockExtensions.test.jsx.snap similarity index 100% rename from packages/volto/src/helpers/Extensions/__snapshots__/withBlockExtensions.test.js.snap rename to packages/volto/src/helpers/Extensions/__snapshots__/withBlockExtensions.test.jsx.snap diff --git a/packages/volto/src/helpers/Extensions/withBlockExtensions.test.js b/packages/volto/src/helpers/Extensions/withBlockExtensions.test.jsx similarity index 100% rename from packages/volto/src/helpers/Extensions/withBlockExtensions.test.js rename to packages/volto/src/helpers/Extensions/withBlockExtensions.test.jsx diff --git a/packages/volto/src/helpers/Utils/Utils.test.js b/packages/volto/src/helpers/Utils/Utils.test.jsx similarity index 100% rename from packages/volto/src/helpers/Utils/Utils.test.js rename to packages/volto/src/helpers/Utils/Utils.test.jsx From cfea4d988d25e41779b0742606bf43fa43d2bbee Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Fern=C3=A1ndez=20de=20Alba?= Date: Sun, 8 Dec 2024 16:35:31 +0100 Subject: [PATCH 03/11] Update @plone/* packages info (#6521) Co-authored-by: Steve Piercy --- PACKAGES.md | 45 +++++++++++++++++++++++++++++++++------------ 1 file changed, 33 insertions(+), 12 deletions(-) diff --git a/PACKAGES.md b/PACKAGES.md index 5e12ae1955..5f72ef477c 100644 --- a/PACKAGES.md +++ b/PACKAGES.md @@ -2,17 +2,37 @@ This document describes the packages that come with Volto, the default frontend for Plone 6. +These packages are part of Plone's API-first story. +Most of them are experimental and are marked in their respective `README` files. +Plone 6.1.x (Volto 18) depends on: +- `@plone/registry` +- `@plone/scripts` +- `@plone/volto-slate` + +and as a development dependency: +- `@plone/types` + +Plone 6.0.x (Volto 17 and below) does not use any of them. + +These packages are expected to be used and become part of Plone 7. +Some of them might become part of Plone 6.1.x minor versions. + +The packages are divided into three categories or types: + +- core +- utilities +- add-ons + ## `@plone/types` Plone types is a special development package. It contains the Plone typings for TypeScript. -It's considered a core package, and it's the only package that the other core packages can rely on as -a `devDependency` in your project configuration. +It's considered a core package, and it's the only package that the other core packages can rely on as a `devDependency` in your project configuration. This package contains `.d.ts` typing definitions, curated by hand. -Due to the nature of this package, it does not need bundling. -It's published "as is", so you can import the type definitions from anywhere in your code. +Due to the nature of this package, it does not need to be built nor bundled. +It is published "as is", so you can import the type definitions from anywhere in your code. ## Core packages @@ -29,12 +49,10 @@ They must be published and bundled in a traditional (transpiled) way. The bundle of these packages must work on both CommonJS and ECMAScript Module (ESM) environments. -## Utility packages +## Utilities packages -- `@plone/drivers` -- `@plone/helpers` - `@plone/providers` -- `@plone/rsc` +- `@plone/helpers` ### Rules @@ -44,19 +62,22 @@ They must be published in the traditional way, as a bundle. This bundle must work on both CommonJS and ESM environments. -## Feature packages +## Add-on packages - `@plone/blocks` -- `@plone/contents` - `@plone/slots` +- `@plone/theming` +- `@plone/contents` ### Rules -Feature packages, or add-on packages, can depend on any other package. +Add-on or feature packages, can depend on any other package. You must distribute them as source code, and not transpile them. They must provide a default configuration registry loader as the default main entry point export. -They must be loadable as any other add-on. +Unlike Volto add-ons, do *NOT* place the code in the `src` folder. +If you do not transpile the package, the direct resolution must work out of the box, where both the bundler and TypeScript resolution are direct. +They must be loadable as any other add-on, and contain an add-on registry compatible `install`-able default export. ## Development utility packages From 64213359f3a39a759fb168663b3ee92e1b1b6e6c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Fern=C3=A1ndez=20de=20Alba?= Date: Mon, 9 Dec 2024 09:27:41 +0100 Subject: [PATCH 04/11] Fixed circular import error in dev with HMR in `App` component when imported in the main default config (#6524) --- packages/volto/news/6524.bugfix | 1 + packages/volto/src/config/Components.jsx | 15 +++++++++------ packages/volto/src/config/index.js | 5 +++-- 3 files changed, 13 insertions(+), 8 deletions(-) create mode 100644 packages/volto/news/6524.bugfix diff --git a/packages/volto/news/6524.bugfix b/packages/volto/news/6524.bugfix new file mode 100644 index 0000000000..36aaa29264 --- /dev/null +++ b/packages/volto/news/6524.bugfix @@ -0,0 +1 @@ +Fixed circular import error in dev with HMR in `App` component when imported in the main default config. @sneridagh diff --git a/packages/volto/src/config/Components.jsx b/packages/volto/src/config/Components.jsx index bd6fea6f85..420a175b43 100644 --- a/packages/volto/src/config/Components.jsx +++ b/packages/volto/src/config/Components.jsx @@ -2,9 +2,12 @@ import App from '@plone/volto/components/theme/App/App'; import PreviewImage from '@plone/volto/components/theme/PreviewImage/PreviewImage'; import Image from '@plone/volto/components/theme/Image/Image'; -// Register components. -export const components = { - PreviewImage: { component: PreviewImage }, - App: { component: App }, - Image: { component: Image }, -}; +export function installDefaultComponents(config) { + config.components = { + PreviewImage: { component: PreviewImage }, + App: { component: App }, + Image: { component: Image }, + }; + + return config; +} diff --git a/packages/volto/src/config/index.js b/packages/volto/src/config/index.js index 348b21319d..c689a84b73 100644 --- a/packages/volto/src/config/index.js +++ b/packages/volto/src/config/index.js @@ -16,7 +16,6 @@ import { initialBlocks, initialBlocksFocus, } from './Blocks'; -import { components } from './Components'; import { loadables } from './Loadables'; import { workflowMapping } from './Workflows'; import slots from './slots'; @@ -33,6 +32,7 @@ import { import applyAddonConfiguration, { addonsInfo } from 'load-volto-addons'; import ConfigRegistry from '@plone/volto/registry'; +import { installDefaultComponents } from './Components'; import { getSiteAsyncPropExtender } from '@plone/volto/helpers/Site'; import { registerValidators } from './validation'; @@ -216,7 +216,7 @@ let config = { }, addonRoutes: [], addonReducers: {}, - components, + components: {}, slots: {}, utilities: {}, }; @@ -261,5 +261,6 @@ Object.entries(slots).forEach(([slotName, components]) => { }); registerValidators(ConfigRegistry); +installDefaultComponents(ConfigRegistry); applyAddonConfiguration(ConfigRegistry); From d5f0c5114534554c80027a69f9b671753dfe1569 Mon Sep 17 00:00:00 2001 From: Victor Fernandez de Alba Date: Mon, 9 Dec 2024 09:52:48 +0100 Subject: [PATCH 05/11] Release @plone/slate 18.0.3 --- packages/volto-slate/CHANGELOG.md | 6 ++++++ packages/volto-slate/news/6520.internal | 1 - packages/volto-slate/package.json | 2 +- 3 files changed, 7 insertions(+), 2 deletions(-) delete mode 100644 packages/volto-slate/news/6520.internal diff --git a/packages/volto-slate/CHANGELOG.md b/packages/volto-slate/CHANGELOG.md index 31bb6fbdee..1693cb8f47 100644 --- a/packages/volto-slate/CHANGELOG.md +++ b/packages/volto-slate/CHANGELOG.md @@ -8,6 +8,12 @@ +## 18.0.3 (2024-12-09) + +### Internal + +- Fix extension in files containing JSX. @sneridagh [#6520](https://github.com/plone/volto/issues/6520) + ## 18.0.2 (2024-12-08) ### Internal diff --git a/packages/volto-slate/news/6520.internal b/packages/volto-slate/news/6520.internal deleted file mode 100644 index 611bdb0abd..0000000000 --- a/packages/volto-slate/news/6520.internal +++ /dev/null @@ -1 +0,0 @@ -Fix extension in files containing JSX. @sneridagh diff --git a/packages/volto-slate/package.json b/packages/volto-slate/package.json index 7e5e1103ca..c0e41e043d 100644 --- a/packages/volto-slate/package.json +++ b/packages/volto-slate/package.json @@ -1,6 +1,6 @@ { "name": "@plone/volto-slate", - "version": "18.0.2", + "version": "18.0.3", "description": "Slate.js integration with Volto", "main": "src/index.js", "author": "European Environment Agency: IDM2 A-Team", From 63843128586f6a56a9ae2ce7872c9eb816e5711f Mon Sep 17 00:00:00 2001 From: Victor Fernandez de Alba Date: Mon, 9 Dec 2024 09:53:41 +0100 Subject: [PATCH 06/11] Release 18.2.1 --- docs/source/release-notes/index.md | 11 +++++++++++ packages/volto/CHANGELOG.md | 11 +++++++++++ packages/volto/news/6515.bugfix | 1 - packages/volto/news/6520.internal | 1 - packages/volto/news/6524.bugfix | 1 - packages/volto/package.json | 2 +- packages/volto/types/config/Components.d.ts | 15 +-------------- 7 files changed, 24 insertions(+), 18 deletions(-) delete mode 100644 packages/volto/news/6515.bugfix delete mode 100644 packages/volto/news/6520.internal delete mode 100644 packages/volto/news/6524.bugfix diff --git a/docs/source/release-notes/index.md b/docs/source/release-notes/index.md index 7faa526e3e..42e7b2f6de 100644 --- a/docs/source/release-notes/index.md +++ b/docs/source/release-notes/index.md @@ -17,6 +17,17 @@ myst: +## 18.2.1 (2024-12-09) + +### Bugfix + +- Fixes ICS download in non-public event content. @sneridagh [#6515](https://github.com/plone/volto/issues/6515) +- 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) + +### Internal + +- Fix extension in files containing JSX. @sneridagh [#6520](https://github.com/plone/volto/issues/6520) + ## 18.2.0 (2024-12-08) ### Internal diff --git a/packages/volto/CHANGELOG.md b/packages/volto/CHANGELOG.md index 7faa526e3e..42e7b2f6de 100644 --- a/packages/volto/CHANGELOG.md +++ b/packages/volto/CHANGELOG.md @@ -17,6 +17,17 @@ myst: +## 18.2.1 (2024-12-09) + +### Bugfix + +- Fixes ICS download in non-public event content. @sneridagh [#6515](https://github.com/plone/volto/issues/6515) +- 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) + +### Internal + +- Fix extension in files containing JSX. @sneridagh [#6520](https://github.com/plone/volto/issues/6520) + ## 18.2.0 (2024-12-08) ### Internal diff --git a/packages/volto/news/6515.bugfix b/packages/volto/news/6515.bugfix deleted file mode 100644 index c55ab658d9..0000000000 --- a/packages/volto/news/6515.bugfix +++ /dev/null @@ -1 +0,0 @@ -Fixes ICS download in non-public event content. @sneridagh diff --git a/packages/volto/news/6520.internal b/packages/volto/news/6520.internal deleted file mode 100644 index 611bdb0abd..0000000000 --- a/packages/volto/news/6520.internal +++ /dev/null @@ -1 +0,0 @@ -Fix extension in files containing JSX. @sneridagh diff --git a/packages/volto/news/6524.bugfix b/packages/volto/news/6524.bugfix deleted file mode 100644 index 36aaa29264..0000000000 --- a/packages/volto/news/6524.bugfix +++ /dev/null @@ -1 +0,0 @@ -Fixed circular import error in dev with HMR in `App` component when imported in the main default config. @sneridagh diff --git a/packages/volto/package.json b/packages/volto/package.json index bb57ff9920..c5d2fe1aec 100644 --- a/packages/volto/package.json +++ b/packages/volto/package.json @@ -9,7 +9,7 @@ } ], "license": "MIT", - "version": "18.2.0", + "version": "18.2.1", "repository": { "type": "git", "url": "git@github.com:plone/volto.git" diff --git a/packages/volto/types/config/Components.d.ts b/packages/volto/types/config/Components.d.ts index 8f3d09ffa1..7a158367a6 100644 --- a/packages/volto/types/config/Components.d.ts +++ b/packages/volto/types/config/Components.d.ts @@ -1,14 +1 @@ -export namespace components { - namespace PreviewImage { - export { PreviewImage as component }; - } - namespace App { - export { App as component }; - } - namespace Image { - export { Image as component }; - } -} -import PreviewImage_1 from '@plone/volto/components/theme/PreviewImage/PreviewImage'; -import App_1 from '@plone/volto/components/theme/App/App'; -import Image_1 from '@plone/volto/components/theme/Image/Image'; +export function installDefaultComponents(config: any): any; From 1cfdda666e70b08833c2919dad8d920b614fa3a1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Fern=C3=A1ndez=20de=20Alba?= Date: Mon, 9 Dec 2024 11:25:07 +0100 Subject: [PATCH 07/11] Fixed circular import error in dev with HMR in core Blocks shadow customizations (#6525) --- packages/volto/news/6525.bugfix | 1 + packages/volto/src/config/Blocks.jsx | 9 +++++++++ packages/volto/src/config/index.js | 20 ++++---------------- 3 files changed, 14 insertions(+), 16 deletions(-) create mode 100644 packages/volto/news/6525.bugfix diff --git a/packages/volto/news/6525.bugfix b/packages/volto/news/6525.bugfix new file mode 100644 index 0000000000..39351c4afc --- /dev/null +++ b/packages/volto/news/6525.bugfix @@ -0,0 +1 @@ +Fixed circular import error in dev with HMR in core Blocks shadow customizations. @sneridagh diff --git a/packages/volto/src/config/Blocks.jsx b/packages/volto/src/config/Blocks.jsx index 573bdce903..0110a6616c 100644 --- a/packages/volto/src/config/Blocks.jsx +++ b/packages/volto/src/config/Blocks.jsx @@ -530,6 +530,15 @@ const requiredBlocks = ['title']; const initialBlocks = {}; const initialBlocksFocus = {}; //{Document:'title'} +export function installDefaultBlocks(config) { + config.blocks.requiredBlocks = requiredBlocks; + config.blocks.blocksConfig = blocksConfig; + config.blocks.groupBlocksOrder = groupBlocksOrder; + config.blocks.initialBlocks = initialBlocks; + config.blocks.initialBlocksFocus = initialBlocksFocus; + config.blocks.showEditBlocksInBabelView = false; +} + export { groupBlocksOrder, requiredBlocks, diff --git a/packages/volto/src/config/index.js b/packages/volto/src/config/index.js index c689a84b73..cf912fbaf0 100644 --- a/packages/volto/src/config/index.js +++ b/packages/volto/src/config/index.js @@ -1,3 +1,4 @@ +import ConfigRegistry from '@plone/volto/registry'; import { parse as parseUrl } from 'url'; import { defaultWidget, widgetMapping } from './Widgets'; import { @@ -9,13 +10,6 @@ import { } from './Views'; import { nonContentRoutes } from './NonContentRoutes'; import { nonContentRoutesPublic } from './NonContentRoutesPublic'; -import { - groupBlocksOrder, - requiredBlocks, - blocksConfig, - initialBlocks, - initialBlocksFocus, -} from './Blocks'; import { loadables } from './Loadables'; import { workflowMapping } from './Workflows'; import slots from './slots'; @@ -31,8 +25,8 @@ import { import applyAddonConfiguration, { addonsInfo } from 'load-volto-addons'; -import ConfigRegistry from '@plone/volto/registry'; import { installDefaultComponents } from './Components'; +import { installDefaultBlocks } from './Blocks'; import { getSiteAsyncPropExtender } from '@plone/volto/helpers/Site'; import { registerValidators } from './validation'; @@ -206,14 +200,7 @@ let config = { errorViews, layoutViewsNamesMapping, }, - blocks: { - requiredBlocks, - blocksConfig, - groupBlocksOrder, - initialBlocks, - initialBlocksFocus, - showEditBlocksInBabelView: false, - }, + blocks: {}, addonRoutes: [], addonReducers: {}, components: {}, @@ -262,5 +249,6 @@ Object.entries(slots).forEach(([slotName, components]) => { registerValidators(ConfigRegistry); installDefaultComponents(ConfigRegistry); +installDefaultBlocks(ConfigRegistry); applyAddonConfiguration(ConfigRegistry); From 6b78429bdba2270f26cb3462bc6f421ccd5fd51e Mon Sep 17 00:00:00 2001 From: Victor Fernandez de Alba Date: Mon, 9 Dec 2024 12:24:14 +0100 Subject: [PATCH 08/11] Release 18.2.2 --- docs/source/release-notes/index.md | 6 ++++++ packages/volto/.release-it.json | 2 +- packages/volto/CHANGELOG.md | 6 ++++++ packages/volto/news/6525.bugfix | 1 - packages/volto/package.json | 2 +- 5 files changed, 14 insertions(+), 3 deletions(-) delete mode 100644 packages/volto/news/6525.bugfix diff --git a/docs/source/release-notes/index.md b/docs/source/release-notes/index.md index 42e7b2f6de..a649b27ca9 100644 --- a/docs/source/release-notes/index.md +++ b/docs/source/release-notes/index.md @@ -17,6 +17,12 @@ myst: +## 18.2.2 (2024-12-09) + +### Bugfix + +- Fixed circular import error in dev with HMR in core Blocks shadow customizations. @sneridagh [#6525](https://github.com/plone/volto/issues/6525) + ## 18.2.1 (2024-12-09) ### Bugfix diff --git a/packages/volto/.release-it.json b/packages/volto/.release-it.json index 0395373591..ecce30528b 100644 --- a/packages/volto/.release-it.json +++ b/packages/volto/.release-it.json @@ -3,7 +3,7 @@ "../scripts/prepublish.js": {} }, "hooks": { - "before:bump": ["pnpm i18n", "pnpm build:types", "git add types"], + "before:bump": ["pnpm i18n"], "after:bump": [ "pipx run towncrier build --draft --yes --version ${version} > .changelog.draft", "pipx run towncrier build --yes --version ${version}", diff --git a/packages/volto/CHANGELOG.md b/packages/volto/CHANGELOG.md index 42e7b2f6de..a649b27ca9 100644 --- a/packages/volto/CHANGELOG.md +++ b/packages/volto/CHANGELOG.md @@ -17,6 +17,12 @@ myst: +## 18.2.2 (2024-12-09) + +### Bugfix + +- Fixed circular import error in dev with HMR in core Blocks shadow customizations. @sneridagh [#6525](https://github.com/plone/volto/issues/6525) + ## 18.2.1 (2024-12-09) ### Bugfix diff --git a/packages/volto/news/6525.bugfix b/packages/volto/news/6525.bugfix deleted file mode 100644 index 39351c4afc..0000000000 --- a/packages/volto/news/6525.bugfix +++ /dev/null @@ -1 +0,0 @@ -Fixed circular import error in dev with HMR in core Blocks shadow customizations. @sneridagh diff --git a/packages/volto/package.json b/packages/volto/package.json index c5d2fe1aec..5743c22e11 100644 --- a/packages/volto/package.json +++ b/packages/volto/package.json @@ -9,7 +9,7 @@ } ], "license": "MIT", - "version": "18.2.1", + "version": "18.2.2", "repository": { "type": "git", "url": "git@github.com:plone/volto.git" From d9e7867052bc2297620c36f74ebb86f9389f7cab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Fern=C3=A1ndez=20de=20Alba?= Date: Mon, 9 Dec 2024 17:37:49 +0100 Subject: [PATCH 09/11] Fixed circular import error in dev with HMR in core Views and Widgets shadow customizations (#6526) --- packages/volto/news/6526.bugfix | 1 + packages/volto/src/config/Views.jsx | 10 ++++++++++ packages/volto/src/config/Widgets.jsx | 5 +++++ packages/volto/src/config/index.js | 25 ++++++------------------- 4 files changed, 22 insertions(+), 19 deletions(-) create mode 100644 packages/volto/news/6526.bugfix diff --git a/packages/volto/news/6526.bugfix b/packages/volto/news/6526.bugfix new file mode 100644 index 0000000000..0a6496a9d9 --- /dev/null +++ b/packages/volto/news/6526.bugfix @@ -0,0 +1 @@ +Fixed circular import error in dev with HMR in core Views and Widgets shadow customizations. @sneridagh diff --git a/packages/volto/src/config/Views.jsx b/packages/volto/src/config/Views.jsx index bb60818ece..e9aef779dc 100644 --- a/packages/volto/src/config/Views.jsx +++ b/packages/volto/src/config/Views.jsx @@ -138,3 +138,13 @@ export const layoutViewsNamesMapping = { view: 'Default view', default: 'Default view', }; + +export function installDefaultViews(config) { + config.views.layoutViews = layoutViews; + config.views.contentTypesViews = contentTypesViews; + config.views.defaultView = defaultView; + config.views.errorViews = errorViews; + config.views.layoutViewsNamesMapping = layoutViewsNamesMapping; + + return config; +} diff --git a/packages/volto/src/config/Widgets.jsx b/packages/volto/src/config/Widgets.jsx index 07f2a72c57..e4be7ea248 100644 --- a/packages/volto/src/config/Widgets.jsx +++ b/packages/volto/src/config/Widgets.jsx @@ -151,3 +151,8 @@ export const widgetMapping = { // Default Widget export const defaultWidget = TextWidget; + +export function installDefaultWidgets(config) { + config.widgets = widgetMapping; + config.widgets.default = defaultWidget; +} diff --git a/packages/volto/src/config/index.js b/packages/volto/src/config/index.js index cf912fbaf0..48ab6e0159 100644 --- a/packages/volto/src/config/index.js +++ b/packages/volto/src/config/index.js @@ -1,13 +1,5 @@ import ConfigRegistry from '@plone/volto/registry'; import { parse as parseUrl } from 'url'; -import { defaultWidget, widgetMapping } from './Widgets'; -import { - layoutViews, - contentTypesViews, - defaultView, - errorViews, - layoutViewsNamesMapping, -} from './Views'; import { nonContentRoutes } from './NonContentRoutes'; import { nonContentRoutesPublic } from './NonContentRoutesPublic'; import { loadables } from './Loadables'; @@ -26,6 +18,8 @@ import { import applyAddonConfiguration, { addonsInfo } from 'load-volto-addons'; import { installDefaultComponents } from './Components'; +import { installDefaultWidgets } from './Widgets'; +import { installDefaultViews } from './Views'; import { installDefaultBlocks } from './Blocks'; import { getSiteAsyncPropExtender } from '@plone/volto/helpers/Site'; @@ -189,17 +183,8 @@ let config = { enabled: true, }, }, - widgets: { - ...widgetMapping, - default: defaultWidget, - }, - views: { - layoutViews, - contentTypesViews, - defaultView, - errorViews, - layoutViewsNamesMapping, - }, + widgets: {}, + views: {}, blocks: {}, addonRoutes: [], addonReducers: {}, @@ -249,6 +234,8 @@ Object.entries(slots).forEach(([slotName, components]) => { registerValidators(ConfigRegistry); installDefaultComponents(ConfigRegistry); +installDefaultWidgets(ConfigRegistry); +installDefaultViews(ConfigRegistry); installDefaultBlocks(ConfigRegistry); applyAddonConfiguration(ConfigRegistry); From 0987c96dbc4597b8ab36009af4e4bfa125f123ec Mon Sep 17 00:00:00 2001 From: Victor Fernandez de Alba Date: Mon, 9 Dec 2024 17:38:40 +0100 Subject: [PATCH 10/11] Release 18.2.3 --- docs/source/release-notes/index.md | 6 ++++++ packages/volto/CHANGELOG.md | 6 ++++++ packages/volto/news/6526.bugfix | 1 - packages/volto/package.json | 2 +- 4 files changed, 13 insertions(+), 2 deletions(-) delete mode 100644 packages/volto/news/6526.bugfix diff --git a/docs/source/release-notes/index.md b/docs/source/release-notes/index.md index a649b27ca9..e5524fc087 100644 --- a/docs/source/release-notes/index.md +++ b/docs/source/release-notes/index.md @@ -17,6 +17,12 @@ myst: +## 18.2.3 (2024-12-09) + +### Bugfix + +- Fixed circular import error in dev with HMR in core Views and Widgets shadow customizations. @sneridagh [#6526](https://github.com/plone/volto/issues/6526) + ## 18.2.2 (2024-12-09) ### Bugfix diff --git a/packages/volto/CHANGELOG.md b/packages/volto/CHANGELOG.md index a649b27ca9..e5524fc087 100644 --- a/packages/volto/CHANGELOG.md +++ b/packages/volto/CHANGELOG.md @@ -17,6 +17,12 @@ myst: +## 18.2.3 (2024-12-09) + +### Bugfix + +- Fixed circular import error in dev with HMR in core Views and Widgets shadow customizations. @sneridagh [#6526](https://github.com/plone/volto/issues/6526) + ## 18.2.2 (2024-12-09) ### Bugfix diff --git a/packages/volto/news/6526.bugfix b/packages/volto/news/6526.bugfix deleted file mode 100644 index 0a6496a9d9..0000000000 --- a/packages/volto/news/6526.bugfix +++ /dev/null @@ -1 +0,0 @@ -Fixed circular import error in dev with HMR in core Views and Widgets shadow customizations. @sneridagh diff --git a/packages/volto/package.json b/packages/volto/package.json index 5743c22e11..afe541524b 100644 --- a/packages/volto/package.json +++ b/packages/volto/package.json @@ -9,7 +9,7 @@ } ], "license": "MIT", - "version": "18.2.2", + "version": "18.2.3", "repository": { "type": "git", "url": "git@github.com:plone/volto.git" From 08893abb609dc8e11efb3f960f86437eefadec1f Mon Sep 17 00:00:00 2001 From: Faakhir Zahid <110815427+Faakhir30@users.noreply.github.com> Date: Tue, 10 Dec 2024 22:40:33 +0500 Subject: [PATCH 11/11] update: skip scroll to top on inital SSR completion. (#6523) Signed-off-by: Faakhir30 --- packages/volto/news/6523.bugfix | 1 + packages/volto/src/helpers/ScrollToTop/ScrollToTop.jsx | 1 + 2 files changed, 2 insertions(+) create mode 100644 packages/volto/news/6523.bugfix diff --git a/packages/volto/news/6523.bugfix b/packages/volto/news/6523.bugfix new file mode 100644 index 0000000000..81d4a50ae7 --- /dev/null +++ b/packages/volto/news/6523.bugfix @@ -0,0 +1 @@ +Disable initial scroll to top after SSR completion. @Faakhir30 diff --git a/packages/volto/src/helpers/ScrollToTop/ScrollToTop.jsx b/packages/volto/src/helpers/ScrollToTop/ScrollToTop.jsx index 8122fbea63..1da8f505e1 100644 --- a/packages/volto/src/helpers/ScrollToTop/ScrollToTop.jsx +++ b/packages/volto/src/helpers/ScrollToTop/ScrollToTop.jsx @@ -37,6 +37,7 @@ class ScrollToTop extends React.Component { const isHash = location?.hash || location?.pathname.hash; if ( !isHash && + prevProps.location !== undefined && noInitialBlocksFocus && location?.pathname !== prevProps.location?.pathname ) {